const e=require("../_util/classNames.js"),t=require("../_util/vnode.js"),n=require("./inputProps.js"),r=require("./utils/commonUtils.js");let i=require("vue");var a=(0,i.defineComponent)({name:`BaseInput`,inheritAttrs:!1,props:n.baseInputProps(),setup(n,{slots:a,attrs:o}){let s=(0,i.ref)(),c=e=>{if(s.value?.contains(e.target)){let{triggerFocus:e}=n;e?.()}},l=()=>{let{allowClear:t,value:r,disabled:o,readonly:s,handleReset:c,suffix:l=a.suffix,prefixCls:u}=n;if(!t)return null;let d=!o&&!s&&r,f=`${u}-clear-icon`,p=a.clearIcon?.()||`*`;return(0,i.createVNode)(`span`,{onClick:c,onMousedown:e=>e.preventDefault(),class:e.default({[`${f}-hidden`]:!d,[`${f}-has-suffix`]:!!l},f),role:`button`,tabindex:-1},[p])};return()=>{let{focused:u,value:d,disabled:f,allowClear:p,readonly:m,hidden:h,prefixCls:g,prefix:_=a.prefix?.(),suffix:v=a.suffix?.(),addonAfter:y=a.addonAfter,addonBefore:b=a.addonBefore,inputElement:x,affixWrapperClassName:S,wrapperClassName:C,groupClassName:w}=n,T=t.cloneElement(x,{value:d,hidden:h});if(r.hasPrefixSuffix({prefix:_,suffix:v,allowClear:p})){let n=`${g}-affix-wrapper`,a=e.default(n,{[`${n}-disabled`]:f,[`${n}-focused`]:u,[`${n}-readonly`]:m,[`${n}-input-with-clear-btn`]:v&&p&&d},!r.hasAddon({addonAfter:y,addonBefore:b})&&o.class,S),C=(v||p)&&(0,i.createVNode)(`span`,{class:`${g}-suffix`},[l(),v]);T=(0,i.createVNode)(`span`,{class:a,style:o.style,hidden:!r.hasAddon({addonAfter:y,addonBefore:b})&&h,onMousedown:c,ref:s},[_&&(0,i.createVNode)(`span`,{class:`${g}-prefix`},[_]),t.cloneElement(x,{style:null,value:d,hidden:null}),C])}if(r.hasAddon({addonAfter:y,addonBefore:b})){let n=`${g}-group`,r=`${n}-addon`,a=e.default(`${g}-wrapper`,n,C);return(0,i.createVNode)(`span`,{class:e.default(`${g}-group-wrapper`,o.class,w),style:o.style,hidden:h},[(0,i.createVNode)(`span`,{class:a},[b&&(0,i.createVNode)(`span`,{class:r},[b]),t.cloneElement(T,{style:null,hidden:null}),y&&(0,i.createVNode)(`span`,{class:r},[y])])])}return T}}});exports.default=a;