
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * https://fantastic-admin.hurui.me
 */
  
import{Ct as e,bt as t}from"./reactivity.esm-bundler-D9OPVc9J.js";import{b as n,g as r,mt as i,y as a}from"./runtime-core.esm-bundler-D-xeQwTN.js";import{St as o,pt as s}from"./lib-C-QGo8GG-CvPpiVvZ.js";import{t as c}from"./_plugin-vue_export-helper-B3ysoDQm-BDNMzG2s.js";var l=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],u=[`d`,`fill`,`stroke`,`stroke-width`],d=[`points`,`fill`,`stroke`,`stroke-width`],f=c({__name:`Shape`,props:{color:String,isSelected:{type:Boolean,default:!1},limit:{type:Number,default:3},plot:Object,radius:Number,shape:String,stroke:String,strokeWidth:Number,zoom:{type:Number,default:1.3},transition:{type:String},still:{type:Boolean}},emits:[`mouseover`,`mouseout`,`click`],setup(c,{emit:f}){let p=c,m=f;function h(e){return{circle:{points:1,rotation:0},line:{points:2,rotation:0},triangle:{points:3,rotation:.52},square:{points:4,rotation:.783},diamond:{points:4,rotation:0},pentagon:{points:5,rotation:.95},hexagon:{points:6,rotation:0}}[e]}let g=r(()=>h(p.shape)),_=r(()=>p.shape===`star`?o({plot:{x:p.plot.x,y:p.plot.y},radius:p.radius*(p.isSelected?p.zoom:1)}):null),v=r(()=>s({plot:{x:p.plot.x,y:p.plot.y},radius:p.radius*(p.isSelected?p.zoom:1),sides:g.value.points,rotation:g.value.rotation}).path);return(r,o)=>(i(),n(`g`,null,[g.value&&g.value.points===1?(i(),n(`circle`,{key:0,class:t([`vdui-shape-circle`,{"vdui-shape-no-transition":c.still}]),cx:c.plot.x,cy:c.plot.y,r:p.radius*(p.isSelected?p.zoom:1),fill:c.color,stroke:c.stroke,"stroke-width":c.strokeWidth,onMouseover:o[0]||(o[0]=e=>m(`mouseover`)),onMouseout:o[1]||(o[1]=e=>m(`mouseout`)),onClick:o[2]||(o[2]=e=>m(`click`)),style:e({transition:c.transition})},null,46,l)):a(``,!0),g.value&&g.value.points>=c.limit?(i(),n(`path`,{key:1,class:t([`vdui-shape-polygon`,{"vdui-shape-no-transition":c.still}]),d:v.value,fill:c.color,stroke:c.stroke,"stroke-width":c.strokeWidth,onMouseover:o[3]||(o[3]=e=>m(`mouseover`)),onMouseout:o[4]||(o[4]=e=>m(`mouseout`)),onClick:o[5]||(o[5]=e=>m(`click`)),style:e({transition:c.transition})},null,46,u)):a(``,!0),_.value?(i(),n(`polygon`,{key:2,class:t([`vdui-shape-star`,{"vdui-shape-no-transition":c.still}]),points:_.value,fill:c.color,stroke:c.stroke,"stroke-width":c.strokeWidth,onMouseover:o[6]||(o[6]=e=>m(`mouseover`)),onMouseout:o[7]||(o[7]=e=>m(`mouseout`)),onClick:o[8]||(o[8]=e=>m(`click`)),style:e({transition:c.transition})},null,46,d)):a(``,!0)]))}},[[`__scopeId`,`data-v-848f7c20`]]);export{f as t};