"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),c=require("./index-YwS-u3iG.cjs"),i=e.defineComponent({__name:"MapNavSetting",setup(d){const o=e.computed({get:()=>e.activeWidgetAttrs.value,set:n=>{e.setMapNavAttrs(e.cloneDeep(n))}}),r=e.ref(!1),u=e.ref([]),s=async n=>{if(!(!n||r.value)){r.value=!0;try{const a=await e.useJSONP(`https://apis.map.qq.com/ws/place/v1/suggestion?key=${e.globalInject.qqMapKey}&keyword=${n}&page_index=1&page_size=8`),{data:t}=a;t!=null&&t.length?u.value=t.map(l=>({lng:l.location.lng,lat:l.location.lat,name:l.title,address:l.address})):u.value=[]}catch(a){console.error(a)}finally{r.value=!1}}};return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(c.TitleRow),null,{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((t=e.unref(e.activeWidgetInfo))==null?void 0:t.name)+"设置 ",1)]}),_:1}),e.createVNode(e.unref(c.Row),{label:"设置导航地址",wrap:""},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElSelect),{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value=t),"value-key":"lng",placeholder:o.value.name,filterable:"",remote:"","remote-method":s,loading:r.value,placement:"bottom-end","fit-input-width":!0},{default:e.withCtx(()=>{var t;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((t=u.value)!=null&&t.length?u.value:[o.value],l=>(e.openBlock(),e.createBlock(e.unref(e.ElOption),{key:`${l.lng}-${l.lat}`,label:l.name+" - "+l.address,value:l},null,8,["label","value"]))),128))]}),_:1},8,["modelValue","placeholder","loading"])]),_:1})],64))}});exports.default=i;
