import{d as f,a8 as _,i as s,q as g,E as h,s as w,o as b,a as C,b as l,P}from"./index.29cf2edd.js";/* empty css              */const y=f({__name:"ProvinceSelection",props:{value:{type:Number}},emits:["change"],setup(i,{emit:c}){const t=i;_();const n=s();let r=s(),o=s();g(async()=>{await u(),t.value&&(n.value=t.value)});const u=async()=>{o.value=!0,await h.getProvinces().then(e=>{r.value=e.data.map(a=>({id:a.id,name:a.name.us})),o.value=!1}).catch(e=>{o.value=!1})},p=(e,a)=>a.name.toLowerCase().indexOf(e.toLowerCase())>=0,v=()=>{c("change",n.value)};return w(()=>t.value,e=>{e&&(n.value=e),e||(n.value=null)}),(e,a)=>{const d=P;return b(),C(d,{value:n.value,"onUpdate:value":a[0]||(a[0]=m=>n.value=m),"show-search":"",placeholder:"Choose a province",options:l(r),"field-names":{label:"name",value:"id"},"filter-option":p,loading:l(o),disabled:l(o),onChange:v,"clear-icon":"","allow-clear":""},null,8,["value","options","loading","disabled"])}}});export{y as _};
