import { Field } from "../../../../utilities/form/Field.mjs";
import { LayoutUnit } from "../../../../layout/LayoutUnit.mjs";
import { SideSheet } from "../../../../UI/surfaces/SideSheet.mjs";
import { FluentTextField } from "../../../../UI/inputs/textField/FluentTextField.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { FormControlLabel, Switch } from "@material-ui/core";
import { useTranslation } from "react-i18next";
//#region src/udp/pages/UdpTransactionTypesPage/sidesheets/UdpTransactionTypePageConfigurationSidesheet.jsx
const UdpTransactionTypePageConfigurationSidesheet = (props) => {
	const $ = c(49);
	const { initialData, isSidesheetOpen, setIsSidesheetOpen } = props;
	const { t } = useTranslation();
	let t0;
	if ($[0] !== t) {
		t0 = t("Page Configurations");
		$[0] = t;
		$[1] = t0;
	} else t0 = $[1];
	let t1;
	if ($[2] !== setIsSidesheetOpen) {
		t1 = () => setIsSidesheetOpen(false);
		$[2] = setIsSidesheetOpen;
		$[3] = t1;
	} else t1 = $[3];
	let t2;
	if ($[4] !== t) {
		t2 = t("Grid Title");
		$[4] = t;
		$[5] = t2;
	} else t2 = $[5];
	const t3 = initialData?.pageConfiguration?.gridTitle || "";
	let t4;
	if ($[6] !== t2 || $[7] !== t3) {
		t4 = /* @__PURE__ */ React.createElement(Field, {
			component: FluentTextField,
			label: t2,
			id: "gridTitle",
			name: "gridTitle",
			fullWidth: true,
			variant: "outlined",
			margin: "normal",
			size: "small",
			initialValue: t3
		});
		$[6] = t2;
		$[7] = t3;
		$[8] = t4;
	} else t4 = $[8];
	let t5;
	if ($[9] !== t) {
		t5 = t("Create Transaction Button Label");
		$[9] = t;
		$[10] = t5;
	} else t5 = $[10];
	const t6 = initialData?.pageConfiguration?.createTransactionButtonLabel || "";
	let t7;
	if ($[11] !== t5 || $[12] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(Field, {
			component: FluentTextField,
			label: t5,
			id: "createTransactionButtonLabel",
			name: "createTransactionButtonLabel",
			fullWidth: true,
			variant: "outlined",
			margin: "normal",
			size: "small",
			initialValue: t6
		});
		$[11] = t5;
		$[12] = t6;
		$[13] = t7;
	} else t7 = $[13];
	let t8;
	if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
		t8 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "nudge" });
		$[14] = t8;
	} else t8 = $[14];
	const t9 = !!initialData?.pageConfiguration?.hideCreateTransaction;
	let t10;
	if ($[15] !== t9) {
		t10 = /* @__PURE__ */ React.createElement(Field, {
			component: Switch,
			id: "hideCreateTransaction",
			name: "hideCreateTransaction",
			type: "checkbox",
			initialValue: t9
		});
		$[15] = t9;
		$[16] = t10;
	} else t10 = $[16];
	let t11;
	if ($[17] !== t) {
		t11 = t("Hide Create Transaction Button");
		$[17] = t;
		$[18] = t11;
	} else t11 = $[18];
	let t12;
	if ($[19] !== t10 || $[20] !== t11) {
		t12 = /* @__PURE__ */ React.createElement(FormControlLabel, {
			control: t10,
			label: t11
		});
		$[19] = t10;
		$[20] = t11;
		$[21] = t12;
	} else t12 = $[21];
	let t13;
	if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
		t13 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "nudge" });
		$[22] = t13;
	} else t13 = $[22];
	const t14 = initialData ? initialData?.pageConfiguration?.paginationAutoPageSize : true;
	let t15;
	if ($[23] !== t14) {
		t15 = /* @__PURE__ */ React.createElement(Field, {
			component: Switch,
			id: "paginationAutoPageSize",
			name: "paginationAutoPageSize",
			type: "checkbox",
			initialValue: t14
		});
		$[23] = t14;
		$[24] = t15;
	} else t15 = $[24];
	let t16;
	if ($[25] !== t) {
		t16 = t("Pagination Auto PageSize");
		$[25] = t;
		$[26] = t16;
	} else t16 = $[26];
	let t17;
	if ($[27] !== t15 || $[28] !== t16) {
		t17 = /* @__PURE__ */ React.createElement(FormControlLabel, {
			control: t15,
			label: t16
		});
		$[27] = t15;
		$[28] = t16;
		$[29] = t17;
	} else t17 = $[29];
	let t18;
	if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
		t18 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "nudge" });
		$[30] = t18;
	} else t18 = $[30];
	const t19 = !!initialData?.pageConfiguration?.hideSaveChanges;
	let t20;
	if ($[31] !== t19) {
		t20 = /* @__PURE__ */ React.createElement(Field, {
			component: Switch,
			id: "hideSaveChanges",
			name: "hideSaveChanges",
			type: "checkbox",
			initialValue: t19
		});
		$[31] = t19;
		$[32] = t20;
	} else t20 = $[32];
	let t21;
	if ($[33] !== t) {
		t21 = t("Hide Save Changes Button");
		$[33] = t;
		$[34] = t21;
	} else t21 = $[34];
	let t22;
	if ($[35] !== t20 || $[36] !== t21) {
		t22 = /* @__PURE__ */ React.createElement(FormControlLabel, {
			control: t20,
			label: t21
		});
		$[35] = t20;
		$[36] = t21;
		$[37] = t22;
	} else t22 = $[37];
	let t23;
	if ($[38] !== t12 || $[39] !== t17 || $[40] !== t22 || $[41] !== t4 || $[42] !== t7) {
		t23 = /* @__PURE__ */ React.createElement(React.Fragment, null, t4, t7, t8, t12, t13, t17, t18, t22);
		$[38] = t12;
		$[39] = t17;
		$[40] = t22;
		$[41] = t4;
		$[42] = t7;
		$[43] = t23;
	} else t23 = $[43];
	let t24;
	if ($[44] !== isSidesheetOpen || $[45] !== t0 || $[46] !== t1 || $[47] !== t23) {
		t24 = /* @__PURE__ */ React.createElement(SideSheet, {
			open: isSidesheetOpen,
			width: 600,
			title: t0,
			onClose: t1
		}, t23);
		$[44] = isSidesheetOpen;
		$[45] = t0;
		$[46] = t1;
		$[47] = t23;
		$[48] = t24;
	} else t24 = $[48];
	return t24;
};
//#endregion
export { UdpTransactionTypePageConfigurationSidesheet as default };

//# sourceMappingURL=UdpTransactionTypePageConfigurationSidesheet.mjs.map