import{__rest as t,__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as n}from"react/jsx-runtime";import{makeStyles as r,TextField as e,InputAdornment as i}from"@material-ui/core";import{useCustomShrink as s}from"./effects/index.js";import u from"../../config/theme/palette.mjs.js";var a=r((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}}}})),l=function(r){var u=r.startIcon,l=r.endIcon,f=r.onFocus,m=r.onBlur,p=r.InputProps,d=r.value,c=void 0===d?"":d,I=r.startAdornment,b=r.endAdornment,L=t(r,["startIcon","endIcon","onFocus","onBlur","InputProps","value","startAdornment","endAdornment"]),M=s({startIcon:u,endIcon:l,onFocus:f,onBlur:m,value:c,InputProps:p}),g=M.shrink,v=M.onInputFocus,A=M.onInputBlur,h=M.startLabelOffset,F=M.endLabelOffset,x=M.startAdornmentRef,O=M.endAdornmentRef,P=a({startLabelOffset:h,endLabelOffset:F});return n(e,o({},L,{onFocus:v,onBlur:A,value:c,classes:{root:P.textField},InputLabelProps:o({shrink:g,classes:{shrink:P.shrunkLabel}},r.InputLabelProps),InputProps:o({startAdornment:u?n(i,o({position:"start",ref:x},{children:u})):I,endAdornment:l?n(i,o({position:"end",ref:O},{children:l})):b},r.InputProps)}))};export{l as default};
