import { __rest } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { Dialog, DialogContent, styled } from '@mui/material';
import classNames from 'classnames';
import { useThemeProps } from '@mui/system';
import SearchAutocomplete from '../SearchAutocomplete';
const PREFIX = 'SCSearchDialog';
const classes = {
    root: `${PREFIX}-root`,
    search: `${PREFIX}-search`
};
const Root = styled(Dialog, {
    name: PREFIX,
    slot: 'Root',
    overridesResolver: (props, styles) => styles.root
})(({ theme }) => ({
    '& .MuiAutocomplete-popperDisablePortal .MuiPaper-root': {
        boxShadow: 'none',
        borderRadius: 0,
        '& .MuiAutocomplete-listbox': {
            maxHeight: 'none'
        }
    }
}));
export default function Search(inProps) {
    // PROPS
    const props = useThemeProps({
        props: inProps,
        name: PREFIX
    });
    const { className, SearchAutocompleteProps = { autoFocus: true } } = props, rest = __rest(props, ["className", "SearchAutocompleteProps"]);
    return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(DialogContent, { children: _jsx(SearchAutocomplete, Object.assign({ className: classes.search, blurOnSelect: false, open: true, disablePortal: true }, SearchAutocompleteProps)) }) })));
}
