import '@das-fed/ui/packages/components/alert/style.css';
import { defineComponent as f, ref as t, computed as m, watch as p, onBeforeUnmount as F, createElementBlock as v, openBlock as b, normalizeStyle as y, normalizeClass as $, createVNode as g, unref as k, mergeProps as T, createSlots as h, withCtx as s, renderSlot as l } from "vue";
import { withInstall as A } from "@das-fed/utils/with-install/index";
import { Alert as w } from "ant-design-vue";
import "ant-design-vue/es/alert/style/css";
import { setThemeRule as B } from "@das-fed/web/packages/theme/index";
import "@das-fed/ui/packages/global/theme";
const C = {
  name: "DasAlert"
}, D = /* @__PURE__ */ f({
  ...C,
  props: {
    left: { default: 0 },
    top: { default: 0 },
    banner: { type: Boolean, default: !1 },
    delayOffTime: { default: 0 }
  },
  setup(n) {
    const o = n, i = t(null), a = t(!1), r = t(null), d = m(() => ({
      position: o.banner ? "fixed" : "unset",
      left: o.left ? o.left + "px" : "0",
      top: o.top ? o.top + "px" : "0"
    }));
    p(
      () => o.delayOffTime,
      (e, c) => {
        e ? u(e) : a.value = !1;
      },
      { immediate: !0 }
    );
    function u(e) {
      r.value = setTimeout(() => {
        a.value = !0;
      }, e);
    }
    return F(() => {
      window.clearTimeout(r.value);
    }), (e, c) => (b(), v(
      "div",
      {
        ref_key: "_dasAlert",
        ref: i,
        class: $({ "das-ui-alert-container": !0, "leave-class": a.value }),
        style: y(d.value)
      },
      [
        g(k(w), T({ class: "das-ui-alert" }, e.$attrs, { banner: e.banner }), h({
          default: s(() => [
            l(e.$slots, "default")
          ]),
          _: 2
          /* DYNAMIC */
        }, [
          e.$slots.description ? {
            name: "description",
            fn: s(() => [
              l(e.$slots, "description")
            ]),
            key: "0"
          } : void 0,
          e.$slots.icon ? {
            name: "icon",
            fn: s(() => [
              l(e.$slots, "icon")
            ]),
            key: "1"
          } : void 0,
          e.$slots.message ? {
            name: "message",
            fn: s(() => [
              l(e.$slots, "message")
            ]),
            key: "2"
          } : void 0,
          e.$slots.closeText ? {
            name: "closeText",
            fn: s(() => [
              l(e.$slots, "closeText")
            ]),
            key: "3"
          } : void 0,
          e.$slots.closeIcon ? {
            name: "closeIcon",
            fn: s(() => [
              l(e.$slots, "closeIcon")
            ]),
            key: "4"
          } : void 0
        ]), 1040, ["banner"])
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), E = {
  "--das-ui-alert-success-bd-color": "#DCFAE4",
  "--das-ui-alert-success-bg-color": "#F2FFF5",
  "--das-ui-alert-info-bg-color": "#F2F9FF",
  "--das-ui-alert-info-bd-color": "#E0EFFF",
  "--das-ui-alert-warning-bg-color": "#FFFBF2",
  "--das-ui-alert-warning-bd-color": "#FFF1D4",
  "--das-ui-alert-error-bg-color": "#FFF2F4",
  "--das-ui-alert-error-bd-color": "#FFDBE0",
  "--das-ui-alert-close-hover-color": "#87adff"
};
B(E);
const L = () => t(null), N = A(D);
export {
  N as DasAlert,
  L as DasAlertRef,
  N as default
};
