@pdf-viewer/react 1.16.0-beta.1 → 1.16.0-rc.1

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 (105) hide show
  1. package/dist/{ToolbarLayout.module-a4aeb4c2.js → ToolbarLayout.module-d84f99c6.js} +976 -974
  2. package/dist/components/RPController.js +4 -4
  3. package/dist/components/RPPages.js +4 -4
  4. package/dist/components/RPProvider.js +4 -4
  5. package/dist/components/layout/LayoutContainer.js +4 -4
  6. package/dist/components/layout/RPDefaultLayout.js +4 -4
  7. package/dist/components/layout/RPLayout.js +4 -4
  8. package/dist/components/layout/sidebar/RPSidebar.js +4 -4
  9. package/dist/components/layout/sidebar/Thumbnail.js +4 -4
  10. package/dist/components/layout/sidebar/Thumbnails.js +4 -4
  11. package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
  12. package/dist/components/layout/toolbar/DocumentDialog.js +4 -4
  13. package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
  14. package/dist/components/layout/toolbar/FileDownloadTool.js +4 -4
  15. package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
  16. package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
  17. package/dist/components/layout/toolbar/MenuItem.js +3 -3
  18. package/dist/components/layout/toolbar/MenuSeparator.js +3 -3
  19. package/dist/components/layout/toolbar/MostPageTool.js +4 -4
  20. package/dist/components/layout/toolbar/OtherTool.js +4 -4
  21. package/dist/components/layout/toolbar/Paginate.js +4 -4
  22. package/dist/components/layout/toolbar/PrintTool.js +4 -4
  23. package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
  24. package/dist/components/layout/toolbar/RPMoreOptions.js +4 -4
  25. package/dist/components/layout/toolbar/RPToolbar.js +4 -4
  26. package/dist/components/layout/toolbar/RPToolbarEnd.js +4 -4
  27. package/dist/components/layout/toolbar/RotateTool.js +3 -3
  28. package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
  29. package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
  30. package/dist/components/layout/toolbar/SearchResultNavigator.js +4 -4
  31. package/dist/components/layout/toolbar/SearchTool.js +4 -4
  32. package/dist/components/layout/toolbar/SelectionModeTool.js +3 -3
  33. package/dist/components/layout/toolbar/ThumbnailTool.js +4 -4
  34. package/dist/components/layout/toolbar/ToolbarCustom.js +4 -4
  35. package/dist/components/layout/toolbar/ToolbarDefault.js +4 -4
  36. package/dist/components/layout/toolbar/ToolbarLayout.js +4 -4
  37. package/dist/components/layout/toolbar/ViewModeTool.js +3 -3
  38. package/dist/components/layout/toolbar/ZoomTool.js +4 -4
  39. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +4 -4
  40. package/dist/components/layout/toolbar/tools/DualPageTool.js +4 -4
  41. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +4 -4
  42. package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
  43. package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
  44. package/dist/components/layout/toolbar/tools/InputPageTool.js +4 -4
  45. package/dist/components/layout/toolbar/tools/NextPageTool.js +4 -4
  46. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +4 -4
  47. package/dist/components/layout/toolbar/tools/PrintTool.js +4 -4
  48. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
  49. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
  50. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
  51. package/dist/components/layout/toolbar/tools/SinglePageTool.js +4 -4
  52. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
  53. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +4 -4
  54. package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
  55. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +4 -4
  56. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +4 -4
  57. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
  58. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +4 -4
  59. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +4 -4
  60. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +3 -3
  61. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +4 -4
  62. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +4 -4
  63. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +3 -3
  64. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +4 -4
  65. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +4 -4
  66. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +3 -3
  67. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
  68. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +3 -3
  69. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +3 -3
  70. package/dist/components/page/AnnotationLayer.js +4 -4
  71. package/dist/components/page/CanvasLayer.js +4 -4
  72. package/dist/components/page/DualPage.js +4 -4
  73. package/dist/components/page/RPPage.js +4 -4
  74. package/dist/components/page/SinglePage.js +4 -4
  75. package/dist/components/page/TextHighlightLayer.js +4 -4
  76. package/dist/components/page/TextLayer.js +4 -4
  77. package/dist/components/ui/Checkbox.js +1 -1
  78. package/dist/components/ui/DropDown.js +3 -3
  79. package/dist/components/ui/LoadingIndicator.js +4 -4
  80. package/dist/components/ui/RPTooltip.js +201 -415
  81. package/dist/contexts/PaginationContext.js +4 -4
  82. package/dist/contexts/PrintContext.js +4 -4
  83. package/dist/contexts/RenderQueueProvider.js +4 -4
  84. package/dist/contexts/SearchContext.js +4 -4
  85. package/dist/contexts/ThumbnailsContext.js +4 -4
  86. package/dist/index-808ea7bf.js +1685 -0
  87. package/dist/index-a48ec088.js +1672 -0
  88. package/dist/{index-35c7f4a2.js → index-c9a2990a.js} +3 -3
  89. package/dist/main.js +4 -4
  90. package/dist/types/utils/annotations.d.ts +1 -2
  91. package/dist/types/utils/link_service.d.ts +3 -1
  92. package/dist/utils/annotations.js +45 -56
  93. package/dist/utils/hooks/useFileDownload.js +4 -4
  94. package/dist/utils/hooks/useLicense.js +1 -1
  95. package/dist/utils/hooks/usePaginate.js +4 -4
  96. package/dist/utils/hooks/usePresentPage.js +4 -4
  97. package/dist/utils/hooks/usePrint.js +4 -4
  98. package/dist/utils/hooks/useScrollToPage.js +4 -4
  99. package/dist/utils/hooks/useSearch.js +4 -4
  100. package/dist/utils/hooks/useThumbnail.js +4 -4
  101. package/dist/utils/hooks/useVirtualReactWindow.js +4 -4
  102. package/dist/utils/link_service.js +40 -10
  103. package/package.json +1 -1
  104. package/dist/floating-ui.react-dom-6b2fe0df.js +0 -1474
  105. package/dist/index-f563c6f0.js +0 -1889
