@namuna-nur/ui-kit 1.3.4 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,18 @@
1
- import { p as s, P as S, q as et, u as Ce, v as U, w as tt, x as Pe, y as ce, z as R, D as q, E as rt, F as Re, G as ot, J as nt, K as st, N as at, O as Ne, Q as it, U as ct, V as lt, W as dt, X as ut, Y as pt, Z as ft, _ as vt, $ as mt, a0 as xt } from "./Avatar.tokens.js";
1
+ import { p as s, P as j, q as pt, u as De, v as ke, w as ve, x as R, y as Y, z as B, D as ft, E as vt, F as Ie, G as mt, J as xt, K as Tt, N as ht, O as Me, Q as wt, U as gt, V as yt, W as bt, X as Et, Y as Ct, Z as Pt, _ as Rt, $ as St, a0 as At } from "./Avatar.tokens.js";
2
2
  import * as n from "react";
3
- import * as ht from "react-dom";
4
- import { b as wt, a as P } from "./twMerge.js";
5
- const Tt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 19, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.6 8a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6.5h6a.75.75 0 0 1 .75.75v6A.75.75 0 0 1 7.6 8zm10.5 0a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 12.1.5h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zM1.6 18.5a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6 11h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zm10.5 0a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75z" })), gt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 13, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.45 12.45a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.42.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.28.3.7a1 1 0 0 1-1 1z" })), Te = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M9.73 18.24a1.2 1.2 0 0 1-.85-.35l-4.53-4.53a1.2 1.2 0 0 1 0-1.7 1.2 1.2 0 0 1 1.7 0l3.68 3.69 8.23-8.23a1.2 1.2 0 0 1 1.7 0 1.2 1.2 0 0 1 0 1.7l-9.08 9.07a1.2 1.2 0 0 1-.85.35" })), yt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.36, d: "m7 17.5 10-10M17 17.5 7 7.5" })), bt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 9.49a1.4 1.4 0 0 0-1.4 1.39v9.73c0 .76.64 1.39 1.4 1.39a1.4 1.4 0 0 0 1.39-1.39v-9.73a1.4 1.4 0 0 0-1.4-1.4M12.37 3c-.5 0-.97.19-1.32.54q-.25.28-.4.6-.14.35-.14.71c0 .49.2.97.54 1.32.69.69 1.95.69 2.63 0a1.84 1.84 0 0 0 .39-2.02q-.14-.34-.39-.61A1.8 1.8 0 0 0 12.37 3" })), Et = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 15.51a1.4 1.4 0 0 1-1.4-1.39V4.4c0-.76.64-1.39 1.4-1.39s1.39.63 1.39 1.39v9.73a1.4 1.4 0 0 1-1.4 1.4M12.37 22c-.5 0-.97-.19-1.32-.54a3 3 0 0 1-.4-.6q-.14-.35-.14-.71c0-.49.2-.97.54-1.32a1.94 1.94 0 0 1 2.63 0 1.84 1.84 0 0 1 .39 2.02q-.14.33-.39.61-.54.53-1.31.54" })), Ct = {
6
- success: /* @__PURE__ */ s.jsx(Te, { className: "text-success-10 fill-success-10" }),
7
- danger: /* @__PURE__ */ s.jsx(yt, { className: "text-danger-10 fill-danger-10" }),
8
- info: /* @__PURE__ */ s.jsx(bt, { className: "text-info-10 fill-info-10" }),
9
- warning: /* @__PURE__ */ s.jsx(Et, { className: "text-sidebar-20 fill-sidebar-20" }),
10
- default: /* @__PURE__ */ s.jsx(Te, { className: "text-success-10 fill-success-10" })
3
+ import { useState as _t, useEffect as Nt } from "react";
4
+ import * as jt from "react-dom";
5
+ import { b as Ot, a as P } from "./twMerge.js";
6
+ const Dt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 19, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.6 8a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6.5h6a.75.75 0 0 1 .75.75v6A.75.75 0 0 1 7.6 8zm10.5 0a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 12.1.5h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zM1.6 18.5a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6 11h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zm10.5 0a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75z" })), kt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 13, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.45 12.45a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.42.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.28.3.7a1 1 0 0 1-1 1z" })), Se = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M9.73 18.24a1.2 1.2 0 0 1-.85-.35l-4.53-4.53a1.2 1.2 0 0 1 0-1.7 1.2 1.2 0 0 1 1.7 0l3.68 3.69 8.23-8.23a1.2 1.2 0 0 1 1.7 0 1.2 1.2 0 0 1 0 1.7l-9.08 9.07a1.2 1.2 0 0 1-.85.35" })), It = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.36, d: "m7 17.5 10-10M17 17.5 7 7.5" })), Mt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 9.49a1.4 1.4 0 0 0-1.4 1.39v9.73c0 .76.64 1.39 1.4 1.39a1.4 1.4 0 0 0 1.39-1.39v-9.73a1.4 1.4 0 0 0-1.4-1.4M12.37 3c-.5 0-.97.19-1.32.54q-.25.28-.4.6-.14.35-.14.71c0 .49.2.97.54 1.32.69.69 1.95.69 2.63 0a1.84 1.84 0 0 0 .39-2.02q-.14-.34-.39-.61A1.8 1.8 0 0 0 12.37 3" })), Lt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 15.51a1.4 1.4 0 0 1-1.4-1.39V4.4c0-.76.64-1.39 1.4-1.39s1.39.63 1.39 1.39v9.73a1.4 1.4 0 0 1-1.4 1.4M12.37 22c-.5 0-.97-.19-1.32-.54a3 3 0 0 1-.4-.6q-.14-.35-.14-.71c0-.49.2-.97.54-1.32a1.94 1.94 0 0 1 2.63 0 1.84 1.84 0 0 1 .39 2.02q-.14.33-.39.61-.54.53-1.31.54" })), Ft = {
7
+ success: /* @__PURE__ */ s.jsx(Se, { className: "text-success-10 fill-success-10" }),
8
+ danger: /* @__PURE__ */ s.jsx(It, { className: "text-danger-10 fill-danger-10" }),
9
+ info: /* @__PURE__ */ s.jsx(Mt, { className: "text-info-10 fill-info-10" }),
10
+ warning: /* @__PURE__ */ s.jsx(Lt, { className: "text-sidebar-20 fill-sidebar-20" }),
11
+ default: /* @__PURE__ */ s.jsx(Se, { className: "text-success-10 fill-success-10" })
11
12
  };
