@pdf-viewer/react 0.4.0-beta.2 → 0.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/Container-337e1b18.js +37 -0
  2. package/dist/{RPLayout-608b83dd.js → RPLayout-88110444.js} +942 -941
  3. package/dist/assets/Container.css +1 -1
  4. package/dist/assets/RPLayout.css +1 -1
  5. package/dist/assets/RPTooltip.css +1 -0
  6. package/dist/components/RPController.js +1 -1
  7. package/dist/components/RPViewer.js +1 -1
  8. package/dist/components/layout/Container.js +1 -1
  9. package/dist/components/layout/RPLayout.js +2 -2
  10. package/dist/components/layout/sidebar/RPSidebar.js +3 -2
  11. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  12. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  13. package/dist/components/layout/toolbar/DarkModeTool.js +13 -12
  14. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  15. package/dist/components/layout/toolbar/DocumentProperties.js +7 -6
  16. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -2
  17. package/dist/components/layout/toolbar/FileUploadTool.js +16 -15
  18. package/dist/components/layout/toolbar/FullScreenTool.js +30 -32
  19. package/dist/components/layout/toolbar/MostPageTool.js +3 -2
  20. package/dist/components/layout/toolbar/OtherTool.js +3 -2
  21. package/dist/components/layout/toolbar/Paginate.js +3 -2
  22. package/dist/components/layout/toolbar/PrintTool.js +3 -2
  23. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  24. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  25. package/dist/components/layout/toolbar/RotateTool.js +24 -23
  26. package/dist/components/layout/toolbar/ScrollModeTool.js +34 -33
  27. package/dist/components/layout/toolbar/SearchTool.js +3 -2
  28. package/dist/components/layout/toolbar/SelectionModeTool.js +27 -26
  29. package/dist/components/layout/toolbar/ZoomTool.js +3 -2
  30. package/dist/components/page/AnnotationLayer.js +1 -1
  31. package/dist/components/page/CanvasLayer.js +1 -1
  32. package/dist/components/page/DualPage.js +1 -1
  33. package/dist/components/page/RPPage.js +1 -1
  34. package/dist/components/page/SinglePage.js +1 -1
  35. package/dist/components/page/TextLayer.js +1 -1
  36. package/dist/components/ui/Checkbox.js +130 -242
  37. package/dist/components/ui/LoadingIndicator.js +1 -1
  38. package/dist/components/ui/RPTooltip.js +2397 -0
  39. package/dist/contexts/PaginateContext.js +1 -1
  40. package/dist/contexts/PrintContext.js +1 -1
  41. package/dist/contexts/SearchContext.js +1 -1
  42. package/dist/contexts/ThumbnailsContext.js +1 -1
  43. package/dist/index-2b077daa.js +122 -0
  44. package/dist/main.js +1 -1
  45. package/dist/types/components/ui/RPTooltip.d.ts +8 -0
  46. package/dist/utils/hooks/useFileDownload.js +1 -1
  47. package/dist/utils/hooks/useLicense.js +1 -1
  48. package/dist/utils/hooks/usePaginate.js +1 -1
  49. package/dist/utils/hooks/usePrint.js +1 -1
  50. package/dist/utils/hooks/useScrollToPage.js +1 -1
  51. package/dist/utils/hooks/useSearch.js +1 -1
  52. package/dist/utils/hooks/useThumbnail.js +1 -1
  53. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  54. package/package.json +2 -1
  55. package/dist/Container-cea98fc1.js +0 -37
