import { defineComponent as v, computed as g, openBlock as l, createElementBlock as a, normalizeStyle as k, unref as r, normalizeClass as b, renderSlot as t, createBlock as w, createCommentVNode as i, createElementVNode as n, Fragment as B, createVNode as $ } from "vue";
import { useColors as I } from "../../composables/useColors.js";
import { useTheme as C } from "../../composables/useTheme.js";
import { infoIcon as h, successIcon as N, errorIcon as S, warningIcon as V, closeIcon as z } from "../../common/icons.js";
import c from "../icon/Icon.vue.js";
const A = /* @__PURE__ */ n("div", { class: "flex-grow" }, null, -1), E = ["aria-label"], L = ["info", "success", "error", "warning"], T = {
  ...I.props(),
  type: String,
  glow: Boolean,
  light: Boolean,
  outlined: Boolean,
  removable: Boolean,
  closeLabel: String
}, _ = {
  name: "XAlert",
  validators: {
    type: L
  }
}, D = /* @__PURE__ */ v({
  ..._,
  props: T,
  emits: ["remove"],
  setup(m) {
    const o = m, p = g(() => o.type === "info" ? h : o.type === "success" ? N : o.type === "error" ? S : o.type === "warning" ? V : ""), { styles: u, classes: f, className: d } = C("Alert", {}, o);
    return (e, s) => (l(), a("div", {
      style: k(r(u)),
      class: b([
        r(d),
        e.$style.alert,
        e.glow ? e.$style["alert--glow"] : "",
        r(f).wrapper
      ])
    }, [
      t(e.$slots, "icon", {}, () => [
        e.type ? (l(), w(c, {
          key: 0,
          icon: p.value,
          class: "text-[color:var(--x-alert-icon)] dark:text-[color:var(--x-alert-dark-icon)]"
        }, null, 8, ["icon"])) : i("", !0)
      ]),
      n("div", null, [
        t(e.$slots, "default")
      ]),
      e.removable ? (l(), a(B, { key: 0 }, [
        A,
        n("button", {
          type: "button",
          class: "shrink-0",
          "aria-label": e.closeLabel,
          onClick: s[0] || (s[0] = (y) => e.$emit("remove", y))
        }, [
          t(e.$slots, "removeIcon", {}, () => [
            $(c, { icon: r(z) }, null, 8, ["icon"])
          ])
        ], 8, E)
      ], 64)) : i("", !0)
    ], 6));
  }
});
export {
  D as default
};
