import{_ as x}from"./NodeMenu-Cz3qSbB5.js";import{d as M,N as g,bg as N,b3 as G,dI as b,a$ as E,o as t,c as r,a as S,w as B,f as C,t as V,cg as W,s as e,n as H,v as a,F as $,r as z,aY as w}from"./index-lT0LPxUj.js";import{u as A}from"./networkGraphStore-DCNH56J4.js";const F={style:{width:"100%",height:"100%"}},R={style:{width:"320px"}},T=e("rect",{id:"workspaceHandler",width:"100%",height:"100%"},null,-1),Y={id:"networkWorkspace"},D=e("g",{class:"grid no-print"},null,-1),I={id:"network"},P=["id"],U={key:0,d:"M10,2L14,4L10,6",fill:"transparent",stroke:"currentcolor"},X={key:1,fill:"currentcolor",r:"2",stroke:"currentcolor",transform:"translate(12,4)"},j={key:2,d:"M10,2L14,4L10,6L10,2L14,4",fill:"currentcolor",stroke:"currentcolor"},q={key:3,fill:"transparent",r:"4",stroke:"currentcolor",transform:"translate(5,5)"},J=e("text",{dx:"8",dy:"5"},null,-1),K={class:"dragline"},O=e("g",{id:"nodeGroups"},null,-1),Q=e("g",{id:"modelAssigned"},null,-1),Z=e("g",{id:"connections"},null,-1),ee=e("g",{id:"nodes"},null,-1),te=e("g",{id:"nodeAddPanel"},null,-1),ae=M({__name:"NetworkGraph",props:{network:{}},setup(v){const l=A(),y=v,L=g(()=>y.network),s=g(()=>l.state.graph),d=N(null);return G(()=>{l.mount(new b(d,L.value))}),E(()=>{l.unmount()}),(oe,i)=>{var c,u,h,_,k,p,f,m;return t(),r("div",F,[S(W,{onClick:i[0]||(i[0]=o=>{var n;return(n=s.value)==null?void 0:n.updateHash()}),size:"small",variant:"text"},{default:B(()=>{var o;return[C(V((o=s.value)==null?void 0:o.hash),1)]}),_:1}),e("div",R,[(c=s.value)!=null&&c.state.nodeMenu.node?(t(),H(x,{key:0,"model-value":(u=s.value)==null?void 0:u.state.nodeMenu.open,node:(h=s.value)==null?void 0:h.state.nodeMenu.node,offset:(_=s.value)==null?void 0:_.state.nodeMenu.offset},null,8,["model-value","node","offset"])):a("",!0)]),(t(),r("svg",{class:"networkGraph",height:"100%",ref_key:"networkGraphRef",ref:d,width:"100%"},[T,e("g",Y,[D,e("g",I,[(t(),r("g",{key:(k=s.value)==null?void 0:k.network.connections.all.length,class:"synMarker"},[(t(!0),r($,null,z((p=s.value)==null?void 0:p.network.connections.all,(o,n)=>(t(),r("defs",{key:"defs"+n,style:w({color:"var(--node"+o.source.idx+"-color)"})},[(t(),r("marker",{key:o.hash,id:"syn-"+n,markerHeight:"8",markerWidth:"16",orient:"auto",refX:"14",refY:"4"},[o.view.markerEndLabel==="generic"?(t(),r("path",U)):a("",!0),o.view.markerEndLabel==="inh"?(t(),r("circle",X)):a("",!0),o.view.markerEndLabel==="exc"?(t(),r("path",j)):a("",!0),o.view.markerEndLabel==="assigned"?(t(),r("circle",q)):a("",!0),J],8,P))],4))),128))])),e("g",K,[e("path",{style:w({strokeWidth:(m=(f=s.value)==null?void 0:f.config)==null?void 0:m.localStorage.strokeWidth}),d:"M0,0L0,0",fill:"none"},null,4)]),O,Q,Z,ee]),te])],512))])}}});export{ae as _};
