import{c as e,i as t,r as n,t as r}from"./base-input.Bg_42oFt.js";import{Et as i,Gr as a,Ot as o,Qa as s,Wr as c,io as l,kt as u}from"./index.dkY5s53S.js";var d=l(s());a();function f(e){"@babel/helpers - typeof";return f=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},f(e)}var p=[`Root`,`StartEnhancer`,`EndEnhancer`],m=[`startEnhancer`,`endEnhancer`,`overrides`];function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function g(e,t){return x(e)||b(e,t)||v(e,t)||_()}function _(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(e,t){if(e){if(typeof e==`string`)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}}function y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function x(e){if(Array.isArray(e))return e}function S(e,t){if(e==null)return{};var n=C(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function C(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function w(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function D(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&O(e,t)}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function k(e){var t=M();return function(){var n=N(e),r;if(t){var i=N(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return A(this,r)}}function A(e,t){if(t&&(f(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return j(e)}function j(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function M(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function N(e){return N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},N(e)}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F=function(i){D(s,i);var a=k(s);function s(){var e;w(this,s);var t=[...arguments];return e=a.call.apply(a,[this].concat(t)),P(j(e),`state`,{isFocused:e.props.autoFocus||!1}),P(j(e),`onFocus`,function(t){e.setState({isFocused:!0}),e.props.onFocus(t)}),P(j(e),`onBlur`,function(t){e.setState({isFocused:!1}),e.props.onBlur(t)}),e}return E(s,[{key:`render`,value:function(){var i=this.props,a=i.startEnhancer,s=i.endEnhancer,l=i.overrides,u=l.Root,f=l.StartEnhancer,_=l.EndEnhancer,v=S(l,p),y=S(i,m),b=g(c(u,t),2),x=b[0],C=b[1],w=g(c(f,n),2),T=w[0],E=w[1],D=g(c(_,n),2),O=D[0],k=D[1],A=e(this.props,this.state);return d.createElement(x,h({"data-baseweb":`input`},A,C,{$adjoined:I(a,s),$hasIconTrailing:this.props.clearable||this.props.type==`password`}),L(a)&&d.createElement(T,h({},A,E,{$position:o.start}),typeof a==`function`?a(A):a),d.createElement(r,h({},y,{overrides:v,adjoined:I(a,s),onFocus:this.onFocus,onBlur:this.onBlur})),L(s)&&d.createElement(O,h({},A,k,{$position:o.end}),typeof s==`function`?s(A):s))}}]),s}(d.Component);P(F,`defaultProps`,{autoComplete:`on`,autoFocus:!1,disabled:!1,name:``,onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:u.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:`text`,readOnly:!1});function I(e,t){return L(e)&&L(t)?i.both:L(e)?i.left:L(t)?i.right:i.none}function L(e){return!!(e||e===0)}export{F as t};