import { colors as colors$1 } from "../../../utilities/style/colors.mjs";
import { LayoutUnit } from "../../../layout/LayoutUnit.mjs";
import { TimelineToken } from "./modified/TimelineToken.mjs";
import { TimelineHoverCard } from "./TimelineHoverCard.mjs";
import { TimelineDot } from "./TimelineDot.mjs";
import { TimelineStatus } from "./TimelineStatus.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Divider, Typography, lighten, makeStyles, useTheme } from "@material-ui/core";
import { MoneyIcon } from "@fluentui/react-icons";
import PropTypes from "prop-types";
//#region src/componentSystems/multiThreadTimeline/ui/TimelineTokenSummary.jsx
const useStyles = makeStyles((theme) => ({
	root: { height: 200 },
	timelineWrapper: {
		background: lighten(theme.palette.secondary.main, .7),
		height: 40,
		borderRadius: 50,
		position: (props) => props.relative ? "relative" : "absolute"
	},
	token: {
		position: (props) => props.relative ? "relative" : "absolute",
		top: (props) => props.top - 9,
		left: (props) => props.left - 2,
		transition: "1s",
		cursor: "pointer",
		"&:hover": {}
	},
	summaryRoot: {},
	negativeMargin: { marginTop: -6 },
	titleContainer: {
		textOverflow: "ellipsis",
		overflow: "hidden",
		borderRadius: 4,
		paddingLeft: 4,
		paddingRight: 2
	}
}), { name: "TimelineTokenSummary" });
const TimelineTokenSummary = (props) => {
	const $ = c(27);
	const { timelineItem, onClick, isHover, title, showLabel: t0, dot, color, date, message, amount, user, status, summary, iconColor, showToken, details: t1, icon } = props;
	const showLabel = t0 === void 0 ? true : t0;
	const details = t1 === void 0 ? true : t1;
	const classes = useStyles(props);
	const theme = useTheme();
	let t2;
	if ($[0] !== amount || $[1] !== classes || $[2] !== details || $[3] !== status || $[4] !== summary || $[5] !== title || $[6] !== user) {
		t2 = (t3) => {
			const { message: message_0 } = t3;
			return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: {
				display: "flex",
				flexDirection: "column",
				justifyContent: "center",
				alignItems: "center"
			} }, summary && /* @__PURE__ */ React.createElement("div", { style: { height: 24 } }, /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical" })), /* @__PURE__ */ React.createElement("div", {
				className: classes.summaryRoot,
				style: { display: "flex" }
			}, /* @__PURE__ */ React.createElement("div", {
				className: classes.titleContainer,
				style: { height: summary && 90 }
			}, /* @__PURE__ */ React.createElement(Typography, {
				variant: "caption",
				style: {
					fontWeight: 700,
					textOverflow: "ellipsis",
					overflow: "hidden"
				}
			}, title), details && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "nudge" }), /* @__PURE__ */ React.createElement(Typography, null, amount), /* @__PURE__ */ React.createElement(TimelineStatus, { status }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, message_0), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, user))))))));
		};
		$[0] = amount;
		$[1] = classes;
		$[2] = details;
		$[3] = status;
		$[4] = summary;
		$[5] = title;
		$[6] = user;
		$[7] = t2;
	} else t2 = $[7];
	const TimelineSummary = t2;
	let t3;
	if ($[8] !== TimelineSummary || $[9] !== classes || $[10] !== color || $[11] !== date || $[12] !== iconColor || $[13] !== isHover || $[14] !== message || $[15] !== onClick || $[16] !== showLabel || $[17] !== showToken || $[18] !== summary || $[19] !== theme || $[20] !== timelineItem || $[21] !== title) {
		t3 = (t4) => {
			const { dot: dot_0, icon: icon_0 } = t4;
			return /* @__PURE__ */ React.createElement("div", {
				className: classes.token,
				onClick
			}, (dot_0 || showToken) && /* @__PURE__ */ React.createElement(TimelineToken, {
				color: colors$1.unity?.info?.hint,
				icon: icon_0,
				size: "small",
				iconColorOverride: iconColor,
				onClick,
				action: true,
				isHover,
				hoverContainer: /* @__PURE__ */ React.createElement(TimelineHoverCard, {
					date,
					categoryColor: theme.palette.info.main,
					message,
					timelineItem
				})
			}, " "), !dot_0 && !summary && /* @__PURE__ */ React.createElement(TimelineDot, {
				title,
				date,
				color,
				hoverContent: /* @__PURE__ */ React.createElement(TimelineHoverCard, {
					date,
					categoryColor: theme.palette.info.main,
					message,
					timelineItem
				})
			}), showLabel && !dot_0 && /* @__PURE__ */ React.createElement(TimelineSummary, { message }));
		};
		$[8] = TimelineSummary;
		$[9] = classes;
		$[10] = color;
		$[11] = date;
		$[12] = iconColor;
		$[13] = isHover;
		$[14] = message;
		$[15] = onClick;
		$[16] = showLabel;
		$[17] = showToken;
		$[18] = summary;
		$[19] = theme;
		$[20] = timelineItem;
		$[21] = title;
		$[22] = t3;
	} else t3 = $[22];
	const NodeItem = t3;
	bb0: switch (timelineItem) {
		case "Email": break bb0;
		case "ServiceOrder": break bb0;
		case "SMS": break bb0;
		case "Web Payment": break bb0;
		case "Deposit - Regular": break bb0;
		case "Start Read": break bb0;
		case "Regular Bill": break bb0;
		case "Email Notify": break bb0;
		case "Payment": break bb0;
		case "Bill": break bb0;
		case "Service Order": break bb0;
		case "Late": break bb0;
		case "Letter": break bb0;
		case "Disc": break bb0;
		default:
	}
	const t4 = icon ? icon : MoneyIcon;
	let t5;
	if ($[23] !== NodeItem || $[24] !== dot || $[25] !== t4) {
		t5 = /* @__PURE__ */ React.createElement(NodeItem, {
			icon: t4,
			dot
		});
		$[23] = NodeItem;
		$[24] = dot;
		$[25] = t4;
		$[26] = t5;
	} else t5 = $[26];
	return t5;
};
TimelineTokenSummary.propTypes = {
	timelineItem: PropTypes.string.isRequired,
	onClick: PropTypes.func,
	isHover: PropTypes.bool,
	title: PropTypes.string,
	showLabel: PropTypes.bool,
	dot: PropTypes.bool,
	color: PropTypes.string,
	date: PropTypes.string,
	message: PropTypes.string,
	amount: PropTypes.string,
	user: PropTypes.string,
	status: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
	summary: PropTypes.bool,
	iconColor: PropTypes.string,
	showToken: PropTypes.bool,
	details: PropTypes.bool,
	icon: PropTypes.oneOfType([PropTypes.elementType, PropTypes.object])
};
//#endregion
export { TimelineTokenSummary };

//# sourceMappingURL=TimelineTokenSummary.mjs.map