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