import { reactive, defineComponent, ref, computed, watchEffect, createVNode, mergeProps, h as h$1, toRaw, onMounted, onUnmounted, Fragment, nextTick, isVNode, cloneVNode, createApp } from 'vue';

const y = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, g = { LIGHT: "light", DARK: "dark", COLORED: "colored", AUTO: "auto" }, E = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, S = { dangerouslyHTMLString: false, multiple: true, position: y.TOP_RIGHT, autoClose: 5e3, transition: "bounce", hideProgressBar: false, pauseOnHover: true, pauseOnFocusLoss: true, closeOnClick: true, className: "", bodyClassName: "", style: {}, progressClassName: "", progressStyle: {}, role: "alert", theme: "light" }, C = { ...S, rtl: false, newestOnTop: false, toastClassName: "" };
var _ = ((e2) => (e2[e2.COLLAPSE_DURATION = 300] = "COLLAPSE_DURATION", e2[e2.DEBOUNCE_DURATION = 50] = "DEBOUNCE_DURATION", e2.CSS_NAMESPACE = "Toastify", e2))(_ || {}), T = ((e2) => (e2.ENTRANCE_ANIMATION_END = "d", e2))(T || {});
const A = { enter: "Toastify--animate Toastify__bounce-enter", exit: "Toastify--animate Toastify__bounce-exit", appendPosition: true }, h = { enter: "Toastify--animate Toastify__slide-enter", exit: "Toastify--animate Toastify__slide-exit", appendPosition: true }, I = { enter: "Toastify--animate Toastify__zoom-enter", exit: "Toastify--animate Toastify__zoom-exit" }, N = { enter: "Toastify--animate Toastify__flip-enter", exit: "Toastify--animate Toastify__flip-exit" }, L = "Toastify--animate Toastify__none-enter";
function O(e2, t2 = false) {
  var n2;
  let o2 = A;
  if (e2 && "string" != typeof e2) o2 = e2;
  else switch (e2) {
    case "flip":
      o2 = N;
      break;
    case "zoom":
      o2 = I;
      break;
    case "slide":
      o2 = h;
  }
  if (t2) o2.enter = L;
  else if (o2.enter === L) {
    const e3 = null == (n2 = o2.exit.split("__")[1]) ? undefined : n2.split("-")[0];
    o2.enter = `Toastify--animate Toastify__${e3}-enter`;
  }
  return o2;
}
const b = "will-unmount";
function P(e2) {
  var t2;
  const { position: n2, containerClassName: o2, rtl: i2 = false, style: a2 = {} } = e2, s2 = _.CSS_NAMESPACE, r2 = function(e3 = y.TOP_RIGHT) {
    return `${_.CSS_NAMESPACE}__toast-container--${e3}`;
  }(n2), l2 = (undefined).querySelector(`.${s2}`), d2 = (undefined).querySelector(`.${r2}`), u2 = !(!d2 || null != (t2 = d2.className) && t2.includes(b)), c2 = l2 || (undefined).createElement("div"), p2 = (undefined).createElement("div");
  p2.className = function(e3, t3, n3 = false) {
    const o3 = [`${_.CSS_NAMESPACE}__toast-container`, `${_.CSS_NAMESPACE}__toast-container--${e3}`, n3 ? `${_.CSS_NAMESPACE}__toast-container--rtl` : null].filter(Boolean).join(" ");
    return W(t3) ? t3({ position: e3, rtl: n3, defaultClassName: o3 }) : `${o3} ${t3 || ""}`;
  }(n2, o2, i2), p2.dataset.testid = `${_.CSS_NAMESPACE}__toast-container--${n2}`, p2.id = function(e3) {
    return e3.containerId || String(e3.position);
  }(e2);
  for (const f2 in a2) if (Object.prototype.hasOwnProperty.call(a2, f2)) {
    const e3 = a2[f2];
    p2.style[f2] = e3;
  }
  return l2 || (c2.className = _.CSS_NAMESPACE, (undefined).body.appendChild(c2)), u2 || c2.appendChild(p2), p2;
}
function q(e2) {
  var t2, n2, o2;
  const i2 = "string" == typeof e2 ? e2 : (null == (t2 = e2.currentTarget) ? undefined : t2.id) || (null == (n2 = e2.target) ? undefined : n2.id), a2 = (undefined).getElementById(i2);
  a2 && a2.removeEventListener("animationend", q, false);
  try {
    $[i2].unmount(), null == (o2 = (void 0).getElementById(i2)) || o2.remove(), delete $[i2], delete D[i2];
  } catch {
  }
}
const $ = reactive({});
function B(e2, t2 = true) {
  const n2 = String(e2);
  if (!$[n2]) return;
  const o2 = (undefined).getElementById(n2);
  o2 && o2.classList.add(b), t2 ? (function(e3) {
    for (const t3 in D) if (t3 === e3) for (const e4 of D[t3] || []) M(e4);
  }(e2), o2 && o2.addEventListener("animationend", q, false)) : q(n2), U.items = U.items.filter((t3) => t3.containerId !== e2);
}
function M(e2, t2) {
  const n2 = (undefined).getElementById(e2.toastId);
  if (n2) {
    let o2 = e2;
    o2 = { ...o2, ...O(o2.transition) };
    const i2 = o2.appendPosition ? `${o2.exit}--${o2.position}` : o2.exit;
    n2.className += ` ${i2}`, t2 && t2(n2);
  }
}
function R(e2) {
  return (undefined).getElementById(e2);
}
function F(e2) {
  var t2;
  const n2 = isVNode(e2.content) ? toRaw(e2.content.props) : null;
  return null != n2 ? n2 : toRaw(null != (t2 = e2.data) ? t2 : {});
}
const D = reactive({}), U = reactive({ items: [] });
function k() {
  const e2 = toRaw(D);
  return Object.values(e2).reduce((e3, t2) => [...e3, ...t2], []);
}
function x(e2, t2 = {}) {
  if (function(e3) {
    const t3 = R(e3.containerId);
    return t3 && t3.classList.contains(b);
  }(t2)) {
    const n2 = R(t2.containerId);
    n2 && n2.addEventListener("animationend", H.bind(null, e2, t2), false);
  } else H(e2, t2);
}
function H(e2, t2 = {}) {
  const n2 = R(t2.containerId);
  n2 && n2.removeEventListener("animationend", H.bind(null, e2, t2), false);
  const i2 = D[t2.containerId] || [], a2 = i2.length > 0;
  if (!a2 && !function(e3 = y.TOP_RIGHT) {
    return !!(undefined).querySelector(`.${_.CSS_NAMESPACE}__toast-container--${e3}`);
  }(t2.position)) {
    const e3 = P(t2), n3 = createApp(se, t2);
    t2.useHandler && t2.useHandler(n3), n3.mount(e3), function(e4, t3) {
      const n4 = (undefined).getElementById(String(t3));
      n4 && ($[n4.id] = e4);
    }(n3, e3.id);
  }
  a2 && !t2.updateId && (t2.position = i2[0].position), nextTick(() => {
    t2.updateId ? z.update(t2) : z.add(e2, t2);
  });
}
const z = { add(e2, t2) {
  const { containerId: n2 = "" } = t2;
  n2 && (D[n2] = D[n2] || [], D[n2].find((e3) => e3.toastId === t2.toastId) || setTimeout(() => {
    var e3, o2;
    t2.newestOnTop ? null == (e3 = D[n2]) || e3.unshift(t2) : null == (o2 = D[n2]) || o2.push(t2), t2.onOpen && t2.onOpen(F(t2));
  }, t2.delay || 0));
}, remove(e2) {
  if (e2) {
    const t2 = function(e3) {
      const t3 = k().find((t4) => t4.toastId === e3);
      return null == t3 ? undefined : t3.containerId;
    }(e2);
    if (t2) {
      const n2 = D[t2];
      let i2 = n2.find((t3) => t3.toastId === e2);
      D[t2] = n2.filter((t3) => t3.toastId !== e2), !D[t2].length && !function(e3) {
        return e3 ? U.items.filter((t3) => t3.containerId === e3).length > 0 : U.items.length > 0;
      }(t2) && B(t2, false), function() {
        if (U.items.length > 0) {
          const e3 = U.items.shift();
          x(null == e3 ? undefined : e3.toastContent, null == e3 ? undefined : e3.toastProps);
        }
      }(), nextTick(() => {
        null != i2 && i2.onClose && (i2.onClose(F(i2)), i2 = undefined);
      });
    }
  }
}, update(e2 = {}) {
  const { containerId: t2 = "" } = e2;
  if (t2 && e2.updateId) {
    D[t2] = D[t2] || [];
    const n2 = D[t2].find((t3) => t3.toastId === e2.toastId), o2 = (null == n2 ? undefined : n2.position) !== e2.position || (null == n2 ? undefined : n2.transition) !== e2.transition, i2 = { ...e2, disabledEnterTransition: !o2, updateId: undefined };
    z.dismissForce(null == e2 ? undefined : e2.toastId), setTimeout(() => {
      pe(i2.content, i2);
    }, e2.delay || 0);
  }
}, clear(e2, t2 = true) {
  e2 ? B(e2, t2) : function(e3) {
    for (const t3 in $) B(t3, e3);
    U.items = [];
  }(t2);
}, dismissCallback(e2) {
  var t2;
  const n2 = null == (t2 = e2.currentTarget) ? undefined : t2.id, o2 = (undefined).getElementById(n2);
  o2 && (o2.removeEventListener("animationend", z.dismissCallback, false), setTimeout(() => {
    z.remove(n2);
  }));
}, dismiss(e2) {
  if (e2) {
    const t2 = k();
    for (const n2 of t2) if (n2.toastId === e2) {
      M(n2, (e3) => {
        e3.addEventListener("animationend", z.dismissCallback, false);
      });
      break;
    }
  }
}, dismissForce(e2) {
  if (e2) {
    const t2 = k();
    for (const n2 of t2) if (n2.toastId === e2) {
      const t3 = (undefined).getElementById(e2);
      t3 && (t3.remove(), t3.removeEventListener("animationend", z.dismissCallback, false), z.remove(e2));
      break;
    }
  }
} };
reactive({ useHandler: undefined });
const j = reactive({}), w = reactive({});
function G() {
  return Math.random().toString(36).substring(2, 9);
}
function K(e2) {
  return "string" == typeof e2;
}
function W(e2) {
  return "function" == typeof e2;
}
function X(...e2) {
  return mergeProps(...e2);
}
function Y(e2) {
  return !!("object" == typeof e2 && (null != e2 && e2.render || null != e2 && e2.setup || "object" == typeof (null == e2 ? undefined : e2.type)));
}
var Z = ((e2) => (e2[e2.Enter = 0] = "Enter", e2[e2.Exit = 1] = "Exit", e2))(Z || {});
const J = { containerId: { type: [String, Number], required: false, default: "" }, clearOnUrlChange: { type: Boolean, required: false, default: true }, disabledEnterTransition: { type: Boolean, required: false, default: false }, dangerouslyHTMLString: { type: Boolean, required: false, default: false }, multiple: { type: Boolean, required: false, default: true }, limit: { type: Number, required: false, default: undefined }, position: { type: String, required: false, default: y.TOP_LEFT }, bodyClassName: { type: String, required: false, default: "" }, autoClose: { type: [Number, Boolean], required: false, default: false }, closeButton: { type: [Boolean, Function, Object], required: false, default: undefined }, transition: { type: [String, Object], required: false, default: "bounce" }, hideProgressBar: { type: Boolean, required: false, default: false }, pauseOnHover: { type: Boolean, required: false, default: true }, pauseOnFocusLoss: { type: Boolean, required: false, default: true }, closeOnClick: { type: Boolean, required: false, default: true }, progress: { type: Number, required: false, default: undefined }, progressClassName: { type: String, required: false, default: "" }, toastStyle: { type: Object, required: false, default: () => ({}) }, progressStyle: { type: Object, required: false, default: () => ({}) }, role: { type: String, required: false, default: "alert" }, theme: { type: String, required: false, default: g.AUTO }, content: { type: [String, Object, Function], required: false, default: "" }, toastId: { type: [String, Number], required: false, default: "" }, data: { type: [Object, String], required: false, default: () => ({}) }, type: { type: String, required: false, default: E.DEFAULT }, icon: { type: [Boolean, String, Number, Object, Function], required: false, default: undefined }, delay: { type: Number, required: false, default: undefined }, onOpen: { type: Function, required: false, default: undefined }, onClose: { type: Function, required: false, default: undefined }, onClick: { type: Function, required: false, default: undefined }, isLoading: { type: Boolean, required: false, default: undefined }, rtl: { type: Boolean, required: false, default: false }, toastClassName: { type: String, required: false, default: "" }, updateId: { type: [String, Number], required: false, default: "" }, contentProps: { type: Object, required: false, default: null }, expandCustomProps: { type: Boolean, required: false, default: false } }, Q = defineComponent({ name: "ProgressBar", props: { autoClose: { type: [Number, Boolean], required: true }, isRunning: { type: Boolean, required: false, default: undefined }, type: { type: String, required: false, default: E.DEFAULT }, theme: { type: String, required: false, default: g.AUTO }, hide: { type: Boolean, required: false, default: undefined }, className: { type: [String, Function], required: false, default: "" }, controlledProgress: { type: Boolean, required: false, default: undefined }, rtl: { type: Boolean, required: false, default: undefined }, isIn: { type: Boolean, required: false, default: undefined }, progress: { type: Number, required: false, default: undefined }, closeToast: { type: Function, required: false, default: undefined } }, setup(e2, { attrs: t2 }) {
  const o2 = ref(), i2 = computed(() => e2.hide ? "true" : "false"), a2 = computed(() => ({ ...t2.style || {}, animationDuration: `${true === e2.autoClose ? 5e3 : e2.autoClose}ms`, animationPlayState: e2.isRunning ? "running" : "paused", opacity: e2.hide || false === e2.autoClose ? 0 : 1, transform: e2.controlledProgress ? `scaleX(${e2.progress})` : "none" })), s2 = computed(() => [`${_.CSS_NAMESPACE}__progress-bar`, e2.controlledProgress ? `${_.CSS_NAMESPACE}__progress-bar--controlled` : `${_.CSS_NAMESPACE}__progress-bar--animated`, `${_.CSS_NAMESPACE}__progress-bar-theme--${e2.theme}`, `${_.CSS_NAMESPACE}__progress-bar--${e2.type}`, e2.rtl ? `${_.CSS_NAMESPACE}__progress-bar--rtl` : null].filter(Boolean).join(" ")), r2 = computed(() => `${s2.value} ${(null == t2 ? undefined : t2.class) || ""}`), d2 = () => {
    o2.value && (o2.value.onanimationend = null, o2.value.ontransitionend = null);
  }, u2 = () => {
    e2.isIn && e2.closeToast && false !== e2.autoClose && (e2.closeToast(), d2());
  }, c2 = computed(() => e2.controlledProgress ? null : u2), f2 = computed(() => e2.controlledProgress ? u2 : null);
  return watchEffect(() => {
    o2.value && (d2(), o2.value.onanimationend = c2.value, o2.value.ontransitionend = f2.value);
  }), () => createVNode("div", { ref: o2, role: "progressbar", "aria-hidden": i2.value, "aria-label": "notification timer", class: r2.value, style: a2.value }, null);
} }), V = defineComponent({ name: "CloseButton", inheritAttrs: false, props: { theme: { type: String, required: false, default: g.AUTO }, type: { type: String, required: false, default: g.LIGHT }, ariaLabel: { type: String, required: false, default: "close" }, closeToast: { type: Function, required: false, default: undefined } }, setup: (e2) => () => createVNode("button", { class: `${_.CSS_NAMESPACE}__close-button ${_.CSS_NAMESPACE}__close-button--${e2.theme}`, type: "button", onClick: (t2) => {
  t2.stopPropagation(), e2.closeToast && e2.closeToast(t2);
}, "aria-label": e2.ariaLabel }, [createVNode("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, [createVNode("path", { "fill-rule": "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" }, null)])]) }), ee = ({ theme: e2, type: t2, path: o2, ...i2 }) => createVNode("svg", mergeProps({ viewBox: "0 0 24 24", width: "100%", height: "100%", fill: "colored" === e2 ? "currentColor" : `var(--toastify-icon-color-${t2})` }, i2), [createVNode("path", { d: o2 }, null)]);
const te = { info: function(e2) {
  return createVNode(ee, mergeProps(e2, { path: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }), null);
}, warning: function(e2) {
  return createVNode(ee, mergeProps(e2, { path: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" }), null);
}, success: function(e2) {
  return createVNode(ee, mergeProps(e2, { path: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" }), null);
}, error: function(e2) {
  return createVNode(ee, mergeProps(e2, { path: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }), null);
}, spinner: function() {
  return createVNode("div", { class: `${_.CSS_NAMESPACE}__spinner` }, null);
} };
function ne({ theme: e2, type: t2, isLoading: n2, icon: o2 }) {
  let a2;
  const r2 = !!n2 || "loading" === t2, l2 = { theme: e2, type: t2 };
  if (r2 && (undefined === o2 || "boolean" == typeof o2)) return te.spinner();
  if (false !== o2) {
    if (Y(o2)) a2 = toRaw(o2);
    else if (W(o2)) {
      const e3 = o2;
      l2.type = r2 ? "loading" : t2, a2 = e3(l2), a2 = !a2 && r2 ? te.spinner() : a2;
    } else isVNode(o2) ? a2 = cloneVNode(o2, l2) : K(o2) || function(e3) {
      return "number" == typeof e3 && !isNaN(e3);
    }(o2) ? a2 = o2 : ((e3) => e3 in te)(t2) && (a2 = te[t2](l2));
    return a2;
  }
}
const oe = () => {
};
function ie(t2) {
  const n2 = ref(false), o2 = ref(false), i2 = ref(false), a2 = ref(Z.Enter), s2 = reactive({ ...t2, appendPosition: t2.appendPosition || false, collapse: typeof t2.collapse > "u" || t2.collapse, collapseDuration: t2.collapseDuration || _.COLLAPSE_DURATION }), r2 = s2.done || oe, c2 = computed(() => s2.appendPosition ? `${s2.enter}--${s2.position}` : s2.enter), f2 = computed(() => s2.appendPosition ? `${s2.exit}--${s2.position}` : s2.exit), v2 = computed(() => t2.pauseOnHover ? { onMouseenter: E2, onMouseleave: g2 } : {});
  function y2() {
    return t2.toastRef.value;
  }
  function g2() {
    (!t2.loading.value || undefined === t2.isLoading) && (n2.value = true);
  }
  function E2() {
    n2.value = false;
  }
  return watchEffect(function() {
    if (!y2()) return;
    const e2 = () => {
      const t3 = y2();
      t3.removeEventListener("animationend", e2), s2.collapse ? function(e3, t4, n3 = _.COLLAPSE_DURATION) {
        const { scrollHeight: o3, style: i3 } = e3, a3 = n3;
        requestAnimationFrame(() => {
          i3.minHeight = "initial", i3.height = o3 + "px", i3.transition = `all ${a3}ms`, requestAnimationFrame(() => {
            i3.height = "0", i3.padding = "0", i3.margin = "0", setTimeout(t4, a3);
          });
        });
      }(t3, r2, s2.collapseDuration) : r2();
    };
    o2.value || (i2.value ? e2() : setTimeout(() => {
      const t3 = y2();
      a2.value = Z.Exit, t3 && (t3.className += ` ${f2.value}`, t3.addEventListener("animationend", e2));
    }));
  }), watchEffect(() => {
    const e2 = k();
    o2.value = e2.findIndex((e3) => e3.toastId === s2.toastId) > -1;
  }), watchEffect(() => {
    undefined !== t2.isLoading && (t2.loading.value ? E2() : g2());
  }), onMounted(function() {
    const e2 = c2.value.split(" ");
    y2().addEventListener(T.ENTRANCE_ANIMATION_END, g2, { once: true });
    const n3 = (t3) => {
      const o3 = y2();
      t3.target === o3 && (o3.dispatchEvent(new Event(T.ENTRANCE_ANIMATION_END)), o3.removeEventListener("animationend", n3), o3.removeEventListener("animationcancel", n3), a2.value === Z.Enter && "animationcancel" !== t3.type && o3.classList.remove(...e2));
    };
    t2.pauseOnFocusLoss && ((undefined).hasFocus() || E2(), (undefined).addEventListener("focus", g2), (undefined).addEventListener("blur", E2)), (() => {
      const t3 = y2();
      t3.classList.add(...e2), t3.addEventListener("animationend", n3), t3.addEventListener("animationcancel", n3);
    })();
  }), onUnmounted(() => {
    t2.pauseOnFocusLoss && ((undefined).removeEventListener("focus", g2), (undefined).removeEventListener("blur", E2));
  }), { isIn: o2, isRunning: n2, hideToast: function(e2) {
    e2 && (e2.stopPropagation(), e2.preventDefault()), o2.value = false;
  }, eventHandlers: v2 };
}
const ae = defineComponent({ name: "ToastItem", inheritAttrs: false, props: J, setup(e2) {
  const t2 = ref(), o2 = computed(() => !!e2.isLoading), s2 = computed(() => undefined !== e2.progress && null !== e2.progress), r2 = computed(() => ne(e2)), d2 = computed(() => [`${_.CSS_NAMESPACE}__toast`, `${_.CSS_NAMESPACE}__toast-theme--${e2.theme}`, `${_.CSS_NAMESPACE}__toast--${e2.type}`, e2.rtl ? `${_.CSS_NAMESPACE}__toast--rtl` : undefined, e2.toastClassName || ""].filter(Boolean).join(" ")), { isRunning: u2, isIn: c2, hideToast: m2, eventHandlers: v2 } = ie({ toastRef: t2, loading: o2, done: () => {
    z.remove(e2.toastId);
  }, ...O(e2.transition, e2.disabledEnterTransition), ...e2 });
  return () => createVNode("div", mergeProps({ id: e2.toastId, class: d2.value, style: e2.toastStyle || {}, ref: t2, "data-testid": `toast-item-${e2.toastId}`, onClick: (t3) => {
    e2.closeOnClick && m2(), e2.onClick && e2.onClick(t3);
  } }, v2.value), [createVNode("div", { role: e2.role, "data-testid": "toast-body", class: `${_.CSS_NAMESPACE}__toast-body ${e2.bodyClassName || ""}` }, [null != r2.value && createVNode("div", { "data-testid": `toast-icon-${e2.type}`, class: [`${_.CSS_NAMESPACE}__toast-icon`, e2.isLoading ? "" : `${_.CSS_NAMESPACE}--animate-icon ${_.CSS_NAMESPACE}__zoom-enter`].join(" ") }, [Y(r2.value) ? h$1(toRaw(r2.value), { theme: e2.theme, type: e2.type }) : W(r2.value) ? r2.value({ theme: e2.theme, type: e2.type }) : r2.value]), createVNode("div", { "data-testid": "toast-content" }, [Y(e2.content) ? h$1(toRaw(e2.content), { toastProps: toRaw(e2), closeToast: m2, data: e2.data, ...e2.expandCustomProps ? e2.contentProps : { contentProps: e2.contentProps || {} } }) : W(e2.content) ? e2.content({ toastProps: toRaw(e2), closeToast: m2, data: e2.data }) : e2.dangerouslyHTMLString ? h$1("div", { innerHTML: e2.content }) : e2.content])]), (undefined === e2.closeButton || true === e2.closeButton) && createVNode(V, { theme: e2.theme, closeToast: (e3) => {
    e3.stopPropagation(), e3.preventDefault(), m2();
  } }, null), Y(e2.closeButton) ? h$1(toRaw(e2.closeButton), { closeToast: m2, type: e2.type, theme: e2.theme }) : W(e2.closeButton) ? e2.closeButton({ closeToast: m2, type: e2.type, theme: e2.theme }) : null, createVNode(Q, { className: e2.progressClassName, style: e2.progressStyle, rtl: e2.rtl, theme: e2.theme, isIn: c2.value, type: e2.type, hide: e2.hideProgressBar, isRunning: u2.value, autoClose: e2.autoClose, controlledProgress: s2.value, progress: e2.progress, closeToast: e2.isLoading ? undefined : m2 }, null)]);
} }), se = defineComponent({ name: "ToastifyContainer", inheritAttrs: false, props: J, setup(e2) {
  const t2 = computed(() => e2.containerId), o2 = computed(() => D[t2.value] || []), i2 = computed(() => o2.value.filter((t3) => t3.position === e2.position));
  return onMounted(() => {
  }), onUnmounted(() => {
  }), () => createVNode(Fragment, null, [i2.value.map((e3) => {
    const { toastId: t3 = "" } = e3;
    return createVNode(ae, mergeProps({ key: t3 }, e3), null);
  })]);
} });
let re = false;
const le = { isLoading: true, autoClose: false, closeOnClick: false, closeButton: false, draggable: false };
function de() {
  const e2 = [];
  return k().forEach((t2) => {
    const n2 = (undefined).getElementById(t2.containerId);
    n2 && !n2.classList.contains(b) && e2.push(t2);
  }), e2;
}
function ue(e2) {
  (function(e3) {
    const t2 = de().length, n2 = null != e3 ? e3 : 0;
    return n2 > 0 && t2 + U.items.length >= n2;
  })(e2.limit) && !e2.updateId && U.items.push({ toastId: e2.toastId, containerId: e2.containerId, toastContent: e2.content, toastProps: e2 });
}
function ce(e2, t2, n2 = {}) {
  if (re) return;
  (!(n2 = X(j[`${_.CSS_NAMESPACE}-default-options`] || C, { type: t2 }, toRaw(n2))).toastId || "string" != typeof n2.toastId && "number" != typeof n2.toastId) && (n2.toastId = G()), n2 = { ...n2, ..."loading" === n2.type ? le : {}, content: e2, containerId: n2.containerId || String(n2.position) };
  const o2 = Number(null == n2 ? undefined : n2.progress);
  return !isNaN(o2) && o2 < 0 && (n2.progress = 0), o2 > 1 && (n2.progress = 1), "auto" === n2.theme && (n2.theme = function() {
    const e3 = (undefined).matchMedia && (undefined).matchMedia("(prefers-color-scheme: dark)").matches;
    return (undefined).documentElement.classList.contains("dark") || e3 ? "dark" : "light";
  }()), ue(n2), w.lastUrl = (undefined).location.href, n2.multiple ? U.items.length ? n2.updateId && x(e2, n2) : x(e2, n2) : (re = true, pe.clearAll(undefined, false), setTimeout(() => {
    x(e2, n2);
  }, 0), setTimeout(() => {
    re = false;
  }, 390)), n2.toastId;
}
const pe = (e2, t2) => ce(e2, E.DEFAULT, t2);
pe.info = (e2, t2) => ce(e2, E.DEFAULT, { ...t2, type: E.INFO }), pe.error = (e2, t2) => ce(e2, E.DEFAULT, { ...t2, type: E.ERROR }), pe.warning = (e2, t2) => ce(e2, E.DEFAULT, { ...t2, type: E.WARNING }), pe.warn = pe.warning, pe.success = (e2, t2) => ce(e2, E.DEFAULT, { ...t2, type: E.SUCCESS }), pe.loading = (e2, t2) => ce(e2, E.DEFAULT, X(t2, le)), pe.dark = (e2, t2) => ce(e2, E.DEFAULT, X(t2, { theme: g.DARK })), pe.remove = (e2) => {
  e2 ? z.dismiss(e2) : z.clear();
}, pe.clearAll = (e2, t2) => {
  nextTick(() => {
    z.clear(e2, t2);
  });
}, pe.isActive = (e2) => {
  let t2 = false;
  return t2 = de().findIndex((t3) => t3.toastId === e2) > -1, t2;
}, pe.update = (e2, t2 = {}) => {
  setTimeout(() => {
    const n2 = function(e3) {
      return k().find((t3) => t3.toastId === e3);
    }(e2);
    if (n2) {
      const o2 = toRaw(n2), { content: a2 } = o2, s2 = { ...o2, ...t2, toastId: t2.toastId || e2, updateId: G() }, r2 = s2.render || a2;
      delete s2.render, ce(r2, s2.type, s2);
    }
  }, 0);
}, pe.done = (e2) => {
  pe.update(e2, { isLoading: false, progress: 1 });
}, pe.promise = function(e2, { pending: t2, error: n2, success: o2 }, i2) {
  var a2, s2, r2;
  let l2;
  const d2 = { ...i2 || {}, autoClose: false };
  t2 && (l2 = K(t2) ? pe.loading(t2, d2) : pe.loading(t2.render, { ...d2, ...t2 }));
  const u2 = { autoClose: null == (a2 = null == i2 ? undefined : i2.autoClose) || a2, closeOnClick: null == (s2 = null == i2 ? undefined : i2.closeOnClick) || s2, closeButton: null != (r2 = null == i2 ? undefined : i2.autoClose) ? r2 : null, isLoading: undefined, draggable: null, delay: 100 }, c2 = (e3, t3, n3) => {
    if (null == t3) return void pe.remove(l2);
    const o3 = { type: e3, ...u2, ...i2, data: n3 }, a3 = K(t3) ? { render: t3 } : t3;
    return l2 ? pe.update(l2, { ...o3, ...a3, isLoading: false }) : pe(a3.render, { ...o3, ...a3, isLoading: false }), n3;
  }, p2 = W(e2) ? e2() : e2;
  return p2.then((e3) => {
    c2("success", o2, e3);
  }).catch((e3) => {
    c2("error", n2, e3);
  }), p2;
}, pe.POSITION = y, pe.THEME = g, pe.TYPE = E, pe.TRANSITIONS = { BOUNCE: "bounce", SLIDE: "slide", FLIP: "flip", ZOOM: "zoom", NONE: "none" };

export { pe as p };
//# sourceMappingURL=index-Dj5w-pp2.mjs.map
