@pdf-viewer/react 0.5.0-beta.2 → 0.5.0-beta.4

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.
Files changed (53) hide show
  1. package/dist/{RPLayout-fab108d3.js → RPLayout-7fd91861.js} +18 -15
  2. package/dist/components/RPController.js +1 -1
  3. package/dist/components/RPViewer.js +1 -1
  4. package/dist/components/layout/RPLayout.js +1 -1
  5. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  6. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  7. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  8. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  9. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  10. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  11. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  12. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  13. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  14. package/dist/components/layout/toolbar/Paginate.js +1 -1
  15. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  16. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  17. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  18. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  19. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  20. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  21. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  22. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  23. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  24. package/dist/components/page/AnnotationLayer.js +1 -1
  25. package/dist/components/page/CanvasLayer.js +1 -1
  26. package/dist/components/page/DualPage.js +1 -1
  27. package/dist/components/page/RPPage.js +1 -1
  28. package/dist/components/page/SinglePage.js +1 -1
  29. package/dist/components/page/TextLayer.js +1 -1
  30. package/dist/components/ui/Checkbox.js +1 -1
  31. package/dist/components/ui/DropDown.js +1 -1
  32. package/dist/components/ui/LoadingIndicator.js +1 -1
  33. package/dist/components/ui/RPTooltip.js +568 -1877
  34. package/dist/contexts/PaginateContext.js +1 -1
  35. package/dist/contexts/PrintContext.js +1 -1
  36. package/dist/contexts/SearchContext.js +1 -1
  37. package/dist/contexts/ThumbnailsContext.js +1 -1
  38. package/dist/contexts/ToolbarComponentContext.js +14 -12
  39. package/dist/floating-ui.react-dom-e6d5fe8f.js +1327 -0
  40. package/dist/index-316854c1.js +2299 -0
  41. package/dist/index-71898eb9.js +139 -0
  42. package/dist/main.js +1 -1
  43. package/dist/utils/hooks/useFileDownload.js +1 -1
  44. package/dist/utils/hooks/useLicense.js +24 -16
  45. package/dist/utils/hooks/usePaginate.js +1 -1
  46. package/dist/utils/hooks/usePrint.js +1 -1
  47. package/dist/utils/hooks/useScrollToPage.js +1 -1
  48. package/dist/utils/hooks/useSearch.js +1 -1
  49. package/dist/utils/hooks/useThumbnail.js +1 -1
  50. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/index-2b077daa.js +0 -122
  53. package/dist/index-8049287f.js +0 -3639
