import WidgetCard from "../../WidgetCard.mjs";
import FluentPrimaryStatNumber from "../../FluentComponents/molecules/FluentPrimaryStatNumber.mjs";
import FluentSecondaryStatNumber from "../../FluentComponents/molecules/FluentSecondaryStatNumber.mjs";
import { c } from "react-compiler-runtime";
import React, { forwardRef } from "react";
import { Grid, makeStyles } from "@material-ui/core";
//#region src/UI/widgets/library/DateTrendWidget/DateTrendWidget.jsx
const useStyles = makeStyles((theme) => ({ column: { width: 160 } }));
const layout = {
	w: {
		default: 2,
		min: 0,
		max: 4
	},
	h: {
		default: 2,
		min: 0,
		max: 4
	}
};
const DateTrendWidget = (props, ref) => {
	const $ = c(24);
	const classes = useStyles();
	let children;
	let other;
	let params;
	if ($[0] !== props) {
		const { children: t0, params: t1, setParam, ...t2 } = props;
		children = t0;
		params = t1;
		other = t2;
		$[0] = props;
		$[1] = children;
		$[2] = other;
		$[3] = params;
	} else {
		children = $[1];
		other = $[2];
		params = $[3];
	}
	const { mockData, theme } = params;
	const t0 = mockData?.title;
	const t1 = mockData?.primary.value;
	const t2 = mockData?.primary.label;
	let t3;
	if ($[4] !== t1 || $[5] !== t2) {
		t3 = /* @__PURE__ */ React.createElement(FluentPrimaryStatNumber, {
			mainStat: t1,
			mainLabel: t2
		});
		$[4] = t1;
		$[5] = t2;
		$[6] = t3;
	} else t3 = $[6];
	let t4;
	if ($[7] !== classes.column || $[8] !== t3) {
		t4 = /* @__PURE__ */ React.createElement(Grid, {
			item: true,
			className: classes.column
		}, t3);
		$[7] = classes.column;
		$[8] = t3;
		$[9] = t4;
	} else t4 = $[9];
	let t5;
	if ($[10] !== mockData?.secondary) {
		t5 = mockData?.secondary.map(_temp);
		$[10] = mockData?.secondary;
		$[11] = t5;
	} else t5 = $[11];
	let t6;
	if ($[12] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(Grid, { item: true }, t5);
		$[12] = t5;
		$[13] = t6;
	} else t6 = $[13];
	let t7;
	if ($[14] !== t4 || $[15] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(Grid, {
			container: true,
			direction: "row",
			spacing: 1
		}, t4, t6);
		$[14] = t4;
		$[15] = t6;
		$[16] = t7;
	} else t7 = $[16];
	let t8;
	if ($[17] !== children || $[18] !== other || $[19] !== ref || $[20] !== t0 || $[21] !== t7 || $[22] !== theme) {
		t8 = /* @__PURE__ */ React.createElement(WidgetCard, {
			ref,
			...other,
			title: t0,
			theme
		}, t7, children);
		$[17] = children;
		$[18] = other;
		$[19] = ref;
		$[20] = t0;
		$[21] = t7;
		$[22] = theme;
		$[23] = t8;
	} else t8 = $[23];
	return t8;
};
var DateTrendWidget_default = forwardRef(DateTrendWidget);
function _temp(secondary) {
	return /* @__PURE__ */ React.createElement(Grid, {
		item: true,
		key: secondary.category
	}, /* @__PURE__ */ React.createElement(FluentSecondaryStatNumber, {
		secondaryStat: secondary.value,
		secondaryLabel: secondary.category,
		trend: secondary.value < 0 ? "down" : "up"
	}));
}
//#endregion
export { DateTrendWidget_default as default, layout };

//# sourceMappingURL=DateTrendWidget.mjs.map