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