import{a as M}from"./index.17037962789732.js";import"./index.170379627897317.js";import{i as w,E as I}from"./style.1703796278973.js";import{u as U}from"./system.1703796278973.js";import{d as v,k as a,l as E,o as n,x as l,u as r,c as u,a as h,F as S,j as d,B,E as $,D as b}from"./vue.1703796278973.js";const j=window.location.protocol,x=o=>{const e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.defer=!0,e.src=o,e},C=(o="1.0")=>{if(window.AMapUI)return Promise.resolve();const e=x(`${j}//webapi.amap.com/ui/${o}/main-async.js`),i=new Promise(s=>{e.onload=()=>{window.initAMapUI(),s(!0)}});return document.body.append(e),i},O=v({__name:"index",props:{style:Object,class:String,AMapUI:[String,Boolean],center:Array},setup(o){var m;const e=o,s=(m=U().$state.configInfo.amap)==null?void 0:m.apiKey;w({key:s||""});const y=a(),p=a(!1),f=a(null),c=E(()=>"AMapUI"in e||e.AMapUI),A=()=>{const t=typeof e.AMapUI=="string"?e.AMapUI:"1.1";C(t).then(()=>{p.value=!0})};a([]);const k=t=>{f.value=t,c.value&&A()};return(t,z)=>{const _=I,g=M;return n(),l("div",{style:$(e.style||{width:"100%",height:"100%"}),class:b(e.class)},[r(s)?(n(),u(_,{key:0,zooms:[3,20],onInit:k,ref_key:"mapRef",ref:y},{default:h(()=>[r(c)?(n(),l(S,{key:0},[r(p)?d(t.$slots,"default",{key:0}):B("",!0)],64)):d(t.$slots,"default",{key:1})]),_:3},512)):(n(),u(g,{key:1,description:"请配置高德地图key",style:{padding:"20%"}}))],6)}}});export{O as _};
