import { c } from "react-compiler-runtime";
import React from "react";
import { TextField, makeStyles } from "@material-ui/core";
import Autocomplete from "@material-ui/lab/Autocomplete";
//#region src/UI/inputs/menus/FluentSelectDirectoryMenu.jsx
const useStyles = makeStyles((theme) => ({
	textField: {
		marginLeft: theme.spacing(1),
		marginRight: theme.spacing(1)
	},
	dense: { marginTop: theme.spacing(1) },
	input: {
		borderRadius: 2,
		height: 32,
		padding: 0,
		marginTop: 3
	},
	formTextInput: { fontSize: 14 },
	labelRoot: { fontSize: 14 }
}));
const FluentSelectGroupMenu = (t0) => {
	const $ = c(17);
	const { data, placeholder, id, handleChange } = t0;
	const classes = useStyles();
	let t1;
	if ($[0] !== data) {
		t1 = data && data.map(_temp);
		$[0] = data;
		$[1] = t1;
	} else t1 = $[1];
	const options = t1;
	let t2;
	if ($[2] !== handleChange) {
		t2 = (event, value) => handleChange(value);
		$[2] = handleChange;
		$[3] = t2;
	} else t2 = $[3];
	let t3;
	if ($[4] !== options) {
		t3 = options.sort(_temp2);
		$[4] = options;
		$[5] = t3;
	} else t3 = $[5];
	let t4;
	if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
		t4 = { width: 300 };
		$[6] = t4;
	} else t4 = $[6];
	let t5;
	if ($[7] !== classes.labelFocused || $[8] !== classes.labelRoot || $[9] !== classes.menu || $[10] !== placeholder) {
		t5 = (params) => /* @__PURE__ */ React.createElement(TextField, {
			...params,
			label: !params.inputProps.value && placeholder,
			variant: "outlined",
			size: "small",
			InputLabelProps: {
				shrink: false,
				classes: {
					root: classes.labelRoot,
					focused: classes.labelFocused
				}
			},
			SelectProps: { MenuProps: { className: classes.menu } }
		});
		$[7] = classes.labelFocused;
		$[8] = classes.labelRoot;
		$[9] = classes.menu;
		$[10] = placeholder;
		$[11] = t5;
	} else t5 = $[11];
	let t6;
	if ($[12] !== id || $[13] !== t2 || $[14] !== t3 || $[15] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(Autocomplete, {
			id,
			onChange: t2,
			options: t3,
			groupBy: _temp3,
			getOptionLabel: _temp4,
			style: t4,
			renderInput: t5
		});
		$[12] = id;
		$[13] = t2;
		$[14] = t3;
		$[15] = t5;
		$[16] = t6;
	} else t6 = $[16];
	return t6;
};
function _temp(option) {
	const firstLetter = option.label[0].toUpperCase();
	return {
		firstLetter: /[0-9]/.test(firstLetter) ? "0-9" : firstLetter,
		...option
	};
}
function _temp2(a, b) {
	return -b.firstLetter.localeCompare(a.firstLetter);
}
function _temp3(option_0) {
	return option_0.firstLetter;
}
function _temp4(option_1) {
	return option_1.label;
}
//#endregion
export { FluentSelectGroupMenu };

//# sourceMappingURL=FluentSelectDirectoryMenu.mjs.map