@krosoft/react 0.0.22 → 0.0.23

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,7 +1,7 @@
1
- import { jsx as p, jsxs as re, Fragment as ye } from "react/jsx-runtime";
1
+ import { jsx as f, jsxs as re, Fragment as ye } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
3
  import F from "react";
4
- import { a as Ye, c as R } from "./index-gWiv5-6R.js";
4
+ import { a as Ye, c as P } from "./index-gWiv5-6R.js";
5
5
  import * as we from "react-dom";
6
6
  import qe from "react-dom";
7
7
  import { c as Ze } from "./createLucideIcon-BxMj32TH.js";
@@ -16,10 +16,10 @@ const le = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, de = Ye, o
16
16
  }), c = n && Object.entries(n).reduce((i, l) => {
17
17
  let [m, y] = l;
18
18
  return y === void 0 || (i[m] = y), i;
19
- }, {}), f = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((i, l) => {
20
- let { class: m, className: y, ...T } = l;
21
- return Object.entries(T).every((x) => {
22
- let [v, d] = x;
19
+ }, {}), p = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((i, l) => {
20
+ let { class: m, className: y, ...b } = l;
21
+ return Object.entries(b).every((C) => {
22
+ let [v, d] = C;
23
23
  return Array.isArray(d) ? d.includes({
24
24
  ...a,
25
25
  ...c
@@ -33,7 +33,7 @@ const le = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, de = Ye, o
33
33
  y
34
34
  ] : i;
35
35
  }, []);
36
- return de(e, u, f, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
36
+ return de(e, u, p, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
37
37
  }, Ge = oe(
38
38
  "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
39
39
  {
@@ -48,19 +48,19 @@ const le = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, de = Ye, o
48
48
  }
49
49
  }
50
50
  ), Je = o.forwardRef(
51
- ({ className: e, variant: t, ...n }, r) => /* @__PURE__ */ p("div", { ref: r, role: "alert", className: R(Ge({ variant: t }), e), ...n })
51
+ ({ className: e, variant: t, ...n }, r) => /* @__PURE__ */ f("div", { ref: r, role: "alert", className: P(Ge({ variant: t }), e), ...n })
52
52
  );
53
53
  Je.displayName = "Alert";
54
- const Qe = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("h5", { ref: n, className: R("mb-1 font-medium leading-none tracking-tight", e), ...t }));
54
+ const Qe = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("h5", { ref: n, className: P("mb-1 font-medium leading-none tracking-tight", e), ...t }));
55
55
  Qe.displayName = "AlertTitle";
56
- const et = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("div", { ref: n, className: R("text-sm [&_p]:leading-relaxed", e), ...t }));
56
+ const et = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("div", { ref: n, className: P("text-sm [&_p]:leading-relaxed", e), ...t }));
57
57
  et.displayName = "AlertDescription";
58
58
  function fe(e, t) {
59
59
  if (typeof e == "function")
60
60
  return e(t);
61
61
  e != null && (e.current = t);
62
62
  }
63
- function Ee(...e) {
63
+ function ge(...e) {
64
64
  return (t) => {
65
65
  let n = !1;
66
66
  const r = e.map((s) => {
@@ -77,17 +77,17 @@ function Ee(...e) {
77
77
  };
78
78
  }
79
79
  function k(...e) {
80
- return o.useCallback(Ee(...e), e);
80
+ return o.useCallback(ge(...e), e);
81
81
  }
82
82
  // @__NO_SIDE_EFFECTS__
83
83
  function q(e) {
84
84
  const t = /* @__PURE__ */ nt(e), n = o.forwardRef((r, s) => {
85
- const { children: a, ...u } = r, c = o.Children.toArray(a), f = c.find(ot);
86
- if (f) {
87
- const i = f.props.children, l = c.map((m) => m === f ? o.Children.count(i) > 1 ? o.Children.only(null) : o.isValidElement(i) ? i.props.children : null : m);
88
- return /* @__PURE__ */ p(t, { ...u, ref: s, children: o.isValidElement(i) ? o.cloneElement(i, void 0, l) : null });
85
+ const { children: a, ...u } = r, c = o.Children.toArray(a), p = c.find(ot);
86
+ if (p) {
87
+ const i = p.props.children, l = c.map((m) => m === p ? o.Children.count(i) > 1 ? o.Children.only(null) : o.isValidElement(i) ? i.props.children : null : m);
88
+ return /* @__PURE__ */ f(t, { ...u, ref: s, children: o.isValidElement(i) ? o.cloneElement(i, void 0, l) : null });
89
89
  }
90
- return /* @__PURE__ */ p(t, { ...u, ref: s, children: a });
90
+ return /* @__PURE__ */ f(t, { ...u, ref: s, children: a });
91
91
  });
92
92
  return n.displayName = `${e}.Slot`, n;
93
93
  }
@@ -98,7 +98,7 @@ function nt(e) {
98
98
  const { children: s, ...a } = n;
99
99
  if (o.isValidElement(s)) {
100
100
  const u = it(s), c = st(a, s.props);
101
- return s.type !== o.Fragment && (c.ref = r ? Ee(r, u) : u), o.cloneElement(s, c);
101
+ return s.type !== o.Fragment && (c.ref = r ? ge(r, u) : u), o.cloneElement(s, c);
102
102
  }
103
103
  return o.Children.count(s) > 1 ? o.Children.only(null) : null;
104
104
  });
@@ -113,8 +113,8 @@ function st(e, t) {
113
113
  for (const r in t) {
114
114
  const s = e[r], a = t[r];
115
115
  /^on[A-Z]/.test(r) ? s && a ? n[r] = (...c) => {
116
- const f = a(...c);
117
- return s(...c), f;
116
+ const p = a(...c);
117
+ return s(...c), p;
118
118
  } : s && (n[r] = s) : r === "style" ? n[r] = { ...s, ...a } : r === "className" && (n[r] = [s, a].filter(Boolean).join(" "));
119
119
  }
120
120
  return { ...e, ...n };
@@ -149,41 +149,54 @@ const at = oe(
149
149
  size: "default"
150
150
  }
151
151
  }
152
- ), ct = o.forwardRef(({ className: e, variant: t, size: n, asChild: r = !1, ...s }, a) => /* @__PURE__ */ p(r ? tt : "button", { className: R(at({ variant: t, size: n, className: e })), ref: a, ...s }));
152
+ ), ct = o.forwardRef(({ className: e, variant: t, size: n, asChild: r = !1, ...s }, a) => /* @__PURE__ */ f(r ? tt : "button", { className: P(at({ variant: t, size: n, className: e })), ref: a, ...s }));
153
153
  ct.displayName = "Button";
154
- const ut = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("div", { ref: n, className: R("rounded-lg border bg-card text-card-foreground shadow-sm", e), ...t }));
154
+ const ut = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("div", { ref: n, className: P("rounded-lg border bg-card text-card-foreground shadow-sm", e), ...t }));
155
155
  ut.displayName = "Card";
156
- const lt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("div", { ref: n, className: R("flex flex-col space-y-1.5 p-6", e), ...t }));
156
+ const lt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("div", { ref: n, className: P("flex flex-col space-y-1.5 p-6", e), ...t }));
157
157
  lt.displayName = "CardHeader";
158
- const dt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("h3", { ref: n, className: R("text-2xl font-semibold leading-none tracking-tight", e), ...t }));
158
+ const dt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("h3", { ref: n, className: P("text-2xl font-semibold leading-none tracking-tight", e), ...t }));
159
159
  dt.displayName = "CardTitle";
160
- const ft = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("p", { ref: n, className: R("text-sm text-muted-foreground", e), ...t }));
160
+ const ft = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("p", { ref: n, className: P("text-sm text-muted-foreground", e), ...t }));
161
161
  ft.displayName = "CardDescription";
162
- const pt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("div", { ref: n, className: R("p-6 pt-0", e), ...t }));
162
+ const pt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("div", { ref: n, className: P("p-6 pt-0", e), ...t }));
163
163
  pt.displayName = "CardContent";
164
- const mt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p("div", { ref: n, className: R("flex items-center p-6 pt-0", e), ...t }));
164
+ const mt = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f("div", { ref: n, className: P("flex items-center p-6 pt-0", e), ...t }));
165
165
  mt.displayName = "CardFooter";
