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