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