var x=Object.defineProperty;var k=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var w=(r,t,n)=>t in r?x(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,z=(r,t)=>{for(var n in t||(t={}))C.call(t,n)&&w(r,n,t[n]);if(k)for(var n of k(t))b.call(t,n)&&w(r,n,t[n]);return r};import{useTimeoutFn as c}from"./useTimeout-KpZCXEcl.js";import{B as y,m as B,x as H,ak as R,v as S}from"./index-CLZzJyTP.js";import{e as D,f as T,w as h,u as i,n as L}from"./vue-vendor-CxLCUzY4.js";import{e as O}from"./echarts-3CSrakfu.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";function N(r,t="default"){const{getDarkMode:n}=y(),u=D(()=>t==="default"?n.value:t);let e=null,l=v;const a=T({});let d=()=>{};l=S(v,200);const g=D(()=>u.value!=="dark"?a.value:z({backgroundColor:"transparent"},a.value));function m(s=t){const o=i(r);if(!o||!i(o))return;e=O.init(o,s);const{removeEvent:f}=H({el:window,name:"resize",listener:l});d=f;const{widthRef:F,screenEnum:M}=R();(i(F)<=M.MD||o.offsetHeight===0)&&c(()=>{l()},30)}function p(s,o=!0){var f;if(a.value=s,((f=i(r))==null?void 0:f.offsetHeight)===0){c(()=>{p(i(g))},30);return}L(()=>{c(()=>{!e&&(m(u.value),!e)||(o&&(e==null||e.clear()),e==null||e.setOption(i(g)))},30)})}function v(){e==null||e.resize()}h(()=>u.value,s=>{e&&(e.dispose(),m(s),p(a.value))}),B(()=>{e&&(d(),e.dispose(),e=null)});function E(){return e||m(u.value),e}return{setOptions:p,resize:v,echarts:O,getInstance:E}}export{N as useECharts};
