import{J as d,ak as F,C as re,P as le,r as ue,L as se,Q as de,N as ve,f as w,H as ce,O as fe,T as M,V as pe}from"./entry.fce5ecd9.js";import{i as be,I as he}from"./Input.20a1c56d.js";import{_ as me}from"./index.566ce5c5.js";import{c as _e}from"./isEqual.3e15c2b9.js";import{i as ye}from"./isPlainObject.e5346bab.js";var k=/iPhone/i,D=/iPod/i,U=/iPad/i,$=/\bAndroid(?:.+)Mobile\b/i,V=/Android/i,c=/\bAndroid(?:.+)SD4930UR\b/i,A=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,W=/\bWindows(?:.+)ARM\b/i,H=/BlackBerry/i,J=/BB10/i,K=/Opera Mini/i,L=/\b(CriOS|Chrome)(?:.+)Mobile/i,Q=/Mobile(?:.+)Firefox\b/i;function t(_,e){return _.test(e)}function Z(_){var e=_||(typeof navigator<"u"?navigator.userAgent:""),r=e.split("[FBAN");if(typeof r[1]<"u"){var l=r,y=F(l,1);e=y[0]}if(r=e.split("Twitter"),typeof r[1]<"u"){var x=r,v=F(x,1);e=v[0]}var n={apple:{phone:t(k,e)&&!t(u,e),ipod:t(D,e),tablet:!t(k,e)&&t(U,e)&&!t(u,e),device:(t(k,e)||t(D,e)||t(U,e))&&!t(u,e)},amazon:{phone:t(c,e),tablet:!t(c,e)&&t(A,e),device:t(c,e)||t(A,e)},android:{phone:!t(u,e)&&t(c,e)||!t(u,e)&&t($,e),tablet:!t(u,e)&&!t(c,e)&&!t($,e)&&(t(A,e)||t(V,e)),device:!t(u,e)&&(t(c,e)||t(A,e)||t($,e)||t(V,e))||t(/\bokhttp\b/i,e)},windows:{phone:t(u,e),tablet:t(W,e),device:t(u,e)||t(W,e)},other:{blackberry:t(H,e),blackberry10:t(J,e),opera:t(K,e),firefox:t(Q,e),chrome:t(L,e),device:t(H,e)||t(J,e)||t(K,e)||t(Q,e)||t(L,e)},any:null,phone:null,tablet:null};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var ge=d(d({},Z()),{},{isMobile:Z});const Ae=ge;var xe=["disabled","loading","addonAfter","suffix"];const $e=re({compatConfig:{MODE:3},name:"AInputSearch",inheritAttrs:!1,props:d(d({},be()),{},{inputPrefixCls:String,enterButton:le.any,onSearch:{type:Function}}),setup:function(e,r){var l=r.slots,y=r.attrs,x=r.expose,v=r.emit,n=ue(),q=function(){var a;(a=n.value)===null||a===void 0||a.focus()},G=function(){var a;(a=n.value)===null||a===void 0||a.blur()};x({focus:q,blur:G});var X=function(a){v("update:value",a.target.value),a&&a.target&&a.type==="click"&&v("search",a.target.value,a),v("change",a)},T=function(a){var o;document.activeElement===((o=n.value)===null||o===void 0?void 0:o.input)&&a.preventDefault()},C=function(a){var o;v("search",(o=n.value)===null||o===void 0?void 0:o.stateValue,a),Ae.tablet||n.value.focus()},g=se("input-search",e),f=g.prefixCls,Y=g.getPrefixCls,ee=g.direction,p=g.size,te=de(function(){return Y("input",e.inputPrefixCls)});return function(){var s,a,o,B,b,N=e.disabled,ae=e.loading,S=e.addonAfter,z=S===void 0?(s=l.addonAfter)===null||s===void 0?void 0:s.call(l):S,R=e.suffix,ne=R===void 0?(a=l.suffix)===null||a===void 0?void 0:a.call(l):R,oe=ve(e,xe),I=e.enterButton,i=I===void 0?(o=(B=l.enterButton)===null||B===void 0?void 0:B.call(l))!==null&&o!==void 0?o:!1:I;i=i||i==="";var P=typeof i=="boolean"?w(me,null,null):null,O="".concat(f.value,"-button"),h=Array.isArray(i)?i[0]:i,m,j=h.type&&ye(h.type)&&h.type.__ANT_BUTTON;if(j||h.tagName==="button")m=_e(h,d({onMousedown:T,onClick:C,key:"enterButton"},j?{class:O,size:p.value}:{}),!1);else{var E=P&&!i;m=w(ce,{class:O,type:i?"primary":void 0,size:p.value,disabled:N,key:"enterButton",onMousedown:T,onClick:C,loading:ae,icon:E?P:null},{default:function(){return[E?null:P||i]}})}z&&(m=[m,z]);var ie=fe(f.value,(b={},M(b,"".concat(f.value,"-rtl"),ee.value==="rtl"),M(b,"".concat(f.value,"-").concat(p.value),!!p.value),M(b,"".concat(f.value,"-with-button"),!!i),b),y.class);return w(he,d(d(d({ref:n},pe(oe,["onUpdate:value","onSearch","enterButton"])),y),{},{onPressEnter:C,size:p.value,prefixCls:te.value,addonAfter:m,suffix:ne,onChange:X,class:ie,disabled:N}),l)}}});export{$e as _};
