import { E as compilerRuntimeExports, r as reactExports, j as jsxRuntimeExports } from "./vendor-react-DYNCg6N5.js";
import { c as useAppSelector, a9 as FilialInfoPanelsEnum, aT as SettingsEnum, i as isSaaS, aU as axiosInstance, I as IFiltersEnumType, aV as EditIcon } from "./index-DfebxkL9.js";
import { u as useSaveSettings } from "./useSaveSettings-GkZlPEM1.js";
import { v as zKe, w as qXe, y as IconTrash, A as IconEdit, c as IconUsersGroup, C as ES, b as gq, F as IconX, H as IconPencil, J as IconChevronDown, K as IconLock } from "./vendor-icons-xWhXK_Ui.js";
import { A as AddButton } from "./index-72JBTuLT.js";
import { u as useStyles } from "./styles-rKP3r-bS.js";
import { o as objectType, a as arrayType, s as stringType, n as numberType, b as booleanType, c as anyType, d as coerce, e as nativeEnumType } from "./types-espwwxTQ.js";
import { u as useTranslation, t } from "./vendor-i18n-wisIXUFi.js";
import { a9 as zodResolver, z as useForm, F as Flex, E as TextInput, h as ActionIcon, T as Text, R as Radio, B as Button, ad as NumberInput, d as Checkbox, k as Tooltip, $ as Table, g as Loader, O as Badge, c as createStyles, Y as Skeleton, s as showNotification, ae as Input, a4 as Select, a6 as notifications, af as Switch, ag as Alert, b as Box, V as LoadingOverlay } from "./vendor-mantine-h0WlM2Mj.js";
import { g as getValidateErrors } from "./validation-Ds00Zghx.js";
import { P as PopUpUI } from "./index-DGrXxZ89.js";
import { P as PillsInputAutoCompleteWithQuery } from "./index-BBtw-2vv.js";
import { S as SectionTemplate } from "./index-CbTPqI7c.js";
import { M as Modal } from "./index-DqcA8P_y.js";
import "./styles-3NoIlzov.js";
import "./useDebounce-DTubzIUC.js";
const tranformAdrressesToForm = (addresses) => addresses.map((address) => ({
  address
}));
const tranformAdrresses = (addresses) => {
  return addresses.map(({
    address
  }) => address);
};
const isValidIPv4 = (value) => {
  return stringType().ip({
    version: "v4"
  }).safeParse(value).success;
};
const validateSchemeIpSecurity = (t2) => objectType({
  addresses: arrayType(objectType({
    address: stringType().refine((value) => {
      if (value.includes("-")) {
        const indexOfSeparator = value.indexOf("-");
        const startIp = value.substring(0, indexOfSeparator);
        const endIp = value.substring(indexOfSeparator + 1);
        return isValidIPv4(startIp) && isValidIPv4(endIp);
      }
      return true;
    }, {
      message: t2("validation.ipAddressRange")
    }).refine((value) => {
      if (value.includes("-")) {
        return true;
      }
      return isValidIPv4(value);
    }, {
      message: t2("validation.ipAddress")
    })
  }))
});
const IPSecurityUsers = () => {
  const $ = compilerRuntimeExports.c(70);
  const {
    classes: classes2
  } = useStyles();
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector(_temp$f);
  const saveSettings = useSaveSettings();
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = [];
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  let t1;
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
    t1 = {
      addresses: t0,
      enabled: false
    };
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  let t22;
  if ($[2] !== t2) {
    t22 = zodResolver(validateSchemeIpSecurity(t2));
    $[2] = t2;
    $[3] = t22;
  } else {
    t22 = $[3];
  }
  let t3;
  if ($[4] !== t22) {
    t3 = {
      validateInputOnChange: true,
      initialValues: t1,
      validate: t22
    };
    $[4] = t22;
    $[5] = t3;
  } else {
    t3 = $[5];
  }
  const form2 = useForm(t3);
  let t4;
  if ($[6] !== form2) {
    t4 = Object.keys(form2.errors).length !== 0 || !form2.isDirty() || !form2.values.addresses.length && form2.values.enabled;
    $[6] = form2;
    $[7] = t4;
  } else {
    t4 = $[7];
  }
  const isDisabledSubmit = t4;
  let t5;
  if ($[8] !== (filial == null ? void 0 : filial.Settings) || $[9] !== form2) {
    t5 = () => {
      const {
        UserIp
      } = (filial == null ? void 0 : filial.Settings) || {};
      if (!UserIp) {
        return;
      }
      const formData = {
        addresses: tranformAdrressesToForm(UserIp.IpAdresses || []),
        enabled: UserIp.Enabled
      };
      form2.setValues(formData);
      form2.resetDirty(formData);
    };
    $[8] = filial == null ? void 0 : filial.Settings;
    $[9] = form2;
    $[10] = t5;
  } else {
    t5 = $[10];
  }
  let t6;
  if ($[11] !== filial) {
    t6 = [filial];
    $[11] = filial;
    $[12] = t6;
  } else {
    t6 = $[12];
  }
  reactExports.useEffect(t5, t6);
  let t7;
  if ($[13] !== filial || $[14] !== form2.values.addresses || $[15] !== form2.values.enabled || $[16] !== saveSettings) {
    t7 = () => {
      if (!filial) {
        return;
      }
      saveSettings(filial.Id, SettingsEnum.UserIp, {
        UserIp: {
          Enabled: form2.values.enabled,
          IpAdresses: tranformAdrresses(form2.values.addresses)
        }
      });
    };
    $[13] = filial;
    $[14] = form2.values.addresses;
    $[15] = form2.values.enabled;
    $[16] = saveSettings;
    $[17] = t7;
  } else {
    t7 = $[17];
  }
  const handleSubmit = t7;
  const t8 = classes2.section;
  const t9 = classes2.title;
  let t10;
  if ($[18] !== t2) {
    t10 = t2("filialSecurity.ipSecurityForUsers");
    $[18] = t2;
    $[19] = t10;
  } else {
    t10 = $[19];
  }
  let t11;
  if ($[20] !== classes2.title || $[21] !== t10) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Text, { className: t9, children: [
      " ",
      t10
    ] });
    $[20] = classes2.title;
    $[21] = t10;
    $[22] = t11;
  } else {
    t11 = $[22];
  }
  const t12 = classes2.radio;
  const t13 = !form2.values.enabled;
  let t14;
  if ($[23] !== form2) {
    t14 = () => {
      form2.setValues({
        enabled: false,
        addresses: []
      });
    };
    $[23] = form2;
    $[24] = t14;
  } else {
    t14 = $[24];
  }
  let t15;
  if ($[25] !== t2) {
    t15 = t2("disable");
    $[25] = t2;
    $[26] = t15;
  } else {
    t15 = $[26];
  }
  let t16;
  if ($[27] !== classes2.radio || $[28] !== t13 || $[29] !== t14 || $[30] !== t15) {
    t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: t12, size: "xs", checked: t13, onChange: t14, label: t15 });
    $[27] = classes2.radio;
    $[28] = t13;
    $[29] = t14;
    $[30] = t15;
    $[31] = t16;
  } else {
    t16 = $[31];
  }
  const t17 = classes2.radio;
  const t18 = form2.values.enabled;
  let t19;
  if ($[32] !== form2) {
    t19 = () => form2.setValues({
      enabled: true
    });
    $[32] = form2;
    $[33] = t19;
  } else {
    t19 = $[33];
  }
  let t20;
  if ($[34] !== t2) {
    t20 = t2("enable");
    $[34] = t2;
    $[35] = t20;
  } else {
    t20 = $[35];
  }
  let t21;
  if ($[36] !== classes2.radio || $[37] !== form2.values.enabled || $[38] !== t19 || $[39] !== t20) {
    t21 = /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: t17, size: "xs", checked: t18, onChange: t19, label: t20 });
    $[36] = classes2.radio;
    $[37] = form2.values.enabled;
    $[38] = t19;
    $[39] = t20;
    $[40] = t21;
  } else {
    t21 = $[40];
  }
  let t222;
  if ($[41] !== form2 || $[42] !== handleSubmit) {
    t222 = form2.onSubmit(handleSubmit);
    $[41] = form2;
    $[42] = handleSubmit;
    $[43] = t222;
  } else {
    t222 = $[43];
  }
  let t23;
  if ($[44] !== classes2.addButton || $[45] !== classes2.textFieldInput || $[46] !== form2 || $[47] !== t2) {
    t23 = form2.values.enabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", direction: "column", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(AddButton, { className: classes2.addButton, onClick: () => {
        form2.insertListItem("addresses", {
          address: ""
        });
      }, children: t2("filialSecurity.addAllowedIpAddress") }),
      form2.values.addresses.map((item, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", mt: "sm", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { style: {
          width: "220px"
        }, className: classes2.textFieldInput, id: item.address, ...form2.getInputProps(`addresses.${index}.address`) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { className: "action-icon", onClick: () => form2.removeListItem("addresses", index), ml: "sm", mt: 5, children: /* @__PURE__ */ jsxRuntimeExports.jsx(zKe, { size: "1.3rem", color: "#667085", stroke: 1.5, style: {
          pointerEvents: "none"
        } }) })
      ] }, index))
    ] });
    $[44] = classes2.addButton;
    $[45] = classes2.textFieldInput;
    $[46] = form2;
    $[47] = t2;
    $[48] = t23;
  } else {
    t23 = $[48];
  }
  const t24 = classes2.description;
  let t25;
  if ($[49] !== t2) {
    t25 = t2("filialSecurity.ipSecurityUsersDescription");
    $[49] = t2;
    $[50] = t25;
  } else {
    t25 = $[50];
  }
  let t26;
  if ($[51] !== classes2.description || $[52] !== t25) {
    t26 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t24, mt: "sm", mb: "md", children: t25 });
    $[51] = classes2.description;
    $[52] = t25;
    $[53] = t26;
  } else {
    t26 = $[53];
  }
  let t27;
  if ($[54] !== t2) {
    t27 = t2("save");
    $[54] = t2;
    $[55] = t27;
  } else {
    t27 = $[55];
  }
  let t28;
  if ($[56] !== isDisabledSubmit || $[57] !== t27) {
    t28 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: isDisabledSubmit, size: "sm", radius: 8, mr: "sm", type: "submit", children: t27 });
    $[56] = isDisabledSubmit;
    $[57] = t27;
    $[58] = t28;
  } else {
    t28 = $[58];
  }
  let t29;
  if ($[59] !== t222 || $[60] !== t23 || $[61] !== t26 || $[62] !== t28) {
    t29 = /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: t222, children: [
      t23,
      t26,
      t28
    ] });
    $[59] = t222;
    $[60] = t23;
    $[61] = t26;
    $[62] = t28;
    $[63] = t29;
  } else {
    t29 = $[63];
  }
  let t30;
  if ($[64] !== classes2.section || $[65] !== t11 || $[66] !== t16 || $[67] !== t21 || $[68] !== t29) {
    t30 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: t8, align: "flex-start", direction: "column", "data-section": FilialInfoPanelsEnum.ipSecurityUsers, children: [
      t11,
      t16,
      t21,
      t29
    ] });
    $[64] = classes2.section;
    $[65] = t11;
    $[66] = t16;
    $[67] = t21;
    $[68] = t29;
    $[69] = t30;
  } else {
    t30 = $[69];
  }
  return t30;
};
function _temp$f(state) {
  return state.filials;
}
const IPSecurityAdm = () => {
  const $ = compilerRuntimeExports.c(71);
  const {
    classes: classes2
  } = useStyles();
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector(_temp$e);
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = [];
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  let t1;
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
    t1 = {
      addresses: t0,
      enabled: false
    };
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  let t22;
  if ($[2] !== t2) {
    t22 = zodResolver(validateSchemeIpSecurity(t2));
    $[2] = t2;
    $[3] = t22;
  } else {
    t22 = $[3];
  }
  let t3;
  if ($[4] !== t22) {
    t3 = {
      validateInputOnChange: true,
      initialValues: t1,
      validate: t22
    };
    $[4] = t22;
    $[5] = t3;
  } else {
    t3 = $[5];
  }
  const form2 = useForm(t3);
  let t4;
  if ($[6] !== form2) {
    t4 = Object.keys(form2.errors).length !== 0 || !form2.isDirty() || !form2.values.addresses.length && form2.values.enabled;
    $[6] = form2;
    $[7] = t4;
  } else {
    t4 = $[7];
  }
  const isDisabledSubmit = t4;
  const saveSettings = useSaveSettings();
  let t5;
  if ($[8] !== (filial == null ? void 0 : filial.Settings) || $[9] !== form2) {
    t5 = () => {
      const {
        AdminIp
      } = (filial == null ? void 0 : filial.Settings) || {};
      if (!AdminIp) {
        return;
      }
      const formData = {
        addresses: tranformAdrressesToForm(AdminIp.IpAdresses || []),
        enabled: AdminIp.Enabled
      };
      form2.setValues(formData);
      form2.resetDirty(formData);
    };
    $[8] = filial == null ? void 0 : filial.Settings;
    $[9] = form2;
    $[10] = t5;
  } else {
    t5 = $[10];
  }
  let t6;
  if ($[11] !== filial) {
    t6 = [filial];
    $[11] = filial;
    $[12] = t6;
  } else {
    t6 = $[12];
  }
  reactExports.useEffect(t5, t6);
  let t7;
  if ($[13] !== filial || $[14] !== form2.values.addresses || $[15] !== form2.values.enabled || $[16] !== saveSettings) {
    t7 = () => {
      if (!filial) {
        return;
      }
      saveSettings(filial.Id, SettingsEnum.AdminIp, {
        AdminIp: {
          Enabled: form2.values.enabled,
          IpAdresses: tranformAdrresses(form2.values.addresses)
        }
      });
    };
    $[13] = filial;
    $[14] = form2.values.addresses;
    $[15] = form2.values.enabled;
    $[16] = saveSettings;
    $[17] = t7;
  } else {
    t7 = $[17];
  }
  const handleSubmit = t7;
  const t8 = classes2.section;
  const t9 = classes2.title;
  let t10;
  if ($[18] !== t2) {
    t10 = t2("filialSecurity.ipSecurityAdministration");
    $[18] = t2;
    $[19] = t10;
  } else {
    t10 = $[19];
  }
  let t11;
  if ($[20] !== classes2.title || $[21] !== t10) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Text, { className: t9, children: [
      " ",
      t10
    ] });
    $[20] = classes2.title;
    $[21] = t10;
    $[22] = t11;
  } else {
    t11 = $[22];
  }
  const t12 = classes2.radio;
  const t13 = !form2.values.enabled;
  let t14;
  if ($[23] !== form2) {
    t14 = () => form2.setValues({
      enabled: false,
      addresses: []
    });
    $[23] = form2;
    $[24] = t14;
  } else {
    t14 = $[24];
  }
  let t15;
  if ($[25] !== t2) {
    t15 = t2("disable");
    $[25] = t2;
    $[26] = t15;
  } else {
    t15 = $[26];
  }
  let t16;
  if ($[27] !== classes2.radio || $[28] !== t13 || $[29] !== t14 || $[30] !== t15) {
    t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: t12, size: "xs", checked: t13, onChange: t14, label: t15 });
    $[27] = classes2.radio;
    $[28] = t13;
    $[29] = t14;
    $[30] = t15;
    $[31] = t16;
  } else {
    t16 = $[31];
  }
  const t17 = classes2.radio;
  const t18 = form2.values.enabled;
  let t19;
  if ($[32] !== form2) {
    t19 = () => form2.setValues({
      enabled: true
    });
    $[32] = form2;
    $[33] = t19;
  } else {
    t19 = $[33];
  }
  let t20;
  if ($[34] !== t2) {
    t20 = t2("enable");
    $[34] = t2;
    $[35] = t20;
  } else {
    t20 = $[35];
  }
  let t21;
  if ($[36] !== classes2.radio || $[37] !== form2.values.enabled || $[38] !== t19 || $[39] !== t20) {
    t21 = /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: t17, size: "xs", checked: t18, onChange: t19, label: t20 });
    $[36] = classes2.radio;
    $[37] = form2.values.enabled;
    $[38] = t19;
    $[39] = t20;
    $[40] = t21;
  } else {
    t21 = $[40];
  }
  let t222;
  if ($[41] !== form2 || $[42] !== handleSubmit) {
    t222 = form2.onSubmit(handleSubmit);
    $[41] = form2;
    $[42] = handleSubmit;
    $[43] = t222;
  } else {
    t222 = $[43];
  }
  let t23;
  if ($[44] !== classes2.addButton || $[45] !== classes2.description || $[46] !== classes2.textFieldInput || $[47] !== form2 || $[48] !== t2) {
    t23 = form2.values.enabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", direction: "column", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: classes2.description, my: "sm", children: t2("filialSecurity.ipSecurityWarningDescription") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(AddButton, { className: classes2.addButton, onClick: () => {
        form2.insertListItem("addresses", {
          address: ""
        });
      }, children: t2("filialSecurity.addAllowedIpAddress") }),
      form2.values.addresses.map((el, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", mt: "sm", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { style: {
          width: "220px"
        }, className: classes2.textFieldInput, id: el.address, ...form2.getInputProps(`addresses.${index}.address`) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { className: "action-icon", onClick: () => form2.removeListItem("addresses", index), ml: "sm", mt: 5, children: /* @__PURE__ */ jsxRuntimeExports.jsx(zKe, { size: "1.3rem", color: "#667085", stroke: 1.5, style: {
          pointerEvents: "none"
        } }) })
      ] }, index))
    ] });
    $[44] = classes2.addButton;
    $[45] = classes2.description;
    $[46] = classes2.textFieldInput;
    $[47] = form2;
    $[48] = t2;
    $[49] = t23;
  } else {
    t23 = $[49];
  }
  const t24 = classes2.description;
  let t25;
  if ($[50] !== t2) {
    t25 = t2("filialSecurity.ipSecurityAdminDescription");
    $[50] = t2;
    $[51] = t25;
  } else {
    t25 = $[51];
  }
  let t26;
  if ($[52] !== classes2.description || $[53] !== t25) {
    t26 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t24, mt: "sm", mb: "md", children: t25 });
    $[52] = classes2.description;
    $[53] = t25;
    $[54] = t26;
  } else {
    t26 = $[54];
  }
  let t27;
  if ($[55] !== t2) {
    t27 = t2("save");
    $[55] = t2;
    $[56] = t27;
  } else {
    t27 = $[56];
  }
  let t28;
  if ($[57] !== isDisabledSubmit || $[58] !== t27) {
    t28 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: isDisabledSubmit, size: "sm", radius: 8, type: "submit", mr: "sm", children: t27 });
    $[57] = isDisabledSubmit;
    $[58] = t27;
    $[59] = t28;
  } else {
    t28 = $[59];
  }
  let t29;
  if ($[60] !== t222 || $[61] !== t23 || $[62] !== t26 || $[63] !== t28) {
    t29 = /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: t222, children: [
      t23,
      t26,
      t28
    ] });
    $[60] = t222;
    $[61] = t23;
    $[62] = t26;
    $[63] = t28;
    $[64] = t29;
  } else {
    t29 = $[64];
  }
  let t30;
  if ($[65] !== classes2.section || $[66] !== t11 || $[67] !== t16 || $[68] !== t21 || $[69] !== t29) {
    t30 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: t8, align: "flex-start", direction: "column", "data-section": FilialInfoPanelsEnum.ipSecurityAdm, children: [
      t11,
      t16,
      t21,
      t29
    ] });
    $[65] = classes2.section;
    $[66] = t11;
    $[67] = t16;
    $[68] = t21;
    $[69] = t29;
    $[70] = t30;
  } else {
    t30 = $[70];
  }
  return t30;
};
function _temp$e(state) {
  return state.filials;
}
const SessionDuration = () => {
  const $ = compilerRuntimeExports.c(54);
  const {
    classes: classes2
  } = useStyles();
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector(_temp$d);
  const saveSettings = useSaveSettings();
  let t0;
  if ($[0] !== t2) {
    t0 = objectType({
      duration: numberType({
        invalid_type_error: t2("filialSecurity.errors.sessionTime")
      }).positive({
        message: t2("filialSecurity.errors.positive")
      }).max(2147483647, {
        message: t2("filialSecurity.maxSessionTime", {
          count: 2147483647
        })
      })
    });
    $[0] = t2;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const schema2 = t0;
  let t1;
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
    t1 = {
      duration: 1440
    };
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  let t22;
  if ($[3] !== schema2) {
    t22 = {
      validateInputOnChange: true,
      initialValues: t1,
      validate: (values) => getValidateErrors(schema2, values)
    };
    $[3] = schema2;
    $[4] = t22;
  } else {
    t22 = $[4];
  }
  const form2 = useForm(t22);
  const errors = form2.errors;
  let t3;
  if ($[5] !== form2) {
    t3 = form2.isDirty();
    $[5] = form2;
    $[6] = t3;
  } else {
    t3 = $[6];
  }
  const isDirtyForm = t3;
  let t4;
  if ($[7] !== errors || $[8] !== isDirtyForm) {
    t4 = Object.keys(errors).length !== 0 || !isDirtyForm;
    $[7] = errors;
    $[8] = isDirtyForm;
    $[9] = t4;
  } else {
    t4 = $[9];
  }
  const isDisabled = t4;
  let t5;
  if ($[10] !== filial || $[11] !== form2) {
    t5 = () => {
      if (!(filial == null ? void 0 : filial.Settings)) {
        return;
      }
      const formData = {
        duration: filial.Settings.SessionDuration
      };
      form2.setValues(formData);
      form2.resetDirty(formData);
    };
    $[10] = filial;
    $[11] = form2;
    $[12] = t5;
  } else {
    t5 = $[12];
  }
  let t6;
  if ($[13] !== filial) {
    t6 = [filial];
    $[13] = filial;
    $[14] = t6;
  } else {
    t6 = $[14];
  }
  reactExports.useEffect(t5, t6);
  let t7;
  if ($[15] !== filial || $[16] !== form2.values || $[17] !== saveSettings) {
    t7 = () => {
      if (!filial) {
        return;
      }
      saveSettings(filial.Id, SettingsEnum.SessionDuration, {
        SessionDuration: form2.values.duration
      });
    };
    $[15] = filial;
    $[16] = form2.values;
    $[17] = saveSettings;
    $[18] = t7;
  } else {
    t7 = $[18];
  }
  const handleSubmit = t7;
  const t8 = classes2.section;
  let t9;
  if ($[19] !== form2 || $[20] !== handleSubmit) {
    t9 = form2.onSubmit(handleSubmit);
    $[19] = form2;
    $[20] = handleSubmit;
    $[21] = t9;
  } else {
    t9 = $[21];
  }
  const t10 = classes2.title;
  let t11;
  if ($[22] !== t2) {
    t11 = t2("filialSecurity.sessionTitle");
    $[22] = t2;
    $[23] = t11;
  } else {
    t11 = $[23];
  }
  let t12;
  if ($[24] !== classes2.title || $[25] !== t11) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t10, children: t11 });
    $[24] = classes2.title;
    $[25] = t11;
    $[26] = t12;
  } else {
    t12 = $[26];
  }
  const t13 = classes2.textFieldInput;
  let t14;
  if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
    t14 = {
      width: "220px"
    };
    $[27] = t14;
  } else {
    t14 = $[27];
  }
  let t15;
  if ($[28] !== form2) {
    t15 = form2.getInputProps("duration");
    $[28] = form2;
    $[29] = t15;
  } else {
    t15 = $[29];
  }
  let t16;
  if ($[30] !== classes2.textFieldInput || $[31] !== t15) {
    t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(NumberInput, { className: t13, hideControls: true, sx: t14, ...t15 });
    $[30] = classes2.textFieldInput;
    $[31] = t15;
    $[32] = t16;
  } else {
    t16 = $[32];
  }
  const t17 = classes2.description;
  let t18;
  if ($[33] !== t2) {
    t18 = t2("filialSecurity.sessionInfo");
    $[33] = t2;
    $[34] = t18;
  } else {
    t18 = $[34];
  }
  let t19;
  if ($[35] !== classes2.description || $[36] !== t18) {
    t19 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t17, mt: "sm", mb: "md", children: t18 });
    $[35] = classes2.description;
    $[36] = t18;
    $[37] = t19;
  } else {
    t19 = $[37];
  }
  let t20;
  if ($[38] !== t2) {
    t20 = t2("save");
    $[38] = t2;
    $[39] = t20;
  } else {
    t20 = $[39];
  }
  let t21;
  if ($[40] !== isDisabled || $[41] !== t20) {
    t21 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: isDisabled, size: "sm", radius: 8, mr: "sm", type: "submit", children: t20 });
    $[40] = isDisabled;
    $[41] = t20;
    $[42] = t21;
  } else {
    t21 = $[42];
  }
  let t222;
  if ($[43] !== t12 || $[44] !== t16 || $[45] !== t19 || $[46] !== t21) {
    t222 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", direction: "column", children: [
      t12,
      t16,
      t19,
      t21
    ] });
    $[43] = t12;
    $[44] = t16;
    $[45] = t19;
    $[46] = t21;
    $[47] = t222;
  } else {
    t222 = $[47];
  }
  let t23;
  if ($[48] !== t222 || $[49] !== t9) {
    t23 = /* @__PURE__ */ jsxRuntimeExports.jsx("form", { onSubmit: t9, children: t222 });
    $[48] = t222;
    $[49] = t9;
    $[50] = t23;
  } else {
    t23 = $[50];
  }
  let t24;
  if ($[51] !== classes2.section || $[52] !== t23) {
    t24 = /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: t8, align: "flex-start", direction: "column", "data-section": FilialInfoPanelsEnum.sessionDuration, children: t23 });
    $[51] = classes2.section;
    $[52] = t23;
    $[53] = t24;
  } else {
    t24 = $[53];
  }
  return t24;
};
function _temp$d(state) {
  return state.filials;
}
const PasswordLimit = () => {
  const $ = compilerRuntimeExports.c(67);
  const {
    classes: classes2
  } = useStyles();
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector(_temp$c);
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = {
      count: 6,
      limitEnabled: false
    };
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  const form2 = useForm({
    validateInputOnChange: true,
    initialValues: t0,
    validate: (values) => getValidateErrors(schema2, values)
  });
  const schema2 = objectType({
    count: numberType({
      invalid_type_error: t2("filialSecurity.errors.passwordAttempts")
    }).positive({
      message: t2("filialSecurity.errors.positive")
    }).max(2147483647, {
      message: t2("filialSecurity.maxSessionTime", {
        count: 2147483647
      })
    })
  });
  const saveSettings = useSaveSettings();
  const errors = form2.errors;
  let t1;
  if ($[1] !== errors || $[2] !== form2) {
    t1 = Object.keys(errors).length !== 0 || !form2.isDirty();
    $[1] = errors;
    $[2] = form2;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  const isDisabled = t1;
  let t22;
  if ($[4] !== (filial == null ? void 0 : filial.Settings) || $[5] !== form2) {
    t22 = () => {
      const {
        PassEnterCount
      } = (filial == null ? void 0 : filial.Settings) || {};
      if (!PassEnterCount) {
        return;
      }
      const formData = {
        count: PassEnterCount.Count || 6,
        limitEnabled: PassEnterCount.Enabled
      };
      form2.setValues(formData);
      form2.resetDirty(formData);
    };
    $[4] = filial == null ? void 0 : filial.Settings;
    $[5] = form2;
    $[6] = t22;
  } else {
    t22 = $[6];
  }
  let t3;
  if ($[7] !== filial) {
    t3 = [filial];
    $[7] = filial;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  reactExports.useEffect(t22, t3);
  let t4;
  if ($[9] !== filial || $[10] !== saveSettings) {
    t4 = (values_0) => {
      if (!filial) {
        return;
      }
      saveSettings(filial.Id, SettingsEnum.PassEnterCount, {
        PassEnterCount: {
          Enabled: values_0.limitEnabled,
          Count: values_0.count
        }
      });
    };
    $[9] = filial;
    $[10] = saveSettings;
    $[11] = t4;
  } else {
    t4 = $[11];
  }
  const handleSubmit = t4;
  let t5;
  if ($[12] !== form2) {
    t5 = () => {
      if (!form2.values.count) {
        form2.setValues({
          limitEnabled: false,
          count: 6
        });
      } else {
        form2.setValues({
          limitEnabled: false
        });
      }
    };
    $[12] = form2;
    $[13] = t5;
  } else {
    t5 = $[13];
  }
  const handleChange = t5;
  const t6 = classes2.section;
  const t7 = classes2.title;
  let t8;
  if ($[14] !== t2) {
    t8 = t2("filialSecurity.passwordTitle");
    $[14] = t2;
    $[15] = t8;
  } else {
    t8 = $[15];
  }
  let t9;
  if ($[16] !== classes2.title || $[17] !== t8) {
    t9 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t7, my: "sm", children: t8 });
    $[16] = classes2.title;
    $[17] = t8;
    $[18] = t9;
  } else {
    t9 = $[18];
  }
  const t10 = classes2.radio;
  const t11 = !form2.values.limitEnabled;
  let t12;
  if ($[19] !== handleChange) {
    t12 = () => handleChange();
    $[19] = handleChange;
    $[20] = t12;
  } else {
    t12 = $[20];
  }
  let t13;
  if ($[21] !== t2) {
    t13 = t2("disable");
    $[21] = t2;
    $[22] = t13;
  } else {
    t13 = $[22];
  }
  let t14;
  if ($[23] !== classes2.radio || $[24] !== t11 || $[25] !== t12 || $[26] !== t13) {
    t14 = /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: t10, size: "xs", checked: t11, onChange: t12, label: t13 });
    $[23] = classes2.radio;
    $[24] = t11;
    $[25] = t12;
    $[26] = t13;
    $[27] = t14;
  } else {
    t14 = $[27];
  }
  const t15 = classes2.radio;
  const t16 = form2.values.limitEnabled;
  let t17;
  if ($[28] !== form2) {
    t17 = () => form2.setValues({
      limitEnabled: true
    });
    $[28] = form2;
    $[29] = t17;
  } else {
    t17 = $[29];
  }
  let t18;
  if ($[30] !== t2) {
    t18 = t2("enable");
    $[30] = t2;
    $[31] = t18;
  } else {
    t18 = $[31];
  }
  let t19;
  if ($[32] !== classes2.radio || $[33] !== form2.values.limitEnabled || $[34] !== t17 || $[35] !== t18) {
    t19 = /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: t15, size: "xs", checked: t16, onChange: t17, label: t18 });
    $[32] = classes2.radio;
    $[33] = form2.values.limitEnabled;
    $[34] = t17;
    $[35] = t18;
    $[36] = t19;
  } else {
    t19 = $[36];
  }
  let t20;
  if ($[37] !== form2 || $[38] !== handleSubmit) {
    t20 = form2.onSubmit(handleSubmit);
    $[37] = form2;
    $[38] = handleSubmit;
    $[39] = t20;
  } else {
    t20 = $[39];
  }
  let t21;
  if ($[40] !== classes2.textFieldInput || $[41] !== form2 || $[42] !== t2) {
    t21 = form2.values.limitEnabled && /* @__PURE__ */ jsxRuntimeExports.jsx(NumberInput, { className: classes2.textFieldInput, label: t2("filialSecurity.passwordLabel"), hideControls: true, sx: {
      width: "220px"
    }, ...form2.getInputProps("count") });
    $[40] = classes2.textFieldInput;
    $[41] = form2;
    $[42] = t2;
    $[43] = t21;
  } else {
    t21 = $[43];
  }
  const t222 = classes2.description;
  let t23;
  if ($[44] !== t2) {
    t23 = t2("filialSecurity.passwordWarning");
    $[44] = t2;
    $[45] = t23;
  } else {
    t23 = $[45];
  }
  let t24;
  if ($[46] !== classes2.description || $[47] !== t23) {
    t24 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t222, mt: "sm", mb: "md", children: t23 });
    $[46] = classes2.description;
    $[47] = t23;
    $[48] = t24;
  } else {
    t24 = $[48];
  }
  let t25;
  if ($[49] !== t2) {
    t25 = t2("save");
    $[49] = t2;
    $[50] = t25;
  } else {
    t25 = $[50];
  }
  let t26;
  if ($[51] !== isDisabled || $[52] !== t25) {
    t26 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: isDisabled, size: "sm", radius: 8, mr: "sm", type: "submit", children: t25 });
    $[51] = isDisabled;
    $[52] = t25;
    $[53] = t26;
  } else {
    t26 = $[53];
  }
  let t27;
  if ($[54] !== t21 || $[55] !== t24 || $[56] !== t26) {
    t27 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", direction: "column", children: [
      t21,
      t24,
      t26
    ] });
    $[54] = t21;
    $[55] = t24;
    $[56] = t26;
    $[57] = t27;
  } else {
    t27 = $[57];
  }
  let t28;
  if ($[58] !== t20 || $[59] !== t27) {
    t28 = /* @__PURE__ */ jsxRuntimeExports.jsx("form", { onSubmit: t20, children: t27 });
    $[58] = t20;
    $[59] = t27;
    $[60] = t28;
  } else {
    t28 = $[60];
  }
  let t29;
  if ($[61] !== classes2.section || $[62] !== t14 || $[63] !== t19 || $[64] !== t28 || $[65] !== t9) {
    t29 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: t6, align: "flex-start", direction: "column", "data-section": FilialInfoPanelsEnum.passwordLimit, children: [
      t9,
      t14,
      t19,
      t28
    ] });
    $[61] = classes2.section;
    $[62] = t14;
    $[63] = t19;
    $[64] = t28;
    $[65] = t9;
    $[66] = t29;
  } else {
    t29 = $[66];
  }
  return t29;
};
function _temp$c(state) {
  return state.filials;
}
const PasswordStrength = () => {
  const $ = compilerRuntimeExports.c(114);
  const {
    classes: classes2,
    theme
  } = useStyles();
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector(_temp$b);
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = {
      passwordLength: 8,
      useCapital: false,
      UseLowLetter: false,
      useDigital: false,
      useCharacters: false,
      UseAllowedSpecialCharacters: false
    };
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  const form2 = useForm({
    validateInputOnChange: true,
    initialValues: t0,
    validate: (values) => getValidateErrors(schema2, values)
  });
  const schema2 = objectType({
    passwordLength: numberType({
      invalid_type_error: t2("filialSecurity.errors.passwordMinMaxLength")
    }).positive({
      message: t2("filialSecurity.errors.positive")
    }).min(8, {
      message: t2("filialSecurity.errors.passwordMinMaxLength")
    }).max(30, {
      message: t2("filialSecurity.errors.passwordMinMaxLength")
    }),
    useCapital: booleanType(),
    useDigital: booleanType(),
    useCharacters: booleanType(),
    UseLowLetter: booleanType(),
    UseAllowedSpecialCharacters: booleanType()
  });
  const saveSettings = useSaveSettings();
  let t1;
  if ($[1] !== (filial == null ? void 0 : filial.Settings) || $[2] !== form2) {
    t1 = () => {
      const {
        PasswordSecurity
      } = (filial == null ? void 0 : filial.Settings) || {};
      if (!PasswordSecurity) {
        return;
      }
      const formData = {
        passwordLength: (PasswordSecurity == null ? void 0 : PasswordSecurity.MinLength) || 8,
        useCapital: (PasswordSecurity == null ? void 0 : PasswordSecurity.UseCapitalLetters) || false,
        UseLowLetter: (PasswordSecurity == null ? void 0 : PasswordSecurity.UseLowLetter) || false,
        useDigital: (PasswordSecurity == null ? void 0 : PasswordSecurity.UseDigital) || false,
        useCharacters: (PasswordSecurity == null ? void 0 : PasswordSecurity.UseSpecialCharacters) || false,
        UseAllowedSpecialCharacters: (PasswordSecurity == null ? void 0 : PasswordSecurity.UseAllowedSpecialCharacters) || false
      };
      form2.setValues(formData);
      form2.resetDirty(formData);
    };
    $[1] = filial == null ? void 0 : filial.Settings;
    $[2] = form2;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  let t22;
  if ($[4] !== filial) {
    t22 = [filial];
    $[4] = filial;
    $[5] = t22;
  } else {
    t22 = $[5];
  }
  reactExports.useEffect(t1, t22);
  let t3;
  if ($[6] !== filial || $[7] !== saveSettings) {
    t3 = (values_0) => {
      if (!filial) {
        return;
      }
      saveSettings(filial.Id, SettingsEnum.PasswordSecurity, {
        PasswordSecurity: {
          MinLength: values_0.passwordLength,
          UseCapitalLetters: values_0.useCapital,
          UseLowLetter: values_0.UseLowLetter,
          UseDigital: values_0.useDigital,
          UseSpecialCharacters: values_0.useCharacters,
          UseAllowedSpecialCharacters: values_0.UseAllowedSpecialCharacters
        }
      });
    };
    $[6] = filial;
    $[7] = saveSettings;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  const handleSubmit = t3;
  const t4 = classes2.section;
  const t5 = classes2.title;
  let t6;
  if ($[9] !== t2) {
    t6 = t2("filialSecurity.passwordStrengthTitle");
    $[9] = t2;
    $[10] = t6;
  } else {
    t6 = $[10];
  }
  let t7;
  if ($[11] !== classes2.title || $[12] !== t6) {
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t5, children: t6 });
    $[11] = classes2.title;
    $[12] = t6;
    $[13] = t7;
  } else {
    t7 = $[13];
  }
  let t8;
  if ($[14] !== form2 || $[15] !== handleSubmit) {
    t8 = form2.onSubmit(handleSubmit);
    $[14] = form2;
    $[15] = handleSubmit;
    $[16] = t8;
  } else {
    t8 = $[16];
  }
  const t9 = classes2.textFieldInput;
  let t10;
  if ($[17] !== t2) {
    t10 = t2("filialSecurity.passwordMinLength");
    $[17] = t2;
    $[18] = t10;
  } else {
    t10 = $[18];
  }
  let t11;
  if ($[19] !== form2) {
    t11 = form2.getInputProps("passwordLength");
    $[19] = form2;
    $[20] = t11;
  } else {
    t11 = $[20];
  }
  let t12;
  if ($[21] !== classes2.textFieldInput || $[22] !== t10 || $[23] !== t11) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(NumberInput, { className: t9, label: t10, hideControls: true, ...t11 });
    $[21] = classes2.textFieldInput;
    $[22] = t10;
    $[23] = t11;
    $[24] = t12;
  } else {
    t12 = $[24];
  }
  let t13;
  if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
    t13 = {
      marginTop: "12px"
    };
    $[25] = t13;
  } else {
    t13 = $[25];
  }
  const t14 = classes2.checkboxItem;
  let t15;
  if ($[26] !== form2) {
    t15 = form2.getInputProps("UseLowLetter", {
      type: "checkbox"
    });
    $[26] = form2;
    $[27] = t15;
  } else {
    t15 = $[27];
  }
  let t16;
  if ($[28] !== t2) {
    t16 = t2("filialSecurity.useLowerCaseLetters");
    $[28] = t2;
    $[29] = t16;
  } else {
    t16 = $[29];
  }
  let t17;
  if ($[30] !== classes2.checkboxItem || $[31] !== t15 || $[32] !== t16) {
    t17 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { sx: t13, className: t14, size: "xs", ...t15, label: t16 });
    $[30] = classes2.checkboxItem;
    $[31] = t15;
    $[32] = t16;
    $[33] = t17;
  } else {
    t17 = $[33];
  }
  const t18 = classes2.checkboxItem;
  let t19;
  if ($[34] !== form2) {
    t19 = form2.getInputProps("useCapital", {
      type: "checkbox"
    });
    $[34] = form2;
    $[35] = t19;
  } else {
    t19 = $[35];
  }
  let t20;
  if ($[36] !== t2) {
    t20 = t2("filialSecurity.useCapitalLetters");
    $[36] = t2;
    $[37] = t20;
  } else {
    t20 = $[37];
  }
  let t21;
  if ($[38] !== classes2.checkboxItem || $[39] !== t19 || $[40] !== t20) {
    t21 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { className: t18, size: "xs", ...t19, label: t20 });
    $[38] = classes2.checkboxItem;
    $[39] = t19;
    $[40] = t20;
    $[41] = t21;
  } else {
    t21 = $[41];
  }
  const t222 = classes2.checkboxItem;
  let t23;
  if ($[42] !== form2) {
    t23 = form2.getInputProps("useDigital", {
      type: "checkbox"
    });
    $[42] = form2;
    $[43] = t23;
  } else {
    t23 = $[43];
  }
  let t24;
  if ($[44] !== t2) {
    t24 = t2("filialSecurity.useDigital");
    $[44] = t2;
    $[45] = t24;
  } else {
    t24 = $[45];
  }
  let t25;
  if ($[46] !== classes2.checkboxItem || $[47] !== t23 || $[48] !== t24) {
    t25 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { className: t222, size: "xs", ...t23, label: t24 });
    $[46] = classes2.checkboxItem;
    $[47] = t23;
    $[48] = t24;
    $[49] = t25;
  } else {
    t25 = $[49];
  }
  const t26 = classes2.checkboxItem;
  let t27;
  if ($[50] !== form2) {
    t27 = form2.getInputProps("useCharacters", {
      type: "checkbox"
    });
    $[50] = form2;
    $[51] = t27;
  } else {
    t27 = $[51];
  }
  let t28;
  if ($[52] !== t2) {
    t28 = t2("filialSecurity.useSpecialCharacters");
    $[52] = t2;
    $[53] = t28;
  } else {
    t28 = $[53];
  }
  let t29;
  if ($[54] !== classes2.checkboxItem || $[55] !== t27 || $[56] !== t28) {
    t29 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { className: t26, size: "xs", ...t27, label: t28 });
    $[54] = classes2.checkboxItem;
    $[55] = t27;
    $[56] = t28;
    $[57] = t29;
  } else {
    t29 = $[57];
  }
  const t30 = classes2.checkboxItem;
  let t31;
  if ($[58] !== form2) {
    t31 = form2.getInputProps("UseAllowedSpecialCharacters", {
      type: "checkbox"
    });
    $[58] = form2;
    $[59] = t31;
  } else {
    t31 = $[59];
  }
  let t32;
  if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
    t32 = {
      lineHeight: "16px"
    };
    $[60] = t32;
  } else {
    t32 = $[60];
  }
  let t33;
  if ($[61] !== t2) {
    t33 = t2("filialSecurity.limitUse");
    $[61] = t2;
    $[62] = t33;
  } else {
    t33 = $[62];
  }
  let t34;
  if ($[63] !== t33) {
    t34 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fz: "sm", mr: "xs", sx: t32, children: t33 });
    $[63] = t33;
    $[64] = t34;
  } else {
    t34 = $[64];
  }
  let t35;
  if ($[65] !== theme.spacing.xs) {
    t35 = {
      background: "#FFF",
      boxShadow: "0px 8px 32px 0px rgba(0, 0, 0, 0.07)",
      borderRadius: theme.spacing.xs,
      padding: "8px"
    };
    $[65] = theme.spacing.xs;
    $[66] = t35;
  } else {
    t35 = $[66];
  }
  let t36;
  if ($[67] !== t2) {
    t36 = t2("filialSecurity.specialCharactersTooltip");
    $[67] = t2;
    $[68] = t36;
  } else {
    t36 = $[68];
  }
  const t37 = theme.colors.dark[8];
  let t38;
  if ($[69] === Symbol.for("react.memo_cache_sentinel")) {
    t38 = {
      textDecoration: "underline dotted",
      lineHeight: "16px",
      cursor: "pointer"
    };
    $[69] = t38;
  } else {
    t38 = $[69];
  }
  let t39;
  if ($[70] !== t2) {
    t39 = t2("filialSecurity.specialCharacters");
    $[70] = t2;
    $[71] = t39;
  } else {
    t39 = $[71];
  }
  let t40;
  if ($[72] !== t39) {
    t40 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fz: "sm", sx: t38, children: t39 });
    $[72] = t39;
    $[73] = t40;
  } else {
    t40 = $[73];
  }
  let t41;
  if ($[74] !== t35 || $[75] !== t36 || $[76] !== t40 || $[77] !== theme.colors.dark[8]) {
    t41 = /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { sx: t35, label: t36, c: t37, children: t40 });
    $[74] = t35;
    $[75] = t36;
    $[76] = t40;
    $[77] = theme.colors.dark[8];
    $[78] = t41;
  } else {
    t41 = $[78];
  }
  let t42;
  if ($[79] !== t34 || $[80] !== t41) {
    t42 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { wrap: "wrap", children: [
      t34,
      t41
    ] });
    $[79] = t34;
    $[80] = t41;
    $[81] = t42;
  } else {
    t42 = $[81];
  }
  let t43;
  if ($[82] !== classes2.checkboxItem || $[83] !== t31 || $[84] !== t42) {
    t43 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { className: t30, size: "xs", ...t31, label: t42 });
    $[82] = classes2.checkboxItem;
    $[83] = t31;
    $[84] = t42;
    $[85] = t43;
  } else {
    t43 = $[85];
  }
  let t44;
  if ($[86] !== t12 || $[87] !== t17 || $[88] !== t21 || $[89] !== t25 || $[90] !== t29 || $[91] !== t43) {
    t44 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", direction: "column", children: [
      t12,
      t17,
      t21,
      t25,
      t29,
      t43
    ] });
    $[86] = t12;
    $[87] = t17;
    $[88] = t21;
    $[89] = t25;
    $[90] = t29;
    $[91] = t43;
    $[92] = t44;
  } else {
    t44 = $[92];
  }
  const t45 = classes2.description;
  let t46;
  if ($[93] !== t2) {
    t46 = t2(`filialSecurity.${isSaaS() ? "passwordStrengthDescriptionSaaS" : "passwordStrengthDescriptionBox"}`);
    $[93] = t2;
    $[94] = t46;
  } else {
    t46 = $[94];
  }
  let t47;
  if ($[95] !== classes2.description || $[96] !== t46) {
    t47 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: t45, mt: "sm", mb: "md", children: t46 });
    $[95] = classes2.description;
    $[96] = t46;
    $[97] = t47;
  } else {
    t47 = $[97];
  }
  let t48;
  if ($[98] !== form2) {
    t48 = !form2.isValid() || !form2.isDirty();
    $[98] = form2;
    $[99] = t48;
  } else {
    t48 = $[99];
  }
  let t49;
  if ($[100] !== t2) {
    t49 = t2("save");
    $[100] = t2;
    $[101] = t49;
  } else {
    t49 = $[101];
  }
  let t50;
  if ($[102] !== t48 || $[103] !== t49) {
    t50 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "sm", radius: 8, mr: "sm", type: "submit", disabled: t48, children: t49 });
    $[102] = t48;
    $[103] = t49;
    $[104] = t50;
  } else {
    t50 = $[104];
  }
  let t51;
  if ($[105] !== t44 || $[106] !== t47 || $[107] !== t50 || $[108] !== t8) {
    t51 = /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: t8, children: [
      t44,
      t47,
      t50
    ] });
    $[105] = t44;
    $[106] = t47;
    $[107] = t50;
    $[108] = t8;
    $[109] = t51;
  } else {
    t51 = $[109];
  }
  let t52;
  if ($[110] !== classes2.section || $[111] !== t51 || $[112] !== t7) {
    t52 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: t4, align: "flex-start", direction: "column", pos: "relative", "data-section": FilialInfoPanelsEnum.passwordSecurity, children: [
      t7,
      t51
    ] });
    $[110] = classes2.section;
    $[111] = t51;
    $[112] = t7;
    $[113] = t52;
  } else {
    t52 = $[113];
  }
  return t52;
};
function _temp$b(state) {
  return state.filials;
}
var AccessType = /* @__PURE__ */ ((AccessType2) => {
  AccessType2[AccessType2["Deny"] = -4096] = "Deny";
  AccessType2[AccessType2["Read"] = 0] = "Read";
  AccessType2[AccessType2["Comment"] = 1] = "Comment";
  AccessType2[AccessType2["Write"] = 4] = "Write";
  AccessType2[AccessType2["Delete"] = 8] = "Delete";
  AccessType2[AccessType2["Full"] = 512] = "Full";
  AccessType2[AccessType2["OnlyUpload"] = -1024] = "OnlyUpload";
  AccessType2[AccessType2["FreeBusy"] = -64] = "FreeBusy";
  AccessType2[AccessType2["Upload"] = 2] = "Upload";
  AccessType2[AccessType2["Sharing"] = 3] = "Sharing";
  AccessType2[AccessType2["Save"] = 16] = "Save";
  AccessType2[AccessType2["EditRights"] = 32] = "EditRights";
  AccessType2[AccessType2["Lock"] = 4096] = "Lock";
  return AccessType2;
})(AccessType || {});
var CustomerSettingType = /* @__PURE__ */ ((CustomerSettingType2) => {
  CustomerSettingType2[CustomerSettingType2["None"] = 0] = "None";
  CustomerSettingType2[CustomerSettingType2["UserIpType"] = 1] = "UserIpType";
  CustomerSettingType2[CustomerSettingType2["AdminIpType"] = 2] = "AdminIpType";
  CustomerSettingType2[CustomerSettingType2["SessionDurationType"] = 3] = "SessionDurationType";
  CustomerSettingType2[CustomerSettingType2["PassEnterCountType"] = 4] = "PassEnterCountType";
  CustomerSettingType2[CustomerSettingType2["LdapType"] = 5] = "LdapType";
  CustomerSettingType2[CustomerSettingType2["Smtp"] = 6] = "Smtp";
  CustomerSettingType2[CustomerSettingType2["PasswordSecurity"] = 7] = "PasswordSecurity";
  CustomerSettingType2[CustomerSettingType2["QuotaRules"] = 8] = "QuotaRules";
  CustomerSettingType2[CustomerSettingType2["TimeZone"] = 9] = "TimeZone";
  CustomerSettingType2[CustomerSettingType2["ExternalLinkRules"] = 10] = "ExternalLinkRules";
  CustomerSettingType2[CustomerSettingType2["RoomsAccess"] = 11] = "RoomsAccess";
  CustomerSettingType2[CustomerSettingType2["ExportUserActionsSettings"] = 12] = "ExportUserActionsSettings";
  CustomerSettingType2[CustomerSettingType2["DocVersionsLimit"] = 13] = "DocVersionsLimit";
  return CustomerSettingType2;
})(CustomerSettingType || {});
class CustomerSettingsService {
  async SaveCustomerSettings(params) {
    try {
      const {
        data
      } = await axiosInstance.post("v2/customer/settings", params);
      return data;
    } catch (e) {
      throw new Error("Unable to save customer settings. Please try again later.");
    }
  }
  async GetCustomer(params) {
    try {
      const {
        data
      } = await axiosInstance.get("v2/customer", {
        params
      });
      return data;
    } catch (e) {
      throw new Error("Unable to fetch customer data. Please try again later.");
    }
  }
  async CreateCustomer(params) {
    try {
      const {
        data
      } = await axiosInstance.post("v2/customer", params);
      return data;
    } catch (e) {
      throw new Error("Unable to create customer. Please try again later.");
    }
  }
  async UpdateCustomer(params) {
    try {
      const {
        data
      } = await axiosInstance.put("v2/customer", params);
      return data;
    } catch (e) {
      throw new Error("Unable to update customer. Please try again later.");
    }
  }
}
const customerSettingsApiArea = () => new CustomerSettingsService();
objectType({
  isDisabled: booleanType(),
  isEnabledRules: booleanType()
});
const useShareLinks = (CustomerId) => {
  const schema2 = objectType({});
  const [settings, setSettings] = reactExports.useState(void 0);
  const [isLoading, setLoading] = reactExports.useState(false);
  const form2 = useForm({
    validateInputOnChange: true,
    initialValues: {
      isDisabled: false,
      isEnabledRules: false
    },
    validate: (values) => getValidateErrors(schema2, values)
  });
  const loadSettings = reactExports.useCallback(async () => {
    var _a, _b;
    if (!CustomerId) return;
    const params = {
      id: CustomerId,
      extended: true
    };
    const {
      Response
    } = await customerSettingsApiArea().GetCustomer(params);
    const settings_0 = Response.Data.Settings;
    if (!settings_0) return;
    setSettings(settings_0.ExternalLinksSettings);
    if (!settings_0.ExternalLinksSettings) return;
    const values_0 = {
      isDisabled: (_a = settings_0.ExternalLinksSettings) == null ? void 0 : _a.IsDisabled,
      isEnabledRules: (_b = settings_0.ExternalLinksSettings) == null ? void 0 : _b.IsEnabledRules
    };
    form2.setValues(values_0);
  }, [CustomerId]);
  const deleteRule = reactExports.useCallback(async (id) => {
    var _a;
    if (!CustomerId || !settings) return;
    const params_0 = {
      CustomerId,
      Type: CustomerSettingType.ExternalLinkRules,
      Settings: {
        ExternalLinksSettings: {
          IsDisabled: true,
          IsEnabledRules: settings.IsEnabledRules,
          Rules: ((_a = settings.Rules) == null ? void 0 : _a.filter((rule) => rule.Id !== id)) || []
        }
      }
    };
    await customerSettingsApiArea().SaveCustomerSettings(params_0).then(loadSettings);
  }, [CustomerId, settings, loadSettings]);
  reactExports.useEffect(() => {
    if (!CustomerId) return;
    setLoading(true);
    loadSettings().finally(() => setLoading(false));
  }, [CustomerId]);
  const handleSubmit = reactExports.useCallback(() => {
    if (!CustomerId) return;
    const params_1 = {
      CustomerId,
      Type: CustomerSettingType.ExternalLinkRules,
      Settings: {
        ExternalLinksSettings: {
          IsDisabled: form2.values.isDisabled,
          IsEnabledRules: form2.values.isEnabledRules,
          Rules: (settings == null ? void 0 : settings.Rules) || []
        }
      }
    };
    customerSettingsApiArea().SaveCustomerSettings(params_1).then(loadSettings);
  }, [CustomerId, form2.values.isDisabled, form2.values.isEnabledRules, settings == null ? void 0 : settings.Rules, loadSettings]);
  return [form2, handleSubmit, settings, isLoading, loadSettings, deleteRule];
};
var FolderTypes = /* @__PURE__ */ ((FolderTypes2) => {
  FolderTypes2["Documents"] = "1";
  FolderTypes2["CommonFolder"] = "3";
  FolderTypes2["Room"] = "2";
  return FolderTypes2;
})(FolderTypes || {});
const schema$2 = objectType({
  roles: arrayType(anyType()).min(1, {
    message: t("ShareLinks.RulesPopUp.roleError")
  }),
  passwordRequired: booleanType(),
  minPasswordLength: numberType().min(6).optional(),
  includeLowercase: booleanType(),
  includeUppercase: booleanType(),
  includeNumber: booleanType(),
  limitExpiration: booleanType(),
  expirationTime: numberType().optional(),
  folderTypeLimited: booleanType(),
  folderTypes: arrayType(stringType()).optional(),
  accessLevelRestricted: booleanType(),
  accessTypes: arrayType(numberType()).optional()
});
const defaultValues = {
  roles: [],
  passwordRequired: false,
  minPasswordLength: 8,
  includeLowercase: true,
  includeUppercase: true,
  includeNumber: true,
  limitExpiration: false,
  expirationTime: 180,
  folderTypeLimited: false,
  folderTypes: [
    "1",
    "3",
    "2"
    /* Room */
  ],
  accessLevelRestricted: false,
  accessTypes: []
};
const useRulesSettings = (args) => {
  var _a, _b, _c, _d, _e;
  const $ = compilerRuntimeExports.c(28);
  const {
    onClose,
    onSuccess,
    customerId,
    settings,
    rule
  } = args;
  const [isLoading, setIsLoading] = reactExports.useState(false);
  let t0;
  if ($[0] !== settings) {
    t0 = (settings == null ? void 0 : settings.Rules) ? [...settings.Rules] : [];
    $[0] = settings;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const Rules = t0;
  let t1;
  if ($[2] !== rule) {
    t1 = rule ? {
      roles: rule.Roles ?? [],
      passwordRequired: !!rule.Password,
      minPasswordLength: ((_a = rule.Password) == null ? void 0 : _a.MinLength) ?? defaultValues.minPasswordLength,
      includeLowercase: ((_b = rule.Password) == null ? void 0 : _b.IsLow) ?? defaultValues.includeLowercase,
      includeUppercase: ((_c = rule.Password) == null ? void 0 : _c.IsHigh) ?? defaultValues.includeUppercase,
      includeNumber: ((_d = rule.Password) == null ? void 0 : _d.IsDigit) ?? defaultValues.includeNumber,
      limitExpiration: !!rule.MaxActivePeriod,
      expirationTime: rule.MaxActivePeriod ?? defaultValues.expirationTime,
      folderTypeLimited: !!rule.ExternalLinkRuleDirectory,
      folderTypes: ((_e = rule.ExternalLinkRuleDirectory) == null ? void 0 : _e.map(_temp$a)) ?? defaultValues.folderTypes,
      accessLevelRestricted: !!rule.AccessTypes,
      accessTypes: rule.AccessTypes ?? defaultValues.accessTypes
    } : defaultValues;
    $[2] = rule;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  const valuesToForm = t1;
  let t2;
  if ($[4] !== valuesToForm) {
    t2 = {
      validateInputOnChange: false,
      initialValues: {
        ...valuesToForm
      },
      validate: _temp2$1
    };
    $[4] = valuesToForm;
    $[5] = t2;
  } else {
    t2 = $[5];
  }
  const form2 = useForm(t2);
  let t3;
  if ($[6] !== Rules || $[7] !== rule) {
    t3 = () => {
      if (rule) {
        return rule.Id;
      }
      if (Rules.length === 0) {
        return 0;
      }
      return Rules[Rules.length - 1].Id + 1;
    };
    $[6] = Rules;
    $[7] = rule;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  const getId = t3;
  let t4;
  if ($[9] !== customerId || $[10] !== onClose || $[11] !== onSuccess || $[12] !== settings) {
    t4 = () => {
      if (!customerId) {
        return;
      }
      setIsLoading(true);
      const temp = {
        IsDisabled: true,
        IsEnabledRules: false,
        ...settings
      };
      customerSettingsApiArea().SaveCustomerSettings({
        CustomerId: customerId,
        Type: CustomerSettingType.ExternalLinkRules,
        Settings: {
          ExternalLinksSettings: {
            ...temp,
            Rules: []
          }
        }
      }).then(onClose).then(onSuccess).finally(() => setIsLoading(false));
    };
    $[9] = customerId;
    $[10] = onClose;
    $[11] = onSuccess;
    $[12] = settings;
    $[13] = t4;
  } else {
    t4 = $[13];
  }
  const reset = t4;
  let t5;
  if ($[14] !== Rules || $[15] !== customerId || $[16] !== form2 || $[17] !== getId || $[18] !== onClose || $[19] !== onSuccess || $[20] !== (rule == null ? void 0 : rule.Id) || $[21] !== settings) {
    t5 = () => {
      const isValid = form2.validate();
      if (!customerId || isValid.hasErrors) {
        return;
      }
      setIsLoading(true);
      const temp_0 = {
        IsEnabledRules: false,
        ...settings,
        IsDisabled: true
      };
      const Id = getId();
      const newRule = {
        Id,
        Roles: form2.values.roles,
        Password: form2.values.passwordRequired ? {
          MinLength: form2.values.minPasswordLength || 8,
          IsDigit: form2.values.includeNumber,
          IsLow: form2.values.includeLowercase,
          IsHigh: form2.values.includeUppercase
        } : null,
        MaxActivePeriod: form2.values.limitExpiration ? form2.values.expirationTime || 120 : null,
        ExternalLinkRuleDirectory: form2.values.folderTypeLimited ? (form2.values.folderTypes || []).map(_temp3) : null,
        AccessTypes: form2.values.accessLevelRestricted ? form2.values.accessTypes || [] : null
      };
      const updatedRules = Rules.filter((r) => r.Id !== (rule == null ? void 0 : rule.Id));
      updatedRules.push(newRule);
      customerSettingsApiArea().SaveCustomerSettings({
        CustomerId: customerId,
        Type: CustomerSettingType.ExternalLinkRules,
        Settings: {
          ExternalLinksSettings: {
            ...temp_0,
            Rules: updatedRules
          }
        }
      }).then(onClose).then(onSuccess).finally(() => setIsLoading(false));
    };
    $[14] = Rules;
    $[15] = customerId;
    $[16] = form2;
    $[17] = getId;
    $[18] = onClose;
    $[19] = onSuccess;
    $[20] = rule == null ? void 0 : rule.Id;
    $[21] = settings;
    $[22] = t5;
  } else {
    t5 = $[22];
  }
  const handleSubmit = t5;
  let t6;
  if ($[23] !== form2 || $[24] !== handleSubmit || $[25] !== isLoading || $[26] !== reset) {
    t6 = [form2, isLoading, handleSubmit, reset];
    $[23] = form2;
    $[24] = handleSubmit;
    $[25] = isLoading;
    $[26] = reset;
    $[27] = t6;
  } else {
    t6 = $[27];
  }
  return t6;
};
function _temp$a(i) {
  return i.toString();
}
function _temp2$1(values) {
  return getValidateErrors(schema$2, values);
}
function _temp3(i_0) {
  return +i_0;
}
const container$8 = "_container_25o0v_1";
const header$3 = "_header_25o0v_9";
const body$4 = "_body_25o0v_27";
const subTitle$1 = "_subTitle_25o0v_43";
const part$1 = "_part_25o0v_53";
const shift = "_shift_25o0v_57";
const inputRoot = "_inputRoot_25o0v_64";
const input$1 = "_input_25o0v_64";
const label$1 = "_label_25o0v_72";
const footer$3 = "_footer_25o0v_77";
const classes$b = {
  container: container$8,
  header: header$3,
  body: body$4,
  subTitle: subTitle$1,
  part: part$1,
  shift,
  inputRoot,
  input: input$1,
  label: label$1,
  footer: footer$3
};
const generateParamsForRequest = (url, filterObject) => {
  const params = Object.keys(filterObject).reduce((acc, k, i) => {
    const value = filterObject[k];
    if (value !== "") {
      acc += `${i === 0 ? "" : "&"}${String(k)}=${value}`;
    }
    return acc;
  }, "");
  return params !== "" ? `${url}?${params}` : url;
};
const DEFAULT__LIST__PARAMS = {
  Count: 20,
  SortOrder: 0,
  Offset: 0,
  Size: 20,
  FilterConditions: [],
  Filters: {},
  SkipIds: [],
  SortField: 0
};
class RoleService {
  async GetRolesByName(params) {
    try {
      const paramsToQuery = {
        ...DEFAULT__LIST__PARAMS,
        ...params
      };
      const {
        data
      } = await axiosInstance.post("v2/roles/list", paramsToQuery);
      return data.Response.Data.Items;
    } catch (e) {
      throw new Error(`Error: ${e}`);
    }
  }
  async GetRolesForUser(params) {
    try {
      const {
        data
      } = await axiosInstance.get(generateParamsForRequest("v2/moduleaccess/roles", params));
      return data.Response.Data.Items;
    } catch (e) {
      throw new Error(`Error: ${e}`);
    }
  }
}
const roleApiArea = () => new RoleService();
const RulesSettings = (props) => {
  var _a, _b, _c, _d;
  const {
    rule,
    settings,
    onSuccess
  } = props;
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector((state) => state.filials);
  const onClose = () => props.setIsOpen(false);
  const [form2, isLoading, handleSubmit] = useRulesSettings({
    onClose,
    rule,
    settings,
    onSuccess,
    customerId: filial == null ? void 0 : filial.Id
  });
  const loader = reactExports.useCallback((query) => {
    return roleApiArea().GetRolesByName({
      Query: query,
      FilterConditions: filial ? [{
        Type: IFiltersEnumType.FilialFilter,
        NumValues: [filial.Id]
      }] : []
    });
  }, [filial == null ? void 0 : filial.Id]);
  const handleValueChange = reactExports.useCallback((items) => {
    form2.setFieldValue("roles", items.map((item) => item.entity));
  }, []);
  const handleMapDataToOptions = reactExports.useCallback((item_0) => ({
    label: item_0.Name,
    value: item_0.Id,
    entity: item_0
  }), []);
  const disabled = Object.keys(form2.errors).length > 0 || isLoading || !form2.isDirty();
  const changeExternalLinkRuleDirectory = (value) => {
    const current = form2.values.folderTypes;
    const currentValue = current.includes(value.toString()) ? current.filter((item_1) => item_1 !== value.toString()) : [...current, value.toString()];
    form2.setFieldValue("folderTypes", currentValue);
    if (currentValue.length === 0) {
      form2.setFieldError("folderTypes", t2("ShareLinks.RulesPopUp.folderTypeError"));
    } else {
      form2.clearFieldError("folderTypes");
    }
  };
  const changeAccessType = (value_0) => {
    const current_0 = form2.values.accessTypes || [];
    const currentValue_0 = current_0.includes(value_0) ? current_0.filter((item_2) => item_2 !== value_0) : [...current_0, value_0];
    form2.setFieldValue("accessTypes", currentValue_0);
    if (currentValue_0.length === 0) {
      form2.setFieldError("accessTypes", t2("ShareLinks.RulesPopUp.accessLevelError"));
    } else {
      form2.clearFieldError("accessTypes");
    }
  };
  const title2 = props.rule ? t2("ShareLinks.RulesPopUp.editTitle") : t2("ShareLinks.RulesPopUp.createTitle");
  const submit = props.rule ? t2("ShareLinks.RulesPopUp.edit") : t2("ShareLinks.RulesPopUp.create");
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.container, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.header, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: title2 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: onClose, children: /* @__PURE__ */ jsxRuntimeExports.jsx(qXe, { size: 16 }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.body, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.part, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$b.subTitle, children: t2("ShareLinks.RulesPopUp.roles") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(PillsInputAutoCompleteWithQuery, { loaderData: loader, onValueChange: handleValueChange, defaultValues: form2.values.roles.map(handleMapDataToOptions), mapDataToOptions: handleMapDataToOptions, props: {
          PillsInputFieldProps: {
            placeholder: t2("ShareLinks.RulesPopUp.chooseRoles")
          },
          PillsInputProps: {
            error: form2.errors.roles ?? null
          }
        } })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.part, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$b.subTitle, children: t2("ShareLinks.RulesPopUp.password") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Radio.Group, { value: form2.values.passwordRequired ? "required" : "optional", onChange: (value_1) => {
          const currentValue_1 = value_1 === "required";
          if (!currentValue_1) {
            form2.clearFieldError("minPasswordLength");
          } else {
            form2.values.minPasswordLength === 0 && form2.setFieldError("minPasswordLength", "Поле не может быть пустым");
          }
          form2.setFieldValue("passwordRequired", currentValue_1);
        }, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "optional", label: t2("ShareLinks.RulesPopUp.optional") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "required", label: t2("ShareLinks.RulesPopUp.required") })
        ] }),
        form2.values.passwordRequired && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.shift, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(NumberInput, { label: t2("ShareLinks.RulesPopUp.minPasswordLength"), min: 6, width: 250, allowNegative: false, maxLength: 9, classNames: {
            root: classes$b.inputRoot,
            input: classes$b.input,
            label: classes$b.label
          }, error: form2.errors.minPasswordLength || null, value: form2.values.minPasswordLength, onChange: (val) => form2.setFieldValue("minPasswordLength", val) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { label: t2("ShareLinks.RulesPopUp.includeLowercase"), checked: form2.values.includeLowercase, onChange: (e) => form2.setFieldValue("includeLowercase", e.currentTarget.checked) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { label: t2("ShareLinks.RulesPopUp.includeUppercase"), checked: form2.values.includeUppercase, onChange: (e_0) => form2.setFieldValue("includeUppercase", e_0.currentTarget.checked) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { label: t2("ShareLinks.RulesPopUp.includeNumber"), checked: form2.values.includeNumber, onChange: (e_1) => form2.setFieldValue("includeNumber", e_1.currentTarget.checked) })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.part, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$b.subTitle, children: t2("ShareLinks.RulesPopUp.expirationDate") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Radio.Group, { withAsterisk: true, value: form2.values.limitExpiration ? "limit" : "unlimited", onChange: (value_2) => {
          const currentValue_2 = value_2 === "limit";
          if (!currentValue_2) {
            form2.clearFieldError("expirationTime");
          } else {
            form2.values.expirationTime === 0 && form2.setFieldError("expirationTime", "Поле не может быть пустым");
          }
          form2.setFieldValue("limitExpiration", currentValue_2);
        }, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "unlimited", label: t2("ShareLinks.RulesPopUp.unlimited") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "limit", label: t2("ShareLinks.RulesPopUp.limited") })
        ] }),
        form2.values.limitExpiration && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$b.shift, children: /* @__PURE__ */ jsxRuntimeExports.jsx(NumberInput, { label: t2("ShareLinks.RulesPopUp.expirationTime"), error: form2.errors.expirationTime || null, min: 1, width: 250, maxLength: 9, classNames: {
          root: classes$b.inputRoot,
          input: classes$b.input,
          label: classes$b.label
        }, allowNegative: false, value: form2.values.expirationTime, onChange: (val_0) => form2.setFieldValue("expirationTime", val_0) }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.part, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$b.subTitle, children: t2("ShareLinks.RulesPopUp.folderType") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Radio.Group, { withAsterisk: true, value: form2.values.folderTypeLimited ? "limited" : "unlimited", onChange: (value_3) => {
          const currentValue_3 = value_3 === "limited";
          if (!currentValue_3) {
            form2.clearFieldError("folderTypes");
          } else {
            form2.values.folderTypes.length === 0 && form2.setFieldError("folderTypes", "Выберите хотя бы один тип папки");
          }
          form2.setFieldValue("folderTypeLimited", value_3 === "limited");
        }, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "unlimited", label: t2("ShareLinks.RulesPopUp.unlimited") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "limited", label: t2("ShareLinks.RulesPopUp.limited") })
        ] }),
        form2.values.folderTypeLimited && /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox.Group, { className: classes$b.shift, error: form2.errors.folderTypes ? t2("ShareLinks.RulesPopUp.folderTypeError") : null, value: form2.values.folderTypes, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.shift, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: FolderTypes.Documents, readOnly: true, checked: form2.values.folderTypes.includes(FolderTypes.Documents), onClick: () => changeExternalLinkRuleDirectory(FolderTypes.Documents), label: t2("ShareLinks.RulesPopUp.myDocuments") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: FolderTypes.CommonFolder, readOnly: true, checked: form2.values.folderTypes.includes(FolderTypes.CommonFolder), onClick: () => changeExternalLinkRuleDirectory(FolderTypes.CommonFolder), label: t2("ShareLinks.RulesPopUp.commonFolder") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: FolderTypes.Room, readOnly: true, checked: form2.values.folderTypes.includes(FolderTypes.Room), onClick: () => changeExternalLinkRuleDirectory(FolderTypes.Room), label: t2("ShareLinks.RulesPopUp.room") })
        ] }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.part, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$b.subTitle, children: t2("ShareLinks.RulesPopUp.accessLevel") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Radio.Group, { withAsterisk: true, value: form2.values.accessLevelRestricted ? "restricted" : "noRestrictions", onChange: (value_4) => {
          const currentValue_4 = value_4 === "restricted";
          if (!currentValue_4) {
            form2.clearFieldError("accessTypes");
          } else {
            (!form2.values.accessTypes || form2.values.accessTypes.length === 0) && form2.setFieldError("accessTypes", t2("ShareLinks.RulesPopUp.accessLevelError"));
          }
          form2.setFieldValue("accessLevelRestricted", currentValue_4);
        }, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "noRestrictions", label: t2("ShareLinks.RulesPopUp.noRestrictions") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { size: "xs", mb: "sm", value: "restricted", label: t2("ShareLinks.RulesPopUp.restrictAccess") })
        ] }),
        form2.values.accessLevelRestricted && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.shift, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: AccessType.OnlyUpload, readOnly: true, checked: (_a = form2.values.accessTypes) == null ? void 0 : _a.includes(AccessType.OnlyUpload), onClick: () => changeAccessType(AccessType.OnlyUpload), label: t2("ShareLinks.RulesPopUp.onlyUpload") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: AccessType.Read, readOnly: true, checked: (_b = form2.values.accessTypes) == null ? void 0 : _b.includes(AccessType.Read), onClick: () => changeAccessType(AccessType.Read), label: t2("ShareLinks.RulesPopUp.read") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: AccessType.Comment, readOnly: true, checked: (_c = form2.values.accessTypes) == null ? void 0 : _c.includes(AccessType.Comment), onClick: () => changeAccessType(AccessType.Comment), label: t2("ShareLinks.RulesPopUp.comment") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: AccessType.Write, readOnly: true, checked: (_d = form2.values.accessTypes) == null ? void 0 : _d.includes(AccessType.Write), onClick: () => changeAccessType(AccessType.Write), label: t2("ShareLinks.RulesPopUp.write") })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$b.footer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, size: "sm", radius: 8, loading: isLoading, disabled, onClick: handleSubmit, children: submit }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, size: "sm", color: "grey", radius: 8, variant: "light", onClick: onClose, children: t2("ShareLinks.RulesPopUp.cancel") })
    ] })
  ] });
};
const wrapperBadge$1 = "_wrapperBadge_zyo87_1";
const badge$1 = "_badge_zyo87_7";
const iconWrapper$1 = "_iconWrapper_zyo87_22";
const cell$1 = "_cell_zyo87_31";
const actions$1 = "_actions_zyo87_40";
const classes$a = {
  wrapperBadge: wrapperBadge$1,
  badge: badge$1,
  iconWrapper: iconWrapper$1,
  cell: cell$1,
  actions: actions$1
};
const getAccessTypeLabel = (type, t2) => {
  switch (type) {
    case AccessType.OnlyUpload:
      return t2("ShareLinks.RulesTable.Cells.AccessType.onlyUpload");
    case AccessType.Read:
      return t2("ShareLinks.RulesTable.Cells.AccessType.read");
    case AccessType.Comment:
      return t2("ShareLinks.RulesTable.Cells.AccessType.comment");
    case AccessType.Write:
      return t2("ShareLinks.RulesTable.Cells.AccessType.write");
    default:
      return t2("ShareLinks.RulesTable.Cells.AccessType.unknown");
  }
};
const getAccessTypesValue = (rule, t2) => {
  if (!rule.AccessTypes || rule.AccessTypes.length === 0) {
    return t2("ShareLinks.RulesTable.Cells.AccessType.noRestrictions");
  }
  return rule.AccessTypes.map((type) => getAccessTypeLabel(type, t2)).join(", ");
};
const AccessTypeCell = (t0) => {
  const $ = compilerRuntimeExports.c(5);
  const {
    rule
  } = t0;
  const {
    t: t2
  } = useTranslation();
  let t1;
  if ($[0] !== rule || $[1] !== t2) {
    t1 = getAccessTypesValue(rule, t2);
    $[0] = rule;
    $[1] = t2;
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  const value = t1;
  let t22;
  if ($[3] !== value) {
    t22 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { width: 200, className: classes$a.cell, children: value });
    $[3] = value;
    $[4] = t22;
  } else {
    t22 = $[4];
  }
  return t22;
};
const ActionCell = (props) => {
  const $ = compilerRuntimeExports.c(16);
  const {
    settings,
    loadSettings,
    rule,
    deleteRule
  } = props;
  const [isLoading, setIsLoading] = reactExports.useState(false);
  let t0;
  if ($[0] !== deleteRule || $[1] !== rule.Id) {
    t0 = () => {
      setIsLoading(true);
      deleteRule(rule.Id).finally(() => setIsLoading(false));
    };
    $[0] = deleteRule;
    $[1] = rule.Id;
    $[2] = t0;
  } else {
    t0 = $[2];
  }
  const handleDeleteRule = t0;
  let t1;
  if ($[3] !== isLoading) {
    t1 = isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { color: "grey", size: 24 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(IconTrash, { size: 24, stroke: 1.5 });
    $[3] = isLoading;
    $[4] = t1;
  } else {
    t1 = $[4];
  }
  const trashIcon = t1;
  let t2;
  if ($[5] !== loadSettings || $[6] !== rule || $[7] !== settings) {
    t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(PopUpUI, { mobileSize: "100%", desktopPosition: "top-end", trigger: _temp$9, children: (t32) => {
      const {
        isOpen,
        setIsOpen: setIsOpen_0
      } = t32;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(RulesSettings, { isOpen, rule, onSuccess: loadSettings, setIsOpen: setIsOpen_0, settings });
    } });
    $[5] = loadSettings;
    $[6] = rule;
    $[7] = settings;
    $[8] = t2;
  } else {
    t2 = $[8];
  }
  let t3;
  if ($[9] !== handleDeleteRule || $[10] !== isLoading || $[11] !== trashIcon) {
    t3 = /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: handleDeleteRule, disabled: isLoading, children: trashIcon });
    $[9] = handleDeleteRule;
    $[10] = isLoading;
    $[11] = trashIcon;
    $[12] = t3;
  } else {
    t3 = $[12];
  }
  let t4;
  if ($[13] !== t2 || $[14] !== t3) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { width: 60, align: "right", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$a.actions, children: [
      t2,
      t3
    ] }) });
    $[13] = t2;
    $[14] = t3;
    $[15] = t4;
  } else {
    t4 = $[15];
  }
  return t4;
};
function _temp$9(t0) {
  const {
    setIsOpen
  } = t0;
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: () => setIsOpen(true), children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconEdit, { size: 24, stroke: 1.5 }) });
}
const getMapDirectoryToLabel = (dir, t2) => {
  switch (dir) {
    case 1:
      return t2("ShareLinks.RulesTable.Cells.FolderType.myDocuments");
    case 2:
      return t2("ShareLinks.RulesTable.Cells.FolderType.sharedFolder");
    case 3:
      return t2("ShareLinks.RulesTable.Cells.FolderType.room");
    default:
      return t2("ShareLinks.RulesTable.Cells.FolderType.unknownType");
  }
};
const externalLinkRuleDirectoryValue = (rule, t2) => {
  if (!rule.ExternalLinkRuleDirectory || rule.ExternalLinkRuleDirectory.length === 0) {
    return t2("ShareLinks.RulesTable.Cells.FolderType.notLimited");
  }
  return rule.ExternalLinkRuleDirectory.map((v) => getMapDirectoryToLabel(v, t2)).join(", ");
};
const FolderTypeCell = (t0) => {
  const $ = compilerRuntimeExports.c(5);
  const {
    rule
  } = t0;
  const {
    t: t2
  } = useTranslation();
  let t1;
  if ($[0] !== rule || $[1] !== t2) {
    t1 = externalLinkRuleDirectoryValue(rule, t2);
    $[0] = rule;
    $[1] = t2;
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  const value = t1;
  let t22;
  if ($[3] !== value) {
    t22 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { width: 200, className: classes$a.cell, children: value });
    $[3] = value;
    $[4] = t22;
  } else {
    t22 = $[4];
  }
  return t22;
};
const useGeneratePasswordTooltip = (rule) => {
  const $ = compilerRuntimeExports.c(20);
  const {
    t: t2
  } = useTranslation();
  if (!rule.Password) {
    let t02;
    if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
      t02 = [];
      $[0] = t02;
    } else {
      t02 = $[0];
    }
    return t02;
  }
  let t0;
  if ($[1] !== t2) {
    t0 = t2("ShareLinks.RulesTable.Cells.Password.required");
    $[1] = t2;
    $[2] = t0;
  } else {
    t0 = $[2];
  }
  const t1 = `${t0}: ${rule.Password.MinLength}`;
  let t22;
  if ($[3] !== t2) {
    t22 = t2("ShareLinks.RulesTable.Cells.Password.requirements");
    $[3] = t2;
    $[4] = t22;
  } else {
    t22 = $[4];
  }
  let t3;
  if ($[5] !== rule.Password.IsLow || $[6] !== t2) {
    t3 = rule.Password.IsLow ? `- ${t2("ShareLinks.RulesTable.Cells.Password.lowercase")}` : null;
    $[5] = rule.Password.IsLow;
    $[6] = t2;
    $[7] = t3;
  } else {
    t3 = $[7];
  }
  let t4;
  if ($[8] !== rule.Password.IsHigh || $[9] !== t2) {
    t4 = rule.Password.IsHigh ? `- ${t2("ShareLinks.RulesTable.Cells.Password.uppercase")}` : null;
    $[8] = rule.Password.IsHigh;
    $[9] = t2;
    $[10] = t4;
  } else {
    t4 = $[10];
  }
  let t5;
  if ($[11] !== rule.Password.IsDigit || $[12] !== t2) {
    t5 = rule.Password.IsDigit ? `- ${t2("ShareLinks.RulesTable.Cells.Password.digit")}` : null;
    $[11] = rule.Password.IsDigit;
    $[12] = t2;
    $[13] = t5;
  } else {
    t5 = $[13];
  }
  let t6;
  if ($[14] !== t1 || $[15] !== t22 || $[16] !== t3 || $[17] !== t4 || $[18] !== t5) {
    const tooltipLines = [t1, t22, t3, t4, t5];
    t6 = tooltipLines.filter(Boolean);
    $[14] = t1;
    $[15] = t22;
    $[16] = t3;
    $[17] = t4;
    $[18] = t5;
    $[19] = t6;
  } else {
    t6 = $[19];
  }
  return t6;
};
const PasswordCell = (t0) => {
  const $ = compilerRuntimeExports.c(21);
  const {
    rule
  } = t0;
  const {
    t: t2
  } = useTranslation();
  const tooltipContent = useGeneratePasswordTooltip(rule);
  if (tooltipContent.length === 0) {
    let t12;
    if ($[0] !== t2) {
      t12 = t2("ShareLinks.RulesTable.Cells.Password.optional");
      $[0] = t2;
      $[1] = t12;
    } else {
      t12 = $[1];
    }
    let t222;
    if ($[2] !== t12) {
      t222 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { width: 100, className: classes$a.cell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: t12 }) });
      $[2] = t12;
      $[3] = t222;
    } else {
      t222 = $[3];
    }
    return t222;
  }
  let t1;
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
    t1 = {
      duration: 200
    };
    $[4] = t1;
  } else {
    t1 = $[4];
  }
  let t22;
  if ($[5] !== tooltipContent) {
    t22 = tooltipContent.map(_temp$8);
    $[5] = tooltipContent;
    $[6] = t22;
  } else {
    t22 = $[6];
  }
  let t3;
  if ($[7] !== t22) {
    t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: t22 });
    $[7] = t22;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  let t4;
  if ($[9] !== rule.Password || $[10] !== t2) {
    t4 = rule.Password && t2("ShareLinks.RulesTable.Cells.Password.required");
    $[9] = rule.Password;
    $[10] = t2;
    $[11] = t4;
  } else {
    t4 = $[11];
  }
  let t5;
  if ($[12] !== rule.Password || $[13] !== t2) {
    t5 = !rule.Password && t2("ShareLinks.RulesTable.Cells.Password.optional");
    $[12] = rule.Password;
    $[13] = t2;
    $[14] = t5;
  } else {
    t5 = $[14];
  }
  let t6;
  if ($[15] !== t4 || $[16] !== t5) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      t4,
      t5
    ] });
    $[15] = t4;
    $[16] = t5;
    $[17] = t6;
  } else {
    t6 = $[17];
  }
  let t7;
  if ($[18] !== t3 || $[19] !== t6) {
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { width: 100, className: classes$a.cell, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { multiline: true, w: 250, withArrow: true, transitionProps: t1, label: t3, children: t6 }) });
    $[18] = t3;
    $[19] = t6;
    $[20] = t7;
  } else {
    t7 = $[20];
  }
  return t7;
};
function _temp$8(line, index) {
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: line }, index);
}
const formatMaxActivePeriod = (period, t2) => {
  if (period === null) return t2("ShareLinks.RulesTable.Cells.Password.optional");
  if (period === 0) return t2("ShareLinks.RulesTable.Cells.Password.optional");
  return t2("ShareLinks.RulesTable.Cells.Password.requiredCount", {
    count: period
  });
};
const PeriodCell = (t0) => {
  const $ = compilerRuntimeExports.c(5);
  const {
    rule
  } = t0;
  const {
    t: t2
  } = useTranslation();
  let t1;
  if ($[0] !== rule.MaxActivePeriod || $[1] !== t2) {
    t1 = formatMaxActivePeriod(rule.MaxActivePeriod, t2);
    $[0] = rule.MaxActivePeriod;
    $[1] = t2;
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  const formattedPeriod = t1;
  let t22;
  if ($[3] !== formattedPeriod) {
    t22 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { width: 100, className: classes$a.cell, children: formattedPeriod });
    $[3] = formattedPeriod;
    $[4] = t22;
  } else {
    t22 = $[4];
  }
  return t22;
};
const renderRoles = (roles) => {
  const Icon = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$a.iconWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconUsersGroup, { size: 20, color: "#A4B0C2", strokeWidth: "1" }) });
  return roles.map((role, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: classes$a.badge, variant: "outline", leftSection: Icon, children: role.Name }, index));
};
const RolesCell = (t0) => {
  const $ = compilerRuntimeExports.c(4);
  const {
    rule
  } = t0;
  let t1;
  if ($[0] !== rule.Roles) {
    t1 = renderRoles(rule.Roles);
    $[0] = rule.Roles;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const value = t1;
  let t2;
  if ($[2] !== value) {
    t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { width: 300, className: classes$a.wrapperBadge, children: value });
    $[2] = value;
    $[3] = t2;
  } else {
    t2 = $[3];
  }
  return t2;
};
const scrollWrapper = "_scrollWrapper_19ylz_1";
const cell = "_cell_19ylz_10";
const row = "_row_19ylz_21";
const classes$9 = {
  scrollWrapper,
  cell,
  row
};
const Rows = (props) => {
  const $ = compilerRuntimeExports.c(11);
  const {
    rules,
    settings,
    loadSettings,
    deleteRule
  } = props;
  let t0;
  if ($[0] !== deleteRule || $[1] !== loadSettings || $[2] !== rules || $[3] !== settings) {
    let t12;
    if ($[5] !== deleteRule || $[6] !== loadSettings || $[7] !== settings) {
      t12 = (rule, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Tr, { className: classes$9.row, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(RolesCell, { rule }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(PasswordCell, { rule }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(PeriodCell, { rule }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(FolderTypeCell, { rule }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(AccessTypeCell, { rule }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ActionCell, { loadSettings, deleteRule, settings, rule })
      ] }, index);
      $[5] = deleteRule;
      $[6] = loadSettings;
      $[7] = settings;
      $[8] = t12;
    } else {
      t12 = $[8];
    }
    t0 = [...rules].sort(_temp$7).map(t12);
    $[0] = deleteRule;
    $[1] = loadSettings;
    $[2] = rules;
    $[3] = settings;
    $[4] = t0;
  } else {
    t0 = $[4];
  }
  let t1;
  if ($[9] !== t0) {
    t1 = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t0 });
    $[9] = t0;
    $[10] = t1;
  } else {
    t1 = $[10];
  }
  return t1;
};
const RulesTable = (props) => {
  const $ = compilerRuntimeExports.c(32);
  const {
    t: t2
  } = useTranslation();
  let t0;
  if ($[0] !== t2) {
    t0 = t2("ShareLinks.RulesTable.roles");
    $[0] = t2;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  let t1;
  if ($[2] !== t0) {
    t1 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { w: 300, className: classes$9.cell, children: t0 });
    $[2] = t0;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  let t22;
  if ($[4] !== t2) {
    t22 = t2("ShareLinks.RulesTable.password");
    $[4] = t2;
    $[5] = t22;
  } else {
    t22 = $[5];
  }
  let t3;
  if ($[6] !== t22) {
    t3 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { className: classes$9.cell, children: t22 });
    $[6] = t22;
    $[7] = t3;
  } else {
    t3 = $[7];
  }
  let t4;
  if ($[8] !== t2) {
    t4 = t2("ShareLinks.RulesTable.expirationDate");
    $[8] = t2;
    $[9] = t4;
  } else {
    t4 = $[9];
  }
  let t5;
  if ($[10] !== t4) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { className: classes$9.cell, children: t4 });
    $[10] = t4;
    $[11] = t5;
  } else {
    t5 = $[11];
  }
  let t6;
  if ($[12] !== t2) {
    t6 = t2("ShareLinks.RulesTable.folderType");
    $[12] = t2;
    $[13] = t6;
  } else {
    t6 = $[13];
  }
  let t7;
  if ($[14] !== t6) {
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { className: classes$9.cell, children: t6 });
    $[14] = t6;
    $[15] = t7;
  } else {
    t7 = $[15];
  }
  let t8;
  if ($[16] !== t2) {
    t8 = t2("ShareLinks.RulesTable.accessLevel");
    $[16] = t2;
    $[17] = t8;
  } else {
    t8 = $[17];
  }
  let t9;
  if ($[18] !== t8) {
    t9 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { className: classes$9.cell, children: t8 });
    $[18] = t8;
    $[19] = t9;
  } else {
    t9 = $[19];
  }
  let t10;
  if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
    t10 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, {});
    $[20] = t10;
  } else {
    t10 = $[20];
  }
  let t11;
  if ($[21] !== t1 || $[22] !== t3 || $[23] !== t5 || $[24] !== t7 || $[25] !== t9) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Thead, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Tr, { children: [
      t1,
      t3,
      t5,
      t7,
      t9,
      t10
    ] }) });
    $[21] = t1;
    $[22] = t3;
    $[23] = t5;
    $[24] = t7;
    $[25] = t9;
    $[26] = t11;
  } else {
    t11 = $[26];
  }
  let t12;
  if ($[27] !== props) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Tbody, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Rows, { ...props }) });
    $[27] = props;
    $[28] = t12;
  } else {
    t12 = $[28];
  }
  let t13;
  if ($[29] !== t11 || $[30] !== t12) {
    t13 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$9.scrollWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
      t11,
      t12
    ] }) });
    $[29] = t11;
    $[30] = t12;
    $[31] = t13;
  } else {
    t13 = $[31];
  }
  return t13;
};
function _temp$7(a, b) {
  return a.Id - b.Id;
}
const container$7 = "_container_h2qak_1";
const title$4 = "_title_h2qak_11";
const form$1 = "_form_h2qak_15";
const checkboxLabel = "_checkboxLabel_h2qak_22";
const exceptionCheckbox = "_exceptionCheckbox_h2qak_27";
const addException$1 = "_addException_h2qak_31";
const addExceptionInner$1 = "_addExceptionInner_h2qak_41";
const addExceptionLabel$1 = "_addExceptionLabel_h2qak_48";
const description$1 = "_description_h2qak_52";
const classes$8 = {
  container: container$7,
  title: title$4,
  form: form$1,
  checkboxLabel,
  exceptionCheckbox,
  addException: addException$1,
  addExceptionInner: addExceptionInner$1,
  addExceptionLabel: addExceptionLabel$1,
  description: description$1
};
const useCX = createStyles({});
const RulesSettingsPopUpTrigger$1 = (props) => {
  const $ = compilerRuntimeExports.c(8);
  const {
    setIsOpen
  } = props;
  const {
    t: t2
  } = useTranslation();
  let t0;
  if ($[0] !== setIsOpen) {
    t0 = () => setIsOpen(true);
    $[0] = setIsOpen;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const handleOpen = t0;
  let t1;
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
    t1 = {
      inner: classes$8.addExceptionInner,
      label: classes$8.addExceptionLabel
    };
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  let t22;
  if ($[3] !== t2) {
    t22 = t2("ShareLinks.addRule");
    $[3] = t2;
    $[4] = t22;
  } else {
    t22 = $[4];
  }
  let t3;
  if ($[5] !== handleOpen || $[6] !== t22) {
    t3 = /* @__PURE__ */ jsxRuntimeExports.jsx(AddButton, { className: classes$8.addException, classNames: t1, onClick: handleOpen, children: t22 });
    $[5] = handleOpen;
    $[6] = t22;
    $[7] = t3;
  } else {
    t3 = $[7];
  }
  return t3;
};
const ShareLinks = () => {
  var _a;
  const $ = compilerRuntimeExports.c(72);
  const {
    cx
  } = useCX();
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector(_temp$6);
  const [form2, handleSubmit, settings, isLoading, loadSettings, deleteRule] = useShareLinks(filial == null ? void 0 : filial.Id);
  let t0;
  if ($[0] !== cx) {
    t0 = cx(classes$8.checkbox, classes$8.exceptionCheckbox);
    $[0] = cx;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const exceptionCheckbox2 = t0;
  const isDisabled = form2.values.isDisabled;
  const isDisabledButton = settings ? form2.values.isEnabledRules === (settings == null ? void 0 : settings.IsEnabledRules) && form2.values.isDisabled === (settings == null ? void 0 : settings.IsDisabled) : true;
  let t1;
  if ($[2] !== form2) {
    t1 = (e) => {
      const isDisabled_0 = e.target.checked;
      form2.setFieldValue("isDisabled", isDisabled_0);
      if (isDisabled_0) {
        form2.setFieldValue("isEnabledRules", true);
      }
    };
    $[2] = form2;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  const handleChangeIsDisabled = t1;
  let t22;
  if ($[4] !== form2) {
    t22 = (e_0) => {
      const isDisabled_1 = e_0.target.checked;
      form2.setFieldValue("isEnabledRules", isDisabled_1);
    };
    $[4] = form2;
    $[5] = t22;
  } else {
    t22 = $[5];
  }
  const handleChangeIsEnabledRules = t22;
  const showTable = settings && ((_a = settings == null ? void 0 : settings.Rules) == null ? void 0 : _a.length) !== 0;
  let t3;
  if ($[6] !== t2) {
    t3 = t2("ShareLinks.title");
    $[6] = t2;
    $[7] = t3;
  } else {
    t3 = $[7];
  }
  let t4;
  if ($[8] !== t3) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$8.title, children: t3 });
    $[8] = t3;
    $[9] = t4;
  } else {
    t4 = $[9];
  }
  let t5;
  if ($[10] !== isLoading) {
    t5 = isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, radius: "sm", width: 200 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, radius: "sm", width: 200 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, radius: "sm", width: 200 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 1, radius: "sm" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 1, radius: "sm" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 1, radius: "sm" })
    ] });
    $[10] = isLoading;
    $[11] = t5;
  } else {
    t5 = $[11];
  }
  let t6;
  if ($[12] !== form2 || $[13] !== handleSubmit) {
    t6 = form2.onSubmit(handleSubmit);
    $[12] = form2;
    $[13] = handleSubmit;
    $[14] = t6;
  } else {
    t6 = $[14];
  }
  const t7 = isLoading ? "none" : "block";
  let t8;
  if ($[15] !== t7) {
    t8 = {
      display: t7
    };
    $[15] = t7;
    $[16] = t8;
  } else {
    t8 = $[16];
  }
  let t9;
  if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
    t9 = {
      label: classes$8.checkboxLabel
    };
    $[17] = t9;
  } else {
    t9 = $[17];
  }
  let t10;
  if ($[18] !== t2) {
    t10 = t2("ShareLinks.isDisabled");
    $[18] = t2;
    $[19] = t10;
  } else {
    t10 = $[19];
  }
  let t11;
  if ($[20] !== handleChangeIsDisabled || $[21] !== isDisabled || $[22] !== t10) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { size: "xs", classNames: t9, checked: isDisabled, onChange: handleChangeIsDisabled, label: t10 });
    $[20] = handleChangeIsDisabled;
    $[21] = isDisabled;
    $[22] = t10;
    $[23] = t11;
  } else {
    t11 = $[23];
  }
  const t12 = isDisabled ? "block" : "none";
  let t13;
  if ($[24] !== t12) {
    t13 = {
      display: t12
    };
    $[24] = t12;
    $[25] = t13;
  } else {
    t13 = $[25];
  }
  let t14;
  if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
    t14 = {
      label: classes$8.checkboxLabel
    };
    $[26] = t14;
  } else {
    t14 = $[26];
  }
  const t15 = form2.values.isEnabledRules;
  let t16;
  if ($[27] !== t2) {
    t16 = t2("ShareLinks.isEnabledRules");
    $[27] = t2;
    $[28] = t16;
  } else {
    t16 = $[28];
  }
  let t17;
  if ($[29] !== exceptionCheckbox2 || $[30] !== form2.values.isEnabledRules || $[31] !== handleChangeIsEnabledRules || $[32] !== t16) {
    t17 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { size: "xs", className: exceptionCheckbox2, classNames: t14, checked: t15, onChange: handleChangeIsEnabledRules, label: t16 });
    $[29] = exceptionCheckbox2;
    $[30] = form2.values.isEnabledRules;
    $[31] = handleChangeIsEnabledRules;
    $[32] = t16;
    $[33] = t17;
  } else {
    t17 = $[33];
  }
  let t18;
  if ($[34] !== t2) {
    t18 = t2("ShareLinks.helper");
    $[34] = t2;
    $[35] = t18;
  } else {
    t18 = $[35];
  }
  let t19;
  if ($[36] !== t18) {
    t19 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$8.description, children: t18 });
    $[36] = t18;
    $[37] = t19;
  } else {
    t19 = $[37];
  }
  let t20;
  if ($[38] !== loadSettings || $[39] !== settings) {
    t20 = /* @__PURE__ */ jsxRuntimeExports.jsx(PopUpUI, { mobileSize: "100%", desktopPosition: "right-start", trigger: RulesSettingsPopUpTrigger$1, children: (t212) => {
      const {
        isOpen,
        setIsOpen
      } = t212;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(RulesSettings, { isOpen, onSuccess: loadSettings, setIsOpen, settings });
    } });
    $[38] = loadSettings;
    $[39] = settings;
    $[40] = t20;
  } else {
    t20 = $[40];
  }
  let t21;
  if ($[41] !== deleteRule || $[42] !== loadSettings || $[43] !== settings || $[44] !== showTable) {
    t21 = showTable && /* @__PURE__ */ jsxRuntimeExports.jsx(RulesTable, { settings, rules: settings.Rules || [], deleteRule, loadSettings });
    $[41] = deleteRule;
    $[42] = loadSettings;
    $[43] = settings;
    $[44] = showTable;
    $[45] = t21;
  } else {
    t21 = $[45];
  }
  let t222;
  if ($[46] !== t13 || $[47] !== t17 || $[48] !== t19 || $[49] !== t20 || $[50] !== t21) {
    t222 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: t13, children: [
      t17,
      t19,
      t20,
      t21
    ] });
    $[46] = t13;
    $[47] = t17;
    $[48] = t19;
    $[49] = t20;
    $[50] = t21;
    $[51] = t222;
  } else {
    t222 = $[51];
  }
  let t23;
  if ($[52] !== t2) {
    t23 = t2("ShareLinks.description");
    $[52] = t2;
    $[53] = t23;
  } else {
    t23 = $[53];
  }
  let t24;
  if ($[54] !== t23) {
    t24 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$8.description, children: t23 });
    $[54] = t23;
    $[55] = t24;
  } else {
    t24 = $[55];
  }
  let t25;
  if ($[56] !== t2) {
    t25 = t2("save");
    $[56] = t2;
    $[57] = t25;
  } else {
    t25 = $[57];
  }
  let t26;
  if ($[58] !== isDisabledButton || $[59] !== t25) {
    t26 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "sm", radius: 8, disabled: isDisabledButton, mr: "sm", type: "submit", children: t25 });
    $[58] = isDisabledButton;
    $[59] = t25;
    $[60] = t26;
  } else {
    t26 = $[60];
  }
  let t27;
  if ($[61] !== t11 || $[62] !== t222 || $[63] !== t24 || $[64] !== t26 || $[65] !== t6 || $[66] !== t8) {
    t27 = /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: t6, className: classes$8.form, style: t8, children: [
      t11,
      t222,
      t24,
      t26
    ] });
    $[61] = t11;
    $[62] = t222;
    $[63] = t24;
    $[64] = t26;
    $[65] = t6;
    $[66] = t8;
    $[67] = t27;
  } else {
    t27 = $[67];
  }
  let t28;
  if ($[68] !== t27 || $[69] !== t4 || $[70] !== t5) {
    t28 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$8.container, children: [
      t4,
      t5,
      t27
    ] });
    $[68] = t27;
    $[69] = t4;
    $[70] = t5;
    $[71] = t28;
  } else {
    t28 = $[71];
  }
  return t28;
};
function _temp$6(state) {
  return state.filials;
}
const container$6 = "_container_1qe9p_1";
const title$3 = "_title_1qe9p_11";
const body$3 = "_body_1qe9p_15";
const wrapperBadge = "_wrapperBadge_1qe9p_23";
const badge = "_badge_1qe9p_29";
const iconWrapper = "_iconWrapper_1qe9p_44";
const addException = "_addException_1qe9p_52";
const addExceptionInner = "_addExceptionInner_1qe9p_63";
const addExceptionLabel = "_addExceptionLabel_1qe9p_70";
const description = "_description_1qe9p_74";
const classes$7 = {
  container: container$6,
  title: title$3,
  body: body$3,
  wrapperBadge,
  badge,
  iconWrapper,
  addException,
  addExceptionInner,
  addExceptionLabel,
  description
};
const useRestrictRoomsByRoles = (CustomerId) => {
  const [settings, setSettings] = reactExports.useState(void 0);
  const [isLoading, setLoading] = reactExports.useState(false);
  const form2 = useForm({
    validateInputOnChange: true,
    initialValues: {
      isDisabled: false,
      restrictions: [],
      initRestrictions: []
    }
  });
  const loadSettings = reactExports.useCallback(async () => {
    var _a, _b;
    if (!CustomerId) return;
    const params = {
      id: CustomerId,
      extended: true
    };
    const {
      Response
    } = await customerSettingsApiArea().GetCustomer(params);
    const settings_0 = Response.Data.Settings;
    if (!settings_0) return;
    setSettings(settings_0.RoomsRoleAccess);
    if (!settings_0.RoomsRoleAccess) return;
    const values = {
      restrictions: (_a = settings_0.RoomsRoleAccess) == null ? void 0 : _a.Roles,
      initRestrictions: (_b = settings_0.RoomsRoleAccess) == null ? void 0 : _b.Roles
    };
    form2.setValues(values);
  }, [CustomerId]);
  const deleteRule = reactExports.useCallback(async (id) => {
    var _a;
    if (!CustomerId || !settings || isLoading) return;
    const params_0 = {
      CustomerId,
      Type: CustomerSettingType.RoomsAccess,
      Settings: {
        RoomsRoleAccess: {
          IsDisabled: settings.IsDisabled,
          Roles: ((_a = settings.Roles) == null ? void 0 : _a.filter((rule) => rule.Id !== id)) || []
        }
      }
    };
    await customerSettingsApiArea().SaveCustomerSettings(params_0).then(loadSettings);
  }, [CustomerId, settings, isLoading, loadSettings]);
  reactExports.useEffect(() => {
    if (!CustomerId) return;
    setLoading(true);
    loadSettings().finally(() => setLoading(false));
  }, [CustomerId]);
  return [settings, isLoading, loadSettings, deleteRule];
};
const container$5 = "_container_lmfcn_1";
const header$2 = "_header_lmfcn_9";
const body$2 = "_body_lmfcn_27";
const subTitle = "_subTitle_lmfcn_36";
const part = "_part_lmfcn_46";
const footer$2 = "_footer_lmfcn_67";
const classes$6 = {
  container: container$5,
  header: header$2,
  body: body$2,
  subTitle,
  part,
  footer: footer$2
};
const useRolesSettings = (args) => {
  const $ = compilerRuntimeExports.c(12);
  const {
    onClose,
    onSuccess,
    customerId,
    settings
  } = args;
  const [isLoading, setIsLoading] = reactExports.useState(false);
  let t0;
  if ($[0] !== settings) {
    t0 = (settings == null ? void 0 : settings.Roles) ? [...settings.Roles] : [];
    $[0] = settings;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const Rules = t0;
  const [Roles, setRoles] = reactExports.useState(Rules);
  let t1;
  if ($[2] !== Roles || $[3] !== customerId || $[4] !== onClose || $[5] !== onSuccess || $[6] !== (settings == null ? void 0 : settings.Roles)) {
    t1 = () => {
      if (!customerId) {
        return;
      }
      setIsLoading(true);
      const temp = {
        IsDisabled: true,
        Roles: (settings == null ? void 0 : settings.Roles) || []
      };
      customerSettingsApiArea().SaveCustomerSettings({
        CustomerId: customerId,
        Type: CustomerSettingType.RoomsAccess,
        Settings: {
          RoomsRoleAccess: {
            ...temp,
            Roles
          }
        }
      }).then(onClose).then(onSuccess).finally(() => setIsLoading(false));
    };
    $[2] = Roles;
    $[3] = customerId;
    $[4] = onClose;
    $[5] = onSuccess;
    $[6] = settings == null ? void 0 : settings.Roles;
    $[7] = t1;
  } else {
    t1 = $[7];
  }
  const handleSubmit = t1;
  let t2;
  if ($[8] !== Roles || $[9] !== handleSubmit || $[10] !== isLoading) {
    t2 = [isLoading, handleSubmit, Roles, setRoles];
    $[8] = Roles;
    $[9] = handleSubmit;
    $[10] = isLoading;
    $[11] = t2;
  } else {
    t2 = $[11];
  }
  return t2;
};
const RulesRestrictions = (props) => {
  const {
    settings,
    onSuccess
  } = props;
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector((state) => state.filials);
  const onClose = () => props.setIsOpen(false);
  const [isLoading, handleSubmit, roles, setRoles] = useRolesSettings({
    onClose,
    settings,
    onSuccess,
    customerId: filial == null ? void 0 : filial.Id
  });
  const loader = reactExports.useCallback((query) => {
    return roleApiArea().GetRolesByName({
      Query: query,
      FilterConditions: filial ? [{
        Type: IFiltersEnumType.FilialFilter,
        NumValues: [filial.Id]
      }] : []
    });
  }, [filial]);
  const handleValueChange = reactExports.useCallback((items) => {
    setRoles(items.map((item) => ({
      Id: item.value,
      Name: item.label
    })));
  }, []);
  const handleMapDataToOptions = reactExports.useCallback((item_0) => ({
    label: item_0.Name,
    value: item_0.Id
  }), []);
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$6.container, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$6.header, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: t2("RestrictRoomsByRoles.RulesRestrictionPopUp.title") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: onClose, children: /* @__PURE__ */ jsxRuntimeExports.jsx(qXe, { size: 16 }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$6.body, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$6.part, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$6.subTitle, children: t2("RestrictRoomsByRoles.RulesRestrictionPopUp.roles") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(PillsInputAutoCompleteWithQuery, { loaderData: loader, onValueChange: handleValueChange, defaultValues: roles.map(handleMapDataToOptions), mapDataToOptions: handleMapDataToOptions, props: {
        PillsInputFieldProps: {
          placeholder: t2("RestrictRoomsByRoles.RulesRestrictionPopUp.chooseRoles")
        }
      } })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$6.footer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, size: "sm", radius: 8, loading: isLoading, onClick: handleSubmit, children: t2("RestrictRoomsByRoles.RulesRestrictionPopUp.save") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, size: "sm", color: "grey", radius: 8, variant: "light", onClick: onClose, children: t2("RestrictRoomsByRoles.RulesRestrictionPopUp.cancel") })
    ] })
  ] });
};
const RulesSettingsPopUpTrigger = (props) => {
  const $ = compilerRuntimeExports.c(8);
  const {
    setIsOpen
  } = props;
  const {
    t: t2
  } = useTranslation();
  let t0;
  if ($[0] !== setIsOpen) {
    t0 = () => setIsOpen(true);
    $[0] = setIsOpen;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const handleOpen = t0;
  let t1;
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
    t1 = {
      inner: classes$7.addExceptionInner,
      label: classes$7.addExceptionLabel
    };
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  let t22;
  if ($[3] !== t2) {
    t22 = t2("RestrictRoomsByRoles.addRole");
    $[3] = t2;
    $[4] = t22;
  } else {
    t22 = $[4];
  }
  let t3;
  if ($[5] !== handleOpen || $[6] !== t22) {
    t3 = /* @__PURE__ */ jsxRuntimeExports.jsx(AddButton, { className: classes$7.addException, classNames: t1, onClick: handleOpen, children: t22 });
    $[5] = handleOpen;
    $[6] = t22;
    $[7] = t3;
  } else {
    t3 = $[7];
  }
  return t3;
};
const RestrictRoomsByRoles = (t0) => {
  const $ = compilerRuntimeExports.c(33);
  const {
    customerId
  } = t0;
  const {
    t: t2
  } = useTranslation();
  const [settings, isLoading, loadSettings, deleteRule] = useRestrictRoomsByRoles(customerId);
  let t1;
  if ($[0] !== t2) {
    t1 = t2("RestrictRoomsByRoles.title");
    $[0] = t2;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  let t22;
  if ($[2] !== t1) {
    t22 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$7.title, children: t1 });
    $[2] = t1;
    $[3] = t22;
  } else {
    t22 = $[3];
  }
  let t3;
  if ($[4] !== isLoading) {
    t3 = isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, radius: "sm", width: 200 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, radius: "sm", width: 200 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, radius: "sm", width: 200 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 1, radius: "sm" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 1, radius: "sm" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 1, radius: "sm" })
    ] });
    $[4] = isLoading;
    $[5] = t3;
  } else {
    t3 = $[5];
  }
  const t4 = isLoading ? "none" : "block";
  let t5;
  if ($[6] !== t4) {
    t5 = {
      display: t4
    };
    $[6] = t4;
    $[7] = t5;
  } else {
    t5 = $[7];
  }
  let t6;
  if ($[8] !== loadSettings || $[9] !== settings) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(PopUpUI, { mobileSize: "100%", desktopPosition: "right-start", trigger: RulesSettingsPopUpTrigger, children: (t72) => {
      const {
        isOpen,
        setIsOpen
      } = t72;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(RulesRestrictions, { isOpen, onSuccess: loadSettings, setIsOpen, settings });
    } });
    $[8] = loadSettings;
    $[9] = settings;
    $[10] = t6;
  } else {
    t6 = $[10];
  }
  let t7;
  if ($[11] !== (settings == null ? void 0 : settings.Roles)) {
    t7 = (settings == null ? void 0 : settings.Roles) || [];
    $[11] = settings == null ? void 0 : settings.Roles;
    $[12] = t7;
  } else {
    t7 = $[12];
  }
  let t8;
  if ($[13] !== deleteRule || $[14] !== t7) {
    let t92;
    if ($[16] !== deleteRule) {
      t92 = (Role, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: classes$7.badge, variant: "outline", rightSection: /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { className: classes$7.iconWrapper, onClick: () => deleteRule(Role.Id), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ES, { color: "#667085" }) }), children: Role.Name }, index);
      $[16] = deleteRule;
      $[17] = t92;
    } else {
      t92 = $[17];
    }
    t8 = t7.map(t92);
    $[13] = deleteRule;
    $[14] = t7;
    $[15] = t8;
  } else {
    t8 = $[15];
  }
  let t9;
  if ($[18] !== t8) {
    t9 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$7.wrapperBadge, children: t8 });
    $[18] = t8;
    $[19] = t9;
  } else {
    t9 = $[19];
  }
  let t10;
  if ($[20] !== t2) {
    t10 = t2("RestrictRoomsByRoles.description");
    $[20] = t2;
    $[21] = t10;
  } else {
    t10 = $[21];
  }
  let t11;
  if ($[22] !== t10) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$7.description, children: t10 });
    $[22] = t10;
    $[23] = t11;
  } else {
    t11 = $[23];
  }
  let t12;
  if ($[24] !== t11 || $[25] !== t5 || $[26] !== t6 || $[27] !== t9) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$7.body, style: t5, children: [
      t6,
      t9,
      t11
    ] });
    $[24] = t11;
    $[25] = t5;
    $[26] = t6;
    $[27] = t9;
    $[28] = t12;
  } else {
    t12 = $[28];
  }
  let t13;
  if ($[29] !== t12 || $[30] !== t22 || $[31] !== t3) {
    t13 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$7.container, children: [
      t22,
      t3,
      t12
    ] });
    $[29] = t12;
    $[30] = t22;
    $[31] = t3;
    $[32] = t13;
  } else {
    t13 = $[32];
  }
  return t13;
};
const container$4 = "_container_azkxk_1";
const title$2 = "_title_azkxk_11";
const form = "_form_azkxk_15";
const input = "_input_azkxk_22";
const select = "_select_azkxk_22";
const label = "_label_azkxk_26";
const classes$5 = {
  container: container$4,
  title: title$2,
  form,
  input,
  select,
  label
};
const schema$1 = objectType({
  Host: stringType().nullable(),
  IsEnabled: booleanType(),
  Port: numberType().optional().default(0),
  Format: numberType().default(0)
});
const useSettingSIEMSystem = (CustomerId) => {
  const $ = compilerRuntimeExports.c(26);
  const [isLoading, setLoading] = reactExports.useState(true);
  const [isPartLoading, setIsPartLoading] = reactExports.useState(false);
  const [initialValuesFromServer, setInitialValuesFromServer] = reactExports.useState(null);
  const {
    t: t2
  } = useTranslation();
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = {
      validateInputOnChange: true,
      initialValues: {
        Host: "",
        Port: 0,
        Format: CustomerSettingType.None,
        IsEnabled: false
      },
      validate: _temp$5
    };
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  const form2 = useForm(t0);
  let t1;
  if ($[1] !== CustomerId || $[2] !== form2) {
    t1 = async () => {
      var _a, _b, _c, _d;
      const params = {
        id: CustomerId,
        extended: true
      };
      const {
        Response
      } = await customerSettingsApiArea().GetCustomer(params);
      const settings = Response.Data.Settings;
      setLoading(false);
      if (!settings || !settings.ExportUserActionsSettings) {
        return;
      }
      const values_0 = {
        Host: ((_a = settings.ExportUserActionsSettings) == null ? void 0 : _a.Host) ?? "",
        Port: Number(((_b = settings.ExportUserActionsSettings) == null ? void 0 : _b.Port) ?? 0),
        Format: Number(((_c = settings.ExportUserActionsSettings) == null ? void 0 : _c.Format) ?? 0),
        IsEnabled: ((_d = settings.ExportUserActionsSettings) == null ? void 0 : _d.IsEnabled) ?? false
      };
      form2.setValues(values_0);
      setInitialValuesFromServer(values_0);
    };
    $[1] = CustomerId;
    $[2] = form2;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  const loadSettings = t1;
  let t22;
  if ($[4] !== CustomerId || $[5] !== loadSettings) {
    t22 = () => {
      if (!CustomerId) {
        return;
      }
      setLoading(true);
      loadSettings().finally(() => setLoading(false));
    };
    $[4] = CustomerId;
    $[5] = loadSettings;
    $[6] = t22;
  } else {
    t22 = $[6];
  }
  let t3;
  if ($[7] !== CustomerId) {
    t3 = [CustomerId];
    $[7] = CustomerId;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  reactExports.useEffect(t22, t3);
  let t4;
  if ($[9] !== loadSettings) {
    t4 = () => loadSettings().finally(() => setIsPartLoading(false));
    $[9] = loadSettings;
    $[10] = t4;
  } else {
    t4 = $[10];
  }
  const update = t4;
  let t5;
  if ($[11] !== CustomerId || $[12] !== form2.values || $[13] !== t2 || $[14] !== update) {
    t5 = async () => {
      if (!CustomerId) {
        return;
      }
      setIsPartLoading(true);
      const params_0 = {
        CustomerId,
        Type: CustomerSettingType.ExportUserActionsSettings,
        Settings: {
          ExportUserActionsSettings: {
            Host: form2.values.Host,
            Port: form2.values.Port || 0,
            Format: form2.values.Format,
            IsEnabled: form2.values.IsEnabled
          }
        }
      };
      try {
        await customerSettingsApiArea().SaveCustomerSettings(params_0);
        await update();
        showNotification({
          title: t2("SettingSIEMSystem.notificationTitle"),
          message: t2("SettingSIEMSystem.success"),
          autoClose: true,
          color: "green"
        });
      } catch (t62) {
        showNotification({
          title: t2("SettingSIEMSystem.notificationTitle"),
          message: t2("SettingSIEMSystem.error"),
          autoClose: true,
          color: "red"
        });
      }
    };
    $[11] = CustomerId;
    $[12] = form2.values;
    $[13] = t2;
    $[14] = update;
    $[15] = t5;
  } else {
    t5 = $[15];
  }
  const handleSubmit = t5;
  let t6;
  bb0: {
    if (!initialValuesFromServer) {
      t6 = false;
      break bb0;
    }
    let t72;
    if ($[16] !== initialValuesFromServer) {
      t72 = JSON.stringify(initialValuesFromServer);
      $[16] = initialValuesFromServer;
      $[17] = t72;
    } else {
      t72 = $[17];
    }
    let t8;
    if ($[18] !== form2.values) {
      t8 = JSON.stringify(form2.values);
      $[18] = form2.values;
      $[19] = t8;
    } else {
      t8 = $[19];
    }
    t6 = t72 !== t8;
  }
  const isFormChanged = t6;
  let t7;
  if ($[20] !== form2 || $[21] !== handleSubmit || $[22] !== isFormChanged || $[23] !== isLoading || $[24] !== isPartLoading) {
    t7 = [form2, handleSubmit, isLoading, isPartLoading, isFormChanged];
    $[20] = form2;
    $[21] = handleSubmit;
    $[22] = isFormChanged;
    $[23] = isLoading;
    $[24] = isPartLoading;
    $[25] = t7;
  } else {
    t7 = $[25];
  }
  return t7;
};
function _temp$5(values) {
  return getValidateErrors(schema$1, values);
}
var ExportUserActionsSettingsFormat = /* @__PURE__ */ ((ExportUserActionsSettingsFormat2) => {
  ExportUserActionsSettingsFormat2[ExportUserActionsSettingsFormat2["CEF"] = 0] = "CEF";
  ExportUserActionsSettingsFormat2[ExportUserActionsSettingsFormat2["LEEF"] = 1] = "LEEF";
  return ExportUserActionsSettingsFormat2;
})(ExportUserActionsSettingsFormat || {});
const options = [{
  value: ExportUserActionsSettingsFormat.CEF.toString(),
  label: "CEF"
}, {
  value: ExportUserActionsSettingsFormat.LEEF.toString(),
  label: "LEEF"
}];
const SettingSIEMSystem = () => {
  const $ = compilerRuntimeExports.c(29);
  const {
    t: t2
  } = useTranslation();
  const {
    filial
  } = useAppSelector(_temp$4);
  const [form2, handleSubmit, isLoading, isPartLoading, isFormChanged] = useSettingSIEMSystem(filial == null ? void 0 : filial.Id);
  let t0;
  if ($[0] !== form2.errors || $[1] !== isFormChanged) {
    t0 = Object.keys((form2 == null ? void 0 : form2.errors) || {}).length > 0 || !isFormChanged;
    $[0] = form2.errors;
    $[1] = isFormChanged;
    $[2] = t0;
  } else {
    t0 = $[2];
  }
  const isDisabledButton = t0;
  let t1;
  if ($[3] !== form2) {
    t1 = options.find((e) => e.value === form2.getInputProps("Format").value.toString());
    $[3] = form2;
    $[4] = t1;
  } else {
    t1 = $[4];
  }
  const currentValue = t1;
  let t22;
  if ($[5] !== form2) {
    t22 = (value) => {
      form2.setFieldValue("Format", Number(value));
    };
    $[5] = form2;
    $[6] = t22;
  } else {
    t22 = $[6];
  }
  const handleChangeSelectSIEM = t22;
  let t3;
  if ($[7] !== form2) {
    t3 = (value_0) => {
      if (!value_0) {
        form2.setFieldValue("Port", 0);
        return;
      }
      form2.setFieldValue("Port", Number(value_0));
    };
    $[7] = form2;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  const handleChangePort = t3;
  let t4;
  if ($[9] !== t2) {
    t4 = t2("SettingSIEMSystem.title");
    $[9] = t2;
    $[10] = t4;
  } else {
    t4 = $[10];
  }
  let t5;
  if ($[11] !== t4) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$5.title, children: t4 });
    $[11] = t4;
    $[12] = t5;
  } else {
    t5 = $[12];
  }
  let t6;
  if ($[13] !== isLoading) {
    t6 = isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$5.skeletons, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, radius: "sm", width: 100 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 20, mt: 4, radius: "sm", width: 100 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 10, mt: 20, radius: "sm", width: 100 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 4, radius: "sm", width: 350 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 10, mt: 20, radius: "sm", width: 100 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 4, radius: "sm", width: 350 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 10, mt: 20, radius: "sm", width: 100 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 30, mt: 4, radius: "sm", width: 350 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 40, mt: 10, radius: "sm", width: 100 })
    ] });
    $[13] = isLoading;
    $[14] = t6;
  } else {
    t6 = $[14];
  }
  let t7;
  if ($[15] !== (currentValue == null ? void 0 : currentValue.value) || $[16] !== form2 || $[17] !== handleChangePort || $[18] !== handleChangeSelectSIEM || $[19] !== handleSubmit || $[20] !== isDisabledButton || $[21] !== isLoading || $[22] !== isPartLoading || $[23] !== t2) {
    t7 = !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: form2.onSubmit(handleSubmit), className: classes$5.form, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: classes$5.radio, size: "xs", checked: !form2.values.IsEnabled, onChange: () => form2.setValues({
        IsEnabled: false
      }), label: t2("SettingSIEMSystem.turnOff") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, { className: classes$5.radio, size: "xs", checked: form2.values.IsEnabled, onChange: () => form2.setValues({
        IsEnabled: true
      }), label: t2("SettingSIEMSystem.turnOn") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Input.Wrapper, { className: classes$5.label, label: t2("SettingSIEMSystem.host"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { ...form2.getInputProps("Host"), disabled: !form2.values.IsEnabled, className: classes$5.input }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Input.Wrapper, { className: classes$5.label, label: t2("SettingSIEMSystem.port"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(NumberInput, { ...form2.getInputProps("Port"), onChange: handleChangePort, hideControls: true, disabled: !form2.values.IsEnabled, className: classes$5.input }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Input.Wrapper, { className: classes$5.label, label: t2("SettingSIEMSystem.format"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select, { ...form2.getInputProps("Format"), onChange: handleChangeSelectSIEM, disabled: !form2.values.IsEnabled, className: classes$5.select, rightSection: /* @__PURE__ */ jsxRuntimeExports.jsx(gq, { size: "1rem", color: "#98A2B3" }), value: currentValue == null ? void 0 : currentValue.value, data: options, comboboxProps: {
        transitionProps: {
          transition: "pop",
          duration: 200
        }
      } }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "sm", loading: isPartLoading, radius: 8, disabled: isDisabledButton, mr: "sm", type: "submit", children: t2("save") })
    ] });
    $[15] = currentValue == null ? void 0 : currentValue.value;
    $[16] = form2;
    $[17] = handleChangePort;
    $[18] = handleChangeSelectSIEM;
    $[19] = handleSubmit;
    $[20] = isDisabledButton;
    $[21] = isLoading;
    $[22] = isPartLoading;
    $[23] = t2;
    $[24] = t7;
  } else {
    t7 = $[24];
  }
  let t8;
  if ($[25] !== t5 || $[26] !== t6 || $[27] !== t7) {
    t8 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$5.container, children: [
      t5,
      t6,
      t7
    ] });
    $[25] = t5;
    $[26] = t6;
    $[27] = t7;
    $[28] = t8;
  } else {
    t8 = $[28];
  }
  return t8;
};
function _temp$4(state) {
  return state.filials;
}
const container$3 = "_container_9qznq_1";
const classes$4 = {
  container: container$3
};
class DlpSettingsService {
  async GetDlpProfiles(customerId) {
    var _a;
    try {
      const params = customerId !== void 0 ? {
        customerId
      } : {};
      const {
        data
      } = await axiosInstance.get("v1/dlp-settings", {
        params
      });
      return data;
    } catch (e) {
      const error = new Error("Unable to fetch DLP profiles. Please try again later.");
      error.status = (_a = e == null ? void 0 : e.response) == null ? void 0 : _a.status;
      throw error;
    }
  }
  async GetDlpProfile(id) {
    try {
      const {
        data
      } = await axiosInstance.get(`v1/dlp-settings/${id}`);
      return data;
    } catch (e) {
      throw new Error("Unable to fetch DLP profile. Please try again later.");
    }
  }
  async SaveDlpProfile(params) {
    try {
      const {
        data
      } = await axiosInstance.post("v1/dlp-settings", params);
      return data;
    } catch (e) {
      throw new Error("Unable to save DLP profile. Please try again later.");
    }
  }
  async DeleteDlpProfile(id) {
    try {
      await axiosInstance.delete(`v1/dlp-settings/${id}`);
    } catch (e) {
      throw new Error("Unable to delete DLP profile. Please try again later.");
    }
  }
  async ToggleEnabled(id, enabled) {
    try {
      const profile = await this.GetDlpProfile(id);
      const updatedProfile = {
        ...profile,
        Enabled: enabled
      };
      const {
        data
      } = await axiosInstance.post("v1/dlp-settings", updatedProfile);
      return data;
    } catch (e) {
      throw new Error("Unable to toggle DLP profile status. Please try again later.");
    }
  }
}
const dlpSettingsApiArea = () => new DlpSettingsService();
const container$2 = "_container_59mb7_1";
const header$1 = "_header_59mb7_12";
const body$1 = "_body_59mb7_18";
const footer$1 = "_footer_59mb7_23";
const classes$3 = {
  container: container$2,
  header: header$1,
  body: body$1,
  footer: footer$1
};
const DeleteDlpDialog = ({
  profileId,
  profileName,
  isOpen,
  setIsOpen,
  onSuccess
}) => {
  const {
    t: t2
  } = useTranslation();
  const [isDeleting, setIsDeleting] = reactExports.useState(false);
  const handleDelete = async () => {
    try {
      setIsDeleting(true);
      await dlpSettingsApiArea().DeleteDlpProfile(profileId);
      notifications.show({
        title: t2("dlp.success"),
        message: t2("dlp.deleteSuccess"),
        color: "green"
      });
      await onSuccess();
      setIsOpen(false);
    } catch (error) {
      console.error("Failed to delete DLP profile:", error);
      notifications.show({
        title: t2("dlp.error"),
        message: error instanceof Error ? error.message : t2("dlp.deleteError"),
        color: "red"
      });
    } finally {
      setIsDeleting(false);
    }
  };
  if (!isOpen) return null;
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$3.container, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$3.header, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { size: "lg", fw: 600, children: t2("dlp.deleteIntegrationTitle") }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$3.body, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { size: "sm", children: t2("dlp.deleteIntegrationConfirm") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { size: "sm", fw: 600, mt: "sm", children: profileName })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: "sm", className: classes$3.footer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, color: "red", onClick: handleDelete, loading: isDeleting, disabled: isDeleting, children: t2("dlp.delete") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, variant: "light", color: "gray", onClick: () => setIsOpen(false), disabled: isDeleting, children: t2("dlp.cancel") })
    ] })
  ] });
};
const DlpItem = (t0) => {
  var _a, _b, _c;
  const $ = compilerRuntimeExports.c(27);
  const {
    profile,
    onEdit,
    onDelete,
    onToggle
  } = t0;
  let t1;
  if ($[0] !== onToggle) {
    t1 = (event) => {
      onToggle(event.currentTarget.checked);
    };
    $[0] = onToggle;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const handleToggle = t1;
  const DeleteTrigger = _temp$3;
  let t2;
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
    t2 = {
      position: "relative"
    };
    $[2] = t2;
  } else {
    t2 = $[2];
  }
  let t3;
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
    t3 = {
      width: "100%"
    };
    $[3] = t3;
  } else {
    t3 = $[3];
  }
  const t4 = (_a = profile.Server) == null ? void 0 : _a.Name;
  let t5;
  if ($[4] !== t4) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { style: t3, children: t4 });
    $[4] = t4;
    $[5] = t5;
  } else {
    t5 = $[5];
  }
  let t6;
  if ($[6] !== handleToggle || $[7] !== profile.Enabled) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { checked: profile.Enabled, onChange: handleToggle }) });
    $[6] = handleToggle;
    $[7] = profile.Enabled;
    $[8] = t6;
  } else {
    t6 = $[8];
  }
  let t7;
  if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
    t7 = {
      width: 60,
      maxWidth: 60
    };
    $[9] = t7;
  } else {
    t7 = $[9];
  }
  let t8;
  if ($[10] !== onEdit || $[11] !== profile.Id) {
    t8 = () => onEdit(profile.Id);
    $[10] = onEdit;
    $[11] = profile.Id;
    $[12] = t8;
  } else {
    t8 = $[12];
  }
  let t9;
  if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
    t9 = /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {});
    $[13] = t9;
  } else {
    t9 = $[13];
  }
  let t10;
  if ($[14] !== t8) {
    t10 = /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: t8, children: t9 });
    $[14] = t8;
    $[15] = t10;
  } else {
    t10 = $[15];
  }
  let t11;
  if ($[16] !== onDelete || $[17] !== profile.Id || $[18] !== ((_b = profile.Server) == null ? void 0 : _b.Name)) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(PopUpUI, { mobileSize: "100%", desktopPosition: "bottom-end", trigger: DeleteTrigger, children: (t122) => {
      var _a2;
      const {
        isOpen,
        setIsOpen: setIsOpen_0
      } = t122;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteDlpDialog, { profileId: profile.Id, profileName: ((_a2 = profile.Server) == null ? void 0 : _a2.Name) || "", isOpen, setIsOpen: setIsOpen_0, onSuccess: onDelete });
    } });
    $[16] = onDelete;
    $[17] = profile.Id;
    $[18] = (_c = profile.Server) == null ? void 0 : _c.Name;
    $[19] = t11;
  } else {
    t11 = $[19];
  }
  let t12;
  if ($[20] !== t10 || $[21] !== t11) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { style: t7, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 4, justify: "flex-end", children: [
      t10,
      t11
    ] }) });
    $[20] = t10;
    $[21] = t11;
    $[22] = t12;
  } else {
    t12 = $[22];
  }
  let t13;
  if ($[23] !== t12 || $[24] !== t5 || $[25] !== t6) {
    t13 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Tr, { style: t2, children: [
      t5,
      t6,
      t12
    ] });
    $[23] = t12;
    $[24] = t5;
    $[25] = t6;
    $[26] = t13;
  } else {
    t13 = $[26];
  }
  return t13;
};
function _temp$3(t0) {
  const {
    setIsOpen
  } = t0;
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: () => setIsOpen(true), children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconTrash, {}) });
}
var ItemDlpTypes = /* @__PURE__ */ ((ItemDlpTypes2) => {
  ItemDlpTypes2[ItemDlpTypes2["NONE"] = 0] = "NONE";
  ItemDlpTypes2[ItemDlpTypes2["CREATE"] = 1] = "CREATE";
  ItemDlpTypes2[ItemDlpTypes2["EDIT"] = 2] = "EDIT";
  return ItemDlpTypes2;
})(ItemDlpTypes || {});
const useDlpPage = (customerId) => {
  const {
    t: t2
  } = useTranslation();
  const [dlps, setDlps] = reactExports.useState([]);
  const [isLoading, setLoading] = reactExports.useState(true);
  const [itemToEditId, setItemToEditId] = reactExports.useState(null);
  const [itemControl, setItemControl] = reactExports.useState(
    0
    /* NONE */
  );
  const [accessDenied, setAccessDenied] = reactExports.useState(false);
  const loadProfiles = reactExports.useCallback(async () => {
    try {
      setLoading(true);
      const profiles = await dlpSettingsApiArea().GetDlpProfiles(customerId);
      setDlps(profiles);
      setAccessDenied(false);
    } catch (error) {
      console.error("Failed to load DLP profiles:", error);
      if ((error == null ? void 0 : error.status) === 403) {
        setAccessDenied(true);
      } else {
        notifications.show({
          title: t2("dlp.loadError"),
          message: t2("dlp.loadErrorMessage"),
          color: "red"
        });
      }
    } finally {
      setLoading(false);
    }
  }, [t2, customerId]);
  const onProfileSaved = reactExports.useCallback(async () => {
    await loadProfiles();
  }, [loadProfiles]);
  const toggleEnabled = reactExports.useCallback(async (id, enabled) => {
    try {
      await dlpSettingsApiArea().ToggleEnabled(id, enabled);
      notifications.show({
        title: t2("dlp.success"),
        message: t2("dlp.toggleSuccess", {
          action: enabled ? t2("dlp.enabled") : t2("dlp.disabled")
        }),
        color: "green"
      });
      await loadProfiles();
    } catch (error_0) {
      console.error("Failed to toggle DLP profile:", error_0);
      notifications.show({
        title: t2("dlp.error"),
        message: error_0 instanceof Error ? error_0.message : t2("dlp.toggleError"),
        color: "red"
      });
    }
  }, [t2, loadProfiles]);
  reactExports.useEffect(() => {
    loadProfiles();
  }, [customerId]);
  const profileToEdit = dlps.find((p) => p.Id === itemToEditId);
  return {
    itemControl,
    itemToEditId,
    dlps,
    isLoading,
    profileToEdit,
    accessDenied,
    setItemControl,
    setItemToEditId,
    loadProfiles,
    onProfileSaved,
    toggleEnabled
  };
};
const container$1 = "_container_1oe74_1";
const formContent = "_formContent_1oe74_8";
const buttonGroup = "_buttonGroup_1oe74_25";
const fullWidth = "_fullWidth_1oe74_30";
const timeoutContainer = "_timeoutContainer_1oe74_34";
const timeoutItem = "_timeoutItem_1oe74_55";
const timeoutItemWide = "_timeoutItemWide_1oe74_59";
const title$1 = "_title_1oe74_69";
const filterContainer = "_filterContainer_1oe74_80";
const filterItem = "_filterItem_1oe74_94";
const filterItemWide = "_filterItemWide_1oe74_98";
const restrictions = "_restrictions_1oe74_102";
const restrictionsItem = "_restrictionsItem_1oe74_116";
const restrictionsItemWide = "_restrictionsItemWide_1oe74_120";
const flexRow = "_flexRow_1oe74_150";
const classes$2 = {
  container: container$1,
  formContent,
  buttonGroup,
  fullWidth,
  timeoutContainer,
  timeoutItem,
  timeoutItemWide,
  title: title$1,
  filterContainer,
  filterItem,
  filterItemWide,
  restrictions,
  restrictionsItem,
  restrictionsItemWide,
  flexRow
};
var DlpFileTypesMode = /* @__PURE__ */ ((DlpFileTypesMode2) => {
  DlpFileTypesMode2[DlpFileTypesMode2["Off"] = 0] = "Off";
  DlpFileTypesMode2[DlpFileTypesMode2["AllowList"] = 1] = "AllowList";
  DlpFileTypesMode2[DlpFileTypesMode2["DenyList"] = 2] = "DenyList";
  return DlpFileTypesMode2;
})(DlpFileTypesMode || {});
var DlpOnTimeout = /* @__PURE__ */ ((DlpOnTimeout2) => {
  DlpOnTimeout2[DlpOnTimeout2["Allow"] = 0] = "Allow";
  DlpOnTimeout2[DlpOnTimeout2["Block"] = 1] = "Block";
  DlpOnTimeout2[DlpOnTimeout2["Quarantine"] = 2] = "Quarantine";
  return DlpOnTimeout2;
})(DlpOnTimeout || {});
const schema = objectType({
  Host: stringType().min(1, "Адрес обязателен"),
  Port: coerce.number().min(1, "Порт обязателен").max(65535, "Некорректный порт"),
  ReqmodService: stringType(),
  RespmodService: stringType()
});
const useServerSettings = (t0) => {
  const $ = compilerRuntimeExports.c(10);
  const {
    server,
    onClose,
    onSuccess
  } = t0;
  let t1;
  if ($[0] !== server) {
    t1 = {
      validateInputOnChange: true,
      initialValues: server ? {
        Host: server.Host,
        Port: server.Port,
        ReqmodService: server.ReqmodService,
        RespmodService: server.RespmodService
      } : {
        Host: "",
        Port: 80,
        ReqmodService: "/",
        RespmodService: "/"
      },
      validate: _temp$2
    };
    $[0] = server;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const form2 = useForm(t1);
  let t2;
  if ($[2] !== form2 || $[3] !== onClose || $[4] !== onSuccess || $[5] !== (server == null ? void 0 : server.Name)) {
    t2 = () => {
      const validation = form2.validate();
      if (validation.hasErrors) {
        return;
      }
      const newServer = {
        Name: (server == null ? void 0 : server.Name) || "",
        Host: form2.values.Host,
        Port: form2.values.Port,
        ReqmodService: form2.values.ReqmodService,
        RespmodService: form2.values.RespmodService
      };
      onSuccess(newServer);
      onClose();
    };
    $[2] = form2;
    $[3] = onClose;
    $[4] = onSuccess;
    $[5] = server == null ? void 0 : server.Name;
    $[6] = t2;
  } else {
    t2 = $[6];
  }
  const handleSubmit = t2;
  let t3;
  if ($[7] !== form2 || $[8] !== handleSubmit) {
    t3 = [form2, handleSubmit];
    $[7] = form2;
    $[8] = handleSubmit;
    $[9] = t3;
  } else {
    t3 = $[9];
  }
  return t3;
};
function _temp$2(values) {
  return getValidateErrors(schema, values);
}
const container = "_container_175w5_1";
const header = "_header_175w5_10";
const title = "_title_175w5_18";
const body = "_body_175w5_24";
const footer = "_footer_175w5_32";
const classes$1 = {
  container,
  header,
  title,
  body,
  footer
};
const ServerSettings = (t0) => {
  const $ = compilerRuntimeExports.c(83);
  const {
    setIsOpen,
    server,
    onSuccess
  } = t0;
  const {
    t: t2
  } = useTranslation();
  let t1;
  if ($[0] !== setIsOpen) {
    t1 = () => setIsOpen(false);
    $[0] = setIsOpen;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const onClose = t1;
  let t22;
  if ($[2] !== onClose || $[3] !== onSuccess || $[4] !== server) {
    t22 = {
      server,
      onClose,
      onSuccess
    };
    $[2] = onClose;
    $[3] = onSuccess;
    $[4] = server;
    $[5] = t22;
  } else {
    t22 = $[5];
  }
  const [form2, handleSubmit] = useServerSettings(t22);
  let t3;
  if ($[6] !== server || $[7] !== t2) {
    t3 = server ? t2("dlp.server.edit") : t2("dlp.server.add");
    $[6] = server;
    $[7] = t2;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  const title2 = t3;
  let t4;
  if ($[9] !== server || $[10] !== t2) {
    t4 = server ? t2("dlp.server.updateButton") : t2("dlp.server.saveButton");
    $[9] = server;
    $[10] = t2;
    $[11] = t4;
  } else {
    t4 = $[11];
  }
  const submitLabel = t4;
  let t5;
  if ($[12] !== title2) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$1.title, children: title2 });
    $[12] = title2;
    $[13] = t5;
  } else {
    t5 = $[13];
  }
  let t6;
  if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(IconX, { size: 16 });
    $[14] = t6;
  } else {
    t6 = $[14];
  }
  let t7;
  if ($[15] !== onClose) {
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: onClose, children: t6 });
    $[15] = onClose;
    $[16] = t7;
  } else {
    t7 = $[16];
  }
  let t8;
  if ($[17] !== t5 || $[18] !== t7) {
    t8 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$1.header, children: [
      t5,
      t7
    ] });
    $[17] = t5;
    $[18] = t7;
    $[19] = t8;
  } else {
    t8 = $[19];
  }
  let t9;
  if ($[20] !== t2) {
    t9 = t2("dlp.server.host");
    $[20] = t2;
    $[21] = t9;
  } else {
    t9 = $[21];
  }
  let t10;
  if ($[22] !== t2) {
    t10 = t2("dlp.server.hostPlaceholder");
    $[22] = t2;
    $[23] = t10;
  } else {
    t10 = $[23];
  }
  let t11;
  if ($[24] !== form2) {
    t11 = form2.getInputProps("Host");
    $[24] = form2;
    $[25] = t11;
  } else {
    t11 = $[25];
  }
  let t12;
  if ($[26] !== t10 || $[27] !== t11 || $[28] !== t9) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { label: t9, placeholder: t10, ...t11 });
    $[26] = t10;
    $[27] = t11;
    $[28] = t9;
    $[29] = t12;
  } else {
    t12 = $[29];
  }
  let t13;
  if ($[30] !== t2) {
    t13 = t2("dlp.server.port");
    $[30] = t2;
    $[31] = t13;
  } else {
    t13 = $[31];
  }
  let t14;
  if ($[32] !== t2) {
    t14 = t2("dlp.server.portPlaceholder");
    $[32] = t2;
    $[33] = t14;
  } else {
    t14 = $[33];
  }
  let t15;
  if ($[34] !== form2) {
    t15 = form2.getInputProps("Port");
    $[34] = form2;
    $[35] = t15;
  } else {
    t15 = $[35];
  }
  let t16;
  if ($[36] !== t13 || $[37] !== t14 || $[38] !== t15) {
    t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { label: t13, placeholder: t14, type: "number", ...t15 });
    $[36] = t13;
    $[37] = t14;
    $[38] = t15;
    $[39] = t16;
  } else {
    t16 = $[39];
  }
  let t17;
  if ($[40] !== t2) {
    t17 = t2("dlp.server.respmodService");
    $[40] = t2;
    $[41] = t17;
  } else {
    t17 = $[41];
  }
  let t18;
  if ($[42] !== t2) {
    t18 = t2("dlp.server.respmodPlaceholder");
    $[42] = t2;
    $[43] = t18;
  } else {
    t18 = $[43];
  }
  let t19;
  if ($[44] !== form2) {
    t19 = form2.getInputProps("RespmodService");
    $[44] = form2;
    $[45] = t19;
  } else {
    t19 = $[45];
  }
  let t20;
  if ($[46] !== t17 || $[47] !== t18 || $[48] !== t19) {
    t20 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { label: t17, placeholder: t18, ...t19 });
    $[46] = t17;
    $[47] = t18;
    $[48] = t19;
    $[49] = t20;
  } else {
    t20 = $[49];
  }
  let t21;
  if ($[50] !== t2) {
    t21 = t2("dlp.server.reqmodService");
    $[50] = t2;
    $[51] = t21;
  } else {
    t21 = $[51];
  }
  let t222;
  if ($[52] !== t2) {
    t222 = t2("dlp.server.reqmodPlaceholder");
    $[52] = t2;
    $[53] = t222;
  } else {
    t222 = $[53];
  }
  let t23;
  if ($[54] !== form2) {
    t23 = form2.getInputProps("ReqmodService");
    $[54] = form2;
    $[55] = t23;
  } else {
    t23 = $[55];
  }
  let t24;
  if ($[56] !== t21 || $[57] !== t222 || $[58] !== t23) {
    t24 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { label: t21, placeholder: t222, ...t23 });
    $[56] = t21;
    $[57] = t222;
    $[58] = t23;
    $[59] = t24;
  } else {
    t24 = $[59];
  }
  let t25;
  if ($[60] !== t12 || $[61] !== t16 || $[62] !== t20 || $[63] !== t24) {
    t25 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$1.body, children: [
      t12,
      t16,
      t20,
      t24
    ] });
    $[60] = t12;
    $[61] = t16;
    $[62] = t20;
    $[63] = t24;
    $[64] = t25;
  } else {
    t25 = $[64];
  }
  let t26;
  if ($[65] !== form2.errors) {
    t26 = Object.keys(form2.errors);
    $[65] = form2.errors;
    $[66] = t26;
  } else {
    t26 = $[66];
  }
  const t27 = t26.length > 0;
  let t28;
  if ($[67] !== handleSubmit || $[68] !== submitLabel || $[69] !== t27) {
    t28 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, size: "sm", radius: 8, disabled: t27, onClick: handleSubmit, children: submitLabel });
    $[67] = handleSubmit;
    $[68] = submitLabel;
    $[69] = t27;
    $[70] = t28;
  } else {
    t28 = $[70];
  }
  let t29;
  if ($[71] !== t2) {
    t29 = t2("dlp.server.cancelButton");
    $[71] = t2;
    $[72] = t29;
  } else {
    t29 = $[72];
  }
  let t30;
  if ($[73] !== onClose || $[74] !== t29) {
    t30 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { fullWidth: true, size: "sm", color: "grey", radius: 8, variant: "light", onClick: onClose, children: t29 });
    $[73] = onClose;
    $[74] = t29;
    $[75] = t30;
  } else {
    t30 = $[75];
  }
  let t31;
  if ($[76] !== t28 || $[77] !== t30) {
    t31 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$1.footer, children: [
      t28,
      t30
    ] });
    $[76] = t28;
    $[77] = t30;
    $[78] = t31;
  } else {
    t31 = $[78];
  }
  let t32;
  if ($[79] !== t25 || $[80] !== t31 || $[81] !== t8) {
    t32 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$1.container, children: [
      t8,
      t25,
      t31
    ] });
    $[79] = t25;
    $[80] = t31;
    $[81] = t8;
    $[82] = t32;
  } else {
    t32 = $[82];
  }
  return t32;
};
const tableContainer = "_tableContainer_oral0_1";
const actions = "_actions_oral0_15";
const classes = {
  tableContainer,
  actions
};
const ServersTable = (t0) => {
  const $ = compilerRuntimeExports.c(39);
  const {
    servers,
    onEdit,
    onDelete
  } = t0;
  const {
    t: t2
  } = useTranslation();
  if (servers.length === 0) {
    return null;
  }
  let t1;
  if ($[0] !== t2) {
    t1 = t2("dlp.server.tableAddress");
    $[0] = t2;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  let t22;
  if ($[2] !== t1) {
    t22 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { children: t1 });
    $[2] = t1;
    $[3] = t22;
  } else {
    t22 = $[3];
  }
  let t3;
  if ($[4] !== t2) {
    t3 = t2("dlp.server.tablePort");
    $[4] = t2;
    $[5] = t3;
  } else {
    t3 = $[5];
  }
  let t4;
  if ($[6] !== t3) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { children: t3 });
    $[6] = t3;
    $[7] = t4;
  } else {
    t4 = $[7];
  }
  let t5;
  if ($[8] !== t2) {
    t5 = t2("dlp.server.tableReqmod");
    $[8] = t2;
    $[9] = t5;
  } else {
    t5 = $[9];
  }
  let t6;
  if ($[10] !== t5) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { children: t5 });
    $[10] = t5;
    $[11] = t6;
  } else {
    t6 = $[11];
  }
  let t7;
  if ($[12] !== t2) {
    t7 = t2("dlp.server.tableRespmod");
    $[12] = t2;
    $[13] = t7;
  } else {
    t7 = $[13];
  }
  let t8;
  if ($[14] !== t7) {
    t8 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { children: t7 });
    $[14] = t7;
    $[15] = t8;
  } else {
    t8 = $[15];
  }
  let t9;
  if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
    t9 = {
      width: "100px"
    };
    $[16] = t9;
  } else {
    t9 = $[16];
  }
  let t10;
  if ($[17] !== t2) {
    t10 = t2("dlp.server.tableActions");
    $[17] = t2;
    $[18] = t10;
  } else {
    t10 = $[18];
  }
  let t11;
  if ($[19] !== t10) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { style: t9, children: t10 });
    $[19] = t10;
    $[20] = t11;
  } else {
    t11 = $[20];
  }
  let t12;
  if ($[21] !== t11 || $[22] !== t22 || $[23] !== t4 || $[24] !== t6 || $[25] !== t8) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Thead, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Tr, { children: [
      t22,
      t4,
      t6,
      t8,
      t11
    ] }) });
    $[21] = t11;
    $[22] = t22;
    $[23] = t4;
    $[24] = t6;
    $[25] = t8;
    $[26] = t12;
  } else {
    t12 = $[26];
  }
  let t13;
  if ($[27] !== onDelete || $[28] !== onEdit || $[29] !== servers) {
    let t142;
    if ($[31] !== onDelete || $[32] !== onEdit) {
      t142 = (server, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Tr, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { children: server.Host }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { children: server.Port }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { children: server.ReqmodService }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { children: server.RespmodService }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Td, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes.actions, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { variant: "subtle", color: "gray", onClick: () => onEdit(server, index), children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconPencil, { size: 16 }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { variant: "subtle", color: "red", onClick: () => onDelete(index), children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconTrash, { size: 16 }) })
        ] }) })
      ] }, index);
      $[31] = onDelete;
      $[32] = onEdit;
      $[33] = t142;
    } else {
      t142 = $[33];
    }
    t13 = servers.map(t142);
    $[27] = onDelete;
    $[28] = onEdit;
    $[29] = servers;
    $[30] = t13;
  } else {
    t13 = $[30];
  }
  let t14;
  if ($[34] !== t13) {
    t14 = /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Tbody, { children: t13 });
    $[34] = t13;
    $[35] = t14;
  } else {
    t14 = $[35];
  }
  let t15;
  if ($[36] !== t12 || $[37] !== t14) {
    t15 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes.tableContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
      t12,
      t14
    ] }) });
    $[36] = t12;
    $[37] = t14;
    $[38] = t15;
  } else {
    t15 = $[38];
  }
  return t15;
};
const ServerSettingsPopUpTrigger = (props) => {
  const $ = compilerRuntimeExports.c(7);
  const {
    setIsOpen,
    t: t2
  } = props;
  let t0;
  if ($[0] !== setIsOpen) {
    t0 = () => setIsOpen(true);
    $[0] = setIsOpen;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const handleOpen = t0;
  let t1;
  if ($[2] !== t2) {
    t1 = t2("dlp.form.addServer");
    $[2] = t2;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  let t22;
  if ($[4] !== handleOpen || $[5] !== t1) {
    t22 = /* @__PURE__ */ jsxRuntimeExports.jsx(AddButton, { onClick: handleOpen, children: t1 });
    $[4] = handleOpen;
    $[5] = t1;
    $[6] = t22;
  } else {
    t22 = $[6];
  }
  return t22;
};
const DLPForm = (t0) => {
  const $ = compilerRuntimeExports.c(428);
  const {
    form: form2,
    handleSubmit,
    onCancel,
    servers,
    addServer,
    deleteServer,
    editServer,
    isEditMode: t1,
    hasServerChanges: t2
  } = t0;
  const isEditMode = t1 === void 0 ? false : t1;
  const hasServerChanges = t2 === void 0 ? false : t2;
  const {
    t: t3
  } = useTranslation();
  const [editingServer, setEditingServer] = reactExports.useState(null);
  const popupSetIsOpenRef = reactExports.useRef(null);
  let t32;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t32 = (server, index) => {
      setEditingServer({
        server,
        index
      });
      if (popupSetIsOpenRef.current) {
        popupSetIsOpenRef.current(true);
      }
    };
    $[0] = t32;
  } else {
    t32 = $[0];
  }
  const handleEditServer = t32;
  let t4;
  if ($[1] !== addServer || $[2] !== editServer || $[3] !== editingServer) {
    t4 = (server_0) => {
      if (editingServer !== null) {
        editServer(server_0, editingServer.index);
        setEditingServer(null);
      } else {
        addServer(server_0);
      }
    };
    $[1] = addServer;
    $[2] = editServer;
    $[3] = editingServer;
    $[4] = t4;
  } else {
    t4 = $[4];
  }
  const handleServerSuccess = t4;
  let t5;
  if ($[5] !== form2) {
    t5 = (field) => {
      const props = form2.getInputProps(field);
      return {
        ...props,
        value: props.value ?? ""
      };
    };
    $[5] = form2;
    $[6] = t5;
  } else {
    t5 = $[6];
  }
  const getNumberInputProps = t5;
  let t6;
  if ($[7] !== form2 || $[8] !== handleSubmit) {
    t6 = form2.onSubmit(handleSubmit);
    $[7] = form2;
    $[8] = handleSubmit;
    $[9] = t6;
  } else {
    t6 = $[9];
  }
  let t7;
  if ($[10] !== t3) {
    t7 = t3("dlp.form.title");
    $[10] = t3;
    $[11] = t7;
  } else {
    t7 = $[11];
  }
  let t8;
  if ($[12] !== t7) {
    t8 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t7 });
    $[12] = t7;
    $[13] = t8;
  } else {
    t8 = $[13];
  }
  let t9;
  if ($[14] !== t3) {
    t9 = t3("dlp.form.name");
    $[14] = t3;
    $[15] = t9;
  } else {
    t9 = $[15];
  }
  let t10;
  if ($[16] !== form2) {
    t10 = form2.getInputProps("name");
    $[16] = form2;
    $[17] = t10;
  } else {
    t10 = $[17];
  }
  let t11;
  if ($[18] !== t10 || $[19] !== t9) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.flexRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t9, ...t10 }) });
    $[18] = t10;
    $[19] = t9;
    $[20] = t11;
  } else {
    t11 = $[20];
  }
  let t12;
  if ($[21] !== t3) {
    t12 = t3("dlp.form.host");
    $[21] = t3;
    $[22] = t12;
  } else {
    t12 = $[22];
  }
  let t13;
  if ($[23] !== form2) {
    t13 = form2.getInputProps("host");
    $[23] = form2;
    $[24] = t13;
  } else {
    t13 = $[24];
  }
  let t14;
  if ($[25] !== t12 || $[26] !== t13) {
    t14 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t12, ...t13 });
    $[25] = t12;
    $[26] = t13;
    $[27] = t14;
  } else {
    t14 = $[27];
  }
  let t15;
  if ($[28] !== t3) {
    t15 = t3("dlp.form.port");
    $[28] = t3;
    $[29] = t15;
  } else {
    t15 = $[29];
  }
  let t16;
  if ($[30] !== form2) {
    t16 = form2.getInputProps("port");
    $[30] = form2;
    $[31] = t16;
  } else {
    t16 = $[31];
  }
  let t17;
  if ($[32] !== t15 || $[33] !== t16) {
    t17 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t15, type: "number", ...t16 });
    $[32] = t15;
    $[33] = t16;
    $[34] = t17;
  } else {
    t17 = $[34];
  }
  let t18;
  if ($[35] !== t14 || $[36] !== t17) {
    t18 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.flexRow, children: [
      t14,
      t17
    ] });
    $[35] = t14;
    $[36] = t17;
    $[37] = t18;
  } else {
    t18 = $[37];
  }
  let t19;
  if ($[38] !== t3) {
    t19 = t3("dlp.form.respmodService");
    $[38] = t3;
    $[39] = t19;
  } else {
    t19 = $[39];
  }
  let t20;
  if ($[40] !== form2) {
    t20 = form2.getInputProps("respmodService");
    $[40] = form2;
    $[41] = t20;
  } else {
    t20 = $[41];
  }
  let t21;
  if ($[42] !== t19 || $[43] !== t20) {
    t21 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t19, ...t20 });
    $[42] = t19;
    $[43] = t20;
    $[44] = t21;
  } else {
    t21 = $[44];
  }
  let t22;
  if ($[45] !== t3) {
    t22 = t3("dlp.form.reqmodService");
    $[45] = t3;
    $[46] = t22;
  } else {
    t22 = $[46];
  }
  let t23;
  if ($[47] !== form2) {
    t23 = form2.getInputProps("reqmodService");
    $[47] = form2;
    $[48] = t23;
  } else {
    t23 = $[48];
  }
  let t24;
  if ($[49] !== t22 || $[50] !== t23) {
    t24 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t22, ...t23 });
    $[49] = t22;
    $[50] = t23;
    $[51] = t24;
  } else {
    t24 = $[51];
  }
  let t25;
  if ($[52] !== t21 || $[53] !== t24) {
    t25 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.flexRow, children: [
      t21,
      t24
    ] });
    $[52] = t21;
    $[53] = t24;
    $[54] = t25;
  } else {
    t25 = $[54];
  }
  let t26;
  if ($[55] !== t11 || $[56] !== t18 || $[57] !== t25 || $[58] !== t8) {
    t26 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t8,
      t11,
      t18,
      t25
    ] });
    $[55] = t11;
    $[56] = t18;
    $[57] = t25;
    $[58] = t8;
    $[59] = t26;
  } else {
    t26 = $[59];
  }
  let t27;
  if ($[60] !== t3) {
    t27 = t3("dlp.form.additionalServers");
    $[60] = t3;
    $[61] = t27;
  } else {
    t27 = $[61];
  }
  let t28;
  if ($[62] !== t27) {
    t28 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t27 });
    $[62] = t27;
    $[63] = t28;
  } else {
    t28 = $[63];
  }
  let t29;
  if ($[64] !== t3) {
    t29 = (props_0) => /* @__PURE__ */ jsxRuntimeExports.jsx(ServerSettingsPopUpTrigger, { ...props_0, t: t3 });
    $[64] = t3;
    $[65] = t29;
  } else {
    t29 = $[65];
  }
  let t30;
  if ($[66] !== (editingServer == null ? void 0 : editingServer.server) || $[67] !== handleServerSuccess) {
    t30 = (t312) => {
      const {
        isOpen,
        setIsOpen
      } = t312;
      popupSetIsOpenRef.current = setIsOpen;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(ServerSettings, { isOpen, setIsOpen: (value) => {
        if (!value) {
          setEditingServer(null);
        }
        setIsOpen(value);
      }, server: editingServer == null ? void 0 : editingServer.server, onSuccess: handleServerSuccess });
    };
    $[66] = editingServer == null ? void 0 : editingServer.server;
    $[67] = handleServerSuccess;
    $[68] = t30;
  } else {
    t30 = $[68];
  }
  let t31;
  if ($[69] !== t29 || $[70] !== t30) {
    t31 = /* @__PURE__ */ jsxRuntimeExports.jsx(PopUpUI, { mobileSize: "100%", desktopPosition: "bottom-start", trigger: t29, children: t30 });
    $[69] = t29;
    $[70] = t30;
    $[71] = t31;
  } else {
    t31 = $[71];
  }
  let t322;
  if ($[72] !== deleteServer || $[73] !== servers) {
    t322 = /* @__PURE__ */ jsxRuntimeExports.jsx(ServersTable, { servers, onEdit: handleEditServer, onDelete: deleteServer });
    $[72] = deleteServer;
    $[73] = servers;
    $[74] = t322;
  } else {
    t322 = $[74];
  }
  let t33;
  if ($[75] !== t28 || $[76] !== t31 || $[77] !== t322) {
    t33 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t28,
      t31,
      t322
    ] });
    $[75] = t28;
    $[76] = t31;
    $[77] = t322;
    $[78] = t33;
  } else {
    t33 = $[78];
  }
  let t34;
  if ($[79] !== t3) {
    t34 = t3("dlp.form.timeoutsAndAttempts");
    $[79] = t3;
    $[80] = t34;
  } else {
    t34 = $[80];
  }
  let t35;
  if ($[81] !== t34) {
    t35 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t34 });
    $[81] = t34;
    $[82] = t35;
  } else {
    t35 = $[82];
  }
  let t36;
  if ($[83] !== t3) {
    t36 = t3("dlp.form.connectTimeout");
    $[83] = t3;
    $[84] = t36;
  } else {
    t36 = $[84];
  }
  let t37;
  if ($[85] !== form2) {
    t37 = form2.getInputProps("connectTimeoutMs");
    $[85] = form2;
    $[86] = t37;
  } else {
    t37 = $[86];
  }
  let t38;
  if ($[87] !== t36 || $[88] !== t37) {
    t38 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.timeoutItem, label: t36, type: "number", ...t37 });
    $[87] = t36;
    $[88] = t37;
    $[89] = t38;
  } else {
    t38 = $[89];
  }
  let t39;
  if ($[90] !== t3) {
    t39 = t3("dlp.form.writeTimeout");
    $[90] = t3;
    $[91] = t39;
  } else {
    t39 = $[91];
  }
  let t40;
  if ($[92] !== form2) {
    t40 = form2.getInputProps("writeTimeoutMs");
    $[92] = form2;
    $[93] = t40;
  } else {
    t40 = $[93];
  }
  let t41;
  if ($[94] !== t39 || $[95] !== t40) {
    t41 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.timeoutItem, label: t39, type: "number", ...t40 });
    $[94] = t39;
    $[95] = t40;
    $[96] = t41;
  } else {
    t41 = $[96];
  }
  let t42;
  if ($[97] !== t3) {
    t42 = t3("dlp.form.readTimeout");
    $[97] = t3;
    $[98] = t42;
  } else {
    t42 = $[98];
  }
  let t43;
  if ($[99] !== form2) {
    t43 = form2.getInputProps("readTimeoutMs");
    $[99] = form2;
    $[100] = t43;
  } else {
    t43 = $[100];
  }
  let t44;
  if ($[101] !== t42 || $[102] !== t43) {
    t44 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.timeoutItem, label: t42, type: "number", ...t43 });
    $[101] = t42;
    $[102] = t43;
    $[103] = t44;
  } else {
    t44 = $[103];
  }
  let t45;
  if ($[104] !== t3) {
    t45 = t3("dlp.form.resultTimeout");
    $[104] = t3;
    $[105] = t45;
  } else {
    t45 = $[105];
  }
  let t46;
  if ($[106] !== form2) {
    t46 = form2.getInputProps("resultTimeoutMs");
    $[106] = form2;
    $[107] = t46;
  } else {
    t46 = $[107];
  }
  let t47;
  if ($[108] !== t45 || $[109] !== t46) {
    t47 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.timeoutItem, label: t45, type: "number", ...t46 });
    $[108] = t45;
    $[109] = t46;
    $[110] = t47;
  } else {
    t47 = $[110];
  }
  let t48;
  if ($[111] !== t3) {
    t48 = t3("dlp.form.attempts");
    $[111] = t3;
    $[112] = t48;
  } else {
    t48 = $[112];
  }
  let t49;
  if ($[113] !== form2) {
    t49 = form2.getInputProps("attempts");
    $[113] = form2;
    $[114] = t49;
  } else {
    t49 = $[114];
  }
  let t50;
  if ($[115] !== t48 || $[116] !== t49) {
    t50 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.timeoutItem, label: t48, type: "number", ...t49 });
    $[115] = t48;
    $[116] = t49;
    $[117] = t50;
  } else {
    t50 = $[117];
  }
  let t51;
  if ($[118] !== t3) {
    t51 = t3("dlp.form.backoff");
    $[118] = t3;
    $[119] = t51;
  } else {
    t51 = $[119];
  }
  let t52;
  if ($[120] !== form2) {
    t52 = form2.getInputProps("backoffMs");
    $[120] = form2;
    $[121] = t52;
  } else {
    t52 = $[121];
  }
  let t53;
  if ($[122] !== t51 || $[123] !== t52) {
    t53 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.timeoutItem, label: t51, type: "number", ...t52 });
    $[122] = t51;
    $[123] = t52;
    $[124] = t53;
  } else {
    t53 = $[124];
  }
  let t54;
  if ($[125] !== t3) {
    t54 = t3("dlp.form.maxConnections");
    $[125] = t3;
    $[126] = t54;
  } else {
    t54 = $[126];
  }
  let t55;
  if ($[127] !== getNumberInputProps) {
    t55 = getNumberInputProps("maxConnections");
    $[127] = getNumberInputProps;
    $[128] = t55;
  } else {
    t55 = $[128];
  }
  let t56;
  if ($[129] !== t54 || $[130] !== t55) {
    t56 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: `${classes$2.timeoutItem} ${classes$2.timeoutItemWide}`, label: t54, type: "number", ...t55 });
    $[129] = t54;
    $[130] = t55;
    $[131] = t56;
  } else {
    t56 = $[131];
  }
  let t57;
  if ($[132] === Symbol.for("react.memo_cache_sentinel")) {
    t57 = /* @__PURE__ */ jsxRuntimeExports.jsx(IconChevronDown, { size: "1rem", color: "#98A2B3" });
    $[132] = t57;
  } else {
    t57 = $[132];
  }
  const t58 = String(DlpOnTimeout.Block);
  let t59;
  if ($[133] !== t3) {
    t59 = t3("dlp.form.onTimeoutBlock");
    $[133] = t3;
    $[134] = t59;
  } else {
    t59 = $[134];
  }
  let t60;
  if ($[135] !== t59) {
    t60 = {
      value: t58,
      label: t59
    };
    $[135] = t59;
    $[136] = t60;
  } else {
    t60 = $[136];
  }
  const t61 = String(DlpOnTimeout.Allow);
  let t62;
  if ($[137] !== t3) {
    t62 = t3("dlp.form.onTimeoutAllow");
    $[137] = t3;
    $[138] = t62;
  } else {
    t62 = $[138];
  }
  let t63;
  if ($[139] !== t62) {
    t63 = {
      value: t61,
      label: t62
    };
    $[139] = t62;
    $[140] = t63;
  } else {
    t63 = $[140];
  }
  const t64 = String(DlpOnTimeout.Quarantine);
  let t65;
  if ($[141] !== t3) {
    t65 = t3("dlp.form.onTimeoutQuarantine");
    $[141] = t3;
    $[142] = t65;
  } else {
    t65 = $[142];
  }
  let t66;
  if ($[143] !== t65) {
    t66 = {
      value: t64,
      label: t65
    };
    $[143] = t65;
    $[144] = t66;
  } else {
    t66 = $[144];
  }
  let t67;
  if ($[145] !== t60 || $[146] !== t63 || $[147] !== t66) {
    t67 = [t60, t63, t66];
    $[145] = t60;
    $[146] = t63;
    $[147] = t66;
    $[148] = t67;
  } else {
    t67 = $[148];
  }
  let t68;
  if ($[149] !== t3) {
    t68 = t3("dlp.form.onTimeout");
    $[149] = t3;
    $[150] = t68;
  } else {
    t68 = $[150];
  }
  let t69;
  if ($[151] === Symbol.for("react.memo_cache_sentinel")) {
    t69 = {
      zIndex: 1e4
    };
    $[151] = t69;
  } else {
    t69 = $[151];
  }
  const t70 = form2.values.onTimeout !== void 0 ? String(form2.values.onTimeout) : null;
  let t71;
  if ($[152] !== form2) {
    t71 = (value_0) => form2.setFieldValue("onTimeout", value_0 ? Number(value_0) : DlpOnTimeout.Block);
    $[152] = form2;
    $[153] = t71;
  } else {
    t71 = $[153];
  }
  let t72;
  if ($[154] !== form2.errors.onTimeout || $[155] !== t67 || $[156] !== t68 || $[157] !== t70 || $[158] !== t71) {
    t72 = /* @__PURE__ */ jsxRuntimeExports.jsx(Select, { className: `${classes$2.timeoutItem} ${classes$2.timeoutItemWide}`, rightSection: t57, data: t67, label: t68, comboboxProps: t69, value: t70, onChange: t71, error: form2.errors.onTimeout });
    $[154] = form2.errors.onTimeout;
    $[155] = t67;
    $[156] = t68;
    $[157] = t70;
    $[158] = t71;
    $[159] = t72;
  } else {
    t72 = $[159];
  }
  let t73;
  if ($[160] !== t38 || $[161] !== t41 || $[162] !== t44 || $[163] !== t47 || $[164] !== t50 || $[165] !== t53 || $[166] !== t56 || $[167] !== t72) {
    t73 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.timeoutContainer, children: [
      t38,
      t41,
      t44,
      t47,
      t50,
      t53,
      t56,
      t72
    ] });
    $[160] = t38;
    $[161] = t41;
    $[162] = t44;
    $[163] = t47;
    $[164] = t50;
    $[165] = t53;
    $[166] = t56;
    $[167] = t72;
    $[168] = t73;
  } else {
    t73 = $[168];
  }
  let t74;
  if ($[169] !== t35 || $[170] !== t73) {
    t74 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t35,
      t73
    ] });
    $[169] = t35;
    $[170] = t73;
    $[171] = t74;
  } else {
    t74 = $[171];
  }
  let t75;
  if ($[172] !== t3) {
    t75 = t3("dlp.form.scanConditions");
    $[172] = t3;
    $[173] = t75;
  } else {
    t75 = $[173];
  }
  let t76;
  if ($[174] !== t75) {
    t76 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t75 });
    $[174] = t75;
    $[175] = t76;
  } else {
    t76 = $[175];
  }
  let t77;
  if ($[176] !== t3) {
    t77 = t3("dlp.form.scanUpload");
    $[176] = t3;
    $[177] = t77;
  } else {
    t77 = $[177];
  }
  let t78;
  if ($[178] !== form2) {
    t78 = form2.getInputProps("scanUpload", {
      type: "checkbox"
    });
    $[178] = form2;
    $[179] = t78;
  } else {
    t78 = $[179];
  }
  let t79;
  if ($[180] !== t77 || $[181] !== t78) {
    t79 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { fz: "14px", mb: 12, label: t77, ...t78 });
    $[180] = t77;
    $[181] = t78;
    $[182] = t79;
  } else {
    t79 = $[182];
  }
  let t80;
  if ($[183] !== t3) {
    t80 = t3("dlp.form.scanDownload");
    $[183] = t3;
    $[184] = t80;
  } else {
    t80 = $[184];
  }
  let t81;
  if ($[185] !== form2) {
    t81 = form2.getInputProps("scanDownload", {
      type: "checkbox"
    });
    $[185] = form2;
    $[186] = t81;
  } else {
    t81 = $[186];
  }
  let t82;
  if ($[187] !== t80 || $[188] !== t81) {
    t82 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { fz: "14px", mb: 12, label: t80, ...t81 });
    $[187] = t80;
    $[188] = t81;
    $[189] = t82;
  } else {
    t82 = $[189];
  }
  let t83;
  if ($[190] !== t3) {
    t83 = t3("dlp.form.scanShareInternal");
    $[190] = t3;
    $[191] = t83;
  } else {
    t83 = $[191];
  }
  let t84;
  if ($[192] !== form2) {
    t84 = form2.getInputProps("scanShareInternal", {
      type: "checkbox"
    });
    $[192] = form2;
    $[193] = t84;
  } else {
    t84 = $[193];
  }
  let t85;
  if ($[194] !== t83 || $[195] !== t84) {
    t85 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { fz: "14px", mb: 12, label: t83, ...t84 });
    $[194] = t83;
    $[195] = t84;
    $[196] = t85;
  } else {
    t85 = $[196];
  }
  let t86;
  if ($[197] !== t3) {
    t86 = t3("dlp.form.scanExternalLink");
    $[197] = t3;
    $[198] = t86;
  } else {
    t86 = $[198];
  }
  let t87;
  if ($[199] !== form2) {
    t87 = form2.getInputProps("scanExternalLink", {
      type: "checkbox"
    });
    $[199] = form2;
    $[200] = t87;
  } else {
    t87 = $[200];
  }
  let t88;
  if ($[201] !== t86 || $[202] !== t87) {
    t88 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { fz: "14px", mb: 12, label: t86, ...t87 });
    $[201] = t86;
    $[202] = t87;
    $[203] = t88;
  } else {
    t88 = $[203];
  }
  let t89;
  if ($[204] !== t79 || $[205] !== t82 || $[206] !== t85 || $[207] !== t88) {
    t89 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      t79,
      t82,
      t85,
      t88
    ] });
    $[204] = t79;
    $[205] = t82;
    $[206] = t85;
    $[207] = t88;
    $[208] = t89;
  } else {
    t89 = $[208];
  }
  let t90;
  if ($[209] !== t76 || $[210] !== t89) {
    t90 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t76,
      t89
    ] });
    $[209] = t76;
    $[210] = t89;
    $[211] = t90;
  } else {
    t90 = $[211];
  }
  let t91;
  if ($[212] !== t3) {
    t91 = t3("dlp.form.fileTypeFiltering");
    $[212] = t3;
    $[213] = t91;
  } else {
    t91 = $[213];
  }
  let t92;
  if ($[214] !== t91) {
    t92 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t91 });
    $[214] = t91;
    $[215] = t92;
  } else {
    t92 = $[215];
  }
  let t93;
  if ($[216] === Symbol.for("react.memo_cache_sentinel")) {
    t93 = /* @__PURE__ */ jsxRuntimeExports.jsx(IconChevronDown, { size: "1rem", color: "#98A2B3" });
    $[216] = t93;
  } else {
    t93 = $[216];
  }
  const t94 = String(DlpFileTypesMode.Off);
  let t95;
  if ($[217] !== t3) {
    t95 = t3("dlp.form.fileTypeModeOff");
    $[217] = t3;
    $[218] = t95;
  } else {
    t95 = $[218];
  }
  let t96;
  if ($[219] !== t95) {
    t96 = {
      value: t94,
      label: t95
    };
    $[219] = t95;
    $[220] = t96;
  } else {
    t96 = $[220];
  }
  const t97 = String(DlpFileTypesMode.AllowList);
  let t98;
  if ($[221] !== t3) {
    t98 = t3("dlp.form.fileTypeModeAllowList");
    $[221] = t3;
    $[222] = t98;
  } else {
    t98 = $[222];
  }
  let t99;
  if ($[223] !== t98) {
    t99 = {
      value: t97,
      label: t98
    };
    $[223] = t98;
    $[224] = t99;
  } else {
    t99 = $[224];
  }
  const t100 = String(DlpFileTypesMode.DenyList);
  let t101;
  if ($[225] !== t3) {
    t101 = t3("dlp.form.fileTypeModeDenyList");
    $[225] = t3;
    $[226] = t101;
  } else {
    t101 = $[226];
  }
  let t102;
  if ($[227] !== t101) {
    t102 = {
      value: t100,
      label: t101
    };
    $[227] = t101;
    $[228] = t102;
  } else {
    t102 = $[228];
  }
  let t103;
  if ($[229] !== t102 || $[230] !== t96 || $[231] !== t99) {
    t103 = [t96, t99, t102];
    $[229] = t102;
    $[230] = t96;
    $[231] = t99;
    $[232] = t103;
  } else {
    t103 = $[232];
  }
  let t104;
  if ($[233] !== t3) {
    t104 = t3("dlp.form.fileTypesMode");
    $[233] = t3;
    $[234] = t104;
  } else {
    t104 = $[234];
  }
  let t105;
  if ($[235] === Symbol.for("react.memo_cache_sentinel")) {
    t105 = {
      zIndex: 1e4
    };
    $[235] = t105;
  } else {
    t105 = $[235];
  }
  const t106 = form2.values.fileTypesMode !== void 0 ? String(form2.values.fileTypesMode) : null;
  let t107;
  if ($[236] !== form2) {
    t107 = (value_1) => form2.setFieldValue("fileTypesMode", value_1 ? Number(value_1) : DlpFileTypesMode.Off);
    $[236] = form2;
    $[237] = t107;
  } else {
    t107 = $[237];
  }
  let t108;
  if ($[238] !== form2.errors.fileTypesMode || $[239] !== t103 || $[240] !== t104 || $[241] !== t106 || $[242] !== t107) {
    t108 = /* @__PURE__ */ jsxRuntimeExports.jsx(Select, { className: `${classes$2.timeoutItem} ${classes$2.filterItemWide}`, rightSection: t93, data: t103, label: t104, comboboxProps: t105, value: t106, onChange: t107, error: form2.errors.fileTypesMode });
    $[238] = form2.errors.fileTypesMode;
    $[239] = t103;
    $[240] = t104;
    $[241] = t106;
    $[242] = t107;
    $[243] = t108;
  } else {
    t108 = $[243];
  }
  let t109;
  if ($[244] !== form2 || $[245] !== t3) {
    t109 = form2.values.fileTypesMode === DlpFileTypesMode.AllowList && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.filterItem, label: t3("dlp.form.allowedExt"), ...form2.getInputProps("allowedExt") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.filterItem, label: t3("dlp.form.allowedMime"), ...form2.getInputProps("allowedMime") })
    ] });
    $[244] = form2;
    $[245] = t3;
    $[246] = t109;
  } else {
    t109 = $[246];
  }
  let t110;
  if ($[247] !== form2 || $[248] !== t3) {
    t110 = form2.values.fileTypesMode === DlpFileTypesMode.DenyList && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.filterItem, label: t3("dlp.form.blockedExt"), ...form2.getInputProps("blockedExt") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.filterItem, label: t3("dlp.form.blockedMime"), ...form2.getInputProps("blockedMime") })
    ] });
    $[247] = form2;
    $[248] = t3;
    $[249] = t110;
  } else {
    t110 = $[249];
  }
  let t111;
  if ($[250] !== t108 || $[251] !== t109 || $[252] !== t110) {
    t111 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.filterContainer, children: [
      t108,
      t109,
      t110
    ] });
    $[250] = t108;
    $[251] = t109;
    $[252] = t110;
    $[253] = t111;
  } else {
    t111 = $[253];
  }
  let t112;
  if ($[254] !== t111 || $[255] !== t92) {
    t112 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t92,
      t111
    ] });
    $[254] = t111;
    $[255] = t92;
    $[256] = t112;
  } else {
    t112 = $[256];
  }
  let t113;
  if ($[257] !== t3) {
    t113 = t3("dlp.form.restrictionsAndSettings");
    $[257] = t3;
    $[258] = t113;
  } else {
    t113 = $[258];
  }
  let t114;
  if ($[259] !== t113) {
    t114 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t113 });
    $[259] = t113;
    $[260] = t114;
  } else {
    t114 = $[260];
  }
  let t115;
  if ($[261] !== t3) {
    t115 = t3("dlp.form.maxFileSizeMb");
    $[261] = t3;
    $[262] = t115;
  } else {
    t115 = $[262];
  }
  let t116;
  if ($[263] !== getNumberInputProps) {
    t116 = getNumberInputProps("maxFileSizeMb");
    $[263] = getNumberInputProps;
    $[264] = t116;
  } else {
    t116 = $[264];
  }
  let t117;
  if ($[265] !== t115 || $[266] !== t116) {
    t117 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.restrictionsItem, label: t115, type: "number", ...t116 });
    $[265] = t115;
    $[266] = t116;
    $[267] = t117;
  } else {
    t117 = $[267];
  }
  let t118;
  if ($[268] !== t3) {
    t118 = t3("dlp.form.whenDownWaitMs");
    $[268] = t3;
    $[269] = t118;
  } else {
    t118 = $[269];
  }
  let t119;
  if ($[270] !== form2) {
    t119 = form2.getInputProps("whenDownWaitMs");
    $[270] = form2;
    $[271] = t119;
  } else {
    t119 = $[271];
  }
  let t120;
  if ($[272] !== t118 || $[273] !== t119) {
    t120 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.restrictionsItem, label: t118, type: "number", ...t119 });
    $[272] = t118;
    $[273] = t119;
    $[274] = t120;
  } else {
    t120 = $[274];
  }
  let t121;
  if ($[275] !== t3) {
    t121 = t3("dlp.form.maxMessageSizeKb");
    $[275] = t3;
    $[276] = t121;
  } else {
    t121 = $[276];
  }
  let t122;
  if ($[277] !== getNumberInputProps) {
    t122 = getNumberInputProps("maxMessageSizeKb");
    $[277] = getNumberInputProps;
    $[278] = t122;
  } else {
    t122 = $[278];
  }
  let t123;
  if ($[279] !== t121 || $[280] !== t122) {
    t123 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: `${classes$2.restrictionsItem} ${classes$2.restrictionsItemWide}`, label: t121, type: "number", ...t122 });
    $[279] = t121;
    $[280] = t122;
    $[281] = t123;
  } else {
    t123 = $[281];
  }
  let t124;
  if ($[282] !== t117 || $[283] !== t120 || $[284] !== t123) {
    t124 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.restrictions, children: [
      t117,
      t120,
      t123
    ] });
    $[282] = t117;
    $[283] = t120;
    $[284] = t123;
    $[285] = t124;
  } else {
    t124 = $[285];
  }
  let t125;
  if ($[286] !== t3) {
    t125 = t3("dlp.form.skipOnIcapErrors");
    $[286] = t3;
    $[287] = t125;
  } else {
    t125 = $[287];
  }
  let t126;
  if ($[288] !== form2) {
    t126 = form2.getInputProps("skipOnIcapErrors", {
      type: "checkbox"
    });
    $[288] = form2;
    $[289] = t126;
  } else {
    t126 = $[289];
  }
  let t127;
  if ($[290] !== t125 || $[291] !== t126) {
    t127 = /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { size: "xs", fz: "14px", mb: 12, label: t125, ...t126 });
    $[290] = t125;
    $[291] = t126;
    $[292] = t127;
  } else {
    t127 = $[292];
  }
  let t128;
  if ($[293] !== t114 || $[294] !== t124 || $[295] !== t127) {
    t128 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t114,
      t124,
      t127
    ] });
    $[293] = t114;
    $[294] = t124;
    $[295] = t127;
    $[296] = t128;
  } else {
    t128 = $[296];
  }
  let t129;
  if ($[297] !== t3) {
    t129 = t3("dlp.form.cachingAndHashing");
    $[297] = t3;
    $[298] = t129;
  } else {
    t129 = $[298];
  }
  let t130;
  if ($[299] !== t129) {
    t130 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t129 });
    $[299] = t129;
    $[300] = t130;
  } else {
    t130 = $[300];
  }
  let t131;
  if ($[301] !== t3) {
    t131 = t3("dlp.form.hashTtlMinutes");
    $[301] = t3;
    $[302] = t131;
  } else {
    t131 = $[302];
  }
  let t132;
  if ($[303] !== getNumberInputProps) {
    t132 = getNumberInputProps("hashTtlMinutes");
    $[303] = getNumberInputProps;
    $[304] = t132;
  } else {
    t132 = $[304];
  }
  let t133;
  if ($[305] !== t131 || $[306] !== t132) {
    t133 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { label: t131, type: "number", ...t132 }) });
    $[305] = t131;
    $[306] = t132;
    $[307] = t133;
  } else {
    t133 = $[307];
  }
  let t134;
  if ($[308] !== t130 || $[309] !== t133) {
    t134 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t130,
      t133
    ] });
    $[308] = t130;
    $[309] = t133;
    $[310] = t134;
  } else {
    t134 = $[310];
  }
  let t135;
  if ($[311] !== t3) {
    t135 = t3("dlp.form.headersAndMetadata");
    $[311] = t3;
    $[312] = t135;
  } else {
    t135 = $[312];
  }
  let t136;
  if ($[313] !== t135) {
    t136 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.title, children: t135 });
    $[313] = t135;
    $[314] = t136;
  } else {
    t136 = $[314];
  }
  let t137;
  if ($[315] !== t3) {
    t137 = t3("dlp.form.headerFileName");
    $[315] = t3;
    $[316] = t137;
  } else {
    t137 = $[316];
  }
  let t138;
  if ($[317] !== form2) {
    t138 = form2.getInputProps("headerFileName");
    $[317] = form2;
    $[318] = t138;
  } else {
    t138 = $[318];
  }
  let t139;
  if ($[319] !== t137 || $[320] !== t138) {
    t139 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t137, ...t138 });
    $[319] = t137;
    $[320] = t138;
    $[321] = t139;
  } else {
    t139 = $[321];
  }
  let t140;
  if ($[322] !== t3) {
    t140 = t3("dlp.form.headerFileSize");
    $[322] = t3;
    $[323] = t140;
  } else {
    t140 = $[323];
  }
  let t141;
  if ($[324] !== form2) {
    t141 = form2.getInputProps("headerFileSize");
    $[324] = form2;
    $[325] = t141;
  } else {
    t141 = $[325];
  }
  let t142;
  if ($[326] !== t140 || $[327] !== t141) {
    t142 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t140, ...t141 });
    $[326] = t140;
    $[327] = t141;
    $[328] = t142;
  } else {
    t142 = $[328];
  }
  let t143;
  if ($[329] !== t139 || $[330] !== t142) {
    t143 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.flexRow, children: [
      t139,
      t142
    ] });
    $[329] = t139;
    $[330] = t142;
    $[331] = t143;
  } else {
    t143 = $[331];
  }
  let t144;
  if ($[332] !== t3) {
    t144 = t3("dlp.form.headerFileId");
    $[332] = t3;
    $[333] = t144;
  } else {
    t144 = $[333];
  }
  let t145;
  if ($[334] !== form2) {
    t145 = form2.getInputProps("headerFileId");
    $[334] = form2;
    $[335] = t145;
  } else {
    t145 = $[335];
  }
  let t146;
  if ($[336] !== t144 || $[337] !== t145) {
    t146 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t144, ...t145 });
    $[336] = t144;
    $[337] = t145;
    $[338] = t146;
  } else {
    t146 = $[338];
  }
  let t147;
  if ($[339] !== t3) {
    t147 = t3("dlp.form.headerFileHash");
    $[339] = t3;
    $[340] = t147;
  } else {
    t147 = $[340];
  }
  let t148;
  if ($[341] !== form2) {
    t148 = form2.getInputProps("headerFileHash");
    $[341] = form2;
    $[342] = t148;
  } else {
    t148 = $[342];
  }
  let t149;
  if ($[343] !== t147 || $[344] !== t148) {
    t149 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t147, ...t148 });
    $[343] = t147;
    $[344] = t148;
    $[345] = t149;
  } else {
    t149 = $[345];
  }
  let t150;
  if ($[346] !== t146 || $[347] !== t149) {
    t150 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.flexRow, children: [
      t146,
      t149
    ] });
    $[346] = t146;
    $[347] = t149;
    $[348] = t150;
  } else {
    t150 = $[348];
  }
  let t151;
  if ($[349] !== t3) {
    t151 = t3("dlp.form.headerRecipientEmail");
    $[349] = t3;
    $[350] = t151;
  } else {
    t151 = $[350];
  }
  let t152;
  if ($[351] !== form2) {
    t152 = form2.getInputProps("headerRecipientEmail");
    $[351] = form2;
    $[352] = t152;
  } else {
    t152 = $[352];
  }
  let t153;
  if ($[353] !== t151 || $[354] !== t152) {
    t153 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t151, ...t152 });
    $[353] = t151;
    $[354] = t152;
    $[355] = t153;
  } else {
    t153 = $[355];
  }
  let t154;
  if ($[356] !== t3) {
    t154 = t3("dlp.form.headerUserEmail");
    $[356] = t3;
    $[357] = t154;
  } else {
    t154 = $[357];
  }
  let t155;
  if ($[358] !== form2) {
    t155 = form2.getInputProps("headerUserEmail");
    $[358] = form2;
    $[359] = t155;
  } else {
    t155 = $[359];
  }
  let t156;
  if ($[360] !== t154 || $[361] !== t155) {
    t156 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t154, ...t155 });
    $[360] = t154;
    $[361] = t155;
    $[362] = t156;
  } else {
    t156 = $[362];
  }
  let t157;
  if ($[363] !== t153 || $[364] !== t156) {
    t157 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.flexRow, children: [
      t153,
      t156
    ] });
    $[363] = t153;
    $[364] = t156;
    $[365] = t157;
  } else {
    t157 = $[365];
  }
  let t158;
  if ($[366] !== t3) {
    t158 = t3("dlp.form.headerRoleId");
    $[366] = t3;
    $[367] = t158;
  } else {
    t158 = $[367];
  }
  let t159;
  if ($[368] !== form2) {
    t159 = form2.getInputProps("headerRoleId");
    $[368] = form2;
    $[369] = t159;
  } else {
    t159 = $[369];
  }
  let t160;
  if ($[370] !== t158 || $[371] !== t159) {
    t160 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t158, ...t159 });
    $[370] = t158;
    $[371] = t159;
    $[372] = t160;
  } else {
    t160 = $[372];
  }
  let t161;
  if ($[373] !== t3) {
    t161 = t3("dlp.form.headerRoleName");
    $[373] = t3;
    $[374] = t161;
  } else {
    t161 = $[374];
  }
  let t162;
  if ($[375] !== form2) {
    t162 = form2.getInputProps("headerRoleName");
    $[375] = form2;
    $[376] = t162;
  } else {
    t162 = $[376];
  }
  let t163;
  if ($[377] !== t161 || $[378] !== t162) {
    t163 = /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t161, ...t162 });
    $[377] = t161;
    $[378] = t162;
    $[379] = t163;
  } else {
    t163 = $[379];
  }
  let t164;
  if ($[380] !== t160 || $[381] !== t163) {
    t164 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.flexRow, children: [
      t160,
      t163
    ] });
    $[380] = t160;
    $[381] = t163;
    $[382] = t164;
  } else {
    t164 = $[382];
  }
  let t165;
  if ($[383] !== t3) {
    t165 = t3("dlp.form.headerRoleType");
    $[383] = t3;
    $[384] = t165;
  } else {
    t165 = $[384];
  }
  let t166;
  if ($[385] !== form2) {
    t166 = form2.getInputProps("headerRoleType");
    $[385] = form2;
    $[386] = t166;
  } else {
    t166 = $[386];
  }
  let t167;
  if ($[387] !== t165 || $[388] !== t166) {
    t167 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes$2.flexRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextInput, { className: classes$2.fullWidth, label: t165, ...t166 }) });
    $[387] = t165;
    $[388] = t166;
    $[389] = t167;
  } else {
    t167 = $[389];
  }
  let t168;
  if ($[390] !== t136 || $[391] !== t143 || $[392] !== t150 || $[393] !== t157 || $[394] !== t164 || $[395] !== t167) {
    t168 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: 24, children: [
      t136,
      t143,
      t150,
      t157,
      t164,
      t167
    ] });
    $[390] = t136;
    $[391] = t143;
    $[392] = t150;
    $[393] = t157;
    $[394] = t164;
    $[395] = t167;
    $[396] = t168;
  } else {
    t168 = $[396];
  }
  let t169;
  if ($[397] !== t112 || $[398] !== t128 || $[399] !== t134 || $[400] !== t168 || $[401] !== t26 || $[402] !== t33 || $[403] !== t74 || $[404] !== t90) {
    t169 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.formContent, children: [
      t26,
      t33,
      t74,
      t90,
      t112,
      t128,
      t134,
      t168
    ] });
    $[397] = t112;
    $[398] = t128;
    $[399] = t134;
    $[400] = t168;
    $[401] = t26;
    $[402] = t33;
    $[403] = t74;
    $[404] = t90;
    $[405] = t169;
  } else {
    t169 = $[405];
  }
  let t170;
  if ($[406] !== form2 || $[407] !== hasServerChanges || $[408] !== isEditMode) {
    t170 = !form2.isValid() || isEditMode && !form2.isDirty() && !hasServerChanges;
    $[406] = form2;
    $[407] = hasServerChanges;
    $[408] = isEditMode;
    $[409] = t170;
  } else {
    t170 = $[409];
  }
  let t171;
  if ($[410] !== isEditMode || $[411] !== t3) {
    t171 = isEditMode ? t3("dlp.form.saveButton") : t3("dlp.form.createButton");
    $[410] = isEditMode;
    $[411] = t3;
    $[412] = t171;
  } else {
    t171 = $[412];
  }
  let t172;
  if ($[413] !== t170 || $[414] !== t171) {
    t172 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "submit", fullWidth: true, disabled: t170, children: t171 });
    $[413] = t170;
    $[414] = t171;
    $[415] = t172;
  } else {
    t172 = $[415];
  }
  let t173;
  if ($[416] !== t3) {
    t173 = t3("dlp.form.cancelButton");
    $[416] = t3;
    $[417] = t173;
  } else {
    t173 = $[417];
  }
  let t174;
  if ($[418] !== onCancel || $[419] !== t173) {
    t174 = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "light", color: "gray", fullWidth: true, onClick: onCancel, children: t173 });
    $[418] = onCancel;
    $[419] = t173;
    $[420] = t174;
  } else {
    t174 = $[420];
  }
  let t175;
  if ($[421] !== t172 || $[422] !== t174) {
    t175 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes$2.buttonGroup, children: [
      t172,
      t174
    ] });
    $[421] = t172;
    $[422] = t174;
    $[423] = t175;
  } else {
    t175 = $[423];
  }
  let t176;
  if ($[424] !== t169 || $[425] !== t175 || $[426] !== t6) {
    t176 = /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: t6, className: classes$2.container, children: [
      t169,
      t175
    ] });
    $[424] = t169;
    $[425] = t175;
    $[426] = t6;
    $[427] = t176;
  } else {
    t176 = $[427];
  }
  return t176;
};
const createSchema = (t2) => objectType({
  name: stringType().min(1, t2("dlp.validation.nameRequired")),
  type: stringType().default(""),
  host: stringType().min(1, t2("dlp.validation.hostRequired")).refine((val) => {
    const ipv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
    const domainRegex = /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;
    if (val === "localhost") return true;
    if (ipv4Regex.test(val)) {
      const parts = val.split(".");
      return parts.every((part2) => parseInt(part2) >= 0 && parseInt(part2) <= 255);
    }
    return domainRegex.test(val);
  }, {
    message: t2("dlp.validation.hostInvalid")
  }),
  port: coerce.number().min(1, t2("dlp.validation.portRequired")).max(65535, t2("dlp.validation.portInvalid")),
  reqmodService: stringType().refine((val) => val === "" || val.startsWith("/"), {
    message: t2("dlp.validation.pathMustStartWithSlash")
  }),
  respmodService: stringType().refine((val) => val === "" || val.startsWith("/"), {
    message: t2("dlp.validation.pathMustStartWithSlash")
  }),
  connectTimeoutMs: coerce.number().min(0).max(3e5, t2("dlp.validation.max5Minutes")),
  writeTimeoutMs: coerce.number().min(0).max(3e5, t2("dlp.validation.max5Minutes")),
  readTimeoutMs: coerce.number().min(0).max(3e5, t2("dlp.validation.max5Minutes")),
  resultTimeoutMs: coerce.number().min(0).max(6e5, t2("dlp.validation.max10Minutes")),
  attempts: coerce.number().min(0).max(100, t2("dlp.validation.max100Attempts")),
  backoffMs: coerce.number().min(0).max(6e4, t2("dlp.validation.max1Minute")),
  maxConnections: coerce.number().nullable().refine((val) => val === null || val > 0 && val <= 1e4, {
    message: t2("dlp.validation.range1To10000")
  }),
  onTimeout: nativeEnumType(DlpOnTimeout),
  scanUpload: booleanType(),
  scanDownload: booleanType(),
  scanShareInternal: booleanType(),
  scanShareGuest: booleanType(),
  scanExternalLink: booleanType(),
  fileTypesMode: nativeEnumType(DlpFileTypesMode),
  allowedExt: stringType(),
  blockedExt: stringType(),
  allowedMime: stringType(),
  blockedMime: stringType(),
  maxFileSizeMb: coerce.number().nullable().refine((val) => val === null || val >= 0 && val <= 10240, {
    message: t2("dlp.validation.maxFileSizeRange")
  }),
  whenDownWaitMs: coerce.number().min(0).max(36e5, t2("dlp.validation.max1Hour")),
  maxMessageSizeKb: coerce.number().nullable().refine((val) => val === null || val >= 0, {
    message: t2("dlp.validation.messageSizeNonNegative")
  }),
  skipOnIcapErrors: booleanType(),
  hashTtlMinutes: coerce.number().nullable(),
  useHashCache: booleanType(),
  headerXScanOp: stringType().default(""),
  headerFileName: stringType().default(""),
  headerFileSize: stringType().default(""),
  headerFileId: stringType().default(""),
  headerFileHash: stringType().default(""),
  headerRecipientEmail: stringType().default(""),
  headerUserEmail: stringType().default(""),
  headerCustomerId: stringType().default(""),
  headerRoleId: stringType().default(""),
  headerRoleName: stringType().default(""),
  headerRoleType: stringType().default("")
}).refine((data) => {
  return data.scanUpload || data.scanDownload || data.scanShareInternal || data.scanShareGuest || data.scanExternalLink;
}, {
  message: t2("dlp.validation.selectAtLeastOneScanCondition"),
  path: ["scanUpload"]
}).refine((data) => {
  if (data.fileTypesMode === DlpFileTypesMode.AllowList) {
    const hasAllowedExt = data.allowedExt.trim().length > 0;
    const hasAllowedMime = data.allowedMime.trim().length > 0;
    return hasAllowedExt || hasAllowedMime;
  }
  return true;
}, {
  message: t2("dlp.validation.allowListRequiresExtOrMime"),
  path: ["allowedExt"]
}).refine((data) => {
  if (data.fileTypesMode === DlpFileTypesMode.DenyList) {
    const hasBlockedExt = data.blockedExt.trim().length > 0;
    const hasBlockedMime = data.blockedMime.trim().length > 0;
    return hasBlockedExt || hasBlockedMime;
  }
  return true;
}, {
  message: t2("dlp.validation.denyListRequiresExtOrMime"),
  path: ["blockedExt"]
}).refine((data) => {
  if (data.useHashCache) {
    return data.hashTtlMinutes !== null && data.hashTtlMinutes > 0;
  }
  return true;
}, {
  message: t2("dlp.validation.hashCacheRequiresTtl"),
  path: ["hashTtlMinutes"]
}).refine((data) => {
  if (data.scanUpload) {
    return data.reqmodService.trim().length > 0;
  }
  return true;
}, {
  message: t2("dlp.validation.uploadScanRequiresReqmod"),
  path: ["reqmodService"]
}).refine((data) => {
  const needRespmod = data.scanDownload || data.scanShareInternal || data.scanShareGuest || data.scanExternalLink;
  if (needRespmod) {
    return data.respmodService.trim().length > 0;
  }
  return true;
}, {
  message: t2("dlp.validation.downloadScanRequiresRespmod"),
  path: ["respmodService"]
});
const getInitialValues = (profile) => {
  if (!profile) {
    return {
      name: "",
      type: "",
      host: "",
      port: 1344,
      reqmodService: "/",
      respmodService: "/",
      connectTimeoutMs: 5e3,
      writeTimeoutMs: 15e3,
      readTimeoutMs: 15e3,
      resultTimeoutMs: 6e4,
      attempts: 3,
      backoffMs: 500,
      maxConnections: null,
      onTimeout: DlpOnTimeout.Block,
      scanUpload: true,
      scanDownload: false,
      scanShareInternal: false,
      scanShareGuest: false,
      scanExternalLink: false,
      fileTypesMode: DlpFileTypesMode.Off,
      allowedExt: "",
      blockedExt: "",
      allowedMime: "",
      blockedMime: "",
      maxFileSizeMb: null,
      whenDownWaitMs: 3e4,
      maxMessageSizeKb: null,
      skipOnIcapErrors: false,
      hashTtlMinutes: null,
      useHashCache: false,
      headerXScanOp: "X-Scan-Op",
      headerUserEmail: "X-User-Email",
      headerRecipientEmail: "X-Recipient-Email",
      headerFileId: "X-File-Id",
      headerFileName: "X-File-Name",
      headerFileSize: "X-File-Size",
      headerFileHash: "X-File-Hash",
      headerCustomerId: "X-Customer-Id",
      headerRoleId: "X-Role-Id",
      headerRoleName: "X-Role-Name",
      headerRoleType: "X-Role-Type"
    };
  }
  return {
    name: profile.Server.Name,
    type: "",
    host: profile.Server.Host,
    port: profile.Server.Port,
    reqmodService: profile.Server.ReqmodService,
    respmodService: profile.Server.RespmodService,
    connectTimeoutMs: profile.ConnectTimeoutMs,
    writeTimeoutMs: profile.WriteTimeoutMs,
    readTimeoutMs: profile.ReadTimeoutMs,
    resultTimeoutMs: profile.ResultTimeoutMs,
    attempts: profile.Attempts,
    backoffMs: profile.BackoffMs,
    maxConnections: profile.MaxConnections,
    onTimeout: profile.OnTimeout,
    scanUpload: (profile.ScanActions & 1) === 1,
    scanDownload: (profile.ScanActions & 2) === 2,
    scanShareInternal: (profile.ScanActions & 4) === 4,
    scanShareGuest: (profile.ScanActions & 8) === 8,
    scanExternalLink: (profile.ScanActions & 16) === 16,
    fileTypesMode: profile.FileTypesMode,
    allowedExt: profile.AllowedExt.join(", "),
    blockedExt: profile.BlockedExt.join(", "),
    allowedMime: profile.AllowedMime.join(", "),
    blockedMime: profile.BlockedMime.join(", "),
    maxFileSizeMb: profile.MaxFileSizeMb,
    whenDownWaitMs: profile.WhenDownWaitMs,
    maxMessageSizeKb: profile.MaxMessageSizeKb,
    skipOnIcapErrors: profile.SkipOnIcapErrors,
    hashTtlMinutes: profile.HashTtlMinutes,
    useHashCache: profile.UseHashCache,
    headerXScanOp: profile.IcapHeaders["Action"] || "X-Scan-Op",
    headerUserEmail: profile.IcapHeaders["UserEmail"] || "X-User-Email",
    headerRecipientEmail: profile.IcapHeaders["RecipientEmail"] || "X-Recipient-Email",
    headerFileId: profile.IcapHeaders["FileId"] || "X-File-Id",
    headerFileName: profile.IcapHeaders["FileName"] || "X-File-Name",
    headerFileSize: profile.IcapHeaders["FileSize"] || "X-File-Size",
    headerFileHash: profile.IcapHeaders["FileHash"] || "X-File-Hash",
    headerCustomerId: profile.IcapHeaders["CustomerId"] || "X-Customer-Id",
    headerRoleId: profile.IcapHeaders["RoleId"] || "X-Role-Id",
    headerRoleName: profile.IcapHeaders["RoleName"] || "X-Role-Name",
    headerRoleType: profile.IcapHeaders["RoleType"] || "X-Role-Type"
  };
};
const useDlpForm = (profile) => {
  const {
    t: t2
  } = useTranslation();
  const schema2 = createSchema(t2);
  const form2 = useForm({
    validateInputOnChange: true,
    initialValues: getInitialValues(profile),
    validate: (values) => getValidateErrors(schema2, values)
  });
  const initialServers = (profile == null ? void 0 : profile.Servers) || [];
  const [servers, setServers] = reactExports.useState(initialServers);
  const hasServerChanges = JSON.stringify(servers) !== JSON.stringify(initialServers);
  const addServer = (server) => {
    setServers((prev) => [...prev, server]);
  };
  const deleteServer = (index) => {
    setServers((prev_0) => prev_0.filter((_, i) => i !== index));
  };
  const editServer = (server_0, index_0) => {
    setServers((prev_1) => prev_1.map((s, i_0) => i_0 === index_0 ? server_0 : s));
  };
  const handleSubmit = async () => {
    var _a, _b;
    const validation = form2.validate();
    if (validation.hasErrors) {
      notifications.show({
        title: t2("dlp.validationError"),
        message: t2("dlp.validationErrorMessage"),
        color: "red"
      });
      return null;
    }
    try {
      const values_0 = form2.values;
      if (servers.length > 0) {
        const needReqmod = values_0.scanUpload;
        const needRespmod = values_0.scanDownload || values_0.scanShareInternal || values_0.scanShareGuest || values_0.scanExternalLink;
        if (needReqmod || needRespmod) {
          for (const server_1 of servers) {
            const hasReqmod = ((_a = server_1.ReqmodService) == null ? void 0 : _a.trim().length) > 0;
            const hasRespmod = ((_b = server_1.RespmodService) == null ? void 0 : _b.trim().length) > 0;
            if (!hasReqmod && !hasRespmod) {
              notifications.show({
                title: t2("dlp.validationError"),
                message: t2("dlp.additionalServersRequireService"),
                color: "red"
              });
              return null;
            }
          }
        }
      }
      const ScanActions = (values_0.scanUpload ? 1 : 0) | (values_0.scanDownload ? 2 : 0) | (values_0.scanShareInternal ? 4 : 0) | (values_0.scanShareGuest ? 8 : 0) | (values_0.scanExternalLink ? 16 : 0);
      const IcapHeaders = {
        Action: values_0.headerXScanOp || "X-Scan-Op",
        UserEmail: values_0.headerUserEmail || "X-User-Email",
        RecipientEmail: values_0.headerRecipientEmail || "X-Recipient-Email",
        FileId: values_0.headerFileId || "X-File-Id",
        FileName: values_0.headerFileName || "X-File-Name",
        FileSize: values_0.headerFileSize || "X-File-Size",
        FileHash: values_0.headerFileHash || "X-File-Hash",
        CustomerId: values_0.headerCustomerId || "X-Customer-Id",
        RoleId: values_0.headerRoleId || "X-Role-Id",
        RoleName: values_0.headerRoleName || "X-Role-Name",
        RoleType: values_0.headerRoleType || "X-Role-Type"
      };
      const params = {
        Id: (profile == null ? void 0 : profile.Id) || 0,
        CustomerId: (profile == null ? void 0 : profile.CustomerId) || null,
        IsActive: true,
        Enabled: true,
        Server: {
          Name: values_0.name,
          Host: values_0.host,
          Port: values_0.port,
          ReqmodService: values_0.reqmodService,
          RespmodService: values_0.respmodService
        },
        MaxConnections: values_0.maxConnections,
        ConnectTimeoutMs: values_0.connectTimeoutMs,
        ReadTimeoutMs: values_0.readTimeoutMs,
        WriteTimeoutMs: values_0.writeTimeoutMs,
        Attempts: values_0.attempts,
        BackoffMs: values_0.backoffMs,
        ResultTimeoutMs: values_0.resultTimeoutMs,
        WhenDownWaitMs: values_0.whenDownWaitMs,
        OnTimeout: values_0.onTimeout,
        ScanActions,
        FileTypesMode: values_0.fileTypesMode,
        AllowedExt: values_0.allowedExt.split(",").map((s_0) => s_0.trim()).filter(Boolean),
        BlockedExt: values_0.blockedExt.split(",").map((s_1) => s_1.trim()).filter(Boolean),
        AllowedMime: values_0.allowedMime.split(",").map((s_2) => s_2.trim()).filter(Boolean),
        BlockedMime: values_0.blockedMime.split(",").map((s_3) => s_3.trim()).filter(Boolean),
        MaxFileSizeMb: values_0.maxFileSizeMb,
        UseHashCache: values_0.useHashCache,
        SkipOnIcapErrors: values_0.skipOnIcapErrors,
        MaxMessageSizeKb: values_0.maxMessageSizeKb,
        HashTtlMinutes: values_0.hashTtlMinutes,
        HashAlgo: "SHA256",
        IcapHeaders,
        Servers: servers
      };
      const savedProfile = await dlpSettingsApiArea().SaveDlpProfile(params);
      notifications.show({
        title: t2("dlp.success"),
        message: (profile == null ? void 0 : profile.Id) ? t2("dlp.updateSuccess") : t2("dlp.createSuccess"),
        color: "green"
      });
      return savedProfile;
    } catch (error) {
      notifications.show({
        title: t2("dlp.saveError"),
        message: error instanceof Error ? error.message : t2("dlp.saveErrorMessage"),
        color: "red"
      });
      return null;
    }
  };
  return [form2, handleSubmit, servers, addServer, deleteServer, editServer, hasServerChanges];
};
const EditDlpDialog = (t0) => {
  const $ = compilerRuntimeExports.c(21);
  const {
    isOpen,
    onClose,
    profile,
    onSuccess
  } = t0;
  const {
    t: t2
  } = useTranslation();
  const [form2, handleSubmit, servers, addServer, deleteServer, editServer, hasServerChanges] = useDlpForm(profile);
  let t1;
  if ($[0] !== handleSubmit || $[1] !== onClose || $[2] !== onSuccess) {
    t1 = async () => {
      const savedProfile = await handleSubmit();
      if (savedProfile) {
        await onSuccess(savedProfile);
        onClose();
      }
    };
    $[0] = handleSubmit;
    $[1] = onClose;
    $[2] = onSuccess;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  const onSubmit = t1;
  let t22;
  if ($[4] !== t2) {
    t22 = t2("dlp.editIntegration");
    $[4] = t2;
    $[5] = t22;
  } else {
    t22 = $[5];
  }
  let t3;
  if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
    t3 = {
      body: {
        padding: 0,
        overflow: "hidden",
        display: "flex",
        flexDirection: "column"
      }
    };
    $[6] = t3;
  } else {
    t3 = $[6];
  }
  let t4;
  if ($[7] !== addServer || $[8] !== deleteServer || $[9] !== editServer || $[10] !== form2 || $[11] !== hasServerChanges || $[12] !== onClose || $[13] !== onSubmit || $[14] !== servers) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx(DLPForm, { form: form2, handleSubmit: onSubmit, onCancel: onClose, servers, addServer, deleteServer, editServer, isEditMode: true, hasServerChanges });
    $[7] = addServer;
    $[8] = deleteServer;
    $[9] = editServer;
    $[10] = form2;
    $[11] = hasServerChanges;
    $[12] = onClose;
    $[13] = onSubmit;
    $[14] = servers;
    $[15] = t4;
  } else {
    t4 = $[15];
  }
  let t5;
  if ($[16] !== isOpen || $[17] !== onClose || $[18] !== t22 || $[19] !== t4) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { size: "1000px", opened: isOpen, title: t22, onClose, scrollAreaComponent: void 0, fullScreen: typeof window !== "undefined" && window.innerWidth < 768, styles: t3, children: t4 });
    $[16] = isOpen;
    $[17] = onClose;
    $[18] = t22;
    $[19] = t4;
    $[20] = t5;
  } else {
    t5 = $[20];
  }
  return t5;
};
const MakeDlpDialog = (t0) => {
  const $ = compilerRuntimeExports.c(20);
  const {
    isOpen,
    onClose,
    onSuccess
  } = t0;
  const {
    t: t2
  } = useTranslation();
  const [form2, handleSubmit, servers, addServer, deleteServer, editServer] = useDlpForm();
  let t1;
  if ($[0] !== handleSubmit || $[1] !== onClose || $[2] !== onSuccess) {
    t1 = async () => {
      const savedProfile = await handleSubmit();
      if (savedProfile) {
        await onSuccess(savedProfile);
        onClose();
      }
    };
    $[0] = handleSubmit;
    $[1] = onClose;
    $[2] = onSuccess;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  const onSubmit = t1;
  let t22;
  if ($[4] !== t2) {
    t22 = t2("dlp.createIntegration");
    $[4] = t2;
    $[5] = t22;
  } else {
    t22 = $[5];
  }
  let t3;
  if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
    t3 = {
      body: {
        padding: 0,
        overflow: "hidden",
        display: "flex",
        flexDirection: "column"
      }
    };
    $[6] = t3;
  } else {
    t3 = $[6];
  }
  let t4;
  if ($[7] !== addServer || $[8] !== deleteServer || $[9] !== editServer || $[10] !== form2 || $[11] !== onClose || $[12] !== onSubmit || $[13] !== servers) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx(DLPForm, { form: form2, handleSubmit: onSubmit, onCancel: onClose, servers, addServer, deleteServer, editServer });
    $[7] = addServer;
    $[8] = deleteServer;
    $[9] = editServer;
    $[10] = form2;
    $[11] = onClose;
    $[12] = onSubmit;
    $[13] = servers;
    $[14] = t4;
  } else {
    t4 = $[14];
  }
  let t5;
  if ($[15] !== isOpen || $[16] !== onClose || $[17] !== t22 || $[18] !== t4) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { size: "1000px", opened: isOpen, title: t22, onClose, scrollAreaComponent: void 0, fullScreen: typeof window !== "undefined" && window.innerWidth < 768, styles: t3, children: t4 });
    $[15] = isOpen;
    $[16] = onClose;
    $[17] = t22;
    $[18] = t4;
    $[19] = t5;
  } else {
    t5 = $[19];
  }
  return t5;
};
const DlpAntivirus = (t0) => {
  const $ = compilerRuntimeExports.c(37);
  let t1;
  if ($[0] !== t0) {
    t1 = t0 === void 0 ? {} : t0;
    $[0] = t0;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const {
    customerId
  } = t1;
  const {
    t: t2
  } = useTranslation();
  const context = useDlpPage(customerId);
  const {
    isLoading,
    itemToEditId,
    itemControl,
    setItemControl,
    setItemToEditId,
    dlps,
    loadProfiles,
    onProfileSaved,
    toggleEnabled,
    profileToEdit,
    accessDenied
  } = context;
  const isEditOpen = Boolean(itemControl === ItemDlpTypes.EDIT && itemToEditId);
  const isMakeOpen = Boolean(itemControl === ItemDlpTypes.CREATE);
  let t22;
  if ($[2] !== setItemControl) {
    t22 = () => setItemControl(ItemDlpTypes.CREATE);
    $[2] = setItemControl;
    $[3] = t22;
  } else {
    t22 = $[3];
  }
  const goToMakeDlp = t22;
  let t3;
  if ($[4] !== setItemControl || $[5] !== setItemToEditId) {
    t3 = () => {
      setItemControl(ItemDlpTypes.NONE);
      setItemToEditId(null);
    };
    $[4] = setItemControl;
    $[5] = setItemToEditId;
    $[6] = t3;
  } else {
    t3 = $[6];
  }
  const closeModal = t3;
  let t4;
  if ($[7] !== setItemControl || $[8] !== setItemToEditId) {
    t4 = (id) => {
      setItemToEditId(id);
      setItemControl(ItemDlpTypes.EDIT);
    };
    $[7] = setItemControl;
    $[8] = setItemToEditId;
    $[9] = t4;
  } else {
    t4 = $[9];
  }
  const editDlpAction = t4;
  let t5;
  if ($[10] !== t2) {
    t5 = t2("dlp.title");
    $[10] = t2;
    $[11] = t5;
  } else {
    t5 = $[11];
  }
  let t6;
  if ($[12] !== isLoading) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: classes$4.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingOverlay, { visible: isLoading }) });
    $[12] = isLoading;
    $[13] = t6;
  } else {
    t6 = $[13];
  }
  let t7;
  if ($[14] !== accessDenied || $[15] !== dlps || $[16] !== editDlpAction || $[17] !== goToMakeDlp || $[18] !== loadProfiles || $[19] !== t2 || $[20] !== toggleEnabled) {
    t7 = accessDenied ? /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(IconLock, { size: 20 }), title: t2("dlp.accessDenied"), color: "orange", maw: 600, children: t2("dlp.accessDeniedMessage") }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { maw: 600, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Thead, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table.Tr, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { style: {
            width: "100%"
          }, children: t2("dlp.connectionName") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { children: t2("dlp.activity") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Th, { style: {
            width: 60,
            maxWidth: 60
          } })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Tbody, { children: dlps.filter(_temp$1).map((profile_0) => /* @__PURE__ */ jsxRuntimeExports.jsx(DlpItem, { profile: profile_0, onEdit: editDlpAction, onDelete: loadProfiles, onToggle: (enabled) => toggleEnabled(profile_0.Id, enabled) }, profile_0.Id)) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(AddButton, { mt: "sm", onClick: goToMakeDlp, children: t2("dlp.addIntegration") })
    ] });
    $[14] = accessDenied;
    $[15] = dlps;
    $[16] = editDlpAction;
    $[17] = goToMakeDlp;
    $[18] = loadProfiles;
    $[19] = t2;
    $[20] = toggleEnabled;
    $[21] = t7;
  } else {
    t7 = $[21];
  }
  let t8;
  if ($[22] !== closeModal || $[23] !== isEditOpen || $[24] !== onProfileSaved || $[25] !== profileToEdit) {
    t8 = isEditOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(EditDlpDialog, { isOpen: isEditOpen, onClose: closeModal, profile: profileToEdit, onSuccess: onProfileSaved });
    $[22] = closeModal;
    $[23] = isEditOpen;
    $[24] = onProfileSaved;
    $[25] = profileToEdit;
    $[26] = t8;
  } else {
    t8 = $[26];
  }
  let t9;
  if ($[27] !== closeModal || $[28] !== isMakeOpen || $[29] !== onProfileSaved) {
    t9 = isMakeOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(MakeDlpDialog, { isOpen: isMakeOpen, onClose: closeModal, onSuccess: onProfileSaved });
    $[27] = closeModal;
    $[28] = isMakeOpen;
    $[29] = onProfileSaved;
    $[30] = t9;
  } else {
    t9 = $[30];
  }
  let t10;
  if ($[31] !== t5 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9) {
    t10 = /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTemplate, { title: t5, children: [
      t6,
      t7,
      t8,
      t9
    ] });
    $[31] = t5;
    $[32] = t6;
    $[33] = t7;
    $[34] = t8;
    $[35] = t9;
    $[36] = t10;
  } else {
    t10 = $[36];
  }
  return t10;
};
function _temp$1(profile) {
  return profile == null ? void 0 : profile.Id;
}
const SecurityPage = () => {
  const $ = compilerRuntimeExports.c(19);
  const {
    classes: classes2
  } = useStyles();
  const {
    Settings
  } = useAppSelector(_temp);
  const {
    filial
  } = useAppSelector(_temp2);
  let t0;
  if ($[0] !== Settings) {
    t0 = isSaaS(Settings);
    $[0] = Settings;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  const showPasswordStrength = !t0;
  const customerId = (filial == null ? void 0 : filial.Id) || 0;
  let t1;
  if ($[2] !== customerId) {
    t1 = /* @__PURE__ */ jsxRuntimeExports.jsx(DlpAntivirus, { customerId });
    $[2] = customerId;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  let t2;
  let t3;
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
    t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(SettingSIEMSystem, {});
    t3 = /* @__PURE__ */ jsxRuntimeExports.jsx(ShareLinks, {});
    $[4] = t2;
    $[5] = t3;
  } else {
    t2 = $[4];
    t3 = $[5];
  }
  let t4;
  if ($[6] !== customerId) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx(RestrictRoomsByRoles, { customerId });
    $[6] = customerId;
    $[7] = t4;
  } else {
    t4 = $[7];
  }
  let t5;
  let t6;
  let t7;
  let t8;
  if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(IPSecurityUsers, {});
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(IPSecurityAdm, {});
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsx(SessionDuration, {});
    t8 = /* @__PURE__ */ jsxRuntimeExports.jsx(PasswordLimit, {});
    $[8] = t5;
    $[9] = t6;
    $[10] = t7;
    $[11] = t8;
  } else {
    t5 = $[8];
    t6 = $[9];
    t7 = $[10];
    t8 = $[11];
  }
  let t9;
  if ($[12] !== showPasswordStrength) {
    t9 = showPasswordStrength && /* @__PURE__ */ jsxRuntimeExports.jsx(PasswordStrength, {});
    $[12] = showPasswordStrength;
    $[13] = t9;
  } else {
    t9 = $[13];
  }
  let t10;
  if ($[14] !== classes2.container || $[15] !== t1 || $[16] !== t4 || $[17] !== t9) {
    t10 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: classes2.container, direction: "column", children: [
      t1,
      t2,
      t3,
      t4,
      t5,
      t6,
      t7,
      t8,
      t9
    ] });
    $[14] = classes2.container;
    $[15] = t1;
    $[16] = t4;
    $[17] = t9;
    $[18] = t10;
  } else {
    t10 = $[18];
  }
  return t10;
};
function _temp(state) {
  return state.userInfo;
}
function _temp2(state_0) {
  return state_0.filials;
}
export {
  SecurityPage as default
};
//# sourceMappingURL=index-UG854A7p.js.map
