import * as d from "react";
import { useEffect as q, useCallback as re, useState as Se, useRef as Ce } from "react";
import * as Oe from "react-dom";
import { jsx as $, Fragment as Pe } from "react/jsx-runtime";
import { g as $e } from "./chunk-3RDGTRSB.DySNCMmQ.js";
function Ne(e, t) {
  typeof e == "function" ? e(t) : e != null && (e.current = t);
}
function ce(...e) {
  return (t) => e.forEach((o) => Ne(o, t));
}
function Vt(...e) {
  return d.useCallback(ce(...e), e);
}
var le = d.forwardRef((e, t) => {
  const { children: o, ...n } = e, i = d.Children.toArray(o), r = i.find(je);
  if (r) {
    const s = r.props.children, a = i.map((c) => c === r ? d.Children.count(s) > 1 ? d.Children.only(null) : d.isValidElement(s) ? s.props.children : null : c);
    return /* @__PURE__ */ $(Z, { ...n, ref: t, children: d.isValidElement(s) ? d.cloneElement(s, void 0, a) : null });
  }
  return /* @__PURE__ */ $(Z, { ...n, ref: t, children: o });
});
le.displayName = "Slot";
var Z = d.forwardRef((e, t) => {
  const { children: o, ...n } = e;
  if (d.isValidElement(o)) {
    const i = Te(o);
    return d.cloneElement(o, {
      ...Ae(n, o.props),
      // @ts-ignore
      ref: t ? ce(t, i) : i
    });
  }
  return d.Children.count(o) > 1 ? d.Children.only(null) : null;
});
Z.displayName = "SlotClone";
var Me = ({ children: e }) => /* @__PURE__ */ $(Pe, { children: e });
function je(e) {
  return d.isValidElement(e) && e.type === Me;
}
function Ae(e, t) {
  const o = { ...t };
  for (const n in t) {
    const i = e[n], r = t[n];
    /^on[A-Z]/.test(n) ? i && r ? o[n] = (...a) => {
      r(...a), i(...a);
    } : i && (o[n] = i) : n === "style" ? o[n] = { ...i, ...r } : n === "className" && (o[n] = [i, r].filter(Boolean).join(" "));
  }
  return { ...e, ...o };
}
function Te(e) {
  var n, i;
  let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = t && "isReactWarning" in t && t.isReactWarning;
  return o ? e.ref : (t = (i = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : i.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
}
var ze = [
  "a",
  "button",
  "div",
  "form",
  "h2",
  "h3",
  "img",
  "input",
  "label",
  "li",
  "nav",
  "ol",
  "p",
  "span",
  "svg",
  "ul"
], Re = ze.reduce((e, t) => {
  const o = d.forwardRef((n, i) => {
    const { asChild: r, ...s } = n, a = r ? le : t;
    return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ $(a, { ...s, ref: i });
  });
  return o.displayName = `Primitive.${t}`, { ...e, [t]: o };
}, {});
function Ut(e, t) {
  e && Oe.flushSync(() => e.dispatchEvent(t));
}
var ke = "VisuallyHidden", de = d.forwardRef(
  (e, t) => /* @__PURE__ */ $(
    Re.span,
    {
      ...e,
      ref: t,
      style: {
        // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.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",
        ...e.style
      }
    }
  )
);
de.displayName = ke;
var qt = de, ue = { exports: {} };
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
(function(e) {
  (function() {
    var t = {}.hasOwnProperty;
    function o() {
      for (var n = [], i = 0; i < arguments.length; i++) {
        var r = arguments[i];
        if (r) {
          var s = typeof r;
          if (s === "string" || s === "number")
            n.push(r);
          else if (Array.isArray(r)) {
            if (r.length) {
              var a = o.apply(null, r);
              a && n.push(a);
            }
          } else if (s === "object") {
            if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]")) {
              n.push(r.toString());
              continue;
            }
            for (var c in r)
              t.call(r, c) && r[c] && n.push(c);
          }
        }
      }
      return n.join(" ");
    }
    e.exports ? (o.default = o, e.exports = o) : window.classNames = o;
  })();
})(ue);
var De = ue.exports;
const Zt = /* @__PURE__ */ $e(De);
function Qt(e, t) {
  const o = d.createContext(t);
  function n(r) {
    const { children: s, ...a } = r, c = d.useMemo(() => a, Object.values(a));
    return /* @__PURE__ */ $(o.Provider, { value: c, children: s });
  }
  function i(r) {
    const s = d.useContext(o);
    if (s) return s;
    if (t !== void 0) return t;
    throw new Error(`\`${r}\` must be used within \`${e}\``);
  }
  return n.displayName = e + "Provider", [n, i];
}
function Gt(e, t = []) {
  let o = [];
  function n(r, s) {
    const a = d.createContext(s), c = o.length;
    o = [...o, s];
    function l(p) {
      const { scope: f, children: m, ...y } = p, E = (f == null ? void 0 : f[e][c]) || a, Ee = d.useMemo(() => y, Object.values(y));
      return /* @__PURE__ */ $(E.Provider, { value: Ee, children: m });
    }
    function u(p, f) {
      const m = (f == null ? void 0 : f[e][c]) || a, y = d.useContext(m);
      if (y) return y;
      if (s !== void 0) return s;
      throw new Error(`\`${p}\` must be used within \`${r}\``);
    }
    return l.displayName = r + "Provider", [l, u];
  }
  const i = () => {
    const r = o.map((s) => d.createContext(s));
    return function(a) {
      const c = (a == null ? void 0 : a[e]) || r;
      return d.useMemo(
        () => ({ [`__scope${e}`]: { ...a, [e]: c } }),
        [a, c]
      );
    };
  };
  return i.scopeName = e, [n, We(i, ...t)];
}
function We(...e) {
  const t = e[0];
  if (e.length === 1) return t;
  const o = () => {
    const n = e.map((i) => ({
      useScope: i(),
      scopeName: i.scopeName
    }));
    return function(r) {
      const s = n.reduce((a, { useScope: c, scopeName: l }) => {
        const p = c(r)[`__scope${l}`];
        return { ...a, ...p };
      }, {});
      return d.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
    };
  };
  return o.scopeName = t.scopeName, o;
}
function Jt(e, t, { checkForDefaultPrevented: o = !0 } = {}) {
  return function(i) {
    if (e == null || e(i), o === !1 || !i.defaultPrevented)
      return t == null ? void 0 : t(i);
  };
}
var _e = globalThis != null && globalThis.document ? d.useLayoutEffect : () => {
};
function fe(e) {
  const t = d.useRef(e);
  return d.useEffect(() => {
    t.current = e;
  }), d.useMemo(() => (...o) => {
    var n;
    return (n = t.current) == null ? void 0 : n.call(t, ...o);
  }, []);
}
function Kt({
  prop: e,
  defaultProp: t,
  onChange: o = () => {
  }
}) {
  const [n, i] = Be({ defaultProp: t, onChange: o }), r = e !== void 0, s = r ? e : n, a = fe(o), c = d.useCallback(
    (l) => {
      if (r) {
        const p = typeof l == "function" ? l(e) : l;
        p !== e && a(p);
      } else
        i(l);
    },
    [r, e, i, a]
  );
  return [s, c];
}
function Be({
  defaultProp: e,
  onChange: t
}) {
  const o = d.useState(e), [n] = o, i = d.useRef(n), r = fe(t);
  return d.useEffect(() => {
    i.current !== n && (r(n), i.current = n);
  }, [n, i, r]), o;
}
function eo(e) {
  const [t, o] = d.useState(void 0);
  return _e(() => {
    if (e) {
      o({ width: e.offsetWidth, height: e.offsetHeight });
      const n = new ResizeObserver((i) => {
        if (!Array.isArray(i) || !i.length)
          return;
        const r = i[0];
        let s, a;
        if ("borderBoxSize" in r) {
          const c = r.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 n.observe(e, { box: "border-box" }), () => n.unobserve(e);
    } else
      o(void 0);
  }, [e]), t;
}
const pe = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakSet();
let C, ee = 0, te = 0;
const w = "__aa_tgt", W = "__aa_del", H = "__aa_new", Fe = (e) => {
  const t = Ue(e);
  t && t.forEach((o) => qe(o));
}, Ie = (e) => {
  e.forEach((t) => {
    t.target === C && Ye(), g.has(t.target) && M(t.target);
  });
};
function He(e) {
  const t = Q.get(e);
  t == null || t.disconnect();
  let o = g.get(e), n = 0;
  const i = 5;
  o || (o = R(e), g.set(e, o));
  const { offsetWidth: r, offsetHeight: s } = C, c = [
    o.top - i,
    r - (o.left + i + o.width),
    s - (o.top + i + o.height),
    o.left - i
  ].map((u) => `${-1 * Math.floor(u)}px`).join(" "), l = new IntersectionObserver(() => {
    ++n > 1 && M(e);
  }, {
    root: C,
    threshold: 1,
    rootMargin: c
  });
  l.observe(e), Q.set(e, l);
}
function M(e) {
  clearTimeout(I.get(e));
  const t = X(e), o = _(t) ? 500 : t.duration;
  I.set(e, setTimeout(async () => {
    const n = N.get(e);
    try {
      await (n == null ? void 0 : n.finished), g.set(e, R(e)), He(e);
    } catch {
    }
  }, o));
}
function Ye() {
  clearTimeout(I.get(C)), I.set(C, setTimeout(() => {
    pe.forEach((e) => ye(e, (t) => me(() => M(t))));
  }, 100));
}
function Xe(e) {
  setTimeout(() => {
    Le.set(e, setInterval(() => me(M.bind(null, e)), 2e3));
  }, Math.round(2e3 * Math.random()));
}
function me(e) {
  typeof requestIdleCallback == "function" ? requestIdleCallback(() => e()) : requestAnimationFrame(() => e());
}
let G, A;
const Ve = typeof window < "u" && "ResizeObserver" in window;
Ve && (C = document.documentElement, G = new MutationObserver(Fe), A = new ResizeObserver(Ie), window.addEventListener("scroll", () => {
  te = window.scrollY, ee = window.scrollX;
}), A.observe(C));
function Ue(e) {
  return e.reduce((n, i) => [
    ...n,
    ...Array.from(i.addedNodes),
    ...Array.from(i.removedNodes)
  ], []).every((n) => n.nodeName === "#comment") ? !1 : e.reduce((n, i) => {
    if (n === !1)
      return !1;
    if (i.target instanceof Element) {
      if (U(i.target), !n.has(i.target)) {
        n.add(i.target);
        for (let r = 0; r < i.target.children.length; r++) {
          const s = i.target.children.item(r);
          if (s) {
            if (W in s)
              return !1;
            U(i.target, s), n.add(s);
          }
        }
      }
      if (i.removedNodes.length)
        for (let r = 0; r < i.removedNodes.length; r++) {
          const s = i.removedNodes[r];
          if (W in s)
            return !1;
          s instanceof Element && (n.add(s), U(i.target, s), T.set(s, [
            i.previousSibling,
            i.nextSibling
          ]));
        }
    }
    return n;
  }, /* @__PURE__ */ new Set());
}
function U(e, t) {
  !t && !(w in e) ? Object.defineProperty(e, w, { value: e }) : t && !(w in t) && Object.defineProperty(t, w, { value: e });
}
function qe(e) {
  var t;
  const o = e.isConnected, n = g.has(e);
  o && T.has(e) && T.delete(e), N.has(e) && ((t = N.get(e)) === null || t === void 0 || t.cancel()), H in e ? ie(e) : n && o ? Qe(e) : n && !o ? Ge(e) : ie(e);
}
function v(e) {
  return Number(e.replace(/[^0-9.\-]/g, ""));
}
function Ze(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 R(e) {
  const t = e.getBoundingClientRect(), { x: o, y: n } = Ze(e);
  return {
    top: t.top + n,
    left: t.left + o,
    width: t.width,
    height: t.height
  };
}
function he(e, t, o) {
  let n = t.width, i = t.height, r = 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);
    n -= u, r -= u, i -= l, s -= l;
  }
  return [n, r, i, s].map(Math.round);
}
function X(e) {
  return w in e && z.has(e[w]) ? z.get(e[w]) : { duration: 250, easing: "ease-in-out" };
}
function ge(e) {
  if (w in e)
    return e[w];
}
function oe(e) {
  const t = ge(e);
  return t ? k.has(t) : !1;
}
function ye(e, ...t) {
  t.forEach((o) => o(e, z.has(e)));
  for (let o = 0; o < e.children.length; o++) {
    const n = e.children.item(o);
    n && t.forEach((i) => i(n, z.has(n)));
  }
}
function ne(e) {
  return Array.isArray(e) ? e : [e];
}
function _(e) {
  return typeof e == "function";
}
function Qe(e) {
  const t = g.get(e), o = R(e);
  if (!oe(e))
    return g.set(e, o);
  let n;
  if (!t)
    return;
  const i = X(e);
  if (typeof i != "function") {
    const r = t.left - o.left, s = t.top - o.top, [a, c, l, u] = he(e, t, o), p = {
      transform: `translate(${r}px, ${s}px)`
    }, f = {
      transform: "translate(0, 0)"
    };
    a !== c && (p.width = `${a}px`, f.width = `${c}px`), l !== u && (p.height = `${l}px`, f.height = `${u}px`), n = e.animate([p, f], {
      duration: i.duration,
      easing: i.easing
    });
  } else {
    const [r] = ne(i(e, "remain", t, o));
    n = new Animation(r), n.play();
  }
  N.set(e, n), g.set(e, o), n.addEventListener("finish", M.bind(null, e));
}
function ie(e) {
  H in e && delete e[H];
  const t = R(e);
  g.set(e, t);
  const o = X(e);
  if (!oe(e))
    return;
  let n;
  if (typeof o != "function")
    n = 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 [i] = ne(o(e, "add", t));
    n = new Animation(i), n.play();
  }
  N.set(e, n), n.addEventListener("finish", M.bind(null, e));
}
function se(e, t) {
  var o;
  e.remove(), g.delete(e), T.delete(e), N.delete(e), (o = Q.get(e)) === null || o === void 0 || o.disconnect(), setTimeout(() => {
    if (W in e && delete e[W], Object.defineProperty(e, H, { value: !0, configurable: !0 }), t && e instanceof HTMLElement)
      for (const n in t)
        e.style[n] = "";
  }, 0);
}
function Ge(e) {
  var t;
  if (!T.has(e) || !g.has(e))
    return;
  const [o, n] = T.get(e);
  Object.defineProperty(e, W, { value: !0, configurable: !0 });
  const i = window.scrollX, r = window.scrollY;
  if (n && n.parentNode && n.parentNode instanceof Element ? n.parentNode.insertBefore(e, n) : o && o.parentNode ? o.parentNode.appendChild(e) : (t = ge(e)) === null || t === void 0 || t.appendChild(e), !oe(e))
    return se(e);
  const [s, a, c, l] = Ke(e), u = X(e), p = g.get(e);
  (i !== ee || r !== te) && Je(e, i, r, u);
  let f, m = {
    position: "absolute",
    top: `${s}px`,
    left: `${a}px`,
    width: `${c}px`,
    height: `${l}px`,
    margin: "0",
    pointerEvents: "none",
    transformOrigin: "center",
    zIndex: "100"
  };
  if (!_(u))
    Object.assign(e.style, m), f = 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", p));
    (E == null ? void 0 : E.styleReset) !== !1 && (m = (E == null ? void 0 : E.styleReset) || m, Object.assign(e.style, m)), f = new Animation(y), f.play();
  }
  N.set(e, f), f.addEventListener("finish", se.bind(null, e, m));
}
function Je(e, t, o, n) {
  const i = ee - t, r = te - o, s = document.documentElement.style.scrollBehavior;
  if (getComputedStyle(C).scrollBehavior === "smooth" && (document.documentElement.style.scrollBehavior = "auto"), window.scrollTo(window.scrollX + i, window.scrollY + r), !e.parentElement)
    return;
  const c = e.parentElement;
  let l = c.clientHeight, u = c.clientWidth;
  const p = performance.now();
  function f() {
    requestAnimationFrame(() => {
      if (!_(n)) {
        const m = l - c.clientHeight, y = u - c.clientWidth;
        p + n.duration > performance.now() ? (window.scrollTo({
          left: window.scrollX - y,
          top: window.scrollY - m
        }), l = c.clientHeight, u = c.clientWidth, f()) : document.documentElement.style.scrollBehavior = s;
      }
    });
  }
  f();
}
function Ke(e) {
  const t = g.get(e), [o, , n] = he(e, t, R(e));
  let i = e.parentElement;
  for (; i && (getComputedStyle(i).position === "static" || i instanceof HTMLBodyElement); )
    i = i.parentElement;
  i || (i = document.body);
  const r = getComputedStyle(i), s = g.get(i) || R(i), a = Math.round(t.top - s.top) - v(r.borderTopWidth), c = Math.round(t.left - s.left) - v(r.borderLeftWidth);
  return [a, c, o, n];
}
function to(e, t = {}) {
  return G && A && (window.matchMedia("(prefers-reduced-motion: reduce)").matches && !_(t) && !t.disrespectUserMotionPreference || (k.add(e), getComputedStyle(e).position === "static" && Object.assign(e.style, { position: "relative" }), ye(e, M, Xe, (i) => A == null ? void 0 : A.observe(i)), _(t) ? z.set(e, t) : z.set(e, { duration: 250, easing: "ease-in-out", ...t }), G.observe(e, { childList: !0 }), pe.add(e))), Object.freeze({
    parent: e,
    enable: () => {
      k.add(e);
    },
    disable: () => {
      k.delete(e);
    },
    isEnabled: () => k.has(e)
  });
}
let et = { data: "" }, tt = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || et, ot = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, nt = /\/\*[^]*?\*\/|  +/g, ae = /\n+/g, S = (e, t) => {
  let o = "", n = "", i = "";
  for (let r in e) {
    let s = e[r];
    r[0] == "@" ? r[1] == "i" ? o = r + " " + s + ";" : n += r[1] == "f" ? S(s, r) : r + "{" + S(s, r[1] == "k" ? "" : t) + "}" : typeof s == "object" ? n += S(s, t ? t.replace(/([^,])+/g, (a) => r.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (c) => /&/.test(c) ? c.replace(/&/g, a) : a ? a + " " + c : c)) : r) : s != null && (r = /^--/.test(r) ? r : r.replace(/[A-Z]/g, "-$&").toLowerCase(), i += S.p ? S.p(r, s) : r + ":" + s + ";");
  }
  return o + (t && i ? t + "{" + i + "}" : i) + n;
}, b = {}, ve = (e) => {
  if (typeof e == "object") {
    let t = "";
    for (let o in e) t += o + ve(e[o]);
    return t;
  }
  return e;
}, rt = (e, t, o, n, i) => {
  let r = ve(e), s = b[r] || (b[r] = ((c) => {
    let l = 0, u = 11;
    for (; l < c.length; ) u = 101 * u + c.charCodeAt(l++) >>> 0;
    return "go" + u;
  })(r));
  if (!b[s]) {
    let c = r !== e ? e : ((l) => {
      let u, p, f = [{}];
      for (; u = ot.exec(l.replace(nt, "")); ) u[4] ? f.shift() : u[3] ? (p = u[3].replace(ae, " ").trim(), f.unshift(f[0][p] = f[0][p] || {})) : f[0][u[1]] = u[2].replace(ae, " ").trim();
      return f[0];
    })(e);
    b[s] = S(i ? { ["@keyframes " + s]: c } : c, o ? "" : "." + s);
  }
  let a = o && b.g ? b.g : null;
  return o && (b.g = b[s]), ((c, l, u, p) => {
    p ? l.data = l.data.replace(p, c) : l.data.indexOf(c) === -1 && (l.data = u ? c + l.data : l.data + c);
  })(b[s], t, n, a), s;
}, it = (e, t, o) => e.reduce((n, i, r) => {
  let s = t[r];
  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 n + i + (s ?? "");
}, "");
function V(e) {
  let t = this || {}, o = e.call ? e(t.p) : e;
  return rt(o.unshift ? o.raw ? it(o, [].slice.call(arguments, 1), t.p) : o.reduce((n, i) => Object.assign(n, i && i.call ? i(t.p) : i), {}) : o, tt(t.target), t.g, t.o, t.k);
}
let be, J, K;
V.bind({ g: 1 });
let x = V.bind({ k: 1 });
function st(e, t, o, n) {
  S.p = t, be = e, J = o, K = n;
}
function O(e, t) {
  let o = this || {};
  return function() {
    let n = arguments;
    function i(r, s) {
      let a = Object.assign({}, r), c = a.className || i.className;
      o.p = Object.assign({ theme: J && J() }, a), o.o = / *go\d+/.test(c), a.className = V.apply(o, n) + (c ? " " + c : "");
      let l = e;
      return e[0] && (l = a.as || e, delete a.as), K && l[0] && K(a), be(l, a);
    }
    return i;
  };
}
var at = (e) => typeof e == "function", Y = (e, t) => at(e) ? e(t) : e, ct = /* @__PURE__ */ (() => {
  let e = 0;
  return () => (++e).toString();
})(), we = /* @__PURE__ */ (() => {
  let e;
  return () => {
    if (e === void 0 && typeof window < "u") {
      let t = matchMedia("(prefers-reduced-motion: reduce)");
      e = !t || t.matches;
    }
    return e;
  };
})(), lt = 20, xe = (e, t) => {
  switch (t.type) {
    case 0:
      return { ...e, toasts: [t.toast, ...e.toasts].slice(0, lt) };
    case 1:
      return { ...e, toasts: e.toasts.map((r) => r.id === t.toast.id ? { ...r, ...t.toast } : r) };
    case 2:
      let { toast: o } = t;
      return xe(e, { type: e.toasts.find((r) => r.id === o.id) ? 1 : 0, toast: o });
    case 3:
      let { toastId: n } = t;
      return { ...e, toasts: e.toasts.map((r) => r.id === n || n === void 0 ? { ...r, dismissed: !0, visible: !1 } : r) };
    case 4:
      return t.toastId === void 0 ? { ...e, toasts: [] } : { ...e, toasts: e.toasts.filter((r) => r.id !== t.toastId) };
    case 5:
      return { ...e, pausedAt: t.time };
    case 6:
      let i = t.time - (e.pausedAt || 0);
      return { ...e, pausedAt: void 0, toasts: e.toasts.map((r) => ({ ...r, pauseDuration: r.pauseDuration + i })) };
  }
}, F = [], P = { toasts: [], pausedAt: void 0 }, j = (e) => {
  P = xe(P, e), F.forEach((t) => {
    t(P);
  });
}, dt = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, ut = (e = {}) => {
  let [t, o] = Se(P), n = Ce(P);
  q(() => (n.current !== P && o(P), F.push(o), () => {
    let r = F.indexOf(o);
    r > -1 && F.splice(r, 1);
  }), []);
  let i = t.toasts.map((r) => {
    var s, a, c;
    return { ...e, ...e[r.type], ...r, removeDelay: r.removeDelay || ((s = e[r.type]) == null ? void 0 : s.removeDelay) || (e == null ? void 0 : e.removeDelay), duration: r.duration || ((a = e[r.type]) == null ? void 0 : a.duration) || (e == null ? void 0 : e.duration) || dt[r.type], style: { ...e.style, ...(c = e[r.type]) == null ? void 0 : c.style, ...r.style } };
  });
  return { ...t, toasts: i };
}, ft = (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 == null ? void 0 : o.id) || ct() }), B = (e) => (t, o) => {
  let n = ft(t, e, o);
  return j({ type: 2, toast: n }), n.id;
}, h = (e, t) => B("blank")(e, t);
h.error = B("error");
h.success = B("success");
h.loading = B("loading");
h.custom = B("custom");
h.dismiss = (e) => {
  j({ type: 3, toastId: e });
};
h.remove = (e) => j({ type: 4, toastId: e });
h.promise = (e, t, o) => {
  let n = h.loading(t.loading, { ...o, ...o == null ? void 0 : o.loading });
  return typeof e == "function" && (e = e()), e.then((i) => {
    let r = t.success ? Y(t.success, i) : void 0;
    return r ? h.success(r, { id: n, ...o, ...o == null ? void 0 : o.success }) : h.dismiss(n), i;
  }).catch((i) => {
    let r = t.error ? Y(t.error, i) : void 0;
    r ? h.error(r, { id: n, ...o, ...o == null ? void 0 : o.error }) : h.dismiss(n);
  }), e;
};
var pt = (e, t) => {
  j({ type: 1, toast: { id: e, height: t } });
}, mt = () => {
  j({ type: 5, time: Date.now() });
}, D = /* @__PURE__ */ new Map(), ht = 1e3, gt = (e, t = ht) => {
  if (D.has(e)) return;
  let o = setTimeout(() => {
    D.delete(e), j({ type: 4, toastId: e });
  }, t);
  D.set(e, o);
}, yt = (e) => {
  let { toasts: t, pausedAt: o } = ut(e);
  q(() => {
    if (o) return;
    let r = Date.now(), s = t.map((a) => {
      if (a.duration === 1 / 0) return;
      let c = (a.duration || 0) + a.pauseDuration - (r - 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 n = re(() => {
    o && j({ type: 6, time: Date.now() });
  }, [o]), i = re((r, s) => {
    let { reverseOrder: a = !1, gutter: c = 8, defaultPosition: l } = s || {}, u = t.filter((m) => (m.position || l) === (r.position || l) && m.height), p = u.findIndex((m) => m.id === r.id), f = u.filter((m, y) => y < p && m.visible).length;
    return u.filter((m) => m.visible).slice(...a ? [f + 1] : [0, f]).reduce((m, y) => m + (y.height || 0) + c, 0);
  }, [t]);
  return q(() => {
    t.forEach((r) => {
      if (r.dismissed) gt(r.id, r.removeDelay);
      else {
        let s = D.get(r.id);
        s && (clearTimeout(s), D.delete(r.id));
      }
    });
  }, [t]), { toasts: t, handlers: { updateHeight: pt, startPause: mt, endPause: n, calculateOffset: i } };
}, vt = x`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`, bt = x`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`, wt = x`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`, xt = O("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e) => e.primary || "#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

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

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

  animation: ${Ct} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${Ot} 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;
  }
`, $t = O("div")`
  position: absolute;
`, Nt = O("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`, Mt = x`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`, jt = O("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${Mt} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`, At = ({ toast: e }) => {
  let { icon: t, type: o, iconTheme: n } = e;
  return t !== void 0 ? typeof t == "string" ? d.createElement(jt, null, t) : t : o === "blank" ? null : d.createElement(Nt, null, d.createElement(St, { ...n }), o !== "loading" && d.createElement($t, null, o === "error" ? d.createElement(xt, { ...n }) : d.createElement(Pt, { ...n })));
}, Tt = (e) => `
0% {transform: translate3d(0,${e * -200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`, zt = (e) => `
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e * -150}%,-1px) scale(.6); opacity:0;}
`, Rt = "0%{opacity:0;} 100%{opacity:1;}", kt = "0%{opacity:1;} 100%{opacity:0;}", Dt = 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;
`, Wt = O("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`, _t = (e, t) => {
  let o = e.includes("top") ? 1 : -1, [n, i] = we() ? [Rt, kt] : [Tt(o), zt(o)];
  return { animation: t ? `${x(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${x(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
}, Bt = d.memo(({ toast: e, position: t, style: o, children: n }) => {
  let i = e.height ? _t(e.position || t || "top-center", e.visible) : { opacity: 0 }, r = d.createElement(At, { toast: e }), s = d.createElement(Wt, { ...e.ariaProps }, Y(e.message, e));
  return d.createElement(Dt, { className: e.className, style: { ...i, ...o, ...e.style } }, typeof n == "function" ? n({ icon: r, message: s }) : d.createElement(d.Fragment, null, r, s));
});
st(d.createElement);
var Lt = ({ id: e, className: t, style: o, onHeightUpdate: n, children: i }) => {
  let r = d.useCallback((s) => {
    if (s) {
      let a = () => {
        let c = s.getBoundingClientRect().height;
        n(e, c);
      };
      a(), new MutationObserver(a).observe(s, { subtree: !0, childList: !0, characterData: !0 });
    }
  }, [e, n]);
  return d.createElement("div", { ref: r, className: t, style: o }, i);
}, Ft = (e, t) => {
  let o = e.includes("top"), n = o ? { 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: we() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t * (o ? 1 : -1)}px)`, ...n, ...i };
}, It = V`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`, L = 16, oo = ({ reverseOrder: e, position: t = "top-center", toastOptions: o, gutter: n, children: i, containerStyle: r, containerClassName: s }) => {
  let { toasts: a, handlers: c } = yt(o);
  return d.createElement("div", { id: "_rht_toaster", style: { position: "fixed", zIndex: 9999, top: L, left: L, right: L, bottom: L, pointerEvents: "none", ...r }, className: s, onMouseEnter: c.startPause, onMouseLeave: c.endPause }, a.map((l) => {
    let u = l.position || t, p = c.calculateOffset(l, { reverseOrder: e, gutter: n, defaultPosition: t }), f = Ft(u, p);
    return d.createElement(Lt, { id: l.id, key: l.id, onHeightUpdate: c.updateHeight, className: l.visible ? It : "", style: f }, l.type === "custom" ? Y(l.message, l) : i ? i(l) : d.createElement(Bt, { toast: l, position: u }));
  }));
};
export {
  oo as O,
  Re as P,
  qt as R,
  le as S,
  de as V,
  Kt as a,
  Jt as b,
  Gt as c,
  eo as d,
  h as e,
  Qt as f,
  _e as g,
  fe as h,
  ce as i,
  to as j,
  Ut as k,
  Me as l,
  Vt as u,
  Zt as y
};
//# sourceMappingURL=index.D1WHzYVh.js.map