@@ -0,0 +1,1685 @@
1
+ import * as w from "react";
2
+ import { useLayoutEffect as ke } from "react";
3
+ import { u as mt, P as it, a as bt, g as We, h as Pt, c as $e, d as Be } from "./index-c9a2990a.js";
4
+ import { jsx as _ } from "react/jsx-runtime";
5
+ import * as _e from "react-dom";
6
+ function gt(t) {
7
+ const e = w.useRef(t);
8
+ return w.useEffect(() => {
9
+ e.current = t;
10
+ }), w.useMemo(() => (...n) => {
11
+ var o;
12
+ return (o = e.current) == null ? void 0 : o.call(e, ...n);
13
+ }, []);
14
+ }
15
+ function He(t, e = globalThis == null ? void 0 : globalThis.document) {
16
+ const n = gt(t);
17
+ w.useEffect(() => {
18
+ const o = (r) => {
19
+ r.key === "Escape" && n(r);
20
+ };
21
+ return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
22
+ }, [n, e]);
23
+ }
24
+ var Ie = "DismissableLayer", Rt = "dismissableLayer.update", Ve = "dismissableLayer.pointerDownOutside", ze = "dismissableLayer.focusOutside", Xt, oe = w.createContext({
25
+ layers: /* @__PURE__ */ new Set(),
26
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
27
+ branches: /* @__PURE__ */ new Set()
28
+ }), Xe = w.forwardRef(
29
+ (t, e) => {
30
+ const {
31
+ disableOutsidePointerEvents: n = !1,
32
+ onEscapeKeyDown: o,
33
+ onPointerDownOutside: r,
34
+ onFocusOutside: i,
35
+ onInteractOutside: s,
36
+ onDismiss: c,
37
+ ...f
38
+ } = t, l = w.useContext(oe), [a, u] = w.useState(null), p = (a == null ? void 0 : a.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, d] = w.useState({}), h = mt(e, (v) => u(v)), m = Array.from(l.layers), [y] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), g = m.indexOf(y), x = a ? m.indexOf(a) : -1, E = l.layersWithOutsidePointerEventsDisabled.size > 0, b = x >= g, A = Ue((v) => {
39
+ const C = v.target, M = [...l.branches].some((O) => O.contains(C));
40
+ !b || M || (r == null || r(v), s == null || s(v), v.defaultPrevented || c == null || c());
41
+ }, p), R = qe((v) => {
42
+ const C = v.target;
43
+ [...l.branches].some((O) => O.contains(C)) || (i == null || i(v), s == null || s(v), v.defaultPrevented || c == null || c());
44
+ }, p);
45
+ return He((v) => {
46
+ x === l.layers.size - 1 && (o == null || o(v), !v.defaultPrevented && c && (v.preventDefault(), c()));
47
+ }, p), w.useEffect(() => {
48
+ if (a)
49
+ return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (Xt = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(a)), l.layers.add(a), Yt(), () => {
50
+ n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = Xt);
51
+ };
52
+ }, [a, p, n, l]), w.useEffect(() => () => {
53
+ a && (l.layers.delete(a), l.layersWithOutsidePointerEventsDisabled.delete(a), Yt());
54
+ }, [a, l]), w.useEffect(() => {
55
+ const v = () => d({});
56
+ return document.addEventListener(Rt, v), () => document.removeEventListener(Rt, v);
57
+ }, []), /* @__PURE__ */ _(
58
+ it.div,
59
+ {
60
+ ...f,
61
+ ref: h,
62
+ style: {
63
+ pointerEvents: E ? b ? "auto" : "none" : void 0,
64
+ ...t.style
65
+ },
66
+ onFocusCapture: bt(t.onFocusCapture, R.onFocusCapture),
67
+ onBlurCapture: bt(t.onBlurCapture, R.onBlurCapture),
68
+ onPointerDownCapture: bt(
69
+ t.onPointerDownCapture,
70
+ A.onPointerDownCapture
71
+ )
72
+ }
73
+ );
74
+ }
75
+ );
76
+ Xe.displayName = Ie;
77
+ var Ye = "DismissableLayerBranch", je = w.forwardRef((t, e) => {
78
+ const n = w.useContext(oe), o = w.useRef(null), r = mt(e, o);
79
+ return w.useEffect(() => {
80
+ const i = o.current;
81
+ if (i)
82
+ return n.branches.add(i), () => {
83
+ n.branches.delete(i);
84
+ };
85
+ }, [n.branches]), /* @__PURE__ */ _(it.div, { ...t, ref: r });
86
+ });
87
+ je.displayName = Ye;
88
+ function Ue(t, e = globalThis == null ? void 0 : globalThis.document) {
89
+ const n = gt(t), o = w.useRef(!1), r = w.useRef(() => {
90
+ });
91
+ return w.useEffect(() => {
92
+ const i = (c) => {
93
+ if (c.target && !o.current) {
94
+ let f = function() {
95
+ re(
96
+ Ve,
97
+ n,
98
+ l,
99
+ { discrete: !0 }
100
+ );
101
+ };
102
+ const l = { originalEvent: c };
103
+ c.pointerType === "touch" ? (e.removeEventListener("click", r.current), r.current = f, e.addEventListener("click", r.current, { once: !0 })) : f();
104
+ } else
105
+ e.removeEventListener("click", r.current);
106
+ o.current = !1;
107
+ }, s = window.setTimeout(() => {
108
+ e.addEventListener("pointerdown", i);
109
+ }, 0);
110
+ return () => {
111
+ window.clearTimeout(s), e.removeEventListener("pointerdown", i), e.removeEventListener("click", r.current);
112
+ };
113
+ }, [e, n]), {
114
+ // ensures we check React component tree (not just DOM tree)
115
+ onPointerDownCapture: () => o.current = !0
116
+ };
117
+ }
118
+ function qe(t, e = globalThis == null ? void 0 : globalThis.document) {
119
+ const n = gt(t), o = w.useRef(!1);
120
+ return w.useEffect(() => {
121
+ const r = (i) => {
122
+ i.target && !o.current && re(ze, n, { originalEvent: i }, {
123
+ discrete: !1
124
+ });
125
+ };
126
+ return e.addEventListener("focusin", r), () => e.removeEventListener("focusin", r);
127
+ }, [e, n]), {
128
+ onFocusCapture: () => o.current = !0,
129
+ onBlurCapture: () => o.current = !1
130
+ };
131
+ }
132
+ function Yt() {
133
+ const t = new CustomEvent(Rt);
134
+ document.dispatchEvent(t);
135
+ }
136
+ function re(t, e, n, { discrete: o }) {
137
+ const r = n.originalEvent.target, i = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: n });
138
+ e && r.addEventListener(t, e, { once: !0 }), o ? We(r, i) : r.dispatchEvent(i);
139
+ }
140
+ var Ke = w[" useId ".trim().toString()] || (() => {
141
+ }), Ze = 0;
142
+ function vo(t) {
143
+ const [e, n] = w.useState(Ke());
144
+ return Pt(() => {
145
+ t || n((o) => o ?? String(Ze++));
146
+ }, [t]), t || (e ? `radix-${e}` : "");
147
+ }
148
+ const Ge = ["top", "right", "bottom", "left"], K = Math.min, $ = Math.max, ut = Math.round, at = Math.floor, X = (t) => ({
149
+ x: t,
150
+ y: t
151
+ }), Je = {
152
+ left: "right",
153
+ right: "left",
154
+ bottom: "top",
155
+ top: "bottom"
156
+ }, Qe = {
157
+ start: "end",
158
+ end: "start"
159
+ };
160
+ function Ct(t, e, n) {
161
+ return $(t, K(e, n));
162
+ }
163
+ function U(t, e) {
164
+ return typeof t == "function" ? t(e) : t;
165
+ }
166
+ function q(t) {
167
+ return t.split("-")[0];
168
+ }
169
+ function tt(t) {
170
+ return t.split("-")[1];
171
+ }
172
+ function Dt(t) {
173
+ return t === "x" ? "y" : "x";
174
+ }
175
+ function Lt(t) {
176
+ return t === "y" ? "height" : "width";
177
+ }
178
+ const tn = /* @__PURE__ */ new Set(["top", "bottom"]);
179
+ function z(t) {
180
+ return tn.has(q(t)) ? "y" : "x";
181
+ }
182
+ function Tt(t) {
183
+ return Dt(z(t));
184
+ }
185
+ function en(t, e, n) {
186
+ n === void 0 && (n = !1);
187
+ const o = tt(t), r = Tt(t), i = Lt(r);
188
+ let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
189
+ return e.reference[i] > e.floating[i] && (s = dt(s)), [s, dt(s)];
190
+ }
191
+ function nn(t) {
192
+ const e = dt(t);
193
+ return [Ot(t), e, Ot(e)];
194
+ }
195
+ function Ot(t) {
196
+ return t.replace(/start|end/g, (e) => Qe[e]);
197
+ }
198
+ const jt = ["left", "right"], Ut = ["right", "left"], on = ["top", "bottom"], rn = ["bottom", "top"];
199
+ function sn(t, e, n) {
200
+ switch (t) {
201
+ case "top":
202
+ case "bottom":
203
+ return n ? e ? Ut : jt : e ? jt : Ut;
204
+ case "left":
205
+ case "right":
206
+ return e ? on : rn;
207
+ default:
208
+ return [];
209
+ }
210
+ }
211
+ function cn(t, e, n, o) {
212
+ const r = tt(t);
213
+ let i = sn(q(t), n === "start", o);
214
+ return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(Ot)))), i;
215
+ }
216
+ function dt(t) {
217
+ return t.replace(/left|right|bottom|top/g, (e) => Je[e]);
218
+ }
219
+ function ln(t) {
220
+ return {
221
+ top: 0,
222
+ right: 0,
223
+ bottom: 0,
224
+ left: 0,
225
+ ...t
226
+ };
227
+ }
228
+ function ie(t) {
229
+ return typeof t != "number" ? ln(t) : {
230
+ top: t,
231
+ right: t,
232
+ bottom: t,
233
+ left: t
234
+ };
235
+ }
236
+ function pt(t) {
237
+ const {
238
+ x: e,
239
+ y: n,
240
+ width: o,
241
+ height: r
242
+ } = t;
243
+ return {
244
+ width: o,
245
+ height: r,
246
+ top: n,
247
+ left: e,
248
+ right: e + o,
249
+ bottom: n + r,
250
+ x: e,
251
+ y: n
252
+ };
253
+ }
254
+ function qt(t, e, n) {
255
+ let {
256
+ reference: o,
257
+ floating: r
258
+ } = t;
259
+ const i = z(e), s = Tt(e), c = Lt(s), f = q(e), l = i === "y", a = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, p = o[c] / 2 - r[c] / 2;
260
+ let d;
261
+ switch (f) {
262
+ case "top":
263
+ d = {
264
+ x: a,
265
+ y: o.y - r.height
266
+ };
267
+ break;
268
+ case "bottom":
269
+ d = {
270
+ x: a,
271
+ y: o.y + o.height
272
+ };
273
+ break;
274
+ case "right":
275
+ d = {
276
+ x: o.x + o.width,
277
+ y: u
278
+ };
279
+ break;
280
+ case "left":
281
+ d = {
282
+ x: o.x - r.width,
283
+ y: u
284
+ };
285
+ break;
286
+ default:
287
+ d = {
288
+ x: o.x,
289
+ y: o.y
290
+ };
291
+ }
292
+ switch (tt(e)) {
293
+ case "start":
294
+ d[s] -= p * (n && l ? -1 : 1);
295
+ break;
296
+ case "end":
297
+ d[s] += p * (n && l ? -1 : 1);
298
+ break;
299
+ }
300
+ return d;
301
+ }
302
+ const an = async (t, e, n) => {
303
+ const {
304
+ placement: o = "bottom",
305
+ strategy: r = "absolute",
306
+ middleware: i = [],
307
+ platform: s
308
+ } = n, c = i.filter(Boolean), f = await (s.isRTL == null ? void 0 : s.isRTL(e));
309
+ let l = await s.getElementRects({
310
+ reference: t,
311
+ floating: e,
312
+ strategy: r
313
+ }), {
314
+ x: a,
315
+ y: u
316
+ } = qt(l, o, f), p = o, d = {}, h = 0;
317
+ for (let m = 0; m < c.length; m++) {
318
+ const {
319
+ name: y,
320
+ fn: g
321
+ } = c[m], {
322
+ x,
323
+ y: E,
324
+ data: b,
325
+ reset: A
326
+ } = await g({
327
+ x: a,
328
+ y: u,
329
+ initialPlacement: o,
330
+ placement: p,
331
+ strategy: r,
332
+ middlewareData: d,
333
+ rects: l,
334
+ platform: s,
335
+ elements: {
336
+ reference: t,
337
+ floating: e
338
+ }
339
+ });
340
+ a = x ?? a, u = E ?? u, d = {
341
+ ...d,
342
+ [y]: {
343
+ ...d[y],
344
+ ...b
345
+ }
346
+ }, A && h <= 50 && (h++, typeof A == "object" && (A.placement && (p = A.placement), A.rects && (l = A.rects === !0 ? await s.getElementRects({
347
+ reference: t,
348
+ floating: e,
349
+ strategy: r
350
+ }) : A.rects), {
351
+ x: a,
352
+ y: u
353
+ } = qt(l, p, f)), m = -1);
354
+ }
355
+ return {
356
+ x: a,
357
+ y: u,
358
+ placement: p,
359
+ strategy: r,
360
+ middlewareData: d
361
+ };
362
+ };
363
+ async function ot(t, e) {
364
+ var n;
365
+ e === void 0 && (e = {});
366
+ const {
367
+ x: o,
368
+ y: r,
369
+ platform: i,
370
+ rects: s,
371
+ elements: c,
372
+ strategy: f
373
+ } = t, {
374
+ boundary: l = "clippingAncestors",
375
+ rootBoundary: a = "viewport",
376
+ elementContext: u = "floating",
377
+ altBoundary: p = !1,
378
+ padding: d = 0
379
+ } = U(e, t), h = ie(d), y = c[p ? u === "floating" ? "reference" : "floating" : u], g = pt(await i.getClippingRect({
380
+ element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
381
+ boundary: l,
382
+ rootBoundary: a,
383
+ strategy: f
384
+ })), x = u === "floating" ? {
385
+ x: o,
386
+ y: r,
387
+ width: s.floating.width,
388
+ height: s.floating.height
389
+ } : s.reference, E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), b = await (i.isElement == null ? void 0 : i.isElement(E)) ? await (i.getScale == null ? void 0 : i.getScale(E)) || {
390
+ x: 1,
391
+ y: 1
392
+ } : {
393
+ x: 1,
394
+ y: 1
395
+ }, A = pt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
396
+ elements: c,
397
+ rect: x,
398
+ offsetParent: E,
399
+ strategy: f
400
+ }) : x);
401
+ return {
402
+ top: (g.top - A.top + h.top) / b.y,
403
+ bottom: (A.bottom - g.bottom + h.bottom) / b.y,
404
+ left: (g.left - A.left + h.left) / b.x,
405
+ right: (A.right - g.right + h.right) / b.x
406
+ };
407
+ }
408
+ const fn = (t) => ({
409
+ name: "arrow",
410
+ options: t,
411
+ async fn(e) {
412
+ const {
413
+ x: n,
414
+ y: o,
415
+ placement: r,
416
+ rects: i,
417
+ platform: s,
418
+ elements: c,
419
+ middlewareData: f
420
+ } = e, {
421
+ element: l,
422
+ padding: a = 0
423
+ } = U(t, e) || {};
424
+ if (l == null)
425
+ return {};
426
+ const u = ie(a), p = {
427
+ x: n,
428
+ y: o
429
+ }, d = Tt(r), h = Lt(d), m = await s.getDimensions(l), y = d === "y", g = y ? "top" : "left", x = y ? "bottom" : "right", E = y ? "clientHeight" : "clientWidth", b = i.reference[h] + i.reference[d] - p[d] - i.floating[h], A = p[d] - i.reference[d], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
430
+ let v = R ? R[E] : 0;
431
+ (!v || !await (s.isElement == null ? void 0 : s.isElement(R))) && (v = c.floating[E] || i.floating[h]);
432
+ const C = b / 2 - A / 2, M = v / 2 - m[h] / 2 - 1, O = K(u[g], M), N = K(u[x], M), k = O, D = v - m[h] - N, S = v / 2 - m[h] / 2 + C, W = Ct(k, S, D), L = !f.arrow && tt(r) != null && S !== W && i.reference[h] / 2 - (S < k ? O : N) - m[h] / 2 < 0, T = L ? S < k ? S - k : S - D : 0;
433
+ return {
434
+ [d]: p[d] + T,
435
+ data: {
436
+ [d]: W,
437
+ centerOffset: S - W - T,
438
+ ...L && {
439
+ alignmentOffset: T
440
+ }
441
+ },
442
+ reset: L
443
+ };
444
+ }
445
+ }), un = function(t) {
446
+ return t === void 0 && (t = {}), {
447
+ name: "flip",
448
+ options: t,
449
+ async fn(e) {
450
+ var n, o;
451
+ const {
452
+ placement: r,
453
+ middlewareData: i,
454
+ rects: s,
455
+ initialPlacement: c,
456
+ platform: f,
457
+ elements: l
458
+ } = e, {
459
+ mainAxis: a = !0,
460
+ crossAxis: u = !0,
461
+ fallbackPlacements: p,
462
+ fallbackStrategy: d = "bestFit",
463
+ fallbackAxisSideDirection: h = "none",
464
+ flipAlignment: m = !0,
465
+ ...y
466
+ } = U(t, e);
467
+ if ((n = i.arrow) != null && n.alignmentOffset)
468
+ return {};
469
+ const g = q(r), x = z(c), E = q(c) === c, b = await (f.isRTL == null ? void 0 : f.isRTL(l.floating)), A = p || (E || !m ? [dt(c)] : nn(c)), R = h !== "none";
470
+ !p && R && A.push(...cn(c, m, h, b));
471
+ const v = [c, ...A], C = await ot(e, y), M = [];
472
+ let O = ((o = i.flip) == null ? void 0 : o.overflows) || [];
473
+ if (a && M.push(C[g]), u) {
474
+ const S = en(r, s, b);
475
+ M.push(C[S[0]], C[S[1]]);
476
+ }
477
+ if (O = [...O, {
478
+ placement: r,
479
+ overflows: M
480
+ }], !M.every((S) => S <= 0)) {
481
+ var N, k;
482
+ const S = (((N = i.flip) == null ? void 0 : N.index) || 0) + 1, W = v[S];
483
+ if (W && (!(u === "alignment" ? x !== z(W) : !1) || // We leave the current main axis only if every placement on that axis
484
+ // overflows the main axis.
485
+ O.every((P) => z(P.placement) === x ? P.overflows[0] > 0 : !0)))
486
+ return {
487
+ data: {
488
+ index: S,
489
+ overflows: O
490
+ },
491
+ reset: {
492
+ placement: W
493
+ }
494
+ };
495
+ let L = (k = O.filter((T) => T.overflows[0] <= 0).sort((T, P) => T.overflows[1] - P.overflows[1])[0]) == null ? void 0 : k.placement;
496
+ if (!L)
497
+ switch (d) {
498
+ case "bestFit": {
499
+ var D;
500
+ const T = (D = O.filter((P) => {
501
+ if (R) {
502
+ const F = z(P.placement);
503
+ return F === x || // Create a bias to the `y` side axis due to horizontal
504
+ // reading directions favoring greater width.
505
+ F === "y";
506
+ }
507
+ return !0;
508
+ }).map((P) => [P.placement, P.overflows.filter((F) => F > 0).reduce((F, V) => F + V, 0)]).sort((P, F) => P[1] - F[1])[0]) == null ? void 0 : D[0];
509
+ T && (L = T);
510
+ break;
511
+ }
512
+ case "initialPlacement":
513
+ L = c;
514
+ break;
515
+ }
516
+ if (r !== L)
517
+ return {
518
+ reset: {
519
+ placement: L
520
+ }
521
+ };
522
+ }
523
+ return {};
524
+ }
525
+ };
526
+ };
527
+ function Kt(t, e) {
528
+ return {
529
+ top: t.top - e.height,
530
+ right: t.right - e.width,
531
+ bottom: t.bottom - e.height,
532
+ left: t.left - e.width
533
+ };
534
+ }
535
+ function Zt(t) {
536
+ return Ge.some((e) => t[e] >= 0);
537
+ }
538
+ const dn = function(t) {
539
+ return t === void 0 && (t = {}), {
540
+ name: "hide",
541
+ options: t,
542
+ async fn(e) {
543
+ const {
544
+ rects: n
545
+ } = e, {
546
+ strategy: o = "referenceHidden",
547
+ ...r
548
+ } = U(t, e);
549
+ switch (o) {
550
+ case "referenceHidden": {
551
+ const i = await ot(e, {
552
+ ...r,
553
+ elementContext: "reference"
554
+ }), s = Kt(i, n.reference);
555
+ return {
556
+ data: {
557
+ referenceHiddenOffsets: s,
558
+ referenceHidden: Zt(s)
559
+ }
560
+ };
561
+ }
562
+ case "escaped": {
563
+ const i = await ot(e, {
564
+ ...r,
565
+ altBoundary: !0
566
+ }), s = Kt(i, n.floating);
567
+ return {
568
+ data: {
569
+ escapedOffsets: s,
570
+ escaped: Zt(s)
571
+ }
572
+ };
573
+ }
574
+ default:
575
+ return {};
576
+ }
577
+ }
578
+ };
579
+ }, se = /* @__PURE__ */ new Set(["left", "top"]);
580
+ async function pn(t, e) {
581
+ const {
582
+ placement: n,
583
+ platform: o,
584
+ elements: r
585
+ } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = q(n), c = tt(n), f = z(n) === "y", l = se.has(s) ? -1 : 1, a = i && f ? -1 : 1, u = U(e, t);
586
+ let {
587
+ mainAxis: p,
588
+ crossAxis: d,
589
+ alignmentAxis: h
590
+ } = typeof u == "number" ? {
591
+ mainAxis: u,
592
+ crossAxis: 0,
593
+ alignmentAxis: null
594
+ } : {
595
+ mainAxis: u.mainAxis || 0,
596
+ crossAxis: u.crossAxis || 0,
597
+ alignmentAxis: u.alignmentAxis
598
+ };
599
+ return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), f ? {
600
+ x: d * a,
601
+ y: p * l
602
+ } : {
603
+ x: p * l,
604
+ y: d * a
605
+ };
606
+ }
607
+ const hn = function(t) {
608
+ return t === void 0 && (t = 0), {
609
+ name: "offset",
610
+ options: t,
611
+ async fn(e) {
612
+ var n, o;
613
+ const {
614
+ x: r,
615
+ y: i,
616
+ placement: s,
617
+ middlewareData: c
618
+ } = e, f = await pn(e, t);
619
+ return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
620
+ x: r + f.x,
621
+ y: i + f.y,
622
+ data: {
623
+ ...f,
624
+ placement: s
625
+ }
626
+ };
627
+ }
628
+ };
629
+ }, mn = function(t) {
630
+ return t === void 0 && (t = {}), {
631
+ name: "shift",
632
+ options: t,
633
+ async fn(e) {
634
+ const {
635
+ x: n,
636
+ y: o,
637
+ placement: r
638
+ } = e, {
639
+ mainAxis: i = !0,
640
+ crossAxis: s = !1,
641
+ limiter: c = {
642
+ fn: (y) => {
643
+ let {
644
+ x: g,
645
+ y: x
646
+ } = y;
647
+ return {
648
+ x: g,
649
+ y: x
650
+ };
651
+ }
652
+ },
653
+ ...f
654
+ } = U(t, e), l = {
655
+ x: n,
656
+ y: o
657
+ }, a = await ot(e, f), u = z(q(r)), p = Dt(u);
658
+ let d = l[p], h = l[u];
659
+ if (i) {
660
+ const y = p === "y" ? "top" : "left", g = p === "y" ? "bottom" : "right", x = d + a[y], E = d - a[g];
661
+ d = Ct(x, d, E);
662
+ }
663
+ if (s) {
664
+ const y = u === "y" ? "top" : "left", g = u === "y" ? "bottom" : "right", x = h + a[y], E = h - a[g];
665
+ h = Ct(x, h, E);
666
+ }
667
+ const m = c.fn({
668
+ ...e,
669
+ [p]: d,
670
+ [u]: h
671
+ });
672
+ return {
673
+ ...m,
674
+ data: {
675
+ x: m.x - n,
676
+ y: m.y - o,
677
+ enabled: {
678
+ [p]: i,
679
+ [u]: s
680
+ }
681
+ }
682
+ };
683
+ }
684
+ };
685
+ }, gn = function(t) {
686
+ return t === void 0 && (t = {}), {
687
+ options: t,
688
+ fn(e) {
689
+ const {
690
+ x: n,
691
+ y: o,
692
+ placement: r,
693
+ rects: i,
694
+ middlewareData: s
695
+ } = e, {
696
+ offset: c = 0,
697
+ mainAxis: f = !0,
698
+ crossAxis: l = !0
699
+ } = U(t, e), a = {
700
+ x: n,
701
+ y: o
702
+ }, u = z(r), p = Dt(u);
703
+ let d = a[p], h = a[u];
704
+ const m = U(c, e), y = typeof m == "number" ? {
705
+ mainAxis: m,
706
+ crossAxis: 0
707
+ } : {
708
+ mainAxis: 0,
709
+ crossAxis: 0,
710
+ ...m
711
+ };
712
+ if (f) {
713
+ const E = p === "y" ? "height" : "width", b = i.reference[p] - i.floating[E] + y.mainAxis, A = i.reference[p] + i.reference[E] - y.mainAxis;
714
+ d < b ? d = b : d > A && (d = A);
715
+ }
716
+ if (l) {
717
+ var g, x;
718
+ const E = p === "y" ? "width" : "height", b = se.has(q(r)), A = i.reference[u] - i.floating[E] + (b && ((g = s.offset) == null ? void 0 : g[u]) || 0) + (b ? 0 : y.crossAxis), R = i.reference[u] + i.reference[E] + (b ? 0 : ((x = s.offset) == null ? void 0 : x[u]) || 0) - (b ? y.crossAxis : 0);
719
+ h < A ? h = A : h > R && (h = R);
720
+ }
721
+ return {
722
+ [p]: d,
723
+ [u]: h
724
+ };
725
+ }
726
+ };
727
+ }, wn = function(t) {
728
+ return t === void 0 && (t = {}), {
729
+ name: "size",
730
+ options: t,
731
+ async fn(e) {
732
+ var n, o;
733
+ const {
734
+ placement: r,
735
+ rects: i,
736
+ platform: s,
737
+ elements: c
738
+ } = e, {
739
+ apply: f = () => {
740
+ },
741
+ ...l
742
+ } = U(t, e), a = await ot(e, l), u = q(r), p = tt(r), d = z(r) === "y", {
743
+ width: h,
744
+ height: m
745
+ } = i.floating;
746
+ let y, g;
747
+ u === "top" || u === "bottom" ? (y = u, g = p === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (g = u, y = p === "end" ? "top" : "bottom");
748
+ const x = m - a.top - a.bottom, E = h - a.left - a.right, b = K(m - a[y], x), A = K(h - a[g], E), R = !e.middlewareData.shift;
749
+ let v = b, C = A;
750
+ if ((n = e.middlewareData.shift) != null && n.enabled.x && (C = E), (o = e.middlewareData.shift) != null && o.enabled.y && (v = x), R && !p) {
751
+ const O = $(a.left, 0), N = $(a.right, 0), k = $(a.top, 0), D = $(a.bottom, 0);
752
+ d ? C = h - 2 * (O !== 0 || N !== 0 ? O + N : $(a.left, a.right)) : v = m - 2 * (k !== 0 || D !== 0 ? k + D : $(a.top, a.bottom));
753
+ }
754
+ await f({
755
+ ...e,
756
+ availableWidth: C,
757
+ availableHeight: v
758
+ });
759
+ const M = await s.getDimensions(c.floating);
760
+ return h !== M.width || m !== M.height ? {
761
+ reset: {
762
+ rects: !0
763
+ }
764
+ } : {};
765
+ }
766
+ };
767
+ };
768
+ function wt() {
769
+ return typeof window < "u";
770
+ }
771
+ function et(t) {
772
+ return ce(t) ? (t.nodeName || "").toLowerCase() : "#document";
773
+ }
774
+ function B(t) {
775
+ var e;
776
+ return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
777
+ }
778
+ function j(t) {
779
+ var e;
780
+ return (e = (ce(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
781
+ }
782
+ function ce(t) {
783
+ return wt() ? t instanceof Node || t instanceof B(t).Node : !1;
784
+ }
785
+ function H(t) {
786
+ return wt() ? t instanceof Element || t instanceof B(t).Element : !1;
787
+ }
788
+ function Y(t) {
789
+ return wt() ? t instanceof HTMLElement || t instanceof B(t).HTMLElement : !1;
790
+ }
791
+ function Gt(t) {
792
+ return !wt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof B(t).ShadowRoot;
793
+ }
794
+ const yn = /* @__PURE__ */ new Set(["inline", "contents"]);
795
+ function st(t) {
796
+ const {
797
+ overflow: e,
798
+ overflowX: n,
799
+ overflowY: o,
800
+ display: r
801
+ } = I(t);
802
+ return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !yn.has(r);
803
+ }
804
+ const xn = /* @__PURE__ */ new Set(["table", "td", "th"]);
805
+ function vn(t) {
806
+ return xn.has(et(t));
807
+ }
808
+ const bn = [":popover-open", ":modal"];
809
+ function yt(t) {
810
+ return bn.some((e) => {
811
+ try {
812
+ return t.matches(e);
813
+ } catch {
814
+ return !1;
815
+ }
816
+ });
817
+ }
818
+ const An = ["transform", "translate", "scale", "rotate", "perspective"], En = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Pn = ["paint", "layout", "strict", "content"];
819
+ function Mt(t) {
820
+ const e = Ft(), n = H(t) ? I(t) : t;
821
+ return An.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || En.some((o) => (n.willChange || "").includes(o)) || Pn.some((o) => (n.contain || "").includes(o));
822
+ }
823
+ function Rn(t) {
824
+ let e = Z(t);
825
+ for (; Y(e) && !Q(e); ) {
826
+ if (Mt(e))
827
+ return e;
828
+ if (yt(e))
829
+ return null;
830
+ e = Z(e);
831
+ }
832
+ return null;
833
+ }
834
+ function Ft() {
835
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
836
+ }
837
+ const Cn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
838
+ function Q(t) {
839
+ return Cn.has(et(t));
840
+ }
841
+ function I(t) {
842
+ return B(t).getComputedStyle(t);
843
+ }
844
+ function xt(t) {
845
+ return H(t) ? {
846
+ scrollLeft: t.scrollLeft,
847
+ scrollTop: t.scrollTop
848
+ } : {
849
+ scrollLeft: t.scrollX,
850
+ scrollTop: t.scrollY
851
+ };
852
+ }
853
+ function Z(t) {
854
+ if (et(t) === "html")
855
+ return t;
856
+ const e = (
857
+ // Step into the shadow DOM of the parent of a slotted node.
858
+ t.assignedSlot || // DOM Element detected.
859
+ t.parentNode || // ShadowRoot detected.
860
+ Gt(t) && t.host || // Fallback.
861
+ j(t)
862
+ );
863
+ return Gt(e) ? e.host : e;
864
+ }
865
+ function le(t) {
866
+ const e = Z(t);
867
+ return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : Y(e) && st(e) ? e : le(e);
868
+ }
869
+ function rt(t, e, n) {
870
+ var o;
871
+ e === void 0 && (e = []), n === void 0 && (n = !0);
872
+ const r = le(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = B(r);
873
+ if (i) {
874
+ const c = St(s);
875
+ return e.concat(s, s.visualViewport || [], st(r) ? r : [], c && n ? rt(c) : []);
876
+ }
877
+ return e.concat(r, rt(r, [], n));
878
+ }
879
+ function St(t) {
880
+ return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
881
+ }
882
+ function ae(t) {
883
+ const e = I(t);
884
+ let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
885
+ const r = Y(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = ut(n) !== i || ut(o) !== s;
886
+ return c && (n = i, o = s), {
887
+ width: n,
888
+ height: o,
889
+ $: c
890
+ };
891
+ }
892
+ function Nt(t) {
893
+ return H(t) ? t : t.contextElement;
894
+ }
895
+ function J(t) {
896
+ const e = Nt(t);
897
+ if (!Y(e))
898
+ return X(1);
899
+ const n = e.getBoundingClientRect(), {
900
+ width: o,
901
+ height: r,
902
+ $: i
903
+ } = ae(e);
904
+ let s = (i ? ut(n.width) : n.width) / o, c = (i ? ut(n.height) : n.height) / r;
905
+ return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
906
+ x: s,
907
+ y: c
908
+ };
909
+ }
910
+ const On = /* @__PURE__ */ X(0);
911
+ function fe(t) {
912
+ const e = B(t);
913
+ return !Ft() || !e.visualViewport ? On : {
914
+ x: e.visualViewport.offsetLeft,
915
+ y: e.visualViewport.offsetTop
916
+ };
917
+ }
918
+ function Sn(t, e, n) {
919
+ return e === void 0 && (e = !1), !n || e && n !== B(t) ? !1 : e;
920
+ }
921
+ function G(t, e, n, o) {
922
+ e === void 0 && (e = !1), n === void 0 && (n = !1);
923
+ const r = t.getBoundingClientRect(), i = Nt(t);
924
+ let s = X(1);
925
+ e && (o ? H(o) && (s = J(o)) : s = J(t));
926
+ const c = Sn(i, n, o) ? fe(i) : X(0);
927
+ let f = (r.left + c.x) / s.x, l = (r.top + c.y) / s.y, a = r.width / s.x, u = r.height / s.y;
928
+ if (i) {
929
+ const p = B(i), d = o && H(o) ? B(o) : o;
930
+ let h = p, m = St(h);
931
+ for (; m && o && d !== h; ) {
932
+ const y = J(m), g = m.getBoundingClientRect(), x = I(m), E = g.left + (m.clientLeft + parseFloat(x.paddingLeft)) * y.x, b = g.top + (m.clientTop + parseFloat(x.paddingTop)) * y.y;
933
+ f *= y.x, l *= y.y, a *= y.x, u *= y.y, f += E, l += b, h = B(m), m = St(h);
934
+ }
935
+ }
936
+ return pt({
937
+ width: a,
938
+ height: u,
939
+ x: f,
940
+ y: l
941
+ });
942
+ }
943
+ function vt(t, e) {
944
+ const n = xt(t).scrollLeft;
945
+ return e ? e.left + n : G(j(t)).left + n;
946
+ }
947
+ function ue(t, e) {
948
+ const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - vt(t, n), r = n.top + e.scrollTop;
949
+ return {
950
+ x: o,
951
+ y: r
952
+ };
953
+ }
954
+ function Dn(t) {
955
+ let {
956
+ elements: e,
957
+ rect: n,
958
+ offsetParent: o,
959
+ strategy: r
960
+ } = t;
961
+ const i = r === "fixed", s = j(o), c = e ? yt(e.floating) : !1;
962
+ if (o === s || c && i)
963
+ return n;
964
+ let f = {
965
+ scrollLeft: 0,
966
+ scrollTop: 0
967
+ }, l = X(1);
968
+ const a = X(0), u = Y(o);
969
+ if ((u || !u && !i) && ((et(o) !== "body" || st(s)) && (f = xt(o)), Y(o))) {
970
+ const d = G(o);
971
+ l = J(o), a.x = d.x + o.clientLeft, a.y = d.y + o.clientTop;
972
+ }
973
+ const p = s && !u && !i ? ue(s, f) : X(0);
974
+ return {
975
+ width: n.width * l.x,
976
+ height: n.height * l.y,
977
+ x: n.x * l.x - f.scrollLeft * l.x + a.x + p.x,
978
+ y: n.y * l.y - f.scrollTop * l.y + a.y + p.y
979
+ };
980
+ }
981
+ function Ln(t) {
982
+ return Array.from(t.getClientRects());
983
+ }
984
+ function Tn(t) {
985
+ const e = j(t), n = xt(t), o = t.ownerDocument.body, r = $(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = $(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
986
+ let s = -n.scrollLeft + vt(t);
987
+ const c = -n.scrollTop;
988
+ return I(o).direction === "rtl" && (s += $(e.clientWidth, o.clientWidth) - r), {
989
+ width: r,
990
+ height: i,
991
+ x: s,
992
+ y: c
993
+ };
994
+ }
995
+ const Jt = 25;
996
+ function Mn(t, e) {
997
+ const n = B(t), o = j(t), r = n.visualViewport;
998
+ let i = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
999
+ if (r) {
1000
+ i = r.width, s = r.height;
1001
+ const a = Ft();
1002
+ (!a || a && e === "fixed") && (c = r.offsetLeft, f = r.offsetTop);
1003
+ }
1004
+ const l = vt(o);
1005
+ if (l <= 0) {
1006
+ const a = o.ownerDocument, u = a.body, p = getComputedStyle(u), d = a.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, h = Math.abs(o.clientWidth - u.clientWidth - d);
1007
+ h <= Jt && (i -= h);
1008
+ } else
1009
+ l <= Jt && (i += l);
1010
+ return {
1011
+ width: i,
1012
+ height: s,
1013
+ x: c,
1014
+ y: f
1015
+ };
1016
+ }
1017
+ const Fn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1018
+ function Nn(t, e) {
1019
+ const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = Y(t) ? J(t) : X(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, f = r * i.x, l = o * i.y;
1020
+ return {
1021
+ width: s,
1022
+ height: c,
1023
+ x: f,
1024
+ y: l
1025
+ };
1026
+ }
1027
+ function Qt(t, e, n) {
1028
+ let o;
1029
+ if (e === "viewport")
1030
+ o = Mn(t, n);
1031
+ else if (e === "document")
1032
+ o = Tn(j(t));
1033
+ else if (H(e))
1034
+ o = Nn(e, n);
1035
+ else {
1036
+ const r = fe(t);
1037
+ o = {
1038
+ x: e.x - r.x,
1039
+ y: e.y - r.y,
1040
+ width: e.width,
1041
+ height: e.height
1042
+ };
1043
+ }
1044
+ return pt(o);
1045
+ }
1046
+ function de(t, e) {
1047
+ const n = Z(t);
1048
+ return n === e || !H(n) || Q(n) ? !1 : I(n).position === "fixed" || de(n, e);
1049
+ }
1050
+ function kn(t, e) {
1051
+ const n = e.get(t);
1052
+ if (n)
1053
+ return n;
1054
+ let o = rt(t, [], !1).filter((c) => H(c) && et(c) !== "body"), r = null;
1055
+ const i = I(t).position === "fixed";
1056
+ let s = i ? Z(t) : t;
1057
+ for (; H(s) && !Q(s); ) {
1058
+ const c = I(s), f = Mt(s);
1059
+ !f && c.position === "fixed" && (r = null), (i ? !f && !r : !f && c.position === "static" && !!r && Fn.has(r.position) || st(s) && !f && de(t, s)) ? o = o.filter((a) => a !== s) : r = c, s = Z(s);
1060
+ }
1061
+ return e.set(t, o), o;
1062
+ }
1063
+ function Wn(t) {
1064
+ let {
1065
+ element: e,
1066
+ boundary: n,
1067
+ rootBoundary: o,
1068
+ strategy: r
1069
+ } = t;
1070
+ const s = [...n === "clippingAncestors" ? yt(e) ? [] : kn(e, this._c) : [].concat(n), o], c = s[0], f = s.reduce((l, a) => {
1071
+ const u = Qt(e, a, r);
1072
+ return l.top = $(u.top, l.top), l.right = K(u.right, l.right), l.bottom = K(u.bottom, l.bottom), l.left = $(u.left, l.left), l;
1073
+ }, Qt(e, c, r));
1074
+ return {
1075
+ width: f.right - f.left,
1076
+ height: f.bottom - f.top,
1077
+ x: f.left,
1078
+ y: f.top
1079
+ };
1080
+ }
1081
+ function $n(t) {
1082
+ const {
1083
+ width: e,
1084
+ height: n
1085
+ } = ae(t);
1086
+ return {
1087
+ width: e,
1088
+ height: n
1089
+ };
1090
+ }
1091
+ function Bn(t, e, n) {
1092
+ const o = Y(e), r = j(e), i = n === "fixed", s = G(t, !0, i, e);
1093
+ let c = {
1094
+ scrollLeft: 0,
1095
+ scrollTop: 0
1096
+ };
1097
+ const f = X(0);
1098
+ function l() {
1099
+ f.x = vt(r);
1100
+ }
1101
+ if (o || !o && !i)
1102
+ if ((et(e) !== "body" || st(r)) && (c = xt(e)), o) {
1103
+ const d = G(e, !0, i, e);
1104
+ f.x = d.x + e.clientLeft, f.y = d.y + e.clientTop;
1105
+ } else
1106
+ r && l();
1107
+ i && !o && r && l();
1108
+ const a = r && !o && !i ? ue(r, c) : X(0), u = s.left + c.scrollLeft - f.x - a.x, p = s.top + c.scrollTop - f.y - a.y;
1109
+ return {
1110
+ x: u,
1111
+ y: p,
1112
+ width: s.width,
1113
+ height: s.height
1114
+ };
1115
+ }
1116
+ function At(t) {
1117
+ return I(t).position === "static";
1118
+ }
1119
+ function te(t, e) {
1120
+ if (!Y(t) || I(t).position === "fixed")
1121
+ return null;
1122
+ if (e)
1123
+ return e(t);
1124
+ let n = t.offsetParent;
1125
+ return j(t) === n && (n = n.ownerDocument.body), n;
1126
+ }
1127
+ function pe(t, e) {
1128
+ const n = B(t);
1129
+ if (yt(t))
1130
+ return n;
1131
+ if (!Y(t)) {
1132
+ let r = Z(t);
1133
+ for (; r && !Q(r); ) {
1134
+ if (H(r) && !At(r))
1135
+ return r;
1136
+ r = Z(r);
1137
+ }
1138
+ return n;
1139
+ }
1140
+ let o = te(t, e);
1141
+ for (; o && vn(o) && At(o); )
1142
+ o = te(o, e);
1143
+ return o && Q(o) && At(o) && !Mt(o) ? n : o || Rn(t) || n;
1144
+ }
1145
+ const _n = async function(t) {
1146
+ const e = this.getOffsetParent || pe, n = this.getDimensions, o = await n(t.floating);
1147
+ return {
1148
+ reference: Bn(t.reference, await e(t.floating), t.strategy),
1149
+ floating: {
1150
+ x: 0,
1151
+ y: 0,
1152
+ width: o.width,
1153
+ height: o.height
1154
+ }
1155
+ };
1156
+ };
1157
+ function Hn(t) {
1158
+ return I(t).direction === "rtl";
1159
+ }
1160
+ const In = {
1161
+ convertOffsetParentRelativeRectToViewportRelativeRect: Dn,
1162
+ getDocumentElement: j,
1163
+ getClippingRect: Wn,
1164
+ getOffsetParent: pe,
1165
+ getElementRects: _n,
1166
+ getClientRects: Ln,
1167
+ getDimensions: $n,
1168
+ getScale: J,
1169
+ isElement: H,
1170
+ isRTL: Hn
1171
+ };
1172
+ function he(t, e) {
1173
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1174
+ }
1175
+ function Vn(t, e) {
1176
+ let n = null, o;
1177
+ const r = j(t);
1178
+ function i() {
1179
+ var c;
1180
+ clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1181
+ }
1182
+ function s(c, f) {
1183
+ c === void 0 && (c = !1), f === void 0 && (f = 1), i();
1184
+ const l = t.getBoundingClientRect(), {
1185
+ left: a,
1186
+ top: u,
1187
+ width: p,
1188
+ height: d
1189
+ } = l;
1190
+ if (c || e(), !p || !d)
1191
+ return;
1192
+ const h = at(u), m = at(r.clientWidth - (a + p)), y = at(r.clientHeight - (u + d)), g = at(a), E = {
1193
+ rootMargin: -h + "px " + -m + "px " + -y + "px " + -g + "px",
1194
+ threshold: $(0, K(1, f)) || 1
1195
+ };
1196
+ let b = !0;
1197
+ function A(R) {
1198
+ const v = R[0].intersectionRatio;
1199
+ if (v !== f) {
1200
+ if (!b)
1201
+ return s();
1202
+ v ? s(!1, v) : o = setTimeout(() => {
1203
+ s(!1, 1e-7);
1204
+ }, 1e3);
1205
+ }
1206
+ v === 1 && !he(l, t.getBoundingClientRect()) && s(), b = !1;
1207
+ }
1208
+ try {
1209
+ n = new IntersectionObserver(A, {
1210
+ ...E,
1211
+ // Handle <iframe>s
1212
+ root: r.ownerDocument
1213
+ });
1214
+ } catch {
1215
+ n = new IntersectionObserver(A, E);
1216
+ }
1217
+ n.observe(t);
1218
+ }
1219
+ return s(!0), i;
1220
+ }
1221
+ function zn(t, e, n, o) {
1222
+ o === void 0 && (o = {});
1223
+ const {
1224
+ ancestorScroll: r = !0,
1225
+ ancestorResize: i = !0,
1226
+ elementResize: s = typeof ResizeObserver == "function",
1227
+ layoutShift: c = typeof IntersectionObserver == "function",
1228
+ animationFrame: f = !1
1229
+ } = o, l = Nt(t), a = r || i ? [...l ? rt(l) : [], ...rt(e)] : [];
1230
+ a.forEach((g) => {
1231
+ r && g.addEventListener("scroll", n, {
1232
+ passive: !0
1233
+ }), i && g.addEventListener("resize", n);
1234
+ });
1235
+ const u = l && c ? Vn(l, n) : null;
1236
+ let p = -1, d = null;
1237
+ s && (d = new ResizeObserver((g) => {
1238
+ let [x] = g;
1239
+ x && x.target === l && d && (d.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1240
+ var E;
1241
+ (E = d) == null || E.observe(e);
1242
+ })), n();
1243
+ }), l && !f && d.observe(l), d.observe(e));
1244
+ let h, m = f ? G(t) : null;
1245
+ f && y();
1246
+ function y() {
1247
+ const g = G(t);
1248
+ m && !he(m, g) && n(), m = g, h = requestAnimationFrame(y);
1249
+ }
1250
+ return n(), () => {
1251
+ var g;
1252
+ a.forEach((x) => {
1253
+ r && x.removeEventListener("scroll", n), i && x.removeEventListener("resize", n);
1254
+ }), u == null || u(), (g = d) == null || g.disconnect(), d = null, f && cancelAnimationFrame(h);
1255
+ };
1256
+ }
1257
+ const Xn = hn, Yn = mn, jn = un, Un = wn, qn = dn, ee = fn, Kn = gn, Zn = (t, e, n) => {
1258
+ const o = /* @__PURE__ */ new Map(), r = {
1259
+ platform: In,
1260
+ ...n
1261
+ }, i = {
1262
+ ...r.platform,
1263
+ _c: o
1264
+ };
1265
+ return an(t, e, {
1266
+ ...r,
1267
+ platform: i
1268
+ });
1269
+ };
1270
+ var Gn = typeof document < "u", Jn = function() {
1271
+ }, ft = Gn ? ke : Jn;
1272
+ function ht(t, e) {
1273
+ if (t === e)
1274
+ return !0;
1275
+ if (typeof t != typeof e)
1276
+ return !1;
1277
+ if (typeof t == "function" && t.toString() === e.toString())
1278
+ return !0;
1279
+ let n, o, r;
1280
+ if (t && e && typeof t == "object") {
1281
+ if (Array.isArray(t)) {
1282
+ if (n = t.length, n !== e.length)
1283
+ return !1;
1284
+ for (o = n; o-- !== 0; )
1285
+ if (!ht(t[o], e[o]))
1286
+ return !1;
1287
+ return !0;
1288
+ }
1289
+ if (r = Object.keys(t), n = r.length, n !== Object.keys(e).length)
1290
+ return !1;
1291
+ for (o = n; o-- !== 0; )
1292
+ if (!{}.hasOwnProperty.call(e, r[o]))
1293
+ return !1;
1294
+ for (o = n; o-- !== 0; ) {
1295
+ const i = r[o];
1296
+ if (!(i === "_owner" && t.$$typeof) && !ht(t[i], e[i]))
1297
+ return !1;
1298
+ }
1299
+ return !0;
1300
+ }
1301
+ return t !== t && e !== e;
1302
+ }
1303
+ function me(t) {
1304
+ return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1305
+ }
1306
+ function ne(t, e) {
1307
+ const n = me(t);
1308
+ return Math.round(e * n) / n;
1309
+ }
1310
+ function Et(t) {
1311
+ const e = w.useRef(t);
1312
+ return ft(() => {
1313
+ e.current = t;
1314
+ }), e;
1315
+ }
1316
+ function Qn(t) {
1317
+ t === void 0 && (t = {});
1318
+ const {
1319
+ placement: e = "bottom",
1320
+ strategy: n = "absolute",
1321
+ middleware: o = [],
1322
+ platform: r,
1323
+ elements: {
1324
+ reference: i,
1325
+ floating: s
1326
+ } = {},
1327
+ transform: c = !0,
1328
+ whileElementsMounted: f,
1329
+ open: l
1330
+ } = t, [a, u] = w.useState({
1331
+ x: 0,
1332
+ y: 0,
1333
+ strategy: n,
1334
+ placement: e,
1335
+ middlewareData: {},
1336
+ isPositioned: !1
1337
+ }), [p, d] = w.useState(o);
1338
+ ht(p, o) || d(o);
1339
+ const [h, m] = w.useState(null), [y, g] = w.useState(null), x = w.useCallback((P) => {
1340
+ P !== R.current && (R.current = P, m(P));
1341
+ }, []), E = w.useCallback((P) => {
1342
+ P !== v.current && (v.current = P, g(P));
1343
+ }, []), b = i || h, A = s || y, R = w.useRef(null), v = w.useRef(null), C = w.useRef(a), M = f != null, O = Et(f), N = Et(r), k = Et(l), D = w.useCallback(() => {
1344
+ if (!R.current || !v.current)
1345
+ return;
1346
+ const P = {
1347
+ placement: e,
1348
+ strategy: n,
1349
+ middleware: p
1350
+ };
1351
+ N.current && (P.platform = N.current), Zn(R.current, v.current, P).then((F) => {
1352
+ const V = {
1353
+ ...F,
1354
+ // The floating element's position may be recomputed while it's closed
1355
+ // but still mounted (such as when transitioning out). To ensure
1356
+ // `isPositioned` will be `false` initially on the next open, avoid
1357
+ // setting it to `true` when `open === false` (must be specified).
1358
+ isPositioned: k.current !== !1
1359
+ };
1360
+ S.current && !ht(C.current, V) && (C.current = V, _e.flushSync(() => {
1361
+ u(V);
1362
+ }));
1363
+ });
1364
+ }, [p, e, n, N, k]);
1365
+ ft(() => {
1366
+ l === !1 && C.current.isPositioned && (C.current.isPositioned = !1, u((P) => ({
1367
+ ...P,
1368
+ isPositioned: !1
1369
+ })));
1370
+ }, [l]);
1371
+ const S = w.useRef(!1);
1372
+ ft(() => (S.current = !0, () => {
1373
+ S.current = !1;
1374
+ }), []), ft(() => {
1375
+ if (b && (R.current = b), A && (v.current = A), b && A) {
1376
+ if (O.current)
1377
+ return O.current(b, A, D);
1378
+ D();
1379
+ }
1380
+ }, [b, A, D, O, M]);
1381
+ const W = w.useMemo(() => ({
1382
+ reference: R,
1383
+ floating: v,
1384
+ setReference: x,
1385
+ setFloating: E
1386
+ }), [x, E]), L = w.useMemo(() => ({
1387
+ reference: b,
1388
+ floating: A
1389
+ }), [b, A]), T = w.useMemo(() => {
1390
+ const P = {
1391
+ position: n,
1392
+ left: 0,
1393
+ top: 0
1394
+ };
1395
+ if (!L.floating)
1396
+ return P;
1397
+ const F = ne(L.floating, a.x), V = ne(L.floating, a.y);
1398
+ return c ? {
1399
+ ...P,
1400
+ transform: "translate(" + F + "px, " + V + "px)",
1401
+ ...me(L.floating) >= 1.5 && {
1402
+ willChange: "transform"
1403
+ }
1404
+ } : {
1405
+ position: n,
1406
+ left: F,
1407
+ top: V
1408
+ };
1409
+ }, [n, c, L.floating, a.x, a.y]);
1410
+ return w.useMemo(() => ({
1411
+ ...a,
1412
+ update: D,
1413
+ refs: W,
1414
+ elements: L,
1415
+ floatingStyles: T
1416
+ }), [a, D, W, L, T]);
1417
+ }
1418
+ const to = (t) => {
1419
+ function e(n) {
1420
+ return {}.hasOwnProperty.call(n, "current");
1421
+ }
1422
+ return {
1423
+ name: "arrow",
1424
+ options: t,
1425
+ fn(n) {
1426
+ const {
1427
+ element: o,
1428
+ padding: r
1429
+ } = typeof t == "function" ? t(n) : t;
1430
+ return o && e(o) ? o.current != null ? ee({
1431
+ element: o.current,
1432
+ padding: r
1433
+ }).fn(n) : {} : o ? ee({
1434
+ element: o,
1435
+ padding: r
1436
+ }).fn(n) : {};
1437
+ }
1438
+ };
1439
+ }, eo = (t, e) => ({
1440
+ ...Xn(t),
1441
+ options: [t, e]
1442
+ }), no = (t, e) => ({
1443
+ ...Yn(t),
1444
+ options: [t, e]
1445
+ }), oo = (t, e) => ({
1446
+ ...Kn(t),
1447
+ options: [t, e]
1448
+ }), ro = (t, e) => ({
1449
+ ...jn(t),
1450
+ options: [t, e]
1451
+ }), io = (t, e) => ({
1452
+ ...Un(t),
1453
+ options: [t, e]
1454
+ }), so = (t, e) => ({
1455
+ ...qn(t),
1456
+ options: [t, e]
1457
+ }), co = (t, e) => ({
1458
+ ...to(t),
1459
+ options: [t, e]
1460
+ });
1461
+ var lo = "Arrow", ge = w.forwardRef((t, e) => {
1462
+ const { children: n, width: o = 10, height: r = 5, ...i } = t;
1463
+ return /* @__PURE__ */ _(
1464
+ it.svg,
1465
+ {
1466
+ ...i,
1467
+ ref: e,
1468
+ width: o,
1469
+ height: r,
1470
+ viewBox: "0 0 30 10",
1471
+ preserveAspectRatio: "none",
1472
+ children: t.asChild ? n : /* @__PURE__ */ _("polygon", { points: "0,0 30,0 15,10" })
1473
+ }
1474
+ );
1475
+ });
1476
+ ge.displayName = lo;
1477
+ var ao = ge, kt = "Popper", [we, bo] = $e(kt), [fo, ye] = we(kt), xe = (t) => {
1478
+ const { __scopePopper: e, children: n } = t, [o, r] = w.useState(null);
1479
+ return /* @__PURE__ */ _(fo, { scope: e, anchor: o, onAnchorChange: r, children: n });
1480
+ };
1481
+ xe.displayName = kt;
1482
+ var ve = "PopperAnchor", be = w.forwardRef(
1483
+ (t, e) => {
1484
+ const { __scopePopper: n, virtualRef: o, ...r } = t, i = ye(ve, n), s = w.useRef(null), c = mt(e, s), f = w.useRef(null);
1485
+ return w.useEffect(() => {
1486
+ const l = f.current;
1487
+ f.current = (o == null ? void 0 : o.current) || s.current, l !== f.current && i.onAnchorChange(f.current);
1488
+ }), o ? null : /* @__PURE__ */ _(it.div, { ...r, ref: c });
1489
+ }
1490
+ );
1491
+ be.displayName = ve;
1492
+ var Wt = "PopperContent", [uo, po] = we(Wt), Ae = w.forwardRef(
1493
+ (t, e) => {
1494
+ var $t, Bt, _t, Ht, It, Vt;
1495
+ const {
1496
+ __scopePopper: n,
1497
+ side: o = "bottom",
1498
+ sideOffset: r = 0,
1499
+ align: i = "center",
1500
+ alignOffset: s = 0,
1501
+ arrowPadding: c = 0,
1502
+ avoidCollisions: f = !0,
1503
+ collisionBoundary: l = [],
1504
+ collisionPadding: a = 0,
1505
+ sticky: u = "partial",
1506
+ hideWhenDetached: p = !1,
1507
+ updatePositionStrategy: d = "optimized",
1508
+ onPlaced: h,
1509
+ ...m
1510
+ } = t, y = ye(Wt, n), [g, x] = w.useState(null), E = mt(e, (nt) => x(nt)), [b, A] = w.useState(null), R = Be(b), v = (R == null ? void 0 : R.width) ?? 0, C = (R == null ? void 0 : R.height) ?? 0, M = o + (i !== "center" ? "-" + i : ""), O = typeof a == "number" ? a : { top: 0, right: 0, bottom: 0, left: 0, ...a }, N = Array.isArray(l) ? l : [l], k = N.length > 0, D = {
1511
+ padding: O,
1512
+ boundary: N.filter(mo),
1513
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1514
+ altBoundary: k
1515
+ }, { refs: S, floatingStyles: W, placement: L, isPositioned: T, middlewareData: P } = Qn({
1516
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1517
+ strategy: "fixed",
1518
+ placement: M,
1519
+ whileElementsMounted: (...nt) => zn(...nt, {
1520
+ animationFrame: d === "always"
1521
+ }),
1522
+ elements: {
1523
+ reference: y.anchor
1524
+ },
1525
+ middleware: [
1526
+ eo({ mainAxis: r + C, alignmentAxis: s }),
1527
+ f && no({
1528
+ mainAxis: !0,
1529
+ crossAxis: !1,
1530
+ limiter: u === "partial" ? oo() : void 0,
1531
+ ...D
1532
+ }),
1533
+ f && ro({ ...D }),
1534
+ io({
1535
+ ...D,
1536
+ apply: ({ elements: nt, rects: zt, availableWidth: Te, availableHeight: Me }) => {
1537
+ const { width: Fe, height: Ne } = zt.reference, lt = nt.floating.style;
1538
+ lt.setProperty("--radix-popper-available-width", `${Te}px`), lt.setProperty("--radix-popper-available-height", `${Me}px`), lt.setProperty("--radix-popper-anchor-width", `${Fe}px`), lt.setProperty("--radix-popper-anchor-height", `${Ne}px`);
1539
+ }
1540
+ }),
1541
+ b && co({ element: b, padding: c }),
1542
+ go({ arrowWidth: v, arrowHeight: C }),
1543
+ p && so({ strategy: "referenceHidden", ...D })
1544
+ ]
1545
+ }), [F, V] = Re(L), ct = gt(h);
1546
+ Pt(() => {
1547
+ T && (ct == null || ct());
1548
+ }, [T, ct]);
1549
+ const Ce = ($t = P.arrow) == null ? void 0 : $t.x, Oe = (Bt = P.arrow) == null ? void 0 : Bt.y, Se = ((_t = P.arrow) == null ? void 0 : _t.centerOffset) !== 0, [De, Le] = w.useState();
1550
+ return Pt(() => {
1551
+ g && Le(window.getComputedStyle(g).zIndex);
1552
+ }, [g]), /* @__PURE__ */ _(
1553
+ "div",
1554
+ {
1555
+ ref: S.setFloating,
1556
+ "data-radix-popper-content-wrapper": "",
1557
+ style: {
1558
+ ...W,
1559
+ transform: T ? W.transform : "translate(0, -200%)",
1560
+ // keep off the page when measuring
1561
+ minWidth: "max-content",
1562
+ zIndex: De,
1563
+ "--radix-popper-transform-origin": [
1564
+ (Ht = P.transformOrigin) == null ? void 0 : Ht.x,
1565
+ (It = P.transformOrigin) == null ? void 0 : It.y
1566
+ ].join(" "),
1567
+ // hide the content if using the hide middleware and should be hidden
1568
+ // set visibility to hidden and disable pointer events so the UI behaves
1569
+ // as if the PopperContent isn't there at all
1570
+ ...((Vt = P.hide) == null ? void 0 : Vt.referenceHidden) && {
1571
+ visibility: "hidden",
1572
+ pointerEvents: "none"
1573
+ }
1574
+ },
1575
+ dir: t.dir,
1576
+ children: /* @__PURE__ */ _(
1577
+ uo,
1578
+ {
1579
+ scope: n,
1580
+ placedSide: F,
1581
+ onArrowChange: A,
1582
+ arrowX: Ce,
1583
+ arrowY: Oe,
1584
+ shouldHideArrow: Se,
1585
+ children: /* @__PURE__ */ _(
1586
+ it.div,
1587
+ {
1588
+ "data-side": F,
1589
+ "data-align": V,
1590
+ ...m,
1591
+ ref: E,
1592
+ style: {
1593
+ ...m.style,
1594
+ // if the PopperContent hasn't been placed yet (not all measurements done)
1595
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
1596
+ animation: T ? void 0 : "none"
1597
+ }
1598
+ }
1599
+ )
1600
+ }
1601
+ )
1602
+ }
1603
+ );
1604
+ }
1605
+ );
1606
+ Ae.displayName = Wt;
1607
+ var Ee = "PopperArrow", ho = {
1608
+ top: "bottom",
1609
+ right: "left",
1610
+ bottom: "top",
1611
+ left: "right"
1612
+ }, Pe = w.forwardRef(function(e, n) {
1613
+ const { __scopePopper: o, ...r } = e, i = po(Ee, o), s = ho[i.placedSide];
1614
+ return (
1615
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1616
+ // doesn't report size as we'd expect on SVG elements.
1617
+ // it reports their bounding box which is effectively the largest path inside the SVG.
1618
+ /* @__PURE__ */ _(
1619
+ "span",
1620
+ {
1621
+ ref: i.onArrowChange,
1622
+ style: {
1623
+ position: "absolute",
1624
+ left: i.arrowX,
1625
+ top: i.arrowY,
1626
+ [s]: 0,
1627
+ transformOrigin: {
1628
+ top: "",
1629
+ right: "0 0",
1630
+ bottom: "center 0",
1631
+ left: "100% 0"
1632
+ }[i.placedSide],
1633
+ transform: {
1634
+ top: "translateY(100%)",
1635
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
1636
+ bottom: "rotate(180deg)",
1637
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
1638
+ }[i.placedSide],
1639
+ visibility: i.shouldHideArrow ? "hidden" : void 0
1640
+ },
1641
+ children: /* @__PURE__ */ _(
1642
+ ao,
1643
+ {
1644
+ ...r,
1645
+ ref: n,
1646
+ style: {
1647
+ ...r.style,
1648
+ // ensures the element can be measured correctly (mostly for if SVG)
1649
+ display: "block"
1650
+ }
1651
+ }
1652
+ )
1653
+ }
1654
+ )
1655
+ );
1656
+ });
1657
+ Pe.displayName = Ee;
1658
+ function mo(t) {
1659
+ return t !== null;
1660
+ }
1661
+ var go = (t) => ({
1662
+ name: "transformOrigin",
1663
+ options: t,
1664
+ fn(e) {
1665
+ var y, g, x;
1666
+ const { placement: n, rects: o, middlewareData: r } = e, s = ((y = r.arrow) == null ? void 0 : y.centerOffset) !== 0, c = s ? 0 : t.arrowWidth, f = s ? 0 : t.arrowHeight, [l, a] = Re(n), u = { start: "0%", center: "50%", end: "100%" }[a], p = (((g = r.arrow) == null ? void 0 : g.x) ?? 0) + c / 2, d = (((x = r.arrow) == null ? void 0 : x.y) ?? 0) + f / 2;
1667
+ let h = "", m = "";
1668
+ return l === "bottom" ? (h = s ? u : `${p}px`, m = `${-f}px`) : l === "top" ? (h = s ? u : `${p}px`, m = `${o.floating.height + f}px`) : l === "right" ? (h = `${-f}px`, m = s ? u : `${d}px`) : l === "left" && (h = `${o.floating.width + f}px`, m = s ? u : `${d}px`), { data: { x: h, y: m } };
1669
+ }
1670
+ });
1671
+ function Re(t) {
1672
+ const [e, n = "center"] = t.split("-");
1673
+ return [e, n];
1674
+ }
1675
+ var Ao = xe, Eo = be, Po = Ae, Ro = Pe;
1676
+ export {
1677
+ Eo as A,
1678
+ Po as C,
1679
+ Xe as D,
1680
+ Ao as R,
1681
+ Ro as a,
1682
+ gt as b,
1683
+ bo as c,
1684
+ vo as u
1685
+ };