"use client";
import * as e from "react";
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
//#region ../../node_modules/.pnpm/goober@2.1.18_csstype@3.2.3/node_modules/goober/dist/goober.modern.js
var a = { data: "" }, o = (e) => {
	if (typeof window == "object") {
		let t = (e ? e.querySelector("#_goober") : window._goober) || Object.assign(document.createElement("style"), {
			innerHTML: " ",
			id: "_goober"
		});
		return t.nonce = window.__nonce__, t.parentNode || (e || document.head).appendChild(t), t.firstChild;
	}
	return e || a;
}, s = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, c = /\/\*[^]*?\*\/|  +/g, l = /\n+/g, u = (e, t) => {
	let n = "", r = "", i = "";
	for (let a in e) {
		let o = e[a];
		a[0] == "@" ? a[1] == "i" ? n = a + " " + o + ";" : r += a[1] == "f" ? u(o, a) : a + "{" + u(o, a[1] == "k" ? "" : t) + "}" : typeof o == "object" ? r += u(o, t ? t.replace(/([^,])+/g, (e) => a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t) => /&/.test(t) ? t.replace(/&/g, e) : e ? e + " " + t : t)) : a) : o != null && (a = /^--/.test(a) ? a : a.replace(/[A-Z]/g, "-$&").toLowerCase(), i += u.p ? u.p(a, o) : a + ":" + o + ";");
	}
	return n + (t && i ? t + "{" + i + "}" : i) + r;
}, d = {}, f = (e) => {
	if (typeof e == "object") {
		let t = "";
		for (let n in e) t += n + f(e[n]);
		return t;
	}
	return e;
}, p = (e, t, n, r, i) => {
	let a = f(e), o = d[a] || (d[a] = ((e) => {
		let t = 0, n = 11;
		for (; t < e.length;) n = 101 * n + e.charCodeAt(t++) >>> 0;
		return "go" + n;
	})(a));
	if (!d[o]) {
		let t = a === e ? ((e) => {
			let t, n, r = [{}];
			for (; t = s.exec(e.replace(c, ""));) t[4] ? r.shift() : t[3] ? (n = t[3].replace(l, " ").trim(), r.unshift(r[0][n] = r[0][n] || {})) : r[0][t[1]] = t[2].replace(l, " ").trim();
			return r[0];
		})(e) : e;
		d[o] = u(i ? { ["@keyframes " + o]: t } : t, n ? "" : "." + o);
	}
	let p = n && d.g ? d.g : null;
	return n && (d.g = d[o]), ((e, t, n, r) => {
		r ? t.data = t.data.replace(r, e) : t.data.indexOf(e) === -1 && (t.data = n ? e + t.data : t.data + e);
	})(d[o], t, r, p), o;
}, m = (e, t, n) => e.reduce((e, r, i) => {
	let a = t[i];
	if (a && a.call) {
		let e = a(n), t = e && e.props && e.props.className || /^go/.test(e) && e;
		a = t ? "." + t : e && typeof e == "object" ? e.props ? "" : u(e, "") : !1 === e ? "" : e;
	}
	return e + r + (a ?? "");
}, "");
function h(e) {
	let t = this || {}, n = e.call ? e(t.p) : e;
	return p(n.unshift ? n.raw ? m(n, [].slice.call(arguments, 1), t.p) : n.reduce((e, n) => Object.assign(e, n && n.call ? n(t.p) : n), {}) : n, o(t.target), t.g, t.o, t.k);
}
var g, _, v;
h.bind({ g: 1 });
var y = h.bind({ k: 1 });
function ee(e, t, n, r) {
	u.p = t, g = e, _ = n, v = r;
}
function b(e, t) {
	let n = this || {};
	return function() {
		let r = arguments;
		function i(a, o) {
			let s = Object.assign({}, a), c = s.className || i.className;
			n.p = Object.assign({ theme: _ && _() }, s), n.o = / *go\d+/.test(c), s.className = h.apply(n, r) + (c ? " " + c : ""), t && (s.ref = o);
			let l = e;
			return e[0] && (l = s.as || e, delete s.as), v && l[0] && v(s), g(l, s);
		}
		return t ? t(i) : i;
	};
}
//#endregion
//#region ../../node_modules/.pnpm/react-hot-toast@2.6.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-hot-toast/dist/index.mjs
var x = (e) => typeof e == "function", S = (e, t) => x(e) ? e(t) : e, C = (() => {
	let e = 0;
	return () => (++e).toString();
})(), w = (() => {
	let e;
	return () => {
		if (e === void 0 && typeof window < "u") {
			let t = matchMedia("(prefers-reduced-motion: reduce)");
			e = !t || t.matches;
		}
		return e;
	};
})(), T = 20, E = "default", D = (e, t) => {
	let { toastLimit: n } = e.settings;
	switch (t.type) {
		case 0: return {
			...e,
			toasts: [t.toast, ...e.toasts].slice(0, n)
		};
		case 1: return {
			...e,
			toasts: e.toasts.map((e) => e.id === t.toast.id ? {
				...e,
				...t.toast
			} : e)
		};
		case 2:
			let { toast: r } = t;
			return D(e, {
				type: e.toasts.find((e) => e.id === r.id) ? 1 : 0,
				toast: r
			});
		case 3:
			let { toastId: i } = t;
			return {
				...e,
				toasts: e.toasts.map((e) => e.id === i || i === void 0 ? {
					...e,
					dismissed: !0,
					visible: !1
				} : e)
			};
		case 4: return t.toastId === void 0 ? {
			...e,
			toasts: []
		} : {
			...e,
			toasts: e.toasts.filter((e) => e.id !== t.toastId)
		};
		case 5: return {
			...e,
			pausedAt: t.time
		};
		case 6:
			let a = t.time - (e.pausedAt || 0);
			return {
				...e,
				pausedAt: void 0,
				toasts: e.toasts.map((e) => ({
					...e,
					pauseDuration: e.pauseDuration + a
				}))
			};
	}
}, O = [], k = {
	toasts: [],
	pausedAt: void 0,
	settings: { toastLimit: T }
}, A = {}, j = (e, t = E) => {
	A[t] = D(A[t] || k, e), O.forEach(([e, n]) => {
		e === t && n(A[t]);
	});
}, M = (e) => Object.keys(A).forEach((t) => j(e, t)), te = (e) => Object.keys(A).find((t) => A[t].toasts.some((t) => t.id === e)), N = (e = E) => (t) => {
	j(t, e);
}, P = {
	blank: 4e3,
	error: 4e3,
	success: 2e3,
	loading: Infinity,
	custom: 4e3
}, F = (e = {}, t = E) => {
	let [a, o] = i(A[t] || k), s = r(A[t]);
	n(() => (s.current !== A[t] && o(A[t]), O.push([t, o]), () => {
		let e = O.findIndex(([e]) => e === t);
		e > -1 && O.splice(e, 1);
	}), [t]);
	let c = a.toasts.map((t) => ({
		...e,
		...e[t.type],
		...t,
		removeDelay: t.removeDelay || e[t.type]?.removeDelay || e?.removeDelay,
		duration: t.duration || e[t.type]?.duration || e?.duration || P[t.type],
		style: {
			...e.style,
			...e[t.type]?.style,
			...t.style
		}
	}));
	return {
		...a,
		toasts: c
	};
}, I = (e, t = "blank", n) => ({
	createdAt: Date.now(),
	visible: !0,
	dismissed: !1,
	type: t,
	ariaProps: {
		role: "status",
		"aria-live": "polite"
	},
	message: e,
	pauseDuration: 0,
	...n,
	id: n?.id || C()
}), L = (e) => (t, n) => {
	let r = I(t, e, n);
	return N(r.toasterId || te(r.id))({
		type: 2,
		toast: r
	}), r.id;
}, R = (e, t) => L("blank")(e, t);
R.error = L("error"), R.success = L("success"), R.loading = L("loading"), R.custom = L("custom"), R.dismiss = (e, t) => {
	let n = {
		type: 3,
		toastId: e
	};
	t ? N(t)(n) : M(n);
}, R.dismissAll = (e) => R.dismiss(void 0, e), R.remove = (e, t) => {
	let n = {
		type: 4,
		toastId: e
	};
	t ? N(t)(n) : M(n);
}, R.removeAll = (e) => R.remove(void 0, e), R.promise = (e, t, n) => {
	let r = R.loading(t.loading, {
		...n,
		...n?.loading
	});
	return typeof e == "function" && (e = e()), e.then((e) => {
		let i = t.success ? S(t.success, e) : void 0;
		return i ? R.success(i, {
			id: r,
			...n,
			...n?.success
		}) : R.dismiss(r), e;
	}).catch((e) => {
		let i = t.error ? S(t.error, e) : void 0;
		i ? R.error(i, {
			id: r,
			...n,
			...n?.error
		}) : R.dismiss(r);
	}), e;
};
var z = 1e3, B = (e, i = "default") => {
	let { toasts: a, pausedAt: o } = F(e, i), s = r(/* @__PURE__ */ new Map()).current, c = t((e, t = z) => {
		if (s.has(e)) return;
		let n = setTimeout(() => {
			s.delete(e), l({
				type: 4,
				toastId: e
			});
		}, t);
		s.set(e, n);
	}, []);
	n(() => {
		if (o) return;
		let e = Date.now(), t = a.map((t) => {
			if (t.duration === Infinity) return;
			let n = (t.duration || 0) + t.pauseDuration - (e - t.createdAt);
			if (n < 0) {
				t.visible && R.dismiss(t.id);
				return;
			}
			return setTimeout(() => R.dismiss(t.id, i), n);
		});
		return () => {
			t.forEach((e) => e && clearTimeout(e));
		};
	}, [
		a,
		o,
		i
	]);
	let l = t(N(i), [i]), u = t(() => {
		l({
			type: 5,
			time: Date.now()
		});
	}, [l]), d = t((e, t) => {
		l({
			type: 1,
			toast: {
				id: e,
				height: t
			}
		});
	}, [l]), f = t(() => {
		o && l({
			type: 6,
			time: Date.now()
		});
	}, [o, l]), p = t((e, t) => {
		let { reverseOrder: n = !1, gutter: r = 8, defaultPosition: i } = t || {}, o = a.filter((t) => (t.position || i) === (e.position || i) && t.height), s = o.findIndex((t) => t.id === e.id), c = o.filter((e, t) => t < s && e.visible).length;
		return o.filter((e) => e.visible).slice(...n ? [c + 1] : [0, c]).reduce((e, t) => e + (t.height || 0) + r, 0);
	}, [a]);
	return n(() => {
		a.forEach((e) => {
			if (e.dismissed) c(e.id, e.removeDelay);
			else {
				let t = s.get(e.id);
				t && (clearTimeout(t), s.delete(e.id));
			}
		});
	}, [a, c]), {
		toasts: a,
		handlers: {
			updateHeight: d,
			startPause: u,
			endPause: f,
			calculateOffset: p
		}
	};
}, V = y`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`, H = y`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`, U = y`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`, W = b("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e) => e.primary || "#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${V} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${H} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${(e) => e.secondary || "#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${U} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`, G = y`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`, K = b("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${(e) => e.secondary || "#e0e0e0"};
  border-right-color: ${(e) => e.primary || "#616161"};
  animation: ${G} 1s linear infinite;
`, q = y`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`, J = y`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`, ne = b("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e) => e.primary || "#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${q} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${J} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${(e) => e.secondary || "#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`, Y = b("div")`
  position: absolute;
`, X = b("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`, Z = y`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`, re = b("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${Z} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`, ie = ({ toast: t }) => {
	let { icon: n, type: r, iconTheme: i } = t;
	return n === void 0 ? r === "blank" ? null : e.createElement(X, null, e.createElement(K, { ...i }), r !== "loading" && e.createElement(Y, null, r === "error" ? e.createElement(W, { ...i }) : e.createElement(ne, { ...i }))) : typeof n == "string" ? e.createElement(re, null, n) : n;
}, ae = (e) => `
0% {transform: translate3d(0,${e * -200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`, oe = (e) => `
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e * -150}%,-1px) scale(.6); opacity:0;}
`, se = "0%{opacity:0;} 100%{opacity:1;}", ce = "0%{opacity:1;} 100%{opacity:0;}", le = b("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`, ue = b("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`, Q = (e, t) => {
	let n = e.includes("top") ? 1 : -1, [r, i] = w() ? [se, ce] : [ae(n), oe(n)];
	return { animation: t ? `${y(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${y(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
}, de = e.memo(({ toast: t, position: n, style: r, children: i }) => {
	let a = t.height ? Q(t.position || n || "top-center", t.visible) : { opacity: 0 }, o = e.createElement(ie, { toast: t }), s = e.createElement(ue, { ...t.ariaProps }, S(t.message, t));
	return e.createElement(le, {
		className: t.className,
		style: {
			...a,
			...r,
			...t.style
		}
	}, typeof i == "function" ? i({
		icon: o,
		message: s
	}) : e.createElement(e.Fragment, null, o, s));
});
ee(e.createElement);
var fe = ({ id: t, className: n, style: r, onHeightUpdate: i, children: a }) => {
	let o = e.useCallback((e) => {
		if (e) {
			let n = () => {
				let n = e.getBoundingClientRect().height;
				i(t, n);
			};
			n(), new MutationObserver(n).observe(e, {
				subtree: !0,
				childList: !0,
				characterData: !0
			});
		}
	}, [t, i]);
	return e.createElement("div", {
		ref: o,
		className: n,
		style: r
	}, a);
}, pe = (e, t) => {
	let n = e.includes("top"), r = n ? { top: 0 } : { bottom: 0 }, i = e.includes("center") ? { justifyContent: "center" } : e.includes("right") ? { justifyContent: "flex-end" } : {};
	return {
		left: 0,
		right: 0,
		display: "flex",
		position: "absolute",
		transition: w() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)",
		transform: `translateY(${t * (n ? 1 : -1)}px)`,
		...r,
		...i
	};
}, me = h`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`, $ = 16, he = ({ reverseOrder: t, position: n = "top-center", toastOptions: r, gutter: i, children: a, toasterId: o, containerStyle: s, containerClassName: c }) => {
	let { toasts: l, handlers: u } = B(r, o);
	return e.createElement("div", {
		"data-rht-toaster": o || "",
		style: {
			position: "fixed",
			zIndex: 9999,
			top: $,
			left: $,
			right: $,
			bottom: $,
			pointerEvents: "none",
			...s
		},
		className: c,
		onMouseEnter: u.startPause,
		onMouseLeave: u.endPause
	}, l.map((r) => {
		let o = r.position || n, s = pe(o, u.calculateOffset(r, {
			reverseOrder: t,
			gutter: i,
			defaultPosition: n
		}));
		return e.createElement(fe, {
			id: r.id,
			key: r.id,
			onHeightUpdate: u.updateHeight,
			className: r.visible ? me : "",
			style: s
		}, r.type === "custom" ? S(r.message, r) : a ? a(r) : e.createElement(de, {
			toast: r,
			position: o
		}));
	}));
};
//#endregion
export { R as n, B as r, he as t };

//# sourceMappingURL=dist.js.map