@@ -1,76 +1,77 @@
1
- import { jsx as b, Fragment as ve, jsxs as wt } from "react/jsx-runtime";
2
- import * as c from "react";
3
- import { useLayoutEffect as wn, useEffect as vn, forwardRef as xn } from "react";
4
- import { d as xe, u as ie, c as vt, b as bn, a as Cn } from "../../index-2b077daa.js";
5
- import * as xt from "react-dom";
6
- import '../../assets/RPTooltip.css';function Y(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
7
- return function(o) {
8
- if (e == null || e(o), n === !1 || !o.defaultPrevented)
9
- return t == null ? void 0 : t(o);
1
+ import { jsx as f, Fragment as F, jsxs as we } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { forwardRef as ft } from "react";
4
+ import { u as J, c as Ce, d as pt, a as H, b as mt } from "../../index-71898eb9.js";
5
+ import * as ht from "react-dom";
6
+ import { u as vt, a as yt, b as gt, o as wt, s as Ct, f as Et, c as Pt, d as bt, h as xt, l as Rt, e as At } from "../../floating-ui.react-dom-e6d5fe8f.js";
7
+ import '../../assets/RPTooltip.css';function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
8
+ return function(r) {
9
+ if (e == null || e(r), n === !1 || !r.defaultPrevented)
10
+ return t == null ? void 0 : t(r);
10
11
  };
11
12
  }
12
- function ot(e, t) {
13
+ function pe(e, t) {
13
14
  if (typeof e == "function")
14
15
  return e(t);
15
16
  e != null && (e.current = t);
16
17
  }
17
- function bt(...e) {
18
+ function Ee(...e) {
18
19
  return (t) => {
19
20
  let n = !1;
20
- const r = e.map((o) => {
21
- const i = ot(o, t);
21
+ const o = e.map((r) => {
22
+ const i = pe(r, t);
22
23
  return !n && typeof i == "function" && (n = !0), i;
23
24
  });
24
25
  if (n)
25
26
  return () => {
26
- for (let o = 0; o < r.length; o++) {
27
- const i = r[o];
28
- typeof i == "function" ? i() : ot(e[o], null);
27
+ for (let r = 0; r < o.length; r++) {
28
+ const i = o[r];
29
+ typeof i == "function" ? i() : pe(e[r], null);
29
30
  }
30
31
  };
31
32
  };
32
33
  }
33
- function le(...e) {
34
- return c.useCallback(bt(...e), e);
34
+ function _(...e) {
35
+ return s.useCallback(Ee(...e), e);
35
36
  }
36
- var Ct = c.forwardRef((e, t) => {
37
- const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(En);
37
+ var Pe = s.forwardRef((e, t) => {
38
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Tt);
38
39
  if (i) {
39
- const s = i.props.children, l = o.map((a) => a === i ? c.Children.count(s) > 1 ? c.Children.only(null) : c.isValidElement(s) ? s.props.children : null : a);
40
- return /* @__PURE__ */ b(Ne, { ...r, ref: t, children: c.isValidElement(s) ? c.cloneElement(s, void 0, l) : null });
40
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
41
+ return /* @__PURE__ */ f(Y, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
41
42
  }
42
- return /* @__PURE__ */ b(Ne, { ...r, ref: t, children: n });
43
+ return /* @__PURE__ */ f(Y, { ...o, ref: t, children: n });
43
44
  });
44
- Ct.displayName = "Slot";
45
- var Ne = c.forwardRef((e, t) => {
46
- const { children: n, ...r } = e;
47
- if (c.isValidElement(n)) {
48
- const o = Rn(n), i = Pn(r, n.props);
49
- return n.type !== c.Fragment && (i.ref = t ? bt(t, o) : o), c.cloneElement(n, i);
45
+ Pe.displayName = "Slot";
46
+ var Y = s.forwardRef((e, t) => {
47
+ const { children: n, ...o } = e;
48
+ if (s.isValidElement(n)) {
49
+ const r = Nt(n), i = Ot(o, n.props);
50
+ return n.type !== s.Fragment && (i.ref = t ? Ee(t, r) : r), s.cloneElement(n, i);
50
51
  }
51
- return c.Children.count(n) > 1 ? c.Children.only(null) : null;
52
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
52
53
  });
53
- Ne.displayName = "SlotClone";
54
- var Et = ({ children: e }) => /* @__PURE__ */ b(ve, { children: e });
55
- function En(e) {
56
- return c.isValidElement(e) && e.type === Et;
54
+ Y.displayName = "SlotClone";
55
+ var be = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
56
+ function Tt(e) {
57
+ return s.isValidElement(e) && e.type === be;
57
58
  }
58
- function Pn(e, t) {
59
+ function Ot(e, t) {
59
60
  const n = { ...t };
60
- for (const r in t) {
61
- const o = e[r], i = t[r];
62
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...l) => {
63
- i(...l), o(...l);
64
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
61
+ for (const o in t) {
62
+ const r = e[o], i = t[o];
63
+ /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
64
+ i(...c), r(...c);
65
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
65
66
  }
66
67
  return { ...e, ...n };
67
68
  }
68
- function Rn(e) {
69
- var r, o;
70
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
71
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
69
+ function Nt(e) {
70
+ var o, r;
71
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
72
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
72
73
  }
73
- var An = [
74
+ var St = [
74
75
  "a",
75
76
  "button",
76
77
  "div",
@@ -87,1501 +88,191 @@ var An = [
87
88
  "span",
88
89
  "svg",
89
90
  "ul"
90
- ], He = An.reduce((e, t) => {
91
- const n = c.forwardRef((r, o) => {
92
- const { asChild: i, ...s } = r, l = i ? Ct : t;
93
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ b(l, { ...s, ref: o });
91
+ ], Q = St.reduce((e, t) => {
92
+ const n = s.forwardRef((o, r) => {
93
+ const { asChild: i, ...a } = o, c = i ? Pe : t;
94
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
94
95
  });
95
96
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
96
97
  }, {});
97
- function On(e, t) {
98
- e && xt.flushSync(() => e.dispatchEvent(t));
98
+ function Dt(e, t) {
99
+ e && ht.flushSync(() => e.dispatchEvent(t));
99
100
  }
100
- function Tn(e, t = globalThis == null ? void 0 : globalThis.document) {
101
- const n = xe(e);
102
- c.useEffect(() => {
103
- const r = (o) => {
104
- o.key === "Escape" && n(o);
105
- };
106
- return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
107
- }, [n, t]);
108
- }
109
- var Sn = "DismissableLayer", De = "dismissableLayer.update", Nn = "dismissableLayer.pointerDownOutside", Dn = "dismissableLayer.focusOutside", it, Pt = c.createContext({
101
+ var _t = "DismissableLayer", G = "dismissableLayer.update", Lt = "dismissableLayer.pointerDownOutside", $t = "dismissableLayer.focusOutside", me, xe = s.createContext({
110
102
  layers: /* @__PURE__ */ new Set(),
111
103
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
112
104
  branches: /* @__PURE__ */ new Set()
113
- }), Rt = c.forwardRef(
105
+ }), Re = s.forwardRef(
114
106
  (e, t) => {
115
107
  const {
116
108
  disableOutsidePointerEvents: n = !1,
117
- onEscapeKeyDown: r,
118
- onPointerDownOutside: o,
109
+ onEscapeKeyDown: o,
110
+ onPointerDownOutside: r,
119
111
  onFocusOutside: i,
120
- onInteractOutside: s,
121
- onDismiss: l,
122
- ...a
123
- } = e, f = c.useContext(Pt), [u, p] = c.useState(null), m = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, d] = c.useState({}), h = le(t, (P) => p(P)), g = Array.from(f.layers), [y] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), w = g.indexOf(y), v = u ? g.indexOf(u) : -1, E = f.layersWithOutsidePointerEventsDisabled.size > 0, x = v >= w, C = $n((P) => {
124
- const O = P.target, M = [...f.branches].some((T) => T.contains(O));
125
- !x || M || (o == null || o(P), s == null || s(P), P.defaultPrevented || l == null || l());
126
- }, m), R = _n((P) => {
127
- const O = P.target;
128
- [...f.branches].some((T) => T.contains(O)) || (i == null || i(P), s == null || s(P), P.defaultPrevented || l == null || l());
129
- }, m);
130
- return Tn((P) => {
131
- v === f.layers.size - 1 && (r == null || r(P), !P.defaultPrevented && l && (P.preventDefault(), l()));
132
- }, m), c.useEffect(() => {
133
- if (u)
134
- return n && (f.layersWithOutsidePointerEventsDisabled.size === 0 && (it = m.body.style.pointerEvents, m.body.style.pointerEvents = "none"), f.layersWithOutsidePointerEventsDisabled.add(u)), f.layers.add(u), st(), () => {
135
- n && f.layersWithOutsidePointerEventsDisabled.size === 1 && (m.body.style.pointerEvents = it);
112
+ onInteractOutside: a,
113
+ onDismiss: c,
114
+ ...l
115
+ } = e, u = s.useContext(xe), [d, m] = s.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = s.useState({}), v = _(t, (g) => m(g)), y = Array.from(u.layers), [w] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), E = y.indexOf(w), C = d ? y.indexOf(d) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, P = C >= E, R = Wt((g) => {
116
+ const T = g.target, L = [...u.branches].some((S) => S.contains(T));
117
+ !P || L || (r == null || r(g), a == null || a(g), g.defaultPrevented || c == null || c());
118
+ }, h), b = kt((g) => {
119
+ const T = g.target;
120
+ [...u.branches].some((S) => S.contains(T)) || (i == null || i(g), a == null || a(g), g.defaultPrevented || c == null || c());
121
+ }, h);
122
+ return vt((g) => {
123
+ C === u.layers.size - 1 && (o == null || o(g), !g.defaultPrevented && c && (g.preventDefault(), c()));
124
+ }, h), s.useEffect(() => {
125
+ if (d)
126
+ return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (me = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), he(), () => {
127
+ n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = me);
136
128
  };
137
- }, [u, m, n, f]), c.useEffect(() => () => {
138
- u && (f.layers.delete(u), f.layersWithOutsidePointerEventsDisabled.delete(u), st());
139
- }, [u, f]), c.useEffect(() => {
140
- const P = () => d({});
141
- return document.addEventListener(De, P), () => document.removeEventListener(De, P);
142
- }, []), /* @__PURE__ */ b(
143
- He.div,
129
+ }, [d, h, n, u]), s.useEffect(() => () => {
130
+ d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), he());
131
+ }, [d, u]), s.useEffect(() => {
132
+ const g = () => p({});
133
+ return document.addEventListener(G, g), () => document.removeEventListener(G, g);
134
+ }, []), /* @__PURE__ */ f(
135
+ Q.div,
144
136
  {
145
- ...a,
146
- ref: h,
137
+ ...l,
138
+ ref: v,
147
139
  style: {
148
- pointerEvents: E ? x ? "auto" : "none" : void 0,
140
+ pointerEvents: x ? P ? "auto" : "none" : void 0,
149
141
  ...e.style
150
142
  },
151
- onFocusCapture: Y(e.onFocusCapture, R.onFocusCapture),
152
- onBlurCapture: Y(e.onBlurCapture, R.onBlurCapture),
153
- onPointerDownCapture: Y(
143
+ onFocusCapture: A(e.onFocusCapture, b.onFocusCapture),
144
+ onBlurCapture: A(e.onBlurCapture, b.onBlurCapture),
145
+ onPointerDownCapture: A(
154
146
  e.onPointerDownCapture,
155
- C.onPointerDownCapture
147
+ R.onPointerDownCapture
156
148
  )
157
149
  }
158
150
  );
159
151
  }
160
152
  );
161
- Rt.displayName = Sn;
162
- var Ln = "DismissableLayerBranch", Mn = c.forwardRef((e, t) => {
163
- const n = c.useContext(Pt), r = c.useRef(null), o = le(t, r);
164
- return c.useEffect(() => {
165
- const i = r.current;
153
+ Re.displayName = _t;
154
+ var Mt = "DismissableLayerBranch", It = s.forwardRef((e, t) => {
155
+ const n = s.useContext(xe), o = s.useRef(null), r = _(t, o);
156
+ return s.useEffect(() => {
157
+ const i = o.current;
166
158
  if (i)
167
159
  return n.branches.add(i), () => {
168
160
  n.branches.delete(i);
169
161
  };
170
- }, [n.branches]), /* @__PURE__ */ b(He.div, { ...e, ref: o });
162
+ }, [n.branches]), /* @__PURE__ */ f(Q.div, { ...e, ref: r });
171
163
  });
172
- Mn.displayName = Ln;
173
- function $n(e, t = globalThis == null ? void 0 : globalThis.document) {
174
- const n = xe(e), r = c.useRef(!1), o = c.useRef(() => {
164
+ It.displayName = Mt;
165
+ function Wt(e, t = globalThis == null ? void 0 : globalThis.document) {
166
+ const n = J(e), o = s.useRef(!1), r = s.useRef(() => {
175
167
  });
176
- return c.useEffect(() => {
177
- const i = (l) => {
178
- if (l.target && !r.current) {
179
- let a = function() {
180
- At(
181
- Nn,
168
+ return s.useEffect(() => {
169
+ const i = (c) => {
170
+ if (c.target && !o.current) {
171
+ let l = function() {
172
+ Ae(
173
+ Lt,
182
174
  n,
183
- f,
175
+ u,
184
176
  { discrete: !0 }
185
177
  );
186
178
  };
187
- const f = { originalEvent: l };
188
- l.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = a, t.addEventListener("click", o.current, { once: !0 })) : a();
179
+ const u = { originalEvent: c };
180
+ c.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = l, t.addEventListener("click", r.current, { once: !0 })) : l();
189
181
  } else
190
- t.removeEventListener("click", o.current);
191
- r.current = !1;
192
- }, s = window.setTimeout(() => {
182
+ t.removeEventListener("click", r.current);
183
+ o.current = !1;
184
+ }, a = window.setTimeout(() => {
193
185
  t.addEventListener("pointerdown", i);
194
186
  }, 0);
195
187
  return () => {
196
- window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
188
+ window.clearTimeout(a), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
197
189
  };
198
190
  }, [t, n]), {
199
191
  // ensures we check React component tree (not just DOM tree)
200
- onPointerDownCapture: () => r.current = !0
192
+ onPointerDownCapture: () => o.current = !0
201
193
  };
202
194
  }
203
- function _n(e, t = globalThis == null ? void 0 : globalThis.document) {
204
- const n = xe(e), r = c.useRef(!1);
205
- return c.useEffect(() => {
206
- const o = (i) => {
207
- i.target && !r.current && At(Dn, n, { originalEvent: i }, {
195
+ function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
196
+ const n = J(e), o = s.useRef(!1);
197
+ return s.useEffect(() => {
198
+ const r = (i) => {
199
+ i.target && !o.current && Ae($t, n, { originalEvent: i }, {
208
200
  discrete: !1
209
201
  });
210
202
  };
211
- return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
203
+ return t.addEventListener("focusin", r), () => t.removeEventListener("focusin", r);
212
204
  }, [t, n]), {
213
- onFocusCapture: () => r.current = !0,
214
- onBlurCapture: () => r.current = !1
205
+ onFocusCapture: () => o.current = !0,
206
+ onBlurCapture: () => o.current = !1
215
207
  };
216
208
  }
217
- function st() {
218
- const e = new CustomEvent(De);
209
+ function he() {
210
+ const e = new CustomEvent(G);
219
211
  document.dispatchEvent(e);
220
212
  }
221
- function At(e, t, n, { discrete: r }) {
222
- const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
223
- t && o.addEventListener(e, t, { once: !0 }), r ? On(o, i) : o.dispatchEvent(i);
224
- }
225
- var kn = c["useId".toString()] || (() => {
226
- }), Wn = 0;
227
- function Fn(e) {
228
- const [t, n] = c.useState(kn());
229
- return ie(() => {
230
- e || n((r) => r ?? String(Wn++));
231
- }, [e]), e || (t ? `radix-${t}` : "");
232
- }
233
- const In = ["top", "right", "bottom", "left"], q = Math.min, W = Math.max, he = Math.round, de = Math.floor, j = (e) => ({
234
- x: e,
235
- y: e
236
- }), Hn = {
237
- left: "right",
238
- right: "left",
239
- bottom: "top",
240
- top: "bottom"
241
- }, Vn = {
242
- start: "end",
243
- end: "start"
244
- };
245
- function Le(e, t, n) {
246
- return W(e, q(t, n));
247
- }
248
- function X(e, t) {
249
- return typeof e == "function" ? e(t) : e;
250
- }
251
- function G(e) {
252
- return e.split("-")[0];
253
- }
254
- function ne(e) {
255
- return e.split("-")[1];
256
- }
257
- function Ve(e) {
258
- return e === "x" ? "y" : "x";
259
- }
260
- function Be(e) {
261
- return e === "y" ? "height" : "width";
262
- }
263
- function Z(e) {
264
- return ["top", "bottom"].includes(G(e)) ? "y" : "x";
265
- }
266
- function je(e) {
267
- return Ve(Z(e));
268
- }
269
- function Bn(e, t, n) {
270
- n === void 0 && (n = !1);
271
- const r = ne(e), o = je(e), i = Be(o);
272
- let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
273
- return t.reference[i] > t.floating[i] && (s = ge(s)), [s, ge(s)];
274
- }
275
- function jn(e) {
276
- const t = ge(e);
277
- return [Me(e), t, Me(t)];
278
- }
279
- function Me(e) {
280
- return e.replace(/start|end/g, (t) => Vn[t]);
281
- }
282
- function Un(e, t, n) {
283
- const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
284
- switch (e) {
285
- case "top":
286
- case "bottom":
287
- return n ? t ? o : r : t ? r : o;
288
- case "left":
289
- case "right":
290
- return t ? i : s;
291
- default:
292
- return [];
293
- }
294
- }
295
- function zn(e, t, n, r) {
296
- const o = ne(e);
297
- let i = Un(G(e), n === "start", r);
298
- return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Me)))), i;
299
- }
300
- function ge(e) {
301
- return e.replace(/left|right|bottom|top/g, (t) => Hn[t]);
302
- }
303
- function Yn(e) {
304
- return {
305
- top: 0,
306
- right: 0,
307
- bottom: 0,
308
- left: 0,
309
- ...e
310
- };
311
- }
312
- function Ot(e) {
313
- return typeof e != "number" ? Yn(e) : {
314
- top: e,
315
- right: e,
316
- bottom: e,
317
- left: e
318
- };
319
- }
320
- function ye(e) {
321
- const {
322
- x: t,
323
- y: n,
324
- width: r,
325
- height: o
326
- } = e;
327
- return {
328
- width: r,
329
- height: o,
330
- top: n,
331
- left: t,
332
- right: t + r,
333
- bottom: n + o,
334
- x: t,
335
- y: n
336
- };
337
- }
338
- function ct(e, t, n) {
339
- let {
340
- reference: r,
341
- floating: o
342
- } = e;
343
- const i = Z(t), s = je(t), l = Be(s), a = G(t), f = i === "y", u = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, m = r[l] / 2 - o[l] / 2;
344
- let d;
345
- switch (a) {
346
- case "top":
347
- d = {
348
- x: u,
349
- y: r.y - o.height
350
- };
351
- break;
352
- case "bottom":
353
- d = {
354
- x: u,
355
- y: r.y + r.height
356
- };
357
- break;
358
- case "right":
359
- d = {
360
- x: r.x + r.width,
361
- y: p
362
- };
363
- break;
364
- case "left":
365
- d = {
366
- x: r.x - o.width,
367
- y: p
368
- };
369
- break;
370
- default:
371
- d = {
372
- x: r.x,
373
- y: r.y
374
- };
375
- }
376
- switch (ne(t)) {
377
- case "start":
378
- d[s] -= m * (n && f ? -1 : 1);
379
- break;
380
- case "end":
381
- d[s] += m * (n && f ? -1 : 1);
382
- break;
383
- }
384
- return d;
385
- }
386
- const Xn = async (e, t, n) => {
387
- const {
388
- placement: r = "bottom",
389
- strategy: o = "absolute",
390
- middleware: i = [],
391
- platform: s
392
- } = n, l = i.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
393
- let f = await s.getElementRects({
394
- reference: e,
395
- floating: t,
396
- strategy: o
397
- }), {
398
- x: u,
399
- y: p
400
- } = ct(f, r, a), m = r, d = {}, h = 0;
401
- for (let g = 0; g < l.length; g++) {
402
- const {
403
- name: y,
404
- fn: w
405
- } = l[g], {
406
- x: v,
407
- y: E,
408
- data: x,
409
- reset: C
410
- } = await w({
411
- x: u,
412
- y: p,
413
- initialPlacement: r,
414
- placement: m,
415
- strategy: o,
416
- middlewareData: d,
417
- rects: f,
418
- platform: s,
419
- elements: {
420
- reference: e,
421
- floating: t
422
- }
423
- });
424
- u = v ?? u, p = E ?? p, d = {
425
- ...d,
426
- [y]: {
427
- ...d[y],
428
- ...x
429
- }
430
- }, C && h <= 50 && (h++, typeof C == "object" && (C.placement && (m = C.placement), C.rects && (f = C.rects === !0 ? await s.getElementRects({
431
- reference: e,
432
- floating: t,
433
- strategy: o
434
- }) : C.rects), {
435
- x: u,
436
- y: p
437
- } = ct(f, m, a)), g = -1);
438
- }
439
- return {
440
- x: u,
441
- y: p,
442
- placement: m,
443
- strategy: o,
444
- middlewareData: d
445
- };
446
- };
447
- async function se(e, t) {
448
- var n;
449
- t === void 0 && (t = {});
450
- const {
451
- x: r,
452
- y: o,
453
- platform: i,
454
- rects: s,
455
- elements: l,
456
- strategy: a
457
- } = e, {
458
- boundary: f = "clippingAncestors",
459
- rootBoundary: u = "viewport",
460
- elementContext: p = "floating",
461
- altBoundary: m = !1,
462
- padding: d = 0
463
- } = X(t, e), h = Ot(d), y = l[m ? p === "floating" ? "reference" : "floating" : p], w = ye(await i.getClippingRect({
464
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
465
- boundary: f,
466
- rootBoundary: u,
467
- strategy: a
468
- })), v = p === "floating" ? {
469
- x: r,
470
- y: o,
471
- width: s.floating.width,
472
- height: s.floating.height
473
- } : s.reference, E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), x = await (i.isElement == null ? void 0 : i.isElement(E)) ? await (i.getScale == null ? void 0 : i.getScale(E)) || {
474
- x: 1,
475
- y: 1
476
- } : {
477
- x: 1,
478
- y: 1
479
- }, C = ye(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
480
- elements: l,
481
- rect: v,
482
- offsetParent: E,
483
- strategy: a
484
- }) : v);
485
- return {
486
- top: (w.top - C.top + h.top) / x.y,
487
- bottom: (C.bottom - w.bottom + h.bottom) / x.y,
488
- left: (w.left - C.left + h.left) / x.x,
489
- right: (C.right - w.right + h.right) / x.x
490
- };
491
- }
492
- const Gn = (e) => ({
493
- name: "arrow",
494
- options: e,
495
- async fn(t) {
496
- const {
497
- x: n,
498
- y: r,
499
- placement: o,
500
- rects: i,
501
- platform: s,
502
- elements: l,
503
- middlewareData: a
504
- } = t, {
505
- element: f,
506
- padding: u = 0
507
- } = X(e, t) || {};
508
- if (f == null)
509
- return {};
510
- const p = Ot(u), m = {
511
- x: n,
512
- y: r
513
- }, d = je(o), h = Be(d), g = await s.getDimensions(f), y = d === "y", w = y ? "top" : "left", v = y ? "bottom" : "right", E = y ? "clientHeight" : "clientWidth", x = i.reference[h] + i.reference[d] - m[d] - i.floating[h], C = m[d] - i.reference[d], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f));
514
- let P = R ? R[E] : 0;
515
- (!P || !await (s.isElement == null ? void 0 : s.isElement(R))) && (P = l.floating[E] || i.floating[h]);
516
- const O = x / 2 - C / 2, M = P / 2 - g[h] / 2 - 1, T = q(p[w], M), _ = q(p[v], M), k = T, N = P - g[h] - _, S = P / 2 - g[h] / 2 + O, I = Le(k, S, N), D = !a.arrow && ne(o) != null && S !== I && i.reference[h] / 2 - (S < k ? T : _) - g[h] / 2 < 0, L = D ? S < k ? S - k : S - N : 0;
517
- return {
518
- [d]: m[d] + L,
519
- data: {
520
- [d]: I,
521
- centerOffset: S - I - L,
522
- ...D && {
523
- alignmentOffset: L
524
- }
525
- },
526
- reset: D
527
- };
528
- }
529
- }), qn = function(e) {
530
- return e === void 0 && (e = {}), {
531
- name: "flip",
532
- options: e,
533
- async fn(t) {
534
- var n, r;
535
- const {
536
- placement: o,
537
- middlewareData: i,
538
- rects: s,
539
- initialPlacement: l,
540
- platform: a,
541
- elements: f
542
- } = t, {
543
- mainAxis: u = !0,
544
- crossAxis: p = !0,
545
- fallbackPlacements: m,
546
- fallbackStrategy: d = "bestFit",
547
- fallbackAxisSideDirection: h = "none",
548
- flipAlignment: g = !0,
549
- ...y
550
- } = X(e, t);
551
- if ((n = i.arrow) != null && n.alignmentOffset)
552
- return {};
553
- const w = G(o), v = Z(l), E = G(l) === l, x = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), C = m || (E || !g ? [ge(l)] : jn(l)), R = h !== "none";
554
- !m && R && C.push(...zn(l, g, h, x));
555
- const P = [l, ...C], O = await se(t, y), M = [];
556
- let T = ((r = i.flip) == null ? void 0 : r.overflows) || [];
557
- if (u && M.push(O[w]), p) {
558
- const S = Bn(o, s, x);
559
- M.push(O[S[0]], O[S[1]]);
560
- }
561
- if (T = [...T, {
562
- placement: o,
563
- overflows: M
564
- }], !M.every((S) => S <= 0)) {
565
- var _, k;
566
- const S = (((_ = i.flip) == null ? void 0 : _.index) || 0) + 1, I = P[S];
567
- if (I)
568
- return {
569
- data: {
570
- index: S,
571
- overflows: T
572
- },
573
- reset: {
574
- placement: I
575
- }
576
- };
577
- let D = (k = T.filter((L) => L.overflows[0] <= 0).sort((L, A) => L.overflows[1] - A.overflows[1])[0]) == null ? void 0 : k.placement;
578
- if (!D)
579
- switch (d) {
580
- case "bestFit": {
581
- var N;
582
- const L = (N = T.filter((A) => {
583
- if (R) {
584
- const $ = Z(A.placement);
585
- return $ === v || // Create a bias to the `y` side axis due to horizontal
586
- // reading directions favoring greater width.
587
- $ === "y";
588
- }
589
- return !0;
590
- }).map((A) => [A.placement, A.overflows.filter(($) => $ > 0).reduce(($, B) => $ + B, 0)]).sort((A, $) => A[1] - $[1])[0]) == null ? void 0 : N[0];
591
- L && (D = L);
592
- break;
593
- }
594
- case "initialPlacement":
595
- D = l;
596
- break;
597
- }
598
- if (o !== D)
599
- return {
600
- reset: {
601
- placement: D
602
- }
603
- };
604
- }
605
- return {};
606
- }
607
- };
608
- };
609
- function lt(e, t) {
610
- return {
611
- top: e.top - t.height,
612
- right: e.right - t.width,
613
- bottom: e.bottom - t.height,
614
- left: e.left - t.width
615
- };
616
- }
617
- function at(e) {
618
- return In.some((t) => e[t] >= 0);
619
- }
620
- const Zn = function(e) {
621
- return e === void 0 && (e = {}), {
622
- name: "hide",
623
- options: e,
624
- async fn(t) {
625
- const {
626
- rects: n
627
- } = t, {
628
- strategy: r = "referenceHidden",
629
- ...o
630
- } = X(e, t);
631
- switch (r) {
632
- case "referenceHidden": {
633
- const i = await se(t, {
634
- ...o,
635
- elementContext: "reference"
636
- }), s = lt(i, n.reference);
637
- return {
638
- data: {
639
- referenceHiddenOffsets: s,
640
- referenceHidden: at(s)
641
- }
642
- };
643
- }
644
- case "escaped": {
645
- const i = await se(t, {
646
- ...o,
647
- altBoundary: !0
648
- }), s = lt(i, n.floating);
649
- return {
650
- data: {
651
- escapedOffsets: s,
652
- escaped: at(s)
653
- }
654
- };
655
- }
656
- default:
657
- return {};
658
- }
659
- }
660
- };
661
- };
662
- async function Kn(e, t) {
663
- const {
664
- placement: n,
665
- platform: r,
666
- elements: o
667
- } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = G(n), l = ne(n), a = Z(n) === "y", f = ["left", "top"].includes(s) ? -1 : 1, u = i && a ? -1 : 1, p = X(t, e);
668
- let {
669
- mainAxis: m,
670
- crossAxis: d,
671
- alignmentAxis: h
672
- } = typeof p == "number" ? {
673
- mainAxis: p,
674
- crossAxis: 0,
675
- alignmentAxis: null
676
- } : {
677
- mainAxis: p.mainAxis || 0,
678
- crossAxis: p.crossAxis || 0,
679
- alignmentAxis: p.alignmentAxis
680
- };
681
- return l && typeof h == "number" && (d = l === "end" ? h * -1 : h), a ? {
682
- x: d * u,
683
- y: m * f
684
- } : {
685
- x: m * f,
686
- y: d * u
687
- };
688
- }
689
- const Jn = function(e) {
690
- return e === void 0 && (e = 0), {
691
- name: "offset",
692
- options: e,
693
- async fn(t) {
694
- var n, r;
695
- const {
696
- x: o,
697
- y: i,
698
- placement: s,
699
- middlewareData: l
700
- } = t, a = await Kn(t, e);
701
- return s === ((n = l.offset) == null ? void 0 : n.placement) && (r = l.arrow) != null && r.alignmentOffset ? {} : {
702
- x: o + a.x,
703
- y: i + a.y,
704
- data: {
705
- ...a,
706
- placement: s
707
- }
708
- };
709
- }
710
- };
711
- }, Qn = function(e) {
712
- return e === void 0 && (e = {}), {
713
- name: "shift",
714
- options: e,
715
- async fn(t) {
716
- const {
717
- x: n,
718
- y: r,
719
- placement: o
720
- } = t, {
721
- mainAxis: i = !0,
722
- crossAxis: s = !1,
723
- limiter: l = {
724
- fn: (y) => {
725
- let {
726
- x: w,
727
- y: v
728
- } = y;
729
- return {
730
- x: w,
731
- y: v
732
- };
733
- }
734
- },
735
- ...a
736
- } = X(e, t), f = {
737
- x: n,
738
- y: r
739
- }, u = await se(t, a), p = Z(G(o)), m = Ve(p);
740
- let d = f[m], h = f[p];
741
- if (i) {
742
- const y = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", v = d + u[y], E = d - u[w];
743
- d = Le(v, d, E);
744
- }
745
- if (s) {
746
- const y = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", v = h + u[y], E = h - u[w];
747
- h = Le(v, h, E);
748
- }
749
- const g = l.fn({
750
- ...t,
751
- [m]: d,
752
- [p]: h
753
- });
754
- return {
755
- ...g,
756
- data: {
757
- x: g.x - n,
758
- y: g.y - r,
759
- enabled: {
760
- [m]: i,
761
- [p]: s
762
- }
763
- }
764
- };
765
- }
766
- };
767
- }, er = function(e) {
768
- return e === void 0 && (e = {}), {
769
- options: e,
770
- fn(t) {
771
- const {
772
- x: n,
773
- y: r,
774
- placement: o,
775
- rects: i,
776
- middlewareData: s
777
- } = t, {
778
- offset: l = 0,
779
- mainAxis: a = !0,
780
- crossAxis: f = !0
781
- } = X(e, t), u = {
782
- x: n,
783
- y: r
784
- }, p = Z(o), m = Ve(p);
785
- let d = u[m], h = u[p];
786
- const g = X(l, t), y = typeof g == "number" ? {
787
- mainAxis: g,
788
- crossAxis: 0
789
- } : {
790
- mainAxis: 0,
791
- crossAxis: 0,
792
- ...g
793
- };
794
- if (a) {
795
- const E = m === "y" ? "height" : "width", x = i.reference[m] - i.floating[E] + y.mainAxis, C = i.reference[m] + i.reference[E] - y.mainAxis;
796
- d < x ? d = x : d > C && (d = C);
797
- }
798
- if (f) {
799
- var w, v;
800
- const E = m === "y" ? "width" : "height", x = ["top", "left"].includes(G(o)), C = i.reference[p] - i.floating[E] + (x && ((w = s.offset) == null ? void 0 : w[p]) || 0) + (x ? 0 : y.crossAxis), R = i.reference[p] + i.reference[E] + (x ? 0 : ((v = s.offset) == null ? void 0 : v[p]) || 0) - (x ? y.crossAxis : 0);
801
- h < C ? h = C : h > R && (h = R);
802
- }
803
- return {
804
- [m]: d,
805
- [p]: h
806
- };
807
- }
808
- };
809
- }, tr = function(e) {
810
- return e === void 0 && (e = {}), {
811
- name: "size",
812
- options: e,
813
- async fn(t) {
814
- var n, r;
815
- const {
816
- placement: o,
817
- rects: i,
818
- platform: s,
819
- elements: l
820
- } = t, {
821
- apply: a = () => {
822
- },
823
- ...f
824
- } = X(e, t), u = await se(t, f), p = G(o), m = ne(o), d = Z(o) === "y", {
825
- width: h,
826
- height: g
827
- } = i.floating;
828
- let y, w;
829
- p === "top" || p === "bottom" ? (y = p, w = m === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (w = p, y = m === "end" ? "top" : "bottom");
830
- const v = g - u.top - u.bottom, E = h - u.left - u.right, x = q(g - u[y], v), C = q(h - u[w], E), R = !t.middlewareData.shift;
831
- let P = x, O = C;
832
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (O = E), (r = t.middlewareData.shift) != null && r.enabled.y && (P = v), R && !m) {
833
- const T = W(u.left, 0), _ = W(u.right, 0), k = W(u.top, 0), N = W(u.bottom, 0);
834
- d ? O = h - 2 * (T !== 0 || _ !== 0 ? T + _ : W(u.left, u.right)) : P = g - 2 * (k !== 0 || N !== 0 ? k + N : W(u.top, u.bottom));
835
- }
836
- await a({
837
- ...t,
838
- availableWidth: O,
839
- availableHeight: P
840
- });
841
- const M = await s.getDimensions(l.floating);
842
- return h !== M.width || g !== M.height ? {
843
- reset: {
844
- rects: !0
845
- }
846
- } : {};
847
- }
848
- };
849
- };
850
- function be() {
851
- return typeof window < "u";
852
- }
853
- function re(e) {
854
- return Tt(e) ? (e.nodeName || "").toLowerCase() : "#document";
855
- }
856
- function F(e) {
857
- var t;
858
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
213
+ function Ae(e, t, n, { discrete: o }) {
214
+ const r = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
215
+ t && r.addEventListener(e, t, { once: !0 }), o ? Dt(r, i) : r.dispatchEvent(i);
859
216
  }
860
- function z(e) {
861
- var t;
862
- return (t = (Tt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
863
- }
864
- function Tt(e) {
865
- return be() ? e instanceof Node || e instanceof F(e).Node : !1;
866
- }
867
- function H(e) {
868
- return be() ? e instanceof Element || e instanceof F(e).Element : !1;
869
- }
870
- function U(e) {
871
- return be() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
872
- }
873
- function ft(e) {
874
- return !be() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
875
- }
876
- function ae(e) {
877
- const {
878
- overflow: t,
879
- overflowX: n,
880
- overflowY: r,
881
- display: o
882
- } = V(e);
883
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
884
- }
885
- function nr(e) {
886
- return ["table", "td", "th"].includes(re(e));
887
- }
888
- function Ce(e) {
889
- return [":popover-open", ":modal"].some((t) => {
890
- try {
891
- return e.matches(t);
892
- } catch {
893
- return !1;
894
- }
895
- });
896
- }
897
- function Ue(e) {
898
- const t = ze(), n = H(e) ? V(e) : e;
899
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
900
- }
901
- function rr(e) {
902
- let t = K(e);
903
- for (; U(t) && !ee(t); ) {
904
- if (Ue(t))
905
- return t;
906
- if (Ce(t))
907
- return null;
908
- t = K(t);
909
- }
910
- return null;
911
- }
912
- function ze() {
913
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
914
- }
915
- function ee(e) {
916
- return ["html", "body", "#document"].includes(re(e));
917
- }
918
- function V(e) {
919
- return F(e).getComputedStyle(e);
920
- }
921
- function Ee(e) {
922
- return H(e) ? {
923
- scrollLeft: e.scrollLeft,
924
- scrollTop: e.scrollTop
925
- } : {
926
- scrollLeft: e.scrollX,
927
- scrollTop: e.scrollY
928
- };
929
- }
930
- function K(e) {
931
- if (re(e) === "html")
932
- return e;
933
- const t = (
934
- // Step into the shadow DOM of the parent of a slotted node.
935
- e.assignedSlot || // DOM Element detected.
936
- e.parentNode || // ShadowRoot detected.
937
- ft(e) && e.host || // Fallback.
938
- z(e)
939
- );
940
- return ft(t) ? t.host : t;
941
- }
942
- function St(e) {
943
- const t = K(e);
944
- return ee(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : U(t) && ae(t) ? t : St(t);
945
- }
946
- function ce(e, t, n) {
947
- var r;
948
- t === void 0 && (t = []), n === void 0 && (n = !0);
949
- const o = St(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = F(o);
950
- if (i) {
951
- const l = $e(s);
952
- return t.concat(s, s.visualViewport || [], ae(o) ? o : [], l && n ? ce(l) : []);
953
- }
954
- return t.concat(o, ce(o, [], n));
955
- }
956
- function $e(e) {
957
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
958
- }
959
- function Nt(e) {
960
- const t = V(e);
961
- let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
962
- const o = U(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, l = he(n) !== i || he(r) !== s;
963
- return l && (n = i, r = s), {
964
- width: n,
965
- height: r,
966
- $: l
967
- };
968
- }
969
- function Ye(e) {
970
- return H(e) ? e : e.contextElement;
971
- }
972
- function Q(e) {
973
- const t = Ye(e);
974
- if (!U(t))
975
- return j(1);
976
- const n = t.getBoundingClientRect(), {
977
- width: r,
978
- height: o,
979
- $: i
980
- } = Nt(t);
981
- let s = (i ? he(n.width) : n.width) / r, l = (i ? he(n.height) : n.height) / o;
982
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
983
- x: s,
984
- y: l
985
- };
986
- }
987
- const or = /* @__PURE__ */ j(0);
988
- function Dt(e) {
989
- const t = F(e);
990
- return !ze() || !t.visualViewport ? or : {
991
- x: t.visualViewport.offsetLeft,
992
- y: t.visualViewport.offsetTop
993
- };
994
- }
995
- function ir(e, t, n) {
996
- return t === void 0 && (t = !1), !n || t && n !== F(e) ? !1 : t;
997
- }
998
- function J(e, t, n, r) {
999
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1000
- const o = e.getBoundingClientRect(), i = Ye(e);
1001
- let s = j(1);
1002
- t && (r ? H(r) && (s = Q(r)) : s = Q(e));
1003
- const l = ir(i, n, r) ? Dt(i) : j(0);
1004
- let a = (o.left + l.x) / s.x, f = (o.top + l.y) / s.y, u = o.width / s.x, p = o.height / s.y;
1005
- if (i) {
1006
- const m = F(i), d = r && H(r) ? F(r) : r;
1007
- let h = m, g = $e(h);
1008
- for (; g && r && d !== h; ) {
1009
- const y = Q(g), w = g.getBoundingClientRect(), v = V(g), E = w.left + (g.clientLeft + parseFloat(v.paddingLeft)) * y.x, x = w.top + (g.clientTop + parseFloat(v.paddingTop)) * y.y;
1010
- a *= y.x, f *= y.y, u *= y.x, p *= y.y, a += E, f += x, h = F(g), g = $e(h);
1011
- }
1012
- }
1013
- return ye({
1014
- width: u,
1015
- height: p,
1016
- x: a,
1017
- y: f
1018
- });
1019
- }
1020
- function Xe(e, t) {
1021
- const n = Ee(e).scrollLeft;
1022
- return t ? t.left + n : J(z(e)).left + n;
1023
- }
1024
- function Lt(e, t, n) {
1025
- n === void 0 && (n = !1);
1026
- const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
1027
- // RTL <body> scrollbar.
1028
- Xe(e, r)
1029
- )), i = r.top + t.scrollTop;
1030
- return {
1031
- x: o,
1032
- y: i
1033
- };
1034
- }
1035
- function sr(e) {
1036
- let {
1037
- elements: t,
1038
- rect: n,
1039
- offsetParent: r,
1040
- strategy: o
1041
- } = e;
1042
- const i = o === "fixed", s = z(r), l = t ? Ce(t.floating) : !1;
1043
- if (r === s || l && i)
1044
- return n;
1045
- let a = {
1046
- scrollLeft: 0,
1047
- scrollTop: 0
1048
- }, f = j(1);
1049
- const u = j(0), p = U(r);
1050
- if ((p || !p && !i) && ((re(r) !== "body" || ae(s)) && (a = Ee(r)), U(r))) {
1051
- const d = J(r);
1052
- f = Q(r), u.x = d.x + r.clientLeft, u.y = d.y + r.clientTop;
1053
- }
1054
- const m = s && !p && !i ? Lt(s, a, !0) : j(0);
1055
- return {
1056
- width: n.width * f.x,
1057
- height: n.height * f.y,
1058
- x: n.x * f.x - a.scrollLeft * f.x + u.x + m.x,
1059
- y: n.y * f.y - a.scrollTop * f.y + u.y + m.y
1060
- };
1061
- }
1062
- function cr(e) {
1063
- return Array.from(e.getClientRects());
1064
- }
1065
- function lr(e) {
1066
- const t = z(e), n = Ee(e), r = e.ownerDocument.body, o = W(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = W(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1067
- let s = -n.scrollLeft + Xe(e);
1068
- const l = -n.scrollTop;
1069
- return V(r).direction === "rtl" && (s += W(t.clientWidth, r.clientWidth) - o), {
1070
- width: o,
1071
- height: i,
1072
- x: s,
1073
- y: l
1074
- };
1075
- }
1076
- function ar(e, t) {
1077
- const n = F(e), r = z(e), o = n.visualViewport;
1078
- let i = r.clientWidth, s = r.clientHeight, l = 0, a = 0;
1079
- if (o) {
1080
- i = o.width, s = o.height;
1081
- const f = ze();
1082
- (!f || f && t === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
1083
- }
1084
- return {
1085
- width: i,
1086
- height: s,
1087
- x: l,
1088
- y: a
1089
- };
1090
- }
1091
- function fr(e, t) {
1092
- const n = J(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = U(e) ? Q(e) : j(1), s = e.clientWidth * i.x, l = e.clientHeight * i.y, a = o * i.x, f = r * i.y;
1093
- return {
1094
- width: s,
1095
- height: l,
1096
- x: a,
1097
- y: f
1098
- };
1099
- }
1100
- function ut(e, t, n) {
1101
- let r;
1102
- if (t === "viewport")
1103
- r = ar(e, n);
1104
- else if (t === "document")
1105
- r = lr(z(e));
1106
- else if (H(t))
1107
- r = fr(t, n);
1108
- else {
1109
- const o = Dt(e);
1110
- r = {
1111
- x: t.x - o.x,
1112
- y: t.y - o.y,
1113
- width: t.width,
1114
- height: t.height
1115
- };
1116
- }
1117
- return ye(r);
1118
- }
1119
- function Mt(e, t) {
1120
- const n = K(e);
1121
- return n === t || !H(n) || ee(n) ? !1 : V(n).position === "fixed" || Mt(n, t);
1122
- }
1123
- function ur(e, t) {
1124
- const n = t.get(e);
1125
- if (n)
1126
- return n;
1127
- let r = ce(e, [], !1).filter((l) => H(l) && re(l) !== "body"), o = null;
1128
- const i = V(e).position === "fixed";
1129
- let s = i ? K(e) : e;
1130
- for (; H(s) && !ee(s); ) {
1131
- const l = V(s), a = Ue(s);
1132
- !a && l.position === "fixed" && (o = null), (i ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || ae(s) && !a && Mt(e, s)) ? r = r.filter((u) => u !== s) : o = l, s = K(s);
1133
- }
1134
- return t.set(e, r), r;
1135
- }
1136
- function dr(e) {
1137
- let {
1138
- element: t,
1139
- boundary: n,
1140
- rootBoundary: r,
1141
- strategy: o
1142
- } = e;
1143
- const s = [...n === "clippingAncestors" ? Ce(t) ? [] : ur(t, this._c) : [].concat(n), r], l = s[0], a = s.reduce((f, u) => {
1144
- const p = ut(t, u, o);
1145
- return f.top = W(p.top, f.top), f.right = q(p.right, f.right), f.bottom = q(p.bottom, f.bottom), f.left = W(p.left, f.left), f;
1146
- }, ut(t, l, o));
1147
- return {
1148
- width: a.right - a.left,
1149
- height: a.bottom - a.top,
1150
- x: a.left,
1151
- y: a.top
1152
- };
1153
- }
1154
- function pr(e) {
1155
- const {
1156
- width: t,
1157
- height: n
1158
- } = Nt(e);
1159
- return {
1160
- width: t,
1161
- height: n
1162
- };
1163
- }
1164
- function mr(e, t, n) {
1165
- const r = U(t), o = z(t), i = n === "fixed", s = J(e, !0, i, t);
1166
- let l = {
1167
- scrollLeft: 0,
1168
- scrollTop: 0
1169
- };
1170
- const a = j(0);
1171
- if (r || !r && !i)
1172
- if ((re(t) !== "body" || ae(o)) && (l = Ee(t)), r) {
1173
- const m = J(t, !0, i, t);
1174
- a.x = m.x + t.clientLeft, a.y = m.y + t.clientTop;
1175
- } else
1176
- o && (a.x = Xe(o));
1177
- const f = o && !r && !i ? Lt(o, l) : j(0), u = s.left + l.scrollLeft - a.x - f.x, p = s.top + l.scrollTop - a.y - f.y;
1178
- return {
1179
- x: u,
1180
- y: p,
1181
- width: s.width,
1182
- height: s.height
1183
- };
1184
- }
1185
- function Te(e) {
1186
- return V(e).position === "static";
1187
- }
1188
- function dt(e, t) {
1189
- if (!U(e) || V(e).position === "fixed")
1190
- return null;
1191
- if (t)
1192
- return t(e);
1193
- let n = e.offsetParent;
1194
- return z(e) === n && (n = n.ownerDocument.body), n;
1195
- }
1196
- function $t(e, t) {
1197
- const n = F(e);
1198
- if (Ce(e))
1199
- return n;
1200
- if (!U(e)) {
1201
- let o = K(e);
1202
- for (; o && !ee(o); ) {
1203
- if (H(o) && !Te(o))
1204
- return o;
1205
- o = K(o);
1206
- }
1207
- return n;
1208
- }
1209
- let r = dt(e, t);
1210
- for (; r && nr(r) && Te(r); )
1211
- r = dt(r, t);
1212
- return r && ee(r) && Te(r) && !Ue(r) ? n : r || rr(e) || n;
1213
- }
1214
- const hr = async function(e) {
1215
- const t = this.getOffsetParent || $t, n = this.getDimensions, r = await n(e.floating);
1216
- return {
1217
- reference: mr(e.reference, await t(e.floating), e.strategy),
1218
- floating: {
1219
- x: 0,
1220
- y: 0,
1221
- width: r.width,
1222
- height: r.height
1223
- }
1224
- };
1225
- };
1226
- function gr(e) {
1227
- return V(e).direction === "rtl";
1228
- }
1229
- const yr = {
1230
- convertOffsetParentRelativeRectToViewportRelativeRect: sr,
1231
- getDocumentElement: z,
1232
- getClippingRect: dr,
1233
- getOffsetParent: $t,
1234
- getElementRects: hr,
1235
- getClientRects: cr,
1236
- getDimensions: pr,
1237
- getScale: Q,
1238
- isElement: H,
1239
- isRTL: gr
1240
- };
1241
- function wr(e, t) {
1242
- let n = null, r;
1243
- const o = z(e);
1244
- function i() {
1245
- var l;
1246
- clearTimeout(r), (l = n) == null || l.disconnect(), n = null;
1247
- }
1248
- function s(l, a) {
1249
- l === void 0 && (l = !1), a === void 0 && (a = 1), i();
1250
- const {
1251
- left: f,
1252
- top: u,
1253
- width: p,
1254
- height: m
1255
- } = e.getBoundingClientRect();
1256
- if (l || t(), !p || !m)
1257
- return;
1258
- const d = de(u), h = de(o.clientWidth - (f + p)), g = de(o.clientHeight - (u + m)), y = de(f), v = {
1259
- rootMargin: -d + "px " + -h + "px " + -g + "px " + -y + "px",
1260
- threshold: W(0, q(1, a)) || 1
1261
- };
1262
- let E = !0;
1263
- function x(C) {
1264
- const R = C[0].intersectionRatio;
1265
- if (R !== a) {
1266
- if (!E)
1267
- return s();
1268
- R ? s(!1, R) : r = setTimeout(() => {
1269
- s(!1, 1e-7);
1270
- }, 1e3);
1271
- }
1272
- E = !1;
1273
- }
1274
- try {
1275
- n = new IntersectionObserver(x, {
1276
- ...v,
1277
- // Handle <iframe>s
1278
- root: o.ownerDocument
1279
- });
1280
- } catch {
1281
- n = new IntersectionObserver(x, v);
1282
- }
1283
- n.observe(e);
1284
- }
1285
- return s(!0), i;
1286
- }
1287
- function vr(e, t, n, r) {
1288
- r === void 0 && (r = {});
1289
- const {
1290
- ancestorScroll: o = !0,
1291
- ancestorResize: i = !0,
1292
- elementResize: s = typeof ResizeObserver == "function",
1293
- layoutShift: l = typeof IntersectionObserver == "function",
1294
- animationFrame: a = !1
1295
- } = r, f = Ye(e), u = o || i ? [...f ? ce(f) : [], ...ce(t)] : [];
1296
- u.forEach((w) => {
1297
- o && w.addEventListener("scroll", n, {
1298
- passive: !0
1299
- }), i && w.addEventListener("resize", n);
1300
- });
1301
- const p = f && l ? wr(f, n) : null;
1302
- let m = -1, d = null;
1303
- s && (d = new ResizeObserver((w) => {
1304
- let [v] = w;
1305
- v && v.target === f && d && (d.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1306
- var E;
1307
- (E = d) == null || E.observe(t);
1308
- })), n();
1309
- }), f && !a && d.observe(f), d.observe(t));
1310
- let h, g = a ? J(e) : null;
1311
- a && y();
1312
- function y() {
1313
- const w = J(e);
1314
- g && (w.x !== g.x || w.y !== g.y || w.width !== g.width || w.height !== g.height) && n(), g = w, h = requestAnimationFrame(y);
1315
- }
1316
- return n(), () => {
1317
- var w;
1318
- u.forEach((v) => {
1319
- o && v.removeEventListener("scroll", n), i && v.removeEventListener("resize", n);
1320
- }), p == null || p(), (w = d) == null || w.disconnect(), d = null, a && cancelAnimationFrame(h);
1321
- };
1322
- }
1323
- const xr = Jn, br = Qn, Cr = qn, Er = tr, Pr = Zn, pt = Gn, Rr = er, Ar = (e, t, n) => {
1324
- const r = /* @__PURE__ */ new Map(), o = {
1325
- platform: yr,
1326
- ...n
1327
- }, i = {
1328
- ...o.platform,
1329
- _c: r
1330
- };
1331
- return Xn(e, t, {
1332
- ...o,
1333
- platform: i
1334
- });
1335
- };
1336
- var me = typeof document < "u" ? wn : vn;
1337
- function we(e, t) {
1338
- if (e === t)
1339
- return !0;
1340
- if (typeof e != typeof t)
1341
- return !1;
1342
- if (typeof e == "function" && e.toString() === t.toString())
1343
- return !0;
1344
- let n, r, o;
1345
- if (e && t && typeof e == "object") {
1346
- if (Array.isArray(e)) {
1347
- if (n = e.length, n !== t.length)
1348
- return !1;
1349
- for (r = n; r-- !== 0; )
1350
- if (!we(e[r], t[r]))
1351
- return !1;
1352
- return !0;
1353
- }
1354
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
1355
- return !1;
1356
- for (r = n; r-- !== 0; )
1357
- if (!{}.hasOwnProperty.call(t, o[r]))
1358
- return !1;
1359
- for (r = n; r-- !== 0; ) {
1360
- const i = o[r];
1361
- if (!(i === "_owner" && e.$$typeof) && !we(e[i], t[i]))
1362
- return !1;
1363
- }
1364
- return !0;
1365
- }
1366
- return e !== e && t !== t;
1367
- }
1368
- function _t(e) {
1369
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1370
- }
1371
- function mt(e, t) {
1372
- const n = _t(e);
1373
- return Math.round(t * n) / n;
1374
- }
1375
- function Se(e) {
1376
- const t = c.useRef(e);
1377
- return me(() => {
1378
- t.current = e;
1379
- }), t;
1380
- }
1381
- function Or(e) {
1382
- e === void 0 && (e = {});
1383
- const {
1384
- placement: t = "bottom",
1385
- strategy: n = "absolute",
1386
- middleware: r = [],
1387
- platform: o,
1388
- elements: {
1389
- reference: i,
1390
- floating: s
1391
- } = {},
1392
- transform: l = !0,
1393
- whileElementsMounted: a,
1394
- open: f
1395
- } = e, [u, p] = c.useState({
1396
- x: 0,
1397
- y: 0,
1398
- strategy: n,
1399
- placement: t,
1400
- middlewareData: {},
1401
- isPositioned: !1
1402
- }), [m, d] = c.useState(r);
1403
- we(m, r) || d(r);
1404
- const [h, g] = c.useState(null), [y, w] = c.useState(null), v = c.useCallback((A) => {
1405
- A !== R.current && (R.current = A, g(A));
1406
- }, []), E = c.useCallback((A) => {
1407
- A !== P.current && (P.current = A, w(A));
1408
- }, []), x = i || h, C = s || y, R = c.useRef(null), P = c.useRef(null), O = c.useRef(u), M = a != null, T = Se(a), _ = Se(o), k = Se(f), N = c.useCallback(() => {
1409
- if (!R.current || !P.current)
1410
- return;
1411
- const A = {
1412
- placement: t,
1413
- strategy: n,
1414
- middleware: m
1415
- };
1416
- _.current && (A.platform = _.current), Ar(R.current, P.current, A).then(($) => {
1417
- const B = {
1418
- ...$,
1419
- // The floating element's position may be recomputed while it's closed
1420
- // but still mounted (such as when transitioning out). To ensure
1421
- // `isPositioned` will be `false` initially on the next open, avoid
1422
- // setting it to `true` when `open === false` (must be specified).
1423
- isPositioned: k.current !== !1
1424
- };
1425
- S.current && !we(O.current, B) && (O.current = B, xt.flushSync(() => {
1426
- p(B);
1427
- }));
1428
- });
1429
- }, [m, t, n, _, k]);
1430
- me(() => {
1431
- f === !1 && O.current.isPositioned && (O.current.isPositioned = !1, p((A) => ({
1432
- ...A,
1433
- isPositioned: !1
1434
- })));
1435
- }, [f]);
1436
- const S = c.useRef(!1);
1437
- me(() => (S.current = !0, () => {
1438
- S.current = !1;
1439
- }), []), me(() => {
1440
- if (x && (R.current = x), C && (P.current = C), x && C) {
1441
- if (T.current)
1442
- return T.current(x, C, N);
1443
- N();
1444
- }
1445
- }, [x, C, N, T, M]);
1446
- const I = c.useMemo(() => ({
1447
- reference: R,
1448
- floating: P,
1449
- setReference: v,
1450
- setFloating: E
1451
- }), [v, E]), D = c.useMemo(() => ({
1452
- reference: x,
1453
- floating: C
1454
- }), [x, C]), L = c.useMemo(() => {
1455
- const A = {
1456
- position: n,
1457
- left: 0,
1458
- top: 0
1459
- };
1460
- if (!D.floating)
1461
- return A;
1462
- const $ = mt(D.floating, u.x), B = mt(D.floating, u.y);
1463
- return l ? {
1464
- ...A,
1465
- transform: "translate(" + $ + "px, " + B + "px)",
1466
- ..._t(D.floating) >= 1.5 && {
1467
- willChange: "transform"
1468
- }
1469
- } : {
1470
- position: n,
1471
- left: $,
1472
- top: B
1473
- };
1474
- }, [n, l, D.floating, u.x, u.y]);
1475
- return c.useMemo(() => ({
1476
- ...u,
1477
- update: N,
1478
- refs: I,
1479
- elements: D,
1480
- floatingStyles: L
1481
- }), [u, N, I, D, L]);
1482
- }
1483
- const Tr = (e) => {
1484
- function t(n) {
1485
- return {}.hasOwnProperty.call(n, "current");
1486
- }
1487
- return {
1488
- name: "arrow",
1489
- options: e,
1490
- fn(n) {
1491
- const {
1492
- element: r,
1493
- padding: o
1494
- } = typeof e == "function" ? e(n) : e;
1495
- return r && t(r) ? r.current != null ? pt({
1496
- element: r.current,
1497
- padding: o
1498
- }).fn(n) : {} : r ? pt({
1499
- element: r,
1500
- padding: o
1501
- }).fn(n) : {};
1502
- }
1503
- };
1504
- }, Sr = (e, t) => ({
1505
- ...xr(e),
1506
- options: [e, t]
1507
- }), Nr = (e, t) => ({
1508
- ...br(e),
1509
- options: [e, t]
1510
- }), Dr = (e, t) => ({
1511
- ...Rr(e),
1512
- options: [e, t]
1513
- }), Lr = (e, t) => ({
1514
- ...Cr(e),
1515
- options: [e, t]
1516
- }), Mr = (e, t) => ({
1517
- ...Er(e),
1518
- options: [e, t]
1519
- }), $r = (e, t) => ({
1520
- ...Pr(e),
1521
- options: [e, t]
1522
- }), _r = (e, t) => ({
1523
- ...Tr(e),
1524
- options: [e, t]
1525
- });
1526
- function ht(e, t) {
217
+ function ve(e, t) {
1527
218
  if (typeof e == "function")
1528
219
  return e(t);
1529
220
  e != null && (e.current = t);
1530
221
  }
1531
- function kr(...e) {
222
+ function Ht(...e) {
1532
223
  return (t) => {
1533
224
  let n = !1;
1534
- const r = e.map((o) => {
1535
- const i = ht(o, t);
225
+ const o = e.map((r) => {
226
+ const i = ve(r, t);
1536
227
  return !n && typeof i == "function" && (n = !0), i;
1537
228
  });
1538
229
  if (n)
1539
230
  return () => {
1540
- for (let o = 0; o < r.length; o++) {
1541
- const i = r[o];
1542
- typeof i == "function" ? i() : ht(e[o], null);
231
+ for (let r = 0; r < o.length; r++) {
232
+ const i = o[r];
233
+ typeof i == "function" ? i() : ve(e[r], null);
1543
234
  }
1544
235
  };
1545
236
  };
1546
237
  }
1547
- var kt = c.forwardRef((e, t) => {
1548
- const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(Fr);
238
+ var Te = s.forwardRef((e, t) => {
239
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Vt);
1549
240
  if (i) {
1550
- const s = i.props.children, l = o.map((a) => a === i ? c.Children.count(s) > 1 ? c.Children.only(null) : c.isValidElement(s) ? s.props.children : null : a);
1551
- return /* @__PURE__ */ b(_e, { ...r, ref: t, children: c.isValidElement(s) ? c.cloneElement(s, void 0, l) : null });
241
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
242
+ return /* @__PURE__ */ f(X, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
1552
243
  }
1553
- return /* @__PURE__ */ b(_e, { ...r, ref: t, children: n });
244
+ return /* @__PURE__ */ f(X, { ...o, ref: t, children: n });
1554
245
  });
1555
- kt.displayName = "Slot";
1556
- var _e = c.forwardRef((e, t) => {
1557
- const { children: n, ...r } = e;
1558
- if (c.isValidElement(n)) {
1559
- const o = Hr(n), i = Ir(r, n.props);
1560
- return n.type !== c.Fragment && (i.ref = t ? kr(t, o) : o), c.cloneElement(n, i);
246
+ Te.displayName = "Slot";
247
+ var X = s.forwardRef((e, t) => {
248
+ const { children: n, ...o } = e;
249
+ if (s.isValidElement(n)) {
250
+ const r = Ut(n), i = Bt(o, n.props);
251
+ return n.type !== s.Fragment && (i.ref = t ? Ht(t, r) : r), s.cloneElement(n, i);
1561
252
  }
1562
- return c.Children.count(n) > 1 ? c.Children.only(null) : null;
253
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
1563
254
  });
1564
- _e.displayName = "SlotClone";
1565
- var Wr = ({ children: e }) => /* @__PURE__ */ b(ve, { children: e });
1566
- function Fr(e) {
1567
- return c.isValidElement(e) && e.type === Wr;
255
+ X.displayName = "SlotClone";
256
+ var Ft = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
257
+ function Vt(e) {
258
+ return s.isValidElement(e) && e.type === Ft;
1568
259
  }
1569
- function Ir(e, t) {
260
+ function Bt(e, t) {
1570
261
  const n = { ...t };
1571
- for (const r in t) {
1572
- const o = e[r], i = t[r];
1573
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...l) => {
1574
- i(...l), o(...l);
1575
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
262
+ for (const o in t) {
263
+ const r = e[o], i = t[o];
264
+ /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
265
+ i(...c), r(...c);
266
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
1576
267
  }
1577
268
  return { ...e, ...n };
1578
269
  }
1579
- function Hr(e) {
1580
- var r, o;
1581
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
1582
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
270
+ function Ut(e) {
271
+ var o, r;
272
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
273
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
1583
274
  }
1584
- var Vr = [
275
+ var jt = [
1585
276
  "a",
1586
277
  "button",
1587
278
  "div",
@@ -1598,91 +289,91 @@ var Vr = [
1598
289
  "span",
1599
290
  "svg",
1600
291
  "ul"
1601
- ], Br = Vr.reduce((e, t) => {
1602
- const n = c.forwardRef((r, o) => {
1603
- const { asChild: i, ...s } = r, l = i ? kt : t;
1604
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ b(l, { ...s, ref: o });
292
+ ], Yt = jt.reduce((e, t) => {
293
+ const n = s.forwardRef((o, r) => {
294
+ const { asChild: i, ...a } = o, c = i ? Te : t;
295
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
1605
296
  });
1606
297
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
1607
- }, {}), jr = "Arrow", Wt = c.forwardRef((e, t) => {
1608
- const { children: n, width: r = 10, height: o = 5, ...i } = e;
1609
- return /* @__PURE__ */ b(
1610
- Br.svg,
298
+ }, {}), Gt = "Arrow", Oe = s.forwardRef((e, t) => {
299
+ const { children: n, width: o = 10, height: r = 5, ...i } = e;
300
+ return /* @__PURE__ */ f(
301
+ Yt.svg,
1611
302
  {
1612
303
  ...i,
1613
304
  ref: t,
1614
- width: r,
1615
- height: o,
305
+ width: o,
306
+ height: r,
1616
307
  viewBox: "0 0 30 10",
1617
308
  preserveAspectRatio: "none",
1618
- children: e.asChild ? n : /* @__PURE__ */ b("polygon", { points: "0,0 30,0 15,10" })
309
+ children: e.asChild ? n : /* @__PURE__ */ f("polygon", { points: "0,0 30,0 15,10" })
1619
310
  }
1620
311
  );
1621
312
  });
1622
- Wt.displayName = jr;
1623
- var Ur = Wt;
1624
- function gt(e, t) {
313
+ Oe.displayName = Gt;
314
+ var Xt = Oe;
315
+ function ye(e, t) {
1625
316
  if (typeof e == "function")
1626
317
  return e(t);
1627
318
  e != null && (e.current = t);
1628
319
  }
1629
- function Ft(...e) {
320
+ function Ne(...e) {
1630
321
  return (t) => {
1631
322
  let n = !1;
1632
- const r = e.map((o) => {
1633
- const i = gt(o, t);
323
+ const o = e.map((r) => {
324
+ const i = ye(r, t);
1634
325
  return !n && typeof i == "function" && (n = !0), i;
1635
326
  });
1636
327
  if (n)
1637
328
  return () => {
1638
- for (let o = 0; o < r.length; o++) {
1639
- const i = r[o];
1640
- typeof i == "function" ? i() : gt(e[o], null);
329
+ for (let r = 0; r < o.length; r++) {
330
+ const i = o[r];
331
+ typeof i == "function" ? i() : ye(e[r], null);
1641
332
  }
1642
333
  };
1643
334
  };
1644
335
  }
1645
- function It(...e) {
1646
- return c.useCallback(Ft(...e), e);
336
+ function Se(...e) {
337
+ return s.useCallback(Ne(...e), e);
1647
338
  }
1648
- var Ht = c.forwardRef((e, t) => {
1649
- const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(Yr);
339
+ var De = s.forwardRef((e, t) => {
340
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Zt);
1650
341
  if (i) {
1651
- const s = i.props.children, l = o.map((a) => a === i ? c.Children.count(s) > 1 ? c.Children.only(null) : c.isValidElement(s) ? s.props.children : null : a);
1652
- return /* @__PURE__ */ b(ke, { ...r, ref: t, children: c.isValidElement(s) ? c.cloneElement(s, void 0, l) : null });
342
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
343
+ return /* @__PURE__ */ f(z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
1653
344
  }
1654
- return /* @__PURE__ */ b(ke, { ...r, ref: t, children: n });
345
+ return /* @__PURE__ */ f(z, { ...o, ref: t, children: n });
1655
346
  });
1656
- Ht.displayName = "Slot";
1657
- var ke = c.forwardRef((e, t) => {
1658
- const { children: n, ...r } = e;
1659
- if (c.isValidElement(n)) {
1660
- const o = Gr(n), i = Xr(r, n.props);
1661
- return n.type !== c.Fragment && (i.ref = t ? Ft(t, o) : o), c.cloneElement(n, i);
347
+ De.displayName = "Slot";
348
+ var z = s.forwardRef((e, t) => {
349
+ const { children: n, ...o } = e;
350
+ if (s.isValidElement(n)) {
351
+ const r = Kt(n), i = qt(o, n.props);
352
+ return n.type !== s.Fragment && (i.ref = t ? Ne(t, r) : r), s.cloneElement(n, i);
1662
353
  }
1663
- return c.Children.count(n) > 1 ? c.Children.only(null) : null;
354
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
1664
355
  });
1665
- ke.displayName = "SlotClone";
1666
- var zr = ({ children: e }) => /* @__PURE__ */ b(ve, { children: e });
1667
- function Yr(e) {
1668
- return c.isValidElement(e) && e.type === zr;
356
+ z.displayName = "SlotClone";
357
+ var zt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
358
+ function Zt(e) {
359
+ return s.isValidElement(e) && e.type === zt;
1669
360
  }
1670
- function Xr(e, t) {
361
+ function qt(e, t) {
1671
362
  const n = { ...t };
1672
- for (const r in t) {
1673
- const o = e[r], i = t[r];
1674
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...l) => {
1675
- i(...l), o(...l);
1676
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
363
+ for (const o in t) {
364
+ const r = e[o], i = t[o];
365
+ /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
366
+ i(...c), r(...c);
367
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
1677
368
  }
1678
369
  return { ...e, ...n };
1679
370
  }
1680
- function Gr(e) {
1681
- var r, o;
1682
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
1683
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
371
+ function Kt(e) {
372
+ var o, r;
373
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
374
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
1684
375
  }
1685
- var qr = [
376
+ var Jt = [
1686
377
  "a",
1687
378
  "button",
1688
379
  "div",
@@ -1699,131 +390,131 @@ var qr = [
1699
390
  "span",
1700
391
  "svg",
1701
392
  "ul"
1702
- ], Vt = qr.reduce((e, t) => {
1703
- const n = c.forwardRef((r, o) => {
1704
- const { asChild: i, ...s } = r, l = i ? Ht : t;
1705
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ b(l, { ...s, ref: o });
393
+ ], _e = Jt.reduce((e, t) => {
394
+ const n = s.forwardRef((o, r) => {
395
+ const { asChild: i, ...a } = o, c = i ? De : t;
396
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
1706
397
  });
1707
398
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
1708
- }, {}), Ge = "Popper", [Bt, jt] = vt(Ge), [Zr, Ut] = Bt(Ge), zt = (e) => {
1709
- const { __scopePopper: t, children: n } = e, [r, o] = c.useState(null);
1710
- return /* @__PURE__ */ b(Zr, { scope: t, anchor: r, onAnchorChange: o, children: n });
399
+ }, {}), ee = "Popper", [Le, $e] = Ce(ee), [Qt, Me] = Le(ee), Ie = (e) => {
400
+ const { __scopePopper: t, children: n } = e, [o, r] = s.useState(null);
401
+ return /* @__PURE__ */ f(Qt, { scope: t, anchor: o, onAnchorChange: r, children: n });
1711
402
  };
1712
- zt.displayName = Ge;
1713
- var Yt = "PopperAnchor", Xt = c.forwardRef(
403
+ Ie.displayName = ee;
404
+ var We = "PopperAnchor", ke = s.forwardRef(
1714
405
  (e, t) => {
1715
- const { __scopePopper: n, virtualRef: r, ...o } = e, i = Ut(Yt, n), s = c.useRef(null), l = It(t, s);
1716
- return c.useEffect(() => {
1717
- i.onAnchorChange((r == null ? void 0 : r.current) || s.current);
1718
- }), r ? null : /* @__PURE__ */ b(Vt.div, { ...o, ref: l });
406
+ const { __scopePopper: n, virtualRef: o, ...r } = e, i = Me(We, n), a = s.useRef(null), c = Se(t, a);
407
+ return s.useEffect(() => {
408
+ i.onAnchorChange((o == null ? void 0 : o.current) || a.current);
409
+ }), o ? null : /* @__PURE__ */ f(_e.div, { ...r, ref: c });
1719
410
  }
1720
411
  );
1721
- Xt.displayName = Yt;
1722
- var qe = "PopperContent", [Kr, Jr] = Bt(qe), Gt = c.forwardRef(
412
+ ke.displayName = We;
413
+ var te = "PopperContent", [en, tn] = Le(te), He = s.forwardRef(
1723
414
  (e, t) => {
1724
- var Ke, Je, Qe, et, tt, nt;
415
+ var se, ae, le, ce, ue, de;
1725
416
  const {
1726
417
  __scopePopper: n,
1727
- side: r = "bottom",
1728
- sideOffset: o = 0,
418
+ side: o = "bottom",
419
+ sideOffset: r = 0,
1729
420
  align: i = "center",
1730
- alignOffset: s = 0,
1731
- arrowPadding: l = 0,
1732
- avoidCollisions: a = !0,
1733
- collisionBoundary: f = [],
1734
- collisionPadding: u = 0,
1735
- sticky: p = "partial",
1736
- hideWhenDetached: m = !1,
1737
- updatePositionStrategy: d = "optimized",
1738
- onPlaced: h,
1739
- ...g
1740
- } = e, y = Ut(qe, n), [w, v] = c.useState(null), E = It(t, (oe) => v(oe)), [x, C] = c.useState(null), R = bn(x), P = (R == null ? void 0 : R.width) ?? 0, O = (R == null ? void 0 : R.height) ?? 0, M = r + (i !== "center" ? "-" + i : ""), T = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, _ = Array.isArray(f) ? f : [f], k = _.length > 0, N = {
1741
- padding: T,
1742
- boundary: _.filter(eo),
421
+ alignOffset: a = 0,
422
+ arrowPadding: c = 0,
423
+ avoidCollisions: l = !0,
424
+ collisionBoundary: u = [],
425
+ collisionPadding: d = 0,
426
+ sticky: m = "partial",
427
+ hideWhenDetached: h = !1,
428
+ updatePositionStrategy: p = "optimized",
429
+ onPlaced: v,
430
+ ...y
431
+ } = e, w = Me(te, n), [E, C] = s.useState(null), x = Se(t, (D) => C(D)), [P, R] = s.useState(null), b = pt(P), g = (b == null ? void 0 : b.width) ?? 0, T = (b == null ? void 0 : b.height) ?? 0, L = o + (i !== "center" ? "-" + i : ""), S = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, re = Array.isArray(u) ? u : [u], Qe = re.length > 0, $ = {
432
+ padding: S,
433
+ boundary: re.filter(rn),
1743
434
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1744
- altBoundary: k
1745
- }, { refs: S, floatingStyles: I, placement: D, isPositioned: L, middlewareData: A } = Or({
435
+ altBoundary: Qe
436
+ }, { refs: et, floatingStyles: oe, placement: tt, isPositioned: M, middlewareData: O } = yt({
1746
437
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1747
438
  strategy: "fixed",
1748
- placement: M,
1749
- whileElementsMounted: (...oe) => vr(...oe, {
1750
- animationFrame: d === "always"
439
+ placement: L,
440
+ whileElementsMounted: (...D) => gt(...D, {
441
+ animationFrame: p === "always"
1751
442
  }),
1752
443
  elements: {
1753
- reference: y.anchor
444
+ reference: w.anchor
1754
445
  },
1755
446
  middleware: [
1756
- Sr({ mainAxis: o + O, alignmentAxis: s }),
1757
- a && Nr({
447
+ wt({ mainAxis: r + T, alignmentAxis: a }),
448
+ l && Ct({
1758
449
  mainAxis: !0,
1759
450
  crossAxis: !1,
1760
- limiter: p === "partial" ? Dr() : void 0,
1761
- ...N
451
+ limiter: m === "partial" ? Rt() : void 0,
452
+ ...$
1762
453
  }),
1763
- a && Lr({ ...N }),
1764
- Mr({
1765
- ...N,
1766
- apply: ({ elements: oe, rects: rt, availableWidth: mn, availableHeight: hn }) => {
1767
- const { width: gn, height: yn } = rt.reference, ue = oe.floating.style;
1768
- ue.setProperty("--radix-popper-available-width", `${mn}px`), ue.setProperty("--radix-popper-available-height", `${hn}px`), ue.setProperty("--radix-popper-anchor-width", `${gn}px`), ue.setProperty("--radix-popper-anchor-height", `${yn}px`);
454
+ l && Et({ ...$ }),
455
+ Pt({
456
+ ...$,
457
+ apply: ({ elements: D, rects: fe, availableWidth: lt, availableHeight: ct }) => {
458
+ const { width: ut, height: dt } = fe.reference, W = D.floating.style;
459
+ W.setProperty("--radix-popper-available-width", `${lt}px`), W.setProperty("--radix-popper-available-height", `${ct}px`), W.setProperty("--radix-popper-anchor-width", `${ut}px`), W.setProperty("--radix-popper-anchor-height", `${dt}px`);
1769
460
  }
1770
461
  }),
1771
- x && _r({ element: x, padding: l }),
1772
- to({ arrowWidth: P, arrowHeight: O }),
1773
- m && $r({ strategy: "referenceHidden", ...N })
462
+ P && bt({ element: P, padding: c }),
463
+ on({ arrowWidth: g, arrowHeight: T }),
464
+ h && xt({ strategy: "referenceHidden", ...$ })
1774
465
  ]
1775
- }), [$, B] = Kt(D), fe = xe(h);
1776
- ie(() => {
1777
- L && (fe == null || fe());
1778
- }, [L, fe]);
1779
- const an = (Ke = A.arrow) == null ? void 0 : Ke.x, fn = (Je = A.arrow) == null ? void 0 : Je.y, un = ((Qe = A.arrow) == null ? void 0 : Qe.centerOffset) !== 0, [dn, pn] = c.useState();
1780
- return ie(() => {
1781
- w && pn(window.getComputedStyle(w).zIndex);
1782
- }, [w]), /* @__PURE__ */ b(
466
+ }), [ie, nt] = Be(tt), I = J(v);
467
+ H(() => {
468
+ M && (I == null || I());
469
+ }, [M, I]);
470
+ const rt = (se = O.arrow) == null ? void 0 : se.x, ot = (ae = O.arrow) == null ? void 0 : ae.y, it = ((le = O.arrow) == null ? void 0 : le.centerOffset) !== 0, [st, at] = s.useState();
471
+ return H(() => {
472
+ E && at(window.getComputedStyle(E).zIndex);
473
+ }, [E]), /* @__PURE__ */ f(
1783
474
  "div",
1784
475
  {
1785
- ref: S.setFloating,
476
+ ref: et.setFloating,
1786
477
  "data-radix-popper-content-wrapper": "",
1787
478
  style: {
1788
- ...I,
1789
- transform: L ? I.transform : "translate(0, -200%)",
479
+ ...oe,
480
+ transform: M ? oe.transform : "translate(0, -200%)",
1790
481
  // keep off the page when measuring
1791
482
  minWidth: "max-content",
1792
- zIndex: dn,
483
+ zIndex: st,
1793
484
  "--radix-popper-transform-origin": [
1794
- (et = A.transformOrigin) == null ? void 0 : et.x,
1795
- (tt = A.transformOrigin) == null ? void 0 : tt.y
485
+ (ce = O.transformOrigin) == null ? void 0 : ce.x,
486
+ (ue = O.transformOrigin) == null ? void 0 : ue.y
1796
487
  ].join(" "),
1797
488
  // hide the content if using the hide middleware and should be hidden
1798
489
  // set visibility to hidden and disable pointer events so the UI behaves
1799
490
  // as if the PopperContent isn't there at all
1800
- ...((nt = A.hide) == null ? void 0 : nt.referenceHidden) && {
491
+ ...((de = O.hide) == null ? void 0 : de.referenceHidden) && {
1801
492
  visibility: "hidden",
1802
493
  pointerEvents: "none"
1803
494
  }
1804
495
  },
1805
496
  dir: e.dir,
1806
- children: /* @__PURE__ */ b(
1807
- Kr,
497
+ children: /* @__PURE__ */ f(
498
+ en,
1808
499
  {
1809
500
  scope: n,
1810
- placedSide: $,
1811
- onArrowChange: C,
1812
- arrowX: an,
1813
- arrowY: fn,
1814
- shouldHideArrow: un,
1815
- children: /* @__PURE__ */ b(
1816
- Vt.div,
501
+ placedSide: ie,
502
+ onArrowChange: R,
503
+ arrowX: rt,
504
+ arrowY: ot,
505
+ shouldHideArrow: it,
506
+ children: /* @__PURE__ */ f(
507
+ _e.div,
1817
508
  {
1818
- "data-side": $,
1819
- "data-align": B,
1820
- ...g,
1821
- ref: E,
509
+ "data-side": ie,
510
+ "data-align": nt,
511
+ ...y,
512
+ ref: x,
1822
513
  style: {
1823
- ...g.style,
514
+ ...y.style,
1824
515
  // if the PopperContent hasn't been placed yet (not all measurements done)
1825
516
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
1826
- animation: L ? void 0 : "none"
517
+ animation: M ? void 0 : "none"
1827
518
  }
1828
519
  }
1829
520
  )
@@ -1833,19 +524,19 @@ var qe = "PopperContent", [Kr, Jr] = Bt(qe), Gt = c.forwardRef(
1833
524
  );
1834
525
  }
1835
526
  );
1836
- Gt.displayName = qe;
1837
- var qt = "PopperArrow", Qr = {
527
+ He.displayName = te;
528
+ var Fe = "PopperArrow", nn = {
1838
529
  top: "bottom",
1839
530
  right: "left",
1840
531
  bottom: "top",
1841
532
  left: "right"
1842
- }, Zt = c.forwardRef(function(t, n) {
1843
- const { __scopePopper: r, ...o } = t, i = Jr(qt, r), s = Qr[i.placedSide];
533
+ }, Ve = s.forwardRef(function(t, n) {
534
+ const { __scopePopper: o, ...r } = t, i = tn(Fe, o), a = nn[i.placedSide];
1844
535
  return (
1845
536
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1846
537
  // doesn't report size as we'd expect on SVG elements.
1847
538
  // it reports their bounding box which is effectively the largest path inside the SVG.
1848
- /* @__PURE__ */ b(
539
+ /* @__PURE__ */ f(
1849
540
  "span",
1850
541
  {
1851
542
  ref: i.onArrowChange,
@@ -1853,7 +544,7 @@ var qt = "PopperArrow", Qr = {
1853
544
  position: "absolute",
1854
545
  left: i.arrowX,
1855
546
  top: i.arrowY,
1856
- [s]: 0,
547
+ [a]: 0,
1857
548
  transformOrigin: {
1858
549
  top: "",
1859
550
  right: "0 0",
@@ -1868,13 +559,13 @@ var qt = "PopperArrow", Qr = {
1868
559
  }[i.placedSide],
1869
560
  visibility: i.shouldHideArrow ? "hidden" : void 0
1870
561
  },
1871
- children: /* @__PURE__ */ b(
1872
- Ur,
562
+ children: /* @__PURE__ */ f(
563
+ Xt,
1873
564
  {
1874
- ...o,
565
+ ...r,
1875
566
  ref: n,
1876
567
  style: {
1877
- ...o.style,
568
+ ...r.style,
1878
569
  // ensures the element can be measured correctly (mostly for if SVG)
1879
570
  display: "block"
1880
571
  }
@@ -1884,35 +575,35 @@ var qt = "PopperArrow", Qr = {
1884
575
  )
1885
576
  );
1886
577
  });
1887
- Zt.displayName = qt;
1888
- function eo(e) {
578
+ Ve.displayName = Fe;
579
+ function rn(e) {
1889
580
  return e !== null;
1890
581
  }
1891
- var to = (e) => ({
582
+ var on = (e) => ({
1892
583
  name: "transformOrigin",
1893
584
  options: e,
1894
585
  fn(t) {
1895
- var y, w, v;
1896
- const { placement: n, rects: r, middlewareData: o } = t, s = ((y = o.arrow) == null ? void 0 : y.centerOffset) !== 0, l = s ? 0 : e.arrowWidth, a = s ? 0 : e.arrowHeight, [f, u] = Kt(n), p = { start: "0%", center: "50%", end: "100%" }[u], m = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + l / 2, d = (((v = o.arrow) == null ? void 0 : v.y) ?? 0) + a / 2;
1897
- let h = "", g = "";
1898
- return f === "bottom" ? (h = s ? p : `${m}px`, g = `${-a}px`) : f === "top" ? (h = s ? p : `${m}px`, g = `${r.floating.height + a}px`) : f === "right" ? (h = `${-a}px`, g = s ? p : `${d}px`) : f === "left" && (h = `${r.floating.width + a}px`, g = s ? p : `${d}px`), { data: { x: h, y: g } };
586
+ var w, E, C;
587
+ const { placement: n, rects: o, middlewareData: r } = t, a = ((w = r.arrow) == null ? void 0 : w.centerOffset) !== 0, c = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [u, d] = Be(n), m = { start: "0%", center: "50%", end: "100%" }[d], h = (((E = r.arrow) == null ? void 0 : E.x) ?? 0) + c / 2, p = (((C = r.arrow) == null ? void 0 : C.y) ?? 0) + l / 2;
588
+ let v = "", y = "";
589
+ return u === "bottom" ? (v = a ? m : `${h}px`, y = `${-l}px`) : u === "top" ? (v = a ? m : `${h}px`, y = `${o.floating.height + l}px`) : u === "right" ? (v = `${-l}px`, y = a ? m : `${p}px`) : u === "left" && (v = `${o.floating.width + l}px`, y = a ? m : `${p}px`), { data: { x: v, y } };
1899
590
  }
1900
591
  });
1901
- function Kt(e) {
592
+ function Be(e) {
1902
593
  const [t, n = "center"] = e.split("-");
1903
594
  return [t, n];
1904
595
  }
1905
- var no = zt, ro = Xt, oo = Gt, io = Zt;
1906
- function so(e, t) {
1907
- return c.useReducer((n, r) => t[n][r] ?? n, e);
596
+ var sn = Ie, an = ke, ln = He, cn = Ve;
597
+ function un(e, t) {
598
+ return s.useReducer((n, o) => t[n][o] ?? n, e);
1908
599
  }
1909
- var Jt = (e) => {
1910
- const { present: t, children: n } = e, r = co(t), o = typeof n == "function" ? n({ present: r.isPresent }) : c.Children.only(n), i = le(r.ref, lo(o));
1911
- return typeof n == "function" || r.isPresent ? c.cloneElement(o, { ref: i }) : null;
600
+ var Ue = (e) => {
601
+ const { present: t, children: n } = e, o = dn(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), i = _(o.ref, fn(r));
602
+ return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: i }) : null;
1912
603
  };
1913
- Jt.displayName = "Presence";
1914
- function co(e) {
1915
- const [t, n] = c.useState(), r = c.useRef({}), o = c.useRef(e), i = c.useRef("none"), s = e ? "mounted" : "unmounted", [l, a] = so(s, {
604
+ Ue.displayName = "Presence";
605
+ function dn(e) {
606
+ const [t, n] = s.useState(), o = s.useRef({}), r = s.useRef(e), i = s.useRef("none"), a = e ? "mounted" : "unmounted", [c, l] = un(a, {
1916
607
  mounted: {
1917
608
  UNMOUNT: "unmounted",
1918
609
  ANIMATION_OUT: "unmountSuspended"
@@ -1925,108 +616,108 @@ function co(e) {
1925
616
  MOUNT: "mounted"
1926
617
  }
1927
618
  });
1928
- return c.useEffect(() => {
1929
- const f = pe(r.current);
1930
- i.current = l === "mounted" ? f : "none";
1931
- }, [l]), ie(() => {
1932
- const f = r.current, u = o.current;
1933
- if (u !== e) {
1934
- const m = i.current, d = pe(f);
1935
- e ? a("MOUNT") : d === "none" || (f == null ? void 0 : f.display) === "none" ? a("UNMOUNT") : a(u && m !== d ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
619
+ return s.useEffect(() => {
620
+ const u = k(o.current);
621
+ i.current = c === "mounted" ? u : "none";
622
+ }, [c]), H(() => {
623
+ const u = o.current, d = r.current;
624
+ if (d !== e) {
625
+ const h = i.current, p = k(u);
626
+ e ? l("MOUNT") : p === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(d && h !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
1936
627
  }
1937
- }, [e, a]), ie(() => {
628
+ }, [e, l]), H(() => {
1938
629
  if (t) {
1939
- let f;
1940
- const u = t.ownerDocument.defaultView ?? window, p = (d) => {
1941
- const g = pe(r.current).includes(d.animationName);
1942
- if (d.target === t && g && (a("ANIMATION_END"), !o.current)) {
1943
- const y = t.style.animationFillMode;
1944
- t.style.animationFillMode = "forwards", f = u.setTimeout(() => {
1945
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
630
+ let u;
631
+ const d = t.ownerDocument.defaultView ?? window, m = (p) => {
632
+ const y = k(o.current).includes(p.animationName);
633
+ if (p.target === t && y && (l("ANIMATION_END"), !r.current)) {
634
+ const w = t.style.animationFillMode;
635
+ t.style.animationFillMode = "forwards", u = d.setTimeout(() => {
636
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = w);
1946
637
  });
1947
638
  }
1948
- }, m = (d) => {
1949
- d.target === t && (i.current = pe(r.current));
639
+ }, h = (p) => {
640
+ p.target === t && (i.current = k(o.current));
1950
641
  };
1951
- return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", p), t.addEventListener("animationend", p), () => {
1952
- u.clearTimeout(f), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", p), t.removeEventListener("animationend", p);
642
+ return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", m), t.addEventListener("animationend", m), () => {
643
+ d.clearTimeout(u), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", m), t.removeEventListener("animationend", m);
1953
644
  };
1954
645
  } else
1955
- a("ANIMATION_END");
1956
- }, [t, a]), {
1957
- isPresent: ["mounted", "unmountSuspended"].includes(l),
1958
- ref: c.useCallback((f) => {
1959
- f && (r.current = getComputedStyle(f)), n(f);
646
+ l("ANIMATION_END");
647
+ }, [t, l]), {
648
+ isPresent: ["mounted", "unmountSuspended"].includes(c),
649
+ ref: s.useCallback((u) => {
650
+ u && (o.current = getComputedStyle(u)), n(u);
1960
651
  }, [])
1961
652
  };
1962
653
  }
1963
- function pe(e) {
654
+ function k(e) {
1964
655
  return (e == null ? void 0 : e.animationName) || "none";
1965
656
  }
1966
- function lo(e) {
1967
- var r, o;
1968
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
1969
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
657
+ function fn(e) {
658
+ var o, r;
659
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
660
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
1970
661
  }
1971
- function yt(e, t) {
662
+ function ge(e, t) {
1972
663
  if (typeof e == "function")
1973
664
  return e(t);
1974
665
  e != null && (e.current = t);
1975
666
  }
1976
- function ao(...e) {
667
+ function pn(...e) {
1977
668
  return (t) => {
1978
669
  let n = !1;
1979
- const r = e.map((o) => {
1980
- const i = yt(o, t);
670
+ const o = e.map((r) => {
671
+ const i = ge(r, t);
1981
672
  return !n && typeof i == "function" && (n = !0), i;
1982
673
  });
1983
674
  if (n)
1984
675
  return () => {
1985
- for (let o = 0; o < r.length; o++) {
1986
- const i = r[o];
1987
- typeof i == "function" ? i() : yt(e[o], null);
676
+ for (let r = 0; r < o.length; r++) {
677
+ const i = o[r];
678
+ typeof i == "function" ? i() : ge(e[r], null);
1988
679
  }
1989
680
  };
1990
681
  };
1991
682
  }
1992
- var Qt = c.forwardRef((e, t) => {
1993
- const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(uo);
683
+ var je = s.forwardRef((e, t) => {
684
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(hn);
1994
685
  if (i) {
1995
- const s = i.props.children, l = o.map((a) => a === i ? c.Children.count(s) > 1 ? c.Children.only(null) : c.isValidElement(s) ? s.props.children : null : a);
1996
- return /* @__PURE__ */ b(We, { ...r, ref: t, children: c.isValidElement(s) ? c.cloneElement(s, void 0, l) : null });
686
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
687
+ return /* @__PURE__ */ f(Z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
1997
688
  }
1998
- return /* @__PURE__ */ b(We, { ...r, ref: t, children: n });
689
+ return /* @__PURE__ */ f(Z, { ...o, ref: t, children: n });
1999
690
  });
2000
- Qt.displayName = "Slot";
2001
- var We = c.forwardRef((e, t) => {
2002
- const { children: n, ...r } = e;
2003
- if (c.isValidElement(n)) {
2004
- const o = mo(n), i = po(r, n.props);
2005
- return n.type !== c.Fragment && (i.ref = t ? ao(t, o) : o), c.cloneElement(n, i);
691
+ je.displayName = "Slot";
692
+ var Z = s.forwardRef((e, t) => {
693
+ const { children: n, ...o } = e;
694
+ if (s.isValidElement(n)) {
695
+ const r = yn(n), i = vn(o, n.props);
696
+ return n.type !== s.Fragment && (i.ref = t ? pn(t, r) : r), s.cloneElement(n, i);
2006
697
  }
2007
- return c.Children.count(n) > 1 ? c.Children.only(null) : null;
698
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
2008
699
  });
2009
- We.displayName = "SlotClone";
2010
- var fo = ({ children: e }) => /* @__PURE__ */ b(ve, { children: e });
2011
- function uo(e) {
2012
- return c.isValidElement(e) && e.type === fo;
700
+ Z.displayName = "SlotClone";
701
+ var mn = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
702
+ function hn(e) {
703
+ return s.isValidElement(e) && e.type === mn;
2013
704
  }
2014
- function po(e, t) {
705
+ function vn(e, t) {
2015
706
  const n = { ...t };
2016
- for (const r in t) {
2017
- const o = e[r], i = t[r];
2018
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...l) => {
2019
- i(...l), o(...l);
2020
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
707
+ for (const o in t) {
708
+ const r = e[o], i = t[o];
709
+ /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
710
+ i(...c), r(...c);
711
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
2021
712
  }
2022
713
  return { ...e, ...n };
2023
714
  }
2024
- function mo(e) {
2025
- var r, o;
2026
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
2027
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
715
+ function yn(e) {
716
+ var o, r;
717
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
718
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
2028
719
  }
2029
- var ho = [
720
+ var gn = [
2030
721
  "a",
2031
722
  "button",
2032
723
  "div",
@@ -2043,15 +734,15 @@ var ho = [
2043
734
  "span",
2044
735
  "svg",
2045
736
  "ul"
2046
- ], go = ho.reduce((e, t) => {
2047
- const n = c.forwardRef((r, o) => {
2048
- const { asChild: i, ...s } = r, l = i ? Qt : t;
2049
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ b(l, { ...s, ref: o });
737
+ ], wn = gn.reduce((e, t) => {
738
+ const n = s.forwardRef((o, r) => {
739
+ const { asChild: i, ...a } = o, c = i ? je : t;
740
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
2050
741
  });
2051
742
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
2052
- }, {}), yo = "VisuallyHidden", en = c.forwardRef(
2053
- (e, t) => /* @__PURE__ */ b(
2054
- go.span,
743
+ }, {}), Cn = "VisuallyHidden", Ye = s.forwardRef(
744
+ (e, t) => /* @__PURE__ */ f(
745
+ wn.span,
2055
746
  {
2056
747
  ...e,
2057
748
  ref: t,
@@ -2072,192 +763,192 @@ var ho = [
2072
763
  }
2073
764
  )
2074
765
  );
2075
- en.displayName = yo;
2076
- var wo = en, [Pe, Vo] = vt("Tooltip", [
2077
- jt
2078
- ]), Re = jt(), tn = "TooltipProvider", vo = 700, Fe = "tooltip.open", [xo, Ze] = Pe(tn), nn = (e) => {
766
+ Ye.displayName = Cn;
767
+ var En = Ye, [V, Yn] = Ce("Tooltip", [
768
+ $e
769
+ ]), B = $e(), Ge = "TooltipProvider", Pn = 700, q = "tooltip.open", [bn, ne] = V(Ge), Xe = (e) => {
2079
770
  const {
2080
771
  __scopeTooltip: t,
2081
- delayDuration: n = vo,
2082
- skipDelayDuration: r = 300,
2083
- disableHoverableContent: o = !1,
772
+ delayDuration: n = Pn,
773
+ skipDelayDuration: o = 300,
774
+ disableHoverableContent: r = !1,
2084
775
  children: i
2085
- } = e, [s, l] = c.useState(!0), a = c.useRef(!1), f = c.useRef(0);
2086
- return c.useEffect(() => {
2087
- const u = f.current;
2088
- return () => window.clearTimeout(u);
2089
- }, []), /* @__PURE__ */ b(
2090
- xo,
776
+ } = e, [a, c] = s.useState(!0), l = s.useRef(!1), u = s.useRef(0);
777
+ return s.useEffect(() => {
778
+ const d = u.current;
779
+ return () => window.clearTimeout(d);
780
+ }, []), /* @__PURE__ */ f(
781
+ bn,
2091
782
  {
2092
783
  scope: t,
2093
- isOpenDelayed: s,
784
+ isOpenDelayed: a,
2094
785
  delayDuration: n,
2095
- onOpen: c.useCallback(() => {
2096
- window.clearTimeout(f.current), l(!1);
786
+ onOpen: s.useCallback(() => {
787
+ window.clearTimeout(u.current), c(!1);
2097
788
  }, []),
2098
- onClose: c.useCallback(() => {
2099
- window.clearTimeout(f.current), f.current = window.setTimeout(
2100
- () => l(!0),
2101
- r
789
+ onClose: s.useCallback(() => {
790
+ window.clearTimeout(u.current), u.current = window.setTimeout(
791
+ () => c(!0),
792
+ o
2102
793
  );
2103
- }, [r]),
2104
- isPointerInTransitRef: a,
2105
- onPointerInTransitChange: c.useCallback((u) => {
2106
- a.current = u;
794
+ }, [o]),
795
+ isPointerInTransitRef: l,
796
+ onPointerInTransitChange: s.useCallback((d) => {
797
+ l.current = d;
2107
798
  }, []),
2108
- disableHoverableContent: o,
799
+ disableHoverableContent: r,
2109
800
  children: i
2110
801
  }
2111
802
  );
2112
803
  };
2113
- nn.displayName = tn;
2114
- var Ae = "Tooltip", [bo, Oe] = Pe(Ae), rn = (e) => {
804
+ Xe.displayName = Ge;
805
+ var U = "Tooltip", [xn, j] = V(U), ze = (e) => {
2115
806
  const {
2116
807
  __scopeTooltip: t,
2117
808
  children: n,
2118
- open: r,
2119
- defaultOpen: o = !1,
809
+ open: o,
810
+ defaultOpen: r = !1,
2120
811
  onOpenChange: i,
2121
- disableHoverableContent: s,
2122
- delayDuration: l
2123
- } = e, a = Ze(Ae, e.__scopeTooltip), f = Re(t), [u, p] = c.useState(null), m = Fn(), d = c.useRef(0), h = s ?? a.disableHoverableContent, g = l ?? a.delayDuration, y = c.useRef(!1), [w = !1, v] = Cn({
2124
- prop: r,
2125
- defaultProp: o,
2126
- onChange: (P) => {
2127
- P ? (a.onOpen(), document.dispatchEvent(new CustomEvent(Fe))) : a.onClose(), i == null || i(P);
812
+ disableHoverableContent: a,
813
+ delayDuration: c
814
+ } = e, l = ne(U, e.__scopeTooltip), u = B(t), [d, m] = s.useState(null), h = At(), p = s.useRef(0), v = a ?? l.disableHoverableContent, y = c ?? l.delayDuration, w = s.useRef(!1), [E = !1, C] = mt({
815
+ prop: o,
816
+ defaultProp: r,
817
+ onChange: (g) => {
818
+ g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(q))) : l.onClose(), i == null || i(g);
2128
819
  }
2129
- }), E = c.useMemo(() => w ? y.current ? "delayed-open" : "instant-open" : "closed", [w]), x = c.useCallback(() => {
2130
- window.clearTimeout(d.current), d.current = 0, y.current = !1, v(!0);
2131
- }, [v]), C = c.useCallback(() => {
2132
- window.clearTimeout(d.current), d.current = 0, v(!1);
2133
- }, [v]), R = c.useCallback(() => {
2134
- window.clearTimeout(d.current), d.current = window.setTimeout(() => {
2135
- y.current = !0, v(!0), d.current = 0;
2136
- }, g);
2137
- }, [g, v]);
2138
- return c.useEffect(() => () => {
2139
- d.current && (window.clearTimeout(d.current), d.current = 0);
2140
- }, []), /* @__PURE__ */ b(no, { ...f, children: /* @__PURE__ */ b(
2141
- bo,
820
+ }), x = s.useMemo(() => E ? w.current ? "delayed-open" : "instant-open" : "closed", [E]), P = s.useCallback(() => {
821
+ window.clearTimeout(p.current), p.current = 0, w.current = !1, C(!0);
822
+ }, [C]), R = s.useCallback(() => {
823
+ window.clearTimeout(p.current), p.current = 0, C(!1);
824
+ }, [C]), b = s.useCallback(() => {
825
+ window.clearTimeout(p.current), p.current = window.setTimeout(() => {
826
+ w.current = !0, C(!0), p.current = 0;
827
+ }, y);
828
+ }, [y, C]);
829
+ return s.useEffect(() => () => {
830
+ p.current && (window.clearTimeout(p.current), p.current = 0);
831
+ }, []), /* @__PURE__ */ f(sn, { ...u, children: /* @__PURE__ */ f(
832
+ xn,
2142
833
  {
2143
834
  scope: t,
2144
- contentId: m,
2145
- open: w,
2146
- stateAttribute: E,
2147
- trigger: u,
2148
- onTriggerChange: p,
2149
- onTriggerEnter: c.useCallback(() => {
2150
- a.isOpenDelayed ? R() : x();
2151
- }, [a.isOpenDelayed, R, x]),
2152
- onTriggerLeave: c.useCallback(() => {
2153
- h ? C() : (window.clearTimeout(d.current), d.current = 0);
2154
- }, [C, h]),
2155
- onOpen: x,
2156
- onClose: C,
2157
- disableHoverableContent: h,
835
+ contentId: h,
836
+ open: E,
837
+ stateAttribute: x,
838
+ trigger: d,
839
+ onTriggerChange: m,
840
+ onTriggerEnter: s.useCallback(() => {
841
+ l.isOpenDelayed ? b() : P();
842
+ }, [l.isOpenDelayed, b, P]),
843
+ onTriggerLeave: s.useCallback(() => {
844
+ v ? R() : (window.clearTimeout(p.current), p.current = 0);
845
+ }, [R, v]),
846
+ onOpen: P,
847
+ onClose: R,
848
+ disableHoverableContent: v,
2158
849
  children: n
2159
850
  }
2160
851
  ) });
2161
852
  };
2162
- rn.displayName = Ae;
2163
- var Ie = "TooltipTrigger", on = c.forwardRef(
853
+ ze.displayName = U;
854
+ var K = "TooltipTrigger", Ze = s.forwardRef(
2164
855
  (e, t) => {
2165
- const { __scopeTooltip: n, ...r } = e, o = Oe(Ie, n), i = Ze(Ie, n), s = Re(n), l = c.useRef(null), a = le(t, l, o.onTriggerChange), f = c.useRef(!1), u = c.useRef(!1), p = c.useCallback(() => f.current = !1, []);
2166
- return c.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ b(ro, { asChild: !0, ...s, children: /* @__PURE__ */ b(
2167
- He.button,
856
+ const { __scopeTooltip: n, ...o } = e, r = j(K, n), i = ne(K, n), a = B(n), c = s.useRef(null), l = _(t, c, r.onTriggerChange), u = s.useRef(!1), d = s.useRef(!1), m = s.useCallback(() => u.current = !1, []);
857
+ return s.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ f(an, { asChild: !0, ...a, children: /* @__PURE__ */ f(
858
+ Q.button,
2168
859
  {
2169
- "aria-describedby": o.open ? o.contentId : void 0,
2170
- "data-state": o.stateAttribute,
2171
- ...r,
2172
- ref: a,
2173
- onPointerMove: Y(e.onPointerMove, (m) => {
2174
- m.pointerType !== "touch" && !u.current && !i.isPointerInTransitRef.current && (o.onTriggerEnter(), u.current = !0);
860
+ "aria-describedby": r.open ? r.contentId : void 0,
861
+ "data-state": r.stateAttribute,
862
+ ...o,
863
+ ref: l,
864
+ onPointerMove: A(e.onPointerMove, (h) => {
865
+ h.pointerType !== "touch" && !d.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), d.current = !0);
2175
866
  }),
2176
- onPointerLeave: Y(e.onPointerLeave, () => {
2177
- o.onTriggerLeave(), u.current = !1;
867
+ onPointerLeave: A(e.onPointerLeave, () => {
868
+ r.onTriggerLeave(), d.current = !1;
2178
869
  }),
2179
- onPointerDown: Y(e.onPointerDown, () => {
2180
- f.current = !0, document.addEventListener("pointerup", p, { once: !0 });
870
+ onPointerDown: A(e.onPointerDown, () => {
871
+ u.current = !0, document.addEventListener("pointerup", m, { once: !0 });
2181
872
  }),
2182
- onFocus: Y(e.onFocus, () => {
2183
- f.current || o.onOpen();
873
+ onFocus: A(e.onFocus, () => {
874
+ u.current || r.onOpen();
2184
875
  }),
2185
- onBlur: Y(e.onBlur, o.onClose),
2186
- onClick: Y(e.onClick, o.onClose)
876
+ onBlur: A(e.onBlur, r.onClose),
877
+ onClick: A(e.onClick, r.onClose)
2187
878
  }
2188
879
  ) });
2189
880
  }
2190
881
  );
2191
- on.displayName = Ie;
2192
- var Co = "TooltipPortal", [Bo, Eo] = Pe(Co, {
882
+ Ze.displayName = K;
883
+ var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
2193
884
  forceMount: void 0
2194
- }), te = "TooltipContent", sn = c.forwardRef(
885
+ }), N = "TooltipContent", qe = s.forwardRef(
2195
886
  (e, t) => {
2196
- const n = Eo(te, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...i } = e, s = Oe(te, e.__scopeTooltip);
2197
- return /* @__PURE__ */ b(Jt, { present: r || s.open, children: s.disableHoverableContent ? /* @__PURE__ */ b(cn, { side: o, ...i, ref: t }) : /* @__PURE__ */ b(Po, { side: o, ...i, ref: t }) });
887
+ const n = An(N, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, a = j(N, e.__scopeTooltip);
888
+ return /* @__PURE__ */ f(Ue, { present: o || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ f(Ke, { side: r, ...i, ref: t }) : /* @__PURE__ */ f(Tn, { side: r, ...i, ref: t }) });
2198
889
  }
2199
- ), Po = c.forwardRef((e, t) => {
2200
- const n = Oe(te, e.__scopeTooltip), r = Ze(te, e.__scopeTooltip), o = c.useRef(null), i = le(t, o), [s, l] = c.useState(null), { trigger: a, onClose: f } = n, u = o.current, { onPointerInTransitChange: p } = r, m = c.useCallback(() => {
2201
- l(null), p(!1);
2202
- }, [p]), d = c.useCallback(
2203
- (h, g) => {
2204
- const y = h.currentTarget, w = { x: h.clientX, y: h.clientY }, v = To(w, y.getBoundingClientRect()), E = So(w, v), x = No(g.getBoundingClientRect()), C = Lo([...E, ...x]);
2205
- l(C), p(!0);
890
+ ), Tn = s.forwardRef((e, t) => {
891
+ const n = j(N, e.__scopeTooltip), o = ne(N, e.__scopeTooltip), r = s.useRef(null), i = _(t, r), [a, c] = s.useState(null), { trigger: l, onClose: u } = n, d = r.current, { onPointerInTransitChange: m } = o, h = s.useCallback(() => {
892
+ c(null), m(!1);
893
+ }, [m]), p = s.useCallback(
894
+ (v, y) => {
895
+ const w = v.currentTarget, E = { x: v.clientX, y: v.clientY }, C = Dn(E, w.getBoundingClientRect()), x = _n(E, C), P = Ln(y.getBoundingClientRect()), R = Mn([...x, ...P]);
896
+ c(R), m(!0);
2206
897
  },
2207
- [p]
898
+ [m]
2208
899
  );
2209
- return c.useEffect(() => () => m(), [m]), c.useEffect(() => {
2210
- if (a && u) {
2211
- const h = (y) => d(y, u), g = (y) => d(y, a);
2212
- return a.addEventListener("pointerleave", h), u.addEventListener("pointerleave", g), () => {
2213
- a.removeEventListener("pointerleave", h), u.removeEventListener("pointerleave", g);
900
+ return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
901
+ if (l && d) {
902
+ const v = (w) => p(w, d), y = (w) => p(w, l);
903
+ return l.addEventListener("pointerleave", v), d.addEventListener("pointerleave", y), () => {
904
+ l.removeEventListener("pointerleave", v), d.removeEventListener("pointerleave", y);
2214
905
  };
2215
906
  }
2216
- }, [a, u, d, m]), c.useEffect(() => {
2217
- if (s) {
2218
- const h = (g) => {
2219
- const y = g.target, w = { x: g.clientX, y: g.clientY }, v = (a == null ? void 0 : a.contains(y)) || (u == null ? void 0 : u.contains(y)), E = !Do(w, s);
2220
- v ? m() : E && (m(), f());
907
+ }, [l, d, p, h]), s.useEffect(() => {
908
+ if (a) {
909
+ const v = (y) => {
910
+ const w = y.target, E = { x: y.clientX, y: y.clientY }, C = (l == null ? void 0 : l.contains(w)) || (d == null ? void 0 : d.contains(w)), x = !$n(E, a);
911
+ C ? h() : x && (h(), u());
2221
912
  };
2222
- return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
913
+ return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
2223
914
  }
2224
- }, [a, u, s, f, m]), /* @__PURE__ */ b(cn, { ...e, ref: i });
2225
- }), [Ro, Ao] = Pe(Ae, { isInside: !1 }), cn = c.forwardRef(
915
+ }, [l, d, a, u, h]), /* @__PURE__ */ f(Ke, { ...e, ref: i });
916
+ }), [On, Nn] = V(U, { isInside: !1 }), Ke = s.forwardRef(
2226
917
  (e, t) => {
2227
918
  const {
2228
919
  __scopeTooltip: n,
2229
- children: r,
2230
- "aria-label": o,
920
+ children: o,
921
+ "aria-label": r,
2231
922
  onEscapeKeyDown: i,
2232
- onPointerDownOutside: s,
2233
- ...l
2234
- } = e, a = Oe(te, n), f = Re(n), { onClose: u } = a;
2235
- return c.useEffect(() => (document.addEventListener(Fe, u), () => document.removeEventListener(Fe, u)), [u]), c.useEffect(() => {
2236
- if (a.trigger) {
2237
- const p = (m) => {
2238
- const d = m.target;
2239
- d != null && d.contains(a.trigger) && u();
923
+ onPointerDownOutside: a,
924
+ ...c
925
+ } = e, l = j(N, n), u = B(n), { onClose: d } = l;
926
+ return s.useEffect(() => (document.addEventListener(q, d), () => document.removeEventListener(q, d)), [d]), s.useEffect(() => {
927
+ if (l.trigger) {
928
+ const m = (h) => {
929
+ const p = h.target;
930
+ p != null && p.contains(l.trigger) && d();
2240
931
  };
2241
- return window.addEventListener("scroll", p, { capture: !0 }), () => window.removeEventListener("scroll", p, { capture: !0 });
932
+ return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
2242
933
  }
2243
- }, [a.trigger, u]), /* @__PURE__ */ b(
2244
- Rt,
934
+ }, [l.trigger, d]), /* @__PURE__ */ f(
935
+ Re,
2245
936
  {
2246
937
  asChild: !0,
2247
938
  disableOutsidePointerEvents: !1,
2248
939
  onEscapeKeyDown: i,
2249
- onPointerDownOutside: s,
2250
- onFocusOutside: (p) => p.preventDefault(),
2251
- onDismiss: u,
2252
- children: /* @__PURE__ */ wt(
2253
- oo,
940
+ onPointerDownOutside: a,
941
+ onFocusOutside: (m) => m.preventDefault(),
942
+ onDismiss: d,
943
+ children: /* @__PURE__ */ we(
944
+ ln,
2254
945
  {
2255
- "data-state": a.stateAttribute,
2256
- ...f,
2257
- ...l,
946
+ "data-state": l.stateAttribute,
947
+ ...u,
948
+ ...c,
2258
949
  ref: t,
2259
950
  style: {
2260
- ...l.style,
951
+ ...c.style,
2261
952
  "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
2262
953
  "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
2263
954
  "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
@@ -2265,8 +956,8 @@ var Co = "TooltipPortal", [Bo, Eo] = Pe(Co, {
2265
956
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
2266
957
  },
2267
958
  children: [
2268
- /* @__PURE__ */ b(Et, { children: r }),
2269
- /* @__PURE__ */ b(Ro, { scope: n, isInside: !0, children: /* @__PURE__ */ b(wo, { id: a.contentId, role: "tooltip", children: o || r }) })
959
+ /* @__PURE__ */ f(be, { children: o }),
960
+ /* @__PURE__ */ f(On, { scope: n, isInside: !0, children: /* @__PURE__ */ f(En, { id: l.contentId, role: "tooltip", children: r || o }) })
2270
961
  ]
2271
962
  }
2272
963
  )
@@ -2274,124 +965,124 @@ var Co = "TooltipPortal", [Bo, Eo] = Pe(Co, {
2274
965
  );
2275
966
  }
2276
967
  );
2277
- sn.displayName = te;
2278
- var ln = "TooltipArrow", Oo = c.forwardRef(
968
+ qe.displayName = N;
969
+ var Je = "TooltipArrow", Sn = s.forwardRef(
2279
970
  (e, t) => {
2280
- const { __scopeTooltip: n, ...r } = e, o = Re(n);
2281
- return Ao(
2282
- ln,
971
+ const { __scopeTooltip: n, ...o } = e, r = B(n);
972
+ return Nn(
973
+ Je,
2283
974
  n
2284
- ).isInside ? null : /* @__PURE__ */ b(io, { ...o, ...r, ref: t });
975
+ ).isInside ? null : /* @__PURE__ */ f(cn, { ...r, ...o, ref: t });
2285
976
  }
2286
977
  );
2287
- Oo.displayName = ln;
2288
- function To(e, t) {
2289
- const n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
2290
- switch (Math.min(n, r, o, i)) {
978
+ Sn.displayName = Je;
979
+ function Dn(e, t) {
980
+ const n = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), r = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
981
+ switch (Math.min(n, o, r, i)) {
2291
982
  case i:
2292
983
  return "left";
2293
- case o:
984
+ case r:
2294
985
  return "right";
2295
986
  case n:
2296
987
  return "top";
2297
- case r:
988
+ case o:
2298
989
  return "bottom";
2299
990
  default:
2300
991
  throw new Error("unreachable");
2301
992
  }
2302
993
  }
2303
- function So(e, t, n = 5) {
2304
- const r = [];
994
+ function _n(e, t, n = 5) {
995
+ const o = [];
2305
996
  switch (t) {
2306
997
  case "top":
2307
- r.push(
998
+ o.push(
2308
999
  { x: e.x - n, y: e.y + n },
2309
1000
  { x: e.x + n, y: e.y + n }
2310
1001
  );
2311
1002
  break;
2312
1003
  case "bottom":
2313
- r.push(
1004
+ o.push(
2314
1005
  { x: e.x - n, y: e.y - n },
2315
1006
  { x: e.x + n, y: e.y - n }
2316
1007
  );
2317
1008
  break;
2318
1009
  case "left":
2319
- r.push(
1010
+ o.push(
2320
1011
  { x: e.x + n, y: e.y - n },
2321
1012
  { x: e.x + n, y: e.y + n }
2322
1013
  );
2323
1014
  break;
2324
1015
  case "right":
2325
- r.push(
1016
+ o.push(
2326
1017
  { x: e.x - n, y: e.y - n },
2327
1018
  { x: e.x - n, y: e.y + n }
2328
1019
  );
2329
1020
  break;
2330
1021
  }
2331
- return r;
1022
+ return o;
2332
1023
  }
2333
- function No(e) {
2334
- const { top: t, right: n, bottom: r, left: o } = e;
1024
+ function Ln(e) {
1025
+ const { top: t, right: n, bottom: o, left: r } = e;
2335
1026
  return [
2336
- { x: o, y: t },
1027
+ { x: r, y: t },
2337
1028
  { x: n, y: t },
2338
- { x: n, y: r },
2339
- { x: o, y: r }
1029
+ { x: n, y: o },
1030
+ { x: r, y: o }
2340
1031
  ];
2341
1032
  }
2342
- function Do(e, t) {
2343
- const { x: n, y: r } = e;
2344
- let o = !1;
2345
- for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
2346
- const l = t[i].x, a = t[i].y, f = t[s].x, u = t[s].y;
2347
- a > r != u > r && n < (f - l) * (r - a) / (u - a) + l && (o = !o);
1033
+ function $n(e, t) {
1034
+ const { x: n, y: o } = e;
1035
+ let r = !1;
1036
+ for (let i = 0, a = t.length - 1; i < t.length; a = i++) {
1037
+ const c = t[i].x, l = t[i].y, u = t[a].x, d = t[a].y;
1038
+ l > o != d > o && n < (u - c) * (o - l) / (d - l) + c && (r = !r);
2348
1039
  }
2349
- return o;
1040
+ return r;
2350
1041
  }
2351
- function Lo(e) {
1042
+ function Mn(e) {
2352
1043
  const t = e.slice();
2353
- return t.sort((n, r) => n.x < r.x ? -1 : n.x > r.x ? 1 : n.y < r.y ? -1 : n.y > r.y ? 1 : 0), Mo(t);
1044
+ return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), In(t);
2354
1045
  }
2355
- function Mo(e) {
1046
+ function In(e) {
2356
1047
  if (e.length <= 1)
2357
1048
  return e.slice();
2358
1049
  const t = [];
2359
- for (let r = 0; r < e.length; r++) {
2360
- const o = e[r];
1050
+ for (let o = 0; o < e.length; o++) {
1051
+ const r = e[o];
2361
1052
  for (; t.length >= 2; ) {
2362
- const i = t[t.length - 1], s = t[t.length - 2];
2363
- if ((i.x - s.x) * (o.y - s.y) >= (i.y - s.y) * (o.x - s.x))
1053
+ const i = t[t.length - 1], a = t[t.length - 2];
1054
+ if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
2364
1055
  t.pop();
2365
1056
  else
2366
1057
  break;
2367
1058
  }
2368
- t.push(o);
1059
+ t.push(r);
2369
1060
  }
2370
1061
  t.pop();
2371
1062
  const n = [];
2372
- for (let r = e.length - 1; r >= 0; r--) {
2373
- const o = e[r];
1063
+ for (let o = e.length - 1; o >= 0; o--) {
1064
+ const r = e[o];
2374
1065
  for (; n.length >= 2; ) {
2375
- const i = n[n.length - 1], s = n[n.length - 2];
2376
- if ((i.x - s.x) * (o.y - s.y) >= (i.y - s.y) * (o.x - s.x))
1066
+ const i = n[n.length - 1], a = n[n.length - 2];
1067
+ if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
2377
1068
  n.pop();
2378
1069
  else
2379
1070
  break;
2380
1071
  }
2381
- n.push(o);
1072
+ n.push(r);
2382
1073
  }
2383
1074
  return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
2384
1075
  }
2385
- const $o = "_tooltipContent_svqcc_1", _o = "_fadeIn_svqcc_1", ko = {
2386
- tooltipContent: $o,
2387
- fadeIn: _o
2388
- }, Wo = xn(
2389
- ({ children: e, content: t, className: n }, r) => /* @__PURE__ */ b(nn, { children: /* @__PURE__ */ wt(rn, { delayDuration: 1e3, children: [
2390
- /* @__PURE__ */ b(on, { asChild: !0, children: /* @__PURE__ */ b("div", { ref: r, className: n, children: e }) }),
2391
- /* @__PURE__ */ b(sn, { className: ko.tooltipContent, sideOffset: -10, children: /* @__PURE__ */ b("p", { children: t }) })
1076
+ const Wn = "_tooltipContent_svqcc_1", kn = "_fadeIn_svqcc_1", Hn = {
1077
+ tooltipContent: Wn,
1078
+ fadeIn: kn
1079
+ }, Fn = ft(
1080
+ ({ children: e, content: t, className: n }, o) => /* @__PURE__ */ f(Xe, { children: /* @__PURE__ */ we(ze, { delayDuration: 1e3, children: [
1081
+ /* @__PURE__ */ f(Ze, { asChild: !0, children: /* @__PURE__ */ f("div", { ref: o, className: n, children: e }) }),
1082
+ /* @__PURE__ */ f(qe, { className: Hn.tooltipContent, sideOffset: -10, children: /* @__PURE__ */ f("p", { children: t }) })
2392
1083
  ] }) })
2393
1084
  );
2394
- Wo.displayName = "RPTooltip";
1085
+ Fn.displayName = "RPTooltip";
2395
1086
  export {
2396
- Wo as default
1087
+ Fn as default
2397
1088
  };