import { LayoutUnit } from "../../../layout/LayoutUnit.mjs";
import { TimelineDateBar } from "./TimelineDateBar.mjs";
import { TimelineStatus } from "./TimelineStatus.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Divider, Tooltip, Typography, makeStyles } from "@material-ui/core";
import clsx from "clsx";
import PropTypes from "prop-types";
//#region src/componentSystems/multiThreadTimeline/ui/SummaryToken.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		minHeight: 200,
		background: (props) => !props.hidebackground && "whitesmoke"
	},
	dateBar: { width: 130 },
	centerWrapper: {
		display: "flex",
		justifyContent: "center"
	}
}));
const SummaryToken = (props) => {
	const $ = c(64);
	const { title, short, showMonth, amount, status, date, user, icon, months: t0, className, month, balance } = props;
	let t1;
	if ($[0] !== t0) {
		t1 = t0 === void 0 ? [] : t0;
		$[0] = t0;
		$[1] = t1;
	} else t1 = $[1];
	const months = t1;
	const classes = useStyles(props);
	let t2;
	if ($[2] !== className || $[3] !== classes.root) {
		t2 = clsx(classes.root, className);
		$[2] = className;
		$[3] = classes.root;
		$[4] = t2;
	} else t2 = $[4];
	let t3;
	let t4;
	if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = {
			display: "flex",
			flexDirection: "column",
			justifyContent: "space-between",
			width: 130
		};
		t4 = { marginRight: -8 };
		$[5] = t3;
		$[6] = t4;
	} else {
		t3 = $[5];
		t4 = $[6];
	}
	let t5;
	if ($[7] !== classes.centerWrapper || $[8] !== icon) {
		t5 = /* @__PURE__ */ React.createElement("div", {
			style: t4,
			className: classes.centerWrapper
		}, icon);
		$[7] = classes.centerWrapper;
		$[8] = icon;
		$[9] = t5;
	} else t5 = $[9];
	let t6;
	let t7;
	let t8;
	let t9;
	if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
		t6 = /* @__PURE__ */ React.createElement("div", { style: {
			height: 24,
			display: "flex",
			justifyContent: "center"
		} }, /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical" }));
		t7 = {
			display: "flex",
			flexDirection: "column"
		};
		t8 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "nudge" });
		t9 = { textAlign: "center" };
		$[10] = t6;
		$[11] = t7;
		$[12] = t8;
		$[13] = t9;
	} else {
		t6 = $[10];
		t7 = $[11];
		t8 = $[12];
		t9 = $[13];
	}
	let t10;
	if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
		t10 = {
			textOverflow: "ellipsis",
			overflow: "hidden",
			whiteSpace: "nowrap"
		};
		$[14] = t10;
	} else t10 = $[14];
	let t11;
	if ($[15] !== title) {
		t11 = /* @__PURE__ */ React.createElement(Typography, {
			variant: "subtitle2",
			style: t10
		}, title);
		$[15] = title;
		$[16] = t11;
	} else t11 = $[16];
	let t12;
	if ($[17] !== t11 || $[18] !== title) {
		t12 = /* @__PURE__ */ React.createElement("div", { style: t9 }, /* @__PURE__ */ React.createElement(Tooltip, { title }, t11));
		$[17] = t11;
		$[18] = title;
		$[19] = t12;
	} else t12 = $[19];
	let t13;
	if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
		t13 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "nudge" });
		$[20] = t13;
	} else t13 = $[20];
	let t14;
	if ($[21] !== amount) {
		t14 = amount && /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Tooltip, { title: amount }, /* @__PURE__ */ React.createElement(Typography, { style: {
			textOverflow: "ellipsis",
			overflow: "hidden",
			whiteSpace: "nowrap"
		} }, amount)));
		$[21] = amount;
		$[22] = t14;
	} else t14 = $[22];
	let t15;
	if ($[23] !== amount || $[24] !== status) {
		t15 = !amount && /* @__PURE__ */ React.createElement("div", { style: {
			display: "flex",
			justifyContent: "center"
		} }, /* @__PURE__ */ React.createElement(TimelineStatus, { status }));
		$[23] = amount;
		$[24] = status;
		$[25] = t15;
	} else t15 = $[25];
	let t16;
	if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
		t16 = { textAlign: "center" };
		$[26] = t16;
	} else t16 = $[26];
	let t17;
	if ($[27] !== date) {
		t17 = /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, date);
		$[27] = date;
		$[28] = t17;
	} else t17 = $[28];
	let t18;
	if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
		t18 = {
			textOverflow: "ellipsis",
			overflow: "hidden",
			whiteSpace: "nowrap"
		};
		$[29] = t18;
	} else t18 = $[29];
	let t19;
	if ($[30] !== user) {
		t19 = /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, user);
		$[30] = user;
		$[31] = t19;
	} else t19 = $[31];
	let t20;
	if ($[32] !== t19 || $[33] !== user) {
		t20 = /* @__PURE__ */ React.createElement("div", { style: t18 }, /* @__PURE__ */ React.createElement(Tooltip, { title: user }, t19));
		$[32] = t19;
		$[33] = user;
		$[34] = t20;
	} else t20 = $[34];
	let t21;
	if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
		t21 = {
			textOverflow: "ellipsis",
			overflow: "hidden",
			whiteSpace: "nowrap"
		};
		$[35] = t21;
	} else t21 = $[35];
	let t22;
	if ($[36] !== balance) {
		t22 = /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, balance);
		$[36] = balance;
		$[37] = t22;
	} else t22 = $[37];
	let t23;
	if ($[38] !== balance || $[39] !== t22) {
		t23 = /* @__PURE__ */ React.createElement("div", { style: t21 }, /* @__PURE__ */ React.createElement(Tooltip, { title: balance }, t22));
		$[38] = balance;
		$[39] = t22;
		$[40] = t23;
	} else t23 = $[40];
	let t24;
	if ($[41] !== t17 || $[42] !== t20 || $[43] !== t23) {
		t24 = /* @__PURE__ */ React.createElement("div", { style: t16 }, t17, t20, t23);
		$[41] = t17;
		$[42] = t20;
		$[43] = t23;
		$[44] = t24;
	} else t24 = $[44];
	let t25;
	if ($[45] !== t12 || $[46] !== t14 || $[47] !== t15 || $[48] !== t24) {
		t25 = /* @__PURE__ */ React.createElement("div", { style: t7 }, t8, t12, t13, t14, t15, t24);
		$[45] = t12;
		$[46] = t14;
		$[47] = t15;
		$[48] = t24;
		$[49] = t25;
	} else t25 = $[49];
	let t26;
	if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
		t26 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "xxs" });
		$[50] = t26;
	} else t26 = $[50];
	let t27;
	if ($[51] !== classes.dateBar || $[52] !== month || $[53] !== months || $[54] !== short || $[55] !== showMonth) {
		t27 = !short && /* @__PURE__ */ React.createElement("div", { className: classes.dateBar }, /* @__PURE__ */ React.createElement(TimelineDateBar, {
			month,
			showMonth,
			months
		}));
		$[51] = classes.dateBar;
		$[52] = month;
		$[53] = months;
		$[54] = short;
		$[55] = showMonth;
		$[56] = t27;
	} else t27 = $[56];
	let t28;
	if ($[57] !== t25 || $[58] !== t27 || $[59] !== t5) {
		t28 = /* @__PURE__ */ React.createElement("div", { style: t3 }, t5, t6, t25, t26, t27);
		$[57] = t25;
		$[58] = t27;
		$[59] = t5;
		$[60] = t28;
	} else t28 = $[60];
	let t29;
	if ($[61] !== t2 || $[62] !== t28) {
		t29 = /* @__PURE__ */ React.createElement("div", { className: t2 }, t28);
		$[61] = t2;
		$[62] = t28;
		$[63] = t29;
	} else t29 = $[63];
	return t29;
};
SummaryToken.propTypes = {
	title: PropTypes.string,
	short: PropTypes.bool,
	showMonth: PropTypes.bool,
	amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
	status: PropTypes.string,
	date: PropTypes.string,
	user: PropTypes.string,
	icon: PropTypes.element,
	months: PropTypes.array,
	className: PropTypes.string,
	month: PropTypes.string,
	balance: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
	hidebackground: PropTypes.bool
};
//#endregion
export { SummaryToken };

//# sourceMappingURL=SummaryToken.mjs.map