import{u as i}from"./uid.KLLbMoZc.js";import{u as j}from"./index.g8c07QCY.js";import{H as n,r as b,k,v as z}from"./entry.RGd0w9hd.js";const D=(a,v)=>{const t=n("form-events",void 0),e=n("form-group",void 0),F=n("form-inputs",void 0),d=b(a==null?void 0:a.id);k(()=>{d.value=(a==null?void 0:a.legend)===null||a.legend?void 0:(a==null?void 0:a.id)??i(),e&&(e.inputId.value=d.value,F&&(F.value[e.name.value]=d))});const I=b(!1);function c(l,m){t&&t.emit({type:l,path:m})}function h(){c("blur",e==null?void 0:e.name.value),I.value=!0}function B(){c("change",e==null?void 0:e.name.value)}const g=j(()=>{(I.value||e!=null&&e.eagerValidation.value)&&c("input",e==null?void 0:e.name.value)},300);return{inputId:d,name:z(()=>(a==null?void 0:a.name)??(e==null?void 0:e.name.value)),size:z(()=>{var m;const l=v.size[e==null?void 0:e.size.value]?e==null?void 0:e.size.value:null;return(a==null?void 0:a.size)??l??((m=v==null?void 0:v.default)==null?void 0:m.size)}),color:z(()=>{var l;return(l=e==null?void 0:e.error)!=null&&l.value?"red":a==null?void 0:a.color}),emitFormBlur:h,emitFormInput:g,emitFormChange:B}};export{D as u};
