import{_ as e}from"./Iog--8e0.js";import{c as a,w as l,A as s,L as t,V as u,P as n,$ as r,M as d,a2 as o,W as i,H as p,u as m,x as c,_ as v,X as y,G as f,O as b}from"./DOfEu912.js";import{j as g}from"./CFjCYvyP.js";import{I as _,j as V,A as x,F as j}from"./CFzYOcUj.js";const k={class:"input-wrapper"},q={key:0,for:"label"},h={class:"relative"},S={key:0,class:"text-desc"},w={key:1},A={class:"absolute top-[48%] -translate-y-1/2 end-5"},I={__name:"BaseSelectInput",props:{items:{type:Array,required:!1,default:()=>[]},name:{type:String,required:!0},label:{type:String,required:!1},placeholder:{type:String,required:!1},value:{type:Object,required:!1},rounded:{type:Boolean,required:!1}},emits:["update:value"],setup(I,{expose:B,emit:C}){const F=I,M=g(F.name),O=a(null);l((()=>O.value),((e,a)=>{e?(M.setValue(e),P("update:value",e)):e!=a&&(M.setValue(null),P("update:value",void 0))}),{deep:!0,immediate:!0}),l((()=>F.value),((e,a)=>{e?(O.value=e,M.setValue(e)):e!=a&&(O.value=null,M.setValue(null))}),{deep:!0,immediate:!0});B({emptyInput:()=>{O.value=null}});const P=C;return(a,l)=>{const g=e,B=s("VeeErrorMessage"),C=s("VeeField");return t(),u(C,{name:I.name},{default:n((({field:e,meta:a})=>[r("div",k,[I.label?(t(),d("label",q,o(I.label),1)):i("",!0),r("div",h,[p(m(_),{modelValue:m(O),"onUpdate:modelValue":l[1]||(l[1]=e=>c(O)?O.value=e:null)},{default:n((()=>[p(m(V),{class:v(I.rounded?"!rounded-full !px-6":"")},{default:n((()=>{var e,a,s,u;return[I.placeholder&&!(null==(e=m(O))?void 0:e.name)?(t(),d("span",S,o(I.placeholder),1)):i("",!0),(null==(a=m(O))?void 0:a.name)?(t(),d("span",w,o(null==(s=m(O))?void 0:s.name),1)):i("",!0),r("span",A,[p(g,{name:"chevron-down"})]),m(O)&&(null==(u=m(O))?void 0:u.id)?(t(),d("button",{key:2,onClick:l[0]||(l[0]=e=>{e.stopPropagation(),O.value=null}),class:"absolute top-1/2 -translate-y-1/2 end-10"},[p(g,{name:"close-2",class:"text-desc scale-[0.6]"})])):i("",!0)]})),_:1},8,["class"]),p(y,{name:"fade"},{default:n((()=>[p(m(x),null,{default:n((()=>[(t(!0),d(f,null,b(I.items,(e=>(t(),u(m(j),{as:"template",key:e.id,value:e},{default:n((({active:a,selected:l})=>[r("li",{class:v([a&&"bg-primary bg-opacity-20 rounded-lg",l&&"bg-primary bg-opacity-20 rounded-lg"])},o(null==e?void 0:e.name),3)])),_:2},1032,["value"])))),128))])),_:1})])),_:1})])),_:1},8,["modelValue"])])]),p(B,{class:"text-sm text-red-500",name:I.name},null,8,["name"])])),_:1},8,["name"])}}};export{I as _};
