import{h as t}from"./p-d7041ce0.js";import{v as e,d as a}from"./p-afb19483.js";const l=(l,o)=>{let s="";const n=()=>({el:l.el,disabled:l.disabled,hasFocus:l.hasFocus,hover:l.hover,label:l.label,tooltip:l.tooltip,validation:l.validation,info:l.info}),r=async(t=!1)=>{const a=n();if(!a.validation)return[];const l={label:a.label||"",name:a.name||""},r=await e.validate(a.validation,a.el,l);return!t&&o&&(s=r.length?r[0].message:"",o(s)),r},i=a(r,1e3);return Object.assign((e,a)=>{const l=n();return[null!=l.label&&t("bce-label",{disabled:l.disabled,hasFocus:l.hasFocus,tooltip:l.tooltip,"data-hover":l.hover},l.label),a,(s||l.info)&&t("small",null,s||l.info)]},{getProps:n,handleInput:()=>{s?r():i()},reset:()=>{s="",o&&o(s)},validate:r})};export{l as g};