import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{jsx as e}from"react/jsx-runtime";import{makeStyles as n,TextField as o,InputAdornment as i}from"@material-ui/core";import{useCustomShrink as a}from"./effects/index.js";import u from"../../config/theme/palette.mjs.js";var s=["startIcon","endIcon","onFocus","onBlur","InputProps","value","startAdornment","endAdornment"];function p(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function c(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}var l=n((function(t){return{textField:{marginTop:16,marginBottom:8,"& .MuiFormLabel-root":{marginLeft:function(t){return t.startLabelOffset?"".concat(t.startLabelOffset+8,"px"):0},marginRight:function(t){return t.endLabelOffset?"".concat(t.endLabelOffset+8,"px"):0}},"&:hover":{"&.MuiTextField-root .MuiInput-root":{"& .MuiInputAdornment-root svg.MuiSvgIcon-root":{fill:u.primary.contrastText}}},"&.MuiTextField-root .MuiInput-root":{"& .MuiInputAdornment-root svg.MuiSvgIcon-root":{width:16,height:16,fontSize:16,fill:"#DADADA"},"&.Mui-error .MuiInputAdornment-root svg.MuiSvgIcon-root":{fill:"".concat(t.palette.error.main," !important")}},"& .Mui-focused .MuiInputAdornment-root svg.MuiSvgIcon-root":{fill:"".concat(t.palette.primary.main," !important")}},shrunkLabel:{"&.MuiInputLabel-shrink.MuiFormLabel-root":{marginLeft:0}}}})),f=function(t){var n=t.startIcon,u=t.endIcon,p=t.onFocus,f=t.onBlur,m=t.InputProps,d=t.value,b=void 0===d?"":d,I=t.startAdornment,O=t.endAdornment,g=r(t,s),v=a({startIcon:n,endIcon:u,onFocus:p,onBlur:f,value:b,InputProps:m}),h=v.shrink,L=v.onInputFocus,M=v.onInputBlur,P=v.startLabelOffset,j=v.endLabelOffset,A=v.startAdornmentRef,y=v.endAdornmentRef,F=l({startLabelOffset:P,endLabelOffset:j});return e(o,c(c({},g),{},{variant:g.variant,onFocus:L,onBlur:M,value:b,classes:{root:F.textField},InputLabelProps:c({shrink:h,classes:{shrink:F.shrunkLabel}},t.InputLabelProps),InputProps:c({startAdornment:n?e(i,{position:"start",ref:A,children:n}):I,endAdornment:u?e(i,{position:"end",ref:y,children:u}):O},t.InputProps)}))};export{f as default};
//# sourceMappingURL=index.js.map
