@adhdev/daemon-standalone 0.9.82-rc.75 → 0.9.82-rc.76
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.
|
@@ -2742,4 +2742,4 @@ Error generating stack: `+o.message+`
|
|
|
2742
2742
|
`,`
|
|
2743
2743
|
+`).split(`
|
|
2744
2744
|
`)),d=u.reduce((c,h)=>c.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(t==null?void 0:t.target)??Ev,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var b,m;if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!u)&&jx(p))return!1;const v=zv(p.code,a);if(o.current.add(p[v]),Dv(s,o.current,!1)){const w=((m=(b=p.composedPath)==null?void 0:b.call(p))==null?void 0:m[0])||p.target,g=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!g)&&p.preventDefault(),i(!0)}},c=p=>{const f=zv(p.code,a);Dv(s,o.current,!0)?(i(!1),o.current.clear()):o.current.delete(p[f]),p.key==="Meta"&&o.current.clear(),r.current=!1},h=()=>{o.current.clear(),i(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function Dv(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function zv(e,t){return t.includes(e)?"code":"key"}const J3=()=>{const e=Le();return R.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:o,maxZoom:s,panZoom:a}=e.getState(),l=Hp(t,i,r,o,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:o,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},d=n.snapGrid??r,c=n.snapToGrid??o;return Gs(u,i,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:o}=i.getBoundingClientRect(),s=Ll(t,n);return{x:s.x+r,y:s.y+o}}}),[])};function v_(e,t){const n=[],i=new Map,r=[];for(const o of e)if(o.type==="add"){r.push(o);continue}else if(o.type==="remove"||o.type==="replace")i.set(o.id,[o]);else{const s=i.get(o.id);s?s.push(o):i.set(o.id,[o])}for(const o of t){const s=i.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...o};for(const l of s)e4(l,a);n.push(a)}return r.length&&r.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function e4(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={...e.dimensions},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 t4(e,t){return v_(e,t)}function n4(e,t){return v_(e,t)}function Fi(e,t){return{id:e,type:"select",selected:t}}function Nr(e,t=new Set,n=!1){const i=[];for(const[r,o]of e){const s=t.has(r);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),i.push(Fi(o.id,s)))}return i}function Pv({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const a=t.get(s.id),l=((r=a==null?void 0:a.internals)==null?void 0:r.userNode)??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)i.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Av(e){return{id:e.id,type:"remove"}}const Iv=e=>c5(e),i4=e=>Vx(e);function w_(e){return R.forwardRef(e)}function Nv(e){const[t,n]=R.useState(BigInt(0)),[i]=R.useState(()=>r4(()=>n(r=>r+BigInt(1))));return oh(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function r4(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const b_=R.createContext(null);function o4({children:e}){const t=Le(),n=R.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:c,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:f}=t.getState();let v=l;for(const m of a)v=typeof m=="function"?m(v):m;let b=Pv({items:v,lookup:h});for(const m of f.values())b=m(b);d&&u(v),b.length>0?c==null||c(b):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:w,setNodes:g}=t.getState();m&&g(w)})},[]),i=Nv(n),r=R.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:h}=t.getState();let p=l;for(const f of a)p=typeof f=="function"?f(p):f;d?u(p):c&&c(Pv({items:p,lookup:h}))},[]),o=Nv(r),s=R.useMemo(()=>({nodeQueue:i,edgeQueue:o}),[]);return G.jsx(b_.Provider,{value:s,children:e})}function s4(){const e=R.useContext(b_);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const a4=e=>!!e.panZoom;function Xp(){const e=J3(),t=Le(),n=s4(),i=xe(a4),r=R.useMemo(()=>{const o=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},a=c=>{n.edgeQueue.push(c)},l=c=>{var m,w;const{nodeLookup:h,nodeOrigin:p}=t.getState(),f=Iv(c)?c:h.get(c.id),v=f.parentId?$x(f.position,f.measured,f.parentId,h,p):f.position,b={...f,position:v,width:((m=f.measured)==null?void 0:m.width)??f.width,height:((w=f.measured)==null?void 0:w.height)??f.height};return eo(b)},u=(c,h,p={replace:!1})=>{s(f=>f.map(v=>{if(v.id===c){const b=typeof h=="function"?h(v):h;return p.replace&&Iv(b)?b:{...v,...b}}return v}))},d=(c,h,p={replace:!1})=>{a(f=>f.map(v=>{if(v.id===c){const b=typeof h=="function"?h(v):h;return p.replace&&i4(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var h;return(h=o(c))==null?void 0:h.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(h=>({...h}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:a,addNodes:c=>{const h=Array.isArray(c)?c:[c];n.nodeQueue.push(p=>[...p,...h])},addEdges:c=>{const h=Array.isArray(c)?c:[c];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:c=[],edges:h=[],transform:p}=t.getState(),[f,v,b]=p;return{nodes:c.map(m=>({...m})),edges:h.map(m=>({...m})),viewport:{x:f,y:v,zoom:b}}},deleteElements:async({nodes:c=[],edges:h=[]})=>{const{nodes:p,edges:f,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:m,triggerEdgeChanges:w,onDelete:g,onBeforeDelete:y}=t.getState(),{nodes:k,edges:_}=await m5({nodesToRemove:c,edgesToRemove:h,nodes:p,edges:f,onBeforeDelete:y}),E=_.length>0,S=k.length>0;if(E){const T=_.map(Av);b==null||b(_),w(T)}if(S){const T=k.map(Av);v==null||v(k),m(T)}return(S||E)&&(g==null||g({nodes:k,edges:_})),{deletedNodes:k,deletedEdges:_}},getIntersectingNodes:(c,h=!0,p)=>{const f=av(c),v=f?c:l(c),b=p!==void 0;return v?(p||t.getState().nodes).filter(m=>{const w=t.getState().nodeLookup.get(m.id);if(w&&!f&&(m.id===c.id||!w.internals.positionAbsolute))return!1;const g=eo(b?m:w),y=_s(g,v);return h&&y>0||y>=g.width*g.height||y>=v.width*v.height}):[]},isNodeIntersecting:(c,h,p=!0)=>{const v=av(c)?c:l(c);if(!v)return!1;const b=_s(v,h);return p&&b>0||b>=h.width*h.height||b>=v.width*v.height},updateNode:u,updateNodeData:(c,h,p={replace:!1})=>{u(c,f=>{const v=typeof h=="function"?h(f):h;return p.replace?{...f,data:v}:{...f,data:{...f.data,...v}}},p)},updateEdge:d,updateEdgeData:(c,h,p={replace:!1})=>{d(c,f=>{const v=typeof h=="function"?h(f):h;return p.replace?{...f,data:v}:{...f,data:{...f.data,...v}}},p)},getNodesBounds:c=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return d5(c,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:c,id:h,nodeId:p})=>{var f;return Array.from(((f=t.getState().connectionLookup.get(`${p}-${c}${h?`-${h}`:""}`))==null?void 0:f.values())??[])},getNodeConnections:({type:c,handleId:h,nodeId:p})=>{var f;return Array.from(((f=t.getState().connectionLookup.get(`${p}${c?h?`-${c}-${h}`:`-${c}`:""}`))==null?void 0:f.values())??[])},fitView:async c=>{const h=t.getState().fitViewResolver??b5();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return R.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const Tv=e=>e.selected,l4=typeof window<"u"?window:void 0;function u4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Le(),{deleteElements:i}=Xp(),r=Ss(e,{actInsideInputWithModifier:!1}),o=Ss(t,{target:l4});R.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();i({nodes:a.filter(Tv),edges:s.filter(Tv)}),n.setState({nodesSelectionActive:!1})}},[r]),R.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function c4(e){const t=Le();R.useEffect(()=>{const n=()=>{var r,o,s,a;if(!e.current||!(((o=(r=e.current).checkVisibility)==null?void 0:o.call(r))??!0))return!1;const i=Bp(e.current);(i.height===0||i.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",zn.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const Cu={position:"absolute",width:"100%",height:"100%",top:0,left:0},d4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function h4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:o=qi.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:c,zoomActivationKeyCode:h,preventScrolling:p=!0,children:f,noWheelClassName:v,noPanClassName:b,onViewportChange:m,isControlledViewport:w,paneClickDistance:g,selectionOnDrag:y}){const k=Le(),_=R.useRef(null),{userSelectionActive:E,lib:S,connectionInProgress:T}=xe(d4,Me),C=Ss(h),I=R.useRef();c4(_);const L=R.useCallback(V=>{m==null||m({x:V[0],y:V[1],zoom:V[2]}),w||k.setState({transform:V})},[m,w]);return R.useEffect(()=>{if(_.current){I.current=n3({domNode:_.current,minZoom:d,maxZoom:c,translateExtent:u,viewport:l,onDraggingChange:A=>k.setState(O=>O.paneDragging===A?O:{paneDragging:A}),onPanZoomStart:(A,O)=>{const{onViewportChangeStart:N,onMoveStart:M}=k.getState();M==null||M(A,O),N==null||N(O)},onPanZoom:(A,O)=>{const{onViewportChange:N,onMove:M}=k.getState();M==null||M(A,O),N==null||N(O)},onPanZoomEnd:(A,O)=>{const{onViewportChangeEnd:N,onMoveEnd:M}=k.getState();M==null||M(A,O),N==null||N(O)}});const{x:V,y:D,zoom:P}=I.current.getViewport();return k.setState({panZoom:I.current,transform:[V,D,P],domNode:_.current.closest(".react-flow")}),()=>{var A;(A=I.current)==null||A.destroy()}}},[]),R.useEffect(()=>{var V;(V=I.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:C,preventScrolling:p,noPanClassName:b,userSelectionActive:E,noWheelClassName:v,lib:S,onTransformChange:L,connectionInProgress:T,selectionOnDrag:y,paneClickDistance:g})},[e,t,n,i,r,o,s,a,C,p,b,E,v,S,L,T,y,g]),G.jsx("div",{className:"react-flow__renderer",ref:_,style:Cu,children:f})}const p4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function f4(){const{userSelectionActive:e,userSelectionRect:t}=xe(p4,Me);return e&&t?G.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 Dc=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},m4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function g4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=xs.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:h,onPaneMouseLeave:p,children:f}){const v=Le(),{userSelectionActive:b,elementsSelectable:m,dragging:w,connectionInProgress:g}=xe(m4,Me),y=m&&(e||b),k=R.useRef(null),_=R.useRef(),E=R.useRef(new Set),S=R.useRef(new Set),T=R.useRef(!1),C=N=>{if(T.current||g){T.current=!1;return}l==null||l(N),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},I=N=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){N.preventDefault();return}u==null||u(N)},L=d?N=>d(N):void 0,V=N=>{T.current&&(N.stopPropagation(),T.current=!1)},D=N=>{var q,U;const{domNode:M}=v.getState();if(_.current=M==null?void 0:M.getBoundingClientRect(),!_.current)return;const x=N.target===k.current;if(!x&&!!N.target.closest(".nokey")||!e||!(o&&x||t)||N.button!==0||!N.isPrimary)return;(U=(q=N.target)==null?void 0:q.setPointerCapture)==null||U.call(q,N.pointerId),T.current=!1;const{x:z,y:X}=sn(N.nativeEvent,_.current);v.setState({userSelectionRect:{width:0,height:0,startX:z,startY:X,x:z,y:X}}),x||(N.stopPropagation(),N.preventDefault())},P=N=>{const{userSelectionRect:M,transform:x,nodeLookup:F,edgeLookup:H,connectionLookup:z,triggerNodeChanges:X,triggerEdgeChanges:q,defaultEdgeOptions:U,resetSelectedElements:K}=v.getState();if(!_.current||!M)return;const{x:Y,y:Q}=sn(N.nativeEvent,_.current),{startX:de,startY:le}=M;if(!T.current){const ye=t?0:r;if(Math.hypot(Y-de,Q-le)<=ye)return;K(),s==null||s(N)}T.current=!0;const se={startX:de,startY:le,x:Y<de?Y:de,y:Q<le?Q:le,width:Math.abs(Y-de),height:Math.abs(Q-le)},oe=E.current,ge=S.current;E.current=new Set(Fp(F,se,x,n===xs.Partial,!0).map(ye=>ye.id)),S.current=new Set;const Ee=(U==null?void 0:U.selectable)??!0;for(const ye of E.current){const Xe=z.get(ye);if(Xe)for(const{edgeId:fn}of Xe.values()){const Vt=H.get(fn);Vt&&(Vt.selectable??Ee)&&S.current.add(fn)}}if(!lv(oe,E.current)){const ye=Nr(F,E.current,!0);X(ye)}if(!lv(ge,S.current)){const ye=Nr(H,S.current);q(ye)}v.setState({userSelectionRect:se,userSelectionActive:!0,nodesSelectionActive:!1})},A=N=>{var M,x;N.button===0&&((x=(M=N.target)==null?void 0:M.releasePointerCapture)==null||x.call(M,N.pointerId),!b&&N.target===k.current&&v.getState().userSelectionRect&&(C==null||C(N)),v.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(a==null||a(N),v.setState({nodesSelectionActive:E.current.size>0})))},O=i===!0||Array.isArray(i)&&i.includes(0);return G.jsxs("div",{className:Ye(["react-flow__pane",{draggable:O,dragging:w,selection:e}]),onClick:y?void 0:Dc(C,k),onContextMenu:Dc(I,k),onWheel:Dc(L,k),onPointerEnter:y?void 0:c,onPointerMove:y?P:h,onPointerUp:y?A:void 0,onPointerDownCapture:y?D:void 0,onClickCapture:y?V:void 0,onPointerLeave:p,ref:k,style:Cu,children:[f,G.jsx(f4,{})]})}function sh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",zn.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function y_({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:o,nodeClickDistance:s}){const a=Le(),[l,u]=R.useState(!1),d=R.useRef();return R.useEffect(()=>{d.current=B5({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{sh({id:c,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:o,nodeId:r,nodeClickDistance:s}),()=>{var c;(c=d.current)==null||c.destroy()}},[n,i,t,o,e,r,s]),l}const v4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function x_(){const e=Le();return R.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:o,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),c=new Map,h=v4(s),p=r?o[0]:5,f=r?o[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*f*n.factor;for(const[,m]of u){if(!h(m))continue;let w={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+b};r&&(w=Hs(w,o));const{position:g,positionAbsolute:y}=Fx({nodeId:m.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:a});m.position=g,m.internals.positionAbsolute=y,c.set(m.id,m)}l(c)},[])}const Zp=R.createContext(null),w4=Zp.Provider;Zp.Consumer;const __=()=>R.useContext(Zp),b4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),y4=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:o,connection:s}=i,{fromHandle:a,toHandle:l,isValid:u}=s,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:o===Kr.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:d&&u}};function x4({type:e="source",position:t=ae.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:d,onTouchStart:c,...h},p){var P,A;const f=s||null,v=e==="target",b=Le(),m=__(),{connectOnClick:w,noPanClassName:g,rfId:y}=xe(b4,Me),{connectingFrom:k,connectingTo:_,clickConnecting:E,isPossibleEndHandle:S,connectionInProcess:T,clickConnectionInProcess:C,valid:I}=xe(y4(m,f,e),Me);m||(A=(P=b.getState()).onError)==null||A.call(P,"010",zn.error010());const L=O=>{const{defaultEdgeOptions:N,onConnect:M,hasDefaultEdges:x}=b.getState(),F={...N,...O};if(x){const{edges:H,setEdges:z}=b.getState();z(E5(F,H))}M==null||M(F),a==null||a(F)},V=O=>{if(!m)return;const N=Ux(O.nativeEvent);if(r&&(N&&O.button===0||!N)){const M=b.getState();rh.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:v,handleId:f,nodeId:m,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...x)=>{var F,H;return(H=(F=b.getState()).onConnectEnd)==null?void 0:H.call(F,...x)},updateConnection:M.updateConnection,onConnect:L,isValidConnection:n||((...x)=>{var F,H;return((H=(F=b.getState()).isValidConnection)==null?void 0:H.call(F,...x))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}N?d==null||d(O):c==null||c(O)},D=O=>{const{onClickConnectStart:N,onClickConnectEnd:M,connectionClickStartHandle:x,connectionMode:F,isValidConnection:H,lib:z,rfId:X,nodeLookup:q,connection:U}=b.getState();if(!m||!x&&!r)return;if(!x){N==null||N(O.nativeEvent,{nodeId:m,handleId:f,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:m,type:e,id:f}});return}const K=Wx(O.target),Y=n||H,{connection:Q,isValid:de}=rh.isValid(O.nativeEvent,{handle:{nodeId:m,id:f,type:e},connectionMode:F,fromNodeId:x.nodeId,fromHandleId:x.id||null,fromType:x.type,isValidConnection:Y,flowId:X,doc:K,lib:z,nodeLookup:q});de&&Q&&L(Q);const le=structuredClone(U);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,M==null||M(O,le),b.setState({connectionClickStartHandle:null})};return G.jsx("div",{"data-handleid":f,"data-nodeid":m,"data-handlepos":t,"data-id":`${y}-${m}-${f}-${e}`,className:Ye(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!v,target:v,connectable:i,connectablestart:r,connectableend:o,clickconnecting:E,connectingfrom:k,connectingto:_,valid:I,connectionindicator:i&&(!T||S)&&(T||C?o:r)}]),onMouseDown:V,onTouchStart:V,onClick:w?D:void 0,ref:p,...h,children:l})}const Ol=R.memo(w_(x4));function _4({data:e,isConnectable:t,sourcePosition:n=ae.Bottom}){return G.jsxs(G.Fragment,{children:[e==null?void 0:e.label,G.jsx(Ol,{type:"source",position:n,isConnectable:t})]})}function k4({data:e,isConnectable:t,targetPosition:n=ae.Top,sourcePosition:i=ae.Bottom}){return G.jsxs(G.Fragment,{children:[G.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,G.jsx(Ol,{type:"source",position:i,isConnectable:t})]})}function S4(){return null}function C4({data:e,isConnectable:t,targetPosition:n=ae.Top}){return G.jsxs(G.Fragment,{children:[G.jsx(Ol,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Rl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Mv={input:_4,default:k4,output:C4,group:S4};function E4(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const D4=e=>{const{width:t,height:n,x:i,y:r}=Fs(e.nodeLookup,{filter:o=>!!o.selected});return{width:on(t)?t:null,height:on(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function z4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Le(),{width:r,height:o,transformString:s,userSelectionActive:a}=xe(D4,Me),l=x_(),u=R.useRef(null);R.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!a&&r!==null&&o!==null;if(y_({nodeRef:u,disabled:!d}),!d)return null;const c=e?p=>{const f=i.getState().nodes.filter(v=>v.selected);e(p,f)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Rl,p.key)&&(p.preventDefault(),l({direction:Rl[p.key],factor:p.shiftKey?4:1}))};return G.jsx("div",{className:Ye(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:G.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:o}})})}const Lv=typeof window<"u"?window:void 0,P4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function k_({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:c,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:f,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:g,panOnScroll:y,panOnScrollSpeed:k,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:S,defaultViewport:T,translateExtent:C,minZoom:I,maxZoom:L,preventScrolling:V,onSelectionContextMenu:D,noWheelClassName:P,noPanClassName:A,disableKeyboardA11y:O,onViewportChange:N,isControlledViewport:M}){const{nodesSelectionActive:x,userSelectionActive:F}=xe(P4,Me),H=Ss(u,{target:Lv}),z=Ss(v,{target:Lv}),X=z||S,q=z||y,U=d&&X!==!0,K=H||F||U;return u4({deleteKeyCode:l,multiSelectionKeyCode:f}),G.jsx(h4,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:g,panOnScroll:q,panOnScrollSpeed:k,panOnScrollMode:_,zoomOnDoubleClick:E,panOnDrag:!H&&X,defaultViewport:T,translateExtent:C,minZoom:I,maxZoom:L,zoomActivationKeyCode:b,preventScrolling:V,noWheelClassName:P,noPanClassName:A,onViewportChange:N,isControlledViewport:M,paneClickDistance:a,selectionOnDrag:U,children:G.jsxs(g4,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:X,isSelecting:!!K,selectionMode:c,selectionKeyPressed:H,paneClickDistance:a,selectionOnDrag:U,children:[e,x&&G.jsx(z4,{onSelectionContextMenu:D,noPanClassName:A,disableKeyboardA11y:O})]})})}k_.displayName="FlowRenderer";const A4=R.memo(k_),I4=e=>t=>e?Fp(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 N4(e){return xe(R.useCallback(I4(e),[e]),Me)}const T4=e=>e.updateNodeInternals;function M4(){const e=xe(T4),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const o=r.target.getAttribute("data-id");i.set(o,{id:o,nodeElement:r.target,force:!0})}),e(i)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function L4({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Le(),o=R.useRef(null),s=R.useRef(null),a=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(t),d=n&&!!e.internals.handleBounds;return R.useEffect(()=>{o.current&&!e.hidden&&(!d||s.current!==o.current)&&(s.current&&(i==null||i.unobserve(s.current)),i==null||i.observe(o.current),s.current=o.current)},[d,e.hidden]),R.useEffect(()=>()=>{s.current&&(i==null||i.unobserve(s.current),s.current=null)},[]),R.useEffect(()=>{if(o.current){const c=u.current!==t,h=a.current!==e.sourcePosition,p=l.current!==e.targetPosition;(c||h||p)&&(u.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function O4({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:o,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:c,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:f,rfId:v,nodeTypes:b,nodeClickDistance:m,onError:w}){const{node:g,internals:y,isParent:k}=xe(Y=>{const Q=Y.nodeLookup.get(e),de=Y.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:de}},Me);let _=g.type||"default",E=(b==null?void 0:b[_])||Mv[_];E===void 0&&(w==null||w("003",zn.error003(_)),_="default",E=(b==null?void 0:b.default)||Mv.default);const S=!!(g.draggable||a&&typeof g.draggable>"u"),T=!!(g.selectable||l&&typeof g.selectable>"u"),C=!!(g.connectable||u&&typeof g.connectable>"u"),I=!!(g.focusable||d&&typeof g.focusable>"u"),L=Le(),V=Gp(g),D=L4({node:g,nodeType:_,hasDimensions:V,resizeObserver:c}),P=y_({nodeRef:D,disabled:g.hidden||!S,noDragClassName:h,handleSelector:g.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:m}),A=x_();if(g.hidden)return null;const O=Xn(g),N=E4(g),M=T||S||t||n||i||r,x=n?Y=>n(Y,{...y.userNode}):void 0,F=i?Y=>i(Y,{...y.userNode}):void 0,H=r?Y=>r(Y,{...y.userNode}):void 0,z=o?Y=>o(Y,{...y.userNode}):void 0,X=s?Y=>s(Y,{...y.userNode}):void 0,q=Y=>{const{selectNodesOnDrag:Q,nodeDragThreshold:de}=L.getState();T&&(!Q||!S||de>0)&&sh({id:e,store:L,nodeRef:D}),t&&t(Y,{...y.userNode})},U=Y=>{if(!(jx(Y.nativeEvent)||f)){if(Mx.includes(Y.key)&&T){const Q=Y.key==="Escape";sh({id:e,store:L,unselect:Q,nodeRef:D})}else if(S&&g.selected&&Object.prototype.hasOwnProperty.call(Rl,Y.key)){Y.preventDefault();const{ariaLabelConfig:Q}=L.getState();L.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:Y.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),A({direction:Rl[Y.key],factor:Y.shiftKey?4:1})}}},K=()=>{var ge;if(f||!((ge=D.current)!=null&&ge.matches(":focus-visible")))return;const{transform:Y,width:Q,height:de,autoPanOnNodeFocus:le,setCenter:se}=L.getState();if(!le)return;Fp(new Map([[e,g]]),{x:0,y:0,width:Q,height:de},Y,!0).length>0||se(g.position.x+O.width/2,g.position.y+O.height/2,{zoom:Y[2]})};return G.jsx("div",{className:Ye(["react-flow__node",`react-flow__node-${_}`,{[p]:S},g.className,{selected:g.selected,selectable:T,parent:k,draggable:S,dragging:P}]),ref:D,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:V?"visible":"hidden",...g.style,...N},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:x,onMouseMove:F,onMouseLeave:H,onContextMenu:z,onClick:q,onDoubleClick:X,onKeyDown:I?U:void 0,tabIndex:I?0:void 0,onFocus:I?K:void 0,role:g.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":f?void 0:`${f_}-${v}`,"aria-label":g.ariaLabel,...g.domAttributes,children:G.jsx(w4,{value:e,children:G.jsx(E,{id:e,data:g.data,type:_,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:g.selected??!1,selectable:T,draggable:S,deletable:g.deletable??!0,isConnectable:C,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:P,dragHandle:g.dragHandle,zIndex:y.z,parentId:g.parentId,...O})})})}var R4=R.memo(O4);const V4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function S_(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:o}=xe(V4,Me),s=N4(e.onlyRenderVisibleElements),a=M4();return G.jsx("div",{className:"react-flow__nodes",style:Cu,children:s.map(l=>G.jsx(R4,{id:l,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:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}S_.displayName="NodeRenderer";const F4=R.memo(S_);function H4(e){return xe(R.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const o=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);o&&s&&k5({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),Me)}const G4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return G.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},B4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return G.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ov={[Tl.Arrow]:G4,[Tl.ArrowClosed]:B4};function $4(e){const t=Le();return R.useMemo(()=>{var r,o;return Object.prototype.hasOwnProperty.call(Ov,e)?Ov[e]:((o=(r=t.getState()).onError)==null||o.call(r,"009",zn.error009(e)),null)},[e])}const W4=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=$4(t);return l?G.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:G.jsx(l,{color:n,strokeWidth:s})}):null},C_=({defaultColor:e,rfId:t})=>{const n=xe(o=>o.edges),i=xe(o=>o.defaultEdgeOptions),r=R.useMemo(()=>I5(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?G.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:G.jsx("defs",{children:r.map(o=>G.jsx(W4,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};C_.displayName="MarkerDefinitions";var j4=R.memo(C_);function E_({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...d}){const[c,h]=R.useState({x:1,y:0,width:0,height:0}),p=Ye(["react-flow__edge-textwrapper",u]),f=R.useRef(null);return R.useEffect(()=>{if(f.current){const v=f.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?G.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:p,visibility:c.width?"visible":"hidden",...d,children:[r&&G.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),G.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:f,style:i,children:n}),l]}):null}E_.displayName="EdgeText";const U4=R.memo(E_);function Eu({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return G.jsxs(G.Fragment,{children:[G.jsx("path",{...d,d:e,fill:"none",className:Ye(["react-flow__edge-path",d.className])}),u?G.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&on(t)&&on(n)?G.jsx(U4,{x:t,y:n,label:i,labelStyle:r,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Rv({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===ae.Left||e===ae.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function D_({sourceX:e,sourceY:t,sourcePosition:n=ae.Bottom,targetX:i,targetY:r,targetPosition:o=ae.Top}){const[s,a]=Rv({pos:n,x1:e,y1:t,x2:i,y2:r}),[l,u]=Rv({pos:o,x1:i,y1:r,x2:e,y2:t}),[d,c,h,p]=Yx({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${i},${r}`,d,c,h,p]}function z_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,sourcePosition:s,targetPosition:a,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:m})=>{const[w,g,y]=D_({sourceX:n,sourceY:i,sourcePosition:s,targetX:r,targetY:o,targetPosition:a}),k=e.isInternal?void 0:t;return G.jsx(Eu,{id:k,path:w,labelX:g,labelY:y,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:m})})}const Y4=z_({isInternal:!1}),P_=z_({isInternal:!0});Y4.displayName="SimpleBezierEdge";P_.displayName="SimpleBezierEdgeInternal";function A_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,sourcePosition:p=ae.Bottom,targetPosition:f=ae.Top,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:w})=>{const[g,y,k]=th({sourceX:n,sourceY:i,sourcePosition:p,targetX:r,targetY:o,targetPosition:f,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),_=e.isInternal?void 0:t;return G.jsx(Eu,{id:_,path:g,labelX:y,labelY:k,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:v,markerStart:b,interactionWidth:w})})}const I_=A_({isInternal:!1}),N_=A_({isInternal:!0});I_.displayName="SmoothStepEdge";N_.displayName="SmoothStepEdgeInternal";function T_(e){return R.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return G.jsx(I_,{...n,id:i,pathOptions:R.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const X4=T_({isInternal:!1}),M_=T_({isInternal:!0});X4.displayName="StepEdge";M_.displayName="StepEdgeInternal";function L_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:p,markerStart:f,interactionWidth:v})=>{const[b,m,w]=qx({sourceX:n,sourceY:i,targetX:r,targetY:o}),g=e.isInternal?void 0:t;return G.jsx(Eu,{id:g,path:b,labelX:m,labelY:w,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:h,markerEnd:p,markerStart:f,interactionWidth:v})})}const Z4=L_({isInternal:!1}),O_=L_({isInternal:!0});Z4.displayName="StraightEdge";O_.displayName="StraightEdgeInternal";function R_(e){return R.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:o,sourcePosition:s=ae.Bottom,targetPosition:a=ae.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,pathOptions:m,interactionWidth:w})=>{const[g,y,k]=Xx({sourceX:n,sourceY:i,sourcePosition:s,targetX:r,targetY:o,targetPosition:a,curvature:m==null?void 0:m.curvature}),_=e.isInternal?void 0:t;return G.jsx(Eu,{id:_,path:g,labelX:y,labelY:k,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,style:f,markerEnd:v,markerStart:b,interactionWidth:w})})}const q4=R_({isInternal:!1}),V_=R_({isInternal:!0});q4.displayName="BezierEdge";V_.displayName="BezierEdgeInternal";const Vv={default:V_,straight:O_,step:M_,smoothstep:N_,simplebezier:P_},Fv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Q4=(e,t,n)=>n===ae.Left?e-t:n===ae.Right?e+t:e,K4=(e,t,n)=>n===ae.Top?e-t:n===ae.Bottom?e+t:e,Hv="react-flow__edgeupdater";function Gv({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:o,onMouseOut:s,type:a}){return G.jsx("circle",{onMouseDown:r,onMouseEnter:o,onMouseOut:s,className:Ye([Hv,`${Hv}-${a}`]),cx:Q4(t,i,e),cy:K4(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function J4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:o,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:c,setReconnecting:h,setUpdateHover:p}){const f=Le(),v=(y,k)=>{if(y.button!==0)return;const{autoPanOnConnect:_,domNode:E,connectionMode:S,connectionRadius:T,lib:C,onConnectStart:I,cancelConnection:L,nodeLookup:V,rfId:D,panBy:P,updateConnection:A}=f.getState(),O=k.type==="target",N=(F,H)=>{h(!1),c==null||c(F,n,k.type,H)},M=F=>u==null?void 0:u(n,F),x=(F,H)=>{h(!0),d==null||d(y,n,k.type),I==null||I(F,H)};rh.onPointerDown(y.nativeEvent,{autoPanOnConnect:_,connectionMode:S,connectionRadius:T,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:V,isTarget:O,edgeUpdaterType:k.type,lib:C,flowId:D,cancelConnection:L,panBy:P,isValidConnection:(...F)=>{var H,z;return((z=(H=f.getState()).isValidConnection)==null?void 0:z.call(H,...F))??!0},onConnect:M,onConnectStart:x,onConnectEnd:(...F)=>{var H,z;return(z=(H=f.getState()).onConnectEnd)==null?void 0:z.call(H,...F)},onReconnectEnd:N,updateConnection:A,getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,dragThreshold:f.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},b=y=>v(y,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=y=>v(y,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>p(!0),g=()=>p(!1);return G.jsxs(G.Fragment,{children:[(e===!0||e==="source")&&G.jsx(Gv,{position:a,centerX:i,centerY:r,radius:t,onMouseDown:b,onMouseEnter:w,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&G.jsx(Gv,{position:l,centerX:o,centerY:s,radius:t,onMouseDown:m,onMouseEnter:w,onMouseOut:g,type:"target"})]})}function eV({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:p,rfId:f,edgeTypes:v,noPanClassName:b,onError:m,disableKeyboardA11y:w}){let g=xe(se=>se.edgeLookup.get(e));const y=xe(se=>se.defaultEdgeOptions);g=y?{...y,...g}:g;let k=g.type||"default",_=(v==null?void 0:v[k])||Vv[k];_===void 0&&(m==null||m("011",zn.error011(k)),k="default",_=(v==null?void 0:v.default)||Vv.default);const E=!!(g.focusable||t&&typeof g.focusable>"u"),S=typeof c<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),T=!!(g.selectable||i&&typeof g.selectable>"u"),C=R.useRef(null),[I,L]=R.useState(!1),[V,D]=R.useState(!1),P=Le(),{zIndex:A,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H}=xe(R.useCallback(se=>{const oe=se.nodeLookup.get(g.source),ge=se.nodeLookup.get(g.target);if(!oe||!ge)return{zIndex:g.zIndex,...Fv};const Ee=A5({id:e,sourceNode:oe,targetNode:ge,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:se.connectionMode,onError:m});return{zIndex:_5({selected:g.selected,zIndex:g.zIndex,sourceNode:oe,targetNode:ge,elevateOnSelect:se.elevateEdgesOnSelect,zIndexMode:se.zIndexMode}),...Ee||Fv}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),Me),z=R.useMemo(()=>g.markerStart?`url('#${nh(g.markerStart,f)}')`:void 0,[g.markerStart,f]),X=R.useMemo(()=>g.markerEnd?`url('#${nh(g.markerEnd,f)}')`:void 0,[g.markerEnd,f]);if(g.hidden||O===null||N===null||M===null||x===null)return null;const q=se=>{var ye;const{addSelectedEdges:oe,unselectNodesAndEdges:ge,multiSelectionActive:Ee}=P.getState();T&&(P.setState({nodesSelectionActive:!1}),g.selected&&Ee?(ge({nodes:[],edges:[g]}),(ye=C.current)==null||ye.blur()):oe([e])),r&&r(se,g)},U=o?se=>{o(se,{...g})}:void 0,K=s?se=>{s(se,{...g})}:void 0,Y=a?se=>{a(se,{...g})}:void 0,Q=l?se=>{l(se,{...g})}:void 0,de=u?se=>{u(se,{...g})}:void 0,le=se=>{var oe;if(!w&&Mx.includes(se.key)&&T){const{unselectNodesAndEdges:ge,addSelectedEdges:Ee}=P.getState();se.key==="Escape"?((oe=C.current)==null||oe.blur(),ge({edges:[g]})):Ee([e])}};return G.jsx("svg",{style:{zIndex:A},children:G.jsxs("g",{className:Ye(["react-flow__edge",`react-flow__edge-${k}`,g.className,b,{selected:g.selected,animated:g.animated,inactive:!T&&!r,updating:I,selectable:T}]),onClick:q,onDoubleClick:U,onContextMenu:K,onMouseEnter:Y,onMouseMove:Q,onMouseLeave:de,onKeyDown:E?le:void 0,tabIndex:E?0:void 0,role:g.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":E?`${m_}-${f}`:void 0,ref:C,...g.domAttributes,children:[!V&&G.jsx(_,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:T,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:z,markerEnd:X,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),S&&G.jsx(J4,{edge:g,isReconnectable:S,reconnectRadius:d,onReconnect:c,onReconnectStart:h,onReconnectEnd:p,sourceX:O,sourceY:N,targetX:M,targetY:x,sourcePosition:F,targetPosition:H,setUpdateHover:L,setReconnecting:D})]})})}var tV=R.memo(eV);const nV=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function F_({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:f,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:m,elementsSelectable:w,onError:g}=xe(nV,Me),y=H4(t);return G.jsxs("div",{className:"react-flow__edges",children:[G.jsx(j4,{defaultColor:e,rfId:n}),y.map(k=>G.jsx(tV,{id:k,edgesFocusable:b,edgesReconnectable:m,elementsSelectable:w,noPanClassName:r,onReconnect:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:c,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:f,rfId:n,onError:g,edgeTypes:i,disableKeyboardA11y:v},k))]})}F_.displayName="EdgeRenderer";const iV=R.memo(F_),rV=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function oV({children:e}){const t=xe(rV);return G.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function sV(e){const t=Xp(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const aV=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function lV(e){const t=xe(aV),n=Le();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uV(e){return e.connection.inProgress?{...e.connection,to:Gs(e.connection.to,e.transform)}:{...e.connection}}function cV(e){return uV}function dV(e){const t=cV();return xe(t,Me)}const hV=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pV({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:o,height:s,isValid:a,inProgress:l}=xe(hV,Me);return!(o&&r&&l)?null:G.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:G.jsx("g",{className:Ye(["react-flow__connection",Rx(a)]),children:G.jsx(H_,{style:t,type:n,CustomComponent:i,isValid:a})})})}const H_=({style:e,type:t=ai.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:o,fromNode:s,fromHandle:a,fromPosition:l,to:u,toNode:d,toHandle:c,toPosition:h,pointer:p}=dV();if(!r)return;if(n)return G.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:o.x,fromY:o.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:h,connectionStatus:Rx(i),toNode:d,toHandle:c,pointer:p});let f="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case ai.Bezier:[f]=Xx(v);break;case ai.SimpleBezier:[f]=D_(v);break;case ai.Step:[f]=th({...v,borderRadius:0});break;case ai.SmoothStep:[f]=th(v);break;default:[f]=qx(v)}return G.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};H_.displayName="ConnectionLine";const fV={};function Bv(e=fV){R.useRef(e),Le(),R.useEffect(()=>{},[e])}function mV(){Le(),R.useRef(!1),R.useEffect(()=>{},[])}function G_({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:h,onSelectionEnd:p,connectionLineType:f,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:m,selectionKeyCode:w,selectionOnDrag:g,selectionMode:y,multiSelectionKeyCode:k,panActivationKeyCode:_,zoomActivationKeyCode:E,deleteKeyCode:S,onlyRenderVisibleElements:T,elementsSelectable:C,defaultViewport:I,translateExtent:L,minZoom:V,maxZoom:D,preventScrolling:P,defaultMarkerColor:A,zoomOnScroll:O,zoomOnPinch:N,panOnScroll:M,panOnScrollSpeed:x,panOnScrollMode:F,zoomOnDoubleClick:H,panOnDrag:z,onPaneClick:X,onPaneMouseEnter:q,onPaneMouseMove:U,onPaneMouseLeave:K,onPaneScroll:Y,onPaneContextMenu:Q,paneClickDistance:de,nodeClickDistance:le,onEdgeContextMenu:se,onEdgeMouseEnter:oe,onEdgeMouseMove:ge,onEdgeMouseLeave:Ee,reconnectRadius:ye,onReconnect:Xe,onReconnectStart:fn,onReconnectEnd:Vt,noDragClassName:mn,noWheelClassName:Pi,noPanClassName:Ai,disableKeyboardA11y:Ii,nodeExtent:co,rfId:hr,viewport:$,onViewportChange:Z}){return Bv(e),Bv(t),mV(),sV(n),lV($),G.jsx(A4,{onPaneClick:X,onPaneMouseEnter:q,onPaneMouseMove:U,onPaneMouseLeave:K,onPaneContextMenu:Q,onPaneScroll:Y,paneClickDistance:de,deleteKeyCode:S,selectionKeyCode:w,selectionOnDrag:g,selectionMode:y,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:_,zoomActivationKeyCode:E,elementsSelectable:C,zoomOnScroll:O,zoomOnPinch:N,zoomOnDoubleClick:H,panOnScroll:M,panOnScrollSpeed:x,panOnScrollMode:F,panOnDrag:z,defaultViewport:I,translateExtent:L,minZoom:V,maxZoom:D,onSelectionContextMenu:c,preventScrolling:P,noDragClassName:mn,noWheelClassName:Pi,noPanClassName:Ai,disableKeyboardA11y:Ii,onViewportChange:Z,isControlledViewport:!!$,children:G.jsxs(oV,{children:[G.jsx(iV,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Xe,onReconnectStart:fn,onReconnectEnd:Vt,onlyRenderVisibleElements:T,onEdgeContextMenu:se,onEdgeMouseEnter:oe,onEdgeMouseMove:ge,onEdgeMouseLeave:Ee,reconnectRadius:ye,defaultMarkerColor:A,noPanClassName:Ai,disableKeyboardA11y:Ii,rfId:hr}),G.jsx(pV,{style:v,type:f,component:b,containerStyle:m}),G.jsx("div",{className:"react-flow__edgelabel-renderer"}),G.jsx(F4,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:le,onlyRenderVisibleElements:T,noPanClassName:Ai,noDragClassName:mn,disableKeyboardA11y:Ii,nodeExtent:co,rfId:hr}),G.jsx("div",{className:"react-flow__viewport-portal"})]})})}G_.displayName="GraphView";const gV=R.memo(G_),$v=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:c,zIndexMode:h="basic"}={})=>{const p=new Map,f=new Map,v=new Map,b=new Map,m=i??t??[],w=n??e??[],g=d??[0,0],y=c??ys;Jx(v,b,m);const{nodesInitialized:k}=ih(w,p,f,{nodeOrigin:g,nodeExtent:y,zIndexMode:h});let _=[0,0,1];if(s&&r&&o){const E=Fs(p,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:S,y:T,zoom:C}=Hp(E,r,o,l,u,(a==null?void 0:a.padding)??.1);_=[S,T,C]}return{rfId:"1",width:r??0,height:o??0,transform:_,nodes:w,nodesInitialized:k,nodeLookup:p,parentLookup:f,edges:m,edgeLookup:b,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:ys,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Kr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Ox},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:g5,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Lx,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},vV=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h})=>M3((p,f)=>{async function v(){const{nodeLookup:b,panZoom:m,fitViewOptions:w,fitViewResolver:g,width:y,height:k,minZoom:_,maxZoom:E}=f();m&&(await f5({nodes:b,width:y,height:k,panZoom:m,minZoom:_,maxZoom:E},w),g==null||g.resolve(!0),p({fitViewResolver:null}))}return{...$v({nodes:e,edges:t,width:r,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:b=>{const{nodeLookup:m,parentLookup:w,nodeOrigin:g,elevateNodesOnSelect:y,fitViewQueued:k,zIndexMode:_,nodesSelectionActive:E}=f(),{nodesInitialized:S,hasSelectedNodes:T}=ih(b,m,w,{nodeOrigin:g,nodeExtent:c,elevateNodesOnSelect:y,checkEquality:!0,zIndexMode:_}),C=E&&T;k&&S?(v(),p({nodes:b,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:C})):p({nodes:b,nodesInitialized:S,nodesSelectionActive:C})},setEdges:b=>{const{connectionLookup:m,edgeLookup:w}=f();Jx(m,w,b),p({edges:b})},setDefaultNodesAndEdges:(b,m)=>{if(b){const{setNodes:w}=f();w(b),p({hasDefaultNodes:!0})}if(m){const{setEdges:w}=f();w(m),p({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:m,nodeLookup:w,parentLookup:g,domNode:y,nodeOrigin:k,nodeExtent:_,debug:E,fitViewQueued:S,zIndexMode:T}=f(),{changes:C,updatedInternals:I}=V5(b,w,g,y,k,_,T);I&&(M5(w,g,{nodeOrigin:k,nodeExtent:_,zIndexMode:T}),S?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(C==null?void 0:C.length)>0&&(E&&console.log("React Flow: trigger node changes",C),m==null||m(C)))},updateNodePositions:(b,m=!1)=>{const w=[];let g=[];const{nodeLookup:y,triggerNodeChanges:k,connection:_,updateConnection:E,onNodesChangeMiddlewareMap:S}=f();for(const[T,C]of b){const I=y.get(T),L=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(C!=null&&C.position)),V={id:T,type:"position",position:L?{x:Math.max(0,C.position.x),y:Math.max(0,C.position.y)}:C.position,dragging:m};if(I&&_.inProgress&&_.fromNode.id===I.id){const D=sr(I,_.fromHandle,ae.Left,!0);E({..._,from:D})}L&&I.parentId&&w.push({id:T,parentId:I.parentId,rect:{...C.internals.positionAbsolute,width:C.measured.width??0,height:C.measured.height??0}}),g.push(V)}if(w.length>0){const{parentLookup:T,nodeOrigin:C}=f(),I=Yp(w,y,T,C);g.push(...I)}for(const T of S.values())g=T(g);k(g)},triggerNodeChanges:b=>{const{onNodesChange:m,setNodes:w,nodes:g,hasDefaultNodes:y,debug:k}=f();if(b!=null&&b.length){if(y){const _=t4(b,g);w(_)}k&&console.log("React Flow: trigger node changes",b),m==null||m(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:m,setEdges:w,edges:g,hasDefaultEdges:y,debug:k}=f();if(b!=null&&b.length){if(y){const _=n4(b,g);w(_)}k&&console.log("React Flow: trigger edge changes",b),m==null||m(b)}},addSelectedNodes:b=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:g,triggerNodeChanges:y,triggerEdgeChanges:k}=f();if(m){const _=b.map(E=>Fi(E,!0));y(_);return}y(Nr(g,new Set([...b]),!0)),k(Nr(w))},addSelectedEdges:b=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:g,triggerNodeChanges:y,triggerEdgeChanges:k}=f();if(m){const _=b.map(E=>Fi(E,!0));k(_);return}k(Nr(w,new Set([...b]))),y(Nr(g,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:m}={})=>{const{edges:w,nodes:g,nodeLookup:y,triggerNodeChanges:k,triggerEdgeChanges:_}=f(),E=b||g,S=m||w,T=[];for(const I of E){if(!I.selected)continue;const L=y.get(I.id);L&&(L.selected=!1),T.push(Fi(I.id,!1))}const C=[];for(const I of S)I.selected&&C.push(Fi(I.id,!1));k(T),_(C)},setMinZoom:b=>{const{panZoom:m,maxZoom:w}=f();m==null||m.setScaleExtent([b,w]),p({minZoom:b})},setMaxZoom:b=>{const{panZoom:m,minZoom:w}=f();m==null||m.setScaleExtent([w,b]),p({maxZoom:b})},setTranslateExtent:b=>{var m;(m=f().panZoom)==null||m.setTranslateExtent(b),p({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:m,triggerNodeChanges:w,triggerEdgeChanges:g,elementsSelectable:y}=f();if(!y)return;const k=m.reduce((E,S)=>S.selected?[...E,Fi(S.id,!1)]:E,[]),_=b.reduce((E,S)=>S.selected?[...E,Fi(S.id,!1)]:E,[]);w(k),g(_)},setNodeExtent:b=>{const{nodes:m,nodeLookup:w,parentLookup:g,nodeOrigin:y,elevateNodesOnSelect:k,nodeExtent:_,zIndexMode:E}=f();b[0][0]===_[0][0]&&b[0][1]===_[0][1]&&b[1][0]===_[1][0]&&b[1][1]===_[1][1]||(ih(m,w,g,{nodeOrigin:y,nodeExtent:b,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),p({nodeExtent:b}))},panBy:b=>{const{transform:m,width:w,height:g,panZoom:y,translateExtent:k}=f();return F5({delta:b,panZoom:y,transform:m,translateExtent:k,width:w,height:g})},setCenter:async(b,m,w)=>{const{width:g,height:y,maxZoom:k,panZoom:_}=f();if(!_)return Promise.resolve(!1);const E=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await _.setViewport({x:g/2-b*E,y:y/2-m*E,zoom:E},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...Ox}})},updateConnection:b=>{p({connection:b})},reset:()=>p({...$v()})}},Object.is);function wV({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:o,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:c,zIndexMode:h,children:p}){const[f]=R.useState(()=>vV({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:o,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:c,zIndexMode:h}));return G.jsx(L3,{value:f,children:G.jsx(o4,{children:p})})}function bV({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:o,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:p}){return R.useContext(ku)?G.jsx(G.Fragment,{children:e}):G.jsx(wV,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:o,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:c,nodeExtent:h,zIndexMode:p,children:e})}const yV={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function xV({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:o,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:c,onMoveEnd:h,onConnect:p,onConnectStart:f,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,onNodeMouseEnter:w,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:_,onNodeDragStart:E,onNodeDrag:S,onNodeDragStop:T,onNodesDelete:C,onEdgesDelete:I,onDelete:L,onSelectionChange:V,onSelectionDragStart:D,onSelectionDrag:P,onSelectionDragStop:A,onSelectionContextMenu:O,onSelectionStart:N,onSelectionEnd:M,onBeforeDelete:x,connectionMode:F,connectionLineType:H=ai.Bezier,connectionLineStyle:z,connectionLineComponent:X,connectionLineContainerStyle:q,deleteKeyCode:U="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:Y=!1,selectionMode:Q=xs.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:le=ks()?"Meta":"Control",zoomActivationKeyCode:se=ks()?"Meta":"Control",snapToGrid:oe,snapGrid:ge,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:ye,nodesDraggable:Xe,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:mn,nodeOrigin:Pi=g_,edgesFocusable:Ai,edgesReconnectable:Ii,elementsSelectable:co=!0,defaultViewport:hr=X3,minZoom:$=.5,maxZoom:Z=2,translateExtent:he=ys,preventScrolling:ve=!0,nodeExtent:Se,defaultMarkerColor:Dt="#b1b1b7",zoomOnScroll:In=!0,zoomOnPinch:Xt=!0,panOnScroll:Ni=!1,panOnScrollSpeed:Ti=.5,panOnScrollMode:pt=qi.Free,zoomOnDoubleClick:Zn=!0,panOnDrag:Zt=!0,onPaneClick:j_,onPaneMouseEnter:U_,onPaneMouseMove:Y_,onPaneMouseLeave:X_,onPaneScroll:Z_,onPaneContextMenu:q_,paneClickDistance:Q_=1,nodeClickDistance:K_=0,children:J_,onReconnect:e1,onReconnectStart:t1,onReconnectEnd:n1,onEdgeContextMenu:i1,onEdgeDoubleClick:r1,onEdgeMouseEnter:o1,onEdgeMouseMove:s1,onEdgeMouseLeave:a1,reconnectRadius:l1=10,onNodesChange:u1,onEdgesChange:c1,noDragClassName:d1="nodrag",noWheelClassName:h1="nowheel",noPanClassName:qp="nopan",fitView:Qp,fitViewOptions:Kp,connectOnClick:p1,attributionPosition:f1,proOptions:m1,defaultEdgeOptions:g1,elevateNodesOnSelect:v1=!0,elevateEdgesOnSelect:w1=!1,disableKeyboardA11y:Jp=!1,autoPanOnConnect:b1,autoPanOnNodeDrag:y1,autoPanSpeed:x1,connectionRadius:_1,isValidConnection:k1,onError:S1,style:C1,id:ef,nodeDragThreshold:E1,connectionDragThreshold:D1,viewport:z1,onViewportChange:P1,width:A1,height:I1,colorMode:N1="light",debug:T1,onScroll:Bs,ariaLabelConfig:M1,zIndexMode:tf="basic",...L1},O1){const Du=ef||"1",R1=K3(N1),V1=R.useCallback(nf=>{nf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Bs==null||Bs(nf)},[Bs]);return G.jsx("div",{"data-testid":"rf__wrapper",...L1,onScroll:V1,style:{...C1,...yV},ref:O1,className:Ye(["react-flow",r,R1]),id:ef,role:"application",children:G.jsxs(bV,{nodes:e,edges:t,width:A1,height:I1,fitView:Qp,fitViewOptions:Kp,minZoom:$,maxZoom:Z,nodeOrigin:Pi,nodeExtent:Se,zIndexMode:tf,children:[G.jsx(Q3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:p,onConnectStart:f,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,nodesDraggable:Xe,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:mn,edgesFocusable:Ai,edgesReconnectable:Ii,elementsSelectable:co,elevateNodesOnSelect:v1,elevateEdgesOnSelect:w1,minZoom:$,maxZoom:Z,nodeExtent:Se,onNodesChange:u1,onEdgesChange:c1,snapToGrid:oe,snapGrid:ge,connectionMode:F,translateExtent:he,connectOnClick:p1,defaultEdgeOptions:g1,fitView:Qp,fitViewOptions:Kp,onNodesDelete:C,onEdgesDelete:I,onDelete:L,onNodeDragStart:E,onNodeDrag:S,onNodeDragStop:T,onSelectionDrag:P,onSelectionDragStart:D,onSelectionDragStop:A,onMove:d,onMoveStart:c,onMoveEnd:h,noPanClassName:qp,nodeOrigin:Pi,rfId:Du,autoPanOnConnect:b1,autoPanOnNodeDrag:y1,autoPanSpeed:x1,onError:S1,connectionRadius:_1,isValidConnection:k1,selectNodesOnDrag:ye,nodeDragThreshold:E1,connectionDragThreshold:D1,onBeforeDelete:x,debug:T1,ariaLabelConfig:M1,zIndexMode:tf}),G.jsx(gV,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:k,onNodeDoubleClick:_,nodeTypes:o,edgeTypes:s,connectionLineType:H,connectionLineStyle:z,connectionLineComponent:X,connectionLineContainerStyle:q,selectionKeyCode:K,selectionOnDrag:Y,selectionMode:Q,deleteKeyCode:U,multiSelectionKeyCode:le,panActivationKeyCode:de,zoomActivationKeyCode:se,onlyRenderVisibleElements:Ee,defaultViewport:hr,translateExtent:he,minZoom:$,maxZoom:Z,preventScrolling:ve,zoomOnScroll:In,zoomOnPinch:Xt,zoomOnDoubleClick:Zn,panOnScroll:Ni,panOnScrollSpeed:Ti,panOnScrollMode:pt,panOnDrag:Zt,onPaneClick:j_,onPaneMouseEnter:U_,onPaneMouseMove:Y_,onPaneMouseLeave:X_,onPaneScroll:Z_,onPaneContextMenu:q_,paneClickDistance:Q_,nodeClickDistance:K_,onSelectionContextMenu:O,onSelectionStart:N,onSelectionEnd:M,onReconnect:e1,onReconnectStart:t1,onReconnectEnd:n1,onEdgeContextMenu:i1,onEdgeDoubleClick:r1,onEdgeMouseEnter:o1,onEdgeMouseMove:s1,onEdgeMouseLeave:a1,reconnectRadius:l1,defaultMarkerColor:Dt,noDragClassName:d1,noWheelClassName:h1,noPanClassName:qp,rfId:Du,disableKeyboardA11y:Jp,nodeExtent:Se,viewport:z1,onViewportChange:P1}),G.jsx(Y3,{onSelectionChange:V}),J_,G.jsx(B3,{proOptions:m1,position:f1}),G.jsx(G3,{rfId:Du,disableKeyboardA11y:Jp})]})})}var l8=w_(xV);const _V=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!Gp(n.userNode))return!1;return!0};function u8(e={includeHiddenNodes:!1}){return xe(_V(e))}function kV({dimensions:e,lineWidth:t,variant:n,className:i}){return G.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ye(["react-flow__background-pattern",n,i])})}function SV({radius:e,className:t}){return G.jsx("circle",{cx:e,cy:e,r:e,className:Ye(["react-flow__background-pattern","dots",t])})}var yi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(yi||(yi={}));const CV={[yi.Dots]:1,[yi.Lines]:1,[yi.Cross]:6},EV=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function B_({id:e,variant:t=yi.Dots,gap:n=20,size:i,lineWidth:r=1,offset:o=0,color:s,bgColor:a,style:l,className:u,patternClassName:d}){const c=R.useRef(null),{transform:h,patternId:p}=xe(EV,Me),f=i||CV[t],v=t===yi.Dots,b=t===yi.Cross,m=Array.isArray(n)?n:[n,n],w=[m[0]*h[2]||1,m[1]*h[2]||1],g=f*h[2],y=Array.isArray(o)?o:[o,o],k=b?[g,g]:w,_=[y[0]*h[2]||1+k[0]/2,y[1]*h[2]||1+k[1]/2],E=`${p}${e||""}`;return G.jsxs("svg",{className:Ye(["react-flow__background",u]),style:{...l,...Cu,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[G.jsx("pattern",{id:E,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?G.jsx(SV,{radius:g/2,className:d}):G.jsx(kV,{dimensions:k,lineWidth:r,variant:t,className:d})}),G.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}B_.displayName="Background";const c8=R.memo(B_);function DV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:G.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function zV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:G.jsx("path",{d:"M0 0h32v4.2H0z"})})}function PV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:G.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 AV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.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 IV(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.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 Ea({children:e,className:t,...n}){return G.jsx("button",{type:"button",className:Ye(["react-flow__controls-button",t]),...n,children:e})}const NV=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $_({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:d,position:c="bottom-left",orientation:h="vertical","aria-label":p}){const f=Le(),{isInteractive:v,minZoomReached:b,maxZoomReached:m,ariaLabelConfig:w}=xe(NV,Me),{zoomIn:g,zoomOut:y,fitView:k}=Xp(),_=()=>{g(),o==null||o()},E=()=>{y(),s==null||s()},S=()=>{k(r),a==null||a()},T=()=>{f.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},C=h==="horizontal"?"horizontal":"vertical";return G.jsxs(Su,{className:Ye(["react-flow__controls",C,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":p??w["controls.ariaLabel"],children:[t&&G.jsxs(G.Fragment,{children:[G.jsx(Ea,{onClick:_,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:m,children:G.jsx(DV,{})}),G.jsx(Ea,{onClick:E,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:b,children:G.jsx(zV,{})})]}),n&&G.jsx(Ea,{className:"react-flow__controls-fitview",onClick:S,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:G.jsx(PV,{})}),i&&G.jsx(Ea,{className:"react-flow__controls-interactive",onClick:T,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:v?G.jsx(IV,{}):G.jsx(AV,{})}),d]})}$_.displayName="Controls";const d8=R.memo($_);function TV({id:e,x:t,y:n,width:i,height:r,style:o,color:s,strokeColor:a,strokeWidth:l,className:u,borderRadius:d,shapeRendering:c,selected:h,onClick:p}){const{background:f,backgroundColor:v}=o||{},b=s||f||v;return G.jsx("rect",{className:Ye(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:b,stroke:a,strokeWidth:l},shapeRendering:c,onClick:p?m=>p(m,e):void 0})}const MV=R.memo(TV),LV=e=>e.nodes.map(t=>t.id),zc=e=>e instanceof Function?e:()=>e;function OV({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:o=MV,onClick:s}){const a=xe(LV,Me),l=zc(t),u=zc(e),d=zc(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return G.jsx(G.Fragment,{children:a.map(h=>G.jsx(VV,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:o,onClick:s,shapeRendering:c},h))})}function RV({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:u,x:d,y:c,width:h,height:p}=xe(f=>{const v=f.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const b=v.internals.userNode,{x:m,y:w}=v.internals.positionAbsolute,{width:g,height:y}=Xn(b);return{node:b,x:m,y:w,width:g,height:y}},Me);return!u||u.hidden||!Gp(u)?null:G.jsx(a,{x:d,y:c,width:h,height:p,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:o,shapeRendering:s,onClick:l,id:u.id})}const VV=R.memo(RV);var FV=R.memo(OV);const HV=200,GV=150,BV=e=>!e.hidden,$V=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?Bx(Fs(e.nodeLookup,{filter:BV}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},WV="react-flow__minimap-desc";function W_({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:c,position:h="bottom-right",onClick:p,onNodeClick:f,pannable:v=!1,zoomable:b=!1,ariaLabel:m,inversePan:w,zoomStep:g=1,offsetScale:y=5}){const k=Le(),_=R.useRef(null),{boundingRect:E,viewBB:S,rfId:T,panZoom:C,translateExtent:I,flowWidth:L,flowHeight:V,ariaLabelConfig:D}=xe($V,Me),P=(e==null?void 0:e.width)??HV,A=(e==null?void 0:e.height)??GV,O=E.width/P,N=E.height/A,M=Math.max(O,N),x=M*P,F=M*A,H=y*M,z=E.x-(x-E.width)/2-H,X=E.y-(F-E.height)/2-H,q=x+H*2,U=F+H*2,K=`${WV}-${T}`,Y=R.useRef(0),Q=R.useRef();Y.current=M,R.useEffect(()=>{if(_.current&&C)return Q.current=X5({domNode:_.current,panZoom:C,getTransform:()=>k.getState().transform,getViewScale:()=>Y.current}),()=>{var oe;(oe=Q.current)==null||oe.destroy()}},[C]),R.useEffect(()=>{var oe;(oe=Q.current)==null||oe.update({translateExtent:I,width:L,height:V,inversePan:w,pannable:v,zoomStep:g,zoomable:b})},[v,b,w,g,I,L,V]);const de=p?oe=>{var ye;const[ge,Ee]=((ye=Q.current)==null?void 0:ye.pointer(oe))||[0,0];p(oe,{x:ge,y:Ee})}:void 0,le=f?R.useCallback((oe,ge)=>{const Ee=k.getState().nodeLookup.get(ge).internals.userNode;f(oe,Ee)},[]):void 0,se=m??D["minimap.ariaLabel"];return G.jsx(Su,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*M:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Ye(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:G.jsxs("svg",{width:P,height:A,viewBox:`${z} ${X} ${q} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:_,onClick:de,children:[se&&G.jsx("title",{id:K,children:se}),G.jsx(FV,{onClick:le,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),G.jsx("path",{className:"react-flow__minimap-mask",d:`M${z-H},${X-H}h${q+H*2}v${U+H*2}h${-q-H*2}z
|
|
2745
|
-
M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W_.displayName="MiniMap";R.memo(W_)
|
|
2745
|
+
M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W_.displayName="MiniMap";const h8=R.memo(W_),jV=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,UV={[no.Line]:"right",[no.Handle]:"bottom-right"};function YV({nodeId:e,position:t,variant:n=no.Handle,className:i,style:r=void 0,children:o,color:s,minWidth:a=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:h,autoScale:p=!0,shouldResize:f,onResizeStart:v,onResize:b,onResizeEnd:m}){const w=__(),g=typeof e=="string"?e:w,y=Le(),k=R.useRef(null),_=n===no.Handle,E=xe(R.useCallback(jV(_&&p),[_,p]),Me),S=R.useRef(null),T=t??UV[n];R.useEffect(()=>{if(!(!k.current||!g))return S.current||(S.current=l3({domNode:k.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:I,transform:L,snapGrid:V,snapToGrid:D,nodeOrigin:P,domNode:A}=y.getState();return{nodeLookup:I,transform:L,snapGrid:V,snapToGrid:D,nodeOrigin:P,paneDomNode:A}},onChange:(I,L)=>{const{triggerNodeChanges:V,nodeLookup:D,parentLookup:P,nodeOrigin:A}=y.getState(),O=[],N={x:I.x,y:I.y},M=D.get(g);if(M&&M.expandParent&&M.parentId){const x=M.origin??A,F=I.width??M.measured.width??0,H=I.height??M.measured.height??0,z={id:M.id,parentId:M.parentId,rect:{width:F,height:H,...$x({x:I.x??M.position.x,y:I.y??M.position.y},{width:F,height:H},M.parentId,D,x)}},X=Yp([z],D,P,A);O.push(...X),N.x=I.x?Math.max(x[0]*F,I.x):void 0,N.y=I.y?Math.max(x[1]*H,I.y):void 0}if(N.x!==void 0&&N.y!==void 0){const x={id:g,type:"position",position:{...N}};O.push(x)}if(I.width!==void 0&&I.height!==void 0){const F={id:g,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};O.push(F)}for(const x of L){const F={...x,type:"position"};O.push(F)}V(O)},onEnd:({width:I,height:L})=>{const V={id:g,type:"dimensions",resizing:!1,dimensions:{width:I,height:L}};y.getState().triggerNodeChanges([V])}})),S.current.update({controlPosition:T,boundaries:{minWidth:a,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:c,resizeDirection:h,onResizeStart:v,onResize:b,onResizeEnd:m,shouldResize:f}),()=>{var I;(I=S.current)==null||I.destroy()}},[T,a,l,u,d,c,v,b,m,f]);const C=T.split("-");return G.jsx("div",{className:Ye(["react-flow__resize-control","nodrag",...C,n,i]),ref:k,style:{...r,scale:E,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:o})}R.memo(YV);export{c8 as B,d8 as C,SM as D,Ol as H,XV as M,t8 as N,ae as P,ie as R,ZV as a,qV as b,QV as c,nb as d,KV as e,a8 as f,s8 as g,h8 as h,l8 as i,G as j,yi as k,Tl as l,u8 as m,Xp as n,lu as o,r8 as p,e8 as q,R as r,i8 as s,JV as t,Ty as u,n8 as v,FN as w,pC as x};
|
package/public/index.html
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<meta name="description" content="ADHDev self-hosted dashboard for controlling AI agents" />
|
|
8
8
|
<link rel="icon" href="/otter-logo.png" />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet" />
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-DW3PmABW.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-CgiI0UIA.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-Bso1b8Lh.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|