import{q as e,k as s,c4 as a,v as t,W as r,X as o,Z as n,$ as i,a8 as d,r as l,d as p}from"./vendor.js?ver=3.1.8";import{_ as c}from"./fc-bits-ui.js?ver=3.1.8";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(r){const o=l(null);let n=null;const i=p(()=>!!r.options&&(!!Array.isArray(r.options.series)&&r.options.series.some(e=>Array.isArray(e.data)&&e.data.length>0))),d=()=>{n&&n.resize()};return e(()=>{o.value&&(n=a(o.value),n.setOption(r.options||{},!0),window.addEventListener("resize",d))}),s(()=>r.options,e=>{o.value&&(n||(n=a(o.value),window.addEventListener("resize",d)),e&&n.setOption(e,!0))},{deep:!0}),t(()=>{n&&(window.removeEventListener("resize",d),n.dispose())}),{chartRef:o,hasData:i}}},[["render",function(e,s,a,t,l,p){return r(),o("div",h,[n("div",{ref:"chartRef",class:"chart-container",style:i("height:"+a.height+"px;")},null,4),t.hasData?d("",!0):(r(),o("div",u," Chart placeholder (ECharts not loaded or data is empty) "))])}],["__scopeId","data-v-5d01edb6"]]);export{v as E};
