import{o as e}from"./chunk.DuxOD-Sk.js";import{r as t}from"./emotion-is-prop-valid.esm.DV_OErv-.js";import{C as n,w as r}from"./getColors.DUygtxH4.js";import{F as i,M as a,P as o}from"./src.sR_9Xh2m.js";import{c as s,i as c,r as l,t as u}from"./base-input.CEBMxrUv.js";var d=e(t());r();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(e){D(r,e);var t=k(r);function r(){var e;w(this,r);var n=[...arguments];return e=t.call.apply(t,[this].concat(n)),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(r,[{key:`render`,value:function(){var e=this.props,t=e.startEnhancer,r=e.endEnhancer,i=e.overrides,a=i.Root,f=i.StartEnhancer,_=i.EndEnhancer,v=S(i,p),y=S(e,m),b=g(n(a,c),2),x=b[0],C=b[1],w=g(n(f,l),2),T=w[0],E=w[1],D=g(n(_,l),2),O=D[0],k=D[1],A=s(this.props,this.state);return d.createElement(x,h({"data-baseweb":`input`},A,C,{$adjoined:I(t,r),$hasIconTrailing:this.props.clearable||this.props.type==`password`}),L(t)&&d.createElement(T,h({},A,E,{$position:o.start}),typeof t==`function`?t(A):t),d.createElement(u,h({},y,{overrides:v,adjoined:I(t,r),onFocus:this.onFocus,onBlur:this.onBlur})),L(r)&&d.createElement(O,h({},A,k,{$position:o.end}),typeof r==`function`?r(A):r))}}]),r}(d.Component);P(F,`defaultProps`,{autoComplete:`on`,autoFocus:!1,disabled:!1,name:``,onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:i.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:`text`,readOnly:!1});function I(e,t){return L(e)&&L(t)?a.both:L(e)?a.left:L(t)?a.right:a.none}function L(e){return!!(e||e===0)}export{F as t};