import { jsx as o, jsxs as d } from "react/jsx-runtime";
import { n } from "./index.B0wX8xO7.js";
import { a as f } from "./index.CfQlFjZU.js";
import { c as m } from "./index.CfM2L_w0.js";
import { a as N, D as w, M as C, E as _, F as b } from "./index.dWlEA7uO.js";
const h = "creator_toast_GiGqi", p = "creator_body_VSeQj", M = "creator_icon_Wit-c", g = "creator_closeButton_c7HMj", y = "creator_toast__default_AS4UG", z = "creator_toast__info_KYeOk", j = "creator_toast__success_rVZxb", v = "creator_toast__warning_jlQmw", x = "creator_toast__error_cdEyl", s = { toast: h, body: p, icon: M, closeButton: g, toast__default: y, toast__info: z, toast__success: j, toast__warning: v, toast__error: x };
function B({
  text: a,
  semantic: t = "default",
  showIcon: e = !0,
  dismissible: r = !0,
  onDismiss: c
}) {
  return {
    containerClassName: m(s.toast, {
      [s.toast__default]: t === "default",
      [s.toast__info]: t === "info",
      [s.toast__success]: t === "success",
      [s.toast__warning]: t === "warning",
      [s.toast__error]: t === "error"
    }),
    bodyClassName: s.body,
    closeButtonClassName: s.closeButton,
    text: a,
    showIcon: e,
    icon: {
      default: /* @__PURE__ */ o(_, { size: 24, className: s.icon }),
      info: /* @__PURE__ */ o(_, { size: 24, className: s.icon }),
      success: /* @__PURE__ */ o(
        C,
        {
          "data-testid": "SuccessIcon",
          size: 24,
          className: s.icon
        }
      ),
      warning: /* @__PURE__ */ o(w, { size: 24, className: s.icon }),
      error: /* @__PURE__ */ o(N, { size: 24, className: s.icon })
    }[t],
    showDismiss: r,
    onDismiss: c
  };
}
function k({
  text: a,
  containerClassName: t,
  bodyClassName: e,
  closeButtonClassName: r,
  onDismiss: c,
  showDismiss: i,
  icon: l,
  showIcon: u
}) {
  return /* @__PURE__ */ d("div", { role: "alert", className: t, children: [
    /* @__PURE__ */ o(n, { value: u, then: l }),
    /* @__PURE__ */ o("p", { className: e, children: a }),
    /* @__PURE__ */ o(
      n,
      {
        value: i,
        then: /* @__PURE__ */ o(
          "div",
          {
            role: "button",
            "aria-label": "Close",
            onClick: c,
            className: r,
            children: /* @__PURE__ */ o(b, { size: 24 })
          }
        )
      }
    )
  ] });
}
const D = f(k, B);
export {
  D as T
};
