import { H as m, I as d, D as u } from "./InfoIcon-c86fd057.mjs";
import { A as a } from "./Alert-1277e378.mjs";
import g from "classnames";
import e from "react";
import { X as f, AlertCircle as p, CheckCircle as h } from "react-feather";
import { B as v, c as w, b as E } from "./Button-c97a7217.mjs";
const N = "alert _alert_d2ea0", B = "messageContainer _messageContainer_f6faf", C = "icon _icon_e9371", k = "close _close_46ec6", y = "success _success_ff70d", A = "danger _danger_73506", I = "info _info_45cec", b = "warning _warning_6de68", D = "help _help_7ffec", T = "withoutBackground _withoutBackground_67988", q = "message _message_99b18", s = {
  alert: N,
  messageContainer: B,
  icon: C,
  close: k,
  success: y,
  danger: A,
  info: I,
  warning: b,
  help: D,
  withoutBackground: T,
  message: q
};
class l extends e.Component {
  render() {
    const { className: _, children: n, type: t, onDismiss: c, dataQa: o = null, dismissDataQa: i = null } = this.props;
    return /* @__PURE__ */ e.createElement("div", { className: g(s.alert, _, t && s[t]), role: "alert", "data-qa-id": o }, /* @__PURE__ */ e.createElement("div", { className: s.messageContainer }, /* @__PURE__ */ e.createElement("span", { className: s.icon }, x(t)), /* @__PURE__ */ e.createElement("span", { className: s.message }, typeof n == "function" ? n() : n)), !!c && /* @__PURE__ */ e.createElement(
      v,
      {
        className: s.close,
        "data-qa-id": i,
        buttonStyle: w.NONE,
        buttonType: E.PLAIN,
        onClick: () => {
          c && c();
        }
      },
      /* @__PURE__ */ e.createElement(f, { size: "1em" })
    ));
  }
}
l.defaultProps = {};
l.className = {
  withoutBackground: s.withoutBackground
};
function x(r) {
  switch (r) {
    case a.success:
      return /* @__PURE__ */ e.createElement(h, null);
    case a.danger:
      return /* @__PURE__ */ e.createElement(u, null);
    case a.warning:
      return /* @__PURE__ */ e.createElement(p, null);
    case a.info:
      return /* @__PURE__ */ e.createElement(d, null);
    case a.help:
      return /* @__PURE__ */ e.createElement(m, null);
    default:
      return null;
  }
}
export {
  l as A,
  x as g
};
