import { ToastContainer as I } from "react-toastify";
export * from "react-toastify";
import { jsx as i } from "react/jsx-runtime";
import { Close as E, CheckCircle as z, CloseCircle as B, InfoCircle as A, Forbidden as O } from "@front.zen/icons";
import { chipClasses as M, styled as R, Box as D, alertClasses as b, formLabelClasses as W, outlinedInputClasses as e, touchRippleClasses as v, stepConnectorClasses as l, stepLabelClasses as F, autocompleteClasses as m, inputBaseClasses as H, menuClasses as P, buttonBaseClasses as L, menuItemClasses as S, alpha as _, createTheme as N, IconButton as j } from "@mui/material";
import T from "@mui/icons-material/KeyboardArrowDownRounded";
import { mergeDeepRight as Y } from "ramda";
import { blue as n, green as s, orange as d, red as p } from "@mui/material/colors";
import { Check as K } from "@mui/icons-material";
const X = {
  defaultProps: {
    deleteIcon: /* @__PURE__ */ i(E, {}),
    color: "primary"
  },
  styleOverrides: {
    root: ({ theme: o, ownerState: r }) => ({
      height: r.size === "small" ? 24 : 32,
      [`& .${M.deleteIcon}`]: {
        color: o.palette.neutral[500]
      },
      ...r.variant === "filled" ? {
        color: o.palette.neutral[800],
        backgroundColor: t(o, r, 100),
        "&:hover": {
          backgroundColor: t(o, r, 200)
        },
        ["& .MuiSvgIcon-root"]: {
          color: "#FFFFFF"
        }
      } : {
        backgroundColor: "#FFFFFF",
        borderStyle: "solid",
        borderWidth: "1px",
        borderColor: t(o, r, 500),
        color: t(o, r, 500),
        "&:hover": {
          color: t(o, r, 600),
          borderColor: t(o, r, 600)
        }
      },
      ...r.disabled && {
        color: o.palette.neutral[400],
        backgroundColor: r.variant === "outlined" ? o.palette.neutral[100] : o.palette.neutral[200],
        ...r.variant === "outlined" && {
          border: `1px solid ${o.palette.neutral[300]}`
        }
      }
    })
  }
}, q = ({ active: o, completed: r, className: c }) => /* @__PURE__ */ i(G, { active: o, className: c, children: r ? /* @__PURE__ */ i(K, { className: "stepIcon-check" }) : /* @__PURE__ */ i("div", { className: "stepIcon-circle" }) }), G = R(D)(({ theme: o, active: r }) => ({
  color: r ? o.palette.secondary[500] : o.palette.grey[500],
  display: "flex",
  alignItems: "center",
  "& .stepIcon-check": {
    color: "#ffff",
    backgroundColor: o.palette.primary[500],
    width: 40,
    height: 40,
    padding: 8,
    borderRadius: "50%",
    zIndex: 1
  },
  "& .stepIcon-circle": {
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    width: 40,
    height: 40,
    borderRadius: "50%",
    backgroundColor: "transparent",
    border: "2px solid currentColor",
    zIndex: 1,
    "&::after": {
      position: "absolute",
      content: '""',
      width: r ? 16 : 14,
      height: r ? 16 : 14,
      borderRadius: "50%",
      backgroundColor: "currentColor"
    }
  }
})), J = {
  styleOverrides: {
    tooltip: ({ theme: o, ownerState: r }) => ({
      backgroundColor: o.palette.primary[800],
      borderRadius: 6,
      padding: "4px 8px"
    }),
    arrow: ({ theme: o, ownerState: r }) => ({
      color: o.palette.primary[800]
    })
  }
}, x = {
  50: "#EFF6FF",
  100: "#DBEAFE",
  200: "#BFDBFE",
  300: "#93C5FD",
  400: "#60A5FA",
  500: "#3B82F6",
  600: "#2563EB",
  700: "#1D4ED8",
  800: "#1E40AF",
  900: "#1E3A8A"
}, y = {
  50: "#F0FDF4",
  100: "#DCFCE7",
  200: "#BBF7D0",
  300: "#86EFAC",
  400: "#4ADE80",
  500: "#22C55E",
  600: "#16A34A",
  700: "#15803D",
  800: "#166534",
  900: "#14532D"
}, u = {
  50: "#F8FAFC",
  100: "#F1F5F9",
  200: "#E2E8F0",
  300: "#CBD5E1",
  400: "#94A3B8",
  500: "#64748B",
  600: "#475569",
  700: "#334155",
  800: "#1E293B",
  900: "#0F172A"
}, C = {
  50: "#FEFCE8",
  100: "#FEF3C7",
  200: "#FDE68A",
  300: "#FCD34D",
  400: "#FBBF24",
  500: "#F59E0B",
  600: "#D97706",
  700: "#B45309",
  800: "#92400E",
  900: "#78350F"
}, $ = {
  50: "#FEF2F2",
  100: "#FEE2E2",
  200: "#FECACA",
  300: "#FCA5A5",
  400: "#F87171",
  500: "#EF4444",
  600: "#DC2626",
  700: "#B91C1C",
  800: "#991B1B",
  900: "#7F1D1D"
}, h = {
  50: "#FEFCE8",
  100: "#FEF9C3",
  200: "#FEF08A",
  300: "#FDE047",
  400: "#FACC15",
  500: "#EAB308",
  600: "#CA8A04",
  700: "#A16207",
  800: "#854D0E",
  900: "#713F12"
}, Q = {
  grey: u,
  primary: {
    ...x,
    dark: x[600],
    main: x[500],
    light: x[400],
    contrastText: "#fff"
  },
  secondary: {
    ...C,
    dark: C[600],
    main: C[500],
    light: C[400],
    contrastText: "#fff"
  },
  neutral: {
    ...u,
    dark: u[600],
    main: u[500],
    light: u[400],
    contrastText: "#fff"
  },
  error: {
    ...$,
    dark: $[600],
    main: $[500],
    light: $[400],
    contrastText: "#fff"
  },
  warning: {
    ...h,
    dark: h[600],
    main: h[500],
    light: h[400],
    contrastText: "#fff"
  },
  success: {
    ...y,
    dark: y[600],
    main: y[500],
    light: y[400],
    contrastText: "#fff"
  }
}, U = {
  fontFamily: "IRANYekanX, roboto",
  h1: {
    fontWeight: 800,
    fontSize: "2rem",
    // 32px
    lineHeight: 1.5
  },
  h2: {
    fontWeight: 800,
    fontSize: "1.5rem",
    // 24px
    lineHeight: 1.5
  },
  h3: {
    fontWeight: 700,
    fontSize: "1.25rem",
    // 20px
    lineHeight: 1.5
  },
  h4: {
    fontWeight: 500,
    fontSize: "1.125rem",
    // 18px
    lineHeight: 1.5
  },
  h5: {
    fontWeight: 700,
    fontSize: "1rem",
    // 16px
    lineHeight: 1.5
  },
  h6: {
    fontWeight: 700,
    fontSize: "0.875rem",
    // 14px
    lineHeight: 1.5
  },
  button: {
    fontWeight: 500,
    fontSize: "1rem",
    // 16px
    lineHeight: 1.25
  },
  body1: {
    fontWeight: 400,
    fontSize: "1rem",
    // 16px
    lineHeight: 1.75
  },
  body2: {
    fontWeight: 400,
    fontSize: "0.875rem",
    // 14px
    lineHeight: 1.75
  },
  caption: {
    fontWeight: 400,
    fontSize: "0.75rem",
    // 12px
    lineHeight: 1.5
  },
  overline: {
    fontWeight: 300,
    fontSize: "0.75rem",
    // 12px
    lineHeight: 1.5
  }
}, f = {
  default: /* @__PURE__ */ i(z, {}),
  success: /* @__PURE__ */ i(z, {}),
  error: /* @__PURE__ */ i(B, {}),
  info: /* @__PURE__ */ i(A, {}),
  warning: /* @__PURE__ */ i(O, {})
}, g = {
  small: "8px",
  medium: "10px"
}, V = {
  palette: Q,
  direction: "rtl",
  typography: U,
  shape: {
    borderRadius: 12
  },
  components: {
    MuiCssBaseline: {
      styleOverrides: (o) => `
      .Toastify__toast-container {
      }
  
      .Toastify__toast {
        padding: 0 6px 0 16px;
        border-radius: ${o.shape.borderRadius}px;
        min-width: 320px;
        box-shadow:${o.shadows[12]}
      }
  
      .Toastify__toast-body {
        font-size: ${o.typography.caption.fontSize};
        font-weight: ${o.typography.caption.fontWeight};
        font-family:${o.typography.fontFamily};
      }
     
      .Toastify__progress-bar {
      }
  
      .Toastify__close-button {
        color: ${o.palette.neutral[700]};
        padding-top:6px;
      }
  
      .Toastify__toast-icon {
        width:unset;
        padding : 8px;
        border-radius: 100%;
      }

      .Toastify__toast-container .Toastify__toast-theme--colored {
        color: ${o.palette.neutral[800]};
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--info {
        background: ${n[100]};
        .Toastify__toast-icon {
          background : ${n[50]};
        }
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--success {
        background: ${s[100]};
        .Toastify__toast-icon {
          background : ${s[50]};
        }
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--warning {
        background: ${d[100]};
        .Toastify__toast-icon {
          background : ${d[50]};
        }
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--error {
        background: ${p[100]};
        .Toastify__toast-icon {
          background : ${p[50]};
        }
      }
      `
    },
    MuiAlert: {
      defaultProps: {
        iconMapping: {
          error: f.error,
          warning: f.warning,
          info: f.info,
          success: f.success
        }
      },
      styleOverrides: {
        root: {
          padding: "8px 16px"
        },
        icon: {
          padding: 0
        },
        message: {
          padding: 0
        },
        standardInfo: {
          background: n[50],
          border: `1px solid ${n[200]}`,
          color: n[900],
          [`& .${b.icon}`]: {
            color: n[900]
          }
        },
        standardSuccess: {
          background: s[50],
          border: `1px solid ${s[200]}`,
          color: s[900],
          [`& .${b.icon}`]: {
            color: s[900]
          }
        },
        standardWarning: {
          background: d[50],
          border: `1px solid ${d[200]}`,
          color: d[900],
          [`& .${b.icon}`]: {
            color: d[900]
          }
        },
        standardError: {
          background: p[50],
          border: `1px solid ${p[200]}`,
          color: p[900],
          [`& .${b.icon}`]: {
            color: p[900]
          }
        }
      }
    },
    MuiRadio: {
      styleOverrides: {
        root: ({ ownerState: o }) => ({
          "& .MuiSvgIcon-root": {
            fontSize: o.size === "small" ? 16 : 20
          }
        })
      }
    },
    MuiCheckbox: {
      defaultProps: {
        size: "small"
      }
    },
    MuiFormLabel: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          fontSize: "0.875rem",
          [`&.${W.disabled}`]: {
            color: o.palette.neutral[400]
          }
        })
      }
    },
    MuiInputBase: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          backgroundColor: "#fff",
          [`&.${e.root}.${e.disabled}`]: {
            background: o.palette.neutral[100],
            [`&.${e.notchedOutline}`]: {
              borderColor: o.palette.neutral[200]
            }
          },
          [`&.${e.root}.${e.disabled}:hover .${e.notchedOutline}`]: {
            borderColor: "unset"
          }
        }),
        disabled: ({ theme: o }) => ({
          backgroundColor: o.palette.neutral[100]
        })
      }
    },
    MuiIconButton: {
      styleOverrides: {
        root: ({ theme: o, ownerState: r }) => ({
          borderRadius: o.shape.borderRadius,
          [`& .${v.root} .${v.child}`]: {
            borderRadius: o.shape.borderRadius
          },
          ...r.size === "small" && {
            padding: 4
          }
        })
      }
    },
    MuiButton: {
      styleOverrides: {
        root: ({ ownerState: o, theme: r }) => ({
          ...o.size === "small" && {
            padding: "5px 10px"
          },
          ...o.size === "medium" && {
            padding: "8px 16px"
          },
          ...o.size === "large" && {
            padding: "11px 22px"
          },
          ...o.variant === "text" && o.size === "small" && {
            padding: 5
          },
          ...o.variant === "text" && o.size === "medium" && {
            padding: 8
          },
          ...o.variant === "text" && o.size === "large" && {
            padding: 11
          },
          //outlined buttons have 1px border. so we should decrement padding in all sizes by one.
          ...o.variant === "outlined" && o.size === "small" && {
            padding: "4px 9px"
          },
          ...o.variant === "outlined" && o.size === "medium" && {
            padding: "7px 15px"
          },
          ...o.variant === "outlined" && o.size === "large" && {
            padding: "10px 21px"
          },
          // semiFill variant
          ...o.variant === "semiFill" && {
            backgroundColor: t(r, o, 100),
            color: t(r, o, 500),
            "&:hover": {
              backgroundColor: t(r, o, 200),
              color: t(r, o, 600)
            },
            "&:focus": {
              backgroundColor: t(r, o, 50),
              color: t(r, o, 400)
            },
            ...o.disabled && {
              backgroundColor: r.palette.grey[100],
              color: r.palette.grey[300]
            }
          }
        })
      }
    },
    MuiSelect: {
      defaultProps: {
        IconComponent: T
      }
    },
    MuiStepper: {
      defaultProps: { alternativeLabel: !0 },
      styleOverrides: {
        root: ({ theme: o, ownerState: r }) => ({
          [`& :nth-of-type(${(r.activeStep || 0) + 2})`]: {
            [`& .${l.line}`]: {
              borderImageSource: `linear-gradient(90deg, ${o.palette.grey[400]} 0%,  ${o.palette.secondary[500]} 100%)`
            }
          }
        })
      }
    },
    MuiStepConnector: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          [`&.${l.alternativeLabel}`]: {
            top: 19
          },
          [`&.${l.active}`]: {
            [`& .${l.line}`]: {
              borderImageSource: `linear-gradient(90deg, ${o.palette.secondary[500]} 0%, ${o.palette.primary[500]} 100%);`
            }
          },
          [`&.${l.completed}`]: {
            [`& .${l.line}`]: {
              borderColor: o.palette.primary[500]
            }
          }
        }),
        line: () => ({
          borderRadius: 1,
          borderTopWidth: 2,
          borderImageSlice: 1
        })
      }
    },
    MuiStepLabel: {
      styleOverrides: {
        labelContainer: ({ theme: o }) => ({
          [`& .${F.label}`]: {
            [`&.${F.active}`]: {
              color: o.palette.secondary[500],
              fontWeight: o.typography.fontWeightBold
            },
            [`&.${F.completed}`]: {
              color: o.palette.primary[500]
            }
          }
        })
      },
      defaultProps: {
        StepIconComponent: q
      }
    },
    MuiInputLabel: {
      styleOverrides: {
        root: ({ ownerState: o }) => ({
          fontSize: o.size === "small" ? "0.875rem" : "1rem",
          transform: o.size === "small" ? "translate(14px, 10px) scale(1)" : "translate(14px, 12px) scale(1)"
        }),
        shrink: {
          // Change the transform value when the input is focused or filled
          transform: "translate(14px, -6px) scale(0.75)",
          fontSize: "0.875rem"
        }
      }
    },
    MuiAutocomplete: {
      defaultProps: {
        size: "small",
        popupIcon: /* @__PURE__ */ i(T, {})
      },
      styleOverrides: {
        root: {
          // TODO write comment
          [`& .${e.root}`]: {
            padding: "8px",
            [`& .${m.input}`]: {
              padding: `calc(${g.medium} - 11px) 8px calc(${g.medium} - 11px) 5px`
            },
            [`&.${H.sizeSmall} .${m.input}`]: {
              padding: `calc(${g.small} - 8px) 8px calc(${g.small} - 8px) 8px`
            }
          }
        },
        paper: {
          [`&.${m.paper}`]: {
            marginTop: "4px"
          }
        },
        listbox: ({ theme: o, ownerState: r }) => ({
          [`& .${m.option}`]: {
            padding: "4px 16px",
            margin: "8px 8px",
            fontSize: r.size === "small" ? "0.875rem" : "1rem",
            color: o.palette.neutral[600],
            borderRadius: o.shape.borderRadius,
            ['&[aria-selected="true"]']: {
              background: o.palette.primary[50],
              color: o.palette.primary[500]
            }
          }
        }),
        input: ({ ownerState: o }) => ({
          fontSize: o.size === "small" ? "0.875rem" : "1rem"
        })
      }
    },
    MuiChip: X,
    MuiTooltip: J,
    MuiList: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          [`&.${P.list}`]: {
            padding: "12px 8px",
            [`& .${L.root}.${S.root}`]: {
              padding: "4px 8px",
              marginBottom: 4,
              color: o.palette.neutral[600],
              borderRadius: o.shape.borderRadius,
              ['&[aria-selected="true"]']: {
                background: o.palette.primary[50],
                color: o.palette.primary[500]
              }
            }
          }
        })
      }
    },
    MuiOutlinedInput: {
      styleOverrides: {
        input: ({ ownerState: o }) => ({
          height: "2em",
          ...!o.multiline && {
            padding: `${g[o.size || "medium"]} 14px`
          }
        }),
        error: ({ theme: o }) => ({
          backgroundColor: o.palette.error[50],
          borderRadius: o.shape.borderRadius,
          borderColor: o.palette.error.main
        }),
        root: ({ theme: o, ownerState: r }) => ({
          lineHeight: "2em",
          fontSize: r.size === "small" ? "0.75rem" : "0.875rem",
          [`& .${e.notchedOutline}`]: {
            fontSize: "0.875rem",
            borderColor: o.palette.neutral[500],
            "& legend": {
              visibility: "visible",
              background: "#fff"
            }
          },
          [`&:not(.${e.error}):hover .${e.notchedOutline}`]: {
            borderColor: t(o, r, "main")
          },
          [`&.${e.focused} .${e.notchedOutline}`]: {
            borderWidth: "1px",
            borderColor: t(o, r, "main"),
            boxShadow: `0 0 8px 0 ${_(t(o, r, "main"), 0.2)}`
          },
          [`&.${e.focused}&.${e.error} .${e.notchedOutline}`]: {
            borderColor: o.palette.error.main,
            boxShadow: `0 0 8px 0 ${_(o.palette.error.main, 0.1)}`
          }
        })
      }
    },
    MuiPaginationItem: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          width: "32px",
          backgroundColor: o.palette.grey[100],
          borderRadius: o.spacing(1.5),
          "&:hover": {
            backgroundColor: o.palette.primary[100]
          },
          "&.Mui-selected , &.Mui-selected:hover": {
            backgroundColor: o.palette.primary[400],
            color: o.palette.common.white
          },
          "&.MuiPaginationItem-ellipsis": {
            backgroundColor: "inherit"
          }
        })
      }
    }
  }
};
function no(o = {}, ...r) {
  const c = Y(V, o), a = N(c, ...r);
  return a.shadows = Z(a.shadows), a;
}
const Z = (o) => Object.assign(o, {
  2: "0px 1px 2px 0px rgba(0,0,0,0.10)",
  // Raised
  8: "0px 4px 8px 0px rgba(0,0,0,0.10)",
  // Overlay
  12: "0px 6px 12px 0px rgba(0,0,0,0.10)",
  // Sticky Nav
  16: "0px 8px 16px 0px rgba(0,0,0,0.10)",
  // Temporary Nav
  24: "0px 12px 24px 0px rgba(0,0,0,0.10)"
  // Pop out
}), t = (o, r, c = "main") => {
  var k;
  const { color: a = "primary" } = r;
  return (k = o.palette) == null ? void 0 : k[a === "inherit" ? "primary" : a === "default" ? "neutral" : a][c];
}, so = (o) => /* @__PURE__ */ i(
  I,
  {
    icon: (r) => f[r.type],
    theme: "colored",
    rtl: !0,
    hideProgressBar: !0,
    position: "bottom-right",
    closeButton: (r) => /* @__PURE__ */ i("div", { className: "Toastify__close-button", children: /* @__PURE__ */ i(j, { size: "small", sx: { color: "inherit" }, onClick: r.closeToast, children: /* @__PURE__ */ i(E, {}) }) }),
    ...o
  }
);
export {
  so as ToastContainer,
  no as createTheme,
  f as icons,
  Q as palette
};
