import { c } from "react-compiler-runtime";
import React from "react";
import { TextField, makeStyles } from "@material-ui/core";
import PropTypes from "prop-types";
//#region src/UI/inputs/textField/AmbientTextField.jsx
const useStyles = makeStyles((theme) => ({
	input: {
		borderRadius: 2,
		height: (props) => !props.multiline && !Array.isArray(props.value) && 32,
		padding: (props) => !props.multiline && 0,
		paddingTop: (props) => props.multiline && "0 !important",
		paddingBottom: 10,
		marginTop: 3,
		"& .MuiFilledInput-inputMarginDense": { paddingTop: 8 },
		"& .MuiInputAdornment-filled.MuiInputAdornment-positionStart:not(.MuiInputAdornment-hiddenLabel)": {
			marginTop: theme.spacing(.5),
			marginLeft: theme.spacing(1)
		}
	},
	inputMultiline: { paddingTop: 0 },
	formTextInput: { fontSize: 14 },
	labelRoot: { fontSize: 14 },
	FormControl: {
		display: "none",
		marginTop: 0
	},
	root: {
		width: "100%",
		marginTop: 25,
		"& .MuiFormLabel-root": {
			marginTop: -30,
			marginLeft: -11
		},
		"& .MuiInputAdornment-root": { paddingLeft: theme.spacing(1) }
	},
	noLabel: { marginTop: theme.spacing(1) }
}));
const AmbientTextField = (props) => {
	const $ = c(36);
	const classes = useStyles(props);
	let InputProps;
	let endAdornment;
	let id;
	let label;
	let startAdornment;
	let t0;
	if ($[0] !== props) {
		({id, label, startAdornment, endAdornment, title: t0, ...InputProps} = props);
		$[0] = props;
		$[1] = InputProps;
		$[2] = endAdornment;
		$[3] = id;
		$[4] = label;
		$[5] = startAdornment;
		$[6] = t0;
	} else {
		InputProps = $[1];
		endAdornment = $[2];
		id = $[3];
		label = $[4];
		startAdornment = $[5];
		t0 = $[6];
	}
	const title = t0 === void 0 ? "noTitle" : t0;
	const t1 = label ? classes.root : classes.noLabel;
	let t2;
	if ($[7] !== title) {
		let t3;
		if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
			t3 = /\s/g;
			$[9] = t3;
		} else t3 = $[9];
		t2 = title.replace(t3, "");
		$[7] = title;
		$[8] = t2;
	} else t2 = $[8];
	const t3 = `udpRecord-FluentAmbientTextField-${t2}-${props?.InputProps?.type}`;
	let t4;
	if ($[10] !== classes.label) {
		t4 = { label: classes.label };
		$[10] = classes.label;
		$[11] = t4;
	} else t4 = $[11];
	const t5 = props.InputProps?.classes;
	let t6;
	if ($[12] !== classes.formTextInput || $[13] !== classes.input || $[14] !== classes.inputMultiline || $[15] !== t5) {
		t6 = {
			root: classes.input,
			input: classes.formTextInput,
			inputMultiline: classes.inputMultiline,
			...t5
		};
		$[12] = classes.formTextInput;
		$[13] = classes.input;
		$[14] = classes.inputMultiline;
		$[15] = t5;
		$[16] = t6;
	} else t6 = $[16];
	let t7;
	if ($[17] !== endAdornment || $[18] !== props.InputProps || $[19] !== startAdornment || $[20] !== t6) {
		t7 = {
			classes: t6,
			...props.InputProps,
			...startAdornment,
			...endAdornment
		};
		$[17] = endAdornment;
		$[18] = props.InputProps;
		$[19] = startAdornment;
		$[20] = t6;
		$[21] = t7;
	} else t7 = $[21];
	let t8;
	if ($[22] !== classes.labelFocused || $[23] !== classes.labelRoot) {
		t8 = {
			shrink: false,
			classes: {
				root: classes.labelRoot,
				focused: classes.labelFocused
			}
		};
		$[22] = classes.labelFocused;
		$[23] = classes.labelRoot;
		$[24] = t8;
	} else t8 = $[24];
	let t9;
	if ($[25] !== InputProps || $[26] !== id || $[27] !== label || $[28] !== t3 || $[29] !== t4 || $[30] !== t7 || $[31] !== t8) {
		t9 = /* @__PURE__ */ React.createElement(TextField, {
			...InputProps,
			id,
			udprecordid: t3,
			variant: "filled",
			size: "small",
			margin: "dense",
			label,
			classes: t4,
			InputProps: t7,
			InputLabelProps: t8
		});
		$[25] = InputProps;
		$[26] = id;
		$[27] = label;
		$[28] = t3;
		$[29] = t4;
		$[30] = t7;
		$[31] = t8;
		$[32] = t9;
	} else t9 = $[32];
	let t10;
	if ($[33] !== t1 || $[34] !== t9) {
		t10 = /* @__PURE__ */ React.createElement("div", { className: t1 }, t9);
		$[33] = t1;
		$[34] = t9;
		$[35] = t10;
	} else t10 = $[35];
	return t10;
};
AmbientTextField.propTypes = {
	id: PropTypes.string,
	label: PropTypes.string,
	startAdornment: PropTypes.node,
	endAdornment: PropTypes.node
};
//#endregion
export { AmbientTextField };

//# sourceMappingURL=AmbientTextField.mjs.map