"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),c=require("lodash"),v=require("../../commons/core/datasource/index.js"),_=require("../../commons/core/useChart.js"),b={class:"zerov-widget"},E=["id"],O=s.defineComponent({name:"zv-chart-map-bmap-rich"}),w=s.defineComponent({...O,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:i,chart:m,renderChart:a,renderData:n}=_.useChart({basicOption:c.cloneDeep(e.basicOption),useEvents:c.cloneDeep(e.useEvents),customRenderData:t=>{t=c.cloneDeep(t),v.SHJDatasourceV2.parse({tId:e.uuid,sources:e.sources,callback:r=>{try{window.SHJParseEvent(e.useEvents,"dataListener",r.data);const o=t.series.find(f=>f._sourceId===r.id);o&&(o.data=r.data[0].data),i(t)}catch{window.SHJParseEvent(e.useEvents,"dataListener",null),i(t)}}})},emit:h});return s.watch(()=>e.sources,()=>{n(e.basicOption)},{deep:!0}),s.watch(()=>c.cloneDeep(e.basicOption),(t,r)=>{c.isEqual(t,r)||a(t)},{deep:!0}),d({getEchartsInstance:()=>m.value,refresh:()=>{e.sources&&e.sources.length>0&&a(e.basicOption),n(e.basicOption)},refreshView:()=>{e.sources&&e.sources.length>0&&a(e.basicOption)},refreshData:()=>{n(e.basicOption)}}),(t,r)=>(s.openBlock(),s.createElementBlock("div",b,[s.createElementVNode("div",{id:s.unref(p),class:"widget"},null,8,E)]))}});exports.default=w;
