import { FluentIconButton } from "../inputs/buttons/FluentIconButton.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Button, Snackbar, makeStyles, useTheme } from "@material-ui/core";
import { ChromeCloseIcon } from "@fluentui/react-icons";
//#region src/UI/feedback/AmbientToast.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		maxWidth: 600,
		"& > * + *": { marginTop: theme.spacing(2) },
		display: "flex"
	},
	alertSecondary: { borderLeft: `4px solid ${theme.palette.secondary.main}` },
	alertPrimary: { borderLeft: `4px solid ${theme.palette.primary.main}` },
	alertSuccess: { borderLeft: `4px solid ${theme.palette.success.main}` },
	alertWarning: { borderLeft: `4px solid ${theme.palette.warning.main}` },
	alertError: {
		borderLeft: `4px solid ${theme.palette.error.main}`,
		color: theme.palette.error.main
	},
	alertInfo: { borderLeft: `4px solid ${theme.palette.info.main}` },
	"@global": { ".MuiSnackbarContent-root": { borderRadius: 0 } }
}));
const AmbientToast = (props) => {
	const $ = c(40);
	const classes = useStyles(props);
	const { noticeType, noticeButton, noticeMessage, closeNotice, noticeOpen, noticeAction } = props;
	const theme = useTheme();
	let t0;
	if ($[0] !== classes.alertError || $[1] !== classes.alertInfo || $[2] !== classes.alertPrimary || $[3] !== classes.alertSecondary || $[4] !== classes.alertSuccess || $[5] !== classes.alertWarning || $[6] !== noticeType) {
		t0 = () => {
			if (noticeType === "secondary") return classes.alertSecondary;
			else if (noticeType === "primary") return classes.alertPrimary;
			else if (noticeType === "success") return classes.alertSuccess;
			else if (noticeType === "warning") return classes.alertWarning;
			else if (noticeType === "error") return classes.alertError;
			else if (noticeType === "info") return classes.alertInfo;
		};
		$[0] = classes.alertError;
		$[1] = classes.alertInfo;
		$[2] = classes.alertPrimary;
		$[3] = classes.alertSecondary;
		$[4] = classes.alertSuccess;
		$[5] = classes.alertWarning;
		$[6] = noticeType;
		$[7] = t0;
	} else t0 = $[7];
	const alertColor = t0;
	let t1;
	if ($[8] !== noticeType || $[9] !== theme) {
		t1 = () => {
			if (noticeType === "secondary") return theme.palette.secondary.main;
			else if (noticeType === "primary") return theme.palette.primary.main;
			else if (noticeType === "success") return theme.palette.success.main;
			else if (noticeType === "warning") return theme.palette.warning.main;
			else if (noticeType === "error") return theme.palette.error.main;
			else if (noticeType === "info") return theme.palette.info.main;
		};
		$[8] = noticeType;
		$[9] = theme;
		$[10] = t1;
	} else t1 = $[10];
	const alertText = t1;
	const t2 = classes.root;
	let t3;
	if ($[11] !== alertColor) {
		t3 = alertColor();
		$[11] = alertColor;
		$[12] = t3;
	} else t3 = $[12];
	let t4;
	if ($[13] !== t3) {
		t4 = { root: t3 };
		$[13] = t3;
		$[14] = t4;
	} else t4 = $[14];
	let t5;
	if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
		t5 = {
			vertical: "bottom",
			horizontal: "right"
		};
		$[15] = t5;
	} else t5 = $[15];
	let t6;
	if ($[16] !== alertText) {
		t6 = alertText();
		$[16] = alertText;
		$[17] = t6;
	} else t6 = $[17];
	let t7;
	if ($[18] !== t6) {
		t7 = { color: t6 };
		$[18] = t6;
		$[19] = t7;
	} else t7 = $[19];
	let t8;
	if ($[20] !== noticeAction || $[21] !== noticeButton || $[22] !== t7) {
		t8 = /* @__PURE__ */ React.createElement(Button, {
			style: t7,
			size: "small",
			onClick: noticeAction
		}, noticeButton);
		$[20] = noticeAction;
		$[21] = noticeButton;
		$[22] = t7;
		$[23] = t8;
	} else t8 = $[23];
	let t9;
	if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
		t9 = { color: "white" };
		$[24] = t9;
	} else t9 = $[24];
	let t10;
	if ($[25] !== classes.icon || $[26] !== closeNotice) {
		t10 = /* @__PURE__ */ React.createElement(FluentIconButton, {
			style: t9,
			size: "small",
			onClick: closeNotice,
			icon: ChromeCloseIcon,
			className: classes.icon
		});
		$[25] = classes.icon;
		$[26] = closeNotice;
		$[27] = t10;
	} else t10 = $[27];
	let t11;
	if ($[28] !== t10 || $[29] !== t8) {
		t11 = /* @__PURE__ */ React.createElement("div", null, t8, t10);
		$[28] = t10;
		$[29] = t8;
		$[30] = t11;
	} else t11 = $[30];
	let t12;
	if ($[31] !== closeNotice || $[32] !== noticeMessage || $[33] !== noticeOpen || $[34] !== t11 || $[35] !== t4) {
		t12 = /* @__PURE__ */ React.createElement(Snackbar, {
			classes: t4,
			anchorOrigin: t5,
			open: noticeOpen,
			onClose: closeNotice,
			message: noticeMessage,
			key: 1,
			action: t11
		});
		$[31] = closeNotice;
		$[32] = noticeMessage;
		$[33] = noticeOpen;
		$[34] = t11;
		$[35] = t4;
		$[36] = t12;
	} else t12 = $[36];
	let t13;
	if ($[37] !== classes.root || $[38] !== t12) {
		t13 = /* @__PURE__ */ React.createElement("div", { className: t2 }, t12);
		$[37] = classes.root;
		$[38] = t12;
		$[39] = t13;
	} else t13 = $[39];
	return t13;
};
//#endregion
export { AmbientToast };

//# sourceMappingURL=AmbientToast.mjs.map