import{f as e,g as a,V as s,W as t,bN as r,a3 as o,c as n,o as i,b as d,L as l,a2 as p}from"./vendor.js?ver=3.1.0";import{_ as c}from"./fc-bits-ui.js?ver=3.1.0";const h={class:"echart-container-wrapper"},u={key:0,class:"fcrm-chart-placeholder"};const v=c({name:"FreshChart",props:{options:{type:Object,default:null},height:{type:[Number,String],default:400}},setup(n){const i=e(null);let d=null;const l=a(()=>!!n.options&&(!!Array.isArray(n.options.series)&&n.options.series.some(e=>Array.isArray(e.data)&&e.data.length>0))),p=()=>{d&&d.resize()};return s(()=>{i.value&&(d=r(i.value),d.setOption(n.options||{},!0),window.addEventListener("resize",p))}),t(()=>n.options,e=>{i.value&&(d||(d=r(i.value),window.addEventListener("resize",p)),e&&d.setOption(e,!0))},{deep:!0}),o(()=>{d&&(window.removeEventListener("resize",p),d.dispose())}),{chartRef:i,hasData:l}}},[["render",function(e,a,s,t,r,o){return i(),n("div",h,[d("div",{ref:"chartRef",class:"chart-container",style:p("height:"+s.height+"px;")},null,4),t.hasData?l("",!0):(i(),n("div",u," Chart placeholder (ECharts not loaded or data is empty) "))])}],["__scopeId","data-v-5d01edb6"]]);export{v as E};
