"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StyledAutocomplete = exports.StyledMenuItem = void 0;
const Autocomplete_1 = __importStar(require("@mui/material/Autocomplete"));
const FormControl_1 = require("@mui/material/FormControl");
const IconButton_1 = require("@mui/material/IconButton");
const InputBase_1 = require("@mui/material/InputBase");
const MenuItem_1 = require("../MenuItem");
const SvgIcon_1 = require("../SvgIcon");
const styled_1 = require("../styled");
const constants_1 = require("./constants");
exports.StyledMenuItem = (0, styled_1.styled)(MenuItem_1.MenuItem) `
    max-height: ${({ theme }) => theme.spacing(13)};

    ${({ theme }) => theme.breakpoints.down('sm')} {
        max-height: unset;
    }
`;
exports.StyledAutocomplete = (0, styled_1.styled)(Autocomplete_1.default) `
    ${({ loading }) => {
    return (loading &&
        `&& .${FormControl_1.formControlClasses.root} .${InputBase_1.inputBaseClasses.adornedEnd} .${SvgIcon_1.svgIconClassnames.root} {
        width: 100%;
        height: 100%;
      }`);
}}
  
  & .${Autocomplete_1.autocompleteClasses.endAdornment} .${IconButton_1.iconButtonClasses.root}:hover {
      background-color: ${({ loading, theme }) => (loading ? 'transparent' : theme.palette.grey[100])};
  }

  &:not(.${constants_1.autocompleteClassnames.emptyValue}) .${InputBase_1.inputBaseClasses.root} {
    gap: ${({ theme }) => theme.spacing(3)};
  }

  & .${Autocomplete_1.autocompleteClasses.inputRoot} .${InputBase_1.inputBaseClasses.input} {
    min-width: ${constants_1.INPUT_MIN_WIDTH}px;
  }

  & .${Autocomplete_1.autocompleteClasses.inputRoot} {
    flex-wrap: nowrap;
  }
    
`;
