import{x as c}from"./index-DfIQY6vp.js";import{R as f}from"./element-plus-C2aeItNs.js";import{l as b,aL as v,r,aK as V,m as g,M as y,K as M,u as n,B as _,R as k}from"./vue-chunks-l-AyUCfi.js";const R=b({__name:"customUrlApi",props:v({formModel:{type:Object,default:()=>({})},modelValue:{type:Object||Array},label:{type:String,default:"name"}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(d){const o=r([]),a=r(!1),i=r(!1);let l=V(d,"modelValue");const u=(t,s)=>{a.value=!0,c({label:t}).then(e=>{a.value=!1;const p=(e.list||[]).map(m=>({label:m.label,value:m.id}));o.value=p}).catch(e=>{a.value=!1,o.value=[]})};return u(),(t,s)=>i.value?k("",!0):(g(),y(n(f),M({key:0,modelValue:n(l),"onUpdate:modelValue":s[0]||(s[0]=e=>_(l)?l.value=e:l=e),loading:a.value,filterable:"",remote:""},t.$attrs,{options:o.value,"remote-method":u}),null,16,["modelValue","loading","options"]))}});export{R as _};
