import{w as c,u as h}from"./ui.config.7ae255de.js";import{E as v,G as y,g as S,C as k,j as l,r as $,z as C,o as a,c as s,y as r,a as z,t as o,l as i,H as B,I as j,J as G,K as q}from"./entry.9e31e8a4.js";import{_ as w}from"./_plugin-vue_export-helper.c27b6911.js";const u=v(y.ui.strategy,y.ui.formGroup,c);let p=0;const E=S({inheritAttrs:!1,props:{name:{type:String,default:null},size:{type:String,default:null,validator(e){return Object.keys(u.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:void 0}},setup(e){const{ui:n,attrs:f}=h("formGroup",e.ui,u,{mergeWrapper:!0}),d=k("form-errors",null),t=l(()=>e.error&&typeof e.error=="string"||typeof e.error=="boolean"?e.error:d?.value?.find(b=>b.path===e.name)?.message),m=l(()=>n.value.size[e.size??u.default.size]),g=$(`${e.name||"lf"}-${p=p<1e6?p+1:0}`);return C("form-group",{error:t,labelFor:g,name:l(()=>e.name),size:l(()=>e.size)}),{ui:n,attrs:f,labelFor:g,size:m,error:t}}}),P=["for"];function F(e,n,f,d,t,m){return a(),s("div",q({class:e.ui.wrapper},e.attrs),[e.label?(a(),s("div",{key:0,class:r([e.ui.label.wrapper,e.size])},[z("label",{for:e.labelFor,class:r([e.ui.label.base,e.required?e.ui.label.required:""])},o(e.label),11,P),e.hint?(a(),s("span",{key:0,class:r([e.ui.hint])},o(e.hint),3)):i("",!0)],2)):i("",!0),e.description?(a(),s("p",{key:1,class:r([e.ui.description,e.size])},o(e.description),3)):i("",!0),z("div",{class:r([e.label?e.ui.container:""])},[B(e.$slots,"default",j(G({error:e.error}))),typeof e.error=="string"&&e.error?(a(),s("p",{key:0,class:r([e.ui.error,e.size])},o(e.error),3)):e.help?(a(),s("p",{key:1,class:r([e.ui.help,e.size])},o(e.help),3)):i("",!0)],2)],16)}const V=w(E,[["render",F]]);export{V as default};
