import{ac as e,B as a,ae as t,af as s,ag as n,ah as o,ai as i,aj as r,ak as l,as as u,at as m,an as p,ao as d,ap as v}from"./echarts.js?v=1764233927359";import{d3 as c}from"./naive.js?v=1764233927359";import{k as f,r as h,w as g,o as y,n as j,ap as w,b as _,R as B,V as x,I,U as b}from"./vue.js?v=1764233927359";import"./__commonjsHelpers__.js?v=1764233927359";import"./common.js?v=1764233927359";a([t,s,n,o,i,r,l,u,m,p,d,v]);const z=f({__name:"index",props:{width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"200px"},dataZoom:{type:Boolean,default:!1},option:{type:Object,required:!0}},setup(a,{expose:t}){const s=a,n=h(null);function o(){if(null===n.value)return;let a=e.getInstanceByDom(n.value);null==a&&(a=e.init(n.value)),a.setOption(s.option,!0)}function i(){var a;null!==n.value&&(null==(a=e.getInstanceByDom(n.value))||a.resize())}g(()=>s.option,e=>{e&&j(()=>{o()})},{immediate:!0,deep:!0});const r=w(i,300,{maxWait:800});return y(()=>{j(()=>{o(),window.addEventListener("resize",r)})}),_(()=>{var a;n.value&&(null==(a=e.getInstanceByDom(n.value))||a.dispose(),window.removeEventListener("resize",r))}),t({resize:i,getChart:()=>e.getInstanceByDom(n.value)}),(e,t)=>(x(),B("div",{ref_key:"chartRef",ref:n,style:I({width:b(c)(a.width),height:b(c)(a.height)})},null,4))}});export{z as default};
