import { AmbientCard } from "../../surfaces/cards/AmbientCard/AmbientCard.mjs";
import { EmptyStateDisplay } from "../EmptyStateDisplay.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
import clsx from "clsx";
import { PropTypes as PropTypes$1 } from "prop-types";
import { useTranslation } from "react-i18next";
import { MuiVegaLite } from "@material-vega/material-ui";
//#region src/UI/dataDisplay/GraphCard/GraphCard.jsx
const useStyles = makeStyles((theme) => ({
	infoPanel: {
		display: "flex",
		flexDirection: "row",
		justifyContent: "space-around",
		alignItems: "center",
		alignSelf: "stretch",
		padding: "10px 32px"
	},
	graphSection: {
		overflow: "hidden",
		"& svg": {
			width: "100%",
			height: "100%"
		},
		"& .vega-embed": {
			width: "100%",
			height: "100%"
		},
		paddingTop: theme.spacing(1),
		margin: 0,
		height: (props) => props?.graphHeight ?? "255px"
	},
	emptyStateDisplay: {
		marginTop: theme.spacing(1),
		marginBottom: theme.spacing(1)
	}
}));
/**
* `GraphCard` component
*/
const GraphCard = (props) => {
	const $ = c(34);
	let children;
	let emptyStateClassName;
	let emptyStateIcon;
	let emptyStateIconSize;
	let emptyStateImageSrc;
	let emptyStateImageWidth;
	let emptyStatePrimaryText;
	let graphSpecs;
	let headerColor;
	let otherProps;
	let t0;
	let t1;
	let title;
	if ($[0] !== props) {
		const { title: t2, showInfoPanel: t3, graphSpecs: t4, children: t5, headerColor: t6, className, noData: t7, emptyStatePrimaryText: t8, emptyStateImageSrc: t9, emptyStateIconSize: t10, emptyStateImageWidth: t11, emptyStateClassName: t12, emptyStateIcon: t13, ...t14 } = props;
		title = t2;
		t0 = t3;
		graphSpecs = t4;
		children = t5;
		headerColor = t6;
		t1 = t7;
		emptyStatePrimaryText = t8;
		emptyStateImageSrc = t9;
		emptyStateIconSize = t10;
		emptyStateImageWidth = t11;
		emptyStateClassName = t12;
		emptyStateIcon = t13;
		otherProps = t14;
		$[0] = props;
		$[1] = children;
		$[2] = emptyStateClassName;
		$[3] = emptyStateIcon;
		$[4] = emptyStateIconSize;
		$[5] = emptyStateImageSrc;
		$[6] = emptyStateImageWidth;
		$[7] = emptyStatePrimaryText;
		$[8] = graphSpecs;
		$[9] = headerColor;
		$[10] = otherProps;
		$[11] = t0;
		$[12] = t1;
		$[13] = title;
	} else {
		children = $[1];
		emptyStateClassName = $[2];
		emptyStateIcon = $[3];
		emptyStateIconSize = $[4];
		emptyStateImageSrc = $[5];
		emptyStateImageWidth = $[6];
		emptyStatePrimaryText = $[7];
		graphSpecs = $[8];
		headerColor = $[9];
		otherProps = $[10];
		t0 = $[11];
		t1 = $[12];
		title = $[13];
	}
	const showInfoPanel = t0 === void 0 ? true : t0;
	const noData = t1 === void 0 ? false : t1;
	const classes = useStyles(props);
	const { t } = useTranslation();
	let t2;
	if ($[14] !== children || $[15] !== classes.emptyStateDisplay || $[16] !== classes.graphSection || $[17] !== classes.infoPanel || $[18] !== emptyStateClassName || $[19] !== emptyStateIcon || $[20] !== emptyStateIconSize || $[21] !== emptyStateImageSrc || $[22] !== emptyStateImageWidth || $[23] !== emptyStatePrimaryText || $[24] !== graphSpecs || $[25] !== noData || $[26] !== showInfoPanel || $[27] !== t) {
		t2 = !noData ? /* @__PURE__ */ React.createElement("div", null, showInfoPanel && /* @__PURE__ */ React.createElement("div", { className: classes.infoPanel }, children), /* @__PURE__ */ React.createElement("div", { className: classes.graphSection }, /* @__PURE__ */ React.createElement(MuiVegaLite, {
			variant: "verticalBarChart",
			background: "paper",
			autoResize: true,
			actions: false,
			spec: graphSpecs || {}
		}))) : /* @__PURE__ */ React.createElement("div", { className: clsx(classes.emptyStateDisplay, emptyStateClassName) }, /* @__PURE__ */ React.createElement(EmptyStateDisplay, {
			primaryText: emptyStatePrimaryText ?? t("No results found"),
			icon: emptyStateIcon,
			iconSize: emptyStateIconSize,
			imageSrc: emptyStateImageSrc,
			imageWidth: emptyStateImageWidth
		}));
		$[14] = children;
		$[15] = classes.emptyStateDisplay;
		$[16] = classes.graphSection;
		$[17] = classes.infoPanel;
		$[18] = emptyStateClassName;
		$[19] = emptyStateIcon;
		$[20] = emptyStateIconSize;
		$[21] = emptyStateImageSrc;
		$[22] = emptyStateImageWidth;
		$[23] = emptyStatePrimaryText;
		$[24] = graphSpecs;
		$[25] = noData;
		$[26] = showInfoPanel;
		$[27] = t;
		$[28] = t2;
	} else t2 = $[28];
	let t3;
	if ($[29] !== headerColor || $[30] !== otherProps || $[31] !== t2 || $[32] !== title) {
		t3 = /* @__PURE__ */ React.createElement(AmbientCard, {
			fullWidth: true,
			title,
			headerColor,
			...otherProps
		}, t2);
		$[29] = headerColor;
		$[30] = otherProps;
		$[31] = t2;
		$[32] = title;
		$[33] = t3;
	} else t3 = $[33];
	return t3;
};
GraphCard.propTypes = {
	title: PropTypes$1.string,
	graphSpecs: PropTypes$1.object.isRequired,
	showInfoPanel: PropTypes$1.bool,
	children: PropTypes$1.node,
	style: PropTypes$1.object
};
//#endregion
export { GraphCard };

//# sourceMappingURL=GraphCard.mjs.map