166
+ const vt = o.forwardRef(({ className: e, type: t, ...n }, r) => /* @__PURE__ */ f(
167
+ "input",
168
+ {
169
+ type: t,
170
+ className: P(
171
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
172
+ e
173
+ ),
174
+ ref: r,
175
+ ...n
176
+ }
177
+ ));
178
+ vt.displayName = "Input";
166
179
  function S(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
167
180
  return function(s) {
168
181
  if (e == null || e(s), n === !1 || !s.defaultPrevented)
169
182
  return t == null ? void 0 : t(s);
170
183
  };
171
184
  }
172
- function he(e, t = []) {
185
+ function Ee(e, t = []) {
173
186
  let n = [];
174
187
  function r(a, u) {
175
- const c = o.createContext(u), f = n.length;
188
+ const c = o.createContext(u), p = n.length;
176
189
  n = [...n, u];
177
190
  const i = (m) => {
178
- var C;
179
- const { scope: y, children: T, ...x } = m, v = ((C = y == null ? void 0 : y[e]) == null ? void 0 : C[f]) || c, d = o.useMemo(() => x, Object.values(x));
180
- return /* @__PURE__ */ p(v.Provider, { value: d, children: T });
191
+ var x;
192
+ const { scope: y, children: b, ...C } = m, v = ((x = y == null ? void 0 : y[e]) == null ? void 0 : x[p]) || c, d = o.useMemo(() => C, Object.values(C));
193
+ return /* @__PURE__ */ f(v.Provider, { value: d, children: b });
181
194
  };
182
195
  i.displayName = a + "Provider";
183
196
  function l(m, y) {
184
197
  var v;
185
- const T = ((v = y == null ? void 0 : y[e]) == null ? void 0 : v[f]) || c, x = o.useContext(T);
186
- if (x) return x;
198
+ const b = ((v = y == null ? void 0 : y[e]) == null ? void 0 : v[p]) || c, C = o.useContext(b);
199
+ if (C) return C;
187
200
  if (u !== void 0) return u;
188
201
  throw new Error(`\`${m}\` must be used within \`${a}\``);
189
202
  }
@@ -192,16 +205,16 @@ function he(e, t = []) {
192
205
  const s = () => {
193
206
  const a = n.map((u) => o.createContext(u));
194
207
  return function(c) {
195
- const f = (c == null ? void 0 : c[e]) || a;
208
+ const p = (c == null ? void 0 : c[e]) || a;
196
209
  return o.useMemo(
197
- () => ({ [`__scope${e}`]: { ...c, [e]: f } }),
198
- [c, f]
210
+ () => ({ [`__scope${e}`]: { ...c, [e]: p } }),
211
+ [c, p]
199
212
  );
200
213
  };
201
214
  };
202
- return s.scopeName = e, [r, vt(s, ...t)];
215
+ return s.scopeName = e, [r, yt(s, ...t)];
203
216
  }
204
- function vt(...e) {
217
+ function yt(...e) {
205
218
  const t = e[0];
206
219
  if (e.length === 1) return t;
207
220
  const n = () => {
@@ -210,8 +223,8 @@ function vt(...e) {
210
223
  scopeName: s.scopeName
211
224
  }));
212
225
  return function(a) {
213
- const u = r.reduce((c, { useScope: f, scopeName: i }) => {
214
- const m = f(a)[`__scope${i}`];
226
+ const u = r.reduce((c, { useScope: p, scopeName: i }) => {
227
+ const m = p(a)[`__scope${i}`];
215
228
  return { ...c, ...m };
216
229
  }, {});
217
230
  return o.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
@@ -219,47 +232,47 @@ function vt(...e) {
219
232
  };
220
233
  return n.scopeName = t.scopeName, n;
221
234
  }
222
- function yt(e) {
223
- const t = e + "CollectionProvider", [n, r] = he(t), [s, a] = n(
235
+ function wt(e) {
236
+ const t = e + "CollectionProvider", [n, r] = Ee(t), [s, a] = n(
224
237
  t,
225
238
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
226
239
  ), u = (v) => {
227
- const { scope: d, children: C } = v, E = F.useRef(null), h = F.useRef(/* @__PURE__ */ new Map()).current;
228
- return /* @__PURE__ */ p(s, { scope: d, itemMap: h, collectionRef: E, children: C });
240
+ const { scope: d, children: x } = v, g = F.useRef(null), E = F.useRef(/* @__PURE__ */ new Map()).current;
241
+ return /* @__PURE__ */ f(s, { scope: d, itemMap: E, collectionRef: g, children: x });
229
242
  };
230
243
  u.displayName = t;
231
- const c = e + "CollectionSlot", f = /* @__PURE__ */ q(c), i = F.forwardRef(
244
+ const c = e + "CollectionSlot", p = /* @__PURE__ */ q(c), i = F.forwardRef(
232
245
  (v, d) => {
233
- const { scope: C, children: E } = v, h = a(c, C), b = k(d, h.collectionRef);
234
- return /* @__PURE__ */ p(f, { ref: b, children: E });
246
+ const { scope: x, children: g } = v, E = a(c, x), T = k(d, E.collectionRef);
247
+ return /* @__PURE__ */ f(p, { ref: T, children: g });
235
248
  }
236
249
  );
237
250
  i.displayName = c;
238
- const l = e + "CollectionItemSlot", m = "data-radix-collection-item", y = /* @__PURE__ */ q(l), T = F.forwardRef(
251
+ const l = e + "CollectionItemSlot", m = "data-radix-collection-item", y = /* @__PURE__ */ q(l), b = F.forwardRef(
239
252
  (v, d) => {
240
- const { scope: C, children: E, ...h } = v, b = F.useRef(null), P = k(d, b), N = a(l, C);
241
- return F.useEffect(() => (N.itemMap.set(b, { ref: b, ...h }), () => void N.itemMap.delete(b))), /* @__PURE__ */ p(y, { [m]: "", ref: P, children: E });
253
+ const { scope: x, children: g, ...E } = v, T = F.useRef(null), R = k(d, T), N = a(l, x);
254
+ return F.useEffect(() => (N.itemMap.set(T, { ref: T, ...E }), () => void N.itemMap.delete(T))), /* @__PURE__ */ f(y, { [m]: "", ref: R, children: g });
242
255
  }
243
256
  );
244
- T.displayName = l;
245
- function x(v) {
257
+ b.displayName = l;
258
+ function C(v) {
246
259
  const d = a(e + "CollectionConsumer", v);
247
260
  return F.useCallback(() => {
248
- const E = d.collectionRef.current;
249
- if (!E) return [];
250
- const h = Array.from(E.querySelectorAll(`[${m}]`));
261
+ const g = d.collectionRef.current;
262
+ if (!g) return [];
263
+ const E = Array.from(g.querySelectorAll(`[${m}]`));
251
264
  return Array.from(d.itemMap.values()).sort(
252
- (N, g) => h.indexOf(N.ref.current) - h.indexOf(g.ref.current)
265
+ (N, h) => E.indexOf(N.ref.current) - E.indexOf(h.ref.current)
253
266
  );
254
267
  }, [d.collectionRef, d.itemMap]);
255
268
  }
256
269
  return [
257
- { Provider: u, Slot: i, ItemSlot: T },
258
- x,
270
+ { Provider: u, Slot: i, ItemSlot: b },
271
+ C,
259
272
  r
260
273
  ];
261
274
  }
262
- var wt = [
275
+ var gt = [
263
276
  "a",
264
277
  "button",
265
278
  "div",
@@ -277,14 +290,14 @@ var wt = [
277
290
  "span",
278
291
  "svg",
279
292
  "ul"
280
- ], I = wt.reduce((e, t) => {
293
+ ], O = gt.reduce((e, t) => {
281
294
  const n = /* @__PURE__ */ q(`Primitive.${t}`), r = o.forwardRef((s, a) => {
282
- const { asChild: u, ...c } = s, f = u ? n : t;
283
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(f, { ...c, ref: a });
295
+ const { asChild: u, ...c } = s, p = u ? n : t;
296
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: a });
284
297
  });
285
298
  return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
286
299
  }, {});
287
- function ge(e, t) {
300
+ function he(e, t) {
288
301
  e && we.flushSync(() => e.dispatchEvent(t));
289
302
  }
290
303
  function V(e) {
@@ -305,11 +318,11 @@ function Et(e, t = globalThis == null ? void 0 : globalThis.document) {
305
318
  return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
306
319
  }, [n, t]);
307
320
  }
308
- var ht = "DismissableLayer", Q = "dismissableLayer.update", gt = "dismissableLayer.pointerDownOutside", Tt = "dismissableLayer.focusOutside", pe, Te = o.createContext({
321
+ var ht = "DismissableLayer", Q = "dismissableLayer.update", bt = "dismissableLayer.pointerDownOutside", Tt = "dismissableLayer.focusOutside", pe, be = o.createContext({
309
322
  layers: /* @__PURE__ */ new Set(),
310
323
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
311
324
  branches: /* @__PURE__ */ new Set()
312
- }), be = o.forwardRef(
325
+ }), Te = o.forwardRef(
313
326
  (e, t) => {
314
327
  const {
315
328
  disableOutsidePointerEvents: n = !1,
@@ -318,16 +331,16 @@ var ht = "DismissableLayer", Q = "dismissableLayer.update", gt = "dismissableLay
318
331
  onFocusOutside: a,
319
332
  onInteractOutside: u,
320
333
  onDismiss: c,
321
- ...f
322
- } = e, i = o.useContext(Te), [l, m] = o.useState(null), y = (l == null ? void 0 : l.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, T] = o.useState({}), x = k(t, (g) => m(g)), v = Array.from(i.layers), [d] = [...i.layersWithOutsidePointerEventsDisabled].slice(-1), C = v.indexOf(d), E = l ? v.indexOf(l) : -1, h = i.layersWithOutsidePointerEventsDisabled.size > 0, b = E >= C, P = Ct((g) => {
323
- const O = g.target, D = [...i.branches].some((L) => L.contains(O));
324
- !b || D || (s == null || s(g), u == null || u(g), g.defaultPrevented || c == null || c());
325
- }, y), N = xt((g) => {
326
- const O = g.target;
327
- [...i.branches].some((L) => L.contains(O)) || (a == null || a(g), u == null || u(g), g.defaultPrevented || c == null || c());
334
+ ...p
335
+ } = e, i = o.useContext(be), [l, m] = o.useState(null), y = (l == null ? void 0 : l.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, b] = o.useState({}), C = k(t, (h) => m(h)), v = Array.from(i.layers), [d] = [...i.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(d), g = l ? v.indexOf(l) : -1, E = i.layersWithOutsidePointerEventsDisabled.size > 0, T = g >= x, R = Ct((h) => {
336
+ const I = h.target, D = [...i.branches].some((L) => L.contains(I));
337
+ !T || D || (s == null || s(h), u == null || u(h), h.defaultPrevented || c == null || c());
338
+ }, y), N = Nt((h) => {
339
+ const I = h.target;
340
+ [...i.branches].some((L) => L.contains(I)) || (a == null || a(h), u == null || u(h), h.defaultPrevented || c == null || c());
328
341
  }, y);
329
- return Et((g) => {
330
- E === i.layers.size - 1 && (r == null || r(g), !g.defaultPrevented && c && (g.preventDefault(), c()));
342
+ return Et((h) => {
343
+ g === i.layers.size - 1 && (r == null || r(h), !h.defaultPrevented && c && (h.preventDefault(), c()));
331
344
  }, y), o.useEffect(() => {
332
345
  if (l)
333
346
  return n && (i.layersWithOutsidePointerEventsDisabled.size === 0 && (pe = y.body.style.pointerEvents, y.body.style.pointerEvents = "none"), i.layersWithOutsidePointerEventsDisabled.add(l)), i.layers.add(l), me(), () => {
@@ -336,55 +349,55 @@ var ht = "DismissableLayer", Q = "dismissableLayer.update", gt = "dismissableLay
336
349
  }, [l, y, n, i]), o.useEffect(() => () => {
337
350
  l && (i.layers.delete(l), i.layersWithOutsidePointerEventsDisabled.delete(l), me());
338
351
  }, [l, i]), o.useEffect(() => {
339
- const g = () => T({});
340
- return document.addEventListener(Q, g), () => document.removeEventListener(Q, g);
341
- }, []), /* @__PURE__ */ p(
342
- I.div,
352
+ const h = () => b({});
353
+ return document.addEventListener(Q, h), () => document.removeEventListener(Q, h);
354
+ }, []), /* @__PURE__ */ f(
355
+ O.div,
343
356
  {
344
- ...f,
345
- ref: x,
357
+ ...p,
358
+ ref: C,
346
359
  style: {
347
- pointerEvents: h ? b ? "auto" : "none" : void 0,
360
+ pointerEvents: E ? T ? "auto" : "none" : void 0,
348
361
  ...e.style
349
362
  },
350
363
  onFocusCapture: S(e.onFocusCapture, N.onFocusCapture),
351
364
  onBlurCapture: S(e.onBlurCapture, N.onBlurCapture),
352
365
  onPointerDownCapture: S(
353
366
  e.onPointerDownCapture,
354
- P.onPointerDownCapture
367
+ R.onPointerDownCapture
355
368
  )
356
369
  }
357
370
  );
358
371
  }
359
372
  );
360
- be.displayName = ht;
361
- var bt = "DismissableLayerBranch", Ce = o.forwardRef((e, t) => {
362
- const n = o.useContext(Te), r = o.useRef(null), s = k(t, r);
373
+ Te.displayName = ht;
374
+ var xt = "DismissableLayerBranch", xe = o.forwardRef((e, t) => {
375
+ const n = o.useContext(be), r = o.useRef(null), s = k(t, r);
363
376
  return o.useEffect(() => {
364
377
  const a = r.current;
365
378
  if (a)
366
379
  return n.branches.add(a), () => {
367
380
  n.branches.delete(a);
368
381
  };
369
- }, [n.branches]), /* @__PURE__ */ p(I.div, { ...e, ref: s });
382
+ }, [n.branches]), /* @__PURE__ */ f(O.div, { ...e, ref: s });
370
383
  });
371
- Ce.displayName = bt;
384
+ xe.displayName = xt;
372
385
  function Ct(e, t = globalThis == null ? void 0 : globalThis.document) {
373
386
  const n = V(e), r = o.useRef(!1), s = o.useRef(() => {
374
387
  });
375
388
  return o.useEffect(() => {
376
389
  const a = (c) => {
377
390
  if (c.target && !r.current) {
378
- let f = function() {
379
- xe(
380
- gt,
391
+ let p = function() {
392
+ Ce(
393
+ bt,
381
394
  n,
382
395
  i,
383
396
  { discrete: !0 }
384
397
  );
385
398
  };
386
399
  const i = { originalEvent: c };
387
- c.pointerType === "touch" ? (t.removeEventListener("click", s.current), s.current = f, t.addEventListener("click", s.current, { once: !0 })) : f();
400
+ c.pointerType === "touch" ? (t.removeEventListener("click", s.current), s.current = p, t.addEventListener("click", s.current, { once: !0 })) : p();
388
401
  } else
389
402
  t.removeEventListener("click", s.current);
390
403
  r.current = !1;
@@ -399,11 +412,11 @@ function Ct(e, t = globalThis == null ? void 0 : globalThis.document) {
399
412
  onPointerDownCapture: () => r.current = !0
400
413
  };
401
414
  }
402
- function xt(e, t = globalThis == null ? void 0 : globalThis.document) {
415
+ function Nt(e, t = globalThis == null ? void 0 : globalThis.document) {
403
416
  const n = V(e), r = o.useRef(!1);
404
417
  return o.useEffect(() => {
405
418
  const s = (a) => {
406
- a.target && !r.current && xe(Tt, n, { originalEvent: a }, {
419
+ a.target && !r.current && Ce(Tt, n, { originalEvent: a }, {
407
420
  discrete: !1
408
421
  });
409
422
  };
@@ -417,29 +430,29 @@ function me() {
417
430
  const e = new CustomEvent(Q);
418
431
  document.dispatchEvent(e);
419
432
  }
420
- function xe(e, t, n, { discrete: r }) {
433
+ function Ce(e, t, n, { discrete: r }) {
421
434
  const s = n.originalEvent.target, a = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
422
- t && s.addEventListener(e, t, { once: !0 }), r ? ge(s, a) : s.dispatchEvent(a);
435
+ t && s.addEventListener(e, t, { once: !0 }), r ? he(s, a) : s.dispatchEvent(a);
423
436
  }
424
- var Nt = be, Pt = Ce, B = globalThis != null && globalThis.document ? o.useLayoutEffect : () => {
425
- }, Rt = "Portal", Ne = o.forwardRef((e, t) => {
437
+ var Rt = Te, Pt = xe, B = globalThis != null && globalThis.document ? o.useLayoutEffect : () => {
438
+ }, St = "Portal", Ne = o.forwardRef((e, t) => {
426
439
  var c;
427
440
  const { container: n, ...r } = e, [s, a] = o.useState(!1);
428
441
  B(() => a(!0), []);
429
442
  const u = n || s && ((c = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : c.body);
430
- return u ? qe.createPortal(/* @__PURE__ */ p(I.div, { ...r, ref: t }), u) : null;
443
+ return u ? qe.createPortal(/* @__PURE__ */ f(O.div, { ...r, ref: t }), u) : null;
431
444
  });
432
- Ne.displayName = Rt;
433
- function St(e, t) {
445
+ Ne.displayName = St;
446
+ function At(e, t) {
434
447
  return o.useReducer((n, r) => t[n][r] ?? n, e);
435
448
  }
436
- var Pe = (e) => {
437
- const { present: t, children: n } = e, r = At(t), s = typeof n == "function" ? n({ present: r.isPresent }) : o.Children.only(n), a = k(r.ref, Ot(s));
449
+ var Re = (e) => {
450
+ const { present: t, children: n } = e, r = It(t), s = typeof n == "function" ? n({ present: r.isPresent }) : o.Children.only(n), a = k(r.ref, Ot(s));
438
451
  return typeof n == "function" || r.isPresent ? o.cloneElement(s, { ref: a }) : null;
439
452
  };
440
- Pe.displayName = "Presence";
441
- function At(e) {
442
- const [t, n] = o.useState(), r = o.useRef(null), s = o.useRef(e), a = o.useRef("none"), u = e ? "mounted" : "unmounted", [c, f] = St(u, {
453
+ Re.displayName = "Presence";
454
+ function It(e) {
455
+ const [t, n] = o.useState(), r = o.useRef(null), s = o.useRef(e), a = o.useRef("none"), u = e ? "mounted" : "unmounted", [c, p] = At(u, {
443
456
  mounted: {
444
457
  UNMOUNT: "unmounted",
445
458
  ANIMATION_OUT: "unmountSuspended"
@@ -458,29 +471,29 @@ function At(e) {
458
471
  }, [c]), B(() => {
459
472
  const i = r.current, l = s.current;
460
473
  if (l !== e) {
461
- const y = a.current, T = X(i);
462
- e ? f("MOUNT") : T === "none" || (i == null ? void 0 : i.display) === "none" ? f("UNMOUNT") : f(l && y !== T ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
474
+ const y = a.current, b = X(i);
475
+ e ? p("MOUNT") : b === "none" || (i == null ? void 0 : i.display) === "none" ? p("UNMOUNT") : p(l && y !== b ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
463
476
  }
464
- }, [e, f]), B(() => {
477
+ }, [e, p]), B(() => {
465
478
  if (t) {
466
479
  let i;
467
- const l = t.ownerDocument.defaultView ?? window, m = (T) => {
468
- const v = X(r.current).includes(CSS.escape(T.animationName));
469
- if (T.target === t && v && (f("ANIMATION_END"), !s.current)) {
480
+ const l = t.ownerDocument.defaultView ?? window, m = (b) => {
481
+ const v = X(r.current).includes(CSS.escape(b.animationName));
482
+ if (b.target === t && v && (p("ANIMATION_END"), !s.current)) {
470
483
  const d = t.style.animationFillMode;
471
484
  t.style.animationFillMode = "forwards", i = l.setTimeout(() => {
472
485
  t.style.animationFillMode === "forwards" && (t.style.animationFillMode = d);
473
486
  });
474
487
  }
475
- }, y = (T) => {
476
- T.target === t && (a.current = X(r.current));
488
+ }, y = (b) => {
489
+ b.target === t && (a.current = X(r.current));
477
490
  };
478
491
  return t.addEventListener("animationstart", y), t.addEventListener("animationcancel", m), t.addEventListener("animationend", m), () => {
479
492
  l.clearTimeout(i), t.removeEventListener("animationstart", y), t.removeEventListener("animationcancel", m), t.removeEventListener("animationend", m);
480
493
  };
481
494
  } else
482
- f("ANIMATION_END");
483
- }, [t, f]), {
495
+ p("ANIMATION_END");
496
+ }, [t, p]), {
484
497
  isPresent: ["mounted", "unmountSuspended"].includes(c),
485
498
  ref: o.useCallback((i) => {
486
499
  r.current = i ? getComputedStyle(i) : null, n(i);
@@ -495,18 +508,18 @@ function Ot(e) {
495
508
  let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
496
509
  return n ? e.ref : (t = (s = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : s.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
497
510
  }
498
- var It = o[" useInsertionEffect ".trim().toString()] || B;
499
- function Dt({
511
+ var Dt = o[" useInsertionEffect ".trim().toString()] || B;
512
+ function _t({
500
513
  prop: e,
501
514
  defaultProp: t,
502
515
  onChange: n = () => {
503
516
  },
504
517
  caller: r
505
518
  }) {
506
- const [s, a, u] = _t({
519
+ const [s, a, u] = Lt({
507
520
  defaultProp: t,
508
521
  onChange: n
509
- }), c = e !== void 0, f = c ? e : s;
522
+ }), c = e !== void 0, p = c ? e : s;
510
523
  {
511
524
  const l = o.useRef(e !== void 0);
512
525
  o.useEffect(() => {
@@ -520,31 +533,31 @@ function Dt({
520
533
  (l) => {
521
534
  var m;
522
535
  if (c) {
523
- const y = Lt(l) ? l(e) : l;
536
+ const y = Mt(l) ? l(e) : l;
524
537
  y !== e && ((m = u.current) == null || m.call(u, y));
525
538
  } else
526
539
  a(l);
527
540
  },
528
541
  [c, e, a, u]
529
542
  );
530
- return [f, i];
543
+ return [p, i];
531
544
  }
532
- function _t({
545
+ function Lt({
533
546
  defaultProp: e,
534
547
  onChange: t
535
548
  }) {
536
549
  const [n, r] = o.useState(e), s = o.useRef(n), a = o.useRef(t);
537
- return It(() => {
550
+ return Dt(() => {
538
551
  a.current = t;
539
552
  }, [t]), o.useEffect(() => {
540
553
  var u;
541
554
  s.current !== n && ((u = a.current) == null || u.call(a, n), s.current = n);
542
555
  }, [n, s]), [n, r, a];
543
556
  }
544
- function Lt(e) {
557
+ function Mt(e) {
545
558
  return typeof e == "function";
546
559
  }
547
- var Mt = Object.freeze({
560
+ var Ft = Object.freeze({
548
561
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
549
562
  position: "absolute",
550
563
  border: 0,
@@ -556,18 +569,18 @@ var Mt = Object.freeze({
556
569
  clip: "rect(0, 0, 0, 0)",
557
570
  whiteSpace: "nowrap",
558
571
  wordWrap: "normal"
559
- }), Ft = "VisuallyHidden", se = o.forwardRef(
560
- (e, t) => /* @__PURE__ */ p(
561
- I.span,
572
+ }), kt = "VisuallyHidden", se = o.forwardRef(
573
+ (e, t) => /* @__PURE__ */ f(
574
+ O.span,
562
575
  {
563
576
  ...e,
564
577
  ref: t,
565
- style: { ...Mt, ...e.style }
578
+ style: { ...Ft, ...e.style }
566
579
  }
567
580
  )
568
581
  );
569
- se.displayName = Ft;
570
- var ie = "ToastProvider", [ae, kt, Vt] = yt("Toast"), [Re] = he("Toast", [Vt]), [Wt, Z] = Re(ie), Se = (e) => {
582
+ se.displayName = kt;
583
+ var ie = "ToastProvider", [ae, Vt, Wt] = wt("Toast"), [Pe] = Ee("Toast", [Wt]), [$t, Z] = Pe(ie), Se = (e) => {
571
584
  const {
572
585
  __scopeToast: t,
573
586
  label: n = "Notification",
@@ -575,11 +588,11 @@ var ie = "ToastProvider", [ae, kt, Vt] = yt("Toast"), [Re] = he("Toast", [Vt]),
575
588
  swipeDirection: s = "right",
576
589
  swipeThreshold: a = 50,
577
590
  children: u
578
- } = e, [c, f] = o.useState(null), [i, l] = o.useState(0), m = o.useRef(!1), y = o.useRef(!1);
591
+ } = e, [c, p] = o.useState(null), [i, l] = o.useState(0), m = o.useRef(!1), y = o.useRef(!1);
579
592
  return n.trim() || console.error(
580
593
  `Invalid prop \`label\` supplied to \`${ie}\`. Expected non-empty \`string\`.`
581
- ), /* @__PURE__ */ p(ae.Provider, { scope: t, children: /* @__PURE__ */ p(
582
- Wt,
594
+ ), /* @__PURE__ */ f(ae.Provider, { scope: t, children: /* @__PURE__ */ f(
595
+ $t,
583
596
  {
584
597
  scope: t,
585
598
  label: n,
@@ -588,9 +601,9 @@ var ie = "ToastProvider", [ae, kt, Vt] = yt("Toast"), [Re] = he("Toast", [Vt]),
588
601
  swipeThreshold: a,
589
602
  toastCount: i,
590
603
  viewport: c,
591
- onViewportChange: f,
592
- onToastAdd: o.useCallback(() => l((T) => T + 1), []),
593
- onToastRemove: o.useCallback(() => l((T) => T - 1), []),
604
+ onViewportChange: p,
605
+ onToastAdd: o.useCallback(() => l((b) => b + 1), []),
606
+ onToastRemove: o.useCallback(() => l((b) => b - 1), []),
594
607
  isFocusedToastEscapeKeyDownRef: m,
595
608
  isClosePausedRef: y,
596
609
  children: u
@@ -598,81 +611,81 @@ var ie = "ToastProvider", [ae, kt, Vt] = yt("Toast"), [Re] = he("Toast", [Vt]),
598
611
  ) });
599
612
  };
600
613
  Se.displayName = ie;
601
- var Ae = "ToastViewport", $t = ["F8"], ee = "toast.viewportPause", te = "toast.viewportResume", Oe = o.forwardRef(
614
+ var Ae = "ToastViewport", Ut = ["F8"], ee = "toast.viewportPause", te = "toast.viewportResume", Ie = o.forwardRef(
602
615
  (e, t) => {
603
616
  const {
604
617
  __scopeToast: n,
605
- hotkey: r = $t,
618
+ hotkey: r = Ut,
606
619
  label: s = "Notifications ({hotkey})",
607
620
  ...a
608
- } = e, u = Z(Ae, n), c = kt(n), f = o.useRef(null), i = o.useRef(null), l = o.useRef(null), m = o.useRef(null), y = k(t, m, u.onViewportChange), T = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""), x = u.toastCount > 0;
621
+ } = e, u = Z(Ae, n), c = Vt(n), p = o.useRef(null), i = o.useRef(null), l = o.useRef(null), m = o.useRef(null), y = k(t, m, u.onViewportChange), b = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""), C = u.toastCount > 0;
609
622
  o.useEffect(() => {
610
- const d = (C) => {
611
- var h;
612
- r.length !== 0 && r.every((b) => C[b] || C.code === b) && ((h = m.current) == null || h.focus());
623
+ const d = (x) => {
624
+ var E;
625
+ r.length !== 0 && r.every((T) => x[T] || x.code === T) && ((E = m.current) == null || E.focus());
613
626
  };
614
627
  return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
615
628
  }, [r]), o.useEffect(() => {
616
- const d = f.current, C = m.current;
617
- if (x && d && C) {
618
- const E = () => {
629
+ const d = p.current, x = m.current;
630
+ if (C && d && x) {
631
+ const g = () => {
619
632
  if (!u.isClosePausedRef.current) {
620
633
  const N = new CustomEvent(ee);
621
- C.dispatchEvent(N), u.isClosePausedRef.current = !0;
634
+ x.dispatchEvent(N), u.isClosePausedRef.current = !0;
622
635
  }
623
- }, h = () => {
636
+ }, E = () => {
624
637
  if (u.isClosePausedRef.current) {
625
638
  const N = new CustomEvent(te);
626
- C.dispatchEvent(N), u.isClosePausedRef.current = !1;
639
+ x.dispatchEvent(N), u.isClosePausedRef.current = !1;
627
640
  }
628
- }, b = (N) => {
629
- !d.contains(N.relatedTarget) && h();
630
- }, P = () => {
631
- d.contains(document.activeElement) || h();
641
+ }, T = (N) => {
642
+ !d.contains(N.relatedTarget) && E();
643
+ }, R = () => {
644
+ d.contains(document.activeElement) || E();
632
645
  };
633
- return d.addEventListener("focusin", E), d.addEventListener("focusout", b), d.addEventListener("pointermove", E), d.addEventListener("pointerleave", P), window.addEventListener("blur", E), window.addEventListener("focus", h), () => {
634
- d.removeEventListener("focusin", E), d.removeEventListener("focusout", b), d.removeEventListener("pointermove", E), d.removeEventListener("pointerleave", P), window.removeEventListener("blur", E), window.removeEventListener("focus", h);
646
+ return d.addEventListener("focusin", g), d.addEventListener("focusout", T), d.addEventListener("pointermove", g), d.addEventListener("pointerleave", R), window.addEventListener("blur", g), window.addEventListener("focus", E), () => {
647
+ d.removeEventListener("focusin", g), d.removeEventListener("focusout", T), d.removeEventListener("pointermove", g), d.removeEventListener("pointerleave", R), window.removeEventListener("blur", g), window.removeEventListener("focus", E);
635
648
  };
636
649
  }
637
- }, [x, u.isClosePausedRef]);
650
+ }, [C, u.isClosePausedRef]);
638
651
  const v = o.useCallback(
639
652
  ({ tabbingDirection: d }) => {
640
- const E = c().map((h) => {
641
- const b = h.ref.current, P = [b, ...Qt(b)];
642
- return d === "forwards" ? P : P.reverse();
653
+ const g = c().map((E) => {
654
+ const T = E.ref.current, R = [T, ...en(T)];
655
+ return d === "forwards" ? R : R.reverse();
643
656
  });
644
- return (d === "forwards" ? E.reverse() : E).flat();
657
+ return (d === "forwards" ? g.reverse() : g).flat();
645
658
  },
646
659
  [c]
647
660
  );
648
661
  return o.useEffect(() => {
649
662
  const d = m.current;
650
663
  if (d) {
651
- const C = (E) => {
652
- var P, N, g;
653
- const h = E.altKey || E.ctrlKey || E.metaKey;
654
- if (E.key === "Tab" && !h) {
655
- const O = document.activeElement, D = E.shiftKey;
656
- if (E.target === d && D) {
657
- (P = i.current) == null || P.focus();
664
+ const x = (g) => {
665
+ var R, N, h;
666
+ const E = g.altKey || g.ctrlKey || g.metaKey;
667
+ if (g.key === "Tab" && !E) {
668
+ const I = document.activeElement, D = g.shiftKey;
669
+ if (g.target === d && D) {
670
+ (R = i.current) == null || R.focus();
658
671
  return;
659
672
  }
660
- const M = v({ tabbingDirection: D ? "backwards" : "forwards" }), j = M.findIndex((w) => w === O);
661
- J(M.slice(j + 1)) ? E.preventDefault() : D ? (N = i.current) == null || N.focus() : (g = l.current) == null || g.focus();
673
+ const M = v({ tabbingDirection: D ? "backwards" : "forwards" }), j = M.findIndex((w) => w === I);
674
+ J(M.slice(j + 1)) ? g.preventDefault() : D ? (N = i.current) == null || N.focus() : (h = l.current) == null || h.focus();
662
675
  }
663
676
  };
664
- return d.addEventListener("keydown", C), () => d.removeEventListener("keydown", C);
677
+ return d.addEventListener("keydown", x), () => d.removeEventListener("keydown", x);
665
678
  }
666
679
  }, [c, v]), /* @__PURE__ */ re(
667
680
  Pt,
668
681
  {
669
- ref: f,
682
+ ref: p,
670
683
  role: "region",
671
- "aria-label": s.replace("{hotkey}", T),
684
+ "aria-label": s.replace("{hotkey}", b),
672
685
  tabIndex: -1,
673
- style: { pointerEvents: x ? void 0 : "none" },
686
+ style: { pointerEvents: C ? void 0 : "none" },
674
687
  children: [
675
- x && /* @__PURE__ */ p(
688
+ C && /* @__PURE__ */ f(
676
689
  ne,
677
690
  {
678
691
  ref: i,
@@ -684,8 +697,8 @@ var Ae = "ToastViewport", $t = ["F8"], ee = "toast.viewportPause", te = "toast.v
684
697
  }
685
698
  }
686
699
  ),
687
- /* @__PURE__ */ p(ae.Slot, { scope: n, children: /* @__PURE__ */ p(I.ol, { tabIndex: -1, ...a, ref: y }) }),
688
- x && /* @__PURE__ */ p(
700
+ /* @__PURE__ */ f(ae.Slot, { scope: n, children: /* @__PURE__ */ f(O.ol, { tabIndex: -1, ...a, ref: y }) }),
701
+ C && /* @__PURE__ */ f(
689
702
  ne,
690
703
  {
691
704
  ref: l,
@@ -702,11 +715,11 @@ var Ae = "ToastViewport", $t = ["F8"], ee = "toast.viewportPause", te = "toast.v
702
715
  );
703
716
  }
704
717
  );
705
- Oe.displayName = Ae;
706
- var Ie = "ToastFocusProxy", ne = o.forwardRef(
718
+ Ie.displayName = Ae;
719
+ var Oe = "ToastFocusProxy", ne = o.forwardRef(
707
720
  (e, t) => {
708
- const { __scopeToast: n, onFocusFromOutsideViewport: r, ...s } = e, a = Z(Ie, n);
709
- return /* @__PURE__ */ p(
721
+ const { __scopeToast: n, onFocusFromOutsideViewport: r, ...s } = e, a = Z(Oe, n);
722
+ return /* @__PURE__ */ f(
710
723
  se,
711
724
  {
712
725
  tabIndex: 0,
@@ -722,22 +735,22 @@ var Ie = "ToastFocusProxy", ne = o.forwardRef(
722
735
  );
723
736
  }
724
737
  );
725
- ne.displayName = Ie;
726
- var K = "Toast", Ut = "toast.swipeStart", Bt = "toast.swipeMove", Kt = "toast.swipeCancel", jt = "toast.swipeEnd", De = o.forwardRef(
738
+ ne.displayName = Oe;
739
+ var K = "Toast", Bt = "toast.swipeStart", Kt = "toast.swipeMove", jt = "toast.swipeCancel", Ht = "toast.swipeEnd", De = o.forwardRef(
727
740
  (e, t) => {
728
- const { forceMount: n, open: r, defaultOpen: s, onOpenChange: a, ...u } = e, [c, f] = Dt({
741
+ const { forceMount: n, open: r, defaultOpen: s, onOpenChange: a, ...u } = e, [c, p] = _t({
729
742
  prop: r,
730
743
  defaultProp: s ?? !0,
731
744
  onChange: a,
732
745
  caller: K
733
746
  });
734
- return /* @__PURE__ */ p(Pe, { present: n || c, children: /* @__PURE__ */ p(
735
- Xt,
747
+ return /* @__PURE__ */ f(Re, { present: n || c, children: /* @__PURE__ */ f(
748
+ Yt,
736
749
  {
737
750
  open: c,
738
751
  ...u,
739
752
  ref: t,
740
- onClose: () => f(!1),
753
+ onClose: () => p(!1),
741
754
  onPause: V(e.onPause),
742
755
  onResume: V(e.onResume),
743
756
  onSwipeStart: S(e.onSwipeStart, (i) => {
@@ -752,17 +765,17 @@ var K = "Toast", Ut = "toast.swipeStart", Bt = "toast.swipeMove", Kt = "toast.sw
752
765
  }),
753
766
  onSwipeEnd: S(e.onSwipeEnd, (i) => {
754
767
  const { x: l, y: m } = i.detail.delta;
755
- 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", `${l}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${m}px`), f(!1);
768
+ 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", `${l}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${m}px`), p(!1);
756
769
  })
757
770
  }
758
771
  ) });
759
772
  }
760
773
  );
761
774
  De.displayName = K;
762
- var [Ht, zt] = Re(K, {
775
+ var [zt, Xt] = Pe(K, {
763
776
  onClose() {
764
777
  }
765
- }), Xt = o.forwardRef(
778
+ }), Yt = o.forwardRef(
766
779
  (e, t) => {
767
780
  const {
768
781
  __scopeToast: n,
@@ -771,19 +784,19 @@ var [Ht, zt] = Re(K, {
771
784
  open: a,
772
785
  onClose: u,
773
786
  onEscapeKeyDown: c,
774
- onPause: f,
787
+ onPause: p,
775
788
  onResume: i,
776
789
  onSwipeStart: l,
777
790
  onSwipeMove: m,
778
791
  onSwipeCancel: y,
779
- onSwipeEnd: T,
780
- ...x
781
- } = e, v = Z(K, n), [d, C] = o.useState(null), E = k(t, (w) => C(w)), h = o.useRef(null), b = o.useRef(null), P = s || v.duration, N = o.useRef(0), g = o.useRef(P), O = o.useRef(0), { onToastAdd: D, onToastRemove: L } = v, W = V(() => {
792
+ onSwipeEnd: b,
793
+ ...C
794
+ } = e, v = Z(K, n), [d, x] = o.useState(null), g = k(t, (w) => x(w)), E = o.useRef(null), T = o.useRef(null), R = s || v.duration, N = o.useRef(0), h = o.useRef(R), I = o.useRef(0), { onToastAdd: D, onToastRemove: L } = v, W = V(() => {
782
795
  var A;
783
796
  (d == null ? void 0 : d.contains(document.activeElement)) && ((A = v.viewport) == null || A.focus()), u();
784
797
  }), M = o.useCallback(
785
798
  (w) => {
786
- !w || w === 1 / 0 || (window.clearTimeout(O.current), N.current = (/* @__PURE__ */ new Date()).getTime(), O.current = window.setTimeout(W, w));
799
+ !w || w === 1 / 0 || (window.clearTimeout(I.current), N.current = (/* @__PURE__ */ new Date()).getTime(), I.current = window.setTimeout(W, w));
787
800
  },
788
801
  [W]
789
802
  );
@@ -791,22 +804,22 @@ var [Ht, zt] = Re(K, {
791
804
  const w = v.viewport;
792
805
  if (w) {
793
806
  const A = () => {
794
- M(g.current), i == null || i();
807
+ M(h.current), i == null || i();
795
808
  }, _ = () => {
796
809
  const $ = (/* @__PURE__ */ new Date()).getTime() - N.current;
797
- g.current = g.current - $, window.clearTimeout(O.current), f == null || f();
810
+ h.current = h.current - $, window.clearTimeout(I.current), p == null || p();
798
811
  };
799
812
  return w.addEventListener(ee, _), w.addEventListener(te, A), () => {
800
813
  w.removeEventListener(ee, _), w.removeEventListener(te, A);
801
814
  };
802
815
  }
803
- }, [v.viewport, P, f, i, M]), o.useEffect(() => {
804
- a && !v.isClosePausedRef.current && M(P);
805
- }, [a, P, v.isClosePausedRef, M]), o.useEffect(() => (D(), () => L()), [D, L]);
816
+ }, [v.viewport, R, p, i, M]), o.useEffect(() => {
817
+ a && !v.isClosePausedRef.current && M(R);
818
+ }, [a, R, v.isClosePausedRef, M]), o.useEffect(() => (D(), () => L()), [D, L]);
806
819
  const j = o.useMemo(() => d ? We(d) : null, [d]);
807
820
  return v.viewport ? /* @__PURE__ */ re(ye, { children: [
808
- j && /* @__PURE__ */ p(
809
- Yt,
821
+ j && /* @__PURE__ */ f(
822
+ qt,
810
823
  {
811
824
  __scopeToast: n,
812
825
  role: "status",
@@ -814,46 +827,46 @@ var [Ht, zt] = Re(K, {
814
827
  children: j
815
828
  }
816
829
  ),
817
- /* @__PURE__ */ p(Ht, { scope: n, onClose: W, children: we.createPortal(
818
- /* @__PURE__ */ p(ae.ItemSlot, { scope: n, children: /* @__PURE__ */ p(
819
- Nt,
830
+ /* @__PURE__ */ f(zt, { scope: n, onClose: W, children: we.createPortal(
831
+ /* @__PURE__ */ f(ae.ItemSlot, { scope: n, children: /* @__PURE__ */ f(
832
+ Rt,
820
833
  {
821
834
  asChild: !0,
822
835
  onEscapeKeyDown: S(c, () => {
823
836
  v.isFocusedToastEscapeKeyDownRef.current || W(), v.isFocusedToastEscapeKeyDownRef.current = !1;
824
837
  }),
825
- children: /* @__PURE__ */ p(
826
- I.li,
838
+ children: /* @__PURE__ */ f(
839
+ O.li,
827
840
  {
828
841
  tabIndex: 0,
829
842
  "data-state": a ? "open" : "closed",
830
843
  "data-swipe-direction": v.swipeDirection,
831
- ...x,
832
- ref: E,
844
+ ...C,
845
+ ref: g,
833
846
  style: { userSelect: "none", touchAction: "none", ...e.style },
834
847
  onKeyDown: S(e.onKeyDown, (w) => {
835
848
  w.key === "Escape" && (c == null || c(w.nativeEvent), w.nativeEvent.defaultPrevented || (v.isFocusedToastEscapeKeyDownRef.current = !0, W()));
836
849
  }),
837
850
  onPointerDown: S(e.onPointerDown, (w) => {
838
- w.button === 0 && (h.current = { x: w.clientX, y: w.clientY });
851
+ w.button === 0 && (E.current = { x: w.clientX, y: w.clientY });
839
852
  }),
840
853
  onPointerMove: S(e.onPointerMove, (w) => {
841
- if (!h.current) return;
842
- const A = w.clientX - h.current.x, _ = w.clientY - h.current.y, $ = !!b.current, U = ["left", "right"].includes(v.swipeDirection), H = ["left", "up"].includes(v.swipeDirection) ? Math.min : Math.max, ze = U ? H(0, A) : 0, Xe = U ? 0 : H(0, _), G = w.pointerType === "touch" ? 10 : 2, z = { x: ze, y: Xe }, ue = { originalEvent: w, delta: z };
843
- $ ? (b.current = z, Y(Bt, m, ue, {
854
+ if (!E.current) return;
855
+ const A = w.clientX - E.current.x, _ = w.clientY - E.current.y, $ = !!T.current, U = ["left", "right"].includes(v.swipeDirection), H = ["left", "up"].includes(v.swipeDirection) ? Math.min : Math.max, ze = U ? H(0, A) : 0, Xe = U ? 0 : H(0, _), G = w.pointerType === "touch" ? 10 : 2, z = { x: ze, y: Xe }, ue = { originalEvent: w, delta: z };
856
+ $ ? (T.current = z, Y(Kt, m, ue, {
844
857
  discrete: !1
845
- })) : ve(z, v.swipeDirection, G) ? (b.current = z, Y(Ut, l, ue, {
858
+ })) : ve(z, v.swipeDirection, G) ? (T.current = z, Y(Bt, l, ue, {
846
859
  discrete: !1
847
- }), w.target.setPointerCapture(w.pointerId)) : (Math.abs(A) > G || Math.abs(_) > G) && (h.current = null);
860
+ }), w.target.setPointerCapture(w.pointerId)) : (Math.abs(A) > G || Math.abs(_) > G) && (E.current = null);
848
861
  }),
849
862
  onPointerUp: S(e.onPointerUp, (w) => {
850
- const A = b.current, _ = w.target;
851
- if (_.hasPointerCapture(w.pointerId) && _.releasePointerCapture(w.pointerId), b.current = null, h.current = null, A) {
863
+ const A = T.current, _ = w.target;
864
+ if (_.hasPointerCapture(w.pointerId) && _.releasePointerCapture(w.pointerId), T.current = null, E.current = null, A) {
852
865
  const $ = w.currentTarget, U = { originalEvent: w, delta: A };
853
- ve(A, v.swipeDirection, v.swipeThreshold) ? Y(jt, T, U, {
866
+ ve(A, v.swipeDirection, v.swipeThreshold) ? Y(Ht, b, U, {
854
867
  discrete: !0
855
868
  }) : Y(
856
- Kt,
869
+ jt,
857
870
  y,
858
871
  U,
859
872
  {
@@ -872,34 +885,34 @@ var [Ht, zt] = Re(K, {
872
885
  ) })
873
886
  ] }) : null;
874
887
  }
875
- ), Yt = (e) => {
876
- const { __scopeToast: t, children: n, ...r } = e, s = Z(K, t), [a, u] = o.useState(!1), [c, f] = o.useState(!1);
877
- return Gt(() => u(!0)), o.useEffect(() => {
878
- const i = window.setTimeout(() => f(!0), 1e3);
888
+ ), qt = (e) => {
889
+ const { __scopeToast: t, children: n, ...r } = e, s = Z(K, t), [a, u] = o.useState(!1), [c, p] = o.useState(!1);
890
+ return Jt(() => u(!0)), o.useEffect(() => {
891
+ const i = window.setTimeout(() => p(!0), 1e3);
879
892
  return () => window.clearTimeout(i);
880
- }, []), c ? null : /* @__PURE__ */ p(Ne, { asChild: !0, children: /* @__PURE__ */ p(se, { ...r, children: a && /* @__PURE__ */ re(ye, { children: [
893
+ }, []), c ? null : /* @__PURE__ */ f(Ne, { asChild: !0, children: /* @__PURE__ */ f(se, { ...r, children: a && /* @__PURE__ */ re(ye, { children: [
881
894
  s.label,
882
895
  " ",
883
896
  n
884
897
  ] }) }) });
885
- }, qt = "ToastTitle", _e = o.forwardRef(
898
+ }, Zt = "ToastTitle", _e = o.forwardRef(
886
899
  (e, t) => {
887
900
  const { __scopeToast: n, ...r } = e;
888
- return /* @__PURE__ */ p(I.div, { ...r, ref: t });
901
+ return /* @__PURE__ */ f(O.div, { ...r, ref: t });
889
902
  }
890
903
  );
891
- _e.displayName = qt;
892
- var Zt = "ToastDescription", Le = o.forwardRef(
904
+ _e.displayName = Zt;
905
+ var Gt = "ToastDescription", Le = o.forwardRef(
893
906
  (e, t) => {
894
907
  const { __scopeToast: n, ...r } = e;
895
- return /* @__PURE__ */ p(I.div, { ...r, ref: t });
908
+ return /* @__PURE__ */ f(O.div, { ...r, ref: t });
896
909
  }
897
910
  );
898
- Le.displayName = Zt;
911
+ Le.displayName = Gt;
899
912
  var Me = "ToastAction", Fe = o.forwardRef(
900
913
  (e, t) => {
901
914
  const { altText: n, ...r } = e;
902
- return n.trim() ? /* @__PURE__ */ p(Ve, { altText: n, asChild: !0, children: /* @__PURE__ */ p(ce, { ...r, ref: t }) }) : (console.error(
915
+ return n.trim() ? /* @__PURE__ */ f(Ve, { altText: n, asChild: !0, children: /* @__PURE__ */ f(ce, { ...r, ref: t }) }) : (console.error(
903
916
  `Invalid prop \`altText\` supplied to \`${Me}\`. Expected non-empty \`string\`.`
904
917
  ), null);
905
918
  }
@@ -907,9 +920,9 @@ var Me = "ToastAction", Fe = o.forwardRef(
907
920
  Fe.displayName = Me;
908
921
  var ke = "ToastClose", ce = o.forwardRef(
909
922
  (e, t) => {
910
- const { __scopeToast: n, ...r } = e, s = zt(ke, n);
911
- return /* @__PURE__ */ p(Ve, { asChild: !0, children: /* @__PURE__ */ p(
912
- I.button,
923
+ const { __scopeToast: n, ...r } = e, s = Xt(ke, n);
924
+ return /* @__PURE__ */ f(Ve, { asChild: !0, children: /* @__PURE__ */ f(
925
+ O.button,
913
926
  {
914
927
  type: "button",
915
928
  ...r,
@@ -922,8 +935,8 @@ var ke = "ToastClose", ce = o.forwardRef(
922
935
  ce.displayName = ke;
923
936
  var Ve = o.forwardRef((e, t) => {
924
937
  const { __scopeToast: n, altText: r, ...s } = e;
925
- return /* @__PURE__ */ p(
926
- I.div,
938
+ return /* @__PURE__ */ f(
939
+ O.div,
927
940
  {
928
941
  "data-radix-toast-announce-exclude": "",
929
942
  "data-radix-toast-announce-alt": r || void 0,
@@ -935,7 +948,7 @@ var Ve = o.forwardRef((e, t) => {
935
948
  function We(e) {
936
949
  const t = [];
937
950
  return Array.from(e.childNodes).forEach((r) => {
938
- if (r.nodeType === r.TEXT_NODE && r.textContent && t.push(r.textContent), Jt(r)) {
951
+ if (r.nodeType === r.TEXT_NODE && r.textContent && t.push(r.textContent), Qt(r)) {
939
952
  const s = r.ariaHidden || r.hidden || r.style.display === "none", a = r.dataset.radixToastAnnounceExclude === "";
940
953
  if (!s)
941
954
  if (a) {
@@ -948,13 +961,13 @@ function We(e) {
948
961
  }
949
962
  function Y(e, t, n, { discrete: r }) {
950
963
  const s = n.originalEvent.currentTarget, a = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: n });
951
- t && s.addEventListener(e, t, { once: !0 }), r ? ge(s, a) : s.dispatchEvent(a);
964
+ t && s.addEventListener(e, t, { once: !0 }), r ? he(s, a) : s.dispatchEvent(a);
952
965
  }
953
966
  var ve = (e, t, n = 0) => {
954
967
  const r = Math.abs(e.x), s = Math.abs(e.y), a = r > s;
955
968
  return t === "left" || t === "right" ? a && r > n : !a && s > n;
956
969
  };
957
- function Gt(e = () => {
970
+ function Jt(e = () => {
958
971
  }) {
959
972
  const t = V(e);
960
973
  B(() => {
@@ -964,10 +977,10 @@ function Gt(e = () => {
964
977
  };
965
978
  }, [t]);
966
979
  }
967
- function Jt(e) {
980
+ function Qt(e) {
968
981
  return e.nodeType === e.ELEMENT_NODE;
969
982
  }
970
- function Qt(e) {
983
+ function en(e) {
971
984
  const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
972
985
  acceptNode: (r) => {
973
986
  const s = r.tagName === "INPUT" && r.type === "hidden";
@@ -981,29 +994,29 @@ function J(e) {
981
994
  const t = document.activeElement;
982
995
  return e.some((n) => n === t ? !0 : (n.focus(), document.activeElement !== t));
983
996
  }
984
- var en = Se, $e = Oe, Ue = De, Be = _e, Ke = Le, je = Fe, He = ce;
997
+ var tn = Se, $e = Ie, Ue = De, Be = _e, Ke = Le, je = Fe, He = ce;
985
998
  /**
986
999
  * @license lucide-react v1.7.0 - ISC
987
1000
  *
988
1001
  * This source code is licensed under the ISC license.
989
1002
  * See the LICENSE file in the root directory of this source tree.
990
1003
  */
991
- const tn = [
1004
+ const nn = [
992
1005
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
993
1006
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
994
- ], nn = Ze("x", tn), yn = en, rn = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(
1007
+ ], rn = Ze("x", nn), wn = tn, on = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
995
1008
  $e,
996
1009
  {
997
1010
  ref: n,
998
- className: R(
1011
+ className: P(
999
1012
  "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
1000
1013
  e
1001
1014
  ),
1002
1015
  ...t
1003
1016
  }
1004
1017
  ));
1005
- rn.displayName = $e.displayName;
1006
- const on = oe(
1018
+ on.displayName = $e.displayName;
1019
+ const sn = oe(
1007
1020
  "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg 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",
1008
1021
  {
1009
1022
  variants: {
@@ -1016,64 +1029,66 @@ const on = oe(
1016
1029
  variant: "default"
1017
1030
  }
1018
1031
  }
1019
- ), sn = o.forwardRef(({ className: e, variant: t, ...n }, r) => /* @__PURE__ */ p(
1032
+ ), an = o.forwardRef(({ className: e, variant: t, ...n }, r) => /* @__PURE__ */ f(
1020
1033
  Ue,
1021
1034
  {
1022
1035
  ref: r,
1023
- className: R(on({ variant: t }), e),
1036
+ className: P(sn({ variant: t }), e),
1024
1037
  ...n
1025
1038
  }
1026
1039
  ));
1027
- sn.displayName = Ue.displayName;
1028
- const an = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(
1040
+ an.displayName = Ue.displayName;
1041
+ const cn = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
1029
1042
  je,
1030
1043
  {
1031
1044
  ref: n,
1032
- className: R(
1045
+ className: P(
1033
1046
  "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",
1034
1047
  e
1035
1048
  ),
1036
1049
  ...t
1037
1050
  }
1038
1051
  ));
1039
- an.displayName = je.displayName;
1040
- const cn = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(
1052
+ cn.displayName = je.displayName;
1053
+ const un = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
1041
1054
  He,
1042
1055
  {
1043
1056
  ref: n,
1044
- className: R(
1057
+ className: P(
1045
1058
  "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
1046
1059
  e
1047
1060
  ),
1048
1061
  "toast-close": "",
1049
1062
  ...t,
1050
- children: /* @__PURE__ */ p(nn, { className: "size-4" })
1063
+ children: /* @__PURE__ */ f(rn, { className: "size-4" })
1051
1064
  }
1052
1065
  ));
1053
- cn.displayName = He.displayName;
1054
- const un = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(
1066
+ un.displayName = He.displayName;
1067
+ const ln = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
1055
1068
  Be,
1056
1069
  {
1057
1070
  ref: n,
1058
- className: R("text-sm font-semibold", e),
1071
+ className: P("text-sm font-semibold", e),
1059
1072
  ...t
1060
1073
  }
1061
1074
  ));
1062
- un.displayName = Be.displayName;
1063
- const ln = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ p(
1075
+ ln.displayName = Be.displayName;
1076
+ const dn = o.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
1064
1077
  Ke,
1065
1078
  {
1066
1079
  ref: n,
1067
- className: R("text-sm opacity-90", e),
1080
+ className: P("text-sm opacity-90", e),
1068
1081
  ...t
1069
1082
  }
1070
1083
  ));
1071
- ln.displayName = Ke.displayName;
1084
+ dn.displayName = Ke.displayName;
1072
1085
  export {
1073
1086
  Je as A,
1074
1087
  ct as B,
1075
1088
  ut as C,
1076
- sn as T,
1089
+ vt as I,
1090
+ an as T,
1091
+ rn as X,
1077
1092
  et as a,
1078
1093
  Qe as b,
1079
1094
  pt as c,
@@ -1081,12 +1096,12 @@ export {
1081
1096
  mt as e,
1082
1097
  lt as f,
1083
1098
  dt as g,
1084
- an as h,
1085
- cn as i,
1086
- ln as j,
1087
- yn as k,
1088
- un as l,
1089
- rn as m,
1099
+ cn as h,
1100
+ un as i,
1101
+ dn as j,
1102
+ wn as k,
1103
+ ln as l,
1104
+ on as m,
1090
1105
  at as n,
1091
1106
  oe as o
1092
1107
  };