import { fluentLibraryIcons } from "../../../assets/unityIcons/LibraryData.mjs";
import { useReadMetaData } from "../hooks/useReadMetaData.mjs";
import { AmbientGridTemplate } from "../../../UI/templates/deprecated/AmbientGridTemplate/AmbientGridTemplate.mjs";
import { TableColumnDefs } from "../utils/TableColumnDefs.mjs";
import { ActionsRenderer } from "../../../UI/templates/ui/renderers/ActionsRenderer.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Grid } from "@material-ui/core";
//#region src/componentSystems/pageRenderer/wrappers/AgGridSimpleWrapper.jsx
const groupData = [
	{
		groupItem: "instructors",
		label: "Instructors",
		value: "instructors"
	},
	{
		groupItem: "tabs",
		label: "Tabs",
		value: "tabs"
	},
	{
		groupItem: "name",
		label: "Course Name",
		value: "name"
	},
	{
		groupItem: "status",
		label: "Status",
		value: "status"
	},
	{
		groupItem: "start",
		label: "Start Date",
		value: "start"
	}
];
const AgGridSimpleWrapper = (props) => {
	const $ = c(14);
	const { propsComponent } = props;
	const { id, columnSize, columnDefs, actionsList, values } = useReadMetaData(propsComponent);
	let t0;
	bb0: {
		if (columnDefs?.length) {
			let t1;
			if ($[0] !== actionsList || $[1] !== columnDefs) {
				const newActionsList = actionsList?.map(_temp2);
				t1 = TableColumnDefs(columnDefs, newActionsList);
				$[0] = actionsList;
				$[1] = columnDefs;
				$[2] = t1;
			} else t1 = $[2];
			t0 = t1;
			break bb0;
		}
		let t1;
		if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
			t1 = [];
			$[3] = t1;
		} else t1 = $[3];
		t0 = t1;
	}
	const columnDefinitions = t0;
	const t1 = columnSize?.xs;
	const t2 = columnSize?.sm;
	const t3 = columnSize?.md;
	let t4;
	if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
		t4 = { actionsRenderer: ActionsRenderer };
		$[4] = t4;
	} else t4 = $[4];
	let t5;
	if ($[5] !== columnDefinitions || $[6] !== values) {
		t5 = /* @__PURE__ */ React.createElement(AmbientGridTemplate, {
			title: "Course List",
			data: values,
			columnDefs: columnDefinitions,
			frameworkComponents: t4,
			groupingData: groupData
		});
		$[5] = columnDefinitions;
		$[6] = values;
		$[7] = t5;
	} else t5 = $[7];
	let t6;
	if ($[8] !== id || $[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(Grid, {
			item: true,
			xs: t1,
			sm: t2,
			md: t3,
			key: id
		}, t5);
		$[8] = id;
		$[9] = t1;
		$[10] = t2;
		$[11] = t3;
		$[12] = t5;
		$[13] = t6;
	} else t6 = $[13];
	return t6;
};
function _temp() {}
function _temp2(actionItem) {
	return {
		...actionItem,
		icon: fluentLibraryIcons.find((x) => x.id === actionItem.icon)?.icon || actionItem.icon,
		onClick: _temp
	};
}
//#endregion
export { AgGridSimpleWrapper };

//# sourceMappingURL=AgGridSimpleWrapper.mjs.map