12
- var Pt = "VisuallyHidden", G = n.forwardRef(
13
+ var Vt = "VisuallyHidden", Q = n.forwardRef(
13
14
  (e, r) => /* @__PURE__ */ s.jsx(
14
- S.span,
15
+ j.span,
15
16
  {
16
17
  ...e,
17
18
  ref: r,
@@ -32,103 +33,134 @@ var Pt = "VisuallyHidden", G = n.forwardRef(
32
33
  }
33
34
  )
34
35
  );
35
- G.displayName = Pt;
36
- var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toast", [At]), [Ar, X] = Ae(Nt), ke = "ToastViewport", kt = ["F8"], oe = "toast.viewportPause", ne = "toast.viewportResume", Se = n.forwardRef(
36
+ Q.displayName = Vt;
37
+ var $t = Q, me = "ToastProvider", [xe, Ht, Kt] = pt("Toast"), [Le, Yr] = De("Toast", [Kt]), [Wt, J] = Le(me), Fe = (e) => {
38
+ const {
39
+ __scopeToast: r,
40
+ label: t = "Notification",
41
+ duration: o = 5e3,
42
+ swipeDirection: a = "right",
43
+ swipeThreshold: i = 50,
44
+ children: l
45
+ } = e, [v, d] = n.useState(null), [c, p] = n.useState(0), m = n.useRef(!1), w = n.useRef(!1);
46
+ return t.trim() || console.error(
47
+ `Invalid prop \`label\` supplied to \`${me}\`. Expected non-empty \`string\`.`
48
+ ), /* @__PURE__ */ s.jsx(xe.Provider, { scope: r, children: /* @__PURE__ */ s.jsx(
49
+ Wt,
50
+ {
51
+ scope: r,
52
+ label: t,
53
+ duration: o,
54
+ swipeDirection: a,
55
+ swipeThreshold: i,
56
+ toastCount: c,
57
+ viewport: v,
58
+ onViewportChange: d,
59
+ onToastAdd: n.useCallback(() => p((h) => h + 1), []),
60
+ onToastRemove: n.useCallback(() => p((h) => h - 1), []),
61
+ isFocusedToastEscapeKeyDownRef: m,
62
+ isClosePausedRef: w,
63
+ children: l
64
+ }
65
+ ) });
66
+ };
67
+ Fe.displayName = me;
68
+ var Ve = "ToastViewport", zt = ["F8"], le = "toast.viewportPause", de = "toast.viewportResume", $e = n.forwardRef(
37
69
  (e, r) => {
38
70
  const {
39
71
  __scopeToast: t,
40
- hotkey: o = kt,
72
+ hotkey: o = zt,
41
73
  label: a = "Notifications ({hotkey})",
42
- ...c
43
- } = e, l = X(ke, t), m = jt(t), u = n.useRef(null), i = n.useRef(null), p = n.useRef(null), x = n.useRef(null), g = U(r, x, l.onViewportChange), w = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), y = l.toastCount > 0;
74
+ ...i
75
+ } = e, l = J(Ve, t), v = Ht(t), d = n.useRef(null), c = n.useRef(null), p = n.useRef(null), m = n.useRef(null), w = B(r, m, l.onViewportChange), h = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), y = l.toastCount > 0;
44
76
  n.useEffect(() => {
45
- const d = (b) => {
46
- var T;
47
- o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((T = x.current) == null || T.focus());
77
+ const u = (b) => {
78
+ var g;
79
+ o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((g = m.current) == null || g.focus());
48
80
  };
49
- return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
81
+ return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
50
82
  }, [o]), n.useEffect(() => {
51
- const d = u.current, b = x.current;
52
- if (y && d && b) {
53
- const h = () => {
83
+ const u = d.current, b = m.current;
84
+ if (y && u && b) {
85
+ const T = () => {
54
86
  if (!l.isClosePausedRef.current) {
55
- const N = new CustomEvent(oe);
56
- b.dispatchEvent(N), l.isClosePausedRef.current = !0;
87
+ const S = new CustomEvent(le);
88
+ b.dispatchEvent(S), l.isClosePausedRef.current = !0;
57
89
  }
58
- }, T = () => {
90
+ }, g = () => {
59
91
  if (l.isClosePausedRef.current) {
60
- const N = new CustomEvent(ne);
61
- b.dispatchEvent(N), l.isClosePausedRef.current = !1;
92
+ const S = new CustomEvent(de);
93
+ b.dispatchEvent(S), l.isClosePausedRef.current = !1;
62
94
  }
63
- }, E = (N) => {
64
- !d.contains(N.relatedTarget) && T();
95
+ }, E = (S) => {
96
+ !u.contains(S.relatedTarget) && g();
65
97
  }, C = () => {
66
- d.contains(document.activeElement) || T();
98
+ u.contains(document.activeElement) || g();
67
99
  };
68
- return d.addEventListener("focusin", h), d.addEventListener("focusout", E), d.addEventListener("pointermove", h), d.addEventListener("pointerleave", C), window.addEventListener("blur", h), window.addEventListener("focus", T), () => {
69
- d.removeEventListener("focusin", h), d.removeEventListener("focusout", E), d.removeEventListener("pointermove", h), d.removeEventListener("pointerleave", C), window.removeEventListener("blur", h), window.removeEventListener("focus", T);
100
+ return u.addEventListener("focusin", T), u.addEventListener("focusout", E), u.addEventListener("pointermove", T), u.addEventListener("pointerleave", C), window.addEventListener("blur", T), window.addEventListener("focus", g), () => {
101
+ u.removeEventListener("focusin", T), u.removeEventListener("focusout", E), u.removeEventListener("pointermove", T), u.removeEventListener("pointerleave", C), window.removeEventListener("blur", T), window.removeEventListener("focus", g);
70
102
  };
71
103
  }
72
104
  }, [y, l.isClosePausedRef]);
73
105
  const f = n.useCallback(
74
- ({ tabbingDirection: d }) => {
75
- const h = m().map((T) => {
76
- const E = T.ref.current, C = [E, ...Wt(E)];
77
- return d === "forwards" ? C : C.reverse();
106
+ ({ tabbingDirection: u }) => {
107
+ const T = v().map((g) => {
108
+ const E = g.ref.current, C = [E, ...or(E)];
109
+ return u === "forwards" ? C : C.reverse();
78
110
  });
79
- return (d === "forwards" ? h.reverse() : h).flat();
111
+ return (u === "forwards" ? T.reverse() : T).flat();
80
112
  },
81
- [m]
113
+ [v]
82
114
  );
83
115
  return n.useEffect(() => {
84
- const d = x.current;
85
- if (d) {
86
- const b = (h) => {
87
- var C, N, A;
88
- const T = h.altKey || h.ctrlKey || h.metaKey;
89
- if (h.key === "Tab" && !T) {
90
- const F = document.activeElement, O = h.shiftKey;
91
- if (h.target === d && O) {
92
- (C = i.current) == null || C.focus();
116
+ const u = m.current;
117
+ if (u) {
118
+ const b = (T) => {
119
+ var C, S, _;
120
+ const g = T.altKey || T.ctrlKey || T.metaKey;
121
+ if (T.key === "Tab" && !g) {
122
+ const F = document.activeElement, I = T.shiftKey;
123
+ if (T.target === u && I) {
124
+ (C = c.current) == null || C.focus();
93
125
  return;
94
126
  }
95
- const _ = f({ tabbingDirection: O ? "backwards" : "forwards" }), $ = _.findIndex((v) => v === F);
96
- te(_.slice($ + 1)) ? h.preventDefault() : O ? (N = i.current) == null || N.focus() : (A = p.current) == null || A.focus();
127
+ const O = f({ tabbingDirection: I ? "backwards" : "forwards" }), W = O.findIndex((x) => x === F);
128
+ se(O.slice(W + 1)) ? T.preventDefault() : I ? (S = c.current) == null || S.focus() : (_ = p.current) == null || _.focus();
97
129
  }
98
130
  };
99
- return d.addEventListener("keydown", b), () => d.removeEventListener("keydown", b);
131
+ return u.addEventListener("keydown", b), () => u.removeEventListener("keydown", b);
100
132
  }
101
- }, [m, f]), /* @__PURE__ */ s.jsxs(
102
- tt,
133
+ }, [v, f]), /* @__PURE__ */ s.jsxs(
134
+ ft,
103
135
  {
104
- ref: u,
136
+ ref: d,
105
137
  role: "region",
106
- "aria-label": a.replace("{hotkey}", w),
138
+ "aria-label": a.replace("{hotkey}", h),
107
139
  tabIndex: -1,
108
140
  style: { pointerEvents: y ? void 0 : "none" },
109
141
  children: [
110
142
  y && /* @__PURE__ */ s.jsx(
111
- se,
143
+ ue,
112
144
  {
113
- ref: i,
145
+ ref: c,
114
146
  onFocusFromOutsideViewport: () => {
115
- const d = f({
147
+ const u = f({
116
148
  tabbingDirection: "forwards"
117
149
  });
118
- te(d);
150
+ se(u);
119
151
  }
120
152
  }
121
153
  ),
122
- /* @__PURE__ */ s.jsx(je.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(S.ol, { tabIndex: -1, ...c, ref: g }) }),
154
+ /* @__PURE__ */ s.jsx(xe.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(j.ol, { tabIndex: -1, ...i, ref: w }) }),
123
155
  y && /* @__PURE__ */ s.jsx(
124
- se,
156
+ ue,
125
157
  {
126
158
  ref: p,
127
159
  onFocusFromOutsideViewport: () => {
128
- const d = f({
160
+ const u = f({
129
161
  tabbingDirection: "backwards"
130
162
  });
131
- te(d);
163
+ se(u);
132
164
  }
133
165
  }
134
166
  )
@@ -137,12 +169,12 @@ var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toa
137
169
  );
138
170
  }
139
171
  );
140
- Se.displayName = ke;
141
- var _e = "ToastFocusProxy", se = n.forwardRef(
172
+ $e.displayName = Ve;
173
+ var He = "ToastFocusProxy", ue = n.forwardRef(
142
174
  (e, r) => {
143
- const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e, c = X(_e, t);
175
+ const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e, i = J(He, t);
144
176
  return /* @__PURE__ */ s.jsx(
145
- G,
177
+ Q,
146
178
  {
147
179
  "aria-hidden": !0,
148
180
  tabIndex: 0,
@@ -150,155 +182,155 @@ var _e = "ToastFocusProxy", se = n.forwardRef(
150
182
  ref: r,
151
183
  style: { position: "fixed" },
152
184
  onFocus: (l) => {
153
- var i;
154
- const m = l.relatedTarget;
155
- !((i = c.viewport) != null && i.contains(m)) && o();
185
+ var c;
186
+ const v = l.relatedTarget;
187
+ !((c = i.viewport) != null && c.contains(v)) && o();
156
188
  }
157
189
  }
158
190
  );
159
191
  }
160
192
  );
161
- se.displayName = _e;
162
- var Y = "Toast", St = "toast.swipeStart", _t = "toast.swipeMove", Dt = "toast.swipeCancel", Ot = "toast.swipeEnd", De = n.forwardRef(
193
+ ue.displayName = He;
194
+ var Z = "Toast", Ut = "toast.swipeStart", qt = "toast.swipeMove", Gt = "toast.swipeCancel", Xt = "toast.swipeEnd", Ke = n.forwardRef(
163
195
  (e, r) => {
164
- const { forceMount: t, open: o, defaultOpen: a, onOpenChange: c, ...l } = e, [m = !0, u] = Pe({
196
+ const { forceMount: t, open: o, defaultOpen: a, onOpenChange: i, ...l } = e, [v = !0, d] = ke({
165
197
  prop: o,
166
198
  defaultProp: a,
167
- onChange: c
199
+ onChange: i
168
200
  });
169
- return /* @__PURE__ */ s.jsx(ce, { present: t || m, children: /* @__PURE__ */ s.jsx(
170
- Ft,
201
+ return /* @__PURE__ */ s.jsx(ve, { present: t || v, children: /* @__PURE__ */ s.jsx(
202
+ Qt,
171
203
  {
172
- open: m,
204
+ open: v,
173
205
  ...l,
174
206
  ref: r,
175
- onClose: () => u(!1),
176
- onPause: q(e.onPause),
177
- onResume: q(e.onResume),
178
- onSwipeStart: R(e.onSwipeStart, (i) => {
179
- i.currentTarget.setAttribute("data-swipe", "start");
207
+ onClose: () => d(!1),
208
+ onPause: Y(e.onPause),
209
+ onResume: Y(e.onResume),
210
+ onSwipeStart: R(e.onSwipeStart, (c) => {
211
+ c.currentTarget.setAttribute("data-swipe", "start");
180
212
  }),
181
- onSwipeMove: R(e.onSwipeMove, (i) => {
182
- const { x: p, y: x } = i.detail.delta;
183
- i.currentTarget.setAttribute("data-swipe", "move"), i.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${p}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${x}px`);
213
+ onSwipeMove: R(e.onSwipeMove, (c) => {
214
+ const { x: p, y: m } = c.detail.delta;
215
+ c.currentTarget.setAttribute("data-swipe", "move"), c.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${p}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${m}px`);
184
216
  }),
185
- onSwipeCancel: R(e.onSwipeCancel, (i) => {
186
- i.currentTarget.setAttribute("data-swipe", "cancel"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
217
+ onSwipeCancel: R(e.onSwipeCancel, (c) => {
218
+ c.currentTarget.setAttribute("data-swipe", "cancel"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
187
219
  }),
188
- onSwipeEnd: R(e.onSwipeEnd, (i) => {
189
- const { x: p, y: x } = i.detail.delta;
190
- i.currentTarget.setAttribute("data-swipe", "end"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${p}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${x}px`), u(!1);
220
+ onSwipeEnd: R(e.onSwipeEnd, (c) => {
221
+ const { x: p, y: m } = c.detail.delta;
222
+ c.currentTarget.setAttribute("data-swipe", "end"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), c.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${p}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${m}px`), d(!1);
191
223
  })
192
224
  }
193
225
  ) });
194
226
  }
195
227
  );
196
- De.displayName = Y;
197
- var [Lt, It] = Ae(Y, {
228
+ Ke.displayName = Z;
229
+ var [Yt, Bt] = Le(Z, {
198
230
  onClose() {
199
231
  }
200
- }), Ft = n.forwardRef(
232
+ }), Qt = n.forwardRef(
201
233
  (e, r) => {
202
234
  const {
203
235
  __scopeToast: t,
204
236
  type: o = "foreground",
205
237
  duration: a,
206
- open: c,
238
+ open: i,
207
239
  onClose: l,
208
- onEscapeKeyDown: m,
209
- onPause: u,
210
- onResume: i,
240
+ onEscapeKeyDown: v,
241
+ onPause: d,
242
+ onResume: c,
211
243
  onSwipeStart: p,
212
- onSwipeMove: x,
213
- onSwipeCancel: g,
214
- onSwipeEnd: w,
244
+ onSwipeMove: m,
245
+ onSwipeCancel: w,
246
+ onSwipeEnd: h,
215
247
  ...y
216
- } = e, f = X(Y, t), [d, b] = n.useState(null), h = U(r, (v) => b(v)), T = n.useRef(null), E = n.useRef(null), C = a || f.duration, N = n.useRef(0), A = n.useRef(C), F = n.useRef(0), { onToastAdd: O, onToastRemove: Z } = f, L = q(() => {
217
- var j;
218
- (d == null ? void 0 : d.contains(document.activeElement)) && ((j = f.viewport) == null || j.focus()), l();
219
- }), _ = n.useCallback(
220
- (v) => {
221
- !v || v === 1 / 0 || (window.clearTimeout(F.current), N.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(L, v));
248
+ } = e, f = J(Z, t), [u, b] = n.useState(null), T = B(r, (x) => b(x)), g = n.useRef(null), E = n.useRef(null), C = a || f.duration, S = n.useRef(0), _ = n.useRef(C), F = n.useRef(0), { onToastAdd: I, onToastRemove: oe } = f, M = Y(() => {
249
+ var A;
250
+ (u == null ? void 0 : u.contains(document.activeElement)) && ((A = f.viewport) == null || A.focus()), l();
251
+ }), O = n.useCallback(
252
+ (x) => {
253
+ !x || x === 1 / 0 || (window.clearTimeout(F.current), S.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(M, x));
222
254
  },
223
- [L]
255
+ [M]
224
256
  );
225
257
  n.useEffect(() => {
226
- const v = f.viewport;
227
- if (v) {
228
- const j = () => {
229
- _(A.current), i == null || i();
230
- }, k = () => {
231
- const M = (/* @__PURE__ */ new Date()).getTime() - N.current;
232
- A.current = A.current - M, window.clearTimeout(F.current), u == null || u();
258
+ const x = f.viewport;
259
+ if (x) {
260
+ const A = () => {
261
+ O(_.current), c == null || c();
262
+ }, N = () => {
263
+ const V = (/* @__PURE__ */ new Date()).getTime() - S.current;
264
+ _.current = _.current - V, window.clearTimeout(F.current), d == null || d();
233
265
  };
234
- return v.addEventListener(oe, k), v.addEventListener(ne, j), () => {
235
- v.removeEventListener(oe, k), v.removeEventListener(ne, j);
266
+ return x.addEventListener(le, N), x.addEventListener(de, A), () => {
267
+ x.removeEventListener(le, N), x.removeEventListener(de, A);
236
268
  };
237
269
  }
238
- }, [f.viewport, C, u, i, _]), n.useEffect(() => {
239
- c && !f.isClosePausedRef.current && _(C);
240
- }, [c, C, f.isClosePausedRef, _]), n.useEffect(() => (O(), () => Z()), [O, Z]);
241
- const $ = n.useMemo(() => d ? He(d) : null, [d]);
270
+ }, [f.viewport, C, d, c, O]), n.useEffect(() => {
271
+ i && !f.isClosePausedRef.current && O(C);
272
+ }, [i, C, f.isClosePausedRef, O]), n.useEffect(() => (I(), () => oe()), [I, oe]);
273
+ const W = n.useMemo(() => u ? Ye(u) : null, [u]);
242
274
  return f.viewport ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
243
- $ && /* @__PURE__ */ s.jsx(
244
- Mt,
275
+ W && /* @__PURE__ */ s.jsx(
276
+ Jt,
245
277
  {
246
278
  __scopeToast: t,
247
279
  role: "status",
248
280
  "aria-live": o === "foreground" ? "assertive" : "polite",
249
281
  "aria-atomic": !0,
250
- children: $
282
+ children: W
251
283
  }
252
284
  ),
253
- /* @__PURE__ */ s.jsx(Lt, { scope: t, onClose: L, children: ht.createPortal(
254
- /* @__PURE__ */ s.jsx(je.ItemSlot, { scope: t, children: /* @__PURE__ */ s.jsx(
255
- rt,
285
+ /* @__PURE__ */ s.jsx(Yt, { scope: t, onClose: M, children: jt.createPortal(
286
+ /* @__PURE__ */ s.jsx(xe.ItemSlot, { scope: t, children: /* @__PURE__ */ s.jsx(
287
+ vt,
256
288
  {
257
289
  asChild: !0,
258
- onEscapeKeyDown: R(m, () => {
259
- f.isFocusedToastEscapeKeyDownRef.current || L(), f.isFocusedToastEscapeKeyDownRef.current = !1;
290
+ onEscapeKeyDown: R(v, () => {
291
+ f.isFocusedToastEscapeKeyDownRef.current || M(), f.isFocusedToastEscapeKeyDownRef.current = !1;
260
292
  }),
261
293
  children: /* @__PURE__ */ s.jsx(
262
- S.li,
294
+ j.li,
263
295
  {
264
296
  role: "status",
265
297
  "aria-live": "off",
266
298
  "aria-atomic": !0,
267
299
  tabIndex: 0,
268
- "data-state": c ? "open" : "closed",
300
+ "data-state": i ? "open" : "closed",
269
301
  "data-swipe-direction": f.swipeDirection,
270
302
  ...y,
271
- ref: h,
303
+ ref: T,
272
304
  style: { userSelect: "none", touchAction: "none", ...e.style },
273
- onKeyDown: R(e.onKeyDown, (v) => {
274
- v.key === "Escape" && (m == null || m(v.nativeEvent), v.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0, L()));
305
+ onKeyDown: R(e.onKeyDown, (x) => {
306
+ x.key === "Escape" && (v == null || v(x.nativeEvent), x.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0, M()));
275
307
  }),
276
- onPointerDown: R(e.onPointerDown, (v) => {
277
- v.button === 0 && (T.current = { x: v.clientX, y: v.clientY });
308
+ onPointerDown: R(e.onPointerDown, (x) => {
309
+ x.button === 0 && (g.current = { x: x.clientX, y: x.clientY });
278
310
  }),
279
- onPointerMove: R(e.onPointerMove, (v) => {
280
- if (!T.current) return;
281
- const j = v.clientX - T.current.x, k = v.clientY - T.current.y, M = !!E.current, V = ["left", "right"].includes(f.swipeDirection), K = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, Qe = V ? K(0, j) : 0, Ze = V ? 0 : K(0, k), ee = v.pointerType === "touch" ? 10 : 2, W = { x: Qe, y: Ze }, we = { originalEvent: v, delta: W };
282
- M ? (E.current = W, z(_t, x, we, {
311
+ onPointerMove: R(e.onPointerMove, (x) => {
312
+ if (!g.current) return;
313
+ const A = x.clientX - g.current.x, N = x.clientY - g.current.y, V = !!E.current, $ = ["left", "right"].includes(f.swipeDirection), z = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, dt = $ ? z(0, A) : 0, ut = $ ? 0 : z(0, N), ne = x.pointerType === "touch" ? 10 : 2, U = { x: dt, y: ut }, Re = { originalEvent: x, delta: U };
314
+ V ? (E.current = U, q(qt, m, Re, {
283
315
  discrete: !1
284
- })) : ge(W, f.swipeDirection, ee) ? (E.current = W, z(St, p, we, {
316
+ })) : Ae(U, f.swipeDirection, ne) ? (E.current = U, q(Ut, p, Re, {
285
317
  discrete: !1
286
- }), v.target.setPointerCapture(v.pointerId)) : (Math.abs(j) > ee || Math.abs(k) > ee) && (T.current = null);
318
+ }), x.target.setPointerCapture(x.pointerId)) : (Math.abs(A) > ne || Math.abs(N) > ne) && (g.current = null);
287
319
  }),
288
- onPointerUp: R(e.onPointerUp, (v) => {
289
- const j = E.current, k = v.target;
290
- if (k.hasPointerCapture(v.pointerId) && k.releasePointerCapture(v.pointerId), E.current = null, T.current = null, j) {
291
- const M = v.currentTarget, V = { originalEvent: v, delta: j };
292
- ge(j, f.swipeDirection, f.swipeThreshold) ? z(Ot, w, V, {
320
+ onPointerUp: R(e.onPointerUp, (x) => {
321
+ const A = E.current, N = x.target;
322
+ if (N.hasPointerCapture(x.pointerId) && N.releasePointerCapture(x.pointerId), E.current = null, g.current = null, A) {
323
+ const V = x.currentTarget, $ = { originalEvent: x, delta: A };
324
+ Ae(A, f.swipeDirection, f.swipeThreshold) ? q(Xt, h, $, {
293
325
  discrete: !0
294
- }) : z(
295
- Dt,
296
- g,
297
- V,
326
+ }) : q(
327
+ Gt,
328
+ w,
329
+ $,
298
330
  {
299
331
  discrete: !0
300
332
  }
301
- ), M.addEventListener("click", (K) => K.preventDefault(), {
333
+ ), V.addEventListener("click", (z) => z.preventDefault(), {
302
334
  once: !0
303
335
  });
304
336
  }
@@ -311,44 +343,44 @@ var [Lt, It] = Ae(Y, {
311
343
  ) })
312
344
  ] }) : null;
313
345
  }
314
- ), Mt = (e) => {
315
- const { __scopeToast: r, children: t, ...o } = e, a = X(Y, r), [c, l] = n.useState(!1), [m, u] = n.useState(!1);
316
- return $t(() => l(!0)), n.useEffect(() => {
317
- const i = window.setTimeout(() => u(!0), 1e3);
318
- return () => window.clearTimeout(i);
319
- }, []), m ? null : /* @__PURE__ */ s.jsx(Re, { asChild: !0, children: /* @__PURE__ */ s.jsx(G, { ...o, children: c && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
346
+ ), Jt = (e) => {
347
+ const { __scopeToast: r, children: t, ...o } = e, a = J(Z, r), [i, l] = n.useState(!1), [v, d] = n.useState(!1);
348
+ return tr(() => l(!0)), n.useEffect(() => {
349
+ const c = window.setTimeout(() => d(!0), 1e3);
350
+ return () => window.clearTimeout(c);
351
+ }, []), v ? null : /* @__PURE__ */ s.jsx(Ie, { asChild: !0, children: /* @__PURE__ */ s.jsx(Q, { ...o, children: i && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
320
352
  a.label,
321
353
  " ",
322
354
  t
323
355
  ] }) }) });
324
- }, Vt = "ToastTitle", Oe = n.forwardRef(
356
+ }, Zt = "ToastTitle", We = n.forwardRef(
325
357
  (e, r) => {
326
358
  const { __scopeToast: t, ...o } = e;
327
- return /* @__PURE__ */ s.jsx(S.div, { ...o, ref: r });
359
+ return /* @__PURE__ */ s.jsx(j.div, { ...o, ref: r });
328
360
  }
329
361
  );
330
- Oe.displayName = Vt;
331
- var Ht = "ToastDescription", Le = n.forwardRef(
362
+ We.displayName = Zt;
363
+ var er = "ToastDescription", ze = n.forwardRef(
332
364
  (e, r) => {
333
365
  const { __scopeToast: t, ...o } = e;
334
- return /* @__PURE__ */ s.jsx(S.div, { ...o, ref: r });
366
+ return /* @__PURE__ */ s.jsx(j.div, { ...o, ref: r });
335
367
  }
336
368
  );
337
- Le.displayName = Ht;
338
- var Ie = "ToastAction", Fe = n.forwardRef(
369
+ ze.displayName = er;
370
+ var Ue = "ToastAction", qe = n.forwardRef(
339
371
  (e, r) => {
340
372
  const { altText: t, ...o } = e;
341
- return t.trim() ? /* @__PURE__ */ s.jsx(Ve, { altText: t, asChild: !0, children: /* @__PURE__ */ s.jsx(le, { ...o, ref: r }) }) : (console.error(
342
- `Invalid prop \`altText\` supplied to \`${Ie}\`. Expected non-empty \`string\`.`
373
+ return t.trim() ? /* @__PURE__ */ s.jsx(Xe, { altText: t, asChild: !0, children: /* @__PURE__ */ s.jsx(Te, { ...o, ref: r }) }) : (console.error(
374
+ `Invalid prop \`altText\` supplied to \`${Ue}\`. Expected non-empty \`string\`.`
343
375
  ), null);
344
376
  }
345
377
  );
346
- Fe.displayName = Ie;
347
- var Me = "ToastClose", le = n.forwardRef(
378
+ qe.displayName = Ue;
379
+ var Ge = "ToastClose", Te = n.forwardRef(
348
380
  (e, r) => {
349
- const { __scopeToast: t, ...o } = e, a = It(Me, t);
350
- return /* @__PURE__ */ s.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ s.jsx(
351
- S.button,
381
+ const { __scopeToast: t, ...o } = e, a = Bt(Ge, t);
382
+ return /* @__PURE__ */ s.jsx(Xe, { asChild: !0, children: /* @__PURE__ */ s.jsx(
383
+ j.button,
352
384
  {
353
385
  type: "button",
354
386
  ...o,
@@ -358,11 +390,11 @@ var Me = "ToastClose", le = n.forwardRef(
358
390
  ) });
359
391
  }
360
392
  );
361
- le.displayName = Me;
362
- var Ve = n.forwardRef((e, r) => {
393
+ Te.displayName = Ge;
394
+ var Xe = n.forwardRef((e, r) => {
363
395
  const { __scopeToast: t, altText: o, ...a } = e;
364
396
  return /* @__PURE__ */ s.jsx(
365
- S.div,
397
+ j.div,
366
398
  {
367
399
  "data-radix-toast-announce-exclude": "",
368
400
  "data-radix-toast-announce-alt": o || void 0,
@@ -371,42 +403,42 @@ var Ve = n.forwardRef((e, r) => {
371
403
  }
372
404
  );
373
405
  });
374
- function He(e) {
406
+ function Ye(e) {
375
407
  const r = [];
376
408
  return Array.from(e.childNodes).forEach((o) => {
377
- if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), Kt(o)) {
378
- const a = o.ariaHidden || o.hidden || o.style.display === "none", c = o.dataset.radixToastAnnounceExclude === "";
409
+ if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), rr(o)) {
410
+ const a = o.ariaHidden || o.hidden || o.style.display === "none", i = o.dataset.radixToastAnnounceExclude === "";
379
411
  if (!a)
380
- if (c) {
412
+ if (i) {
381
413
  const l = o.dataset.radixToastAnnounceAlt;
382
414
  l && r.push(l);
383
415
  } else
384
- r.push(...He(o));
416
+ r.push(...Ye(o));
385
417
  }
386
418
  }), r;
387
419
  }
388
- function z(e, r, t, { discrete: o }) {
389
- const a = t.originalEvent.currentTarget, c = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
390
- r && a.addEventListener(e, r, { once: !0 }), o ? ot(a, c) : a.dispatchEvent(c);
420
+ function q(e, r, t, { discrete: o }) {
421
+ const a = t.originalEvent.currentTarget, i = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
422
+ r && a.addEventListener(e, r, { once: !0 }), o ? mt(a, i) : a.dispatchEvent(i);
391
423
  }
392
- var ge = (e, r, t = 0) => {
393
- const o = Math.abs(e.x), a = Math.abs(e.y), c = o > a;
394
- return r === "left" || r === "right" ? c && o > t : !c && a > t;
424
+ var Ae = (e, r, t = 0) => {
425
+ const o = Math.abs(e.x), a = Math.abs(e.y), i = o > a;
426
+ return r === "left" || r === "right" ? i && o > t : !i && a > t;
395
427
  };
396
- function $t(e = () => {
428
+ function tr(e = () => {
397
429
  }) {
398
- const r = q(e);
399
- nt(() => {
430
+ const r = Y(e);
431
+ xt(() => {
400
432
  let t = 0, o = 0;
401
433
  return t = window.requestAnimationFrame(() => o = window.requestAnimationFrame(r)), () => {
402
434
  window.cancelAnimationFrame(t), window.cancelAnimationFrame(o);
403
435
  };
404
436
  }, [r]);
405
437
  }
406
- function Kt(e) {
438
+ function rr(e) {
407
439
  return e.nodeType === e.ELEMENT_NODE;
408
440
  }
409
- function Wt(e) {
441
+ function or(e) {
410
442
  const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
411
443
  acceptNode: (o) => {
412
444
  const a = o.tagName === "INPUT" && o.type === "hidden";
@@ -416,54 +448,142 @@ function Wt(e) {
416
448
  for (; t.nextNode(); ) r.push(t.currentNode);
417
449
  return r;
418
450
  }
419
- function te(e) {
451
+ function se(e) {
420
452
  const r = document.activeElement;
421
453
  return e.some((t) => t === r ? !0 : (t.focus(), document.activeElement !== r));
422
454
  }
423
- var $e = Se, Ke = De, We = Oe, ze = Le, qe = Fe, Ue = le;
424
- const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, zt = (e, r) => (t) => {
455
+ var nr = Fe, Be = $e, Qe = Ke, Je = We, Ze = ze, et = qe, tt = Te;
456
+ const _e = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ne = Ot, sr = (e, r) => (t) => {
425
457
  var o;
426
- if ((r == null ? void 0 : r.variants) == null) return be(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
427
- const { variants: a, defaultVariants: c } = r, l = Object.keys(a).map((i) => {
428
- const p = t == null ? void 0 : t[i], x = c == null ? void 0 : c[i];
458
+ if ((r == null ? void 0 : r.variants) == null) return Ne(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
459
+ const { variants: a, defaultVariants: i } = r, l = Object.keys(a).map((c) => {
460
+ const p = t == null ? void 0 : t[c], m = i == null ? void 0 : i[c];
429
461
  if (p === null) return null;
430
- const g = ye(p) || ye(x);
431
- return a[i][g];
432
- }), m = t && Object.entries(t).reduce((i, p) => {
433
- let [x, g] = p;
434
- return g === void 0 || (i[x] = g), i;
435
- }, {}), u = r == null || (o = r.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((i, p) => {
436
- let { class: x, className: g, ...w } = p;
437
- return Object.entries(w).every((y) => {
438
- let [f, d] = y;
439
- return Array.isArray(d) ? d.includes({
440
- ...c,
441
- ...m
462
+ const w = _e(p) || _e(m);
463
+ return a[c][w];
464
+ }), v = t && Object.entries(t).reduce((c, p) => {
465
+ let [m, w] = p;
466
+ return w === void 0 || (c[m] = w), c;
467
+ }, {}), d = r == null || (o = r.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((c, p) => {
468
+ let { class: m, className: w, ...h } = p;
469
+ return Object.entries(h).every((y) => {
470
+ let [f, u] = y;
471
+ return Array.isArray(u) ? u.includes({
472
+ ...i,
473
+ ...v
442
474
  }[f]) : {
443
- ...c,
444
- ...m
445
- }[f] === d;
475
+ ...i,
476
+ ...v
477
+ }[f] === u;
446
478
  }) ? [
447
- ...i,
448
- x,
449
- g
450
- ] : i;
479
+ ...c,
480
+ m,
481
+ w
482
+ ] : c;
451
483
  }, []);
452
- return be(e, l, u, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
453
- }, qt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
454
- $e,
484
+ return Ne(e, l, d, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
485
+ }, ar = 1, ir = 1e6;
486
+ var k = /* @__PURE__ */ ((e) => (e.ADD_TOAST = "ADD_TOAST", e.UPDATE_TOAST = "UPDATE_TOAST", e.DISMISS_TOAST = "DISMISS_TOAST", e.REMOVE_TOAST = "REMOVE_TOAST", e))(k || {});
487
+ let ae = 0;
488
+ const cr = () => (ae = (ae + 1) % Number.MAX_SAFE_INTEGER, ae.toString()), ie = /* @__PURE__ */ new Map(), je = (e) => {
489
+ if (ie.has(e))
490
+ return;
491
+ const r = setTimeout(() => {
492
+ ie.delete(e), H({
493
+ type: k.REMOVE_TOAST,
494
+ toastId: e
495
+ });
496
+ }, ir);
497
+ ie.set(e, r);
498
+ }, lr = (e, r) => {
499
+ switch (r.type) {
500
+ case "ADD_TOAST":
501
+ return {
502
+ ...e,
503
+ toasts: [r.toast, ...e.toasts].slice(0, ar)
504
+ };
505
+ case "UPDATE_TOAST":
506
+ return {
507
+ ...e,
508
+ toasts: e.toasts.map(
509
+ (t) => t.id === r.toast.id ? { ...t, ...r.toast } : t
510
+ )
511
+ };
512
+ case "DISMISS_TOAST": {
513
+ const { toastId: t } = r;
514
+ return t ? je(t) : e.toasts.forEach((o) => {
515
+ je(o.id);
516
+ }), {
517
+ ...e,
518
+ toasts: e.toasts.map(
519
+ (o) => o.id === t || t === void 0 ? {
520
+ ...o,
521
+ open: !1
522
+ } : o
523
+ )
524
+ };
525
+ }
526
+ case k.REMOVE_TOAST:
527
+ return r.toastId === void 0 ? {
528
+ ...e,
529
+ toasts: []
530
+ } : {
531
+ ...e,
532
+ toasts: e.toasts.filter((t) => t.id !== r.toastId)
533
+ };
534
+ default:
535
+ return e;
536
+ }
537
+ }, G = [];
538
+ let X = { toasts: [] };
539
+ const H = (e) => {
540
+ X = lr(X, e), G.forEach((r) => {
541
+ r(X);
542
+ });
543
+ }, dr = ({ ...e }) => {
544
+ const r = cr(), t = (a) => H({
545
+ type: k.UPDATE_TOAST,
546
+ toast: { ...a, id: r }
547
+ }), o = () => H({ type: k.DISMISS_TOAST, toastId: r });
548
+ return H({
549
+ type: k.ADD_TOAST,
550
+ toast: {
551
+ ...e,
552
+ id: r,
553
+ open: !0,
554
+ onOpenChange: (a) => {
555
+ a || o();
556
+ }
557
+ }
558
+ }), {
559
+ id: r,
560
+ dismiss: o,
561
+ update: t
562
+ };
563
+ }, ur = () => {
564
+ const [e, r] = _t(X);
565
+ return Nt(() => (G.push(r), () => {
566
+ const t = G.indexOf(r);
567
+ t > -1 && G.splice(t, 1);
568
+ }), [e]), {
569
+ ...e,
570
+ toast: dr,
571
+ dismiss: (t) => H({ type: k.DISMISS_TOAST, toastId: t })
572
+ };
573
+ }, pr = nr, rt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
574
+ Be,
455
575
  {
456
576
  ref: t,
457
577
  className: P(
458
- "fixed top-0 z-[100] flex max-h-screen flex-col-reverse sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col min-w-64 max-w-[420px]",
578
+ "fixed top-0 z-[100] flex flex-col-reverse sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col m-5 max-h-screen min-w-[250px]",
459
579
  e
460
580
  ),
461
581
  ...r
462
582
  }
463
583
  ));
464
- qt.displayName = $e.displayName;
465
- const Ut = zt(
466
- "group pointer-events-auto rounded-[10px] relative border-l-2 flex w-full items-center justify-between space-x-2 overflow-hidden py-3 px-5 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full dark:border-neutral-800",
584
+ rt.displayName = Be.displayName;
585
+ const fr = sr(
586
+ "group pointer-events-auto rounded-[10px] relative border-l-2 flex w-full items-center justify-between space-x-2 overflow-hidden py-3 px-[15px] transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full dark:border-neutral-800",
467
587
  {
468
588
  variants: {
469
589
  variant: {
@@ -478,17 +598,17 @@ const Ut = zt(
478
598
  variant: "default"
479
599
  }
480
600
  }
481
- ), Gt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
482
- Ke,
601
+ ), ot = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
602
+ Qe,
483
603
  {
484
604
  ref: o,
485
- className: P(Ut({ variant: r }), e),
605
+ className: P(fr({ variant: r }), e),
486
606
  ...t
487
607
  }
488
608
  ));
489
- Gt.displayName = Ke.displayName;
490
- const Xt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
491
- qe,
609
+ ot.displayName = Qe.displayName;
610
+ const vr = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
611
+ et,
492
612
  {
493
613
  ref: t,
494
614
  className: P(
@@ -498,40 +618,58 @@ const Xt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
498
618
  ...r
499
619
  }
500
620
  ));
501
- Xt.displayName = qe.displayName;
502
- const Yt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
503
- Ue,
621
+ vr.displayName = et.displayName;
622
+ const nt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
623
+ tt,
504
624
  {
505
- ref: t,
625
+ ref: o,
506
626
  className: P(
507
627
  "absolute right-3 top-2 rounded-md p-1 text-neutral-950/50 opacity-0 transition-opacity hover:text-neutral-950 focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 dark:text-neutral-50/50 dark:hover:text-neutral-50",
508
628
  e
509
629
  ),
510
630
  "toast-close": "",
511
- ...r,
512
- children: /* @__PURE__ */ s.jsx(st, { className: "h-4 w-4" })
631
+ ...t,
632
+ children: /* @__PURE__ */ s.jsx(Tt, { className: P(`size-4 text-${r}-10`) })
513
633
  }
514
634
  ));
515
- Yt.displayName = Ue.displayName;
516
- const Ge = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
517
- We,
635
+ nt.displayName = tt.displayName;
636
+ const st = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
637
+ Je,
518
638
  {
519
639
  ref: t,
520
640
  className: P("text-base font-semibold [&+div]:text-xs", e),
521
641
  ...r
522
642
  }
523
643
  ));
524
- Ge.displayName = We.displayName;
525
- const Xe = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
526
- ze,
644
+ st.displayName = Je.displayName;
645
+ const at = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
646
+ Ze,
527
647
  {
528
648
  ref: t,
529
649
  className: P("text-xs font-normal opacity-90", e),
530
650
  ...r
531
651
  }
532
652
  ));
533
- Xe.displayName = ze.displayName;
534
- const kr = ({
653
+ at.displayName = Ze.displayName;
654
+ const Br = ({ duration: e = 5 }) => {
655
+ const { toasts: r } = ur();
656
+ return /* @__PURE__ */ s.jsxs(pr, { children: [
657
+ r.map(({ id: t, title: o, description: a, action: i, ...l }) => /* @__PURE__ */ s.jsxs(ot, { duration: e * 1e3, ...l, children: [
658
+ /* @__PURE__ */ s.jsx("div", { className: "grid gap-1", children: /* @__PURE__ */ s.jsx(
659
+ mr,
660
+ {
661
+ withIcon: l.withIcon,
662
+ type: l.variant,
663
+ title: o,
664
+ description: a
665
+ }
666
+ ) }),
667
+ i,
668
+ /* @__PURE__ */ s.jsx(nt, { variant: l.variant })
669
+ ] }, t)),
670
+ /* @__PURE__ */ s.jsx(rt, {})
671
+ ] });
672
+ }, mr = ({
535
673
  type: e = "info",
536
674
  title: r,
537
675
  description: t,
@@ -544,16 +682,16 @@ const kr = ({
544
682
  "flex items-center gap-1.5"
545
683
  ),
546
684
  children: [
547
- o && /* @__PURE__ */ s.jsx("div", { "data-testid": "notification-icon", children: e && Ct[e] }),
685
+ o && /* @__PURE__ */ s.jsx("div", { "data-testid": "notification-icon", children: e && Ft[e] }),
548
686
  /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col", children: [
549
- /* @__PURE__ */ s.jsx(Ge, { className: o ? "text-left" : "text-center", children: r }),
550
- /* @__PURE__ */ s.jsx(Xe, { className: o ? "text-left" : "text-center", children: t })
687
+ /* @__PURE__ */ s.jsx(st, { className: o ? "text-left" : "text-center", children: r }),
688
+ /* @__PURE__ */ s.jsx(at, { className: o ? "text-left" : "text-center", children: t })
551
689
  ] })
552
690
  ]
553
691
  }
554
- ), { Root: Bt, Thumb: Jt } = at, Sr = n.forwardRef(({ classNames: e, ...r }, t) => {
692
+ ), { Root: xr, Thumb: Tr } = ht, Qr = n.forwardRef(({ classNames: e, ...r }, t) => {
555
693
  const o = r.checked ?? !1;
556
- return /* @__PURE__ */ s.jsxs(Bt, { ref: t, className: P(D.base, e == null ? void 0 : e.root), ...r, children: [
694
+ return /* @__PURE__ */ s.jsxs(xr, { ref: t, className: P(D.base, e == null ? void 0 : e.root), ...r, children: [
557
695
  /* @__PURE__ */ s.jsx(
558
696
  "div",
559
697
  {
@@ -563,7 +701,7 @@ const kr = ({
563
701
  !o && D.iconWrapper.checked
564
702
  ),
565
703
  children: /* @__PURE__ */ s.jsx(
566
- gt,
704
+ kt,
567
705
  {
568
706
  "data-testid": "list-icon",
569
707
  className: P(o ? "fill-dark-30/25" : "fill-dark-30/[.80]")
@@ -580,7 +718,7 @@ const kr = ({
580
718
  o && D.iconWrapper.checked
581
719
  ),
582
720
  children: /* @__PURE__ */ s.jsx(
583
- Tt,
721
+ Dt,
584
722
  {
585
723
  "data-testid": "grid-icon",
586
724
  className: P(o ? "fill-dark-30/[.80]" : "fill-dark-30/25")
@@ -589,7 +727,7 @@ const kr = ({
589
727
  }
590
728
  ),
591
729
  /* @__PURE__ */ s.jsx("div", { className: P(D.borderLine) }),
592
- /* @__PURE__ */ s.jsx(Jt, { tabIndex: 1, className: P(D.thumb, e == null ? void 0 : e.thumb) })
730
+ /* @__PURE__ */ s.jsx(Tr, { tabIndex: 1, className: P(D.thumb, e == null ? void 0 : e.thumb) })
593
731
  ] });
594
732
  }), D = {
595
733
  base: "group relative inline-flex w-20 h-[38px] shrink-0 cursor-pointer items-center bg-gray-50 rounded-[10px] transition-colors duration-200 transition-colors",
@@ -600,84 +738,84 @@ const kr = ({
600
738
  },
601
739
  borderLine: "pointer-events-none absolute z-0 left-0 top-0 w-full h-full group-hover:border group-hover:border-primary-20/[.30] rounded-[10px] transition-colors duration-200"
602
740
  };
603
- var [B, Qt] = Ce("Tooltip", [
604
- Ne
605
- ]), J = Ne(), Ye = "TooltipProvider", Zt = 700, ae = "tooltip.open", [er, de] = B(Ye), ue = (e) => {
741
+ var [ee, hr] = De("Tooltip", [
742
+ Me
743
+ ]), te = Me(), it = "TooltipProvider", wr = 700, pe = "tooltip.open", [gr, he] = ee(it), we = (e) => {
606
744
  const {
607
745
  __scopeTooltip: r,
608
- delayDuration: t = Zt,
746
+ delayDuration: t = wr,
609
747
  skipDelayDuration: o = 300,
610
748
  disableHoverableContent: a = !1,
611
- children: c
612
- } = e, [l, m] = n.useState(!0), u = n.useRef(!1), i = n.useRef(0);
749
+ children: i
750
+ } = e, [l, v] = n.useState(!0), d = n.useRef(!1), c = n.useRef(0);
613
751
  return n.useEffect(() => {
614
- const p = i.current;
752
+ const p = c.current;
615
753
  return () => window.clearTimeout(p);
616
754
  }, []), /* @__PURE__ */ s.jsx(
617
- er,
755
+ gr,
618
756
  {
619
757
  scope: r,
620
758
  isOpenDelayed: l,
621
759
  delayDuration: t,
622
760
  onOpen: n.useCallback(() => {
623
- window.clearTimeout(i.current), m(!1);
761
+ window.clearTimeout(c.current), v(!1);
624
762
  }, []),
625
763
  onClose: n.useCallback(() => {
626
- window.clearTimeout(i.current), i.current = window.setTimeout(
627
- () => m(!0),
764
+ window.clearTimeout(c.current), c.current = window.setTimeout(
765
+ () => v(!0),
628
766
  o
629
767
  );
630
768
  }, [o]),
631
- isPointerInTransitRef: u,
769
+ isPointerInTransitRef: d,
632
770
  onPointerInTransitChange: n.useCallback((p) => {
633
- u.current = p;
771
+ d.current = p;
634
772
  }, []),
635
773
  disableHoverableContent: a,
636
- children: c
774
+ children: i
637
775
  }
638
776
  );
639
777
  };
640
- ue.displayName = Ye;
641
- var Q = "Tooltip", [tr, H] = B(Q), pe = (e) => {
778
+ we.displayName = it;
779
+ var re = "Tooltip", [yr, K] = ee(re), ge = (e) => {
642
780
  const {
643
781
  __scopeTooltip: r,
644
782
  children: t,
645
783
  open: o,
646
784
  defaultOpen: a = !1,
647
- onOpenChange: c,
785
+ onOpenChange: i,
648
786
  disableHoverableContent: l,
649
- delayDuration: m
650
- } = e, u = de(Q, e.__scopeTooltip), i = J(r), [p, x] = n.useState(null), g = ct(), w = n.useRef(0), y = l ?? u.disableHoverableContent, f = m ?? u.delayDuration, d = n.useRef(!1), [b = !1, h] = Pe({
787
+ delayDuration: v
788
+ } = e, d = he(re, e.__scopeTooltip), c = te(r), [p, m] = n.useState(null), w = gt(), h = n.useRef(0), y = l ?? d.disableHoverableContent, f = v ?? d.delayDuration, u = n.useRef(!1), [b = !1, T] = ke({
651
789
  prop: o,
652
790
  defaultProp: a,
653
- onChange: (A) => {
654
- A ? (u.onOpen(), document.dispatchEvent(new CustomEvent(ae))) : u.onClose(), c == null || c(A);
791
+ onChange: (_) => {
792
+ _ ? (d.onOpen(), document.dispatchEvent(new CustomEvent(pe))) : d.onClose(), i == null || i(_);
655
793
  }
656
- }), T = n.useMemo(() => b ? d.current ? "delayed-open" : "instant-open" : "closed", [b]), E = n.useCallback(() => {
657
- window.clearTimeout(w.current), w.current = 0, d.current = !1, h(!0);
658
- }, [h]), C = n.useCallback(() => {
659
- window.clearTimeout(w.current), w.current = 0, h(!1);
660
- }, [h]), N = n.useCallback(() => {
661
- window.clearTimeout(w.current), w.current = window.setTimeout(() => {
662
- d.current = !0, h(!0), w.current = 0;
794
+ }), g = n.useMemo(() => b ? u.current ? "delayed-open" : "instant-open" : "closed", [b]), E = n.useCallback(() => {
795
+ window.clearTimeout(h.current), h.current = 0, u.current = !1, T(!0);
796
+ }, [T]), C = n.useCallback(() => {
797
+ window.clearTimeout(h.current), h.current = 0, T(!1);
798
+ }, [T]), S = n.useCallback(() => {
799
+ window.clearTimeout(h.current), h.current = window.setTimeout(() => {
800
+ u.current = !0, T(!0), h.current = 0;
663
801
  }, f);
664
- }, [f, h]);
802
+ }, [f, T]);
665
803
  return n.useEffect(() => () => {
666
- w.current && (window.clearTimeout(w.current), w.current = 0);
667
- }, []), /* @__PURE__ */ s.jsx(lt, { ...i, children: /* @__PURE__ */ s.jsx(
668
- tr,
804
+ h.current && (window.clearTimeout(h.current), h.current = 0);
805
+ }, []), /* @__PURE__ */ s.jsx(yt, { ...c, children: /* @__PURE__ */ s.jsx(
806
+ yr,
669
807
  {
670
808
  scope: r,
671
- contentId: g,
809
+ contentId: w,
672
810
  open: b,
673
- stateAttribute: T,
811
+ stateAttribute: g,
674
812
  trigger: p,
675
- onTriggerChange: x,
813
+ onTriggerChange: m,
676
814
  onTriggerEnter: n.useCallback(() => {
677
- u.isOpenDelayed ? N() : E();
678
- }, [u.isOpenDelayed, N, E]),
815
+ d.isOpenDelayed ? S() : E();
816
+ }, [d.isOpenDelayed, S, E]),
679
817
  onTriggerLeave: n.useCallback(() => {
680
- y ? C() : (window.clearTimeout(w.current), w.current = 0);
818
+ y ? C() : (window.clearTimeout(h.current), h.current = 0);
681
819
  }, [C, y]),
682
820
  onOpen: E,
683
821
  onClose: C,
@@ -686,28 +824,28 @@ var Q = "Tooltip", [tr, H] = B(Q), pe = (e) => {
686
824
  }
687
825
  ) });
688
826
  };
689
- pe.displayName = Q;
690
- var ie = "TooltipTrigger", fe = n.forwardRef(
827
+ ge.displayName = re;
828
+ var fe = "TooltipTrigger", ye = n.forwardRef(
691
829
  (e, r) => {
692
- const { __scopeTooltip: t, ...o } = e, a = H(ie, t), c = de(ie, t), l = J(t), m = n.useRef(null), u = U(r, m, a.onTriggerChange), i = n.useRef(!1), p = n.useRef(!1), x = n.useCallback(() => i.current = !1, []);
693
- return n.useEffect(() => () => document.removeEventListener("pointerup", x), [x]), /* @__PURE__ */ s.jsx(dt, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
694
- S.button,
830
+ const { __scopeTooltip: t, ...o } = e, a = K(fe, t), i = he(fe, t), l = te(t), v = n.useRef(null), d = B(r, v, a.onTriggerChange), c = n.useRef(!1), p = n.useRef(!1), m = n.useCallback(() => c.current = !1, []);
831
+ return n.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ s.jsx(bt, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
832
+ j.button,
695
833
  {
696
834
  "aria-describedby": a.open ? a.contentId : void 0,
697
835
  "data-state": a.stateAttribute,
698
836
  ...o,
699
- ref: u,
700
- onPointerMove: R(e.onPointerMove, (g) => {
701
- g.pointerType !== "touch" && !p.current && !c.isPointerInTransitRef.current && (a.onTriggerEnter(), p.current = !0);
837
+ ref: d,
838
+ onPointerMove: R(e.onPointerMove, (w) => {
839
+ w.pointerType !== "touch" && !p.current && !i.isPointerInTransitRef.current && (a.onTriggerEnter(), p.current = !0);
702
840
  }),
703
841
  onPointerLeave: R(e.onPointerLeave, () => {
704
842
  a.onTriggerLeave(), p.current = !1;
705
843
  }),
706
844
  onPointerDown: R(e.onPointerDown, () => {
707
- i.current = !0, document.addEventListener("pointerup", x, { once: !0 });
845
+ c.current = !0, document.addEventListener("pointerup", m, { once: !0 });
708
846
  }),
709
847
  onFocus: R(e.onFocus, () => {
710
- i.current || a.onOpen();
848
+ c.current || a.onOpen();
711
849
  }),
712
850
  onBlur: R(e.onBlur, a.onClose),
713
851
  onClick: R(e.onClick, a.onClose)
@@ -715,81 +853,81 @@ var ie = "TooltipTrigger", fe = n.forwardRef(
715
853
  ) });
716
854
  }
717
855
  );
718
- fe.displayName = ie;
719
- var ve = "TooltipPortal", [rr, or] = B(ve, {
856
+ ye.displayName = fe;
857
+ var be = "TooltipPortal", [br, Er] = ee(be, {
720
858
  forceMount: void 0
721
- }), me = (e) => {
722
- const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, c = H(ve, r);
723
- return /* @__PURE__ */ s.jsx(rr, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(ce, { present: t || c.open, children: /* @__PURE__ */ s.jsx(Re, { asChild: !0, container: a, children: o }) }) });
859
+ }), Ee = (e) => {
860
+ const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, i = K(be, r);
861
+ return /* @__PURE__ */ s.jsx(br, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(ve, { present: t || i.open, children: /* @__PURE__ */ s.jsx(Ie, { asChild: !0, container: a, children: o }) }) });
724
862
  };
725
- me.displayName = ve;
726
- var I = "TooltipContent", xe = n.forwardRef(
863
+ Ee.displayName = be;
864
+ var L = "TooltipContent", Ce = n.forwardRef(
727
865
  (e, r) => {
728
- const t = or(I, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...c } = e, l = H(I, e.__scopeTooltip);
729
- return /* @__PURE__ */ s.jsx(ce, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ s.jsx(Be, { side: a, ...c, ref: r }) : /* @__PURE__ */ s.jsx(nr, { side: a, ...c, ref: r }) });
866
+ const t = Er(L, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...i } = e, l = K(L, e.__scopeTooltip);
867
+ return /* @__PURE__ */ s.jsx(ve, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ s.jsx(ct, { side: a, ...i, ref: r }) : /* @__PURE__ */ s.jsx(Cr, { side: a, ...i, ref: r }) });
730
868
  }
731
- ), nr = n.forwardRef((e, r) => {
732
- const t = H(I, e.__scopeTooltip), o = de(I, e.__scopeTooltip), a = n.useRef(null), c = U(r, a), [l, m] = n.useState(null), { trigger: u, onClose: i } = t, p = a.current, { onPointerInTransitChange: x } = o, g = n.useCallback(() => {
733
- m(null), x(!1);
734
- }, [x]), w = n.useCallback(
869
+ ), Cr = n.forwardRef((e, r) => {
870
+ const t = K(L, e.__scopeTooltip), o = he(L, e.__scopeTooltip), a = n.useRef(null), i = B(r, a), [l, v] = n.useState(null), { trigger: d, onClose: c } = t, p = a.current, { onPointerInTransitChange: m } = o, w = n.useCallback(() => {
871
+ v(null), m(!1);
872
+ }, [m]), h = n.useCallback(
735
873
  (y, f) => {
736
- const d = y.currentTarget, b = { x: y.clientX, y: y.clientY }, h = ir(b, d.getBoundingClientRect()), T = cr(b, h), E = lr(f.getBoundingClientRect()), C = ur([...T, ...E]);
737
- m(C), x(!0);
874
+ const u = y.currentTarget, b = { x: y.clientX, y: y.clientY }, T = Sr(b, u.getBoundingClientRect()), g = Ar(b, T), E = _r(f.getBoundingClientRect()), C = jr([...g, ...E]);
875
+ v(C), m(!0);
738
876
  },
739
- [x]
877
+ [m]
740
878
  );
741
- return n.useEffect(() => () => g(), [g]), n.useEffect(() => {
742
- if (u && p) {
743
- const y = (d) => w(d, p), f = (d) => w(d, u);
744
- return u.addEventListener("pointerleave", y), p.addEventListener("pointerleave", f), () => {
745
- u.removeEventListener("pointerleave", y), p.removeEventListener("pointerleave", f);
879
+ return n.useEffect(() => () => w(), [w]), n.useEffect(() => {
880
+ if (d && p) {
881
+ const y = (u) => h(u, p), f = (u) => h(u, d);
882
+ return d.addEventListener("pointerleave", y), p.addEventListener("pointerleave", f), () => {
883
+ d.removeEventListener("pointerleave", y), p.removeEventListener("pointerleave", f);
746
884
  };
747
885
  }
748
- }, [u, p, w, g]), n.useEffect(() => {
886
+ }, [d, p, h, w]), n.useEffect(() => {
749
887
  if (l) {
750
888
  const y = (f) => {
751
- const d = f.target, b = { x: f.clientX, y: f.clientY }, h = (u == null ? void 0 : u.contains(d)) || (p == null ? void 0 : p.contains(d)), T = !dr(b, l);
752
- h ? g() : T && (g(), i());
889
+ const u = f.target, b = { x: f.clientX, y: f.clientY }, T = (d == null ? void 0 : d.contains(u)) || (p == null ? void 0 : p.contains(u)), g = !Nr(b, l);
890
+ T ? w() : g && (w(), c());
753
891
  };
754
892
  return document.addEventListener("pointermove", y), () => document.removeEventListener("pointermove", y);
755
893
  }
756
- }, [u, p, l, i, g]), /* @__PURE__ */ s.jsx(Be, { ...e, ref: c });
757
- }), [sr, ar] = B(Q, { isInside: !1 }), Be = n.forwardRef(
894
+ }, [d, p, l, c, w]), /* @__PURE__ */ s.jsx(ct, { ...e, ref: i });
895
+ }), [Pr, Rr] = ee(re, { isInside: !1 }), ct = n.forwardRef(
758
896
  (e, r) => {
759
897
  const {
760
898
  __scopeTooltip: t,
761
899
  children: o,
762
900
  "aria-label": a,
763
- onEscapeKeyDown: c,
901
+ onEscapeKeyDown: i,
764
902
  onPointerDownOutside: l,
765
- ...m
766
- } = e, u = H(I, t), i = J(t), { onClose: p } = u;
767
- return n.useEffect(() => (document.addEventListener(ae, p), () => document.removeEventListener(ae, p)), [p]), n.useEffect(() => {
768
- if (u.trigger) {
769
- const x = (g) => {
770
- const w = g.target;
771
- w != null && w.contains(u.trigger) && p();
903
+ ...v
904
+ } = e, d = K(L, t), c = te(t), { onClose: p } = d;
905
+ return n.useEffect(() => (document.addEventListener(pe, p), () => document.removeEventListener(pe, p)), [p]), n.useEffect(() => {
906
+ if (d.trigger) {
907
+ const m = (w) => {
908
+ const h = w.target;
909
+ h != null && h.contains(d.trigger) && p();
772
910
  };
773
- return window.addEventListener("scroll", x, { capture: !0 }), () => window.removeEventListener("scroll", x, { capture: !0 });
911
+ return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
774
912
  }
775
- }, [u.trigger, p]), /* @__PURE__ */ s.jsx(
776
- ut,
913
+ }, [d.trigger, p]), /* @__PURE__ */ s.jsx(
914
+ Et,
777
915
  {
778
916
  asChild: !0,
779
917
  disableOutsidePointerEvents: !1,
780
- onEscapeKeyDown: c,
918
+ onEscapeKeyDown: i,
781
919
  onPointerDownOutside: l,
782
- onFocusOutside: (x) => x.preventDefault(),
920
+ onFocusOutside: (m) => m.preventDefault(),
783
921
  onDismiss: p,
784
922
  children: /* @__PURE__ */ s.jsxs(
785
- pt,
923
+ Ct,
786
924
  {
787
- "data-state": u.stateAttribute,
788
- ...i,
789
- ...m,
925
+ "data-state": d.stateAttribute,
926
+ ...c,
927
+ ...v,
790
928
  ref: r,
791
929
  style: {
792
- ...m.style,
930
+ ...v.style,
793
931
  "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
794
932
  "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
795
933
  "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
@@ -797,8 +935,8 @@ var I = "TooltipContent", xe = n.forwardRef(
797
935
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
798
936
  },
799
937
  children: [
800
- /* @__PURE__ */ s.jsx(ft, { children: o }),
801
- /* @__PURE__ */ s.jsx(sr, { scope: t, isInside: !0, children: /* @__PURE__ */ s.jsx(Rt, { id: u.contentId, role: "tooltip", children: a || o }) })
938
+ /* @__PURE__ */ s.jsx(Pt, { children: o }),
939
+ /* @__PURE__ */ s.jsx(Pr, { scope: t, isInside: !0, children: /* @__PURE__ */ s.jsx($t, { id: d.contentId, role: "tooltip", children: a || o }) })
802
940
  ]
803
941
  }
804
942
  )
@@ -806,21 +944,21 @@ var I = "TooltipContent", xe = n.forwardRef(
806
944
  );
807
945
  }
808
946
  );
809
- xe.displayName = I;
810
- var Je = "TooltipArrow", he = n.forwardRef(
947
+ Ce.displayName = L;
948
+ var lt = "TooltipArrow", Pe = n.forwardRef(
811
949
  (e, r) => {
812
- const { __scopeTooltip: t, ...o } = e, a = J(t);
813
- return ar(
814
- Je,
950
+ const { __scopeTooltip: t, ...o } = e, a = te(t);
951
+ return Rr(
952
+ lt,
815
953
  t
816
- ).isInside ? null : /* @__PURE__ */ s.jsx(it, { ...a, ...o, ref: r });
954
+ ).isInside ? null : /* @__PURE__ */ s.jsx(wt, { ...a, ...o, ref: r });
817
955
  }
818
956
  );
819
- he.displayName = Je;
820
- function ir(e, r) {
821
- const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), a = Math.abs(r.right - e.x), c = Math.abs(r.left - e.x);
822
- switch (Math.min(t, o, a, c)) {
823
- case c:
957
+ Pe.displayName = lt;
958
+ function Sr(e, r) {
959
+ const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), a = Math.abs(r.right - e.x), i = Math.abs(r.left - e.x);
960
+ switch (Math.min(t, o, a, i)) {
961
+ case i:
824
962
  return "left";
825
963
  case a:
826
964
  return "right";
@@ -832,7 +970,7 @@ function ir(e, r) {
832
970
  throw new Error("unreachable");
833
971
  }
834
972
  }
835
- function cr(e, r, t = 5) {
973
+ function Ar(e, r, t = 5) {
836
974
  const o = [];
837
975
  switch (r) {
838
976
  case "top":
@@ -862,7 +1000,7 @@ function cr(e, r, t = 5) {
862
1000
  }
863
1001
  return o;
864
1002
  }
865
- function lr(e) {
1003
+ function _r(e) {
866
1004
  const { top: r, right: t, bottom: o, left: a } = e;
867
1005
  return [
868
1006
  { x: a, y: r },
@@ -871,27 +1009,27 @@ function lr(e) {
871
1009
  { x: a, y: o }
872
1010
  ];
873
1011
  }
874
- function dr(e, r) {
1012
+ function Nr(e, r) {
875
1013
  const { x: t, y: o } = e;
876
1014
  let a = !1;
877
- for (let c = 0, l = r.length - 1; c < r.length; l = c++) {
878
- const m = r[c].x, u = r[c].y, i = r[l].x, p = r[l].y;
879
- u > o != p > o && t < (i - m) * (o - u) / (p - u) + m && (a = !a);
1015
+ for (let i = 0, l = r.length - 1; i < r.length; l = i++) {
1016
+ const v = r[i].x, d = r[i].y, c = r[l].x, p = r[l].y;
1017
+ d > o != p > o && t < (c - v) * (o - d) / (p - d) + v && (a = !a);
880
1018
  }
881
1019
  return a;
882
1020
  }
883
- function ur(e) {
1021
+ function jr(e) {
884
1022
  const r = e.slice();
885
- return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), pr(r);
1023
+ return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), Or(r);
886
1024
  }
887
- function pr(e) {
1025
+ function Or(e) {
888
1026
  if (e.length <= 1) return e.slice();
889
1027
  const r = [];
890
1028
  for (let o = 0; o < e.length; o++) {
891
1029
  const a = e[o];
892
1030
  for (; r.length >= 2; ) {
893
- const c = r[r.length - 1], l = r[r.length - 2];
894
- if ((c.x - l.x) * (a.y - l.y) >= (c.y - l.y) * (a.x - l.x)) r.pop();
1031
+ const i = r[r.length - 1], l = r[r.length - 2];
1032
+ if ((i.x - l.x) * (a.y - l.y) >= (i.y - l.y) * (a.x - l.x)) r.pop();
895
1033
  else break;
896
1034
  }
897
1035
  r.push(a);
@@ -901,53 +1039,53 @@ function pr(e) {
901
1039
  for (let o = e.length - 1; o >= 0; o--) {
902
1040
  const a = e[o];
903
1041
  for (; t.length >= 2; ) {
904
- const c = t[t.length - 1], l = t[t.length - 2];
905
- if ((c.x - l.x) * (a.y - l.y) >= (c.y - l.y) * (a.x - l.x)) t.pop();
1042
+ const i = t[t.length - 1], l = t[t.length - 2];
1043
+ if ((i.x - l.x) * (a.y - l.y) >= (i.y - l.y) * (a.x - l.x)) t.pop();
906
1044
  else break;
907
1045
  }
908
1046
  t.push(a);
909
1047
  }
910
1048
  return t.pop(), r.length === 1 && t.length === 1 && r[0].x === t[0].x && r[0].y === t[0].y ? r : r.concat(t);
911
1049
  }
912
- var fr = ue, vr = pe, mr = fe, xr = me, hr = xe, wr = he;
913
- const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1050
+ var Dr = we, kr = ge, Ir = ye, Mr = Ee, Lr = Ce, Fr = Pe;
1051
+ const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
914
1052
  __proto__: null,
915
- Arrow: wr,
916
- Content: hr,
917
- Portal: xr,
918
- Provider: fr,
919
- Root: vr,
920
- Tooltip: pe,
921
- TooltipArrow: he,
922
- TooltipContent: xe,
923
- TooltipPortal: me,
924
- TooltipProvider: ue,
925
- TooltipTrigger: fe,
926
- Trigger: mr,
927
- createTooltipScope: Qt
928
- }, Symbol.toStringTag, { value: "Module" })), { Provider: gr, Root: yr, Trigger: br, Portal: Er, Content: Cr, Arrow: Pr } = Tr, _r = ({
1053
+ Arrow: Fr,
1054
+ Content: Lr,
1055
+ Portal: Mr,
1056
+ Provider: Dr,
1057
+ Root: kr,
1058
+ Tooltip: ge,
1059
+ TooltipArrow: Pe,
1060
+ TooltipContent: Ce,
1061
+ TooltipPortal: Ee,
1062
+ TooltipProvider: we,
1063
+ TooltipTrigger: ye,
1064
+ Trigger: Ir,
1065
+ createTooltipScope: hr
1066
+ }, Symbol.toStringTag, { value: "Module" })), { Provider: $r, Root: Hr, Trigger: Kr, Portal: Wr, Content: zr, Arrow: Ur } = Vr, Jr = ({
929
1067
  children: e,
930
1068
  className: r,
931
1069
  defaultOpen: t,
932
1070
  side: o,
933
1071
  content: a,
934
- delayDuration: c = 0,
1072
+ delayDuration: i = 0,
935
1073
  isDisabled: l = !1
936
- }) => /* @__PURE__ */ s.jsx(gr, { children: /* @__PURE__ */ s.jsxs(yr, { defaultOpen: t, delayDuration: c, children: [
937
- /* @__PURE__ */ s.jsx(br, { asChild: !0, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
938
- !l && /* @__PURE__ */ s.jsx(Er, { children: /* @__PURE__ */ s.jsxs(
939
- Cr,
1074
+ }) => /* @__PURE__ */ s.jsx($r, { children: /* @__PURE__ */ s.jsxs(Hr, { defaultOpen: t, delayDuration: i, children: [
1075
+ /* @__PURE__ */ s.jsx(Kr, { asChild: !0, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
1076
+ !l && /* @__PURE__ */ s.jsx(Wr, { children: /* @__PURE__ */ s.jsxs(
1077
+ zr,
940
1078
  {
941
1079
  side: o,
942
1080
  sideOffset: 5,
943
- className: P(Ee.content, r),
1081
+ className: P(Oe.content, r),
944
1082
  children: [
945
1083
  a,
946
- /* @__PURE__ */ s.jsx(Pr, { className: Ee.arrow })
1084
+ /* @__PURE__ */ s.jsx(Ur, { className: Oe.arrow })
947
1085
  ]
948
1086
  }
949
1087
  ) })
950
- ] }) }), Ee = {
1088
+ ] }) }), Oe = {
951
1089
  content: P(
952
1090
  "font-mono select-none w-auto h-auto max-size-32 rounded-[5px] bg-dark-30 px-4 py-2 text-[10px] text-start leading-none text-sidebar-10 z-50",
953
1091
  "animate-tooltipFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade",
@@ -956,41 +1094,42 @@ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
956
1094
  "data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade"
957
1095
  ),
958
1096
  arrow: "fill-dark-30"
959
- }, Dr = ({
1097
+ }, Zr = ({
960
1098
  value: e,
961
1099
  onValueChange: r,
962
1100
  classNames: t = {},
963
1101
  count: o = 3,
964
1102
  ...a
965
- }) => /* @__PURE__ */ s.jsx(vt, { value: e, onValueChange: r, children: /* @__PURE__ */ s.jsx(
966
- mt,
1103
+ }) => /* @__PURE__ */ s.jsx(Rt, { value: e, onValueChange: r, children: /* @__PURE__ */ s.jsx(
1104
+ St,
967
1105
  {
968
- className: P(re.container, t.container),
1106
+ className: P(ce.container, t.container),
969
1107
  ...a,
970
- children: Array.from({ length: o }).map((c, l) => /* @__PURE__ */ s.jsx(
971
- xt,
1108
+ children: Array.from({ length: o }).map((i, l) => /* @__PURE__ */ s.jsx(
1109
+ At,
972
1110
  {
973
1111
  value: String(l),
974
1112
  className: P(
975
- re.dot,
976
- l <= Number(e) && re.dotActive,
1113
+ ce.dot,
1114
+ l <= Number(e) && ce.dotActive,
977
1115
  t.trigger
978
1116
  )
979
1117
  },
980
1118
  l
981
1119
  ))
982
1120
  }
983
- ) }), re = {
1121
+ ) }), ce = {
984
1122
  container: "flex items-center gap-1",
985
1123
  dot: "size-2 rounded-full bg-dark-30/[.20] transition-colors focus:outline-none focus:ring-offset-0 focus:ring-primary-10",
986
1124
  dotActive: "bg-primary-10"
987
1125
  };
988
1126
  export {
989
- kr as N,
990
- Sr as S,
991
- _r as T,
992
- Dr as a,
993
- re as b,
1127
+ mr as N,
1128
+ Qr as S,
1129
+ Br as T,
1130
+ Jr as a,
1131
+ Zr as b,
1132
+ ce as c,
994
1133
  D as s,
995
- Ee as t
1134
+ Oe as t
996
1135
  };