File: /home/dmstechonline/whatsapp.dmstech.online/node_modules/.vite/deps/vue3-toastify.js
import "./chunk-QNPQGVCQ.js";
import {
Fragment,
cloneVNode,
computed,
createApp,
createVNode,
defineComponent,
h,
isVNode,
mergeProps,
nextTick,
onMounted,
onUnmounted,
reactive,
ref,
toRaw,
watchEffect
} from "./chunk-GJ2CBTJY.js";
import "./chunk-ROME4SDB.js";
// node_modules/vue3-toastify/dist/index.mjs
var D = {
TOP_LEFT: "top-left",
TOP_RIGHT: "top-right",
TOP_CENTER: "top-center",
BOTTOM_LEFT: "bottom-left",
BOTTOM_RIGHT: "bottom-right",
BOTTOM_CENTER: "bottom-center"
};
var M = {
LIGHT: "light",
DARK: "dark",
COLORED: "colored",
AUTO: "auto"
};
var g = {
INFO: "info",
SUCCESS: "success",
WARNING: "warning",
ERROR: "error",
DEFAULT: "default"
};
var Ne = {
BOUNCE: "bounce",
SLIDE: "slide",
FLIP: "flip",
ZOOM: "zoom"
};
var ce = {
dangerouslyHTMLString: false,
multiple: true,
position: D.TOP_RIGHT,
autoClose: 5e3,
transition: "bounce",
hideProgressBar: false,
pauseOnHover: true,
pauseOnFocusLoss: true,
closeOnClick: true,
className: "",
bodyClassName: "",
style: {},
progressClassName: "",
progressStyle: {},
role: "alert",
theme: "light"
};
var Ie = {
rtl: false,
newestOnTop: false,
toastClassName: ""
};
var fe = {
...ce,
...Ie
};
({
...ce,
type: g.DEFAULT
});
var r = ((e) => (e[e.COLLAPSE_DURATION = 300] = "COLLAPSE_DURATION", e[e.DEBOUNCE_DURATION = 50] = "DEBOUNCE_DURATION", e.CSS_NAMESPACE = "Toastify", e))(r || {});
var J = ((e) => (e.ENTRANCE_ANIMATION_END = "d", e))(J || {});
var _e = {
enter: "Toastify--animate Toastify__bounce-enter",
exit: "Toastify--animate Toastify__bounce-exit",
appendPosition: true
};
var he = {
enter: "Toastify--animate Toastify__slide-enter",
exit: "Toastify--animate Toastify__slide-exit",
appendPosition: true
};
var Oe = {
enter: "Toastify--animate Toastify__zoom-enter",
exit: "Toastify--animate Toastify__zoom-exit"
};
var be = {
enter: "Toastify--animate Toastify__flip-enter",
exit: "Toastify--animate Toastify__flip-exit"
};
function me(e) {
let t = _e;
if (!e || typeof e == "string")
switch (e) {
case "flip":
t = be;
break;
case "zoom":
t = Oe;
break;
case "slide":
t = he;
break;
}
else
t = e;
return t;
}
function Pe(e) {
return e.containerId || String(e.position);
}
var K = "will-unmount";
function Le(e = D.TOP_RIGHT) {
return !!document.querySelector(".".concat(r.CSS_NAMESPACE, "__toast-container--").concat(e));
}
function $e(e = D.TOP_RIGHT) {
return "".concat(r.CSS_NAMESPACE, "__toast-container--").concat(e);
}
function qe(e, t, n = false) {
const a = [
"".concat(r.CSS_NAMESPACE, "__toast-container"),
"".concat(r.CSS_NAMESPACE, "__toast-container--").concat(e),
n ? "".concat(r.CSS_NAMESPACE, "__toast-container--rtl") : null
].filter(Boolean).join(" ");
return B(t) ? t({
position: e,
rtl: n,
defaultClassName: a
}) : "".concat(a, " ").concat(t || "");
}
function Be(e) {
var C;
const { position: t, containerClassName: n, rtl: a = false, style: o = {} } = e, s = r.CSS_NAMESPACE, u = $e(t), E = document.querySelector(".".concat(s)), d = document.querySelector(".".concat(u)), p = !!d && !((C = d.className) != null && C.includes(K)), m = E || document.createElement("div"), S = document.createElement("div");
S.className = qe(
t,
n,
a
), S.dataset.testid = "".concat(r.CSS_NAMESPACE, "__toast-container--").concat(t), S.id = Pe(e);
for (const v in o)
if (Object.prototype.hasOwnProperty.call(o, v)) {
const I = o[v];
S.style[v] = I;
}
return E || (m.className = r.CSS_NAMESPACE, document.body.appendChild(m)), p || m.appendChild(S), S;
}
function ee(e) {
var a, o, s;
const t = typeof e == "string" ? e : ((a = e.currentTarget) == null ? void 0 : a.id) || ((o = e.target) == null ? void 0 : o.id), n = document.getElementById(t);
n && n.removeEventListener("animationend", ee, false);
try {
x[t].unmount(), (s = document.getElementById(t)) == null || s.remove(), delete x[t], delete c[t];
} catch {
}
}
var x = reactive({});
function Me(e, t) {
const n = document.getElementById(String(t));
n && (x[n.id] = e);
}
function te(e, t = true) {
const n = String(e);
if (!x[n])
return;
const a = document.getElementById(n);
a && a.classList.add(K), t ? (Re(e), a && a.addEventListener("animationend", ee, false)) : ee(n), N.items = N.items.filter((o) => o.containerId !== e);
}
function we(e) {
for (const t in x)
te(t, e);
N.items = [];
}
function ge(e, t) {
const n = document.getElementById(e.toastId);
if (n) {
let a = e;
a = {
...a,
...me(a.transition)
};
const o = a.appendPosition ? "".concat(a.exit, "--").concat(a.position) : a.exit;
n.className += " ".concat(o), t && t(n);
}
}
function Re(e) {
for (const t in c)
if (t === e)
for (const n of c[t] || [])
ge(n);
}
function Fe(e) {
const n = k().find((a) => a.toastId === e);
return n == null ? void 0 : n.containerId;
}
function se(e) {
return document.getElementById(e);
}
function Ue(e) {
const t = se(e.containerId);
return t && t.classList.contains(K);
}
function re(e) {
var n;
const t = isVNode(e.content) ? toRaw(e.content.props) : null;
return t != null ? t : toRaw((n = e.data) != null ? n : {});
}
function xe(e) {
return e ? N.items.filter((n) => n.containerId === e).length > 0 : N.items.length > 0;
}
function De() {
if (N.items.length > 0) {
const e = N.items.shift();
j(e == null ? void 0 : e.toastContent, e == null ? void 0 : e.toastProps);
}
}
var c = reactive({});
var N = reactive({
items: []
});
function k() {
const e = toRaw(c);
return Object.values(e).reduce((t, n) => [...t, ...n], []);
}
function ke(e) {
return k().find((n) => n.toastId === e);
}
function j(e, t = {}) {
if (Ue(t)) {
const n = se(t.containerId);
n && n.addEventListener("animationend", ne.bind(null, e, t), false);
} else
ne(e, t);
}
function ne(e, t = {}) {
const n = se(t.containerId);
n && n.removeEventListener("animationend", ne.bind(null, e, t), false);
const a = c[t.containerId] || [], o = a.length > 0;
if (!o && !Le(t.position)) {
const s = Be(t), u = createApp(rt, t);
u.mount(s), Me(u, s.id);
}
o && (t.position = a[0].position), nextTick(() => {
t.updateId ? A.update(t) : A.add(e, t);
});
}
var A = {
/**
* add a toast
* @param _ ..
* @param opts toast props
*/
add(e, t) {
const { containerId: n = "" } = t;
n && (c[n] = c[n] || [], c[n].find((a) => a.toastId === t.toastId) || setTimeout(() => {
var a, o;
t.newestOnTop ? (a = c[n]) == null || a.unshift(t) : (o = c[n]) == null || o.push(t), t.onOpen && t.onOpen(re(t));
}, t.delay || 0));
},
/**
* remove a toast
* @param id toastId
*/
remove(e) {
if (e) {
const t = Fe(e);
if (t) {
const n = c[t];
let a = n.find((o) => o.toastId === e);
c[t] = n.filter((o) => o.toastId !== e), !c[t].length && !xe(t) && te(t, false), De(), nextTick(() => {
a != null && a.onClose && (a.onClose(re(a)), a = void 0);
});
}
}
},
/**
* update the toast
* @param opts toast props
*/
update(e = {}) {
const { containerId: t = "" } = e;
if (t && e.updateId) {
c[t] = c[t] || [];
const n = c[t].find((a) => a.toastId === e.toastId);
n && setTimeout(() => {
for (const a in e)
if (Object.prototype.hasOwnProperty.call(e, a)) {
const o = e[a];
n[a] = o;
}
}, e.delay || 0);
}
},
/**
* clear all toasts in container.
* @param containerId container id
*/
clear(e, t = true) {
e ? te(e, t) : we(t);
},
dismissCallback(e) {
var a;
const t = (a = e.currentTarget) == null ? void 0 : a.id, n = document.getElementById(t);
n && (n.removeEventListener("animationend", A.dismissCallback, false), setTimeout(() => {
A.remove(t);
}));
},
dismiss(e) {
if (e) {
const t = k();
for (const n of t)
if (n.toastId === e) {
ge(n, (a) => {
a.addEventListener("animationend", A.dismissCallback, false);
});
break;
}
}
}
};
var Ce = reactive({});
var Q = reactive({});
function ye() {
return Math.random().toString(36).substring(2, 9);
}
function He(e) {
return typeof e == "number" && !isNaN(e);
}
function ae(e) {
return typeof e == "string";
}
function B(e) {
return typeof e == "function";
}
function Y(...e) {
return mergeProps(...e);
}
function G(e) {
return typeof e == "object" && (!!(e != null && e.render) || !!(e != null && e.setup) || typeof (e == null ? void 0 : e.type) == "object");
}
function ze(e = {}) {
Ce["".concat(r.CSS_NAMESPACE, "-default-options")] = e;
}
function je() {
return Ce["".concat(r.CSS_NAMESPACE, "-default-options")] || fe;
}
function Ge() {
return document.documentElement.classList.contains("dark") ? "dark" : "light";
}
var V = ((e) => (e[e.Enter = 0] = "Enter", e[e.Exit = 1] = "Exit", e))(V || {});
var Ee = {
containerId: {
type: [String, Number],
required: false,
default: ""
},
clearOnUrlChange: {
type: Boolean,
required: false,
default: true
},
dangerouslyHTMLString: {
type: Boolean,
required: false,
default: false
},
multiple: {
type: Boolean,
required: false,
default: true
},
limit: {
type: Number,
required: false,
default: void 0
},
position: {
type: String,
required: false,
default: D.TOP_LEFT
},
bodyClassName: {
type: String,
required: false,
default: ""
},
autoClose: {
type: [Number, Boolean],
required: false,
default: false
},
closeButton: {
type: [Boolean, Function, Object],
required: false,
default: void 0
},
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: void 0
},
progressClassName: {
type: String,
required: false,
default: ""
},
toastStyle: {
type: Object,
required: false,
default() {
return {};
}
},
progressStyle: {
type: Object,
required: false,
default() {
return {};
}
},
role: {
type: String,
required: false,
default: "alert"
},
theme: {
type: String,
required: false,
default: M.AUTO
},
content: {
type: [String, Object, Function],
required: false,
default: ""
},
toastId: {
type: [String, Number],
required: false,
default: ""
},
data: {
type: [Object, String],
required: false,
default() {
return {};
}
},
type: {
type: String,
required: false,
default: g.DEFAULT
},
icon: {
type: [Boolean, String, Number, Object, Function],
required: false,
default: void 0
},
delay: {
type: Number,
required: false,
default: void 0
},
onOpen: {
type: Function,
required: false,
default: void 0
},
onClose: {
type: Function,
required: false,
default: void 0
},
onClick: {
type: Function,
required: false,
default: void 0
},
isLoading: {
type: Boolean,
required: false,
default: void 0
},
rtl: {
type: Boolean,
required: false,
default: false
},
toastClassName: {
type: String,
required: false,
default: ""
},
updateId: {
type: [String, Number],
required: false,
default: ""
}
};
var Ve = {
autoClose: {
type: [Number, Boolean],
required: true
},
isRunning: {
type: Boolean,
required: false,
default: void 0
},
type: {
type: String,
required: false,
default: g.DEFAULT
},
theme: {
type: String,
required: false,
default: M.AUTO
},
hide: {
type: Boolean,
required: false,
default: void 0
},
className: {
type: [String, Function],
required: false,
default: ""
},
controlledProgress: {
type: Boolean,
required: false,
default: void 0
},
rtl: {
type: Boolean,
required: false,
default: void 0
},
isIn: {
type: Boolean,
required: false,
default: void 0
},
progress: {
type: Number,
required: false,
default: void 0
},
closeToast: {
type: Function,
required: false,
default: void 0
}
};
var Qe = defineComponent({
name: "ProgressBar",
props: Ve,
// @ts-ignore
setup(e, {
attrs: t
}) {
const n = ref(), a = computed(() => e.hide ? "true" : "false"), o = computed(() => ({
...t.style || {},
animationDuration: "".concat(e.autoClose === true ? 5e3 : e.autoClose, "ms"),
animationPlayState: e.isRunning ? "running" : "paused",
opacity: e.hide || e.autoClose === false ? 0 : 1,
transform: e.controlledProgress ? "scaleX(".concat(e.progress, ")") : "none"
})), s = computed(() => ["".concat(r.CSS_NAMESPACE, "__progress-bar"), e.controlledProgress ? "".concat(r.CSS_NAMESPACE, "__progress-bar--controlled") : "".concat(r.CSS_NAMESPACE, "__progress-bar--animated"), "".concat(r.CSS_NAMESPACE, "__progress-bar-theme--").concat(e.theme), "".concat(r.CSS_NAMESPACE, "__progress-bar--").concat(e.type), e.rtl ? "".concat(r.CSS_NAMESPACE, "__progress-bar--rtl") : null].filter(Boolean).join(" ")), u = computed(() => "".concat(s.value, " ").concat((t == null ? void 0 : t.class) || "")), E = () => {
n.value && (n.value.onanimationend = null, n.value.ontransitionend = null);
}, d = () => {
e.isIn && e.closeToast && e.autoClose !== false && (e.closeToast(), E());
}, p = computed(() => e.controlledProgress ? null : d), m = computed(() => e.controlledProgress ? d : null);
return watchEffect(() => {
n.value && (E(), n.value.onanimationend = p.value, n.value.ontransitionend = m.value);
}), () => createVNode("div", {
ref: n,
role: "progressbar",
"aria-hidden": a.value,
"aria-label": "notification timer",
class: u.value,
style: o.value
}, null);
}
});
var We = defineComponent({
name: "CloseButton",
inheritAttrs: false,
props: {
theme: {
type: String,
required: false,
default: M.AUTO
},
type: {
type: String,
required: false,
default: M.LIGHT
},
ariaLabel: {
type: String,
required: false,
default: "close"
},
closeToast: {
type: Function,
required: false,
default: void 0
}
},
setup(e) {
return () => createVNode("button", {
class: "".concat(r.CSS_NAMESPACE, "__close-button ").concat(r.CSS_NAMESPACE, "__close-button--").concat(e.theme),
type: "button",
onClick: (t) => {
t.stopPropagation(), e.closeToast && e.closeToast(t);
},
"aria-label": e.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)])]);
}
});
var Z = ({
theme: e,
type: t,
path: n,
...a
}) => createVNode("svg", mergeProps({
viewBox: "0 0 24 24",
width: "100%",
height: "100%",
fill: e === "colored" ? "currentColor" : "var(--toastify-icon-color-".concat(t, ")")
}, a), [createVNode("path", {
d: n
}, null)]);
function Ke(e) {
return createVNode(Z, mergeProps(e, {
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);
}
function Ye(e) {
return createVNode(Z, mergeProps(e, {
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);
}
function Ze(e) {
return createVNode(Z, mergeProps(e, {
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);
}
function Xe(e) {
return createVNode(Z, mergeProps(e, {
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);
}
function Je() {
return createVNode("div", {
class: "".concat(r.CSS_NAMESPACE, "__spinner")
}, null);
}
var oe = {
info: Ye,
warning: Ke,
success: Ze,
error: Xe,
spinner: Je
};
var et = (e) => e in oe;
function tt({
theme: e,
type: t,
isLoading: n,
icon: a
}) {
let o;
const s = {
theme: e,
type: t
};
return n ? o = oe.spinner() : a === false ? o = void 0 : G(a) ? o = toRaw(a) : B(a) ? o = a(s) : isVNode(a) ? o = cloneVNode(a, s) : ae(a) || He(a) ? o = a : et(t) && (o = oe[t](s)), o;
}
var nt = () => {
};
function at(e, t, n = r.COLLAPSE_DURATION) {
const { scrollHeight: a, style: o } = e, s = n;
requestAnimationFrame(() => {
o.minHeight = "initial", o.height = a + "px", o.transition = "all ".concat(s, "ms"), requestAnimationFrame(() => {
o.height = "0", o.padding = "0", o.margin = "0", setTimeout(t, s);
});
});
}
function ot(e) {
const t = ref(false), n = ref(false), a = ref(false), o = ref(V.Enter), s = reactive({
...e,
appendPosition: e.appendPosition || false,
collapse: typeof e.collapse > "u" ? true : e.collapse,
collapseDuration: e.collapseDuration || r.COLLAPSE_DURATION
}), u = s.done || nt, E = computed(() => s.appendPosition ? "".concat(s.enter, "--").concat(s.position) : s.enter), d = computed(() => s.appendPosition ? "".concat(s.exit, "--").concat(s.position) : s.exit), p = computed(() => e.pauseOnHover ? {
onMouseenter: h2,
onMouseleave: _
} : {});
function m() {
const y = E.value.split(" ");
C().addEventListener(
J.ENTRANCE_ANIMATION_END,
_,
{ once: true }
);
const O = ($) => {
const F = C();
$.target === F && (F.dispatchEvent(new Event(J.ENTRANCE_ANIMATION_END)), F.removeEventListener("animationend", O), F.removeEventListener("animationcancel", O), o.value === V.Enter && $.type !== "animationcancel" && F.classList.remove(...y));
}, b = () => {
const $ = C();
$.classList.add(...y), $.addEventListener("animationend", O), $.addEventListener("animationcancel", O);
};
e.pauseOnFocusLoss && v(), b();
}
function S() {
if (!C())
return;
const y = () => {
const b = C();
b.removeEventListener("animationend", y), s.collapse ? at(b, u, s.collapseDuration) : u();
}, O = () => {
const b = C();
o.value = V.Exit, b && (b.className += " ".concat(d.value), b.addEventListener("animationend", y));
};
n.value || (a.value ? y() : setTimeout(O));
}
function C() {
return e.toastRef.value;
}
function v() {
document.hasFocus() || h2(), window.addEventListener("focus", _), window.addEventListener("blur", h2);
}
function I() {
window.removeEventListener("focus", _), window.removeEventListener("blur", h2);
}
function _() {
(!e.loading.value || e.isLoading === void 0) && (t.value = true);
}
function h2() {
t.value = false;
}
function R(y) {
y && (y.stopPropagation(), y.preventDefault()), n.value = false;
}
return watchEffect(S), watchEffect(() => {
const y = k();
n.value = y.findIndex((O) => O.toastId === s.toastId) > -1;
}), watchEffect(() => {
e.isLoading !== void 0 && (e.loading.value ? h2() : _());
}), onMounted(m), onUnmounted(() => {
e.pauseOnFocusLoss && I();
}), {
isIn: n,
isRunning: t,
hideToast: R,
eventHandlers: p
};
}
var st = defineComponent({
name: "ToastItem",
inheritAttrs: false,
props: Ee,
// @ts-ignore
setup(e) {
const t = ref(), n = computed(() => !!e.isLoading), a = computed(() => e.progress !== void 0 && e.progress !== null), o = computed(() => tt(e)), s = computed(() => ["".concat(r.CSS_NAMESPACE, "__toast"), "".concat(r.CSS_NAMESPACE, "__toast-theme--").concat(e.theme), "".concat(r.CSS_NAMESPACE, "__toast--").concat(e.type), e.rtl ? "".concat(r.CSS_NAMESPACE, "__toast--rtl") : void 0, e.toastClassName || ""].filter(Boolean).join(" ")), {
isRunning: u,
isIn: E,
hideToast: d,
eventHandlers: p
} = ot({
toastRef: t,
loading: n,
done: () => {
A.remove(e.toastId);
},
...me(e.transition),
...e
});
return () => createVNode("div", mergeProps({
id: e.toastId,
class: s.value,
style: e.toastStyle || {},
ref: t,
"data-testid": "toast-item-".concat(e.toastId),
onClick: (m) => {
e.closeOnClick && d(), e.onClick && e.onClick(m);
}
}, p.value), [createVNode("div", {
role: e.role,
"data-testid": "toast-body",
class: "".concat(r.CSS_NAMESPACE, "__toast-body ").concat(e.bodyClassName || "")
}, [o.value != null && createVNode("div", {
"data-testid": "toast-icon-".concat(e.type),
class: ["".concat(r.CSS_NAMESPACE, "__toast-icon"), e.isLoading ? "" : "".concat(r.CSS_NAMESPACE, "--animate-icon ").concat(r.CSS_NAMESPACE, "__zoom-enter")].join(" ")
}, [G(o.value) ? h(toRaw(o.value), {
theme: e.theme,
type: e.type
}) : B(o.value) ? o.value({
theme: e.theme,
type: e.type
}) : o.value]), createVNode("div", {
"data-testid": "toast-content"
}, [G(e.content) ? h(toRaw(e.content), {
toastProps: toRaw(e),
closeToast: d,
data: e.data
}) : B(e.content) ? e.content({
toastProps: toRaw(e),
closeToast: d,
data: e.data
}) : e.dangerouslyHTMLString ? h("div", {
innerHTML: e.content
}) : e.content])]), (e.closeButton === void 0 || e.closeButton === true) && createVNode(We, {
theme: e.theme,
closeToast: (m) => {
m.stopPropagation(), m.preventDefault(), d();
}
}, null), G(e.closeButton) ? h(toRaw(e.closeButton), {
closeToast: d,
type: e.type,
theme: e.theme
}) : B(e.closeButton) ? e.closeButton({
closeToast: d,
type: e.type,
theme: e.theme
}) : null, createVNode(Qe, {
className: e.progressClassName,
style: e.progressStyle,
rtl: e.rtl,
theme: e.theme,
isIn: E.value,
type: e.type,
hide: e.hideProgressBar,
isRunning: u.value,
autoClose: e.autoClose,
controlledProgress: a.value,
progress: e.progress,
closeToast: e.isLoading ? void 0 : d
}, null)]);
}
});
var U = 0;
function Se() {
typeof window > "u" || (U && window.cancelAnimationFrame(U), U = window.requestAnimationFrame(Se), Q.lastUrl !== window.location.href && (Q.lastUrl = window.location.href, A.clear()));
}
var rt = defineComponent({
name: "ToastifyContainer",
inheritAttrs: false,
props: Ee,
// @ts-ignore
setup(e) {
const t = computed(() => e.containerId), n = computed(() => c[t.value] || []), a = computed(() => n.value.filter((o) => o.position === e.position));
return onMounted(() => {
typeof window < "u" && e.clearOnUrlChange && window.requestAnimationFrame(Se);
}), onUnmounted(() => {
typeof window < "u" && U && (window.cancelAnimationFrame(U), Q.lastUrl = "");
}), () => createVNode(Fragment, null, [a.value.map((o) => {
const {
toastId: s = ""
} = o;
return createVNode(st, mergeProps({
key: s
}, o), null);
})]);
}
});
var X = false;
function ve() {
const e = [];
return k().forEach((n) => {
const a = document.getElementById(n.containerId);
a && !a.classList.contains(K) && e.push(n);
}), e;
}
function lt(e) {
const t = ve().length, n = e != null ? e : 0;
return n > 0 && t + N.items.length >= n;
}
function it(e) {
lt(e.limit) && !e.updateId && N.items.push({
toastId: e.toastId,
containerId: e.containerId,
toastContent: e.content,
toastProps: e
});
}
function L(e, t, n = {}) {
if (X)
return;
n = Y(je(), {
type: t
}, toRaw(n)), (!n.toastId || typeof n.toastId != "string" && typeof n.toastId != "number") && (n.toastId = ye()), n = {
...n,
content: e,
containerId: n.containerId || String(n.position)
};
const a = Number(n == null ? void 0 : n.progress);
return a < 0 && (n.progress = 0), a > 1 && (n.progress = 1), n.theme === "auto" && (n.theme = Ge()), it(n), Q.lastUrl = window.location.href, n.multiple ? N.items.length ? n.updateId && j(e, n) : j(e, n) : (X = true, l.clearAll(void 0, false), setTimeout(() => {
j(e, n);
}, 0), setTimeout(() => {
X = false;
}, 390)), n.toastId;
}
var l = (e, t) => L(e, g.DEFAULT, t);
l.info = (e, t) => L(e, g.DEFAULT, {
...t,
type: g.INFO
});
l.error = (e, t) => L(e, g.DEFAULT, {
...t,
type: g.ERROR
});
l.warning = (e, t) => L(e, g.DEFAULT, {
...t,
type: g.WARNING
});
l.warn = l.warning;
l.success = (e, t) => L(e, g.DEFAULT, {
...t,
type: g.SUCCESS
});
l.loading = (e, t) => L(e, g.DEFAULT, Y(t, {
isLoading: true,
autoClose: false,
closeOnClick: false,
closeButton: false,
draggable: false
}));
l.dark = (e, t) => L(e, g.DEFAULT, Y(t, {
theme: M.DARK
}));
l.remove = (e) => {
e ? A.dismiss(e) : A.clear();
};
l.clearAll = (e, t) => {
A.clear(e, t);
};
l.isActive = (e) => {
let t = false;
return t = ve().findIndex((a) => a.toastId === e) > -1, t;
};
l.update = (e, t = {}) => {
setTimeout(() => {
const n = ke(e);
if (n) {
const a = toRaw(n), {
content: o
} = a, s = {
...a,
...t,
toastId: t.toastId || e,
updateId: ye()
}, u = s.render || o;
delete s.render, L(u, s.type, s);
}
}, 0);
};
l.done = (e) => {
l.update(e, {
isLoading: false,
progress: 1
});
};
l.promise = ut;
function ut(e, {
pending: t,
error: n,
success: a
}, o) {
var m, S, C;
let s;
const u = {
...o || {},
autoClose: false
};
t && (s = ae(t) ? l.loading(t, u) : l.loading(t.render, {
...u,
...t
}));
const E = {
autoClose: (m = o == null ? void 0 : o.autoClose) != null ? m : true,
closeOnClick: (S = o == null ? void 0 : o.closeOnClick) != null ? S : true,
closeButton: (C = o == null ? void 0 : o.autoClose) != null ? C : null,
isLoading: void 0,
draggable: null,
delay: 100
}, d = (v, I, _) => {
if (I == null) {
l.remove(s);
return;
}
const h2 = {
type: v,
...E,
...o,
data: _
}, R = ae(I) ? {
render: I
} : I;
return s ? l.update(s, {
...h2,
...R,
isLoading: false
}) : l(R.render, {
...h2,
...R,
isLoading: false
}), _;
}, p = B(e) ? e() : e;
return p.then((v) => {
d("success", a, v);
}).catch((v) => {
d("error", n, v);
}), p;
}
l.POSITION = D;
l.THEME = M;
l.TYPE = g;
l.TRANSITIONS = Ne;
var dt = {
install(e, t = {}) {
ct(t);
}
};
typeof window < "u" && (window.Vue3Toastify = dt);
function ct(e = {}) {
const t = Y(fe, e);
ze(t);
}
export {
V as AnimationStep,
_e as Bounce,
be as Flip,
he as Slide,
A as ToastActions,
rt as ToastifyContainer,
Oe as Zoom,
ge as addExitAnimateToNode,
De as appendFromQueue,
Me as cacheRenderInstance,
we as clearContainers,
x as containerInstances,
dt as default,
j as doAppend,
k as getAllToast,
ke as getToast,
Q as globalCache,
Ce as globalOptions,
N as queue,
te as removeContainer,
l as toast,
c as toastContainers,
ct as updateGlobalOptions,
ot as useCssTransition
};
//# sourceMappingURL=vue3-toastify.js.map