import{_ as e}from"./common.js?v=1763625242172";import"./interface.js?v=1763625242172";import{d3 as t}from"./naive.js?v=1763625242172";import{k as a,r as s,w as n,n as i,o,b as r,R as l,S as u,I as m,V as p,ap as d}from"./vue.js?v=1763625242172";import{a4 as c}from"./echarts.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const f=a({__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:f}){const v=a,h=s(null);let w=!0;function y(){var e;null!==h.value&&(null==(e=c.getInstanceByDom(h.value))||e.resize())}n((()=>v.option),(t=>{t&&i((()=>{!async function(){if(w){const{data:t}=await e.get("/static/vite/data/world.json");c.registerMap("world",t),w=!1}if(null===h.value)return;let t=c.getInstanceByDom(h.value);null==t&&(t=c.init(h.value)),t.setOption(v.option,!0)}()}))}),{immediate:!0,deep:!0});const g=d(y,300,{maxWait:800});return o((async()=>{window.addEventListener("resize",g)})),r((()=>{var e;h.value&&(null==(e=c.getInstanceByDom(h.value))||e.dispose(),window.removeEventListener("resize",g))})),f({resize:y}),(e,s)=>(l(),u("div",{ref_key:"chartRef",ref:h,style:m({width:p(t)(a.width),height:p(t)(a.height)})},null,4))}});export{f as default};
