import { a as r, E as compilerRuntimeExports, j as jsxRuntimeExports, r as reactExports, D as commonjsGlobal, C as getDefaultExportFromCjs } from "./vendor-react-DYNCg6N5.js";
import { c as createStyles, i as Indicator, b as Box, M as Menu, O as Badge, T as Text, g as Loader, X as Drawer, U as UnstyledButton, h as ActionIcon, G as Group, K as Divider, an as propTypesExports } from "./vendor-mantine-h0WlM2Mj.js";
import { U as UserStatusEnum, K as IUsersSortField, bs as theme, bt as getActiveFiltersLengths, O as themeColors, bu as useGetFilterListItemsQuery, I as IFiltersEnumType } from "./index-DfebxkL9.js";
import { O as OverflowTip } from "./index-C-CFogWu.js";
import { w as qXe, b as gq, W as Ws, a0 as oe, a1 as $n } from "./vendor-icons-xWhXK_Ui.js";
import { U as UserAvatarWithCard } from "./index-3c9En-DB.js";
import { u as useLoadMore } from "./index-CfN7Ll0p.js";
import { I as InfiniteScroll } from "./index.es-BTZFX8B-.js";
import { U as UsersActionTableEnum } from "./useUpdateUser-innD962A.js";
import { u as useTranslation } from "./vendor-i18n-wisIXUFi.js";
import { S as SearchFilter } from "./index-C6QQOvbB.js";
import { D as DateRangeFilter } from "./index-_NgMYV3i.js";
import { I as IUserTypeEnum } from "./index-TL41xEJi.js";
const useStyles$3 = createStyles((theme2) => ({
  user: {
    height: "100%",
    width: "100%",
    display: "flex",
    alignItems: "center",
    position: "relative",
    justifyContent: "left",
    flexDirection: "row",
    margin: 0,
    padding: 0
  },
  content: {
    height: "100%",
    width: "100%",
    display: "flex",
    alignItems: "flex-start",
    justifyContent: "space-between",
    flexDirection: "column",
    marginLeft: theme2.spacing.sm
  },
  nameWrapper: {
    textOverflow: "ellipsis",
    overflow: "hidden",
    display: "flex",
    alignItems: "center",
    gap: "8px"
  },
  ldapLabel: {
    position: "absolute",
    left: 16,
    bottom: -10,
    backgroundColor: "rgba(51, 154, 240, 1)",
    color: "#EFF8FF",
    fontWeight: 500,
    lineHeight: "18px",
    padding: "0 6px",
    borderRadius: "16px",
    fontSize: "10px",
    flexShrink: 0
  }
}));
const ItemUser = (t0) => {
  var _a, _b;
  const $ = compilerRuntimeExports.c(31);
  const {
    item
  } = t0;
  const {
    classes
  } = useStyles$3();
  const isBan = (item == null ? void 0 : item.Status) === UserStatusEnum.Ban;
  const isLdapUser = (item == null ? void 0 : item.Type) === IUsersSortField.LDAP;
  let t1;
  if ($[0] !== isBan || $[1] !== item) {
    t1 = isBan && /* @__PURE__ */ jsxRuntimeExports.jsx(Indicator, { withBorder: true, label: /* @__PURE__ */ jsxRuntimeExports.jsx(qXe, { size: "8", stroke: "4" }), size: 20, offset: 6, position: "bottom-start", color: "red", children: /* @__PURE__ */ jsxRuntimeExports.jsx(UserAvatarWithCard, { hoverCardProps: {
      position: "right"
    }, user: item, size: 40, src: item == null ? void 0 : item.Avatar }) });
    $[0] = isBan;
    $[1] = item;
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  let t2;
  if ($[3] !== isBan || $[4] !== item) {
    t2 = !isBan && /* @__PURE__ */ jsxRuntimeExports.jsx(UserAvatarWithCard, { hoverCardProps: {
      position: "right"
    }, user: item, size: 40, src: item == null ? void 0 : item.Avatar });
    $[3] = isBan;
    $[4] = item;
    $[5] = t2;
  } else {
    t2 = $[5];
  }
  let t3;
  if ($[6] !== classes.ldapLabel || $[7] !== isLdapUser) {
    t3 = isLdapUser && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: classes.ldapLabel, children: "LDAP" });
    $[6] = classes.ldapLabel;
    $[7] = isLdapUser;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  const t4 = item == null ? void 0 : item.Name;
  let t5;
  if ($[9] !== t4) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTip, { size: "sm", fw: 600, color: "#101828", children: t4 });
    $[9] = t4;
    $[10] = t5;
  } else {
    t5 = $[10];
  }
  let t6;
  if ($[11] !== classes.ldapLabel || $[12] !== isLdapUser) {
    t6 = isLdapUser && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: classes.ldapLabel, children: "LDAP" });
    $[11] = classes.ldapLabel;
    $[12] = isLdapUser;
    $[13] = t6;
  } else {
    t6 = $[13];
  }
  let t7;
  if ($[14] !== classes.nameWrapper || $[15] !== t5 || $[16] !== t6) {
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { maw: "200px", className: classes.nameWrapper, children: [
      t5,
      t6
    ] });
    $[14] = classes.nameWrapper;
    $[15] = t5;
    $[16] = t6;
    $[17] = t7;
  } else {
    t7 = $[17];
  }
  let t8;
  if ($[18] !== classes.nameWrapper || $[19] !== (item == null ? void 0 : item.Positions)) {
    t8 = ((_a = item == null ? void 0 : item.Positions) == null ? void 0 : _a.length) && ((_b = item == null ? void 0 : item.Positions) == null ? void 0 : _b.slice(0, 2).map((position, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: classes.nameWrapper, maw: "200px", children: /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTip, { size: "xs", fw: 400, children: position == null ? void 0 : position.Position }) }, index)));
    $[18] = classes.nameWrapper;
    $[19] = item == null ? void 0 : item.Positions;
    $[20] = t8;
  } else {
    t8 = $[20];
  }
  let t9;
  if ($[21] !== classes.content || $[22] !== t7 || $[23] !== t8) {
    t9 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: classes.content, maw: "200px", children: [
      t7,
      t8
    ] });
    $[21] = classes.content;
    $[22] = t7;
    $[23] = t8;
    $[24] = t9;
  } else {
    t9 = $[24];
  }
  let t10;
  if ($[25] !== classes.user || $[26] !== t1 || $[27] !== t2 || $[28] !== t3 || $[29] !== t9) {
    t10 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: classes.user, children: [
      t1,
      t2,
      t3,
      t9
    ] });
    $[25] = classes.user;
    $[26] = t1;
    $[27] = t2;
    $[28] = t3;
    $[29] = t9;
    $[30] = t10;
  } else {
    t10 = $[30];
  }
  return t10;
};
const ItemUser$1 = r.memo(ItemUser);
const useStyles$2 = createStyles((theme2) => ({
  scrolled: {
    boxShadow: theme2.shadows.sm
  },
  infiniteScroll: {
    "&::-webkit-scrollbar": {
      width: "8px",
      height: "10px"
    },
    "&::-webkit-scrollbar-thumb": {
      borderRadius: "8px",
      background: "#98A2B3"
    },
    "&::-webkit-scrollbar-track": {
      background: "#F9FAFB",
      borderRadius: "8px"
    },
    scrollbarColor: "#98A2B3 #F9FAFB"
  },
  infiniteScrollMoreData: {
    width: "100%",
    height: "50px",
    display: "flex",
    alignItems: "center",
    justifyContent: "center"
  },
  error: {
    height: "100vh",
    width: "100%",
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    flexDirection: "column",
    backgroundColor: theme2.colors.backgroundGray[0],
    "& p": {
      display: "flex",
      alignItems: "center",
      justifyContent: "center",
      margin: "0px 10px"
    }
  },
  badge: {
    backgroundColor: theme2.colors.backgroundGray[6],
    color: "#344054",
    textTransform: "none",
    fontSize: "12px",
    fontWeight: 400,
    lineHeight: "18px",
    marginRight: theme2.spacing.xs,
    borderRadius: "16px",
    cursor: "pointer",
    padding: `0px ${theme2.spacing.xs}`,
    "& .mantine-Badge-rightSection": {
      display: "flex"
    }
  },
  disabled: {
    opacity: "0.5",
    pointerEvents: "none"
  },
  label: {
    cursor: "pointer",
    width: "220px",
    wordWrap: "break-word",
    whiteSpace: "normal",
    fontSize: theme2.fontSizes.sm
  },
  dropdown: {
    padding: theme2.spacing.sm
  }
}));
const FilialsControl = (t0) => {
  const $ = compilerRuntimeExports.c(36);
  const {
    item,
    handleClickListItem,
    handleClick,
    disabled
  } = t0;
  const {
    t
  } = useTranslation();
  const {
    classes
  } = useStyles$2();
  const {
    list,
    total,
    loadMore
  } = useLoadMore();
  const ref = reactExports.useRef(null);
  let t1;
  if ($[0] !== classes.dropdown) {
    t1 = {
      dropdown: classes.dropdown
    };
    $[0] = classes.dropdown;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  let t2;
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
    t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(gq, { size: "12px" });
    $[2] = t2;
  } else {
    t2 = $[2];
  }
  const t3 = `${classes.badge} ${disabled ? classes.disabled : ""}`;
  const t4 = `${item.value}`;
  let t5;
  if ($[3] !== t) {
    t5 = t("users.actionList.changeDepartment");
    $[3] = t;
    $[4] = t5;
  } else {
    t5 = $[4];
  }
  let t6;
  if ($[5] !== t5) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fz: "inherit", children: t5 });
    $[5] = t5;
    $[6] = t6;
  } else {
    t6 = $[6];
  }
  let t7;
  if ($[7] !== handleClick || $[8] !== t3 || $[9] !== t4 || $[10] !== t6) {
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Target, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { "data-type": UsersActionTableEnum.filial, onClick: handleClick, variant: "light", size: "md", miw: "fit-content", rightSection: t2, className: t3, "data-cy": t4, children: t6 }) });
    $[7] = handleClick;
    $[8] = t3;
    $[9] = t4;
    $[10] = t6;
    $[11] = t7;
  } else {
    t7 = $[11];
  }
  let t8;
  if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
    t8 = {
      width: "100%"
    };
    $[12] = t8;
  } else {
    t8 = $[12];
  }
  let t9;
  if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
    t9 = {
      overflow: "auto"
    };
    $[13] = t9;
  } else {
    t9 = $[13];
  }
  let t10;
  if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
    t10 = {
      height: "auto",
      maxHeight: 250,
      minHeight: 32
    };
    $[14] = t10;
  } else {
    t10 = $[14];
  }
  const t11 = list == null ? void 0 : list.length;
  const t12 = total > list.length;
  let t13;
  if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
    t13 = /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "sm" });
    $[15] = t13;
  } else {
    t13 = $[15];
  }
  let t14;
  if ($[16] !== classes.infiniteScrollMoreData) {
    t14 = /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: classes.infiniteScrollMoreData, children: t13 });
    $[16] = classes.infiniteScrollMoreData;
    $[17] = t14;
  } else {
    t14 = $[17];
  }
  const t15 = classes.infiniteScroll;
  let t16;
  if ($[18] !== classes.label || $[19] !== handleClickListItem || $[20] !== list) {
    let t172;
    if ($[22] !== classes.label || $[23] !== handleClickListItem) {
      t172 = (item_0, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Item, { "data-value": item_0.value, onClick: handleClickListItem, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { truncate: true, className: classes.label, children: item_0.label }) }, index);
      $[22] = classes.label;
      $[23] = handleClickListItem;
      $[24] = t172;
    } else {
      t172 = $[24];
    }
    t16 = list.map(t172);
    $[18] = classes.label;
    $[19] = handleClickListItem;
    $[20] = list;
    $[21] = t16;
  } else {
    t16 = $[21];
  }
  let t17;
  if ($[25] !== classes.infiniteScroll || $[26] !== loadMore || $[27] !== t11 || $[28] !== t12 || $[29] !== t14 || $[30] !== t16) {
    t17 = /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Dropdown, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: t8, ref, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "scrollableDiv", style: t9, children: /* @__PURE__ */ jsxRuntimeExports.jsx(InfiniteScroll, { style: t10, height: 250, scrollableTarget: "scrollableDiv", dataLength: t11, next: loadMore, hasMore: t12, loader: t14, className: t15, children: t16 }) }) }) });
    $[25] = classes.infiniteScroll;
    $[26] = loadMore;
    $[27] = t11;
    $[28] = t12;
    $[29] = t14;
    $[30] = t16;
    $[31] = t17;
  } else {
    t17 = $[31];
  }
  let t18;
  if ($[32] !== t1 || $[33] !== t17 || $[34] !== t7) {
    t18 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu, { width: "auto", zIndex: 400, position: "bottom-start", classNames: t1, children: [
      t7,
      t17
    ] });
    $[32] = t1;
    $[33] = t17;
    $[34] = t7;
    $[35] = t18;
  } else {
    t18 = $[35];
  }
  return t18;
};
reactExports.createContext({
  list: [],
  total: 0,
  loadMore: () => {
  }
});
const useStyles$1 = createStyles((theme2) => ({
  filterHeader: {
    display: "flex",
    flexDirection: "row",
    alignItems: "center",
    justifyContent: "center",
    backgroundColor: "#F2F4F7",
    padding: "4px 20px 4px 20px",
    height: "32px",
    gap: 0,
    borderRadius: "54px",
    fontWeight: 400,
    color: "var(--mantine-colors-black)"
  },
  filterItem: {
    flexWrap: "nowrap"
  },
  menuButton: {
    display: "flex",
    alignItems: "center",
    justifyContent: "center"
  },
  badgeContainer: {
    flexDirection: "row",
    display: "flex",
    justifyContent: "center",
    alignItems: "center",
    marginLeft: "12px"
  },
  scroll: {
    overflow: "scroll",
    height: "100%",
    width: "100%",
    position: "absolute",
    top: "0",
    left: "0",
    visibility: "hidden"
  },
  checkbox: {
    display: "flex",
    marginRight: theme2.spacing.md,
    "& input": {
      cursor: "pointer"
    }
  },
  badge: {
    textTransform: "none",
    fontSize: "12px",
    fontWeight: 400,
    lineHeight: "18px",
    marginRight: theme2.spacing.xs,
    borderRadius: "16px",
    padding: `0px 6px`
  },
  leftSection: {
    display: "flex",
    alignItems: "flex-start",
    gap: 20
  },
  rightSection: {
    display: "flex",
    alignItems: "flex-end"
  },
  menu: {
    height: "180px",
    marginBottom: "10px"
  },
  backArrow: {
    display: "none",
    "@media (max-width: 574px)": {
      display: "flex"
    }
  },
  dropdown: {
    padding: theme2.spacing.sm
  }
}));
const useStyles = createStyles(() => {
  var _a;
  return {
    root: {
      width: "100%",
      height: "100%",
      display: "flex",
      flexDirection: "column",
      alignItems: "center",
      justifyContent: "space-between",
      "& .mantine-Drawer-content": {
        maxWidth: "auto",
        boxShadow: "-32px 0px 80px 0px rgba(0, 0, 0, 0.10)",
        "@media (min-width: 574px)": {
          maxWidth: "320px"
        }
      },
      "& .mantine-Drawer-body": {
        padding: (_a = theme.spacing) == null ? void 0 : _a.sm
      }
    },
    title: {
      width: "100%"
    },
    description: {
      width: "100%"
    }
  };
});
const UsersFiltersModal = (t0) => {
  const $ = compilerRuntimeExports.c(9);
  const {
    open,
    setOpen,
    list
  } = t0;
  let t1;
  if ($[0] !== setOpen) {
    t1 = () => () => {
      setOpen();
    };
    $[0] = setOpen;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  let t2;
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
    t2 = [];
    $[2] = t2;
  } else {
    t2 = $[2];
  }
  reactExports.useEffect(t1, t2);
  const {
    classes
  } = useStyles();
  let t3;
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
    t3 = {
      opacity: 0
    };
    $[3] = t3;
  } else {
    t3 = $[3];
  }
  let t4;
  if ($[4] !== classes.root || $[5] !== list || $[6] !== open || $[7] !== setOpen) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx(Drawer, { zIndex: 1100, opened: open, onClose: setOpen, position: "right", withCloseButton: false, className: classes.root, lockScroll: true, overlayProps: t3, children: list });
    $[4] = classes.root;
    $[5] = list;
    $[6] = open;
    $[7] = setOpen;
    $[8] = t4;
  } else {
    t4 = $[8];
  }
  return t4;
};
const UsersFilterList = (t0) => {
  const $ = compilerRuntimeExports.c(105);
  const {
    activeFilters,
    handleFilterReset,
    filtersMenuList,
    handleResetFilters,
    handleFilterChange
  } = t0;
  const {
    classes
  } = useStyles$1();
  const {
    t,
    i18n
  } = useTranslation();
  const [openFiltersModal, setOpenFiltersModal] = reactExports.useState(false);
  let t1;
  if ($[0] !== activeFilters) {
    t1 = getActiveFiltersLengths(activeFilters);
    $[0] = activeFilters;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const totalActiveFiltersCount = t1;
  let t2;
  if ($[2] !== filtersMenuList) {
    t2 = [...filtersMenuList.slice(0, 4)];
    $[2] = filtersMenuList;
    $[3] = t2;
  } else {
    t2 = $[3];
  }
  const slicedFilters = t2;
  if (!filtersMenuList) {
    return null;
  }
  let t3;
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
    t3 = [5, 6, 7, 9, 13, 14];
    $[4] = t3;
  } else {
    t3 = $[4];
  }
  const excludedTypes = t3;
  let T0;
  let T1;
  let t4;
  let t5;
  let t6;
  let t7;
  let t8;
  if ($[5] !== activeFilters || $[6] !== classes.backArrow || $[7] !== classes.badge || $[8] !== classes.badgeContainer || $[9] !== classes.dropdown || $[10] !== classes.filterHeader || $[11] !== classes.filterItem || $[12] !== classes.leftSection || $[13] !== classes.menuButton || $[14] !== filtersMenuList || $[15] !== handleFilterChange || $[16] !== handleFilterReset || $[17] !== handleResetFilters || $[18] !== openFiltersModal || $[19] !== slicedFilters || $[20] !== t || $[21] !== totalActiveFiltersCount) {
    let t92;
    if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
      t92 = (filterMenu) => !excludedTypes.includes(filterMenu.Type);
      $[29] = t92;
    } else {
      t92 = $[29];
    }
    const filteredMenuList = filtersMenuList.filter(t92);
    let t102;
    if ($[30] !== handleFilterReset) {
      t102 = (e, type) => {
        e.stopPropagation();
        handleFilterReset(type);
      };
      $[30] = handleFilterReset;
      $[31] = t102;
    } else {
      t102 = $[31];
    }
    const onHandleResetOneFilter = t102;
    let t112;
    if ($[32] !== handleResetFilters) {
      t112 = (e_0) => {
        e_0.stopPropagation();
        handleResetFilters();
      };
      $[32] = handleResetFilters;
      $[33] = t112;
    } else {
      t112 = $[33];
    }
    const onHandleResetAllFilters = t112;
    T1 = Box;
    t6 = classes.leftSection;
    if ($[34] !== activeFilters || $[35] !== classes.badge || $[36] !== classes.badgeContainer || $[37] !== classes.dropdown || $[38] !== classes.filterHeader || $[39] !== classes.menuButton || $[40] !== handleFilterChange || $[41] !== handleFilterReset || $[42] !== onHandleResetOneFilter || $[43] !== slicedFilters || $[44] !== t) {
      t7 = slicedFilters.map((filterMenu_0, index) => {
        const activeIds = activeFilters[filterMenu_0 == null ? void 0 : filterMenu_0.Type];
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu, { width: "auto", zIndex: 400, position: "bottom-start", classNames: {
          dropdown: classes.dropdown
        }, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Target, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "transparent", color: "gray", className: classes.filterHeader, rightSection: (activeIds == null ? void 0 : activeIds.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: classes.badgeContainer, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: classes.badge, variant: "filled", children: activeIds == null ? void 0 : activeIds.length }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { size: 24, onClick: (e_1) => onHandleResetOneFilter(e_1, filterMenu_0.Type), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ws, { size: 16, color: themeColors.brandGray[0] }) })
          ] }) : null, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(UnstyledButton, { className: classes.menuButton, children: [
            (filterMenu_0 == null ? void 0 : filterMenu_0.label) || t("users.status"),
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsx(gq, { size: 18 })
          ] }) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Dropdown, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SearchFilter, { handleFilterReset, activeIds, filterType: filterMenu_0 == null ? void 0 : filterMenu_0.Type, label: filterMenu_0 == null ? void 0 : filterMenu_0.label, list: filterMenu_0 == null ? void 0 : filterMenu_0.Items, hideSearch: filterMenu_0 == null ? void 0 : filterMenu_0.hideSearch, hideCollapse: true, handleFilterChange, handleLoadData: useGetFilterListItemsQuery }) })
        ] }, `${filterMenu_0 == null ? void 0 : filterMenu_0.label}${index}${filterMenu_0.Type}`);
      });
      $[34] = activeFilters;
      $[35] = classes.badge;
      $[36] = classes.badgeContainer;
      $[37] = classes.dropdown;
      $[38] = classes.filterHeader;
      $[39] = classes.menuButton;
      $[40] = handleFilterChange;
      $[41] = handleFilterReset;
      $[42] = onHandleResetOneFilter;
      $[43] = slicedFilters;
      $[44] = t;
      $[45] = t7;
    } else {
      t7 = $[45];
    }
    t8 = (filteredMenuList == null ? void 0 : filteredMenuList.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: classes.filterHeader, rightSection: totalActiveFiltersCount ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: classes.badgeContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: classes.badge, variant: "filled", children: totalActiveFiltersCount }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { size: 24, onClick: onHandleResetAllFilters, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ws, { size: 16, color: themeColors.brandGray[0] }) })
    ] }) : null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(UnstyledButton, { onClick: () => setOpenFiltersModal(!openFiltersModal), "data-cy": "allFiltersButton", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { className: classes.filterItem, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(oe, { size: 16 }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { children: t("users.allFilters") }) })
    ] }) }) }) : null;
    T0 = UsersFiltersModal;
    let t122;
    if ($[46] !== openFiltersModal) {
      t122 = () => setOpenFiltersModal(!openFiltersModal);
      $[46] = openFiltersModal;
      $[47] = t122;
    } else {
      t122 = $[47];
    }
    let t132;
    if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
      t132 = /* @__PURE__ */ jsxRuntimeExports.jsx($n, { color: "#667085" });
      $[48] = t132;
    } else {
      t132 = $[48];
    }
    let t142;
    if ($[49] !== classes.backArrow || $[50] !== t122) {
      t142 = /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { onClick: t122, size: "md", className: classes.backArrow, children: t132 });
      $[49] = classes.backArrow;
      $[50] = t122;
      $[51] = t142;
    } else {
      t142 = $[51];
    }
    let t152;
    if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
      t152 = /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {});
      $[52] = t152;
    } else {
      t152 = $[52];
    }
    if ($[53] !== t142) {
      t4 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { children: [
        t142,
        t152
      ] });
      $[53] = t142;
      $[54] = t4;
    } else {
      t4 = $[54];
    }
    let t162;
    if ($[55] !== activeFilters || $[56] !== handleFilterChange || $[57] !== handleFilterReset) {
      t162 = (filterMenu_1, index_0) => {
        const activeIds_0 = activeFilters[filterMenu_1 == null ? void 0 : filterMenu_1.Type];
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { gap: "sm", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(SearchFilter, { handleFilterReset, activeIds: activeIds_0, filterType: filterMenu_1 == null ? void 0 : filterMenu_1.Type, list: filterMenu_1 == null ? void 0 : filterMenu_1.Items, label: filterMenu_1 == null ? void 0 : filterMenu_1.label, hideSearch: filterMenu_1 == null ? void 0 : filterMenu_1.hideSearch, handleFilterChange, handleLoadData: useGetFilterListItemsQuery }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {})
        ] }, `${filterMenu_1 == null ? void 0 : filterMenu_1.Type}${index_0}${filterMenu_1 == null ? void 0 : filterMenu_1.label}`);
      };
      $[55] = activeFilters;
      $[56] = handleFilterChange;
      $[57] = handleFilterReset;
      $[58] = t162;
    } else {
      t162 = $[58];
    }
    t5 = filteredMenuList.map(t162);
    $[5] = activeFilters;
    $[6] = classes.backArrow;
    $[7] = classes.badge;
    $[8] = classes.badgeContainer;
    $[9] = classes.dropdown;
    $[10] = classes.filterHeader;
    $[11] = classes.filterItem;
    $[12] = classes.leftSection;
    $[13] = classes.menuButton;
    $[14] = filtersMenuList;
    $[15] = handleFilterChange;
    $[16] = handleFilterReset;
    $[17] = handleResetFilters;
    $[18] = openFiltersModal;
    $[19] = slicedFilters;
    $[20] = t;
    $[21] = totalActiveFiltersCount;
    $[22] = T0;
    $[23] = T1;
    $[24] = t4;
    $[25] = t5;
    $[26] = t6;
    $[27] = t7;
    $[28] = t8;
  } else {
    T0 = $[22];
    T1 = $[23];
    t4 = $[24];
    t5 = $[25];
    t6 = $[26];
    t7 = $[27];
    t8 = $[28];
  }
  const t9 = activeFilters[IFiltersEnumType.BirthDateFilter];
  let t10;
  if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
    t10 = /* @__PURE__ */ new Date();
    $[59] = t10;
  } else {
    t10 = $[59];
  }
  let t11;
  if ($[60] !== handleFilterChange || $[61] !== handleFilterReset || $[62] !== i18n.language || $[63] !== t9) {
    t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(DateRangeFilter, { activeValue: t9, type: IFiltersEnumType.BirthDateFilter, handleFilterReset, handleChange: handleFilterChange, maxDate: t10, locale: i18n.language });
    $[60] = handleFilterChange;
    $[61] = handleFilterReset;
    $[62] = i18n.language;
    $[63] = t9;
    $[64] = t11;
  } else {
    t11 = $[64];
  }
  let t12;
  if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
    t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {});
    $[65] = t12;
  } else {
    t12 = $[65];
  }
  let t13;
  if ($[66] !== t11) {
    t13 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { gap: "sm", children: [
      t11,
      t12
    ] });
    $[66] = t11;
    $[67] = t13;
  } else {
    t13 = $[67];
  }
  const t14 = activeFilters[IFiltersEnumType.DateOfCreateFilter];
  let t15;
  if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
    t15 = /* @__PURE__ */ new Date();
    $[68] = t15;
  } else {
    t15 = $[68];
  }
  let t16;
  if ($[69] !== handleFilterChange || $[70] !== handleFilterReset || $[71] !== i18n.language || $[72] !== t14) {
    t16 = /* @__PURE__ */ jsxRuntimeExports.jsx(DateRangeFilter, { activeValue: t14, type: IFiltersEnumType.DateOfCreateFilter, handleFilterReset, handleChange: handleFilterChange, maxDate: t15, locale: i18n.language });
    $[69] = handleFilterChange;
    $[70] = handleFilterReset;
    $[71] = i18n.language;
    $[72] = t14;
    $[73] = t16;
  } else {
    t16 = $[73];
  }
  let t17;
  if ($[74] === Symbol.for("react.memo_cache_sentinel")) {
    t17 = /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {});
    $[74] = t17;
  } else {
    t17 = $[74];
  }
  let t18;
  if ($[75] !== t16) {
    t18 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { gap: "sm", children: [
      t16,
      t17
    ] });
    $[75] = t16;
    $[76] = t18;
  } else {
    t18 = $[76];
  }
  const t19 = activeFilters[IFiltersEnumType.LastVisitDateFilter];
  let t20;
  if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
    t20 = /* @__PURE__ */ new Date();
    $[77] = t20;
  } else {
    t20 = $[77];
  }
  let t21;
  if ($[78] !== handleFilterChange || $[79] !== handleFilterReset || $[80] !== i18n.language || $[81] !== t19) {
    t21 = /* @__PURE__ */ jsxRuntimeExports.jsx(DateRangeFilter, { activeValue: t19, type: IFiltersEnumType.LastVisitDateFilter, handleFilterReset, handleChange: handleFilterChange, maxDate: t20, locale: i18n.language });
    $[78] = handleFilterChange;
    $[79] = handleFilterReset;
    $[80] = i18n.language;
    $[81] = t19;
    $[82] = t21;
  } else {
    t21 = $[82];
  }
  let t22;
  if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
    t22 = /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {});
    $[83] = t22;
  } else {
    t22 = $[83];
  }
  let t23;
  if ($[84] !== t21) {
    t23 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Group, { gap: "sm", children: [
      t21,
      t22
    ] });
    $[84] = t21;
    $[85] = t23;
  } else {
    t23 = $[85];
  }
  let t24;
  if ($[86] !== t13 || $[87] !== t18 || $[88] !== t23 || $[89] !== t4 || $[90] !== t5) {
    t24 = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      t4,
      t5,
      t13,
      t18,
      t23
    ] });
    $[86] = t13;
    $[87] = t18;
    $[88] = t23;
    $[89] = t4;
    $[90] = t5;
    $[91] = t24;
  } else {
    t24 = $[91];
  }
  let t25;
  if ($[92] !== openFiltersModal) {
    t25 = () => setOpenFiltersModal(!openFiltersModal);
    $[92] = openFiltersModal;
    $[93] = t25;
  } else {
    t25 = $[93];
  }
  let t26;
  if ($[94] !== T0 || $[95] !== openFiltersModal || $[96] !== t24 || $[97] !== t25) {
    t26 = /* @__PURE__ */ jsxRuntimeExports.jsx(T0, { list: t24, open: openFiltersModal, setOpen: t25 });
    $[94] = T0;
    $[95] = openFiltersModal;
    $[96] = t24;
    $[97] = t25;
    $[98] = t26;
  } else {
    t26 = $[98];
  }
  let t27;
  if ($[99] !== T1 || $[100] !== t26 || $[101] !== t6 || $[102] !== t7 || $[103] !== t8) {
    t27 = /* @__PURE__ */ jsxRuntimeExports.jsxs(T1, { className: t6, children: [
      t7,
      t8,
      t26
    ] });
    $[99] = T1;
    $[100] = t26;
    $[101] = t6;
    $[102] = t7;
    $[103] = t8;
    $[104] = t27;
  } else {
    t27 = $[104];
  }
  return t27;
};
const UsersFilterList$1 = r.memo(UsersFilterList);
const CreateUserContext = reactExports.createContext({});
var dist = { exports: {} };
(function(module, exports$1) {
  !function(e, t) {
    module.exports = t(propTypesExports, reactExports);
  }(commonjsGlobal, function(e, t) {
    function o(e2) {
      return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
    }
    var n = o(e), i = o(t);
    function r2(e2, t2) {
      for (var o2 = 0; o2 < t2.length; o2++) {
        var n2 = t2[o2];
        n2.enumerable = n2.enumerable || false, n2.configurable = true, "value" in n2 && (n2.writable = true), Object.defineProperty(e2, n2.key, n2);
      }
    }
    function s(e2, t2, o2) {
      return t2 in e2 ? Object.defineProperty(e2, t2, { value: o2, enumerable: true, configurable: true, writable: true }) : e2[t2] = o2, e2;
    }
    function u() {
      return (u = Object.assign || function(e2) {
        for (var t2 = 1; t2 < arguments.length; t2++) {
          var o2 = arguments[t2];
          for (var n2 in o2) Object.prototype.hasOwnProperty.call(o2, n2) && (e2[n2] = o2[n2]);
        }
        return e2;
      }).apply(this, arguments);
    }
    function a(t2, e2) {
      var o2, n2 = Object.keys(t2);
      return Object.getOwnPropertySymbols && (o2 = Object.getOwnPropertySymbols(t2), e2 && (o2 = o2.filter(function(e3) {
        return Object.getOwnPropertyDescriptor(t2, e3).enumerable;
      })), n2.push.apply(n2, o2)), n2;
    }
    function y(t2) {
      for (var e2 = 1; e2 < arguments.length; e2++) {
        var o2 = null != arguments[e2] ? arguments[e2] : {};
        e2 % 2 ? a(Object(o2), true).forEach(function(e3) {
          s(t2, e3, o2[e3]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t2, Object.getOwnPropertyDescriptors(o2)) : a(Object(o2)).forEach(function(e3) {
          Object.defineProperty(t2, e3, Object.getOwnPropertyDescriptor(o2, e3));
        });
      }
      return t2;
    }
    function h(e2) {
      return (h = Object.setPrototypeOf ? Object.getPrototypeOf : function(e3) {
        return e3.__proto__ || Object.getPrototypeOf(e3);
      })(e2);
    }
    function c(e2, t2) {
      return (c = Object.setPrototypeOf || function(e3, t3) {
        return e3.__proto__ = t3, e3;
      })(e2, t2);
    }
    function l(e2, t2) {
      if (null == e2) return {};
      var o2, n2 = function(e3, t3) {
        if (null == e3) return {};
        for (var o3, n3 = {}, a3 = Object.keys(e3), r4 = 0; r4 < a3.length; r4++) o3 = a3[r4], 0 <= t3.indexOf(o3) || (n3[o3] = e3[o3]);
        return n3;
      }(e2, t2);
      if (Object.getOwnPropertySymbols) for (var a2 = Object.getOwnPropertySymbols(e2), r3 = 0; r3 < a2.length; r3++) o2 = a2[r3], 0 <= t2.indexOf(o2) || Object.prototype.propertyIsEnumerable.call(e2, o2) && (n2[o2] = e2[o2]);
      return n2;
    }
    function d(e2) {
      if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return e2;
    }
    function p(r3) {
      var i2 = function() {
        if ("undefined" == typeof Reflect || !Reflect.construct) return false;
        if (Reflect.construct.sham) return false;
        if ("function" == typeof Proxy) return true;
        try {
          return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
          })), true;
        } catch (e2) {
          return false;
        }
      }();
      return function() {
        var e2, t2, o2, n2, a2 = h(r3);
        return t2 = i2 ? (e2 = h(this).constructor, Reflect.construct(a2, arguments, e2)) : a2.apply(this, arguments), o2 = this, !(n2 = t2) || "object" != typeof n2 && "function" != typeof n2 ? d(o2) : n2;
      };
    }
    function m(e2, t2) {
      return function(e3) {
        if (Array.isArray(e3)) return e3;
      }(e2) || function(e3, t3) {
        if ("undefined" == typeof Symbol || !(Symbol.iterator in Object(e3))) return;
        var o2 = [], n2 = true, a2 = false, r3 = void 0;
        try {
          for (var i2, s2 = e3[Symbol.iterator](); !(n2 = (i2 = s2.next()).done) && (o2.push(i2.value), !t3 || o2.length !== t3); n2 = true) ;
        } catch (e4) {
          a2 = true, r3 = e4;
        } finally {
          try {
            n2 || null == s2.return || s2.return();
          } finally {
            if (a2) throw r3;
          }
        }
        return o2;
      }(e2, t2) || g(e2, t2) || function() {
        throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }();
    }
    function g(e2, t2) {
      if (e2) {
        if ("string" == typeof e2) return f(e2, t2);
        var o2 = Object.prototype.toString.call(e2).slice(8, -1);
        return "Object" === o2 && e2.constructor && (o2 = e2.constructor.name), "Map" === o2 || "Set" === o2 ? Array.from(e2) : "Arguments" === o2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o2) ? f(e2, t2) : void 0;
      }
    }
    function f(e2, t2) {
      (null == t2 || t2 > e2.length) && (t2 = e2.length);
      for (var o2 = 0, n2 = new Array(t2); o2 < t2; o2++) n2[o2] = e2[o2];
      return n2;
    }
    function v(a2, r3) {
      return new Promise(function(e2, t2) {
        var o2, n2 = new Image();
        n2.onload = function() {
          return e2(n2);
        }, n2.onerror = t2, false == (null !== (o2 = a2) && !!o2.match(/^\s*data:([a-z]+\/[a-z]+(;[a-z-]+=[a-z-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=\-._~:@/?%\s]*\s*$/i)) && r3 && (n2.crossOrigin = r3), n2.src = a2;
      });
    }
    var b, w = !("undefined" == typeof window || "undefined" == typeof navigator || !("ontouchstart" in window || 0 < navigator.msMaxTouchPoints)), M = "undefined" != typeof File, O = { touch: { react: { down: "onTouchStart", mouseDown: "onMouseDown" }, native: { down: "touchstart", mouseDown: "mousedown", drag: "touchmove", move: "touchmove", mouseMove: "mousemove", up: "touchend", mouseUp: "mouseup" } }, desktop: { react: { down: "onMouseDown" }, native: { down: "mousedown", drag: "dragStart", move: "mousemove", up: "mouseup" } } }, I = w ? O.touch : O.desktop, P = "undefined" != typeof window && window.devicePixelRatio ? window.devicePixelRatio : 1, C = { x: 0.5, y: 0.5 }, x = function() {
      !function(e3, t3) {
        if ("function" != typeof t3 && null !== t3) throw new TypeError("Super expression must either be null or a function");
        e3.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e3, writable: true, configurable: true } }), t3 && c(e3, t3);
      }(a2, i["default"].Component);
      var e2, t2, n2 = p(a2);
      function a2(e3) {
        var v2;
        return function(e4, t3) {
          if (!(e4 instanceof t3)) throw new TypeError("Cannot call a class as a function");
        }(this, a2), s(d(v2 = n2.call(this, e3)), "state", { drag: false, my: null, mx: null, image: C }), s(d(v2), "handleImageReady", function(e4) {
          var t3 = v2.getInitialSize(e4.width, e4.height);
          t3.resource = e4, t3.x = 0.5, t3.y = 0.5, t3.backgroundColor = v2.props.backgroundColor, v2.setState({ drag: false, image: t3 }, v2.props.onImageReady), v2.props.onLoadSuccess(t3);
        }), s(d(v2), "clearImage", function() {
          v2.canvas.getContext("2d").clearRect(0, 0, v2.canvas.width, v2.canvas.height), v2.setState({ image: C });
        }), s(d(v2), "handleMouseDown", function(e4) {
          (e4 = e4 || window.event).preventDefault(), v2.setState({ drag: true, mx: null, my: null });
        }), s(d(v2), "handleMouseUp", function() {
          v2.state.drag && (v2.setState({ drag: false }), v2.props.onMouseUp());
        }), s(d(v2), "handleMouseMove", function(e4) {
          var t3, o2, n3, a3, r3, i2, s2, u2, h2, c2, l2, d2, p2, g2, f2, m2;
          e4 = e4 || window.event, false !== v2.state.drag && (e4.preventDefault(), n3 = { mx: t3 = e4.targetTouches ? e4.targetTouches[0].pageX : e4.clientX, my: o2 = e4.targetTouches ? e4.targetTouches[0].pageY : e4.clientY }, m2 = v2.props.rotate, m2 = (m2 %= 360) < 0 ? m2 + 360 : m2, v2.state.mx && v2.state.my && (a3 = v2.state.mx - t3, r3 = v2.state.my - o2, i2 = v2.state.image.width * v2.props.scale, s2 = v2.state.image.height * v2.props.scale, h2 = (u2 = v2.getCroppingRect()).x, c2 = u2.y, h2 *= i2, c2 *= s2, l2 = function(e5) {
            return e5 * (Math.PI / 180);
          }, d2 = Math.cos(l2(m2)), g2 = c2 + -a3 * (p2 = Math.sin(l2(m2))) + r3 * d2, f2 = { x: (h2 + a3 * d2 + r3 * p2) / i2 + 1 / v2.props.scale * v2.getXScale() / 2, y: g2 / s2 + 1 / v2.props.scale * v2.getYScale() / 2 }, v2.props.onPositionChange(f2), n3.image = y(y({}, v2.state.image), f2)), v2.setState(n3), v2.props.onMouseMove(e4));
        }), s(d(v2), "setCanvas", function(e4) {
          v2.canvas = e4;
        }), v2.canvas = null, v2;
      }
      return e2 = a2, (t2 = [{ key: "componentDidMount", value: function() {
        this.props.disableHiDPIScaling && (P = 1);
        var e3, t3, o2 = this.canvas.getContext("2d");
        this.props.image && this.loadImage(this.props.image), this.paint(o2), document && (e3 = !!function() {
          var t4 = false;
          try {
            var e4 = Object.defineProperty({}, "passive", { get: function() {
              t4 = true;
            } });
            window.addEventListener("test", e4, e4), window.removeEventListener("test", e4, e4);
          } catch (e5) {
            t4 = false;
          }
          return t4;
        }() && { passive: false }, t3 = I.native, document.addEventListener(t3.move, this.handleMouseMove, e3), document.addEventListener(t3.up, this.handleMouseUp, e3), w && (document.addEventListener(t3.mouseMove, this.handleMouseMove, e3), document.addEventListener(t3.mouseUp, this.handleMouseUp, e3)));
      } }, { key: "componentDidUpdate", value: function(e3, t3) {
        this.props.image && this.props.image !== e3.image || this.props.width !== e3.width || this.props.height !== e3.height || this.props.backgroundColor !== e3.backgroundColor ? this.loadImage(this.props.image) : this.props.image || t3.image === C || this.clearImage();
        var o2 = this.canvas.getContext("2d");
        o2.clearRect(0, 0, this.canvas.width, this.canvas.height), this.paint(o2), this.paintImage(o2, this.state.image, this.props.border), e3.image === this.props.image && e3.width === this.props.width && e3.height === this.props.height && e3.position === this.props.position && e3.scale === this.props.scale && e3.rotate === this.props.rotate && t3.my === this.state.my && t3.mx === this.state.mx && t3.image.x === this.state.image.x && t3.image.y === this.state.image.y && t3.backgroundColor === this.state.backgroundColor || this.props.onImageChange();
      } }, { key: "componentWillUnmount", value: function() {
        var e3;
        document && (e3 = I.native, document.removeEventListener(e3.move, this.handleMouseMove, false), document.removeEventListener(e3.up, this.handleMouseUp, false), w && (document.removeEventListener(e3.mouseMove, this.handleMouseMove, false), document.removeEventListener(e3.mouseUp, this.handleMouseUp, false)));
      } }, { key: "isVertical", value: function() {
        return !this.props.disableCanvasRotation && this.props.rotate % 180 != 0;
      } }, { key: "getBorders", value: function(e3) {
        var t3 = 0 < arguments.length && void 0 !== e3 ? e3 : this.props.border;
        return Array.isArray(t3) ? t3 : [t3, t3];
      } }, { key: "getDimensions", value: function() {
        var e3 = this.props, t3 = e3.width, o2 = e3.height, n3 = e3.rotate, a3 = e3.border, r3 = {}, i2 = m(this.getBorders(a3), 2), s2 = i2[0], u2 = i2[1], h2 = t3, c2 = o2;
        return this.isVertical() ? (r3.width = c2, r3.height = h2) : (r3.width = h2, r3.height = c2), r3.width += 2 * s2, r3.height += 2 * u2, { canvas: r3, rotate: n3, width: t3, height: o2, border: a3 };
      } }, { key: "getImage", value: function() {
        var e3 = this.getCroppingRect(), t3 = this.state.image;
        e3.x *= t3.resource.width, e3.y *= t3.resource.height, e3.width *= t3.resource.width, e3.height *= t3.resource.height;
        var o2 = document.createElement("canvas");
        this.isVertical() ? (o2.width = e3.height, o2.height = e3.width) : (o2.width = e3.width, o2.height = e3.height);
        var n3 = o2.getContext("2d");
        return n3.translate(o2.width / 2, o2.height / 2), n3.rotate(this.props.rotate * Math.PI / 180), n3.translate(-o2.width / 2, -o2.height / 2), this.isVertical() && n3.translate((o2.width - o2.height) / 2, (o2.height - o2.width) / 2), t3.backgroundColor && (n3.fillStyle = t3.backgroundColor, n3.fillRect(-e3.x, -e3.y, t3.resource.width, t3.resource.height)), n3.drawImage(t3.resource, -e3.x, -e3.y), o2;
      } }, { key: "getImageScaledToCanvas", value: function() {
        var e3 = this.getDimensions(), t3 = e3.width, o2 = e3.height, n3 = document.createElement("canvas");
        return this.isVertical() ? (n3.width = o2, n3.height = t3) : (n3.width = t3, n3.height = o2), this.paintImage(n3.getContext("2d"), this.state.image, 0, 1), n3;
      } }, { key: "getXScale", value: function() {
        var e3 = this.props.width / this.props.height, t3 = this.state.image.width / this.state.image.height;
        return Math.min(1, e3 / t3);
      } }, { key: "getYScale", value: function() {
        var e3 = this.props.height / this.props.width, t3 = this.state.image.height / this.state.image.width;
        return Math.min(1, e3 / t3);
      } }, { key: "getCroppingRect", value: function() {
        var e3 = this.props.position || { x: this.state.image.x, y: this.state.image.y }, t3 = 1 / this.props.scale * this.getXScale(), o2 = 1 / this.props.scale * this.getYScale(), n3 = { x: e3.x - t3 / 2, y: e3.y - o2 / 2, width: t3, height: o2 }, a3 = 0, r3 = 1 - n3.width, i2 = 0, s2 = 1 - n3.height;
        return (this.props.disableBoundaryChecks || 1 < t3 || 1 < o2) && (a3 = -n3.width, i2 = -n3.height, s2 = r3 = 1), y(y({}, n3), {}, { x: Math.max(a3, Math.min(n3.x, r3)), y: Math.max(i2, Math.min(n3.y, s2)) });
      } }, { key: "loadImage", value: function(e3) {
        var t3;
        M && e3 instanceof File ? this.loadingImage = (t3 = e3, new Promise(function(o2, n3) {
          var e4 = new FileReader();
          e4.onload = function(e5) {
            try {
              var t4 = v(e5.target.result);
              o2(t4);
            } catch (e6) {
              n3(e6);
            }
          }, e4.readAsDataURL(t3);
        }).then(this.handleImageReady).catch(this.props.onLoadFailure)) : "string" == typeof e3 && (this.loadingImage = v(e3, this.props.crossOrigin).then(this.handleImageReady).catch(this.props.onLoadFailure));
      } }, { key: "getInitialSize", value: function(e3, t3) {
        var o2, n3, a3 = this.getDimensions();
        return t3 / e3 < a3.height / a3.width ? n3 = e3 * ((o2 = this.getDimensions().height) / t3) : o2 = t3 * ((n3 = this.getDimensions().width) / e3), { height: o2, width: n3 };
      } }, { key: "paintImage", value: function(e3, t3, o2, n3) {
        var a3, r3 = 3 < arguments.length && void 0 !== n3 ? n3 : P;
        t3.resource && (a3 = this.calculatePosition(t3, o2), e3.save(), e3.translate(e3.canvas.width / 2, e3.canvas.height / 2), e3.rotate(this.props.rotate * Math.PI / 180), e3.translate(-e3.canvas.width / 2, -e3.canvas.height / 2), this.isVertical() && e3.translate((e3.canvas.width - e3.canvas.height) / 2, (e3.canvas.height - e3.canvas.width) / 2), e3.scale(r3, r3), e3.globalCompositeOperation = "destination-over", e3.drawImage(t3.resource, a3.x, a3.y, a3.width, a3.height), t3.backgroundColor && (e3.fillStyle = t3.backgroundColor, e3.fillRect(a3.x, a3.y, a3.width, a3.height)), e3.restore());
      } }, { key: "calculatePosition", value: function(e3, t3) {
        e3 = e3 || this.state.image;
        var o2 = m(this.getBorders(t3), 2), n3 = o2[0], a3 = o2[1], r3 = this.getCroppingRect(), i2 = e3.width * this.props.scale, s2 = e3.height * this.props.scale, u2 = -r3.x * i2, h2 = -r3.y * s2;
        return this.isVertical() ? (u2 += a3, h2 += n3) : (u2 += n3, h2 += a3), { x: u2, y: h2, height: s2, width: i2 };
      } }, { key: "paint", value: function(e3) {
        e3.save(), e3.scale(P, P), e3.translate(0, 0), e3.fillStyle = "rgba(" + this.props.color.slice(0, 4).join(",") + ")";
        var t3, o2, n3, a3, r3, i2, s2, u2, h2 = this.props.borderRadius, c2 = this.getDimensions(), l2 = m(this.getBorders(c2.border), 2), d2 = l2[0], p2 = l2[1], g2 = c2.canvas.height, f2 = c2.canvas.width, h2 = Math.max(h2, 0);
        h2 = Math.min(h2, f2 / 2 - d2, g2 / 2 - p2), e3.beginPath(), t3 = e3, a3 = f2 - 2 * (o2 = d2), r3 = g2 - 2 * (n3 = p2), 0 === (i2 = h2) ? t3.rect(o2, n3, a3, r3) : (s2 = a3 - i2, u2 = r3 - i2, t3.translate(o2, n3), t3.arc(i2, i2, i2, Math.PI, 1.5 * Math.PI), t3.lineTo(s2, 0), t3.arc(s2, i2, i2, 1.5 * Math.PI, 2 * Math.PI), t3.lineTo(a3, u2), t3.arc(s2, u2, i2, 2 * Math.PI, 0.5 * Math.PI), t3.lineTo(i2, r3), t3.arc(i2, u2, i2, 0.5 * Math.PI, Math.PI), t3.translate(-o2, -n3)), e3.rect(f2, 0, -f2, g2), e3.fill("evenodd"), e3.restore();
      } }, { key: "render", value: function() {
        var e3 = this.props, t3 = (e3.scale, e3.rotate, e3.image, e3.border, e3.borderRadius, e3.width, e3.height, e3.position, e3.color, e3.backgroundColor, e3.style), o2 = (e3.crossOrigin, e3.onLoadFailure, e3.onLoadSuccess, e3.onImageReady, e3.onImageChange, e3.onMouseUp, e3.onMouseMove, e3.onPositionChange, e3.disableBoundaryChecks, e3.disableHiDPIScaling, e3.disableCanvasRotation, l(e3, ["scale", "rotate", "image", "border", "borderRadius", "width", "height", "position", "color", "backgroundColor", "style", "crossOrigin", "onLoadFailure", "onLoadSuccess", "onImageReady", "onImageChange", "onMouseUp", "onMouseMove", "onPositionChange", "disableBoundaryChecks", "disableHiDPIScaling", "disableCanvasRotation"])), n3 = this.getDimensions(), a3 = { width: n3.canvas.width, height: n3.canvas.height, cursor: this.state.drag ? "grabbing" : "grab", touchAction: "none" }, r3 = { width: n3.canvas.width * P, height: n3.canvas.height * P, style: y(y({}, a3), t3) };
        return r3[I.react.down] = this.handleMouseDown, w && (r3[I.react.mouseDown] = this.handleMouseDown), i.default.createElement("canvas", u({ ref: this.setCanvas }, r3, o2));
      } }]) && r2(e2.prototype, t2), a2;
    }();
    return s(x, "propTypes", { scale: n.default.number, rotate: n.default.number, image: n.default.oneOfType([n.default.string].concat(function(e2) {
      if (Array.isArray(e2)) return f(e2);
    }(b = M ? [n.default.instanceOf(File)] : []) || function(e2) {
      if ("undefined" != typeof Symbol && Symbol.iterator in Object(e2)) return Array.from(e2);
    }(b) || g(b) || function() {
      throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }())), border: n.default.oneOfType([n.default.number, n.default.arrayOf(n.default.number)]), borderRadius: n.default.number, width: n.default.number, height: n.default.number, position: n.default.shape({ x: n.default.number, y: n.default.number }), color: n.default.arrayOf(n.default.number), backgroundColor: n.default.string, crossOrigin: n.default.oneOf(["", "anonymous", "use-credentials"]), onLoadFailure: n.default.func, onLoadSuccess: n.default.func, onImageReady: n.default.func, onImageChange: n.default.func, onMouseUp: n.default.func, onMouseMove: n.default.func, onPositionChange: n.default.func, disableBoundaryChecks: n.default.bool, disableHiDPIScaling: n.default.bool, disableCanvasRotation: n.default.bool }), s(x, "defaultProps", { scale: 1, rotate: 0, border: 25, borderRadius: 0, width: 200, height: 200, color: [0, 0, 0, 0.5], onLoadFailure: function() {
    }, onLoadSuccess: function() {
    }, onImageReady: function() {
    }, onImageChange: function() {
    }, onMouseUp: function() {
    }, onMouseMove: function() {
    }, onPositionChange: function() {
    }, disableBoundaryChecks: false, disableHiDPIScaling: false, disableCanvasRotation: true }), x;
  });
})(dist);
var distExports = dist.exports;
const ReactAvatarEditor = /* @__PURE__ */ getDefaultExportFromCjs(distExports);
[{
  value: IUserTypeEnum.Contact.toString(),
  label: "Локальный"
}, {
  value: IUserTypeEnum.LDAP.toString(),
  label: "LDAP"
}, {
  value: IUserTypeEnum.SSO.toString(),
  label: "SSO"
}];
const userStatusesOptions = (t) => [{
  label: t("users.actionList.active"),
  value: UserStatusEnum.Active.toString()
}, {
  label: t("users.actionList.locked"),
  value: UserStatusEnum.Ban.toString()
}];
export {
  CreateUserContext as C,
  FilialsControl as F,
  ItemUser$1 as I,
  ReactAvatarEditor as R,
  UsersFilterList$1 as U,
  userStatusesOptions as u
};
//# sourceMappingURL=options-CRIRDAK6.js.map
