import * as d from "react";
import { useEffect as Z, useCallback as re, useState as Oe, useRef as $e } from "react";
import * as Pe from "react-dom";
import { jsx as P, Fragment as Ne } from "react/jsx-runtime";
import { H as Me } from "./use-page-data.BYLN5MSa.js";
const de = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakSet();
let C, ee = 0, te = 0;
const w = "__aa_tgt", k = "__aa_del", F = "__aa_new", Re = (e) => {
  const t = ke(e);
  t && t.forEach((o) => We(o));
}, Ae = (e) => {
  e.forEach((t) => {
    t.target === C && De(), g.has(t.target) && M(t.target);
  });
};
function je(e) {
  const t = Q.get(e);
  t?.disconnect();
  let o = g.get(e), i = 0;
  const r = 5;
  o || (o = D(e), g.set(e, o));
  const { offsetWidth: n, offsetHeight: s } = C, c = [
    o.top - r,
    n - (o.left + r + o.width),
    s - (o.top + r + o.height),
    o.left - r
  ].map((u) => `${-1 * Math.floor(u)}px`).join(" "), l = new IntersectionObserver(() => {
    ++i > 1 && M(e);
  }, {
    root: C,
    threshold: 1,
    rootMargin: c
  });
  l.observe(e), Q.set(e, l);
}
function M(e) {
  clearTimeout(B.get(e));
  const t = V(e), o = W(t) ? 500 : t.duration;
  B.set(e, setTimeout(async () => {
    const i = N.get(e);
    try {
      await i?.finished, g.set(e, D(e)), je(e);
    } catch {
    }
  }, o));
}
function De() {
  clearTimeout(B.get(C)), B.set(C, setTimeout(() => {
    de.forEach((e) => me(e, (t) => ue(() => M(t))));
  }, 100));
}
function _e(e) {
  setTimeout(() => {
    Te.set(e, setInterval(() => ue(M.bind(null, e)), 2e3));
  }, Math.round(2e3 * Math.random()));
}
function ue(e) {
  typeof requestIdleCallback == "function" ? requestIdleCallback(() => e()) : requestAnimationFrame(() => e());
}
let G, R;
const ze = typeof window < "u" && "ResizeObserver" in window;
ze && (C = document.documentElement, G = new MutationObserver(Re), R = new ResizeObserver(Ae), window.addEventListener("scroll", () => {
  te = window.scrollY, ee = window.scrollX;
}), R.observe(C));
function ke(e) {
  return e.reduce((i, r) => [
    ...i,
    ...Array.from(r.addedNodes),
    ...Array.from(r.removedNodes)
  ], []).every((i) => i.nodeName === "#comment") ? !1 : e.reduce((i, r) => {
    if (i === !1)
      return !1;
    if (r.target instanceof Element) {
      if (q(r.target), !i.has(r.target)) {
        i.add(r.target);
        for (let n = 0; n < r.target.children.length; n++) {
          const s = r.target.children.item(n);
          if (s) {
            if (k in s)
              return !1;
            q(r.target, s), i.add(s);
          }
        }
      }
      if (r.removedNodes.length)
        for (let n = 0; n < r.removedNodes.length; n++) {
          const s = r.removedNodes[n];
          if (k in s)
            return !1;
          s instanceof Element && (i.add(s), q(r.target, s), A.set(s, [
            r.previousSibling,
            r.nextSibling
          ]));
        }
    }
    return i;
  }, /* @__PURE__ */ new Set());
}
function q(e, t) {
  !t && !(w in e) ? Object.defineProperty(e, w, { value: e }) : t && !(w in t) && Object.defineProperty(t, w, { value: e });
}
function We(e) {
  var t;
  const o = e.isConnected, i = g.has(e);
  o && A.has(e) && A.delete(e), N.has(e) && ((t = N.get(e)) === null || t === void 0 || t.cancel()), F in e ? ie(e) : i && o ? Ie(e) : i && !o ? He(e) : ie(e);
}
function v(e) {
  return Number(e.replace(/[^0-9.\-]/g, ""));
}
function Le(e) {
  let t = e.parentElement;
  for (; t; ) {
    if (t.scrollLeft || t.scrollTop)
      return { x: t.scrollLeft, y: t.scrollTop };
    t = t.parentElement;
  }
  return { x: 0, y: 0 };
}
function D(e) {
  const t = e.getBoundingClientRect(), { x: o, y: i } = Le(e);
  return {
    top: t.top + i,
    left: t.left + o,
    width: t.width,
    height: t.height
  };
}
function fe(e, t, o) {
  let i = t.width, r = t.height, n = o.width, s = o.height;
  const a = getComputedStyle(e);
  if (a.getPropertyValue("box-sizing") === "content-box") {
    const l = v(a.paddingTop) + v(a.paddingBottom) + v(a.borderTopWidth) + v(a.borderBottomWidth), u = v(a.paddingLeft) + v(a.paddingRight) + v(a.borderRightWidth) + v(a.borderLeftWidth);
    i -= u, n -= u, r -= l, s -= l;
  }
  return [i, n, r, s].map(Math.round);
}
function V(e) {
  return w in e && j.has(e[w]) ? j.get(e[w]) : { duration: 250, easing: "ease-in-out" };
}
function pe(e) {
  if (w in e)
    return e[w];
}
function oe(e) {
  const t = pe(e);
  return t ? _.has(t) : !1;
}
function me(e, ...t) {
  t.forEach((o) => o(e, j.has(e)));
  for (let o = 0; o < e.children.length; o++) {
    const i = e.children.item(o);
    i && t.forEach((r) => r(i, j.has(i)));
  }
}
function ne(e) {
  return Array.isArray(e) ? e : [e];
}
function W(e) {
  return typeof e == "function";
}
function Ie(e) {
  const t = g.get(e), o = D(e);
  if (!oe(e))
    return g.set(e, o);
  let i;
  if (!t)
    return;
  const r = V(e);
  if (typeof r != "function") {
    const n = t.left - o.left, s = t.top - o.top, [a, c, l, u] = fe(e, t, o), f = {
      transform: `translate(${n}px, ${s}px)`
    }, p = {
      transform: "translate(0, 0)"
    };
    a !== c && (f.width = `${a}px`, p.width = `${c}px`), l !== u && (f.height = `${l}px`, p.height = `${u}px`), i = e.animate([f, p], {
      duration: r.duration,
      easing: r.easing
    });
  } else {
    const [n] = ne(r(e, "remain", t, o));
    i = new Animation(n), i.play();
  }
  N.set(e, i), g.set(e, o), i.addEventListener("finish", M.bind(null, e));
}
function ie(e) {
  F in e && delete e[F];
  const t = D(e);
  g.set(e, t);
  const o = V(e);
  if (!oe(e))
    return;
  let i;
  if (typeof o != "function")
    i = e.animate([
      { transform: "scale(.98)", opacity: 0 },
      { transform: "scale(0.98)", opacity: 0, offset: 0.5 },
      { transform: "scale(1)", opacity: 1 }
    ], {
      duration: o.duration * 1.5,
      easing: "ease-in"
    });
  else {
    const [r] = ne(o(e, "add", t));
    i = new Animation(r), i.play();
  }
  N.set(e, i), i.addEventListener("finish", M.bind(null, e));
}
function se(e, t) {
  var o;
  e.remove(), g.delete(e), A.delete(e), N.delete(e), (o = Q.get(e)) === null || o === void 0 || o.disconnect(), setTimeout(() => {
    if (k in e && delete e[k], Object.defineProperty(e, F, { value: !0, configurable: !0 }), t && e instanceof HTMLElement)
      for (const i in t)
        e.style[i] = "";
  }, 0);
}
function He(e) {
  var t;
  if (!A.has(e) || !g.has(e))
    return;
  const [o, i] = A.get(e);
  Object.defineProperty(e, k, { value: !0, configurable: !0 });
  const r = window.scrollX, n = window.scrollY;
  if (i && i.parentNode && i.parentNode instanceof Element ? i.parentNode.insertBefore(e, i) : o && o.parentNode ? o.parentNode.appendChild(e) : (t = pe(e)) === null || t === void 0 || t.appendChild(e), !oe(e))
    return se(e);
  const [s, a, c, l] = Fe(e), u = V(e), f = g.get(e);
  (r !== ee || n !== te) && Be(e, r, n, u);
  let p, m = {
    position: "absolute",
    top: `${s}px`,
    left: `${a}px`,
    width: `${c}px`,
    height: `${l}px`,
    margin: "0",
    pointerEvents: "none",
    transformOrigin: "center",
    zIndex: "100"
  };
  if (!W(u))
    Object.assign(e.style, m), p = e.animate([
      {
        transform: "scale(1)",
        opacity: 1
      },
      {
        transform: "scale(.98)",
        opacity: 0
      }
    ], { duration: u.duration, easing: "ease-out" });
  else {
    const [y, E] = ne(u(e, "remove", f));
    E?.styleReset !== !1 && (m = E?.styleReset || m, Object.assign(e.style, m)), p = new Animation(y), p.play();
  }
  N.set(e, p), p.addEventListener("finish", se.bind(null, e, m));
}
function Be(e, t, o, i) {
  const r = ee - t, n = te - o, s = document.documentElement.style.scrollBehavior;
  if (getComputedStyle(C).scrollBehavior === "smooth" && (document.documentElement.style.scrollBehavior = "auto"), window.scrollTo(window.scrollX + r, window.scrollY + n), !e.parentElement)
    return;
  const c = e.parentElement;
  let l = c.clientHeight, u = c.clientWidth;
  const f = performance.now();
  function p() {
    requestAnimationFrame(() => {
      if (!W(i)) {
        const m = l - c.clientHeight, y = u - c.clientWidth;
        f + i.duration > performance.now() ? (window.scrollTo({
          left: window.scrollX - y,
          top: window.scrollY - m
        }), l = c.clientHeight, u = c.clientWidth, p()) : document.documentElement.style.scrollBehavior = s;
      }
    });
  }
  p();
}
function Fe(e) {
  const t = g.get(e), [o, , i] = fe(e, t, D(e));
  let r = e.parentElement;
  for (; r && (getComputedStyle(r).position === "static" || r instanceof HTMLBodyElement); )
    r = r.parentElement;
  r || (r = document.body);
  const n = getComputedStyle(r), s = g.get(r) || D(r), a = Math.round(t.top - s.top) - v(n.borderTopWidth), c = Math.round(t.left - s.left) - v(n.borderLeftWidth);
  return [a, c, o, i];
}
function Gt(e, t = {}) {
  return G && R && (window.matchMedia("(prefers-reduced-motion: reduce)").matches && !W(t) && !t.disrespectUserMotionPreference || (_.add(e), getComputedStyle(e).position === "static" && Object.assign(e.style, { position: "relative" }), me(e, M, _e, (r) => R?.observe(r)), W(t) ? j.set(e, t) : j.set(e, { duration: 250, easing: "ease-in-out", ...t }), G.observe(e, { childList: !0 }), de.add(e))), Object.freeze({
    parent: e,
    enable: () => {
      _.add(e);
    },
    disable: () => {
      _.delete(e);
    },
    isEnabled: () => _.has(e)
  });
}
let Ye = { data: "" }, Ve = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || Ye, Xe = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, qe = /\/\*[^]*?\*\/|  +/g, ae = /\n+/g, S = (e, t) => {
  let o = "", i = "", r = "";
  for (let n in e) {
    let s = e[n];
    n[0] == "@" ? n[1] == "i" ? o = n + " " + s + ";" : i += n[1] == "f" ? S(s, n) : n + "{" + S(s, n[1] == "k" ? "" : t) + "}" : typeof s == "object" ? i += S(s, t ? t.replace(/([^,])+/g, (a) => n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (c) => /&/.test(c) ? c.replace(/&/g, a) : a ? a + " " + c : c)) : n) : s != null && (n = /^--/.test(n) ? n : n.replace(/[A-Z]/g, "-$&").toLowerCase(), r += S.p ? S.p(n, s) : n + ":" + s + ";");
  }
  return o + (t && r ? t + "{" + r + "}" : r) + i;
}, b = {}, he = (e) => {
  if (typeof e == "object") {
    let t = "";
    for (let o in e) t += o + he(e[o]);
    return t;
  }
  return e;
}, Ue = (e, t, o, i, r) => {
  let n = he(e), s = b[n] || (b[n] = ((c) => {
    let l = 0, u = 11;
    for (; l < c.length; ) u = 101 * u + c.charCodeAt(l++) >>> 0;
    return "go" + u;
  })(n));
  if (!b[s]) {
    let c = n !== e ? e : ((l) => {
      let u, f, p = [{}];
      for (; u = Xe.exec(l.replace(qe, "")); ) u[4] ? p.shift() : u[3] ? (f = u[3].replace(ae, " ").trim(), p.unshift(p[0][f] = p[0][f] || {})) : p[0][u[1]] = u[2].replace(ae, " ").trim();
      return p[0];
    })(e);
    b[s] = S(r ? { ["@keyframes " + s]: c } : c, o ? "" : "." + s);
  }
  let a = o && b.g ? b.g : null;
  return o && (b.g = b[s]), ((c, l, u, f) => {
    f ? l.data = l.data.replace(f, c) : l.data.indexOf(c) === -1 && (l.data = u ? c + l.data : l.data + c);
  })(b[s], t, i, a), s;
}, Ze = (e, t, o) => e.reduce((i, r, n) => {
  let s = t[n];
  if (s && s.call) {
    let a = s(o), c = a && a.props && a.props.className || /^go/.test(a) && a;
    s = c ? "." + c : a && typeof a == "object" ? a.props ? "" : S(a, "") : a === !1 ? "" : a;
  }
  return i + r + (s ?? "");
}, "");
function X(e) {
  let t = this || {}, o = e.call ? e(t.p) : e;
  return Ue(o.unshift ? o.raw ? Ze(o, [].slice.call(arguments, 1), t.p) : o.reduce((i, r) => Object.assign(i, r && r.call ? r(t.p) : r), {}) : o, Ve(t.target), t.g, t.o, t.k);
}
let ge, J, K;
X.bind({ g: 1 });
let x = X.bind({ k: 1 });
function Qe(e, t, o, i) {
  S.p = t, ge = e, J = o, K = i;
}
function O(e, t) {
  let o = this || {};
  return function() {
    let i = arguments;
    function r(n, s) {
      let a = Object.assign({}, n), c = a.className || r.className;
      o.p = Object.assign({ theme: J && J() }, a), o.o = / *go\d+/.test(c), a.className = X.apply(o, i) + (c ? " " + c : "");
      let l = e;
      return e[0] && (l = a.as || e, delete a.as), K && l[0] && K(a), ge(l, a);
    }
    return r;
  };
}
var Ge = (e) => typeof e == "function", Y = (e, t) => Ge(e) ? e(t) : e, Je = /* @__PURE__ */ (() => {
  let e = 0;
  return () => (++e).toString();
})(), ye = /* @__PURE__ */ (() => {
  let e;
  return () => {
    if (e === void 0 && typeof window < "u") {
      let t = matchMedia("(prefers-reduced-motion: reduce)");
      e = !t || t.matches;
    }
    return e;
  };
})(), Ke = 20, ve = (e, t) => {
  switch (t.type) {
    case 0:
      return { ...e, toasts: [t.toast, ...e.toasts].slice(0, Ke) };
    case 1:
      return { ...e, toasts: e.toasts.map((n) => n.id === t.toast.id ? { ...n, ...t.toast } : n) };
    case 2:
      let { toast: o } = t;
      return ve(e, { type: e.toasts.find((n) => n.id === o.id) ? 1 : 0, toast: o });
    case 3:
      let { toastId: i } = t;
      return { ...e, toasts: e.toasts.map((n) => n.id === i || i === void 0 ? { ...n, dismissed: !0, visible: !1 } : n) };
    case 4:
      return t.toastId === void 0 ? { ...e, toasts: [] } : { ...e, toasts: e.toasts.filter((n) => n.id !== t.toastId) };
    case 5:
      return { ...e, pausedAt: t.time };
    case 6:
      let r = t.time - (e.pausedAt || 0);
      return { ...e, pausedAt: void 0, toasts: e.toasts.map((n) => ({ ...n, pauseDuration: n.pauseDuration + r })) };
  }
}, H = [], $ = { toasts: [], pausedAt: void 0 }, T = (e) => {
  $ = ve($, e), H.forEach((t) => {
    t($);
  });
}, et = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, tt = (e = {}) => {
  let [t, o] = Oe($), i = $e($);
  Z(() => (i.current !== $ && o($), H.push(o), () => {
    let n = H.indexOf(o);
    n > -1 && H.splice(n, 1);
  }), []);
  let r = t.toasts.map((n) => {
    var s, a, c;
    return { ...e, ...e[n.type], ...n, removeDelay: n.removeDelay || ((s = e[n.type]) == null ? void 0 : s.removeDelay) || e?.removeDelay, duration: n.duration || ((a = e[n.type]) == null ? void 0 : a.duration) || e?.duration || et[n.type], style: { ...e.style, ...(c = e[n.type]) == null ? void 0 : c.style, ...n.style } };
  });
  return { ...t, toasts: r };
}, ot = (e, t = "blank", o) => ({ createdAt: Date.now(), visible: !0, dismissed: !1, type: t, ariaProps: { role: "status", "aria-live": "polite" }, message: e, pauseDuration: 0, ...o, id: o?.id || Je() }), L = (e) => (t, o) => {
  let i = ot(t, e, o);
  return T({ type: 2, toast: i }), i.id;
}, h = (e, t) => L("blank")(e, t);
h.error = L("error");
h.success = L("success");
h.loading = L("loading");
h.custom = L("custom");
h.dismiss = (e) => {
  T({ type: 3, toastId: e });
};
h.remove = (e) => T({ type: 4, toastId: e });
h.promise = (e, t, o) => {
  let i = h.loading(t.loading, { ...o, ...o?.loading });
  return typeof e == "function" && (e = e()), e.then((r) => {
    let n = t.success ? Y(t.success, r) : void 0;
    return n ? h.success(n, { id: i, ...o, ...o?.success }) : h.dismiss(i), r;
  }).catch((r) => {
    let n = t.error ? Y(t.error, r) : void 0;
    n ? h.error(n, { id: i, ...o, ...o?.error }) : h.dismiss(i);
  }), e;
};
var nt = (e, t) => {
  T({ type: 1, toast: { id: e, height: t } });
}, rt = () => {
  T({ type: 5, time: Date.now() });
}, z = /* @__PURE__ */ new Map(), it = 1e3, st = (e, t = it) => {
  if (z.has(e)) return;
  let o = setTimeout(() => {
    z.delete(e), T({ type: 4, toastId: e });
  }, t);
  z.set(e, o);
}, at = (e) => {
  let { toasts: t, pausedAt: o } = tt(e);
  Z(() => {
    if (o) return;
    let n = Date.now(), s = t.map((a) => {
      if (a.duration === 1 / 0) return;
      let c = (a.duration || 0) + a.pauseDuration - (n - a.createdAt);
      if (c < 0) {
        a.visible && h.dismiss(a.id);
        return;
      }
      return setTimeout(() => h.dismiss(a.id), c);
    });
    return () => {
      s.forEach((a) => a && clearTimeout(a));
    };
  }, [t, o]);
  let i = re(() => {
    o && T({ type: 6, time: Date.now() });
  }, [o]), r = re((n, s) => {
    let { reverseOrder: a = !1, gutter: c = 8, defaultPosition: l } = s || {}, u = t.filter((m) => (m.position || l) === (n.position || l) && m.height), f = u.findIndex((m) => m.id === n.id), p = u.filter((m, y) => y < f && m.visible).length;
    return u.filter((m) => m.visible).slice(...a ? [p + 1] : [0, p]).reduce((m, y) => m + (y.height || 0) + c, 0);
  }, [t]);
  return Z(() => {
    t.forEach((n) => {
      if (n.dismissed) st(n.id, n.removeDelay);
      else {
        let s = z.get(n.id);
        s && (clearTimeout(s), z.delete(n.id));
      }
    });
  }, [t]), { toasts: t, handlers: { updateHeight: nt, startPause: rt, endPause: i, calculateOffset: r } };
}, ct = x`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`, lt = x`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`, dt = x`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`, ut = O("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e) => e.primary || "#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

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

  &:after,
  &:before {
    content: '';
    animation: ${lt} 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: ${dt} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`, ft = x`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`, pt = O("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: ${ft} 1s linear infinite;
`, mt = x`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`, ht = x`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`, gt = O("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e) => e.primary || "#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${mt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${ht} 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;
  }
`, yt = O("div")`
  position: absolute;
`, vt = O("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`, bt = x`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`, wt = O("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${bt} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`, xt = ({ toast: e }) => {
  let { icon: t, type: o, iconTheme: i } = e;
  return t !== void 0 ? typeof t == "string" ? d.createElement(wt, null, t) : t : o === "blank" ? null : d.createElement(vt, null, d.createElement(pt, { ...i }), o !== "loading" && d.createElement(yt, null, o === "error" ? d.createElement(ut, { ...i }) : d.createElement(gt, { ...i })));
}, Et = (e) => `
0% {transform: translate3d(0,${e * -200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`, St = (e) => `
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e * -150}%,-1px) scale(.6); opacity:0;}
`, Ct = "0%{opacity:0;} 100%{opacity:1;}", Ot = "0%{opacity:1;} 100%{opacity:0;}", $t = O("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;
`, Pt = O("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`, Nt = (e, t) => {
  let o = e.includes("top") ? 1 : -1, [i, r] = ye() ? [Ct, Ot] : [Et(o), St(o)];
  return { animation: t ? `${x(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${x(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
}, Mt = d.memo(({ toast: e, position: t, style: o, children: i }) => {
  let r = e.height ? Nt(e.position || t || "top-center", e.visible) : { opacity: 0 }, n = d.createElement(xt, { toast: e }), s = d.createElement(Pt, { ...e.ariaProps }, Y(e.message, e));
  return d.createElement($t, { className: e.className, style: { ...r, ...o, ...e.style } }, typeof i == "function" ? i({ icon: n, message: s }) : d.createElement(d.Fragment, null, n, s));
});
Qe(d.createElement);
var Tt = ({ id: e, className: t, style: o, onHeightUpdate: i, children: r }) => {
  let n = d.useCallback((s) => {
    if (s) {
      let a = () => {
        let c = s.getBoundingClientRect().height;
        i(e, c);
      };
      a(), new MutationObserver(a).observe(s, { subtree: !0, childList: !0, characterData: !0 });
    }
  }, [e, i]);
  return d.createElement("div", { ref: n, className: t, style: o }, r);
}, Rt = (e, t) => {
  let o = e.includes("top"), i = o ? { top: 0 } : { bottom: 0 }, r = e.includes("center") ? { justifyContent: "center" } : e.includes("right") ? { justifyContent: "flex-end" } : {};
  return { left: 0, right: 0, display: "flex", position: "absolute", transition: ye() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t * (o ? 1 : -1)}px)`, ...i, ...r };
}, At = X`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`, I = 16, Jt = ({ reverseOrder: e, position: t = "top-center", toastOptions: o, gutter: i, children: r, containerStyle: n, containerClassName: s }) => {
  let { toasts: a, handlers: c } = at(o);
  return d.createElement("div", { id: "_rht_toaster", style: { position: "fixed", zIndex: 9999, top: I, left: I, right: I, bottom: I, pointerEvents: "none", ...n }, className: s, onMouseEnter: c.startPause, onMouseLeave: c.endPause }, a.map((l) => {
    let u = l.position || t, f = c.calculateOffset(l, { reverseOrder: e, gutter: i, defaultPosition: t }), p = Rt(u, f);
    return d.createElement(Tt, { id: l.id, key: l.id, onHeightUpdate: c.updateHeight, className: l.visible ? At : "", style: p }, l.type === "custom" ? Y(l.message, l) : r ? r(l) : d.createElement(Mt, { toast: l, position: u }));
  }));
};
function ce(e, t) {
  if (typeof e == "function")
    return e(t);
  e != null && (e.current = t);
}
function be(...e) {
  return (t) => {
    let o = !1;
    const i = e.map((r) => {
      const n = ce(r, t);
      return !o && typeof n == "function" && (o = !0), n;
    });
    if (o)
      return () => {
        for (let r = 0; r < i.length; r++) {
          const n = i[r];
          typeof n == "function" ? n() : ce(e[r], null);
        }
      };
  };
}
function Kt(...e) {
  return d.useCallback(be(...e), e);
}
// @__NO_SIDE_EFFECTS__
function we(e) {
  const t = /* @__PURE__ */ jt(e), o = d.forwardRef((i, r) => {
    const { children: n, ...s } = i, a = d.Children.toArray(n), c = a.find(_t);
    if (c) {
      const l = c.props.children, u = a.map((f) => f === c ? d.Children.count(l) > 1 ? d.Children.only(null) : d.isValidElement(l) ? l.props.children : null : f);
      return /* @__PURE__ */ P(t, { ...s, ref: r, children: d.isValidElement(l) ? d.cloneElement(l, void 0, u) : null });
    }
    return /* @__PURE__ */ P(t, { ...s, ref: r, children: n });
  });
  return o.displayName = `${e}.Slot`, o;
}
var eo = /* @__PURE__ */ we("Slot");
// @__NO_SIDE_EFFECTS__
function jt(e) {
  const t = d.forwardRef((o, i) => {
    const { children: r, ...n } = o;
    if (d.isValidElement(r)) {
      const s = kt(r), a = zt(n, r.props);
      return r.type !== d.Fragment && (a.ref = i ? be(i, s) : s), d.cloneElement(r, a);
    }
    return d.Children.count(r) > 1 ? d.Children.only(null) : null;
  });
  return t.displayName = `${e}.SlotClone`, t;
}
var xe = Symbol("radix.slottable");
// @__NO_SIDE_EFFECTS__
function Dt(e) {
  const t = ({ children: o }) => /* @__PURE__ */ P(Ne, { children: o });
  return t.displayName = `${e}.Slottable`, t.__radixId = xe, t;
}
var to = /* @__PURE__ */ Dt("Slottable");
function _t(e) {
  return d.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === xe;
}
function zt(e, t) {
  const o = { ...t };
  for (const i in t) {
    const r = e[i], n = t[i];
    /^on[A-Z]/.test(i) ? r && n ? o[i] = (...a) => {
      const c = n(...a);
      return r(...a), c;
    } : r && (o[i] = r) : i === "style" ? o[i] = { ...r, ...n } : i === "className" && (o[i] = [r, n].filter(Boolean).join(" "));
  }
  return { ...e, ...o };
}
function kt(e) {
  let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, o = t && "isReactWarning" in t && t.isReactWarning;
  return o ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
}
var Wt = [
  "a",
  "button",
  "div",
  "form",
  "h2",
  "h3",
  "img",
  "input",
  "label",
  "li",
  "nav",
  "ol",
  "p",
  "select",
  "span",
  "svg",
  "ul"
], Lt = Wt.reduce((e, t) => {
  const o = /* @__PURE__ */ we(`Primitive.${t}`), i = d.forwardRef((r, n) => {
    const { asChild: s, ...a } = r, c = s ? o : t;
    return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ P(c, { ...a, ref: n });
  });
  return i.displayName = `Primitive.${t}`, { ...e, [t]: i };
}, {});
function oo(e, t) {
  e && Pe.flushSync(() => e.dispatchEvent(t));
}
var It = Object.freeze({
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
  position: "absolute",
  border: 0,
  width: 1,
  height: 1,
  padding: 0,
  margin: -1,
  overflow: "hidden",
  clip: "rect(0, 0, 0, 0)",
  whiteSpace: "nowrap",
  wordWrap: "normal"
}), Ht = "VisuallyHidden", Ee = d.forwardRef(
  (e, t) => /* @__PURE__ */ P(
    Lt.span,
    {
      ...e,
      ref: t,
      style: { ...It, ...e.style }
    }
  )
);
Ee.displayName = Ht;
var no = Ee;
function ro(e, t) {
  const o = d.createContext(t), i = (n) => {
    const { children: s, ...a } = n, c = d.useMemo(() => a, Object.values(a));
    return /* @__PURE__ */ P(o.Provider, { value: c, children: s });
  };
  i.displayName = e + "Provider";
  function r(n) {
    const s = d.useContext(o);
    if (s) return s;
    if (t !== void 0) return t;
    throw new Error(`\`${n}\` must be used within \`${e}\``);
  }
  return [i, r];
}
function io(e, t = []) {
  let o = [];
  function i(n, s) {
    const a = d.createContext(s), c = o.length;
    o = [...o, s];
    const l = (f) => {
      const { scope: p, children: m, ...y } = f, E = p?.[e]?.[c] || a, Ce = d.useMemo(() => y, Object.values(y));
      return /* @__PURE__ */ P(E.Provider, { value: Ce, children: m });
    };
    l.displayName = n + "Provider";
    function u(f, p) {
      const m = p?.[e]?.[c] || a, y = d.useContext(m);
      if (y) return y;
      if (s !== void 0) return s;
      throw new Error(`\`${f}\` must be used within \`${n}\``);
    }
    return [l, u];
  }
  const r = () => {
    const n = o.map((s) => d.createContext(s));
    return function(a) {
      const c = a?.[e] || n;
      return d.useMemo(
        () => ({ [`__scope${e}`]: { ...a, [e]: c } }),
        [a, c]
      );
    };
  };
  return r.scopeName = e, [i, Bt(r, ...t)];
}
function Bt(...e) {
  const t = e[0];
  if (e.length === 1) return t;
  const o = () => {
    const i = e.map((r) => ({
      useScope: r(),
      scopeName: r.scopeName
    }));
    return function(n) {
      const s = i.reduce((a, { useScope: c, scopeName: l }) => {
        const f = c(n)[`__scope${l}`];
        return { ...a, ...f };
      }, {});
      return d.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
    };
  };
  return o.scopeName = t.scopeName, o;
}
function so(e, t, { checkForDefaultPrevented: o = !0 } = {}) {
  return function(r) {
    if (e?.(r), o === !1 || !r.defaultPrevented)
      return t?.(r);
  };
}
var Se = globalThis?.document ? d.useLayoutEffect : () => {
}, Ft = d[" useInsertionEffect ".trim().toString()] || Se;
function ao({
  prop: e,
  defaultProp: t,
  onChange: o = () => {
  },
  caller: i
}) {
  const [r, n, s] = Yt({
    defaultProp: t,
    onChange: o
  }), a = e !== void 0, c = a ? e : r;
  {
    const u = d.useRef(e !== void 0);
    d.useEffect(() => {
      const f = u.current;
      f !== a && console.warn(
        `${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
      ), u.current = a;
    }, [a, i]);
  }
  const l = d.useCallback(
    (u) => {
      if (a) {
        const f = Vt(u) ? u(e) : u;
        f !== e && s.current?.(f);
      } else
        n(u);
    },
    [a, e, n, s]
  );
  return [c, l];
}
function Yt({
  defaultProp: e,
  onChange: t
}) {
  const [o, i] = d.useState(e), r = d.useRef(o), n = d.useRef(t);
  return Ft(() => {
    n.current = t;
  }, [t]), d.useEffect(() => {
    r.current !== o && (n.current?.(o), r.current = o);
  }, [o, r]), [o, i, n];
}
function Vt(e) {
  return typeof e == "function";
}
function co(e) {
  const [t, o] = d.useState(void 0);
  return Se(() => {
    if (e) {
      o({ width: e.offsetWidth, height: e.offsetHeight });
      const i = new ResizeObserver((r) => {
        if (!Array.isArray(r) || !r.length)
          return;
        const n = r[0];
        let s, a;
        if ("borderBoxSize" in n) {
          const c = n.borderBoxSize, l = Array.isArray(c) ? c[0] : c;
          s = l.inlineSize, a = l.blockSize;
        } else
          s = e.offsetWidth, a = e.offsetHeight;
        o({ width: s, height: a });
      });
      return i.observe(e, { box: "border-box" }), () => i.unobserve(e);
    } else
      o(void 0);
  }, [e]), t;
}
var U = { exports: {} };
var le;
function Xt() {
  return le || (le = 1, (function(e) {
    (function() {
      var t = {}.hasOwnProperty;
      function o() {
        for (var n = "", s = 0; s < arguments.length; s++) {
          var a = arguments[s];
          a && (n = r(n, i(a)));
        }
        return n;
      }
      function i(n) {
        if (typeof n == "string" || typeof n == "number")
          return n;
        if (typeof n != "object")
          return "";
        if (Array.isArray(n))
          return o.apply(null, n);
        if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
          return n.toString();
        var s = "";
        for (var a in n)
          t.call(n, a) && n[a] && (s = r(s, a));
        return s;
      }
      function r(n, s) {
        return s ? n ? n + " " + s : n + s : n;
      }
      e.exports ? (o.default = o, e.exports = o) : window.classNames = o;
    })();
  })(U)), U.exports;
}
var qt = Xt();
const lo = /* @__PURE__ */ Me(qt);
export {
  Jt as O,
  Lt as P,
  no as R,
  eo as S,
  It as V,
  ao as a,
  so as b,
  io as c,
  co as d,
  h as e,
  Gt as f,
  we as g,
  ro as h,
  Se as i,
  be as j,
  oo as k,
  Dt as l,
  to as m,
  Kt as u,
  lo as y
};