@@ -0,0 +1,2397 @@
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);
10
+ };
11
+ }
12
+ function ot(e, t) {
13
+ if (typeof e == "function")
14
+ return e(t);
15
+ e != null && (e.current = t);
16
+ }
17
+ function bt(...e) {
18
+ return (t) => {
19
+ let n = !1;
20
+ const r = e.map((o) => {
21
+ const i = ot(o, t);
22
+ return !n && typeof i == "function" && (n = !0), i;
23
+ });
24
+ if (n)
25
+ return () => {
26
+ for (let o = 0; o < r.length; o++) {
27
+ const i = r[o];
28
+ typeof i == "function" ? i() : ot(e[o], null);
29
+ }
30
+ };
31
+ };
32
+ }
33
+ function le(...e) {
34
+ return c.useCallback(bt(...e), e);
35
+ }
36
+ var Ct = c.forwardRef((e, t) => {
37
+ const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(En);
38
+ 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 });
41
+ }
42
+ return /* @__PURE__ */ b(Ne, { ...r, ref: t, children: n });
43
+ });
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);
50
+ }
51
+ return c.Children.count(n) > 1 ? c.Children.only(null) : null;
52
+ });
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;
57
+ }
58
+ function Pn(e, t) {
59
+ 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(" "));
65
+ }
66
+ return { ...e, ...n };
67
+ }
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);
72
+ }
73
+ var An = [
74
+ "a",
75
+ "button",
76
+ "div",
77
+ "form",
78
+ "h2",
79
+ "h3",
80
+ "img",
81
+ "input",
82
+ "label",
83
+ "li",
84
+ "nav",
85
+ "ol",
86
+ "p",
87
+ "span",
88
+ "svg",
89
+ "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 });
94
+ });
95
+ return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
96
+ }, {});
97
+ function On(e, t) {
98
+ e && xt.flushSync(() => e.dispatchEvent(t));
99
+ }
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({
110
+ layers: /* @__PURE__ */ new Set(),
111
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
112
+ branches: /* @__PURE__ */ new Set()
113
+ }), Rt = c.forwardRef(
114
+ (e, t) => {
115
+ const {
116
+ disableOutsidePointerEvents: n = !1,
117
+ onEscapeKeyDown: r,
118
+ onPointerDownOutside: o,
119
+ 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);
136
+ };
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,
144
+ {
145
+ ...a,
146
+ ref: h,
147
+ style: {
148
+ pointerEvents: E ? x ? "auto" : "none" : void 0,
149
+ ...e.style
150
+ },
151
+ onFocusCapture: Y(e.onFocusCapture, R.onFocusCapture),
152
+ onBlurCapture: Y(e.onBlurCapture, R.onBlurCapture),
153
+ onPointerDownCapture: Y(
154
+ e.onPointerDownCapture,
155
+ C.onPointerDownCapture
156
+ )
157
+ }
158
+ );
159
+ }
160
+ );
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;
166
+ if (i)
167
+ return n.branches.add(i), () => {
168
+ n.branches.delete(i);
169
+ };
170
+ }, [n.branches]), /* @__PURE__ */ b(He.div, { ...e, ref: o });
171
+ });
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(() => {
175
+ });
176
+ return c.useEffect(() => {
177
+ const i = (l) => {
178
+ if (l.target && !r.current) {
179
+ let a = function() {
180
+ At(
181
+ Nn,
182
+ n,
183
+ f,
184
+ { discrete: !0 }
185
+ );
186
+ };
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();
189
+ } else
190
+ t.removeEventListener("click", o.current);
191
+ r.current = !1;
192
+ }, s = window.setTimeout(() => {
193
+ t.addEventListener("pointerdown", i);
194
+ }, 0);
195
+ return () => {
196
+ window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
197
+ };
198
+ }, [t, n]), {
199
+ // ensures we check React component tree (not just DOM tree)
200
+ onPointerDownCapture: () => r.current = !0
201
+ };
202
+ }
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 }, {
208
+ discrete: !1
209
+ });
210
+ };
211
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
212
+ }, [t, n]), {
213
+ onFocusCapture: () => r.current = !0,
214
+ onBlurCapture: () => r.current = !1
215
+ };
216
+ }
217
+ function st() {
218
+ const e = new CustomEvent(De);
219
+ document.dispatchEvent(e);
220
+ }
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;
859
+ }
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) {
1527
+ if (typeof e == "function")
1528
+ return e(t);
1529
+ e != null && (e.current = t);
1530
+ }
1531
+ function kr(...e) {
1532
+ return (t) => {
1533
+ let n = !1;
1534
+ const r = e.map((o) => {
1535
+ const i = ht(o, t);
1536
+ return !n && typeof i == "function" && (n = !0), i;
1537
+ });
1538
+ if (n)
1539
+ return () => {
1540
+ for (let o = 0; o < r.length; o++) {
1541
+ const i = r[o];
1542
+ typeof i == "function" ? i() : ht(e[o], null);
1543
+ }
1544
+ };
1545
+ };
1546
+ }
1547
+ var kt = c.forwardRef((e, t) => {
1548
+ const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(Fr);
1549
+ 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 });
1552
+ }
1553
+ return /* @__PURE__ */ b(_e, { ...r, ref: t, children: n });
1554
+ });
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);
1561
+ }
1562
+ return c.Children.count(n) > 1 ? c.Children.only(null) : null;
1563
+ });
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;
1568
+ }
1569
+ function Ir(e, t) {
1570
+ 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(" "));
1576
+ }
1577
+ return { ...e, ...n };
1578
+ }
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);
1583
+ }
1584
+ var Vr = [
1585
+ "a",
1586
+ "button",
1587
+ "div",
1588
+ "form",
1589
+ "h2",
1590
+ "h3",
1591
+ "img",
1592
+ "input",
1593
+ "label",
1594
+ "li",
1595
+ "nav",
1596
+ "ol",
1597
+ "p",
1598
+ "span",
1599
+ "svg",
1600
+ "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 });
1605
+ });
1606
+ 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,
1611
+ {
1612
+ ...i,
1613
+ ref: t,
1614
+ width: r,
1615
+ height: o,
1616
+ viewBox: "0 0 30 10",
1617
+ preserveAspectRatio: "none",
1618
+ children: e.asChild ? n : /* @__PURE__ */ b("polygon", { points: "0,0 30,0 15,10" })
1619
+ }
1620
+ );
1621
+ });
1622
+ Wt.displayName = jr;
1623
+ var Ur = Wt;
1624
+ function gt(e, t) {
1625
+ if (typeof e == "function")
1626
+ return e(t);
1627
+ e != null && (e.current = t);
1628
+ }
1629
+ function Ft(...e) {
1630
+ return (t) => {
1631
+ let n = !1;
1632
+ const r = e.map((o) => {
1633
+ const i = gt(o, t);
1634
+ return !n && typeof i == "function" && (n = !0), i;
1635
+ });
1636
+ if (n)
1637
+ return () => {
1638
+ for (let o = 0; o < r.length; o++) {
1639
+ const i = r[o];
1640
+ typeof i == "function" ? i() : gt(e[o], null);
1641
+ }
1642
+ };
1643
+ };
1644
+ }
1645
+ function It(...e) {
1646
+ return c.useCallback(Ft(...e), e);
1647
+ }
1648
+ var Ht = c.forwardRef((e, t) => {
1649
+ const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(Yr);
1650
+ 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 });
1653
+ }
1654
+ return /* @__PURE__ */ b(ke, { ...r, ref: t, children: n });
1655
+ });
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);
1662
+ }
1663
+ return c.Children.count(n) > 1 ? c.Children.only(null) : null;
1664
+ });
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;
1669
+ }
1670
+ function Xr(e, t) {
1671
+ 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(" "));
1677
+ }
1678
+ return { ...e, ...n };
1679
+ }
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);
1684
+ }
1685
+ var qr = [
1686
+ "a",
1687
+ "button",
1688
+ "div",
1689
+ "form",
1690
+ "h2",
1691
+ "h3",
1692
+ "img",
1693
+ "input",
1694
+ "label",
1695
+ "li",
1696
+ "nav",
1697
+ "ol",
1698
+ "p",
1699
+ "span",
1700
+ "svg",
1701
+ "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 });
1706
+ });
1707
+ 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 });
1711
+ };
1712
+ zt.displayName = Ge;
1713
+ var Yt = "PopperAnchor", Xt = c.forwardRef(
1714
+ (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 });
1719
+ }
1720
+ );
1721
+ Xt.displayName = Yt;
1722
+ var qe = "PopperContent", [Kr, Jr] = Bt(qe), Gt = c.forwardRef(
1723
+ (e, t) => {
1724
+ var Ke, Je, Qe, et, tt, nt;
1725
+ const {
1726
+ __scopePopper: n,
1727
+ side: r = "bottom",
1728
+ sideOffset: o = 0,
1729
+ 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),
1743
+ // 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({
1746
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1747
+ strategy: "fixed",
1748
+ placement: M,
1749
+ whileElementsMounted: (...oe) => vr(...oe, {
1750
+ animationFrame: d === "always"
1751
+ }),
1752
+ elements: {
1753
+ reference: y.anchor
1754
+ },
1755
+ middleware: [
1756
+ Sr({ mainAxis: o + O, alignmentAxis: s }),
1757
+ a && Nr({
1758
+ mainAxis: !0,
1759
+ crossAxis: !1,
1760
+ limiter: p === "partial" ? Dr() : void 0,
1761
+ ...N
1762
+ }),
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`);
1769
+ }
1770
+ }),
1771
+ x && _r({ element: x, padding: l }),
1772
+ to({ arrowWidth: P, arrowHeight: O }),
1773
+ m && $r({ strategy: "referenceHidden", ...N })
1774
+ ]
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(
1783
+ "div",
1784
+ {
1785
+ ref: S.setFloating,
1786
+ "data-radix-popper-content-wrapper": "",
1787
+ style: {
1788
+ ...I,
1789
+ transform: L ? I.transform : "translate(0, -200%)",
1790
+ // keep off the page when measuring
1791
+ minWidth: "max-content",
1792
+ zIndex: dn,
1793
+ "--radix-popper-transform-origin": [
1794
+ (et = A.transformOrigin) == null ? void 0 : et.x,
1795
+ (tt = A.transformOrigin) == null ? void 0 : tt.y
1796
+ ].join(" "),
1797
+ // hide the content if using the hide middleware and should be hidden
1798
+ // set visibility to hidden and disable pointer events so the UI behaves
1799
+ // as if the PopperContent isn't there at all
1800
+ ...((nt = A.hide) == null ? void 0 : nt.referenceHidden) && {
1801
+ visibility: "hidden",
1802
+ pointerEvents: "none"
1803
+ }
1804
+ },
1805
+ dir: e.dir,
1806
+ children: /* @__PURE__ */ b(
1807
+ Kr,
1808
+ {
1809
+ scope: n,
1810
+ placedSide: $,
1811
+ onArrowChange: C,
1812
+ arrowX: an,
1813
+ arrowY: fn,
1814
+ shouldHideArrow: un,
1815
+ children: /* @__PURE__ */ b(
1816
+ Vt.div,
1817
+ {
1818
+ "data-side": $,
1819
+ "data-align": B,
1820
+ ...g,
1821
+ ref: E,
1822
+ style: {
1823
+ ...g.style,
1824
+ // if the PopperContent hasn't been placed yet (not all measurements done)
1825
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
1826
+ animation: L ? void 0 : "none"
1827
+ }
1828
+ }
1829
+ )
1830
+ }
1831
+ )
1832
+ }
1833
+ );
1834
+ }
1835
+ );
1836
+ Gt.displayName = qe;
1837
+ var qt = "PopperArrow", Qr = {
1838
+ top: "bottom",
1839
+ right: "left",
1840
+ bottom: "top",
1841
+ left: "right"
1842
+ }, Zt = c.forwardRef(function(t, n) {
1843
+ const { __scopePopper: r, ...o } = t, i = Jr(qt, r), s = Qr[i.placedSide];
1844
+ return (
1845
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1846
+ // doesn't report size as we'd expect on SVG elements.
1847
+ // it reports their bounding box which is effectively the largest path inside the SVG.
1848
+ /* @__PURE__ */ b(
1849
+ "span",
1850
+ {
1851
+ ref: i.onArrowChange,
1852
+ style: {
1853
+ position: "absolute",
1854
+ left: i.arrowX,
1855
+ top: i.arrowY,
1856
+ [s]: 0,
1857
+ transformOrigin: {
1858
+ top: "",
1859
+ right: "0 0",
1860
+ bottom: "center 0",
1861
+ left: "100% 0"
1862
+ }[i.placedSide],
1863
+ transform: {
1864
+ top: "translateY(100%)",
1865
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
1866
+ bottom: "rotate(180deg)",
1867
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
1868
+ }[i.placedSide],
1869
+ visibility: i.shouldHideArrow ? "hidden" : void 0
1870
+ },
1871
+ children: /* @__PURE__ */ b(
1872
+ Ur,
1873
+ {
1874
+ ...o,
1875
+ ref: n,
1876
+ style: {
1877
+ ...o.style,
1878
+ // ensures the element can be measured correctly (mostly for if SVG)
1879
+ display: "block"
1880
+ }
1881
+ }
1882
+ )
1883
+ }
1884
+ )
1885
+ );
1886
+ });
1887
+ Zt.displayName = qt;
1888
+ function eo(e) {
1889
+ return e !== null;
1890
+ }
1891
+ var to = (e) => ({
1892
+ name: "transformOrigin",
1893
+ options: e,
1894
+ 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 } };
1899
+ }
1900
+ });
1901
+ function Kt(e) {
1902
+ const [t, n = "center"] = e.split("-");
1903
+ return [t, n];
1904
+ }
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);
1908
+ }
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;
1912
+ };
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, {
1916
+ mounted: {
1917
+ UNMOUNT: "unmounted",
1918
+ ANIMATION_OUT: "unmountSuspended"
1919
+ },
1920
+ unmountSuspended: {
1921
+ MOUNT: "mounted",
1922
+ ANIMATION_END: "unmounted"
1923
+ },
1924
+ unmounted: {
1925
+ MOUNT: "mounted"
1926
+ }
1927
+ });
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;
1936
+ }
1937
+ }, [e, a]), ie(() => {
1938
+ 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);
1946
+ });
1947
+ }
1948
+ }, m = (d) => {
1949
+ d.target === t && (i.current = pe(r.current));
1950
+ };
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);
1953
+ };
1954
+ } 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);
1960
+ }, [])
1961
+ };
1962
+ }
1963
+ function pe(e) {
1964
+ return (e == null ? void 0 : e.animationName) || "none";
1965
+ }
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);
1970
+ }
1971
+ function yt(e, t) {
1972
+ if (typeof e == "function")
1973
+ return e(t);
1974
+ e != null && (e.current = t);
1975
+ }
1976
+ function ao(...e) {
1977
+ return (t) => {
1978
+ let n = !1;
1979
+ const r = e.map((o) => {
1980
+ const i = yt(o, t);
1981
+ return !n && typeof i == "function" && (n = !0), i;
1982
+ });
1983
+ if (n)
1984
+ return () => {
1985
+ for (let o = 0; o < r.length; o++) {
1986
+ const i = r[o];
1987
+ typeof i == "function" ? i() : yt(e[o], null);
1988
+ }
1989
+ };
1990
+ };
1991
+ }
1992
+ var Qt = c.forwardRef((e, t) => {
1993
+ const { children: n, ...r } = e, o = c.Children.toArray(n), i = o.find(uo);
1994
+ 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 });
1997
+ }
1998
+ return /* @__PURE__ */ b(We, { ...r, ref: t, children: n });
1999
+ });
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);
2006
+ }
2007
+ return c.Children.count(n) > 1 ? c.Children.only(null) : null;
2008
+ });
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;
2013
+ }
2014
+ function po(e, t) {
2015
+ 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(" "));
2021
+ }
2022
+ return { ...e, ...n };
2023
+ }
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);
2028
+ }
2029
+ var ho = [
2030
+ "a",
2031
+ "button",
2032
+ "div",
2033
+ "form",
2034
+ "h2",
2035
+ "h3",
2036
+ "img",
2037
+ "input",
2038
+ "label",
2039
+ "li",
2040
+ "nav",
2041
+ "ol",
2042
+ "p",
2043
+ "span",
2044
+ "svg",
2045
+ "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 });
2050
+ });
2051
+ return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
2052
+ }, {}), yo = "VisuallyHidden", en = c.forwardRef(
2053
+ (e, t) => /* @__PURE__ */ b(
2054
+ go.span,
2055
+ {
2056
+ ...e,
2057
+ ref: t,
2058
+ style: {
2059
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
2060
+ position: "absolute",
2061
+ border: 0,
2062
+ width: 1,
2063
+ height: 1,
2064
+ padding: 0,
2065
+ margin: -1,
2066
+ overflow: "hidden",
2067
+ clip: "rect(0, 0, 0, 0)",
2068
+ whiteSpace: "nowrap",
2069
+ wordWrap: "normal",
2070
+ ...e.style
2071
+ }
2072
+ }
2073
+ )
2074
+ );
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) => {
2079
+ const {
2080
+ __scopeTooltip: t,
2081
+ delayDuration: n = vo,
2082
+ skipDelayDuration: r = 300,
2083
+ disableHoverableContent: o = !1,
2084
+ 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,
2091
+ {
2092
+ scope: t,
2093
+ isOpenDelayed: s,
2094
+ delayDuration: n,
2095
+ onOpen: c.useCallback(() => {
2096
+ window.clearTimeout(f.current), l(!1);
2097
+ }, []),
2098
+ onClose: c.useCallback(() => {
2099
+ window.clearTimeout(f.current), f.current = window.setTimeout(
2100
+ () => l(!0),
2101
+ r
2102
+ );
2103
+ }, [r]),
2104
+ isPointerInTransitRef: a,
2105
+ onPointerInTransitChange: c.useCallback((u) => {
2106
+ a.current = u;
2107
+ }, []),
2108
+ disableHoverableContent: o,
2109
+ children: i
2110
+ }
2111
+ );
2112
+ };
2113
+ nn.displayName = tn;
2114
+ var Ae = "Tooltip", [bo, Oe] = Pe(Ae), rn = (e) => {
2115
+ const {
2116
+ __scopeTooltip: t,
2117
+ children: n,
2118
+ open: r,
2119
+ defaultOpen: o = !1,
2120
+ 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);
2128
+ }
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,
2142
+ {
2143
+ 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,
2158
+ children: n
2159
+ }
2160
+ ) });
2161
+ };
2162
+ rn.displayName = Ae;
2163
+ var Ie = "TooltipTrigger", on = c.forwardRef(
2164
+ (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,
2168
+ {
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);
2175
+ }),
2176
+ onPointerLeave: Y(e.onPointerLeave, () => {
2177
+ o.onTriggerLeave(), u.current = !1;
2178
+ }),
2179
+ onPointerDown: Y(e.onPointerDown, () => {
2180
+ f.current = !0, document.addEventListener("pointerup", p, { once: !0 });
2181
+ }),
2182
+ onFocus: Y(e.onFocus, () => {
2183
+ f.current || o.onOpen();
2184
+ }),
2185
+ onBlur: Y(e.onBlur, o.onClose),
2186
+ onClick: Y(e.onClick, o.onClose)
2187
+ }
2188
+ ) });
2189
+ }
2190
+ );
2191
+ on.displayName = Ie;
2192
+ var Co = "TooltipPortal", [Bo, Eo] = Pe(Co, {
2193
+ forceMount: void 0
2194
+ }), te = "TooltipContent", sn = c.forwardRef(
2195
+ (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 }) });
2198
+ }
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);
2206
+ },
2207
+ [p]
2208
+ );
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);
2214
+ };
2215
+ }
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());
2221
+ };
2222
+ return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
2223
+ }
2224
+ }, [a, u, s, f, m]), /* @__PURE__ */ b(cn, { ...e, ref: i });
2225
+ }), [Ro, Ao] = Pe(Ae, { isInside: !1 }), cn = c.forwardRef(
2226
+ (e, t) => {
2227
+ const {
2228
+ __scopeTooltip: n,
2229
+ children: r,
2230
+ "aria-label": o,
2231
+ 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();
2240
+ };
2241
+ return window.addEventListener("scroll", p, { capture: !0 }), () => window.removeEventListener("scroll", p, { capture: !0 });
2242
+ }
2243
+ }, [a.trigger, u]), /* @__PURE__ */ b(
2244
+ Rt,
2245
+ {
2246
+ asChild: !0,
2247
+ disableOutsidePointerEvents: !1,
2248
+ onEscapeKeyDown: i,
2249
+ onPointerDownOutside: s,
2250
+ onFocusOutside: (p) => p.preventDefault(),
2251
+ onDismiss: u,
2252
+ children: /* @__PURE__ */ wt(
2253
+ oo,
2254
+ {
2255
+ "data-state": a.stateAttribute,
2256
+ ...f,
2257
+ ...l,
2258
+ ref: t,
2259
+ style: {
2260
+ ...l.style,
2261
+ "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
2262
+ "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
2263
+ "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
2264
+ "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
2265
+ "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
2266
+ },
2267
+ 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 }) })
2270
+ ]
2271
+ }
2272
+ )
2273
+ }
2274
+ );
2275
+ }
2276
+ );
2277
+ sn.displayName = te;
2278
+ var ln = "TooltipArrow", Oo = c.forwardRef(
2279
+ (e, t) => {
2280
+ const { __scopeTooltip: n, ...r } = e, o = Re(n);
2281
+ return Ao(
2282
+ ln,
2283
+ n
2284
+ ).isInside ? null : /* @__PURE__ */ b(io, { ...o, ...r, ref: t });
2285
+ }
2286
+ );
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)) {
2291
+ case i:
2292
+ return "left";
2293
+ case o:
2294
+ return "right";
2295
+ case n:
2296
+ return "top";
2297
+ case r:
2298
+ return "bottom";
2299
+ default:
2300
+ throw new Error("unreachable");
2301
+ }
2302
+ }
2303
+ function So(e, t, n = 5) {
2304
+ const r = [];
2305
+ switch (t) {
2306
+ case "top":
2307
+ r.push(
2308
+ { x: e.x - n, y: e.y + n },
2309
+ { x: e.x + n, y: e.y + n }
2310
+ );
2311
+ break;
2312
+ case "bottom":
2313
+ r.push(
2314
+ { x: e.x - n, y: e.y - n },
2315
+ { x: e.x + n, y: e.y - n }
2316
+ );
2317
+ break;
2318
+ case "left":
2319
+ r.push(
2320
+ { x: e.x + n, y: e.y - n },
2321
+ { x: e.x + n, y: e.y + n }
2322
+ );
2323
+ break;
2324
+ case "right":
2325
+ r.push(
2326
+ { x: e.x - n, y: e.y - n },
2327
+ { x: e.x - n, y: e.y + n }
2328
+ );
2329
+ break;
2330
+ }
2331
+ return r;
2332
+ }
2333
+ function No(e) {
2334
+ const { top: t, right: n, bottom: r, left: o } = e;
2335
+ return [
2336
+ { x: o, y: t },
2337
+ { x: n, y: t },
2338
+ { x: n, y: r },
2339
+ { x: o, y: r }
2340
+ ];
2341
+ }
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);
2348
+ }
2349
+ return o;
2350
+ }
2351
+ function Lo(e) {
2352
+ 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);
2354
+ }
2355
+ function Mo(e) {
2356
+ if (e.length <= 1)
2357
+ return e.slice();
2358
+ const t = [];
2359
+ for (let r = 0; r < e.length; r++) {
2360
+ const o = e[r];
2361
+ 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))
2364
+ t.pop();
2365
+ else
2366
+ break;
2367
+ }
2368
+ t.push(o);
2369
+ }
2370
+ t.pop();
2371
+ const n = [];
2372
+ for (let r = e.length - 1; r >= 0; r--) {
2373
+ const o = e[r];
2374
+ 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))
2377
+ n.pop();
2378
+ else
2379
+ break;
2380
+ }
2381
+ n.push(o);
2382
+ }
2383
+ 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
+ }
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 }) })
2392
+ ] }) })
2393
+ );
2394
+ Wo.displayName = "RPTooltip";
2395
+ export {
2396
+ Wo as default
2397
+ };