"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue");require("echarts-gl");const c=require("lodash"),f=require("./renderPie3d.js"),m=require("../../core/useChart.js"),_={class:"zerov-widget"},b=["id"],w=s.defineComponent({name:"zv-chart-pie-3d"}),O=s.defineComponent({...w,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},emits:["chart-click","chart-dblclick","chart-mousedown","chart-mouseover","chart-mouseout","chart-contextmenu"],setup(u,{expose:d,emit:l}){const e=u,h=l,{id:p,setOption:a,chart:v,renderChart:n,renderData:o}=m.useChart({basicOption:c.cloneDeep(e.basicOption),useEvents:c.cloneDeep(e.useEvents),customRenderData:t=>{t=c.cloneDeep(t),window.SHJDatasourceV2({tId:e.uuid,sources:e.sources,callback:({data:r})=>{try{window.SHJParseEvent(e.useEvents,"dataListener",r);const i=f.getPie3D(r[0].data,t);a(i,"canvas")}catch{window.SHJParseEvent(e.useEvents,"dataListener",null),a(t)}}})},emit:h});return s.watch(()=>e.sources,()=>{e.sources&&e.sources.length>0&&o(e.basicOption)},{deep:!0}),s.watch(()=>c.cloneDeep(e.basicOption),(t,r)=>{c.isEqual(t,r)||n(t)},{deep:!0}),d({getEchartsInstance:()=>v.value,refresh:()=>{e.sources&&e.sources.length>0&&n(e.basicOption),o(e.basicOption)},refreshView:()=>{e.sources&&e.sources.length>0&&n(e.basicOption)},refreshData:()=>{o(e.basicOption)}}),(t,r)=>(s.openBlock(),s.createElementBlock("div",_,[s.createElementVNode("div",{id:s.unref(p),class:"widget"},null,8,b)]))}});exports.default=O;
