import { c } from "react-compiler-runtime";
import React from "react";
import { Link } from "react-router-dom";
import { AdminALogo32Icon, BugIcon, ChevronDownIcon, ChevronRightIcon, CloudUploadIcon, ContentFeedIcon, MessageIcon, OfficeFormsLogo16Icon, RawSourceIcon, ViewDashboardIcon } from "@fluentui/react-icons";
import PropTypes from "prop-types";
import { makeStyles } from "@material-ui/core/styles";
import Typography from "@material-ui/core/Typography";
import TreeView from "@material-ui/lab/TreeView";
import TreeItem from "@material-ui/lab/TreeItem";
//#region src/UI/navigation/FluentSideNav.jsx
const useTreeItemStyles = makeStyles((theme) => ({
	root: {
		color: theme.palette.text.secondary,
		"&:hover > $content": { backgroundColor: theme.palette.action.hover },
		"&:focus > $content, &$selected > $content": {
			backgroundColor: `var(--tree-view-bg-color, ${theme.palette.grey[300]})`,
			color: "var(--tree-view-color)"
		},
		"&:focus > $marker, &$selected > $marker": {
			backgroundColor: `var(--tree-view-bg-color, ${theme.palette.grey[300]})`,
			color: "var(--tree-view-color)"
		},
		"&:focus > $content $label, &:hover > $content $label, &$selected > $content $label": { backgroundColor: "transparent" }
	},
	content: {
		color: theme.palette.text.secondary,
		paddingRight: theme.spacing(1),
		paddingLeft: theme.spacing(1),
		fontWeight: theme.typography.fontWeightMedium,
		"$expanded > &": { fontWeight: theme.typography.fontWeightRegular }
	},
	group: {
		marginLeft: 0,
		"& $content": { paddingLeft: theme.spacing(2) }
	},
	expanded: {},
	selected: {},
	label: {
		fontWeight: "inherit",
		color: "inherit"
	},
	labelRoot: {
		display: "flex",
		alignItems: "center",
		padding: theme.spacing(1.5, 0)
	},
	labelIcon: {
		marginRight: theme.spacing(2.5),
		fontSize: 16,
		color: theme.palette.secondary.main
	},
	labelText: {
		fontWeight: "inherit",
		fontSize: 14,
		flexGrow: 1
	}
}));
const StyledTreeItem = (props) => {
	const $ = c(42);
	const classes = useTreeItemStyles();
	let LabelIcon;
	let bgColor;
	let children;
	let color;
	let labelInfo;
	let labelText;
	let other;
	let to;
	if ($[0] !== props) {
		({labelText, labelIcon: LabelIcon, labelInfo, color, bgColor, to, children, ...other} = props);
		$[0] = props;
		$[1] = LabelIcon;
		$[2] = bgColor;
		$[3] = children;
		$[4] = color;
		$[5] = labelInfo;
		$[6] = labelText;
		$[7] = other;
		$[8] = to;
	} else {
		LabelIcon = $[1];
		bgColor = $[2];
		children = $[3];
		color = $[4];
		labelInfo = $[5];
		labelText = $[6];
		other = $[7];
		to = $[8];
	}
	let t0;
	if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
		t0 = { textDecoration: "none" };
		$[9] = t0;
	} else t0 = $[9];
	let t1;
	if ($[10] !== LabelIcon || $[11] !== classes.labelIcon) {
		t1 = LabelIcon && /* @__PURE__ */ React.createElement(LabelIcon, {
			color: "inherit",
			className: classes.labelIcon
		});
		$[10] = LabelIcon;
		$[11] = classes.labelIcon;
		$[12] = t1;
	} else t1 = $[12];
	let t2;
	if ($[13] !== classes.labelText || $[14] !== labelText) {
		t2 = /* @__PURE__ */ React.createElement(Typography, {
			variant: "body2",
			className: classes.labelText
		}, labelText);
		$[13] = classes.labelText;
		$[14] = labelText;
		$[15] = t2;
	} else t2 = $[15];
	let t3;
	if ($[16] !== labelInfo) {
		t3 = /* @__PURE__ */ React.createElement(Typography, {
			variant: "caption",
			color: "inherit"
		}, labelInfo);
		$[16] = labelInfo;
		$[17] = t3;
	} else t3 = $[17];
	let t4;
	if ($[18] !== classes.labelRoot || $[19] !== t1 || $[20] !== t2 || $[21] !== t3) {
		t4 = /* @__PURE__ */ React.createElement("div", { className: classes.labelRoot }, t1, t2, t3);
		$[18] = classes.labelRoot;
		$[19] = t1;
		$[20] = t2;
		$[21] = t3;
		$[22] = t4;
	} else t4 = $[22];
	let t5;
	if ($[23] !== bgColor || $[24] !== color) {
		t5 = {
			"--tree-view-color": color,
			"--tree-view-bg-color": bgColor
		};
		$[23] = bgColor;
		$[24] = color;
		$[25] = t5;
	} else t5 = $[25];
	let t6;
	if ($[26] !== classes.content || $[27] !== classes.expanded || $[28] !== classes.group || $[29] !== classes.label || $[30] !== classes.root || $[31] !== classes.selected) {
		t6 = {
			root: classes.root,
			content: classes.content,
			expanded: classes.expanded,
			selected: classes.selected,
			group: classes.group,
			label: classes.label
		};
		$[26] = classes.content;
		$[27] = classes.expanded;
		$[28] = classes.group;
		$[29] = classes.label;
		$[30] = classes.root;
		$[31] = classes.selected;
		$[32] = t6;
	} else t6 = $[32];
	let t7;
	if ($[33] !== children || $[34] !== other || $[35] !== t4 || $[36] !== t5 || $[37] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(TreeItem, {
			label: t4,
			style: t5,
			classes: t6,
			...other,
			children
		});
		$[33] = children;
		$[34] = other;
		$[35] = t4;
		$[36] = t5;
		$[37] = t6;
		$[38] = t7;
	} else t7 = $[38];
	let t8;
	if ($[39] !== t7 || $[40] !== to) {
		t8 = /* @__PURE__ */ React.createElement(Link, {
			to,
			style: t0
		}, t7);
		$[39] = t7;
		$[40] = to;
		$[41] = t8;
	} else t8 = $[41];
	return t8;
};
StyledTreeItem.propTypes = {
	bgColor: PropTypes.string,
	color: PropTypes.string,
	labelIcon: PropTypes.elementType,
	labelInfo: PropTypes.string,
	labelText: PropTypes.string.isRequired
};
const useStyles = makeStyles({ root: {
	height: 264,
	flexGrow: 1,
	maxWidth: 280
} });
const FluentSideNav = (props) => {
	const $ = c(8);
	const classes = useStyles();
	const { data } = props;
	let t0;
	if ($[0] !== data) {
		t0 = data.map(_temp);
		$[0] = data;
		$[1] = t0;
	} else t0 = $[1];
	const renderedArray = t0;
	let t1;
	let t2;
	let t3;
	if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
		t1 = /* @__PURE__ */ React.createElement(ChevronDownIcon, null);
		t2 = /* @__PURE__ */ React.createElement(ChevronRightIcon, null);
		t3 = /* @__PURE__ */ React.createElement("div", { style: { width: 24 } });
		$[2] = t1;
		$[3] = t2;
		$[4] = t3;
	} else {
		t1 = $[2];
		t2 = $[3];
		t3 = $[4];
	}
	let t4;
	if ($[5] !== classes.root || $[6] !== renderedArray) {
		t4 = /* @__PURE__ */ React.createElement(TreeView, {
			className: classes.root,
			defaultCollapseIcon: t1,
			defaultExpandIcon: t2,
			defaultEndIcon: t3
		}, renderedArray);
		$[5] = classes.root;
		$[6] = renderedArray;
		$[7] = t4;
	} else t4 = $[7];
	return t4;
};
function _temp(nodes) {
	const icons = {
		ViewDashboardIcon,
		AdminALogo32Icon,
		MessageIcon,
		ContentFeedIcon,
		RawSourceIcon,
		BugIcon,
		OfficeFormsLogo16Icon,
		CloudUploadIcon
	};
	return /* @__PURE__ */ React.createElement(StyledTreeItem, {
		key: nodes.nodeId,
		nodeId: nodes.nodeId,
		labelText: nodes.labelText,
		labelIcon: typeof nodes.labelIcon === "string" ? icons[nodes.labelIcon] : nodes.labelIcon,
		to: nodes.to !== "" && nodes.to,
		children: nodes.children && nodes.children.map((nodes_0) => /* @__PURE__ */ React.createElement(StyledTreeItem, {
			key: nodes_0.nodeId,
			nodeId: nodes_0.nodeId,
			labelText: nodes_0.labelText,
			labelIcon: typeof nodes_0.labelIcon === "string" ? icons[nodes_0.labelIcon] : nodes_0.labelIcon,
			to: nodes_0.to !== "" && nodes_0.to
		}))
	});
}
//#endregion
export { FluentSideNav };

//# sourceMappingURL=FluentSideNav.mjs.map