@synnaxlabs/pluto 0.44.1 → 0.44.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/{Animated-KCUNFDvN.js → Animated-D5cL3URg.js} +1 -1
  2. package/dist/{Animated-3QNTHym1.cjs → Animated-DnsZ5vvU.cjs} +1 -1
  3. package/dist/{Menu-BFD8DPDp.js → Menu-C-MABQ1r.js} +1 -1
  4. package/dist/{Menu-BPH8apK8.cjs → Menu-vR5-lqo4.cjs} +1 -1
  5. package/dist/{Toggle-BHiPL61M.cjs → Toggle-Ckdi4fKV.cjs} +1 -1
  6. package/dist/{Toggle-1E6vrl6G.js → Toggle-Dol9oHzM.js} +1 -1
  7. package/dist/button.cjs +1 -1
  8. package/dist/button.js +1 -1
  9. package/dist/color.cjs +1 -1
  10. package/dist/color.js +1 -1
  11. package/dist/dialog.cjs +1 -1
  12. package/dist/dialog.js +1 -1
  13. package/dist/ether.cjs +1 -1
  14. package/dist/ether.js +2 -2
  15. package/dist/{external-BmaCxlPM.js → external-B5RyMtMy.js} +2 -2
  16. package/dist/{external-B1mnn7_J.js → external-B8qSW3N8.js} +1 -1
  17. package/dist/{external-CKvxjJs5.cjs → external-BGCkpetp.cjs} +1 -1
  18. package/dist/{external-DRcsXa_0.cjs → external-BJ91nMtQ.cjs} +1 -1
  19. package/dist/{external-B16icDUE.js → external-BYJw6DJV.js} +1 -1
  20. package/dist/{external-DTzGaj9d.js → external-B_NFroo8.js} +2 -2
  21. package/dist/{external-BzGhOwHW.js → external-CJZTgfAH.js} +2 -2
  22. package/dist/{external-Bx2weRCW.cjs → external-CS6l_QN4.cjs} +1 -1
  23. package/dist/{external-k23HUvy8.js → external-CU_XHLqP.js} +141 -141
  24. package/dist/{external-DWSWz3Rk.js → external-CVNscTLA.js} +2 -2
  25. package/dist/{external-Bmv3JTk3.cjs → external-CY2bvy20.cjs} +1 -1
  26. package/dist/{external-lMAel8Te.cjs → external-CkvXTCCL.cjs} +1 -1
  27. package/dist/{external-CtwEvFYE.cjs → external-ClD4VLgc.cjs} +1 -1
  28. package/dist/external-CtooTI5M.cjs +1 -0
  29. package/dist/{external-DIRuVzOZ.cjs → external-DFsKdN71.cjs} +1 -1
  30. package/dist/{external-DF7sP0pe.cjs → external-DNHOS3w0.cjs} +1 -1
  31. package/dist/{external-DPN-ziJs.js → external-DOd9BcLC.js} +1 -1
  32. package/dist/{external-BDFD5v83.cjs → external-DPqPAgoV.cjs} +1 -1
  33. package/dist/{external-T7fQRFNS.cjs → external-DXY1bIut.cjs} +1 -1
  34. package/dist/{external-Dr5azzr8.cjs → external-DZqxSCvz.cjs} +1 -1
  35. package/dist/{external-R1cRWCTB.js → external-DnnHYQqD.js} +1 -1
  36. package/dist/{external-DIE22vag.js → external-Ylv9Wts9.js} +2 -2
  37. package/dist/{external-DJ4pzZBh.cjs → external-_eEnQPcq.cjs} +1 -1
  38. package/dist/{external-BgZRkFq4.js → external-b2X_jilF.js} +2 -2
  39. package/dist/{external-Bx2Al5fy.js → external-pm79tCDD.js} +1 -1
  40. package/dist/{external-5PfK-PF3.js → external-xfHaehZH.js} +1 -1
  41. package/dist/flex.cjs +1 -1
  42. package/dist/flex.js +1 -1
  43. package/dist/header.cjs +1 -1
  44. package/dist/header.js +1 -1
  45. package/dist/index.cjs +7 -7
  46. package/dist/index.js +4630 -4595
  47. package/dist/input.cjs +1 -1
  48. package/dist/input.js +1 -1
  49. package/dist/list.cjs +1 -1
  50. package/dist/list.js +1 -1
  51. package/dist/menu.cjs +1 -1
  52. package/dist/menu.js +1 -1
  53. package/dist/{provider-BhLG7kqF.js → provider-Bp-CLkh2.js} +1734 -1624
  54. package/dist/provider-DBSsDoFS.cjs +53 -0
  55. package/dist/src/channel/LinePlot.d.ts +2 -0
  56. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  57. package/dist/src/icon/registry.d.ts +1 -0
  58. package/dist/src/icon/registry.d.ts.map +1 -1
  59. package/dist/src/input/Text.d.ts +3 -2
  60. package/dist/src/input/Text.d.ts.map +1 -1
  61. package/dist/src/telem/aether/transformers.d.ts +28 -2
  62. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  63. package/dist/src/vis/diagram/Diagram.d.ts +6 -0
  64. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  65. package/dist/src/vis/line/aether/line.d.ts +9 -2
  66. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  67. package/dist/{symbols-DzAWrATO.cjs → symbols-B15FeAg9.cjs} +42 -42
  68. package/dist/{symbols-5jPiWw_d.js → symbols-Lz5vQQDw.js} +5777 -5762
  69. package/dist/tabs.cjs +1 -1
  70. package/dist/tabs.js +1 -1
  71. package/dist/text.cjs +1 -1
  72. package/dist/text.js +2 -2
  73. package/dist/theming.cjs +1 -1
  74. package/dist/theming.js +2 -2
  75. package/dist/tree.cjs +1 -1
  76. package/dist/tree.js +1 -1
  77. package/dist/triggers.cjs +1 -1
  78. package/dist/triggers.js +1 -1
  79. package/package.json +5 -5
  80. package/dist/external-DMB49R_H.cjs +0 -1
  81. package/dist/provider-DVZt686Q.cjs +0 -53
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./symbols-DzAWrATO.cjs"),o=require("./jsx-runtime-CITbqOLs.cjs"),g=require("react"),u=require("./css-9yccD6t_.cjs"),M=require("./eraser-CLWNvWDn.cjs"),Lh=require("./external-DMB49R_H.cjs"),zl=require("./Animated-3QNTHym1.cjs"),_=require("./provider-DVZt686Q.cjs"),$l=require("react-dom"),Je=require("./external-DIRuVzOZ.cjs"),Vl=require("./external-T7fQRFNS.cjs"),Te=require("./external-Bmv3JTk3.cjs"),se=require("zod"),Pe=require("./external-DRcsXa_0.cjs"),ws=require("./external-Dr5azzr8.cjs"),Fl=require("./external-CtwEvFYE.cjs"),Zl=require("./Menu-BPH8apK8.cjs"),fe=require("./external-CKvxjJs5.cjs"),Kl=require("./units-BGkvnLO-.cjs"),Ph=require("./external-DJ4pzZBh.cjs"),Th=require("./external-DF7sP0pe.cjs"),Me=require("./external-Bx2weRCW.cjs"),Ah=require("./external-BDFD5v83.cjs"),Ih=require("./external-lMAel8Te.cjs"),Oh=require("./Video-BidrtYj_.cjs"),Yl=require("./Toggle-BHiPL61M.cjs"),Bh=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),Dh=e=>se.array(e).or(e.transform(t=>[t])),Wl=e=>M.f(e,(t,n,s)=>{const r=n===s.length-1,i=!isNaN(parseInt(t)),l=!isNaN(parseInt(s[n+1]));return i&&(t="element"),r||l?t:[t,"shape"]}),hi=(e,t)=>{if(e==null)return null;const n=e[t];return n==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:n},Hh=(e,t,n)=>M.c(hi(e,"shape"),Wl(t),{...n,getter:hi}),zh=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:Hh,getFieldSchemaPath:Wl,nullToUndefined:Bh,toArray:Dh},Symbol.toStringTag,{value:"Module"})),Gl=Symbol(),Uo=Symbol(),cn="a",es="w";let $h=(e,t)=>new Proxy(e,t);const Ro=Object.getPrototypeOf,gi=new WeakMap,qo=e=>e&&(gi.has(e)?gi.get(e):Ro(e)===Object.prototype||Ro(e)===Array.prototype),ji=e=>typeof e=="object"&&e!==null,Ei=new WeakMap,Ul=e=>e[Uo]||e,ql=(e,t,n)=>{if(!qo(e))return e;const s=Ul(e),r=(l=>Object.isFrozen(l)||Object.values(Object.getOwnPropertyDescriptors(l)).some(a=>!a.writable))(s);let i=n&&n.get(s);return i&&i[1].f===r||(i=((l,a)=>{const c={f:a};let d=!1;const x=(m,h)=>{if(!d){let j=c[cn].get(l);if(j||(j={},c[cn].set(l,j)),m===es)j[es]=!0;else{let E=j[m];E||(E=new Set,j[m]=E),E.add(h)}}},p={get:(m,h)=>h===Uo?l:(x("k",h),ql(Reflect.get(m,h),c[cn],c.c)),has:(m,h)=>h===Gl?(d=!0,c[cn].delete(l),!0):(x("h",h),Reflect.has(m,h)),getOwnPropertyDescriptor:(m,h)=>(x("o",h),Reflect.getOwnPropertyDescriptor(m,h)),ownKeys:m=>(x(es),Reflect.ownKeys(m))};return a&&(p.set=p.deleteProperty=()=>!1),[p,c]})(s,r),i[1].p=$h(r?(l=>{let a=Ei.get(l);if(!a){if(Array.isArray(l))a=Array.from(l);else{const c=Object.getOwnPropertyDescriptors(l);Object.values(c).forEach(d=>{d.configurable=!0}),a=Object.create(Ro(l),c)}Ei.set(l,a)}return a})(s):s,i[0]),n&&n.set(s,i)),i[1][cn]=t,i[1].c=n,i[1].p},Xl=(e,t,n,s)=>{if(Object.is(e,t))return!1;if(!ji(e)||!ji(t))return!0;const r=n.get(Ul(e));if(!r)return!0;if(s){const l=s.get(e);if(l&&l.n===t)return l.g;s.set(e,{n:t,g:!1})}let i=null;try{for(const l of r.h||[])if(i=Reflect.has(e,l)!==Reflect.has(t,l),i)return i;if(r[es]===!0){if(i=((l,a)=>{const c=Reflect.ownKeys(l),d=Reflect.ownKeys(a);return c.length!==d.length||c.some((x,p)=>x!==d[p])})(e,t),i)return i}else for(const l of r.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,l)!=!!Reflect.getOwnPropertyDescriptor(t,l),i)return i;for(const l of r.k||[])if(i=Xl(e[l],t[l],n,s),i)return i;return i===null&&(i=!0),i}finally{s&&s.set(e,{n:t,g:i})}},Vh=e=>!!qo(e)&&Gl in e,Ql=e=>qo(e)&&e[Uo]||null,Fh="h",Zh="w",Kh="o",Yh="k",Co=e=>typeof e=="object"&&e!==null,Jl=(e,t)=>{if(!Co(e))return e;const n=Ql(e);return n!==null?(Vh(e),n):(t.has(e)||(t.add(e),Object.entries(e).forEach(([s,r])=>{const i=Jl(r,t);Object.is(i,r)||(e[s]=i)})),e)},wo=(e,t,n)=>{var s,r,i;if(!Co(e)||!Co(t))return;const l=n.get(Ql(t)||t);l&&((s=l[Fh])==null||s.forEach(a=>{Reflect.has(e,a)}),l[Zh]===!0&&Reflect.ownKeys(e),(r=l[Kh])==null||r.forEach(a=>{Reflect.getOwnPropertyDescriptor(e,a)}),(i=l[Yh])==null||i.forEach(a=>{wo(e[a],t[a],n)}))},Js="o",eo="r",to="a";function Wh(e,t){var n;let s=0;const r=(n=t?.size)!=null?n:1,i=[],l=t!=null&&t.noWeakMap?null:new WeakMap;return c=>{const d=l?.get(c);if(d)return d[eo];for(let j=0;j<r;j+=1){const E=i[(s+j)%r];if(!E)break;if(!Xl(E[Js],c,E[to],new WeakMap))return wo(c,E[Js],E[to]),l?.set(c,E),E[eo]}const x=new WeakMap,p=ql(c,x),m=Jl(e(p),new Set);wo(c,c,x);const h={[Js]:c,[eo]:m,[to]:x};return s=(s-1+r)%r,i[s]=h,l?.set(c,h),m}}const Gh=(e,t)=>u.S.RUNTIME==="browser"?Wh(e,t):e,We=(e,t)=>{g.useEffect(()=>{const n=new AbortController,s=n.signal,i=(async()=>(await u.ur(),await e(s)))().catch(console.error);return()=>{n.abort(),i.then(l=>l?.()).catch(console.error)}},t)},Uh=(e,t,n=150)=>{const[s,r]=g.useState(e);return g.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},qh=({transforms:e=[]})=>{const[t,n]=g.useState(e),s=g.useCallback((l,a,c=0)=>n(d=>{const x=d.filter(p=>p.key!==l);return x.push({key:l,transform:a,priority:c}),x.sort((p,m)=>m.priority-p.priority),x}),[n]),r=g.useCallback(l=>n(a=>a.filter(c=>c.key!==l)),[s]);return{transform:g.useCallback(l=>t.reduce((a,c)=>c.transform(a),{...l,transformed:!1}),[t]),setTransform:s,deleteTransform:r}},Xh=Object.freeze(Object.defineProperty({__proto__:null,Access:f.Access,Acquire:f.Acquire,Add:f.Add,Align:f.Align,Analyze:f.Analyze,Annotate:f.Annotate,Array:f.Array,Arrow:f.Arrow,Attachment:f.Attachment,Auto:f.Auto,AutoFitWidth:f.AutoFitWidth,Binary:f.Binary,Bolt:f.Bolt,Box:f.Box$1,Bridge:f.Bridge,Calculation:f.Calculation,Calendar:f.Calendar$1,Caret:f.Caret,Channel:f.Channel,Check:f.Check,Circle:f.Circle,Close:f.Close,Cluster:f.Cluster,Commit:f.Commit,Concepts:f.Concepts,Connect:f.Connect,Constant:f.Constant,Control:f.Control,Copy:f.Copy,Decimal:f.Decimal,Delete:f.Delete,Details:f.Details,Device:f.Device,Disable:f.Disable,Disconnect:f.Disconnect,Download:f.Download,Downsample:f.Downsample,Drag:f.Drag,Dynamic:f.Dynamic,Edit:f.Edit,EditOff:f.EditOff,Enable:f.Enable,Expand:f.Expand,Explore:f.Explore,Export:f.Export,Feedback:f.Feedback,Filter:f.Filter,Focus:f.Focus,Function:f.Function,Group:f.Group,Guide:f.Guide,Hardware:f.Hardware,Heart:f.Heart,Hidden:f.Hidden,Import:f.Import,Index:f.Index,Info:f.Info,JSON:f.JSON,Keyboard:f.Keyboard,Label:f.Label,LinePlot:f.LinePlot,Linear:f.Linear,Link:f.Link,LinkExternal:f.LinkExternal,Loading:f.Loading,Log:f.Log,Logo:f.Logo,Map:f.Map,Menu:f.Menu,MoveToMainWindow:f.MoveToMainWindow,NPM:f.NPM,Node:f.Node,None:f.None,OpenExternal:f.OpenExternal,OpenInNewWindow:f.OpenInNewWindow,PNPM:f.PNPM,Pan:f.Pan,Pause:f.Pause,Play:f.Play,Python:f.Python,QuestionMark:f.QuestionMark,Rack:f.Rack,Range:f.Range,Reference:f.Reference,Refresh:f.Refresh,Release:f.Release,Rename:f.Rename,Resources:f.Resources,Rotate:f.Rotate,Rule:f.Rule,Save:f.Save,Schematic:f.Schematic,Search:f.Search,Selection:f.Selection,Settings:f.Settings,Snapshot:f.Snapshot,Snooze:f.Snooze,Sound:f.Sound,SplitX:f.SplitX,SplitY:f.SplitY,StarFilled:f.StarFilled,StarOutlined:f.StarOutlined,String:f.String,StrokeWidth:f.StrokeWidth,Subtract:f.Subtract,Sync:f.Sync,Table:f.Table,Tare:f.Tare,Task:f.Task,Text:f.Text$3,TextAlign:f.TextAlign,Time:f.Time$1,Tooltip:f.Tooltip,Type:f.Type,TypeScript:f.TypeScript,Units:f.Units,User:f.User,Value:f.Value,Variable:f.Variable,Virtual:f.Virtual,Visible:f.Visible,Visualize:f.Visualize,Warning:f.Warning,Wave:f.Wave,Workspace:f.Workspace,Yarn:f.Yarn,Zoom:f.Zoom,createComposite:f.createComposite,resolve:f.resolve,wrapSVGIcon:f.wrapSVGIcon},Symbol.toStringTag,{value:"Module"})),Qh=Object.freeze(Object.defineProperty({__proto__:null,Config:f.Config,Dialog:f.Dialog$1,chooseLocation:f.chooseLocation,formatTip:f.formatTip,useConfig:f.useConfig,wrap:f.wrap},Symbol.toStringTag,{value:"Module"})),Xo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:a="px",showHandle:c=!0,...d})=>{const x=u.K$1.construct(t),p=u.K$1.direction(x),m=u.g.dimension(p);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),r),style:{[m]:`${s}${a}`,...n},ref:e,direction:p,empty:!0,...d,children:[i,c&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:u.CSS(u.CSS.BE("resize","handle"),u.CSS.bordered(u.K$1.swap(x))),onDragStart:l,onDrag:f.preventDefault,onDragEnd:f.preventDefault})]})},ea=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=g.useRef(null),[l,a]=g.useState({sizeDistribution:Jh(n,t),root:null}),c=g.useCallback((p,m,h)=>{if(i.current==null)return;const j=u.Ho.dim(u.Ho.construct(i.current),r);a(E=>so(E,j,p,s,m,h))},[s,a,r]);g.useEffect(()=>e?.(l.sizeDistribution),[l.sizeDistribution,e]);const d=g.useCallback((p,m)=>{p.preventDefault();const h=r==="x"?"clientX":"clientY",j=S=>c(m,S[h]),E=()=>{a(S=>({...S,root:null})),document.removeEventListener("mousemove",j)};a(S=>({...S,root:p[h]})),document.addEventListener("mousemove",j),document.addEventListener("mouseup",E,{once:!0})},[a,r,so]);return{setSize:g.useCallback((p,m)=>c(p,void 0,m),[so]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},ta=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const a=u.g.construct(t),c=g.Children.toArray(n);return s=eg(s),o.jsxRuntimeExports.jsx(f.Box,{...l,ref:e,direction:a,className:u.CSS(u.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:c.map((d,x)=>o.jsxRuntimeExports.jsx(Xo,{onDragStart:p=>r(p,x),location:u.g.location(a),size:s[x]*100,sizeUnits:"%",showHandle:x!==c.length-1,children:d},x))})},Jh=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},no=.001,eg=e=>e.every(t=>u.nr.closeTo(t,1/e.length),no)?e.map((t,n)=>n%2===0?t+no:n===e.length-1?t:t-no):e,so=(e,t,n,s,r,i)=>{const l=na(e,t,n,r,i),[a,c]=tg(e.sizeDistribution,n,l,s/t),d=c?r??null:e.root;return{...e,sizeDistribution:a,root:d}},na=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},tg=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=ng(r,e,s,n),a=e[l]-n;return i<s||a<s?[e,!1]:[e.map((c,d)=>d===r?i:d===l?a:c),!0]},ng=(e,t,n,s)=>(e===t.length-1?og:sg)(e,t,n,s),sg=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},og=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},oo=2,rg=100,sa=({onCollapse:e,onResize:t,location:n="left",minSize:s,maxSize:r,initialSize:i=200,collapseThreshold:l=1/0,className:a,...c})=>{const[d,x]=g.useState(u.R(i,s,r)),p=g.useRef(null),m=u.K$1.construct(n),h=g.useCallback(y=>{if(p.current===null)return 0;const C=u.Ho.dim(y,u.K$1.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),N=p.current+C,k=u.R(N,s,r);return(k-N)/(s??rg)>l?oo:k},[m,s,r,l]),j=g.useRef(null),E=g.useCallback(y=>{const C=h(y);x(C),j.current!=null&&t?.(C,u.Ho.construct(j.current))},[t,h]),S=g.useCallback(()=>x(y=>(p.current=y,y)),[x]),R=g.useCallback(y=>h(y)===oo&&e?.(),[e,h]);g.useEffect(()=>{s==null||r==null||x(y=>{const C=u.R(y,s,r);return p.current=C,C})},[s,r]);const v=Pe.useCursorDrag({onMove:E,onStart:S,onEnd:R});return o.jsxRuntimeExports.jsx(Xo,{ref:j,location:m,size:d,onDragStart:v,className:u.clsx(a,u.CSS.expanded(d!==oo)),...c})},ig=Object.freeze(Object.defineProperty({__proto__:null,Core:Xo,Multiple:ta,Single:sa,calculateDiffPercentage:na,useMultiple:ea},Symbol.toStringTag,{value:"Module"})),Qo=({aetherKey:e,enabled:t=!0})=>{const{setState:n}=f.useLifecycle({aetherKey:e,type:M.Eraser.TYPE,schema:M.eraserStateZ,initialState:{region:u.Ho.ZERO,enabled:t}}),s=f.useSyncedRef(t);return{erase:g.useCallback(i=>{n({enabled:s.current,region:i})},[n,s])}},lg=({aetherKey:e,children:t})=>{const{erase:n}=Qo({aetherKey:e}),s=f.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},ag=Object.freeze(Object.defineProperty({__proto__:null,Eraser:lg,use:Qo},Symbol.toStringTag,{value:"Module"})),cg=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},ug=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,onCollapse:a,eraseEnabled:c,...d})=>{const x=u.K$1.direction(s);c??=e!=null;const p=g.useCallback(()=>{a?a():e!=null&&n?.(e.key)},[n,e?.key,a]),{erase:m}=Qo({enabled:c}),h=g.useCallback((v,y)=>{l?.(v,y),m(y)},[l,m]),{content:j,minSize:E,maxSize:S,initialSize:R=0}=e??{};return o.jsxRuntimeExports.jsx(sa,{className:u.CSS(u.CSS.B("nav-drawer"),u.CSS.dir(x),u.CSS.visible(e!=null),i),collapseThreshold:r,onCollapse:p,location:s,onResize:h,minSize:E,maxSize:S,initialSize:R,...d,children:j})},dg=Object.freeze(Object.defineProperty({__proto__:null,Bar:f.Bar,Drawer:ug,useDrawer:cg},Symbol.toStringTag,{value:"Module"})),Jo={info:"var(--pluto-text-color)",error:"var(--pluto-error-z)",warning:"var(--pluto-warning-m1)",success:"var(--pluto-primary-z)",loading:"var(--pluto-text-color)",disabled:"var(--pluto-gray-l8)"},er=({variant:e,...t})=>e==="loading"?o.jsxRuntimeExports.jsx(f.Loading,{...t}):o.jsxRuntimeExports.jsx(f.Circle,{color:e!=null?Jo[e]:void 0,...t}),xg=({action:e})=>g.isValidElement(e)?e:g.createElement(f.Button,{...e,key:e.key,size:"tiny"}),pg=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:a,className:c,children:d,...x})=>{const p=g.useRef(null);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("notification"),c),y:!0,empty:!0,ref:p,...x,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,justify:"between",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(er,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:`x${n}`}),o.jsxRuntimeExports.jsx(f.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"start",className:u.CSS(u.CSS.BE("notification","content")),gap:"small",children:[d??o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","message")),style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),a!=null&&o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:M.t.toArray(a).map(m=>o.jsxRuntimeExports.jsx(xg,{action:m},m.key))})]},t.toString())},mg=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:f.Aggregator,Indicator:er,Notification:pg,Summary:f.Summary,VARIANT_COLORS:Jo,useAdder:f.useAdder,useErrorHandler:f.useErrorHandler,useNotifications:f.useNotifications},Symbol.toStringTag,{value:"Module"})),oa=e=>e==="preview"?"connected":e,ra=e=>e==="preview"?"preview":void 0,bs=({resourceName:e,value:t,onChange:n,data:s,getItem:r,subscribe:i,haulType:l,icon:a,disabled:c,onSearch:d,emptyContent:x,status:p,onFetchMore:m,children:h,renderTag:j,actions:E,allowNone:S,replaceOnSingle:R,triggerProps:v,virtual:y=!0,dialogProps:C,variant:N="connected",...k})=>o.jsxRuntimeExports.jsx(f.Frame,{variant:oa(N),...k,children:o.jsxRuntimeExports.jsxs(f.Frame$1,{multiple:!0,value:t,onChange:n,data:s,getItem:r,subscribe:i,onFetchMore:m,allowNone:S,replaceOnSingle:R,virtual:y,children:[o.jsxRuntimeExports.jsx(la,{haulType:l,icon:a,placeholder:`Select ${e}s`,disabled:c,variant:ra(N),...v,children:j}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:d,emptyContent:x,status:p,actions:E,resourceName:e,...C,children:h})]})}),Ge=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},ia=e=>o.jsxRuntimeExports.jsxs(fe.Buttons,{...e,keys:M.SIZES,children:[o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"tiny",children:"L"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"small",children:"M"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"medium",children:"L"})]}),fg=Object.freeze(Object.defineProperty({__proto__:null,SIZES:M.SIZES,SelectSize:ia,isRenderProp:f.isRenderProp,isSize:M.isSize,removeProps:Ge,renderProp:f.renderProp,size:M.size},Symbol.toStringTag,{value:"Module"})),vs=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...a})=>{const c=u.ir.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(f.Circle,{color:c}));const d=r==null?void 0:o.jsxRuntimeExports.jsx(f.Button,{"aria-label":"close",size:t==="tiny"?"small":t,variant:"text",className:u.CSS.BE("tag","close"),sharp:!0,onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(f.Close,{})});return o.jsxRuntimeExports.jsxs(f.Button,{el:"div",className:u.CSS(i,u.CSS.B("tag"),r!=null&&u.CSS.BM("tag","closeable")),size:t,overflow:"nowrap",align:"center",gap:"small",onDragStart:l,...a,children:[s,d,e]})},tr=({children:e,onClick:t,variant:n="outlined",size:s="medium",...r})=>o.jsxRuntimeExports.jsx(f.Button,{el:"div",variant:n,size:s,x:!0,onClick:t,align:"center",gap:"small",style:{padding:"0rem 0.5rem",paddingRight:"2rem"},rounded:!0,...r,children:e}),hg=Object.freeze(Object.defineProperty({__proto__:null,Tag:vs,Tags:tr},Symbol.toStringTag,{value:"Module"})),gg=({itemKey:e,icon:t,onDragStart:n})=>{const s=f.useItem(e),{onSelect:r}=f.useItemState(e);return o.jsxRuntimeExports.jsx(vs,{onClose:r,onDragStart:()=>n(e),draggable:!0,size:"small",status:s==null?"error":void 0,icon:s?.icon??t,children:s?.name??e})},jg=f.renderProp(gg),nr=({items:e},t,n,s)=>{if(t===""||s===!0)return!1;const r=f.filterByType(t,e);return r.length>0&&!r.every(i=>n.includes(i.key))},la=({haulType:e="",disabled:t,placeholder:n="Select...",variant:s="outlined",icon:r,children:i=jg})=>{const l=f.useSelection(),a=f.useSyncedRef(l),{setSelected:c}=f.useContext$2(),{toggle:d,visible:x}=f.useContext$1(),p=g.useCallback(v=>nr(v,e,M.t.toArray(l),t),[e,l,t]),{startDrag:m,...h}=f.useDragAndDrop({type:e,canDrop:p,onDrop:f.useFilterByTypeCallback(e,({items:v})=>{const y=M.t.toArray(a.current);return c(u.c.unique([...M.t.toArray(y),...v.map(C=>C.key)])),v},[c])}),j=g.useCallback(({dropped:v})=>{const y=l.filter(C=>!v.some(N=>N.key===C));c(y)},[c,l]),E=g.useCallback(v=>{m([{key:v,type:e}],j)},[m,j,e]),S=f.useDraggingState(),R=s==="text"&&l.length!==0;return o.jsxRuntimeExports.jsxs(tr,{full:"x",onClick:()=>{R||d()},...h,className:u.CSS(u.CSS.dropRegion(p(S)),u.CSS.BE("dialog","trigger"),u.CSS.BM("variant",s)),variant:s,preventClick:R,grow:!0,children:[l.length===0&&o.jsxRuntimeExports.jsxs(f.Text,{color:8,weight:400,style:{padding:"0 1rem"},children:[r,n]}),l.map(v=>i({key:v,itemKey:v,onDragStart:E,icon:r})),s!=="text"&&o.jsxRuntimeExports.jsx(zl.Animated,{className:u.CSS.level("p"),enabled:x,enabledLoc:"bottom",disabledLoc:"left",color:8}),R&&o.jsxRuntimeExports.jsx(f.Button,{variant:s,onClick:v=>{v.stopPropagation(),d()},children:o.jsxRuntimeExports.jsx(f.Add,{color:8})})]})},It=({resourceName:e,onChange:t,value:n,allowNone:s,emptyContent:r,haulType:i,data:l,getItem:a,subscribe:c,itemHeight:d,onFetchMore:x,disabled:p,onSearch:m,status:h,icon:j,children:E,variant:S="connected",actions:R,dialogProps:v,triggerProps:y,virtual:C=!0,closeDialogOnSelect:N=!0,...k})=>o.jsxRuntimeExports.jsx(f.Frame,{...k,variant:oa(S),children:o.jsxRuntimeExports.jsxs(f.Frame$1,{value:n,onChange:t,data:l,getItem:a,subscribe:c,allowNone:s,onFetchMore:x,itemHeight:d,virtual:C,closeDialogOnSelect:N,children:[o.jsxRuntimeExports.jsx(aa,{haulType:i,icon:j,placeholder:`Select a ${e}`,disabled:p,variant:ra(S),...y}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:m,resourceName:e,emptyContent:r,status:h,actions:R,...v,children:E})]})}),aa=({haulType:e="",placeholder:t,icon:n,disabled:s,iconOnly:r=!1,hideCaret:i=!1,...l})=>{const a=f.useSelection(),{setSelected:c}=f.useContext$2(),[d]=a,x=f.useItem(d),{name:p,icon:m}=x??{},h=g.useCallback(S=>nr(S,e,a,s),[e,a,s]),j=f.useDrop({type:e,canDrop:h,onDrop:f.useFilterByTypeCallback(e,({items:S})=>(S.length!==0&&c([S[0].key]),S),[c])}),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(Vl.Trigger,{variant:"outlined",gap:"small",className:u.CSS(u.CSS.dropRegion(h(E))),disabled:s,...j,...l,hideCaret:i||r,textColor:p==null?8:void 0,children:[m??n,!r&&(p??t)]})},Eg=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);if(n==null)return null;const{name:s,icon:r}=n;return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,children:[r,s]})}),Nn=({data:e,filter:t,children:n=Eg,virtual:s=!1,...r})=>{const{retrieve:i,...l}=f.useStaticData({data:e,filter:t}),{search:a}=Je.usePager({retrieve:i});return o.jsxRuntimeExports.jsx(It,{...r,...l,onSearch:a,virtual:s,children:n})},nn=e=>o.jsxRuntimeExports.jsxs(fe.Buttons,{...e,keys:M.LEVELS,children:[o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"h2",square:!0,children:"XL"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"h3",square:!0,children:"L"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"h4",square:!0,children:"M"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"h5",square:!0,children:"S"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"small",square:!0,children:"XS"})]}),yg=[250,400,500,600],ca=e=>o.jsxRuntimeExports.jsxs(fe.Buttons,{...e,keys:yg,children:[o.jsxRuntimeExports.jsx(fe.Button,{itemKey:250,children:"Light"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:400,children:"Normal"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:500,children:"Medium"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:600,children:"Bold"})]}),Sg=Object.freeze(Object.defineProperty({__proto__:null,Level:nn,Weight:ca},Symbol.toStringTag,{value:"Module"})),Rg=Object.freeze(Object.defineProperty({__proto__:null,Button:fe.Button,Buttons:fe.Buttons,Core:f.Core,Dialog:f.Dialog$2,Frame:f.Frame$1,ListItem:f.ListItem,Multiple:bs,MultipleTrigger:la,Single:It,SingleTrigger:aa,Static:Nn,Text:Sg,staticCanDrop:nr,useClear:f.useClear,useContext:f.useContext$2,useHover:f.useHover,useItemState:f.useItemState,useMultiple:f.useMultiple,useSelection:f.useSelection,useSingle:f.useSingle},Symbol.toStringTag,{value:"Module"})),Cg=()=>o.jsxRuntimeExports.jsx(f.Caret.Right,{className:u.CSS.BE("breadcrumb","separator")}),En=({children:e,...t})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS.BE("breadcrumb","segment"),...t,defaultEl:"span",children:e}),sr=({children:e,highlightVariant:t,...n})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.B("breadcrumb"),t!=null&&u.CSS.BM("breadcrumb","highlight",t)),x:!0,align:"center",gap:"small",...n,children:g.Children.map(e,(s,r)=>s==null||typeof s=="boolean"?null:o.jsxRuntimeExports.jsxs(g.Fragment,{children:[r>0&&o.jsxRuntimeExports.jsx(Cg,{}),typeof s=="string"?o.jsxRuntimeExports.jsx(En,{children:s}):s]},r))}),wg=(e,t)=>{const n=e.split("/");return n.map((s,r)=>t({href:n.slice(0,r+1).join("/"),segment:s,index:r}))},bg=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:sr,Segment:En,mapURLSegments:wg},Symbol.toStringTag,{value:"Module"})),or=g.createContext(null),rr=()=>f.useRequiredContext(or),vt=(e,t,n,s)=>({variant:"loading",status:u._r.create({variant:"loading",message:`${u.z.capitalize(t)} ${e}`}),data:n,listenersMounted:s}),qe=(e,t,n,s)=>({variant:"success",status:u._r.create({variant:"success",message:`${u.z.capitalize(t)} ${e}`}),data:n,listenersMounted:s}),lt=(e,t,n,s)=>({variant:"error",status:u._r.fromException(n,`Failed to ${t} ${e}`),data:null,listenersMounted:s}),_s=(e,t,n)=>lt(e,t,new M.wm(`Cannot ${t} ${e} because no cluster is connected.`),n),ua=()=>{const e=g.useRef({mountCalled:!1,destructor:()=>{}}),t=rr();return g.useEffect(()=>()=>e.current.destructor(),[]),g.useCallback(({listeners:n,onOpen:s})=>{if(n==null||n.length===0||e.current.mountCalled)return;e.current.mountCalled=!0;let r=0;const i=()=>{r++,r===n.length&&s?.()},l=n.map(({channel:a,handler:c})=>t({channel:a,handler:c,onOpen:i}));e.current.destructor=()=>l.forEach(a=>a())},[t])},hn={..._.ZERO_CONTEXT_VALUE,state:M.Xp.connectivity.DEFAULT},ir=g.createContext(hn),da=()=>g.use(ir),et=()=>da().client,vg=()=>da().state,bo={connected:"success",connecting:"loading",disconnected:"disabled",failed:"error"},xa="serverVersionMismatch",_g=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Ng=({children:e,client:t})=>{const{path:n}=f.useUnidirectional({type:_.Provider.TYPE,schema:_.Provider.stateZ,state:{props:null,state:null}});return o.jsxRuntimeExports.jsx(ir,{value:{...hn,client:t},children:o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})})},pa=({children:e,connParams:t})=>{const[n,s,r]=f.useCombinedStateAndRef(hn),{path:i}=f.useUnidirectional({type:_.Provider.TYPE,schema:_.Provider.stateZ,state:{props:t??null,state:null}}),l=f.useAdder(),a=g.useCallback(c=>{r.current.state.status!==c.status&&l({variant:bo[c.status],message:c.message??u.z.capitalize(c.status)}),s(d=>({...d,state:c}))},[l]);return We(async c=>{if(n.client!=null&&n.client.close(),t==null)return s(hn);const d=new M.Xp({...t,connectivityPollFrequency:M.O$1.seconds(2)});s({client:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(!c.aborted){if(s({client:d,state:x}),l({variant:bo[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||u.pr.semVerOlder(x.nodeVersion,x.clientVersion),m=_g(p,x.clientVersion,x.nodeVersion);l({variant:"warning",message:"Incompatible cluster version",description:m,details:{type:xa,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),()=>{d.close(),s(hn)}}},[t,a]),o.jsxRuntimeExports.jsx(ir,{value:n,children:o.jsxRuntimeExports.jsx(f.Composite,{path:i,children:e})})},Mg=Object.freeze(Object.defineProperty({__proto__:null,CONNECTION_STATE_VARIANTS:bo,Provider:pa,SERVER_VERSION_MISMATCH:xa,TestProvider:Ng,use:et,useConnectionState:vg},Symbol.toStringTag,{value:"Module"})),ma=e=>{const[t,n]=g.useState(vt(e.name,"retrieving",null,!1));return{...t,...fa({...e,onChange:n})}},fa=({retrieve:e,listeners:t=[],name:n,onChange:s})=>{const r=et(),i=g.useRef(null),l=f.useInitializerRef(()=>new _.Mutex),a=ua(),c=g.useCallback(async(x,p={})=>{const{signal:m}=p,h=M.executeSetter(x,i.current??{});i.current=h;try{if(r==null)return s(E=>_s(n,"retrieve",E.listenersMounted));s(E=>vt(n,"retrieving",E.data,E.listenersMounted));const j=await e({client:r,params:h});if(m?.aborted)return;a({onOpen:()=>s(E=>({...E,listenersMounted:!0})),listeners:t.map(E=>({channel:E.channel,handler:S=>void l.current.runExclusive(async()=>{if(!(r==null||i.current==null))try{await E.onChange({client:r,params:i.current,changed:S.get(E.channel),onChange:R=>{s(v=>{if(v.data==null)return v;const y=M.executeSetter(R,v.data);return qe(n,"retrieved",y,v.listenersMounted)})}})}catch(R){if(m?.aborted)return;s(v=>lt(n,"retrieve",R,v.listenersMounted))}})}))}),s(E=>qe(n,"retrieved",j,E.listenersMounted))}catch(j){if(m?.aborted)return;s(E=>lt(n,"retrieve",j,E.listenersMounted))}},[r,n,a]);return{retrieve:g.useCallback((x,p)=>void c(x,p),[c]),retrieveAsync:c}},kg=({params:e,...t})=>{const{retrieveAsync:n,retrieve:s,...r}=ma(t),i=f.useMemoDeepEqual(e);return We(async l=>await n(i,{signal:l}),[n,i]),r},Lg=({params:e,...t})=>{const{retrieveAsync:n}=fa(t),s=f.useMemoDeepEqual(e);We(async r=>await n(s,{signal:r}),[n,s])},ct=e=>({useDirect:t=>kg({...e,...t}),useStateful:()=>ma(e),useEffect:t=>Lg({...e,...t})}),ha=({onChange:e,params:t,update:n,name:s})=>{const r=et(),i=g.useCallback(async(a,c={})=>{const{signal:d}=c;try{if(r==null)return e(p=>_s(s,"update",p.listenersMounted)),!1;e(p=>vt(s,"updating",p.data,p.listenersMounted));let x=!1;return await n({client:r,onChange:p=>{x=!0,e(m=>qe(s,"updated",p,m.listenersMounted))},value:a,params:t}),d?.aborted===!0?!1:(x||e(p=>qe(s,"updated",a,p.listenersMounted)),!0)}catch(x){return d?.aborted!==!0&&e(p=>lt(s,"update",x,p.listenersMounted)),!1}},[s,t]);return{update:g.useCallback((a,c)=>void i(a,c),[i]),updateAsync:i}},Pg=({params:e,name:t,...n})=>{const[s,r]=g.useState(qe(t,"updated",null,!1)),i=ha({...n,name:t,onChange:r,params:e});return{...s,...i}},Ot=e=>({useObservable:t=>ha({...t,...e}),useDirect:t=>Pg({...t,...e})}),lr=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:()=>{},setCurrentStateAsInitialValues:()=>{}}),sn=e=>{const t=g.use(lr);return e??t},Et=(e,t={})=>{const{optional:n=!1,onChange:s,defaultValue:r}=t,i=sn(t?.ctx),{get:l,bind:a,set:c,setStatus:d}=i,x=g.useCallback(j=>{s?.(j,{...i,path:e}),c(e,j)},[e,c,s]),p=g.useCallback(j=>d(e,j),[e,d]),m=g.useSyncExternalStore(a,g.useCallback(()=>l(e,{optional:n,defaultValue:r}),[e,l,n,r]));if(m==null){if(!n)throw new Error(`Field state is null: ${e}`);return null}const h=i.mode==="preview"?"preview":void 0;return{onChange:x,setStatus:p,variant:h,...m}},ar=(e,t)=>{const{get:n,bind:s}=sn(t?.ctx);return g.useSyncExternalStore(s,g.useCallback(()=>n(e,t),[e,n,t]))},cr=(e,t)=>ar(e,t)?.value??null,Tg=e=>ar(e,{optional:!0})?.status?.variant==="success",ga=(e,t)=>({value:()=>e.get(t).value,add:(n,s)=>{const r=u.br(e.get(t).value);r.splice(s,0,...M.t.toArray(n)),e.set(t,r)},push:(n,s)=>{const r=u.br(e.get(t).value);r.push(...M.t.toArray(n)),s!=null&&r.sort(s),e.set(t,r)},remove:n=>{const s=e.get(t).value,r=new Set(M.t.toArray(n)),i=s.filter(({key:l})=>!r.has(l));return e.set(t,i),i.map(({key:l})=>l)},keepOnly:n=>{const s=e.get(t).value,r=new Set(M.t.toArray(n)),i=s.filter(({key:l})=>r.has(l));return e.set(t,i),i.map(({key:l})=>l)},set:n=>e.set(t,M.executeSetter(n,e.get(t).value)),sort:n=>{const s=u.br(e.get(t).value);s.sort(n),e.set(t,s)}}),Ag=(e,t={})=>{const n=sn(t?.ctx),s=cr(e,t);return g.useMemo(()=>({data:s.map(({key:r})=>r),...ga(n,e)}),[s,n,e])},Ig=f.renderProp(e=>o.jsxRuntimeExports.jsx(f.Text$2,{...e})),Ee=({path:e,children:t=Ig,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:a,className:c,defaultValue:d,...x})=>{const p=Et(e,{optional:l??i,onChange:a,defaultValue:d}),m=sn();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??=u.z.capitalize(M.m.element(e,-1)),r=typeof r=="function"?r(p,m):r,!r)return null;const h=p.status.message,{onChange:j,value:E}=p,S={onChange:j,value:E};return p.variant!=null&&(S.variant=p.variant),o.jsxRuntimeExports.jsx(Te.Item,{padHelpText:s,helpText:h,status:p.status.variant,label:n,required:p.required,className:u.CSS(c,u.CSS.BE("field",e.split(".").join("-")),u.CSS.M(p.status.variant)),...x,children:t(S)})},Mn=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:a=t,optional:c,defaultValue:d,...x})=>o.jsxRuntimeExports.jsx(Ee,{...n,...x,defaultValue:d,optional:c,path:a?`${l}.${a}`:l,children:p=>o.jsxRuntimeExports.jsx(e,{...p,...s,...i})});return r.displayName=e.displayName,r},ja=Mn(f.Numeric),He=ja({inputProps:{}}),Ea=Mn(f.Text$2),ur=Ea({inputProps:{}}),ya=Mn(f.Switch$1),Ns=ya({inputProps:{}}),Og=e=>Mn(Nn)(e),Bg=({children:e,...t})=>o.jsxRuntimeExports.jsx(lr,{value:t,children:e}),Dg=e=>e.code==="custom"&&e.params!=null&&"variant"in e.params?e.params.variant:"error";class Hg extends _.a.Observer{schema;values;initialValues;statuses;touched;cachedRefs;constructor(t,n){super(),this.schema=n,this.values=M.m.copy(t),this.statuses=new Map,this.touched=new Set,this.cachedRefs=new Map,this.initialValues=M.m.copy(this.values)}setValue(t,n){t==""?this.values=M.m.copy(n):M.m.set(this.values,t,n),this.checkTouched(t,n),this.updateCachedRefs(t)}checkTouched(t,n){const s=M.m.get(this.initialValues,t,{optional:!0});M.m.equal(s,n)?this.clearTouched(t):this.setTouched(t)}setStatus(t,n){this.statuses.set(t,n),this.updateCachedRefs(t)}clearStatus(t=""){this.statuses.delete(t),this.updateCachedRefs(t)}reset(t){t!=null&&(this.initialValues=t);const n=M.m.copy(this.initialValues);this.statuses.clear(),this.touched.clear();const s=new Set;this.cachedRefs.forEach((r,i)=>{const l=M.m.get(this.values,i,{optional:!0}),a=M.m.get(n,i,{optional:!0});l!==a&&s.add(i)}),s.forEach(r=>this.cachedRefs.delete(r)),this.values=n}setCurrentStateAsInitialValues(){this.initialValues=M.m.copy(this.values),this.touched.clear(),this.cachedRefs.clear()}setTouched(t){this.touched.add(t),this.updateCachedRefs(t)}clearTouched(t=""){t===""?this.touched.clear():this.touched.delete(t),this.updateCachedRefs(t),this.notify()}remove(t){M.m.remove(this.values,t),this.statuses.delete(t),this.clearTouched(t),this.cachedRefs.delete(t)}validate(t,n){if(this.schema==null)return!0;const s=this.schema.safeParse(this.values);return this.processValidation(t,s,n)}async validateAsync(t,n){if(this.schema==null)return!0;const s=await this.schema.safeParseAsync(this.values);return this.processValidation(t,s,n)}processValidation(t=!1,n,s){if(this.schema==null)return!0;const r=new Set;if(this.statuses.forEach((l,a)=>{l.variant!=="success"&&r.add(a)}),r.forEach(l=>this.clearStatus(l)),n.success)return!0;let i=!0;return n.error.issues.forEach(l=>{const{message:a}=l,c=l.path.join(".");if(s!=null&&!M.m.pathsMatch(c,s)&&!M.m.pathsMatch(s,c)||!t&&!this.touched.has(c))return;const d=Dg(l);d!=="warning"&&(i=!1),this.setStatus(c,{key:c,variant:d,message:a})}),i}get hasBeenTouched(){return this.touched.size>0}getState(t,n={}){const{optional:s=!1,defaultValue:r=void 0}=n,i=u.hr.getOrSetDefault(this.cachedRefs,t,{});let l=M.m.get(this.values,t,{optional:s||r!=null});if(l==null){if(r==null)return null;l=r,this.setValue(t,l)}if(i.value=l,i.required=!1,this.schema!=null){const a=zh.getFieldSchema(this.schema,t,{optional:!0});a!=null&&(i.required=!a.safeParse(void 0).success)}return i.status=u.hr.getOrSetDefault(this.statuses,t,{key:t,variant:"success",message:""}),i.touched=this.touched.has(t),i}updateCachedRefs(t){this.cachedRefs.forEach((n,s)=>{(M.m.pathsMatch(s,t)||M.m.pathsMatch(t,s))&&this.cachedRefs.set(s,{})})}}const dr=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r,onHasTouched:i})=>{const l=f.useInitializerRef(()=>new Hg(e,n)),a=f.useSyncedRef(r),c=f.useErrorHandler(),d=f.useSyncedRef(i),x=g.useCallback(()=>{l.current.setCurrentStateAsInitialValues(),d.current?.(!1)},[]),p=g.useCallback(N=>l.current.onChange(N),[]),m=g.useCallback((N,k)=>l.current.getState(N,k),[]),h=g.useCallback(N=>{l.current.remove(N),l.current.notify()},[]),j=g.useCallback(N=>{const k=l.current.values,A=l.current.hasBeenTouched;l.current.reset(N),k!==l.current.values&&a.current?.({values:l.current.values,path:"",prev:k,valid:!0}),l.current.notify();const D=l.current.hasBeenTouched;D!==A&&d.current?.(D)},[]),E=g.useCallback(async N=>{const k=await l.current.validateAsync(!0,N);return l.current.notify(),k},[]),S=g.useCallback(N=>{const k=l.current.validate(!0,N);return l.current.notify(),k},[]),R=g.useCallback((N,k)=>{const A=M.m.get(l.current.values,N,{optional:!0}),I=l.current.hasBeenTouched;l.current.setValue(N,k);const D=()=>{a.current?.({values:l.current.values,path:N,prev:A,valid:!0}),l.current.notify();const V=l.current.hasBeenTouched;V!==I&&d.current?.(V)};try{l.current.validate()}catch{return c(async()=>{await l.current.validateAsync(),D()},"Failed to validate form")}D()},[]),v=g.useCallback(N=>M.m.has(l.current.values,N),[]),y=g.useCallback((N,k)=>{const A=l.current.hasBeenTouched;l.current.setStatus(N,k),l.current.notify();const I=l.current.hasBeenTouched;I!==A&&d.current?.(I)},[]),C=g.useCallback(()=>{l.current.clearStatus(),l.current.notify()},[]);return g.useEffect(()=>{t&&(l.current.reset(e),l.current.notify())},[t,e]),g.useMemo(()=>({bind:p,set:R,get:m,mode:s,validate:S,validateAsync:E,value:()=>l.current.values,has:v,remove:h,setStatus:y,clearStatuses:C,reset:j,setCurrentStateAsInitialValues:x}),[p,R,m,S,E,v,h,y,C,j,s,x])},Sa=({key:e,open:t,onChange:n})=>{const s=f.useMemoPrimitiveArray(e);We(async()=>{if(t==null)return;const r=await t();if(r==null)return;const i=r.onChange(n);return async()=>{i(),await r.close()}},[t==null,s])},zg=Object.freeze(Object.defineProperty({__proto__:null,useListener:Sa},Symbol.toStringTag,{value:"Module"})),$g=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...a})=>{const c=et(),d=f.useErrorHandler(),x=f.useMemoPrimitiveArray(e),p=dr({values:s,...a,sync:!1,onChange:j=>{c!=null&&d(async()=>{await i?.({...j,client:c})},`Failed to apply changes for ${t}`)}});We(async()=>{if(c!=null)try{const j=await n({client:c});p.set("",j)}catch(j){d(j,`Failed to retrieve ${t}`)}},[x,c?.key]);const m=g.useCallback(async()=>{if(c!=null)return await r?.(c)},[x,c?.key]),h=g.useCallback(j=>l?.({changes:j,ctx:p}),[x,l]);return Sa({key:x,open:m,onChange:h}),p},Vg=Object.freeze(Object.defineProperty({__proto__:null,Context:lr,Field:Ee,Form:Bg,NumericField:He,SwitchField:Ns,TextField:ur,buildNumericField:ja,buildSelectField:Og,buildSwitchField:ya,buildTextField:Ea,fieldBuilder:Mn,fieldListUtils:ga,use:dr,useContext:sn,useField:Et,useFieldList:Ag,useFieldState:ar,useFieldValid:Tg,useFieldValue:cr,useSynced:$g},Symbol.toStringTag,{value:"Module"})),Bt=({name:e,schema:t,retrieve:n,listeners:s,update:r,initialValues:i})=>{const l=ct({name:e,retrieve:n,listeners:s}),a=Ot({name:e,update:r});return({params:c,initialValues:d,autoSave:x=!1,afterSave:p,sync:m,onHasTouched:h,mode:j})=>{const[E,S,R]=f.useCombinedStateAndRef(vt(e,"retrieving",null,!1)),v=dr({schema:t,values:d??i,onChange:({path:A})=>{x&&A!==""&&k()},sync:m,onHasTouched:h,mode:j}),y=g.useCallback((A,I=!0)=>{const D=M.executeSetter(A,R.current);R.current=D,D.data!=null&&(v.set("",D.data),I&&v.setCurrentStateAsInitialValues()),S(D)},[v]);l.useEffect({params:c,onChange:y});const C=g.useCallback(A=>y(A,!1),[y]),{updateAsync:N}=a.useObservable({params:c,onChange:C}),k=g.useCallback(A=>void(async()=>{try{if(!await v.validateAsync()||!await N(v.value(),A))return;p?.({form:v,params:c}),v.setCurrentStateAsInitialValues()}catch(I){S(D=>lt(e,"update",I,D.listenersMounted))}})(),[v,N,p,c]);return{form:v,save:k,...E}}},Fg=()=>!0,Zg=u.a.milliseconds(100),Ve=({name:e,listeners:t,retrieve:n,retrieveByKey:s})=>(r={})=>{const{filter:i=Fg,sort:l,initialParams:a,retrieveDebounce:c=Zg}=r,d=f.useSyncedRef(i),x=f.useSyncedRef(l),p=et(),m=g.useRef(new Map),h=f.useInitializerRef(()=>({mounted:!1,listeners:new Map})),[j,E,S]=f.useCombinedStateAndRef(vt(e,"retrieving",null,!1)),R=g.useRef(!0),v=g.useRef(a??null),y=ua(),C=g.useCallback(H=>h.current.listeners.forEach((B,$)=>{B===H&&$()}),[h]),N=g.useCallback(H=>{if(x.current==null)return H;const B=H.map($=>m.current.get($)).filter($=>$!=null);return B.sort(x.current),B.map($=>$.key)},[x]),k=g.useCallback(async(H,B={})=>{const{signal:$,mode:w="replace"}=B,P=M.executeSetter(H,v.current??{});v.current=P;try{if(p==null)return E(z=>_s(e,"retrieve",z.listenersMounted));if(E(z=>vt(e,"retrieving",z.data,!1)),w==="replace")R.current=!0;else if(w==="append"&&!R.current)return E(z=>qe(e,"retrieved",z.data??[],z.listenersMounted));let L=await n({client:p,params:P});if($?.aborted)return;L=L.filter(d.current),x.current!=null&&(L=L.sort(x.current)),L.length===0&&(R.current=!1);const O=L.map(z=>z.key);return S.current.data!=null&&u.O.primitiveArrays(S.current.data,O)===u.O.EQUAL?E(z=>qe(e,"retrieved",z.data??[],z.listenersMounted)):(L.forEach(z=>m.current.set(z.key,z)),y({onOpen:()=>{E(z=>({...z,listenersMounted:!0}))},listeners:t?.map(z=>({channel:z.channel,handler:F=>void(async()=>{if(!(p==null||v.current==null))try{await z.onChange({client:p,params:v.current,changed:F.get(z.channel),onDelete:Z=>{m.current.delete(Z),E(K=>K.data==null?K:{...K,data:K.data.filter(X=>X!==Z)})},onChange:(Z,K,X={})=>{const{mode:oe="append"}=X,J=m.current.get(Z)??null;if(J!=null&&!d.current(J))return;const ue=M.executeSetter(K,J);ue==null||!d.current(ue)||(m.current.set(Z,ue),E(te=>{if(te.data==null)return te;let ne;if(J==null)x.current!=null?ne=N([...te.data,Z]):ne=oe==="prepend"?[Z,...te.data]:[...te.data,Z];else if(x.current!=null){const ee=te.data.indexOf(Z),le=N(te.data),ge=le.indexOf(Z);ee!==ge?ne=le:ne=te.data}else ne=te.data;return{...te,data:ne}}),C(Z))}})}catch(Z){if($?.aborted)return;E(K=>lt(e,"retrieve",Z,K.listenersMounted))}})()}))}),E(z=>{if(w==="replace"||z.data==null)return qe(e,"retrieved",O,z.listenersMounted);const F=new Set(O);return qe(e,"retrieved",[...z.data.filter(Z=>!F.has(Z)),...O],z.listenersMounted)}))}catch(L){if($?.aborted)return;E(O=>lt(e,"retrieve",L,O.listenersMounted))}},[p,e,y,d]),A=g.useCallback((H,B={})=>{const{signal:$}=B;(async()=>{try{if(p==null||u.F.isZero(H))return;const w=await s({client:p,key:H,params:v.current??{}});if($?.aborted||w==null)return;if(!d.current(w)){m.current.set(H,null);return}m.current.set(H,w),C(H)}catch(w){if($?.aborted)return;m.current.set(H,null),E(P=>lt(e,"retrieve",w,P.listenersMounted))}})()},[s,p,C]),I=g.useCallback(H=>{if(H==null)return;if(Array.isArray(H))return H.map($=>I($)).filter($=>$!=null);const B=m.current.get(H);return B===void 0&&A(H),B},[A]),D=g.useCallback((H,B)=>B==null?()=>{}:(h.current.listeners.set(H,B),()=>h.current.listeners.delete(H)),[]);return{retrieve:Pe.useDebouncedCallback((H,B={})=>void k(H,B),new u.a(c).milliseconds,[k]),retrieveAsync:k,subscribe:D,getItem:I,...j,data:j?.data??[]}},Kg=({key:e,subscribe:t,getItem:n})=>g.useSyncExternalStore(g.useCallback(s=>t(s,e),[t,e]),g.useCallback(()=>n(e),[n,e])),Yg=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:_.AcquireChannelControl,AuthoritySource:_.AuthoritySource,Chip:_.Chip,Controller:_.Controller,Indicator:_.Indicator,Legend:_.Legend,REGISTRY:_.REGISTRY$16,STATUSES:_.STATUSES,SetChannelValue:_.SetChannelValue,StateProvider:_.StateProvider,acquireChannelControl:_.acquireChannelControl,acquireChannelControlPropsZ:_.acquireChannelControlPropsZ,authoritySource:_.authoritySource,authoritySourceDetailsZ:_.authoritySourceDetailsZ,authoritySourceProps:_.authoritySourceProps,chipStateZ:_.chipStateZ,chipStatusDetailsZ:_.chipStatusDetailsZ,controllerStateZ:_.controllerStateZ,indicatorStateZ:_.indicatorStateZ,indicatorStatusDetailsZ:_.indicatorStatusDetailsZ,legendStateZ:_.legendStateZ,setChannelValue:_.setChannelValue,setChannelValuePropsZ:_.setChannelValuePropsZ,stateProviderStateZ:_.stateProviderStateZ,statusZ:_.statusZ,sugaredStateZ:_.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var yi=180/Math.PI,vo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ra(e,t,n,s,r,i){var l,a,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(a=Math.sqrt(n*n+s*s))&&(n/=a,s/=a,c/=a),e*s<t*n&&(e=-e,t=-t,c=-c,l=-l),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*yi,skewX:Math.atan(c)*yi,scaleX:l,scaleY:a}}var Zn;function Wg(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?vo:Ra(t.a,t.b,t.c,t.d,t.e,t.f)}function Gg(e){return e==null||(Zn||(Zn=document.createElementNS("http://www.w3.org/2000/svg","g")),Zn.setAttribute("transform",e),!(e=Zn.transform.baseVal.consolidate()))?vo:(e=e.matrix,Ra(e.a,e.b,e.c,e.d,e.e,e.f))}function Ca(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function i(d,x,p,m,h,j){if(d!==p||x!==m){var E=h.push("translate(",null,t,null,n);j.push({i:E-4,x:_.interpolateNumber(d,p)},{i:E-2,x:_.interpolateNumber(x,m)})}else(p||m)&&h.push("translate("+p+t+m+n)}function l(d,x,p,m){d!==x?(d-x>180?x+=360:x-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:_.interpolateNumber(d,x)})):x&&p.push(r(p)+"rotate("+x+s)}function a(d,x,p,m){d!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:_.interpolateNumber(d,x)}):x&&p.push(r(p)+"skewX("+x+s)}function c(d,x,p,m,h,j){if(d!==p||x!==m){var E=h.push(r(h)+"scale(",null,",",null,")");j.push({i:E-4,x:_.interpolateNumber(d,p)},{i:E-2,x:_.interpolateNumber(x,m)})}else(p!==1||m!==1)&&h.push(r(h)+"scale("+p+","+m+")")}return function(d,x){var p=[],m=[];return d=e(d),x=e(x),i(d.translateX,d.translateY,x.translateX,x.translateY,p,m),l(d.rotate,x.rotate,p,m),a(d.skewX,x.skewX,p,m),c(d.scaleX,d.scaleY,x.scaleX,x.scaleY,p,m),d=x=null,function(h){for(var j=-1,E=m.length,S;++j<E;)p[(S=m[j]).i]=S.x(h);return p.join("")}}}var Ug=Ca(Wg,"px, ","px)","deg)"),qg=Ca(Gg,", ",")",")"),Xg=1e-12;function Si(e){return((e=Math.exp(e))+1/e)/2}function Qg(e){return((e=Math.exp(e))-1/e)/2}function Jg(e){return((e=Math.exp(2*e))-1)/(e+1)}const ts=function e(t,n,s){function r(i,l){var a=i[0],c=i[1],d=i[2],x=l[0],p=l[1],m=l[2],h=x-a,j=p-c,E=h*h+j*j,S,R;if(E<Xg)R=Math.log(m/d)/t,S=function(A){return[a+A*h,c+A*j,d*Math.exp(t*A*R)]};else{var v=Math.sqrt(E),y=(m*m-d*d+s*E)/(2*d*n*v),C=(m*m-d*d-s*E)/(2*m*n*v),N=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(C*C+1)-C);R=(k-N)/t,S=function(A){var I=A*R,D=Si(N),V=d/(n*v)*(D*Jg(t*I+N)-Qg(N));return[a+V*h,c+V*j,d*D/Si(t*I+N)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return r.rho=function(i){var l=Math.max(.001,+i),a=l*l,c=a*a;return e(l,a,c)},r}(Math.SQRT2,2,4),e1=Object.freeze(Object.defineProperty({__proto__:null,Base:_.Base,Bottom:_.Bottom,Right:_.Right,Top:_.Top,axisStateZ:_.axisStateZ,newCanvas:_.newCanvas,newTickFactory:_.newTickFactory,tickFactoryProps:_.tickFactoryProps,tickType:_.tickType},Symbol.toStringTag,{value:"Module"})),Ie=e=>{const t=rr(),n=f.useErrorHandler();g.useEffect(()=>_.mountListeners(t,n,e),[t,n])},t1=u.a.seconds(5),wa=({children:e,openStreamer:t,streamerRemovalDelay:n=t1})=>{const s=et(),r=f.useErrorHandler(),i=g.useRef(new _.Streamer({handleError:r,removalDelay:n})),{path:l}=f.useLifecycle({type:_.Provider$1.TYPE,schema:_.providerStateZ,initialState:{}}),a=g.useMemo(()=>t??s?.openStreamer.bind(s),[s,t]);We(async()=>{if(a!=null)return await i.current.updateStreamer(a),i.current.close.bind(i.current)},[a]);const c=g.useCallback(({channel:d,handler:x,onOpen:p})=>i.current.addListener(x,d,p),[]);return o.jsxRuntimeExports.jsx(f.Composite,{path:l,children:o.jsxRuntimeExports.jsx(or,{value:c,children:e})})},n1=Object.freeze(Object.defineProperty({__proto__:null,Context:or,Provider:wa,createForm:Bt,createList:Ve,createRetrieve:ct,createUpdate:Ot,errorResult:lt,nullClientResult:_s,parsedHandler:_.parsedHandler,pendingResult:vt,stringHandler:_.stringHandler,successResult:qe,useAddListener:rr,useListItem:Kg,useListener:Ie},Symbol.toStringTag,{value:"Module"})),ba=e=>Ie({channel:M.Nm.RESOURCE_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:t})=>e(t))}),s1=e=>Ie({channel:M.Nm.RESOURCE_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:t})=>{e(t)})}),o1=e=>Ie({channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:t})=>{e(t)})}),r1=e=>Ie({channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:t})=>{e(t)})}),va=e=>Ve({name:"useDependents",retrieve:async({client:t,params:{id:n}})=>n==null?[]:await t.ontology.retrieve([n],{children:e==="to",parents:e==="from"}),retrieveByKey:async({client:t,key:n})=>await t.ontology.retrieve(M.Nm.idZ.parse(n)),listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({client:t,changed:n,params:s,onChange:r})=>{if(!("id"in s))return;const{id:i}=s;if(!M.Nm.matchRelationship(n,{type:"parent",[M.Nm.oppositeRelationshipDirection(e)]:i}))return;const l=await t.ontology.retrieve(n[e]);r(l.key,l)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:t,params:n,onDelete:s})=>{if(!("id"in n))return;const{id:r}=n;M.Nm.matchRelationship(t,{type:"parent",[M.Nm.oppositeRelationshipDirection(e)]:r})&&s(M.Nm.idToString(t[e]))})},{channel:M.Nm.RESOURCE_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({client:t,changed:n,params:s,onChange:r})=>{const{id:i}=s;if(i==null||!M.Nm.idsEqual(i,n))return;const l=await t.ontology.retrieve(n);r(l.key,l)})}]}),i1=va("to"),l1=Ve({name:"useResourceList",retrieve:async({client:e,params:t})=>await e.ontology.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.ontology.retrieve(M.Nm.idZ.parse(t)),listeners:[{channel:M.Nm.RESOURCE_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:e,onChange:t,client:n})=>t(e.key,await n.ontology.retrieve(e)))},{channel:M.Nm.RESOURCE_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:e,onDelete:t})=>{t(e.key)})}]}),a1=ct({name:"useParentID",retrieve:async({client:e,params:{id:t,type:n}})=>{const s=await e.ontology.retrieveParents(t);if(n==null)return s[0].id;const r=s.find(({id:i})=>i.type===n);return r==null?null:r.id},listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,params:{id:t,type:n},onChange:s})=>{e.type===M.Nm.PARENT_OF_RELATIONSHIP_TYPE&&(n==null||e.from.type===n)&&M.Nm.idsEqual(e.to,t)&&s(e.to)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,params:{id:t,type:n},onChange:s})=>{e.type===M.Nm.PARENT_OF_RELATIONSHIP_TYPE&&(n==null||e.from.type===n)&&M.Nm.idsEqual(e.to,t)&&s(null)})}]}),c1=Object.freeze(Object.defineProperty({__proto__:null,createDependentsListHook:va,retrieveParentID:a1,useChildren:i1,useRelationshipDeleteSynchronizer:r1,useRelationshipSetSynchronizer:o1,useResourceDeleteSynchronizer:s1,useResourceList:l1,useResourceSetSynchronizer:ba},Symbol.toStringTag,{value:"Module"})),_a=g.createContext(void 0),kn=()=>{const e=g.use(_a);if(e==null)throw new Error("Channel.AliasProvider not found");return e},u1=()=>kn().activeRange,xr=e=>kn().aliases[e]??null,Na=()=>kn().aliases,Ms=(e,t="")=>{const n=et(),s=f.useErrorHandler(),r=g.useCallback(p=>{M.Nm.idsEqual(p,M.xm.ontologyID(e))&&i==null&&s(async()=>{const m=await n?.ontology.retrieve(p);d(m?.name)},"Failed to retrieve resource")},[n,s,e]);ba(r);const i=xr(e),{getName:l,setAlias:a}=kn(),[c,d]=g.useState(t);We(async p=>{const m=await l(e);p.aborted||d(m)},[e,l]);const x=g.useCallback(p=>{s(async()=>{const m=c;try{if(i!=null){if(a==null)throw new Error("AliasSetter not found");await a(e,p);return}if(n==null)throw new M.wm;await n.channels.rename(e,p)}catch(h){throw d(m),h}},"Failed to rename channel")},[i,a,e,s,c]);return[c??t,x]},Ma=()=>kn().setAlias,d1=({channelKey:e,shadow:t,className:n,...s})=>{const{value:r,onChange:i}=s,[l,a]=g.useState(!1),c=Ma(),d=xr(e),[x]=Ms(e);let p=o.jsxRuntimeExports.jsx(f.Rename,{});l?p=o.jsxRuntimeExports.jsx(f.Loading,{}):d===r&&(p=o.jsxRuntimeExports.jsx(f.Check,{}));const m=c!=null&&!l&&d!==r&&e!==0,h=f.useErrorHandler(),j=()=>{m&&h(async()=>{a(!0);try{await c(e,r),a(!1)}catch(R){throw a(!1),R}},"Failed to set channel alias")},E=()=>{d!=null&&i?.(d)},S=e===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):r.length===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===r?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Sync alias for ",x," with this label"]});return o.jsxRuntimeExports.jsxs(f.Text$2,{selectOnFocus:!0,...s,children:[m&&o.jsxRuntimeExports.jsx(f.Button,{onClick:E,tooltip:o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Set ",x," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(f.Sync,{})}),o.jsxRuntimeExports.jsx(f.Button,{onClick:j,disabled:!m,tooltip:S,tooltipLocation:{y:"top"},variant:"outlined",children:p})]})},_t=(e,t)=>M.Nm.matchRelationship(e,{from:t,type:M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE}),ka=ct({name:"Labels",retrieve:async({client:e,params:{id:t}})=>await e.labels.retrieve({for:t}),listeners:[{channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async({changed:e,onChange:t})=>t(n=>{const s=n.filter(r=>r.key!==e.key);return s.length===n.length?n:[...s,e]}))},{channel:M.Gm.DELETE_CHANNEL_NAME,onChange:_.stringHandler(async({changed:e,onChange:t})=>t(n=>n.filter(s=>s.key!==e)))},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({client:e,changed:t,onChange:n,params:{id:s}})=>{if(!_t(t,s))return;const{key:r}=t.to,i=await e.labels.retrieve({key:r});n(l=>[...l.filter(a=>a.key!==r),i])})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{id:n}})=>{_t(e,n)&&t(s=>s.filter(r=>r.key!==e.to.key))})}]}),La=se.z.object({labels:se.z.array(M.Gm.keyZ)}),x1=Bt({name:"Labels",schema:La,initialValues:{labels:[]},retrieve:async({client:e,params:{id:t}})=>t==null?null:{labels:(await e.labels.retrieve({for:t})).map(s=>s.key)},update:async({client:e,value:t,params:{id:n}})=>{await e.labels.label(n,t.labels,{replace:!0})},listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({client:e,changed:t,onChange:n,params:{id:s}})=>{if(!_t(t,s))return;const{key:r}=t.to,i=await e.labels.retrieve({key:r});n(l=>l==null?{labels:[i.key]}:{labels:[...l.labels.filter(a=>a!==r),i.key]})})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{id:n}})=>{_t(e,n)&&t(s=>s==null?{labels:[]}:{labels:s.labels.filter(r=>r!==e.to.key)})})}]}),p1=e=>Ie({channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async t=>{e(t.changed)})}),m1=e=>Ie({channel:M.Gm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.keyZ,async t=>{e(t.changed)})}),pr=Ve({name:"Labels",retrieve:async({client:e,params:t})=>await e.labels.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.labels.retrieve({key:t}),listeners:[{channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async({changed:e,onChange:t})=>{t(e.key,e,{mode:"prepend"})})},{channel:M.Gm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.keyZ,async({changed:e,onDelete:t})=>t(e))}]}),Pa=M.Gm.labelZ.partial({key:!0}),f1=Bt({name:"Label",initialValues:{name:"",color:"#000000"},schema:Pa,retrieve:async({client:e,params:{key:t}})=>t==null?null:await e.labels.retrieve({key:t}),update:async({client:e,value:t,onChange:n})=>n(await e.labels.create(t)),listeners:[{channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async({changed:e,onChange:t,params:n})=>{n.key==null||e.key!==n.key||t(e)})}]}),h1=Ot({name:"Label",update:async({client:e,params:{key:t}})=>await e.labels.delete(t)}).useDirect,mr="label",g1=({itemKey:e,...t})=>{const n=f.useItem(e),{selected:s,onSelect:r,hovered:i}=f.useItemState(e);return n==null?null:o.jsxRuntimeExports.jsx(f.Item,{itemKey:e,onSelect:r,selected:s,hovered:i,...t,children:o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(f.Circle,{color:n?.color,size:"2.5em"}),n?.name]})})},Ta=f.renderProp(g1),j1=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t),{onSelect:s}=f.useItemState(t);return n==null?null:o.jsxRuntimeExports.jsx(vs,{color:n.color,onClose:s,size:"small",children:n.name})}),E1={variant:"text"},y1=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=pr({filter:s,initialParams:r}),{fetchMore:p,search:m}=Je.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Label",haulType:mr,value:t,onChange:e,data:l,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,renderTag:j1,icon:o.jsxRuntimeExports.jsx(f.Label,{}),triggerProps:E1,variant:"floating",...i,children:Ta})},S1=({onChange:e,value:t,allowNone:n,emptyContent:s,filter:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=pr({filter:r,initialParams:i}),{fetchMore:m,search:h}=Je.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(It,{resourceName:"Label",value:t,onChange:e,data:a,getItem:d,subscribe:x,allowNone:n,onFetchMore:m,onSearch:h,emptyContent:s,status:p,haulType:mr,...l,children:Ta})},R1=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:mr,SelectMultiple:y1,SelectSingle:S1,formSchema:Pa,labelsOfFormSchema:La,matchRelationship:_t,retrieveLabelsOf:ka,useDelete:h1,useDeleteSynchronizer:m1,useForm:f1,useLabelsOfForm:x1,useList:pr,useSetSynchronizer:p1},Symbol.toStringTag,{value:"Module"})),C1=e=>Ie({channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async t=>{e(t.changed)})}),Aa=e=>Ie({channel:M.Km.SET_ALIAS_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.aliasZ,async t=>{e(t.changed)})}),Ia=e=>Ie({channel:M.Km.DELETE_ALIAS_CHANNEL_NAME,onChange:_.stringHandler(async t=>{e(M.Km.decodeDeleteAliasChange(t.changed))})}),Oa=async({changed:e,onChange:t,client:n})=>{if(M.Nm.matchRelationship(e,{from:{type:"range"},type:M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE,to:{type:"label"}})){const r=await n.labels.retrieve({key:e.to.key});t(e.from.key,i=>i==null?i:n.ranges.sugarOne({...i,labels:[...i.labels,r]}))}},Ba=async({changed:e,onChange:t,client:n})=>{if(M.Nm.matchRelationship(e,{from:{type:"range"},type:M.Nm.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const r=await n.ranges.retrieve(e.from.key);t(e.to.key,i=>i==null?i:n.ranges.sugarOne({...i,parent:r}))}},w1=Ve({name:"Range",retrieve:async({client:e,params:{key:t}})=>{const n=await e.ontology.retrieveChildren(M.Km.ontologyID(t),{types:["range"]});return n.length===0?[]:await e.ranges.retrieve({keys:n.map(({id:{key:s}})=>s),includeParent:!0,includeLabels:!0})},retrieveByKey:async({client:e,key:t})=>await e.ranges.retrieve(t),listeners:[{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({changed:e,onChange:t,client:n})=>{t(e.key,s=>s==null?s:n.ranges.sugarOne({...s.payload,...e,parent:s.parent??e.parent,labels:s.labels??[]}))})},{channel:M.Km.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async e=>{const{changed:t,onChange:n,client:s,params:r}=e;if(!("key"in r))return;if(M.Nm.matchRelationship(t,{from:M.Km.ontologyID(r.key),type:M.Nm.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const l=await s.ranges.retrieve({keys:[t.to.key],includeParent:!0,includeLabels:!0});return n(t.to.key,l[0])}await Oa(e),await Ba(e)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onDelete:t,onChange:n,client:s,params:{key:r}})=>{if(M.Nm.matchRelationship(e,{type:"parent",to:M.Km.ontologyID(r)}))return t(e.to.key);e.type===M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE&&n(e.from.key,a=>a==null?a:s.ranges.sugarOne({...a,labels:a.labels.filter(c=>c.key!==e.to.key)}))})}]}),b1=ct({name:"Range",retrieve:async({client:e,params:{key:t}})=>{const s=(await e.ontology.retrieveParents(M.Km.ontologyID(t))).find(({id:{type:r}})=>r==="range");return s==null?null:e.ranges.sugarOntologyResource(s)},listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{key:n},client:s})=>M.Nm.matchRelationship(e,{type:"parent",to:M.Km.ontologyID(n)})&&t(await s.ranges.retrieve(e.from.key)))},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{key:n},client:s})=>M.Nm.matchRelationship(e,{type:"parent",from:M.Km.ontologyID(n)})&&t(await s.ranges.retrieve(e.from.key)))},{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({changed:e,onChange:t,client:n})=>{t(s=>s==null||s.key!==e.key?s:n.ranges.sugarOne({...s.payload,...e}))})}]}),v1={channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({client:e,changed:t,params:{key:n},onChange:s})=>{t.key===n&&s(e.ranges.sugarOne(t))})},Da=ct({name:"Range",retrieve:async({client:e,params:{key:t}})=>await e.ranges.retrieve(t),listeners:[v1]}),_1=Da.useDirect,Ha=se.z.object({...M.Km.payloadZ.omit({timeRange:!0}).partial({key:!0}).shape,labels:se.z.array(M.Gm.keyZ),parent:se.z.string().optional(),timeRange:se.z.object({start:se.z.number(),end:se.z.number()})}),_o=async(e,t,n)=>({...e.payload,timeRange:e.timeRange.numeric,labels:t??(await e.retrieveLabels()).map(s=>s.key),parent:n??(await e.retrieveParent())?.key??""}),N1={name:"",labels:[],parent:"",timeRange:{start:0,end:0}},M1=Bt({name:"Range",schema:Ha,initialValues:N1,retrieve:async({client:e,params:{key:t}})=>t==null?null:await _o(await e.ranges.retrieve(t)),update:async({client:e,value:t,onChange:n})=>{const s=u.F.isZero(t.parent)?void 0:M.Km.ontologyID(t.parent),r=await e.ranges.create(t,{parent:s});await e.labels.label(r.ontologyID,t.labels,{replace:!0}),n({...t,...r.payload,timeRange:r.timeRange.numeric,labels:t.labels,parent:t.parent})},listeners:[{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({client:e,changed:t,onChange:n})=>{const s=await _o(e.ranges.sugarOne(t));n(r=>r?.key!==t.key?r:{...s,labels:r.labels,parent:r.parent})})},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t})=>{t(n=>{if(n==null||n.key==null)return n;const s=M.Km.ontologyID(n.key);return _t(e,s)?{...n,labels:[...n.labels.filter(l=>l!==e.to.key),e.to.key]}:M.Nm.matchRelationship(e,{type:M.Nm.PARENT_OF_RELATIONSHIP_TYPE,to:s})?{...n,parent:e.from.key}:n})})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{key:n}})=>{n==null||!_t(e,M.Km.ontologyID(n))||t(s=>{if(s==null)return s;const r=s.labels.filter(i=>i!==e.to.key);return{...s,labels:r}})})}]}),k1=e=>ka.useDirect({params:{id:M.Km.ontologyID(e)}}),L1={includeParent:!0,includeLabels:!0},fr=Ve({name:"Ranges",retrieve:async({client:e,params:t})=>await e.ranges.retrieve({...L1,...t}),retrieveByKey:async({client:e,key:t})=>await e.ranges.retrieve(t),listeners:[{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({changed:e,onChange:t,client:n})=>t(e.key,s=>{const r={...s?.payload,...e,parent:s?.parent??e.parent,labels:s?.labels??[]};return n.ranges.sugarOne(r)}))},{channel:M.Km.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async e=>{await Oa(e),await Ba(e)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,client:n})=>{if(e.type===M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE)return t(e.from.key,s=>s==null?s:n.ranges.sugarOne({...s,labels:s.labels.filter(r=>r.key!==e.to.key)}))})}]}),P1=se.z.object({pairs:se.z.array(se.z.object({key:se.z.string(),value:se.z.string()}))}),T1=se.z.string().transform(e=>e.split("<--->")).transform(([e,t])=>({key:t,range:e})),A1=Ve({name:"Range Meta Data",retrieve:async({client:e,params:{rangeKey:t}})=>{const s=await e.ranges.getKV(t).list();return Object.entries(s).map(([r,i])=>({key:r,value:i,range:t}))},retrieveByKey:async({client:e,key:t,params:{rangeKey:n}})=>{if(n==null)return;const r=await e.ranges.getKV(n).get(t);return{key:t,value:r,range:n}},listeners:[{channel:M.Km.KV_SET_CHANNEL,onChange:_.parsedHandler(M.Km.kvPairZ,async({changed:e,onChange:t,params:{rangeKey:n}})=>{e.range===n&&t(e.key,e)})},{channel:M.Km.KV_DELETE_CHANNEL,onChange:_.parsedHandler(T1,async({changed:e,onDelete:t,params:{rangeKey:n}})=>{e.range===n&&t(e.key)})}]}),za=M.Km.kvPairZ,I1=Bt({name:"Range Meta Data",schema:za,retrieve:async()=>null,update:async({client:e,value:t})=>{await e.ranges.getKV(t.range).set(t.key,t.value)},initialValues:{key:"",value:"",range:""}}),O1=Ot({name:"Range Meta Data",update:async({client:e,value:t,params:{rangeKey:n}})=>{await e.ranges.getKV(n).delete(t)}}),B1=Ot({name:"Range Meta Data",update:async({client:e,value:t,onChange:n})=>{await e.ranges.getKV(t.range).set(t.key,t.value),n(t)}}),D1=Ot({name:"Range",update:async({client:e,value:t,onChange:n})=>n(await e.ranges.create(t))}),H1=Ot({name:"Range",update:async({client:e,value:t})=>await e.ranges.delete(t)}),$a=({timeRange:e,level:t="p",color:n=9,showSpan:s=!1,...r})=>{const i=new u.n(e.start),l=i.isToday?"time":"dateTime",a=new u.n(e.end),c=a.equals(u.n.MAX),d=a.span(i)<u.a.DAY?"time":"dateTime",x=i.span(a),p=o.jsxRuntimeExports.jsxs(f.Text,{x:!0,align:"center",gap:"small",children:[i.isToday&&o.jsxRuntimeExports.jsx(f.Text,{level:t,color:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(f.DateTime,{el:"span",level:t,displayTZ:"local",format:l,color:n,weight:450,children:i})]}),m=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[c?o.jsxRuntimeExports.jsx(f.Text,{level:t,el:"span",children:"Now"}):o.jsxRuntimeExports.jsx(f.DateTime,{level:t,el:"span",displayTZ:"local",format:d,color:n,weight:450,children:a}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(f.Text,{level:t,color:n,weight:450,el:"span",children:["(",i.span(a).truncate(u.a.MILLISECOND).toString(),")"]})]});return o.jsxRuntimeExports.jsxs(f.Text,{x:!0,gap:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",level:t,color:n,...r,children:[p,o.jsxRuntimeExports.jsx(f.Arrow.Right,{color:9}),m]})},hr="range",gr=g.memo(({itemKey:e,showParent:t=!0,showLabels:n=!0,...s})=>{const r=f.useItem(e);if(r==null)return null;const{name:i,parent:l,timeRange:a,labels:c}=r;return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,justify:"between",...s,children:[o.jsxRuntimeExports.jsxs(sr,{children:[o.jsxRuntimeExports.jsx(En,{weight:450,color:10,children:i}),l!=null&&t&&o.jsxRuntimeExports.jsx(En,{weight:400,color:8,children:l.name})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx($a,{level:"small",timeRange:a}),n&&o.jsxRuntimeExports.jsx(tr,{children:c?.map(d=>o.jsxRuntimeExports.jsx(vs,{color:d.color,size:"small",children:d.name},d.key))})]})]})});gr.displayName="Ranger.ListItem";const Va=f.renderProp(gr),Fa=o.jsxRuntimeExports.jsx(f.Range,{}),z1=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=fr({filter:s,initialParams:r}),{fetchMore:p,search:m}=Je.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Range",haulType:hr,value:t,onChange:e,data:l,getItem:c,icon:Fa,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,...i,children:Va})},$1={style:{width:800}},V1=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,subscribe:d,getItem:x,status:p}=fr({filter:n,initialParams:i}),{fetchMore:m,search:h}=Je.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(It,{resourceName:"Range",variant:"modal",value:t,onChange:e,data:a,allowNone:s,haulType:hr,onFetchMore:m,getItem:x,subscribe:d,status:p,onSearch:h,emptyContent:r,icon:Fa,itemHeight:45,dialogProps:$1,...l,children:Va})},F1=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:hr,ListItem:gr,SelectMultiple:z1,SelectSingle:V1,TimeRangeChip:$a,formSchema:Ha,kvPairFormSchema:za,metaDataFormSchema:P1,retrieveParent:b1,retrieveQuery:Da,toFormValues:_o,useAliasDeleteSynchronizer:Ia,useAliasSetSynchronizer:Aa,useChildren:w1,useDelete:H1,useDeleteKV:O1,useForm:M1,useKVPairForm:I1,useLabels:k1,useList:fr,useListKV:A1,useRetrieve:_1,useSetSynchronizer:C1,useUpdate:D1,useUpdateKV:B1},Symbol.toStringTag,{value:"Module"})),Ri={},Za=({activeRange:e,...t})=>{const n=et(),[s,r]=g.useState(Ri);We(async x=>{if(n==null||e==null){r(Ri);return}const p=await n.ranges.retrieve(e);if(x.aborted)return;const m=await p.listAliases();x.aborted||r(m)},[n,e]);const i=g.useCallback(({alias:x,channel:p,range:m})=>r(h=>{if(m!==e)return h;const j={...h};return j[p]=x,j}),[e]);Aa(i);const l=g.useCallback(({channel:x,range:p})=>r(m=>{if(p!==e)return m;const h={...m};return delete h[x],h}),[e]);Ia(l);const a=g.useCallback(async(x,p)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(x,p)},[n,e]),c=g.useCallback(async x=>{if(n==null||x===0)return;const p=s[x];if(p!=null)return p;const{name:m}=await n.channels.retrieve(x);return m},[s,n]),d=g.useMemo(()=>({aliases:s,activeRange:e,setAlias:e!=null?a:null,getName:c}),[s,e,a,c]);return o.jsxRuntimeExports.jsx(_a,{...t,value:d})},Nt="channel",Z1={region:u.Ho.ZERO,dpr:1,os:u.S.getOS()},K1={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Y1=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},a]=f.use$2({type:_.Canvas.TYPE,schema:_.canvasStateZ,initialState:Z1}),c=g.useRef({...K1}),d=g.useRef(!1),x=g.useCallback(E=>{c.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:E,dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})})),d.current=!0)},[a]),p=g.useRef(null),m=f.useResize(x,{debounce:t}),h=f.useCombinedRefs(p,m);g.useEffect(()=>{const E=()=>{window.devicePixelRatio===l||!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",E,{once:!0})},[l]),g.useEffect(()=>{const E=()=>{!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",E),window.addEventListener("blur",E)},[a]);const j=g.useCallback(E=>{if(E==null)return;E.className.includes("gl")?c.current.gl=E:E.className.includes("upper2d")?c.current.upper2d=E:c.current.lower2d=E;const{gl:S,lower2d:R,upper2d:v,bootstrapped:y}=c.current;if(S==null||R==null||v==null||y)return;c.current.bootstrapped=!0;const C=S.transferControlToOffscreen(),N=v.transferControlToOffscreen(),k=R.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:N,lower2dCanvas:k,bootstrap:!0,bootstrapped:!1,region:u.Ho.construct(S),dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})},[C,N,k])},[a]);return o.jsxRuntimeExports.jsxs("div",{ref:h,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:j,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:j,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:j,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:i&&e})]})},Ln=(e,t)=>f.useResize(g.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(u.C.XY.translate(u.K.scale(u.Ho.topLeft(r),-1)).box(n),s)},[e]),t),W1=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Y1,useRegion:Ln},Symbol.toStringTag,{value:"Module"})),Ka=g.createContext(null),Qe=e=>{const t=g.use(Ka);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Ya=e=>{const{addViewportHandler:t}=Qe("Viewport");g.useEffect(()=>t(e),[t,e])},Pn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=Qe(t),{key:r}=e;return f.useEffectCompare(()=>{u.K$1.outer.parse(e.loc),n(e)},([a],[c])=>M.m.equal(a,c),[e]),g.useEffect(()=>()=>s(r),[]),{gridArea:u.g.swap(u.K$1.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Wa=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.K.ZERO,children:r,hold:i=!1,onHold:l,visible:a,...c})=>{const[d,x]=g.useState([]),p=f.useMemoDeepEqual({clearOverScan:s,hold:i,visible:a}),[{path:m},{grid:h},j]=f.use$2({aetherKey:e,type:_.LinePlot.TYPE,schema:_.linePlotStateZ,initialState:{container:u.Ho.ZERO,viewport:u.Ho.DECIMAL,grid:{},...p}}),E=g.useCallback(B=>{a&&j($=>({...$,container:B}))},[j,a]),S=Ln(E,{debounce:n});g.useEffect(()=>j(B=>({...B,...p})),[p]);const R=g.useRef(new Map),v=g.useCallback(B=>(R.current.set(B,null),()=>R.current.delete(B)),[R]),y=g.useCallback(B=>{const{mode:$,box:w,stage:P}=B;($==="pan"&&P!=="start"||$==="zoom"||$==="zoomReset"&&P==="start")&&j(L=>({...L,viewport:w})),R.current.forEach((L,O)=>O(B))},[j]),C=g.useCallback(B=>{j($=>({...$,grid:{...$.grid,[B.key]:B}}))},[j]),N=g.useCallback(B=>j($=>{const{[B]:w,...P}=$.grid;return{...$,grid:P}}),[j]),k=g.useCallback(B=>{x($=>[...$.filter(({key:w})=>w!==B.key),B])},[x]),A=g.useCallback(B=>x($=>$.filter(({key:w})=>w!==B)),[k]),I=g.useMemo(()=>G1(h),[h]),D=g.useCallback(B=>{j($=>({...$,hold:B})),l?.(B)},[j,l]),V=`line-plot-${e}`,H=g.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:N,setLine:k,removeLine:A,setViewport:y,addViewportHandler:v,setHold:D,id:V}),[V,d,C,N,k,A,y,v,D]);return o.jsxRuntimeExports.jsx("div",{id:V,className:u.CSS.B("line-plot"),style:{...t,...I},ref:S,...c,children:o.jsxRuntimeExports.jsx(Ka,{value:H,children:o.jsxRuntimeExports.jsx(f.Composite,{path:m,children:r})})})},G1=e=>{const t=u.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()},jr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?_.XAxis.TYPE:_.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:a=t,label:c="",labelLevel:d="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:h,showGrid:j,type:E,bounds:S,className:R,tickSpacing:v,autoBounds:y,axisKey:C,autoBoundUpdateInterval:N,onAutoBoundsChange:k,style:A,...I})=>{const D=(c?.length??0)>0,V=f.useUniqueKey(i),H=f.useMemoDeepEqual({location:a,showGrid:j,type:E,bounds:S,axisKey:C,label:c,labelDirection:x,tickSpacing:v,autoBounds:y,autoBoundUpdateInterval:N}),[{path:B},{size:$,labelSize:w,...P},L]=f.use$2({aetherKey:V,type:n,schema:_.coreAxisStateZ,initialState:H});g.useEffect(()=>L(Z=>({...Z,...H})),[H]),g.useEffect(()=>{const{lower:Z,upper:K}=_.parseAutoBounds(P.autoBounds);P.bounds!=null&&(Z&&S?.lower!==P.bounds.lower||K&&S?.upper!==P.bounds.upper)&&k?.(P.bounds)},[P.autoBounds,P.bounds]);const O=Pn({loc:a,key:`${n}-${V}`,size:$+w,order:1},`${e.toUpperCase()}Axis`),z=ws.useTypography(d).toString(),F=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(c==null)return;let K=M.dimensions(c,z)[u.g.dimension(u.g.construct(x))];K>0&&(K+=9),L(X=>({...X,labelSize:K}))}else{let K=M.dimensions(c,z).height*1.3;K>0&&(K+=12);const X=F.current;_.withinSizeThreshold(X,K)||(F.current=K,L(oe=>({...oe,labelSize:K})))}},[c,x,z]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(R,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(a)),style:{...A,...O},align:"center",justify:a!=="left"?"end":"start",direction:u.g.swap(e),...I,children:D&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:c,onChange:p,level:d})}),o.jsxRuntimeExports.jsx(f.Composite,{path:B,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},Ga=jr("x"),Ua=jr("y"),qa=u.K.xy.extend({root:u.K$1.corner,units:se.z.object({x:se.z.enum(["px","decimal"]),y:se.z.enum(["px","decimal"])})}),U1=qa.partial({root:!0,units:!0}),q1=e=>{const t={};return t[e.root?.x??"left"]=e?.units?.x==="px"?`${e.x}px`:`${e.x*100}%`,t[e.root?.y??"top"]=e?.units?.y==="px"?`${e.y}px`:`${e.y*100}%`,t},X1=(e,t)=>{const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Ho.construct(t.current),r=u.Ho.construct(t.current.parentElement);return e.units?.x==="decimal"?e.root?.x==="right"&&(n.x=1-e.x):e.root?.x==="right"?n.x=1-(e.x+u.Ho.width(s))/u.Ho.width(r):n.x/=u.Ho.width(r),e.units?.y==="decimal"?e.root?.y==="bottom"&&(n.y=1-e.y):e.root?.y==="bottom"?n.y=1-(e.y+u.Ho.height(s))/u.Ho.height(r):n.y/=u.Ho.height(r),n},Xa=(e,t)=>{if(t.current==null)return null;const n=u.Ho.construct(t.current.parentElement),s=u.Ho.construct(t.current),r={x:e.x,y:e.y,root:{...u.K$1.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*u.Ho.width(n)-u.Ho.width(s),r.root.x="right"):e.x<.2?r.x=e.x*u.Ho.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*u.Ho.height(n)-u.Ho.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*u.Ho.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...u.K.truncate(r,3)}},Ci=u.Ho.reRoot(u.Ho.DECIMAL,u.K$1.TOP_LEFT),Q1={x:.1,y:.1,root:u.K$1.TOP_LEFT,units:{x:"decimal",y:"decimal"}},Er=g.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,initial:i=Q1,...l})=>{const[a,c]=M.usePurePassthrough({value:t,onChange:n,initial:i}),d=g.useRef(a),x=f.useSyncedRef(r===!1),p=g.useRef(null);a!==null&&(s={...s,...q1(a)});const m=g.useCallback(j=>{if(p.current?.parentElement==null)return d.current;const E=u.Ho.construct(p.current.parentElement),S=u.C.XY.scale(E).scale(Ci),R=S.box(u.Ho.construct(p.current)),v=u.C.XY.clamp(u.Ho.construct(u.Ho.topLeft(Ci),{width:1-u.Ho.width(R),height:1-u.Ho.height(R)})),y=u.K.translate(u.K.construct(d.current),u.Ho.signedDims(S.box(j))),C=v.pos(y);return Xa(C,p)},[]),h=Pe.useCursorDrag({onStart:g.useCallback(()=>{d.current=X1(d.current,p)},[]),onMove:g.useCallback(j=>{if(x.current)return;const E=m(j);E!==null&&c(E)},[]),onEnd:g.useCallback(j=>{if(x.current)return;const E=m(j);E!==null&&(d.current=E)},[])});return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,style:s,onDragStart:h,draggable:r,borderColor:5,ref:p,onDrag:f.preventDefault,onDragEnd:f.preventDefault,background:1,rounded:1,...l})});Er.displayName="Legend.Container";const ks=g.memo(({data:e,onEntryChange:t,onVisibleChange:n,allowVisibleChange:s=!0,background:r=1})=>o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e.sort((i,l)=>i.label.localeCompare(l.label)).map(({key:i,color:l,label:a,visible:c=!0})=>o.jsxRuntimeExports.jsxs(f.Box,{style:{cursor:"pointer",height:"3rem"},x:!0,align:"center",gap:"small",justify:"between",grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(Pe.Swatch,{value:l,onChange:d=>t?.({key:i,color:d,label:a,visible:c}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"tiny"}),o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",value:a,onChange:d=>t?.({key:i,color:l,label:d,visible:c}),overflow:"nowrap",color:c?10:7,onDoubleClick:d=>d.stopPropagation()})]}),s&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.B("visible-toggle"),onClick:d=>{d.stopPropagation(),t?.({key:i,color:l,label:a,visible:!c})},onDoubleClick:d=>d.stopPropagation(),size:"tiny",contrast:r,variant:"text",children:c?o.jsxRuntimeExports.jsx(f.Visible,{}):o.jsxRuntimeExports.jsx(f.Hidden,{})})]},i))}));ks.displayName="LegendSwatches";const yr=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,allowVisibleChange:r=!0,background:i=1,...l})=>{const[a,c]=g.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(Er,{...l,className:r?u.CSS.M("with-visible-toggle"):void 0,draggable:!a,value:n,onChange:s,gap:r?0:"small",background:i,children:o.jsxRuntimeExports.jsx(ks,{data:e,onEntryChange:t,onVisibleChange:c,allowVisibleChange:r,background:i})})},J1=Object.freeze(Object.defineProperty({__proto__:null,Container:Er,LegendSwatches:ks,Simple:yr,calcStickyPos:Xa,completeStickyXYz:qa,stickyXYz:U1},Symbol.toStringTag,{value:"Module"})),Sr=g.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=Qe("Legend");return Qe("Legend"),o.jsxRuntimeExports.jsx(yr,{data:r,onEntryChange:n,...s})});Sr.displayName="FloatingLegend";const e0=({onLineChange:e})=>{const{lines:t}=Qe("Legend"),n=f.useUniqueKey(),s=Pn({key:n,size:t.length>0?36:0,loc:"bottom",order:5},"Legend");return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS.BE("legend","container"),align:"center",x:!0,style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 ",width:"fit-content"},children:o.jsxRuntimeExports.jsx(ks,{data:t,onEntryChange:e,background:0})})},Qa=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(Sr,{...t}):o.jsxRuntimeExports.jsx(e0,{...t}),Rr=g.memo(({aetherKey:e,...t})=>(f.useUnidirectional({aetherKey:e,type:_.Line.TYPE,schema:_.stateZ,state:t}),null));Rr.displayName="Line";const t0=Object.freeze(Object.defineProperty({__proto__:null,Line:Rr},Symbol.toStringTag,{value:"Module"})),Cr=({aetherKey:e,color:t,label:n="",visible:s=!0,...r})=>{const i=f.useUniqueKey(e),{setLine:l,removeLine:a}=Qe("Line");return g.useEffect(()=>(l({key:i,color:t,label:n,visible:s}),()=>a(i)),[n,t,s]),o.jsxRuntimeExports.jsx(Rr,{aetherKey:i,color:t,label:n,visible:s,...r})},Ja=({level:e="h2",...t})=>{const n=f.useUniqueKey(),s=ws.useTypography(e),r=Pn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(f.Box,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{...t,level:e})})},ec=({aetherKey:e,...t})=>{const n=f.useUniqueKey(e),[,,s]=f.use$2({aetherKey:n,type:_.Tooltip.TYPE,schema:_.tooltipStateZ,initialState:{position:null,...t}}),r=g.useRef(null),i=g.useCallback(a=>{const c=document.querySelector(".pluto-canvas-container");if(c==null)return;const d=u.Ho.topLeft(c);s({position:u.K.translation(d,u.K.construct(a))})},[s]),l=g.useCallback(()=>s({position:null}),[s]);return g.useEffect(()=>{if(r.current===null)return;const a=r.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",l),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},n0=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ec},Symbol.toStringTag,{value:"Module"})),tc=()=>{const e=g.useRef(new Map),t=g.useCallback(s=>{const{request:r,response:i}=s,l=e.current.get(r);l!=null&&(l(i.bounds),e.current.delete(r))},[]),[,,n]=f.use$2({type:_.BoundQuerier.TYPE,schema:_.boundQuerierStateZ,onAetherChange:t,initialState:{request:"",response:{request:"",bounds:{}}}});return g.useCallback(async()=>await new Promise(s=>{const r=u.$t.create();e.current.set(r,s),n(i=>({...i,request:r}))}),[])},s0=({ref:e})=>(e.current=tc(),null),o0={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer",cancel:"default"},nc=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:o0[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...u.Ho.css(n),display:u.Ho.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),r0=(e,t)=>{for(;e!=null&&!t(e);)e=e.parentElement;return e},i0=11,l0=6,a0=2,wi=5,c0=e=>u.Ho.width(e)<wi&&u.Ho.height(e)<wi,xn=e=>{const t=u.Ho.width(e),n=u.Ho.height(e);return Math.min(t,n)<.001?i0:l0},u0=["zoom","pan","select","zoomReset","cancel"],wr=[...u0,"click"],d0=se.z.enum(wr),sc=["zoom","select"],pn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},oc={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},rc={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]],cancel:[["Escape"]]},br={zoom:pn,pan:oc,select:rc,zoomReset:pn,click:pn,cancel:pn},x0=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},p0=u.Ho.construct(0,0,1,1,u.K$1.TOP_LEFT),m0={width:30,height:50},ic=({onChange:e,triggers:t,initial:n=p0,threshold:s=m0,ref:r})=>{const i=t?.defaultMode??"zoom",[l,a]=g.useState(u.Ho.ZERO),[c,d]=g.useState(i),[x,p]=f.useStateRef(n),m=g.useRef(u.K.ZERO),h=g.useRef(null),j=u._.construct(s);g.useEffect(()=>p(()=>u.Ho.truncate(n,xn(n))),[n]),g.useEffect(()=>d(i),[i]);const[E,S,R,v]=f.useMemoCompare(()=>{const I={...br[i],...t},D=f.flattenConfig(I),V=x0(I);return[I,D,V,f.flattenConfig(V)]},f.compareModeConfigs,[t]),y=g.useCallback(({box:I,triggers:D,stage:V,cursor:H})=>{if(h.current==null)return;const B=f.determineMode(E,D),$=u.Ho.construct(h.current);if(B==null)return;if(B==="cancel"){a(u.Ho.ZERO),e?.({box:x.current,mode:B,stage:V,cursor:H});return}if(B==="zoomReset")return a(u.Ho.ZERO),e?.({box:u.Ho.DECIMAL,mode:B,stage:V,cursor:H}),p(u.Ho.DECIMAL);const w=c0(I);if(V==="end"){if(w){B==="zoom"&&a(u.Ho.ZERO),e?.({box:x.current,mode:"click",stage:V,cursor:H});return}return p(L=>{if(B==="pan"){const z=bi(I,L,$);return z===null||u.Ho.equals(z,L)?L:(e?.({box:z,mode:B,stage:V,cursor:H}),z)}const O=C(I,L,$);return O===null?L:(e?.({box:O,mode:B,stage:V,cursor:H}),B==="zoom"?(a(u.Ho.ZERO),O):u.Ho.truncate(L,xn(L)))})}if(sc.includes(B))return w?void 0:a(u.C.XY.scale($).clamp($).translate({x:-u.Ho.left($),y:-u.Ho.top($)}).box(vi(j,I,$)));if(a(L=>u.Ho.areaIsZero(L)?L:u.Ho.ZERO),u.K.distance(H,m.current)<a0)return;m.current=H;const P=bi(I,x.current,$);e?.({box:P,mode:B,stage:V,cursor:H})},[a,d,e,E,s.height,s.width,p,h,xn]);g.useImperativeHandle(r,()=>({reset:()=>{a(u.Ho.ZERO),p(u.Ho.DECIMAL),e?.({box:u.Ho.DECIMAL,mode:"zoomReset",stage:"start",cursor:u.K.ZERO})}}),[e]);const C=g.useCallback((I,D,V)=>{const H=No(D,V).box(vi(j,I,V));return u.Ho.truncate(H,xn(H))},[s]),N=f.useHeldRef({triggers:[["Control"]]}),k=f.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const I=D=>{if(h.current==null)return;let V=1;D.deltaY<0?V-=.035:V+=.035;const H=u.Ho.construct(h.current),B=u.K.construct(D);if(Array.from(h.current.children).push(h.current),!u.Ho.contains(H,B)||h.current!==D.target&&r0(D.target,z=>z===h.current)==null)return;const P=No(x.current,u.Ho.construct(h.current)).pos(u.K.construct(D));let O=u.C.XY.magnify({x:N.current.held?1:V,y:k.current.held?1:V}).box(x.current);O=u.Ho.translate(O,{x:N.current.held?0:P.x*(1-V),y:k.current.held?0:P.y*(1-V)}),p(O),e?.({stage:"end",box:O,cursor:u.K.construct(D),mode:"zoom"})};return window.addEventListener("wheel",I),()=>window.removeEventListener("wheel",I)},[p,e]),Fl.useDrag({bound:h,onDrag:y,triggers:S,loose:!0});const A=g.useCallback(({triggers:I,stage:D})=>{if(D==="end")return d(i);const V=f.determineMode(R,I);V!=null&&d(V)},[R,i,e]);return f.use$1({triggers:v,callback:A,region:h}),{maskBox:l,ref:h,mode:c}},No=(e,t)=>u.C.XY.scale(t).clamp(t).scale(e),bi=(e,t,n)=>{let s=u.Ho.signedDims(No(t,n).box(e));s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight};const r=u.C.XY.translate(u.K.construct(s)).box(t);return u.Ho.truncate(r,xn(r))},vi=(e,t,n)=>u.Ho.height(t)<=e.height?u.Ho.construct(u.Ho.left(t),u.Ho.top(n),u.Ho.width(t),u.Ho.height(n)):u.Ho.width(t)<=e.width?u.Ho.construct(u.Ho.left(n),u.Ho.top(t),u.Ho.width(n),u.Ho.height(t)):t,ro=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",children:[o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:u.z.capitalize(e)}),o.jsxRuntimeExports.jsx(f.Box,{empty:!0,x:!0,align:"center",children:o.jsxRuntimeExports.jsx(f.Text$1,{trigger:t[0],level:"small"})})]}),f0=({triggers:e,value:t,onChange:n,disable:s=["zoomReset","click","cancel"],...r})=>{const i=g.useMemo(()=>wr.filter(l=>!s.includes(l)),[s]);return o.jsxRuntimeExports.jsxs(fe.Buttons,{...r,keys:i,value:t,onChange:n,children:[o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"zoom",tooltip:o.jsxRuntimeExports.jsx(ro,{mode:"zoom",triggers:e.zoom}),size:"small",children:o.jsxRuntimeExports.jsx(f.Zoom,{})}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"pan",tooltip:o.jsxRuntimeExports.jsx(ro,{mode:"pan",triggers:e.pan}),size:"small",children:o.jsxRuntimeExports.jsx(f.Pan,{})}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"select",tooltip:o.jsxRuntimeExports.jsx(ro,{mode:"select",triggers:e.select}),size:"small",children:o.jsxRuntimeExports.jsx(f.Selection,{})})]})},h0=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:br,MASK_MODES:sc,MODES:wr,Mask:nc,PAN_DEFAULT_TRIGGERS:oc,SELECT_DEFAULT_TRIGGERS:rc,SelectMode:f0,ZOOM_DEFAULT_TRIGGERS:pn,modeZ:d0,use:ic},Symbol.toStringTag,{value:"Module"})),g0=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,lc=({ref:e,children:t,initial:n=u.Ho.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=Qe("Viewport");g.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:u.K.ZERO,stage:"start"})},[i,n]);const l=g.useCallback(c=>{i(c),s?.(c)},[s,i]),a=ic({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(nc,{className:u.CSS.BE("line-plot","viewport"),...a,children:t})},j0=Object.freeze(Object.defineProperty({__proto__:null,BoundsQuerier:s0,Floating:Sr,Legend:Qa,Line:Cr,LinePlot:Wa,Title:Ja,Tooltip:n0,Viewport:lc,XAxis:Ga,YAxis:Ua,axisFactory:jr,selectViewportEl:g0,useBoundQuerier:tc,useContext:Qe,useGridEntry:Pn,useViewport:Ya},Symbol.toStringTag,{value:"Module"})),E0=({aetherKey:e,...t})=>(f.use$2({aetherKey:e,type:_.Annotation.TYPE,schema:_.annotationStateZ,initialState:t}),null),ac=({aetherKey:e,menu:t,...n})=>{const s=f.useUniqueKey(e),{setViewport:r,setHold:i}=Qe("Range.Provider"),[,{hovered:l,count:a},c]=f.use$2({aetherKey:s,type:_.Provider$2.TYPE,schema:_.providerStateZ$1,initialState:{...n,cursor:null,hovered:null,count:0}}),d=Pn({key:s,loc:"top",size:a>0?32:0,order:3},"Annotation.Provider"),x=f.useContextMenu(),p=f.useSyncedRef(x.visible),m=g.useCallback(j=>c(E=>({...E,cursor:{x:j.clientX,y:j.clientY}})),[c]),h=g.useCallback(()=>{p.current||c(j=>({...j,cursor:null}))},[c,p]);return o.jsxRuntimeExports.jsx(f.ContextMenu,{...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(f.Box,{style:{...d,cursor:l!=null?"pointer":"default",width:"100%",height:"100%"},onContextMenu:x.open,className:x.className,onClick:()=>{l!=null&&(r({box:u.Ho.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:u.K.ZERO,stage:"start"}),i(!0))},onMouseMove:m,onMouseLeave:h})})},y0=Object.freeze(Object.defineProperty({__proto__:null,Annotation:E0,Provider:ac},Symbol.toStringTag,{value:"Module"})),cc={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},S0=f.flattenConfig(cc),uc=({aetherKey:e})=>{const t=f.useUniqueKey(e),[,,n]=f.use$2({aetherKey:t,type:_.Measure.TYPE,schema:_.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=g.useRef(null),r=f.useHeldRef({triggers:S0,loose:!0}),i=g.useCallback(({mode:c,cursor:d})=>{if(c==="click"){const x=f.determineMode(cc,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:d}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[n,r]);Ya(i);const l=g.useCallback(c=>n(d=>({...d,hover:u.K.construct(c)})),[n]),a=g.useCallback(()=>{n(c=>({...c,hover:null}))},[n]);return g.useEffect(()=>{if(s.current===null)return;const c=s.current.parentElement;if(c!=null)return c.addEventListener("mousemove",l),c.addEventListener("mouseleave",a),()=>{c.removeEventListener("mousemove",l),c.removeEventListener("mouseleave",a)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},R0=Object.freeze(Object.defineProperty({__proto__:null,Measure:uc},Symbol.toStringTag,{value:"Module"})),vr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:a,lineWidth:c,lineDash:d,className:x,onSelect:p,style:m,...h})=>{const[j,E]=M.usePurePassthrough({value:t,onChange:s,initial:""}),S=f.useSyncedRef(r),[,{pixelPosition:R},v]=f.use$2({aetherKey:e,type:_.Rule.TYPE,schema:_.ruleStateZ,initialState:{color:a,dragging:!1,position:n,lineWidth:c,lineDash:d},onAetherChange:g.useCallback(({position:B})=>{B!=null&&S.current?.(B)},[S])}),y=g.useRef(R);R!==y.current&&(y.current=R);const{id:C}=Qe("Rule"),k=document.getElementById(C)?.querySelector(".pluto-line-plot__viewport"),A=g.useRef(R);g.useEffect(()=>{v(B=>({...B,position:n,color:a,lineWidth:c,lineDash:d}))},[n,a,c,d]);const I=Pe.useCursorDrag({onStart:g.useCallback(()=>{p?.(),v(B=>({...B,dragging:!0})),A.current=y.current},[]),onMove:B=>{v($=>({...$,pixelPosition:(A.current??0)+u.Ho.signedHeight(B)}))},onEnd:g.useCallback(()=>{v(B=>({...B,dragging:!1})),A.current=R},[])}),D=g.useRef(null);if(n==null||R==null)return null;const V=u.ir.pickByContrast(a,u.ir.BLACK,u.ir.WHITE),H=o.jsxRuntimeExports.jsxs("div",{ref:D,className:u.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:I,draggable:!0}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS(x,u.CSS.BE("rule","tag")),bordered:!0,onClick:p,empty:!0,rounded:!0,style:{borderColor:u.ir.cssString(a),backgroundColor:u.ir.hex(u.ir.setAlpha(a,.7)),...m},...h,children:[o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS.BE("rule","label"),level:"small",value:j,onChange:E,color:V}),o.jsxRuntimeExports.jsx(Zl.Divider$1,{y:!0,style:{borderColor:u.ir.cssString(a)}}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS.BE("rule","value"),children:[o.jsxRuntimeExports.jsx(f.Editable,{value:n.toFixed(2),onChange:B=>{const $=Number(B);isFinite($)&&r?.($)},level:"small",color:V}),l.length>0&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",color:V,value:l,onChange:i})]})]})]});return k==null?H:$l.createPortal(H,k)},C0=Object.freeze(Object.defineProperty({__proto__:null,Rule:vr},Symbol.toStringTag,{value:"Module"})),dc=f.canDropOfType(Nt),w0=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:a,titleLevel:c="h4",onLineChange:d,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:h,enableTooltip:j=!0,enableMeasure:E=!1,initialViewport:S=u.Ho.DECIMAL,legendVariant:R,onViewportChange:v,viewportTriggers:y,rangeAnnotationProvider:C,onSelectRule:N,children:k,...A})=>{const I=t.filter(({location:$})=>u.K$1.isY($)),D=g.useRef(null),V=f.usePrevious(e.length),H=f.usePrevious(A.hold),B=V===0&&e.length!==0||H===!0&&A.hold===!1;return g.useEffect(()=>{B&&D.current?.reset()},[B]),o.jsxRuntimeExports.jsxs(Wa,{...A,children:[I.map(($,w)=>{const P=e.filter(z=>z.axes.x===$.key),L=t.filter(({location:z})=>u.K$1.isX(z)),O=h?.filter(z=>[...L.map(({key:F})=>F),$.key].includes(z.axis));return o.jsxRuntimeExports.jsx(b0,{axis:$,index:w,lines:P,yAxes:L,rules:O,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:N},$.key)}),i&&o.jsxRuntimeExports.jsx(Qa,{onLineChange:d,position:l,onPositionChange:a,variant:R}),n&&o.jsxRuntimeExports.jsx(Ja,{value:s,onChange:r,level:c}),o.jsxRuntimeExports.jsxs(lc,{initial:S,onChange:v,triggers:y,ref:D,children:[j&&o.jsxRuntimeExports.jsx(ec,{}),E&&o.jsxRuntimeExports.jsx(uc,{}),k]})]})},b0=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:a,axis:{location:c,key:d,showGrid:x,...p},annotationProvider:m})=>{const h=f.useDrop({type:"Channel.LinePlot.XAxis",canDrop:dc,onDrop:g.useCallback(({items:S})=>{const R=f.filterByType(Nt,S);return l?.(d,R.map(({key:v})=>v)),R},[d,l])}),j=s?.filter(S=>S.axis===d),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(Ga,{...p,...h,location:c,axisKey:d,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(Nt)(E))),onAutoBoundsChange:S=>a?.({key:d,bounds:S}),onLabelChange:S=>a?.({key:d,label:S}),children:[e.map((S,R)=>{const v=t.filter(C=>C.axes.y===S.key),y=s?.filter(C=>C.axis===S.key);return o.jsxRuntimeExports.jsx(_0,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:v,rules:y,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:a,onSelectRule:i},S.key)}),j?.map(S=>g.createElement(vr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>r?.({key:S.key,label:R}),onPositionChange:R=>r?.({key:S.key,position:R}),onUnitsChange:R=>r?.({key:S.key,units:R}),onSelect:()=>i?.(S.key)})),o.jsxRuntimeExports.jsx(ac,{...m})]})},v0=({channels:{x:e,y:t}})=>`${e??0}-${t}`,_0=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...a},onSelectRule:c})=>{const d=f.useDrop({type:"Channel.LinePlot.YAxis",canDrop:dc,onDrop:g.useCallback(({items:p})=>{const m=f.filterByType(Nt,p);return s?.(i,m.map(({key:h})=>h)),m},[i,s])}),x=f.useDraggingState();return o.jsxRuntimeExports.jsxs(Ua,{...a,...d,location:l,axisKey:i,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(Nt)(x))),onAutoBoundsChange:p=>r?.({key:i,bounds:p}),onLabelChange:p=>r?.({key:i,label:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(N0,{line:p},v0(p))),t?.map(p=>g.createElement(vr,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n?.({key:p.key,label:m}),onPositionChange:m=>n?.({key:p.key,position:m}),onUnitsChange:m=>n?.({key:p.key,units:m}),onClick:()=>c?.(p.key)}))]})},N0=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(k0,{line:e}):o.jsxRuntimeExports.jsx(M0,{line:e}),M0=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:a}=g.useMemo(()=>{const c=Number(t.valueOf())*3,d=_.streamChannelData({timeSpan:t,channel:s,keepFor:c}),x=n!=null&&n!==0;return{xTelem:_.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:c}),yTelem:d}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Cr,{aetherKey:e,y:a,x:l,...i})},k0=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=g.useMemo(()=>{const a=_.channelData({timeRange:e,channel:s}),c=n!=null&&n!==0;return{xTelem:_.channelData({timeRange:e,channel:c?n:s,useIndexOfChannel:!c}),yTelem:a}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Cr,{aetherKey:t,y:l,x:i,...r})},L0=e=>Ie({channel:M.xm.CALCULATION_STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.calculationStatusZ,async t=>{e(t.changed)})}),_r=M.xm.newZ.extend({name:se.z.string().min(1,"Name must not be empty"),dataType:M.$.z.transform(e=>e.toString())}).refine(e=>!e.isIndex||M.$.z.parse(e.dataType).equals(M.$.TIMESTAMP),{message:"Index channel must have data type TIMESTAMP",path:["dataType"]}).refine(e=>e.isIndex||e.index!==0||e.virtual,{message:"Data channel must have an index",path:["index"]}).refine(e=>e.virtual||!M.$.z.parse(e.dataType).isVariable,{message:"Persisted channels must have a fixed-size data type",path:["dataType"]}),xc=_r.extend({expression:se.z.string().min(1,"Expression must not be empty").refine(e=>e.includes("return"),{message:"Expression must contain a return statement"})}).refine(e=>e.requires?.length>0,{message:"Expression must use at least one channel",path:["requires"]}),Ls=e=>({...e.payload,dataType:e.dataType.toString()}),Nr={key:0,name:"",index:0,dataType:M.$.FLOAT32.toString(),internal:!1,isIndex:!1,leaseholder:0,virtual:!1,expression:"",requires:[]},pc=async({client:e,params:{key:t}})=>{if(t==null)return null;const n=await e.channels.retrieve(t);return Ls(n)},mc=async({client:e,value:t,onChange:n})=>{const s=await e.channels.create(t);n(Ls(s))},P0=e=>Bt({name:"Channel",schema:_r,initialValues:Nr,retrieve:pc,update:mc,listeners:[{channel:M.xm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:t,onChange:n,params:s,client:r})=>{s.key===t&&n(Ls(await r.channels.retrieve(t)))})}]})(e),T0=e=>Bt({name:"Calculated Channel",schema:xc,initialValues:Nr,retrieve:pc,update:mc,listeners:[{channel:M.xm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:t,onChange:n,params:s,client:r})=>{s.key===t&&n(Ls(await r.channels.retrieve(t)))})}]})(e),A0={internal:!1},Mr=Ve({name:"Channels",retrieve:async({client:e,params:t})=>await e.channels.retrieve({...A0,...t,searchTerm:t.searchTerm}),retrieveByKey:async({client:e,key:t})=>await e.channels.retrieve(t),listeners:[{channel:M.xm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:e,onChange:t,client:n})=>{t(e,await n.channels.retrieve(e))})},{channel:M.xm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:e,onDelete:t})=>t(e))}]}),fc=e=>{if(e==null)return f.Channel;if(M.xm.isCalculated(e))return f.Calculation;if(e.isIndex)return f.Index;const t=new u.r(e.dataType);return t.isInteger?f.Binary:t.isFloat?f.Decimal:t.equals(u.r.STRING)?f.String:t.equals(u.r.JSON)?f.JSON:f.Channel},hc=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e),s=Na(),r=fc(n?.payload),i=s[n?.key??0]??n?.name??"";return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,children:[o.jsxRuntimeExports.jsx(r,{}),i]})}),I0=({onChange:e,value:t,emptyContent:n,initialParams:s,filter:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Mr({initialParams:s,filter:r}),{fetchMore:p,search:m}=Je.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Channel",value:t,onChange:e,data:l,haulType:Nt,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...i,children:hc})},Mt=({onChange:e,value:t,allowNone:n,emptyContent:s,initialParams:r,filter:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=Mr({initialParams:r,filter:i}),{fetchMore:m,search:h}=Je.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(It,{resourceName:"Channel",onChange:e,value:t,allowNone:n,emptyContent:s,onFetchMore:m,onSearch:h,data:a,getItem:d,subscribe:x,status:p,haulType:Nt,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...l,children:hc})},O0=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:d1,AliasProvider:Za,LinePlot:w0,SelectMultiple:I0,SelectSingle:Mt,ZERO_FORM_VALUES:Nr,calculatedFormSchema:xc,formSchema:_r,resolveIcon:fc,useActiveRange:u1,useAlias:xr,useAliasSetter:Ma,useAliases:Na,useCalculatedForm:T0,useCalculationStatusSynchronizer:L0,useForm:P0,useList:Mr,useName:Ms},Symbol.toStringTag,{value:"Module"})),gc=({yDirection:e="up",...t})=>o.jsxRuntimeExports.jsxs(fe.Buttons,{...t,keys:u.g.DIRECTIONS,children:[o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"x",children:o.jsxRuntimeExports.jsx(f.Arrow.Right,{})}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"y",children:e==="up"?o.jsxRuntimeExports.jsx(f.Arrow.Up,{}):o.jsxRuntimeExports.jsx(f.Arrow.Down,{})})]}),B0=Object.freeze(Object.defineProperty({__proto__:null,Select:gc},Symbol.toStringTag,{value:"Module"})),D0=e=>Ie({channel:M.zm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.deviceZ,async({changed:t})=>e(t))}),H0=()=>ct({name:"Device",retrieve:async({client:e,params:t})=>await e.hardware.devices.retrieve({key:t.key,includeStatus:!0}),listeners:[{channel:M.zm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.deviceZ,async({onChange:e,changed:t})=>e(n=>t.key!==n.key?n:t))},{channel:M.zm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.statusZ,async({changed:e,onChange:t})=>{t(n=>(e.details.device!==n.key||(n.status=e),n))})}]}),jc=Ve({name:"Devices",retrieve:async({client:e,params:t})=>await e.hardware.devices.retrieve({includeStatus:!0,...t}),retrieveByKey:async({client:e,key:t})=>await e.hardware.devices.retrieve({key:t,includeStatus:!0}),listeners:[{channel:M.zm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.deviceZ,async({onChange:e,changed:t})=>e(t.key,t))},{channel:M.zm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M.zm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.statusZ,async({changed:e,onChange:t})=>{t(e.details.device,n=>n==null?n:{...n,status:e})})}]}),z0=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e);return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,className:u.CSS.BE("device","list-item"),justify:"between",align:"center",children:[o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(Ec,{status:n?.status}),n?.name]}),o.jsxRuntimeExports.jsx(sr,{level:"small",color:9,weight:450,style:{marginTop:"0.25rem"},gap:"tiny",children:n?.location.split(".").map(s=>o.jsxRuntimeExports.jsx(En,{children:s},s))})]})}),$0=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,disabled:l,icon:a=o.jsxRuntimeExports.jsx(f.Device,{}),...c})=>{const{data:d,retrieve:x,getItem:p,subscribe:m,status:h}=jc({filter:n,initialParams:i}),{fetchMore:j,search:E}=Je.usePager({retrieve:x});return o.jsxRuntimeExports.jsx(It,{resourceName:"Device",value:t,onChange:e,data:d,getItem:p,subscribe:m,onFetchMore:j,onSearch:E,emptyContent:r,status:h,disabled:l,icon:a,...c,children:z0})},Ec=({status:e,tooltipLocation:t="right"})=>{const n=e?.variant??"disabled",s=e?.message??"Device Status Unknown";return o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:n,hideIcon:!0,level:"small",weight:450,children:s}),o.jsxRuntimeExports.jsx(er,{variant:n,className:u.CSS.BE("device","status-indicator")})]})},V0=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:$0,StatusIndicator:Ec,retrieve:H0,useList:jc,useSetSynchronizer:D0},Symbol.toStringTag,{value:"Module"})),yc=Ve({name:"Racks",retrieve:async({client:e,params:t})=>await e.hardware.racks.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.hardware.racks.retrieve({key:t}),listeners:[{channel:M.Vm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.statusZ,async({changed:e,onChange:t})=>t(e.details.rack,n=>n==null?n:{...n,status:e}))},{channel:M.Vm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.keyZ,async({changed:e,onChange:t,client:n})=>t(e,(await n.hardware.racks.retrieve({key:e})).payload))},{channel:M.Vm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.keyZ,async({changed:e,onDelete:t})=>t(e))}]}),F0=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,align:"center",justify:"between",children:[o.jsxRuntimeExports.jsx(f.Text,{children:n?.name}),o.jsxRuntimeExports.jsx(Sc,{status:n?.status,tooltipLocation:"left"})]})}),Z0=({value:e,onChange:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=yc({initialParams:{includeStatus:!0,...i},filter:n}),{fetchMore:m,search:h}=Je.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(It,{resourceName:"Driver",value:e,onChange:t,data:a,getItem:d,subscribe:x,onFetchMore:m,onSearch:h,emptyContent:r,status:p,icon:o.jsxRuntimeExports.jsx(f.Rack,{}),...l,children:F0})},Sc=({status:e,tooltipLocation:t="right"})=>{const n=g.useRef(null),s=e?.variant??"disabled";return g.useEffect(()=>{if(s!=="success")return;const r=n.current;r&&(r.classList.remove(u.CSS.BEM("rack","heartbeat","beat")),requestAnimationFrame(()=>r.classList.add(u.CSS.BEM("rack","heartbeat","beat"))))},[e]),o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:s,hideIcon:!0,level:"small",weight:450,children:e?.message}),o.jsxRuntimeExports.jsx(f.Heart,{ref:n,className:u.CSS.BE("rack","heartbeat"),style:{color:Jo[s]}})]})},kr=e=>Ie({channel:M.Vm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.statusZ,async t=>{e(t.changed)})}),K0=e=>{const t=et(),[n,s]=g.useState(void 0);We(async i=>{if(t==null||e===0){s(void 0);return}const l=await t.hardware.racks.retrieve({key:e});i.aborted||s(l)},[t,e]);const r=g.useCallback(i=>{n==null||t==null||s(t.hardware.racks.sugar({...n.payload,status:i}))},[n,t]);return kr(r),n},Y0=e=>{const t=et(),[n,s]=g.useState(void 0);We(async i=>{if(t==null)return;const{status:l}=await t.hardware.racks.retrieve({key:e,includeStatus:!0});i.aborted||s(l)},[t]);const r=g.useCallback(i=>{i.details.rack===e&&s(i)},[e]);return kr(r),n},W0=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Z0,StatusIndicator:Sc,use:K0,useList:yc,useStatus:Y0,useStatusSynchronizer:kr},Symbol.toStringTag,{value:"Module"})),G0=e=>Ie({channel:M._m.COMMAND_CHANNEL_NAME,onChange:_.parsedHandler(M._m.commandZ,async t=>{e(t.changed)})}),U0=(e,t=se.z.unknown())=>Ie({channel:M._m.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M._m.statusZ(t),async n=>{e(n.changed)})}),q0=["start","stop"],X0=e=>ct({name:"Task",retrieve:async({client:t,params:{key:n}})=>n==null?null:await t.hardware.tasks.retrieve({key:n,includeStatus:!0,schemas:e}),listeners:[{channel:M._m.SET_CHANNEL_NAME,onChange:_.parsedHandler(M._m.keyZ,async({client:t,changed:n,onChange:s,params:{key:r}})=>{r==null||n!==r||s(await t.hardware.tasks.retrieve({key:r,schemas:e}))})}]}),Q0=Ve({name:"Task",retrieve:async({client:e,params:t})=>await e.hardware.tasks.retrieve({includeStatus:!0,...t}),retrieveByKey:async({client:e,key:t})=>await e.hardware.tasks.retrieve({key:t}),listeners:[{channel:M._m.SET_CHANNEL_NAME,onChange:_.parsedHandler(M._m.keyZ,async({client:e,changed:t,onChange:n})=>n(t,await e.hardware.tasks.retrieve({key:t})))},{channel:M._m.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M._m.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M._m.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M._m.statusZ(se.z.unknown()),async({changed:e,onChange:t,client:n})=>{t(e.details.task,s=>s==null?s:n.hardware.tasks.sugar({...s,status:e}))})},{channel:M._m.COMMAND_CHANNEL_NAME,onChange:_.parsedHandler(M._m.commandZ,async({changed:e,onChange:t,client:n})=>{t(e.task,s=>s==null||!q0.includes(e.type)?s:n.hardware.tasks.sugar({...s,status:u._r.create({variant:"loading",message:"Executing command...",details:{task:e.task,running:!0,data:{}}})}))})}]}),J0=Object.freeze(Object.defineProperty({__proto__:null,createRetrieveQuery:X0,useCommandSynchronizer:G0,useList:Q0,useStatusSynchronizer:U0},Symbol.toStringTag,{value:"Module"})),Ps=new Error("Tab not found"),ej=new Error("Invalid Mosaic"),ls=(e,t,n="center",s,r)=>{if(e=tt(e),s===void 0)return Mo(e,t);const i=ko(e,s);if(n==="center")return i.tabs||=[],r!==void 0&&r>=0&&r<=i.tabs.length?i.tabs.splice(r,0,t):i.tabs.push(t),i.selected=t.tabKey,e;const l=i.key*2,a=i.key*2+1,c=n==="top"||n==="left"?l:a;if(ko(e,c).key!==i.key)return ls(e,t,"center",c);if(i.tabs==null||i.tabs.length===0)return ls(e,t,"center",s);const[d,x,p]=ij(n);if(i.direction=p,i[d]={key:0,tabs:[t],selected:t.tabKey},i[x]={key:0,tabs:i.tabs,selected:i.selected},i.first==null||i.last==null)throw ej;return i.first.key=l,i.last.key=a,i.tabs=void 0,i.size=void 0,i.selected=void 0,e},tj=(e,t,n)=>{e=tt(e);const[s,r]=kt(e,t);if(s==null||r==null)throw Ps;return r.tabs=r.tabs?.map(i=>i.tabKey===t?n(i):i),e},Mo=(e,t)=>(e=tt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Mo(e.first,t):e.last!=null&&(e.last=Mo(e.last,t)),e)),as=e=>{e=tt(e);const t=[];if(e.tabs!=null&&(e.selected=Me.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=as(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=as(e.last);e.last=n,t.push(...s)}return[e,t]},Lr=(e,t)=>{e=tt(e);const[,n]=kt(e,t);if(n==null)return[e,null];n.tabs=n.tabs?.filter(r=>r.tabKey!==t),n.selected=Me.resetSelection(n.selected,n.tabs),e=rj(e);const s=n.selected??cs(e);return[e,s]},cs=e=>e.selected!=null?e.selected:e.first!=null?cs(e.first):e.last!=null?cs(e.last):null,Rc=(e,t)=>{e=tt(e);const[n,s]=kt(e,t);if(n==null||s==null)throw Ps;return s.selected=t,e},Cc=(e,t,n,s,r)=>{e=tt(e);const[i,l]=kt(e,t);if(i==null||l==null)throw Ps;const[a,c]=Lr(e,t);return[ls(a,i,n,s,r),c]},yn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=yn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=yn(e.last,t);if(n!=null)return n}},wc=(e,t,n)=>{const s=us(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},nj=(e,t,n)=>{e=tt(e);const s=yn(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,c={key:s.key*2+1,tabs:[i],selected:i.tabKey},d={key:l,tabs:s.tabs,selected:s.selected};return d.selected=Me.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=c,s.tabs=void 0,s.selected=void 0,e},sj=(e,t)=>{const n=yn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},bc=(e,t,n)=>{e=tt(e);const[,s]=kt(e,t);if(s?.tabs==null)throw Ps;return s.tabs=Me.rename(t,n,s?.tabs??[]),e},oj=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,ko=(e,t)=>{const n=us(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:ko(e,s)},rj=e=>{let t=!0;for(;t;)[e,t]=Lo(e);return e=To(e,1),e},Lo=e=>{if(e.first==null||e.last==null)return[e,!1];if(Ni(e.first))return[_i(e.last),!0];if(Ni(e.last))return[_i(e.first),!0];let t,n;return[e.first,t]=Lo(e.first),[e.last,n]=Lo(e.last),[e,t||n]},_i=e=>(e.size=void 0,e),Ni=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),kt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(a=>a.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=kt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=kt(e.last,t);return[r,i]},us=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=us(e.first,t);return n??us(e.last,t)},ij=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")}},tt=e=>M.m.copy(e),ds=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ds(e.first,t,n),e.last!=null&&ds(e.last,t,n),n),Po=(e,t)=>{t(e),e.first!=null&&Po(e.first,t),e.last!=null&&Po(e.last,t)},To=(e,t)=>(e=tt(e),e.key=t,e.first!=null&&(e.first=To(e.first,t*2)),e.last!=null&&(e.last=To(e.last,t*2+1)),e);class vc{parent;stub;el;constructor(t={}){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 lj=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),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 r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},_c=({node:e,children:t})=>$l.createPortal(t,e.el),aj=Object.freeze(Object.defineProperty({__proto__:null,In:_c,Node:vc,Out:lj},Symbol.toStringTag,{value:"Module"})),xs=g.memo(({root:e,onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,activeTab:l,emptyContent:a,onSelect:c,onClose:d,onRename:x,onReorder:p,contextMenu:m,addTooltip:h,...j})=>{const{tabs:E,direction:S,first:R,last:v,key:y,size:C}=e,N={onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,onClose:d,contextMenu:m,onSelect:c,onRename:x,onReorder:p,activeTab:l,addTooltip:h},k=g.useCallback(([V])=>n(y,V),[n]),{props:A}=ea({direction:S,onResize:k,count:2,initialSizes:C!=null?[C]:void 0});let I={};y==1&&(I={...j,className:u.CSS(u.CSS.B("mosaic"))});let D;return E!==void 0?D=o.jsxRuntimeExports.jsx(Nc,{root:e,emptyContent:a,...I,...N}):R!=null&&v!=null?D=o.jsxRuntimeExports.jsxs(ta,{id:`mosaic-${y}`,align:"stretch",...A,...I,children:[o.jsxRuntimeExports.jsx(xs,{...N,root:R,onResize:n},R.key),o.jsxRuntimeExports.jsx(xs,{...N,root:v,onResize:n},v.key)]}):(D=null,console.warn("Mosaic tree is malformed")),D});xs.displayName="Mosaic";const ps="pluto-mosaic-tab-drop",Pr="pluto-mosaic-tab-create",cj=(e,t,n)=>{if(f.filterByType(f.FILE_TYPE,t).length>0&&n)return!0;const r=f.filterByType(ps,t).map(a=>a.key),i=e.filter(a=>!r.includes(a.tabKey)).length>0;return f.filterByType(Pr,t).length>0||r.length>0&&(i||e.length===0)},Nc=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,className:i,onReorder:l,onFileDrop:a,addTooltip:c,...d})=>{const{key:x,tabs:p}=e,[m,h]=g.useState(null),j=a!=null,E=g.useCallback(({items:D})=>cj(p,D,j),[p,j]),S=g.useCallback(({items:D,event:V})=>{if(V==null)return[];const H=dj(V);h(null);const B=f.filterByType(f.FILE_TYPE,D).length>0,{percents:$}=Mi(V),w=p.length===0?"center":ki($);if(B)return a?.(x,w,V),D;const P=f.filterByType(ps,D);if(P.length>0){const O=P.map(({key:z})=>z)[0];t(x,O,w,H)}const L=f.filterByType(Pr,D);if(L.length>0){const O=L.map(({key:z})=>z);n?.(x,w,O)}return P},[t,p.length]),R=g.useCallback(({event:D})=>{if(D==null)return;const{percents:V,inSelector:H}=Mi(D);let B=null;H||(B=p.length===0?"center":ki(V)),h(B)},[p.length]),{startDrag:v,...y}=f.useDragAndDrop({type:"Mosaic",canDrop:E,onDrop:S,onDragOver:R}),C=E(f.useDraggingState()),N=g.useCallback(()=>h(null),[]),k=g.useCallback((D,{tabKey:V})=>{v([{key:V,type:ps,elementID:D.currentTarget.id}])},[v]),A=g.useCallback(()=>n?.(x,"center"),[x]),I=x==1&&p.length==0;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:o.jsxRuntimeExports.jsxs(Me.Tabs,{id:`tab-${x}`,tabs:p,className:u.CSS(i,I&&m!=null&&u.CSS.M("drag-over")),onDragLeave:N,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:k,onCreate:A,addTooltip:c,...y,...d,children:[e.selected!=null&&r(p.find(D=>D.tabKey===e.selected)),C&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),m!=null&&o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:uj[m]})]})})});Nc.displayName="MosaicTabLeaf";const uj={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%"}},Mi=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{percents:{x:.5,y:.5},inSelector:!0}:{percents:{x:n/t.width,y:s/t.height},inSelector:!1}},dj=e=>{const t=e.target.closest(".pluto-tabs-selector__btn");if(t!=null)return Array.from(t.parentElement?.children??[]).indexOf(t)},xj=e=>e,pj=e=>1-e,ki=({x:e,y:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[xj(e),pj(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")},mj=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),r=new Set,i=ds(e,l=>l.tabs?.map(a=>{let c=s.current.get(a.tabKey);return a==null?null:(c==null&&(c=new vc({style:"width: 100%; height: 100%; position: relative;"}),c.el.addEventListener("click",()=>t?.(a.tabKey)),s.current.set(a.tabKey,c)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(_c,{node:c,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})).flat().filter(l=>l!=null);return s.current.forEach((l,a)=>!r.has(a)&&s.current.delete(a)),[s,i]},Ao=se.z.object({key:se.z.number(),tabs:se.z.array(Me.tabZ).optional(),selected:se.z.string().optional(),direction:u.g.direction.optional(),size:se.z.number().optional(),get first(){return Ao.optional()},get last(){return Ao.optional()}}),fj=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(as(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>Cc(m,x,p,d)[0]),onClose:d=>s(x=>Lr(x,d)[0]),onSelect:d=>s(x=>Rc(x,d)),onResize:(d,x)=>s(p=>wc(p,d,x)),onRename:e?(d,x)=>s(p=>bc(p,d,x)):void 0}},hj=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Pr,HAUL_DROP_TYPE:ps,Mosaic:xs,autoSelectTabs:as,canSplit:sj,findSelected:cs,findTabNode:yn,forEachNode:Po,insertTab:ls,isEmpty:oj,mapNodes:ds,moveTab:Cc,nodeZ:Ao,removeTab:Lr,renameTab:bc,resizeNode:wc,selectTab:Rc,split:nj,updateTab:tj,use:fj,usePortal:mj},Symbol.toStringTag,{value:"Module"})),gj=({variant:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...n}),jj=Object.freeze(Object.defineProperty({__proto__:null,Note:gj},Symbol.toStringTag,{value:"Module"})),io={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})},Ej=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{gap:1.5,x:!0,className:u.CSS(u.CSS.B("macos-controls"),!n&&u.CSS.BM("macos-controls","blurred"),t),...a,children:[o.jsxRuntimeExports.jsx(lo,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:io.Close}),o.jsxRuntimeExports.jsx(lo,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:io.Minimize}),o.jsxRuntimeExports.jsx(lo,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:io.Maximize})]}),lo=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,...s}),yj=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,contrast:l=2,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{pack:!0,...a,children:[o.jsxRuntimeExports.jsx(ao,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Subtract,{})}),o.jsxRuntimeExports.jsx(ao,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Box$1,{})}),o.jsxRuntimeExports.jsx(ao,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),ao=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Mc=u.S.getOS,Sj="Windows",Rj=({forceOS:e,visibleIfOS:t,...n})=>{const s=Mc({force:e,default:Sj});if(t!=null&&t!==s)return null;const r=s==="macOS"?Ej:yj;return o.jsxRuntimeExports.jsx(r,{...n})},Cj=Object.freeze(Object.defineProperty({__proto__:null,Controls:Rj,use:Mc},Symbol.toStringTag,{value:"Module"})),wj=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},bj=Object.freeze(Object.defineProperty({__proto__:null,createComponent:wj},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:M.O.NOOP});const vj=({children:e,...t})=>{const{path:n}=f.useUnidirectional({type:M.Provider$1.TYPE,schema:M.providerStateZ,state:t});return o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})},_j="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",kc=({children:e})=>{const{path:t}=f.useUnidirectional({type:_.BaseProvider.TYPE,schema:_.providerStateZ$2,state:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},Nj=new Set([u.r.UUID,u.r.JSON]),Mj=e=>{if(e.equals(u.r.JSON))return o.jsxRuntimeExports.jsx(f.JSON,{});if(e.isInteger)return o.jsxRuntimeExports.jsx(f.Binary,{});if(e.isFloat)return o.jsxRuntimeExports.jsx(f.Decimal,{});if(e.equals(u.r.STRING)||e.equals(u.r.UUID))return o.jsxRuntimeExports.jsx(f.String,{});if(e.equals(u.r.TIMESTAMP))return o.jsxRuntimeExports.jsx(f.Time$1,{})},Lc=u.r.ALL.filter(e=>e!==u.r.UNKNOWN).map(e=>({key:e.toString(),name:Nj.has(e)?e.toString().toUpperCase():u.z.capitalize(e.toString()),icon:Mj(e)})),kj=Lc.filter(e=>!new u.r(e.key).isVariable),Lj=({hideVariableDensity:e=!1,...t})=>{const n=e?kj:Lc;return o.jsxRuntimeExports.jsx(Nn,{...t,data:n,resourceName:"Data Type"})},Pj=Object.freeze(Object.defineProperty({__proto__:null,Provider:kc,SelectDataType:Lj},Symbol.toStringTag,{value:"Module"})),Tj=e=>{switch(e.variant){case"disabled":return e.details?.valid===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l12)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l7)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return e.details?.authority===M.Lm.ABSOLUTE_AUTHORITY?{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 schematic to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Pc=({source:e,sink:t,className:n,...s})=>{const r=f.useMemoDeepEqual({source:e,sink:t}),[,{status:i},l]=f.use$2({type:_.Chip.TYPE,schema:_.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:u.n.now(),details:{}}}});g.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const a=g.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:c,chipColor:d,buttonStyle:x,disabled:p}=Tj(i);return o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:a,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:c}),style:x,...s,children:o.jsxRuntimeExports.jsx(f.Circle,{color:d})})},Tc=g.createContext({needsControlOf:[]}),Ac=()=>g.use(Tc),Aj=({children:e,onStatusChange:t,...n})=>{const s=f.useMemoDeepEqual(n),[{path:r},{status:i,needsControlOf:l},a]=f.use$2({type:_.Controller.TYPE,schema:_.controllerStateZ,initialState:s});return g.useEffect(()=>{i!=null&&t?.(i)},[i,t]),g.useEffect(()=>{a(c=>({...c,...s}))},[s,a]),g.useEffect(()=>()=>t?.("released"),[]),o.jsxRuntimeExports.jsxs(Tc,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e}),";"]})},Ic=({colorSource:e,statusSource:t})=>{const n=f.useMemoDeepEqual({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=f.use$2({type:_.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:u.n.now(),details:{color:void 0}}},schema:_.indicatorStateZ});g.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return r.details?.color!=null?l=u.ir.colorZ.parse(r.details.color):s!=null&&!u.ir.isZero(s)?l=s:l="var(--pluto-gray-l10)",o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(f.Text,{children:r.message}),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.ir.cssString(l),flexGrow:1}})]})},Ij=e=>{const{needsControlOf:t}=Ac(),[,{states:n},s]=f.use$2({type:_.Legend.TYPE,schema:_.legendStateZ,initialState:{states:[],needsControlOf:t}});g.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=u.c.unique(n.map(l=>l.subject.key)).map(l=>{const a=n.find(c=>c.subject.key===l);if(a==null)throw new M.lt("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return o.jsxRuntimeExports.jsx(yr,{data:i,...e})},Oc=({children:e})=>{const[{path:t}]=f.use$2({type:_.StateProvider.TYPE,schema:_.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},Oj=Object.freeze(Object.defineProperty({__proto__:null,Chip:Pc,Controller:Aj,Indicator:Ic,Legend:Ij,StateProvider:Oc,useContext:Ac},Symbol.toStringTag,{value:"Module"})),Bc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Bj=Bc(kc),Dj=Bc(f.Provider$4),Hj=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:a,haul:c,channelAlias:d,telem:x,color:p})=>o.jsxRuntimeExports.jsx(f.Provider$1,{...l,children:o.jsxRuntimeExports.jsx(f.Config,{...i,children:o.jsxRuntimeExports.jsx(f.Provider$2,{...c,children:o.jsxRuntimeExports.jsx(f.Provider$3,{url:s??_j,enabled:n,children:o.jsxRuntimeExports.jsx(Dj,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(vj,{...a,children:o.jsxRuntimeExports.jsx(f.Aggregator,{children:o.jsxRuntimeExports.jsx(pa,{connParams:t,children:o.jsxRuntimeExports.jsx(wa,{children:o.jsxRuntimeExports.jsx(Za,{...d,children:o.jsxRuntimeExports.jsx(Pe.Provider,{...p,children:o.jsxRuntimeExports.jsx(f.Provider,{...r,children:o.jsxRuntimeExports.jsx(Bj,{...x,children:o.jsxRuntimeExports.jsx(Oc,{children:e})})})})})})})})})})})})})}),zj=Object.freeze(Object.defineProperty({__proto__:null,Provider:Hj},Symbol.toStringTag,{value:"Module"})),$j=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Vj=Object.freeze(Object.defineProperty({__proto__:null,Progress:$j},Symbol.toStringTag,{value:"Module"})),Fj=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsxs(f.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(f.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l10)"}})]},i.key))})},Zj=Object.freeze(Object.defineProperty({__proto__:null,Steps:Fj},Symbol.toStringTag,{value:"Module"})),Kj=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=f.use$2({type:_.Table.TYPE,schema:_.Table.stateZ,initialState:{region:u.Ho.ZERO,visible:n}});g.useEffect(()=>{i(a=>({...a,visible:n}))},[n]);const l=Ln(a=>i(c=>({...c,region:a})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e})})})]})},Yj=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...a})=>o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...a,children:[r!=null&&o.jsxRuntimeExports.jsx(Hc,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),Tr=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),Dc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Wj=e=>Dc[e],Hc=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const a=f.useSyncedRef(e),c=g.useRef(e),d=Pe.useCursorDrag({onStart:g.useCallback(()=>{c.current=a.current},[]),onMove:g.useCallback(x=>s(c.current+u.Ho.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:u.CSS(u.CSS.BE("table","resizer"),u.CSS.dir(i),u.CSS.selected(t),f.CONTEXT_TARGET,t&&f.CONTEXT_SELECTED),style:{[u.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(f.Text,{full:"x",justify:"center",align:"center",square:!1,children:i==="x"?Dc[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.g.location(i)]:r+e},onDragStart:d,draggable:!0})]})},Gj=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const a=r;return r+=i,o.jsxRuntimeExports.jsx(Hc,{onSelect:t,position:a,selected:e.includes(l),index:l,value:i,onChange:c=>s(c,l),direction:"x"},l)})]})},Uj=Object.freeze(Object.defineProperty({__proto__:null,Cell:Tr,ColumnIndicators:Gj,Row:Yj,Table:Kj,getCellColumn:Wj},Symbol.toStringTag,{value:"Module"})),zc=se.z.object({bounds:u.W.bounds,gradient:u.ir.gradientZ}),Ar={bounds:{lower:0,upper:1},gradient:[]},Li={size:"small",showDragHandle:!1},Pi={width:60},qj=u.C.Scale.scale(0,1),Ir=({path:e})=>{const{set:t,get:n}=sn(),s=cr(`${e}.bounds`),r=qj.scale(s);return o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(He,{inputProps:Li,style:Pi,label:"Lower",path:`${e}.bounds.lower`}),o.jsxRuntimeExports.jsx(Ee,{path:`${e}.gradient`,label:"Gradient",align:"start",padHelpText:!1,children:({value:i,onChange:l})=>o.jsxRuntimeExports.jsx(Pe.GradientPicker,{value:M.m.copy(i),scale:r,onChange:a=>{const d={...n(`${e}.bounds`).value},x=a.map(S=>S.position),p=r.pos(Math.max(...x)),m=r.pos(Math.min(...x)),h=p>d.upper,j=m<d.lower;h&&(a[a.length-1].position=1,d.upper=p),j&&(a[0].position=0,d.lower=m);const E=a.map(S=>({...S,color:u.ir.hex(S.color)}));h||j?t(e,{bounds:d,gradient:E}):l(a.map(S=>({...S,color:u.ir.hex(S.color)})))}})}),o.jsxRuntimeExports.jsx(He,{inputProps:Li,style:Pi,label:"Upper",path:`${e}.bounds.upper`})]})},Xj=e=>o.jsxRuntimeExports.jsxs(fe.Buttons,{...e,keys:u.mr.NOTATIONS,children:[o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"standard",children:"Standard"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"scientific",children:"Scientific"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"engineering",children:"Engineering"})]}),Qj=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Or=({path:e})=>{const{value:t,onChange:n}=Et(e),s=_.sourcePipelinePropsZ.parse(t.telem?.props),r=_.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=_.stringifyNumberProps.parse(s.segments.stringifier.props),l=_.rollingAverageProps.parse(s.segments.rollingAverage.props),a=h=>{const j=_.sourcePipeline("string",{connections:Qj,segments:{valueStream:_.streamChannelValue({channel:r.channel}),stringifier:_.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:_.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:j})},c=h=>a({valueStream:_.streamChannelValue({channel:h??0})}),d=h=>a({stringifier:_.stringifyNumber({...i,notation:h})}),x=h=>a({stringifier:_.stringifyNumber({...i,precision:h})}),p=h=>a({rollingAverage:_.rollingAverage({windowSize:h})});if(typeof r.channel!="number")throw new Error("Must pass in a channel by key to Value.TelemForm");const[m]=Ms(r.channel);return g.useEffect(()=>n({...t,tooltip:[m]}),[m]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Mt,{value:r.channel,onChange:c})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(Xj,{value:i.notation,onChange:d})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},Jj=_.Value.z.partial({color:!0}).extend({level:M.levelZ.optional()}),Br=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:a,notation:c,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m})=>{const h=f.useMemoDeepEqual({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:c,backgroundTelem:a,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m}),[,j,E]=f.use$2({aetherKey:e,type:_.Value.TYPE,schema:_.Value.z,initialState:h});return g.useEffect(()=>E(S=>({...S,...h})),[h]),{width:j.width??j.minWidth}},e2=Object.freeze(Object.defineProperty({__proto__:null,RedlineForm:Ir,TelemForm:Or,ZERO_READLINE:Ar,corePropsZ:Jj,redlineZ:zc,use:Br},Symbol.toStringTag,{value:"Module"})),t2="text",$c=se.z.object({value:se.z.string(),level:M.levelZ,weight:M.weightZ,align:u.K$1.x.or(u.K$1.center),backgroundColor:u.ir.crudeZ}),Vc=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:a,backgroundColor:c})=>{const d=p=>r(e,p),x=p=>t({level:l,value:p,weight:a,align:i,backgroundColor:c});return o.jsxRuntimeExports.jsx(Tr,{id:e,className:u.CSS(f.CONTEXT_TARGET,s&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","text")),selected:s,onClick:d,onContextMenu:d,style:{backgroundColor:u.ir.cssString(c)},children:o.jsxRuntimeExports.jsx(f.Editable,{level:l,value:n,weight:a,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},n2="value",Fc=se.z.object({telem:_.stringSourceSpecZ,redline:zc,level:M.levelZ,color:se.z.string(),units:se.z.string()}),Zc=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:a,onSelect:c})=>{const{width:d}=Br({aetherKey:e,box:a,telem:t,level:n,color:s,backgroundTelem:_.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:_.scaleNumber({scale:u.C.Scale.scale(i).scale(0,1).transform}),gradient:_.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>c(e,p);return o.jsxRuntimeExports.jsx(Tr,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:d},className:u.CSS(f.CONTEXT_TARGET,l&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},s2={padding:"2rem"},co=e=>o.jsxRuntimeExports.jsx(f.Box,{...e,style:s2,y:!0}),o2=[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],Kc=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsx(Or,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsx(Ir,{path:"redline"})});default:return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Dr,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(Pe.Swatch,{value:r??u.ir.setAlpha(u.ir.ZERO,1),onChange:i,...a,bordered:!0})}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(nn,{value:r,onChange:i,...a})})]})})}},[]),n=Me.useStatic({tabs:o2,content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n,size:"small"})},r2={padding:"2rem"},Yc=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,style:r2,children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Dr,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(ur,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(nn,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"weight",label:"Weight",padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(ca,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"align",label:"Alignment",hideIfNull:!0,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(fe.SelectAlignment,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(Pe.Swatch,{value:t,onChange:n})})]}),i2=[{key:"text",name:"Text",icon:o.jsxRuntimeExports.jsx(f.Text$3,{})},{key:"value",name:"Value",icon:o.jsxRuntimeExports.jsx(f.Channel,{})}],Dr=e=>o.jsxRuntimeExports.jsx(Nn,{...e,data:i2,resourceName:"Variant"}),l2=["text","value"],a2=se.z.enum(l2),c2={key:"value",name:"Value",Form:Kc,Cell:Zc,defaultProps:e=>({telem:_.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"}),redline:Ar,color:u.ir.hex(e.colors.gray.l10),level:"h5",units:""}),schema:Fc},u2={key:"text",name:"Text",Form:Yc,Cell:Vc,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:$c},d2={text:u2,value:c2},x2=Object.freeze(Object.defineProperty({__proto__:null,CELLS:d2,SelectVariant:Dr,TEXT_TYPE:t2,Text:Vc,TextForm:Yc,VALUE_TYPE:n2,Value:Zc,ValueForm:Kc,textPropsZ:$c,valuePropsZ:Fc,variantZ:a2},Symbol.toStringTag,{value:"Module"})),Ti=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=Rt(e,...n);return u.K.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Ai=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!p2({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.g.construct(t),a=u.g.swap(l);let c=wt(a,s[a]-e[a]);const d=u.Ho.loc(n,c);if(u.K$1.swap(t)===r){const x=u.Ho.loc(i,u.K$1.swap(c));Math.abs(d-x)<Be&&(c=u.K$1.swap(c))}return{direction:a,length:d-e[a]+Lt(c,Be)}},Io=se.z.object({direction:u.g.direction,length:se.z.number()}),Rt=(e,...t)=>{let n=e;for(const s of t)n=u.K.translate(n,s.direction,s.length);return n},Wc=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(h=>(r=u.K.translate(r,h.direction,h.length),r))];if(!s)return i;const l=t[0],a=wt(l.direction,l.length),c=Ii(a),d=4*(2-n**.5);i[0]=u.K.translate(i[0],{[l.direction]:-1*c*d,[u.g.swap(l.direction)]:0});const x=t[t.length-1],p=wt(x.direction,x.length),m=Ii(p);return i[i.length-1]=u.K.translate(i[i.length-1],{[x.direction]:m*d,[u.g.swap(x.direction)]:0}),i}catch{return[]}},Be=10,Ii=e=>e==="top"||e==="left"?-1:1,Lt=(e,t)=>e==="top"||e==="left"?-t:t,wt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ht=e=>wt(e.direction,e.length),p2=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.g.construct(n),r=t[s]-e[s];return Lt(n,r)<0},Kn=e=>({direction:u.g.construct(e),length:Lt(e,Be)}),Oi={top:Kn("top"),bottom:Kn("bottom"),left:Kn("left"),right:Kn("right")},m2=4,f2=.25,Ts=e=>Oo(h2(Oo(e))),h2=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<m2){if(r===0||r===e.length-1)return!1;if(i<f2)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},Oo=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,a=r,c=ht(i),d=ht(s);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===Be)return!1;const x=Lt(c,Be),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<Be?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}if(r===e.length-1){const l=r,a=r-1,c=ht(s),d=ht(i);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===Be)return!1;const x=Lt(c,Be),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<Be?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?Oo(t):t},Kt=e=>Ts(g2(e)),g2=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,a=r,c={...Oi[i]},d=Rt(n,c);const x={...Oi[r]};let p=Rt(s,x);const m=Math.abs(d.x-p.x),h=Math.abs(d.y-p.y);m<2*Be&&h<10&&(c.length-=m/2,x.length+=m/2,d=Rt(n,c),p=Rt(s,x));const j=[c],E=Ai({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});E!=null&&(j.push(E),d=Rt(d,E),l=ht(E),c=E);const S=Ai({sourceStumpTip:p,sourceOrientation:a,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});S!=null&&(p=Rt(p,S),a=wt(S.direction,S.length));const R=()=>{S!=null&&(S.length*=-1,j.push(S)),x.length*=-1,j.push(x)};if(u.K$1.swap(l)===r){const A=u.g.construct(l),I=(p[A]-d[A])/2;j.push({direction:A,length:I});const D=u.g.swap(A);return j.push({direction:D,length:p[D]-d[D]}),j.push({direction:A,length:I}),R(),j}const v=p[c.direction]-d[c.direction];let y=u.g.swap(c.direction);const C=d[y]-p[y];let N;wt(c.direction,v)===l&&wt(y,C)===a?N={direction:c.direction,length:v}:(N={direction:y,length:p[y]-d[y]},y=u.g.swap(y)),j.push(N);const k={direction:y,length:p[y]-d[y]};return j.push(k),R(),j},j2=e=>Ts(E2(e)),E2=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=u.g.swap(r.direction),l=ht(r);if(t===0){s.unshift({direction:i,length:n});const a=Lt(l,Be);s.unshift({direction:r.direction,length:a}),t+=2,s[t]={...s[t],length:s[t].length-a}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:i,length:-n});const a=Lt(l,Be);s.push({direction:r.direction,length:a}),s[t]={...s[t],length:s[t].length-a}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},y2=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},S2=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?y2(e,r):e.findIndex(r)},R2=({delta:e,segments:t})=>Ts(Gc(e,t,!1)),C2=({delta:e,segments:t})=>Ts(Gc(e,t,!0)),Gc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Di("x",e,s,n)),e.y!==0&&(s=Di("y",e,s,n)),s},Bi=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=ht(t),i=ht(s),l=Math.abs(s.length),a=Math.abs(t.length);return(l>a||l>Be)&&r===i},Di=(e,t,n,s)=>{const r=u.g.swap(e),i=s?n.length-1:0,l=n[i];if(Bi(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<Be?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const a=s?0:n.length-1,d=S2(n,p=>p.direction===e,s,i);if(d===a){const p=n[a];return Bi(e,p,t)?(n[a]={...p,length:p.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>p.length?n[i]={...l,length:l.length-t[e]}:n[a]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[d];return n[d]={...x,length:x.length-t[e]},n},w2=se.z.object({position:u.K.xy,zoom:se.z.number()}),Uc=se.z.object({color:u.ir.crudeZ,variant:se.z.string().optional(),segments:se.z.array(Io)}),b2=Uc.extend({key:se.z.string(),source:se.z.string(),target:se.z.string(),segments:se.z.array(Io),color:u.ir.crudeZ,id:se.z.string(),data:se.z.object({segments:se.z.array(Io),color:u.ir.crudeZ,variant:se.z.string().optional()}).optional(),selected:se.z.boolean(),sourceHandle:se.z.string().nullable().optional(),targetHandle:se.z.string().nullable().optional()}),v2=se.z.object({key:se.z.string(),position:u.K.xy,selected:se.z.boolean().optional(),zIndex:se.z.number().optional(),type:se.z.string().optional(),data:u.u.unknownZ.optional(),measured:se.z.object({width:se.z.number().optional(),height:se.z.number().optional()}).optional()}),Hr=(e,t)=>e.map(n=>({id:n.key,type:"custom",zIndex:n.zIndex,measured:{...n.measured},position:{...n.position},selected:n.selected,data:{},dragHandle:t})),zr=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),qc=e=>e.map(t=>({key:t.id,...t})),Xc=(e,t)=>e.map(n=>(n.data??={segments:[],color:t,variant:"pipe"},{key:n.id,segments:n.data?.segments??[],selected:n.selected??!1,color:n.data?.color??t,variant:n.data?.variant??"pipe",...n})),Qc=e=>({...e.position,zoom:e.zoom}),Jc=e=>({position:u.K.construct(e),zoom:e.zoom}),eu=(e,t)=>qc(t(Hr(e))),ns=(e,t,n)=>Xc(t(zr(e)),n),_2=(e,t="x")=>{if(e.length===0)return[];const n=u.K$1.construct(t),s=u.K$1.swap(n);return e.sort((r,i)=>u.Ho.loc(r.box,n)-u.Ho.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===s),c=r.handles.find(h=>h.orientation===n);if(a==null||c==null)return;const d=a.absolutePosition,x=c.absolutePosition,p=u.K.set(u.K.translation(x,d),t,0),m=u.K.translate(u.Ho.topLeft(r.box),p);r.box=u.Ho.construct(m,u.Ho.dims(r.box))}),e};function Ne(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=Ne(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var N2={value:()=>{}};function As(){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 ss(n)}function ss(e){this._=e}function M2(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}ss.prototype=As.prototype={constructor:ss,on:function(e,t){var n=this._,s=M2(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=k2(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=Hi(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Hi(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ss(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function k2(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Hi(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=N2,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Bo="http://www.w3.org/1999/xhtml";const zi={svg:"http://www.w3.org/2000/svg",xhtml:Bo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Is(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zi.hasOwnProperty(t)?{space:zi[t],local:e}:e}function L2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Bo&&t.documentElement.namespaceURI===Bo?t.createElement(e):t.createElementNS(n,e)}}function P2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tu(e){var t=Is(e);return(t.local?P2:L2)(t)}function T2(){}function $r(e){return e==null?T2:function(){return this.querySelector(e)}}function A2(e){typeof e!="function"&&(e=$r(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=new Array(l),c,d,x=0;x<l;++x)(c=i[x])&&(d=e.call(c,c.__data__,x,i))&&("__data__"in c&&(d.__data__=c.__data__),a[x]=d);return new $e(s,this._parents)}function I2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function O2(){return[]}function nu(e){return e==null?O2:function(){return this.querySelectorAll(e)}}function B2(e){return function(){return I2(e.apply(this,arguments))}}function D2(e){typeof e=="function"?e=B2(e):e=nu(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&(s.push(e.call(c,c.__data__,d,l)),r.push(c));return new $e(s,r)}function su(e){return function(){return this.matches(e)}}function ou(e){return function(t){return t.matches(e)}}var H2=Array.prototype.find;function z2(e){return function(){return H2.call(this.children,e)}}function $2(){return this.firstElementChild}function V2(e){return this.select(e==null?$2:z2(typeof e=="function"?e:ou(e)))}var F2=Array.prototype.filter;function Z2(){return Array.from(this.children)}function K2(e){return function(){return F2.call(this.children,e)}}function Y2(e){return this.selectAll(e==null?Z2:K2(typeof e=="function"?e:ou(e)))}function W2(e){typeof e!="function"&&(e=su(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new $e(s,this._parents)}function ru(e){return new Array(e.length)}function G2(){return new $e(this._enter||this._groups.map(ru),this._parents)}function ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ms.prototype={constructor:ms,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 U2(e){return function(){return e}}function q2(e,t,n,s,r,i){for(var l=0,a,c=t.length,d=i.length;l<d;++l)(a=t[l])?(a.__data__=i[l],s[l]=a):n[l]=new ms(e,i[l]);for(;l<c;++l)(a=t[l])&&(r[l]=a)}function X2(e,t,n,s,r,i,l){var a,c,d=new Map,x=t.length,p=i.length,m=new Array(x),h;for(a=0;a<x;++a)(c=t[a])&&(m[a]=h=l.call(c,c.__data__,a,t)+"",d.has(h)?r[a]=c:d.set(h,c));for(a=0;a<p;++a)h=l.call(e,i[a],a,i)+"",(c=d.get(h))?(s[a]=c,c.__data__=i[a],d.delete(h)):n[a]=new ms(e,i[a]);for(a=0;a<x;++a)(c=t[a])&&d.get(m[a])===c&&(r[a]=c)}function Q2(e){return e.__data__}function J2(e,t){if(!arguments.length)return Array.from(this,Q2);var n=t?X2:q2,s=this._parents,r=this._groups;typeof e!="function"&&(e=U2(e));for(var i=r.length,l=new Array(i),a=new Array(i),c=new Array(i),d=0;d<i;++d){var x=s[d],p=r[d],m=p.length,h=e3(e.call(x,x&&x.__data__,d,s)),j=h.length,E=a[d]=new Array(j),S=l[d]=new Array(j),R=c[d]=new Array(m);n(x,p,E,S,R,h,t);for(var v=0,y=0,C,N;v<j;++v)if(C=E[v]){for(v>=y&&(y=v+1);!(N=S[y])&&++y<j;);C._next=N||null}}return l=new $e(l,s),l._enter=a,l._exit=c,l}function e3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function t3(){return new $e(this._exit||this._groups.map(ru),this._parents)}function n3(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function s3(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),a=new Array(r),c=0;c<l;++c)for(var d=n[c],x=s[c],p=d.length,m=a[c]=new Array(p),h,j=0;j<p;++j)(h=d[j]||x[j])&&(m[j]=h);for(;c<r;++c)a[c]=n[c];return new $e(a,this._parents)}function o3(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function r3(e){e||(e=i3);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],a=l.length,c=r[i]=new Array(a),d,x=0;x<a;++x)(d=l[x])&&(c[x]=d);c.sort(t)}return new $e(r,this._parents).order()}function i3(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function l3(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function a3(){return Array.from(this)}function c3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function u3(){let e=0;for(const t of this)++e;return e}function d3(){return!this.node()}function x3(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,a;i<l;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function p3(e){return function(){this.removeAttribute(e)}}function m3(e){return function(){this.removeAttributeNS(e.space,e.local)}}function f3(e,t){return function(){this.setAttribute(e,t)}}function h3(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function g3(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function j3(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 E3(e,t){var n=Is(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?m3:p3:typeof t=="function"?n.local?j3:g3:n.local?h3:f3)(n,t))}function iu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function y3(e){return function(){this.style.removeProperty(e)}}function S3(e,t,n){return function(){this.style.setProperty(e,t,n)}}function R3(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function C3(e,t,n){return arguments.length>1?this.each((t==null?y3:typeof t=="function"?R3:S3)(e,t,n??"")):Ut(this.node(),e)}function Ut(e,t){return e.style.getPropertyValue(t)||iu(e).getComputedStyle(e,null).getPropertyValue(t)}function w3(e){return function(){delete this[e]}}function b3(e,t){return function(){this[e]=t}}function v3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _3(e,t){return arguments.length>1?this.each((t==null?w3:typeof t=="function"?v3:b3)(e,t)):this.node()[e]}function lu(e){return e.trim().split(/^|\s+/)}function Vr(e){return e.classList||new au(e)}function au(e){this._node=e,this._names=lu(e.getAttribute("class")||"")}au.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 cu(e,t){for(var n=Vr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function uu(e,t){for(var n=Vr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function N3(e){return function(){cu(this,e)}}function M3(e){return function(){uu(this,e)}}function k3(e,t){return function(){(t.apply(this,arguments)?cu:uu)(this,e)}}function L3(e,t){var n=lu(e+"");if(arguments.length<2){for(var s=Vr(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?k3:t?N3:M3)(n,t))}function P3(){this.textContent=""}function T3(e){return function(){this.textContent=e}}function A3(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function I3(e){return arguments.length?this.each(e==null?P3:(typeof e=="function"?A3:T3)(e)):this.node().textContent}function O3(){this.innerHTML=""}function B3(e){return function(){this.innerHTML=e}}function D3(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function H3(e){return arguments.length?this.each(e==null?O3:(typeof e=="function"?D3:B3)(e)):this.node().innerHTML}function z3(){this.nextSibling&&this.parentNode.appendChild(this)}function $3(){return this.each(z3)}function V3(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function F3(){return this.each(V3)}function Z3(e){var t=typeof e=="function"?e:tu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function K3(){return null}function Y3(e,t){var n=typeof e=="function"?e:tu(e),s=t==null?K3:typeof t=="function"?t:$r(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function W3(){var e=this.parentNode;e&&e.removeChild(this)}function G3(){return this.each(W3)}function U3(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function q3(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X3(e){return this.select(e?q3:U3)}function Q3(e){return arguments.length?this.property("__data__",e):this.node().__data__}function J3(e){return function(t){e.call(this,t,this.__data__)}}function eE(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 tE(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function nE(e,t,n){return function(){var s=this.__on,r,i=J3(t);if(s){for(var l=0,a=s.length;l<a;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function sE(e,t,n){var s=eE(e+""),r,i=s.length,l;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,d=a.length,x;c<d;++c)for(r=0,x=a[c];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(a=t?nE:tE,r=0;r<i;++r)this.each(a(s[r],t,n));return this}function du(e,t,n){var s=iu(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function oE(e,t){return function(){return du(this,e,t)}}function rE(e,t){return function(){return du(this,e,t.apply(this,arguments))}}function iE(e,t){return this.each((typeof t=="function"?rE:oE)(e,t))}function*lE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var xu=[null];function $e(e,t){this._groups=e,this._parents=t}function Tn(){return new $e([[document.documentElement]],xu)}function aE(){return this}$e.prototype=Tn.prototype={constructor:$e,select:A2,selectAll:D2,selectChild:V2,selectChildren:Y2,filter:W2,data:J2,enter:G2,exit:t3,join:n3,merge:s3,selection:aE,order:o3,sort:r3,call:l3,nodes:a3,node:c3,size:u3,empty:d3,each:x3,attr:E3,style:C3,property:_3,classed:L3,text:I3,html:H3,raise:$3,lower:F3,append:Z3,insert:Y3,remove:G3,clone:X3,datum:Q3,on:sE,dispatch:iE,[Symbol.iterator]:lE};function ze(e){return typeof e=="string"?new $e([[document.querySelector(e)]],[document.documentElement]):new $e([[e]],xu)}function cE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ze(e,t){if(e=cE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const uE={passive:!1},Sn={capture:!0,passive:!1};function uo(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function pu(e){var t=e.document.documentElement,n=ze(e).on("dragstart.drag",Gt,Sn);"onselectstart"in t?n.on("selectstart.drag",Gt,Sn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mu(e,t){var n=e.document.documentElement,s=ze(e).on("dragstart.drag",null);t&&(s.on("click.drag",Gt,Sn),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 Yn=e=>()=>e;function Do(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:a,dx:c,dy:d,dispatch:x}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:x}})}Do.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dE(e){return!e.ctrlKey&&!e.button}function xE(){return this.parentNode}function pE(e,t){return t??{x:e.x,y:e.y}}function mE(){return navigator.maxTouchPoints||"ontouchstart"in this}function fu(){var e=dE,t=xE,n=pE,s=mE,r={},i=As("start","drag","end"),l=0,a,c,d,x,p=0;function m(C){C.on("mousedown.drag",h).filter(s).on("touchstart.drag",S).on("touchmove.drag",R,uE).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(C,N){if(!(x||!e.call(this,C,N))){var k=y(this,t.call(this,C,N),C,N,"mouse");k&&(ze(C.view).on("mousemove.drag",j,Sn).on("mouseup.drag",E,Sn),pu(C.view),uo(C),d=!1,a=C.clientX,c=C.clientY,k("start",C))}}function j(C){if(Gt(C),!d){var N=C.clientX-a,k=C.clientY-c;d=N*N+k*k>p}r.mouse("drag",C)}function E(C){ze(C.view).on("mousemove.drag mouseup.drag",null),mu(C.view,d),Gt(C),r.mouse("end",C)}function S(C,N){if(e.call(this,C,N)){var k=C.changedTouches,A=t.call(this,C,N),I=k.length,D,V;for(D=0;D<I;++D)(V=y(this,A,C,N,k[D].identifier,k[D]))&&(uo(C),V("start",C,k[D]))}}function R(C){var N=C.changedTouches,k=N.length,A,I;for(A=0;A<k;++A)(I=r[N[A].identifier])&&(Gt(C),I("drag",C,N[A]))}function v(C){var N=C.changedTouches,k=N.length,A,I;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),A=0;A<k;++A)(I=r[N[A].identifier])&&(uo(C),I("end",C,N[A]))}function y(C,N,k,A,I,D){var V=i.copy(),H=Ze(D||k,N),B,$,w;if((w=n.call(C,new Do("beforestart",{sourceEvent:k,target:m,identifier:I,active:l,x:H[0],y:H[1],dx:0,dy:0,dispatch:V}),A))!=null)return B=w.x-H[0]||0,$=w.y-H[1]||0,function P(L,O,z){var F=H,Z;switch(L){case"start":r[I]=P,Z=l++;break;case"end":delete r[I],--l;case"drag":H=Ze(z||O,N),Z=l;break}V.call(L,C,new Do(L,{sourceEvent:O,subject:w,target:m,identifier:I,active:Z,x:H[0]+B,y:H[1]+$,dx:H[0]-F[0],dy:H[1]-F[1],dispatch:V}),A)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Yn(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:Yn(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:Yn(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Yn(!!C),m):s},m.on=function(){var C=i.on.apply(i,arguments);return C===i?m:C},m.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,m):Math.sqrt(p)},m}var qt=0,mn=0,un=0,hu=1e3,fs,fn,hs=0,Pt=0,Os=0,Rn=typeof performance=="object"&&performance.now?performance:Date,gu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fr(){return Pt||(gu(fE),Pt=Rn.now()+Os)}function fE(){Pt=0}function gs(){this._call=this._time=this._next=null}gs.prototype=ju.prototype={constructor:gs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fr():+n)+(t==null?0:+t),!this._next&&fn!==this&&(fn?fn._next=this:fs=this,fn=this),this._call=e,this._time=n,Ho()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ho())}};function ju(e,t,n){var s=new gs;return s.restart(e,t,n),s}function hE(){Fr(),++qt;for(var e=fs,t;e;)(t=Pt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--qt}function $i(){Pt=(hs=Rn.now())+Os,qt=mn=0;try{hE()}finally{qt=0,jE(),Pt=0}}function gE(){var e=Rn.now(),t=e-hs;t>hu&&(Os-=t,hs=e)}function jE(){for(var e,t=fs,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:fs=n);fn=e,Ho(s)}function Ho(e){if(!qt){mn&&(mn=clearTimeout(mn));var t=e-Pt;t>24?(e<1/0&&(mn=setTimeout($i,e-Rn.now()-Os)),un&&(un=clearInterval(un))):(un||(hs=Rn.now(),un=setInterval(gE,hu)),qt=1,gu($i))}}function Vi(e,t,n){var s=new gs;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var EE=As("start","end","cancel","interrupt"),yE=[],Eu=0,Fi=1,zo=2,os=3,Zi=4,$o=5,rs=6;function Bs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;SE(e,n,{name:t,index:s,group:r,on:EE,tween:yE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Eu})}function Zr(e,t){var n=Ue(e,t);if(n.state>Eu)throw new Error("too late; already scheduled");return n}function nt(e,t){var n=Ue(e,t);if(n.state>os)throw new Error("too late; already running");return n}function Ue(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function SE(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=ju(i,0,n.time);function i(d){n.state=Fi,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var x,p,m,h;if(n.state!==Fi)return c();for(x in s)if(h=s[x],h.name===n.name){if(h.state===os)return Vi(l);h.state===Zi?(h.state=rs,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[x]):+x<t&&(h.state=rs,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[x])}if(Vi(function(){n.state===os&&(n.state=Zi,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=zo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===zo){for(n.state=os,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(h=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=h);r.length=p+1}}function a(d){for(var x=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=$o,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===$o&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=rs,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function is(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>zo&&s.state<$o,s.state=rs,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function RE(e){return this.each(function(){is(this,e)})}function CE(e,t){var n,s;return function(){var r=nt(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,a=s.length;l<a;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function wE(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=nt(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var a={name:t,value:n},c=0,d=r.length;c<d;++c)if(r[c].name===t){r[c]=a;break}c===d&&r.push(a)}i.tween=r}}function bE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Ue(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?CE:wE)(n,e,t))}function Kr(e,t,n){var s=e._id;return e.each(function(){var r=nt(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Ue(r,s).value[t]}}function yu(e,t){var n;return(typeof t=="number"?_.interpolateNumber:t instanceof _.color?_.interpolateRgb:(n=_.color(t))?(t=n,_.interpolateRgb):_.interpolateString)(e,t)}function vE(e){return function(){this.removeAttribute(e)}}function _E(e){return function(){this.removeAttributeNS(e.space,e.local)}}function NE(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function ME(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function kE(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function LE(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function PE(e,t){var n=Is(e),s=n==="transform"?qg:yu;return this.attrTween(e,typeof t=="function"?(n.local?LE:kE)(n,s,Kr(this,"attr."+e,t)):t==null?(n.local?_E:vE)(n):(n.local?ME:NE)(n,s,t))}function TE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function AE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function IE(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&AE(e,i)),n}return r._value=t,r}function OE(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&TE(e,i)),n}return r._value=t,r}function BE(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=Is(e);return this.tween(n,(s.local?IE:OE)(s,t))}function DE(e,t){return function(){Zr(this,e).delay=+t.apply(this,arguments)}}function HE(e,t){return t=+t,function(){Zr(this,e).delay=t}}function zE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?DE:HE)(t,e)):Ue(this.node(),t).delay}function $E(e,t){return function(){nt(this,e).duration=+t.apply(this,arguments)}}function VE(e,t){return t=+t,function(){nt(this,e).duration=t}}function FE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$E:VE)(t,e)):Ue(this.node(),t).duration}function ZE(e,t){if(typeof t!="function")throw new Error;return function(){nt(this,e).ease=t}}function KE(e){var t=this._id;return arguments.length?this.each(ZE(t,e)):Ue(this.node(),t).ease}function YE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nt(this,e).ease=n}}function WE(e){if(typeof e!="function")throw new Error;return this.each(YE(this._id,e))}function GE(e){typeof e!="function"&&(e=su(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new at(s,this._parents,this._name,this._id)}function UE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),a=0;a<i;++a)for(var c=t[a],d=n[a],x=c.length,p=l[a]=new Array(x),m,h=0;h<x;++h)(m=c[h]||d[h])&&(p[h]=m);for(;a<s;++a)l[a]=t[a];return new at(l,this._parents,this._name,this._id)}function qE(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 XE(e,t,n){var s,r,i=qE(t)?Zr:nt;return function(){var l=i(this,e),a=l.on;a!==s&&(r=(s=a).copy()).on(t,n),l.on=r}}function QE(e,t){var n=this._id;return arguments.length<2?Ue(this.node(),n).on.on(e):this.each(XE(n,e,t))}function JE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function e5(){return this.on("end.remove",JE(this._id))}function t5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$r(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var a=s[l],c=a.length,d=i[l]=new Array(c),x,p,m=0;m<c;++m)(x=a[m])&&(p=e.call(x,x.__data__,m,a))&&("__data__"in x&&(p.__data__=x.__data__),d[m]=p,Bs(d[m],t,n,m,d,Ue(x,n)));return new at(i,this._parents,t,n)}function n5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nu(e));for(var s=this._groups,r=s.length,i=[],l=[],a=0;a<r;++a)for(var c=s[a],d=c.length,x,p=0;p<d;++p)if(x=c[p]){for(var m=e.call(x,x.__data__,p,c),h,j=Ue(x,n),E=0,S=m.length;E<S;++E)(h=m[E])&&Bs(h,t,n,E,m,j);i.push(m),l.push(x)}return new at(i,l,t,n)}var s5=Tn.prototype.constructor;function o5(){return new s5(this._groups,this._parents)}function r5(e,t){var n,s,r;return function(){var i=Ut(this,e),l=(this.style.removeProperty(e),Ut(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function Su(e){return function(){this.style.removeProperty(e)}}function i5(e,t,n){var s,r=n+"",i;return function(){var l=Ut(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function l5(e,t,n){var s,r,i;return function(){var l=Ut(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Ut(this,e))),l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a))}}function a5(e,t){var n,s,r,i="style."+t,l="end."+i,a;return function(){var c=nt(this,e),d=c.on,x=c.value[i]==null?a||(a=Su(t)):void 0;(d!==n||r!==x)&&(s=(n=d).copy()).on(l,r=x),c.on=s}}function c5(e,t,n){var s=(e+="")=="transform"?Ug:yu;return t==null?this.styleTween(e,r5(e,s)).on("end.style."+e,Su(e)):typeof t=="function"?this.styleTween(e,l5(e,s,Kr(this,"style."+e,t))).each(a5(this._id,e)):this.styleTween(e,i5(e,s,t),n).on("end.style."+e,null)}function u5(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function d5(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&u5(e,l,n)),s}return i._value=t,i}function x5(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,d5(e,t,n??""))}function p5(e){return function(){this.textContent=e}}function m5(e){return function(){var t=e(this);this.textContent=t??""}}function f5(e){return this.tween("text",typeof e=="function"?m5(Kr(this,"text",e)):p5(e==null?"":e+""))}function h5(e){return function(t){this.textContent=e.call(this,t)}}function g5(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&h5(r)),t}return s._value=e,s}function j5(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,g5(e))}function E5(){for(var e=this._name,t=this._id,n=Ru(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)if(c=l[d]){var x=Ue(c,t);Bs(c,e,n,d,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new at(s,this._parents,e,n)}function y5(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var a={value:l},c={value:function(){--r===0&&i()}};n.each(function(){var d=nt(this,s),x=d.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),d.on=t}),r===0&&i()})}var S5=0;function at(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Ru(){return++S5}var ot=Tn.prototype;at.prototype={constructor:at,select:t5,selectAll:n5,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:GE,merge:UE,selection:o5,transition:E5,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:QE,attr:PE,attrTween:BE,style:c5,styleTween:x5,text:f5,textTween:j5,remove:e5,tween:bE,delay:zE,duration:FE,ease:KE,easeVarying:WE,end:y5,[Symbol.iterator]:ot[Symbol.iterator]};function R5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var C5={time:null,delay:0,duration:250,ease:R5};function w5(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 b5(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=Ru(),(n=C5).time=Fr(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&Bs(c,e,t,d,l,n||w5(c,t));return new at(s,this._parents,e,t)}Tn.prototype.interrupt=RE;Tn.prototype.transition=b5;const Wn=e=>()=>e;function v5(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function it(e,t,n){this.k=e,this.x=t,this.y=n}it.prototype={constructor:it,scale:function(e){return e===1?this:new it(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new it(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 Ds=new it(1,0,0);Cu.prototype=it.prototype;function Cu(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ds;return e.__zoom}function xo(e){e.stopImmediatePropagation()}function dn(e){e.preventDefault(),e.stopImmediatePropagation()}function _5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function N5(){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 Ki(){return this.__zoom||Ds}function M5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function k5(){return navigator.maxTouchPoints||"ontouchstart"in this}function L5(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function wu(){var e=_5,t=N5,n=L5,s=M5,r=k5,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],a=250,c=ts,d=As("start","zoom","end"),x,p,m,h=500,j=150,E=0,S=10;function R(w){w.property("__zoom",Ki).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",H).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(w,P,L,O){var z=w.selection?w.selection():w;z.property("__zoom",Ki),w!==z?N(w,P,L,O):z.interrupt().each(function(){k(this,arguments).event(O).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},R.scaleBy=function(w,P,L,O){R.scaleTo(w,function(){var z=this.__zoom.k,F=typeof P=="function"?P.apply(this,arguments):P;return z*F},L,O)},R.scaleTo=function(w,P,L,O){R.transform(w,function(){var z=t.apply(this,arguments),F=this.__zoom,Z=L==null?C(z):typeof L=="function"?L.apply(this,arguments):L,K=F.invert(Z),X=typeof P=="function"?P.apply(this,arguments):P;return n(y(v(F,X),Z,K),z,l)},L,O)},R.translateBy=function(w,P,L,O){R.transform(w,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),l)},null,O)},R.translateTo=function(w,P,L,O,z){R.transform(w,function(){var F=t.apply(this,arguments),Z=this.__zoom,K=O==null?C(F):typeof O=="function"?O.apply(this,arguments):O;return n(Ds.translate(K[0],K[1]).scale(Z.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof L=="function"?-L.apply(this,arguments):-L),F,l)},O,z)};function v(w,P){return P=Math.max(i[0],Math.min(i[1],P)),P===w.k?w:new it(P,w.x,w.y)}function y(w,P,L){var O=P[0]-L[0]*w.k,z=P[1]-L[1]*w.k;return O===w.x&&z===w.y?w:new it(w.k,O,z)}function C(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function N(w,P,L,O){w.on("start.zoom",function(){k(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(O).end()}).tween("zoom",function(){var z=this,F=arguments,Z=k(z,F).event(O),K=t.apply(z,F),X=L==null?C(K):typeof L=="function"?L.apply(z,F):L,oe=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),J=z.__zoom,ue=typeof P=="function"?P.apply(z,F):P,te=c(J.invert(X).concat(oe/J.k),ue.invert(X).concat(oe/ue.k));return function(ne){if(ne===1)ne=ue;else{var ee=te(ne),le=oe/ee[2];ne=new it(le,X[0]-ee[0]*le,X[1]-ee[1]*le)}Z.zoom(null,ne)}})}function k(w,P,L){return!L&&w.__zooming||new A(w,P)}function A(w,P){this.that=w,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,P),this.taps=0}A.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,P){return this.mouse&&w!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var P=ze(this.that).datum();d.call(w,this.that,new v5(w,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:d}),P)}};function I(w,...P){if(!e.apply(this,arguments))return;var L=k(this,P).event(w),O=this.__zoom,z=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,s.apply(this,arguments)))),F=Ze(w);if(L.wheel)(L.mouse[0][0]!==F[0]||L.mouse[0][1]!==F[1])&&(L.mouse[1]=O.invert(L.mouse[0]=F)),clearTimeout(L.wheel);else{if(O.k===z)return;L.mouse=[F,O.invert(F)],is(this),L.start()}dn(w),L.wheel=setTimeout(Z,j),L.zoom("mouse",n(y(v(O,z),L.mouse[0],L.mouse[1]),L.extent,l));function Z(){L.wheel=null,L.end()}}function D(w,...P){if(m||!e.apply(this,arguments))return;var L=w.currentTarget,O=k(this,P,!0).event(w),z=ze(w.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",oe,!0),F=Ze(w,L),Z=w.clientX,K=w.clientY;pu(w.view),xo(w),O.mouse=[F,this.__zoom.invert(F)],is(this),O.start();function X(J){if(dn(J),!O.moved){var ue=J.clientX-Z,te=J.clientY-K;O.moved=ue*ue+te*te>E}O.event(J).zoom("mouse",n(y(O.that.__zoom,O.mouse[0]=Ze(J,L),O.mouse[1]),O.extent,l))}function oe(J){z.on("mousemove.zoom mouseup.zoom",null),mu(J.view,O.moved),dn(J),O.event(J).end()}}function V(w,...P){if(e.apply(this,arguments)){var L=this.__zoom,O=Ze(w.changedTouches?w.changedTouches[0]:w,this),z=L.invert(O),F=L.k*(w.shiftKey?.5:2),Z=n(y(v(L,F),O,z),t.apply(this,P),l);dn(w),a>0?ze(this).transition().duration(a).call(N,Z,O,w):ze(this).call(R.transform,Z,O,w)}}function H(w,...P){if(e.apply(this,arguments)){var L=w.touches,O=L.length,z=k(this,P,w.changedTouches.length===O).event(w),F,Z,K,X;for(xo(w),Z=0;Z<O;++Z)K=L[Z],X=Ze(K,this),X=[X,this.__zoom.invert(X),K.identifier],z.touch0?!z.touch1&&z.touch0[2]!==X[2]&&(z.touch1=X,z.taps=0):(z.touch0=X,F=!0,z.taps=1+!!x);x&&(x=clearTimeout(x)),F&&(z.taps<2&&(p=X[0],x=setTimeout(function(){x=null},h)),is(this),z.start())}}function B(w,...P){if(this.__zooming){var L=k(this,P).event(w),O=w.changedTouches,z=O.length,F,Z,K,X;for(dn(w),F=0;F<z;++F)Z=O[F],K=Ze(Z,this),L.touch0&&L.touch0[2]===Z.identifier?L.touch0[0]=K:L.touch1&&L.touch1[2]===Z.identifier&&(L.touch1[0]=K);if(Z=L.that.__zoom,L.touch1){var oe=L.touch0[0],J=L.touch0[1],ue=L.touch1[0],te=L.touch1[1],ne=(ne=ue[0]-oe[0])*ne+(ne=ue[1]-oe[1])*ne,ee=(ee=te[0]-J[0])*ee+(ee=te[1]-J[1])*ee;Z=v(Z,Math.sqrt(ne/ee)),K=[(oe[0]+ue[0])/2,(oe[1]+ue[1])/2],X=[(J[0]+te[0])/2,(J[1]+te[1])/2]}else if(L.touch0)K=L.touch0[0],X=L.touch0[1];else return;L.zoom("touch",n(y(Z,K,X),L.extent,l))}}function $(w,...P){if(this.__zooming){var L=k(this,P).event(w),O=w.changedTouches,z=O.length,F,Z;for(xo(w),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),F=0;F<z;++F)Z=O[F],L.touch0&&L.touch0[2]===Z.identifier?delete L.touch0:L.touch1&&L.touch1[2]===Z.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(Z=Ze(Z,this),Math.hypot(p[0]-Z[0],p[1]-Z[1])<S)){var K=ze(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return R.wheelDelta=function(w){return arguments.length?(s=typeof w=="function"?w:Wn(+w),R):s},R.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Wn(!!w),R):e},R.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Wn(!!w),R):r},R.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Wn([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),R):t},R.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],R):[i[0],i[1]]},R.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(w){return arguments.length?(n=w,R):n},R.duration=function(w){return arguments.length?(a=+w,R):a},R.interpolate=function(w){return arguments.length?(c=w,R):c},R.on=function(){var w=d.on.apply(d,arguments);return w===d?R:w},R.clickDistance=function(w){return arguments.length?(E=(w=+w)*w,R):Math.sqrt(E)},R.tapDistance=function(w){return arguments.length?(S=+w,R):S},R}const Ae={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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Cn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bu=["Enter"," ","Escape"],vu={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Tt;(function(e){e.Strict="strict",e.Loose="loose"})(Tt||(Tt={}));var bt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(bt||(bt={}));var Xt;(function(e){e.Partial="partial",e.Full="full"})(Xt||(Xt={}));const _u={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ft;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ft||(ft={}));var js;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(js||(js={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Yi={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function Nu(e){return e===null?null:e?"valid":"invalid"}const Mu=e=>"id"in e&&"source"in e&&"target"in e,P5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Yr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),An=(e,t=[0,0])=>{const{width:n,height:s}=ut(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},T5=(e,t={nodeOrigin:[0,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,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):Yr(r)?r:t.nodeLookup.get(r.id));const a=l?Es(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Hs(s,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zs(n)},In=(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 r=Es(s);n=Hs(n,r)}}),zs(n)},Wr=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const a={...On(t,[n,s,r]),width:t.width/r,height:t.height/r},c=[];for(const d of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=d;if(l&&!p||m)continue;const h=x.width??d.width??d.initialWidth??null,j=x.height??d.height??d.initialHeight??null,E=wn(a,Jt(d)),S=(h??0)*(j??0),R=i&&E>0;(!d.internals.handleBounds||R||E>=S||d.dragging)&&c.push(d)}return c},A5=(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 I5(e,t){const n=new Map,s=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function O5({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const a=I5(e,l),c=In(a),d=Gr(c,t,n,l?.minZoom??r,l?.maxZoom??i,l?.padding??.1);return await s.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function ku({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const l=n.get(e),a=l.parentId?n.get(l.parentId):void 0,{x:c,y:d}=a?a.internals.positionAbsolute:{x:0,y:0},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!a)i?.("005",Ae.error005());else{const h=a.measured.width,j=a.measured.height;h&&j&&(p=[[c,d],[c+h,d+j]])}else a&&en(l.extent)&&(p=[[l.extent[0][0]+c,l.extent[0][1]+d],[l.extent[1][0]+c,l.extent[1][1]+d]]);const m=en(p)?At(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Ae.error015()),{position:{x:m.x-c+(l.measured.width??0)*x[0],y:m.y-d+(l.measured.height??0)*x[1]},positionAbsolute:m}}async function B5({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const h=i.has(m.id),j=!h&&m.parentId&&l.find(E=>E.id===m.parentId);(h||j)&&l.push(m)}const a=new Set(t.map(m=>m.id)),c=s.filter(m=>m.deletable!==!1),x=A5(l,c);for(const m of c)a.has(m.id)&&!x.find(j=>j.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const Qt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),At=(e={x:0,y:0},t,n)=>({x:Qt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Qt(e.y,t[0][1],t[1][1]-(n?.height??0))});function Lu(e,t,n){const{width:s,height:r}=ut(n),{x:i,y:l}=n.internals.positionAbsolute;return At(e,[[i,l],[i+s,l+r]],t)}const Wi=(e,t,n)=>e<t?Qt(Math.abs(e-t),1,t)/t:e>n?-Qt(Math.abs(e-n),1,t)/t:0,Pu=(e,t,n=15,s=40)=>{const r=Wi(e.x,s,t.width-s)*n,i=Wi(e.y,s,t.height-s)*n;return[r,i]},Hs=(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)}),Vo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),zs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Jt=(e,t=[0,0])=>{const{x:n,y:s}=Yr(e)?e.internals.positionAbsolute:An(e,t);return{x:n,y:s,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Es=(e,t=[0,0])=>{const{x:n,y:s}=Yr(e)?e.internals.positionAbsolute:An(e,t);return{x:n,y:s,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:s+(e.measured?.height??e.height??e.initialHeight??0)}},Tu=(e,t)=>zs(Hs(Vo(e),Vo(t))),wn=(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)},Gi=e=>Ke(e.width)&&Ke(e.height)&&Ke(e.x)&&Ke(e.y),Ke=e=>!isNaN(e)&&isFinite(e),ys=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},$s=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),On=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const a={x:(e-n)/r,y:(t-s)/r};return i?$s(a,l):a},Ss=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function Zt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function D5(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=Zt(e,n),r=Zt(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=Zt(e.top??e.y??0,n),r=Zt(e.bottom??e.y??0,n),i=Zt(e.left??e.x??0,t),l=Zt(e.right??e.x??0,t);return{top:s,right:l,bottom:r,left:i,x:i+l,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function H5(e,t,n,s,r,i){const{x:l,y:a}=Ss(e,[t,n,s]),{x:c,y:d}=Ss({x:e.x+e.width,y:e.y+e.height},[t,n,s]),x=r-c,p=i-d;return{left:Math.floor(l),top:Math.floor(a),right:Math.floor(x),bottom:Math.floor(p)}}const Gr=(e,t,n,s,r,i)=>{const l=D5(i,t,n),a=(t-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(a,c),x=Qt(d,s,r),p=e.x+e.width/2,m=e.y+e.height/2,h=t/2-p*x,j=n/2-m*x,E=H5(e,h,j,x,t,n),S={left:Math.min(E.left-l.left,0),top:Math.min(E.top-l.top,0),right:Math.min(E.right-l.right,0),bottom:Math.min(E.bottom-l.bottom,0)};return{x:h-S.left+S.right,y:j-S.top+S.bottom,zoom:x}},Rs=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function en(e){return e!==void 0&&e!=="parent"}function ut(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Au(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Iu(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const a=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Ui(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function z5(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function $5(e){return{...vu,...e||{}}}function gn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=Xe(e),a=On({x:i-(r?.left??0),y:l-(r?.top??0)},s),{x:c,y:d}=n?$s(a,t):a;return{xSnapped:c,ySnapped:d,...a}}const Ur=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ou=e=>e?.getRootNode?.()||window?.document,V5=["INPUT","SELECT","TEXTAREA"];function Bu(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:V5.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Du=e=>"clientX"in e,Xe=(e,t)=>{const n=Du(e),s=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:s-(t?.left??0),y:r-(t?.top??0)}},qi=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const a=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(a.left-n.left)/s,y:(a.top-n.top)/s,...Ur(l)}})};function Hu({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:a}){const c=e*.125+r*.375+l*.375+n*.125,d=t*.125+i*.375+a*.375+s*.125,x=Math.abs(c-e),p=Math.abs(d-t);return[c,d,x,p]}function Gn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xi({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Q.Left:return[t-Gn(t-s,i),n];case Q.Right:return[t+Gn(s-t,i),n];case Q.Top:return[t,n-Gn(n-r,i)];case Q.Bottom:return[t,n+Gn(r-n,i)]}}function zu({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,curvature:l=.25}){const[a,c]=Xi({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[d,x]=Xi({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,h,j]=Hu({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:x});return[`M${e},${t} C${a},${c} ${d},${x} ${s},${r}`,p,m,h,j]}function $u({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,a=s<t?s+l:s-l;return[i,a,r,l]}function F5({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:r=!1}){if(s!==void 0)return s;const i=r&&n?1e3:0,l=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+l}function Z5({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=Hs(Es(e),Es(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return wn(l,zs(i))>0}const Vu=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,K5=(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)),Fu=(e,t)=>{if(!e.source||!e.target)return ys("006",Ae.error006()),t;let n;return Mu(e)?n={...e}:n={...e,id:Vu(e)},K5(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Y5=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return ys("006",Ae.error006()),n;if(!n.find(c=>c.id===e.id))return ys("007",Ae.error007(r)),n;const a={...i,id:s.shouldReplaceId?Vu(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(c=>c.id!==r).concat(a)};function Zu({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,a]=$u({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,a]}const Qi={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},W5=({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},Ji=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function G5({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:s=Q.Top,center:r,offset:i}){const l=Qi[t],a=Qi[s],c={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+a.x*i,y:n.y+a.y*i},x=W5({source:c,sourcePosition:t,target:d}),p=x.x!==0?"x":"y",m=x[p];let h=[],j,E;const S={x:0,y:0},R={x:0,y:0},[v,y,C,N]=$u({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*a[p]===-1){j=r.x??v,E=r.y??y;const A=[{x:j,y:c.y},{x:j,y:d.y}],I=[{x:c.x,y:E},{x:d.x,y:E}];l[p]===m?h=p==="x"?A:I:h=p==="x"?I:A}else{const A=[{x:c.x,y:d.y}],I=[{x:d.x,y:c.y}];if(p==="x"?h=l.x===m?I:A:h=l.y===m?A:I,t===s){const $=Math.abs(e[p]-n[p]);if($<=i){const w=Math.min(i-1,i-$);l[p]===m?S[p]=(c[p]>e[p]?-1:1)*w:R[p]=(d[p]>n[p]?-1:1)*w}}if(t!==s){const $=p==="x"?"y":"x",w=l[p]===a[$],P=c[$]>d[$],L=c[$]<d[$];(l[p]===1&&(!w&&P||w&&L)||l[p]!==1&&(!w&&L||w&&P))&&(h=p==="x"?A:I)}const D={x:c.x+S.x,y:c.y+S.y},V={x:d.x+R.x,y:d.y+R.y},H=Math.max(Math.abs(D.x-h[0].x),Math.abs(V.x-h[0].x)),B=Math.max(Math.abs(D.y-h[0].y),Math.abs(V.y-h[0].y));H>=B?(j=(D.x+V.x)/2,E=h[0].y):(j=h[0].x,E=(D.y+V.y)/2)}return[[e,{x:c.x+S.x,y:c.y+S.y},...h,{x:d.x+R.x,y:d.y+R.y},n],j,E,C,N]}function U5(e,t,n,s){const r=Math.min(Ji(e,t)/2,Ji(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*d},${l}Q ${i},${l} ${i},${l+r*x}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${l+r*c}Q ${i},${l} ${i+r*a},${l}`}function Fo({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,borderRadius:l=5,centerX:a,centerY:c,offset:d=20}){const[x,p,m,h,j]=G5({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:a,y:c},offset:d});return[x.reduce((S,R,v)=>{let y="";return v>0&&v<x.length-1?y=U5(x[v-1],R,x[v+1],l):y=`${v===0?"M":"L"}${R.x} ${R.y}`,S+=y,S},""),p,m,h,j]}function el(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function q5(e){const{sourceNode:t,targetNode:n}=e;if(!el(t)||!el(n))return null;const s=t.internals.handleBounds||tl(t.handles),r=n.internals.handleBounds||tl(n.handles),i=nl(s?.source??[],e.sourceHandle),l=nl(e.connectionMode===Tt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!l)return e.onError?.("008",Ae.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Q.Bottom,c=l?.position||Q.Top,d=bn(t,i,a),x=bn(n,l,c);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:a,targetPosition:c}}function tl(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 bn(e,t,n=Q.Left,s=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:a}=t??ut(e);if(s)return{x:r+l/2,y:i+a/2};switch(t?.position??n){case Q.Top:return{x:r+l/2,y:i};case Q.Right:return{x:r+l,y:i+a/2};case Q.Bottom:return{x:r+l/2,y:i+a};case Q.Left:return{x:r,y:i+a/2}}}function nl(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Zo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function X5(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,a)=>([a.markerStart||s,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const d=Zo(c,t);i.has(d)||(l.push({id:d,color:c.color||n,...c}),i.add(d))}}),l),[]).sort((l,a)=>l.id.localeCompare(a.id))}const qr={nodeOrigin:[0,0],nodeExtent:Cn,elevateNodesOnSelect:!0,defaults:{}},Q5={...qr,checkEquality:!0};function Xr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function J5(e,t,n){const s=Xr(qr,n);for(const r of e.values())if(r.parentId)Qr(r,e,t,s);else{const i=An(r,s.nodeOrigin),l=en(r.extent)?r.extent:s.nodeExtent,a=At(i,l,ut(r));r.internals.positionAbsolute=a}}function Ko(e,t,n,s){const r=Xr(Q5,s);let i=e.length>0;const l=new Map(t),a=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let d=l.get(c.id);if(r.checkEquality&&c===d?.internals.userNode)t.set(c.id,d);else{const x=An(c,r.nodeOrigin),p=en(c.extent)?c.extent:r.nodeExtent,m=At(x,p,ut(c));d={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:m,handleBounds:c.measured?d?.internals.handleBounds:void 0,z:Ku(c,a),userNode:c}},t.set(c.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(i=!1),c.parentId&&Qr(d,t,n,s)}return i}function ey(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 Qr(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=Xr(qr,s),a=e.parentId,c=t.get(a);if(!c){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ey(e,n);const d=r?1e3:0,{x,y:p,z:m}=ty(e,c,i,l,d),{positionAbsolute:h}=e.internals,j=x!==h.x||p!==h.y;(j||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:j?{x,y:p}:h,z:m}})}function Ku(e,t){return(Ke(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function ty(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,a=ut(e),c=An(e,n),d=en(e.extent)?At(c,e.extent,a):c;let x=At({x:i+d.x,y:l+d.y},s,a);e.extent==="parent"&&(x=Lu(x,a,t));const p=Ku(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>=p?m+1:p}}function Jr(e,t,n,s=[0,0]){const r=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=i.get(l.parentId)?.expandedRect??Jt(a),d=Tu(c,l.rect);i.set(l.parentId,{expandedRect:d,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},c)=>{const d=a.internals.positionAbsolute,x=ut(a),p=a.origin??s,m=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,h=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,j=Math.max(x.width,Math.round(l.width)),E=Math.max(x.height,Math.round(l.height)),S=(j-x.width)*p[0],R=(E-x.height)*p[1];(m>0||h>0||S||R)&&(r.push({id:c,type:"position",position:{x:a.position.x-m+S,y:a.position.y-h+R}}),n.get(c)?.forEach(v=>{e.some(y=>y.id===v.id)||r.push({id:v.id,type:"position",position:{x:v.position.x+m,y:v.position.y+h}})})),(x.width<l.width||x.height<l.height||m||h)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:j+(m?p[0]*m-S:0),height:E+(h?p[1]*h-R:0)}})}),r}function ny(e,t,n,s,r,i){const l=s?.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const c=[],d=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(d.transform),p=[];for(const m of e.values()){const h=t.get(m.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),a=!0;continue}const j=Ur(m.nodeElement),E=h.measured.width!==j.width||h.measured.height!==j.height;if(!!(j.width&&j.height&&(E||!h.internals.handleBounds||m.force))){const R=m.nodeElement.getBoundingClientRect(),v=en(h.extent)?h.extent:i;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=Lu(y,j,t.get(h.parentId)):v&&(y=At(y,v,j));const C={...h,measured:j,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:qi("source",m.nodeElement,R,x,h.id),target:qi("target",m.nodeElement,R,x,h.id)}}};t.set(h.id,C),h.parentId&&Qr(C,t,n,{nodeOrigin:r}),a=!0,E&&(c.push({id:h.id,type:"dimensions",dimensions:j}),h.expandParent&&h.parentId&&p.push({id:h.id,parentId:h.parentId,rect:Jt(C,r)}))}}if(p.length>0){const m=Jr(p,t,n,r);c.push(...m)}return{changes:c,updatedInternals:a}}async function sy({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){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],[r,i]],s),a=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(a)}function sl(e,t,n,s,r,i){let l=r;const a=s.get(l)||new Map;s.set(l,a.set(n,t)),l=`${r}-${e}`;const c=s.get(l)||new Map;if(s.set(l,c.set(n,t)),i){l=`${r}-${e}-${i}`;const d=s.get(l)||new Map;s.set(l,d.set(n,t))}}function Yu(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:a=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:a},d=`${r}-${l}--${i}-${a}`,x=`${i}-${a}--${r}-${l}`;sl("source",c,x,e,r,l),sl("target",c,d,e,i,a),t.set(s.id,s)}}function Wu(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Wu(n,t):!1}function ol(e,t,n){let s=e;do{if(s?.matches?.(t))return!0;if(s===n)return!1;s=s?.parentElement}while(s);return!1}function oy(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Wu(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function po({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){const r=[];for(const[l,a]of t){const c=n.get(l)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:s})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:s}:r[0],r]}function ry({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,a=new Map,c=!1,d={x:0,y:0},x=null,p=!1,m=null,h=!1,j=!1;function E({noDragClassName:R,handleSelector:v,domNode:y,isSelectable:C,nodeId:N,nodeClickDistance:k=0}){m=ze(y);function A({x:H,y:B},$){const{nodeLookup:w,nodeExtent:P,snapGrid:L,snapToGrid:O,nodeOrigin:z,onNodeDrag:F,onSelectionDrag:Z,onError:K,updateNodePositions:X}=t();i={x:H,y:B};let oe=!1,J={x:0,y:0,x2:0,y2:0};if(a.size>1&&P){const ue=In(a);J=Vo(ue)}for(const[ue,te]of a){if(!w.has(ue))continue;let ne={x:H-te.distance.x,y:B-te.distance.y};O&&(ne=$s(ne,L));let ee=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];if(a.size>1&&P&&!te.extent){const{positionAbsolute:ye}=te.internals,G=ye.x-J.x+P[0][0],re=ye.x+te.measured.width-J.x2+P[1][0],ie=ye.y-J.y+P[0][1],we=ye.y+te.measured.height-J.y2+P[1][1];ee=[[G,ie],[re,we]]}const{position:le,positionAbsolute:ge}=ku({nodeId:ue,nextPosition:ne,nodeLookup:w,nodeExtent:ee,nodeOrigin:z,onError:K});oe=oe||te.position.x!==le.x||te.position.y!==le.y,te.position=le,te.internals.positionAbsolute=ge}if(j=j||oe,!!oe&&(X(a,!0),$&&(s||F||!N&&Z))){const[ue,te]=po({nodeId:N,dragItems:a,nodeLookup:w});s?.($,a,ue,te),F?.($,ue,te),N||Z?.($,te)}}async function I(){if(!x)return;const{transform:H,panBy:B,autoPanSpeed:$,autoPanOnNodeDrag:w}=t();if(!w){c=!1,cancelAnimationFrame(l);return}const[P,L]=Pu(d,x,$);(P!==0||L!==0)&&(i.x=(i.x??0)-P/H[2],i.y=(i.y??0)-L/H[2],await B({x:P,y:L})&&A(i,null)),l=requestAnimationFrame(I)}function D(H){const{nodeLookup:B,multiSelectionActive:$,nodesDraggable:w,transform:P,snapGrid:L,snapToGrid:O,selectNodesOnDrag:z,onNodeDragStart:F,onSelectionDragStart:Z,unselectNodesAndEdges:K}=t();p=!0,(!z||!C)&&!$&&N&&(B.get(N)?.selected||K()),C&&z&&N&&e?.(N);const X=gn(H.sourceEvent,{transform:P,snapGrid:L,snapToGrid:O,containerBounds:x});if(i=X,a=oy(B,w,X,N),a.size>0&&(n||F||!N&&Z)){const[oe,J]=po({nodeId:N,dragItems:a,nodeLookup:B});n?.(H.sourceEvent,a,oe,J),F?.(H.sourceEvent,oe,J),N||Z?.(H.sourceEvent,J)}}const V=fu().clickDistance(k).on("start",H=>{const{domNode:B,nodeDragThreshold:$,transform:w,snapGrid:P,snapToGrid:L}=t();x=B?.getBoundingClientRect()||null,h=!1,j=!1,$===0&&D(H),i=gn(H.sourceEvent,{transform:w,snapGrid:P,snapToGrid:L,containerBounds:x}),d=Xe(H.sourceEvent,x)}).on("drag",H=>{const{autoPanOnNodeDrag:B,transform:$,snapGrid:w,snapToGrid:P,nodeDragThreshold:L,nodeLookup:O}=t(),z=gn(H.sourceEvent,{transform:$,snapGrid:w,snapToGrid:P,containerBounds:x});if((H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||N&&!O.has(N))&&(h=!0),!h){if(!c&&B&&p&&(c=!0,I()),!p){const F=z.xSnapped-(i.x??0),Z=z.ySnapped-(i.y??0);Math.sqrt(F*F+Z*Z)>L&&D(H)}(i.x!==z.xSnapped||i.y!==z.ySnapped)&&a&&p&&(d=Xe(H.sourceEvent,x),A(z,H.sourceEvent))}}).on("end",H=>{if(!(!p||h)&&(c=!1,p=!1,cancelAnimationFrame(l),a.size>0)){const{nodeLookup:B,updateNodePositions:$,onNodeDragStop:w,onSelectionDragStop:P}=t();if(j&&($(a,!1),j=!1),r||w||!N&&P){const[L,O]=po({nodeId:N,dragItems:a,nodeLookup:B,dragging:!1});r?.(H.sourceEvent,a,L,O),w?.(H.sourceEvent,L,O),N||P?.(H.sourceEvent,O)}}}).filter(H=>{const B=H.target;return!H.button&&(!R||!ol(B,`.${R}`,y))&&(!v||ol(B,v,y))});m.call(V)}function S(){m?.on(".drag",null)}return{update:E,destroy:S}}function iy(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())wn(r,Jt(i))>0&&s.push(i);return s}const ly=250;function ay(e,t,n,s){let r=[],i=1/0;const l=iy(e,n,t+ly);for(const a of l){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const d of c){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x,y:p}=bn(a,d,d.position,!0),m=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(p-e.y,2));m>t||(m<i?(r=[{...d,x,y:p}],i=m):m===i&&r.push({...d,x,y:p}))}}if(!r.length)return null;if(r.length>1){const a=s.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function Gu(e,t,n,s,r,i=!1){const l=s.get(e);if(!l)return null;const a=r==="strict"?l.internals.handleBounds?.[t]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],c=(n?a?.find(d=>d.id===n):a?.[0])??null;return c&&i?{...c,...bn(l,c,c.position,!0)}:c}function Uu(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function cy(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const qu=()=>!0;function uy(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:a,nodeLookup:c,lib:d,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:h,onConnectStart:j,onConnect:E,onConnectEnd:S,isValidConnection:R=qu,onReconnectEnd:v,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:k,dragThreshold:A=1}){const I=Ou(e.target);let D=0,V;const{x:H,y:B}=Xe(e),$=I?.elementFromPoint(H,B),w=Uu(i,$),P=a?.getBoundingClientRect();let L=!1;if(!P||!w)return;const O=Gu(r,w,s,c,t);if(!O)return;let z=Xe(e,P),F=!1,Z=null,K=!1,X=null;function oe(){if(!x||!P)return;const[ye,G]=Pu(z,P,k);m({x:ye,y:G}),D=requestAnimationFrame(oe)}const J={...O,nodeId:r,type:w,position:O.position},ue=c.get(r);let ne={inProgress:!0,isValid:null,from:bn(ue,J,Q.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:ue,to:z,toHandle:null,toPosition:Yi[J.position],toNode:null};function ee(){L=!0,y(ne),j?.(e,{nodeId:r,handleId:s,handleType:w})}A===0&&ee();function le(ye){if(!L){const{x:we,y:ke}=Xe(ye),st=we-H,Vt=ke-B;if(!(st*st+Vt*Vt>A*A))return;ee()}if(!N()||!J){ge(ye);return}const G=C();z=Xe(ye,P),V=ay(On(z,G,!1,[1,1]),n,c,J),F||(oe(),F=!0);const re=Xu(ye,{handle:V,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:I,lib:d,flowId:p,nodeLookup:c});X=re.handleDomNode,Z=re.connection,K=cy(!!V,re.isValid);const ie={...ne,isValid:K,to:re.toHandle&&K?Ss({x:re.toHandle.x,y:re.toHandle.y},G):z,toHandle:re.toHandle,toPosition:K&&re.toHandle?re.toHandle.position:Yi[J.position],toNode:re.toHandle?c.get(re.toHandle.nodeId):null};K&&V&&ne.toHandle&&ie.toHandle&&ne.toHandle.type===ie.toHandle.type&&ne.toHandle.nodeId===ie.toHandle.nodeId&&ne.toHandle.id===ie.toHandle.id&&ne.to.x===ie.to.x&&ne.to.y===ie.to.y||(y(ie),ne=ie)}function ge(ye){if(L){(V||X)&&Z&&K&&E?.(Z);const{inProgress:G,...re}=ne,ie={...re,toPosition:ne.toHandle?ne.toPosition:null};S?.(ye,ie),i&&v?.(ye,ie)}h(),cancelAnimationFrame(D),F=!1,K=!1,Z=null,X=null,I.removeEventListener("mousemove",le),I.removeEventListener("mouseup",ge),I.removeEventListener("touchmove",le),I.removeEventListener("touchend",ge)}I.addEventListener("mousemove",le),I.addEventListener("mouseup",ge),I.addEventListener("touchmove",le),I.addEventListener("touchend",ge)}function Xu(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:a,flowId:c,isValidConnection:d=qu,nodeLookup:x}){const p=i==="target",m=t?l.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:j}=Xe(e),E=l.elementFromPoint(h,j),S=E?.classList.contains(`${a}-flow__handle`)?E:m,R={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const v=Uu(void 0,S),y=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),N=S.classList.contains("connectable"),k=S.classList.contains("connectableend");if(!y||!v)return R;const A={source:p?y:s,sourceHandle:p?C:r,target:p?s:y,targetHandle:p?r:C};R.connection=A;const D=N&&k&&(n===Tt.Strict?p&&v==="source"||!p&&v==="target":y!==s||C!==r);R.isValid=D&&d(A),R.toHandle=Gu(y,v,C,x,n,!0)}return R}const Yo={onPointerDown:uy,isValid:Xu};function dy({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=ze(e);function i({translateExtent:a,width:c,height:d,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:h=!1}){const j=y=>{const C=n();if(y.sourceEvent.type!=="wheel"||!t)return;const N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*x,k=C[2]*Math.pow(2,N);t.scaleTo(k)};let E=[0,0];const S=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},R=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],k=[N[0]-E[0],N[1]-E[1]];E=N;const A=s()*Math.max(C[2],Math.log(C[2]))*(h?-1:1),I={x:C[0]-k[0]*A,y:C[1]-k[1]*A},D=[[0,0],[c,d]];t.setViewportConstrained({x:I.x,y:I.y,zoom:C[2]},D,a)},v=wu().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?j:null);r.call(v,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:Ze}}const xy=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Vs=e=>({x:e.x,y:e.y,zoom:e.k}),mo=({x:e,y:t,zoom:n})=>Ds.translate(e,t).scale(n),Yt=(e,t)=>e.target.closest(`.${t}`),Qu=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),py=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fo=(e,t=0,n=py,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},Ju=e=>{const t=e.ctrlKey&&Rs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function my({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:d}){return x=>{if(Yt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=Ze(x),R=Ju(x),v=p*Math.pow(2,R);s.scaleTo(n,v,S,x);return}const m=x.deltaMode===1?20:1;let h=r===bt.Vertical?0:x.deltaX*m,j=r===bt.Horizontal?0:x.deltaY*m;!Rs()&&x.shiftKey&&r!==bt.Vertical&&(h=x.deltaY*m,j=0),s.translateBy(n,-(h/p)*i,-(j/p)*i,{internal:!0});const E=Vs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a?.(x,E)),e.isPanScrolling&&(c?.(x,E),e.panScrollTimeout=setTimeout(()=>{d?.(x,E),e.isPanScrolling=!1},150))}}function fy({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",l=!t&&i&&!s.ctrlKey,a=Yt(s,e);if(s.ctrlKey&&i&&a&&s.preventDefault(),l||a)return null;s.preventDefault(),n.call(this,s,r)}}function hy({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{if(s.sourceEvent?.internal)return;const r=Vs(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,s.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(s.sourceEvent,r)}}function gy({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Qu(t,e.mouseButton??0)),i.sourceEvent?.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Vs(i.transform))}}function jy({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Qu(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&xy(e.prevViewport,l.transform))){const a=Vs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(l.sourceEvent,a)},n?150:0)}}}function Ey({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:a,noPanClassName:c,lib:d}){return x=>{const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(Yt(x,`${d}-flow__node`)||Yt(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||Yt(x,a)&&x.type==="wheel"||Yt(x,c)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&x.touches?.length>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const h=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&h}}function yy({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:d}){const x={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=wu().clickDistance(!Ke(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),h=ze(e).call(m);y({x:i.x,y:i.y,zoom:Qt(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const j=h.on("wheel.zoom"),E=h.on("dblclick.zoom");m.wheelDelta(Ju);function S(B,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?_.interpolate:ts).transform(fo(h,$?.duration,$?.ease,()=>w(!0)),B)}):Promise.resolve(!1)}function R({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:w,userSelectionActive:P,panOnScroll:L,panOnDrag:O,panOnScrollMode:z,panOnScrollSpeed:F,preventScrolling:Z,zoomOnPinch:K,zoomOnScroll:X,zoomOnDoubleClick:oe,zoomActivationKeyPressed:J,lib:ue,onTransformChange:te}){P&&!x.isZoomingOrPanning&&v();const ee=L&&!J&&!P?my({zoomPanValues:x,noWheelClassName:B,d3Selection:h,d3Zoom:m,panOnScrollMode:z,panOnScrollSpeed:F,zoomOnPinch:K,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):fy({noWheelClassName:B,preventScrolling:Z,d3ZoomHandler:j});if(h.on("wheel.zoom",ee,{passive:!1}),!P){const ge=hy({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:a});m.on("start",ge);const ye=gy({zoomPanValues:x,panOnDrag:O,onPaneContextMenu:!!w,onPanZoom:l,onTransformChange:te});m.on("zoom",ye);const G=jy({zoomPanValues:x,panOnDrag:O,panOnScroll:L,onPaneContextMenu:w,onPanZoomEnd:c,onDraggingChange:d});m.on("end",G)}const le=Ey({zoomActivationKeyPressed:J,panOnDrag:O,zoomOnScroll:X,panOnScroll:L,zoomOnDoubleClick:oe,zoomOnPinch:K,userSelectionActive:P,noPanClassName:$,noWheelClassName:B,lib:ue});m.filter(le),oe?h.on("dblclick.zoom",E):h.on("dblclick.zoom",null)}function v(){m.on("zoom",null)}async function y(B,$,w){const P=mo(B),L=m?.constrain()(P,$,w);return L&&await S(L),new Promise(O=>O(L))}async function C(B,$){const w=mo(B);return await S(w,$),new Promise(P=>P(w))}function N(B){if(h){const $=mo(B),w=h.property("__zoom");(w.k!==B.zoom||w.x!==B.x||w.y!==B.y)&&m?.transform(h,$,null,{sync:!0})}}function k(){const B=h?Cu(h.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}function A(B,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?_.interpolate:ts).scaleTo(fo(h,$?.duration,$?.ease,()=>w(!0)),B)}):Promise.resolve(!1)}function I(B,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?_.interpolate:ts).scaleBy(fo(h,$?.duration,$?.ease,()=>w(!0)),B)}):Promise.resolve(!1)}function D(B){m?.scaleExtent(B)}function V(B){m?.translateExtent(B)}function H(B){const $=!Ke(B)||B<0?0:B;m?.clickDistance($)}return{update:R,destroy:v,setViewport:C,setViewportConstrained:y,getViewport:k,scaleTo:A,scaleBy:I,setScaleExtent:D,setTranslateExtent:V,syncViewport:N,setClickDistance:H}}var tn;(function(e){e.Line="line",e.Handle="handle"})(tn||(tn={}));function Sy({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,a=n-s,c=[l>0?1:l<0?-1:0,a>0?1:a<0?-1:0];return l&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function Ry(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function xt(e,t){return Math.max(0,t-e)}function pt(e,t){return Math.max(0,e-t)}function Un(e,t,n){return Math.max(0,t-e,e-n)}function rl(e,t){return e?!t:t}function Cy(e,t,n,s,r,i,l,a){let{affectsX:c,affectsY:d}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:h,ySnapped:j}=n,{minWidth:E,maxWidth:S,minHeight:R,maxHeight:v}=s,{x:y,y:C,width:N,height:k,aspectRatio:A}=e;let I=Math.floor(x?h-e.pointerX:0),D=Math.floor(p?j-e.pointerY:0);const V=N+(c?-I:I),H=k+(d?-D:D),B=-i[0]*N,$=-i[1]*k;let w=Un(V,E,S),P=Un(H,R,v);if(l){let z=0,F=0;c&&I<0?z=xt(y+I+B,l[0][0]):!c&&I>0&&(z=pt(y+V+B,l[1][0])),d&&D<0?F=xt(C+D+$,l[0][1]):!d&&D>0&&(F=pt(C+H+$,l[1][1])),w=Math.max(w,z),P=Math.max(P,F)}if(a){let z=0,F=0;c&&I>0?z=pt(y+I,a[0][0]):!c&&I<0&&(z=xt(y+V,a[1][0])),d&&D>0?F=pt(C+D,a[0][1]):!d&&D<0&&(F=xt(C+H,a[1][1])),w=Math.max(w,z),P=Math.max(P,F)}if(r){if(x){const z=Un(V/A,R,v)*A;if(w=Math.max(w,z),l){let F=0;!c&&!d||c&&!d&&m?F=pt(C+$+V/A,l[1][1])*A:F=xt(C+$+(c?I:-I)/A,l[0][1])*A,w=Math.max(w,F)}if(a){let F=0;!c&&!d||c&&!d&&m?F=xt(C+V/A,a[1][1])*A:F=pt(C+(c?I:-I)/A,a[0][1])*A,w=Math.max(w,F)}}if(p){const z=Un(H*A,E,S)/A;if(P=Math.max(P,z),l){let F=0;!c&&!d||d&&!c&&m?F=pt(y+H*A+B,l[1][0])/A:F=xt(y+(d?D:-D)*A+B,l[0][0])/A,P=Math.max(P,F)}if(a){let F=0;!c&&!d||d&&!c&&m?F=xt(y+H*A,a[1][0])/A:F=pt(y+(d?D:-D)*A,a[0][0])/A,P=Math.max(P,F)}}}D=D+(D<0?P:-P),I=I+(I<0?w:-w),r&&(m?V>H*A?D=(rl(c,d)?-I:I)/A:I=(rl(c,d)?-D:D)*A:x?(D=I/A,d=c):(I=D*A,c=d));const L=c?y+I:y,O=d?C+D:C;return{width:N+(c?-I:I),height:k+(d?-D:D),x:i[0]*I*(c?-1:1)+L,y:i[1]*D*(d?-1:1)+O}}const ed={width:0,height:0,x:0,y:0},wy={...ed,pointerX:0,pointerY:0,aspectRatio:1};function by(e){return[[0,0],[e.measured.width,e.measured.height]]}function vy(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,a=n[0]*i,c=n[1]*l;return[[s-a,r-c],[s+i-a,r+l-c]]}function _y({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=ze(e);function l({controlPosition:c,boundaries:d,keepAspectRatio:x,resizeDirection:p,onResizeStart:m,onResize:h,onResizeEnd:j,shouldResize:E}){let S={...ed},R={...wy};const v=Ry(c);let y,C=null,N=[],k,A,I;const D=fu().on("start",V=>{const{nodeLookup:H,transform:B,snapGrid:$,snapToGrid:w,nodeOrigin:P,paneDomNode:L}=n();if(y=H.get(t),!y)return;C=L?.getBoundingClientRect()??null;const{xSnapped:O,ySnapped:z}=gn(V.sourceEvent,{transform:B,snapGrid:$,snapToGrid:w,containerBounds:C});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},R={...S,pointerX:O,pointerY:z,aspectRatio:S.width/S.height},k=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(k=H.get(y.parentId),A=k&&y.extent==="parent"?by(k):void 0),N=[],I=void 0;for(const[F,Z]of H)if(Z.parentId===t&&(N.push({id:F,position:{...Z.position},extent:Z.extent}),Z.extent==="parent"||Z.expandParent)){const K=vy(Z,y,Z.origin??P);I?I=[[Math.min(K[0][0],I[0][0]),Math.min(K[0][1],I[0][1])],[Math.max(K[1][0],I[1][0]),Math.max(K[1][1],I[1][1])]]:I=K}m?.(V,{...S})}).on("drag",V=>{const{transform:H,snapGrid:B,snapToGrid:$,nodeOrigin:w}=n(),P=gn(V.sourceEvent,{transform:H,snapGrid:B,snapToGrid:$,containerBounds:C}),L=[];if(!y)return;const{x:O,y:z,width:F,height:Z}=S,K={},X=y.origin??w,{width:oe,height:J,x:ue,y:te}=Cy(R,v,P,d,x,X,A,I),ne=oe!==F,ee=J!==Z,le=ue!==O&&ne,ge=te!==z&&ee;if(!le&&!ge&&!ne&&!ee)return;if((le||ge||X[0]===1||X[1]===1)&&(K.x=le?ue:S.x,K.y=ge?te:S.y,S.x=K.x,S.y=K.y,N.length>0)){const ie=ue-O,we=te-z;for(const ke of N)ke.position={x:ke.position.x-ie+X[0]*(oe-F),y:ke.position.y-we+X[1]*(J-Z)},L.push(ke)}if((ne||ee)&&(K.width=ne&&(!p||p==="horizontal")?oe:S.width,K.height=ee&&(!p||p==="vertical")?J:S.height,S.width=K.width,S.height=K.height),k&&y.expandParent){const ie=X[0]*(K.width??0);K.x&&K.x<ie&&(S.x=ie,R.x=R.x-(K.x-ie));const we=X[1]*(K.height??0);K.y&&K.y<we&&(S.y=we,R.y=R.y-(K.y-we))}const ye=Sy({width:S.width,prevWidth:F,height:S.height,prevHeight:Z,affectsX:v.affectsX,affectsY:v.affectsY}),G={...S,direction:ye};E?.(V,G)!==!1&&(h?.(V,G),s(K,L))}).on("end",V=>{j?.(V,{...S}),r?.({...S})});i.call(D)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var qn={exports:{}},ho={},Xn={exports:{}},go={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./symbols-B15FeAg9.cjs"),o=require("./jsx-runtime-CITbqOLs.cjs"),g=require("react"),u=require("./css-9yccD6t_.cjs"),M=require("./eraser-CLWNvWDn.cjs"),Ph=require("./external-CtooTI5M.cjs"),Hl=require("./Animated-DnsZ5vvU.cjs"),_=require("./provider-DBSsDoFS.cjs"),$l=require("react-dom"),tt=require("./external-DFsKdN71.cjs"),Vl=require("./external-DXY1bIut.cjs"),Ae=require("./external-CY2bvy20.cjs"),se=require("zod"),Pe=require("./external-BJ91nMtQ.cjs"),ws=require("./external-DZqxSCvz.cjs"),Fl=require("./external-ClD4VLgc.cjs"),Zl=require("./Menu-vR5-lqo4.cjs"),pe=require("./external-BGCkpetp.cjs"),Kl=require("./units-BGkvnLO-.cjs"),Th=require("./external-_eEnQPcq.cjs"),Ah=require("./external-DNHOS3w0.cjs"),ke=require("./external-CS6l_QN4.cjs"),Ih=require("./external-DPqPAgoV.cjs"),Oh=require("./external-CkvXTCCL.cjs"),Bh=require("./Video-BidrtYj_.cjs"),Yl=require("./Toggle-Ckdi4fKV.cjs"),Dh=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),zh=e=>se.array(e).or(e.transform(t=>[t])),Wl=e=>M.f(e,(t,n,s)=>{const r=n===s.length-1,i=!isNaN(parseInt(t)),l=!isNaN(parseInt(s[n+1]));return i&&(t="element"),r||l?t:[t,"shape"]}),hi=(e,t)=>{if(e==null)return null;const n=e[t];return n==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:n},Hh=(e,t,n)=>M.c(hi(e,"shape"),Wl(t),{...n,getter:hi}),$h=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:Hh,getFieldSchemaPath:Wl,nullToUndefined:Dh,toArray:zh},Symbol.toStringTag,{value:"Module"})),Gl=Symbol(),Uo=Symbol(),un="a",es="w";let Vh=(e,t)=>new Proxy(e,t);const Ro=Object.getPrototypeOf,gi=new WeakMap,qo=e=>e&&(gi.has(e)?gi.get(e):Ro(e)===Object.prototype||Ro(e)===Array.prototype),ji=e=>typeof e=="object"&&e!==null,Ei=new WeakMap,Ul=e=>e[Uo]||e,ql=(e,t,n)=>{if(!qo(e))return e;const s=Ul(e),r=(l=>Object.isFrozen(l)||Object.values(Object.getOwnPropertyDescriptors(l)).some(a=>!a.writable))(s);let i=n&&n.get(s);return i&&i[1].f===r||(i=((l,a)=>{const c={f:a};let d=!1;const x=(m,h)=>{if(!d){let j=c[un].get(l);if(j||(j={},c[un].set(l,j)),m===es)j[es]=!0;else{let E=j[m];E||(E=new Set,j[m]=E),E.add(h)}}},p={get:(m,h)=>h===Uo?l:(x("k",h),ql(Reflect.get(m,h),c[un],c.c)),has:(m,h)=>h===Gl?(d=!0,c[un].delete(l),!0):(x("h",h),Reflect.has(m,h)),getOwnPropertyDescriptor:(m,h)=>(x("o",h),Reflect.getOwnPropertyDescriptor(m,h)),ownKeys:m=>(x(es),Reflect.ownKeys(m))};return a&&(p.set=p.deleteProperty=()=>!1),[p,c]})(s,r),i[1].p=Vh(r?(l=>{let a=Ei.get(l);if(!a){if(Array.isArray(l))a=Array.from(l);else{const c=Object.getOwnPropertyDescriptors(l);Object.values(c).forEach(d=>{d.configurable=!0}),a=Object.create(Ro(l),c)}Ei.set(l,a)}return a})(s):s,i[0]),n&&n.set(s,i)),i[1][un]=t,i[1].c=n,i[1].p},Xl=(e,t,n,s)=>{if(Object.is(e,t))return!1;if(!ji(e)||!ji(t))return!0;const r=n.get(Ul(e));if(!r)return!0;if(s){const l=s.get(e);if(l&&l.n===t)return l.g;s.set(e,{n:t,g:!1})}let i=null;try{for(const l of r.h||[])if(i=Reflect.has(e,l)!==Reflect.has(t,l),i)return i;if(r[es]===!0){if(i=((l,a)=>{const c=Reflect.ownKeys(l),d=Reflect.ownKeys(a);return c.length!==d.length||c.some((x,p)=>x!==d[p])})(e,t),i)return i}else for(const l of r.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,l)!=!!Reflect.getOwnPropertyDescriptor(t,l),i)return i;for(const l of r.k||[])if(i=Xl(e[l],t[l],n,s),i)return i;return i===null&&(i=!0),i}finally{s&&s.set(e,{n:t,g:i})}},Fh=e=>!!qo(e)&&Gl in e,Ql=e=>qo(e)&&e[Uo]||null,Zh="h",Kh="w",Yh="o",Wh="k",Co=e=>typeof e=="object"&&e!==null,Jl=(e,t)=>{if(!Co(e))return e;const n=Ql(e);return n!==null?(Fh(e),n):(t.has(e)||(t.add(e),Object.entries(e).forEach(([s,r])=>{const i=Jl(r,t);Object.is(i,r)||(e[s]=i)})),e)},wo=(e,t,n)=>{var s,r,i;if(!Co(e)||!Co(t))return;const l=n.get(Ql(t)||t);l&&((s=l[Zh])==null||s.forEach(a=>{Reflect.has(e,a)}),l[Kh]===!0&&Reflect.ownKeys(e),(r=l[Yh])==null||r.forEach(a=>{Reflect.getOwnPropertyDescriptor(e,a)}),(i=l[Wh])==null||i.forEach(a=>{wo(e[a],t[a],n)}))},Js="o",eo="r",to="a";function Gh(e,t){var n;let s=0;const r=(n=t?.size)!=null?n:1,i=[],l=t!=null&&t.noWeakMap?null:new WeakMap;return c=>{const d=l?.get(c);if(d)return d[eo];for(let j=0;j<r;j+=1){const E=i[(s+j)%r];if(!E)break;if(!Xl(E[Js],c,E[to],new WeakMap))return wo(c,E[Js],E[to]),l?.set(c,E),E[eo]}const x=new WeakMap,p=ql(c,x),m=Jl(e(p),new Set);wo(c,c,x);const h={[Js]:c,[eo]:m,[to]:x};return s=(s-1+r)%r,i[s]=h,l?.set(c,h),m}}const Uh=(e,t)=>u.S.RUNTIME==="browser"?Gh(e,t):e,Ge=(e,t)=>{g.useEffect(()=>{const n=new AbortController,s=n.signal,i=(async()=>(await u.ur(),await e(s)))().catch(console.error);return()=>{n.abort(),i.then(l=>l?.()).catch(console.error)}},t)},qh=(e,t,n=150)=>{const[s,r]=g.useState(e);return g.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},Xh=({transforms:e=[]})=>{const[t,n]=g.useState(e),s=g.useCallback((l,a,c=0)=>n(d=>{const x=d.filter(p=>p.key!==l);return x.push({key:l,transform:a,priority:c}),x.sort((p,m)=>m.priority-p.priority),x}),[n]),r=g.useCallback(l=>n(a=>a.filter(c=>c.key!==l)),[s]);return{transform:g.useCallback(l=>t.reduce((a,c)=>c.transform(a),{...l,transformed:!1}),[t]),setTransform:s,deleteTransform:r}},Qh=Object.freeze(Object.defineProperty({__proto__:null,Access:f.Access,Acquire:f.Acquire,Add:f.Add,Align:f.Align,Analyze:f.Analyze,Annotate:f.Annotate,Array:f.Array,Arrow:f.Arrow,Attachment:f.Attachment,Auto:f.Auto,AutoFitWidth:f.AutoFitWidth,Binary:f.Binary,Bolt:f.Bolt,Box:f.Box$1,Bridge:f.Bridge,Calculation:f.Calculation,Calendar:f.Calendar$1,Caret:f.Caret,Channel:f.Channel,Check:f.Check,Circle:f.Circle,Close:f.Close,Cluster:f.Cluster,Commit:f.Commit,Concepts:f.Concepts,Connect:f.Connect,Constant:f.Constant,Control:f.Control,Copy:f.Copy,Decimal:f.Decimal,Delete:f.Delete,Details:f.Details,Device:f.Device,Disable:f.Disable,Disconnect:f.Disconnect,Download:f.Download,Downsample:f.Downsample,Drag:f.Drag,Dynamic:f.Dynamic,Edit:f.Edit,EditOff:f.EditOff,Enable:f.Enable,Expand:f.Expand,Explore:f.Explore,Export:f.Export,Feedback:f.Feedback,Filter:f.Filter,Focus:f.Focus,Function:f.Function,Group:f.Group,Guide:f.Guide,Hardware:f.Hardware,Heart:f.Heart,Hidden:f.Hidden,Import:f.Import,Index:f.Index,Info:f.Info,JSON:f.JSON,Keyboard:f.Keyboard,Label:f.Label,LinePlot:f.LinePlot,Linear:f.Linear,Link:f.Link,LinkExternal:f.LinkExternal,Loading:f.Loading,Log:f.Log,Logo:f.Logo,Map:f.Map,Menu:f.Menu,MoveToMainWindow:f.MoveToMainWindow,NPM:f.NPM,Node:f.Node,None:f.None,OpenExternal:f.OpenExternal,OpenInNewWindow:f.OpenInNewWindow,PNPM:f.PNPM,Pan:f.Pan,Pause:f.Pause,Play:f.Play,Python:f.Python,QuestionMark:f.QuestionMark,Rack:f.Rack,Range:f.Range,Reference:f.Reference,Refresh:f.Refresh,Release:f.Release,Rename:f.Rename,Resources:f.Resources,Rotate:f.Rotate,Rule:f.Rule,Save:f.Save,Schematic:f.Schematic,Search:f.Search,Selection:f.Selection,Settings:f.Settings,Snapshot:f.Snapshot,Snooze:f.Snooze,Sound:f.Sound,SplitX:f.SplitX,SplitY:f.SplitY,StarFilled:f.StarFilled,StarOutlined:f.StarOutlined,String:f.String,StrokeWidth:f.StrokeWidth,Subtract:f.Subtract,Sync:f.Sync,Table:f.Table,Tare:f.Tare,Task:f.Task,Terminal:f.Terminal,Text:f.Text$3,TextAlign:f.TextAlign,Time:f.Time$1,Tooltip:f.Tooltip,Type:f.Type,TypeScript:f.TypeScript,Units:f.Units,User:f.User,Value:f.Value,Variable:f.Variable,Virtual:f.Virtual,Visible:f.Visible,Visualize:f.Visualize,Warning:f.Warning,Wave:f.Wave,Workspace:f.Workspace,Yarn:f.Yarn,Zoom:f.Zoom,createComposite:f.createComposite,resolve:f.resolve,wrapSVGIcon:f.wrapSVGIcon},Symbol.toStringTag,{value:"Module"})),Jh=Object.freeze(Object.defineProperty({__proto__:null,Config:f.Config,Dialog:f.Dialog$1,chooseLocation:f.chooseLocation,formatTip:f.formatTip,useConfig:f.useConfig,wrap:f.wrap},Symbol.toStringTag,{value:"Module"})),Xo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:a="px",showHandle:c=!0,...d})=>{const x=u.K$1.construct(t),p=u.K$1.direction(x),m=u.g.dimension(p);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),r),style:{[m]:`${s}${a}`,...n},ref:e,direction:p,empty:!0,...d,children:[i,c&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:u.CSS(u.CSS.BE("resize","handle"),u.CSS.bordered(u.K$1.swap(x))),onDragStart:l,onDrag:f.preventDefault,onDragEnd:f.preventDefault})]})},ea=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=g.useRef(null),[l,a]=g.useState({sizeDistribution:eg(n,t),root:null}),c=g.useCallback((p,m,h)=>{if(i.current==null)return;const j=u.Ho.dim(u.Ho.construct(i.current),r);a(E=>so(E,j,p,s,m,h))},[s,a,r]);g.useEffect(()=>e?.(l.sizeDistribution),[l.sizeDistribution,e]);const d=g.useCallback((p,m)=>{p.preventDefault();const h=r==="x"?"clientX":"clientY",j=S=>c(m,S[h]),E=()=>{a(S=>({...S,root:null})),document.removeEventListener("mousemove",j)};a(S=>({...S,root:p[h]})),document.addEventListener("mousemove",j),document.addEventListener("mouseup",E,{once:!0})},[a,r,so]);return{setSize:g.useCallback((p,m)=>c(p,void 0,m),[so]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},ta=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const a=u.g.construct(t),c=g.Children.toArray(n);return s=tg(s),o.jsxRuntimeExports.jsx(f.Box,{...l,ref:e,direction:a,className:u.CSS(u.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:c.map((d,x)=>o.jsxRuntimeExports.jsx(Xo,{onDragStart:p=>r(p,x),location:u.g.location(a),size:s[x]*100,sizeUnits:"%",showHandle:x!==c.length-1,children:d},x))})},eg=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},no=.001,tg=e=>e.every(t=>u.nr.closeTo(t,1/e.length),no)?e.map((t,n)=>n%2===0?t+no:n===e.length-1?t:t-no):e,so=(e,t,n,s,r,i)=>{const l=na(e,t,n,r,i),[a,c]=ng(e.sizeDistribution,n,l,s/t),d=c?r??null:e.root;return{...e,sizeDistribution:a,root:d}},na=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},ng=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=sg(r,e,s,n),a=e[l]-n;return i<s||a<s?[e,!1]:[e.map((c,d)=>d===r?i:d===l?a:c),!0]},sg=(e,t,n,s)=>(e===t.length-1?rg:og)(e,t,n,s),og=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},rg=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},oo=2,ig=100,sa=({onCollapse:e,onResize:t,location:n="left",minSize:s,maxSize:r,initialSize:i=200,collapseThreshold:l=1/0,className:a,...c})=>{const[d,x]=g.useState(u.R(i,s,r)),p=g.useRef(null),m=u.K$1.construct(n),h=g.useCallback(y=>{if(p.current===null)return 0;const C=u.Ho.dim(y,u.K$1.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),N=p.current+C,k=u.R(N,s,r);return(k-N)/(s??ig)>l?oo:k},[m,s,r,l]),j=g.useRef(null),E=g.useCallback(y=>{const C=h(y);x(C),j.current!=null&&t?.(C,u.Ho.construct(j.current))},[t,h]),S=g.useCallback(()=>x(y=>(p.current=y,y)),[x]),R=g.useCallback(y=>h(y)===oo&&e?.(),[e,h]);g.useEffect(()=>{s==null||r==null||x(y=>{const C=u.R(y,s,r);return p.current=C,C})},[s,r]);const v=Pe.useCursorDrag({onMove:E,onStart:S,onEnd:R});return o.jsxRuntimeExports.jsx(Xo,{ref:j,location:m,size:d,onDragStart:v,className:u.clsx(a,u.CSS.expanded(d!==oo)),...c})},lg=Object.freeze(Object.defineProperty({__proto__:null,Core:Xo,Multiple:ta,Single:sa,calculateDiffPercentage:na,useMultiple:ea},Symbol.toStringTag,{value:"Module"})),Qo=({aetherKey:e,enabled:t=!0})=>{const{setState:n}=f.useLifecycle({aetherKey:e,type:M.Eraser.TYPE,schema:M.eraserStateZ,initialState:{region:u.Ho.ZERO,enabled:t}}),s=f.useSyncedRef(t);return{erase:g.useCallback(i=>{n({enabled:s.current,region:i})},[n,s])}},ag=({aetherKey:e,children:t})=>{const{erase:n}=Qo({aetherKey:e}),s=f.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},cg=Object.freeze(Object.defineProperty({__proto__:null,Eraser:ag,use:Qo},Symbol.toStringTag,{value:"Module"})),ug=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},dg=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,onCollapse:a,eraseEnabled:c,...d})=>{const x=u.K$1.direction(s);c??=e!=null;const p=g.useCallback(()=>{a?a():e!=null&&n?.(e.key)},[n,e?.key,a]),{erase:m}=Qo({enabled:c}),h=g.useCallback((v,y)=>{l?.(v,y),m(y)},[l,m]),{content:j,minSize:E,maxSize:S,initialSize:R=0}=e??{};return o.jsxRuntimeExports.jsx(sa,{className:u.CSS(u.CSS.B("nav-drawer"),u.CSS.dir(x),u.CSS.visible(e!=null),i),collapseThreshold:r,onCollapse:p,location:s,onResize:h,minSize:E,maxSize:S,initialSize:R,...d,children:j})},xg=Object.freeze(Object.defineProperty({__proto__:null,Bar:f.Bar,Drawer:dg,useDrawer:ug},Symbol.toStringTag,{value:"Module"})),Jo={info:"var(--pluto-text-color)",error:"var(--pluto-error-z)",warning:"var(--pluto-warning-m1)",success:"var(--pluto-primary-z)",loading:"var(--pluto-text-color)",disabled:"var(--pluto-gray-l8)"},er=({variant:e,...t})=>e==="loading"?o.jsxRuntimeExports.jsx(f.Loading,{...t}):o.jsxRuntimeExports.jsx(f.Circle,{color:e!=null?Jo[e]:void 0,...t}),pg=({action:e})=>g.isValidElement(e)?e:g.createElement(f.Button,{...e,key:e.key,size:"tiny"}),mg=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:a,className:c,children:d,...x})=>{const p=g.useRef(null);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("notification"),c),y:!0,empty:!0,ref:p,...x,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,justify:"between",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(er,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:`x${n}`}),o.jsxRuntimeExports.jsx(f.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"start",className:u.CSS(u.CSS.BE("notification","content")),gap:"small",children:[d??o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","message")),style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),a!=null&&o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:M.t.toArray(a).map(m=>o.jsxRuntimeExports.jsx(pg,{action:m},m.key))})]},t.toString())},fg=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:f.Aggregator,Indicator:er,Notification:mg,Summary:f.Summary,VARIANT_COLORS:Jo,useAdder:f.useAdder,useErrorHandler:f.useErrorHandler,useNotifications:f.useNotifications},Symbol.toStringTag,{value:"Module"})),oa=e=>e==="preview"?"connected":e,ra=e=>e==="preview"?"preview":void 0,bs=({resourceName:e,value:t,onChange:n,data:s,getItem:r,subscribe:i,haulType:l,icon:a,disabled:c,onSearch:d,emptyContent:x,status:p,onFetchMore:m,children:h,renderTag:j,actions:E,allowNone:S,replaceOnSingle:R,triggerProps:v,virtual:y=!0,dialogProps:C,variant:N="connected",...k})=>o.jsxRuntimeExports.jsx(f.Frame,{variant:oa(N),...k,children:o.jsxRuntimeExports.jsxs(f.Frame$1,{multiple:!0,value:t,onChange:n,data:s,getItem:r,subscribe:i,onFetchMore:m,allowNone:S,replaceOnSingle:R,virtual:y,children:[o.jsxRuntimeExports.jsx(la,{haulType:l,icon:a,placeholder:`Select ${e}s`,disabled:c,variant:ra(N),...v,children:j}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:d,emptyContent:x,status:p,actions:E,resourceName:e,...C,children:h})]})}),Ue=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},ia=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:M.SIZES,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"tiny",children:"L"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",children:"M"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"medium",children:"L"})]}),hg=Object.freeze(Object.defineProperty({__proto__:null,SIZES:M.SIZES,SelectSize:ia,isRenderProp:f.isRenderProp,isSize:M.isSize,removeProps:Ue,renderProp:f.renderProp,size:M.size},Symbol.toStringTag,{value:"Module"})),vs=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...a})=>{const c=u.ir.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(f.Circle,{color:c}));const d=r==null?void 0:o.jsxRuntimeExports.jsx(f.Button,{"aria-label":"close",size:t==="tiny"?"small":t,variant:"text",className:u.CSS.BE("tag","close"),sharp:!0,onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(f.Close,{})});return o.jsxRuntimeExports.jsxs(f.Button,{el:"div",className:u.CSS(i,u.CSS.B("tag"),r!=null&&u.CSS.BM("tag","closeable")),size:t,overflow:"nowrap",align:"center",gap:"small",onDragStart:l,...a,children:[s,d,e]})},tr=({children:e,onClick:t,variant:n="outlined",size:s="medium",...r})=>o.jsxRuntimeExports.jsx(f.Button,{el:"div",variant:n,size:s,x:!0,onClick:t,align:"center",gap:"small",style:{padding:"0rem 0.5rem",paddingRight:"2rem"},rounded:!0,...r,children:e}),gg=Object.freeze(Object.defineProperty({__proto__:null,Tag:vs,Tags:tr},Symbol.toStringTag,{value:"Module"})),jg=({itemKey:e,icon:t,onDragStart:n})=>{const s=f.useItem(e),{onSelect:r}=f.useItemState(e);return o.jsxRuntimeExports.jsx(vs,{onClose:r,onDragStart:()=>n(e),draggable:!0,size:"small",status:s==null?"error":void 0,icon:s?.icon??t,children:s?.name??e})},Eg=f.renderProp(jg),nr=({items:e},t,n,s)=>{if(t===""||s===!0)return!1;const r=f.filterByType(t,e);return r.length>0&&!r.every(i=>n.includes(i.key))},la=({haulType:e="",disabled:t,placeholder:n="Select...",variant:s="outlined",icon:r,children:i=Eg})=>{const l=f.useSelection(),a=f.useSyncedRef(l),{setSelected:c}=f.useContext$2(),{toggle:d,visible:x}=f.useContext$1(),p=g.useCallback(v=>nr(v,e,M.t.toArray(l),t),[e,l,t]),{startDrag:m,...h}=f.useDragAndDrop({type:e,canDrop:p,onDrop:f.useFilterByTypeCallback(e,({items:v})=>{const y=M.t.toArray(a.current);return c(u.c.unique([...M.t.toArray(y),...v.map(C=>C.key)])),v},[c])}),j=g.useCallback(({dropped:v})=>{const y=l.filter(C=>!v.some(N=>N.key===C));c(y)},[c,l]),E=g.useCallback(v=>{m([{key:v,type:e}],j)},[m,j,e]),S=f.useDraggingState(),R=s==="text"&&l.length!==0;return o.jsxRuntimeExports.jsxs(tr,{full:"x",onClick:()=>{R||d()},...h,className:u.CSS(u.CSS.dropRegion(p(S)),u.CSS.BE("dialog","trigger"),u.CSS.BM("variant",s)),variant:s,preventClick:R,grow:!0,children:[l.length===0&&o.jsxRuntimeExports.jsxs(f.Text,{color:8,weight:400,style:{padding:"0 1rem"},children:[r,n]}),l.map(v=>i({key:v,itemKey:v,onDragStart:E,icon:r})),s!=="text"&&o.jsxRuntimeExports.jsx(Hl.Animated,{className:u.CSS.level("p"),enabled:x,enabledLoc:"bottom",disabledLoc:"left",color:8}),R&&o.jsxRuntimeExports.jsx(f.Button,{variant:s,onClick:v=>{v.stopPropagation(),d()},children:o.jsxRuntimeExports.jsx(f.Add,{color:8})})]})},Ot=({resourceName:e,onChange:t,value:n,allowNone:s,emptyContent:r,haulType:i,data:l,getItem:a,subscribe:c,itemHeight:d,onFetchMore:x,disabled:p,onSearch:m,status:h,icon:j,children:E,variant:S="connected",actions:R,dialogProps:v,triggerProps:y,virtual:C=!0,closeDialogOnSelect:N=!0,...k})=>o.jsxRuntimeExports.jsx(f.Frame,{...k,variant:oa(S),children:o.jsxRuntimeExports.jsxs(f.Frame$1,{value:n,onChange:t,data:l,getItem:a,subscribe:c,allowNone:s,onFetchMore:x,itemHeight:d,virtual:C,closeDialogOnSelect:N,children:[o.jsxRuntimeExports.jsx(aa,{haulType:i,icon:j,placeholder:`Select a ${e}`,disabled:p,variant:ra(S),...y}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:m,resourceName:e,emptyContent:r,status:h,actions:R,...v,children:E})]})}),aa=({haulType:e="",placeholder:t,icon:n,disabled:s,iconOnly:r=!1,hideCaret:i=!1,...l})=>{const a=f.useSelection(),{setSelected:c}=f.useContext$2(),[d]=a,x=f.useItem(d),{name:p,icon:m}=x??{},h=g.useCallback(S=>nr(S,e,a,s),[e,a,s]),j=f.useDrop({type:e,canDrop:h,onDrop:f.useFilterByTypeCallback(e,({items:S})=>(S.length!==0&&c([S[0].key]),S),[c])}),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(Vl.Trigger,{variant:"outlined",gap:"small",className:u.CSS(u.CSS.dropRegion(h(E))),disabled:s,...j,...l,hideCaret:i||r,textColor:p==null?8:void 0,children:[m??n,!r&&(p??t)]})},yg=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);if(n==null)return null;const{name:s,icon:r}=n;return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,children:[r,s]})}),Mn=({data:e,filter:t,children:n=yg,virtual:s=!1,...r})=>{const{retrieve:i,...l}=f.useStaticData({data:e,filter:t}),{search:a}=tt.usePager({retrieve:i});return o.jsxRuntimeExports.jsx(Ot,{...r,...l,onSearch:a,virtual:s,children:n})},nn=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:M.LEVELS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h2",square:!0,children:"XL"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h3",square:!0,children:"L"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h4",square:!0,children:"M"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h5",square:!0,children:"S"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",square:!0,children:"XS"})]}),Sg=[250,400,500,600],ca=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:Sg,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:250,children:"Light"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:400,children:"Normal"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:500,children:"Medium"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:600,children:"Bold"})]}),Rg=Object.freeze(Object.defineProperty({__proto__:null,Level:nn,Weight:ca},Symbol.toStringTag,{value:"Module"})),Cg=Object.freeze(Object.defineProperty({__proto__:null,Button:pe.Button,Buttons:pe.Buttons,Core:f.Core,Dialog:f.Dialog$2,Frame:f.Frame$1,ListItem:f.ListItem,Multiple:bs,MultipleTrigger:la,Single:Ot,SingleTrigger:aa,Static:Mn,Text:Rg,staticCanDrop:nr,useClear:f.useClear,useContext:f.useContext$2,useHover:f.useHover,useItemState:f.useItemState,useMultiple:f.useMultiple,useSelection:f.useSelection,useSingle:f.useSingle},Symbol.toStringTag,{value:"Module"})),wg=()=>o.jsxRuntimeExports.jsx(f.Caret.Right,{className:u.CSS.BE("breadcrumb","separator")}),yn=({children:e,...t})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS.BE("breadcrumb","segment"),...t,defaultEl:"span",children:e}),sr=({children:e,highlightVariant:t,...n})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.B("breadcrumb"),t!=null&&u.CSS.BM("breadcrumb","highlight",t)),x:!0,align:"center",gap:"small",...n,children:g.Children.map(e,(s,r)=>s==null||typeof s=="boolean"?null:o.jsxRuntimeExports.jsxs(g.Fragment,{children:[r>0&&o.jsxRuntimeExports.jsx(wg,{}),typeof s=="string"?o.jsxRuntimeExports.jsx(yn,{children:s}):s]},r))}),bg=(e,t)=>{const n=e.split("/");return n.map((s,r)=>t({href:n.slice(0,r+1).join("/"),segment:s,index:r}))},vg=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:sr,Segment:yn,mapURLSegments:bg},Symbol.toStringTag,{value:"Module"})),or=g.createContext(null),rr=()=>f.useRequiredContext(or),_t=(e,t,n,s)=>({variant:"loading",status:u._r.create({variant:"loading",message:`${u.z.capitalize(t)} ${e}`}),data:n,listenersMounted:s}),Qe=(e,t,n,s)=>({variant:"success",status:u._r.create({variant:"success",message:`${u.z.capitalize(t)} ${e}`}),data:n,listenersMounted:s}),at=(e,t,n,s)=>({variant:"error",status:u._r.fromException(n,`Failed to ${t} ${e}`),data:null,listenersMounted:s}),_s=(e,t,n)=>at(e,t,new M.wm(`Cannot ${t} ${e} because no cluster is connected.`),n),ua=()=>{const e=g.useRef({mountCalled:!1,destructor:()=>{}}),t=rr();return g.useEffect(()=>()=>e.current.destructor(),[]),g.useCallback(({listeners:n,onOpen:s})=>{if(n==null||n.length===0||e.current.mountCalled)return;e.current.mountCalled=!0;let r=0;const i=()=>{r++,r===n.length&&s?.()},l=n.map(({channel:a,handler:c})=>t({channel:a,handler:c,onOpen:i}));e.current.destructor=()=>l.forEach(a=>a())},[t])},gn={..._.ZERO_CONTEXT_VALUE,state:M.Xp.connectivity.DEFAULT},ir=g.createContext(gn),da=()=>g.use(ir),nt=()=>da().client,_g=()=>da().state,bo={connected:"success",connecting:"loading",disconnected:"disabled",failed:"error"},xa="serverVersionMismatch",Ng=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Mg=({children:e,client:t})=>{const{path:n}=f.useUnidirectional({type:_.Provider.TYPE,schema:_.Provider.stateZ,state:{props:null,state:null}});return o.jsxRuntimeExports.jsx(ir,{value:{...gn,client:t},children:o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})})},pa=({children:e,connParams:t})=>{const[n,s,r]=f.useCombinedStateAndRef(gn),{path:i}=f.useUnidirectional({type:_.Provider.TYPE,schema:_.Provider.stateZ,state:{props:t??null,state:null}}),l=f.useAdder(),a=g.useCallback(c=>{r.current.state.status!==c.status&&l({variant:bo[c.status],message:c.message??u.z.capitalize(c.status)}),s(d=>({...d,state:c}))},[l]);return Ge(async c=>{if(n.client!=null&&n.client.close(),t==null)return s(gn);const d=new M.Xp({...t,connectivityPollFrequency:M.O$1.seconds(2)});s({client:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(!c.aborted){if(s({client:d,state:x}),l({variant:bo[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||u.pr.semVerOlder(x.nodeVersion,x.clientVersion),m=Ng(p,x.clientVersion,x.nodeVersion);l({variant:"warning",message:"Incompatible cluster version",description:m,details:{type:xa,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),()=>{d.close(),s(gn)}}},[t,a]),o.jsxRuntimeExports.jsx(ir,{value:n,children:o.jsxRuntimeExports.jsx(f.Composite,{path:i,children:e})})},kg=Object.freeze(Object.defineProperty({__proto__:null,CONNECTION_STATE_VARIANTS:bo,Provider:pa,SERVER_VERSION_MISMATCH:xa,TestProvider:Mg,use:nt,useConnectionState:_g},Symbol.toStringTag,{value:"Module"})),ma=e=>{const[t,n]=g.useState(_t(e.name,"retrieving",null,!1));return{...t,...fa({...e,onChange:n})}},fa=({retrieve:e,listeners:t=[],name:n,onChange:s})=>{const r=nt(),i=g.useRef(null),l=f.useInitializerRef(()=>new _.Mutex),a=ua(),c=g.useCallback(async(x,p={})=>{const{signal:m}=p,h=M.executeSetter(x,i.current??{});i.current=h;try{if(r==null)return s(E=>_s(n,"retrieve",E.listenersMounted));s(E=>_t(n,"retrieving",E.data,E.listenersMounted));const j=await e({client:r,params:h});if(m?.aborted)return;a({onOpen:()=>s(E=>({...E,listenersMounted:!0})),listeners:t.map(E=>({channel:E.channel,handler:S=>void l.current.runExclusive(async()=>{if(!(r==null||i.current==null))try{await E.onChange({client:r,params:i.current,changed:S.get(E.channel),onChange:R=>{s(v=>{if(v.data==null)return v;const y=M.executeSetter(R,v.data);return Qe(n,"retrieved",y,v.listenersMounted)})}})}catch(R){if(m?.aborted)return;s(v=>at(n,"retrieve",R,v.listenersMounted))}})}))}),s(E=>Qe(n,"retrieved",j,E.listenersMounted))}catch(j){if(m?.aborted)return;s(E=>at(n,"retrieve",j,E.listenersMounted))}},[r,n,a]);return{retrieve:g.useCallback((x,p)=>void c(x,p),[c]),retrieveAsync:c}},Lg=({params:e,...t})=>{const{retrieveAsync:n,retrieve:s,...r}=ma(t),i=f.useMemoDeepEqual(e);return Ge(async l=>await n(i,{signal:l}),[n,i]),r},Pg=({params:e,...t})=>{const{retrieveAsync:n}=fa(t),s=f.useMemoDeepEqual(e);Ge(async r=>await n(s,{signal:r}),[n,s])},ut=e=>({useDirect:t=>Lg({...e,...t}),useStateful:()=>ma(e),useEffect:t=>Pg({...e,...t})}),ha=({onChange:e,params:t,update:n,name:s})=>{const r=nt(),i=g.useCallback(async(a,c={})=>{const{signal:d}=c;try{if(r==null)return e(p=>_s(s,"update",p.listenersMounted)),!1;e(p=>_t(s,"updating",p.data,p.listenersMounted));let x=!1;return await n({client:r,onChange:p=>{x=!0,e(m=>Qe(s,"updated",p,m.listenersMounted))},value:a,params:t}),d?.aborted===!0?!1:(x||e(p=>Qe(s,"updated",a,p.listenersMounted)),!0)}catch(x){return d?.aborted!==!0&&e(p=>at(s,"update",x,p.listenersMounted)),!1}},[s,t]);return{update:g.useCallback((a,c)=>void i(a,c),[i]),updateAsync:i}},Tg=({params:e,name:t,...n})=>{const[s,r]=g.useState(Qe(t,"updated",null,!1)),i=ha({...n,name:t,onChange:r,params:e});return{...s,...i}},Bt=e=>({useObservable:t=>ha({...t,...e}),useDirect:t=>Tg({...t,...e})}),lr=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:()=>{},setCurrentStateAsInitialValues:()=>{}}),sn=e=>{const t=g.use(lr);return e??t},yt=(e,t={})=>{const{optional:n=!1,onChange:s,defaultValue:r}=t,i=sn(t?.ctx),{get:l,bind:a,set:c,setStatus:d}=i,x=g.useCallback(j=>{s?.(j,{...i,path:e}),c(e,j)},[e,c,s]),p=g.useCallback(j=>d(e,j),[e,d]),m=g.useSyncExternalStore(a,g.useCallback(()=>l(e,{optional:n,defaultValue:r}),[e,l,n,r]));if(m==null){if(!n)throw new Error(`Field state is null: ${e}`);return null}const h=i.mode==="preview"?"preview":void 0;return{onChange:x,setStatus:p,variant:h,...m}},ar=(e,t)=>{const{get:n,bind:s}=sn(t?.ctx);return g.useSyncExternalStore(s,g.useCallback(()=>n(e,t),[e,n,t]))},cr=(e,t)=>ar(e,t)?.value??null,Ag=e=>ar(e,{optional:!0})?.status?.variant==="success",ga=(e,t)=>({value:()=>e.get(t).value,add:(n,s)=>{const r=u.br(e.get(t).value);r.splice(s,0,...M.t.toArray(n)),e.set(t,r)},push:(n,s)=>{const r=u.br(e.get(t).value);r.push(...M.t.toArray(n)),s!=null&&r.sort(s),e.set(t,r)},remove:n=>{const s=e.get(t).value,r=new Set(M.t.toArray(n)),i=s.filter(({key:l})=>!r.has(l));return e.set(t,i),i.map(({key:l})=>l)},keepOnly:n=>{const s=e.get(t).value,r=new Set(M.t.toArray(n)),i=s.filter(({key:l})=>r.has(l));return e.set(t,i),i.map(({key:l})=>l)},set:n=>e.set(t,M.executeSetter(n,e.get(t).value)),sort:n=>{const s=u.br(e.get(t).value);s.sort(n),e.set(t,s)}}),Ig=(e,t={})=>{const n=sn(t?.ctx),s=cr(e,t);return g.useMemo(()=>({data:s.map(({key:r})=>r),...ga(n,e)}),[s,n,e])},Og=f.renderProp(e=>o.jsxRuntimeExports.jsx(f.Text$2,{...e})),ye=({path:e,children:t=Og,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:a,className:c,defaultValue:d,...x})=>{const p=yt(e,{optional:l??i,onChange:a,defaultValue:d}),m=sn();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??=u.z.capitalize(M.m.element(e,-1)),r=typeof r=="function"?r(p,m):r,!r)return null;const h=p.status.message,{onChange:j,value:E}=p,S={onChange:j,value:E};return p.variant!=null&&(S.variant=p.variant),o.jsxRuntimeExports.jsx(Ae.Item,{padHelpText:s,helpText:h,status:p.status.variant,label:n,required:p.required,className:u.CSS(c,u.CSS.BE("field",e.split(".").join("-")),u.CSS.M(p.status.variant)),...x,children:t(S)})},kn=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:a=t,optional:c,defaultValue:d,...x})=>o.jsxRuntimeExports.jsx(ye,{...n,...x,defaultValue:d,optional:c,path:a?`${l}.${a}`:l,children:p=>o.jsxRuntimeExports.jsx(e,{...p,...s,...i})});return r.displayName=e.displayName,r},ja=kn(f.Numeric),He=ja({inputProps:{}}),Ea=kn(f.Text$2),ur=Ea({inputProps:{}}),ya=kn(f.Switch$1),Ns=ya({inputProps:{}}),Bg=e=>kn(Mn)(e),Dg=({children:e,...t})=>o.jsxRuntimeExports.jsx(lr,{value:t,children:e}),zg=e=>e.code==="custom"&&e.params!=null&&"variant"in e.params?e.params.variant:"error";class Hg extends _.a.Observer{schema;values;initialValues;statuses;touched;cachedRefs;constructor(t,n){super(),this.schema=n,this.values=M.m.copy(t),this.statuses=new Map,this.touched=new Set,this.cachedRefs=new Map,this.initialValues=M.m.copy(this.values)}setValue(t,n){t==""?this.values=M.m.copy(n):M.m.set(this.values,t,n),this.checkTouched(t,n),this.updateCachedRefs(t)}checkTouched(t,n){const s=M.m.get(this.initialValues,t,{optional:!0});M.m.equal(s,n)?this.clearTouched(t):this.setTouched(t)}setStatus(t,n){this.statuses.set(t,n),this.updateCachedRefs(t)}clearStatus(t=""){this.statuses.delete(t),this.updateCachedRefs(t)}reset(t){t!=null&&(this.initialValues=t);const n=M.m.copy(this.initialValues);this.statuses.clear(),this.touched.clear();const s=new Set;this.cachedRefs.forEach((r,i)=>{const l=M.m.get(this.values,i,{optional:!0}),a=M.m.get(n,i,{optional:!0});l!==a&&s.add(i)}),s.forEach(r=>this.cachedRefs.delete(r)),this.values=n}setCurrentStateAsInitialValues(){this.initialValues=M.m.copy(this.values),this.touched.clear(),this.cachedRefs.clear()}setTouched(t){this.touched.add(t),this.updateCachedRefs(t)}clearTouched(t=""){t===""?this.touched.clear():this.touched.delete(t),this.updateCachedRefs(t),this.notify()}remove(t){M.m.remove(this.values,t),this.statuses.delete(t),this.clearTouched(t),this.cachedRefs.delete(t)}validate(t,n){if(this.schema==null)return!0;const s=this.schema.safeParse(this.values);return this.processValidation(t,s,n)}async validateAsync(t,n){if(this.schema==null)return!0;const s=await this.schema.safeParseAsync(this.values);return this.processValidation(t,s,n)}processValidation(t=!1,n,s){if(this.schema==null)return!0;const r=new Set;if(this.statuses.forEach((l,a)=>{l.variant!=="success"&&r.add(a)}),r.forEach(l=>this.clearStatus(l)),n.success)return!0;let i=!0;return n.error.issues.forEach(l=>{const{message:a}=l,c=l.path.join(".");if(s!=null&&!M.m.pathsMatch(c,s)&&!M.m.pathsMatch(s,c)||!t&&!this.touched.has(c))return;const d=zg(l);d!=="warning"&&(i=!1),this.setStatus(c,{key:c,variant:d,message:a})}),i}get hasBeenTouched(){return this.touched.size>0}getState(t,n={}){const{optional:s=!1,defaultValue:r=void 0}=n,i=u.hr.getOrSetDefault(this.cachedRefs,t,{});let l=M.m.get(this.values,t,{optional:s||r!=null});if(l==null){if(r==null)return null;l=r,this.setValue(t,l)}if(i.value=l,i.required=!1,this.schema!=null){const a=$h.getFieldSchema(this.schema,t,{optional:!0});a!=null&&(i.required=!a.safeParse(void 0).success)}return i.status=u.hr.getOrSetDefault(this.statuses,t,{key:t,variant:"success",message:""}),i.touched=this.touched.has(t),i}updateCachedRefs(t){this.cachedRefs.forEach((n,s)=>{(M.m.pathsMatch(s,t)||M.m.pathsMatch(t,s))&&this.cachedRefs.set(s,{})})}}const dr=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r,onHasTouched:i})=>{const l=f.useInitializerRef(()=>new Hg(e,n)),a=f.useSyncedRef(r),c=f.useErrorHandler(),d=f.useSyncedRef(i),x=g.useCallback(()=>{l.current.setCurrentStateAsInitialValues(),d.current?.(!1)},[]),p=g.useCallback(N=>l.current.onChange(N),[]),m=g.useCallback((N,k)=>l.current.getState(N,k),[]),h=g.useCallback(N=>{l.current.remove(N),l.current.notify()},[]),j=g.useCallback(N=>{const k=l.current.values,A=l.current.hasBeenTouched;l.current.reset(N),k!==l.current.values&&a.current?.({values:l.current.values,path:"",prev:k,valid:!0}),l.current.notify();const D=l.current.hasBeenTouched;D!==A&&d.current?.(D)},[]),E=g.useCallback(async N=>{const k=await l.current.validateAsync(!0,N);return l.current.notify(),k},[]),S=g.useCallback(N=>{const k=l.current.validate(!0,N);return l.current.notify(),k},[]),R=g.useCallback((N,k)=>{const A=M.m.get(l.current.values,N,{optional:!0}),I=l.current.hasBeenTouched;l.current.setValue(N,k);const D=()=>{a.current?.({values:l.current.values,path:N,prev:A,valid:!0}),l.current.notify();const V=l.current.hasBeenTouched;V!==I&&d.current?.(V)};try{l.current.validate()}catch{return c(async()=>{await l.current.validateAsync(),D()},"Failed to validate form")}D()},[]),v=g.useCallback(N=>M.m.has(l.current.values,N),[]),y=g.useCallback((N,k)=>{const A=l.current.hasBeenTouched;l.current.setStatus(N,k),l.current.notify();const I=l.current.hasBeenTouched;I!==A&&d.current?.(I)},[]),C=g.useCallback(()=>{l.current.clearStatus(),l.current.notify()},[]);return g.useEffect(()=>{t&&(l.current.reset(e),l.current.notify())},[t,e]),g.useMemo(()=>({bind:p,set:R,get:m,mode:s,validate:S,validateAsync:E,value:()=>l.current.values,has:v,remove:h,setStatus:y,clearStatuses:C,reset:j,setCurrentStateAsInitialValues:x}),[p,R,m,S,E,v,h,y,C,j,s,x])},Sa=({key:e,open:t,onChange:n})=>{const s=f.useMemoPrimitiveArray(e);Ge(async()=>{if(t==null)return;const r=await t();if(r==null)return;const i=r.onChange(n);return async()=>{i(),await r.close()}},[t==null,s])},$g=Object.freeze(Object.defineProperty({__proto__:null,useListener:Sa},Symbol.toStringTag,{value:"Module"})),Vg=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...a})=>{const c=nt(),d=f.useErrorHandler(),x=f.useMemoPrimitiveArray(e),p=dr({values:s,...a,sync:!1,onChange:j=>{c!=null&&d(async()=>{await i?.({...j,client:c})},`Failed to apply changes for ${t}`)}});Ge(async()=>{if(c!=null)try{const j=await n({client:c});p.set("",j)}catch(j){d(j,`Failed to retrieve ${t}`)}},[x,c?.key]);const m=g.useCallback(async()=>{if(c!=null)return await r?.(c)},[x,c?.key]),h=g.useCallback(j=>l?.({changes:j,ctx:p}),[x,l]);return Sa({key:x,open:m,onChange:h}),p},Fg=Object.freeze(Object.defineProperty({__proto__:null,Context:lr,Field:ye,Form:Dg,NumericField:He,SwitchField:Ns,TextField:ur,buildNumericField:ja,buildSelectField:Bg,buildSwitchField:ya,buildTextField:Ea,fieldBuilder:kn,fieldListUtils:ga,use:dr,useContext:sn,useField:yt,useFieldList:Ig,useFieldState:ar,useFieldValid:Ag,useFieldValue:cr,useSynced:Vg},Symbol.toStringTag,{value:"Module"})),Dt=({name:e,schema:t,retrieve:n,listeners:s,update:r,initialValues:i})=>{const l=ut({name:e,retrieve:n,listeners:s}),a=Bt({name:e,update:r});return({params:c,initialValues:d,autoSave:x=!1,afterSave:p,sync:m,onHasTouched:h,mode:j})=>{const[E,S,R]=f.useCombinedStateAndRef(_t(e,"retrieving",null,!1)),v=dr({schema:t,values:d??i,onChange:({path:A})=>{x&&A!==""&&k()},sync:m,onHasTouched:h,mode:j}),y=g.useCallback((A,I=!0)=>{const D=M.executeSetter(A,R.current);R.current=D,D.data!=null&&(v.set("",D.data),I&&v.setCurrentStateAsInitialValues()),S(D)},[v]);l.useEffect({params:c,onChange:y});const C=g.useCallback(A=>y(A,!1),[y]),{updateAsync:N}=a.useObservable({params:c,onChange:C}),k=g.useCallback(A=>void(async()=>{try{if(!await v.validateAsync()||!await N(v.value(),A))return;p?.({form:v,params:c}),v.setCurrentStateAsInitialValues()}catch(I){S(D=>at(e,"update",I,D.listenersMounted))}})(),[v,N,p,c]);return{form:v,save:k,...E}}},Zg=()=>!0,Kg=u.a.milliseconds(100),Fe=({name:e,listeners:t,retrieve:n,retrieveByKey:s})=>(r={})=>{const{filter:i=Zg,sort:l,initialParams:a,retrieveDebounce:c=Kg}=r,d=f.useSyncedRef(i),x=f.useSyncedRef(l),p=nt(),m=g.useRef(new Map),h=f.useInitializerRef(()=>({mounted:!1,listeners:new Map})),[j,E,S]=f.useCombinedStateAndRef(_t(e,"retrieving",null,!1)),R=g.useRef(!0),v=g.useRef(a??null),y=ua(),C=g.useCallback(z=>h.current.listeners.forEach((B,$)=>{B===z&&$()}),[h]),N=g.useCallback(z=>{if(x.current==null)return z;const B=z.map($=>m.current.get($)).filter($=>$!=null);return B.sort(x.current),B.map($=>$.key)},[x]),k=g.useCallback(async(z,B={})=>{const{signal:$,mode:w="replace"}=B,P=M.executeSetter(z,v.current??{});v.current=P;try{if(p==null)return E(H=>_s(e,"retrieve",H.listenersMounted));if(E(H=>_t(e,"retrieving",H.data,!1)),w==="replace")R.current=!0;else if(w==="append"&&!R.current)return E(H=>Qe(e,"retrieved",H.data??[],H.listenersMounted));let L=await n({client:p,params:P});if($?.aborted)return;L=L.filter(d.current),x.current!=null&&(L=L.sort(x.current)),L.length===0&&(R.current=!1);const O=L.map(H=>H.key);return S.current.data!=null&&u.O.primitiveArrays(S.current.data,O)===u.O.EQUAL?E(H=>Qe(e,"retrieved",H.data??[],H.listenersMounted)):(L.forEach(H=>m.current.set(H.key,H)),y({onOpen:()=>{E(H=>({...H,listenersMounted:!0}))},listeners:t?.map(H=>({channel:H.channel,handler:F=>void(async()=>{if(!(p==null||v.current==null))try{await H.onChange({client:p,params:v.current,changed:F.get(H.channel),onDelete:Z=>{m.current.delete(Z),E(K=>K.data==null?K:{...K,data:K.data.filter(X=>X!==Z)})},onChange:(Z,K,X={})=>{const{mode:oe="append"}=X,J=m.current.get(Z)??null;if(J!=null&&!d.current(J))return;const ae=M.executeSetter(K,J);ae==null||!d.current(ae)||(m.current.set(Z,ae),E(te=>{if(te.data==null)return te;let ne;if(J==null)x.current!=null?ne=N([...te.data,Z]):ne=oe==="prepend"?[Z,...te.data]:[...te.data,Z];else if(x.current!=null){const ee=te.data.indexOf(Z),re=N(te.data),je=re.indexOf(Z);ee!==je?ne=re:ne=te.data}else ne=te.data;return{...te,data:ne}}),C(Z))}})}catch(Z){if($?.aborted)return;E(K=>at(e,"retrieve",Z,K.listenersMounted))}})()}))}),E(H=>{if(w==="replace"||H.data==null)return Qe(e,"retrieved",O,H.listenersMounted);const F=new Set(O);return Qe(e,"retrieved",[...H.data.filter(Z=>!F.has(Z)),...O],H.listenersMounted)}))}catch(L){if($?.aborted)return;E(O=>at(e,"retrieve",L,O.listenersMounted))}},[p,e,y,d]),A=g.useCallback((z,B={})=>{const{signal:$}=B;(async()=>{try{if(p==null||u.F.isZero(z))return;const w=await s({client:p,key:z,params:v.current??{}});if($?.aborted||w==null)return;if(!d.current(w)){m.current.set(z,null);return}m.current.set(z,w),C(z)}catch(w){if($?.aborted)return;m.current.set(z,null),E(P=>at(e,"retrieve",w,P.listenersMounted))}})()},[s,p,C]),I=g.useCallback(z=>{if(z==null)return;if(Array.isArray(z))return z.map($=>I($)).filter($=>$!=null);const B=m.current.get(z);return B===void 0&&A(z),B},[A]),D=g.useCallback((z,B)=>B==null?()=>{}:(h.current.listeners.set(z,B),()=>h.current.listeners.delete(z)),[]);return{retrieve:Pe.useDebouncedCallback((z,B={})=>void k(z,B),new u.a(c).milliseconds,[k]),retrieveAsync:k,subscribe:D,getItem:I,...j,data:j?.data??[]}},Yg=({key:e,subscribe:t,getItem:n})=>g.useSyncExternalStore(g.useCallback(s=>t(s,e),[t,e]),g.useCallback(()=>n(e),[n,e])),Wg=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:_.AcquireChannelControl,AuthoritySource:_.AuthoritySource,Chip:_.Chip,Controller:_.Controller,Indicator:_.Indicator,Legend:_.Legend,REGISTRY:_.REGISTRY$16,STATUSES:_.STATUSES,SetChannelValue:_.SetChannelValue,StateProvider:_.StateProvider,acquireChannelControl:_.acquireChannelControl,acquireChannelControlPropsZ:_.acquireChannelControlPropsZ,authoritySource:_.authoritySource,authoritySourceDetailsZ:_.authoritySourceDetailsZ,authoritySourceProps:_.authoritySourceProps,chipStateZ:_.chipStateZ,chipStatusDetailsZ:_.chipStatusDetailsZ,controllerStateZ:_.controllerStateZ,indicatorStateZ:_.indicatorStateZ,indicatorStatusDetailsZ:_.indicatorStatusDetailsZ,legendStateZ:_.legendStateZ,setChannelValue:_.setChannelValue,setChannelValuePropsZ:_.setChannelValuePropsZ,stateProviderStateZ:_.stateProviderStateZ,statusZ:_.statusZ,sugaredStateZ:_.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var yi=180/Math.PI,vo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ra(e,t,n,s,r,i){var l,a,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(a=Math.sqrt(n*n+s*s))&&(n/=a,s/=a,c/=a),e*s<t*n&&(e=-e,t=-t,c=-c,l=-l),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*yi,skewX:Math.atan(c)*yi,scaleX:l,scaleY:a}}var Zn;function Gg(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?vo:Ra(t.a,t.b,t.c,t.d,t.e,t.f)}function Ug(e){return e==null||(Zn||(Zn=document.createElementNS("http://www.w3.org/2000/svg","g")),Zn.setAttribute("transform",e),!(e=Zn.transform.baseVal.consolidate()))?vo:(e=e.matrix,Ra(e.a,e.b,e.c,e.d,e.e,e.f))}function Ca(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function i(d,x,p,m,h,j){if(d!==p||x!==m){var E=h.push("translate(",null,t,null,n);j.push({i:E-4,x:_.interpolateNumber(d,p)},{i:E-2,x:_.interpolateNumber(x,m)})}else(p||m)&&h.push("translate("+p+t+m+n)}function l(d,x,p,m){d!==x?(d-x>180?x+=360:x-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:_.interpolateNumber(d,x)})):x&&p.push(r(p)+"rotate("+x+s)}function a(d,x,p,m){d!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:_.interpolateNumber(d,x)}):x&&p.push(r(p)+"skewX("+x+s)}function c(d,x,p,m,h,j){if(d!==p||x!==m){var E=h.push(r(h)+"scale(",null,",",null,")");j.push({i:E-4,x:_.interpolateNumber(d,p)},{i:E-2,x:_.interpolateNumber(x,m)})}else(p!==1||m!==1)&&h.push(r(h)+"scale("+p+","+m+")")}return function(d,x){var p=[],m=[];return d=e(d),x=e(x),i(d.translateX,d.translateY,x.translateX,x.translateY,p,m),l(d.rotate,x.rotate,p,m),a(d.skewX,x.skewX,p,m),c(d.scaleX,d.scaleY,x.scaleX,x.scaleY,p,m),d=x=null,function(h){for(var j=-1,E=m.length,S;++j<E;)p[(S=m[j]).i]=S.x(h);return p.join("")}}}var qg=Ca(Gg,"px, ","px)","deg)"),Xg=Ca(Ug,", ",")",")"),Qg=1e-12;function Si(e){return((e=Math.exp(e))+1/e)/2}function Jg(e){return((e=Math.exp(e))-1/e)/2}function e1(e){return((e=Math.exp(2*e))-1)/(e+1)}const ts=function e(t,n,s){function r(i,l){var a=i[0],c=i[1],d=i[2],x=l[0],p=l[1],m=l[2],h=x-a,j=p-c,E=h*h+j*j,S,R;if(E<Qg)R=Math.log(m/d)/t,S=function(A){return[a+A*h,c+A*j,d*Math.exp(t*A*R)]};else{var v=Math.sqrt(E),y=(m*m-d*d+s*E)/(2*d*n*v),C=(m*m-d*d-s*E)/(2*m*n*v),N=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(C*C+1)-C);R=(k-N)/t,S=function(A){var I=A*R,D=Si(N),V=d/(n*v)*(D*e1(t*I+N)-Jg(N));return[a+V*h,c+V*j,d*D/Si(t*I+N)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return r.rho=function(i){var l=Math.max(.001,+i),a=l*l,c=a*a;return e(l,a,c)},r}(Math.SQRT2,2,4),t1=Object.freeze(Object.defineProperty({__proto__:null,Base:_.Base,Bottom:_.Bottom,Right:_.Right,Top:_.Top,axisStateZ:_.axisStateZ,newCanvas:_.newCanvas,newTickFactory:_.newTickFactory,tickFactoryProps:_.tickFactoryProps,tickType:_.tickType},Symbol.toStringTag,{value:"Module"})),Oe=e=>{const t=rr(),n=f.useErrorHandler();g.useEffect(()=>_.mountListeners(t,n,e),[t,n])},n1=u.a.seconds(5),wa=({children:e,openStreamer:t,streamerRemovalDelay:n=n1})=>{const s=nt(),r=f.useErrorHandler(),i=g.useRef(new _.Streamer({handleError:r,removalDelay:n})),{path:l}=f.useLifecycle({type:_.Provider$1.TYPE,schema:_.providerStateZ,initialState:{}}),a=g.useMemo(()=>t??s?.openStreamer.bind(s),[s,t]);Ge(async()=>{if(a!=null)return await i.current.updateStreamer(a),i.current.close.bind(i.current)},[a]);const c=g.useCallback(({channel:d,handler:x,onOpen:p})=>i.current.addListener(x,d,p),[]);return o.jsxRuntimeExports.jsx(f.Composite,{path:l,children:o.jsxRuntimeExports.jsx(or,{value:c,children:e})})},s1=Object.freeze(Object.defineProperty({__proto__:null,Context:or,Provider:wa,createForm:Dt,createList:Fe,createRetrieve:ut,createUpdate:Bt,errorResult:at,nullClientResult:_s,parsedHandler:_.parsedHandler,pendingResult:_t,stringHandler:_.stringHandler,successResult:Qe,useAddListener:rr,useListItem:Yg,useListener:Oe},Symbol.toStringTag,{value:"Module"})),ba=e=>Oe({channel:M.Nm.RESOURCE_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:t})=>e(t))}),o1=e=>Oe({channel:M.Nm.RESOURCE_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:t})=>{e(t)})}),r1=e=>Oe({channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:t})=>{e(t)})}),i1=e=>Oe({channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:t})=>{e(t)})}),va=e=>Fe({name:"useDependents",retrieve:async({client:t,params:{id:n}})=>n==null?[]:await t.ontology.retrieve([n],{children:e==="to",parents:e==="from"}),retrieveByKey:async({client:t,key:n})=>await t.ontology.retrieve(M.Nm.idZ.parse(n)),listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({client:t,changed:n,params:s,onChange:r})=>{if(!("id"in s))return;const{id:i}=s;if(!M.Nm.matchRelationship(n,{type:"parent",[M.Nm.oppositeRelationshipDirection(e)]:i}))return;const l=await t.ontology.retrieve(n[e]);r(l.key,l)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:t,params:n,onDelete:s})=>{if(!("id"in n))return;const{id:r}=n;M.Nm.matchRelationship(t,{type:"parent",[M.Nm.oppositeRelationshipDirection(e)]:r})&&s(M.Nm.idToString(t[e]))})},{channel:M.Nm.RESOURCE_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({client:t,changed:n,params:s,onChange:r})=>{const{id:i}=s;if(i==null||!M.Nm.idsEqual(i,n))return;const l=await t.ontology.retrieve(n);r(l.key,l)})}]}),l1=va("to"),a1=Fe({name:"useResourceList",retrieve:async({client:e,params:t})=>await e.ontology.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.ontology.retrieve(M.Nm.idZ.parse(t)),listeners:[{channel:M.Nm.RESOURCE_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:e,onChange:t,client:n})=>t(e.key,await n.ontology.retrieve(e)))},{channel:M.Nm.RESOURCE_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.idZ,async({changed:e,onDelete:t})=>{t(e.key)})}]}),c1=ut({name:"useParentID",retrieve:async({client:e,params:{id:t,type:n}})=>{const s=await e.ontology.retrieveParents(t);if(n==null)return s[0].id;const r=s.find(({id:i})=>i.type===n);return r==null?null:r.id},listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,params:{id:t,type:n},onChange:s})=>{e.type===M.Nm.PARENT_OF_RELATIONSHIP_TYPE&&(n==null||e.from.type===n)&&M.Nm.idsEqual(e.to,t)&&s(e.to)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,params:{id:t,type:n},onChange:s})=>{e.type===M.Nm.PARENT_OF_RELATIONSHIP_TYPE&&(n==null||e.from.type===n)&&M.Nm.idsEqual(e.to,t)&&s(null)})}]}),u1=Object.freeze(Object.defineProperty({__proto__:null,createDependentsListHook:va,retrieveParentID:c1,useChildren:l1,useRelationshipDeleteSynchronizer:i1,useRelationshipSetSynchronizer:r1,useResourceDeleteSynchronizer:o1,useResourceList:a1,useResourceSetSynchronizer:ba},Symbol.toStringTag,{value:"Module"})),_a=g.createContext(void 0),Ln=()=>{const e=g.use(_a);if(e==null)throw new Error("Channel.AliasProvider not found");return e},d1=()=>Ln().activeRange,xr=e=>Ln().aliases[e]??null,Na=()=>Ln().aliases,Ms=(e,t="")=>{const n=nt(),s=f.useErrorHandler(),r=g.useCallback(p=>{M.Nm.idsEqual(p,M.xm.ontologyID(e))&&i==null&&s(async()=>{const m=await n?.ontology.retrieve(p);d(m?.name)},"Failed to retrieve resource")},[n,s,e]);ba(r);const i=xr(e),{getName:l,setAlias:a}=Ln(),[c,d]=g.useState(t);Ge(async p=>{const m=await l(e);p.aborted||d(m)},[e,l]);const x=g.useCallback(p=>{s(async()=>{const m=c;try{if(i!=null){if(a==null)throw new Error("AliasSetter not found");await a(e,p);return}if(n==null)throw new M.wm;await n.channels.rename(e,p)}catch(h){throw d(m),h}},"Failed to rename channel")},[i,a,e,s,c]);return[c??t,x]},Ma=()=>Ln().setAlias,x1=({channelKey:e,shadow:t,className:n,...s})=>{const{value:r,onChange:i}=s,[l,a]=g.useState(!1),c=Ma(),d=xr(e),[x]=Ms(e);let p=o.jsxRuntimeExports.jsx(f.Rename,{});l?p=o.jsxRuntimeExports.jsx(f.Loading,{}):d===r&&(p=o.jsxRuntimeExports.jsx(f.Check,{}));const m=c!=null&&!l&&d!==r&&e!==0,h=f.useErrorHandler(),j=()=>{m&&h(async()=>{a(!0);try{await c(e,r),a(!1)}catch(R){throw a(!1),R}},"Failed to set channel alias")},E=()=>{d!=null&&i?.(d)},S=e===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):r.length===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===r?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Sync alias for ",x," with this label"]});return o.jsxRuntimeExports.jsxs(f.Text$2,{selectOnFocus:!0,...s,children:[m&&o.jsxRuntimeExports.jsx(f.Button,{onClick:E,tooltip:o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Set ",x," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(f.Sync,{})}),o.jsxRuntimeExports.jsx(f.Button,{onClick:j,disabled:!m,tooltip:S,tooltipLocation:{y:"top"},variant:"outlined",children:p})]})},Nt=(e,t)=>M.Nm.matchRelationship(e,{from:t,type:M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE}),ka=ut({name:"Labels",retrieve:async({client:e,params:{id:t}})=>await e.labels.retrieve({for:t}),listeners:[{channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async({changed:e,onChange:t})=>t(n=>{const s=n.filter(r=>r.key!==e.key);return s.length===n.length?n:[...s,e]}))},{channel:M.Gm.DELETE_CHANNEL_NAME,onChange:_.stringHandler(async({changed:e,onChange:t})=>t(n=>n.filter(s=>s.key!==e)))},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({client:e,changed:t,onChange:n,params:{id:s}})=>{if(!Nt(t,s))return;const{key:r}=t.to,i=await e.labels.retrieve({key:r});n(l=>[...l.filter(a=>a.key!==r),i])})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{id:n}})=>{Nt(e,n)&&t(s=>s.filter(r=>r.key!==e.to.key))})}]}),La=se.z.object({labels:se.z.array(M.Gm.keyZ)}),p1=Dt({name:"Labels",schema:La,initialValues:{labels:[]},retrieve:async({client:e,params:{id:t}})=>t==null?null:{labels:(await e.labels.retrieve({for:t})).map(s=>s.key)},update:async({client:e,value:t,params:{id:n}})=>{await e.labels.label(n,t.labels,{replace:!0})},listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({client:e,changed:t,onChange:n,params:{id:s}})=>{if(!Nt(t,s))return;const{key:r}=t.to,i=await e.labels.retrieve({key:r});n(l=>l==null?{labels:[i.key]}:{labels:[...l.labels.filter(a=>a!==r),i.key]})})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{id:n}})=>{Nt(e,n)&&t(s=>s==null?{labels:[]}:{labels:s.labels.filter(r=>r!==e.to.key)})})}]}),m1=e=>Oe({channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async t=>{e(t.changed)})}),f1=e=>Oe({channel:M.Gm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.keyZ,async t=>{e(t.changed)})}),pr=Fe({name:"Labels",retrieve:async({client:e,params:t})=>await e.labels.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.labels.retrieve({key:t}),listeners:[{channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async({changed:e,onChange:t})=>{t(e.key,e,{mode:"prepend"})})},{channel:M.Gm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.keyZ,async({changed:e,onDelete:t})=>t(e))}]}),Pa=M.Gm.labelZ.partial({key:!0}),h1=Dt({name:"Label",initialValues:{name:"",color:"#000000"},schema:Pa,retrieve:async({client:e,params:{key:t}})=>t==null?null:await e.labels.retrieve({key:t}),update:async({client:e,value:t,onChange:n})=>n(await e.labels.create(t)),listeners:[{channel:M.Gm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Gm.labelZ,async({changed:e,onChange:t,params:n})=>{n.key==null||e.key!==n.key||t(e)})}]}),g1=Bt({name:"Label",update:async({client:e,params:{key:t}})=>await e.labels.delete(t)}).useDirect,mr="label",j1=({itemKey:e,...t})=>{const n=f.useItem(e),{selected:s,onSelect:r,hovered:i}=f.useItemState(e);return n==null?null:o.jsxRuntimeExports.jsx(f.Item,{itemKey:e,onSelect:r,selected:s,hovered:i,...t,children:o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(f.Circle,{color:n?.color,size:"2.5em"}),n?.name]})})},Ta=f.renderProp(j1),E1=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t),{onSelect:s}=f.useItemState(t);return n==null?null:o.jsxRuntimeExports.jsx(vs,{color:n.color,onClose:s,size:"small",children:n.name})}),y1={variant:"text"},S1=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=pr({filter:s,initialParams:r}),{fetchMore:p,search:m}=tt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Label",haulType:mr,value:t,onChange:e,data:l,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,renderTag:E1,icon:o.jsxRuntimeExports.jsx(f.Label,{}),triggerProps:y1,variant:"floating",...i,children:Ta})},R1=({onChange:e,value:t,allowNone:n,emptyContent:s,filter:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=pr({filter:r,initialParams:i}),{fetchMore:m,search:h}=tt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Ot,{resourceName:"Label",value:t,onChange:e,data:a,getItem:d,subscribe:x,allowNone:n,onFetchMore:m,onSearch:h,emptyContent:s,status:p,haulType:mr,...l,children:Ta})},C1=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:mr,SelectMultiple:S1,SelectSingle:R1,formSchema:Pa,labelsOfFormSchema:La,matchRelationship:Nt,retrieveLabelsOf:ka,useDelete:g1,useDeleteSynchronizer:f1,useForm:h1,useLabelsOfForm:p1,useList:pr,useSetSynchronizer:m1},Symbol.toStringTag,{value:"Module"})),w1=e=>Oe({channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async t=>{e(t.changed)})}),Aa=e=>Oe({channel:M.Km.SET_ALIAS_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.aliasZ,async t=>{e(t.changed)})}),Ia=e=>Oe({channel:M.Km.DELETE_ALIAS_CHANNEL_NAME,onChange:_.stringHandler(async t=>{e(M.Km.decodeDeleteAliasChange(t.changed))})}),Oa=async({changed:e,onChange:t,client:n})=>{if(M.Nm.matchRelationship(e,{from:{type:"range"},type:M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE,to:{type:"label"}})){const r=await n.labels.retrieve({key:e.to.key});t(e.from.key,i=>i==null?i:n.ranges.sugarOne({...i,labels:[...i.labels,r]}))}},Ba=async({changed:e,onChange:t,client:n})=>{if(M.Nm.matchRelationship(e,{from:{type:"range"},type:M.Nm.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const r=await n.ranges.retrieve(e.from.key);t(e.to.key,i=>i==null?i:n.ranges.sugarOne({...i,parent:r}))}},b1=Fe({name:"Range",retrieve:async({client:e,params:{key:t}})=>{const n=await e.ontology.retrieveChildren(M.Km.ontologyID(t),{types:["range"]});return n.length===0?[]:await e.ranges.retrieve({keys:n.map(({id:{key:s}})=>s),includeParent:!0,includeLabels:!0})},retrieveByKey:async({client:e,key:t})=>await e.ranges.retrieve(t),listeners:[{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({changed:e,onChange:t,client:n})=>{t(e.key,s=>s==null?s:n.ranges.sugarOne({...s.payload,...e,parent:s.parent??e.parent,labels:s.labels??[]}))})},{channel:M.Km.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async e=>{const{changed:t,onChange:n,client:s,params:r}=e;if(!("key"in r))return;if(M.Nm.matchRelationship(t,{from:M.Km.ontologyID(r.key),type:M.Nm.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const l=await s.ranges.retrieve({keys:[t.to.key],includeParent:!0,includeLabels:!0});return n(t.to.key,l[0])}await Oa(e),await Ba(e)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onDelete:t,onChange:n,client:s,params:{key:r}})=>{if(M.Nm.matchRelationship(e,{type:"parent",to:M.Km.ontologyID(r)}))return t(e.to.key);e.type===M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE&&n(e.from.key,a=>a==null?a:s.ranges.sugarOne({...a,labels:a.labels.filter(c=>c.key!==e.to.key)}))})}]}),v1=ut({name:"Range",retrieve:async({client:e,params:{key:t}})=>{const s=(await e.ontology.retrieveParents(M.Km.ontologyID(t))).find(({id:{type:r}})=>r==="range");return s==null?null:e.ranges.sugarOntologyResource(s)},listeners:[{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{key:n},client:s})=>M.Nm.matchRelationship(e,{type:"parent",to:M.Km.ontologyID(n)})&&t(await s.ranges.retrieve(e.from.key)))},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{key:n},client:s})=>M.Nm.matchRelationship(e,{type:"parent",from:M.Km.ontologyID(n)})&&t(await s.ranges.retrieve(e.from.key)))},{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({changed:e,onChange:t,client:n})=>{t(s=>s==null||s.key!==e.key?s:n.ranges.sugarOne({...s.payload,...e}))})}]}),_1={channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({client:e,changed:t,params:{key:n},onChange:s})=>{t.key===n&&s(e.ranges.sugarOne(t))})},Da=ut({name:"Range",retrieve:async({client:e,params:{key:t}})=>await e.ranges.retrieve(t),listeners:[_1]}),N1=Da.useDirect,za=se.z.object({...M.Km.payloadZ.omit({timeRange:!0}).partial({key:!0}).shape,labels:se.z.array(M.Gm.keyZ),parent:se.z.string().optional(),timeRange:se.z.object({start:se.z.number(),end:se.z.number()})}),_o=async(e,t,n)=>({...e.payload,timeRange:e.timeRange.numeric,labels:t??(await e.retrieveLabels()).map(s=>s.key),parent:n??(await e.retrieveParent())?.key??""}),M1={name:"",labels:[],parent:"",timeRange:{start:0,end:0}},k1=Dt({name:"Range",schema:za,initialValues:M1,retrieve:async({client:e,params:{key:t}})=>t==null?null:await _o(await e.ranges.retrieve(t)),update:async({client:e,value:t,onChange:n})=>{const s=u.F.isZero(t.parent)?void 0:M.Km.ontologyID(t.parent),r=await e.ranges.create(t,{parent:s});await e.labels.label(r.ontologyID,t.labels,{replace:!0}),n({...t,...r.payload,timeRange:r.timeRange.numeric,labels:t.labels,parent:t.parent})},listeners:[{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({client:e,changed:t,onChange:n})=>{const s=await _o(e.ranges.sugarOne(t));n(r=>r?.key!==t.key?r:{...s,labels:r.labels,parent:r.parent})})},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t})=>{t(n=>{if(n==null||n.key==null)return n;const s=M.Km.ontologyID(n.key);return Nt(e,s)?{...n,labels:[...n.labels.filter(l=>l!==e.to.key),e.to.key]}:M.Nm.matchRelationship(e,{type:M.Nm.PARENT_OF_RELATIONSHIP_TYPE,to:s})?{...n,parent:e.from.key}:n})})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,params:{key:n}})=>{n==null||!Nt(e,M.Km.ontologyID(n))||t(s=>{if(s==null)return s;const r=s.labels.filter(i=>i!==e.to.key);return{...s,labels:r}})})}]}),L1=e=>ka.useDirect({params:{id:M.Km.ontologyID(e)}}),P1={includeParent:!0,includeLabels:!0},fr=Fe({name:"Ranges",retrieve:async({client:e,params:t})=>await e.ranges.retrieve({...P1,...t}),retrieveByKey:async({client:e,key:t})=>await e.ranges.retrieve(t),listeners:[{channel:M.Km.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.payloadZ,async({changed:e,onChange:t,client:n})=>t(e.key,s=>{const r={...s?.payload,...e,parent:s?.parent??e.parent,labels:s?.labels??[]};return n.ranges.sugarOne(r)}))},{channel:M.Km.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Km.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M.Nm.RELATIONSHIP_SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async e=>{await Oa(e),await Ba(e)})},{channel:M.Nm.RELATIONSHIP_DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Nm.relationshipZ,async({changed:e,onChange:t,client:n})=>{if(e.type===M.Gm.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE)return t(e.from.key,s=>s==null?s:n.ranges.sugarOne({...s,labels:s.labels.filter(r=>r.key!==e.to.key)}))})}]}),T1=se.z.object({pairs:se.z.array(se.z.object({key:se.z.string(),value:se.z.string()}))}),A1=se.z.string().transform(e=>e.split("<--->")).transform(([e,t])=>({key:t,range:e})),I1=Fe({name:"Range Meta Data",retrieve:async({client:e,params:{rangeKey:t}})=>{const s=await e.ranges.getKV(t).list();return Object.entries(s).map(([r,i])=>({key:r,value:i,range:t}))},retrieveByKey:async({client:e,key:t,params:{rangeKey:n}})=>{if(n==null)return;const r=await e.ranges.getKV(n).get(t);return{key:t,value:r,range:n}},listeners:[{channel:M.Km.KV_SET_CHANNEL,onChange:_.parsedHandler(M.Km.kvPairZ,async({changed:e,onChange:t,params:{rangeKey:n}})=>{e.range===n&&t(e.key,e)})},{channel:M.Km.KV_DELETE_CHANNEL,onChange:_.parsedHandler(A1,async({changed:e,onDelete:t,params:{rangeKey:n}})=>{e.range===n&&t(e.key)})}]}),Ha=M.Km.kvPairZ,O1=Dt({name:"Range Meta Data",schema:Ha,retrieve:async()=>null,update:async({client:e,value:t})=>{await e.ranges.getKV(t.range).set(t.key,t.value)},initialValues:{key:"",value:"",range:""}}),B1=Bt({name:"Range Meta Data",update:async({client:e,value:t,params:{rangeKey:n}})=>{await e.ranges.getKV(n).delete(t)}}),D1=Bt({name:"Range Meta Data",update:async({client:e,value:t,onChange:n})=>{await e.ranges.getKV(t.range).set(t.key,t.value),n(t)}}),z1=Bt({name:"Range",update:async({client:e,value:t,onChange:n})=>n(await e.ranges.create(t))}),H1=Bt({name:"Range",update:async({client:e,value:t})=>await e.ranges.delete(t)}),$a=({timeRange:e,level:t="p",color:n=9,showSpan:s=!1,...r})=>{const i=new u.n(e.start),l=i.isToday?"time":"dateTime",a=new u.n(e.end),c=a.equals(u.n.MAX),d=a.span(i)<u.a.DAY?"time":"dateTime",x=i.span(a),p=o.jsxRuntimeExports.jsxs(f.Text,{x:!0,align:"center",gap:"small",children:[i.isToday&&o.jsxRuntimeExports.jsx(f.Text,{level:t,color:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(f.DateTime,{el:"span",level:t,displayTZ:"local",format:l,color:n,weight:450,children:i})]}),m=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[c?o.jsxRuntimeExports.jsx(f.Text,{level:t,el:"span",children:"Now"}):o.jsxRuntimeExports.jsx(f.DateTime,{level:t,el:"span",displayTZ:"local",format:d,color:n,weight:450,children:a}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(f.Text,{level:t,color:n,weight:450,el:"span",children:["(",i.span(a).truncate(u.a.MILLISECOND).toString(),")"]})]});return o.jsxRuntimeExports.jsxs(f.Text,{x:!0,gap:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",level:t,color:n,...r,children:[p,o.jsxRuntimeExports.jsx(f.Arrow.Right,{color:9}),m]})},hr="range",gr=g.memo(({itemKey:e,showParent:t=!0,showLabels:n=!0,...s})=>{const r=f.useItem(e);if(r==null)return null;const{name:i,parent:l,timeRange:a,labels:c}=r;return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,justify:"between",...s,children:[o.jsxRuntimeExports.jsxs(sr,{children:[o.jsxRuntimeExports.jsx(yn,{weight:450,color:10,children:i}),l!=null&&t&&o.jsxRuntimeExports.jsx(yn,{weight:400,color:8,children:l.name})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx($a,{level:"small",timeRange:a}),n&&o.jsxRuntimeExports.jsx(tr,{children:c?.map(d=>o.jsxRuntimeExports.jsx(vs,{color:d.color,size:"small",children:d.name},d.key))})]})]})});gr.displayName="Ranger.ListItem";const Va=f.renderProp(gr),Fa=o.jsxRuntimeExports.jsx(f.Range,{}),$1=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=fr({filter:s,initialParams:r}),{fetchMore:p,search:m}=tt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Range",haulType:hr,value:t,onChange:e,data:l,getItem:c,icon:Fa,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,...i,children:Va})},V1={style:{width:800}},F1=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,subscribe:d,getItem:x,status:p}=fr({filter:n,initialParams:i}),{fetchMore:m,search:h}=tt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Ot,{resourceName:"Range",variant:"modal",value:t,onChange:e,data:a,allowNone:s,haulType:hr,onFetchMore:m,getItem:x,subscribe:d,status:p,onSearch:h,emptyContent:r,icon:Fa,itemHeight:45,dialogProps:V1,...l,children:Va})},Z1=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:hr,ListItem:gr,SelectMultiple:$1,SelectSingle:F1,TimeRangeChip:$a,formSchema:za,kvPairFormSchema:Ha,metaDataFormSchema:T1,retrieveParent:v1,retrieveQuery:Da,toFormValues:_o,useAliasDeleteSynchronizer:Ia,useAliasSetSynchronizer:Aa,useChildren:b1,useDelete:H1,useDeleteKV:B1,useForm:k1,useKVPairForm:O1,useLabels:L1,useList:fr,useListKV:I1,useRetrieve:N1,useSetSynchronizer:w1,useUpdate:z1,useUpdateKV:D1},Symbol.toStringTag,{value:"Module"})),Ri={},Za=({activeRange:e,...t})=>{const n=nt(),[s,r]=g.useState(Ri);Ge(async x=>{if(n==null||e==null){r(Ri);return}const p=await n.ranges.retrieve(e);if(x.aborted)return;const m=await p.listAliases();x.aborted||r(m)},[n,e]);const i=g.useCallback(({alias:x,channel:p,range:m})=>r(h=>{if(m!==e)return h;const j={...h};return j[p]=x,j}),[e]);Aa(i);const l=g.useCallback(({channel:x,range:p})=>r(m=>{if(p!==e)return m;const h={...m};return delete h[x],h}),[e]);Ia(l);const a=g.useCallback(async(x,p)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(x,p)},[n,e]),c=g.useCallback(async x=>{if(n==null||x===0)return;const p=s[x];if(p!=null)return p;const{name:m}=await n.channels.retrieve(x);return m},[s,n]),d=g.useMemo(()=>({aliases:s,activeRange:e,setAlias:e!=null?a:null,getName:c}),[s,e,a,c]);return o.jsxRuntimeExports.jsx(_a,{...t,value:d})},Mt="channel",K1={region:u.Ho.ZERO,dpr:1,os:u.S.getOS()},Y1={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},W1=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},a]=f.use$2({type:_.Canvas.TYPE,schema:_.canvasStateZ,initialState:K1}),c=g.useRef({...Y1}),d=g.useRef(!1),x=g.useCallback(E=>{c.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:E,dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})})),d.current=!0)},[a]),p=g.useRef(null),m=f.useResize(x,{debounce:t}),h=f.useCombinedRefs(p,m);g.useEffect(()=>{const E=()=>{window.devicePixelRatio===l||!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",E,{once:!0})},[l]),g.useEffect(()=>{const E=()=>{!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",E),window.addEventListener("blur",E)},[a]);const j=g.useCallback(E=>{if(E==null)return;E.className.includes("gl")?c.current.gl=E:E.className.includes("upper2d")?c.current.upper2d=E:c.current.lower2d=E;const{gl:S,lower2d:R,upper2d:v,bootstrapped:y}=c.current;if(S==null||R==null||v==null||y)return;c.current.bootstrapped=!0;const C=S.transferControlToOffscreen(),N=v.transferControlToOffscreen(),k=R.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:N,lower2dCanvas:k,bootstrap:!0,bootstrapped:!1,region:u.Ho.construct(S),dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})},[C,N,k])},[a]);return o.jsxRuntimeExports.jsxs("div",{ref:h,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:j,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:j,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:j,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:i&&e})]})},Pn=(e,t)=>f.useResize(g.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(u.C.XY.translate(u.K.scale(u.Ho.topLeft(r),-1)).box(n),s)},[e]),t),G1=Object.freeze(Object.defineProperty({__proto__:null,Canvas:W1,useRegion:Pn},Symbol.toStringTag,{value:"Module"})),Ka=g.createContext(null),et=e=>{const t=g.use(Ka);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Ya=e=>{const{addViewportHandler:t}=et("Viewport");g.useEffect(()=>t(e),[t,e])},Tn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=et(t),{key:r}=e;return f.useEffectCompare(()=>{u.K$1.outer.parse(e.loc),n(e)},([a],[c])=>M.m.equal(a,c),[e]),g.useEffect(()=>()=>s(r),[]),{gridArea:u.g.swap(u.K$1.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Wa=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.K.ZERO,children:r,hold:i=!1,onHold:l,visible:a,...c})=>{const[d,x]=g.useState([]),p=f.useMemoDeepEqual({clearOverScan:s,hold:i,visible:a}),[{path:m},{grid:h},j]=f.use$2({aetherKey:e,type:_.LinePlot.TYPE,schema:_.linePlotStateZ,initialState:{container:u.Ho.ZERO,viewport:u.Ho.DECIMAL,grid:{},...p}}),E=g.useCallback(B=>{a&&j($=>({...$,container:B}))},[j,a]),S=Pn(E,{debounce:n});g.useEffect(()=>j(B=>({...B,...p})),[p]);const R=g.useRef(new Map),v=g.useCallback(B=>(R.current.set(B,null),()=>R.current.delete(B)),[R]),y=g.useCallback(B=>{const{mode:$,box:w,stage:P}=B;($==="pan"&&P!=="start"||$==="zoom"||$==="zoomReset"&&P==="start")&&j(L=>({...L,viewport:w})),R.current.forEach((L,O)=>O(B))},[j]),C=g.useCallback(B=>{j($=>({...$,grid:{...$.grid,[B.key]:B}}))},[j]),N=g.useCallback(B=>j($=>{const{[B]:w,...P}=$.grid;return{...$,grid:P}}),[j]),k=g.useCallback(B=>{x($=>[...$.filter(({key:w})=>w!==B.key),B])},[x]),A=g.useCallback(B=>x($=>$.filter(({key:w})=>w!==B)),[k]),I=g.useMemo(()=>U1(h),[h]),D=g.useCallback(B=>{j($=>({...$,hold:B})),l?.(B)},[j,l]),V=`line-plot-${e}`,z=g.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:N,setLine:k,removeLine:A,setViewport:y,addViewportHandler:v,setHold:D,id:V}),[V,d,C,N,k,A,y,v,D]);return o.jsxRuntimeExports.jsx("div",{id:V,className:u.CSS.B("line-plot"),style:{...t,...I},ref:S,...c,children:o.jsxRuntimeExports.jsx(Ka,{value:z,children:o.jsxRuntimeExports.jsx(f.Composite,{path:m,children:r})})})},U1=e=>{const t=u.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()},jr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?_.XAxis.TYPE:_.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:a=t,label:c="",labelLevel:d="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:h,showGrid:j,type:E,bounds:S,className:R,tickSpacing:v,autoBounds:y,axisKey:C,autoBoundUpdateInterval:N,onAutoBoundsChange:k,style:A,...I})=>{const D=(c?.length??0)>0,V=f.useUniqueKey(i),z=f.useMemoDeepEqual({location:a,showGrid:j,type:E,bounds:S,axisKey:C,label:c,labelDirection:x,tickSpacing:v,autoBounds:y,autoBoundUpdateInterval:N}),[{path:B},{size:$,labelSize:w,...P},L]=f.use$2({aetherKey:V,type:n,schema:_.coreAxisStateZ,initialState:z});g.useEffect(()=>L(Z=>({...Z,...z})),[z]),g.useEffect(()=>{const{lower:Z,upper:K}=_.parseAutoBounds(P.autoBounds);P.bounds!=null&&(Z&&S?.lower!==P.bounds.lower||K&&S?.upper!==P.bounds.upper)&&k?.(P.bounds)},[P.autoBounds,P.bounds]);const O=Tn({loc:a,key:`${n}-${V}`,size:$+w,order:1},`${e.toUpperCase()}Axis`),H=ws.useTypography(d).toString(),F=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(c==null)return;let K=M.dimensions(c,H)[u.g.dimension(u.g.construct(x))];K>0&&(K+=9),L(X=>({...X,labelSize:K}))}else{let K=M.dimensions(c,H).height*1.3;K>0&&(K+=12);const X=F.current;_.withinSizeThreshold(X,K)||(F.current=K,L(oe=>({...oe,labelSize:K})))}},[c,x,H]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(R,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(a)),style:{...A,...O},align:"center",justify:a!=="left"?"end":"start",direction:u.g.swap(e),...I,children:D&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:c,onChange:p,level:d})}),o.jsxRuntimeExports.jsx(f.Composite,{path:B,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},Ga=jr("x"),Ua=jr("y"),qa=u.K.xy.extend({root:u.K$1.corner,units:se.z.object({x:se.z.enum(["px","decimal"]),y:se.z.enum(["px","decimal"])})}),q1=qa.partial({root:!0,units:!0}),X1=e=>{const t={};return t[e.root?.x??"left"]=e?.units?.x==="px"?`${e.x}px`:`${e.x*100}%`,t[e.root?.y??"top"]=e?.units?.y==="px"?`${e.y}px`:`${e.y*100}%`,t},Q1=(e,t)=>{const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Ho.construct(t.current),r=u.Ho.construct(t.current.parentElement);return e.units?.x==="decimal"?e.root?.x==="right"&&(n.x=1-e.x):e.root?.x==="right"?n.x=1-(e.x+u.Ho.width(s))/u.Ho.width(r):n.x/=u.Ho.width(r),e.units?.y==="decimal"?e.root?.y==="bottom"&&(n.y=1-e.y):e.root?.y==="bottom"?n.y=1-(e.y+u.Ho.height(s))/u.Ho.height(r):n.y/=u.Ho.height(r),n},Xa=(e,t)=>{if(t.current==null)return null;const n=u.Ho.construct(t.current.parentElement),s=u.Ho.construct(t.current),r={x:e.x,y:e.y,root:{...u.K$1.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*u.Ho.width(n)-u.Ho.width(s),r.root.x="right"):e.x<.2?r.x=e.x*u.Ho.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*u.Ho.height(n)-u.Ho.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*u.Ho.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...u.K.truncate(r,3)}},Ci=u.Ho.reRoot(u.Ho.DECIMAL,u.K$1.TOP_LEFT),J1={x:.1,y:.1,root:u.K$1.TOP_LEFT,units:{x:"decimal",y:"decimal"}},Er=g.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,initial:i=J1,...l})=>{const[a,c]=M.usePurePassthrough({value:t,onChange:n,initial:i}),d=g.useRef(a),x=f.useSyncedRef(r===!1),p=g.useRef(null);a!==null&&(s={...s,...X1(a)});const m=g.useCallback(j=>{if(p.current?.parentElement==null)return d.current;const E=u.Ho.construct(p.current.parentElement),S=u.C.XY.scale(E).scale(Ci),R=S.box(u.Ho.construct(p.current)),v=u.C.XY.clamp(u.Ho.construct(u.Ho.topLeft(Ci),{width:1-u.Ho.width(R),height:1-u.Ho.height(R)})),y=u.K.translate(u.K.construct(d.current),u.Ho.signedDims(S.box(j))),C=v.pos(y);return Xa(C,p)},[]),h=Pe.useCursorDrag({onStart:g.useCallback(()=>{d.current=Q1(d.current,p)},[]),onMove:g.useCallback(j=>{if(x.current)return;const E=m(j);E!==null&&c(E)},[]),onEnd:g.useCallback(j=>{if(x.current)return;const E=m(j);E!==null&&(d.current=E)},[])});return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,style:s,onDragStart:h,draggable:r,borderColor:5,ref:p,onDrag:f.preventDefault,onDragEnd:f.preventDefault,background:1,rounded:1,...l})});Er.displayName="Legend.Container";const ks=g.memo(({data:e,onEntryChange:t,onVisibleChange:n,allowVisibleChange:s=!0,background:r=1})=>o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e.sort((i,l)=>i.label.localeCompare(l.label)).map(({key:i,color:l,label:a,visible:c=!0})=>o.jsxRuntimeExports.jsxs(f.Box,{style:{cursor:"pointer",height:"3rem"},x:!0,align:"center",gap:"small",justify:"between",grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(Pe.Swatch,{value:l,onChange:d=>t?.({key:i,color:d,label:a,visible:c}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"tiny"}),o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",value:a,onChange:d=>t?.({key:i,color:l,label:d,visible:c}),overflow:"nowrap",color:c?10:7,onDoubleClick:d=>d.stopPropagation()})]}),s&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.B("visible-toggle"),onClick:d=>{d.stopPropagation(),t?.({key:i,color:l,label:a,visible:!c})},onDoubleClick:d=>d.stopPropagation(),size:"tiny",contrast:r,variant:"text",children:c?o.jsxRuntimeExports.jsx(f.Visible,{}):o.jsxRuntimeExports.jsx(f.Hidden,{})})]},i))}));ks.displayName="LegendSwatches";const yr=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,allowVisibleChange:r=!0,background:i=1,...l})=>{const[a,c]=g.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(Er,{...l,className:r?u.CSS.M("with-visible-toggle"):void 0,draggable:!a,value:n,onChange:s,gap:r?0:"small",background:i,children:o.jsxRuntimeExports.jsx(ks,{data:e,onEntryChange:t,onVisibleChange:c,allowVisibleChange:r,background:i})})},e0=Object.freeze(Object.defineProperty({__proto__:null,Container:Er,LegendSwatches:ks,Simple:yr,calcStickyPos:Xa,completeStickyXYz:qa,stickyXYz:q1},Symbol.toStringTag,{value:"Module"})),Sr=g.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=et("Legend");return et("Legend"),o.jsxRuntimeExports.jsx(yr,{data:r,onEntryChange:n,...s})});Sr.displayName="FloatingLegend";const t0=({onLineChange:e})=>{const{lines:t}=et("Legend"),n=f.useUniqueKey(),s=Tn({key:n,size:t.length>0?36:0,loc:"bottom",order:5},"Legend");return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS.BE("legend","container"),align:"center",x:!0,style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 ",width:"fit-content"},children:o.jsxRuntimeExports.jsx(ks,{data:t,onEntryChange:e,background:0})})},Qa=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(Sr,{...t}):o.jsxRuntimeExports.jsx(t0,{...t}),Rr=g.memo(({aetherKey:e,...t})=>(f.useUnidirectional({aetherKey:e,type:_.Line.TYPE,schema:_.stateZ,state:t}),null));Rr.displayName="Line";const n0=Object.freeze(Object.defineProperty({__proto__:null,Line:Rr},Symbol.toStringTag,{value:"Module"})),Cr=({aetherKey:e,color:t,label:n="",visible:s=!0,...r})=>{const i=f.useUniqueKey(e),{setLine:l,removeLine:a}=et("Line");return g.useEffect(()=>(l({key:i,color:t,label:n,visible:s}),()=>a(i)),[n,t,s]),o.jsxRuntimeExports.jsx(Rr,{aetherKey:i,color:t,label:n,visible:s,...r})},Ja=({level:e="h2",...t})=>{const n=f.useUniqueKey(),s=ws.useTypography(e),r=Tn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(f.Box,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{...t,level:e})})},ec=({aetherKey:e,...t})=>{const n=f.useUniqueKey(e),[,,s]=f.use$2({aetherKey:n,type:_.Tooltip.TYPE,schema:_.tooltipStateZ,initialState:{position:null,...t}}),r=g.useRef(null),i=g.useCallback(a=>{const c=document.querySelector(".pluto-canvas-container");if(c==null)return;const d=u.Ho.topLeft(c);s({position:u.K.translation(d,u.K.construct(a))})},[s]),l=g.useCallback(()=>s({position:null}),[s]);return g.useEffect(()=>{if(r.current===null)return;const a=r.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",l),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},s0=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ec},Symbol.toStringTag,{value:"Module"})),tc=()=>{const e=g.useRef(new Map),t=g.useCallback(s=>{const{request:r,response:i}=s,l=e.current.get(r);l!=null&&(l(i.bounds),e.current.delete(r))},[]),[,,n]=f.use$2({type:_.BoundQuerier.TYPE,schema:_.boundQuerierStateZ,onAetherChange:t,initialState:{request:"",response:{request:"",bounds:{}}}});return g.useCallback(async()=>await new Promise(s=>{const r=u.$t.create();e.current.set(r,s),n(i=>({...i,request:r}))}),[])},o0=({ref:e})=>(e.current=tc(),null),r0={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer",cancel:"default"},nc=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:r0[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...u.Ho.css(n),display:u.Ho.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),i0=(e,t)=>{for(;e!=null&&!t(e);)e=e.parentElement;return e},l0=11,a0=6,c0=2,wi=5,u0=e=>u.Ho.width(e)<wi&&u.Ho.height(e)<wi,pn=e=>{const t=u.Ho.width(e),n=u.Ho.height(e);return Math.min(t,n)<.001?l0:a0},d0=["zoom","pan","select","zoomReset","cancel"],wr=[...d0,"click"],x0=se.z.enum(wr),sc=["zoom","select"],mn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},oc={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},rc={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]],cancel:[["Escape"]]},br={zoom:mn,pan:oc,select:rc,zoomReset:mn,click:mn,cancel:mn},p0=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},m0=u.Ho.construct(0,0,1,1,u.K$1.TOP_LEFT),f0={width:30,height:50},ic=({onChange:e,triggers:t,initial:n=m0,threshold:s=f0,ref:r})=>{const i=t?.defaultMode??"zoom",[l,a]=g.useState(u.Ho.ZERO),[c,d]=g.useState(i),[x,p]=f.useStateRef(n),m=g.useRef(u.K.ZERO),h=g.useRef(null),j=u._.construct(s);g.useEffect(()=>p(()=>u.Ho.truncate(n,pn(n))),[n]),g.useEffect(()=>d(i),[i]);const[E,S,R,v]=f.useMemoCompare(()=>{const I={...br[i],...t},D=f.flattenConfig(I),V=p0(I);return[I,D,V,f.flattenConfig(V)]},f.compareModeConfigs,[t]),y=g.useCallback(({box:I,triggers:D,stage:V,cursor:z})=>{if(h.current==null)return;const B=f.determineMode(E,D),$=u.Ho.construct(h.current);if(B==null)return;if(B==="cancel"){a(u.Ho.ZERO),e?.({box:x.current,mode:B,stage:V,cursor:z});return}if(B==="zoomReset")return a(u.Ho.ZERO),e?.({box:u.Ho.DECIMAL,mode:B,stage:V,cursor:z}),p(u.Ho.DECIMAL);const w=u0(I);if(V==="end"){if(w){B==="zoom"&&a(u.Ho.ZERO),e?.({box:x.current,mode:"click",stage:V,cursor:z});return}return p(L=>{if(B==="pan"){const H=bi(I,L,$);return H===null||u.Ho.equals(H,L)?L:(e?.({box:H,mode:B,stage:V,cursor:z}),H)}const O=C(I,L,$);return O===null?L:(e?.({box:O,mode:B,stage:V,cursor:z}),B==="zoom"?(a(u.Ho.ZERO),O):u.Ho.truncate(L,pn(L)))})}if(sc.includes(B))return w?void 0:a(u.C.XY.scale($).clamp($).translate({x:-u.Ho.left($),y:-u.Ho.top($)}).box(vi(j,I,$)));if(a(L=>u.Ho.areaIsZero(L)?L:u.Ho.ZERO),u.K.distance(z,m.current)<c0)return;m.current=z;const P=bi(I,x.current,$);e?.({box:P,mode:B,stage:V,cursor:z})},[a,d,e,E,s.height,s.width,p,h,pn]);g.useImperativeHandle(r,()=>({reset:()=>{a(u.Ho.ZERO),p(u.Ho.DECIMAL),e?.({box:u.Ho.DECIMAL,mode:"zoomReset",stage:"start",cursor:u.K.ZERO})}}),[e]);const C=g.useCallback((I,D,V)=>{const z=No(D,V).box(vi(j,I,V));return u.Ho.truncate(z,pn(z))},[s]),N=f.useHeldRef({triggers:[["Control"]]}),k=f.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const I=D=>{if(h.current==null)return;let V=1;D.deltaY<0?V-=.035:V+=.035;const z=u.Ho.construct(h.current),B=u.K.construct(D);if(Array.from(h.current.children).push(h.current),!u.Ho.contains(z,B)||h.current!==D.target&&i0(D.target,H=>H===h.current)==null)return;const P=No(x.current,u.Ho.construct(h.current)).pos(u.K.construct(D));let O=u.C.XY.magnify({x:N.current.held?1:V,y:k.current.held?1:V}).box(x.current);O=u.Ho.translate(O,{x:N.current.held?0:P.x*(1-V),y:k.current.held?0:P.y*(1-V)}),p(O),e?.({stage:"end",box:O,cursor:u.K.construct(D),mode:"zoom"})};return window.addEventListener("wheel",I),()=>window.removeEventListener("wheel",I)},[p,e]),Fl.useDrag({bound:h,onDrag:y,triggers:S,loose:!0});const A=g.useCallback(({triggers:I,stage:D})=>{if(D==="end")return d(i);const V=f.determineMode(R,I);V!=null&&d(V)},[R,i,e]);return f.use$1({triggers:v,callback:A,region:h}),{maskBox:l,ref:h,mode:c}},No=(e,t)=>u.C.XY.scale(t).clamp(t).scale(e),bi=(e,t,n)=>{let s=u.Ho.signedDims(No(t,n).box(e));s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight};const r=u.C.XY.translate(u.K.construct(s)).box(t);return u.Ho.truncate(r,pn(r))},vi=(e,t,n)=>u.Ho.height(t)<=e.height?u.Ho.construct(u.Ho.left(t),u.Ho.top(n),u.Ho.width(t),u.Ho.height(n)):u.Ho.width(t)<=e.width?u.Ho.construct(u.Ho.left(n),u.Ho.top(t),u.Ho.width(n),u.Ho.height(t)):t,ro=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",children:[o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:u.z.capitalize(e)}),o.jsxRuntimeExports.jsx(f.Box,{empty:!0,x:!0,align:"center",children:o.jsxRuntimeExports.jsx(f.Text$1,{trigger:t[0],level:"small"})})]}),h0=({triggers:e,value:t,onChange:n,disable:s=["zoomReset","click","cancel"],...r})=>{const i=g.useMemo(()=>wr.filter(l=>!s.includes(l)),[s]);return o.jsxRuntimeExports.jsxs(pe.Buttons,{...r,keys:i,value:t,onChange:n,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"zoom",tooltip:o.jsxRuntimeExports.jsx(ro,{mode:"zoom",triggers:e.zoom}),size:"small",children:o.jsxRuntimeExports.jsx(f.Zoom,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",tooltip:o.jsxRuntimeExports.jsx(ro,{mode:"pan",triggers:e.pan}),size:"small",children:o.jsxRuntimeExports.jsx(f.Pan,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",tooltip:o.jsxRuntimeExports.jsx(ro,{mode:"select",triggers:e.select}),size:"small",children:o.jsxRuntimeExports.jsx(f.Selection,{})})]})},g0=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:br,MASK_MODES:sc,MODES:wr,Mask:nc,PAN_DEFAULT_TRIGGERS:oc,SELECT_DEFAULT_TRIGGERS:rc,SelectMode:h0,ZOOM_DEFAULT_TRIGGERS:mn,modeZ:x0,use:ic},Symbol.toStringTag,{value:"Module"})),j0=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,lc=({ref:e,children:t,initial:n=u.Ho.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=et("Viewport");g.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:u.K.ZERO,stage:"start"})},[i,n]);const l=g.useCallback(c=>{i(c),s?.(c)},[s,i]),a=ic({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(nc,{className:u.CSS.BE("line-plot","viewport"),...a,children:t})},E0=Object.freeze(Object.defineProperty({__proto__:null,BoundsQuerier:o0,Floating:Sr,Legend:Qa,Line:Cr,LinePlot:Wa,Title:Ja,Tooltip:s0,Viewport:lc,XAxis:Ga,YAxis:Ua,axisFactory:jr,selectViewportEl:j0,useBoundQuerier:tc,useContext:et,useGridEntry:Tn,useViewport:Ya},Symbol.toStringTag,{value:"Module"})),y0=({aetherKey:e,...t})=>(f.use$2({aetherKey:e,type:_.Annotation.TYPE,schema:_.annotationStateZ,initialState:t}),null),ac=({aetherKey:e,menu:t,...n})=>{const s=f.useUniqueKey(e),{setViewport:r,setHold:i}=et("Range.Provider"),[,{hovered:l,count:a},c]=f.use$2({aetherKey:s,type:_.Provider$2.TYPE,schema:_.providerStateZ$1,initialState:{...n,cursor:null,hovered:null,count:0}}),d=Tn({key:s,loc:"top",size:a>0?32:0,order:3},"Annotation.Provider"),x=f.useContextMenu(),p=f.useSyncedRef(x.visible),m=g.useCallback(j=>c(E=>({...E,cursor:{x:j.clientX,y:j.clientY}})),[c]),h=g.useCallback(()=>{p.current||c(j=>({...j,cursor:null}))},[c,p]);return o.jsxRuntimeExports.jsx(f.ContextMenu,{...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(f.Box,{style:{...d,cursor:l!=null?"pointer":"default",width:"100%",height:"100%"},onContextMenu:x.open,className:x.className,onClick:()=>{l!=null&&(r({box:u.Ho.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:u.K.ZERO,stage:"start"}),i(!0))},onMouseMove:m,onMouseLeave:h})})},S0=Object.freeze(Object.defineProperty({__proto__:null,Annotation:y0,Provider:ac},Symbol.toStringTag,{value:"Module"})),cc={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},R0=f.flattenConfig(cc),uc=({aetherKey:e})=>{const t=f.useUniqueKey(e),[,,n]=f.use$2({aetherKey:t,type:_.Measure.TYPE,schema:_.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=g.useRef(null),r=f.useHeldRef({triggers:R0,loose:!0}),i=g.useCallback(({mode:c,cursor:d})=>{if(c==="click"){const x=f.determineMode(cc,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:d}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[n,r]);Ya(i);const l=g.useCallback(c=>n(d=>({...d,hover:u.K.construct(c)})),[n]),a=g.useCallback(()=>{n(c=>({...c,hover:null}))},[n]);return g.useEffect(()=>{if(s.current===null)return;const c=s.current.parentElement;if(c!=null)return c.addEventListener("mousemove",l),c.addEventListener("mouseleave",a),()=>{c.removeEventListener("mousemove",l),c.removeEventListener("mouseleave",a)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},C0=Object.freeze(Object.defineProperty({__proto__:null,Measure:uc},Symbol.toStringTag,{value:"Module"})),vr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:a,lineWidth:c,lineDash:d,className:x,onSelect:p,style:m,...h})=>{const[j,E]=M.usePurePassthrough({value:t,onChange:s,initial:""}),S=f.useSyncedRef(r),[,{pixelPosition:R},v]=f.use$2({aetherKey:e,type:_.Rule.TYPE,schema:_.ruleStateZ,initialState:{color:a,dragging:!1,position:n,lineWidth:c,lineDash:d},onAetherChange:g.useCallback(({position:B})=>{B!=null&&S.current?.(B)},[S])}),y=g.useRef(R);R!==y.current&&(y.current=R);const{id:C}=et("Rule"),k=document.getElementById(C)?.querySelector(".pluto-line-plot__viewport"),A=g.useRef(R);g.useEffect(()=>{v(B=>({...B,position:n,color:a,lineWidth:c,lineDash:d}))},[n,a,c,d]);const I=Pe.useCursorDrag({onStart:g.useCallback(()=>{p?.(),v(B=>({...B,dragging:!0})),A.current=y.current},[]),onMove:B=>{v($=>({...$,pixelPosition:(A.current??0)+u.Ho.signedHeight(B)}))},onEnd:g.useCallback(()=>{v(B=>({...B,dragging:!1})),A.current=R},[])}),D=g.useRef(null);if(n==null||R==null)return null;const V=u.ir.pickByContrast(a,u.ir.BLACK,u.ir.WHITE),z=o.jsxRuntimeExports.jsxs("div",{ref:D,className:u.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:I,draggable:!0}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS(x,u.CSS.BE("rule","tag")),bordered:!0,onClick:p,empty:!0,rounded:!0,style:{borderColor:u.ir.cssString(a),backgroundColor:u.ir.hex(u.ir.setAlpha(a,.7)),...m},...h,children:[o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS.BE("rule","label"),level:"small",value:j,onChange:E,color:V}),o.jsxRuntimeExports.jsx(Zl.Divider$1,{y:!0,style:{borderColor:u.ir.cssString(a)}}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS.BE("rule","value"),children:[o.jsxRuntimeExports.jsx(f.Editable,{value:n.toFixed(2),onChange:B=>{const $=Number(B);isFinite($)&&r?.($)},level:"small",color:V}),l.length>0&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",color:V,value:l,onChange:i})]})]})]});return k==null?z:$l.createPortal(z,k)},w0=Object.freeze(Object.defineProperty({__proto__:null,Rule:vr},Symbol.toStringTag,{value:"Module"})),dc=f.canDropOfType(Mt),b0=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:a,titleLevel:c="h4",onLineChange:d,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:h,enableTooltip:j=!0,enableMeasure:E=!1,initialViewport:S=u.Ho.DECIMAL,legendVariant:R,onViewportChange:v,viewportTriggers:y,rangeAnnotationProvider:C,onSelectRule:N,children:k,...A})=>{const I=t.filter(({location:$})=>u.K$1.isY($)),D=g.useRef(null),V=f.usePrevious(e.length),z=f.usePrevious(A.hold),B=V===0&&e.length!==0||z===!0&&A.hold===!1;return g.useEffect(()=>{B&&D.current?.reset()},[B]),o.jsxRuntimeExports.jsxs(Wa,{...A,children:[I.map(($,w)=>{const P=e.filter(H=>H.axes.x===$.key),L=t.filter(({location:H})=>u.K$1.isX(H)),O=h?.filter(H=>[...L.map(({key:F})=>F),$.key].includes(H.axis));return o.jsxRuntimeExports.jsx(v0,{axis:$,index:w,lines:P,yAxes:L,rules:O,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:N},$.key)}),i&&o.jsxRuntimeExports.jsx(Qa,{onLineChange:d,position:l,onPositionChange:a,variant:R}),n&&o.jsxRuntimeExports.jsx(Ja,{value:s,onChange:r,level:c}),o.jsxRuntimeExports.jsxs(lc,{initial:S,onChange:v,triggers:y,ref:D,children:[j&&o.jsxRuntimeExports.jsx(ec,{}),E&&o.jsxRuntimeExports.jsx(uc,{}),k]})]})},v0=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:a,axis:{location:c,key:d,showGrid:x,...p},annotationProvider:m})=>{const h=f.useDrop({type:"Channel.LinePlot.XAxis",canDrop:dc,onDrop:g.useCallback(({items:S})=>{const R=f.filterByType(Mt,S);return l?.(d,R.map(({key:v})=>v)),R},[d,l])}),j=s?.filter(S=>S.axis===d),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(Ga,{...p,...h,location:c,axisKey:d,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(Mt)(E))),onAutoBoundsChange:S=>a?.({key:d,bounds:S}),onLabelChange:S=>a?.({key:d,label:S}),children:[e.map((S,R)=>{const v=t.filter(C=>C.axes.y===S.key),y=s?.filter(C=>C.axis===S.key);return o.jsxRuntimeExports.jsx(N0,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:v,rules:y,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:a,onSelectRule:i},S.key)}),j?.map(S=>g.createElement(vr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>r?.({key:S.key,label:R}),onPositionChange:R=>r?.({key:S.key,position:R}),onUnitsChange:R=>r?.({key:S.key,units:R}),onSelect:()=>i?.(S.key)})),o.jsxRuntimeExports.jsx(ac,{...m})]})},_0=({channels:{x:e,y:t}})=>`${e??0}-${t}`,N0=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...a},onSelectRule:c})=>{const d=f.useDrop({type:"Channel.LinePlot.YAxis",canDrop:dc,onDrop:g.useCallback(({items:p})=>{const m=f.filterByType(Mt,p);return s?.(i,m.map(({key:h})=>h)),m},[i,s])}),x=f.useDraggingState();return o.jsxRuntimeExports.jsxs(Ua,{...a,...d,location:l,axisKey:i,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(Mt)(x))),onAutoBoundsChange:p=>r?.({key:i,bounds:p}),onLabelChange:p=>r?.({key:i,label:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(M0,{line:p},_0(p))),t?.map(p=>g.createElement(vr,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n?.({key:p.key,label:m}),onPositionChange:m=>n?.({key:p.key,position:m}),onUnitsChange:m=>n?.({key:p.key,units:m}),onClick:()=>c?.(p.key)}))]})},M0=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(L0,{line:e}):o.jsxRuntimeExports.jsx(k0,{line:e}),k0=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:a}=g.useMemo(()=>{const c=Number(t.valueOf())*3,d=_.streamChannelData({timeSpan:t,channel:s,keepFor:c}),x=n!=null&&n!==0;return{xTelem:_.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:c}),yTelem:d}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Cr,{aetherKey:e,y:a,x:l,...i},e)},L0=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=g.useMemo(()=>{const a=_.channelData({timeRange:e,channel:s}),c=n!=null&&n!==0;return{xTelem:_.channelData({timeRange:e,channel:c?n:s,useIndexOfChannel:!c}),yTelem:a}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Cr,{aetherKey:t,y:l,x:i,...r},t)},P0=e=>Oe({channel:M.xm.CALCULATION_STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.calculationStatusZ,async t=>{e(t.changed)})}),_r=M.xm.newZ.extend({name:se.z.string().min(1,"Name must not be empty"),dataType:M.$.z.transform(e=>e.toString())}).refine(e=>!e.isIndex||M.$.z.parse(e.dataType).equals(M.$.TIMESTAMP),{message:"Index channel must have data type TIMESTAMP",path:["dataType"]}).refine(e=>e.isIndex||e.index!==0||e.virtual,{message:"Data channel must have an index",path:["index"]}).refine(e=>e.virtual||!M.$.z.parse(e.dataType).isVariable,{message:"Persisted channels must have a fixed-size data type",path:["dataType"]}),xc=_r.extend({expression:se.z.string().min(1,"Expression must not be empty").refine(e=>e.includes("return"),{message:"Expression must contain a return statement"})}).refine(e=>e.requires?.length>0,{message:"Expression must use at least one channel",path:["requires"]}),Ls=e=>({...e.payload,dataType:e.dataType.toString()}),Nr={key:0,name:"",index:0,dataType:M.$.FLOAT32.toString(),internal:!1,isIndex:!1,leaseholder:0,virtual:!1,expression:"",requires:[]},pc=async({client:e,params:{key:t}})=>{if(t==null)return null;const n=await e.channels.retrieve(t);return Ls(n)},mc=async({client:e,value:t,onChange:n})=>{const s=await e.channels.create(t);n(Ls(s))},T0=e=>Dt({name:"Channel",schema:_r,initialValues:Nr,retrieve:pc,update:mc,listeners:[{channel:M.xm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:t,onChange:n,params:s,client:r})=>{s.key===t&&n(Ls(await r.channels.retrieve(t)))})}]})(e),A0=e=>Dt({name:"Calculated Channel",schema:xc,initialValues:Nr,retrieve:pc,update:mc,listeners:[{channel:M.xm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:t,onChange:n,params:s,client:r})=>{s.key===t&&n(Ls(await r.channels.retrieve(t)))})}]})(e),I0={internal:!1},Mr=Fe({name:"Channels",retrieve:async({client:e,params:t})=>await e.channels.retrieve({...I0,...t,searchTerm:t.searchTerm}),retrieveByKey:async({client:e,key:t})=>await e.channels.retrieve(t),listeners:[{channel:M.xm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:e,onChange:t,client:n})=>{t(e,await n.channels.retrieve(e))})},{channel:M.xm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.xm.keyZ,async({changed:e,onDelete:t})=>t(e))}]}),fc=e=>{if(e==null)return f.Channel;if(M.xm.isCalculated(e))return f.Calculation;if(e.isIndex)return f.Index;const t=new u.r(e.dataType);return t.isInteger?f.Binary:t.isFloat?f.Decimal:t.equals(u.r.STRING)?f.String:t.equals(u.r.JSON)?f.JSON:f.Channel},hc=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e),s=Na(),r=fc(n?.payload),i=s[n?.key??0]??n?.name??"";return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,children:[o.jsxRuntimeExports.jsx(r,{}),i]})}),O0=({onChange:e,value:t,emptyContent:n,initialParams:s,filter:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Mr({initialParams:s,filter:r}),{fetchMore:p,search:m}=tt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Channel",value:t,onChange:e,data:l,haulType:Mt,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...i,children:hc})},kt=({onChange:e,value:t,allowNone:n,emptyContent:s,initialParams:r,filter:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=Mr({initialParams:r,filter:i}),{fetchMore:m,search:h}=tt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Ot,{resourceName:"Channel",onChange:e,value:t,allowNone:n,emptyContent:s,onFetchMore:m,onSearch:h,data:a,getItem:d,subscribe:x,status:p,haulType:Mt,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...l,children:hc})},B0=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:x1,AliasProvider:Za,LinePlot:b0,SelectMultiple:O0,SelectSingle:kt,ZERO_FORM_VALUES:Nr,calculatedFormSchema:xc,formSchema:_r,resolveIcon:fc,useActiveRange:d1,useAlias:xr,useAliasSetter:Ma,useAliases:Na,useCalculatedForm:A0,useCalculationStatusSynchronizer:P0,useForm:T0,useList:Mr,useName:Ms},Symbol.toStringTag,{value:"Module"})),gc=({yDirection:e="up",...t})=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...t,keys:u.g.DIRECTIONS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"x",children:o.jsxRuntimeExports.jsx(f.Arrow.Right,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"y",children:e==="up"?o.jsxRuntimeExports.jsx(f.Arrow.Up,{}):o.jsxRuntimeExports.jsx(f.Arrow.Down,{})})]}),D0=Object.freeze(Object.defineProperty({__proto__:null,Select:gc},Symbol.toStringTag,{value:"Module"})),z0=e=>Oe({channel:M.zm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.deviceZ,async({changed:t})=>e(t))}),H0=()=>ut({name:"Device",retrieve:async({client:e,params:t})=>await e.hardware.devices.retrieve({key:t.key,includeStatus:!0}),listeners:[{channel:M.zm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.deviceZ,async({onChange:e,changed:t})=>e(n=>t.key!==n.key?n:t))},{channel:M.zm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.statusZ,async({changed:e,onChange:t})=>{t(n=>(e.details.device!==n.key||(n.status=e),n))})}]}),jc=Fe({name:"Devices",retrieve:async({client:e,params:t})=>await e.hardware.devices.retrieve({includeStatus:!0,...t}),retrieveByKey:async({client:e,key:t})=>await e.hardware.devices.retrieve({key:t,includeStatus:!0}),listeners:[{channel:M.zm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.deviceZ,async({onChange:e,changed:t})=>e(t.key,t))},{channel:M.zm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M.zm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.zm.statusZ,async({changed:e,onChange:t})=>{t(e.details.device,n=>n==null?n:{...n,status:e})})}]}),$0=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e);return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,className:u.CSS.BE("device","list-item"),justify:"between",align:"center",children:[o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(Ec,{status:n?.status}),n?.name]}),o.jsxRuntimeExports.jsx(sr,{level:"small",color:9,weight:450,style:{marginTop:"0.25rem"},gap:"tiny",children:n?.location.split(".").map(s=>o.jsxRuntimeExports.jsx(yn,{children:s},s))})]})}),V0=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,disabled:l,icon:a=o.jsxRuntimeExports.jsx(f.Device,{}),...c})=>{const{data:d,retrieve:x,getItem:p,subscribe:m,status:h}=jc({filter:n,initialParams:i}),{fetchMore:j,search:E}=tt.usePager({retrieve:x});return o.jsxRuntimeExports.jsx(Ot,{resourceName:"Device",value:t,onChange:e,data:d,getItem:p,subscribe:m,onFetchMore:j,onSearch:E,emptyContent:r,status:h,disabled:l,icon:a,...c,children:$0})},Ec=({status:e,tooltipLocation:t="right"})=>{const n=e?.variant??"disabled",s=e?.message??"Device Status Unknown";return o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:n,hideIcon:!0,level:"small",weight:450,children:s}),o.jsxRuntimeExports.jsx(er,{variant:n,className:u.CSS.BE("device","status-indicator")})]})},F0=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:V0,StatusIndicator:Ec,retrieve:H0,useList:jc,useSetSynchronizer:z0},Symbol.toStringTag,{value:"Module"})),yc=Fe({name:"Racks",retrieve:async({client:e,params:t})=>await e.hardware.racks.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.hardware.racks.retrieve({key:t}),listeners:[{channel:M.Vm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.statusZ,async({changed:e,onChange:t})=>t(e.details.rack,n=>n==null?n:{...n,status:e}))},{channel:M.Vm.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.keyZ,async({changed:e,onChange:t,client:n})=>t(e,(await n.hardware.racks.retrieve({key:e})).payload))},{channel:M.Vm.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.keyZ,async({changed:e,onDelete:t})=>t(e))}]}),Z0=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,align:"center",justify:"between",children:[o.jsxRuntimeExports.jsx(f.Text,{children:n?.name}),o.jsxRuntimeExports.jsx(Sc,{status:n?.status,tooltipLocation:"left"})]})}),K0=({value:e,onChange:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=yc({initialParams:{includeStatus:!0,...i},filter:n}),{fetchMore:m,search:h}=tt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Ot,{resourceName:"Driver",value:e,onChange:t,data:a,getItem:d,subscribe:x,onFetchMore:m,onSearch:h,emptyContent:r,status:p,icon:o.jsxRuntimeExports.jsx(f.Rack,{}),...l,children:Z0})},Sc=({status:e,tooltipLocation:t="right"})=>{const n=g.useRef(null),s=e?.variant??"disabled";return g.useEffect(()=>{if(s!=="success")return;const r=n.current;r&&(r.classList.remove(u.CSS.BEM("rack","heartbeat","beat")),requestAnimationFrame(()=>r.classList.add(u.CSS.BEM("rack","heartbeat","beat"))))},[e]),o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:s,hideIcon:!0,level:"small",weight:450,children:e?.message}),o.jsxRuntimeExports.jsx(f.Heart,{ref:n,className:u.CSS.BE("rack","heartbeat"),style:{color:Jo[s]}})]})},kr=e=>Oe({channel:M.Vm.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M.Vm.statusZ,async t=>{e(t.changed)})}),Y0=e=>{const t=nt(),[n,s]=g.useState(void 0);Ge(async i=>{if(t==null||e===0){s(void 0);return}const l=await t.hardware.racks.retrieve({key:e});i.aborted||s(l)},[t,e]);const r=g.useCallback(i=>{n==null||t==null||s(t.hardware.racks.sugar({...n.payload,status:i}))},[n,t]);return kr(r),n},W0=e=>{const t=nt(),[n,s]=g.useState(void 0);Ge(async i=>{if(t==null)return;const{status:l}=await t.hardware.racks.retrieve({key:e,includeStatus:!0});i.aborted||s(l)},[t]);const r=g.useCallback(i=>{i.details.rack===e&&s(i)},[e]);return kr(r),n},G0=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:K0,StatusIndicator:Sc,use:Y0,useList:yc,useStatus:W0,useStatusSynchronizer:kr},Symbol.toStringTag,{value:"Module"})),U0=e=>Oe({channel:M._m.COMMAND_CHANNEL_NAME,onChange:_.parsedHandler(M._m.commandZ,async t=>{e(t.changed)})}),q0=(e,t=se.z.unknown())=>Oe({channel:M._m.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M._m.statusZ(t),async n=>{e(n.changed)})}),X0=["start","stop"],Q0=e=>ut({name:"Task",retrieve:async({client:t,params:{key:n}})=>n==null?null:await t.hardware.tasks.retrieve({key:n,includeStatus:!0,schemas:e}),listeners:[{channel:M._m.SET_CHANNEL_NAME,onChange:_.parsedHandler(M._m.keyZ,async({client:t,changed:n,onChange:s,params:{key:r}})=>{r==null||n!==r||s(await t.hardware.tasks.retrieve({key:r,schemas:e}))})}]}),J0=Fe({name:"Task",retrieve:async({client:e,params:t})=>await e.hardware.tasks.retrieve({includeStatus:!0,...t}),retrieveByKey:async({client:e,key:t})=>await e.hardware.tasks.retrieve({key:t}),listeners:[{channel:M._m.SET_CHANNEL_NAME,onChange:_.parsedHandler(M._m.keyZ,async({client:e,changed:t,onChange:n})=>n(t,await e.hardware.tasks.retrieve({key:t})))},{channel:M._m.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M._m.keyZ,async({changed:e,onDelete:t})=>t(e))},{channel:M._m.STATUS_CHANNEL_NAME,onChange:_.parsedHandler(M._m.statusZ(se.z.unknown()),async({changed:e,onChange:t,client:n})=>{t(e.details.task,s=>s==null?s:n.hardware.tasks.sugar({...s,status:e}))})},{channel:M._m.COMMAND_CHANNEL_NAME,onChange:_.parsedHandler(M._m.commandZ,async({changed:e,onChange:t,client:n})=>{t(e.task,s=>s==null||!X0.includes(e.type)?s:n.hardware.tasks.sugar({...s,status:u._r.create({variant:"loading",message:"Executing command...",details:{task:e.task,running:!0,data:{}}})}))})}]}),ej=Object.freeze(Object.defineProperty({__proto__:null,createRetrieveQuery:Q0,useCommandSynchronizer:U0,useList:J0,useStatusSynchronizer:q0},Symbol.toStringTag,{value:"Module"})),Ps=new Error("Tab not found"),tj=new Error("Invalid Mosaic"),ls=(e,t,n="center",s,r)=>{if(e=st(e),s===void 0)return Mo(e,t);const i=ko(e,s);if(n==="center")return i.tabs||=[],r!==void 0&&r>=0&&r<=i.tabs.length?i.tabs.splice(r,0,t):i.tabs.push(t),i.selected=t.tabKey,e;const l=i.key*2,a=i.key*2+1,c=n==="top"||n==="left"?l:a;if(ko(e,c).key!==i.key)return ls(e,t,"center",c);if(i.tabs==null||i.tabs.length===0)return ls(e,t,"center",s);const[d,x,p]=lj(n);if(i.direction=p,i[d]={key:0,tabs:[t],selected:t.tabKey},i[x]={key:0,tabs:i.tabs,selected:i.selected},i.first==null||i.last==null)throw tj;return i.first.key=l,i.last.key=a,i.tabs=void 0,i.size=void 0,i.selected=void 0,e},nj=(e,t,n)=>{e=st(e);const[s,r]=Lt(e,t);if(s==null||r==null)throw Ps;return r.tabs=r.tabs?.map(i=>i.tabKey===t?n(i):i),e},Mo=(e,t)=>(e=st(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Mo(e.first,t):e.last!=null&&(e.last=Mo(e.last,t)),e)),as=e=>{e=st(e);const t=[];if(e.tabs!=null&&(e.selected=ke.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=as(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=as(e.last);e.last=n,t.push(...s)}return[e,t]},Lr=(e,t)=>{e=st(e);const[,n]=Lt(e,t);if(n==null)return[e,null];n.tabs=n.tabs?.filter(r=>r.tabKey!==t),n.selected=ke.resetSelection(n.selected,n.tabs),e=ij(e);const s=n.selected??cs(e);return[e,s]},cs=e=>e.selected!=null?e.selected:e.first!=null?cs(e.first):e.last!=null?cs(e.last):null,Rc=(e,t)=>{e=st(e);const[n,s]=Lt(e,t);if(n==null||s==null)throw Ps;return s.selected=t,e},Cc=(e,t,n,s,r)=>{e=st(e);const[i,l]=Lt(e,t);if(i==null||l==null)throw Ps;const[a,c]=Lr(e,t);return[ls(a,i,n,s,r),c]},Sn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Sn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Sn(e.last,t);if(n!=null)return n}},wc=(e,t,n)=>{const s=us(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},sj=(e,t,n)=>{e=st(e);const s=Sn(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,c={key:s.key*2+1,tabs:[i],selected:i.tabKey},d={key:l,tabs:s.tabs,selected:s.selected};return d.selected=ke.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=c,s.tabs=void 0,s.selected=void 0,e},oj=(e,t)=>{const n=Sn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},bc=(e,t,n)=>{e=st(e);const[,s]=Lt(e,t);if(s?.tabs==null)throw Ps;return s.tabs=ke.rename(t,n,s?.tabs??[]),e},rj=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,ko=(e,t)=>{const n=us(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:ko(e,s)},ij=e=>{let t=!0;for(;t;)[e,t]=Lo(e);return e=To(e,1),e},Lo=e=>{if(e.first==null||e.last==null)return[e,!1];if(Ni(e.first))return[_i(e.last),!0];if(Ni(e.last))return[_i(e.first),!0];let t,n;return[e.first,t]=Lo(e.first),[e.last,n]=Lo(e.last),[e,t||n]},_i=e=>(e.size=void 0,e),Ni=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Lt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(a=>a.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=Lt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=Lt(e.last,t);return[r,i]},us=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=us(e.first,t);return n??us(e.last,t)},lj=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")}},st=e=>M.m.copy(e),ds=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ds(e.first,t,n),e.last!=null&&ds(e.last,t,n),n),Po=(e,t)=>{t(e),e.first!=null&&Po(e.first,t),e.last!=null&&Po(e.last,t)},To=(e,t)=>(e=st(e),e.key=t,e.first!=null&&(e.first=To(e.first,t*2)),e.last!=null&&(e.last=To(e.last,t*2+1)),e);class vc{parent;stub;el;constructor(t={}){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 aj=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),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 r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},_c=({node:e,children:t})=>$l.createPortal(t,e.el),cj=Object.freeze(Object.defineProperty({__proto__:null,In:_c,Node:vc,Out:aj},Symbol.toStringTag,{value:"Module"})),xs=g.memo(({root:e,onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,activeTab:l,emptyContent:a,onSelect:c,onClose:d,onRename:x,onReorder:p,contextMenu:m,addTooltip:h,...j})=>{const{tabs:E,direction:S,first:R,last:v,key:y,size:C}=e,N={onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,onClose:d,contextMenu:m,onSelect:c,onRename:x,onReorder:p,activeTab:l,addTooltip:h},k=g.useCallback(([V])=>n(y,V),[n]),{props:A}=ea({direction:S,onResize:k,count:2,initialSizes:C!=null?[C]:void 0});let I={};y==1&&(I={...j,className:u.CSS(u.CSS.B("mosaic"))});let D;return E!==void 0?D=o.jsxRuntimeExports.jsx(Nc,{root:e,emptyContent:a,...I,...N}):R!=null&&v!=null?D=o.jsxRuntimeExports.jsxs(ta,{id:`mosaic-${y}`,align:"stretch",...A,...I,children:[o.jsxRuntimeExports.jsx(xs,{...N,root:R,onResize:n},R.key),o.jsxRuntimeExports.jsx(xs,{...N,root:v,onResize:n},v.key)]}):(D=null,console.warn("Mosaic tree is malformed")),D});xs.displayName="Mosaic";const ps="pluto-mosaic-tab-drop",Pr="pluto-mosaic-tab-create",uj=(e,t,n)=>{if(f.filterByType(f.FILE_TYPE,t).length>0&&n)return!0;const r=f.filterByType(ps,t).map(a=>a.key),i=e.filter(a=>!r.includes(a.tabKey)).length>0;return f.filterByType(Pr,t).length>0||r.length>0&&(i||e.length===0)},Nc=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,className:i,onReorder:l,onFileDrop:a,addTooltip:c,...d})=>{const{key:x,tabs:p}=e,[m,h]=g.useState(null),j=a!=null,E=g.useCallback(({items:D})=>uj(p,D,j),[p,j]),S=g.useCallback(({items:D,event:V})=>{if(V==null)return[];const z=xj(V);h(null);const B=f.filterByType(f.FILE_TYPE,D).length>0,{percents:$}=Mi(V),w=p.length===0?"center":ki($);if(B)return a?.(x,w,V),D;const P=f.filterByType(ps,D);if(P.length>0){const O=P.map(({key:H})=>H)[0];t(x,O,w,z)}const L=f.filterByType(Pr,D);if(L.length>0){const O=L.map(({key:H})=>H);n?.(x,w,O)}return P},[t,p.length]),R=g.useCallback(({event:D})=>{if(D==null)return;const{percents:V,inSelector:z}=Mi(D);let B=null;z||(B=p.length===0?"center":ki(V)),h(B)},[p.length]),{startDrag:v,...y}=f.useDragAndDrop({type:"Mosaic",canDrop:E,onDrop:S,onDragOver:R}),C=E(f.useDraggingState()),N=g.useCallback(()=>h(null),[]),k=g.useCallback((D,{tabKey:V})=>{v([{key:V,type:ps,elementID:D.currentTarget.id}])},[v]),A=g.useCallback(()=>n?.(x,"center"),[x]),I=x==1&&p.length==0;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:o.jsxRuntimeExports.jsxs(ke.Tabs,{id:`tab-${x}`,tabs:p,className:u.CSS(i,I&&m!=null&&u.CSS.M("drag-over")),onDragLeave:N,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:k,onCreate:A,addTooltip:c,...y,...d,children:[e.selected!=null&&r(p.find(D=>D.tabKey===e.selected)),C&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),m!=null&&o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:dj[m]})]})})});Nc.displayName="MosaicTabLeaf";const dj={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%"}},Mi=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{percents:{x:.5,y:.5},inSelector:!0}:{percents:{x:n/t.width,y:s/t.height},inSelector:!1}},xj=e=>{const t=e.target.closest(".pluto-tabs-selector__btn");if(t!=null)return Array.from(t.parentElement?.children??[]).indexOf(t)},pj=e=>e,mj=e=>1-e,ki=({x:e,y:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[pj(e),mj(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")},fj=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),r=new Set,i=ds(e,l=>l.tabs?.map(a=>{let c=s.current.get(a.tabKey);return a==null?null:(c==null&&(c=new vc({style:"width: 100%; height: 100%; position: relative;"}),c.el.addEventListener("click",()=>t?.(a.tabKey)),s.current.set(a.tabKey,c)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(_c,{node:c,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})).flat().filter(l=>l!=null);return s.current.forEach((l,a)=>!r.has(a)&&s.current.delete(a)),[s,i]},Ao=se.z.object({key:se.z.number(),tabs:se.z.array(ke.tabZ).optional(),selected:se.z.string().optional(),direction:u.g.direction.optional(),size:se.z.number().optional(),get first(){return Ao.optional()},get last(){return Ao.optional()}}),hj=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(as(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>Cc(m,x,p,d)[0]),onClose:d=>s(x=>Lr(x,d)[0]),onSelect:d=>s(x=>Rc(x,d)),onResize:(d,x)=>s(p=>wc(p,d,x)),onRename:e?(d,x)=>s(p=>bc(p,d,x)):void 0}},gj=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Pr,HAUL_DROP_TYPE:ps,Mosaic:xs,autoSelectTabs:as,canSplit:oj,findSelected:cs,findTabNode:Sn,forEachNode:Po,insertTab:ls,isEmpty:rj,mapNodes:ds,moveTab:Cc,nodeZ:Ao,removeTab:Lr,renameTab:bc,resizeNode:wc,selectTab:Rc,split:sj,updateTab:nj,use:hj,usePortal:fj},Symbol.toStringTag,{value:"Module"})),jj=({variant:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...n}),Ej=Object.freeze(Object.defineProperty({__proto__:null,Note:jj},Symbol.toStringTag,{value:"Module"})),io={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})},yj=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{gap:1.5,x:!0,className:u.CSS(u.CSS.B("macos-controls"),!n&&u.CSS.BM("macos-controls","blurred"),t),...a,children:[o.jsxRuntimeExports.jsx(lo,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:io.Close}),o.jsxRuntimeExports.jsx(lo,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:io.Minimize}),o.jsxRuntimeExports.jsx(lo,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:io.Maximize})]}),lo=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,...s}),Sj=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,contrast:l=2,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{pack:!0,...a,children:[o.jsxRuntimeExports.jsx(ao,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Subtract,{})}),o.jsxRuntimeExports.jsx(ao,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Box$1,{})}),o.jsxRuntimeExports.jsx(ao,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),ao=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Mc=u.S.getOS,Rj="Windows",Cj=({forceOS:e,visibleIfOS:t,...n})=>{const s=Mc({force:e,default:Rj});if(t!=null&&t!==s)return null;const r=s==="macOS"?yj:Sj;return o.jsxRuntimeExports.jsx(r,{...n})},wj=Object.freeze(Object.defineProperty({__proto__:null,Controls:Cj,use:Mc},Symbol.toStringTag,{value:"Module"})),bj=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},vj=Object.freeze(Object.defineProperty({__proto__:null,createComponent:bj},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:M.O.NOOP});const _j=({children:e,...t})=>{const{path:n}=f.useUnidirectional({type:M.Provider$1.TYPE,schema:M.providerStateZ,state:t});return o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})},Nj="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",kc=({children:e})=>{const{path:t}=f.useUnidirectional({type:_.BaseProvider.TYPE,schema:_.providerStateZ$2,state:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},Mj=new Set([u.r.UUID,u.r.JSON]),kj=e=>{if(e.equals(u.r.JSON))return o.jsxRuntimeExports.jsx(f.JSON,{});if(e.isInteger)return o.jsxRuntimeExports.jsx(f.Binary,{});if(e.isFloat)return o.jsxRuntimeExports.jsx(f.Decimal,{});if(e.equals(u.r.STRING)||e.equals(u.r.UUID))return o.jsxRuntimeExports.jsx(f.String,{});if(e.equals(u.r.TIMESTAMP))return o.jsxRuntimeExports.jsx(f.Time$1,{})},Lc=u.r.ALL.filter(e=>e!==u.r.UNKNOWN).map(e=>({key:e.toString(),name:Mj.has(e)?e.toString().toUpperCase():u.z.capitalize(e.toString()),icon:kj(e)})),Lj=Lc.filter(e=>!new u.r(e.key).isVariable),Pj=({hideVariableDensity:e=!1,...t})=>{const n=e?Lj:Lc;return o.jsxRuntimeExports.jsx(Mn,{...t,data:n,resourceName:"Data Type"})},Tj=Object.freeze(Object.defineProperty({__proto__:null,Provider:kc,SelectDataType:Pj},Symbol.toStringTag,{value:"Module"})),Aj=e=>{switch(e.variant){case"disabled":return e.details?.valid===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l12)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l7)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return e.details?.authority===M.Lm.ABSOLUTE_AUTHORITY?{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 schematic to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Pc=({source:e,sink:t,className:n,...s})=>{const r=f.useMemoDeepEqual({source:e,sink:t}),[,{status:i},l]=f.use$2({type:_.Chip.TYPE,schema:_.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:u.n.now(),details:{}}}});g.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const a=g.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:c,chipColor:d,buttonStyle:x,disabled:p}=Aj(i);return o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:a,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:c}),style:x,...s,children:o.jsxRuntimeExports.jsx(f.Circle,{color:d})})},Tc=g.createContext({needsControlOf:[]}),Ac=()=>g.use(Tc),Ij=({children:e,onStatusChange:t,...n})=>{const s=f.useMemoDeepEqual(n),[{path:r},{status:i,needsControlOf:l},a]=f.use$2({type:_.Controller.TYPE,schema:_.controllerStateZ,initialState:s});return g.useEffect(()=>{i!=null&&t?.(i)},[i,t]),g.useEffect(()=>{a(c=>({...c,...s}))},[s,a]),g.useEffect(()=>()=>t?.("released"),[]),o.jsxRuntimeExports.jsxs(Tc,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e}),";"]})},Ic=({colorSource:e,statusSource:t})=>{const n=f.useMemoDeepEqual({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=f.use$2({type:_.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:u.n.now(),details:{color:void 0}}},schema:_.indicatorStateZ});g.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return r.details?.color!=null?l=u.ir.colorZ.parse(r.details.color):s!=null&&!u.ir.isZero(s)?l=s:l="var(--pluto-gray-l10)",o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(f.Text,{children:r.message}),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.ir.cssString(l),flexGrow:1}})]})},Oj=e=>{const{needsControlOf:t}=Ac(),[,{states:n},s]=f.use$2({type:_.Legend.TYPE,schema:_.legendStateZ,initialState:{states:[],needsControlOf:t}});g.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=u.c.unique(n.map(l=>l.subject.key)).map(l=>{const a=n.find(c=>c.subject.key===l);if(a==null)throw new M.lt("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return o.jsxRuntimeExports.jsx(yr,{data:i,...e})},Oc=({children:e})=>{const[{path:t}]=f.use$2({type:_.StateProvider.TYPE,schema:_.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},Bj=Object.freeze(Object.defineProperty({__proto__:null,Chip:Pc,Controller:Ij,Indicator:Ic,Legend:Oj,StateProvider:Oc,useContext:Ac},Symbol.toStringTag,{value:"Module"})),Bc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Dj=Bc(kc),zj=Bc(f.Provider$4),Hj=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:a,haul:c,channelAlias:d,telem:x,color:p})=>o.jsxRuntimeExports.jsx(f.Provider$1,{...l,children:o.jsxRuntimeExports.jsx(f.Config,{...i,children:o.jsxRuntimeExports.jsx(f.Provider$2,{...c,children:o.jsxRuntimeExports.jsx(f.Provider$3,{url:s??Nj,enabled:n,children:o.jsxRuntimeExports.jsx(zj,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(_j,{...a,children:o.jsxRuntimeExports.jsx(f.Aggregator,{children:o.jsxRuntimeExports.jsx(pa,{connParams:t,children:o.jsxRuntimeExports.jsx(wa,{children:o.jsxRuntimeExports.jsx(Za,{...d,children:o.jsxRuntimeExports.jsx(Pe.Provider,{...p,children:o.jsxRuntimeExports.jsx(f.Provider,{...r,children:o.jsxRuntimeExports.jsx(Dj,{...x,children:o.jsxRuntimeExports.jsx(Oc,{children:e})})})})})})})})})})})})})}),$j=Object.freeze(Object.defineProperty({__proto__:null,Provider:Hj},Symbol.toStringTag,{value:"Module"})),Vj=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Fj=Object.freeze(Object.defineProperty({__proto__:null,Progress:Vj},Symbol.toStringTag,{value:"Module"})),Zj=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsxs(f.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(f.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l10)"}})]},i.key))})},Kj=Object.freeze(Object.defineProperty({__proto__:null,Steps:Zj},Symbol.toStringTag,{value:"Module"})),Yj=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=f.use$2({type:_.Table.TYPE,schema:_.Table.stateZ,initialState:{region:u.Ho.ZERO,visible:n}});g.useEffect(()=>{i(a=>({...a,visible:n}))},[n]);const l=Pn(a=>i(c=>({...c,region:a})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e})})})]})},Wj=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...a})=>o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...a,children:[r!=null&&o.jsxRuntimeExports.jsx(zc,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),Tr=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),Dc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Gj=e=>Dc[e],zc=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const a=f.useSyncedRef(e),c=g.useRef(e),d=Pe.useCursorDrag({onStart:g.useCallback(()=>{c.current=a.current},[]),onMove:g.useCallback(x=>s(c.current+u.Ho.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:u.CSS(u.CSS.BE("table","resizer"),u.CSS.dir(i),u.CSS.selected(t),f.CONTEXT_TARGET,t&&f.CONTEXT_SELECTED),style:{[u.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(f.Text,{full:"x",justify:"center",align:"center",square:!1,children:i==="x"?Dc[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.g.location(i)]:r+e},onDragStart:d,draggable:!0})]})},Uj=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const a=r;return r+=i,o.jsxRuntimeExports.jsx(zc,{onSelect:t,position:a,selected:e.includes(l),index:l,value:i,onChange:c=>s(c,l),direction:"x"},l)})]})},qj=Object.freeze(Object.defineProperty({__proto__:null,Cell:Tr,ColumnIndicators:Uj,Row:Wj,Table:Yj,getCellColumn:Gj},Symbol.toStringTag,{value:"Module"})),Hc=se.z.object({bounds:u.W.bounds,gradient:u.ir.gradientZ}),Ar={bounds:{lower:0,upper:1},gradient:[]},Li={size:"small",showDragHandle:!1},Pi={width:60},Xj=u.C.Scale.scale(0,1),Ir=({path:e})=>{const{set:t,get:n}=sn(),s=cr(`${e}.bounds`),r=Xj.scale(s);return o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(He,{inputProps:Li,style:Pi,label:"Lower",path:`${e}.bounds.lower`}),o.jsxRuntimeExports.jsx(ye,{path:`${e}.gradient`,label:"Gradient",align:"start",padHelpText:!1,children:({value:i,onChange:l})=>o.jsxRuntimeExports.jsx(Pe.GradientPicker,{value:M.m.copy(i),scale:r,onChange:a=>{const d={...n(`${e}.bounds`).value},x=a.map(S=>S.position),p=r.pos(Math.max(...x)),m=r.pos(Math.min(...x)),h=p>d.upper,j=m<d.lower;h&&(a[a.length-1].position=1,d.upper=p),j&&(a[0].position=0,d.lower=m);const E=a.map(S=>({...S,color:u.ir.hex(S.color)}));h||j?t(e,{bounds:d,gradient:E}):l(a.map(S=>({...S,color:u.ir.hex(S.color)})))}})}),o.jsxRuntimeExports.jsx(He,{inputProps:Li,style:Pi,label:"Upper",path:`${e}.bounds.upper`})]})},Qj=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:u.mr.NOTATIONS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"standard",children:"Standard"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"scientific",children:"Scientific"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"engineering",children:"Engineering"})]}),Jj=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Or=({path:e})=>{const{value:t,onChange:n}=yt(e),s=_.sourcePipelinePropsZ.parse(t.telem?.props),r=_.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=_.stringifyNumberProps.parse(s.segments.stringifier.props),l=_.rollingAverageProps.parse(s.segments.rollingAverage.props),a=h=>{const j=_.sourcePipeline("string",{connections:Jj,segments:{valueStream:_.streamChannelValue({channel:r.channel}),stringifier:_.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:_.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:j})},c=h=>a({valueStream:_.streamChannelValue({channel:h??0})}),d=h=>a({stringifier:_.stringifyNumber({...i,notation:h})}),x=h=>a({stringifier:_.stringifyNumber({...i,precision:h})}),p=h=>a({rollingAverage:_.rollingAverage({windowSize:h})});if(typeof r.channel!="number")throw new Error("Must pass in a channel by key to Value.TelemForm");const[m]=Ms(r.channel);return g.useEffect(()=>n({...t,tooltip:[m]}),[m]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:c})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(Qj,{value:i.notation,onChange:d})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},e2=_.Value.z.partial({color:!0}).extend({level:M.levelZ.optional()}),Br=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:a,notation:c,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m})=>{const h=f.useMemoDeepEqual({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:c,backgroundTelem:a,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m}),[,j,E]=f.use$2({aetherKey:e,type:_.Value.TYPE,schema:_.Value.z,initialState:h});return g.useEffect(()=>E(S=>({...S,...h})),[h]),{width:j.width??j.minWidth}},t2=Object.freeze(Object.defineProperty({__proto__:null,RedlineForm:Ir,TelemForm:Or,ZERO_READLINE:Ar,corePropsZ:e2,redlineZ:Hc,use:Br},Symbol.toStringTag,{value:"Module"})),n2="text",$c=se.z.object({value:se.z.string(),level:M.levelZ,weight:M.weightZ,align:u.K$1.x.or(u.K$1.center),backgroundColor:u.ir.crudeZ}),Vc=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:a,backgroundColor:c})=>{const d=p=>r(e,p),x=p=>t({level:l,value:p,weight:a,align:i,backgroundColor:c});return o.jsxRuntimeExports.jsx(Tr,{id:e,className:u.CSS(f.CONTEXT_TARGET,s&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","text")),selected:s,onClick:d,onContextMenu:d,style:{backgroundColor:u.ir.cssString(c)},children:o.jsxRuntimeExports.jsx(f.Editable,{level:l,value:n,weight:a,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},s2="value",Fc=se.z.object({telem:_.stringSourceSpecZ,redline:Hc,level:M.levelZ,color:se.z.string(),units:se.z.string()}),Zc=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:a,onSelect:c})=>{const{width:d}=Br({aetherKey:e,box:a,telem:t,level:n,color:s,backgroundTelem:_.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:_.scaleNumber({scale:u.C.Scale.scale(i).scale(0,1).transform}),gradient:_.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>c(e,p);return o.jsxRuntimeExports.jsx(Tr,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:d},className:u.CSS(f.CONTEXT_TARGET,l&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},o2={padding:"2rem"},co=e=>o.jsxRuntimeExports.jsx(f.Box,{...e,style:o2,y:!0}),r2=[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],Kc=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsx(Or,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsx(Ir,{path:"redline"})});default:return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Dr,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(Pe.Swatch,{value:r??u.ir.setAlpha(u.ir.ZERO,1),onChange:i,...a,bordered:!0})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(nn,{value:r,onChange:i,...a})})]})})}},[]),n=ke.useStatic({tabs:r2,content:t});return o.jsxRuntimeExports.jsx(ke.Tabs,{...n,size:"small"})},i2={padding:"2rem"},Yc=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,style:i2,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Dr,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(ur,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(nn,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(ye,{path:"weight",label:"Weight",padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(ca,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",hideIfNull:!0,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(ye,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(Pe.Swatch,{value:t,onChange:n})})]}),l2=[{key:"text",name:"Text",icon:o.jsxRuntimeExports.jsx(f.Text$3,{})},{key:"value",name:"Value",icon:o.jsxRuntimeExports.jsx(f.Channel,{})}],Dr=e=>o.jsxRuntimeExports.jsx(Mn,{...e,data:l2,resourceName:"Variant"}),a2=["text","value"],c2=se.z.enum(a2),u2={key:"value",name:"Value",Form:Kc,Cell:Zc,defaultProps:e=>({telem:_.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"}),redline:Ar,color:u.ir.hex(e.colors.gray.l10),level:"h5",units:""}),schema:Fc},d2={key:"text",name:"Text",Form:Yc,Cell:Vc,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:$c},x2={text:d2,value:u2},p2=Object.freeze(Object.defineProperty({__proto__:null,CELLS:x2,SelectVariant:Dr,TEXT_TYPE:n2,Text:Vc,TextForm:Yc,VALUE_TYPE:s2,Value:Zc,ValueForm:Kc,textPropsZ:$c,valuePropsZ:Fc,variantZ:c2},Symbol.toStringTag,{value:"Module"})),Ti=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=Ct(e,...n);return u.K.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Ai=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!m2({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.g.construct(t),a=u.g.swap(l);let c=bt(a,s[a]-e[a]);const d=u.Ho.loc(n,c);if(u.K$1.swap(t)===r){const x=u.Ho.loc(i,u.K$1.swap(c));Math.abs(d-x)<De&&(c=u.K$1.swap(c))}return{direction:a,length:d-e[a]+Pt(c,De)}},Io=se.z.object({direction:u.g.direction,length:se.z.number()}),Ct=(e,...t)=>{let n=e;for(const s of t)n=u.K.translate(n,s.direction,s.length);return n},Wc=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(h=>(r=u.K.translate(r,h.direction,h.length),r))];if(!s)return i;const l=t[0],a=bt(l.direction,l.length),c=Ii(a),d=4*(2-n**.5);i[0]=u.K.translate(i[0],{[l.direction]:-1*c*d,[u.g.swap(l.direction)]:0});const x=t[t.length-1],p=bt(x.direction,x.length),m=Ii(p);return i[i.length-1]=u.K.translate(i[i.length-1],{[x.direction]:m*d,[u.g.swap(x.direction)]:0}),i}catch{return[]}},De=10,Ii=e=>e==="top"||e==="left"?-1:1,Pt=(e,t)=>e==="top"||e==="left"?-t:t,bt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",gt=e=>bt(e.direction,e.length),m2=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.g.construct(n),r=t[s]-e[s];return Pt(n,r)<0},Kn=e=>({direction:u.g.construct(e),length:Pt(e,De)}),Oi={top:Kn("top"),bottom:Kn("bottom"),left:Kn("left"),right:Kn("right")},f2=4,h2=.25,Ts=e=>Oo(g2(Oo(e))),g2=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<f2){if(r===0||r===e.length-1)return!1;if(i<h2)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},Oo=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,a=r,c=gt(i),d=gt(s);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===De)return!1;const x=Pt(c,De),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<De?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}if(r===e.length-1){const l=r,a=r-1,c=gt(s),d=gt(i);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===De)return!1;const x=Pt(c,De),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<De?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?Oo(t):t},Kt=e=>Ts(j2(e)),j2=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,a=r,c={...Oi[i]},d=Ct(n,c);const x={...Oi[r]};let p=Ct(s,x);const m=Math.abs(d.x-p.x),h=Math.abs(d.y-p.y);m<2*De&&h<10&&(c.length-=m/2,x.length+=m/2,d=Ct(n,c),p=Ct(s,x));const j=[c],E=Ai({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});E!=null&&(j.push(E),d=Ct(d,E),l=gt(E),c=E);const S=Ai({sourceStumpTip:p,sourceOrientation:a,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});S!=null&&(p=Ct(p,S),a=bt(S.direction,S.length));const R=()=>{S!=null&&(S.length*=-1,j.push(S)),x.length*=-1,j.push(x)};if(u.K$1.swap(l)===r){const A=u.g.construct(l),I=(p[A]-d[A])/2;j.push({direction:A,length:I});const D=u.g.swap(A);return j.push({direction:D,length:p[D]-d[D]}),j.push({direction:A,length:I}),R(),j}const v=p[c.direction]-d[c.direction];let y=u.g.swap(c.direction);const C=d[y]-p[y];let N;bt(c.direction,v)===l&&bt(y,C)===a?N={direction:c.direction,length:v}:(N={direction:y,length:p[y]-d[y]},y=u.g.swap(y)),j.push(N);const k={direction:y,length:p[y]-d[y]};return j.push(k),R(),j},E2=e=>Ts(y2(e)),y2=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=u.g.swap(r.direction),l=gt(r);if(t===0){s.unshift({direction:i,length:n});const a=Pt(l,De);s.unshift({direction:r.direction,length:a}),t+=2,s[t]={...s[t],length:s[t].length-a}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:i,length:-n});const a=Pt(l,De);s.push({direction:r.direction,length:a}),s[t]={...s[t],length:s[t].length-a}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},S2=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},R2=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?S2(e,r):e.findIndex(r)},C2=({delta:e,segments:t})=>Ts(Gc(e,t,!1)),w2=({delta:e,segments:t})=>Ts(Gc(e,t,!0)),Gc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Di("x",e,s,n)),e.y!==0&&(s=Di("y",e,s,n)),s},Bi=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=gt(t),i=gt(s),l=Math.abs(s.length),a=Math.abs(t.length);return(l>a||l>De)&&r===i},Di=(e,t,n,s)=>{const r=u.g.swap(e),i=s?n.length-1:0,l=n[i];if(Bi(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<De?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const a=s?0:n.length-1,d=R2(n,p=>p.direction===e,s,i);if(d===a){const p=n[a];return Bi(e,p,t)?(n[a]={...p,length:p.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>p.length?n[i]={...l,length:l.length-t[e]}:n[a]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[d];return n[d]={...x,length:x.length-t[e]},n},b2=se.z.object({position:u.K.xy,zoom:se.z.number()}),Uc=se.z.object({color:u.ir.crudeZ,variant:se.z.string().optional(),segments:se.z.array(Io)}),v2=Uc.extend({key:se.z.string(),source:se.z.string(),target:se.z.string(),segments:se.z.array(Io),color:u.ir.crudeZ,id:se.z.string(),data:se.z.object({segments:se.z.array(Io),color:u.ir.crudeZ,variant:se.z.string().optional()}).optional(),selected:se.z.boolean(),sourceHandle:se.z.string().nullable().optional(),targetHandle:se.z.string().nullable().optional()}),_2=se.z.object({key:se.z.string(),position:u.K.xy,selected:se.z.boolean().optional(),zIndex:se.z.number().optional(),type:se.z.string().optional(),data:u.u.unknownZ.optional(),measured:se.z.object({width:se.z.number().optional(),height:se.z.number().optional()}).optional()}),zr=(e,t)=>e.map(n=>({id:n.key,type:"custom",zIndex:n.zIndex,measured:{...n.measured},position:{...n.position},selected:n.selected,data:{},dragHandle:t})),Hr=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),qc=e=>e.map(t=>({key:t.id,...t})),Xc=(e,t)=>e.map(n=>(n.data??={segments:[],color:t,variant:"pipe"},{key:n.id,segments:n.data?.segments??[],selected:n.selected??!1,color:n.data?.color??t,variant:n.data?.variant??"pipe",...n})),Qc=e=>({...e.position,zoom:e.zoom}),Jc=e=>({position:u.K.construct(e),zoom:e.zoom}),eu=(e,t)=>qc(t(zr(e))),ns=(e,t,n)=>Xc(t(Hr(e)),n),N2=(e,t="x")=>{if(e.length===0)return[];const n=u.K$1.construct(t),s=u.K$1.swap(n);return e.sort((r,i)=>u.Ho.loc(r.box,n)-u.Ho.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===s),c=r.handles.find(h=>h.orientation===n);if(a==null||c==null)return;const d=a.absolutePosition,x=c.absolutePosition,p=u.K.set(u.K.translation(x,d),t,0),m=u.K.translate(u.Ho.topLeft(r.box),p);r.box=u.Ho.construct(m,u.Ho.dims(r.box))}),e};function Me(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=Me(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var M2={value:()=>{}};function As(){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 ss(n)}function ss(e){this._=e}function k2(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}ss.prototype=As.prototype={constructor:ss,on:function(e,t){var n=this._,s=k2(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=L2(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=zi(n[r],e.name,t);else if(t==null)for(r in n)n[r]=zi(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ss(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function L2(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function zi(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=M2,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Bo="http://www.w3.org/1999/xhtml";const Hi={svg:"http://www.w3.org/2000/svg",xhtml:Bo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Is(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Hi.hasOwnProperty(t)?{space:Hi[t],local:e}:e}function P2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Bo&&t.documentElement.namespaceURI===Bo?t.createElement(e):t.createElementNS(n,e)}}function T2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tu(e){var t=Is(e);return(t.local?T2:P2)(t)}function A2(){}function $r(e){return e==null?A2:function(){return this.querySelector(e)}}function I2(e){typeof e!="function"&&(e=$r(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=new Array(l),c,d,x=0;x<l;++x)(c=i[x])&&(d=e.call(c,c.__data__,x,i))&&("__data__"in c&&(d.__data__=c.__data__),a[x]=d);return new Ve(s,this._parents)}function O2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function B2(){return[]}function nu(e){return e==null?B2:function(){return this.querySelectorAll(e)}}function D2(e){return function(){return O2(e.apply(this,arguments))}}function z2(e){typeof e=="function"?e=D2(e):e=nu(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&(s.push(e.call(c,c.__data__,d,l)),r.push(c));return new Ve(s,r)}function su(e){return function(){return this.matches(e)}}function ou(e){return function(t){return t.matches(e)}}var H2=Array.prototype.find;function $2(e){return function(){return H2.call(this.children,e)}}function V2(){return this.firstElementChild}function F2(e){return this.select(e==null?V2:$2(typeof e=="function"?e:ou(e)))}var Z2=Array.prototype.filter;function K2(){return Array.from(this.children)}function Y2(e){return function(){return Z2.call(this.children,e)}}function W2(e){return this.selectAll(e==null?K2:Y2(typeof e=="function"?e:ou(e)))}function G2(e){typeof e!="function"&&(e=su(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new Ve(s,this._parents)}function ru(e){return new Array(e.length)}function U2(){return new Ve(this._enter||this._groups.map(ru),this._parents)}function ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ms.prototype={constructor:ms,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 q2(e){return function(){return e}}function X2(e,t,n,s,r,i){for(var l=0,a,c=t.length,d=i.length;l<d;++l)(a=t[l])?(a.__data__=i[l],s[l]=a):n[l]=new ms(e,i[l]);for(;l<c;++l)(a=t[l])&&(r[l]=a)}function Q2(e,t,n,s,r,i,l){var a,c,d=new Map,x=t.length,p=i.length,m=new Array(x),h;for(a=0;a<x;++a)(c=t[a])&&(m[a]=h=l.call(c,c.__data__,a,t)+"",d.has(h)?r[a]=c:d.set(h,c));for(a=0;a<p;++a)h=l.call(e,i[a],a,i)+"",(c=d.get(h))?(s[a]=c,c.__data__=i[a],d.delete(h)):n[a]=new ms(e,i[a]);for(a=0;a<x;++a)(c=t[a])&&d.get(m[a])===c&&(r[a]=c)}function J2(e){return e.__data__}function e3(e,t){if(!arguments.length)return Array.from(this,J2);var n=t?Q2:X2,s=this._parents,r=this._groups;typeof e!="function"&&(e=q2(e));for(var i=r.length,l=new Array(i),a=new Array(i),c=new Array(i),d=0;d<i;++d){var x=s[d],p=r[d],m=p.length,h=t3(e.call(x,x&&x.__data__,d,s)),j=h.length,E=a[d]=new Array(j),S=l[d]=new Array(j),R=c[d]=new Array(m);n(x,p,E,S,R,h,t);for(var v=0,y=0,C,N;v<j;++v)if(C=E[v]){for(v>=y&&(y=v+1);!(N=S[y])&&++y<j;);C._next=N||null}}return l=new Ve(l,s),l._enter=a,l._exit=c,l}function t3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function n3(){return new Ve(this._exit||this._groups.map(ru),this._parents)}function s3(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function o3(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),a=new Array(r),c=0;c<l;++c)for(var d=n[c],x=s[c],p=d.length,m=a[c]=new Array(p),h,j=0;j<p;++j)(h=d[j]||x[j])&&(m[j]=h);for(;c<r;++c)a[c]=n[c];return new Ve(a,this._parents)}function r3(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function i3(e){e||(e=l3);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],a=l.length,c=r[i]=new Array(a),d,x=0;x<a;++x)(d=l[x])&&(c[x]=d);c.sort(t)}return new Ve(r,this._parents).order()}function l3(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function a3(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function c3(){return Array.from(this)}function u3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function d3(){let e=0;for(const t of this)++e;return e}function x3(){return!this.node()}function p3(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,a;i<l;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function m3(e){return function(){this.removeAttribute(e)}}function f3(e){return function(){this.removeAttributeNS(e.space,e.local)}}function h3(e,t){return function(){this.setAttribute(e,t)}}function g3(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function j3(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function E3(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 y3(e,t){var n=Is(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?f3:m3:typeof t=="function"?n.local?E3:j3:n.local?g3:h3)(n,t))}function iu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function S3(e){return function(){this.style.removeProperty(e)}}function R3(e,t,n){return function(){this.style.setProperty(e,t,n)}}function C3(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function w3(e,t,n){return arguments.length>1?this.each((t==null?S3:typeof t=="function"?C3:R3)(e,t,n??"")):Ut(this.node(),e)}function Ut(e,t){return e.style.getPropertyValue(t)||iu(e).getComputedStyle(e,null).getPropertyValue(t)}function b3(e){return function(){delete this[e]}}function v3(e,t){return function(){this[e]=t}}function _3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function N3(e,t){return arguments.length>1?this.each((t==null?b3:typeof t=="function"?_3:v3)(e,t)):this.node()[e]}function lu(e){return e.trim().split(/^|\s+/)}function Vr(e){return e.classList||new au(e)}function au(e){this._node=e,this._names=lu(e.getAttribute("class")||"")}au.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 cu(e,t){for(var n=Vr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function uu(e,t){for(var n=Vr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function M3(e){return function(){cu(this,e)}}function k3(e){return function(){uu(this,e)}}function L3(e,t){return function(){(t.apply(this,arguments)?cu:uu)(this,e)}}function P3(e,t){var n=lu(e+"");if(arguments.length<2){for(var s=Vr(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?L3:t?M3:k3)(n,t))}function T3(){this.textContent=""}function A3(e){return function(){this.textContent=e}}function I3(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function O3(e){return arguments.length?this.each(e==null?T3:(typeof e=="function"?I3:A3)(e)):this.node().textContent}function B3(){this.innerHTML=""}function D3(e){return function(){this.innerHTML=e}}function z3(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function H3(e){return arguments.length?this.each(e==null?B3:(typeof e=="function"?z3:D3)(e)):this.node().innerHTML}function $3(){this.nextSibling&&this.parentNode.appendChild(this)}function V3(){return this.each($3)}function F3(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z3(){return this.each(F3)}function K3(e){var t=typeof e=="function"?e:tu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Y3(){return null}function W3(e,t){var n=typeof e=="function"?e:tu(e),s=t==null?Y3:typeof t=="function"?t:$r(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function G3(){var e=this.parentNode;e&&e.removeChild(this)}function U3(){return this.each(G3)}function q3(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X3(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Q3(e){return this.select(e?X3:q3)}function J3(e){return arguments.length?this.property("__data__",e):this.node().__data__}function eE(e){return function(t){e.call(this,t,this.__data__)}}function tE(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 nE(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function sE(e,t,n){return function(){var s=this.__on,r,i=eE(t);if(s){for(var l=0,a=s.length;l<a;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function oE(e,t,n){var s=tE(e+""),r,i=s.length,l;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,d=a.length,x;c<d;++c)for(r=0,x=a[c];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(a=t?sE:nE,r=0;r<i;++r)this.each(a(s[r],t,n));return this}function du(e,t,n){var s=iu(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function rE(e,t){return function(){return du(this,e,t)}}function iE(e,t){return function(){return du(this,e,t.apply(this,arguments))}}function lE(e,t){return this.each((typeof t=="function"?iE:rE)(e,t))}function*aE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var xu=[null];function Ve(e,t){this._groups=e,this._parents=t}function An(){return new Ve([[document.documentElement]],xu)}function cE(){return this}Ve.prototype=An.prototype={constructor:Ve,select:I2,selectAll:z2,selectChild:F2,selectChildren:W2,filter:G2,data:e3,enter:U2,exit:n3,join:s3,merge:o3,selection:cE,order:r3,sort:i3,call:a3,nodes:c3,node:u3,size:d3,empty:x3,each:p3,attr:y3,style:w3,property:N3,classed:P3,text:O3,html:H3,raise:V3,lower:Z3,append:K3,insert:W3,remove:U3,clone:Q3,datum:J3,on:oE,dispatch:lE,[Symbol.iterator]:aE};function $e(e){return typeof e=="string"?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],xu)}function uE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ke(e,t){if(e=uE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const dE={passive:!1},Rn={capture:!0,passive:!1};function uo(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function pu(e){var t=e.document.documentElement,n=$e(e).on("dragstart.drag",Gt,Rn);"onselectstart"in t?n.on("selectstart.drag",Gt,Rn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mu(e,t){var n=e.document.documentElement,s=$e(e).on("dragstart.drag",null);t&&(s.on("click.drag",Gt,Rn),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 Yn=e=>()=>e;function Do(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:a,dx:c,dy:d,dispatch:x}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:x}})}Do.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xE(e){return!e.ctrlKey&&!e.button}function pE(){return this.parentNode}function mE(e,t){return t??{x:e.x,y:e.y}}function fE(){return navigator.maxTouchPoints||"ontouchstart"in this}function fu(){var e=xE,t=pE,n=mE,s=fE,r={},i=As("start","drag","end"),l=0,a,c,d,x,p=0;function m(C){C.on("mousedown.drag",h).filter(s).on("touchstart.drag",S).on("touchmove.drag",R,dE).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(C,N){if(!(x||!e.call(this,C,N))){var k=y(this,t.call(this,C,N),C,N,"mouse");k&&($e(C.view).on("mousemove.drag",j,Rn).on("mouseup.drag",E,Rn),pu(C.view),uo(C),d=!1,a=C.clientX,c=C.clientY,k("start",C))}}function j(C){if(Gt(C),!d){var N=C.clientX-a,k=C.clientY-c;d=N*N+k*k>p}r.mouse("drag",C)}function E(C){$e(C.view).on("mousemove.drag mouseup.drag",null),mu(C.view,d),Gt(C),r.mouse("end",C)}function S(C,N){if(e.call(this,C,N)){var k=C.changedTouches,A=t.call(this,C,N),I=k.length,D,V;for(D=0;D<I;++D)(V=y(this,A,C,N,k[D].identifier,k[D]))&&(uo(C),V("start",C,k[D]))}}function R(C){var N=C.changedTouches,k=N.length,A,I;for(A=0;A<k;++A)(I=r[N[A].identifier])&&(Gt(C),I("drag",C,N[A]))}function v(C){var N=C.changedTouches,k=N.length,A,I;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),A=0;A<k;++A)(I=r[N[A].identifier])&&(uo(C),I("end",C,N[A]))}function y(C,N,k,A,I,D){var V=i.copy(),z=Ke(D||k,N),B,$,w;if((w=n.call(C,new Do("beforestart",{sourceEvent:k,target:m,identifier:I,active:l,x:z[0],y:z[1],dx:0,dy:0,dispatch:V}),A))!=null)return B=w.x-z[0]||0,$=w.y-z[1]||0,function P(L,O,H){var F=z,Z;switch(L){case"start":r[I]=P,Z=l++;break;case"end":delete r[I],--l;case"drag":z=Ke(H||O,N),Z=l;break}V.call(L,C,new Do(L,{sourceEvent:O,subject:w,target:m,identifier:I,active:Z,x:z[0]+B,y:z[1]+$,dx:z[0]-F[0],dy:z[1]-F[1],dispatch:V}),A)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Yn(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:Yn(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:Yn(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Yn(!!C),m):s},m.on=function(){var C=i.on.apply(i,arguments);return C===i?m:C},m.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,m):Math.sqrt(p)},m}var qt=0,fn=0,dn=0,hu=1e3,fs,hn,hs=0,Tt=0,Os=0,Cn=typeof performance=="object"&&performance.now?performance:Date,gu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fr(){return Tt||(gu(hE),Tt=Cn.now()+Os)}function hE(){Tt=0}function gs(){this._call=this._time=this._next=null}gs.prototype=ju.prototype={constructor:gs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fr():+n)+(t==null?0:+t),!this._next&&hn!==this&&(hn?hn._next=this:fs=this,hn=this),this._call=e,this._time=n,zo()},stop:function(){this._call&&(this._call=null,this._time=1/0,zo())}};function ju(e,t,n){var s=new gs;return s.restart(e,t,n),s}function gE(){Fr(),++qt;for(var e=fs,t;e;)(t=Tt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--qt}function $i(){Tt=(hs=Cn.now())+Os,qt=fn=0;try{gE()}finally{qt=0,EE(),Tt=0}}function jE(){var e=Cn.now(),t=e-hs;t>hu&&(Os-=t,hs=e)}function EE(){for(var e,t=fs,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:fs=n);hn=e,zo(s)}function zo(e){if(!qt){fn&&(fn=clearTimeout(fn));var t=e-Tt;t>24?(e<1/0&&(fn=setTimeout($i,e-Cn.now()-Os)),dn&&(dn=clearInterval(dn))):(dn||(hs=Cn.now(),dn=setInterval(jE,hu)),qt=1,gu($i))}}function Vi(e,t,n){var s=new gs;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var yE=As("start","end","cancel","interrupt"),SE=[],Eu=0,Fi=1,Ho=2,os=3,Zi=4,$o=5,rs=6;function Bs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;RE(e,n,{name:t,index:s,group:r,on:yE,tween:SE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Eu})}function Zr(e,t){var n=qe(e,t);if(n.state>Eu)throw new Error("too late; already scheduled");return n}function ot(e,t){var n=qe(e,t);if(n.state>os)throw new Error("too late; already running");return n}function qe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function RE(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=ju(i,0,n.time);function i(d){n.state=Fi,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var x,p,m,h;if(n.state!==Fi)return c();for(x in s)if(h=s[x],h.name===n.name){if(h.state===os)return Vi(l);h.state===Zi?(h.state=rs,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[x]):+x<t&&(h.state=rs,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[x])}if(Vi(function(){n.state===os&&(n.state=Zi,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=Ho,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ho){for(n.state=os,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(h=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=h);r.length=p+1}}function a(d){for(var x=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=$o,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===$o&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=rs,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function is(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>Ho&&s.state<$o,s.state=rs,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function CE(e){return this.each(function(){is(this,e)})}function wE(e,t){var n,s;return function(){var r=ot(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,a=s.length;l<a;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function bE(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=ot(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var a={name:t,value:n},c=0,d=r.length;c<d;++c)if(r[c].name===t){r[c]=a;break}c===d&&r.push(a)}i.tween=r}}function vE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=qe(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?wE:bE)(n,e,t))}function Kr(e,t,n){var s=e._id;return e.each(function(){var r=ot(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return qe(r,s).value[t]}}function yu(e,t){var n;return(typeof t=="number"?_.interpolateNumber:t instanceof _.color?_.interpolateRgb:(n=_.color(t))?(t=n,_.interpolateRgb):_.interpolateString)(e,t)}function _E(e){return function(){this.removeAttribute(e)}}function NE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ME(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function kE(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function LE(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function PE(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function TE(e,t){var n=Is(e),s=n==="transform"?Xg:yu;return this.attrTween(e,typeof t=="function"?(n.local?PE:LE)(n,s,Kr(this,"attr."+e,t)):t==null?(n.local?NE:_E)(n):(n.local?kE:ME)(n,s,t))}function AE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function IE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function OE(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&IE(e,i)),n}return r._value=t,r}function BE(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&AE(e,i)),n}return r._value=t,r}function DE(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=Is(e);return this.tween(n,(s.local?OE:BE)(s,t))}function zE(e,t){return function(){Zr(this,e).delay=+t.apply(this,arguments)}}function HE(e,t){return t=+t,function(){Zr(this,e).delay=t}}function $E(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?zE:HE)(t,e)):qe(this.node(),t).delay}function VE(e,t){return function(){ot(this,e).duration=+t.apply(this,arguments)}}function FE(e,t){return t=+t,function(){ot(this,e).duration=t}}function ZE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?VE:FE)(t,e)):qe(this.node(),t).duration}function KE(e,t){if(typeof t!="function")throw new Error;return function(){ot(this,e).ease=t}}function YE(e){var t=this._id;return arguments.length?this.each(KE(t,e)):qe(this.node(),t).ease}function WE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ot(this,e).ease=n}}function GE(e){if(typeof e!="function")throw new Error;return this.each(WE(this._id,e))}function UE(e){typeof e!="function"&&(e=su(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new ct(s,this._parents,this._name,this._id)}function qE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),a=0;a<i;++a)for(var c=t[a],d=n[a],x=c.length,p=l[a]=new Array(x),m,h=0;h<x;++h)(m=c[h]||d[h])&&(p[h]=m);for(;a<s;++a)l[a]=t[a];return new ct(l,this._parents,this._name,this._id)}function XE(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 QE(e,t,n){var s,r,i=XE(t)?Zr:ot;return function(){var l=i(this,e),a=l.on;a!==s&&(r=(s=a).copy()).on(t,n),l.on=r}}function JE(e,t){var n=this._id;return arguments.length<2?qe(this.node(),n).on.on(e):this.each(QE(n,e,t))}function e5(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function t5(){return this.on("end.remove",e5(this._id))}function n5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$r(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var a=s[l],c=a.length,d=i[l]=new Array(c),x,p,m=0;m<c;++m)(x=a[m])&&(p=e.call(x,x.__data__,m,a))&&("__data__"in x&&(p.__data__=x.__data__),d[m]=p,Bs(d[m],t,n,m,d,qe(x,n)));return new ct(i,this._parents,t,n)}function s5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nu(e));for(var s=this._groups,r=s.length,i=[],l=[],a=0;a<r;++a)for(var c=s[a],d=c.length,x,p=0;p<d;++p)if(x=c[p]){for(var m=e.call(x,x.__data__,p,c),h,j=qe(x,n),E=0,S=m.length;E<S;++E)(h=m[E])&&Bs(h,t,n,E,m,j);i.push(m),l.push(x)}return new ct(i,l,t,n)}var o5=An.prototype.constructor;function r5(){return new o5(this._groups,this._parents)}function i5(e,t){var n,s,r;return function(){var i=Ut(this,e),l=(this.style.removeProperty(e),Ut(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function Su(e){return function(){this.style.removeProperty(e)}}function l5(e,t,n){var s,r=n+"",i;return function(){var l=Ut(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function a5(e,t,n){var s,r,i;return function(){var l=Ut(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Ut(this,e))),l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a))}}function c5(e,t){var n,s,r,i="style."+t,l="end."+i,a;return function(){var c=ot(this,e),d=c.on,x=c.value[i]==null?a||(a=Su(t)):void 0;(d!==n||r!==x)&&(s=(n=d).copy()).on(l,r=x),c.on=s}}function u5(e,t,n){var s=(e+="")=="transform"?qg:yu;return t==null?this.styleTween(e,i5(e,s)).on("end.style."+e,Su(e)):typeof t=="function"?this.styleTween(e,a5(e,s,Kr(this,"style."+e,t))).each(c5(this._id,e)):this.styleTween(e,l5(e,s,t),n).on("end.style."+e,null)}function d5(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function x5(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&d5(e,l,n)),s}return i._value=t,i}function p5(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,x5(e,t,n??""))}function m5(e){return function(){this.textContent=e}}function f5(e){return function(){var t=e(this);this.textContent=t??""}}function h5(e){return this.tween("text",typeof e=="function"?f5(Kr(this,"text",e)):m5(e==null?"":e+""))}function g5(e){return function(t){this.textContent=e.call(this,t)}}function j5(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&g5(r)),t}return s._value=e,s}function E5(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,j5(e))}function y5(){for(var e=this._name,t=this._id,n=Ru(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)if(c=l[d]){var x=qe(c,t);Bs(c,e,n,d,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new ct(s,this._parents,e,n)}function S5(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var a={value:l},c={value:function(){--r===0&&i()}};n.each(function(){var d=ot(this,s),x=d.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),d.on=t}),r===0&&i()})}var R5=0;function ct(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Ru(){return++R5}var rt=An.prototype;ct.prototype={constructor:ct,select:n5,selectAll:s5,selectChild:rt.selectChild,selectChildren:rt.selectChildren,filter:UE,merge:qE,selection:r5,transition:y5,call:rt.call,nodes:rt.nodes,node:rt.node,size:rt.size,empty:rt.empty,each:rt.each,on:JE,attr:TE,attrTween:DE,style:u5,styleTween:p5,text:h5,textTween:E5,remove:t5,tween:vE,delay:$E,duration:ZE,ease:YE,easeVarying:GE,end:S5,[Symbol.iterator]:rt[Symbol.iterator]};function C5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var w5={time:null,delay:0,duration:250,ease:C5};function b5(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 v5(e){var t,n;e instanceof ct?(t=e._id,e=e._name):(t=Ru(),(n=w5).time=Fr(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&Bs(c,e,t,d,l,n||b5(c,t));return new ct(s,this._parents,e,t)}An.prototype.interrupt=CE;An.prototype.transition=v5;const Wn=e=>()=>e;function _5(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function lt(e,t,n){this.k=e,this.x=t,this.y=n}lt.prototype={constructor:lt,scale:function(e){return e===1?this:new lt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new lt(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 Ds=new lt(1,0,0);Cu.prototype=lt.prototype;function Cu(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ds;return e.__zoom}function xo(e){e.stopImmediatePropagation()}function xn(e){e.preventDefault(),e.stopImmediatePropagation()}function N5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function M5(){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 Ki(){return this.__zoom||Ds}function k5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L5(){return navigator.maxTouchPoints||"ontouchstart"in this}function P5(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function wu(){var e=N5,t=M5,n=P5,s=k5,r=L5,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],a=250,c=ts,d=As("start","zoom","end"),x,p,m,h=500,j=150,E=0,S=10;function R(w){w.property("__zoom",Ki).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(w,P,L,O){var H=w.selection?w.selection():w;H.property("__zoom",Ki),w!==H?N(w,P,L,O):H.interrupt().each(function(){k(this,arguments).event(O).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},R.scaleBy=function(w,P,L,O){R.scaleTo(w,function(){var H=this.__zoom.k,F=typeof P=="function"?P.apply(this,arguments):P;return H*F},L,O)},R.scaleTo=function(w,P,L,O){R.transform(w,function(){var H=t.apply(this,arguments),F=this.__zoom,Z=L==null?C(H):typeof L=="function"?L.apply(this,arguments):L,K=F.invert(Z),X=typeof P=="function"?P.apply(this,arguments):P;return n(y(v(F,X),Z,K),H,l)},L,O)},R.translateBy=function(w,P,L,O){R.transform(w,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),l)},null,O)},R.translateTo=function(w,P,L,O,H){R.transform(w,function(){var F=t.apply(this,arguments),Z=this.__zoom,K=O==null?C(F):typeof O=="function"?O.apply(this,arguments):O;return n(Ds.translate(K[0],K[1]).scale(Z.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof L=="function"?-L.apply(this,arguments):-L),F,l)},O,H)};function v(w,P){return P=Math.max(i[0],Math.min(i[1],P)),P===w.k?w:new lt(P,w.x,w.y)}function y(w,P,L){var O=P[0]-L[0]*w.k,H=P[1]-L[1]*w.k;return O===w.x&&H===w.y?w:new lt(w.k,O,H)}function C(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function N(w,P,L,O){w.on("start.zoom",function(){k(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(O).end()}).tween("zoom",function(){var H=this,F=arguments,Z=k(H,F).event(O),K=t.apply(H,F),X=L==null?C(K):typeof L=="function"?L.apply(H,F):L,oe=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),J=H.__zoom,ae=typeof P=="function"?P.apply(H,F):P,te=c(J.invert(X).concat(oe/J.k),ae.invert(X).concat(oe/ae.k));return function(ne){if(ne===1)ne=ae;else{var ee=te(ne),re=oe/ee[2];ne=new lt(re,X[0]-ee[0]*re,X[1]-ee[1]*re)}Z.zoom(null,ne)}})}function k(w,P,L){return!L&&w.__zooming||new A(w,P)}function A(w,P){this.that=w,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,P),this.taps=0}A.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,P){return this.mouse&&w!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var P=$e(this.that).datum();d.call(w,this.that,new _5(w,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:d}),P)}};function I(w,...P){if(!e.apply(this,arguments))return;var L=k(this,P).event(w),O=this.__zoom,H=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,s.apply(this,arguments)))),F=Ke(w);if(L.wheel)(L.mouse[0][0]!==F[0]||L.mouse[0][1]!==F[1])&&(L.mouse[1]=O.invert(L.mouse[0]=F)),clearTimeout(L.wheel);else{if(O.k===H)return;L.mouse=[F,O.invert(F)],is(this),L.start()}xn(w),L.wheel=setTimeout(Z,j),L.zoom("mouse",n(y(v(O,H),L.mouse[0],L.mouse[1]),L.extent,l));function Z(){L.wheel=null,L.end()}}function D(w,...P){if(m||!e.apply(this,arguments))return;var L=w.currentTarget,O=k(this,P,!0).event(w),H=$e(w.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",oe,!0),F=Ke(w,L),Z=w.clientX,K=w.clientY;pu(w.view),xo(w),O.mouse=[F,this.__zoom.invert(F)],is(this),O.start();function X(J){if(xn(J),!O.moved){var ae=J.clientX-Z,te=J.clientY-K;O.moved=ae*ae+te*te>E}O.event(J).zoom("mouse",n(y(O.that.__zoom,O.mouse[0]=Ke(J,L),O.mouse[1]),O.extent,l))}function oe(J){H.on("mousemove.zoom mouseup.zoom",null),mu(J.view,O.moved),xn(J),O.event(J).end()}}function V(w,...P){if(e.apply(this,arguments)){var L=this.__zoom,O=Ke(w.changedTouches?w.changedTouches[0]:w,this),H=L.invert(O),F=L.k*(w.shiftKey?.5:2),Z=n(y(v(L,F),O,H),t.apply(this,P),l);xn(w),a>0?$e(this).transition().duration(a).call(N,Z,O,w):$e(this).call(R.transform,Z,O,w)}}function z(w,...P){if(e.apply(this,arguments)){var L=w.touches,O=L.length,H=k(this,P,w.changedTouches.length===O).event(w),F,Z,K,X;for(xo(w),Z=0;Z<O;++Z)K=L[Z],X=Ke(K,this),X=[X,this.__zoom.invert(X),K.identifier],H.touch0?!H.touch1&&H.touch0[2]!==X[2]&&(H.touch1=X,H.taps=0):(H.touch0=X,F=!0,H.taps=1+!!x);x&&(x=clearTimeout(x)),F&&(H.taps<2&&(p=X[0],x=setTimeout(function(){x=null},h)),is(this),H.start())}}function B(w,...P){if(this.__zooming){var L=k(this,P).event(w),O=w.changedTouches,H=O.length,F,Z,K,X;for(xn(w),F=0;F<H;++F)Z=O[F],K=Ke(Z,this),L.touch0&&L.touch0[2]===Z.identifier?L.touch0[0]=K:L.touch1&&L.touch1[2]===Z.identifier&&(L.touch1[0]=K);if(Z=L.that.__zoom,L.touch1){var oe=L.touch0[0],J=L.touch0[1],ae=L.touch1[0],te=L.touch1[1],ne=(ne=ae[0]-oe[0])*ne+(ne=ae[1]-oe[1])*ne,ee=(ee=te[0]-J[0])*ee+(ee=te[1]-J[1])*ee;Z=v(Z,Math.sqrt(ne/ee)),K=[(oe[0]+ae[0])/2,(oe[1]+ae[1])/2],X=[(J[0]+te[0])/2,(J[1]+te[1])/2]}else if(L.touch0)K=L.touch0[0],X=L.touch0[1];else return;L.zoom("touch",n(y(Z,K,X),L.extent,l))}}function $(w,...P){if(this.__zooming){var L=k(this,P).event(w),O=w.changedTouches,H=O.length,F,Z;for(xo(w),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),F=0;F<H;++F)Z=O[F],L.touch0&&L.touch0[2]===Z.identifier?delete L.touch0:L.touch1&&L.touch1[2]===Z.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(Z=Ke(Z,this),Math.hypot(p[0]-Z[0],p[1]-Z[1])<S)){var K=$e(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return R.wheelDelta=function(w){return arguments.length?(s=typeof w=="function"?w:Wn(+w),R):s},R.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Wn(!!w),R):e},R.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Wn(!!w),R):r},R.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Wn([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),R):t},R.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],R):[i[0],i[1]]},R.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(w){return arguments.length?(n=w,R):n},R.duration=function(w){return arguments.length?(a=+w,R):a},R.interpolate=function(w){return arguments.length?(c=w,R):c},R.on=function(){var w=d.on.apply(d,arguments);return w===d?R:w},R.clickDistance=function(w){return arguments.length?(E=(w=+w)*w,R):Math.sqrt(E)},R.tapDistance=function(w){return arguments.length?(S=+w,R):S},R}const Ie={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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},wn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bu=["Enter"," ","Escape"],vu={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var At;(function(e){e.Strict="strict",e.Loose="loose"})(At||(At={}));var vt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(vt||(vt={}));var Xt;(function(e){e.Partial="partial",e.Full="full"})(Xt||(Xt={}));const _u={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ht;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ht||(ht={}));var js;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(js||(js={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Yi={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function Nu(e){return e===null?null:e?"valid":"invalid"}const Mu=e=>"id"in e&&"source"in e&&"target"in e,T5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Yr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),In=(e,t=[0,0])=>{const{width:n,height:s}=dt(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},A5=(e,t={nodeOrigin:[0,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,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):Yr(r)?r:t.nodeLookup.get(r.id));const a=l?Es(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return zs(s,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hs(n)},On=(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 r=Es(s);n=zs(n,r)}}),Hs(n)},Wr=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const a={...Bn(t,[n,s,r]),width:t.width/r,height:t.height/r},c=[];for(const d of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=d;if(l&&!p||m)continue;const h=x.width??d.width??d.initialWidth??null,j=x.height??d.height??d.initialHeight??null,E=bn(a,Jt(d)),S=(h??0)*(j??0),R=i&&E>0;(!d.internals.handleBounds||R||E>=S||d.dragging)&&c.push(d)}return c},I5=(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 O5(e,t){const n=new Map,s=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function B5({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const a=O5(e,l),c=On(a),d=Gr(c,t,n,l?.minZoom??r,l?.maxZoom??i,l?.padding??.1);return await s.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function ku({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const l=n.get(e),a=l.parentId?n.get(l.parentId):void 0,{x:c,y:d}=a?a.internals.positionAbsolute:{x:0,y:0},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!a)i?.("005",Ie.error005());else{const h=a.measured.width,j=a.measured.height;h&&j&&(p=[[c,d],[c+h,d+j]])}else a&&en(l.extent)&&(p=[[l.extent[0][0]+c,l.extent[0][1]+d],[l.extent[1][0]+c,l.extent[1][1]+d]]);const m=en(p)?It(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Ie.error015()),{position:{x:m.x-c+(l.measured.width??0)*x[0],y:m.y-d+(l.measured.height??0)*x[1]},positionAbsolute:m}}async function D5({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const h=i.has(m.id),j=!h&&m.parentId&&l.find(E=>E.id===m.parentId);(h||j)&&l.push(m)}const a=new Set(t.map(m=>m.id)),c=s.filter(m=>m.deletable!==!1),x=I5(l,c);for(const m of c)a.has(m.id)&&!x.find(j=>j.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const Qt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),It=(e={x:0,y:0},t,n)=>({x:Qt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Qt(e.y,t[0][1],t[1][1]-(n?.height??0))});function Lu(e,t,n){const{width:s,height:r}=dt(n),{x:i,y:l}=n.internals.positionAbsolute;return It(e,[[i,l],[i+s,l+r]],t)}const Wi=(e,t,n)=>e<t?Qt(Math.abs(e-t),1,t)/t:e>n?-Qt(Math.abs(e-n),1,t)/t:0,Pu=(e,t,n=15,s=40)=>{const r=Wi(e.x,s,t.width-s)*n,i=Wi(e.y,s,t.height-s)*n;return[r,i]},zs=(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)}),Vo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Hs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Jt=(e,t=[0,0])=>{const{x:n,y:s}=Yr(e)?e.internals.positionAbsolute:In(e,t);return{x:n,y:s,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Es=(e,t=[0,0])=>{const{x:n,y:s}=Yr(e)?e.internals.positionAbsolute:In(e,t);return{x:n,y:s,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:s+(e.measured?.height??e.height??e.initialHeight??0)}},Tu=(e,t)=>Hs(zs(Vo(e),Vo(t))),bn=(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)},Gi=e=>Ye(e.width)&&Ye(e.height)&&Ye(e.x)&&Ye(e.y),Ye=e=>!isNaN(e)&&isFinite(e),ys=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},$s=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Bn=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const a={x:(e-n)/r,y:(t-s)/r};return i?$s(a,l):a},Ss=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function Zt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function z5(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=Zt(e,n),r=Zt(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=Zt(e.top??e.y??0,n),r=Zt(e.bottom??e.y??0,n),i=Zt(e.left??e.x??0,t),l=Zt(e.right??e.x??0,t);return{top:s,right:l,bottom:r,left:i,x:i+l,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function H5(e,t,n,s,r,i){const{x:l,y:a}=Ss(e,[t,n,s]),{x:c,y:d}=Ss({x:e.x+e.width,y:e.y+e.height},[t,n,s]),x=r-c,p=i-d;return{left:Math.floor(l),top:Math.floor(a),right:Math.floor(x),bottom:Math.floor(p)}}const Gr=(e,t,n,s,r,i)=>{const l=z5(i,t,n),a=(t-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(a,c),x=Qt(d,s,r),p=e.x+e.width/2,m=e.y+e.height/2,h=t/2-p*x,j=n/2-m*x,E=H5(e,h,j,x,t,n),S={left:Math.min(E.left-l.left,0),top:Math.min(E.top-l.top,0),right:Math.min(E.right-l.right,0),bottom:Math.min(E.bottom-l.bottom,0)};return{x:h-S.left+S.right,y:j-S.top+S.bottom,zoom:x}},Rs=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function en(e){return e!==void 0&&e!=="parent"}function dt(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Au(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Iu(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const a=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Ui(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function $5(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function V5(e){return{...vu,...e||{}}}function jn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=Je(e),a=Bn({x:i-(r?.left??0),y:l-(r?.top??0)},s),{x:c,y:d}=n?$s(a,t):a;return{xSnapped:c,ySnapped:d,...a}}const Ur=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ou=e=>e?.getRootNode?.()||window?.document,F5=["INPUT","SELECT","TEXTAREA"];function Bu(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:F5.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Du=e=>"clientX"in e,Je=(e,t)=>{const n=Du(e),s=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:s-(t?.left??0),y:r-(t?.top??0)}},qi=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const a=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(a.left-n.left)/s,y:(a.top-n.top)/s,...Ur(l)}})};function zu({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:a}){const c=e*.125+r*.375+l*.375+n*.125,d=t*.125+i*.375+a*.375+s*.125,x=Math.abs(c-e),p=Math.abs(d-t);return[c,d,x,p]}function Gn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xi({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Q.Left:return[t-Gn(t-s,i),n];case Q.Right:return[t+Gn(s-t,i),n];case Q.Top:return[t,n-Gn(n-r,i)];case Q.Bottom:return[t,n+Gn(r-n,i)]}}function Hu({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,curvature:l=.25}){const[a,c]=Xi({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[d,x]=Xi({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,h,j]=zu({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:x});return[`M${e},${t} C${a},${c} ${d},${x} ${s},${r}`,p,m,h,j]}function $u({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,a=s<t?s+l:s-l;return[i,a,r,l]}function Z5({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:r=!1}){if(s!==void 0)return s;const i=r&&n?1e3:0,l=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+l}function K5({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=zs(Es(e),Es(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return bn(l,Hs(i))>0}const Vu=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Y5=(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)),Fu=(e,t)=>{if(!e.source||!e.target)return ys("006",Ie.error006()),t;let n;return Mu(e)?n={...e}:n={...e,id:Vu(e)},Y5(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},W5=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return ys("006",Ie.error006()),n;if(!n.find(c=>c.id===e.id))return ys("007",Ie.error007(r)),n;const a={...i,id:s.shouldReplaceId?Vu(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(c=>c.id!==r).concat(a)};function Zu({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,a]=$u({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,a]}const Qi={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},G5=({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},Ji=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function U5({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:s=Q.Top,center:r,offset:i}){const l=Qi[t],a=Qi[s],c={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+a.x*i,y:n.y+a.y*i},x=G5({source:c,sourcePosition:t,target:d}),p=x.x!==0?"x":"y",m=x[p];let h=[],j,E;const S={x:0,y:0},R={x:0,y:0},[v,y,C,N]=$u({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*a[p]===-1){j=r.x??v,E=r.y??y;const A=[{x:j,y:c.y},{x:j,y:d.y}],I=[{x:c.x,y:E},{x:d.x,y:E}];l[p]===m?h=p==="x"?A:I:h=p==="x"?I:A}else{const A=[{x:c.x,y:d.y}],I=[{x:d.x,y:c.y}];if(p==="x"?h=l.x===m?I:A:h=l.y===m?A:I,t===s){const $=Math.abs(e[p]-n[p]);if($<=i){const w=Math.min(i-1,i-$);l[p]===m?S[p]=(c[p]>e[p]?-1:1)*w:R[p]=(d[p]>n[p]?-1:1)*w}}if(t!==s){const $=p==="x"?"y":"x",w=l[p]===a[$],P=c[$]>d[$],L=c[$]<d[$];(l[p]===1&&(!w&&P||w&&L)||l[p]!==1&&(!w&&L||w&&P))&&(h=p==="x"?A:I)}const D={x:c.x+S.x,y:c.y+S.y},V={x:d.x+R.x,y:d.y+R.y},z=Math.max(Math.abs(D.x-h[0].x),Math.abs(V.x-h[0].x)),B=Math.max(Math.abs(D.y-h[0].y),Math.abs(V.y-h[0].y));z>=B?(j=(D.x+V.x)/2,E=h[0].y):(j=h[0].x,E=(D.y+V.y)/2)}return[[e,{x:c.x+S.x,y:c.y+S.y},...h,{x:d.x+R.x,y:d.y+R.y},n],j,E,C,N]}function q5(e,t,n,s){const r=Math.min(Ji(e,t)/2,Ji(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*d},${l}Q ${i},${l} ${i},${l+r*x}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${l+r*c}Q ${i},${l} ${i+r*a},${l}`}function Fo({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,borderRadius:l=5,centerX:a,centerY:c,offset:d=20}){const[x,p,m,h,j]=U5({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:a,y:c},offset:d});return[x.reduce((S,R,v)=>{let y="";return v>0&&v<x.length-1?y=q5(x[v-1],R,x[v+1],l):y=`${v===0?"M":"L"}${R.x} ${R.y}`,S+=y,S},""),p,m,h,j]}function el(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function X5(e){const{sourceNode:t,targetNode:n}=e;if(!el(t)||!el(n))return null;const s=t.internals.handleBounds||tl(t.handles),r=n.internals.handleBounds||tl(n.handles),i=nl(s?.source??[],e.sourceHandle),l=nl(e.connectionMode===At.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!l)return e.onError?.("008",Ie.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Q.Bottom,c=l?.position||Q.Top,d=vn(t,i,a),x=vn(n,l,c);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:a,targetPosition:c}}function tl(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 vn(e,t,n=Q.Left,s=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:a}=t??dt(e);if(s)return{x:r+l/2,y:i+a/2};switch(t?.position??n){case Q.Top:return{x:r+l/2,y:i};case Q.Right:return{x:r+l,y:i+a/2};case Q.Bottom:return{x:r+l/2,y:i+a};case Q.Left:return{x:r,y:i+a/2}}}function nl(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Zo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Q5(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,a)=>([a.markerStart||s,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const d=Zo(c,t);i.has(d)||(l.push({id:d,color:c.color||n,...c}),i.add(d))}}),l),[]).sort((l,a)=>l.id.localeCompare(a.id))}const qr={nodeOrigin:[0,0],nodeExtent:wn,elevateNodesOnSelect:!0,defaults:{}},J5={...qr,checkEquality:!0};function Xr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function ey(e,t,n){const s=Xr(qr,n);for(const r of e.values())if(r.parentId)Qr(r,e,t,s);else{const i=In(r,s.nodeOrigin),l=en(r.extent)?r.extent:s.nodeExtent,a=It(i,l,dt(r));r.internals.positionAbsolute=a}}function Ko(e,t,n,s){const r=Xr(J5,s);let i=e.length>0;const l=new Map(t),a=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let d=l.get(c.id);if(r.checkEquality&&c===d?.internals.userNode)t.set(c.id,d);else{const x=In(c,r.nodeOrigin),p=en(c.extent)?c.extent:r.nodeExtent,m=It(x,p,dt(c));d={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:m,handleBounds:c.measured?d?.internals.handleBounds:void 0,z:Ku(c,a),userNode:c}},t.set(c.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(i=!1),c.parentId&&Qr(d,t,n,s)}return i}function ty(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 Qr(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=Xr(qr,s),a=e.parentId,c=t.get(a);if(!c){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ty(e,n);const d=r?1e3:0,{x,y:p,z:m}=ny(e,c,i,l,d),{positionAbsolute:h}=e.internals,j=x!==h.x||p!==h.y;(j||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:j?{x,y:p}:h,z:m}})}function Ku(e,t){return(Ye(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function ny(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,a=dt(e),c=In(e,n),d=en(e.extent)?It(c,e.extent,a):c;let x=It({x:i+d.x,y:l+d.y},s,a);e.extent==="parent"&&(x=Lu(x,a,t));const p=Ku(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>=p?m+1:p}}function Jr(e,t,n,s=[0,0]){const r=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=i.get(l.parentId)?.expandedRect??Jt(a),d=Tu(c,l.rect);i.set(l.parentId,{expandedRect:d,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},c)=>{const d=a.internals.positionAbsolute,x=dt(a),p=a.origin??s,m=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,h=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,j=Math.max(x.width,Math.round(l.width)),E=Math.max(x.height,Math.round(l.height)),S=(j-x.width)*p[0],R=(E-x.height)*p[1];(m>0||h>0||S||R)&&(r.push({id:c,type:"position",position:{x:a.position.x-m+S,y:a.position.y-h+R}}),n.get(c)?.forEach(v=>{e.some(y=>y.id===v.id)||r.push({id:v.id,type:"position",position:{x:v.position.x+m,y:v.position.y+h}})})),(x.width<l.width||x.height<l.height||m||h)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:j+(m?p[0]*m-S:0),height:E+(h?p[1]*h-R:0)}})}),r}function sy(e,t,n,s,r,i){const l=s?.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const c=[],d=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(d.transform),p=[];for(const m of e.values()){const h=t.get(m.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),a=!0;continue}const j=Ur(m.nodeElement),E=h.measured.width!==j.width||h.measured.height!==j.height;if(!!(j.width&&j.height&&(E||!h.internals.handleBounds||m.force))){const R=m.nodeElement.getBoundingClientRect(),v=en(h.extent)?h.extent:i;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=Lu(y,j,t.get(h.parentId)):v&&(y=It(y,v,j));const C={...h,measured:j,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:qi("source",m.nodeElement,R,x,h.id),target:qi("target",m.nodeElement,R,x,h.id)}}};t.set(h.id,C),h.parentId&&Qr(C,t,n,{nodeOrigin:r}),a=!0,E&&(c.push({id:h.id,type:"dimensions",dimensions:j}),h.expandParent&&h.parentId&&p.push({id:h.id,parentId:h.parentId,rect:Jt(C,r)}))}}if(p.length>0){const m=Jr(p,t,n,r);c.push(...m)}return{changes:c,updatedInternals:a}}async function oy({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){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],[r,i]],s),a=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(a)}function sl(e,t,n,s,r,i){let l=r;const a=s.get(l)||new Map;s.set(l,a.set(n,t)),l=`${r}-${e}`;const c=s.get(l)||new Map;if(s.set(l,c.set(n,t)),i){l=`${r}-${e}-${i}`;const d=s.get(l)||new Map;s.set(l,d.set(n,t))}}function Yu(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:a=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:a},d=`${r}-${l}--${i}-${a}`,x=`${i}-${a}--${r}-${l}`;sl("source",c,x,e,r,l),sl("target",c,d,e,i,a),t.set(s.id,s)}}function Wu(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Wu(n,t):!1}function ol(e,t,n){let s=e;do{if(s?.matches?.(t))return!0;if(s===n)return!1;s=s?.parentElement}while(s);return!1}function ry(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Wu(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function po({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){const r=[];for(const[l,a]of t){const c=n.get(l)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:s})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:s}:r[0],r]}function iy({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,a=new Map,c=!1,d={x:0,y:0},x=null,p=!1,m=null,h=!1,j=!1;function E({noDragClassName:R,handleSelector:v,domNode:y,isSelectable:C,nodeId:N,nodeClickDistance:k=0}){m=$e(y);function A({x:z,y:B},$){const{nodeLookup:w,nodeExtent:P,snapGrid:L,snapToGrid:O,nodeOrigin:H,onNodeDrag:F,onSelectionDrag:Z,onError:K,updateNodePositions:X}=t();i={x:z,y:B};let oe=!1,J={x:0,y:0,x2:0,y2:0};if(a.size>1&&P){const ae=On(a);J=Vo(ae)}for(const[ae,te]of a){if(!w.has(ae))continue;let ne={x:z-te.distance.x,y:B-te.distance.y};O&&(ne=$s(ne,L));let ee=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];if(a.size>1&&P&&!te.extent){const{positionAbsolute:Se}=te.internals,ue=Se.x-J.x+P[0][0],me=Se.x+te.measured.width-J.x2+P[1][0],U=Se.y-J.y+P[0][1],de=Se.y+te.measured.height-J.y2+P[1][1];ee=[[ue,U],[me,de]]}const{position:re,positionAbsolute:je}=ku({nodeId:ae,nextPosition:ne,nodeLookup:w,nodeExtent:ee,nodeOrigin:H,onError:K});oe=oe||te.position.x!==re.x||te.position.y!==re.y,te.position=re,te.internals.positionAbsolute=je}if(j=j||oe,!!oe&&(X(a,!0),$&&(s||F||!N&&Z))){const[ae,te]=po({nodeId:N,dragItems:a,nodeLookup:w});s?.($,a,ae,te),F?.($,ae,te),N||Z?.($,te)}}async function I(){if(!x)return;const{transform:z,panBy:B,autoPanSpeed:$,autoPanOnNodeDrag:w}=t();if(!w){c=!1,cancelAnimationFrame(l);return}const[P,L]=Pu(d,x,$);(P!==0||L!==0)&&(i.x=(i.x??0)-P/z[2],i.y=(i.y??0)-L/z[2],await B({x:P,y:L})&&A(i,null)),l=requestAnimationFrame(I)}function D(z){const{nodeLookup:B,multiSelectionActive:$,nodesDraggable:w,transform:P,snapGrid:L,snapToGrid:O,selectNodesOnDrag:H,onNodeDragStart:F,onSelectionDragStart:Z,unselectNodesAndEdges:K}=t();p=!0,(!H||!C)&&!$&&N&&(B.get(N)?.selected||K()),C&&H&&N&&e?.(N);const X=jn(z.sourceEvent,{transform:P,snapGrid:L,snapToGrid:O,containerBounds:x});if(i=X,a=ry(B,w,X,N),a.size>0&&(n||F||!N&&Z)){const[oe,J]=po({nodeId:N,dragItems:a,nodeLookup:B});n?.(z.sourceEvent,a,oe,J),F?.(z.sourceEvent,oe,J),N||Z?.(z.sourceEvent,J)}}const V=fu().clickDistance(k).on("start",z=>{const{domNode:B,nodeDragThreshold:$,transform:w,snapGrid:P,snapToGrid:L}=t();x=B?.getBoundingClientRect()||null,h=!1,j=!1,$===0&&D(z),i=jn(z.sourceEvent,{transform:w,snapGrid:P,snapToGrid:L,containerBounds:x}),d=Je(z.sourceEvent,x)}).on("drag",z=>{const{autoPanOnNodeDrag:B,transform:$,snapGrid:w,snapToGrid:P,nodeDragThreshold:L,nodeLookup:O}=t(),H=jn(z.sourceEvent,{transform:$,snapGrid:w,snapToGrid:P,containerBounds:x});if((z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||N&&!O.has(N))&&(h=!0),!h){if(!c&&B&&p&&(c=!0,I()),!p){const F=H.xSnapped-(i.x??0),Z=H.ySnapped-(i.y??0);Math.sqrt(F*F+Z*Z)>L&&D(z)}(i.x!==H.xSnapped||i.y!==H.ySnapped)&&a&&p&&(d=Je(z.sourceEvent,x),A(H,z.sourceEvent))}}).on("end",z=>{if(!(!p||h)&&(c=!1,p=!1,cancelAnimationFrame(l),a.size>0)){const{nodeLookup:B,updateNodePositions:$,onNodeDragStop:w,onSelectionDragStop:P}=t();if(j&&($(a,!1),j=!1),r||w||!N&&P){const[L,O]=po({nodeId:N,dragItems:a,nodeLookup:B,dragging:!1});r?.(z.sourceEvent,a,L,O),w?.(z.sourceEvent,L,O),N||P?.(z.sourceEvent,O)}}}).filter(z=>{const B=z.target;return!z.button&&(!R||!ol(B,`.${R}`,y))&&(!v||ol(B,v,y))});m.call(V)}function S(){m?.on(".drag",null)}return{update:E,destroy:S}}function ly(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())bn(r,Jt(i))>0&&s.push(i);return s}const ay=250;function cy(e,t,n,s){let r=[],i=1/0;const l=ly(e,n,t+ay);for(const a of l){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const d of c){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x,y:p}=vn(a,d,d.position,!0),m=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(p-e.y,2));m>t||(m<i?(r=[{...d,x,y:p}],i=m):m===i&&r.push({...d,x,y:p}))}}if(!r.length)return null;if(r.length>1){const a=s.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function Gu(e,t,n,s,r,i=!1){const l=s.get(e);if(!l)return null;const a=r==="strict"?l.internals.handleBounds?.[t]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],c=(n?a?.find(d=>d.id===n):a?.[0])??null;return c&&i?{...c,...vn(l,c,c.position,!0)}:c}function Uu(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function uy(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const qu=()=>!0;function dy(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:a,nodeLookup:c,lib:d,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:h,onConnectStart:j,onConnect:E,onConnectEnd:S,isValidConnection:R=qu,onReconnectEnd:v,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:k,dragThreshold:A=1}){const I=Ou(e.target);let D=0,V;const{x:z,y:B}=Je(e),$=I?.elementFromPoint(z,B),w=Uu(i,$),P=a?.getBoundingClientRect();let L=!1;if(!P||!w)return;const O=Gu(r,w,s,c,t);if(!O)return;let H=Je(e,P),F=!1,Z=null,K=!1,X=null;function oe(){if(!x||!P)return;const[Se,ue]=Pu(H,P,k);m({x:Se,y:ue}),D=requestAnimationFrame(oe)}const J={...O,nodeId:r,type:w,position:O.position},ae=c.get(r);let ne={inProgress:!0,isValid:null,from:vn(ae,J,Q.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:ae,to:H,toHandle:null,toPosition:Yi[J.position],toNode:null};function ee(){L=!0,y(ne),j?.(e,{nodeId:r,handleId:s,handleType:w})}A===0&&ee();function re(Se){if(!L){const{x:de,y:be}=Je(Se),Te=de-z,Xe=be-B;if(!(Te*Te+Xe*Xe>A*A))return;ee()}if(!N()||!J){je(Se);return}const ue=C();H=Je(Se,P),V=cy(Bn(H,ue,!1,[1,1]),n,c,J),F||(oe(),F=!0);const me=Xu(Se,{handle:V,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:I,lib:d,flowId:p,nodeLookup:c});X=me.handleDomNode,Z=me.connection,K=uy(!!V,me.isValid);const U={...ne,isValid:K,to:me.toHandle&&K?Ss({x:me.toHandle.x,y:me.toHandle.y},ue):H,toHandle:me.toHandle,toPosition:K&&me.toHandle?me.toHandle.position:Yi[J.position],toNode:me.toHandle?c.get(me.toHandle.nodeId):null};K&&V&&ne.toHandle&&U.toHandle&&ne.toHandle.type===U.toHandle.type&&ne.toHandle.nodeId===U.toHandle.nodeId&&ne.toHandle.id===U.toHandle.id&&ne.to.x===U.to.x&&ne.to.y===U.to.y||(y(U),ne=U)}function je(Se){if(L){(V||X)&&Z&&K&&E?.(Z);const{inProgress:ue,...me}=ne,U={...me,toPosition:ne.toHandle?ne.toPosition:null};S?.(Se,U),i&&v?.(Se,U)}h(),cancelAnimationFrame(D),F=!1,K=!1,Z=null,X=null,I.removeEventListener("mousemove",re),I.removeEventListener("mouseup",je),I.removeEventListener("touchmove",re),I.removeEventListener("touchend",je)}I.addEventListener("mousemove",re),I.addEventListener("mouseup",je),I.addEventListener("touchmove",re),I.addEventListener("touchend",je)}function Xu(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:a,flowId:c,isValidConnection:d=qu,nodeLookup:x}){const p=i==="target",m=t?l.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:j}=Je(e),E=l.elementFromPoint(h,j),S=E?.classList.contains(`${a}-flow__handle`)?E:m,R={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const v=Uu(void 0,S),y=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),N=S.classList.contains("connectable"),k=S.classList.contains("connectableend");if(!y||!v)return R;const A={source:p?y:s,sourceHandle:p?C:r,target:p?s:y,targetHandle:p?r:C};R.connection=A;const D=N&&k&&(n===At.Strict?p&&v==="source"||!p&&v==="target":y!==s||C!==r);R.isValid=D&&d(A),R.toHandle=Gu(y,v,C,x,n,!0)}return R}const Yo={onPointerDown:dy,isValid:Xu};function xy({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=$e(e);function i({translateExtent:a,width:c,height:d,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:h=!1}){const j=y=>{const C=n();if(y.sourceEvent.type!=="wheel"||!t)return;const N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*x,k=C[2]*Math.pow(2,N);t.scaleTo(k)};let E=[0,0];const S=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},R=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],k=[N[0]-E[0],N[1]-E[1]];E=N;const A=s()*Math.max(C[2],Math.log(C[2]))*(h?-1:1),I={x:C[0]-k[0]*A,y:C[1]-k[1]*A},D=[[0,0],[c,d]];t.setViewportConstrained({x:I.x,y:I.y,zoom:C[2]},D,a)},v=wu().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?j:null);r.call(v,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:Ke}}const py=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Vs=e=>({x:e.x,y:e.y,zoom:e.k}),mo=({x:e,y:t,zoom:n})=>Ds.translate(e,t).scale(n),Yt=(e,t)=>e.target.closest(`.${t}`),Qu=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),my=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fo=(e,t=0,n=my,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},Ju=e=>{const t=e.ctrlKey&&Rs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function fy({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:d}){return x=>{if(Yt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=Ke(x),R=Ju(x),v=p*Math.pow(2,R);s.scaleTo(n,v,S,x);return}const m=x.deltaMode===1?20:1;let h=r===vt.Vertical?0:x.deltaX*m,j=r===vt.Horizontal?0:x.deltaY*m;!Rs()&&x.shiftKey&&r!==vt.Vertical&&(h=x.deltaY*m,j=0),s.translateBy(n,-(h/p)*i,-(j/p)*i,{internal:!0});const E=Vs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a?.(x,E)),e.isPanScrolling&&(c?.(x,E),e.panScrollTimeout=setTimeout(()=>{d?.(x,E),e.isPanScrolling=!1},150))}}function hy({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",l=!t&&i&&!s.ctrlKey,a=Yt(s,e);if(s.ctrlKey&&i&&a&&s.preventDefault(),l||a)return null;s.preventDefault(),n.call(this,s,r)}}function gy({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{if(s.sourceEvent?.internal)return;const r=Vs(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,s.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(s.sourceEvent,r)}}function jy({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Qu(t,e.mouseButton??0)),i.sourceEvent?.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Vs(i.transform))}}function Ey({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Qu(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&py(e.prevViewport,l.transform))){const a=Vs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(l.sourceEvent,a)},n?150:0)}}}function yy({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:a,noPanClassName:c,lib:d}){return x=>{const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(Yt(x,`${d}-flow__node`)||Yt(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||Yt(x,a)&&x.type==="wheel"||Yt(x,c)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&x.touches?.length>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const h=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&h}}function Sy({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:d}){const x={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=wu().clickDistance(!Ye(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),h=$e(e).call(m);y({x:i.x,y:i.y,zoom:Qt(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const j=h.on("wheel.zoom"),E=h.on("dblclick.zoom");m.wheelDelta(Ju);function S(B,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?_.interpolate:ts).transform(fo(h,$?.duration,$?.ease,()=>w(!0)),B)}):Promise.resolve(!1)}function R({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:w,userSelectionActive:P,panOnScroll:L,panOnDrag:O,panOnScrollMode:H,panOnScrollSpeed:F,preventScrolling:Z,zoomOnPinch:K,zoomOnScroll:X,zoomOnDoubleClick:oe,zoomActivationKeyPressed:J,lib:ae,onTransformChange:te}){P&&!x.isZoomingOrPanning&&v();const ee=L&&!J&&!P?fy({zoomPanValues:x,noWheelClassName:B,d3Selection:h,d3Zoom:m,panOnScrollMode:H,panOnScrollSpeed:F,zoomOnPinch:K,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):hy({noWheelClassName:B,preventScrolling:Z,d3ZoomHandler:j});if(h.on("wheel.zoom",ee,{passive:!1}),!P){const je=gy({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:a});m.on("start",je);const Se=jy({zoomPanValues:x,panOnDrag:O,onPaneContextMenu:!!w,onPanZoom:l,onTransformChange:te});m.on("zoom",Se);const ue=Ey({zoomPanValues:x,panOnDrag:O,panOnScroll:L,onPaneContextMenu:w,onPanZoomEnd:c,onDraggingChange:d});m.on("end",ue)}const re=yy({zoomActivationKeyPressed:J,panOnDrag:O,zoomOnScroll:X,panOnScroll:L,zoomOnDoubleClick:oe,zoomOnPinch:K,userSelectionActive:P,noPanClassName:$,noWheelClassName:B,lib:ae});m.filter(re),oe?h.on("dblclick.zoom",E):h.on("dblclick.zoom",null)}function v(){m.on("zoom",null)}async function y(B,$,w){const P=mo(B),L=m?.constrain()(P,$,w);return L&&await S(L),new Promise(O=>O(L))}async function C(B,$){const w=mo(B);return await S(w,$),new Promise(P=>P(w))}function N(B){if(h){const $=mo(B),w=h.property("__zoom");(w.k!==B.zoom||w.x!==B.x||w.y!==B.y)&&m?.transform(h,$,null,{sync:!0})}}function k(){const B=h?Cu(h.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}function A(B,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?_.interpolate:ts).scaleTo(fo(h,$?.duration,$?.ease,()=>w(!0)),B)}):Promise.resolve(!1)}function I(B,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?_.interpolate:ts).scaleBy(fo(h,$?.duration,$?.ease,()=>w(!0)),B)}):Promise.resolve(!1)}function D(B){m?.scaleExtent(B)}function V(B){m?.translateExtent(B)}function z(B){const $=!Ye(B)||B<0?0:B;m?.clickDistance($)}return{update:R,destroy:v,setViewport:C,setViewportConstrained:y,getViewport:k,scaleTo:A,scaleBy:I,setScaleExtent:D,setTranslateExtent:V,syncViewport:N,setClickDistance:z}}var tn;(function(e){e.Line="line",e.Handle="handle"})(tn||(tn={}));function Ry({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,a=n-s,c=[l>0?1:l<0?-1:0,a>0?1:a<0?-1:0];return l&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function Cy(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function pt(e,t){return Math.max(0,t-e)}function mt(e,t){return Math.max(0,e-t)}function Un(e,t,n){return Math.max(0,t-e,e-n)}function rl(e,t){return e?!t:t}function wy(e,t,n,s,r,i,l,a){let{affectsX:c,affectsY:d}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:h,ySnapped:j}=n,{minWidth:E,maxWidth:S,minHeight:R,maxHeight:v}=s,{x:y,y:C,width:N,height:k,aspectRatio:A}=e;let I=Math.floor(x?h-e.pointerX:0),D=Math.floor(p?j-e.pointerY:0);const V=N+(c?-I:I),z=k+(d?-D:D),B=-i[0]*N,$=-i[1]*k;let w=Un(V,E,S),P=Un(z,R,v);if(l){let H=0,F=0;c&&I<0?H=pt(y+I+B,l[0][0]):!c&&I>0&&(H=mt(y+V+B,l[1][0])),d&&D<0?F=pt(C+D+$,l[0][1]):!d&&D>0&&(F=mt(C+z+$,l[1][1])),w=Math.max(w,H),P=Math.max(P,F)}if(a){let H=0,F=0;c&&I>0?H=mt(y+I,a[0][0]):!c&&I<0&&(H=pt(y+V,a[1][0])),d&&D>0?F=mt(C+D,a[0][1]):!d&&D<0&&(F=pt(C+z,a[1][1])),w=Math.max(w,H),P=Math.max(P,F)}if(r){if(x){const H=Un(V/A,R,v)*A;if(w=Math.max(w,H),l){let F=0;!c&&!d||c&&!d&&m?F=mt(C+$+V/A,l[1][1])*A:F=pt(C+$+(c?I:-I)/A,l[0][1])*A,w=Math.max(w,F)}if(a){let F=0;!c&&!d||c&&!d&&m?F=pt(C+V/A,a[1][1])*A:F=mt(C+(c?I:-I)/A,a[0][1])*A,w=Math.max(w,F)}}if(p){const H=Un(z*A,E,S)/A;if(P=Math.max(P,H),l){let F=0;!c&&!d||d&&!c&&m?F=mt(y+z*A+B,l[1][0])/A:F=pt(y+(d?D:-D)*A+B,l[0][0])/A,P=Math.max(P,F)}if(a){let F=0;!c&&!d||d&&!c&&m?F=pt(y+z*A,a[1][0])/A:F=mt(y+(d?D:-D)*A,a[0][0])/A,P=Math.max(P,F)}}}D=D+(D<0?P:-P),I=I+(I<0?w:-w),r&&(m?V>z*A?D=(rl(c,d)?-I:I)/A:I=(rl(c,d)?-D:D)*A:x?(D=I/A,d=c):(I=D*A,c=d));const L=c?y+I:y,O=d?C+D:C;return{width:N+(c?-I:I),height:k+(d?-D:D),x:i[0]*I*(c?-1:1)+L,y:i[1]*D*(d?-1:1)+O}}const ed={width:0,height:0,x:0,y:0},by={...ed,pointerX:0,pointerY:0,aspectRatio:1};function vy(e){return[[0,0],[e.measured.width,e.measured.height]]}function _y(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,a=n[0]*i,c=n[1]*l;return[[s-a,r-c],[s+i-a,r+l-c]]}function Ny({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=$e(e);function l({controlPosition:c,boundaries:d,keepAspectRatio:x,resizeDirection:p,onResizeStart:m,onResize:h,onResizeEnd:j,shouldResize:E}){let S={...ed},R={...by};const v=Cy(c);let y,C=null,N=[],k,A,I;const D=fu().on("start",V=>{const{nodeLookup:z,transform:B,snapGrid:$,snapToGrid:w,nodeOrigin:P,paneDomNode:L}=n();if(y=z.get(t),!y)return;C=L?.getBoundingClientRect()??null;const{xSnapped:O,ySnapped:H}=jn(V.sourceEvent,{transform:B,snapGrid:$,snapToGrid:w,containerBounds:C});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},R={...S,pointerX:O,pointerY:H,aspectRatio:S.width/S.height},k=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(k=z.get(y.parentId),A=k&&y.extent==="parent"?vy(k):void 0),N=[],I=void 0;for(const[F,Z]of z)if(Z.parentId===t&&(N.push({id:F,position:{...Z.position},extent:Z.extent}),Z.extent==="parent"||Z.expandParent)){const K=_y(Z,y,Z.origin??P);I?I=[[Math.min(K[0][0],I[0][0]),Math.min(K[0][1],I[0][1])],[Math.max(K[1][0],I[1][0]),Math.max(K[1][1],I[1][1])]]:I=K}m?.(V,{...S})}).on("drag",V=>{const{transform:z,snapGrid:B,snapToGrid:$,nodeOrigin:w}=n(),P=jn(V.sourceEvent,{transform:z,snapGrid:B,snapToGrid:$,containerBounds:C}),L=[];if(!y)return;const{x:O,y:H,width:F,height:Z}=S,K={},X=y.origin??w,{width:oe,height:J,x:ae,y:te}=wy(R,v,P,d,x,X,A,I),ne=oe!==F,ee=J!==Z,re=ae!==O&&ne,je=te!==H&&ee;if(!re&&!je&&!ne&&!ee)return;if((re||je||X[0]===1||X[1]===1)&&(K.x=re?ae:S.x,K.y=je?te:S.y,S.x=K.x,S.y=K.y,N.length>0)){const U=ae-O,de=te-H;for(const be of N)be.position={x:be.position.x-U+X[0]*(oe-F),y:be.position.y-de+X[1]*(J-Z)},L.push(be)}if((ne||ee)&&(K.width=ne&&(!p||p==="horizontal")?oe:S.width,K.height=ee&&(!p||p==="vertical")?J:S.height,S.width=K.width,S.height=K.height),k&&y.expandParent){const U=X[0]*(K.width??0);K.x&&K.x<U&&(S.x=U,R.x=R.x-(K.x-U));const de=X[1]*(K.height??0);K.y&&K.y<de&&(S.y=de,R.y=R.y-(K.y-de))}const Se=Ry({width:S.width,prevWidth:F,height:S.height,prevHeight:Z,affectsX:v.affectsX,affectsY:v.affectsY}),ue={...S,direction:Se};E?.(V,ue)!==!1&&(h?.(V,ue),s(K,L))}).on("end",V=>{j?.(V,{...S}),r?.({...S})});i.call(D)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var qn={exports:{}},ho={},Xn={exports:{}},go={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var il;function Ny(){if(il)return go;il=1;var e=g;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function a(p,m){var h=m(),j=s({inst:{value:h,getSnapshot:m}}),E=j[0].inst,S=j[1];return i(function(){E.value=h,E.getSnapshot=m,c(E)&&S({inst:E})},[p,h,m]),r(function(){return c(E)&&S({inst:E}),p(function(){c(E)&&S({inst:E})})},[p]),l(h),h}function c(p){var m=p.getSnapshot;p=p.value;try{var h=m();return!n(p,h)}catch{return!0}}function d(p,m){return m()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return go.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,go}var jo={};/**
9
+ */var il;function My(){if(il)return go;il=1;var e=g;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function a(p,m){var h=m(),j=s({inst:{value:h,getSnapshot:m}}),E=j[0].inst,S=j[1];return i(function(){E.value=h,E.getSnapshot=m,c(E)&&S({inst:E})},[p,h,m]),r(function(){return c(E)&&S({inst:E}),p(function(){c(E)&&S({inst:E})})},[p]),l(h),h}function c(p){var m=p.getSnapshot;p=p.value;try{var h=m();return!n(p,h)}catch{return!0}}function d(p,m){return m()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return go.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,go}var jo={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.development.js
12
12
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ll;function My(){return ll||(ll=1,process.env.NODE_ENV!=="production"&&function(){function e(h,j){return h===j&&(h!==0||1/h===1/j)||h!==h&&j!==j}function t(h,j){x||r.startTransition===void 0||(x=!0,console.error("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 E=j();if(!p){var S=j();i(E,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}S=l({inst:{value:E,getSnapshot:j}});var R=S[0].inst,v=S[1];return c(function(){R.value=E,R.getSnapshot=j,n(R)&&v({inst:R})},[h,E,j]),a(function(){return n(R)&&v({inst:R}),h(function(){n(R)&&v({inst:R})})},[h]),d(E),E}function n(h){var j=h.getSnapshot;h=h.value;try{var E=j();return!i(h,E)}catch{return!0}}function s(h,j){return j()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=g,i=typeof Object.is=="function"?Object.is:e,l=r.useState,a=r.useEffect,c=r.useLayoutEffect,d=r.useDebugValue,x=!1,p=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;jo.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),jo}var al;function td(){return al||(al=1,process.env.NODE_ENV==="production"?Xn.exports=Ny():Xn.exports=My()),Xn.exports}/**
17
+ */var ll;function ky(){return ll||(ll=1,process.env.NODE_ENV!=="production"&&function(){function e(h,j){return h===j&&(h!==0||1/h===1/j)||h!==h&&j!==j}function t(h,j){x||r.startTransition===void 0||(x=!0,console.error("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 E=j();if(!p){var S=j();i(E,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}S=l({inst:{value:E,getSnapshot:j}});var R=S[0].inst,v=S[1];return c(function(){R.value=E,R.getSnapshot=j,n(R)&&v({inst:R})},[h,E,j]),a(function(){return n(R)&&v({inst:R}),h(function(){n(R)&&v({inst:R})})},[h]),d(E),E}function n(h){var j=h.getSnapshot;h=h.value;try{var E=j();return!i(h,E)}catch{return!0}}function s(h,j){return j()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=g,i=typeof Object.is=="function"?Object.is:e,l=r.useState,a=r.useEffect,c=r.useLayoutEffect,d=r.useDebugValue,x=!1,p=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;jo.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),jo}var al;function td(){return al||(al=1,process.env.NODE_ENV==="production"?Xn.exports=My():Xn.exports=ky()),Xn.exports}/**
18
18
  * @license React
19
19
  * use-sync-external-store-shim/with-selector.production.js
20
20
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var cl;function ky(){if(cl)return ho;cl=1;var e=g,t=td();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,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,a=e.useMemo,c=e.useDebugValue;return ho.useSyncExternalStoreWithSelector=function(d,x,p,m,h){var j=i(null);if(j.current===null){var E={hasValue:!1,value:null};j.current=E}else E=j.current;j=a(function(){function R(k){if(!v){if(v=!0,y=k,k=m(k),h!==void 0&&E.hasValue){var A=E.value;if(h(A,k))return C=A}return C=k}if(A=C,s(y,k))return A;var I=m(k);return h!==void 0&&h(A,I)?(y=k,A):(y=k,C=I)}var v=!1,y,C,N=p===void 0?null:p;return[function(){return R(x())},N===null?void 0:function(){return R(N())}]},[x,p,m,h]);var S=r(d,j[0],j[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},ho}var Eo={};/**
25
+ */var cl;function Ly(){if(cl)return ho;cl=1;var e=g,t=td();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,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,a=e.useMemo,c=e.useDebugValue;return ho.useSyncExternalStoreWithSelector=function(d,x,p,m,h){var j=i(null);if(j.current===null){var E={hasValue:!1,value:null};j.current=E}else E=j.current;j=a(function(){function R(k){if(!v){if(v=!0,y=k,k=m(k),h!==void 0&&E.hasValue){var A=E.value;if(h(A,k))return C=A}return C=k}if(A=C,s(y,k))return A;var I=m(k);return h!==void 0&&h(A,I)?(y=k,A):(y=k,C=I)}var v=!1,y,C,N=p===void 0?null:p;return[function(){return R(x())},N===null?void 0:function(){return R(N())}]},[x,p,m,h]);var S=r(d,j[0],j[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},ho}var Eo={};/**
26
26
  * @license React
27
27
  * use-sync-external-store-shim/with-selector.development.js
28
28
  *
@@ -30,10 +30,10 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var ul;function Ly(){return ul||(ul=1,process.env.NODE_ENV!=="production"&&function(){function e(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,n=td(),s=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,a=t.useMemo,c=t.useDebugValue;Eo.useSyncExternalStoreWithSelector=function(d,x,p,m,h){var j=i(null);if(j.current===null){var E={hasValue:!1,value:null};j.current=E}else E=j.current;j=a(function(){function R(k){if(!v){if(v=!0,y=k,k=m(k),h!==void 0&&E.hasValue){var A=E.value;if(h(A,k))return C=A}return C=k}if(A=C,s(y,k))return A;var I=m(k);return h!==void 0&&h(A,I)?(y=k,A):(y=k,C=I)}var v=!1,y,C,N=p===void 0?null:p;return[function(){return R(x())},N===null?void 0:function(){return R(N())}]},[x,p,m,h]);var S=r(d,j[0],j[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Eo}var dl;function Py(){return dl||(dl=1,process.env.NODE_ENV==="production"?qn.exports=ky():qn.exports=Ly()),qn.exports}var Ty=Py();const Ay=f.getDefaultExportFromCjs(Ty),Iy={},xl=e=>{let t;const n=new Set,s=(x,p)=>{const m=typeof x=="function"?x(t):x;if(!Object.is(m,t)){const h=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(j=>j(t,h))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>d,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{(Iy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,r,c);return c},Oy=e=>e?xl(e):xl,{useDebugValue:By}=g,{useSyncExternalStoreWithSelector:Dy}=Ay,Hy=e=>e;function nd(e,t=Hy,n){const s=Dy(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return By(s),s}const pl=(e,t)=>{const n=Oy(e),s=(r,i=t)=>nd(n,r,i);return Object.assign(s,n),s},zy=(e,t)=>e?pl(e,t):pl;function ve(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Fs=g.createContext(null),$y=Fs.Provider,sd=Ae.error001();function je(e,t){const n=g.useContext(Fs);if(n===null)throw new Error(sd);return nd(n,e,t)}function be(){const e=g.useContext(Fs);if(e===null)throw new Error(sd);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ml={display:"none"},Vy={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},od="react-flow__node-desc",rd="react-flow__edge-desc",Fy="react-flow__aria-live",Zy=e=>e.ariaLiveMessage,Ky=e=>e.ariaLabelConfig;function Yy({rfId:e}){const t=je(Zy);return o.jsxRuntimeExports.jsx("div",{id:`${Fy}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Vy,children:t})}function Wy({rfId:e,disableKeyboardA11y:t}){const n=je(Ky);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{id:`${od}-${e}`,style:ml,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsxRuntimeExports.jsx("div",{id:`${rd}-${e}`,style:ml,children:n["edge.a11yDescription.default"]}),!t&&o.jsxRuntimeExports.jsx(Yy,{rfId:e})]})}const Zs=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const l=`${e}`.split("-");return o.jsxRuntimeExports.jsx("div",{className:Ne(["react-flow__panel",n,...l]),style:s,ref:i,...r,children:t})});Zs.displayName="Panel";function Gy({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:o.jsxRuntimeExports.jsx(Zs,{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:o.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Uy=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}},Qn=e=>e.id;function qy(e,t){return ve(e.selectedNodes.map(Qn),t.selectedNodes.map(Qn))&&ve(e.selectedEdges.map(Qn),t.selectedEdges.map(Qn))}function Xy({onSelectionChange:e}){const t=be(),{selectedNodes:n,selectedEdges:s}=je(Uy,qy);return g.useEffect(()=>{const r={nodes:n,edges:s};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const Qy=e=>!!e.onSelectionChangeHandlers;function Jy({onSelectionChange:e}){const t=je(Qy);return e||t?o.jsxRuntimeExports.jsx(Xy,{onSelectionChange:e}):null}const id=[0,0],eS={x:0,y:0,zoom:1},tS=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","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","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],fl=[...tS,"rfId"],nS=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}),hl={translateExtent:Cn,nodeOrigin:id,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function sS(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:a,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=je(nS,ve),x=be();g.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=hl,a()}),[]);const p=g.useRef(hl);return g.useEffect(()=>{for(const m of fl){const h=e[m],j=p.current[m];h!==j&&(typeof e[m]>"u"||(m==="nodes"?t(h):m==="edges"?n(h):m==="minZoom"?s(h):m==="maxZoom"?r(h):m==="translateExtent"?i(h):m==="nodeExtent"?l(h):m==="paneClickDistance"?d(h):m==="ariaLabelConfig"?x.setState({ariaLabelConfig:$5(h)}):m==="fitView"?x.setState({fitViewQueued:h}):m==="fitViewOptions"?x.setState({fitViewOptions:h}):x.setState({[m]:h})))}p.current=e},fl.map(m=>e[m])),null}function gl(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function oS(e){const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const s=gl(),r=()=>n(s?.matches?"dark":"light");return r(),s?.addEventListener("change",r),()=>{s?.removeEventListener("change",r)}},[e]),t!==null?t:gl()?.matches?"dark":"light"}const jl=typeof document<"u"?document:null;function vn(e=null,t={target:jl,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),r=g.useRef(!1),i=g.useRef(new Set([])),[l,a]=g.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
33
+ */var ul;function Py(){return ul||(ul=1,process.env.NODE_ENV!=="production"&&function(){function e(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,n=td(),s=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,a=t.useMemo,c=t.useDebugValue;Eo.useSyncExternalStoreWithSelector=function(d,x,p,m,h){var j=i(null);if(j.current===null){var E={hasValue:!1,value:null};j.current=E}else E=j.current;j=a(function(){function R(k){if(!v){if(v=!0,y=k,k=m(k),h!==void 0&&E.hasValue){var A=E.value;if(h(A,k))return C=A}return C=k}if(A=C,s(y,k))return A;var I=m(k);return h!==void 0&&h(A,I)?(y=k,A):(y=k,C=I)}var v=!1,y,C,N=p===void 0?null:p;return[function(){return R(x())},N===null?void 0:function(){return R(N())}]},[x,p,m,h]);var S=r(d,j[0],j[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Eo}var dl;function Ty(){return dl||(dl=1,process.env.NODE_ENV==="production"?qn.exports=Ly():qn.exports=Py()),qn.exports}var Ay=Ty();const Iy=f.getDefaultExportFromCjs(Ay),Oy={},xl=e=>{let t;const n=new Set,s=(x,p)=>{const m=typeof x=="function"?x(t):x;if(!Object.is(m,t)){const h=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(j=>j(t,h))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>d,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{(Oy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,r,c);return c},By=e=>e?xl(e):xl,{useDebugValue:Dy}=g,{useSyncExternalStoreWithSelector:zy}=Iy,Hy=e=>e;function nd(e,t=Hy,n){const s=zy(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Dy(s),s}const pl=(e,t)=>{const n=By(e),s=(r,i=t)=>nd(n,r,i);return Object.assign(s,n),s},$y=(e,t)=>e?pl(e,t):pl;function _e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Fs=g.createContext(null),Vy=Fs.Provider,sd=Ie.error001();function Ee(e,t){const n=g.useContext(Fs);if(n===null)throw new Error(sd);return nd(n,e,t)}function ve(){const e=g.useContext(Fs);if(e===null)throw new Error(sd);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ml={display:"none"},Fy={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},od="react-flow__node-desc",rd="react-flow__edge-desc",Zy="react-flow__aria-live",Ky=e=>e.ariaLiveMessage,Yy=e=>e.ariaLabelConfig;function Wy({rfId:e}){const t=Ee(Ky);return o.jsxRuntimeExports.jsx("div",{id:`${Zy}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Fy,children:t})}function Gy({rfId:e,disableKeyboardA11y:t}){const n=Ee(Yy);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{id:`${od}-${e}`,style:ml,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsxRuntimeExports.jsx("div",{id:`${rd}-${e}`,style:ml,children:n["edge.a11yDescription.default"]}),!t&&o.jsxRuntimeExports.jsx(Wy,{rfId:e})]})}const Zs=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const l=`${e}`.split("-");return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__panel",n,...l]),style:s,ref:i,...r,children:t})});Zs.displayName="Panel";function Uy({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:o.jsxRuntimeExports.jsx(Zs,{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:o.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const qy=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}},Qn=e=>e.id;function Xy(e,t){return _e(e.selectedNodes.map(Qn),t.selectedNodes.map(Qn))&&_e(e.selectedEdges.map(Qn),t.selectedEdges.map(Qn))}function Qy({onSelectionChange:e}){const t=ve(),{selectedNodes:n,selectedEdges:s}=Ee(qy,Xy);return g.useEffect(()=>{const r={nodes:n,edges:s};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const Jy=e=>!!e.onSelectionChangeHandlers;function eS({onSelectionChange:e}){const t=Ee(Jy);return e||t?o.jsxRuntimeExports.jsx(Qy,{onSelectionChange:e}):null}const id=[0,0],tS={x:0,y:0,zoom:1},nS=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","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","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],fl=[...nS,"rfId"],sS=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}),hl={translateExtent:wn,nodeOrigin:id,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function oS(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:a,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=Ee(sS,_e),x=ve();g.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=hl,a()}),[]);const p=g.useRef(hl);return g.useEffect(()=>{for(const m of fl){const h=e[m],j=p.current[m];h!==j&&(typeof e[m]>"u"||(m==="nodes"?t(h):m==="edges"?n(h):m==="minZoom"?s(h):m==="maxZoom"?r(h):m==="translateExtent"?i(h):m==="nodeExtent"?l(h):m==="paneClickDistance"?d(h):m==="ariaLabelConfig"?x.setState({ariaLabelConfig:V5(h)}):m==="fitView"?x.setState({fitViewQueued:h}):m==="fitViewOptions"?x.setState({fitViewOptions:h}):x.setState({[m]:h})))}p.current=e},fl.map(m=>e[m])),null}function gl(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function rS(e){const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const s=gl(),r=()=>n(s?.matches?"dark":"light");return r(),s?.addEventListener("change",r),()=>{s?.removeEventListener("change",r)}},[e]),t!==null?t:gl()?.matches?"dark":"light"}const jl=typeof document<"u"?document:null;function _n(e=null,t={target:jl,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),r=g.useRef(!1),i=g.useRef(new Set([])),[l,a]=g.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
34
34
  `).replace(`
35
35
 
36
36
  `,`
37
37
  +`).split(`
38
- `)),x=d.reduce((p,m)=>p.concat(...m),[]);return[d,x]}return[[],[]]},[e]);return g.useEffect(()=>{const c=t?.target??jl,d=t?.actInsideInputWithModifier??!0;if(e!==null){const x=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!d)&&Bu(h))return!1;const E=yl(h.code,a);if(i.current.add(h[E]),El(l,i.current,!1)){const S=h.composedPath?.()?.[0]||h.target,R=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(r.current||!R)&&h.preventDefault(),s(!0)}},p=h=>{const j=yl(h.code,a);El(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(h[j]),h.key==="Meta"&&i.current.clear(),r.current=!1},m=()=>{i.current.clear(),s(!1)};return c?.addEventListener("keydown",x),c?.addEventListener("keyup",p),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c?.removeEventListener("keydown",x),c?.removeEventListener("keyup",p),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,s]),n}function El(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function yl(e,t){return t.includes(e)?"code":"key"}const rS=()=>{const e=be();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:a}=e.getState(),c=Gr(t,s,r,i,l,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:a,y:c}=l.getBoundingClientRect(),d={x:t.x-a,y:t.y-c},x=n.snapGrid??r,p=n.snapToGrid??i;return On(d,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=Ss(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function ld(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const a={...i};for(const c of l)iS(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function iS(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.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ad(e,t){return ld(e,t)}function cd(e,t){return ld(e,t)}function Ct(e,t){return{id:e,type:"select",selected:t}}function Wt(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Ct(i.id,l)))}return s}function Sl({items:e=[],lookup:t}){const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const l=t.get(i.id),a=l?.internals?.userNode??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function Rl(e){return{id:e.id,type:"remove"}}const Cl=e=>P5(e),lS=e=>Mu(e);function ud(e){return g.forwardRef(e)}const aS=typeof window<"u"?g.useLayoutEffect:g.useEffect;function wl(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>cS(()=>n(r=>r+BigInt(1))));return aS(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function cS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const dd=g.createContext(null);function uS({children:e}){const t=be(),n=g.useCallback(a=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m,fitViewQueued:h}=t.getState();let j=c;for(const S of a)j=typeof S=="function"?S(j):S;const E=Sl({items:j,lookup:m});x&&d(j),E.length>0?p?.(E):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:R,setNodes:v}=t.getState();S&&v(R)})},[]),s=wl(n),r=g.useCallback(a=>{const{edges:c=[],setEdges:d,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let h=c;for(const j of a)h=typeof j=="function"?j(h):j;x?d(h):p&&p(Sl({items:h,lookup:m}))},[]),i=wl(r),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(dd.Provider,{value:l,children:e})}function dS(){const e=g.useContext(dd);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const xS=e=>!!e.panZoom;function Dt(){const e=rS(),t=be(),n=dS(),s=je(xS),r=g.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},a=p=>{n.edgeQueue.push(p)},c=p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState(),j=Cl(p)?p:m.get(p.id),E=j.parentId?Iu(j.position,j.measured,j.parentId,m,h):j.position,S={...j,position:E,width:j.measured?.width??j.width,height:j.measured?.height??j.height};return Jt(S)},d=(p,m,h={replace:!1})=>{l(j=>j.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&Cl(S)?S:{...E,...S}}return E}))},x=(p,m,h={replace:!1})=>{a(j=>j.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&lS(S)?S:{...E,...S}}return E}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>i(p)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(m=>({...m}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:a,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(h=>[...h,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(h=>[...h,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:h}=t.getState(),[j,E,S]=h;return{nodes:p.map(R=>({...R})),edges:m.map(R=>({...R})),viewport:{x:j,y:E,zoom:S}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:h,edges:j,onNodesDelete:E,onEdgesDelete:S,triggerNodeChanges:R,triggerEdgeChanges:v,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:N,edges:k}=await B5({nodesToRemove:p,edgesToRemove:m,nodes:h,edges:j,onBeforeDelete:C}),A=k.length>0,I=N.length>0;if(A){const D=k.map(Rl);S?.(k),v(D)}if(I){const D=N.map(Rl);E?.(N),R(D)}return(I||A)&&y?.({nodes:N,edges:k}),{deletedNodes:N,deletedEdges:k}},getIntersectingNodes:(p,m=!0,h)=>{const j=Gi(p),E=j?p:c(p),S=h!==void 0;return E?(h||t.getState().nodes).filter(R=>{const v=t.getState().nodeLookup.get(R.id);if(v&&!j&&(R.id===p.id||!v.internals.positionAbsolute))return!1;const y=Jt(S?R:v),C=wn(y,E);return m&&C>0||C>=E.width*E.height}):[]},isNodeIntersecting:(p,m,h=!0)=>{const E=Gi(p)?p:c(p);if(!E)return!1;const S=wn(E,m);return h&&S>0||S>=E.width*E.height},updateNode:d,updateNodeData:(p,m,h={replace:!1})=>{d(p,j=>{const E=typeof m=="function"?m(j):m;return h.replace?{...j,data:E}:{...j,data:{...j.data,...E}}},h)},updateEdge:x,updateEdgeData:(p,m,h={replace:!1})=>{x(p,j=>{const E=typeof m=="function"?m(j):m;return h.replace?{...j,data:E}:{...j,data:{...j.data,...E}}},h)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState();return T5(p,{nodeLookup:m,nodeOrigin:h})},getHandleConnections:({type:p,id:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${p}${m?`-${m}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${p?m?`-${p}-${m}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const m=t.getState().fitViewResolver??z5();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),n.nodeQueue.push(h=>[...h]),m.promise}}},[]);return g.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const bl=e=>e.selected,pS=typeof window<"u"?window:void 0;function mS({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=be(),{deleteElements:s}=Dt(),r=vn(e,{actInsideInputWithModifier:!1}),i=vn(t,{target:pS});g.useEffect(()=>{if(r){const{edges:l,nodes:a}=n.getState();s({nodes:a.filter(bl),edges:l.filter(bl)}),n.setState({nodesSelectionActive:!1})}},[r]),g.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function fS(e){const t=be();g.useEffect(()=>{const n=()=>{if(!e.current)return!1;const s=Ur(e.current);(s.height===0||s.width===0)&&t.getState().onError?.("004",Ae.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 Ks={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:r=.5,panOnScrollMode:i=bt.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:d,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:h=!0,children:j,noWheelClassName:E,noPanClassName:S,onViewportChange:R,isControlledViewport:v,paneClickDistance:y}){const C=be(),N=g.useRef(null),{userSelectionActive:k,lib:A}=je(hS,ve),I=vn(m),D=g.useRef();fS(N);const V=g.useCallback(H=>{R?.({x:H[0],y:H[1],zoom:H[2]}),v||C.setState({transform:H})},[R,v]);return g.useEffect(()=>{if(N.current){D.current=yy({domNode:N.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:c,paneClickDistance:y,onDraggingChange:w=>C.setState({paneDragging:w}),onPanZoomStart:(w,P)=>{const{onViewportChangeStart:L,onMoveStart:O}=C.getState();O?.(w,P),L?.(P)},onPanZoom:(w,P)=>{const{onViewportChange:L,onMove:O}=C.getState();O?.(w,P),L?.(P)},onPanZoomEnd:(w,P)=>{const{onViewportChangeEnd:L,onMoveEnd:O}=C.getState();O?.(w,P),L?.(P)}});const{x:H,y:B,zoom:$}=D.current.getViewport();return C.setState({panZoom:D.current,transform:[H,B,$],domNode:N.current.closest(".react-flow")}),()=>{D.current?.destroy()}}},[]),g.useEffect(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:I,preventScrolling:h,noPanClassName:S,userSelectionActive:k,noWheelClassName:E,lib:A,onTransformChange:V})},[e,t,n,s,r,i,l,a,I,h,S,k,E,A,V]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:N,style:Ks,children:j})}const jS=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ES(){const{userSelectionActive:e,userSelectionRect:t}=je(jS,ve);return e&&t?o.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 yo=(e,t)=>n=>{n.target===t.current&&e?.(n)},yS=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function SS({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xt.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:a,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){const j=be(),{userSelectionActive:E,elementsSelectable:S,dragging:R,connectionInProgress:v}=je(yS,ve),y=S&&(e||E),C=g.useRef(null),N=g.useRef(),k=g.useRef(new Set),A=g.useRef(new Set),I=g.useRef(!1),D=g.useRef(!1),V=O=>{if(I.current||v){I.current=!1;return}a?.(O),j.getState().resetSelectedElements(),j.setState({nodesSelectionActive:!1})},H=O=>{if(Array.isArray(s)&&s?.includes(2)){O.preventDefault();return}c?.(O)},B=d?O=>d(O):void 0,$=O=>{const{resetSelectedElements:z,domNode:F}=j.getState();if(N.current=F?.getBoundingClientRect(),!S||!e||O.button!==0||O.target!==C.current||!N.current)return;O.target?.setPointerCapture?.(O.pointerId),D.current=!0,I.current=!1;const{x:Z,y:K}=Xe(O.nativeEvent,N.current);z(),j.setState({userSelectionRect:{width:0,height:0,startX:Z,startY:K,x:Z,y:K}}),i?.(O)},w=O=>{const{userSelectionRect:z,transform:F,nodeLookup:Z,edgeLookup:K,connectionLookup:X,triggerNodeChanges:oe,triggerEdgeChanges:J,defaultEdgeOptions:ue}=j.getState();if(!N.current||!z)return;I.current=!0;const{x:te,y:ne}=Xe(O.nativeEvent,N.current),{startX:ee,startY:le}=z,ge={startX:ee,startY:le,x:te<ee?te:ee,y:ne<le?ne:le,width:Math.abs(te-ee),height:Math.abs(ne-le)},ye=k.current,G=A.current;k.current=new Set(Wr(Z,ge,F,n===Xt.Partial,!0).map(ie=>ie.id)),A.current=new Set;const re=ue?.selectable??!0;for(const ie of k.current){const we=X.get(ie);if(we)for(const{edgeId:ke}of we.values()){const st=K.get(ke);st&&(st.selectable??re)&&A.current.add(ke)}}if(!Ui(ye,k.current)){const ie=Wt(Z,k.current,!0);oe(ie)}if(!Ui(G,A.current)){const ie=Wt(K,A.current);J(ie)}j.setState({userSelectionRect:ge,userSelectionActive:!0,nodesSelectionActive:!1})},P=O=>{if(O.button!==0||!D.current)return;O.target?.releasePointerCapture?.(O.pointerId);const{userSelectionRect:z}=j.getState();!E&&z&&O.target===C.current&&V?.(O),j.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),l?.(O),(t||r)&&(I.current=!1),D.current=!1},L=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:Ne(["react-flow__pane",{draggable:L,dragging:R,selection:e}]),onClick:y?void 0:yo(V,C),onContextMenu:yo(H,C),onWheel:yo(B,C),onPointerEnter:y?void 0:x,onPointerDown:y?$:p,onPointerMove:y?w:p,onPointerUp:y?P:void 0,onPointerLeave:m,ref:C,style:Ks,children:[h,o.jsxRuntimeExports.jsx(ES,{})]})}function Wo({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:a,onError:c}=t.getState(),d=a.get(e);if(!d){c?.("012",Ae.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):r([e])}function xd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const a=be(),[c,d]=g.useState(!1),x=g.useRef();return g.useEffect(()=>{x.current=ry({getStoreItems:()=>a.getState(),onNodeMouseDown:p=>{Wo({id:p,store:a,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),g.useEffect(()=>{if(t)x.current?.destroy();else if(e.current)return x.current?.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{x.current?.destroy()}},[n,s,t,i,e,r]),c}const RS=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function pd(){const e=be();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:a,updateNodePositions:c,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=RS(l),h=r?i[0]:5,j=r?i[1]:5,E=n.direction.x*h*n.factor,S=n.direction.y*j*n.factor;for(const[,R]of d){if(!m(R))continue;let v={x:R.internals.positionAbsolute.x+E,y:R.internals.positionAbsolute.y+S};r&&(v=$s(v,i));const{position:y,positionAbsolute:C}=ku({nodeId:R.id,nextPosition:v,nodeLookup:d,nodeExtent:s,nodeOrigin:x,onError:a});R.position=y,R.internals.positionAbsolute=C,p.set(R.id,R)}c(p)},[])}const ei=g.createContext(null),CS=ei.Provider;ei.Consumer;const md=()=>g.useContext(ei),wS=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),bS=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:a,toHandle:c,isValid:d}=l,x=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:x,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===Tt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:x&&d}};function vS({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:a,children:c,className:d,onMouseDown:x,onTouchStart:p,...m},h){const j=l||null,E=e==="target",S=be(),R=md(),{connectOnClick:v,noPanClassName:y,rfId:C}=je(wS,ve),{connectingFrom:N,connectingTo:k,clickConnecting:A,isPossibleEndHandle:I,connectionInProcess:D,clickConnectionInProcess:V,valid:H}=je(bS(R,j,e),ve);R||S.getState().onError?.("010",Ae.error010());const B=P=>{const{defaultEdgeOptions:L,onConnect:O,hasDefaultEdges:z}=S.getState(),F={...L,...P};if(z){const{edges:Z,setEdges:K}=S.getState();K(Fu(F,Z))}O?.(F),a?.(F)},$=P=>{if(!R)return;const L=Du(P.nativeEvent);if(r&&(L&&P.button===0||!L)){const O=S.getState();Yo.onPointerDown(P.nativeEvent,{autoPanOnConnect:O.autoPanOnConnect,connectionMode:O.connectionMode,connectionRadius:O.connectionRadius,domNode:O.domNode,nodeLookup:O.nodeLookup,lib:O.lib,isTarget:E,handleId:j,nodeId:R,flowId:O.rfId,panBy:O.panBy,cancelConnection:O.cancelConnection,onConnectStart:O.onConnectStart,onConnectEnd:O.onConnectEnd,updateConnection:O.updateConnection,onConnect:B,isValidConnection:n||O.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:O.autoPanSpeed,dragThreshold:O.connectionDragThreshold})}L?x?.(P):p?.(P)},w=P=>{const{onClickConnectStart:L,onClickConnectEnd:O,connectionClickStartHandle:z,connectionMode:F,isValidConnection:Z,lib:K,rfId:X,nodeLookup:oe,connection:J}=S.getState();if(!R||!z&&!r)return;if(!z){L?.(P.nativeEvent,{nodeId:R,handleId:j,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:j}});return}const ue=Ou(P.target),te=n||Z,{connection:ne,isValid:ee}=Yo.isValid(P.nativeEvent,{handle:{nodeId:R,id:j,type:e},connectionMode:F,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:te,flowId:X,doc:ue,lib:K,nodeLookup:oe});ee&&ne&&B(ne);const le=structuredClone(J);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,O?.(P,le),S.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":j,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${j}-${e}`,className:Ne(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!E,target:E,connectable:s,connectablestart:r,connectableend:i,clickconnecting:A,connectingfrom:N,connectingto:k,valid:H,connectionindicator:s&&(!D||I)&&(D||V?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:v?w:void 0,ref:h,...m,children:c})}const _n=g.memo(ud(vS));function _S({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e?.label,o.jsxRuntimeExports.jsx(_n,{type:"source",position:n,isConnectable:t})]})}function NS({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:s=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(_n,{type:"target",position:n,isConnectable:t}),e?.label,o.jsxRuntimeExports.jsx(_n,{type:"source",position:s,isConnectable:t})]})}function MS(){return null}function kS({data:e,isConnectable:t,targetPosition:n=Q.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(_n,{type:"target",position:n,isConnectable:t}),e?.label]})}const Cs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vl={input:_S,default:NS,output:kS,group:MS};function LS(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const PS=e=>{const{width:t,height:n,x:s,y:r}=In(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ke(t)?t:null,height:Ke(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function TS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=be(),{width:r,height:i,transformString:l,userSelectionActive:a}=je(PS,ve),c=pd(),d=g.useRef(null);if(g.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),xd({nodeRef:d}),a||!r||!i)return null;const x=e?m=>{const h=s.getState().nodes.filter(j=>j.selected);e(m,h)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Cs,m.key)&&(m.preventDefault(),c({direction:Cs[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Ne(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const _l=typeof window<"u"?window:void 0,AS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function fd({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:S,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:A,panOnDrag:I,defaultViewport:D,translateExtent:V,minZoom:H,maxZoom:B,preventScrolling:$,onSelectionContextMenu:w,noWheelClassName:P,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:z,isControlledViewport:F}){const{nodesSelectionActive:Z,userSelectionActive:K}=je(AS),X=vn(d,{target:_l}),oe=vn(E,{target:_l}),J=oe||I,ue=oe||C,te=x&&J!==!0,ne=X||K||te;return mS({deleteKeyCode:c,multiSelectionKeyCode:j}),o.jsxRuntimeExports.jsx(gS,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ue,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:A,panOnDrag:!X&&J,defaultViewport:D,translateExtent:V,minZoom:H,maxZoom:B,zoomActivationKeyCode:S,preventScrolling:$,noWheelClassName:P,noPanClassName:L,onViewportChange:z,isControlledViewport:F,paneClickDistance:a,children:o.jsxRuntimeExports.jsxs(SS,{onSelectionStart:m,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:J,isSelecting:!!ne,selectionMode:p,selectionKeyPressed:X,selectionOnDrag:te,children:[e,Z&&o.jsxRuntimeExports.jsx(TS,{onSelectionContextMenu:w,noPanClassName:L,disableKeyboardA11y:O})]})})}fd.displayName="FlowRenderer";const IS=g.memo(fd),OS=e=>t=>e?Wr(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 BS(e){return je(g.useCallback(OS(e),[e]),ve)}const DS=e=>e.updateNodeInternals;function HS(){const e=je(DS),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t?.disconnect()},[t]),t}function zS({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=be(),i=g.useRef(null),l=g.useRef(null),a=g.useRef(e.sourcePosition),c=g.useRef(e.targetPosition),d=g.useRef(t),x=n&&!!e.internals.handleBounds;return g.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&s?.unobserve(l.current),s?.observe(i.current),l.current=i.current)},[x,e.hidden]),g.useEffect(()=>()=>{l.current&&(s?.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(i.current){const p=d.current!==t,m=a.current!==e.sourcePosition,h=c.current!==e.targetPosition;(p||m||h)&&(d.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function $S({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:a,elementsSelectable:c,nodesConnectable:d,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:h,disableKeyboardA11y:j,rfId:E,nodeTypes:S,nodeClickDistance:R,onError:v}){const{node:y,internals:C,isParent:N}=je(ee=>{const le=ee.nodeLookup.get(e),ge=ee.parentLookup.has(e);return{node:le,internals:le.internals,isParent:ge}},ve);let k=y.type||"default",A=S?.[k]||vl[k];A===void 0&&(v?.("003",Ae.error003(k)),k="default",A=vl.default);const I=!!(y.draggable||a&&typeof y.draggable>"u"),D=!!(y.selectable||c&&typeof y.selectable>"u"),V=!!(y.connectable||d&&typeof y.connectable>"u"),H=!!(y.focusable||x&&typeof y.focusable>"u"),B=be(),$=Au(y),w=zS({node:y,nodeType:k,hasDimensions:$,resizeObserver:p}),P=xd({nodeRef:w,disabled:y.hidden||!I,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:R}),L=pd();if(y.hidden)return null;const O=ut(y),z=LS(y),F=D||I||t||n||s||r,Z=n?ee=>n(ee,{...C.userNode}):void 0,K=s?ee=>s(ee,{...C.userNode}):void 0,X=r?ee=>r(ee,{...C.userNode}):void 0,oe=i?ee=>i(ee,{...C.userNode}):void 0,J=l?ee=>l(ee,{...C.userNode}):void 0,ue=ee=>{const{selectNodesOnDrag:le,nodeDragThreshold:ge}=B.getState();D&&(!le||!I||ge>0)&&Wo({id:e,store:B,nodeRef:w}),t&&t(ee,{...C.userNode})},te=ee=>{if(!(Bu(ee.nativeEvent)||j)){if(bu.includes(ee.key)&&D){const le=ee.key==="Escape";Wo({id:e,store:B,unselect:le,nodeRef:w})}else if(I&&y.selected&&Object.prototype.hasOwnProperty.call(Cs,ee.key)){ee.preventDefault();const{ariaLabelConfig:le}=B.getState();B.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),L({direction:Cs[ee.key],factor:ee.shiftKey?4:1})}}},ne=()=>{if(j||!w.current?.matches(":focus-visible"))return;const{transform:ee,width:le,height:ge,autoPanOnNodeFocus:ye,setCenter:G}=B.getState();if(!ye)return;Wr(new Map([[e,y]]),{x:0,y:0,width:le,height:ge},ee,!0).length>0||G(y.position.x+O.width/2,y.position.y+O.height/2,{zoom:ee[2]})};return o.jsxRuntimeExports.jsx("div",{className:Ne(["react-flow__node",`react-flow__node-${k}`,{[h]:I},y.className,{selected:y.selected,selectable:D,parent:N,draggable:I,dragging:P}]),ref:w,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:$?"visible":"hidden",...y.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:K,onMouseLeave:X,onContextMenu:oe,onClick:ue,onDoubleClick:J,onKeyDown:H?te:void 0,tabIndex:H?0:void 0,onFocus:H?ne:void 0,role:y.ariaRole??(H?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${od}-${E}`,"aria-label":y.ariaLabel,...y.domAttributes,children:o.jsxRuntimeExports.jsx(CS,{value:e,children:o.jsxRuntimeExports.jsx(A,{id:e,data:y.data,type:k,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:I,deletable:y.deletable??!0,isConnectable:V,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:P,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...O})})})}const VS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hd(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=je(VS,ve),l=BS(e.onlyRenderVisibleElements),a=HS();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ks,children:l.map(c=>o.jsxRuntimeExports.jsx($S,{id:c,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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}hd.displayName="NodeRenderer";const FS=g.memo(hd);function ZS(e){return je(g.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&Z5({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),ve)}const KS=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),YS=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Nl={[js.Arrow]:KS,[js.ArrowClosed]:YS};function WS(e){const t=be();return g.useMemo(()=>Object.prototype.hasOwnProperty.call(Nl,e)?Nl[e]:(t.getState().onError?.("009",Ae.error009(e)),null),[e])}const GS=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:a="auto-start-reverse"})=>{const c=WS(t);return c?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(c,{color:n,strokeWidth:l})}):null},gd=({defaultColor:e,rfId:t})=>{const n=je(i=>i.edges),s=je(i=>i.defaultEdgeOptions),r=g.useMemo(()=>X5(n,{id:t,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(GS,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};gd.displayName="MarkerDefinitions";var US=g.memo(gd);function jd({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:a=2,children:c,className:d,...x}){const[p,m]=g.useState({x:1,y:0,width:0,height:0}),h=Ne(["react-flow__edge-textwrapper",d]),j=g.useRef(null);return g.useEffect(()=>{if(j.current){const E=j.current.getBBox();m({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),n?o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:h,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:j,style:s,children:n}),c]}):null}jd.displayName="EdgeText";const qS=g.memo(jd);function Ye({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:d=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:Ne(["react-flow__edge-path",x.className])}),d&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Ke(t)&&Ke(n)?o.jsxRuntimeExports.jsx(qS,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Ml({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Q.Left||e===Q.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function Ed({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top}){const[l,a]=Ml({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,d]=Ml({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,h]=Hu({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${e},${t} C${l},${a} ${c},${d} ${s},${r}`,x,p,m,h]}function yd(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l,targetPosition:a,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,interactionWidth:R})=>{const[v,y,C]=Ed({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a}),N=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ye,{id:N,path:v,labelX:y,labelY:C,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,interactionWidth:R})})}const XS=yd({isInternal:!1}),Sd=yd({isInternal:!0});XS.displayName="SimpleBezierEdge";Sd.displayName="SimpleBezierEdgeInternal";function Rd(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:h=Q.Bottom,targetPosition:j=Q.Top,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,N]=Fo({sourceX:n,sourceY:s,sourcePosition:h,targetX:r,targetY:i,targetPosition:j,borderRadius:R?.borderRadius,offset:R?.offset}),k=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ye,{id:k,path:y,labelX:C,labelY:N,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:S,interactionWidth:v})})}const Cd=Rd({isInternal:!1}),wd=Rd({isInternal:!0});Cd.displayName="SmoothStepEdge";wd.displayName="SmoothStepEdgeInternal";function bd(e){return g.memo(({id:t,...n})=>{const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Cd,{...n,id:s,pathOptions:g.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const QS=bd({isInternal:!1}),vd=bd({isInternal:!0});QS.displayName="StepEdge";vd.displayName="StepEdgeInternal";function _d(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:j,interactionWidth:E})=>{const[S,R,v]=Zu({sourceX:n,sourceY:s,targetX:r,targetY:i}),y=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ye,{id:y,path:S,labelX:R,labelY:v,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:j,interactionWidth:E})})}const JS=_d({isInternal:!1}),Nd=_d({isInternal:!0});JS.displayName="StraightEdge";Nd.displayName="StraightEdgeInternal";function Md(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=Q.Bottom,targetPosition:a=Q.Top,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,N]=zu({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a,curvature:R?.curvature}),k=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ye,{id:k,path:y,labelX:C,labelY:N,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,interactionWidth:v})})}const e4=Md({isInternal:!1}),kd=Md({isInternal:!0});e4.displayName="BezierEdge";kd.displayName="BezierEdgeInternal";const kl={default:kd,straight:Nd,step:vd,smoothstep:wd,simplebezier:Sd},Ll={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},t4=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,n4=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,Pl="react-flow__edgeupdater";function Tl({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:a}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:Ne([Pl,`${Pl}-${a}`]),cx:t4(t,s,e),cy:n4(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function s4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:a,targetPosition:c,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:h}){const j=be(),E=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:k,domNode:A,isValidConnection:I,connectionMode:D,connectionRadius:V,lib:H,onConnectStart:B,onConnectEnd:$,cancelConnection:w,nodeLookup:P,rfId:L,panBy:O,updateConnection:z}=j.getState(),F=N.type==="target",Z=(oe,J)=>{m(!1),p?.(oe,n,N.type,J)},K=oe=>d?.(n,oe),X=(oe,J)=>{m(!0),x?.(C,n,N.type),B?.(oe,J)};Yo.onPointerDown(C.nativeEvent,{autoPanOnConnect:k,connectionMode:D,connectionRadius:V,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:P,isTarget:F,edgeUpdaterType:N.type,lib:H,flowId:L,cancelConnection:w,panBy:O,isValidConnection:I,onConnect:K,onConnectStart:X,onConnectEnd:$,onReconnectEnd:Z,updateConnection:z,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold})},S=C=>E(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=C=>E(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>h(!0),y=()=>h(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(Tl,{position:a,centerX:s,centerY:r,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(Tl,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function o4({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,rfId:j,edgeTypes:E,noPanClassName:S,onError:R,disableKeyboardA11y:v}){let y=je(G=>G.edgeLookup.get(e));const C=je(G=>G.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",k=E?.[N]||kl[N];k===void 0&&(R?.("011",Ae.error011(N)),N="default",k=kl.default);const A=!!(y.focusable||t&&typeof y.focusable>"u"),I=typeof p<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),D=!!(y.selectable||s&&typeof y.selectable>"u"),V=g.useRef(null),[H,B]=g.useState(!1),[$,w]=g.useState(!1),P=be(),{zIndex:L,sourceX:O,sourceY:z,targetX:F,targetY:Z,sourcePosition:K,targetPosition:X}=je(g.useCallback(G=>{const re=G.nodeLookup.get(y.source),ie=G.nodeLookup.get(y.target);if(!re||!ie)return{zIndex:y.zIndex,...Ll};const we=q5({id:e,sourceNode:re,targetNode:ie,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:G.connectionMode,onError:R});return{zIndex:F5({selected:y.selected,zIndex:y.zIndex,sourceNode:re,targetNode:ie,elevateOnSelect:G.elevateEdgesOnSelect}),...we||Ll}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),ve),oe=g.useMemo(()=>y.markerStart?`url('#${Zo(y.markerStart,j)}')`:void 0,[y.markerStart,j]),J=g.useMemo(()=>y.markerEnd?`url('#${Zo(y.markerEnd,j)}')`:void 0,[y.markerEnd,j]);if(y.hidden||O===null||z===null||F===null||Z===null)return null;const ue=G=>{const{addSelectedEdges:re,unselectNodesAndEdges:ie,multiSelectionActive:we}=P.getState();D&&(P.setState({nodesSelectionActive:!1}),y.selected&&we?(ie({nodes:[],edges:[y]}),V.current?.blur()):re([e])),r&&r(G,y)},te=i?G=>{i(G,{...y})}:void 0,ne=l?G=>{l(G,{...y})}:void 0,ee=a?G=>{a(G,{...y})}:void 0,le=c?G=>{c(G,{...y})}:void 0,ge=d?G=>{d(G,{...y})}:void 0,ye=G=>{if(!v&&bu.includes(G.key)&&D){const{unselectNodesAndEdges:re,addSelectedEdges:ie}=P.getState();G.key==="Escape"?(V.current?.blur(),re({edges:[y]})):ie([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:L},children:o.jsxRuntimeExports.jsxs("g",{className:Ne(["react-flow__edge",`react-flow__edge-${N}`,y.className,S,{selected:y.selected,animated:y.animated,inactive:!D&&!r,updating:H,selectable:D}]),onClick:ue,onDoubleClick:te,onContextMenu:ne,onMouseEnter:ee,onMouseMove:le,onMouseLeave:ge,onKeyDown:A?ye:void 0,tabIndex:A?0:void 0,role:y.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":A?`${rd}-${j}`:void 0,ref:V,...y.domAttributes,children:[!$&&o.jsxRuntimeExports.jsx(k,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:O,sourceY:z,targetX:F,targetY:Z,sourcePosition:K,targetPosition:X,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:oe,markerEnd:J,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),I&&o.jsxRuntimeExports.jsx(s4,{edge:y,isReconnectable:I,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,sourceX:O,sourceY:z,targetX:F,targetY:Z,sourcePosition:K,targetPosition:X,setUpdateHover:B,setReconnecting:w})]})})}const r4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ld({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:h,onReconnectEnd:j,disableKeyboardA11y:E}){const{edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,onError:y}=je(r4,ve),C=ZS(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx(US,{defaultColor:e,rfId:n}),C.map(N=>o.jsxRuntimeExports.jsx(o4,{id:N,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:h,onReconnectEnd:j,rfId:n,onError:y,edgeTypes:s,disableKeyboardA11y:E},N))]})}Ld.displayName="EdgeRenderer";const i4=g.memo(Ld),l4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function a4({children:e}){const t=je(l4);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function c4(e){const t=Dt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const u4=e=>e.panZoom?.syncViewport;function d4(e){const t=je(u4),n=be();return g.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function x4(e){return e.connection.inProgress?{...e.connection,to:On(e.connection.to,e.transform)}:{...e.connection}}function p4(e){return x4}function m4(e){const t=p4();return je(t,ve)}const f4=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function h4({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:a,inProgress:c}=je(f4,ve);return!(i&&r&&c)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:Ne(["react-flow__connection",Nu(a)]),children:o.jsxRuntimeExports.jsx(Pd,{style:t,type:n,CustomComponent:s,isValid:a})})})}const Pd=({style:e,type:t=ft.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:a,fromPosition:c,to:d,toNode:x,toHandle:p,toPosition:m}=m4();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:a,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:m,connectionStatus:Nu(s),toNode:x,toHandle:p});let h="";const j={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case ft.Bezier:[h]=zu(j);break;case ft.SimpleBezier:[h]=Ed(j);break;case ft.Step:[h]=Fo({...j,borderRadius:0});break;case ft.SmoothStep:[h]=Fo(j);break;default:[h]=Zu(j)}return o.jsxRuntimeExports.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Pd.displayName="ConnectionLine";const g4={};function Al(e=g4){const t=g.useRef(e),n=be();g.useEffect(()=>{if(process.env.NODE_ENV==="development"){const s=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const r of s)if(t.current[r]!==e[r]){n.getState().onError?.("002",Ae.error002());break}t.current=e}},[e])}function j4(){const e=be(),t=g.useRef(!1);g.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",Ae.error013("react")),t.current=!0}},[])}function Td({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:h,connectionLineType:j,connectionLineStyle:E,connectionLineComponent:S,connectionLineContainerStyle:R,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:A,deleteKeyCode:I,onlyRenderVisibleElements:D,elementsSelectable:V,defaultViewport:H,translateExtent:B,minZoom:$,maxZoom:w,preventScrolling:P,defaultMarkerColor:L,zoomOnScroll:O,zoomOnPinch:z,panOnScroll:F,panOnScrollSpeed:Z,panOnScrollMode:K,zoomOnDoubleClick:X,panOnDrag:oe,onPaneClick:J,onPaneMouseEnter:ue,onPaneMouseMove:te,onPaneMouseLeave:ne,onPaneScroll:ee,onPaneContextMenu:le,paneClickDistance:ge,nodeClickDistance:ye,onEdgeContextMenu:G,onEdgeMouseEnter:re,onEdgeMouseMove:ie,onEdgeMouseLeave:we,reconnectRadius:ke,onReconnect:st,onReconnectStart:Vt,onReconnectEnd:zn,noDragClassName:$n,noWheelClassName:Vn,noPanClassName:rn,disableKeyboardA11y:ln,nodeExtent:qs,rfId:Fn,viewport:Ft,onViewportChange:an}){return Al(e),Al(t),j4(),c4(n),d4(Ft),o.jsxRuntimeExports.jsx(IS,{onPaneClick:J,onPaneMouseEnter:ue,onPaneMouseMove:te,onPaneMouseLeave:ne,onPaneContextMenu:le,onPaneScroll:ee,paneClickDistance:ge,deleteKeyCode:I,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:A,elementsSelectable:V,zoomOnScroll:O,zoomOnPinch:z,zoomOnDoubleClick:X,panOnScroll:F,panOnScrollSpeed:Z,panOnScrollMode:K,panOnDrag:oe,defaultViewport:H,translateExtent:B,minZoom:$,maxZoom:w,onSelectionContextMenu:p,preventScrolling:P,noDragClassName:$n,noWheelClassName:Vn,noPanClassName:rn,disableKeyboardA11y:ln,onViewportChange:an,isControlledViewport:!!Ft,children:o.jsxRuntimeExports.jsxs(a4,{children:[o.jsxRuntimeExports.jsx(i4,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:st,onReconnectStart:Vt,onReconnectEnd:zn,onlyRenderVisibleElements:D,onEdgeContextMenu:G,onEdgeMouseEnter:re,onEdgeMouseMove:ie,onEdgeMouseLeave:we,reconnectRadius:ke,defaultMarkerColor:L,noPanClassName:rn,disableKeyboardA11y:ln,rfId:Fn}),o.jsxRuntimeExports.jsx(h4,{style:E,type:j,component:S,containerStyle:R}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(FS,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:ye,onlyRenderVisibleElements:D,noPanClassName:rn,noDragClassName:$n,disableKeyboardA11y:ln,nodeExtent:qs,rfId:Fn}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Td.displayName="GraphView";const E4=g.memo(Td),Il=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c=.5,maxZoom:d=2,nodeOrigin:x,nodeExtent:p}={})=>{const m=new Map,h=new Map,j=new Map,E=new Map,S=s??t??[],R=n??e??[],v=x??[0,0],y=p??Cn;Yu(j,E,S);const C=Ko(R,m,h,{nodeOrigin:v,nodeExtent:y,elevateNodesOnSelect:!1});let N=[0,0,1];if(l&&r&&i){const k=In(m,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:A,y:I,zoom:D}=Gr(k,r,i,c,d,a?.padding??.1);N=[A,I,D]}return{rfId:"1",width:0,height:0,transform:N,nodes:R,nodesInitialized:C,nodeLookup:m,parentLookup:h,edges:S,edgeLookup:E,connectionLookup:j,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:Cn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Tt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:a,fitViewResolver:null,connection:{..._u},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ys,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:vu}},y4=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p})=>zy((m,h)=>{async function j(){const{nodeLookup:E,panZoom:S,fitViewOptions:R,fitViewResolver:v,width:y,height:C,minZoom:N,maxZoom:k}=h();S&&(await O5({nodes:E,width:y,height:C,panZoom:S,minZoom:N,maxZoom:k},R),v?.resolve(!0),m({fitViewResolver:null}))}return{...Il({nodes:e,edges:t,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p,defaultNodes:n,defaultEdges:s}),setNodes:E=>{const{nodeLookup:S,parentLookup:R,nodeOrigin:v,elevateNodesOnSelect:y,fitViewQueued:C}=h(),N=Ko(E,S,R,{nodeOrigin:v,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!0});C&&N?(j(),m({nodes:E,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:E,nodesInitialized:N})},setEdges:E=>{const{connectionLookup:S,edgeLookup:R}=h();Yu(S,R,E),m({edges:E})},setDefaultNodesAndEdges:(E,S)=>{if(E){const{setNodes:R}=h();R(E),m({hasDefaultNodes:!0})}if(S){const{setEdges:R}=h();R(S),m({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:S,nodeLookup:R,parentLookup:v,domNode:y,nodeOrigin:C,nodeExtent:N,debug:k,fitViewQueued:A}=h(),{changes:I,updatedInternals:D}=ny(E,R,v,y,C,N);D&&(J5(R,v,{nodeOrigin:C,nodeExtent:N}),A?(j(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),I?.length>0&&(k&&console.log("React Flow: trigger node changes",I),S?.(I)))},updateNodePositions:(E,S=!1)=>{const R=[],v=[],{nodeLookup:y,triggerNodeChanges:C}=h();for(const[N,k]of E){const A=y.get(N),I=!!(A?.expandParent&&A?.parentId&&k?.position),D={id:N,type:"position",position:I?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:S};I&&A.parentId&&R.push({id:N,parentId:A.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),v.push(D)}if(R.length>0){const{parentLookup:N,nodeOrigin:k}=h(),A=Jr(R,y,N,k);v.push(...A)}C(v)},triggerNodeChanges:E=>{const{onNodesChange:S,setNodes:R,nodes:v,hasDefaultNodes:y,debug:C}=h();if(E?.length){if(y){const N=ad(E,v);R(N)}C&&console.log("React Flow: trigger node changes",E),S?.(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:S,setEdges:R,edges:v,hasDefaultEdges:y,debug:C}=h();if(E?.length){if(y){const N=cd(E,v);R(N)}C&&console.log("React Flow: trigger edge changes",E),S?.(E)}},addSelectedNodes:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const N=E.map(k=>Ct(k,!0));y(N);return}y(Wt(v,new Set([...E]),!0)),C(Wt(R))},addSelectedEdges:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const N=E.map(k=>Ct(k,!0));C(N);return}C(Wt(R,new Set([...E]))),y(Wt(v,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:S}={})=>{const{edges:R,nodes:v,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=h(),k=E||v,A=S||R,I=k.map(V=>{const H=y.get(V.id);return H&&(H.selected=!1),Ct(V.id,!1)}),D=A.map(V=>Ct(V.id,!1));C(I),N(D)},setMinZoom:E=>{const{panZoom:S,maxZoom:R}=h();S?.setScaleExtent([E,R]),m({minZoom:E})},setMaxZoom:E=>{const{panZoom:S,minZoom:R}=h();S?.setScaleExtent([R,E]),m({maxZoom:E})},setTranslateExtent:E=>{h().panZoom?.setTranslateExtent(E),m({translateExtent:E})},setPaneClickDistance:E=>{h().panZoom?.setClickDistance(E)},resetSelectedElements:()=>{const{edges:E,nodes:S,triggerNodeChanges:R,triggerEdgeChanges:v,elementsSelectable:y}=h();if(!y)return;const C=S.reduce((k,A)=>A.selected?[...k,Ct(A.id,!1)]:k,[]),N=E.reduce((k,A)=>A.selected?[...k,Ct(A.id,!1)]:k,[]);R(C),v(N)},setNodeExtent:E=>{const{nodes:S,nodeLookup:R,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:C,nodeExtent:N}=h();E[0][0]===N[0][0]&&E[0][1]===N[0][1]&&E[1][0]===N[1][0]&&E[1][1]===N[1][1]||(Ko(S,R,v,{nodeOrigin:y,nodeExtent:E,elevateNodesOnSelect:C,checkEquality:!1}),m({nodeExtent:E}))},panBy:E=>{const{transform:S,width:R,height:v,panZoom:y,translateExtent:C}=h();return sy({delta:E,panZoom:y,transform:S,translateExtent:C,width:R,height:v})},setCenter:async(E,S,R)=>{const{width:v,height:y,maxZoom:C,panZoom:N}=h();if(!N)return Promise.resolve(!1);const k=typeof R?.zoom<"u"?R.zoom:C;return await N.setViewport({x:v/2-E*k,y:y/2-S*k,zoom:k},{duration:R?.duration,ease:R?.ease,interpolate:R?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{..._u}})},updateConnection:E=>{m({connection:E})},reset:()=>m({...Il()})}},Object.is);function Ad({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:l,initialMaxZoom:a,initialFitViewOptions:c,fitView:d,nodeOrigin:x,nodeExtent:p,children:m}){const[h]=g.useState(()=>y4({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:d,minZoom:l,maxZoom:a,fitViewOptions:c,nodeOrigin:x,nodeExtent:p}));return o.jsxRuntimeExports.jsx($y,{value:h,children:o.jsxRuntimeExports.jsx(uS,{children:m})})}function S4({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:x,nodeOrigin:p,nodeExtent:m}){return g.useContext(Fs)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Ad,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:a,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:x,nodeOrigin:p,nodeExtent:m,children:e})}const R4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function C4({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:a,onEdgeClick:c,onInit:d,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:h,onConnectStart:j,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:k,onNodeDragStart:A,onNodeDrag:I,onNodeDragStop:D,onNodesDelete:V,onEdgesDelete:H,onDelete:B,onSelectionChange:$,onSelectionDragStart:w,onSelectionDrag:P,onSelectionDragStop:L,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:F,onBeforeDelete:Z,connectionMode:K,connectionLineType:X=ft.Bezier,connectionLineStyle:oe,connectionLineComponent:J,connectionLineContainerStyle:ue,deleteKeyCode:te="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:ee=!1,selectionMode:le=Xt.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:ye=Rs()?"Meta":"Control",zoomActivationKeyCode:G=Rs()?"Meta":"Control",snapToGrid:re,snapGrid:ie,onlyRenderVisibleElements:we=!1,selectNodesOnDrag:ke,nodesDraggable:st,autoPanOnNodeFocus:Vt,nodesConnectable:zn,nodesFocusable:$n,nodeOrigin:Vn=id,edgesFocusable:rn,edgesReconnectable:ln,elementsSelectable:qs=!0,defaultViewport:Fn=eS,minZoom:Ft=.5,maxZoom:an=2,translateExtent:li=Cn,preventScrolling:Mf=!0,nodeExtent:Xs,defaultMarkerColor:kf="#b1b1b7",zoomOnScroll:Lf=!0,zoomOnPinch:Pf=!0,panOnScroll:Tf=!1,panOnScrollSpeed:Af=.5,panOnScrollMode:If=bt.Free,zoomOnDoubleClick:Of=!0,panOnDrag:Bf=!0,onPaneClick:Df,onPaneMouseEnter:Hf,onPaneMouseMove:zf,onPaneMouseLeave:$f,onPaneScroll:Vf,onPaneContextMenu:Ff,paneClickDistance:ai=0,nodeClickDistance:Zf=0,children:Kf,onReconnect:Yf,onReconnectStart:Wf,onReconnectEnd:Gf,onEdgeContextMenu:Uf,onEdgeDoubleClick:qf,onEdgeMouseEnter:Xf,onEdgeMouseMove:Qf,onEdgeMouseLeave:Jf,reconnectRadius:eh=10,onNodesChange:th,onEdgesChange:nh,noDragClassName:sh="nodrag",noWheelClassName:oh="nowheel",noPanClassName:ci="nopan",fitView:ui,fitViewOptions:di,connectOnClick:rh,attributionPosition:ih,proOptions:lh,defaultEdgeOptions:ah,elevateNodesOnSelect:ch,elevateEdgesOnSelect:uh,disableKeyboardA11y:xi=!1,autoPanOnConnect:dh,autoPanOnNodeDrag:xh,autoPanSpeed:ph,connectionRadius:mh,isValidConnection:fh,onError:hh,style:gh,id:pi,nodeDragThreshold:jh,connectionDragThreshold:Eh,viewport:yh,onViewportChange:Sh,width:Rh,height:Ch,colorMode:wh="light",debug:bh,onScroll:mi,ariaLabelConfig:vh,..._h},Nh){const Qs=pi||"1",Mh=oS(wh),kh=g.useCallback(fi=>{fi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),mi?.(fi)},[mi]);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",..._h,onScroll:kh,style:{...gh,...R4},ref:Nh,className:Ne(["react-flow",r,Mh]),id:pi,role:"application",children:o.jsxRuntimeExports.jsxs(S4,{nodes:e,edges:t,width:Rh,height:Ch,fitView:ui,fitViewOptions:di,minZoom:Ft,maxZoom:an,nodeOrigin:Vn,nodeExtent:Xs,children:[o.jsxRuntimeExports.jsx(E4,{onInit:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:l,connectionLineType:X,connectionLineStyle:oe,connectionLineComponent:J,connectionLineContainerStyle:ue,selectionKeyCode:ne,selectionOnDrag:ee,selectionMode:le,deleteKeyCode:te,multiSelectionKeyCode:ye,panActivationKeyCode:ge,zoomActivationKeyCode:G,onlyRenderVisibleElements:we,defaultViewport:Fn,translateExtent:li,minZoom:Ft,maxZoom:an,preventScrolling:Mf,zoomOnScroll:Lf,zoomOnPinch:Pf,zoomOnDoubleClick:Of,panOnScroll:Tf,panOnScrollSpeed:Af,panOnScrollMode:If,panOnDrag:Bf,onPaneClick:Df,onPaneMouseEnter:Hf,onPaneMouseMove:zf,onPaneMouseLeave:$f,onPaneScroll:Vf,onPaneContextMenu:Ff,paneClickDistance:ai,nodeClickDistance:Zf,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:F,onReconnect:Yf,onReconnectStart:Wf,onReconnectEnd:Gf,onEdgeContextMenu:Uf,onEdgeDoubleClick:qf,onEdgeMouseEnter:Xf,onEdgeMouseMove:Qf,onEdgeMouseLeave:Jf,reconnectRadius:eh,defaultMarkerColor:kf,noDragClassName:sh,noWheelClassName:oh,noPanClassName:ci,rfId:Qs,disableKeyboardA11y:xi,nodeExtent:Xs,viewport:yh,onViewportChange:Sh}),o.jsxRuntimeExports.jsx(sS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:j,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:st,autoPanOnNodeFocus:Vt,nodesConnectable:zn,nodesFocusable:$n,edgesFocusable:rn,edgesReconnectable:ln,elementsSelectable:qs,elevateNodesOnSelect:ch,elevateEdgesOnSelect:uh,minZoom:Ft,maxZoom:an,nodeExtent:Xs,onNodesChange:th,onEdgesChange:nh,snapToGrid:re,snapGrid:ie,connectionMode:K,translateExtent:li,connectOnClick:rh,defaultEdgeOptions:ah,fitView:ui,fitViewOptions:di,onNodesDelete:V,onEdgesDelete:H,onDelete:B,onNodeDragStart:A,onNodeDrag:I,onNodeDragStop:D,onSelectionDrag:P,onSelectionDragStart:w,onSelectionDragStop:L,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:ci,nodeOrigin:Vn,rfId:Qs,autoPanOnConnect:dh,autoPanOnNodeDrag:xh,autoPanSpeed:ph,onError:hh,connectionRadius:mh,isValidConnection:fh,selectNodesOnDrag:ke,nodeDragThreshold:jh,connectionDragThreshold:Eh,onBeforeDelete:Z,paneClickDistance:ai,debug:bh,ariaLabelConfig:vh}),o.jsxRuntimeExports.jsx(Jy,{onSelectionChange:$}),Kf,o.jsxRuntimeExports.jsx(Gy,{proOptions:lh,position:ih}),o.jsxRuntimeExports.jsx(Wy,{rfId:Qs,disableKeyboardA11y:xi})]})})}var w4=ud(C4);function b4(){const e=be();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const a=n?.querySelector(`.react-flow__node[data-id="${l}"]`);a&&i.set(l,{id:l,nodeElement:a,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function v4({onStart:e,onChange:t,onEnd:n}){const s=be();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function _4({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ne(["react-flow__background-pattern",n,s])})}function N4({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Ne(["react-flow__background-pattern","dots",t])})}var gt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gt||(gt={}));const M4={[gt.Dots]:1,[gt.Lines]:1,[gt.Cross]:6},k4=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Id({id:e,variant:t=gt.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:a,style:c,className:d,patternClassName:x}){const p=g.useRef(null),{transform:m,patternId:h}=je(k4,ve),j=s||M4[t],E=t===gt.Dots,S=t===gt.Cross,R=Array.isArray(n)?n:[n,n],v=[R[0]*m[2]||1,R[1]*m[2]||1],y=j*m[2],C=Array.isArray(i)?i:[i,i],N=S?[y,y]:v,k=[C[0]*m[2]||1+N[0]/2,C[1]*m[2]||1+N[1]/2],A=`${h}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:Ne(["react-flow__background",d]),style:{...c,...Ks,"--xy-background-color-props":a,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:A,x:m[0]%v[0],y:m[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:E?o.jsxRuntimeExports.jsx(N4,{radius:y/2,className:x}):o.jsxRuntimeExports.jsx(_4,{dimensions:N,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}Id.displayName="Background";const L4=g.memo(Id);function P4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function T4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function A4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 I4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 O4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Jn({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:Ne(["react-flow__controls-button",t]),...n,children:e})}const B4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Od({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:a,onInteractiveChange:c,className:d,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":h}){const j=be(),{isInteractive:E,minZoomReached:S,maxZoomReached:R,ariaLabelConfig:v}=je(B4,ve),{zoomIn:y,zoomOut:C,fitView:N}=Dt(),k=()=>{y(),i?.()},A=()=>{C(),l?.()},I=()=>{N(r),a?.()},D=()=>{j.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),c?.(!E)},V=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(Zs,{className:Ne(["react-flow__controls",V,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":h??v["controls.ariaLabel"],children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Jn,{onClick:k,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:R,children:o.jsxRuntimeExports.jsx(P4,{})}),o.jsxRuntimeExports.jsx(Jn,{onClick:A,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:o.jsxRuntimeExports.jsx(T4,{})})]}),n&&o.jsxRuntimeExports.jsx(Jn,{className:"react-flow__controls-fitview",onClick:I,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:o.jsxRuntimeExports.jsx(A4,{})}),s&&o.jsxRuntimeExports.jsx(Jn,{className:"react-flow__controls-interactive",onClick:D,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:E?o.jsxRuntimeExports.jsx(O4,{}):o.jsxRuntimeExports.jsx(I4,{})}),x]})}Od.displayName="Controls";g.memo(Od);function D4({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:a,strokeWidth:c,className:d,borderRadius:x,shapeRendering:p,selected:m,onClick:h}){const{background:j,backgroundColor:E}=i||{},S=l||j||E;return o.jsxRuntimeExports.jsx("rect",{className:Ne(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:p,onClick:h?R=>h(R,e):void 0})}const H4=g.memo(D4),z4=e=>e.nodes.map(t=>t.id),So=e=>e instanceof Function?e:()=>e;function $4({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=H4,onClick:l}){const a=je(z4,ve),c=So(t),d=So(e),x=So(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:a.map(m=>o.jsxRuntimeExports.jsx(F4,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function V4({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:a,onClick:c}){const{node:d,x,y:p,width:m,height:h}=je(j=>{const{internals:E}=j.nodeLookup.get(e),S=E.userNode,{x:R,y:v}=E.positionAbsolute,{width:y,height:C}=ut(S);return{node:S,x:R,y:v,width:y,height:C}},ve);return!d||d.hidden||!Au(d)?null:o.jsxRuntimeExports.jsx(a,{x,y:p,width:m,height:h,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:r,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const F4=g.memo(V4);var Z4=g.memo($4);const K4=200,Y4=150,W4=e=>!e.hidden,G4=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?Tu(In(e.nodeLookup,{filter:W4}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},U4="react-flow__minimap-desc";function Bd({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:a,bgColor:c,maskColor:d,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:h,onNodeClick:j,pannable:E=!1,zoomable:S=!1,ariaLabel:R,inversePan:v,zoomStep:y=10,offsetScale:C=5}){const N=be(),k=g.useRef(null),{boundingRect:A,viewBB:I,rfId:D,panZoom:V,translateExtent:H,flowWidth:B,flowHeight:$,ariaLabelConfig:w}=je(G4,ve),P=e?.width??K4,L=e?.height??Y4,O=A.width/P,z=A.height/L,F=Math.max(O,z),Z=F*P,K=F*L,X=C*F,oe=A.x-(Z-A.width)/2-X,J=A.y-(K-A.height)/2-X,ue=Z+X*2,te=K+X*2,ne=`${U4}-${D}`,ee=g.useRef(0),le=g.useRef();ee.current=F,g.useEffect(()=>{if(k.current&&V)return le.current=dy({domNode:k.current,panZoom:V,getTransform:()=>N.getState().transform,getViewScale:()=>ee.current}),()=>{le.current?.destroy()}},[V]),g.useEffect(()=>{le.current?.update({translateExtent:H,width:B,height:$,inversePan:v,pannable:E,zoomStep:y,zoomable:S})},[E,S,v,y,H,B,$]);const ge=h?re=>{const[ie,we]=le.current?.pointer(re)||[0,0];h(re,{x:ie,y:we})}:void 0,ye=j?g.useCallback((re,ie)=>{const we=N.getState().nodeLookup.get(ie).internals.userNode;j(re,we)},[]):void 0,G=R??w["minimap.ariaLabel"];return o.jsxRuntimeExports.jsx(Zs,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*F: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=="number"?l:void 0},className:Ne(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:P,height:L,viewBox:`${oe} ${J} ${ue} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:k,onClick:ge,children:[G&&o.jsxRuntimeExports.jsx("title",{id:ne,children:G}),o.jsxRuntimeExports.jsx(Z4,{onClick:ye,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:a}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${oe-X},${J-X}h${ue+X*2}v${te+X*2}h${-ue-X*2}z
39
- M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Bd.displayName="MiniMap";g.memo(Bd);const q4=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,X4={[tn.Line]:"right",[tn.Handle]:"bottom-right"};function Q4({nodeId:e,position:t,variant:n=tn.Handle,className:s,style:r=void 0,children:i,color:l,minWidth:a=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:m,autoScale:h=!0,shouldResize:j,onResizeStart:E,onResize:S,onResizeEnd:R}){const v=md(),y=typeof e=="string"?e:v,C=be(),N=g.useRef(null),k=n===tn.Handle,A=je(g.useCallback(q4(k&&h),[k,h]),ve),I=g.useRef(null),D=t??X4[n];g.useEffect(()=>{if(!(!N.current||!y))return I.current||(I.current=_y({domNode:N.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:H,transform:B,snapGrid:$,snapToGrid:w,nodeOrigin:P,domNode:L}=C.getState();return{nodeLookup:H,transform:B,snapGrid:$,snapToGrid:w,nodeOrigin:P,paneDomNode:L}},onChange:(H,B)=>{const{triggerNodeChanges:$,nodeLookup:w,parentLookup:P,nodeOrigin:L}=C.getState(),O=[],z={x:H.x,y:H.y},F=w.get(y);if(F&&F.expandParent&&F.parentId){const Z=F.origin??L,K=H.width??F.measured.width??0,X=H.height??F.measured.height??0,oe={id:F.id,parentId:F.parentId,rect:{width:K,height:X,...Iu({x:H.x??F.position.x,y:H.y??F.position.y},{width:K,height:X},F.parentId,w,Z)}},J=Jr([oe],w,P,L);O.push(...J),z.x=H.x?Math.max(Z[0]*K,H.x):void 0,z.y=H.y?Math.max(Z[1]*X,H.y):void 0}if(z.x!==void 0&&z.y!==void 0){const Z={id:y,type:"position",position:{...z}};O.push(Z)}if(H.width!==void 0&&H.height!==void 0){const K={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};O.push(K)}for(const Z of B){const K={...Z,type:"position"};O.push(K)}$(O)},onEnd:({width:H,height:B})=>{const $={id:y,type:"dimensions",resizing:!1,dimensions:{width:H,height:B}};C.getState().triggerNodeChanges([$])}})),I.current.update({controlPosition:D,boundaries:{minWidth:a,minHeight:c,maxWidth:d,maxHeight:x},keepAspectRatio:p,resizeDirection:m,onResizeStart:E,onResize:S,onResizeEnd:R,shouldResize:j}),()=>{I.current?.destroy()}},[D,a,c,d,x,p,E,S,R,j]);const V=D.split("-");return o.jsxRuntimeExports.jsx("div",{className:Ne(["react-flow__resize-control","nodrag",...V,n,s]),ref:N,style:{...r,scale:A,...l&&{[k?"backgroundColor":"borderColor"]:l}},children:i})}g.memo(Q4);const J4=(e,t)=>e.map((n,s)=>u.K.translate(n,t[s])),Dd=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ye,{path:jt(e),style:{stroke:u.ir.cssString(t)},...n}),eR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ye,{path:jt(e),style:{stroke:u.ir.cssString(t),strokeDasharray:"12,4"},...n}),tR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ye,{path:jt(e),style:{stroke:u.ir.cssString(t),strokeDasharray:"12,4,4"},...n}),nR=({points:e,color:t,...n})=>{const s=u.K.calculateMiters(e,6),r=e.map((c,d)=>u.K.translate(c,s[d])),i=e.map((c,d)=>u.K.translate(c,u.K.scale(s[d],-1))),l=u.ir.cssString(t),a=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ye,{path:jt(r),style:{stroke:l,opacity:a},...n}),o.jsxRuntimeExports.jsx(Ye,{path:jt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ye,{path:jt(i),style:{stroke:l,opacity:a},...n})]})},Ol=5,sR=(e,t)=>{const n=[],s=[];for(let a=0;a<e.length-1;a++){const c=u.K.distance(e[a],e[a+1]);s.push(c)}const r=t;let i=0,l=r;for(let a=0;a<s.length;a++){const c=s[a],d=e[a],x=e[a+1];for(;i+c>=l;){const p=(l-i)/c,m={x:d.x+p*(x.x-d.x),y:d.y+p*(x.y-d.y)};let h="x";Math.abs(x.x-d.x)<1&&(h="y"),l+=r,!(u.K.distance(m,x)<Ol||u.K.distance(m,d)<Ol)&&n.push({position:m,direction:h})}i+=c}return n},oR=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},rR=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=u.K.translateX(t,-10),l=45;return n==="y"&&(i=u.K.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},iR=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.ir.cssString(e),strokeWidth:2}),ti=e=>{const t=({points:n,color:s,...r})=>{const i=jt(n),l=sR(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ye,{path:i,...r,style:{stroke:u.ir.cssString(s)}}),l.map(({position:a,direction:c},d)=>o.jsxRuntimeExports.jsx(e,{position:a,direction:c,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},lR=ti(oR),aR=ti(rR),cR=ti(iR),jt=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],a=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*a+l.x*(1-a)},${i.y*a+l.y*(1-a)}`)}return t},Hd={pipe:Dd,electric:eR,secondary:tR,jacketed:nR,hydraulic:lR,pneumatic:aR,data:cR},zd=Dd,uR=[{key:"pipe",name:"Pipe"},{key:"electric",name:"Electric Signal"},{key:"secondary",name:"Secondary"},{key:"jacketed",name:"Jacketed"},{key:"hydraulic",name:"Hydraulic"},{key:"pneumatic",name:"Pneumatic"},{key:"data",name:"Data"}],dR=e=>o.jsxRuntimeExports.jsx(Nn,{data:uR,...e,resourceName:"Path Type"}),Ys=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Oe=(e,t)=>{const n=Ys(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return u.Ho.construct(s.position,u._.scale(u.Ho.dims(u.Ho.construct(n)),1/e.getZoom()))},xR=(e,t)=>Ws.fromFlow(e,t);class $d{node_=null;position;orientation;constructor(t,n){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 u.K.translate(u.Ho.topLeft(this.node.box),this.position)}}class Ws{key;box;handles;constructor(t,n,s){this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Oe(n,t),r=Ys(t),i=r.getElementsByClassName("react-flow__handle"),l=u.Ho.construct(r),a=Array.from(i).map(c=>{const d=u.Ho.center(u.Ho.construct(c)),x=u.K.translation(u.Ho.topLeft(l),d),p=c.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=u.K$1.construct(p[0]);return new $d(x,m)});return new Ws(t,s,a)}}const pR=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:a,connectionStatus:c})=>{const x=document.querySelector(".react-flow__handle-connecting")?.className.match(/react-flow__handle-(\w+)/);if(x!=null){const j=u.K$1.outer.safeParse(x[1]);j.success&&(i=j.data)}const p=Dt(),m=Kt({sourcePos:u.K.construct(e,t),targetPos:u.K.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Oe(p,l?.id??""),targetBox:Oe(p,l?.id??"")}),h=Wc(u.K.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(zd,{points:h,style:{...a,stroke:u.ir.cssString(c==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l11)"),strokeWidth:2,fill:"none"}})},mR=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:a=[],onSegmentsChange:c,color:d="var(--pluto-gray-l11)",selected:x=!1,variant:p="pipe",...m})=>{const h=u.K.construct(m.sourceX,m.sourceY),j=g.useRef(h),E=u.K.equals(h,j.current),S=u.K.construct(m.targetX,m.targetY),R=g.useRef(S),v=u.K.equals(S,R.current),y=Dt(),[C,N,k]=f.useCombinedStateAndRef(()=>a.length>0?a:Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),A=g.useRef(i),I=g.useRef(s),D=Pe.useDebouncedCallback(c,100,[c]);if(!E||!v){let w=C;const P=u.K.translation(j.current,h),L=u.K.translation(S,R.current);u.K.equals(P,u.K.scale(L,-1),.001)?(j.current=h,R.current=S):(E?v||(w=C2({delta:L,segments:w}),A.current!==i&&(A.current=i,w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),Ti({sourcePos:h,targetPos:S,next:w,prev:C})||(w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),R.current=S):(w=R2({delta:P,segments:w}),I.current!==s&&(I.current=s,w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),Ti({sourcePos:h,targetPos:S,next:w,prev:C})||(w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),j.current=h),D(w),N(w))}const V=g.useRef(null),H=Pe.useCursorDrag({onStart:g.useCallback((w,P,L)=>{V.current={index:Number(L.currentTarget.id.split("-")[1]),segments:[...k.current]}},[]),onMove:g.useCallback(w=>{if(V.current==null)return;const P=j2({segments:V.current.segments,index:V.current.index,magnitude:u.Ho.dim(w,u.g.swap(V.current.segments[V.current.index].direction),!0)/y.getZoom()});N(P)},[]),onEnd:g.useCallback(()=>c(k.current),[c])}),B=Wc(h,C,y.getZoom(),!0),$=Hd[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx($,{points:B,color:d}),x&&fR(B).map((w,P)=>{const L=C[P].direction,O=u.g.swap(L),z={[u.g.dimension(L)]:"18px",[u.g.dimension(O)]:"4px"},F={[L]:w[L]-9,[O]:w[O]-2};return o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...z,...F,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:w.x-9,y:w.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${P}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(L)),draggable:!0,onDragStart:H})})]},P)})]})},fR=e=>e.slice(1).map((t,n)=>{const s=e[n];return u.K.construct((t.x+s.x)/2,(t.y+s.y)/2)}),hR=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.K.ZERO,zoom:1}})=>{const[r,i]=g.useState(n),[l,a]=g.useState(e),[c,d]=g.useState(t),[x,p]=g.useState(s),[m,h]=g.useState(!1);return{viewport:x,onViewportChange:p,edges:c,nodes:l,onNodesChange:a,onEdgesChange:d,editable:r,onEditableChange:i,fitViewOnResize:m,setFitViewOnResize:h}},gR=()=>!0,jR={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},ER={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},Go={maxZoom:1,minZoom:.5,padding:.05},yR={hideAttribution:!0},Vd=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Bn=()=>g.use(Vd),Fd=g.memo(({children:e})=>{const{registerNodeRenderer:t}=Bn();return g.useEffect(()=>t(e),[t,e]),null});Fd.displayName="NodeRenderer";const SR=["Backspace","Delete"],RR=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:r,onEditableChange:i,editable:l,viewport:a,triggers:c,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:p,visible:m,dragHandleSelector:h,...j})=>{const E=f.useMemoDeepEqual({visible:m}),[{path:S},,R]=f.use$2({aetherKey:e,type:_.Diagram$1.TYPE,schema:_.diagramStateZ,initialState:{position:a.position,region:u.Ho.ZERO,zoom:a.zoom,...E}}),{fitView:v}=Dt(),y=Pe.useDebouncedCallback(G=>void v(G),50,[v]),C=Ln(g.useCallback(G=>{x&&y(Go),R(re=>({...re,region:G}))},[R,y,x]));g.useEffect(()=>R(G=>({...G,...E})),[E]);const N=u.ir.hex(f.use().colors.gray.l11),k=f.useMemoCompare(()=>c??br.zoom,f.compareModeConfigs,[c]),A=g.useRef(null),I=g.useCallback(G=>{const re=A.current;re!=null&&re.x===G.x&&re.y===G.y&&re.zoom===G.zoom||(A.current=G,!(isNaN(G.x)||isNaN(G.y)||isNaN(G.zoom))&&(R(ie=>({...ie,position:G,zoom:G.zoom})),d(Jc(G))))},[R,d]);v4({onStart:I,onChange:I,onEnd:I});const[D,V]=g.useState(()=>()=>null),H=g.useCallback(G=>V(()=>G),[]),B=g.useMemo(()=>({custom:({id:G,positionAbsoluteX:re,positionAbsoluteY:ie,selected:we=!1,draggable:ke=!0})=>D({symbolKey:G,position:{x:re,y:ie},selected:we,draggable:ke})}),[D]),$=g.useRef(r),w=g.useMemo(()=>($.current=r,zr(r)),[r]),P=g.useRef(s),L=g.useMemo(()=>(P.current=s,Hr(s,h)),[s,h]),O=g.useCallback(G=>t(eu(P.current,re=>ad(G,re)),G),[t]),z=g.useCallback(G=>n(ns($.current,re=>cd(G,re),N)),[n,N]),F=g.useCallback((G,re)=>n(ns($.current,ie=>Y5(G,re,ie),N)),[]),Z=g.useCallback(G=>n(ns($.current,re=>Fu(G,re),N)),[n,N]),K=g.useCallback((G,re)=>{const ie=[...$.current],we=ie.findIndex(ke=>ke.key===G);we!==-1&&(ie[we]={...ie[we],segments:re},$.current=ie,n(ie))},[n]),X=l?jR:ER,oe=f.useSyncedRef(K),J=g.useMemo(()=>({default:G=>o.jsxRuntimeExports.jsx(mR,{...G,segments:G.data?.segments??[],color:G.data?.color,variant:G.data?.variant,onSegmentsChange:g.useCallback(re=>oe.current(G.id,re),[G.id])},G.id)}),[]),ue=g.useRef(null);f.use$1({triggers:k.zoomReset,callback:g.useCallback(({stage:G,cursor:re})=>{const ie=ue.current;ie==null||G!=="start"||!u.Ho.contains(ie,re)||v()},[v])});const te=f.purgeMouse(k.select)[0]??null,ne=f.purgeMouse(k.pan)[0]??null,ee=f.purgeMouse(k.zoom)[0]??null,le={selectionOnDrag:te==null,panOnDrag:ne==null,selectionKeyCode:te,panActivationKeyCode:ne,zoomActivationKeyCode:ee},ge=f.useCombinedRefs(ue,C),ye=g.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:H,fitViewOnResize:x,setFitViewOnResize:p}),[l,m,i,H,x]);return o.jsxRuntimeExports.jsx(Vd,{value:ye,children:o.jsxRuntimeExports.jsx(f.Composite,{path:S,children:m&&o.jsxRuntimeExports.jsx(w4,{...le,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(l),u.CSS.BE("symbol","container")),nodes:L,edges:w,nodeTypes:B,edgeTypes:J,ref:ge,fitView:!0,onNodesChange:O,onEdgesChange:z,onConnect:Z,onReconnect:F,defaultViewport:Qc(a),connectionLineComponent:pR,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:gR,connectionMode:Tt.Loose,fitViewOptions:Go,selectionMode:Xt.Partial,proOptions:yR,deleteKeyCode:SR,...j,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...j.style},...X,nodesDraggable:l})})})},CR=()=>{const{editable:e}=Bn();return e?o.jsxRuntimeExports.jsx(L4,{}):null},wR=e=>o.jsxRuntimeExports.jsx(f.Box,{pack:!0,borderColor:5,className:u.CSS.BE("diagram","controls"),...e}),bR=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=Bn();return o.jsxRuntimeExports.jsx(Yl.Toggle,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",tooltip:`${n?"Disable":"Enable"} editing`,...t,children:n?o.jsxRuntimeExports.jsx(f.EditOff,{}):o.jsxRuntimeExports.jsx(f.Edit,{})})},vR=({onClick:e,...t})=>{const{fitView:n}=Dt(),{fitViewOnResize:s,setFitViewOnResize:r}=Bn();return o.jsxRuntimeExports.jsx(Yl.Toggle,{onClick:i=>{n(Go),e?.(i)},value:s,onChange:r,rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",...t,children:o.jsxRuntimeExports.jsx(f.Expand,{})})},_R=e=>o.jsxRuntimeExports.jsx(Ad,{children:o.jsxRuntimeExports.jsx(RR,{...e})}),NR=Object.freeze(Object.defineProperty({__proto__:null,Background:CR,Controls:wR,DefaultPath:zd,Diagram:_R,FitViewControl:vR,HandleLayout:$d,NodeLayout:Ws,NodeRenderer:Fd,PATHS:Hd,SelectPathType:dR,ToggleEditControl:bR,alignNodes:_2,calcPath:jt,edgeConverter:ns,edgeZ:b2,nodeConverter:eu,nodeZ:v2,offsetPath:J4,rfEdgeDataZ:Uc,selectNode:Ys,selectNodeBox:Oe,selectNodeLayout:xR,translateEdgesBackward:Xc,translateEdgesForward:zr,translateNodesBackward:qc,translateNodesForward:Hr,translateViewportBackward:Jc,translateViewportForward:Qc,use:hR,useContext:Bn,viewportZ:w2},Symbol.toStringTag,{value:"Module"})),MR=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(f.Summary,{center:!0,level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...a})=>{const c=f.useMemoDeepEqual({font:t,color:i,telem:l,visible:s}),[,{scrolling:d,empty:x},p]=f.use$2({type:_.Log.TYPE,schema:_.logState,initialState:{empty:!0,region:u.Ho.ZERO,scrolling:!1,wheelPos:0,...c}});g.useEffect(()=>{p(h=>({...h,...c}))},[c,p]);const m=Ln(g.useCallback(h=>p(j=>({...j,region:h})),[p]));return o.jsxRuntimeExports.jsx("div",{ref:m,className:u.CSS(u.CSS.B("log"),n),onWheel:h=>{p(j=>({...j,wheelPos:j.wheelPos-h.deltaY,scrolling:j.scrolling?j.scrolling:h.deltaY<0}))},...a,children:x?r:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("log","live"),d&&u.CSS.M("active")),variant:"outlined",onClick:()=>p(h=>({...h,scrolling:!h.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",tooltipLocation:u.K$1.BOTTOM_LEFT,children:o.jsxRuntimeExports.jsx(f.Dynamic,{})})})},kR=Object.freeze(Object.defineProperty({__proto__:null,Log:MR},Symbol.toStringTag,{value:"Module"})),LR="Schematic.Grid",Gs=u.CSS.B("drag-handle"),PR=e=>{const n=Ys(e).closest(".react-flow__pane");n!=null&&f.triggerReflow(n)},Dn=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${LR}`,[a,c]=g.useState(!1),d=g.useMemo(()=>f.canDropOfType(l),[l]),x=f.useSyncedRef(i),{startDrag:p,onDragEnd:m,...h}=f.useDragAndDrop({type:l,canDrop:d,onDrop:g.useCallback(({items:R})=>(c(!1),R),[]),onDragOver:g.useCallback(R=>{const{items:v}=R;c(d(R)),v.forEach(({key:y})=>x.current(y,e))},[])}),j=r.filter(R=>R.location===e),E=g.useCallback((R,v)=>{p([{key:v,type:l}]),document.addEventListener("mousemove",m,{once:!0})},[p,l,m]),S=d(f.useDraggingState());return o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e),u.CSS.dropRegion(S),a&&u.CSS.B("dragging-over"),S&&u.CSS.B("dragging")),onDragLeave:()=>c(!1),empty:!0,...h,children:j.map(({element:R,key:v})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(R,{draggable:!0,onDragStart:y=>E(y,v),onDragEnd:m,style:{...R.props.style,cursor:"grab"}})},v))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r;if(i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(c=>c.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e)),empty:!0,children:a.map(({element:c,key:d})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:c},d))})}},TR=Dn("top"),AR=Dn("left"),IR=Dn("right"),OR=Dn("bottom"),BR=Dn("center"),Ht=({editable:e,allowRotate:t=!0,children:n,allowCenter:s,onRotate:r,symbolKey:i,...l})=>{const a=g.useRef(e);return e!==a.current&&(PR(i),a.current=e),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(TR,{editable:e,symbolKey:i,...l},`top-${i}`),o.jsxRuntimeExports.jsx(AR,{editable:e,symbolKey:i,...l},`left-${i}`),o.jsxRuntimeExports.jsx(IR,{editable:e,symbolKey:i,...l},`right-${i}`),o.jsxRuntimeExports.jsx(OR,{editable:e,symbolKey:i,...l},`bottom-${i}`),s&&o.jsxRuntimeExports.jsx(BR,{editable:e,symbolKey:i,...l},`center-${i}`),e&&t&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.BE("grid","rotate"),size:"tiny",variant:"filled",onClick:r,children:o.jsxRuntimeExports.jsx(f.Rotate,{})}),o.jsxRuntimeExports.jsx("div",{className:Gs,children:n})]})},DR=_.MODES,HR=({aetherKey:e,sink:t,mode:n})=>{const s=f.useMemoDeepEqual({sink:t,mode:n}),r=g.useRef({trigger:0,...s}),{setState:i}=f.useLifecycle({aetherKey:e,type:_.Button.TYPE,schema:_.buttonStateZ,initialState:r.current});g.useEffect(()=>{r.current={...r.current,...s},i(r.current)},[s,i,e]);const l=g.useCallback(()=>{r.current.trigger+=_.MOUSE_UP_INCREMENT,i(r.current)},[i]),a=g.useCallback(()=>{r.current.trigger+=_.MOUSE_DOWN_INCREMENT,i(r.current)},[i]);return{onClick:l,onMouseDown:a,onMouseUp:l}},zR=e=>o.jsxRuntimeExports.jsxs(fe.Buttons,{...e,keys:DR,children:[o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"fire",tooltip:"Output true when clicked",children:"Fire"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"momentary",tooltip:"Output true on press, false on release",children:"Momentary"}),o.jsxRuntimeExports.jsx(fe.Button,{itemKey:"pulse",tooltip:"Output true and then immediately output false on click",children:"Pulse"})]}),$R=({value:e,hideOuter:t=!1,showOuterCenter:n=!1,hideInner:s,onChange:r})=>{const{outer:i}=e,l=c=>()=>r({...e,...c}),a=u.CSS.B("select","orientation");return t?o.jsxRuntimeExports.jsx(Bl,{className:a,value:e,onChange:r}):o.jsxRuntimeExports.jsxs(f.Box,{className:a,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(rt,{selected:i==="top",onClick:l({outer:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(rt,{selected:i==="left",onClick:l({outer:"left"})}),o.jsxRuntimeExports.jsx(Bl,{hideInner:s,value:e,onChange:r,showOuterCenter:n}),o.jsxRuntimeExports.jsx(rt,{selected:i==="right",onClick:l({outer:"right"})})]}),o.jsxRuntimeExports.jsx(rt,{selected:i==="bottom",onClick:l({outer:"bottom"})})]})},Bl=({value:e,onChange:t,className:n,hideInner:s=!1,showOuterCenter:r=!1,...i})=>{const{inner:l}=e,a=x=>()=>t({...e,...x});let c={};s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"});let d=null;return r?d=o.jsxRuntimeExports.jsx(rt,{selected:e.outer==="center",onClick:a({outer:"center"})}):d=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="top",onClick:a({inner:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="left",onClick:a({inner:"left"})}),o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="right",onClick:a({inner:"right"})})]}),o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="bottom",onClick:a({inner:"bottom"})})]}),o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(n,u.CSS.B("value"),r&&u.CSS.M("show-outer-center")),y:!0,align:"center",justify:"center",empty:!0,...i,children:d})},rt=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),size:"tiny",...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Le=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),gap:t==="x"?"large":"medium",...n}),yt=({hideOuter:e,hideInner:t,showOuterCenter:n,...s})=>t&&e?null:o.jsxRuntimeExports.jsx(Ee,{label:"Orientation",padHelpText:!1,...s,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx($R,{value:{inner:r.orientation??"top",outer:r.label?.orientation??"top"},hideInner:t,hideOuter:e,showOuterCenter:n,onChange:l=>i({...r,orientation:l.inner,label:{...r.label,orientation:l.outer}})})}),dt=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ee,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Text$2,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx(He,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(nn,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(Ee,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(fe.SelectAlignment,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(Ee,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(gc,{value:n,onChange:s,yDirection:"down"})})]}),De=e=>o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(Pe.Swatch,{value:t??u.ir.setAlpha(u.ir.ZERO,1),onChange:n,...r,bordered:!0})}),Zd=e=>o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),xe=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(De,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(Ee,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(f.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(Zd,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:t,hideOuter:n})]}),VR=({path:e})=>{const{value:t,onChange:n}=Et(e),s=_.sourcePipelinePropsZ.parse(t.source?.props),r=_.sinkPipelinePropsZ.parse(t.sink?.props),i=_.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=_.setChannelValuePropsZ.parse(r.segments.setter.props),a=d=>{d??=0;const x=_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:d}),threshold:_.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{d??=0;const x=_.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:_.setChannelValue({channel:d}),setpoint:_.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=_.authoritySource({channel:d}),m=_.acquireChannelControl({channel:d,authority:255});n({...t,sink:x,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:m,source:p},indicator:{statusSource:p}}})};return o.jsxRuntimeExports.jsxs(Le,{x:!0,grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Mt,{value:i.channel,onChange:a})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Mt,{value:l.channel,onChange:c})}),o.jsxRuntimeExports.jsx(Ns,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},ni=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Se=({hideInnerOrientation:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(VR,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{hideInnerOrientation:e})}},[e]),n=Me.useStatic({tabs:ni,content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n})},mt={y:2,x:.25},jn={lower:0,upper:2e3},Dl={lower:0,upper:51},Kd=({includeBorderRadius:e=!1,includeStrokeWidth:t=!1})=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(De,{path:"color"}),o.jsxRuntimeExports.jsx(De,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Dl,endContent:"%",...n})}),o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Dl,endContent:"%",...n})}),e&&o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:jn,endContent:"px",...n})}),t&&o.jsxRuntimeExports.jsx(Ee,{path:"strokeWidth",hideIfNull:!0,optional:!0,label:"Border Width",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:{lower:0,upper:21},endContent:"px",...n})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.width",label:"Width",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:jn,endContent:"px",...s})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.height",label:"Height",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:jn,endContent:"px",...s})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0,showOuterCenter:!0,label:"Label Location"})]}),FR=()=>o.jsxRuntimeExports.jsx(Le,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(De,{path:"color"}),o.jsxRuntimeExports.jsx(De,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(He,{path:"rotation",label:"Rotation",inputProps:{dragScale:{x:1,y:.25},bounds:{lower:0,upper:360},endContent:"°"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"numSides",label:"Number of Sides",inputProps:{dragScale:{x:.5,y:.1},bounds:{lower:3,upper:21}},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"sideLength",label:"Side Length",inputProps:{dragScale:{x:1,y:1},bounds:{lower:10,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"cornerRounding",label:"Corner Rounding",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:181},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),ZR=()=>o.jsxRuntimeExports.jsx(Le,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(De,{path:"color"}),o.jsxRuntimeExports.jsx(De,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(He,{path:"radius",label:"Radius",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),Yd=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],KR={dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"},YR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Le,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsx(Or,{path:""}),";"]});case"redline":return o.jsxRuntimeExports.jsx(Le,{y:!0,empty:!0,children:o.jsxRuntimeExports.jsx(Ir,{path:"redline"})});default:return o.jsxRuntimeExports.jsxs(Le,{x:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(De,{path:"color"}),o.jsxRuntimeExports.jsx(Ee,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(f.Text$2,{...s})}),o.jsxRuntimeExports.jsx(He,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:KR}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(nn,{value:s,onChange:r})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:Yd,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},WR=({path:e})=>{const{value:t,onChange:n}=Et(e),s=_.sourcePipelinePropsZ.parse(t.source?.props),r=_.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=_.withinBoundsProps.parse(s.segments.threshold.props),l=d=>{d??=0;const x=_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:d}),threshold:_.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:x})},a=d=>{const x=_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:r.channel}),threshold:_.withinBounds({trueBound:d})},outlet:"threshold"});n({...t,source:x})},[c]=Ms(r.channel);return g.useEffect(()=>n({...t}),[c]),o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Mt,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.lower??.9,onChange:d=>a({...i.trueBound,lower:d})})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.upper??1.1,onChange:d=>a({...i.trueBound,upper:d})})})]})},GR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(WR,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{})}},[]),t=Me.useStatic({tabs:Yd,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},UR=({path:e})=>{const{value:t,onChange:n}=Et(e),s=_.sinkPipelinePropsZ.parse(t.sink?.props),r=_.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=_.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:_.setChannelValue({channel:l}),setpoint:_.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),c=_.authoritySource({channel:l}),d=_.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}}})};return o.jsxRuntimeExports.jsxs(Le,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Output Channel",grow:!0,padHelpText:!1,children:o.jsxRuntimeExports.jsx(Mt,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx(He,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0,padHelpText:!1}),o.jsxRuntimeExports.jsx(Ns,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0,padHelpText:!1})]}),o.jsxRuntimeExports.jsx(Ee,{path:"mode",label:"Mode",optional:!0,children:({value:l,onChange:a})=>o.jsxRuntimeExports.jsx(zR,{value:l,onChange:a})})]})},qR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(UR,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Me.useStatic({tabs:ni,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},XR=({path:e})=>{const{value:t,onChange:n}=Et(e),s=_.sinkPipelinePropsZ.parse(t.sink?.props),r=_.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=_.sinkPipeline("number",{connections:[],segments:{setter:_.setChannelValue({channel:l})},inlet:"setter"}),c=_.authoritySource({channel:l}),d=_.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}},disabled:l==0})};return o.jsxRuntimeExports.jsx(Le,{x:!0,grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(Te.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Mt,{value:r.channel,onChange:i})})})},QR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(XR,{path:""});default:return o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",grow:!0,gap:"small",children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(ur,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(Ee,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(ia,{value:s,onChange:r})}),o.jsxRuntimeExports.jsx(De,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:ni,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},JR=()=>{const e=Et("autoFit",{optional:!0});return o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ee,{path:"value",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(f.Text$2,{...t})}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Text Size",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(nn,{value:t,onChange:n})}),o.jsxRuntimeExports.jsx(Ee,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(fe.SelectAlignment,{value:t,onChange:n})})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(De,{path:"color"}),o.jsxRuntimeExports.jsx(Ee,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(f.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(f.Button,{onClick:()=>e?.onChange(!0),disabled:e?.value===!0,variant:"outlined",tooltip:e?.value===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:o.jsxRuntimeExports.jsx(f.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:""})]})},eC=()=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(De,{path:"color"})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideOuter:!0})]}),tC=()=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(De,{path:"color"}),o.jsxRuntimeExports.jsx(De,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:jn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:jn,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0})]}),zt=()=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(De,{path:"color"}),o.jsxRuntimeExports.jsx(Zd,{path:"scale"}),o.jsxRuntimeExports.jsx(Ns,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(yt,{path:""})]}),nC=()=>o.jsxRuntimeExports.jsx(Kd,{includeBorderRadius:!0,includeStrokeWidth:!0}),sC=()=>o.jsxRuntimeExports.jsx(Se,{hideInnerOrientation:!0}),T=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),he=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),_e=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),pe=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),oC={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}},rC=(e,t)=>oC[t][e],iC=(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}},lC=(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},W=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=b4()}catch{return null}const r=g.useRef(null),i=g.useRef(!0);return g.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const a=r.current.closest(".react-flow__node")?.getAttribute("data-id");a!=null&&s?.(a)},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},b=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...a})=>{const c=lC(i,s,t,n);return o.jsxRuntimeExports.jsx(_n,{position:iC(rC(e,t),!r),...a,type:"source",onClick:d=>d.stopPropagation(),className:(u.CSS.B("handle"),u.CSS.BE("handle",a.id)),style:{left:`${c.left}%`,top:`${c.top}%`,...l}})},me=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("symbol-primitive"),u.CSS.B("symbol-primitive-toggle"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),e),color:u.ir.cssString(r),...i}),ae=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),aC=.8,q=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...a})=>{e=u.g.construct(t)==="y"?u._.swap(e):e;const d=u.ir.cssString(r),x=f.use();let p={...i,aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*aC).width};return r!=null&&(p={...p,[u.CSS.var("symbol-color")]:u.ir.rgbString(r),[u.CSS.var("symbol-color-contrast")]:u.ir.rgbString(u.ir.pickByContrast(r,x.colors.gray.l0,x.colors.gray.l11))}),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u._.svgViewBox(e),className:u.CSS(u.CSS.loc(t),s),fill:d,stroke:d,...a,style:p,children:o.jsxRuntimeExports.jsx("g",{children:n})})},Wd=({className:e,orientation:t="left",scale:n,color:s,...r})=>{const i=u.ir.cssString(s);return o.jsxRuntimeExports.jsxs(me,{...r,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:12.037,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:87.963,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:7.2916,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:92.6084,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:108,height:96},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(T,{d:"M3.02937 72.7038C2.50936 73.1041 2.50936 73.8883 3.02937 74.2886L7.14001 77.453C7.79757 77.9592 8.75 77.4904 8.75 76.6606V70.3318C8.75 69.502 7.79757 69.0332 7.14001 69.5394L3.02937 72.7038Z",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M54.2 48L17.0545 29.2035C15.059 28.1937 12.7 29.6438 12.7 31.8803V64.1197C12.7 66.3562 15.059 67.8063 17.0545 66.7965L54.2 48ZM54.2 48L91.3455 29.2035C93.341 28.1937 95.7 29.6438 95.7 31.8803V64.1197C95.7 66.3562 93.341 67.8063 91.3455 66.7965L54.2 48Z"}),o.jsxRuntimeExports.jsx(T,{d:"M54.2 48L35.4035 85.1455C34.3937 87.141 35.8439 89.5 38.0803 89.5H70.3197C72.5562 89.5 74.0063 87.141 72.9965 85.1455L54.2 48ZM54.2 48L35.4035 10.8545C34.3937 8.85901 35.8439 6.5 38.0803 6.5H70.3197C72.5562 6.5 74.0063 8.85901 72.9965 10.8545L54.2 48Z"}),o.jsxRuntimeExports.jsx(T,{d:"M8.70001 73.5C24.7 73.5 28.7 86.8333 28.7 93.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M105.371 23.2962C105.891 22.8959 105.891 22.1117 105.371 21.7114L101.26 18.547C100.602 18.0408 99.65 18.5096 99.65 19.3394V25.6682C99.65 26.498 100.602 26.9668 101.26 26.4606L105.371 23.2962Z",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M99.7 22.5C83.7 22.5 79.7 9.16667 79.7 2.5",strokeLinecap:"round"})]})]})},Gd=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(me,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),Ud=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(me,{...s,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(T,{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"})})]}),qd=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(me,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(T,{className:u.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"}),o.jsxRuntimeExports.jsx(pe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(he,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Xd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Qd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(pe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),Jd=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(ae,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M7 39.5V11.5941C7 9.42886 9.22384 7.97669 11.2063 8.84738L76.7937 37.6526C78.7762 38.5233 81 37.0711 81 34.9059V6",strokeLinecap:"round"})]})]})},ex=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(ae,{orientation:t,className:u.CSS(u.CSS.B("check-valve-with-arrow"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.602,top:60.65,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.775,top:60.65,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:93,height:57},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M67.4706 5.20759C67.9906 5.6079 67.9906 6.3921 67.4706 6.79241L63.36 9.95678C62.7024 10.463 61.75 9.99421 61.75 9.16437V2.83563C61.75 2.00579 62.7024 1.53702 63.36 2.04322L67.4706 5.20759Z",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M62.5 6H32.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(_e,{cx:"7.5",cy:"13.5",r:"6",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M49 34.5L11.8545 15.7035C9.85901 14.6937 7.5 16.1438 7.5 18.3803V50.6197C7.5 52.8562 9.85901 54.3063 11.8545 53.2965L49 34.5ZM49 34.5L86.1455 15.7035C88.141 14.6937 90.5 16.1438 90.5 18.3803V50.6197C90.5 52.8562 88.141 54.3063 86.1455 53.2965L49 34.5Z"})]})]})},tx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),nx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(T,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 28.8486L80.6455 39.5202C82.641 40.5299 85 39.0798 85 36.8434V4.60396C85 2.36751 82.641 0.917381 80.6455 1.92716L60.5 12.3486"})]})]}),sx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(T,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(T,{d:"M35.3737 38.7499L24.7021 58.8954C23.6923 60.8909 25.1425 63.2499 27.3789 63.2499H59.6183C61.8548 63.2499 63.3049 60.8909 62.2951 58.8954L51.8737 38.7499"})]})]}),ox=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 2 L43.5 39.7965"})]})]}),rx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(_e,{cx:"43.5",cy:"21",r:"10",fill:u.ir.cssString(e)})]})]}),ix=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"43.5",cy:"21",r:"10",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),lx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"91",cy:"49.5",r:"6",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(_e,{cx:"8",cy:"7.5",r:"6",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(T,{d:"M49.5 28.5L12.3545 9.70349C10.359 8.69372 8 10.1438 8 12.3803V44.6197C8 46.8562 10.359 48.3063 12.3545 47.2965L49.5 28.5ZM49.5 28.5L86.6455 9.70349C88.641 8.69372 91 10.1438 91 12.3803V44.6197C91 46.8562 88.641 48.3063 86.6455 47.2965L49.5 28.5Z"})]})]}),ax=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),cx=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=u.ir.cssString(t);return o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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}),o.jsxRuntimeExports.jsx(T,{d:"M33 24H2",strokeLinecap:"round"})]})]})},ux=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),dx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{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"})})]}),xx=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(T,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),px=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(pe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),mx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{color:n,dimensions:{width:72,height:36},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 33V22",strokeLinecap:"round"})]})]}),Hl=(e,t)=>e/t*100,fx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{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"})})]}),hx=e=>typeof e=="number"?{topLeft:u.K.construct(e),topRight:u.K.construct(e),bottomLeft:u.K.construct(e),bottomRight:u.K.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:u.K.construct(e.topLeft),topRight:u.K.construct(e.topRight),bottomLeft:u.K.construct(e.bottomLeft),bottomRight:u.K.construct(e.bottomRight)}:e,cC=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},gx={width:40,height:80},si={x:50,y:10},Us=({className:e,dimensions:t=gx,borderRadius:n=si,boxBorderRadius:s,color:r,backgroundColor:i,strokeWidth:l=2,...a})=>{const c=hx(n),d=s==null,x=f.use(),{width:p,height:m}=t,h=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,m,p]),j=Hl(1,p),E=100-j,S=Hl(1,m),R=100-S;return o.jsxRuntimeExports.jsx(ae,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??cC(c),borderColor:u.ir.cssString(r??x.colors.gray.l11),backgroundColor:u.ir.cssString(i),borderWidth:l},...a,children:o.jsxRuntimeExports.jsxs(W,{refreshDeps:h,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:S,id:"1"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:j,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:E,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:R,id:"4"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:j,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:E,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:j,top:50,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:E,top:50,id:"8"})]})})},uC=20,dC=(e,t,n=0,s=4)=>{const r=2*Math.PI/e,i=n*Math.PI/180,l=t/(2*Math.sin(Math.PI/e)),a=l+s/2;return Array.from({length:e}).map((c,d)=>{const x=r*d+i-Math.PI/2;return{x:a+l*Math.cos(x),y:a+l*Math.sin(x)}})},xC=(e,t,n)=>{const s=[],r=Math.min(n,t/2),i=e.length;if(i<3||r<=0)return`M ${e.map(l=>`${l.x},${l.y}`).join(" L ")} Z`;for(let l=0;l<i;l++){const a=e[(l-1+i)%i],c=e[l],d=e[(l+1)%i],x=c.x-a.x,p=c.y-a.y,m=d.x-c.x,h=d.y-c.y,j=Math.hypot(x,p),E=Math.hypot(m,h),S=r/j,R=r/E,v=c.x-x*S,y=c.y-p*S,C=c.x+m*R,N=c.y+h*R;l===0?s.push(`M ${v},${y}`):s.push(`L ${v},${y}`),s.push(`Q ${c.x},${c.y} ${C},${N}`)}return s.push("Z"),s.join(" ")},oi=({numSides:e,sideLength:t,rotation:n=0,color:s,backgroundColor:r,className:i,cornerRounding:l,strokeWidth:a,...c})=>{const d=f.use(),x=g.useMemo(()=>2*((a??2)+1),[a]),p=g.useMemo(()=>dC(e,t,n,x),[e,t,n,x]),m=g.useMemo(()=>xC(p,t,l??0),[p,t,l]),h=g.useMemo(()=>2*(t/(2*Math.sin(Math.PI/e)))+x,[t,e,x]);return o.jsxRuntimeExports.jsx(ae,{className:u.CSS(i,u.CSS.B("polygon")),...c,children:o.jsxRuntimeExports.jsx(q,{dimensions:{width:h,height:h},children:o.jsxRuntimeExports.jsx(T,{d:m,fill:u.ir.cssString(r??d.colors.gray.l1),stroke:u.ir.cssString(s??d.colors.gray.l9),strokeWidth:a??2})})})},jx=({radius:e,color:t,backgroundColor:n,className:s,strokeWidth:r,...i})=>{const l=(r??2)+1,a=e*2,c=a+2*l,d=a+2*l;return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(s,u.CSS.B("circle-shape")),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:"left",refreshDeps:e,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:l/d*100,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:(d-l)/d*100,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:l/c*100,top:50,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:(c-l)/c*100,top:50,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:c,height:d},children:o.jsxRuntimeExports.jsx(_e,{cx:c/2,cy:d/2,r:e,stroke:u.ir.cssString(t),strokeWidth:r??2,fill:u.ir.cssString(n)})})]})},Ex=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(pe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),yx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("regulator-manual")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:2.2989,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.381,top:75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.619,top:75,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:84},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M43.5 20L43.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M19.5 2L67.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 63L6.35453 44.2035C4.35901 43.1937 2 44.6438 2 46.8803V79.1197C2 81.3562 4.35901 82.8063 6.35453 81.7965L43.5 63ZM43.5 63L80.6455 44.2035C82.641 43.1937 85 44.6438 85 46.8803V79.1197C85 81.3562 82.641 82.8063 80.6455 81.7965L43.5 63Z"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(pe,{x1:"43.5",y1:"63",x2:"43.5",y2:"40"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 20V18C43.5 16.3431 44.8431 15 46.5 15H79.5C81.1569 15 82.5 16.3431 82.5 18V34.4281C82.5 35.4126 82.017 36.3344 81.2076 36.8947L43.5 63"})]})]}),Sx=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(T,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Rx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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:u.ir.cssString(n)}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),Cx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(me,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(pe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),wx=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:a=80,...c})=>{const d=u.ir.cssString(t),x=f.use(),p=t==null?"var(--pluto-gray-l0)":u.ir.cssString(u.ir.pickByContrast(t,x.colors.gray.l0,x.colors.gray.l11));return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("value"),e),...c,style:{borderColor:d,height:n?.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n?.width,inlineSize:a,maxWidth:n?.width},children:l}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:o.jsxRuntimeExports.jsx(f.Text,{level:i,color:p,children:r})})]})},bx=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(ae,{orientation:n,children:[o.jsxRuntimeExports.jsx(f.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),vx=({onClick:e,onMouseDown:t,onMouseUp:n,orientation:s="left",label:r="",color:i,size:l,level:a,onClickDelay:c})=>o.jsxRuntimeExports.jsxs(ae,{orientation:s,children:[o.jsxRuntimeExports.jsx(f.Button,{variant:"filled",onClick:e,onMouseDown:t,onMouseUp:n,color:i,size:l,level:a,onClickDelay:c,children:r}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:s,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:s,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:s,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]})]}),_x=({className:e,orientation:t="left",width:n,color:s,level:r,autoFit:i,align:l="center",value:a,onChange:c,...d})=>{const x={textAlign:l};return u.g.construct(t)==="y"?x.height=i?"fit-content":n:x.width=i?"fit-content":n,o.jsxRuntimeExports.jsx(ae,{style:x,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),...d,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS.BE("symbol","label"),color:u.ir.cssString(s),level:r,value:a,onChange:c})})},Nx=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:a,size:c="small",disabled:d,...x})=>{const[p,m]=g.useState(r);return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(f.Numeric,{size:c,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:l,borderWidth:1,disabled:d,children:o.jsxRuntimeExports.jsx(f.Button,{size:c,variant:"filled",onClick:()=>a(p),color:l,children:"Set"})})]})},Mx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),kx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"})})]}),Lx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{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:u.CSS(u.CSS.M("detail"),t)})]})]}),Px=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Tx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Ax=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(pe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Ix=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"})})]}),Ox=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.29885,top:69.565,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.70115,top:69.565,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:23.1479,top:23.61,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:11.11,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:76.8521,top:23.61,id:"5"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M43.5 49L6.35453 30.2035C4.35901 29.1937 2 30.6438 2 32.8803V65.1197C2 67.3562 4.35901 68.8063 6.35453 67.7965L43.5 49ZM43.5 49L80.6455 30.2035C82.641 29.1937 85 30.6438 85 32.8803V65.1197C85 67.3562 82.641 68.8063 80.6455 67.7965L43.5 49Z"}),o.jsxRuntimeExports.jsx(he,{x:"21",y:"6.5",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M43 6.5V4C43 2.34315 44.3431 1 46 1H79C80.6569 1 82 2.34315 82 4V20.4281C82 21.4126 81.517 22.3344 80.7076 22.8947L43 49"}),o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"49",x2:"43",y2:"24.5"})]})]}),Bx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("regulator-motorized")),...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:35.6321,top:13.72549,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:1.96078,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:64.3679,top:13.72549,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:24.1379,top:46.078,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:75.8621,top:46.078,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:78.43137,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:78.43137,id:"7"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:102},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M43.5 80.5L6.35453 61.7035C4.35901 60.6937 2 62.1438 2 64.3803V96.6197C2 98.8562 4.35901 100.306 6.35453 99.2965L43.5 80.5ZM43.5 80.5L80.6455 61.7035C82.641 60.6937 85 62.1438 85 64.3803V96.6197C85 98.8562 82.641 100.306 80.6455 99.2965L43.5 80.5Z"}),o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"80.5",x2:"43",y2:"56"}),o.jsxRuntimeExports.jsx(T,{d:"M43 38V35.5C43 33.8431 44.3431 32.5 46 32.5H79C80.6569 32.5 82 33.8431 82 35.5V51.9281C82 52.9126 81.517 53.8344 80.7076 54.3947L43 80.5"}),o.jsxRuntimeExports.jsx(he,{x:"21",y:"38",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M43 38V26",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(_e,{cx:"43",cy:"14",r:"12"})]})]}),Dx=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(me,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:1,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:86},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43 1L45 65"})]})]}),Hx=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(me,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),zx=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(me,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(he,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),$x=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(he,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(pe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Vx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(pe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(pe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(pe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(he,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Fx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(pe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),Zx=({id:e,className:t,orientation:n="right",label:s="text",color:r,level:i="p",onLabelChange:l,...a})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const d=u.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...a,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.ir.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.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"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Kx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Yx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(pe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(pe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(pe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Wx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("flow-straightener"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:93,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2.5",y:"2.5",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M10.5 26.5H60.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M10.5 9.5H60.5",strokeLinecap:"round"})]})]}),Gx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("heater-element"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:11.9,top:5.55555556,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:11.9,top:94,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:21,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M2.5 34.0005H14.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M2.5 2.00049L14.5 2.00049",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M14.3793 10.0013C14.9046 10.0013 15.4248 10.1048 15.9101 10.3058C16.3954 10.5068 16.8363 10.8015 17.2078 11.1729C17.5792 11.5443 17.8738 11.9853 18.0749 12.4706C18.2759 12.9559 18.3793 13.4761 18.3793 14.0013C18.3793 14.5266 18.2759 15.0468 18.0749 15.5321C17.8738 16.0174 17.5792 16.4583 17.2078 16.8298C16.8363 17.2012 16.3954 17.4958 15.9101 17.6969C15.4248 17.8979 14.9046 18.0013 14.3793 18.0013"}),o.jsxRuntimeExports.jsx(T,{d:"M14.5 2.00049C15.0253 2.00049 15.5454 2.10395 16.0307 2.30497C16.516 2.50599 16.957 2.80063 17.3284 3.17206C17.6999 3.5435 17.9945 3.98445 18.1955 4.46975C18.3965 4.95506 18.5 5.4752 18.5 6.00049C18.5 6.52578 18.3965 7.04592 18.1955 7.53122C17.9945 8.01652 17.6999 8.45748 17.3284 8.82892C16.957 9.20035 16.516 9.49499 16.0307 9.69601C15.5454 9.89703 15.0253 10.0005 14.5 10.0005"}),o.jsxRuntimeExports.jsx(T,{d:"M14.5 18.0005C15.0253 18.0005 15.5454 18.104 16.0307 18.305C16.516 18.506 16.957 18.8006 17.3284 19.1721C17.6999 19.5435 17.9945 19.9845 18.1955 20.4698C18.3965 20.9551 18.5 21.4752 18.5 22.0005C18.5 22.5258 18.3965 23.0459 18.1955 23.5312C17.9945 24.0165 17.6999 24.4575 17.3284 24.8289C16.957 25.2003 16.516 25.495 16.0307 25.696C15.5454 25.897 15.0253 26.0005 14.5 26.0005"}),o.jsxRuntimeExports.jsx(T,{d:"M14.6206 25.9995C15.1459 25.9995 15.6661 26.103 16.1514 26.304C16.6367 26.505 17.0776 26.7997 17.4491 27.1711C17.8205 27.5425 18.1151 27.9835 18.3162 28.4688C18.5172 28.9541 18.6206 29.4742 18.6206 29.9995C18.6206 30.5248 18.5172 31.0449 18.3162 31.5302C18.1151 32.0155 17.8205 32.4565 17.4491 32.8279C17.0776 33.1994 16.6367 33.494 16.1514 33.695C15.6661 33.896 15.1459 33.9995 14.6206 33.9995"})]})]}),Ux=({className:e,dimensions:t=gx,borderRadius:n=si,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const a=hx(n),c=f.use(),d=g.useMemo(()=>[t,n,a],[a.bottomLeft,a.bottomRight,a.topLeft,a.topRight,t.height,t.width]),x=u.ir.cssString(r??c.colors.gray.l11),p=i==null?void 0:u.ir.cssString(i),m=t.width/66,h=t.height/180,j=`scale(${m},${h})`;return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[o.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:j,children:o.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:x,transform:j,fill:p})}),o.jsxRuntimeExports.jsxs(W,{refreshDeps:d,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},qx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(me,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:l}),o.jsxRuntimeExports.jsx(T,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:l}),o.jsxRuntimeExports.jsx(_e,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(T,{d:"M45 4C45 3.44772 44.5523 3 44 3C43.4477 3 43 3.44772 43 4H45ZM37.5777 24.7889L38.0249 23.8944L37.5777 24.7889ZM37.5777 21.2111L38.0249 22.1056L37.5777 21.2111ZM50.4223 31.2111L49.9751 32.1056L50.4223 31.2111ZM37.5777 44.7889L37.1305 45.6833L37.5777 44.7889ZM37.5777 41.2111L37.1305 40.3167L37.5777 41.2111ZM42.8944 47.4472L42.4472 48.3416L42.8944 47.4472ZM45 52V49.2361H43V52H45ZM43.3416 46.5528L38.0249 43.8944L37.1305 45.6833L42.4472 48.3416L43.3416 46.5528ZM38.0249 42.1056L50.8695 35.6833L49.9751 33.8944L37.1305 40.3167L38.0249 42.1056ZM50.8695 30.3167L38.0249 23.8944L37.1305 25.6833L49.9751 32.1056L50.8695 30.3167ZM38.0249 22.1056L50.8695 15.6833L49.9751 13.8944L37.1305 20.3167L38.0249 22.1056ZM50.8695 10.3167L45.5528 7.65836L44.6584 9.44721L49.9751 12.1056L50.8695 10.3167ZM45 6.76393V4H43V6.76393H45ZM45.5528 7.65836C45.214 7.48897 45 7.1427 45 6.76393H43C43 7.90025 43.642 8.93904 44.6584 9.44721L45.5528 7.65836ZM50.8695 15.6833C53.0806 14.5777 53.0807 11.4223 50.8695 10.3167L49.9751 12.1056C50.7121 12.4741 50.7121 13.5259 49.9751 13.8944L50.8695 15.6833ZM38.0249 23.8944C37.2879 23.5259 37.2879 22.4741 38.0249 22.1056L37.1305 20.3167C34.9193 21.4223 34.9194 24.5777 37.1305 25.6833L38.0249 23.8944ZM50.8695 35.6833C53.0806 34.5777 53.0807 31.4223 50.8695 30.3167L49.9751 32.1056C50.7121 32.4741 50.7121 33.5259 49.9751 33.8944L50.8695 35.6833ZM38.0249 43.8944C37.2879 43.5259 37.2879 42.4741 38.0249 42.1056L37.1305 40.3167C34.9193 41.4223 34.9194 44.5777 37.1305 45.6833L38.0249 43.8944ZM45 49.2361C45 48.0998 44.358 47.061 43.3416 46.5528L42.4472 48.3416C42.786 48.511 43 48.8573 43 49.2361H45Z",fill:l,strokeWidth:1})]})]})},Xx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(me,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),o.jsxRuntimeExports.jsx(T,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(T,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),o.jsxRuntimeExports.jsx(_e,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(T,{d:"M21 53.0105V50.0225C21 49.3397 20.6516 48.704 20.0759 48.3366L15.6419 45.507C14.4098 44.7207 14.4098 42.9214 15.6419 42.1351L26.3581 35.2965C27.5902 34.5102 27.5902 32.7109 26.3581 31.9246L15.6419 25.0859C14.4098 24.2997 14.4098 22.5003 15.6419 21.714L26.3581 14.8754C27.5902 14.0891 27.5902 12.2898 26.3581 11.5035L21.9241 8.67393C21.3484 8.30656 21 7.67087 21 6.98798V4",stroke:l,strokeLinecap:"round"})]})]})},Qx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:22.3095,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1538,top:22.3095,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:92.8571,id:"3"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:21},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M1.5 5.5V3.5C1.5 2.39543 2.39543 1.5 3.5 1.5H35.5C36.6046 1.5 37.5 2.39543 37.5 3.5V5.5C37.5 6.60457 36.6046 7.5 35.5 7.5H24.5C23.3954 7.5 22.5 8.39543 22.5 9.5V17.5C22.5 18.6046 21.6046 19.5 20.5 19.5H18.5C17.3954 19.5 16.5 18.6046 16.5 17.5V9.5C16.5 8.39543 15.6046 7.5 14.5 7.5H3.5C2.39543 7.5 1.5 6.60457 1.5 5.5Z",fill:u.ir.cssString(n),stroke:"none"})})]}),Jx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1539,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50.5,top:96.1539,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.5,top:3.8462,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:39},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M22.5 35.5C22.5 36.6046 21.6046 37.5 20.5 37.5H18.5C17.3954 37.5 16.5 36.6046 16.5 35.5V24.5C16.5 23.3954 15.6046 22.5 14.5 22.5H3.5C2.39543 22.5 1.5 21.6046 1.5 20.5V18.5C1.5 17.3954 2.39543 16.5 3.5 16.5H14.5C15.6046 16.5 16.5 15.6046 16.5 14.5V3.5C16.5 2.39543 17.3954 1.5 18.5 1.5H20.5C21.6046 1.5 22.5 2.39543 22.5 3.5V14.5C22.5 15.6046 23.3954 16.5 24.5 16.5H35.5C36.6046 16.5 37.5 17.3954 37.5 18.5V20.5C37.5 21.6046 36.6046 22.5 35.5 22.5H24.5C23.3954 22.5 22.5 23.3954 22.5 24.5V35.5Z",fill:u.ir.cssString(n),stroke:"none"})})]}),Fe=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:e?.x??57,y:e?.y??27,style:{fill:u.ir.cssString(t),fontWeight:450},stroke:"none",children:"F"}),ep=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Fe,{position:{x:56,y:25},color:s})]})]}),tp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Fe,{position:{x:58,y:29},color:s})]})]}),np=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(T,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(T,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(T,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Fe,{color:s})]})]}),sp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Fe,{position:{x:58,y:29},color:s})]})]}),op=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Fe,{color:s})]})]}),rp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Fe,{position:{x:56,y:29},color:s})]})]}),ip=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(_e,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(_e,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Fe,{position:{x:56,y:29},color:s})]})]}),lp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Fe,{color:s})]})]}),ap=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Fe,{color:s})]})]}),cp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Fe,{color:s})]})]}),up=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Fe,{color:s})]})]}),dp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Orifice"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 33V22",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Fe,{color:s})]})]}),xp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(T,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(T,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"})]})]}),pp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(T,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),mp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(he,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(he,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(he,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(pe,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),fp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 62C29.2204 62 27.3855 61.332 25.5927 59.9086C23.791 58.4782 22.0952 56.3316 20.6377 53.5381C19.1829 50.7496 18.0147 47.4106 17.214 43.7054C16.4137 40.0021 16 36.0237 16 32C16 27.9763 16.4137 23.9979 17.214 20.2946C18.0147 16.5895 19.1829 13.2504 20.6377 10.4619C22.0952 7.66841 23.791 5.52179 25.5927 4.09136C27.3855 2.66801 29.2204 2 31 2",strokeWidth:"2"})]})]}),hp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M50.3827 20.3601C47.1902 21.7605 43.4002 22.8046 39.2752 23.4077C35.1519 24.0105 30.8103 24.1557 26.5584 23.8319C22.3057 23.508 18.2597 22.7238 14.7044 21.5418C11.1449 20.3584 8.19358 18.8149 6.03181 17.0454M6.02374 46.9613C8.18198 45.1925 11.129 43.6491 14.6841 42.465C18.2349 41.2824 22.2765 40.4968 26.5256 40.1707C30.774 39.8447 35.113 39.9871 39.2353 40.5866C43.3592 41.1864 47.15 42.2268 50.3455 43.6237",strokeLinecap:"round"})]})]}),gp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z",strokeLinecap:"round"})})]}),jp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(_e,{cx:"33",cy:"33",r:"14.5"})]})]}),Ep=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(T,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(T,{d:"M35 53.6V45.6"})]})]}),yp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(T,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(T,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(T,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(T,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(T,{d:"M36 38.196L40 45.1242"})]})]}),Sp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M49.1214 16.2515C43.5325 21.3055 36.2463 24.0711 28.7115 23.9986C21.1766 23.9262 13.945 21.0209 8.45428 15.8604M8.4838 50.112C13.9718 44.968 21.1918 42.0733 28.7133 42.0014C36.2348 41.9295 43.5089 44.6858 49.0942 49.7239"})]})]}),Rp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(me,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M3 33H63"})]})]}),Cp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M16.5 2.5L16.5 66.5M2.5 34.5H30.5M2.5 18.9848H30.5M2.5 50.0152H30.5M5.3 66.5H27.7C29.2464 66.5 30.5 65.1976 30.5 63.5909V5.40909C30.5 3.80244 29.2464 2.5 27.7 2.5H5.3C3.7536 2.5 2.5 3.80245 2.5 5.40909V63.5909C2.5 65.1976 3.7536 66.5 5.3 66.5Z",strokeLinecap:"round"})})]}),wp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(T,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(T,{d:"M29.12 65.62L61 34.5"})]})]}),bp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"})]})]}),vp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(T,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(pe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(pe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),_p=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(T,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(T,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(T,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(pe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(pe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Np=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(T,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(T,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(T,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(T,{d:"M78.4994 37.5101C78.4914 37.8382 78.4028 38.1592 78.2414 38.445C78.0801 38.7307 77.8509 38.9723 77.574 39.1486C77.2972 39.3248 76.9813 39.4302 76.6541 39.4555C76.3269 39.4808 75.9986 39.4252 75.698 39.2936"})]})]}),Mp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:18.75,top:17.46,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:1.5873,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:81.25,top:17.46,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:126},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"12",y:"1.6667",width:"40",height:"40",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M1.3333 124H62.6667",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M50.1883 41.6667C41.7748 41.6667 35.0143 46.3333 42.6923 59.3333C59.3476 87.5333 63.6327 119 62.855 124",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M14 41.6667C22.4135 41.6667 29.174 46.3333 21.496 59.3333C4.84066 87.5333 0.555555 119 1.33333 124",strokeLinecap:"round"})]})]}),kp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Lp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(he,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(T,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),pC=({aetherKey:e,source:t})=>{const n=f.useMemoDeepEqual({source:t}),[,{enabled:s},r]=f.use$2({aetherKey:e,type:_.Light.TYPE,schema:_.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},mC=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{value:r},i]=f.use$2({aetherKey:e,type:_.Setpoint.TYPE,schema:_.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{i(a=>({...a,...s}))},[s,i]),{set:g.useCallback(a=>i(c=>({...c,trigger:c.trigger+1,command:a})),[i]),value:r}},fC=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{triggered:r,enabled:i},l]=f.use$2({aetherKey:e,type:_.Toggle.TYPE,schema:_.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return g.useEffect(()=>{l(c=>({...c,...s}))},[s,l]),{toggle:g.useCallback(()=>l(c=>({...c,triggered:!c.triggered})),[l]),triggered:r,enabled:i}},on=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:a}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS(u.CSS.BE("symbol","label"),u.CSS.dir(i)),level:s,value:n,onChange:c=>t?.({label:{...e,label:c}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:a}}),location:r}},ri=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(f.Box,{direction:u.g.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),gap:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Pc,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(Ic,{...i})]}),location:l}},Re=(e,t)=>{const n=({symbolKey:s,control:r,source:i,sink:l,label:a,onChange:c,selected:d,orientation:x="left",position:p,...m})=>{const{enabled:h,triggered:j,toggle:E}=fC({aetherKey:s,source:i,sink:l}),S=[],R=on(a,c);R!=null&&S.push(R);const v=ri(r);return v!=null&&S.push(v),o.jsxRuntimeExports.jsx(Ht,{editable:d,symbolKey:s,items:S,onRotate:()=>c({orientation:u.K$1.rotate90(x)}),onLocationChange:(y,C)=>{y==="label"&&c({label:{...a,orientation:C}}),y==="control"&&c({control:{...r,orientation:C}})},...t?.grid,children:o.jsxRuntimeExports.jsx(e,{enabled:h,triggered:j,onClick:E,orientation:x,...m})})};return n.displayName=e.displayName,n},de=(e,t)=>{const n=({symbolKey:s,label:r,onChange:i,selected:l,position:a,orientation:c="left",...d})=>{const x=[],p=on(r,i);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Ht,{...t?.grid,items:x,editable:l,symbolKey:s,onRotate:()=>i({orientation:u.K$1.rotate90(c)}),onLocationChange:(m,h)=>{m==="label"&&i({label:{...r,orientation:h}})},children:o.jsxRuntimeExports.jsx(e,{orientation:c,...d})})};return n.displayName=e.displayName,n},St=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,position:l,orientation:a="left",enabled:c=!1,clickable:d=!1,...x})=>{const p=[],m=on(s,r);m!=null&&p.push(m);const h=()=>{d&&r({enabled:!c})};return o.jsxRuntimeExports.jsx(Ht,{items:p,editable:i,symbolKey:n,onRotate:()=>r({orientation:u.K$1.rotate90(a)}),onLocationChange:(j,E)=>{j==="label"&&r({label:{...s,orientation:E}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:c,onClick:h,...x})})};return t.displayName=e.displayName,t},Pp=Re(Gd),Tp=Re(Ud),Ap=Re(qd),Ip=Re(Wd),Op=Re(tx),Bp=Re(ax),Dp=Re(fp),Hp=Re(hp),zp=Re(kx),$p=Re(Lx),Vp=Re(Px),Fp=Re(Ax),Zp=Re(Dx),Kp=Re(Hx),Yp=Re(zx),Wp=Re($x),Gp=Re(Vx),Up=Re(Fx),qp=Re(Mx),Xp=Re(gp),Qp=Re(jp),Jp=Re(Ep),em=Re(yp),tm=Re(Sp),nm=Re(Rp),sm=Re(rx),om=Re(ix),rm=Re(nx),im=Re(sx),lm=Re(ox),am=de(Ex),cm=de(yx),um=de(Ox),dm=de(Bx),xm=de(cx),pm=de(dx),mm=de(xx),fm=de(fx),hm=de(Qd),gm=de(Jd),jm=de(ex),Em=de(Sx),ym=Re(bx,{grid:{allowRotate:!1}}),Sm=de(Kx),Rm=de(mx),Cm=de(Yx),wm=de(Wx),bm=de(Gx),vm=de(ux),_m=de(Qx),Nm=de(Jx,{grid:{allowRotate:!1}}),Mm=de(Tx),km=de(ep),Lm=de(tp),Pm=de(np),Tm=de(sp),Am=de(op),Im=de(rp),Om=de(ip),Bm=de(lp),Dm=de(ap),Hm=de(cp),zm=de(up),$m=de(dp),Vm=de(xp),Fm=de(pp),Zm=de(mp),Km=de(Cp),Ym=de(bp),Wm=de(wp),Gm=de(vp),Um=de(_p),qm=de(Np),Xm=de(Mp),Qm=de(kp),Jm=de(Lp),ef=St(Rx),tf=St(Xd),nf=St(qx),sf=St(Xx),of=St(px),rf=St(Cx),lf=St(lx),af=de(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Us,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e}),{grid:{allowCenter:!0,allowRotate:!1}}),cf=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50}}),hC=de(({sideLength:e,rotation:t,color:n,backgroundColor:s,numSides:r,...i})=>o.jsxRuntimeExports.jsx(oi,{numSides:3,sideLength:e,rotation:t,color:n,backgroundColor:s,...i})),uf=de(({numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})=>o.jsxRuntimeExports.jsx(oi,{numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})),df=de(({radius:e,color:t,backgroundColor:n,strokeWidth:s,...r})=>o.jsxRuntimeExports.jsx(jx,{radius:e,color:t,backgroundColor:n,strokeWidth:s,...r}),{grid:{allowRotate:!1}}),xf=de(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i,strokeWidth:l})=>o.jsxRuntimeExports.jsx(Us,{onResize:a=>n({dimensions:a}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e,strokeWidth:l}),{grid:{allowCenter:!0,allowRotate:!1}}),pf=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50},borderRadius:0}),mf=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:a,onChange:c,selected:d,draggable:x,size:p,disabled:m})=>{const{value:h,set:j}=mC({aetherKey:t,source:i,sink:l}),E=[],S=ri(s);S!=null&&E.push(S);const R=on(e,c);return R!=null&&E.push(R),o.jsxRuntimeExports.jsx(Ht,{symbolKey:t,allowRotate:!1,editable:d&&!x,onRotate:()=>c({orientation:u.K$1.rotate90(n)}),items:E,onLocationChange:(v,y)=>{v==="label"&&c({label:{...e,orientation:y}})},children:o.jsxRuntimeExports.jsx(Nx,{value:h,onChange:j,units:r,color:a,orientation:n,disabled:m,size:p})})},ff=({className:e,...t})=>o.jsxRuntimeExports.jsx(Nx,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:u.CSS(u.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(f.Text,{children:"10.0"})}),gC=u.K.construct(10,-1),jC=u.K.construct(1,1),hf=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:a,onChange:c,inlineSize:d=70,selected:x,draggable:p,notation:m,redline:h})=>{const j=ws.useTypography(n),E=(j.lineHeight+.5)*j.baseSize+2,S=g.useMemo(()=>{if(l==null||h==null)return;const{bounds:C,gradient:N}=h;return _.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:l,scale:_.scaleNumber({scale:u.C.Scale.scale(C).scale(0,1).transform}),gradient:_.colorGradient({gradient:N})},outlet:"gradient"})},[l,h]),{width:R}=Br({aetherKey:e,color:r,level:n,box:u.Ho.construct(u.K.translateY({...s},1),{height:E,width:d}),telem:l,backgroundTelem:S,minWidth:d,notation:m,useWidthForBackground:!0,valueBackgroundOverScan:gC,valueBackgroundShift:jC}),v=[],y=on(t,c);return y!=null&&v.push(y),o.jsxRuntimeExports.jsx(Ht,{editable:x&&!p,symbolKey:e,items:v,allowRotate:!1,onLocationChange:(C,N)=>{C==="label"&&c({label:{...t,orientation:N}})},children:o.jsxRuntimeExports.jsx(wx,{color:i,dimensions:{height:E,width:R},inlineSize:d,units:a,unitsLevel:M.downLevel(n)})})},gf=({color:e})=>o.jsxRuntimeExports.jsx(wx,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(f.Text,{children:"50.00"})}),jf=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:a,mode:c,...d})=>{const{onMouseDown:x,onMouseUp:p}=HR({aetherKey:e,sink:s,mode:c}),m=[],h=ri(r);return h!=null&&m.push(h),o.jsxRuntimeExports.jsx(Ht,{onRotate:()=>a({orientation:u.K$1.rotate90(n)}),allowRotate:!1,editable:i,symbolKey:e,items:m,onLocationChange:(j,E)=>{j==="label"&&a({label:{...t,orientation:E}})},children:o.jsxRuntimeExports.jsx(vx,{...t,onMouseDown:x,onMouseUp:p,orientation:n,...d})})},Ef=({label:e,...t})=>o.jsxRuntimeExports.jsx(vx,{label:"Button",...t}),yf=({symbolKey:e,label:t,source:n,onChange:s,selected:r,...i})=>{const{enabled:l}=pC({aetherKey:e,source:n}),a=[],c=on(t,s);return c!=null&&a.push(c),o.jsxRuntimeExports.jsx(Ht,{items:a,allowRotate:!1,editable:r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:o.jsxRuntimeExports.jsx(Ix,{enabled:l,...i})})},Sf=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(Zx,{className:Gs,onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),Rf=({label:e,...t})=>o.jsxRuntimeExports.jsx(Zx,{label:"Off Page",...t,orientation:"right"}),Cf=de(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Ux,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),wf=e=>o.jsxRuntimeExports.jsx(Ux,{...e,dimensions:{width:25,height:50}}),bf=({onChange:e,symbolKey:t,color:n,width:s,align:r,autoFit:i,level:l,value:a})=>o.jsxRuntimeExports.jsx(_x,{className:Gs,onChange:c=>e({value:c}),value:a,level:l,color:n,width:s,align:r,autoFit:i},t),vf=e=>o.jsxRuntimeExports.jsx(_x,{...e,autoFit:!0,value:"Text Box"}),U=4,Hn=2,EC=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","electricRegulatorMotorized","filter","flowStraightener","heaterElement","checkValveWithArrow","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","flowmeterOrifice","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","regulatorManual","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","polygon","circle","textBox","threeWayValve","vacuumPump","value","valve","vent","tJunction","crossJunction","heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","diaphragmPump","ejectionPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation","thruster","nozzle","strainer","strainerCone"],yC=se.z.enum(EC),ce={orientation:"left",scale:1},SC={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"})},RC={...ce,source:_.sourcePipeline("number",{connections:[],segments:{valueStream:_.streamChannelValue({channel:0})},outlet:"valueStream"})},CC={...ce,sink:_.sinkPipeline("number",{connections:[],segments:{setter:_.setChannelValue({channel:0})},inlet:"setter"})},_f={...ce,source:_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:0}),threshold:_.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Nf={...ce,control:{show:!0},sink:_.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:_.setChannelValue({channel:0}),setpoint:_.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Ce={..._f,...Nf},$t={...ce,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),wC={width:125,height:200},ii={dimensions:wC},bC=3,vC={name:"Three Way Valve",key:"threeWayValve",Form:Se,Symbol:Pp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three Way Valve"),...Ce}),Preview:Gd,zIndex:U},_C={name:"Valve",key:"valve",Form:Se,Symbol:Tp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Valve"),...Ce}),Preview:Ud,zIndex:U},NC={name:"Solenoid Valve",key:"solenoidValve",Form:Se,Symbol:Ap,defaultProps:e=>({color:e.colors.gray.l11,...Y("Solenoid Valve"),normallyOpen:!1,...Ce}),Preview:qd,zIndex:U},MC={name:"Four Way Valve",key:"fourWayValve",Form:Se,Symbol:Ip,defaultProps:e=>({color:e.colors.gray.l11,...Y("Four Way Valve"),...Ce}),Preview:Wd,zIndex:U},kC={name:"Angled Valve",key:"angledValve",Form:Se,Symbol:Op,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Valve"),...Ce}),Preview:tx,zIndex:U},LC={name:"Ball Valve",key:"ballValve",Form:Se,Symbol:rm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ball Valve"),...Ce}),Preview:nx,zIndex:U},PC={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:Se,Symbol:im,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three-Way Ball Valve"),...Ce}),Preview:sx,zIndex:U},TC={name:"Gate Valve",key:"gateValve",Form:Se,Symbol:lm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Gate Valve"),...Ce}),Preview:ox,zIndex:U},AC={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:Se,Symbol:sm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Remote)"),...Ce}),Preview:rx,zIndex:U},IC={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:Se,Symbol:om,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Manual)"),...Ce}),Preview:ix,zIndex:U},OC={name:"Breather Valve",key:"breatherValve",Form:zt,Symbol:lf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Breather Valve"),...$t}),Preview:Ge(lx,["clickable"]),zIndex:U},BC={name:"Pump",key:"pump",Form:Se,Symbol:Bp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pump"),...Ce}),Preview:ax,zIndex:U},DC={name:"Screw Pump",key:"screwPump",Form:Se,Symbol:qp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Screw Pump"),...Ce}),Preview:Mx,zIndex:U},HC={name:"Tank",key:"tank",Form:Kd,Symbol:af,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Tank"),borderRadius:si,...ii,...ce}),Preview:cf,zIndex:Hn},zC={name:"Polygon",key:"polygon",Symbol:uf,Form:FR,defaultProps:e=>({numSides:6,sideLength:uC,cornerRounding:0,rotation:0,color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),strokeWidth:2,...Y("Polygon")}),Preview:Ge(oi,["clickable"]),zIndex:Hn},$C={name:"Circle",key:"circle",Symbol:df,Form:ZR,defaultProps:e=>({radius:20,color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Circle"),strokeWidth:2}),Preview:Ge(jx,["clickable"]),zIndex:Hn},VC={name:"Cylinder",key:"cylinder",Form:tC,Symbol:Cf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("cylinder"),dimensions:{width:66,height:181},...ce}),Preview:wf,zIndex:Hn},FC={name:"Box",key:"box",Form:nC,Symbol:xf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Box"),borderRadius:bC,strokeWidth:2,...ii,...ce}),Preview:pf,zIndex:Hn},ZC={name:"Relief Valve",key:"reliefValve",Form:zt,Symbol:tf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Relief Valve"),...$t}),Preview:Ge(Xd,["clickable"]),zIndex:U},KC={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:zt,Symbol:nf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Spring Loaded Relief Valve"),...$t}),Preview:Ge(qx,["clickable"]),zIndex:U},YC={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:zt,Symbol:sf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Spring Loaded Relief Valve"),...$t}),Preview:Ge(Xx,["clickable"]),zIndex:U},WC={name:"Regulator",key:"regulator",Form:xe,Symbol:am,defaultProps:e=>({color:e.colors.gray.l11,...Y("Regulator"),...ce}),Preview:Ex,zIndex:U},GC={name:"Manual Regulator",key:"regulatorManual",Form:xe,Symbol:cm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Regulator"),...ce}),Preview:Ge(yx,["clickable"]),zIndex:U},UC={name:"Electric Regulator",key:"electricRegulator",Form:xe,Symbol:um,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator"),...ce}),Preview:Ox,zIndex:U},qC={name:"Electric Regulator Motorized",key:"electricRegulatorMotorized",Form:xe,Symbol:dm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator Motorized"),...ce}),Preview:Bx,zIndex:U},XC={name:"Burst Disc",key:"burstDisc",Form:xe,Symbol:xm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Burst Disc"),...ce}),Preview:cx,zIndex:U},QC={name:"ISO Burst Disc",key:"isoBurstDisc",Form:xe,Symbol:vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Burst Disc"),...ce}),Preview:ux,zIndex:U},JC={name:"Cap",key:"cap",Form:xe,Symbol:pm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cap"),...ce}),Preview:dx,zIndex:U},e6={name:"ISO Cap",key:"isoCap",Form:xe,Symbol:mm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Cap"),...ce}),Preview:xx,zIndex:U},t6={name:"Manual Valve",key:"manualValve",Form:zt,Symbol:of,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Valve"),...$t}),Preview:Ge(px,["clickable"]),zIndex:U},n6={name:"Orifice Plate",key:"orificePlate",Form:xe,Symbol:Rm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Plate"),...ce}),Preview:mx,zIndex:U},s6={name:"ISO Filter",key:"isoFilter",Form:xe,Symbol:Cm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Filter"),...ce}),Preview:Yx,zIndex:U},o6={name:"Filter",key:"filter",Form:xe,Symbol:fm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Filter"),...ce}),Preview:fx,zIndex:U},r6={name:"Flow Straightener",key:"flowStraightener",Form:xe,Symbol:wm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flow Straightener"),...ce}),Preview:Wx,zIndex:U},i6={name:"Heater Element",key:"heaterElement",Form:xe,Symbol:bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Heater Element"),...ce}),Preview:Gx,zIndex:U},l6={name:"Needle Valve",key:"needleValve",Form:zt,Symbol:ef,defaultProps:e=>({color:e.colors.gray.l11,...Y("Needle Valve"),...$t}),Preview:Ge(Rx,["clickable"]),zIndex:U},a6={name:"Check Valve",key:"checkValve",Form:xe,Symbol:hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ce}),Preview:Qd,zIndex:U},c6={name:"Orifice",key:"orifice",Form:xe,Symbol:Em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice"),...ce}),Preview:Sx,zIndex:U},u6={name:"Angled Relief Valve",key:"angledReliefValve",Form:zt,Symbol:rf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Relief Valve"),...$t}),Preview:Ge(Cx,["clickable"]),zIndex:U},d6={name:"Value",key:"value",Form:YR,Symbol:hf,Preview:gf,defaultProps:e=>({color:e.colors.gray.l11,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ce,telem:SC.source,redline:Ar}),zIndex:U},x6={name:"Button",key:"button",Symbol:jf,Form:qR,Preview:Ef,defaultProps:e=>({color:e.colors.primary.z,...Y("Button"),...Nf,mode:"fire",onClickDelay:0,scale:null}),zIndex:U},p6={name:"Switch",key:"switch",Symbol:ym,Form:sC,defaultProps:()=>({...Y("Switch"),...Ce,scale:null}),Preview:bx,zIndex:U},m6={name:"Vacuum Pump",key:"vacuumPump",Symbol:zp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vacuum Pump"),...Ce}),Preview:kx,zIndex:U},f6={name:"Compressor",key:"compressor",Symbol:Xp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Compressor"),...Ce}),Preview:gp,zIndex:U},h6={name:"Cavity Pump",key:"cavityPump",Symbol:$p,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cavity Pump"),...Ce}),Preview:Lx,zIndex:U},g6={name:"Piston Pump",key:"pistonPump",Symbol:Vp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Piston Pump"),...Ce}),Preview:Px,zIndex:U},j6={name:"Static Mixer",key:"staticMixer",Symbol:Mm,Form:xe,defaultProps:e=>({color:e.colors.gray.l11,...Y("Static Mixer"),...ce}),Preview:Tx,zIndex:U},E6={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Fp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Rotary Mixer"),...Ce}),Preview:Ax,zIndex:U},y6={name:"Light",key:"light",Symbol:yf,Form:GR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Light"),..._f}),Preview:Ix,zIndex:U},S6={name:"Setpoint",key:"setpoint",Symbol:mf,Form:QR,defaultProps:e=>({units:"mV",color:e.colors.gray.l11,size:"small",...Y("Setpoint"),...RC,...CC}),Preview:ff,zIndex:U},R6={name:"Agitator",key:"agitator",Symbol:Zp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Agitator"),...Ce}),Preview:Dx,zIndex:U},C6={name:"Propeller Agitator",key:"propellerAgitator",Symbol:Kp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Propeller Agitator"),...Ce}),Preview:Hx,zIndex:U},w6={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:Yp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flat Blade Agitator"),...Ce}),Preview:zx,zIndex:U},b6={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Wp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Paddle Agitator"),...Ce}),Preview:$x,zIndex:U},v6={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Gp,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cross Beam Agitator"),...Ce}),Preview:Vx,zIndex:U},_6={name:"Helical Agitator",key:"helicalAgitator",Symbol:Up,Form:Se,defaultProps:e=>({color:e.colors.gray.l11,...Y("Helical Agitator"),...Ce}),Preview:Fx,zIndex:U},N6={name:"Text Box",key:"textBox",Symbol:bf,Form:JR,defaultProps:e=>({color:e.colors.gray.l11,autoFit:!0,align:"center",...Y("Text Box"),...ce,...ii,level:"p",value:"Text Box",width:75}),Preview:vf,zIndex:U},M6={name:"Off Page Reference",key:"offPageReference",Form:eC,Symbol:Sf,defaultProps:e=>({color:e.colors.gray.l11,orientation:"right",...Y("Off Page Reference")}),Preview:Rf,zIndex:U},k6={name:"ISO Check Valve",key:"isoCheckValve",Form:xe,Symbol:gm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Check Valve"),...ce}),Preview:Jd,zIndex:U},L6={name:"Check Valve Variant",key:"checkValveWithArrow",Form:xe,Symbol:jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ce}),Preview:ex,zIndex:U},P6={name:"Vent",key:"vent",Form:xe,Symbol:Sm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vent"),...ce}),Preview:Kx,zIndex:U},T6={name:"T Junction",key:"tJunction",Form:xe,Symbol:_m,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ce}),Preview:Qx,zIndex:U+20},A6={name:"Cross Junction",key:"crossJunction",Form:xe,Symbol:Nm,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ce}),Preview:Jx,zIndex:U+20},I6={name:"Flowmeter General",key:"flowmeterGeneral",Form:xe,Symbol:km,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Flowmeter"),...ce}),Preview:ep,zIndex:U},O6={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:xe,Symbol:Lm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electromagnetic Flowmeter"),...ce}),Preview:tp,zIndex:U},B6={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:xe,Symbol:Pm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Variable Area Flowmeter"),...ce}),Preview:np,zIndex:U},D6={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:xe,Symbol:Tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Coriolis Flowmeter"),...ce}),Preview:sp,zIndex:U},H6={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:xe,Symbol:Am,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle Flowmeter"),...ce}),Preview:op,zIndex:U},z6={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:xe,Symbol:Im,defaultProps:e=>({color:e.colors.gray.l11,...Y("Venturi Flowmeter"),...ce}),Preview:rp,zIndex:U},$6={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:xe,Symbol:Om,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ring Piston Flowmeter"),...ce}),Preview:ip,zIndex:U},V6={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:xe,Symbol:Bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Positive Displacement Flowmeter"),...ce}),Preview:lp,zIndex:U},F6={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:xe,Symbol:Dm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbine Flowmeter"),...ce}),Preview:ap,zIndex:U},Z6={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:xe,Symbol:Hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pulse Flowmeter"),...ce}),Preview:cp,zIndex:U},K6={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:xe,Symbol:zm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Float Sensor Flowmeter"),...ce}),Preview:up,zIndex:U},Y6={name:"Flowmeter Orifice",key:"flowmeterOrifice",Form:xe,Symbol:$m,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Flowmeter"),...ce}),Preview:dp,zIndex:U},W6={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:xe,Symbol:Vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Heat Exchanger"),...ce}),Preview:xp,zIndex:U},G6={name:"Heat Exchanger M",key:"heatExchangerM",Form:xe,Symbol:Fm,defaultProps:e=>({color:e.colors.gray.l11,...Y("M Heat Exchanger"),...ce}),Preview:pp,zIndex:U},U6={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:xe,Symbol:Zm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Straight Tube Heat Exchanger"),...ce}),Preview:mp,zIndex:U},q6={name:"Turbo Compressor",key:"turboCompressor",Form:Se,Symbol:Qp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbo Compressor"),...Ce}),Preview:jp,zIndex:U},X6={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:Se,Symbol:Jp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Roller Vane Compressor"),...Ce}),Preview:Ep,zIndex:U},Q6={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:Se,Symbol:em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Liquid Ring Compressor"),...Ce}),Preview:yp,zIndex:U},J6={name:"Ejector Compressor",key:"ejectorCompressor",Form:Se,Symbol:tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejector Compressor"),...Ce}),Preview:Sp,zIndex:U},e9={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:Se,Symbol:nm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Centrifugal Compressor"),...Ce}),Preview:Rp,zIndex:U},t9={name:"Diaphragm Pump",key:"diaphragmPump",Form:Se,Symbol:Dp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Diaphragm Pump"),...Ce}),Preview:fp,zIndex:U},n9={name:"Ejection Pump",key:"ejectionPump",Form:Se,Symbol:Hp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejection Pump"),...Ce}),Preview:hp,zIndex:U},s9={name:"Flame Arrestor",key:"flameArrestor",Form:xe,Symbol:Km,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor"),...ce}),Preview:Cp,zIndex:U},o9={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:xe,Symbol:Ym,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Explosion-Proof)"),...ce}),Preview:bp,zIndex:U},r9={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:xe,Symbol:Wm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Detonation-Proof)"),...ce}),Preview:wp,zIndex:U},i9={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:xe,Symbol:Gm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant)"),...ce}),Preview:vp,zIndex:U},l9={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:xe,Symbol:Um,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ce}),Preview:_p,zIndex:U},a9={name:"Thruster",key:"thruster",Form:Se,Symbol:qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Thruster"),...Ce}),Preview:Np,zIndex:U},c9={name:"Nozzle",key:"nozzle",Form:xe,Symbol:Xm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle"),...ce}),Preview:Mp,zIndex:U},u9={name:"Strainer",key:"strainer",Form:xe,Symbol:Qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer"),...ce}),Preview:kp,zIndex:U},d9={name:"Strainer Cone",key:"strainerCone",Form:xe,Symbol:Jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer Cone"),...ce}),Preview:Lp,zIndex:U},x9={value:d6,button:x6,tank:HC,polygon:zC,circle:$C,tJunction:T6,crossJunction:A6,switch:p6,offPageReference:M6,light:y6,setpoint:S6,box:FC,textBox:N6,valve:_C,solenoidValve:NC,threeWayValve:vC,fourWayValve:MC,angledValve:kC,ballValve:LC,threeWayBallValve:PC,gateValve:TC,butterflyValveOne:AC,butterflyValveTwo:IC,breatherValve:OC,manualValve:t6,needleValve:l6,reliefValve:ZC,angledReliefValve:u6,checkValve:a6,regulator:WC,regulatorManual:GC,electricRegulator:UC,electricRegulatorMotorized:qC,springLoadedReliefValve:KC,angledSpringLoadedReliefValve:YC,pump:BC,pistonPump:g6,screwPump:DC,cavityPump:h6,diaphragmPump:t9,ejectionPump:n9,vacuumPump:m6,compressor:f6,turboCompressor:q6,rollerVaneCompressor:X6,liquidRingCompressor:Q6,ejectorCompressor:J6,centrifugalCompressor:e9,staticMixer:j6,rotaryMixer:E6,burstDisc:XC,isoBurstDisc:QC,cap:JC,isoCap:e6,filter:o6,isoFilter:s6,flowStraightener:r6,heaterElement:i6,orifice:c6,orificePlate:n6,agitator:R6,propellerAgitator:C6,flatBladeAgitator:w6,paddleAgitator:b6,crossBeamAgitator:v6,helicalAgitator:_6,isoCheckValve:k6,checkValveWithArrow:L6,vent:P6,cylinder:VC,flowmeterGeneral:I6,flowmeterElectromagnetic:O6,flowmeterVariableArea:B6,flowmeterCoriolis:D6,flowmeterNozzle:H6,flowmeterVenturi:z6,flowmeterRingPiston:$6,flowmeterPositiveDisplacement:V6,flowmeterTurbine:F6,flowmeterPulse:Z6,flowmeterFloatSensor:K6,flowmeterOrifice:Y6,heatExchangerGeneral:W6,heatExchangerM:G6,heatExchangerStraightTube:U6,flameArrestor:s9,flameArrestorExplosion:o9,flameArrestorDetonation:r9,flameArrestorFireRes:i9,flameArrestorFireResDetonation:l9,thruster:a9,nozzle:c9,strainer:u9,strainerCone:d9},p9=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Zp,AngledReliefValve:rf,AngledSpringLoadedReliefValve:sf,AngledValve:Op,BallValve:rm,Box:xf,BoxPreview:pf,BreatherValve:lf,BurstDisc:xm,ButterflyValveOne:sm,ButterflyValveTwo:om,Button:jf,ButtonPreview:Ef,Cap:pm,CavityPump:$p,CentrifugalCompressor:nm,CheckValve:hm,CheckValveWithArrow:jm,Circle:df,Compressor:Xp,CrossBeamAgitator:Gp,CrossJunction:Nm,Cylinder:Cf,CylinderPreview:wf,DRAG_HANDLE_CLASS:Gs,DiaphragmPump:Dp,EjectionPump:Hp,EjectorCompressor:tm,ElectricRegulator:um,ElectricRegulatorMotorized:dm,Filter:fm,FlameArrestor:Km,FlameArrestorDetonation:Wm,FlameArrestorExplosion:Ym,FlameArrestorFireRes:Gm,FlameArrestorFireResDetonation:Um,FlatBladeAgitator:Yp,FlowStraightener:wm,FlowmeterCoriolis:Tm,FlowmeterElectromagnetic:Lm,FlowmeterFloatSensor:zm,FlowmeterGeneral:km,FlowmeterNozzle:Am,FlowmeterOrifice:$m,FlowmeterPositiveDisplacement:Bm,FlowmeterPulse:Hm,FlowmeterRingPiston:Om,FlowmeterTurbine:Dm,FlowmeterVariableArea:Pm,FlowmeterVenturi:Im,FourWayValve:Ip,GateValve:lm,HeatExchangerGeneral:Vm,HeatExchangerM:Fm,HeatExchangerStraightTube:Zm,HeaterElement:bm,HelicalAgitator:Up,ISOBurstDisc:vm,ISOCap:mm,ISOCheckValve:gm,ISOFilter:Cm,Light:yf,LiquidRingCompressor:em,ManualValve:of,NeedleValve:ef,Nozzle:Xm,OffPageReference:Sf,OffPageReferencePreview:Rf,Orifice:Em,OrificePlate:Rm,PaddleAgitator:Wp,PistonPump:Vp,PolygonSymbol:uf,PropellerAgitator:Kp,Pump:Bp,Regulator:am,RegulatorManual:cm,ReliefValve:tf,RollerVaneCompressor:Jp,RotaryMixer:Fp,SYMBOLS:x9,ScrewPump:qp,Setpoint:mf,SetpointPreview:ff,SolenoidValve:Ap,SpringLoadedReliefValve:nf,StaticMixer:Mm,Strainer:Qm,StrainerCone:Jm,Switch:ym,TJunction:_m,Tank:af,TankPreview:cf,TextBox:bf,TextBoxPreview:vf,ThreeWayBallValve:im,ThreeWayValve:Pp,Thruster:qm,Triangle:hC,TurboCompressor:Qp,VacuumPump:zp,Value:hf,ValuePreview:gf,Valve:Tp,Vent:Sm,createDummyToggle:St,createLabeled:de,createToggle:Re,variantZ:yC},Symbol.toStringTag,{value:"Module"})),m9=ct({name:"Workspace",retrieve:({params:e,client:t})=>t.workspaces.retrieve(e.key)}),f9=Ve({name:"Workspace",retrieve:async({client:e,params:t})=>await e.workspaces.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.workspaces.retrieve(t),listeners:[{channel:M.iw.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.iw.workspaceZ,async({onChange:e,changed:t})=>e(t.key,t))},{channel:M.iw.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.iw.keyZ,async({onDelete:e,changed:t})=>e(t))}]}),h9=Object.freeze(Object.defineProperty({__proto__:null,retrieve:m9,useList:f9},Symbol.toStringTag,{value:"Module"}));exports.Aether=f.main;exports.Generic=f.Generic;exports.Haul=f.Haul;exports.Worker=f.Context;exports.compareArrayDeps=f.compareArrayDeps;exports.preventDefault=f.preventDefault;exports.stopPropagation=f.stopPropagation;exports.useClickOutside=f.useClickOutside;exports.useCombinedRefs=f.useCombinedRefs;exports.useCombinedStateAndRef=f.useCombinedStateAndRef;exports.useEffectCompare=f.useEffectCompare;exports.useInitializerRef=f.useInitializerRef;exports.useMemoCompare=f.useMemoCompare;exports.useMemoDeepEqual=f.useMemoDeepEqual;exports.useMemoPrimitiveArray=f.useMemoPrimitiveArray;exports.usePrevious=f.usePrevious;exports.useRequiredContext=f.useRequiredContext;exports.useResize=f.useResize;exports.useStateRef=f.useStateRef;exports.useSyncedRef=f.useSyncedRef;exports.CSS=u.CSS;exports.DataType=u.r;exports.Density=u.d;exports.MultiSeries=u.Vt;exports.Rate=u.E;exports.Series=u.I;exports.TimeRange=u.w;exports.TimeSpan=u.a;exports.TimeStamp=u.n;exports.newBEM=u.newBEM;exports.state=M.state;exports.Button=Lh.external;exports.Caret=zl.Animated$1;exports.telem=_.external;exports.List=Je.external;exports.Dialog=Vl.external;exports.Input=Te.external;exports.Color=Pe.external;exports.useDebouncedCallback=Pe.useDebouncedCallback;exports.Theming=ws.external;exports.Triggers=Fl.external;exports.Divider=Zl.Divider$2;exports.Flex=fe.external;exports.createHexOpacityVariants=Kl.createHexOpacityVariants;exports.unitProperty=Kl.unitProperty;exports.Header=Ph.external;exports.Menu=Th.external;exports.Tabs=Me.external;exports.Text=Ah.external;exports.Tree=Ih.external;exports.Video=Oh.Video;exports.Breadcrumb=bg;exports.Canvas=W1;exports.Channel=O0;exports.Component=fg;exports.Control=Oj;exports.Device=V0;exports.Diagram=NR;exports.Direction=B0;exports.Eraser=ag;exports.Flux=n1;exports.Form=Vg;exports.Icon=Xh;exports.Label=R1;exports.Legend=J1;exports.Line=t0;exports.LinePlot=j0;exports.Log=kR;exports.Measure=R0;exports.Mosaic=hj;exports.Nav=dg;exports.Note=jj;exports.OS=Cj;exports.Observe=zg;exports.Ontology=c1;exports.Override=bj;exports.Pluto=zj;exports.Portal=aj;exports.Progress=Vj;exports.Rack=W0;exports.Range=y0;exports.Ranger=F1;exports.Resize=ig;exports.Rule=C0;exports.Schematic=p9;exports.Select=Rg;exports.Status=mg;exports.Steps=Zj;exports.Synnax=Mg;exports.Table=Uj;exports.TableCells=x2;exports.Tag=hg;exports.Task=J0;exports.Telem=Pj;exports.Tooltip=Qh;exports.Value=e2;exports.Viewport=h0;exports.Workspace=h9;exports.axis=e1;exports.control=Yg;exports.proxyMemo=Gh;exports.useAsyncEffect=We;exports.useDelayedState=Uh;exports.useTransforms=qh;
38
+ `)),x=d.reduce((p,m)=>p.concat(...m),[]);return[d,x]}return[[],[]]},[e]);return g.useEffect(()=>{const c=t?.target??jl,d=t?.actInsideInputWithModifier??!0;if(e!==null){const x=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!d)&&Bu(h))return!1;const E=yl(h.code,a);if(i.current.add(h[E]),El(l,i.current,!1)){const S=h.composedPath?.()?.[0]||h.target,R=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(r.current||!R)&&h.preventDefault(),s(!0)}},p=h=>{const j=yl(h.code,a);El(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(h[j]),h.key==="Meta"&&i.current.clear(),r.current=!1},m=()=>{i.current.clear(),s(!1)};return c?.addEventListener("keydown",x),c?.addEventListener("keyup",p),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c?.removeEventListener("keydown",x),c?.removeEventListener("keyup",p),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,s]),n}function El(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function yl(e,t){return t.includes(e)?"code":"key"}const iS=()=>{const e=ve();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:a}=e.getState(),c=Gr(t,s,r,i,l,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:a,y:c}=l.getBoundingClientRect(),d={x:t.x-a,y:t.y-c},x=n.snapGrid??r,p=n.snapToGrid??i;return Bn(d,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=Ss(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function ld(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const a={...i};for(const c of l)lS(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function lS(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.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ad(e,t){return ld(e,t)}function cd(e,t){return ld(e,t)}function wt(e,t){return{id:e,type:"select",selected:t}}function Wt(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(wt(i.id,l)))}return s}function Sl({items:e=[],lookup:t}){const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const l=t.get(i.id),a=l?.internals?.userNode??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function Rl(e){return{id:e.id,type:"remove"}}const Cl=e=>T5(e),aS=e=>Mu(e);function ud(e){return g.forwardRef(e)}const cS=typeof window<"u"?g.useLayoutEffect:g.useEffect;function wl(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>uS(()=>n(r=>r+BigInt(1))));return cS(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function uS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const dd=g.createContext(null);function dS({children:e}){const t=ve(),n=g.useCallback(a=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m,fitViewQueued:h}=t.getState();let j=c;for(const S of a)j=typeof S=="function"?S(j):S;const E=Sl({items:j,lookup:m});x&&d(j),E.length>0?p?.(E):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:R,setNodes:v}=t.getState();S&&v(R)})},[]),s=wl(n),r=g.useCallback(a=>{const{edges:c=[],setEdges:d,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let h=c;for(const j of a)h=typeof j=="function"?j(h):j;x?d(h):p&&p(Sl({items:h,lookup:m}))},[]),i=wl(r),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(dd.Provider,{value:l,children:e})}function xS(){const e=g.useContext(dd);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const pS=e=>!!e.panZoom;function zt(){const e=iS(),t=ve(),n=xS(),s=Ee(pS),r=g.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},a=p=>{n.edgeQueue.push(p)},c=p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState(),j=Cl(p)?p:m.get(p.id),E=j.parentId?Iu(j.position,j.measured,j.parentId,m,h):j.position,S={...j,position:E,width:j.measured?.width??j.width,height:j.measured?.height??j.height};return Jt(S)},d=(p,m,h={replace:!1})=>{l(j=>j.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&Cl(S)?S:{...E,...S}}return E}))},x=(p,m,h={replace:!1})=>{a(j=>j.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&aS(S)?S:{...E,...S}}return E}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>i(p)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(m=>({...m}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:a,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(h=>[...h,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(h=>[...h,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:h}=t.getState(),[j,E,S]=h;return{nodes:p.map(R=>({...R})),edges:m.map(R=>({...R})),viewport:{x:j,y:E,zoom:S}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:h,edges:j,onNodesDelete:E,onEdgesDelete:S,triggerNodeChanges:R,triggerEdgeChanges:v,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:N,edges:k}=await D5({nodesToRemove:p,edgesToRemove:m,nodes:h,edges:j,onBeforeDelete:C}),A=k.length>0,I=N.length>0;if(A){const D=k.map(Rl);S?.(k),v(D)}if(I){const D=N.map(Rl);E?.(N),R(D)}return(I||A)&&y?.({nodes:N,edges:k}),{deletedNodes:N,deletedEdges:k}},getIntersectingNodes:(p,m=!0,h)=>{const j=Gi(p),E=j?p:c(p),S=h!==void 0;return E?(h||t.getState().nodes).filter(R=>{const v=t.getState().nodeLookup.get(R.id);if(v&&!j&&(R.id===p.id||!v.internals.positionAbsolute))return!1;const y=Jt(S?R:v),C=bn(y,E);return m&&C>0||C>=E.width*E.height}):[]},isNodeIntersecting:(p,m,h=!0)=>{const E=Gi(p)?p:c(p);if(!E)return!1;const S=bn(E,m);return h&&S>0||S>=E.width*E.height},updateNode:d,updateNodeData:(p,m,h={replace:!1})=>{d(p,j=>{const E=typeof m=="function"?m(j):m;return h.replace?{...j,data:E}:{...j,data:{...j.data,...E}}},h)},updateEdge:x,updateEdgeData:(p,m,h={replace:!1})=>{x(p,j=>{const E=typeof m=="function"?m(j):m;return h.replace?{...j,data:E}:{...j,data:{...j.data,...E}}},h)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState();return A5(p,{nodeLookup:m,nodeOrigin:h})},getHandleConnections:({type:p,id:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${p}${m?`-${m}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${p?m?`-${p}-${m}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const m=t.getState().fitViewResolver??$5();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),n.nodeQueue.push(h=>[...h]),m.promise}}},[]);return g.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const bl=e=>e.selected,mS=typeof window<"u"?window:void 0;function fS({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ve(),{deleteElements:s}=zt(),r=_n(e,{actInsideInputWithModifier:!1}),i=_n(t,{target:mS});g.useEffect(()=>{if(r){const{edges:l,nodes:a}=n.getState();s({nodes:a.filter(bl),edges:l.filter(bl)}),n.setState({nodesSelectionActive:!1})}},[r]),g.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function hS(e){const t=ve();g.useEffect(()=>{const n=()=>{if(!e.current)return!1;const s=Ur(e.current);(s.height===0||s.width===0)&&t.getState().onError?.("004",Ie.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 Ks={position:"absolute",width:"100%",height:"100%",top:0,left:0},gS=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function jS({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=vt.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:d,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:h=!0,children:j,noWheelClassName:E,noPanClassName:S,onViewportChange:R,isControlledViewport:v,paneClickDistance:y}){const C=ve(),N=g.useRef(null),{userSelectionActive:k,lib:A}=Ee(gS,_e),I=_n(m),D=g.useRef();hS(N);const V=g.useCallback(z=>{R?.({x:z[0],y:z[1],zoom:z[2]}),v||C.setState({transform:z})},[R,v]);return g.useEffect(()=>{if(N.current){D.current=Sy({domNode:N.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:c,paneClickDistance:y,onDraggingChange:w=>C.setState({paneDragging:w}),onPanZoomStart:(w,P)=>{const{onViewportChangeStart:L,onMoveStart:O}=C.getState();O?.(w,P),L?.(P)},onPanZoom:(w,P)=>{const{onViewportChange:L,onMove:O}=C.getState();O?.(w,P),L?.(P)},onPanZoomEnd:(w,P)=>{const{onViewportChangeEnd:L,onMoveEnd:O}=C.getState();O?.(w,P),L?.(P)}});const{x:z,y:B,zoom:$}=D.current.getViewport();return C.setState({panZoom:D.current,transform:[z,B,$],domNode:N.current.closest(".react-flow")}),()=>{D.current?.destroy()}}},[]),g.useEffect(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:I,preventScrolling:h,noPanClassName:S,userSelectionActive:k,noWheelClassName:E,lib:A,onTransformChange:V})},[e,t,n,s,r,i,l,a,I,h,S,k,E,A,V]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:N,style:Ks,children:j})}const ES=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function yS(){const{userSelectionActive:e,userSelectionRect:t}=Ee(ES,_e);return e&&t?o.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 yo=(e,t)=>n=>{n.target===t.current&&e?.(n)},SS=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function RS({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xt.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:a,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){const j=ve(),{userSelectionActive:E,elementsSelectable:S,dragging:R,connectionInProgress:v}=Ee(SS,_e),y=S&&(e||E),C=g.useRef(null),N=g.useRef(),k=g.useRef(new Set),A=g.useRef(new Set),I=g.useRef(!1),D=g.useRef(!1),V=O=>{if(I.current||v){I.current=!1;return}a?.(O),j.getState().resetSelectedElements(),j.setState({nodesSelectionActive:!1})},z=O=>{if(Array.isArray(s)&&s?.includes(2)){O.preventDefault();return}c?.(O)},B=d?O=>d(O):void 0,$=O=>{const{resetSelectedElements:H,domNode:F}=j.getState();if(N.current=F?.getBoundingClientRect(),!S||!e||O.button!==0||O.target!==C.current||!N.current)return;O.target?.setPointerCapture?.(O.pointerId),D.current=!0,I.current=!1;const{x:Z,y:K}=Je(O.nativeEvent,N.current);H(),j.setState({userSelectionRect:{width:0,height:0,startX:Z,startY:K,x:Z,y:K}}),i?.(O)},w=O=>{const{userSelectionRect:H,transform:F,nodeLookup:Z,edgeLookup:K,connectionLookup:X,triggerNodeChanges:oe,triggerEdgeChanges:J,defaultEdgeOptions:ae}=j.getState();if(!N.current||!H)return;I.current=!0;const{x:te,y:ne}=Je(O.nativeEvent,N.current),{startX:ee,startY:re}=H,je={startX:ee,startY:re,x:te<ee?te:ee,y:ne<re?ne:re,width:Math.abs(te-ee),height:Math.abs(ne-re)},Se=k.current,ue=A.current;k.current=new Set(Wr(Z,je,F,n===Xt.Partial,!0).map(U=>U.id)),A.current=new Set;const me=ae?.selectable??!0;for(const U of k.current){const de=X.get(U);if(de)for(const{edgeId:be}of de.values()){const Te=K.get(be);Te&&(Te.selectable??me)&&A.current.add(be)}}if(!Ui(Se,k.current)){const U=Wt(Z,k.current,!0);oe(U)}if(!Ui(ue,A.current)){const U=Wt(K,A.current);J(U)}j.setState({userSelectionRect:je,userSelectionActive:!0,nodesSelectionActive:!1})},P=O=>{if(O.button!==0||!D.current)return;O.target?.releasePointerCapture?.(O.pointerId);const{userSelectionRect:H}=j.getState();!E&&H&&O.target===C.current&&V?.(O),j.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),l?.(O),(t||r)&&(I.current=!1),D.current=!1},L=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:Me(["react-flow__pane",{draggable:L,dragging:R,selection:e}]),onClick:y?void 0:yo(V,C),onContextMenu:yo(z,C),onWheel:yo(B,C),onPointerEnter:y?void 0:x,onPointerDown:y?$:p,onPointerMove:y?w:p,onPointerUp:y?P:void 0,onPointerLeave:m,ref:C,style:Ks,children:[h,o.jsxRuntimeExports.jsx(yS,{})]})}function Wo({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:a,onError:c}=t.getState(),d=a.get(e);if(!d){c?.("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):r([e])}function xd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const a=ve(),[c,d]=g.useState(!1),x=g.useRef();return g.useEffect(()=>{x.current=iy({getStoreItems:()=>a.getState(),onNodeMouseDown:p=>{Wo({id:p,store:a,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),g.useEffect(()=>{if(t)x.current?.destroy();else if(e.current)return x.current?.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{x.current?.destroy()}},[n,s,t,i,e,r]),c}const CS=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function pd(){const e=ve();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:a,updateNodePositions:c,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=CS(l),h=r?i[0]:5,j=r?i[1]:5,E=n.direction.x*h*n.factor,S=n.direction.y*j*n.factor;for(const[,R]of d){if(!m(R))continue;let v={x:R.internals.positionAbsolute.x+E,y:R.internals.positionAbsolute.y+S};r&&(v=$s(v,i));const{position:y,positionAbsolute:C}=ku({nodeId:R.id,nextPosition:v,nodeLookup:d,nodeExtent:s,nodeOrigin:x,onError:a});R.position=y,R.internals.positionAbsolute=C,p.set(R.id,R)}c(p)},[])}const ei=g.createContext(null),wS=ei.Provider;ei.Consumer;const md=()=>g.useContext(ei),bS=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),vS=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:a,toHandle:c,isValid:d}=l,x=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:x,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===At.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:x&&d}};function _S({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:a,children:c,className:d,onMouseDown:x,onTouchStart:p,...m},h){const j=l||null,E=e==="target",S=ve(),R=md(),{connectOnClick:v,noPanClassName:y,rfId:C}=Ee(bS,_e),{connectingFrom:N,connectingTo:k,clickConnecting:A,isPossibleEndHandle:I,connectionInProcess:D,clickConnectionInProcess:V,valid:z}=Ee(vS(R,j,e),_e);R||S.getState().onError?.("010",Ie.error010());const B=P=>{const{defaultEdgeOptions:L,onConnect:O,hasDefaultEdges:H}=S.getState(),F={...L,...P};if(H){const{edges:Z,setEdges:K}=S.getState();K(Fu(F,Z))}O?.(F),a?.(F)},$=P=>{if(!R)return;const L=Du(P.nativeEvent);if(r&&(L&&P.button===0||!L)){const O=S.getState();Yo.onPointerDown(P.nativeEvent,{autoPanOnConnect:O.autoPanOnConnect,connectionMode:O.connectionMode,connectionRadius:O.connectionRadius,domNode:O.domNode,nodeLookup:O.nodeLookup,lib:O.lib,isTarget:E,handleId:j,nodeId:R,flowId:O.rfId,panBy:O.panBy,cancelConnection:O.cancelConnection,onConnectStart:O.onConnectStart,onConnectEnd:O.onConnectEnd,updateConnection:O.updateConnection,onConnect:B,isValidConnection:n||O.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:O.autoPanSpeed,dragThreshold:O.connectionDragThreshold})}L?x?.(P):p?.(P)},w=P=>{const{onClickConnectStart:L,onClickConnectEnd:O,connectionClickStartHandle:H,connectionMode:F,isValidConnection:Z,lib:K,rfId:X,nodeLookup:oe,connection:J}=S.getState();if(!R||!H&&!r)return;if(!H){L?.(P.nativeEvent,{nodeId:R,handleId:j,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:j}});return}const ae=Ou(P.target),te=n||Z,{connection:ne,isValid:ee}=Yo.isValid(P.nativeEvent,{handle:{nodeId:R,id:j,type:e},connectionMode:F,fromNodeId:H.nodeId,fromHandleId:H.id||null,fromType:H.type,isValidConnection:te,flowId:X,doc:ae,lib:K,nodeLookup:oe});ee&&ne&&B(ne);const re=structuredClone(J);delete re.inProgress,re.toPosition=re.toHandle?re.toHandle.position:null,O?.(P,re),S.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":j,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${j}-${e}`,className:Me(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!E,target:E,connectable:s,connectablestart:r,connectableend:i,clickconnecting:A,connectingfrom:N,connectingto:k,valid:z,connectionindicator:s&&(!D||I)&&(D||V?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:v?w:void 0,ref:h,...m,children:c})}const Nn=g.memo(ud(_S));function NS({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e?.label,o.jsxRuntimeExports.jsx(Nn,{type:"source",position:n,isConnectable:t})]})}function MS({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:s=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Nn,{type:"target",position:n,isConnectable:t}),e?.label,o.jsxRuntimeExports.jsx(Nn,{type:"source",position:s,isConnectable:t})]})}function kS(){return null}function LS({data:e,isConnectable:t,targetPosition:n=Q.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Nn,{type:"target",position:n,isConnectable:t}),e?.label]})}const Cs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vl={input:NS,default:MS,output:LS,group:kS};function PS(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const TS=e=>{const{width:t,height:n,x:s,y:r}=On(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ye(t)?t:null,height:Ye(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function AS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ve(),{width:r,height:i,transformString:l,userSelectionActive:a}=Ee(TS,_e),c=pd(),d=g.useRef(null);if(g.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),xd({nodeRef:d}),a||!r||!i)return null;const x=e?m=>{const h=s.getState().nodes.filter(j=>j.selected);e(m,h)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Cs,m.key)&&(m.preventDefault(),c({direction:Cs[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const _l=typeof window<"u"?window:void 0,IS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function fd({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:S,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:A,panOnDrag:I,defaultViewport:D,translateExtent:V,minZoom:z,maxZoom:B,preventScrolling:$,onSelectionContextMenu:w,noWheelClassName:P,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:H,isControlledViewport:F}){const{nodesSelectionActive:Z,userSelectionActive:K}=Ee(IS),X=_n(d,{target:_l}),oe=_n(E,{target:_l}),J=oe||I,ae=oe||C,te=x&&J!==!0,ne=X||K||te;return fS({deleteKeyCode:c,multiSelectionKeyCode:j}),o.jsxRuntimeExports.jsx(jS,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:A,panOnDrag:!X&&J,defaultViewport:D,translateExtent:V,minZoom:z,maxZoom:B,zoomActivationKeyCode:S,preventScrolling:$,noWheelClassName:P,noPanClassName:L,onViewportChange:H,isControlledViewport:F,paneClickDistance:a,children:o.jsxRuntimeExports.jsxs(RS,{onSelectionStart:m,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:J,isSelecting:!!ne,selectionMode:p,selectionKeyPressed:X,selectionOnDrag:te,children:[e,Z&&o.jsxRuntimeExports.jsx(AS,{onSelectionContextMenu:w,noPanClassName:L,disableKeyboardA11y:O})]})})}fd.displayName="FlowRenderer";const OS=g.memo(fd),BS=e=>t=>e?Wr(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 DS(e){return Ee(g.useCallback(BS(e),[e]),_e)}const zS=e=>e.updateNodeInternals;function HS(){const e=Ee(zS),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t?.disconnect()},[t]),t}function $S({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=ve(),i=g.useRef(null),l=g.useRef(null),a=g.useRef(e.sourcePosition),c=g.useRef(e.targetPosition),d=g.useRef(t),x=n&&!!e.internals.handleBounds;return g.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&s?.unobserve(l.current),s?.observe(i.current),l.current=i.current)},[x,e.hidden]),g.useEffect(()=>()=>{l.current&&(s?.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(i.current){const p=d.current!==t,m=a.current!==e.sourcePosition,h=c.current!==e.targetPosition;(p||m||h)&&(d.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function VS({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:a,elementsSelectable:c,nodesConnectable:d,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:h,disableKeyboardA11y:j,rfId:E,nodeTypes:S,nodeClickDistance:R,onError:v}){const{node:y,internals:C,isParent:N}=Ee(ee=>{const re=ee.nodeLookup.get(e),je=ee.parentLookup.has(e);return{node:re,internals:re.internals,isParent:je}},_e);let k=y.type||"default",A=S?.[k]||vl[k];A===void 0&&(v?.("003",Ie.error003(k)),k="default",A=vl.default);const I=!!(y.draggable||a&&typeof y.draggable>"u"),D=!!(y.selectable||c&&typeof y.selectable>"u"),V=!!(y.connectable||d&&typeof y.connectable>"u"),z=!!(y.focusable||x&&typeof y.focusable>"u"),B=ve(),$=Au(y),w=$S({node:y,nodeType:k,hasDimensions:$,resizeObserver:p}),P=xd({nodeRef:w,disabled:y.hidden||!I,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:R}),L=pd();if(y.hidden)return null;const O=dt(y),H=PS(y),F=D||I||t||n||s||r,Z=n?ee=>n(ee,{...C.userNode}):void 0,K=s?ee=>s(ee,{...C.userNode}):void 0,X=r?ee=>r(ee,{...C.userNode}):void 0,oe=i?ee=>i(ee,{...C.userNode}):void 0,J=l?ee=>l(ee,{...C.userNode}):void 0,ae=ee=>{const{selectNodesOnDrag:re,nodeDragThreshold:je}=B.getState();D&&(!re||!I||je>0)&&Wo({id:e,store:B,nodeRef:w}),t&&t(ee,{...C.userNode})},te=ee=>{if(!(Bu(ee.nativeEvent)||j)){if(bu.includes(ee.key)&&D){const re=ee.key==="Escape";Wo({id:e,store:B,unselect:re,nodeRef:w})}else if(I&&y.selected&&Object.prototype.hasOwnProperty.call(Cs,ee.key)){ee.preventDefault();const{ariaLabelConfig:re}=B.getState();B.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),L({direction:Cs[ee.key],factor:ee.shiftKey?4:1})}}},ne=()=>{if(j||!w.current?.matches(":focus-visible"))return;const{transform:ee,width:re,height:je,autoPanOnNodeFocus:Se,setCenter:ue}=B.getState();if(!Se)return;Wr(new Map([[e,y]]),{x:0,y:0,width:re,height:je},ee,!0).length>0||ue(y.position.x+O.width/2,y.position.y+O.height/2,{zoom:ee[2]})};return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__node",`react-flow__node-${k}`,{[h]:I},y.className,{selected:y.selected,selectable:D,parent:N,draggable:I,dragging:P}]),ref:w,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:$?"visible":"hidden",...y.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:K,onMouseLeave:X,onContextMenu:oe,onClick:ae,onDoubleClick:J,onKeyDown:z?te:void 0,tabIndex:z?0:void 0,onFocus:z?ne:void 0,role:y.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${od}-${E}`,"aria-label":y.ariaLabel,...y.domAttributes,children:o.jsxRuntimeExports.jsx(wS,{value:e,children:o.jsxRuntimeExports.jsx(A,{id:e,data:y.data,type:k,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:I,deletable:y.deletable??!0,isConnectable:V,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:P,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...O})})})}const FS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hd(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Ee(FS,_e),l=DS(e.onlyRenderVisibleElements),a=HS();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ks,children:l.map(c=>o.jsxRuntimeExports.jsx(VS,{id:c,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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}hd.displayName="NodeRenderer";const ZS=g.memo(hd);function KS(e){return Ee(g.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&K5({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),_e)}const YS=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),WS=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Nl={[js.Arrow]:YS,[js.ArrowClosed]:WS};function GS(e){const t=ve();return g.useMemo(()=>Object.prototype.hasOwnProperty.call(Nl,e)?Nl[e]:(t.getState().onError?.("009",Ie.error009(e)),null),[e])}const US=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:a="auto-start-reverse"})=>{const c=GS(t);return c?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(c,{color:n,strokeWidth:l})}):null},gd=({defaultColor:e,rfId:t})=>{const n=Ee(i=>i.edges),s=Ee(i=>i.defaultEdgeOptions),r=g.useMemo(()=>Q5(n,{id:t,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(US,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};gd.displayName="MarkerDefinitions";var qS=g.memo(gd);function jd({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:a=2,children:c,className:d,...x}){const[p,m]=g.useState({x:1,y:0,width:0,height:0}),h=Me(["react-flow__edge-textwrapper",d]),j=g.useRef(null);return g.useEffect(()=>{if(j.current){const E=j.current.getBBox();m({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),n?o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:h,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:j,style:s,children:n}),c]}):null}jd.displayName="EdgeText";const XS=g.memo(jd);function We({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:d=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:Me(["react-flow__edge-path",x.className])}),d&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Ye(t)&&Ye(n)?o.jsxRuntimeExports.jsx(XS,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Ml({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Q.Left||e===Q.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function Ed({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top}){const[l,a]=Ml({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,d]=Ml({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,h]=zu({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${e},${t} C${l},${a} ${c},${d} ${s},${r}`,x,p,m,h]}function yd(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l,targetPosition:a,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,interactionWidth:R})=>{const[v,y,C]=Ed({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a}),N=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(We,{id:N,path:v,labelX:y,labelY:C,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,interactionWidth:R})})}const QS=yd({isInternal:!1}),Sd=yd({isInternal:!0});QS.displayName="SimpleBezierEdge";Sd.displayName="SimpleBezierEdgeInternal";function Rd(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:h=Q.Bottom,targetPosition:j=Q.Top,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,N]=Fo({sourceX:n,sourceY:s,sourcePosition:h,targetX:r,targetY:i,targetPosition:j,borderRadius:R?.borderRadius,offset:R?.offset}),k=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(We,{id:k,path:y,labelX:C,labelY:N,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:S,interactionWidth:v})})}const Cd=Rd({isInternal:!1}),wd=Rd({isInternal:!0});Cd.displayName="SmoothStepEdge";wd.displayName="SmoothStepEdgeInternal";function bd(e){return g.memo(({id:t,...n})=>{const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Cd,{...n,id:s,pathOptions:g.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const JS=bd({isInternal:!1}),vd=bd({isInternal:!0});JS.displayName="StepEdge";vd.displayName="StepEdgeInternal";function _d(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:j,interactionWidth:E})=>{const[S,R,v]=Zu({sourceX:n,sourceY:s,targetX:r,targetY:i}),y=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(We,{id:y,path:S,labelX:R,labelY:v,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:j,interactionWidth:E})})}const e4=_d({isInternal:!1}),Nd=_d({isInternal:!0});e4.displayName="StraightEdge";Nd.displayName="StraightEdgeInternal";function Md(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=Q.Bottom,targetPosition:a=Q.Top,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,N]=Hu({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a,curvature:R?.curvature}),k=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(We,{id:k,path:y,labelX:C,labelY:N,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:j,markerEnd:E,markerStart:S,interactionWidth:v})})}const t4=Md({isInternal:!1}),kd=Md({isInternal:!0});t4.displayName="BezierEdge";kd.displayName="BezierEdgeInternal";const kl={default:kd,straight:Nd,step:vd,smoothstep:wd,simplebezier:Sd},Ll={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},n4=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,s4=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,Pl="react-flow__edgeupdater";function Tl({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:a}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:Me([Pl,`${Pl}-${a}`]),cx:n4(t,s,e),cy:s4(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function o4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:a,targetPosition:c,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:h}){const j=ve(),E=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:k,domNode:A,isValidConnection:I,connectionMode:D,connectionRadius:V,lib:z,onConnectStart:B,onConnectEnd:$,cancelConnection:w,nodeLookup:P,rfId:L,panBy:O,updateConnection:H}=j.getState(),F=N.type==="target",Z=(oe,J)=>{m(!1),p?.(oe,n,N.type,J)},K=oe=>d?.(n,oe),X=(oe,J)=>{m(!0),x?.(C,n,N.type),B?.(oe,J)};Yo.onPointerDown(C.nativeEvent,{autoPanOnConnect:k,connectionMode:D,connectionRadius:V,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:P,isTarget:F,edgeUpdaterType:N.type,lib:z,flowId:L,cancelConnection:w,panBy:O,isValidConnection:I,onConnect:K,onConnectStart:X,onConnectEnd:$,onReconnectEnd:Z,updateConnection:H,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold})},S=C=>E(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=C=>E(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>h(!0),y=()=>h(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(Tl,{position:a,centerX:s,centerY:r,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(Tl,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function r4({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,rfId:j,edgeTypes:E,noPanClassName:S,onError:R,disableKeyboardA11y:v}){let y=Ee(ue=>ue.edgeLookup.get(e));const C=Ee(ue=>ue.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",k=E?.[N]||kl[N];k===void 0&&(R?.("011",Ie.error011(N)),N="default",k=kl.default);const A=!!(y.focusable||t&&typeof y.focusable>"u"),I=typeof p<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),D=!!(y.selectable||s&&typeof y.selectable>"u"),V=g.useRef(null),[z,B]=g.useState(!1),[$,w]=g.useState(!1),P=ve(),{zIndex:L,sourceX:O,sourceY:H,targetX:F,targetY:Z,sourcePosition:K,targetPosition:X}=Ee(g.useCallback(ue=>{const me=ue.nodeLookup.get(y.source),U=ue.nodeLookup.get(y.target);if(!me||!U)return{zIndex:y.zIndex,...Ll};const de=X5({id:e,sourceNode:me,targetNode:U,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ue.connectionMode,onError:R});return{zIndex:Z5({selected:y.selected,zIndex:y.zIndex,sourceNode:me,targetNode:U,elevateOnSelect:ue.elevateEdgesOnSelect}),...de||Ll}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),_e),oe=g.useMemo(()=>y.markerStart?`url('#${Zo(y.markerStart,j)}')`:void 0,[y.markerStart,j]),J=g.useMemo(()=>y.markerEnd?`url('#${Zo(y.markerEnd,j)}')`:void 0,[y.markerEnd,j]);if(y.hidden||O===null||H===null||F===null||Z===null)return null;const ae=ue=>{const{addSelectedEdges:me,unselectNodesAndEdges:U,multiSelectionActive:de}=P.getState();D&&(P.setState({nodesSelectionActive:!1}),y.selected&&de?(U({nodes:[],edges:[y]}),V.current?.blur()):me([e])),r&&r(ue,y)},te=i?ue=>{i(ue,{...y})}:void 0,ne=l?ue=>{l(ue,{...y})}:void 0,ee=a?ue=>{a(ue,{...y})}:void 0,re=c?ue=>{c(ue,{...y})}:void 0,je=d?ue=>{d(ue,{...y})}:void 0,Se=ue=>{if(!v&&bu.includes(ue.key)&&D){const{unselectNodesAndEdges:me,addSelectedEdges:U}=P.getState();ue.key==="Escape"?(V.current?.blur(),me({edges:[y]})):U([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:L},children:o.jsxRuntimeExports.jsxs("g",{className:Me(["react-flow__edge",`react-flow__edge-${N}`,y.className,S,{selected:y.selected,animated:y.animated,inactive:!D&&!r,updating:z,selectable:D}]),onClick:ae,onDoubleClick:te,onContextMenu:ne,onMouseEnter:ee,onMouseMove:re,onMouseLeave:je,onKeyDown:A?Se:void 0,tabIndex:A?0:void 0,role:y.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":A?`${rd}-${j}`:void 0,ref:V,...y.domAttributes,children:[!$&&o.jsxRuntimeExports.jsx(k,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:O,sourceY:H,targetX:F,targetY:Z,sourcePosition:K,targetPosition:X,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:oe,markerEnd:J,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),I&&o.jsxRuntimeExports.jsx(o4,{edge:y,isReconnectable:I,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,sourceX:O,sourceY:H,targetX:F,targetY:Z,sourcePosition:K,targetPosition:X,setUpdateHover:B,setReconnecting:w})]})})}const i4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ld({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:h,onReconnectEnd:j,disableKeyboardA11y:E}){const{edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,onError:y}=Ee(i4,_e),C=KS(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx(qS,{defaultColor:e,rfId:n}),C.map(N=>o.jsxRuntimeExports.jsx(r4,{id:N,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:h,onReconnectEnd:j,rfId:n,onError:y,edgeTypes:s,disableKeyboardA11y:E},N))]})}Ld.displayName="EdgeRenderer";const l4=g.memo(Ld),a4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function c4({children:e}){const t=Ee(a4);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function u4(e){const t=zt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const d4=e=>e.panZoom?.syncViewport;function x4(e){const t=Ee(d4),n=ve();return g.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function p4(e){return e.connection.inProgress?{...e.connection,to:Bn(e.connection.to,e.transform)}:{...e.connection}}function m4(e){return p4}function f4(e){const t=m4();return Ee(t,_e)}const h4=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function g4({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:a,inProgress:c}=Ee(h4,_e);return!(i&&r&&c)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:Me(["react-flow__connection",Nu(a)]),children:o.jsxRuntimeExports.jsx(Pd,{style:t,type:n,CustomComponent:s,isValid:a})})})}const Pd=({style:e,type:t=ht.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:a,fromPosition:c,to:d,toNode:x,toHandle:p,toPosition:m}=f4();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:a,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:m,connectionStatus:Nu(s),toNode:x,toHandle:p});let h="";const j={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case ht.Bezier:[h]=Hu(j);break;case ht.SimpleBezier:[h]=Ed(j);break;case ht.Step:[h]=Fo({...j,borderRadius:0});break;case ht.SmoothStep:[h]=Fo(j);break;default:[h]=Zu(j)}return o.jsxRuntimeExports.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Pd.displayName="ConnectionLine";const j4={};function Al(e=j4){const t=g.useRef(e),n=ve();g.useEffect(()=>{if(process.env.NODE_ENV==="development"){const s=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const r of s)if(t.current[r]!==e[r]){n.getState().onError?.("002",Ie.error002());break}t.current=e}},[e])}function E4(){const e=ve(),t=g.useRef(!1);g.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",Ie.error013("react")),t.current=!0}},[])}function Td({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:h,connectionLineType:j,connectionLineStyle:E,connectionLineComponent:S,connectionLineContainerStyle:R,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:A,deleteKeyCode:I,onlyRenderVisibleElements:D,elementsSelectable:V,defaultViewport:z,translateExtent:B,minZoom:$,maxZoom:w,preventScrolling:P,defaultMarkerColor:L,zoomOnScroll:O,zoomOnPinch:H,panOnScroll:F,panOnScrollSpeed:Z,panOnScrollMode:K,zoomOnDoubleClick:X,panOnDrag:oe,onPaneClick:J,onPaneMouseEnter:ae,onPaneMouseMove:te,onPaneMouseLeave:ne,onPaneScroll:ee,onPaneContextMenu:re,paneClickDistance:je,nodeClickDistance:Se,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:U,onEdgeMouseLeave:de,reconnectRadius:be,onReconnect:Te,onReconnectStart:Xe,onReconnectEnd:Hn,noDragClassName:$n,noWheelClassName:Vn,noPanClassName:ln,disableKeyboardA11y:an,nodeExtent:qs,rfId:Fn,viewport:Ft,onViewportChange:cn}){return Al(e),Al(t),E4(),u4(n),x4(Ft),o.jsxRuntimeExports.jsx(OS,{onPaneClick:J,onPaneMouseEnter:ae,onPaneMouseMove:te,onPaneMouseLeave:ne,onPaneContextMenu:re,onPaneScroll:ee,paneClickDistance:je,deleteKeyCode:I,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:A,elementsSelectable:V,zoomOnScroll:O,zoomOnPinch:H,zoomOnDoubleClick:X,panOnScroll:F,panOnScrollSpeed:Z,panOnScrollMode:K,panOnDrag:oe,defaultViewport:z,translateExtent:B,minZoom:$,maxZoom:w,onSelectionContextMenu:p,preventScrolling:P,noDragClassName:$n,noWheelClassName:Vn,noPanClassName:ln,disableKeyboardA11y:an,onViewportChange:cn,isControlledViewport:!!Ft,children:o.jsxRuntimeExports.jsxs(c4,{children:[o.jsxRuntimeExports.jsx(l4,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:Te,onReconnectStart:Xe,onReconnectEnd:Hn,onlyRenderVisibleElements:D,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:U,onEdgeMouseLeave:de,reconnectRadius:be,defaultMarkerColor:L,noPanClassName:ln,disableKeyboardA11y:an,rfId:Fn}),o.jsxRuntimeExports.jsx(g4,{style:E,type:j,component:S,containerStyle:R}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(ZS,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:Se,onlyRenderVisibleElements:D,noPanClassName:ln,noDragClassName:$n,disableKeyboardA11y:an,nodeExtent:qs,rfId:Fn}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Td.displayName="GraphView";const y4=g.memo(Td),Il=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c=.5,maxZoom:d=2,nodeOrigin:x,nodeExtent:p}={})=>{const m=new Map,h=new Map,j=new Map,E=new Map,S=s??t??[],R=n??e??[],v=x??[0,0],y=p??wn;Yu(j,E,S);const C=Ko(R,m,h,{nodeOrigin:v,nodeExtent:y,elevateNodesOnSelect:!1});let N=[0,0,1];if(l&&r&&i){const k=On(m,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:A,y:I,zoom:D}=Gr(k,r,i,c,d,a?.padding??.1);N=[A,I,D]}return{rfId:"1",width:0,height:0,transform:N,nodes:R,nodesInitialized:C,nodeLookup:m,parentLookup:h,edges:S,edgeLookup:E,connectionLookup:j,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:wn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:At.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:a,fitViewResolver:null,connection:{..._u},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ys,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:vu}},S4=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p})=>$y((m,h)=>{async function j(){const{nodeLookup:E,panZoom:S,fitViewOptions:R,fitViewResolver:v,width:y,height:C,minZoom:N,maxZoom:k}=h();S&&(await B5({nodes:E,width:y,height:C,panZoom:S,minZoom:N,maxZoom:k},R),v?.resolve(!0),m({fitViewResolver:null}))}return{...Il({nodes:e,edges:t,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p,defaultNodes:n,defaultEdges:s}),setNodes:E=>{const{nodeLookup:S,parentLookup:R,nodeOrigin:v,elevateNodesOnSelect:y,fitViewQueued:C}=h(),N=Ko(E,S,R,{nodeOrigin:v,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!0});C&&N?(j(),m({nodes:E,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:E,nodesInitialized:N})},setEdges:E=>{const{connectionLookup:S,edgeLookup:R}=h();Yu(S,R,E),m({edges:E})},setDefaultNodesAndEdges:(E,S)=>{if(E){const{setNodes:R}=h();R(E),m({hasDefaultNodes:!0})}if(S){const{setEdges:R}=h();R(S),m({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:S,nodeLookup:R,parentLookup:v,domNode:y,nodeOrigin:C,nodeExtent:N,debug:k,fitViewQueued:A}=h(),{changes:I,updatedInternals:D}=sy(E,R,v,y,C,N);D&&(ey(R,v,{nodeOrigin:C,nodeExtent:N}),A?(j(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),I?.length>0&&(k&&console.log("React Flow: trigger node changes",I),S?.(I)))},updateNodePositions:(E,S=!1)=>{const R=[],v=[],{nodeLookup:y,triggerNodeChanges:C}=h();for(const[N,k]of E){const A=y.get(N),I=!!(A?.expandParent&&A?.parentId&&k?.position),D={id:N,type:"position",position:I?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:S};I&&A.parentId&&R.push({id:N,parentId:A.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),v.push(D)}if(R.length>0){const{parentLookup:N,nodeOrigin:k}=h(),A=Jr(R,y,N,k);v.push(...A)}C(v)},triggerNodeChanges:E=>{const{onNodesChange:S,setNodes:R,nodes:v,hasDefaultNodes:y,debug:C}=h();if(E?.length){if(y){const N=ad(E,v);R(N)}C&&console.log("React Flow: trigger node changes",E),S?.(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:S,setEdges:R,edges:v,hasDefaultEdges:y,debug:C}=h();if(E?.length){if(y){const N=cd(E,v);R(N)}C&&console.log("React Flow: trigger edge changes",E),S?.(E)}},addSelectedNodes:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const N=E.map(k=>wt(k,!0));y(N);return}y(Wt(v,new Set([...E]),!0)),C(Wt(R))},addSelectedEdges:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const N=E.map(k=>wt(k,!0));C(N);return}C(Wt(R,new Set([...E]))),y(Wt(v,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:S}={})=>{const{edges:R,nodes:v,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=h(),k=E||v,A=S||R,I=k.map(V=>{const z=y.get(V.id);return z&&(z.selected=!1),wt(V.id,!1)}),D=A.map(V=>wt(V.id,!1));C(I),N(D)},setMinZoom:E=>{const{panZoom:S,maxZoom:R}=h();S?.setScaleExtent([E,R]),m({minZoom:E})},setMaxZoom:E=>{const{panZoom:S,minZoom:R}=h();S?.setScaleExtent([R,E]),m({maxZoom:E})},setTranslateExtent:E=>{h().panZoom?.setTranslateExtent(E),m({translateExtent:E})},setPaneClickDistance:E=>{h().panZoom?.setClickDistance(E)},resetSelectedElements:()=>{const{edges:E,nodes:S,triggerNodeChanges:R,triggerEdgeChanges:v,elementsSelectable:y}=h();if(!y)return;const C=S.reduce((k,A)=>A.selected?[...k,wt(A.id,!1)]:k,[]),N=E.reduce((k,A)=>A.selected?[...k,wt(A.id,!1)]:k,[]);R(C),v(N)},setNodeExtent:E=>{const{nodes:S,nodeLookup:R,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:C,nodeExtent:N}=h();E[0][0]===N[0][0]&&E[0][1]===N[0][1]&&E[1][0]===N[1][0]&&E[1][1]===N[1][1]||(Ko(S,R,v,{nodeOrigin:y,nodeExtent:E,elevateNodesOnSelect:C,checkEquality:!1}),m({nodeExtent:E}))},panBy:E=>{const{transform:S,width:R,height:v,panZoom:y,translateExtent:C}=h();return oy({delta:E,panZoom:y,transform:S,translateExtent:C,width:R,height:v})},setCenter:async(E,S,R)=>{const{width:v,height:y,maxZoom:C,panZoom:N}=h();if(!N)return Promise.resolve(!1);const k=typeof R?.zoom<"u"?R.zoom:C;return await N.setViewport({x:v/2-E*k,y:y/2-S*k,zoom:k},{duration:R?.duration,ease:R?.ease,interpolate:R?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{..._u}})},updateConnection:E=>{m({connection:E})},reset:()=>m({...Il()})}},Object.is);function Ad({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:l,initialMaxZoom:a,initialFitViewOptions:c,fitView:d,nodeOrigin:x,nodeExtent:p,children:m}){const[h]=g.useState(()=>S4({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:d,minZoom:l,maxZoom:a,fitViewOptions:c,nodeOrigin:x,nodeExtent:p}));return o.jsxRuntimeExports.jsx(Vy,{value:h,children:o.jsxRuntimeExports.jsx(dS,{children:m})})}function R4({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:x,nodeOrigin:p,nodeExtent:m}){return g.useContext(Fs)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Ad,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:a,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:x,nodeOrigin:p,nodeExtent:m,children:e})}const C4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function w4({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:a,onEdgeClick:c,onInit:d,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:h,onConnectStart:j,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:k,onNodeDragStart:A,onNodeDrag:I,onNodeDragStop:D,onNodesDelete:V,onEdgesDelete:z,onDelete:B,onSelectionChange:$,onSelectionDragStart:w,onSelectionDrag:P,onSelectionDragStop:L,onSelectionContextMenu:O,onSelectionStart:H,onSelectionEnd:F,onBeforeDelete:Z,connectionMode:K,connectionLineType:X=ht.Bezier,connectionLineStyle:oe,connectionLineComponent:J,connectionLineContainerStyle:ae,deleteKeyCode:te="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:ee=!1,selectionMode:re=Xt.Full,panActivationKeyCode:je="Space",multiSelectionKeyCode:Se=Rs()?"Meta":"Control",zoomActivationKeyCode:ue=Rs()?"Meta":"Control",snapToGrid:me,snapGrid:U,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:be,nodesDraggable:Te,autoPanOnNodeFocus:Xe,nodesConnectable:Hn,nodesFocusable:$n,nodeOrigin:Vn=id,edgesFocusable:ln,edgesReconnectable:an,elementsSelectable:qs=!0,defaultViewport:Fn=tS,minZoom:Ft=.5,maxZoom:cn=2,translateExtent:li=wn,preventScrolling:kf=!0,nodeExtent:Xs,defaultMarkerColor:Lf="#b1b1b7",zoomOnScroll:Pf=!0,zoomOnPinch:Tf=!0,panOnScroll:Af=!1,panOnScrollSpeed:If=.5,panOnScrollMode:Of=vt.Free,zoomOnDoubleClick:Bf=!0,panOnDrag:Df=!0,onPaneClick:zf,onPaneMouseEnter:Hf,onPaneMouseMove:$f,onPaneMouseLeave:Vf,onPaneScroll:Ff,onPaneContextMenu:Zf,paneClickDistance:ai=0,nodeClickDistance:Kf=0,children:Yf,onReconnect:Wf,onReconnectStart:Gf,onReconnectEnd:Uf,onEdgeContextMenu:qf,onEdgeDoubleClick:Xf,onEdgeMouseEnter:Qf,onEdgeMouseMove:Jf,onEdgeMouseLeave:eh,reconnectRadius:th=10,onNodesChange:nh,onEdgesChange:sh,noDragClassName:oh="nodrag",noWheelClassName:rh="nowheel",noPanClassName:ci="nopan",fitView:ui,fitViewOptions:di,connectOnClick:ih,attributionPosition:lh,proOptions:ah,defaultEdgeOptions:ch,elevateNodesOnSelect:uh,elevateEdgesOnSelect:dh,disableKeyboardA11y:xi=!1,autoPanOnConnect:xh,autoPanOnNodeDrag:ph,autoPanSpeed:mh,connectionRadius:fh,isValidConnection:hh,onError:gh,style:jh,id:pi,nodeDragThreshold:Eh,connectionDragThreshold:yh,viewport:Sh,onViewportChange:Rh,width:Ch,height:wh,colorMode:bh="light",debug:vh,onScroll:mi,ariaLabelConfig:_h,...Nh},Mh){const Qs=pi||"1",kh=rS(bh),Lh=g.useCallback(fi=>{fi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),mi?.(fi)},[mi]);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...Nh,onScroll:Lh,style:{...jh,...C4},ref:Mh,className:Me(["react-flow",r,kh]),id:pi,role:"application",children:o.jsxRuntimeExports.jsxs(R4,{nodes:e,edges:t,width:Ch,height:wh,fitView:ui,fitViewOptions:di,minZoom:Ft,maxZoom:cn,nodeOrigin:Vn,nodeExtent:Xs,children:[o.jsxRuntimeExports.jsx(y4,{onInit:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:l,connectionLineType:X,connectionLineStyle:oe,connectionLineComponent:J,connectionLineContainerStyle:ae,selectionKeyCode:ne,selectionOnDrag:ee,selectionMode:re,deleteKeyCode:te,multiSelectionKeyCode:Se,panActivationKeyCode:je,zoomActivationKeyCode:ue,onlyRenderVisibleElements:de,defaultViewport:Fn,translateExtent:li,minZoom:Ft,maxZoom:cn,preventScrolling:kf,zoomOnScroll:Pf,zoomOnPinch:Tf,zoomOnDoubleClick:Bf,panOnScroll:Af,panOnScrollSpeed:If,panOnScrollMode:Of,panOnDrag:Df,onPaneClick:zf,onPaneMouseEnter:Hf,onPaneMouseMove:$f,onPaneMouseLeave:Vf,onPaneScroll:Ff,onPaneContextMenu:Zf,paneClickDistance:ai,nodeClickDistance:Kf,onSelectionContextMenu:O,onSelectionStart:H,onSelectionEnd:F,onReconnect:Wf,onReconnectStart:Gf,onReconnectEnd:Uf,onEdgeContextMenu:qf,onEdgeDoubleClick:Xf,onEdgeMouseEnter:Qf,onEdgeMouseMove:Jf,onEdgeMouseLeave:eh,reconnectRadius:th,defaultMarkerColor:Lf,noDragClassName:oh,noWheelClassName:rh,noPanClassName:ci,rfId:Qs,disableKeyboardA11y:xi,nodeExtent:Xs,viewport:Sh,onViewportChange:Rh}),o.jsxRuntimeExports.jsx(oS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:j,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:Te,autoPanOnNodeFocus:Xe,nodesConnectable:Hn,nodesFocusable:$n,edgesFocusable:ln,edgesReconnectable:an,elementsSelectable:qs,elevateNodesOnSelect:uh,elevateEdgesOnSelect:dh,minZoom:Ft,maxZoom:cn,nodeExtent:Xs,onNodesChange:nh,onEdgesChange:sh,snapToGrid:me,snapGrid:U,connectionMode:K,translateExtent:li,connectOnClick:ih,defaultEdgeOptions:ch,fitView:ui,fitViewOptions:di,onNodesDelete:V,onEdgesDelete:z,onDelete:B,onNodeDragStart:A,onNodeDrag:I,onNodeDragStop:D,onSelectionDrag:P,onSelectionDragStart:w,onSelectionDragStop:L,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:ci,nodeOrigin:Vn,rfId:Qs,autoPanOnConnect:xh,autoPanOnNodeDrag:ph,autoPanSpeed:mh,onError:gh,connectionRadius:fh,isValidConnection:hh,selectNodesOnDrag:be,nodeDragThreshold:Eh,connectionDragThreshold:yh,onBeforeDelete:Z,paneClickDistance:ai,debug:vh,ariaLabelConfig:_h}),o.jsxRuntimeExports.jsx(eS,{onSelectionChange:$}),Yf,o.jsxRuntimeExports.jsx(Uy,{proOptions:ah,position:lh}),o.jsxRuntimeExports.jsx(Gy,{rfId:Qs,disableKeyboardA11y:xi})]})})}var b4=ud(w4);function v4(){const e=ve();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const a=n?.querySelector(`.react-flow__node[data-id="${l}"]`);a&&i.set(l,{id:l,nodeElement:a,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function _4({onStart:e,onChange:t,onEnd:n}){const s=ve();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function N4({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Me(["react-flow__background-pattern",n,s])})}function M4({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Me(["react-flow__background-pattern","dots",t])})}var jt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(jt||(jt={}));const k4={[jt.Dots]:1,[jt.Lines]:1,[jt.Cross]:6},L4=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Id({id:e,variant:t=jt.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:a,style:c,className:d,patternClassName:x}){const p=g.useRef(null),{transform:m,patternId:h}=Ee(L4,_e),j=s||k4[t],E=t===jt.Dots,S=t===jt.Cross,R=Array.isArray(n)?n:[n,n],v=[R[0]*m[2]||1,R[1]*m[2]||1],y=j*m[2],C=Array.isArray(i)?i:[i,i],N=S?[y,y]:v,k=[C[0]*m[2]||1+N[0]/2,C[1]*m[2]||1+N[1]/2],A=`${h}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:Me(["react-flow__background",d]),style:{...c,...Ks,"--xy-background-color-props":a,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:A,x:m[0]%v[0],y:m[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:E?o.jsxRuntimeExports.jsx(M4,{radius:y/2,className:x}):o.jsxRuntimeExports.jsx(N4,{dimensions:N,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}Id.displayName="Background";const P4=g.memo(Id);function T4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function A4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function I4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 O4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 B4(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Jn({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:Me(["react-flow__controls-button",t]),...n,children:e})}const D4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Od({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:a,onInteractiveChange:c,className:d,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":h}){const j=ve(),{isInteractive:E,minZoomReached:S,maxZoomReached:R,ariaLabelConfig:v}=Ee(D4,_e),{zoomIn:y,zoomOut:C,fitView:N}=zt(),k=()=>{y(),i?.()},A=()=>{C(),l?.()},I=()=>{N(r),a?.()},D=()=>{j.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),c?.(!E)},V=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(Zs,{className:Me(["react-flow__controls",V,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":h??v["controls.ariaLabel"],children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Jn,{onClick:k,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:R,children:o.jsxRuntimeExports.jsx(T4,{})}),o.jsxRuntimeExports.jsx(Jn,{onClick:A,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:o.jsxRuntimeExports.jsx(A4,{})})]}),n&&o.jsxRuntimeExports.jsx(Jn,{className:"react-flow__controls-fitview",onClick:I,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:o.jsxRuntimeExports.jsx(I4,{})}),s&&o.jsxRuntimeExports.jsx(Jn,{className:"react-flow__controls-interactive",onClick:D,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:E?o.jsxRuntimeExports.jsx(B4,{}):o.jsxRuntimeExports.jsx(O4,{})}),x]})}Od.displayName="Controls";g.memo(Od);function z4({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:a,strokeWidth:c,className:d,borderRadius:x,shapeRendering:p,selected:m,onClick:h}){const{background:j,backgroundColor:E}=i||{},S=l||j||E;return o.jsxRuntimeExports.jsx("rect",{className:Me(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:p,onClick:h?R=>h(R,e):void 0})}const H4=g.memo(z4),$4=e=>e.nodes.map(t=>t.id),So=e=>e instanceof Function?e:()=>e;function V4({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=H4,onClick:l}){const a=Ee($4,_e),c=So(t),d=So(e),x=So(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:a.map(m=>o.jsxRuntimeExports.jsx(Z4,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function F4({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:a,onClick:c}){const{node:d,x,y:p,width:m,height:h}=Ee(j=>{const{internals:E}=j.nodeLookup.get(e),S=E.userNode,{x:R,y:v}=E.positionAbsolute,{width:y,height:C}=dt(S);return{node:S,x:R,y:v,width:y,height:C}},_e);return!d||d.hidden||!Au(d)?null:o.jsxRuntimeExports.jsx(a,{x,y:p,width:m,height:h,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:r,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const Z4=g.memo(F4);var K4=g.memo(V4);const Y4=200,W4=150,G4=e=>!e.hidden,U4=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?Tu(On(e.nodeLookup,{filter:G4}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},q4="react-flow__minimap-desc";function Bd({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:a,bgColor:c,maskColor:d,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:h,onNodeClick:j,pannable:E=!1,zoomable:S=!1,ariaLabel:R,inversePan:v,zoomStep:y=10,offsetScale:C=5}){const N=ve(),k=g.useRef(null),{boundingRect:A,viewBB:I,rfId:D,panZoom:V,translateExtent:z,flowWidth:B,flowHeight:$,ariaLabelConfig:w}=Ee(U4,_e),P=e?.width??Y4,L=e?.height??W4,O=A.width/P,H=A.height/L,F=Math.max(O,H),Z=F*P,K=F*L,X=C*F,oe=A.x-(Z-A.width)/2-X,J=A.y-(K-A.height)/2-X,ae=Z+X*2,te=K+X*2,ne=`${q4}-${D}`,ee=g.useRef(0),re=g.useRef();ee.current=F,g.useEffect(()=>{if(k.current&&V)return re.current=xy({domNode:k.current,panZoom:V,getTransform:()=>N.getState().transform,getViewScale:()=>ee.current}),()=>{re.current?.destroy()}},[V]),g.useEffect(()=>{re.current?.update({translateExtent:z,width:B,height:$,inversePan:v,pannable:E,zoomStep:y,zoomable:S})},[E,S,v,y,z,B,$]);const je=h?me=>{const[U,de]=re.current?.pointer(me)||[0,0];h(me,{x:U,y:de})}:void 0,Se=j?g.useCallback((me,U)=>{const de=N.getState().nodeLookup.get(U).internals.userNode;j(me,de)},[]):void 0,ue=R??w["minimap.ariaLabel"];return o.jsxRuntimeExports.jsx(Zs,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*F: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=="number"?l:void 0},className:Me(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:P,height:L,viewBox:`${oe} ${J} ${ae} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:k,onClick:je,children:[ue&&o.jsxRuntimeExports.jsx("title",{id:ne,children:ue}),o.jsxRuntimeExports.jsx(K4,{onClick:Se,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:a}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${oe-X},${J-X}h${ae+X*2}v${te+X*2}h${-ae-X*2}z
39
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Bd.displayName="MiniMap";g.memo(Bd);const X4=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Q4={[tn.Line]:"right",[tn.Handle]:"bottom-right"};function J4({nodeId:e,position:t,variant:n=tn.Handle,className:s,style:r=void 0,children:i,color:l,minWidth:a=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:m,autoScale:h=!0,shouldResize:j,onResizeStart:E,onResize:S,onResizeEnd:R}){const v=md(),y=typeof e=="string"?e:v,C=ve(),N=g.useRef(null),k=n===tn.Handle,A=Ee(g.useCallback(X4(k&&h),[k,h]),_e),I=g.useRef(null),D=t??Q4[n];g.useEffect(()=>{if(!(!N.current||!y))return I.current||(I.current=Ny({domNode:N.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:z,transform:B,snapGrid:$,snapToGrid:w,nodeOrigin:P,domNode:L}=C.getState();return{nodeLookup:z,transform:B,snapGrid:$,snapToGrid:w,nodeOrigin:P,paneDomNode:L}},onChange:(z,B)=>{const{triggerNodeChanges:$,nodeLookup:w,parentLookup:P,nodeOrigin:L}=C.getState(),O=[],H={x:z.x,y:z.y},F=w.get(y);if(F&&F.expandParent&&F.parentId){const Z=F.origin??L,K=z.width??F.measured.width??0,X=z.height??F.measured.height??0,oe={id:F.id,parentId:F.parentId,rect:{width:K,height:X,...Iu({x:z.x??F.position.x,y:z.y??F.position.y},{width:K,height:X},F.parentId,w,Z)}},J=Jr([oe],w,P,L);O.push(...J),H.x=z.x?Math.max(Z[0]*K,z.x):void 0,H.y=z.y?Math.max(Z[1]*X,z.y):void 0}if(H.x!==void 0&&H.y!==void 0){const Z={id:y,type:"position",position:{...H}};O.push(Z)}if(z.width!==void 0&&z.height!==void 0){const K={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};O.push(K)}for(const Z of B){const K={...Z,type:"position"};O.push(K)}$(O)},onEnd:({width:z,height:B})=>{const $={id:y,type:"dimensions",resizing:!1,dimensions:{width:z,height:B}};C.getState().triggerNodeChanges([$])}})),I.current.update({controlPosition:D,boundaries:{minWidth:a,minHeight:c,maxWidth:d,maxHeight:x},keepAspectRatio:p,resizeDirection:m,onResizeStart:E,onResize:S,onResizeEnd:R,shouldResize:j}),()=>{I.current?.destroy()}},[D,a,c,d,x,p,E,S,R,j]);const V=D.split("-");return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__resize-control","nodrag",...V,n,s]),ref:N,style:{...r,scale:A,...l&&{[k?"backgroundColor":"borderColor"]:l}},children:i})}g.memo(J4);const eR=(e,t)=>e.map((n,s)=>u.K.translate(n,t[s])),Dd=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(We,{path:Et(e),style:{stroke:u.ir.cssString(t)},...n}),tR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(We,{path:Et(e),style:{stroke:u.ir.cssString(t),strokeDasharray:"12,4"},...n}),nR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(We,{path:Et(e),style:{stroke:u.ir.cssString(t),strokeDasharray:"12,4,4"},...n}),sR=({points:e,color:t,...n})=>{const s=u.K.calculateMiters(e,6),r=e.map((c,d)=>u.K.translate(c,s[d])),i=e.map((c,d)=>u.K.translate(c,u.K.scale(s[d],-1))),l=u.ir.cssString(t),a=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(We,{path:Et(r),style:{stroke:l,opacity:a},...n}),o.jsxRuntimeExports.jsx(We,{path:Et(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(We,{path:Et(i),style:{stroke:l,opacity:a},...n})]})},Ol=5,oR=(e,t)=>{const n=[],s=[];for(let a=0;a<e.length-1;a++){const c=u.K.distance(e[a],e[a+1]);s.push(c)}const r=t;let i=0,l=r;for(let a=0;a<s.length;a++){const c=s[a],d=e[a],x=e[a+1];for(;i+c>=l;){const p=(l-i)/c,m={x:d.x+p*(x.x-d.x),y:d.y+p*(x.y-d.y)};let h="x";Math.abs(x.x-d.x)<1&&(h="y"),l+=r,!(u.K.distance(m,x)<Ol||u.K.distance(m,d)<Ol)&&n.push({position:m,direction:h})}i+=c}return n},rR=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},iR=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=u.K.translateX(t,-10),l=45;return n==="y"&&(i=u.K.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},lR=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.ir.cssString(e),strokeWidth:2}),ti=e=>{const t=({points:n,color:s,...r})=>{const i=Et(n),l=oR(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(We,{path:i,...r,style:{stroke:u.ir.cssString(s)}}),l.map(({position:a,direction:c},d)=>o.jsxRuntimeExports.jsx(e,{position:a,direction:c,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},aR=ti(rR),cR=ti(iR),uR=ti(lR),Et=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],a=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*a+l.x*(1-a)},${i.y*a+l.y*(1-a)}`)}return t},zd={pipe:Dd,electric:tR,secondary:nR,jacketed:sR,hydraulic:aR,pneumatic:cR,data:uR},Hd=Dd,dR=[{key:"pipe",name:"Pipe"},{key:"electric",name:"Electric Signal"},{key:"secondary",name:"Secondary"},{key:"jacketed",name:"Jacketed"},{key:"hydraulic",name:"Hydraulic"},{key:"pneumatic",name:"Pneumatic"},{key:"data",name:"Data"}],xR=e=>o.jsxRuntimeExports.jsx(Mn,{data:dR,...e,resourceName:"Path Type"}),Ys=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Be=(e,t)=>{const n=Ys(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return u.Ho.construct(s.position,u._.scale(u.Ho.dims(u.Ho.construct(n)),1/e.getZoom()))},pR=(e,t)=>Ws.fromFlow(e,t);class $d{node_=null;position;orientation;constructor(t,n){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 u.K.translate(u.Ho.topLeft(this.node.box),this.position)}}class Ws{key;box;handles;constructor(t,n,s){this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Be(n,t),r=Ys(t),i=r.getElementsByClassName("react-flow__handle"),l=u.Ho.construct(r),a=Array.from(i).map(c=>{const d=u.Ho.center(u.Ho.construct(c)),x=u.K.translation(u.Ho.topLeft(l),d),p=c.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=u.K$1.construct(p[0]);return new $d(x,m)});return new Ws(t,s,a)}}const mR=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:a,connectionStatus:c})=>{const x=document.querySelector(".react-flow__handle-connecting")?.className.match(/react-flow__handle-(\w+)/);if(x!=null){const j=u.K$1.outer.safeParse(x[1]);j.success&&(i=j.data)}const p=zt(),m=Kt({sourcePos:u.K.construct(e,t),targetPos:u.K.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Be(p,l?.id??""),targetBox:Be(p,l?.id??"")}),h=Wc(u.K.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(Hd,{points:h,style:{...a,stroke:u.ir.cssString(c==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l11)"),strokeWidth:2,fill:"none"}})},fR=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:a=[],onSegmentsChange:c,color:d="var(--pluto-gray-l11)",selected:x=!1,variant:p="pipe",...m})=>{const h=u.K.construct(m.sourceX,m.sourceY),j=g.useRef(h),E=u.K.equals(h,j.current),S=u.K.construct(m.targetX,m.targetY),R=g.useRef(S),v=u.K.equals(S,R.current),y=zt(),[C,N,k]=f.useCombinedStateAndRef(()=>a.length>0?a:Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Be(y,t),targetBox:Be(y,n)})),A=g.useRef(i),I=g.useRef(s),D=Pe.useDebouncedCallback(c,100,[c]);if(!E||!v){let w=C;const P=u.K.translation(j.current,h),L=u.K.translation(S,R.current);u.K.equals(P,u.K.scale(L,-1),.001)?(j.current=h,R.current=S):(E?v||(w=w2({delta:L,segments:w}),A.current!==i&&(A.current=i,w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Be(y,t),targetBox:Be(y,n)})),Ti({sourcePos:h,targetPos:S,next:w,prev:C})||(w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Be(y,t),targetBox:Be(y,n)})),R.current=S):(w=C2({delta:P,segments:w}),I.current!==s&&(I.current=s,w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Be(y,t),targetBox:Be(y,n)})),Ti({sourcePos:h,targetPos:S,next:w,prev:C})||(w=Kt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Be(y,t),targetBox:Be(y,n)})),j.current=h),D(w),N(w))}const V=g.useRef(null),z=Pe.useCursorDrag({onStart:g.useCallback((w,P,L)=>{V.current={index:Number(L.currentTarget.id.split("-")[1]),segments:[...k.current]}},[]),onMove:g.useCallback(w=>{if(V.current==null)return;const P=E2({segments:V.current.segments,index:V.current.index,magnitude:u.Ho.dim(w,u.g.swap(V.current.segments[V.current.index].direction),!0)/y.getZoom()});N(P)},[]),onEnd:g.useCallback(()=>c(k.current),[c])}),B=Wc(h,C,y.getZoom(),!0),$=zd[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx($,{points:B,color:d}),x&&hR(B).map((w,P)=>{const L=C[P].direction,O=u.g.swap(L),H={[u.g.dimension(L)]:"18px",[u.g.dimension(O)]:"4px"},F={[L]:w[L]-9,[O]:w[O]-2};return o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...H,...F,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:w.x-9,y:w.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${P}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(L)),draggable:!0,onDragStart:z})})]},P)})]})},hR=e=>e.slice(1).map((t,n)=>{const s=e[n];return u.K.construct((t.x+s.x)/2,(t.y+s.y)/2)}),gR=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.K.ZERO,zoom:1}})=>{const[r,i]=g.useState(n),[l,a]=g.useState("select"),[c,d]=g.useState(e),[x,p]=g.useState(t),[m,h]=g.useState(s),[j,E]=g.useState(!1);return{viewport:m,onViewportChange:h,edges:x,nodes:c,onNodesChange:d,onEdgesChange:p,editable:r,onEditableChange:i,fitViewOnResize:j,setFitViewOnResize:E,viewportMode:l,onViewportModeChange:a}},jR=()=>!0,ER={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},yR={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},Go={maxZoom:1,minZoom:.5,padding:.05},SR={hideAttribution:!0},Vd=g.createContext({editable:!0,visible:!0,viewportMode:"select",onViewportModeChange:()=>{},onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),on=()=>g.use(Vd),Fd=g.memo(({children:e})=>{const{registerNodeRenderer:t}=on();return g.useEffect(()=>t(e),[t,e]),null});Fd.displayName="NodeRenderer";const RR=["Backspace","Delete"],CR=e=>e==="pan"?{panOnDrag:!0}:e==="select"?{selectionOnDrag:!0}:{},wR=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:r,onEditableChange:i,editable:l,viewport:a,triggers:c,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:p,visible:m,dragHandleSelector:h,viewportMode:j,onViewportModeChange:E,...S})=>{const R=f.useMemoDeepEqual({visible:m}),[{path:v},,y]=f.use$2({aetherKey:e,type:_.Diagram$1.TYPE,schema:_.diagramStateZ,initialState:{position:a.position,region:u.Ho.ZERO,zoom:a.zoom,...R}}),{fitView:C}=zt(),N=Pe.useDebouncedCallback(U=>void C(U),50,[C]),k=Pn(g.useCallback(U=>{x&&N(Go),y(de=>({...de,region:U}))},[y,N,x]));g.useEffect(()=>y(U=>({...U,...R})),[R]);const A=u.ir.hex(f.use().colors.gray.l11),I=f.useMemoCompare(()=>c??br.zoom,f.compareModeConfigs,[c]),D=g.useRef(null),V=g.useCallback(U=>{const de=D.current;de!=null&&de.x===U.x&&de.y===U.y&&de.zoom===U.zoom||(D.current=U,!(isNaN(U.x)||isNaN(U.y)||isNaN(U.zoom))&&(y(be=>({...be,position:U,zoom:U.zoom})),d(Jc(U))))},[y,d]);_4({onStart:V,onChange:V,onEnd:V});const[z,B]=g.useState(()=>()=>null),$=g.useCallback(U=>B(()=>U),[]),w=g.useMemo(()=>({custom:({id:U,positionAbsoluteX:de,positionAbsoluteY:be,selected:Te=!1,draggable:Xe=!0})=>z({symbolKey:U,position:{x:de,y:be},selected:Te,draggable:Xe})}),[z]),P=g.useRef(r),L=g.useMemo(()=>(P.current=r,Hr(r)),[r]),O=g.useRef(s),H=g.useMemo(()=>(O.current=s,zr(s,h)),[s,h]),F=g.useCallback(U=>t(eu(O.current,de=>ad(U,de)),U),[t]),Z=g.useCallback(U=>n(ns(P.current,de=>cd(U,de),A)),[n,A]),K=g.useCallback((U,de)=>n(ns(P.current,be=>W5(U,de,be),A)),[]),X=g.useCallback(U=>n(ns(P.current,de=>Fu(U,de),A)),[n,A]),oe=g.useCallback((U,de)=>{const be=[...P.current],Te=be.findIndex(Xe=>Xe.key===U);Te!==-1&&(be[Te]={...be[Te],segments:de},P.current=be,n(be))},[n]),J=l?ER:yR,ae=f.useSyncedRef(oe),te=g.useMemo(()=>({default:U=>o.jsxRuntimeExports.jsx(fR,{...U,segments:U.data?.segments??[],color:U.data?.color,variant:U.data?.variant,onSegmentsChange:g.useCallback(de=>ae.current(U.id,de),[U.id])},U.id)}),[]),ne=g.useRef(null);f.use$1({triggers:I.zoomReset,callback:g.useCallback(({stage:U,cursor:de})=>{const be=ne.current;be==null||U!=="start"||!u.Ho.contains(be,de)||C()},[C])});const ee=f.purgeMouse(I.select)[0]??null,re=f.purgeMouse(I.pan)[0]??null,je=f.purgeMouse(I.zoom)[0]??null,Se={selectionOnDrag:ee==null,panOnDrag:re==null,selectionKeyCode:ee,panActivationKeyCode:re,zoomActivationKeyCode:je},ue=f.useCombinedRefs(ne,k),me=g.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:$,fitViewOnResize:x,setFitViewOnResize:p,viewportMode:j,onViewportModeChange:E}),[l,m,i,$,x,j,E]);return o.jsxRuntimeExports.jsx(Vd,{value:me,children:o.jsxRuntimeExports.jsx(f.Composite,{path:v,children:m&&o.jsxRuntimeExports.jsx(b4,{...Se,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(l),u.CSS.BE("symbol","container")),nodes:H,edges:L,nodeTypes:w,edgeTypes:te,ref:ue,fitView:!0,onNodesChange:F,onEdgesChange:Z,onConnect:X,onReconnect:K,defaultViewport:Qc(a),connectionLineComponent:mR,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:jR,connectionMode:At.Loose,fitViewOptions:Go,selectionMode:Xt.Partial,proOptions:SR,deleteKeyCode:RR,...S,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...S.style},...J,...CR(j),nodesDraggable:l})})})},bR=()=>{const{editable:e}=on();return e?o.jsxRuntimeExports.jsx(P4,{}):null},vR=e=>o.jsxRuntimeExports.jsx(f.Box,{x:!0,className:u.CSS.BE("diagram","controls"),...e}),_R=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=on();return o.jsxRuntimeExports.jsx(Yl.Toggle,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",tooltip:`${n?"Disable":"Enable"} editing`,...t,children:n?o.jsxRuntimeExports.jsx(f.EditOff,{}):o.jsxRuntimeExports.jsx(f.Edit,{})})},NR=({onClick:e,...t})=>{const{fitView:n}=zt(),{fitViewOnResize:s,setFitViewOnResize:r}=on();return o.jsxRuntimeExports.jsx(Yl.Toggle,{onClick:i=>{n(Go),e?.(i)},value:s,onChange:r,rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",...t,children:o.jsxRuntimeExports.jsx(f.Expand,{})})},Zd=["zoom","pan","select"],MR=()=>{const{viewportMode:e,onViewportModeChange:t}=on();return o.jsxRuntimeExports.jsxs(pe.Buttons,{keys:Zd,value:e,onChange:t,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",size:"small",children:o.jsxRuntimeExports.jsx(f.Pan,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",size:"small",children:o.jsxRuntimeExports.jsx(f.Selection,{})})]})},kR=e=>o.jsxRuntimeExports.jsx(Ad,{children:o.jsxRuntimeExports.jsx(wR,{...e})}),LR=Object.freeze(Object.defineProperty({__proto__:null,Background:bR,Controls:vR,DefaultPath:Hd,Diagram:kR,FitViewControl:NR,HandleLayout:$d,NodeLayout:Ws,NodeRenderer:Fd,PATHS:zd,SelectPathType:xR,SelectViewportModeControl:MR,ToggleEditControl:_R,VIEWPORT_MODES:Zd,alignNodes:N2,calcPath:Et,edgeConverter:ns,edgeZ:v2,nodeConverter:eu,nodeZ:_2,offsetPath:eR,rfEdgeDataZ:Uc,selectNode:Ys,selectNodeBox:Be,selectNodeLayout:pR,translateEdgesBackward:Xc,translateEdgesForward:Hr,translateNodesBackward:qc,translateNodesForward:zr,translateViewportBackward:Jc,translateViewportForward:Qc,use:gR,useContext:on,viewportZ:b2},Symbol.toStringTag,{value:"Module"})),PR=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(f.Summary,{center:!0,level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...a})=>{const c=f.useMemoDeepEqual({font:t,color:i,telem:l,visible:s}),[,{scrolling:d,empty:x},p]=f.use$2({type:_.Log.TYPE,schema:_.logState,initialState:{empty:!0,region:u.Ho.ZERO,scrolling:!1,wheelPos:0,...c}});g.useEffect(()=>{p(h=>({...h,...c}))},[c,p]);const m=Pn(g.useCallback(h=>p(j=>({...j,region:h})),[p]));return o.jsxRuntimeExports.jsx("div",{ref:m,className:u.CSS(u.CSS.B("log"),n),onWheel:h=>{p(j=>({...j,wheelPos:j.wheelPos-h.deltaY,scrolling:j.scrolling?j.scrolling:h.deltaY<0}))},...a,children:x?r:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("log","live"),d&&u.CSS.M("active")),variant:"outlined",onClick:()=>p(h=>({...h,scrolling:!h.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",tooltipLocation:u.K$1.BOTTOM_LEFT,children:o.jsxRuntimeExports.jsx(f.Dynamic,{})})})},TR=Object.freeze(Object.defineProperty({__proto__:null,Log:PR},Symbol.toStringTag,{value:"Module"})),AR="Schematic.Grid",Gs=u.CSS.B("drag-handle"),IR=e=>{const n=Ys(e).closest(".react-flow__pane");n!=null&&f.triggerReflow(n)},Dn=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${AR}`,[a,c]=g.useState(!1),d=g.useMemo(()=>f.canDropOfType(l),[l]),x=f.useSyncedRef(i),{startDrag:p,onDragEnd:m,...h}=f.useDragAndDrop({type:l,canDrop:d,onDrop:g.useCallback(({items:R})=>(c(!1),R),[]),onDragOver:g.useCallback(R=>{const{items:v}=R;c(d(R)),v.forEach(({key:y})=>x.current(y,e))},[])}),j=r.filter(R=>R.location===e),E=g.useCallback((R,v)=>{p([{key:v,type:l}]),document.addEventListener("mousemove",m,{once:!0})},[p,l,m]),S=d(f.useDraggingState());return o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e),u.CSS.dropRegion(S),a&&u.CSS.B("dragging-over"),S&&u.CSS.B("dragging")),onDragLeave:()=>c(!1),empty:!0,...h,children:j.map(({element:R,key:v})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(R,{draggable:!0,onDragStart:y=>E(y,v),onDragEnd:m,style:{...R.props.style,cursor:"grab"}})},v))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r;if(i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(c=>c.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e)),empty:!0,children:a.map(({element:c,key:d})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:c},d))})}},OR=Dn("top"),BR=Dn("left"),DR=Dn("right"),zR=Dn("bottom"),HR=Dn("center"),Ht=({editable:e,allowRotate:t=!0,children:n,allowCenter:s,onRotate:r,symbolKey:i,...l})=>{const a=g.useRef(e);return e!==a.current&&(IR(i),a.current=e),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(OR,{editable:e,symbolKey:i,...l},`top-${i}`),o.jsxRuntimeExports.jsx(BR,{editable:e,symbolKey:i,...l},`left-${i}`),o.jsxRuntimeExports.jsx(DR,{editable:e,symbolKey:i,...l},`right-${i}`),o.jsxRuntimeExports.jsx(zR,{editable:e,symbolKey:i,...l},`bottom-${i}`),s&&o.jsxRuntimeExports.jsx(HR,{editable:e,symbolKey:i,...l},`center-${i}`),e&&t&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.BE("grid","rotate"),size:"tiny",variant:"filled",onClick:r,children:o.jsxRuntimeExports.jsx(f.Rotate,{})}),o.jsxRuntimeExports.jsx("div",{className:Gs,children:n})]})},$R=_.MODES,VR=({aetherKey:e,sink:t,mode:n})=>{const s=f.useMemoDeepEqual({sink:t,mode:n}),r=g.useRef({trigger:0,...s}),{setState:i}=f.useLifecycle({aetherKey:e,type:_.Button.TYPE,schema:_.buttonStateZ,initialState:r.current});g.useEffect(()=>{r.current={...r.current,...s},i(r.current)},[s,i,e]);const l=g.useCallback(()=>{r.current.trigger+=_.MOUSE_UP_INCREMENT,i(r.current)},[i]),a=g.useCallback(()=>{r.current.trigger+=_.MOUSE_DOWN_INCREMENT,i(r.current)},[i]);return{onClick:l,onMouseDown:a,onMouseUp:l}},FR=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:$R,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"fire",tooltip:"Output true when clicked",children:"Fire"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"momentary",tooltip:"Output true on press, false on release",children:"Momentary"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pulse",tooltip:"Output true and then immediately output false on click",children:"Pulse"})]}),ZR=({value:e,hideOuter:t=!1,showOuterCenter:n=!1,hideInner:s,onChange:r})=>{const{outer:i}=e,l=c=>()=>r({...e,...c}),a=u.CSS.B("select","orientation");return t?o.jsxRuntimeExports.jsx(Bl,{className:a,value:e,onChange:r}):o.jsxRuntimeExports.jsxs(f.Box,{className:a,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(it,{selected:i==="top",onClick:l({outer:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(it,{selected:i==="left",onClick:l({outer:"left"})}),o.jsxRuntimeExports.jsx(Bl,{hideInner:s,value:e,onChange:r,showOuterCenter:n}),o.jsxRuntimeExports.jsx(it,{selected:i==="right",onClick:l({outer:"right"})})]}),o.jsxRuntimeExports.jsx(it,{selected:i==="bottom",onClick:l({outer:"bottom"})})]})},Bl=({value:e,onChange:t,className:n,hideInner:s=!1,showOuterCenter:r=!1,...i})=>{const{inner:l}=e,a=x=>()=>t({...e,...x});let c={};s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"});let d=null;return r?d=o.jsxRuntimeExports.jsx(it,{selected:e.outer==="center",onClick:a({outer:"center"})}):d=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="top",onClick:a({inner:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,selected:l==="left",onClick:a({inner:"left"})}),o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,selected:l==="right",onClick:a({inner:"right"})})]}),o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="bottom",onClick:a({inner:"bottom"})})]}),o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(n,u.CSS.B("value"),r&&u.CSS.M("show-outer-center")),y:!0,align:"center",justify:"center",empty:!0,...i,children:d})},it=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),size:"tiny",...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Le=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),gap:t==="x"?"large":"medium",...n}),St=({hideOuter:e,hideInner:t,showOuterCenter:n,...s})=>t&&e?null:o.jsxRuntimeExports.jsx(ye,{label:"Orientation",padHelpText:!1,...s,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(ZR,{value:{inner:r.orientation??"top",outer:r.label?.orientation??"top"},hideInner:t,hideOuter:e,showOuterCenter:n,onChange:l=>i({...r,orientation:l.inner,label:{...r.label,orientation:l.outer}})})}),xt=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Text$2,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx(He,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(nn,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(gc,{value:n,onChange:s,yDirection:"down"})})]}),ze=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(Pe.Swatch,{value:t??u.ir.setAlpha(u.ir.ZERO,1),onChange:n,...r,bordered:!0})}),Kd=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),xe=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ze,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(ye,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(f.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(Kd,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(St,{path:"",hideInner:t,hideOuter:n})]}),KR=({path:e})=>{const{value:t,onChange:n}=yt(e),s=_.sourcePipelinePropsZ.parse(t.source?.props),r=_.sinkPipelinePropsZ.parse(t.sink?.props),i=_.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=_.setChannelValuePropsZ.parse(r.segments.setter.props),a=d=>{d??=0;const x=_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:d}),threshold:_.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{d??=0;const x=_.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:_.setChannelValue({channel:d}),setpoint:_.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=_.authoritySource({channel:d}),m=_.acquireChannelControl({channel:d,authority:255});n({...t,sink:x,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:m,source:p},indicator:{statusSource:p}}})};return o.jsxRuntimeExports.jsxs(Le,{x:!0,grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:i.channel,onChange:a})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:l.channel,onChange:c})}),o.jsxRuntimeExports.jsx(Ns,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},ni=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Re=({hideInnerOrientation:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(KR,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{hideInnerOrientation:e})}},[e]),n=ke.useStatic({tabs:ni,content:t});return o.jsxRuntimeExports.jsx(ke.Tabs,{...n})},ft={y:2,x:.25},En={lower:0,upper:2e3},Dl={lower:0,upper:51},Yd=({includeBorderRadius:e=!1,includeStrokeWidth:t=!1})=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(ze,{path:"color"}),o.jsxRuntimeExports.jsx(ze,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:ft,bounds:Dl,endContent:"%",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:ft,bounds:Dl,endContent:"%",...n})}),e&&o.jsxRuntimeExports.jsx(ye,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:ft,bounds:En,endContent:"px",...n})}),t&&o.jsxRuntimeExports.jsx(ye,{path:"strokeWidth",hideIfNull:!0,optional:!0,label:"Border Width",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:ft,bounds:{lower:0,upper:21},endContent:"px",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:ft,bounds:En,endContent:"px",...s})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:ft,bounds:En,endContent:"px",...s})})]})]}),o.jsxRuntimeExports.jsx(St,{path:"",hideInner:!0,showOuterCenter:!0,label:"Label Location"})]}),YR=()=>o.jsxRuntimeExports.jsx(Le,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(ze,{path:"color"}),o.jsxRuntimeExports.jsx(ze,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(He,{path:"rotation",label:"Rotation",inputProps:{dragScale:{x:1,y:.25},bounds:{lower:0,upper:360},endContent:"°"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"numSides",label:"Number of Sides",inputProps:{dragScale:{x:.5,y:.1},bounds:{lower:3,upper:21}},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"sideLength",label:"Side Length",inputProps:{dragScale:{x:1,y:1},bounds:{lower:10,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"cornerRounding",label:"Corner Rounding",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:181},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),WR=()=>o.jsxRuntimeExports.jsx(Le,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(ze,{path:"color"}),o.jsxRuntimeExports.jsx(ze,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(He,{path:"radius",label:"Radius",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx(He,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),Wd=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],GR={dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"},UR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Le,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsx(Or,{path:""}),";"]});case"redline":return o.jsxRuntimeExports.jsx(Le,{y:!0,empty:!0,children:o.jsxRuntimeExports.jsx(Ir,{path:"redline"})});default:return o.jsxRuntimeExports.jsxs(Le,{x:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(ze,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(f.Text$2,{...s})}),o.jsxRuntimeExports.jsx(He,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:GR}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(nn,{value:s,onChange:r})})]})]}),o.jsxRuntimeExports.jsx(St,{path:"",hideInner:!0})]})}},[]),t=ke.useStatic({tabs:Wd,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},qR=({path:e})=>{const{value:t,onChange:n}=yt(e),s=_.sourcePipelinePropsZ.parse(t.source?.props),r=_.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=_.withinBoundsProps.parse(s.segments.threshold.props),l=d=>{d??=0;const x=_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:d}),threshold:_.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:x})},a=d=>{const x=_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:r.channel}),threshold:_.withinBounds({trueBound:d})},outlet:"threshold"});n({...t,source:x})},[c]=Ms(r.channel);return g.useEffect(()=>n({...t}),[c]),o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.lower??.9,onChange:d=>a({...i.trueBound,lower:d})})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.upper??1.1,onChange:d=>a({...i.trueBound,upper:d})})})]})},XR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(qR,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{})}},[]),t=ke.useStatic({tabs:Wd,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},QR=({path:e})=>{const{value:t,onChange:n}=yt(e),s=_.sinkPipelinePropsZ.parse(t.sink?.props),r=_.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=_.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:_.setChannelValue({channel:l}),setpoint:_.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),c=_.authoritySource({channel:l}),d=_.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}}})};return o.jsxRuntimeExports.jsxs(Le,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Output Channel",grow:!0,padHelpText:!1,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx(He,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0,padHelpText:!1}),o.jsxRuntimeExports.jsx(Ns,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0,padHelpText:!1})]}),o.jsxRuntimeExports.jsx(ye,{path:"mode",label:"Mode",optional:!0,children:({value:l,onChange:a})=>o.jsxRuntimeExports.jsx(FR,{value:l,onChange:a})})]})},JR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(QR,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=ke.useStatic({tabs:ni,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},eC=({path:e})=>{const{value:t,onChange:n}=yt(e),s=_.sinkPipelinePropsZ.parse(t.sink?.props),r=_.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=_.sinkPipeline("number",{connections:[],segments:{setter:_.setChannelValue({channel:l})},inlet:"setter"}),c=_.authoritySource({channel:l}),d=_.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}},disabled:l==0})};return o.jsxRuntimeExports.jsx(Le,{x:!0,grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:i})})})},tC=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(eC,{path:""});default:return o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",grow:!0,gap:"small",children:[o.jsxRuntimeExports.jsx(xt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(ur,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(ye,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(ia,{value:s,onChange:r})}),o.jsxRuntimeExports.jsx(ze,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(St,{path:"",hideInner:!0})]})}},[]),t=ke.useStatic({tabs:ni,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},nC=()=>{const e=yt("autoFit",{optional:!0});return o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:"value",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(f.Text$2,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Text Size",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(nn,{value:t,onChange:n})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n})})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(ze,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(f.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(f.Button,{onClick:()=>e?.onChange(!0),disabled:e?.value===!0,variant:"outlined",tooltip:e?.value===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:o.jsxRuntimeExports.jsx(f.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(St,{path:""})]})},sC=()=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(ze,{path:"color"})]}),o.jsxRuntimeExports.jsx(St,{path:"",hideOuter:!0})]}),oC=()=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(ze,{path:"color"}),o.jsxRuntimeExports.jsx(ze,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:ft,bounds:En,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:ft,bounds:En,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(St,{path:"",hideInner:!0})]}),$t=()=>o.jsxRuntimeExports.jsxs(Le,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(xt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ze,{path:"color"}),o.jsxRuntimeExports.jsx(Kd,{path:"scale"}),o.jsxRuntimeExports.jsx(Ns,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(St,{path:""})]}),rC=()=>o.jsxRuntimeExports.jsx(Yd,{includeBorderRadius:!0,includeStrokeWidth:!0}),iC=()=>o.jsxRuntimeExports.jsx(Re,{hideInnerOrientation:!0}),T=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),ge=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ne=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),lC={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}},aC=(e,t)=>lC[t][e],cC=(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}},uC=(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},W=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=v4()}catch{return null}const r=g.useRef(null),i=g.useRef(!0);return g.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const a=r.current.closest(".react-flow__node")?.getAttribute("data-id");a!=null&&s?.(a)},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},b=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...a})=>{const c=uC(i,s,t,n);return o.jsxRuntimeExports.jsx(Nn,{position:cC(aC(e,t),!r),...a,type:"source",onClick:d=>d.stopPropagation(),className:(u.CSS.B("handle"),u.CSS.BE("handle",a.id)),style:{left:`${c.left}%`,top:`${c.top}%`,...l}})},he=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("symbol-primitive"),u.CSS.B("symbol-primitive-toggle"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),e),color:u.ir.cssString(r),...i}),ie=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),dC=.8,q=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...a})=>{e=u.g.construct(t)==="y"?u._.swap(e):e;const d=u.ir.cssString(r),x=f.use();let p={...i,aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*dC).width};return r!=null&&(p={...p,[u.CSS.var("symbol-color")]:u.ir.rgbString(r),[u.CSS.var("symbol-color-contrast")]:u.ir.rgbString(u.ir.pickByContrast(r,x.colors.gray.l0,x.colors.gray.l11))}),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u._.svgViewBox(e),className:u.CSS(u.CSS.loc(t),s),fill:d,stroke:d,...a,style:p,children:o.jsxRuntimeExports.jsx("g",{children:n})})},Gd=({className:e,orientation:t="left",scale:n,color:s,...r})=>{const i=u.ir.cssString(s);return o.jsxRuntimeExports.jsxs(he,{...r,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:12.037,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:87.963,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:7.2916,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:92.6084,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:108,height:96},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(T,{d:"M3.02937 72.7038C2.50936 73.1041 2.50936 73.8883 3.02937 74.2886L7.14001 77.453C7.79757 77.9592 8.75 77.4904 8.75 76.6606V70.3318C8.75 69.502 7.79757 69.0332 7.14001 69.5394L3.02937 72.7038Z",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M54.2 48L17.0545 29.2035C15.059 28.1937 12.7 29.6438 12.7 31.8803V64.1197C12.7 66.3562 15.059 67.8063 17.0545 66.7965L54.2 48ZM54.2 48L91.3455 29.2035C93.341 28.1937 95.7 29.6438 95.7 31.8803V64.1197C95.7 66.3562 93.341 67.8063 91.3455 66.7965L54.2 48Z"}),o.jsxRuntimeExports.jsx(T,{d:"M54.2 48L35.4035 85.1455C34.3937 87.141 35.8439 89.5 38.0803 89.5H70.3197C72.5562 89.5 74.0063 87.141 72.9965 85.1455L54.2 48ZM54.2 48L35.4035 10.8545C34.3937 8.85901 35.8439 6.5 38.0803 6.5H70.3197C72.5562 6.5 74.0063 8.85901 72.9965 10.8545L54.2 48Z"}),o.jsxRuntimeExports.jsx(T,{d:"M8.70001 73.5C24.7 73.5 28.7 86.8333 28.7 93.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M105.371 23.2962C105.891 22.8959 105.891 22.1117 105.371 21.7114L101.26 18.547C100.602 18.0408 99.65 18.5096 99.65 19.3394V25.6682C99.65 26.498 100.602 26.9668 101.26 26.4606L105.371 23.2962Z",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M99.7 22.5C83.7 22.5 79.7 9.16667 79.7 2.5",strokeLinecap:"round"})]})]})},Ud=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),qd=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(T,{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"})})]}),Xd=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(T,{className:u.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"}),o.jsxRuntimeExports.jsx(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(ge,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Qd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Jd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),ex=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(ie,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M7 39.5V11.5941C7 9.42886 9.22384 7.97669 11.2063 8.84738L76.7937 37.6526C78.7762 38.5233 81 37.0711 81 34.9059V6",strokeLinecap:"round"})]})]})},tx=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(ie,{orientation:t,className:u.CSS(u.CSS.B("check-valve-with-arrow"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.602,top:60.65,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.775,top:60.65,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:93,height:57},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M67.4706 5.20759C67.9906 5.6079 67.9906 6.3921 67.4706 6.79241L63.36 9.95678C62.7024 10.463 61.75 9.99421 61.75 9.16437V2.83563C61.75 2.00579 62.7024 1.53702 63.36 2.04322L67.4706 5.20759Z",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M62.5 6H32.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ne,{cx:"7.5",cy:"13.5",r:"6",fill:i}),o.jsxRuntimeExports.jsx(T,{d:"M49 34.5L11.8545 15.7035C9.85901 14.6937 7.5 16.1438 7.5 18.3803V50.6197C7.5 52.8562 9.85901 54.3063 11.8545 53.2965L49 34.5ZM49 34.5L86.1455 15.7035C88.141 14.6937 90.5 16.1438 90.5 18.3803V50.6197C90.5 52.8562 88.141 54.3063 86.1455 53.2965L49 34.5Z"})]})]})},nx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),sx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(T,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 28.8486L80.6455 39.5202C82.641 40.5299 85 39.0798 85 36.8434V4.60396C85 2.36751 82.641 0.917381 80.6455 1.92716L60.5 12.3486"})]})]}),ox=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(T,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(T,{d:"M35.3737 38.7499L24.7021 58.8954C23.6923 60.8909 25.1425 63.2499 27.3789 63.2499H59.6183C61.8548 63.2499 63.3049 60.8909 62.2951 58.8954L51.8737 38.7499"})]})]}),rx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 2 L43.5 39.7965"})]})]}),ix=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(Ne,{cx:"43.5",cy:"21",r:"10",fill:u.ir.cssString(e)})]})]}),lx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"43.5",cy:"21",r:"10",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),ax=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"91",cy:"49.5",r:"6",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(Ne,{cx:"8",cy:"7.5",r:"6",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(T,{d:"M49.5 28.5L12.3545 9.70349C10.359 8.69372 8 10.1438 8 12.3803V44.6197C8 46.8562 10.359 48.3063 12.3545 47.2965L49.5 28.5ZM49.5 28.5L86.6455 9.70349C88.641 8.69372 91 10.1438 91 12.3803V44.6197C91 46.8562 88.641 48.3063 86.6455 47.2965L49.5 28.5Z"})]})]}),cx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),ux=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=u.ir.cssString(t);return o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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}),o.jsxRuntimeExports.jsx(T,{d:"M33 24H2",strokeLinecap:"round"})]})]})},dx=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),xx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{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"})})]}),px=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(T,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),mx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),fx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{color:n,dimensions:{width:72,height:36},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 33V22",strokeLinecap:"round"})]})]}),zl=(e,t)=>e/t*100,hx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{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"})})]}),gx=e=>typeof e=="number"?{topLeft:u.K.construct(e),topRight:u.K.construct(e),bottomLeft:u.K.construct(e),bottomRight:u.K.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:u.K.construct(e.topLeft),topRight:u.K.construct(e.topRight),bottomLeft:u.K.construct(e.bottomLeft),bottomRight:u.K.construct(e.bottomRight)}:e,xC=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},jx={width:40,height:80},si={x:50,y:10},Us=({className:e,dimensions:t=jx,borderRadius:n=si,boxBorderRadius:s,color:r,backgroundColor:i,strokeWidth:l=2,...a})=>{const c=gx(n),d=s==null,x=f.use(),{width:p,height:m}=t,h=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,m,p]),j=zl(1,p),E=100-j,S=zl(1,m),R=100-S;return o.jsxRuntimeExports.jsx(ie,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??xC(c),borderColor:u.ir.cssString(r??x.colors.gray.l11),backgroundColor:u.ir.cssString(i),borderWidth:l},...a,children:o.jsxRuntimeExports.jsxs(W,{refreshDeps:h,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:S,id:"1"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:j,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:E,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:R,id:"4"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:j,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:E,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:j,top:50,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:E,top:50,id:"8"})]})})},pC=20,mC=(e,t,n=0,s=4)=>{const r=2*Math.PI/e,i=n*Math.PI/180,l=t/(2*Math.sin(Math.PI/e)),a=l+s/2;return Array.from({length:e}).map((c,d)=>{const x=r*d+i-Math.PI/2;return{x:a+l*Math.cos(x),y:a+l*Math.sin(x)}})},fC=(e,t,n)=>{const s=[],r=Math.min(n,t/2),i=e.length;if(i<3||r<=0)return`M ${e.map(l=>`${l.x},${l.y}`).join(" L ")} Z`;for(let l=0;l<i;l++){const a=e[(l-1+i)%i],c=e[l],d=e[(l+1)%i],x=c.x-a.x,p=c.y-a.y,m=d.x-c.x,h=d.y-c.y,j=Math.hypot(x,p),E=Math.hypot(m,h),S=r/j,R=r/E,v=c.x-x*S,y=c.y-p*S,C=c.x+m*R,N=c.y+h*R;l===0?s.push(`M ${v},${y}`):s.push(`L ${v},${y}`),s.push(`Q ${c.x},${c.y} ${C},${N}`)}return s.push("Z"),s.join(" ")},oi=({numSides:e,sideLength:t,rotation:n=0,color:s,backgroundColor:r,className:i,cornerRounding:l,strokeWidth:a,...c})=>{const d=f.use(),x=g.useMemo(()=>2*((a??2)+1),[a]),p=g.useMemo(()=>mC(e,t,n,x),[e,t,n,x]),m=g.useMemo(()=>fC(p,t,l??0),[p,t,l]),h=g.useMemo(()=>2*(t/(2*Math.sin(Math.PI/e)))+x,[t,e,x]);return o.jsxRuntimeExports.jsx(ie,{className:u.CSS(i,u.CSS.B("polygon")),...c,children:o.jsxRuntimeExports.jsx(q,{dimensions:{width:h,height:h},children:o.jsxRuntimeExports.jsx(T,{d:m,fill:u.ir.cssString(r??d.colors.gray.l1),stroke:u.ir.cssString(s??d.colors.gray.l9),strokeWidth:a??2})})})},Ex=({radius:e,color:t,backgroundColor:n,className:s,strokeWidth:r,...i})=>{const l=(r??2)+1,a=e*2,c=a+2*l,d=a+2*l;return o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(s,u.CSS.B("circle-shape")),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:"left",refreshDeps:e,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:l/d*100,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:(d-l)/d*100,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:l/c*100,top:50,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:(c-l)/c*100,top:50,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:c,height:d},children:o.jsxRuntimeExports.jsx(Ne,{cx:c/2,cy:d/2,r:e,stroke:u.ir.cssString(t),strokeWidth:r??2,fill:u.ir.cssString(n)})})]})},yx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),Sx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(e,u.CSS.B("regulator-manual")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:2.2989,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.381,top:75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.619,top:75,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:84},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M43.5 20L43.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M19.5 2L67.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 63L6.35453 44.2035C4.35901 43.1937 2 44.6438 2 46.8803V79.1197C2 81.3562 4.35901 82.8063 6.35453 81.7965L43.5 63ZM43.5 63L80.6455 44.2035C82.641 43.1937 85 44.6438 85 46.8803V79.1197C85 81.3562 82.641 82.8063 80.6455 81.7965L43.5 63Z"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(T,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"63",x2:"43.5",y2:"40"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 20V18C43.5 16.3431 44.8431 15 46.5 15H79.5C81.1569 15 82.5 16.3431 82.5 18V34.4281C82.5 35.4126 82.017 36.3344 81.2076 36.8947L43.5 63"})]})]}),Rx=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(T,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Cx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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:u.ir.cssString(n)}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),wx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),bx=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:a=80,...c})=>{const d=u.ir.cssString(t),x=f.use(),p=t==null?"var(--pluto-gray-l0)":u.ir.cssString(u.ir.pickByContrast(t,x.colors.gray.l0,x.colors.gray.l11));return o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("value"),e),...c,style:{borderColor:d,height:n?.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n?.width,inlineSize:a,maxWidth:n?.width},children:l}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:o.jsxRuntimeExports.jsx(f.Text,{level:i,color:p,children:r})})]})},vx=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(ie,{orientation:n,children:[o.jsxRuntimeExports.jsx(f.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),_x=({onClick:e,onMouseDown:t,onMouseUp:n,orientation:s="left",label:r="",color:i,size:l,level:a,onClickDelay:c})=>o.jsxRuntimeExports.jsxs(ie,{orientation:s,children:[o.jsxRuntimeExports.jsx(f.Button,{variant:"filled",onClick:e,onMouseDown:t,onMouseUp:n,color:i,size:l,level:a,onClickDelay:c,children:r}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:s,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:s,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:s,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]})]}),Nx=({className:e,orientation:t="left",width:n,color:s,level:r,autoFit:i,align:l="center",value:a,onChange:c,...d})=>{const x={textAlign:l};return u.g.construct(t)==="y"?x.height=i?"fit-content":n:x.width=i?"fit-content":n,o.jsxRuntimeExports.jsx(ie,{style:x,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),...d,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS.BE("symbol","label"),color:u.ir.cssString(s),level:r,value:a,onChange:c})})},Mx=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:a,size:c="small",disabled:d,...x})=>{const[p,m]=g.useState(r);return o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(f.Numeric,{size:c,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:l,borderWidth:1,disabled:d,children:o.jsxRuntimeExports.jsx(f.Button,{size:c,variant:"filled",onClick:()=>a(p),color:l,children:"Set"})})]})},kx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Lx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"})})]}),Px=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{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:u.CSS(u.CSS.M("detail"),t)})]})]}),Tx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(T,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Ax=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Ix=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Ox=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(Ne,{cx:"32",cy:"32",r:"30"})})]}),Bx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.29885,top:69.565,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.70115,top:69.565,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:23.1479,top:23.61,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:11.11,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:76.8521,top:23.61,id:"5"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M43.5 49L6.35453 30.2035C4.35901 29.1937 2 30.6438 2 32.8803V65.1197C2 67.3562 4.35901 68.8063 6.35453 67.7965L43.5 49ZM43.5 49L80.6455 30.2035C82.641 29.1937 85 30.6438 85 32.8803V65.1197C85 67.3562 82.641 68.8063 80.6455 67.7965L43.5 49Z"}),o.jsxRuntimeExports.jsx(ge,{x:"21",y:"6.5",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M43 6.5V4C43 2.34315 44.3431 1 46 1H79C80.6569 1 82 2.34315 82 4V20.4281C82 21.4126 81.517 22.3344 80.7076 22.8947L43 49"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"24.5"})]})]}),Dx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(e,u.CSS.B("regulator-motorized")),...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:35.6321,top:13.72549,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:1.96078,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:64.3679,top:13.72549,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:24.1379,top:46.078,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:75.8621,top:46.078,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:78.43137,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:78.43137,id:"7"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:102},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M43.5 80.5L6.35453 61.7035C4.35901 60.6937 2 62.1438 2 64.3803V96.6197C2 98.8562 4.35901 100.306 6.35453 99.2965L43.5 80.5ZM43.5 80.5L80.6455 61.7035C82.641 60.6937 85 62.1438 85 64.3803V96.6197C85 98.8562 82.641 100.306 80.6455 99.2965L43.5 80.5Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"80.5",x2:"43",y2:"56"}),o.jsxRuntimeExports.jsx(T,{d:"M43 38V35.5C43 33.8431 44.3431 32.5 46 32.5H79C80.6569 32.5 82 33.8431 82 35.5V51.9281C82 52.9126 81.517 53.8344 80.7076 54.3947L43 80.5"}),o.jsxRuntimeExports.jsx(ge,{x:"21",y:"38",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M43 38V26",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ne,{cx:"43",cy:"14",r:"12"})]})]}),zx=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:1,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:86},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43 1L45 65"})]})]}),Hx=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(T,{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"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),$x=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Vx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Fx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Zx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{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"})]})]}),Kx=({id:e,className:t,orientation:n="right",label:s="text",color:r,level:i="p",onLabelChange:l,...a})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const d=u.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...a,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.ir.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.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"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Yx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Wx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Gx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("flow-straightener"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:93,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2.5",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M10.5 26.5H60.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M10.5 9.5H60.5",strokeLinecap:"round"})]})]}),Ux=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("heater-element"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:11.9,top:5.55555556,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:11.9,top:94,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:21,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M2.5 34.0005H14.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M2.5 2.00049L14.5 2.00049",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M14.3793 10.0013C14.9046 10.0013 15.4248 10.1048 15.9101 10.3058C16.3954 10.5068 16.8363 10.8015 17.2078 11.1729C17.5792 11.5443 17.8738 11.9853 18.0749 12.4706C18.2759 12.9559 18.3793 13.4761 18.3793 14.0013C18.3793 14.5266 18.2759 15.0468 18.0749 15.5321C17.8738 16.0174 17.5792 16.4583 17.2078 16.8298C16.8363 17.2012 16.3954 17.4958 15.9101 17.6969C15.4248 17.8979 14.9046 18.0013 14.3793 18.0013"}),o.jsxRuntimeExports.jsx(T,{d:"M14.5 2.00049C15.0253 2.00049 15.5454 2.10395 16.0307 2.30497C16.516 2.50599 16.957 2.80063 17.3284 3.17206C17.6999 3.5435 17.9945 3.98445 18.1955 4.46975C18.3965 4.95506 18.5 5.4752 18.5 6.00049C18.5 6.52578 18.3965 7.04592 18.1955 7.53122C17.9945 8.01652 17.6999 8.45748 17.3284 8.82892C16.957 9.20035 16.516 9.49499 16.0307 9.69601C15.5454 9.89703 15.0253 10.0005 14.5 10.0005"}),o.jsxRuntimeExports.jsx(T,{d:"M14.5 18.0005C15.0253 18.0005 15.5454 18.104 16.0307 18.305C16.516 18.506 16.957 18.8006 17.3284 19.1721C17.6999 19.5435 17.9945 19.9845 18.1955 20.4698C18.3965 20.9551 18.5 21.4752 18.5 22.0005C18.5 22.5258 18.3965 23.0459 18.1955 23.5312C17.9945 24.0165 17.6999 24.4575 17.3284 24.8289C16.957 25.2003 16.516 25.495 16.0307 25.696C15.5454 25.897 15.0253 26.0005 14.5 26.0005"}),o.jsxRuntimeExports.jsx(T,{d:"M14.6206 25.9995C15.1459 25.9995 15.6661 26.103 16.1514 26.304C16.6367 26.505 17.0776 26.7997 17.4491 27.1711C17.8205 27.5425 18.1151 27.9835 18.3162 28.4688C18.5172 28.9541 18.6206 29.4742 18.6206 29.9995C18.6206 30.5248 18.5172 31.0449 18.3162 31.5302C18.1151 32.0155 17.8205 32.4565 17.4491 32.8279C17.0776 33.1994 16.6367 33.494 16.1514 33.695C15.6661 33.896 15.1459 33.9995 14.6206 33.9995"})]})]}),qx=({className:e,dimensions:t=jx,borderRadius:n=si,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const a=gx(n),c=f.use(),d=g.useMemo(()=>[t,n,a],[a.bottomLeft,a.bottomRight,a.topLeft,a.topRight,t.height,t.width]),x=u.ir.cssString(r??c.colors.gray.l11),p=i==null?void 0:u.ir.cssString(i),m=t.width/66,h=t.height/180,j=`scale(${m},${h})`;return o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[o.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:j,children:o.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:x,transform:j,fill:p})}),o.jsxRuntimeExports.jsxs(W,{refreshDeps:d,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},Xx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:l}),o.jsxRuntimeExports.jsx(T,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:l}),o.jsxRuntimeExports.jsx(Ne,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(T,{d:"M45 4C45 3.44772 44.5523 3 44 3C43.4477 3 43 3.44772 43 4H45ZM37.5777 24.7889L38.0249 23.8944L37.5777 24.7889ZM37.5777 21.2111L38.0249 22.1056L37.5777 21.2111ZM50.4223 31.2111L49.9751 32.1056L50.4223 31.2111ZM37.5777 44.7889L37.1305 45.6833L37.5777 44.7889ZM37.5777 41.2111L37.1305 40.3167L37.5777 41.2111ZM42.8944 47.4472L42.4472 48.3416L42.8944 47.4472ZM45 52V49.2361H43V52H45ZM43.3416 46.5528L38.0249 43.8944L37.1305 45.6833L42.4472 48.3416L43.3416 46.5528ZM38.0249 42.1056L50.8695 35.6833L49.9751 33.8944L37.1305 40.3167L38.0249 42.1056ZM50.8695 30.3167L38.0249 23.8944L37.1305 25.6833L49.9751 32.1056L50.8695 30.3167ZM38.0249 22.1056L50.8695 15.6833L49.9751 13.8944L37.1305 20.3167L38.0249 22.1056ZM50.8695 10.3167L45.5528 7.65836L44.6584 9.44721L49.9751 12.1056L50.8695 10.3167ZM45 6.76393V4H43V6.76393H45ZM45.5528 7.65836C45.214 7.48897 45 7.1427 45 6.76393H43C43 7.90025 43.642 8.93904 44.6584 9.44721L45.5528 7.65836ZM50.8695 15.6833C53.0806 14.5777 53.0807 11.4223 50.8695 10.3167L49.9751 12.1056C50.7121 12.4741 50.7121 13.5259 49.9751 13.8944L50.8695 15.6833ZM38.0249 23.8944C37.2879 23.5259 37.2879 22.4741 38.0249 22.1056L37.1305 20.3167C34.9193 21.4223 34.9194 24.5777 37.1305 25.6833L38.0249 23.8944ZM50.8695 35.6833C53.0806 34.5777 53.0807 31.4223 50.8695 30.3167L49.9751 32.1056C50.7121 32.4741 50.7121 33.5259 49.9751 33.8944L50.8695 35.6833ZM38.0249 43.8944C37.2879 43.5259 37.2879 42.4741 38.0249 42.1056L37.1305 40.3167C34.9193 41.4223 34.9194 44.5777 37.1305 45.6833L38.0249 43.8944ZM45 49.2361C45 48.0998 44.358 47.061 43.3416 46.5528L42.4472 48.3416C42.786 48.511 43 48.8573 43 49.2361H45Z",fill:l,strokeWidth:1})]})]})},Qx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),o.jsxRuntimeExports.jsx(T,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(T,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),o.jsxRuntimeExports.jsx(Ne,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(T,{d:"M21 53.0105V50.0225C21 49.3397 20.6516 48.704 20.0759 48.3366L15.6419 45.507C14.4098 44.7207 14.4098 42.9214 15.6419 42.1351L26.3581 35.2965C27.5902 34.5102 27.5902 32.7109 26.3581 31.9246L15.6419 25.0859C14.4098 24.2997 14.4098 22.5003 15.6419 21.714L26.3581 14.8754C27.5902 14.0891 27.5902 12.2898 26.3581 11.5035L21.9241 8.67393C21.3484 8.30656 21 7.67087 21 6.98798V4",stroke:l,strokeLinecap:"round"})]})]})},Jx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:22.3095,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1538,top:22.3095,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:92.8571,id:"3"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:21},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M1.5 5.5V3.5C1.5 2.39543 2.39543 1.5 3.5 1.5H35.5C36.6046 1.5 37.5 2.39543 37.5 3.5V5.5C37.5 6.60457 36.6046 7.5 35.5 7.5H24.5C23.3954 7.5 22.5 8.39543 22.5 9.5V17.5C22.5 18.6046 21.6046 19.5 20.5 19.5H18.5C17.3954 19.5 16.5 18.6046 16.5 17.5V9.5C16.5 8.39543 15.6046 7.5 14.5 7.5H3.5C2.39543 7.5 1.5 6.60457 1.5 5.5Z",fill:u.ir.cssString(n),stroke:"none"})})]}),ep=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1539,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50.5,top:96.1539,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.5,top:3.8462,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:39},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M22.5 35.5C22.5 36.6046 21.6046 37.5 20.5 37.5H18.5C17.3954 37.5 16.5 36.6046 16.5 35.5V24.5C16.5 23.3954 15.6046 22.5 14.5 22.5H3.5C2.39543 22.5 1.5 21.6046 1.5 20.5V18.5C1.5 17.3954 2.39543 16.5 3.5 16.5H14.5C15.6046 16.5 16.5 15.6046 16.5 14.5V3.5C16.5 2.39543 17.3954 1.5 18.5 1.5H20.5C21.6046 1.5 22.5 2.39543 22.5 3.5V14.5C22.5 15.6046 23.3954 16.5 24.5 16.5H35.5C36.6046 16.5 37.5 17.3954 37.5 18.5V20.5C37.5 21.6046 36.6046 22.5 35.5 22.5H24.5C23.3954 22.5 22.5 23.3954 22.5 24.5V35.5Z",fill:u.ir.cssString(n),stroke:"none"})})]}),Ze=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:e?.x??57,y:e?.y??27,style:{fill:u.ir.cssString(t),fontWeight:450},stroke:"none",children:"F"}),tp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:25},color:s})]})]}),np=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),sp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(T,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(T,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(T,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),op=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),rp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),ip=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),lp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Ne,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ne,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),ap=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),cp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),up=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),dp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),xp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("flowmeter-Orifice"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M24.5 33V22",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),pp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(T,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(T,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"})]})]}),mp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(T,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),fp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ie,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ge,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ge,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),hp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M31 62C29.2204 62 27.3855 61.332 25.5927 59.9086C23.791 58.4782 22.0952 56.3316 20.6377 53.5381C19.1829 50.7496 18.0147 47.4106 17.214 43.7054C16.4137 40.0021 16 36.0237 16 32C16 27.9763 16.4137 23.9979 17.214 20.2946C18.0147 16.5895 19.1829 13.2504 20.6377 10.4619C22.0952 7.66841 23.791 5.52179 25.5927 4.09136C27.3855 2.66801 29.2204 2 31 2",strokeWidth:"2"})]})]}),gp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M50.3827 20.3601C47.1902 21.7605 43.4002 22.8046 39.2752 23.4077C35.1519 24.0105 30.8103 24.1557 26.5584 23.8319C22.3057 23.508 18.2597 22.7238 14.7044 21.5418C11.1449 20.3584 8.19358 18.8149 6.03181 17.0454M6.02374 46.9613C8.18198 45.1925 11.129 43.6491 14.6841 42.465C18.2349 41.2824 22.2765 40.4968 26.5256 40.1707C30.774 39.8447 35.113 39.9871 39.2353 40.5866C43.3592 41.1864 47.15 42.2268 50.3455 43.6237",strokeLinecap:"round"})]})]}),jp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z",strokeLinecap:"round"})})]}),Ep=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(Ne,{cx:"33",cy:"33",r:"14.5"})]})]}),yp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(T,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(T,{d:"M35 53.6V45.6"})]})]}),Sp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(T,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(T,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(T,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(T,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(T,{d:"M36 38.196L40 45.1242"})]})]}),Rp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M49.1214 16.2515C43.5325 21.3055 36.2463 24.0711 28.7115 23.9986C21.1766 23.9262 13.945 21.0209 8.45428 15.8604M8.4838 50.112C13.9718 44.968 21.1918 42.0733 28.7133 42.0014C36.2348 41.9295 43.5089 44.6858 49.0942 49.7239"})]})]}),Cp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(T,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(T,{d:"M3 33H63"})]})]}),wp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(T,{d:"M16.5 2.5L16.5 66.5M2.5 34.5H30.5M2.5 18.9848H30.5M2.5 50.0152H30.5M5.3 66.5H27.7C29.2464 66.5 30.5 65.1976 30.5 63.5909V5.40909C30.5 3.80244 29.2464 2.5 27.7 2.5H5.3C3.7536 2.5 2.5 3.80245 2.5 5.40909V63.5909C2.5 65.1976 3.7536 66.5 5.3 66.5Z",strokeLinecap:"round"})})]}),bp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(T,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(T,{d:"M29.12 65.62L61 34.5"})]})]}),vp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"})]})]}),_p=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(T,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Np=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(T,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(T,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(T,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(T,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(T,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Mp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(T,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(T,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(T,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(T,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(T,{d:"M78.4994 37.5101C78.4914 37.8382 78.4028 38.1592 78.2414 38.445C78.0801 38.7307 77.8509 38.9723 77.574 39.1486C77.2972 39.3248 76.9813 39.4302 76.6541 39.4555C76.3269 39.4808 75.9986 39.4252 75.698 39.2936"})]})]}),kp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:18.75,top:17.46,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:1.5873,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:81.25,top:17.46,id:"3"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:126},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"12",y:"1.6667",width:"40",height:"40",rx:"2"}),o.jsxRuntimeExports.jsx(T,{d:"M1.3333 124H62.6667",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M50.1883 41.6667C41.7748 41.6667 35.0143 46.3333 42.6923 59.3333C59.3476 87.5333 63.6327 119 62.855 124",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(T,{d:"M14 41.6667C22.4135 41.6667 29.174 46.3333 21.496 59.3333C4.84066 87.5333 0.555555 119 1.33333 124",strokeLinecap:"round"})]})]}),Lp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Pp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ie,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(T,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(T,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),hC=({aetherKey:e,source:t})=>{const n=f.useMemoDeepEqual({source:t}),[,{enabled:s},r]=f.use$2({aetherKey:e,type:_.Light.TYPE,schema:_.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},gC=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{value:r},i]=f.use$2({aetherKey:e,type:_.Setpoint.TYPE,schema:_.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{i(a=>({...a,...s}))},[s,i]),{set:g.useCallback(a=>i(c=>({...c,trigger:c.trigger+1,command:a})),[i]),value:r}},jC=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{triggered:r,enabled:i},l]=f.use$2({aetherKey:e,type:_.Toggle.TYPE,schema:_.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return g.useEffect(()=>{l(c=>({...c,...s}))},[s,l]),{toggle:g.useCallback(()=>l(c=>({...c,triggered:!c.triggered})),[l]),triggered:r,enabled:i}},rn=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:a}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS(u.CSS.BE("symbol","label"),u.CSS.dir(i)),level:s,value:n,onChange:c=>t?.({label:{...e,label:c}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:a}}),location:r}},ri=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(f.Box,{direction:u.g.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),gap:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Pc,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(Ic,{...i})]}),location:l}},Ce=(e,t)=>{const n=({symbolKey:s,control:r,source:i,sink:l,label:a,onChange:c,selected:d,orientation:x="left",position:p,...m})=>{const{enabled:h,triggered:j,toggle:E}=jC({aetherKey:s,source:i,sink:l}),S=[],R=rn(a,c);R!=null&&S.push(R);const v=ri(r);return v!=null&&S.push(v),o.jsxRuntimeExports.jsx(Ht,{editable:d,symbolKey:s,items:S,onRotate:()=>c({orientation:u.K$1.rotate90(x)}),onLocationChange:(y,C)=>{y==="label"&&c({label:{...a,orientation:C}}),y==="control"&&c({control:{...r,orientation:C}})},...t?.grid,children:o.jsxRuntimeExports.jsx(e,{enabled:h,triggered:j,onClick:E,orientation:x,...m})})};return n.displayName=e.displayName,n},ce=(e,t)=>{const n=({symbolKey:s,label:r,onChange:i,selected:l,position:a,orientation:c="left",...d})=>{const x=[],p=rn(r,i);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Ht,{...t?.grid,items:x,editable:l,symbolKey:s,onRotate:()=>i({orientation:u.K$1.rotate90(c)}),onLocationChange:(m,h)=>{m==="label"&&i({label:{...r,orientation:h}})},children:o.jsxRuntimeExports.jsx(e,{orientation:c,...d})})};return n.displayName=e.displayName,n},Rt=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,position:l,orientation:a="left",enabled:c=!1,clickable:d=!1,...x})=>{const p=[],m=rn(s,r);m!=null&&p.push(m);const h=()=>{d&&r({enabled:!c})};return o.jsxRuntimeExports.jsx(Ht,{items:p,editable:i,symbolKey:n,onRotate:()=>r({orientation:u.K$1.rotate90(a)}),onLocationChange:(j,E)=>{j==="label"&&r({label:{...s,orientation:E}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:c,onClick:h,...x})})};return t.displayName=e.displayName,t},Tp=Ce(Ud),Ap=Ce(qd),Ip=Ce(Xd),Op=Ce(Gd),Bp=Ce(nx),Dp=Ce(cx),zp=Ce(hp),Hp=Ce(gp),$p=Ce(Lx),Vp=Ce(Px),Fp=Ce(Tx),Zp=Ce(Ix),Kp=Ce(zx),Yp=Ce(Hx),Wp=Ce($x),Gp=Ce(Vx),Up=Ce(Fx),qp=Ce(Zx),Xp=Ce(kx),Qp=Ce(jp),Jp=Ce(Ep),em=Ce(yp),tm=Ce(Sp),nm=Ce(Rp),sm=Ce(Cp),om=Ce(ix),rm=Ce(lx),im=Ce(sx),lm=Ce(ox),am=Ce(rx),cm=ce(yx),um=ce(Sx),dm=ce(Bx),xm=ce(Dx),pm=ce(ux),mm=ce(xx),fm=ce(px),hm=ce(hx),gm=ce(Jd),jm=ce(ex),Em=ce(tx),ym=ce(Rx),Sm=Ce(vx,{grid:{allowRotate:!1}}),Rm=ce(Yx),Cm=ce(fx),wm=ce(Wx),bm=ce(Gx),vm=ce(Ux),_m=ce(dx),Nm=ce(Jx),Mm=ce(ep,{grid:{allowRotate:!1}}),km=ce(Ax),Lm=ce(tp),Pm=ce(np),Tm=ce(sp),Am=ce(op),Im=ce(rp),Om=ce(ip),Bm=ce(lp),Dm=ce(ap),zm=ce(cp),Hm=ce(up),$m=ce(dp),Vm=ce(xp),Fm=ce(pp),Zm=ce(mp),Km=ce(fp),Ym=ce(wp),Wm=ce(vp),Gm=ce(bp),Um=ce(_p),qm=ce(Np),Xm=ce(Mp),Qm=ce(kp),Jm=ce(Lp),ef=ce(Pp),tf=Rt(Cx),nf=Rt(Qd),sf=Rt(Xx),of=Rt(Qx),rf=Rt(mx),lf=Rt(wx),af=Rt(ax),cf=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Us,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e}),{grid:{allowCenter:!0,allowRotate:!1}}),uf=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50}}),EC=ce(({sideLength:e,rotation:t,color:n,backgroundColor:s,numSides:r,...i})=>o.jsxRuntimeExports.jsx(oi,{numSides:3,sideLength:e,rotation:t,color:n,backgroundColor:s,...i})),df=ce(({numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})=>o.jsxRuntimeExports.jsx(oi,{numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})),xf=ce(({radius:e,color:t,backgroundColor:n,strokeWidth:s,...r})=>o.jsxRuntimeExports.jsx(Ex,{radius:e,color:t,backgroundColor:n,strokeWidth:s,...r}),{grid:{allowRotate:!1}}),pf=ce(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i,strokeWidth:l})=>o.jsxRuntimeExports.jsx(Us,{onResize:a=>n({dimensions:a}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e,strokeWidth:l}),{grid:{allowCenter:!0,allowRotate:!1}}),mf=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50},borderRadius:0}),ff=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:a,onChange:c,selected:d,draggable:x,size:p,disabled:m})=>{const{value:h,set:j}=gC({aetherKey:t,source:i,sink:l}),E=[],S=ri(s);S!=null&&E.push(S);const R=rn(e,c);return R!=null&&E.push(R),o.jsxRuntimeExports.jsx(Ht,{symbolKey:t,allowRotate:!1,editable:d&&!x,onRotate:()=>c({orientation:u.K$1.rotate90(n)}),items:E,onLocationChange:(v,y)=>{v==="label"&&c({label:{...e,orientation:y}})},children:o.jsxRuntimeExports.jsx(Mx,{value:h,onChange:j,units:r,color:a,orientation:n,disabled:m,size:p})})},hf=({className:e,...t})=>o.jsxRuntimeExports.jsx(Mx,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:u.CSS(u.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(f.Text,{children:"10.0"})}),yC=u.K.construct(10,-1),SC=u.K.construct(1,1),gf=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:a,onChange:c,inlineSize:d=70,selected:x,draggable:p,notation:m,redline:h})=>{const j=ws.useTypography(n),E=(j.lineHeight+.5)*j.baseSize+2,S=g.useMemo(()=>{if(l==null||h==null)return;const{bounds:C,gradient:N}=h;return _.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:l,scale:_.scaleNumber({scale:u.C.Scale.scale(C).scale(0,1).transform}),gradient:_.colorGradient({gradient:N})},outlet:"gradient"})},[l,h]),{width:R}=Br({aetherKey:e,color:r,level:n,box:u.Ho.construct(u.K.translateY({...s},1),{height:E,width:d}),telem:l,backgroundTelem:S,minWidth:d,notation:m,useWidthForBackground:!0,valueBackgroundOverScan:yC,valueBackgroundShift:SC}),v=[],y=rn(t,c);return y!=null&&v.push(y),o.jsxRuntimeExports.jsx(Ht,{editable:x&&!p,symbolKey:e,items:v,allowRotate:!1,onLocationChange:(C,N)=>{C==="label"&&c({label:{...t,orientation:N}})},children:o.jsxRuntimeExports.jsx(bx,{color:i,dimensions:{height:E,width:R},inlineSize:d,units:a,unitsLevel:M.downLevel(n)})})},jf=({color:e})=>o.jsxRuntimeExports.jsx(bx,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(f.Text,{children:"50.00"})}),Ef=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:a,mode:c,...d})=>{const{onMouseDown:x,onMouseUp:p}=VR({aetherKey:e,sink:s,mode:c}),m=[],h=ri(r);return h!=null&&m.push(h),o.jsxRuntimeExports.jsx(Ht,{onRotate:()=>a({orientation:u.K$1.rotate90(n)}),allowRotate:!1,editable:i,symbolKey:e,items:m,onLocationChange:(j,E)=>{j==="label"&&a({label:{...t,orientation:E}})},children:o.jsxRuntimeExports.jsx(_x,{...t,onMouseDown:x,onMouseUp:p,orientation:n,...d})})},yf=({label:e,...t})=>o.jsxRuntimeExports.jsx(_x,{label:"Button",...t}),Sf=({symbolKey:e,label:t,source:n,onChange:s,selected:r,...i})=>{const{enabled:l}=hC({aetherKey:e,source:n}),a=[],c=rn(t,s);return c!=null&&a.push(c),o.jsxRuntimeExports.jsx(Ht,{items:a,allowRotate:!1,editable:r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:o.jsxRuntimeExports.jsx(Ox,{enabled:l,...i})})},Rf=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(Kx,{className:Gs,onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),Cf=({label:e,...t})=>o.jsxRuntimeExports.jsx(Kx,{label:"Off Page",...t,orientation:"right"}),wf=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(qx,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),bf=e=>o.jsxRuntimeExports.jsx(qx,{...e,dimensions:{width:25,height:50}}),vf=({onChange:e,symbolKey:t,color:n,width:s,align:r,autoFit:i,level:l,value:a})=>o.jsxRuntimeExports.jsx(Nx,{className:Gs,onChange:c=>e({value:c}),value:a,level:l,color:n,width:s,align:r,autoFit:i},t),_f=e=>o.jsxRuntimeExports.jsx(Nx,{...e,autoFit:!0,value:"Text Box"}),G=4,zn=2,RC=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","electricRegulatorMotorized","filter","flowStraightener","heaterElement","checkValveWithArrow","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","flowmeterOrifice","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","regulatorManual","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","polygon","circle","textBox","threeWayValve","vacuumPump","value","valve","vent","tJunction","crossJunction","heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","diaphragmPump","ejectionPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation","thruster","nozzle","strainer","strainerCone"],CC=se.z.enum(RC),le={orientation:"left",scale:1},wC={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"})},bC={...le,source:_.sourcePipeline("number",{connections:[],segments:{valueStream:_.streamChannelValue({channel:0})},outlet:"valueStream"})},vC={...le,sink:_.sinkPipeline("number",{connections:[],segments:{setter:_.setChannelValue({channel:0})},inlet:"setter"})},Nf={...le,source:_.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:_.streamChannelValue({channel:0}),threshold:_.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Mf={...le,control:{show:!0},sink:_.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:_.setChannelValue({channel:0}),setpoint:_.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},we={...Nf,...Mf},Vt={...le,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),_C={width:125,height:200},ii={dimensions:_C},NC=3,MC={name:"Three Way Valve",key:"threeWayValve",Form:Re,Symbol:Tp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three Way Valve"),...we}),Preview:Ud,zIndex:G},kC={name:"Valve",key:"valve",Form:Re,Symbol:Ap,defaultProps:e=>({color:e.colors.gray.l11,...Y("Valve"),...we}),Preview:qd,zIndex:G},LC={name:"Solenoid Valve",key:"solenoidValve",Form:Re,Symbol:Ip,defaultProps:e=>({color:e.colors.gray.l11,...Y("Solenoid Valve"),normallyOpen:!1,...we}),Preview:Xd,zIndex:G},PC={name:"Four Way Valve",key:"fourWayValve",Form:Re,Symbol:Op,defaultProps:e=>({color:e.colors.gray.l11,...Y("Four Way Valve"),...we}),Preview:Gd,zIndex:G},TC={name:"Angled Valve",key:"angledValve",Form:Re,Symbol:Bp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Valve"),...we}),Preview:nx,zIndex:G},AC={name:"Ball Valve",key:"ballValve",Form:Re,Symbol:im,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ball Valve"),...we}),Preview:sx,zIndex:G},IC={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:Re,Symbol:lm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three-Way Ball Valve"),...we}),Preview:ox,zIndex:G},OC={name:"Gate Valve",key:"gateValve",Form:Re,Symbol:am,defaultProps:e=>({color:e.colors.gray.l11,...Y("Gate Valve"),...we}),Preview:rx,zIndex:G},BC={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:Re,Symbol:om,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Remote)"),...we}),Preview:ix,zIndex:G},DC={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:Re,Symbol:rm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Manual)"),...we}),Preview:lx,zIndex:G},zC={name:"Breather Valve",key:"breatherValve",Form:$t,Symbol:af,defaultProps:e=>({color:e.colors.gray.l11,...Y("Breather Valve"),...Vt}),Preview:Ue(ax,["clickable"]),zIndex:G},HC={name:"Pump",key:"pump",Form:Re,Symbol:Dp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pump"),...we}),Preview:cx,zIndex:G},$C={name:"Screw Pump",key:"screwPump",Form:Re,Symbol:Xp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Screw Pump"),...we}),Preview:kx,zIndex:G},VC={name:"Tank",key:"tank",Form:Yd,Symbol:cf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Tank"),borderRadius:si,...ii,...le}),Preview:uf,zIndex:zn},FC={name:"Polygon",key:"polygon",Symbol:df,Form:YR,defaultProps:e=>({numSides:6,sideLength:pC,cornerRounding:0,rotation:0,color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),strokeWidth:2,...Y("Polygon")}),Preview:Ue(oi,["clickable"]),zIndex:zn},ZC={name:"Circle",key:"circle",Symbol:xf,Form:WR,defaultProps:e=>({radius:20,color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Circle"),strokeWidth:2}),Preview:Ue(Ex,["clickable"]),zIndex:zn},KC={name:"Cylinder",key:"cylinder",Form:oC,Symbol:wf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("cylinder"),dimensions:{width:66,height:181},...le}),Preview:bf,zIndex:zn},YC={name:"Box",key:"box",Form:rC,Symbol:pf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Box"),borderRadius:NC,strokeWidth:2,...ii,...le}),Preview:mf,zIndex:zn},WC={name:"Relief Valve",key:"reliefValve",Form:$t,Symbol:nf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Relief Valve"),...Vt}),Preview:Ue(Qd,["clickable"]),zIndex:G},GC={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:$t,Symbol:sf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Spring Loaded Relief Valve"),...Vt}),Preview:Ue(Xx,["clickable"]),zIndex:G},UC={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:$t,Symbol:of,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Spring Loaded Relief Valve"),...Vt}),Preview:Ue(Qx,["clickable"]),zIndex:G},qC={name:"Regulator",key:"regulator",Form:xe,Symbol:cm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Regulator"),...le}),Preview:yx,zIndex:G},XC={name:"Manual Regulator",key:"regulatorManual",Form:xe,Symbol:um,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Regulator"),...le}),Preview:Ue(Sx,["clickable"]),zIndex:G},QC={name:"Electric Regulator",key:"electricRegulator",Form:xe,Symbol:dm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator"),...le}),Preview:Bx,zIndex:G},JC={name:"Electric Regulator Motorized",key:"electricRegulatorMotorized",Form:xe,Symbol:xm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator Motorized"),...le}),Preview:Dx,zIndex:G},e6={name:"Burst Disc",key:"burstDisc",Form:xe,Symbol:pm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Burst Disc"),...le}),Preview:ux,zIndex:G},t6={name:"ISO Burst Disc",key:"isoBurstDisc",Form:xe,Symbol:_m,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Burst Disc"),...le}),Preview:dx,zIndex:G},n6={name:"Cap",key:"cap",Form:xe,Symbol:mm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cap"),...le}),Preview:xx,zIndex:G},s6={name:"ISO Cap",key:"isoCap",Form:xe,Symbol:fm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Cap"),...le}),Preview:px,zIndex:G},o6={name:"Manual Valve",key:"manualValve",Form:$t,Symbol:rf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Valve"),...Vt}),Preview:Ue(mx,["clickable"]),zIndex:G},r6={name:"Orifice Plate",key:"orificePlate",Form:xe,Symbol:Cm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Plate"),...le}),Preview:fx,zIndex:G},i6={name:"ISO Filter",key:"isoFilter",Form:xe,Symbol:wm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Filter"),...le}),Preview:Wx,zIndex:G},l6={name:"Filter",key:"filter",Form:xe,Symbol:hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Filter"),...le}),Preview:hx,zIndex:G},a6={name:"Flow Straightener",key:"flowStraightener",Form:xe,Symbol:bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flow Straightener"),...le}),Preview:Gx,zIndex:G},c6={name:"Heater Element",key:"heaterElement",Form:xe,Symbol:vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Heater Element"),...le}),Preview:Ux,zIndex:G},u6={name:"Needle Valve",key:"needleValve",Form:$t,Symbol:tf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Needle Valve"),...Vt}),Preview:Ue(Cx,["clickable"]),zIndex:G},d6={name:"Check Valve",key:"checkValve",Form:xe,Symbol:gm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...le}),Preview:Jd,zIndex:G},x6={name:"Orifice",key:"orifice",Form:xe,Symbol:ym,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice"),...le}),Preview:Rx,zIndex:G},p6={name:"Angled Relief Valve",key:"angledReliefValve",Form:$t,Symbol:lf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Relief Valve"),...Vt}),Preview:Ue(wx,["clickable"]),zIndex:G},m6={name:"Value",key:"value",Form:UR,Symbol:gf,Preview:jf,defaultProps:e=>({color:e.colors.gray.l11,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...le,telem:wC.source,redline:Ar}),zIndex:G},f6={name:"Button",key:"button",Symbol:Ef,Form:JR,Preview:yf,defaultProps:e=>({color:e.colors.primary.z,...Y("Button"),...Mf,mode:"fire",onClickDelay:0,scale:null}),zIndex:G},h6={name:"Switch",key:"switch",Symbol:Sm,Form:iC,defaultProps:()=>({...Y("Switch"),...we,scale:null}),Preview:vx,zIndex:G},g6={name:"Vacuum Pump",key:"vacuumPump",Symbol:$p,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vacuum Pump"),...we}),Preview:Lx,zIndex:G},j6={name:"Compressor",key:"compressor",Symbol:Qp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Compressor"),...we}),Preview:jp,zIndex:G},E6={name:"Cavity Pump",key:"cavityPump",Symbol:Vp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cavity Pump"),...we}),Preview:Px,zIndex:G},y6={name:"Piston Pump",key:"pistonPump",Symbol:Fp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Piston Pump"),...we}),Preview:Tx,zIndex:G},S6={name:"Static Mixer",key:"staticMixer",Symbol:km,Form:xe,defaultProps:e=>({color:e.colors.gray.l11,...Y("Static Mixer"),...le}),Preview:Ax,zIndex:G},R6={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Zp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Rotary Mixer"),...we}),Preview:Ix,zIndex:G},C6={name:"Light",key:"light",Symbol:Sf,Form:XR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Light"),...Nf}),Preview:Ox,zIndex:G},w6={name:"Setpoint",key:"setpoint",Symbol:ff,Form:tC,defaultProps:e=>({units:"mV",color:e.colors.gray.l11,size:"small",...Y("Setpoint"),...bC,...vC}),Preview:hf,zIndex:G},b6={name:"Agitator",key:"agitator",Symbol:Kp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Agitator"),...we}),Preview:zx,zIndex:G},v6={name:"Propeller Agitator",key:"propellerAgitator",Symbol:Yp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Propeller Agitator"),...we}),Preview:Hx,zIndex:G},_6={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:Wp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flat Blade Agitator"),...we}),Preview:$x,zIndex:G},N6={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Gp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Paddle Agitator"),...we}),Preview:Vx,zIndex:G},M6={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Up,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cross Beam Agitator"),...we}),Preview:Fx,zIndex:G},k6={name:"Helical Agitator",key:"helicalAgitator",Symbol:qp,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Helical Agitator"),...we}),Preview:Zx,zIndex:G},L6={name:"Text Box",key:"textBox",Symbol:vf,Form:nC,defaultProps:e=>({color:e.colors.gray.l11,autoFit:!0,align:"center",...Y("Text Box"),...le,...ii,level:"p",value:"Text Box",width:75}),Preview:_f,zIndex:G},P6={name:"Off Page Reference",key:"offPageReference",Form:sC,Symbol:Rf,defaultProps:e=>({color:e.colors.gray.l11,orientation:"right",...Y("Off Page Reference")}),Preview:Cf,zIndex:G},T6={name:"ISO Check Valve",key:"isoCheckValve",Form:xe,Symbol:jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Check Valve"),...le}),Preview:ex,zIndex:G},A6={name:"Check Valve Variant",key:"checkValveWithArrow",Form:xe,Symbol:Em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...le}),Preview:tx,zIndex:G},I6={name:"Vent",key:"vent",Form:xe,Symbol:Rm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vent"),...le}),Preview:Yx,zIndex:G},O6={name:"T Junction",key:"tJunction",Form:xe,Symbol:Nm,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...le}),Preview:Jx,zIndex:G+20},B6={name:"Cross Junction",key:"crossJunction",Form:xe,Symbol:Mm,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...le}),Preview:ep,zIndex:G+20},D6={name:"Flowmeter General",key:"flowmeterGeneral",Form:xe,Symbol:Lm,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Flowmeter"),...le}),Preview:tp,zIndex:G},z6={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:xe,Symbol:Pm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electromagnetic Flowmeter"),...le}),Preview:np,zIndex:G},H6={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:xe,Symbol:Tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Variable Area Flowmeter"),...le}),Preview:sp,zIndex:G},$6={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:xe,Symbol:Am,defaultProps:e=>({color:e.colors.gray.l11,...Y("Coriolis Flowmeter"),...le}),Preview:op,zIndex:G},V6={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:xe,Symbol:Im,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle Flowmeter"),...le}),Preview:rp,zIndex:G},F6={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:xe,Symbol:Om,defaultProps:e=>({color:e.colors.gray.l11,...Y("Venturi Flowmeter"),...le}),Preview:ip,zIndex:G},Z6={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:xe,Symbol:Bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ring Piston Flowmeter"),...le}),Preview:lp,zIndex:G},K6={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:xe,Symbol:Dm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Positive Displacement Flowmeter"),...le}),Preview:ap,zIndex:G},Y6={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:xe,Symbol:zm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbine Flowmeter"),...le}),Preview:cp,zIndex:G},W6={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:xe,Symbol:Hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pulse Flowmeter"),...le}),Preview:up,zIndex:G},G6={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:xe,Symbol:$m,defaultProps:e=>({color:e.colors.gray.l11,...Y("Float Sensor Flowmeter"),...le}),Preview:dp,zIndex:G},U6={name:"Flowmeter Orifice",key:"flowmeterOrifice",Form:xe,Symbol:Vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Flowmeter"),...le}),Preview:xp,zIndex:G},q6={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:xe,Symbol:Fm,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Heat Exchanger"),...le}),Preview:pp,zIndex:G},X6={name:"Heat Exchanger M",key:"heatExchangerM",Form:xe,Symbol:Zm,defaultProps:e=>({color:e.colors.gray.l11,...Y("M Heat Exchanger"),...le}),Preview:mp,zIndex:G},Q6={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:xe,Symbol:Km,defaultProps:e=>({color:e.colors.gray.l11,...Y("Straight Tube Heat Exchanger"),...le}),Preview:fp,zIndex:G},J6={name:"Turbo Compressor",key:"turboCompressor",Form:Re,Symbol:Jp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbo Compressor"),...we}),Preview:Ep,zIndex:G},e9={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:Re,Symbol:em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Roller Vane Compressor"),...we}),Preview:yp,zIndex:G},t9={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:Re,Symbol:tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Liquid Ring Compressor"),...we}),Preview:Sp,zIndex:G},n9={name:"Ejector Compressor",key:"ejectorCompressor",Form:Re,Symbol:nm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejector Compressor"),...we}),Preview:Rp,zIndex:G},s9={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:Re,Symbol:sm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Centrifugal Compressor"),...we}),Preview:Cp,zIndex:G},o9={name:"Diaphragm Pump",key:"diaphragmPump",Form:Re,Symbol:zp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Diaphragm Pump"),...we}),Preview:hp,zIndex:G},r9={name:"Ejection Pump",key:"ejectionPump",Form:Re,Symbol:Hp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejection Pump"),...we}),Preview:gp,zIndex:G},i9={name:"Flame Arrestor",key:"flameArrestor",Form:xe,Symbol:Ym,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor"),...le}),Preview:wp,zIndex:G},l9={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:xe,Symbol:Wm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Explosion-Proof)"),...le}),Preview:vp,zIndex:G},a9={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:xe,Symbol:Gm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Detonation-Proof)"),...le}),Preview:bp,zIndex:G},c9={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:xe,Symbol:Um,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant)"),...le}),Preview:_p,zIndex:G},u9={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:xe,Symbol:qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...le}),Preview:Np,zIndex:G},d9={name:"Thruster",key:"thruster",Form:Re,Symbol:Xm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Thruster"),...we}),Preview:Mp,zIndex:G},x9={name:"Nozzle",key:"nozzle",Form:xe,Symbol:Qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle"),...le}),Preview:kp,zIndex:G},p9={name:"Strainer",key:"strainer",Form:xe,Symbol:Jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer"),...le}),Preview:Lp,zIndex:G},m9={name:"Strainer Cone",key:"strainerCone",Form:xe,Symbol:ef,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer Cone"),...le}),Preview:Pp,zIndex:G},f9={value:m6,button:f6,tank:VC,polygon:FC,circle:ZC,tJunction:O6,crossJunction:B6,switch:h6,offPageReference:P6,light:C6,setpoint:w6,box:YC,textBox:L6,valve:kC,solenoidValve:LC,threeWayValve:MC,fourWayValve:PC,angledValve:TC,ballValve:AC,threeWayBallValve:IC,gateValve:OC,butterflyValveOne:BC,butterflyValveTwo:DC,breatherValve:zC,manualValve:o6,needleValve:u6,reliefValve:WC,angledReliefValve:p6,checkValve:d6,regulator:qC,regulatorManual:XC,electricRegulator:QC,electricRegulatorMotorized:JC,springLoadedReliefValve:GC,angledSpringLoadedReliefValve:UC,pump:HC,pistonPump:y6,screwPump:$C,cavityPump:E6,diaphragmPump:o9,ejectionPump:r9,vacuumPump:g6,compressor:j6,turboCompressor:J6,rollerVaneCompressor:e9,liquidRingCompressor:t9,ejectorCompressor:n9,centrifugalCompressor:s9,staticMixer:S6,rotaryMixer:R6,burstDisc:e6,isoBurstDisc:t6,cap:n6,isoCap:s6,filter:l6,isoFilter:i6,flowStraightener:a6,heaterElement:c6,orifice:x6,orificePlate:r6,agitator:b6,propellerAgitator:v6,flatBladeAgitator:_6,paddleAgitator:N6,crossBeamAgitator:M6,helicalAgitator:k6,isoCheckValve:T6,checkValveWithArrow:A6,vent:I6,cylinder:KC,flowmeterGeneral:D6,flowmeterElectromagnetic:z6,flowmeterVariableArea:H6,flowmeterCoriolis:$6,flowmeterNozzle:V6,flowmeterVenturi:F6,flowmeterRingPiston:Z6,flowmeterPositiveDisplacement:K6,flowmeterTurbine:Y6,flowmeterPulse:W6,flowmeterFloatSensor:G6,flowmeterOrifice:U6,heatExchangerGeneral:q6,heatExchangerM:X6,heatExchangerStraightTube:Q6,flameArrestor:i9,flameArrestorExplosion:l9,flameArrestorDetonation:a9,flameArrestorFireRes:c9,flameArrestorFireResDetonation:u9,thruster:d9,nozzle:x9,strainer:p9,strainerCone:m9},h9=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Kp,AngledReliefValve:lf,AngledSpringLoadedReliefValve:of,AngledValve:Bp,BallValve:im,Box:pf,BoxPreview:mf,BreatherValve:af,BurstDisc:pm,ButterflyValveOne:om,ButterflyValveTwo:rm,Button:Ef,ButtonPreview:yf,Cap:mm,CavityPump:Vp,CentrifugalCompressor:sm,CheckValve:gm,CheckValveWithArrow:Em,Circle:xf,Compressor:Qp,CrossBeamAgitator:Up,CrossJunction:Mm,Cylinder:wf,CylinderPreview:bf,DRAG_HANDLE_CLASS:Gs,DiaphragmPump:zp,EjectionPump:Hp,EjectorCompressor:nm,ElectricRegulator:dm,ElectricRegulatorMotorized:xm,Filter:hm,FlameArrestor:Ym,FlameArrestorDetonation:Gm,FlameArrestorExplosion:Wm,FlameArrestorFireRes:Um,FlameArrestorFireResDetonation:qm,FlatBladeAgitator:Wp,FlowStraightener:bm,FlowmeterCoriolis:Am,FlowmeterElectromagnetic:Pm,FlowmeterFloatSensor:$m,FlowmeterGeneral:Lm,FlowmeterNozzle:Im,FlowmeterOrifice:Vm,FlowmeterPositiveDisplacement:Dm,FlowmeterPulse:Hm,FlowmeterRingPiston:Bm,FlowmeterTurbine:zm,FlowmeterVariableArea:Tm,FlowmeterVenturi:Om,FourWayValve:Op,GateValve:am,HeatExchangerGeneral:Fm,HeatExchangerM:Zm,HeatExchangerStraightTube:Km,HeaterElement:vm,HelicalAgitator:qp,ISOBurstDisc:_m,ISOCap:fm,ISOCheckValve:jm,ISOFilter:wm,Light:Sf,LiquidRingCompressor:tm,ManualValve:rf,NeedleValve:tf,Nozzle:Qm,OffPageReference:Rf,OffPageReferencePreview:Cf,Orifice:ym,OrificePlate:Cm,PaddleAgitator:Gp,PistonPump:Fp,PolygonSymbol:df,PropellerAgitator:Yp,Pump:Dp,Regulator:cm,RegulatorManual:um,ReliefValve:nf,RollerVaneCompressor:em,RotaryMixer:Zp,SYMBOLS:f9,ScrewPump:Xp,Setpoint:ff,SetpointPreview:hf,SolenoidValve:Ip,SpringLoadedReliefValve:sf,StaticMixer:km,Strainer:Jm,StrainerCone:ef,Switch:Sm,TJunction:Nm,Tank:cf,TankPreview:uf,TextBox:vf,TextBoxPreview:_f,ThreeWayBallValve:lm,ThreeWayValve:Tp,Thruster:Xm,Triangle:EC,TurboCompressor:Jp,VacuumPump:$p,Value:gf,ValuePreview:jf,Valve:Ap,Vent:Rm,createDummyToggle:Rt,createLabeled:ce,createToggle:Ce,variantZ:CC},Symbol.toStringTag,{value:"Module"})),g9=ut({name:"Workspace",retrieve:({params:e,client:t})=>t.workspaces.retrieve(e.key)}),j9=Fe({name:"Workspace",retrieve:async({client:e,params:t})=>await e.workspaces.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.workspaces.retrieve(t),listeners:[{channel:M.iw.SET_CHANNEL_NAME,onChange:_.parsedHandler(M.iw.workspaceZ,async({onChange:e,changed:t})=>e(t.key,t))},{channel:M.iw.DELETE_CHANNEL_NAME,onChange:_.parsedHandler(M.iw.keyZ,async({onDelete:e,changed:t})=>e(t))}]}),E9=Object.freeze(Object.defineProperty({__proto__:null,retrieve:g9,useList:j9},Symbol.toStringTag,{value:"Module"}));exports.Aether=f.main;exports.Generic=f.Generic;exports.Haul=f.Haul;exports.Worker=f.Context;exports.compareArrayDeps=f.compareArrayDeps;exports.preventDefault=f.preventDefault;exports.stopPropagation=f.stopPropagation;exports.useClickOutside=f.useClickOutside;exports.useCombinedRefs=f.useCombinedRefs;exports.useCombinedStateAndRef=f.useCombinedStateAndRef;exports.useEffectCompare=f.useEffectCompare;exports.useInitializerRef=f.useInitializerRef;exports.useMemoCompare=f.useMemoCompare;exports.useMemoDeepEqual=f.useMemoDeepEqual;exports.useMemoPrimitiveArray=f.useMemoPrimitiveArray;exports.usePrevious=f.usePrevious;exports.useRequiredContext=f.useRequiredContext;exports.useResize=f.useResize;exports.useStateRef=f.useStateRef;exports.useSyncedRef=f.useSyncedRef;exports.CSS=u.CSS;exports.DataType=u.r;exports.Density=u.d;exports.MultiSeries=u.Vt;exports.Rate=u.E;exports.Series=u.I;exports.TimeRange=u.w;exports.TimeSpan=u.a;exports.TimeStamp=u.n;exports.newBEM=u.newBEM;exports.state=M.state;exports.Button=Ph.external;exports.Caret=Hl.Animated$1;exports.telem=_.external;exports.List=tt.external;exports.Dialog=Vl.external;exports.Input=Ae.external;exports.Color=Pe.external;exports.useDebouncedCallback=Pe.useDebouncedCallback;exports.Theming=ws.external;exports.Triggers=Fl.external;exports.Divider=Zl.Divider$2;exports.Flex=pe.external;exports.createHexOpacityVariants=Kl.createHexOpacityVariants;exports.unitProperty=Kl.unitProperty;exports.Header=Th.external;exports.Menu=Ah.external;exports.Tabs=ke.external;exports.Text=Ih.external;exports.Tree=Oh.external;exports.Video=Bh.Video;exports.Breadcrumb=vg;exports.Canvas=G1;exports.Channel=B0;exports.Component=hg;exports.Control=Bj;exports.Device=F0;exports.Diagram=LR;exports.Direction=D0;exports.Eraser=cg;exports.Flux=s1;exports.Form=Fg;exports.Icon=Qh;exports.Label=C1;exports.Legend=e0;exports.Line=n0;exports.LinePlot=E0;exports.Log=TR;exports.Measure=C0;exports.Mosaic=gj;exports.Nav=xg;exports.Note=Ej;exports.OS=wj;exports.Observe=$g;exports.Ontology=u1;exports.Override=vj;exports.Pluto=$j;exports.Portal=cj;exports.Progress=Fj;exports.Rack=G0;exports.Range=S0;exports.Ranger=Z1;exports.Resize=lg;exports.Rule=w0;exports.Schematic=h9;exports.Select=Cg;exports.Status=fg;exports.Steps=Kj;exports.Synnax=kg;exports.Table=qj;exports.TableCells=p2;exports.Tag=gg;exports.Task=ej;exports.Telem=Tj;exports.Tooltip=Jh;exports.Value=t2;exports.Viewport=g0;exports.Workspace=E9;exports.axis=t1;exports.control=Wg;exports.proxyMemo=Uh;exports.useAsyncEffect=Ge;exports.useDelayedState=qh;exports.useTransforms=Xh;