import { H as m, I as d, D as u } from "./InfoIcon-c86fd057.mjs";
import { A as s } from "./Alert-1277e378.mjs";
import g from "classnames";
import e from "react";
import { X as p, AlertCircle as f, CheckCircle as h } from "react-feather";
import { B as v, c as w, b as E } from "./Button-c97a7217.mjs";
const N = "alert _alert_e4894", B = "messageContainer _messageContainer_27781", C = "icon _icon_27ca0", k = "close _close_ef105", y = "success _success_c518e", A = "danger _danger_02413", I = "info _info_8919a", b = "warning _warning_5e1aa", D = "help _help_3a100", T = "withoutBackground _withoutBackground_b7644", q = "message _message_2dd2b", a = {
  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(a.alert, _, t && a[t]), role: "alert", "data-qa-id": o }, /* @__PURE__ */ e.createElement("div", { className: a.messageContainer }, /* @__PURE__ */ e.createElement("span", { className: a.icon }, x(t)), /* @__PURE__ */ e.createElement("span", { className: a.message }, typeof n == "function" ? n() : n)), !!c && /* @__PURE__ */ e.createElement(
      v,
      {
        className: a.close,
        "data-qa-id": i,
        buttonStyle: w.NONE,
        buttonType: E.PLAIN,
        onClick: () => {
          c && c();
        }
      },
      /* @__PURE__ */ e.createElement(p, { size: "1em" })
    ));
  }
}
l.defaultProps = {};
l.className = {
  withoutBackground: a.withoutBackground
};
function x(r) {
  switch (r) {
    case s.success:
      return /* @__PURE__ */ e.createElement(h, null);
    case s.danger:
      return /* @__PURE__ */ e.createElement(u, null);
    case s.warning:
      return /* @__PURE__ */ e.createElement(f, null);
    case s.info:
      return /* @__PURE__ */ e.createElement(d, null);
    case s.help:
      return /* @__PURE__ */ e.createElement(m, null);
    default:
      return null;
  }
}
export {
  l as A,
  x as g
};
