import{g as v,E as r,G as m,j as i,H as g,z,C as h,Q as b,R as y,S as n}from"./entry.eb978f24.js";const S=v({props:{name:{type:String,default:null},size:{type:String,default:null,validator(e){return Object.keys(r.ui.formGroup.size).includes(e)}},label:{type:String,default:null},description:{type:String,default:null},required:{type:Boolean,default:!1},help:{type:String,default:null},error:{type:[String,Boolean],default:null},hint:{type:String,default:null},ui:{type:Object,default:()=>r.ui.formGroup}},setup(e,{slots:s}){const o=m(),l=i(()=>g({},e.ui,o.ui.formGroup));z("form-path",e.name);const c=h("form-errors",null),u=i(()=>e.error&&typeof e.error=="string"?e.error:c?.value?.find(t=>t.path===e.name)?.message),d=i(()=>b(s)),f=i(()=>d.value.map(t=>{const a={};return u.value?(a.oldColor=t.props?.color,a.color="red"):a.oldColor&&(a.color=a.oldColor),e.name&&(a.name=e.name),e.size&&(a.size=e.size),y(t,a)}));return()=>n("div",{class:[l.value.wrapper]},[e.label&&n("div",{class:[l.value.label.wrapper,l.value.size[e.size]]},[n("label",{for:e.name,class:[l.value.label.base,e.required&&l.value.label.required]},e.label),e.hint&&n("span",{class:[l.value.hint]},e.hint)]),e.description&&n("p",{class:[l.value.description,l.value.size[e.size]]},e.description),n("div",{class:[!!e.label&&l.value.container]},[...f.value,u.value?n("p",{class:[l.value.error,l.value.size[e.size]]},u.value):e.help?n("p",{class:[l.value.help,l.value.size[e.size]]},e.help):null])])}});export{S as default};
