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