import { FluentSearchField } from "../../UI/inputs/textField/FluentSearchField.mjs";
import { ActionSummaryListContainer } from "./ActionSummaryListContainer.mjs";
import { ActionSummaryHeader } from "./ActionSummaryHeader.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
import { Typography, makeStyles } from "@material-ui/core";
//#region src/actions/actionSummary/ActionSummaryCard.tsx
const useStyles = makeStyles((theme) => ({
	root: {
		width: 750,
		paddingLeft: 12,
		paddingRight: 12,
		maxHeight: 750,
		overflowY: "scroll"
	},
	header: {
		display: "flex",
		justifyContent: "space-between"
	}
}));
const ActionSummaryCard = (t0) => {
	const $ = c(19);
	const { actionMenuContent, selectedNode } = t0;
	const classes = useStyles();
	const [searchValue, setSearchValue] = useState("");
	const t1 = classes.root;
	let t2;
	if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
		t2 = /* @__PURE__ */ React.createElement("div", { style: {
			display: "flex",
			justifyContent: "center",
			flexDirection: "column"
		} }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, "Actions"));
		$[0] = t2;
	} else t2 = $[0];
	let t3;
	if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = (e) => setSearchValue(e.target.value);
		$[1] = t3;
	} else t3 = $[1];
	let t4;
	if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
		t4 = {
			marginTop: 0,
			paddingTop: 0
		};
		$[2] = t4;
	} else t4 = $[2];
	let t5;
	if ($[3] !== searchValue) {
		t5 = /* @__PURE__ */ React.createElement(FluentSearchField, {
			id: "udpRecord-ActionSummaryCard-Search",
			udprecordid: "udpRecord-ActionSummaryCard-Search",
			value: searchValue,
			onChange: t3,
			variant: "filled",
			style: t4
		});
		$[3] = searchValue;
		$[4] = t5;
	} else t5 = $[4];
	let t6;
	if ($[5] !== classes.header || $[6] !== t5) {
		t6 = /* @__PURE__ */ React.createElement("div", { className: classes.header }, t2, t5);
		$[5] = classes.header;
		$[6] = t5;
		$[7] = t6;
	} else t6 = $[7];
	let t7;
	if ($[8] !== actionMenuContent || $[9] !== searchValue || $[10] !== selectedNode) {
		let t8;
		if ($[12] !== searchValue || $[13] !== selectedNode) {
			t8 = (section, i) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ActionSummaryHeader, {
				key: i,
				iconType: section.iconType,
				icon: section.icon,
				header: section.header
			}), /* @__PURE__ */ React.createElement(ActionSummaryListContainer, {
				key: i,
				selectedNode,
				items: section.items.map((item) => {
					const highlighted = item?.value && item.value.toLowerCase().includes(searchValue.toLowerCase()) && searchValue.length > 0;
					return {
						...item,
						highlighted: highlighted || item.highlighted
					};
				})
			}));
			$[12] = searchValue;
			$[13] = selectedNode;
			$[14] = t8;
		} else t8 = $[14];
		t7 = actionMenuContent.map(t8);
		$[8] = actionMenuContent;
		$[9] = searchValue;
		$[10] = selectedNode;
		$[11] = t7;
	} else t7 = $[11];
	let t8;
	if ($[15] !== classes.root || $[16] !== t6 || $[17] !== t7) {
		t8 = /* @__PURE__ */ React.createElement("div", { className: t1 }, t6, t7);
		$[15] = classes.root;
		$[16] = t6;
		$[17] = t7;
		$[18] = t8;
	} else t8 = $[18];
	return t8;
};
//#endregion
export { ActionSummaryCard };

//# sourceMappingURL=ActionSummaryCard.mjs.map