
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * https://fantastic-admin.hurui.me
 */
  
import{C as e}from"./reactivity.esm-bundler-D9OPVc9J.js";import{Ht as t,St as n,_ as r,b as i,bt as a,et as o,mt as s,o as c,qt as l,v as u,xt as d,y as f}from"./runtime-core.esm-bundler-D-xeQwTN.js";import{w as p}from"./runtime-dom.esm-bundler-Dnva3vcP.js";var m=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`,`onMouseover`],h=[`x`,`y`,`height`,`width`,`onClick`,`onMouseover`],g={__name:`RecursiveCircles`,props:{color:{type:String,default:`#000000`},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null},linkColor:{type:String,default:`#CCCCCC`},stroke:{type:String,default:`#FFFFFF`},strokeHovered:{type:String,default:`#000000`}},emits:[`click`,`hover`],setup(g,{emit:_}){let v=g,y=_;function b(e){y(`click`,e)}function x(e){y(`hover`,e)}let S=e([]);return t(()=>v.dataset,e=>{S.value=e||[]},{immediate:!0}),(e,t)=>{let _=n(`RecursiveCircles`,!0);return s(!0),i(c,null,a(g.dataset,(n,v)=>(s(),i(c,null,[n.polygonPath&&n.polygonPath.coordinates?(s(),i(c,{key:0},[(s(!0),i(c,null,a(n.polygonPath.coordinates,(a,l)=>(s(),i(c,{key:`node_${v}_${l}`},[d(e.$slots,`node-svg`,{nodeSvg:{x:a.x,y:a.y,radius:n.circleRadius,color:n.color,stroke:g.stroke,strokeWidth:n.circleRadius/12,isSelected:g.hoveredUid&&g.hoveredUid===n.uid,onClick:()=>b(n),onEnter:()=>x(n),onLeave:()=>x(null)}},()=>[r(`circle`,{cx:a.x,cy:a.y,r:n.circleRadius,fill:`url(#gradient_${n.color})`,stroke:g.hoveredUid&&g.hoveredUid===n.uid?g.strokeHovered:g.stroke,"stroke-width":g.hoveredUid&&g.hoveredUid===n.uid?n.circleRadius/6:n.circleRadius/12,style:{cursor:`pointer`},onClick:e=>b(n),onMouseover:e=>x(n),onMouseleave:t[0]||(t[0]=e=>x(null))},null,40,m)]),e.$slots.node?(s(),i(`foreignObject`,{key:0,x:a.x-n.circleRadius,y:a.y-n.circleRadius,height:n.circleRadius*2,width:n.circleRadius*2,style:{overflow:`visible`},onClick:p(e=>b(n),[`stop`]),onMouseover:e=>x(n),onMouseleave:t[1]||(t[1]=e=>x(null))},[d(e.$slots,`node`,o({ref_for:!0},{node:n}))],40,h)):f(``,!0)],64))),128)),n.nodes&&n.nodes.length>0?(s(),u(_,{key:0,dataset:n.nodes,color:g.color,stroke:g.stroke,strokeHovered:g.strokeHovered,hoveredUid:g.hoveredUid,onClick:b,onHover:x},{node:l(({node:t})=>[d(e.$slots,`node`,o({ref_for:!0},{node:t}))]),"node-svg":l(({nodeSvg:t})=>[d(e.$slots,`node-svg`,o({ref_for:!0},{nodeSvg:t}))]),_:2},1032,[`dataset`,`color`,`stroke`,`strokeHovered`,`hoveredUid`])):f(``,!0)],64)):f(``,!0)],64))),256)}}};export{g as default};