import NumberVisualization from "../../utils/NumberVisualization.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Typography, makeStyles } from "@material-ui/core";
//#region src/UI/widgets/FluentComponents/molecules/FluentTimeline.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		flexDirection: "row",
		marginTop: theme.spacing(3),
		marginLeft: theme.spacing(2),
		overflow: "auto"
	},
	dot: {
		width: 10,
		height: 10,
		backgroundColor: "white",
		borderRadius: theme.shape.borderRadius + 25,
		marginTop: theme.spacing(1)
	},
	timeLabels: { color: "white" },
	indicator: {
		display: "flex",
		flexDirection: "column",
		justifyContent: "flex-end",
		marginRight: theme.spacing(2),
		textAlign: "center",
		alignItems: "center"
	}
}));
const TimeDot = (props) => {
	const $ = c(11);
	const classes = useStyles();
	const { dot } = props;
	let t0;
	if ($[0] !== classes.dot) {
		t0 = /* @__PURE__ */ React.createElement("div", { className: classes.dot });
		$[0] = classes.dot;
		$[1] = t0;
	} else t0 = $[1];
	let t1;
	if ($[2] !== dot) {
		t1 = /* @__PURE__ */ React.createElement(Typography, { variant: "overline" }, dot);
		$[2] = dot;
		$[3] = t1;
	} else t1 = $[3];
	let t2;
	if ($[4] !== classes.timeLabels || $[5] !== t1) {
		t2 = /* @__PURE__ */ React.createElement("div", { className: classes.timeLabels }, t1);
		$[4] = classes.timeLabels;
		$[5] = t1;
		$[6] = t2;
	} else t2 = $[6];
	let t3;
	if ($[7] !== classes.indicator || $[8] !== t0 || $[9] !== t2) {
		t3 = /* @__PURE__ */ React.createElement("div", { className: classes.indicator }, t0, t2);
		$[7] = classes.indicator;
		$[8] = t0;
		$[9] = t2;
		$[10] = t3;
	} else t3 = $[10];
	return t3;
};
const Visualization = (props) => {
	const $ = c(8);
	const classes = useStyles();
	const { value, label } = props;
	let t0;
	if ($[0] !== value) {
		t0 = /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(NumberVisualization, { number: value }));
		$[0] = value;
		$[1] = t0;
	} else t0 = $[1];
	let t1;
	if ($[2] !== label) {
		t1 = /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TimeDot, { dot: label }));
		$[2] = label;
		$[3] = t1;
	} else t1 = $[3];
	let t2;
	if ($[4] !== classes.indicator || $[5] !== t0 || $[6] !== t1) {
		t2 = /* @__PURE__ */ React.createElement("div", { className: classes.indicator }, t0, t1);
		$[4] = classes.indicator;
		$[5] = t0;
		$[6] = t1;
		$[7] = t2;
	} else t2 = $[7];
	return t2;
};
const categoriesToDisplay = (categories) => categories.map((item) => {
	return /* @__PURE__ */ React.createElement(Visualization, {
		key: item.label,
		value: item.value,
		label: item.label
	});
});
const FluentTimeline = (props) => {
	const $ = c(5);
	const classes = useStyles();
	const { categories } = props;
	const t0 = classes.root;
	let t1;
	if ($[0] !== categories) {
		t1 = categoriesToDisplay(categories);
		$[0] = categories;
		$[1] = t1;
	} else t1 = $[1];
	let t2;
	if ($[2] !== classes.root || $[3] !== t1) {
		t2 = /* @__PURE__ */ React.createElement("div", { className: t0 }, t1);
		$[2] = classes.root;
		$[3] = t1;
		$[4] = t2;
	} else t2 = $[4];
	return t2;
};
//#endregion
export { FluentTimeline as default };

//# sourceMappingURL=FluentTimeline.mjs.map