import{d as S,r as _,w as f,f as g,_ as V,o as u,c as m,a as r,l as n,k as v,F as b,v as y,q as h,t as G}from"./app-DZcRemIr.js";import{S as w,a as x,b as k,c as C,d as q}from"./SelectValue-CSZtknPb.js";import{S as T}from"./GlobalTable-DcNRAfk4.js";const B=S({__name:"GlobalSelect",props:{modelValue:{type:null,required:!1},options:{type:Array,required:!0},placeholder:{type:String,required:!1}},emits:["update:modelValue"],setup(s,{expose:d,emit:o}){d();const e=s,c=o,a=_(e.modelValue??null);f(()=>e.modelValue,t=>{t!==void 0&&(a.value=t)});const l=t=>{a.value=t,c("update:modelValue",t)},p=g(()=>(e.options||[]).map(t=>typeof t=="string"?{id:t,nombre:t}:t)),i={props:e,emit:c,internalValue:a,updateValue:l,normalizedOptions:p,get Select(){return q},get SelectContent(){return C},get SelectGroup(){return T},get SelectItem(){return k},get SelectTrigger(){return x},get SelectValue(){return w}};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}});function I(s,d,o,e,c,a){return u(),m(e.Select,{"model-value":e.internalValue,"onUpdate:modelValue":e.updateValue},{default:r(()=>[n(e.SelectTrigger,null,{default:r(()=>[n(e.SelectValue,{placeholder:o.placeholder??"Seleccionar"},null,8,["placeholder"])]),_:1}),n(e.SelectContent,null,{default:r(()=>[n(e.SelectGroup,null,{default:r(()=>[(u(!0),v(b,null,y(e.normalizedOptions,l=>(u(),m(e.SelectItem,{key:l.id,value:l.id},{default:r(()=>[h(G(l.nombre),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["model-value"])}const F=V(B,[["render",I],["__file","/var/www/resources/js/components/GlobalSelect.vue"]]);export{F as G};
