import { Token } from "../../components/dataDisplay/Token.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Typography, makeStyles } from "@material-ui/core";
import { ChevronDownIcon } from "@fluentui/react-icons";
import PropTypes from "prop-types";
//#region src/UI/templates/ui/ExtenderToggle.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		flexDirection: "row",
		borderRadius: "0px 0px 25px 25px ",
		paddingRight: (props) => props.toggleLabel && theme.spacing(2),
		background: (props) => props.color,
		cursor: "pointer"
	},
	label: {
		display: "flex",
		alignItems: "center",
		justifyContent: "flex-end",
		color: (props) => theme?.palette?.getContrastText(props.color ? theme.palette?.secondary?.main : props.color)
	},
	token: { transform: (props) => props.open ? "rotateZ(-180deg)" : "rotateZ(0deg)" }
}));
const ExtenderToggle = (props) => {
	const $ = c(15);
	const classes = useStyles(props);
	const { onClick, toggleLabel, compact } = props;
	const t0 = !compact && classes.root;
	let t1;
	if ($[0] !== compact) {
		t1 = /* @__PURE__ */ React.createElement(Token, {
			icon: ChevronDownIcon,
			color: "default",
			size: "small",
			variant: "filled",
			type: "icon",
			compact
		});
		$[0] = compact;
		$[1] = t1;
	} else t1 = $[1];
	let t2;
	if ($[2] !== classes.token || $[3] !== t1) {
		t2 = /* @__PURE__ */ React.createElement("div", { className: classes.token }, t1);
		$[2] = classes.token;
		$[3] = t1;
		$[4] = t2;
	} else t2 = $[4];
	let t3;
	if ($[5] !== toggleLabel) {
		t3 = /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, " ", toggleLabel, " ");
		$[5] = toggleLabel;
		$[6] = t3;
	} else t3 = $[6];
	let t4;
	if ($[7] !== classes.label || $[8] !== t3) {
		t4 = /* @__PURE__ */ React.createElement("div", { className: classes.label }, t3);
		$[7] = classes.label;
		$[8] = t3;
		$[9] = t4;
	} else t4 = $[9];
	let t5;
	if ($[10] !== onClick || $[11] !== t0 || $[12] !== t2 || $[13] !== t4) {
		t5 = /* @__PURE__ */ React.createElement("div", {
			className: t0,
			onClick
		}, t2, t4);
		$[10] = onClick;
		$[11] = t0;
		$[12] = t2;
		$[13] = t4;
		$[14] = t5;
	} else t5 = $[14];
	return t5;
};
ExtenderToggle.propTypes = {
	onClick: PropTypes.func,
	toggleLabel: PropTypes.string,
	color: PropTypes.string
};
//#endregion
export { ExtenderToggle };

//# sourceMappingURL=ExtenderToggle.mjs.map