import{__rest as e,__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as t,jsx as r}from"react/jsx-runtime";import{useMemo as i}from"react";import{makeStyles as l,FormControl as a,InputLabel as n,Select as u,FormHelperText as d}from"@material-ui/core";import p from"uuid/v4";import c from"classnames";var s=l((function(e){return{formControlRoot:{"& .MuiSelect-icon":{top:"calc(50% - 8px)",right:4},"& .MuiSelect-icon.MuiSelect-iconOutlined":{right:8},"& .MuiSelect-icon.MuiSelect-iconFilled":{right:8},"&:hover":{"& .MuiFormLabel-root, & .MuiInputAdornment-root,  & .MuiSelect-icon > svg > path":{color:e.palette.primary.contrastText},"& .MuiSelect-icon > svg > path":{stroke:e.palette.primary.contrastText,fill:e.palette.primary.contrastText},"& .MuiInput-underline:not(.Mui-disabled), & .MuiFilledInput-underline:not(.Mui-disabled)":{"&::before":{borderBottom:"2px solid ".concat(e.palette.primary.contrastText)}}},"& .MuiInputBase-root.Mui-focused":{"& .MuiSelect-icon > svg > path":{stroke:e.palette.primary.main,fill:e.palette.primary.main}},"& .MuiInput-underline, & .MuiFilledInput-underline":{"&::before":{borderBottom:"1px solid ".concat(e.palette.primary.text6)},"&.Mui-disabled":{"&::before":{opacity:"0.4",borderBottom:"1px solid ".concat(e.palette.primary.text6)},"&::after":{opacity:"0.4"}}},"& .MuiSelect-root":{"&.Mui-disabled":{color:e.palette.primary.contrastText,opacity:"0.4"}},"& .MuiFormLabel-root":{color:e.palette.primary.text6,"&.Mui-focused":{color:e.palette.primary.main},"&.Mui-disabled.MuiInputLabel-root":{color:e.palette.primary.text6,opacity:"0.4"}},"& .MuiSelect-icon.Mui-disabled":{color:e.palette.primary.contrastText,opacity:"0.4"},"& .MuiFormHelperText-root":{color:e.palette.primary.text6,"&.Mui-disabled":{opacity:"0.4"}},"& .MuiFilledInput-root":{backgroundColor:e.palette.background.b6,"&:hover":{backgroundColor:e.palette.background.b7},"&.Mui-disabled":{backgroundColor:e.palette.background.b6,opacity:"0.4"}},"& .MuiInputLabel-filled":{left:2},"& .MuiSelect-filled":{paddingLeft:14},"& .MuiSvgIcon-root.MuiSelect-icon":{color:e.palette.primary.text6},"& .MuiInputBase-root":{"& .MuiInputAdornment-root":{color:e.palette.primary.text6,"& svg":{height:16,width:16}},"&.Mui-error":{"& .MuiInputAdornment-root":{color:e.palette.error.main}},"&.Mui-disabled":{"& .MuiInputAdornment-root":{opacity:"0.4"}},"&.Mui-focused":{"& .MuiInputAdornment-root":{color:e.palette.primary.main}}}},menuList:{backgroundColor:e.palette.background.b9,"& .MuiMenuItem-root":{"&.Mui-selected":{backgroundColor:e.palette.primary.text9}}},error:{"&:hover":{"& .MuiInput-underline, & .MuiFilledInput-underline":{"&::after":{borderBottom:"2px solid ".concat(e.palette.error.main)}},"& .MuiInput-underline.Mui-disabled, & .MuiFilledInput-underline.Mui-disabled":{"&::before":{borderBottom:"1px solid ".concat(e.palette.error.main)},"&::after":{display:"none"}},"& .MuiOutlinedInput-root.Mui-error:not(.Mui-disabled) .MuiOutlinedInput-notchedOutline":{borderWidth:2}},"& .MuiFormLabel-root.MuiInputLabel-root":{color:e.palette.error.main,"&.Mui-focused":{color:e.palette.error.main},"&.Mui-disabled":{color:e.palette.error.main}},"& .MuiFormHelperText-root":{color:e.palette.error.main},"& .MuiInput-underline, & .MuiFilledInput-underline":{"&::after":{borderBottom:"1px solid ".concat(e.palette.error.main)},"&.Mui-disabled::after":{display:"none"},"&.Mui-disabled::before":{borderBottom:"1px solid ".concat(e.palette.error.main)}},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:e.palette.error.main,opacity:"0.4"}},paper:{marginTop:8}}})),m=function(l){var m,M,b,f,I,v,x,y=l.FormControlProps,h=l.InputLabelProps,g=l.label,F=l.formHelperText,S=l.fullWidth,C=e(l,["FormControlProps","InputLabelProps","label","formHelperText","fullWidth"]),L=i(p,[]),P=s();return t(a,o({},y,{classes:o(o({},y.classes),{root:c(null===(M=y.classes)||void 0===M?void 0:M.root,P.formControlRoot,(m={},m[P.error]=C.error,m))}),disabled:y.disabled||C.disabled,fullWidth:S},{children:[g&&r(n,o({id:L},h,{children:g})),r(u,o({},C,{labelId:L,label:g,MenuProps:o(o({getContentAnchorEl:null,anchorOrigin:{horizontal:"left",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"left"}},null==C?void 0:C.MenuProps),{classes:o(o({},null===(b=null==C?void 0:C.MenuProps)||void 0===b?void 0:b.classes),{paper:c(P.paper,null===(I=null===(f=null==C?void 0:C.MenuProps)||void 0===f?void 0:f.classes)||void 0===I?void 0:I.paper),list:c(null===(x=null===(v=null==C?void 0:C.MenuProps)||void 0===v?void 0:v.classes)||void 0===x?void 0:x.list,P.menuList)})}),fullWidth:S})),F&&r(d,{children:F})]}))};m.defaultProps={FormControlProps:{},InputLabelProps:{},label:null,formHelperText:null,error:!1,fullWidth:!1};export{m as default};
