@pdf-viewer/react 1.9.0-beta.3 → 1.9.0-beta.5

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 (129) hide show
  1. package/dist/Checkbox.module-3edaacbb.js +7 -0
  2. package/dist/Combination-da8647d4.js +693 -0
  3. package/dist/Container.module-f8b5c306.js +6 -0
  4. package/dist/DropDown.module-a78567cb.js +11 -0
  5. package/dist/MenuItem.module-bc11d0d3.js +6 -0
  6. package/dist/MenuSeparator.module-89b2ff7f.js +6 -0
  7. package/dist/PropertyItem.module-db0150cc.js +8 -0
  8. package/dist/RPSplitter.module-13d612c4.js +7 -0
  9. package/dist/RPTheme.module-bd9038da.js +8 -0
  10. package/dist/RotateTool.module-03987eba.js +6 -0
  11. package/dist/SearchTool.module-016f3a8d.js +16 -0
  12. package/dist/ToolbarLayout.module-60c3d6e8.js +2434 -0
  13. package/dist/WrapperLayout.module-147bc943.js +6 -0
  14. package/dist/assets/Checkbox.css +1 -1
  15. package/dist/assets/ToolbarLayout.css +1 -0
  16. package/dist/components/RPController.js +9 -9
  17. package/dist/components/RPDropFileZone.js +21 -23
  18. package/dist/components/RPPages.js +21 -19
  19. package/dist/components/RPProvider.js +19 -15
  20. package/dist/components/layout/Container.js +10 -11
  21. package/dist/components/layout/LayoutContainer.js +21 -18
  22. package/dist/components/layout/RPDefaultLayout.js +76 -14
  23. package/dist/components/layout/RPLayout.js +74 -25
  24. package/dist/components/layout/WrapperLayout.js +7 -8
  25. package/dist/components/layout/sidebar/RPSidebar.js +51 -12
  26. package/dist/components/layout/sidebar/RPSplitter.js +7 -9
  27. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  28. package/dist/components/layout/sidebar/Thumbnails.js +3 -2
  29. package/dist/components/layout/toolbar/DocumentDialog.js +307 -25
  30. package/dist/components/layout/toolbar/DocumentProperties.js +23 -19
  31. package/dist/components/layout/toolbar/FileDownloadTool.js +23 -13
  32. package/dist/components/layout/toolbar/MenuItem.js +6 -7
  33. package/dist/components/layout/toolbar/MenuSeparator.js +4 -5
  34. package/dist/components/layout/toolbar/MostPageTool.js +50 -24
  35. package/dist/components/layout/toolbar/OtherTool.js +115 -22
  36. package/dist/components/layout/toolbar/Paginate.js +99 -17
  37. package/dist/components/layout/toolbar/PrintTool.js +43 -13
  38. package/dist/components/layout/toolbar/PropertyItem.js +5 -8
  39. package/dist/components/layout/toolbar/RPToolbar.js +28 -7
  40. package/dist/components/layout/toolbar/RPToolbarEnd.js +22 -7
  41. package/dist/components/layout/toolbar/RotateTool.js +20 -21
  42. package/dist/components/layout/toolbar/ScrollModeTool.js +35 -37
  43. package/dist/components/layout/toolbar/SearchCloseButton.js +19 -7
  44. package/dist/components/layout/toolbar/SearchResultNavigator.js +42 -8
  45. package/dist/components/layout/toolbar/SearchTool.js +198 -30
  46. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  47. package/dist/components/layout/toolbar/ThumbnailTool.js +4 -4
  48. package/dist/components/layout/toolbar/ToolbarCustom.js +48 -21
  49. package/dist/components/layout/toolbar/ToolbarDefault.js +82 -0
  50. package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
  51. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  52. package/dist/components/layout/toolbar/ZoomTool.js +140 -27
  53. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +3 -3
  54. package/dist/components/layout/toolbar/tools/InputPageTool.js +7 -7
  55. package/dist/components/layout/toolbar/tools/NextPageTool.js +21 -19
  56. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  57. package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
  58. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
  59. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +14 -14
  60. package/dist/components/layout/toolbar/tools/defaults/{TopbarDefaultTools.js → RPHorizontalBar.js} +29 -20
  61. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
  62. package/dist/components/page/AnnotationLayer.js +20 -18
  63. package/dist/components/page/CanvasLayer.js +20 -18
  64. package/dist/components/page/DualPage.js +1 -1
  65. package/dist/components/page/RPPage.js +21 -18
  66. package/dist/components/page/SinglePage.js +1 -1
  67. package/dist/components/page/TextHighlightLayer.js +20 -18
  68. package/dist/components/page/TextLayer.js +20 -18
  69. package/dist/components/ui/Button.js +8 -8
  70. package/dist/components/ui/Checkbox.js +70 -61
  71. package/dist/components/ui/DropDown.js +14 -20
  72. package/dist/components/ui/Input.js +11 -11
  73. package/dist/components/ui/LoadingIndicator.js +22 -5
  74. package/dist/components/ui/RPTooltip.js +62 -64
  75. package/dist/contexts/PaginationContext.js +4 -4
  76. package/dist/contexts/PrintContext.js +2 -2
  77. package/dist/contexts/SearchContext.js +3 -3
  78. package/dist/contexts/ThumbnailsContext.js +1 -1
  79. package/dist/contexts/ViewportContext.js +42 -35
  80. package/dist/floating-ui.react-dom-f3f380e0.js +1447 -0
  81. package/dist/index-473557b1.js +1191 -0
  82. package/dist/{index-1cb41342.js → index-8547fbc6.js} +12 -12
  83. package/dist/main.js +76 -73
  84. package/dist/types/components/layout/LayoutContainer.d.ts +5 -1
  85. package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -1
  86. package/dist/types/components/layout/RPLayout.d.ts +2 -1
  87. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +3 -1
  88. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +2 -1
  89. package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +2 -2
  90. package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
  91. package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -0
  92. package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
  93. package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.d.ts +3 -0
  94. package/dist/types/components/page/RPPage.d.ts +3 -1
  95. package/dist/types/components/ui/Button.d.ts +3 -1
  96. package/dist/types/components/ui/Checkbox.d.ts +1 -0
  97. package/dist/types/components/ui/DropDown.d.ts +2 -1
  98. package/dist/types/components/ui/Input.d.ts +3 -1
  99. package/dist/types/components/ui/RPTooltip.d.ts +3 -1
  100. package/dist/types/main.d.ts +3 -3
  101. package/dist/types/utils/types.d.ts +17 -17
  102. package/dist/types/utils/withRef.d.ts +4 -0
  103. package/dist/utils/hooks/useFileDownload.js +20 -18
  104. package/dist/utils/hooks/useLicense.js +1 -1
  105. package/dist/utils/hooks/usePaginate.js +20 -18
  106. package/dist/utils/hooks/usePresentPage.js +20 -18
  107. package/dist/utils/hooks/usePrint.js +20 -18
  108. package/dist/utils/hooks/useScrollToPage.js +20 -18
  109. package/dist/utils/hooks/useSearch.js +20 -18
  110. package/dist/utils/hooks/useThumbnail.js +20 -18
  111. package/dist/utils/hooks/useVirtualReactWindow.js +20 -18
  112. package/dist/utils/withRef.js +8 -0
  113. package/package.json +1 -1
  114. package/dist/Popover-1faa77f6.js +0 -1445
  115. package/dist/RPLayout-897cb09d.js +0 -3393
  116. package/dist/SearchCloseButton-ddb9877e.js +0 -32
  117. package/dist/assets/Popover.css +0 -1
  118. package/dist/assets/RPLayout.css +0 -1
  119. package/dist/component-1da194e8.js +0 -337
  120. package/dist/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.js +0 -16
  121. package/dist/components/ui/Popover.js +0 -6
  122. package/dist/floating-ui.react-dom-15b9b819.js +0 -1310
  123. package/dist/index-7279fb4e.js +0 -1557
  124. package/dist/index-aa2d3884.js +0 -140
  125. package/dist/types/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.d.ts +0 -3
  126. package/dist/types/components/layout/toolbar/tools/defaults/TopbarDefaultTools.d.ts +0 -3
  127. package/dist/types/components/ui/Popover.d.ts +0 -9
  128. /package/dist/assets/{RPDropFileZone.css → RPTheme.css} +0 -0
  129. /package/dist/assets/{SearchCloseButton.css → SearchTool.css} +0 -0
@@ -1,1310 +0,0 @@
1
- import * as S from "react";
2
- import { useLayoutEffect as jt, useEffect as It } from "react";
3
- import * as Yt from "react-dom";
4
- const qt = ["top", "right", "bottom", "left"], X = Math.min, F = Math.max, st = Math.round, it = Math.floor, V = (t) => ({
5
- x: t,
6
- y: t
7
- }), Xt = {
8
- left: "right",
9
- right: "left",
10
- bottom: "top",
11
- top: "bottom"
12
- }, Ut = {
13
- start: "end",
14
- end: "start"
15
- };
16
- function gt(t, e, n) {
17
- return F(t, X(e, n));
18
- }
19
- function I(t, e) {
20
- return typeof t == "function" ? t(e) : t;
21
- }
22
- function Y(t) {
23
- return t.split("-")[0];
24
- }
25
- function Z(t) {
26
- return t.split("-")[1];
27
- }
28
- function xt(t) {
29
- return t === "x" ? "y" : "x";
30
- }
31
- function yt(t) {
32
- return t === "y" ? "height" : "width";
33
- }
34
- function U(t) {
35
- return ["top", "bottom"].includes(Y(t)) ? "y" : "x";
36
- }
37
- function vt(t) {
38
- return xt(U(t));
39
- }
40
- function Kt(t, e, n) {
41
- n === void 0 && (n = !1);
42
- const o = Z(t), i = vt(t), r = yt(i);
43
- let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
44
- return e.reference[r] > e.floating[r] && (s = ct(s)), [s, ct(s)];
45
- }
46
- function Gt(t) {
47
- const e = ct(t);
48
- return [pt(t), e, pt(e)];
49
- }
50
- function pt(t) {
51
- return t.replace(/start|end/g, (e) => Ut[e]);
52
- }
53
- function Jt(t, e, n) {
54
- const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
55
- switch (t) {
56
- case "top":
57
- case "bottom":
58
- return n ? e ? i : o : e ? o : i;
59
- case "left":
60
- case "right":
61
- return e ? r : s;
62
- default:
63
- return [];
64
- }
65
- }
66
- function Qt(t, e, n, o) {
67
- const i = Z(t);
68
- let r = Jt(Y(t), n === "start", o);
69
- return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(pt)))), r;
70
- }
71
- function ct(t) {
72
- return t.replace(/left|right|bottom|top/g, (e) => Xt[e]);
73
- }
74
- function Zt(t) {
75
- return {
76
- top: 0,
77
- right: 0,
78
- bottom: 0,
79
- left: 0,
80
- ...t
81
- };
82
- }
83
- function kt(t) {
84
- return typeof t != "number" ? Zt(t) : {
85
- top: t,
86
- right: t,
87
- bottom: t,
88
- left: t
89
- };
90
- }
91
- function lt(t) {
92
- const {
93
- x: e,
94
- y: n,
95
- width: o,
96
- height: i
97
- } = t;
98
- return {
99
- width: o,
100
- height: i,
101
- top: n,
102
- left: e,
103
- right: e + o,
104
- bottom: n + i,
105
- x: e,
106
- y: n
107
- };
108
- }
109
- function Ct(t, e, n) {
110
- let {
111
- reference: o,
112
- floating: i
113
- } = t;
114
- const r = U(e), s = vt(e), c = yt(s), f = Y(e), l = r === "y", a = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, m = o[c] / 2 - i[c] / 2;
115
- let d;
116
- switch (f) {
117
- case "top":
118
- d = {
119
- x: a,
120
- y: o.y - i.height
121
- };
122
- break;
123
- case "bottom":
124
- d = {
125
- x: a,
126
- y: o.y + o.height
127
- };
128
- break;
129
- case "right":
130
- d = {
131
- x: o.x + o.width,
132
- y: u
133
- };
134
- break;
135
- case "left":
136
- d = {
137
- x: o.x - i.width,
138
- y: u
139
- };
140
- break;
141
- default:
142
- d = {
143
- x: o.x,
144
- y: o.y
145
- };
146
- }
147
- switch (Z(e)) {
148
- case "start":
149
- d[s] -= m * (n && l ? -1 : 1);
150
- break;
151
- case "end":
152
- d[s] += m * (n && l ? -1 : 1);
153
- break;
154
- }
155
- return d;
156
- }
157
- const te = async (t, e, n) => {
158
- const {
159
- placement: o = "bottom",
160
- strategy: i = "absolute",
161
- middleware: r = [],
162
- platform: s
163
- } = n, c = r.filter(Boolean), f = await (s.isRTL == null ? void 0 : s.isRTL(e));
164
- let l = await s.getElementRects({
165
- reference: t,
166
- floating: e,
167
- strategy: i
168
- }), {
169
- x: a,
170
- y: u
171
- } = Ct(l, o, f), m = o, d = {}, h = 0;
172
- for (let g = 0; g < c.length; g++) {
173
- const {
174
- name: p,
175
- fn: w
176
- } = c[g], {
177
- x: v,
178
- y,
179
- data: b,
180
- reset: x
181
- } = await w({
182
- x: a,
183
- y: u,
184
- initialPlacement: o,
185
- placement: m,
186
- strategy: i,
187
- middlewareData: d,
188
- rects: l,
189
- platform: s,
190
- elements: {
191
- reference: t,
192
- floating: e
193
- }
194
- });
195
- a = v ?? a, u = y ?? u, d = {
196
- ...d,
197
- [p]: {
198
- ...d[p],
199
- ...b
200
- }
201
- }, x && h <= 50 && (h++, typeof x == "object" && (x.placement && (m = x.placement), x.rects && (l = x.rects === !0 ? await s.getElementRects({
202
- reference: t,
203
- floating: e,
204
- strategy: i
205
- }) : x.rects), {
206
- x: a,
207
- y: u
208
- } = Ct(l, m, f)), g = -1);
209
- }
210
- return {
211
- x: a,
212
- y: u,
213
- placement: m,
214
- strategy: i,
215
- middlewareData: d
216
- };
217
- };
218
- async function et(t, e) {
219
- var n;
220
- e === void 0 && (e = {});
221
- const {
222
- x: o,
223
- y: i,
224
- platform: r,
225
- rects: s,
226
- elements: c,
227
- strategy: f
228
- } = t, {
229
- boundary: l = "clippingAncestors",
230
- rootBoundary: a = "viewport",
231
- elementContext: u = "floating",
232
- altBoundary: m = !1,
233
- padding: d = 0
234
- } = I(e, t), h = kt(d), p = c[m ? u === "floating" ? "reference" : "floating" : u], w = lt(await r.getClippingRect({
235
- element: (n = await (r.isElement == null ? void 0 : r.isElement(p))) == null || n ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
236
- boundary: l,
237
- rootBoundary: a,
238
- strategy: f
239
- })), v = u === "floating" ? {
240
- x: o,
241
- y: i,
242
- width: s.floating.width,
243
- height: s.floating.height
244
- } : s.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
245
- x: 1,
246
- y: 1
247
- } : {
248
- x: 1,
249
- y: 1
250
- }, x = lt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
251
- elements: c,
252
- rect: v,
253
- offsetParent: y,
254
- strategy: f
255
- }) : v);
256
- return {
257
- top: (w.top - x.top + h.top) / b.y,
258
- bottom: (x.bottom - w.bottom + h.bottom) / b.y,
259
- left: (w.left - x.left + h.left) / b.x,
260
- right: (x.right - w.right + h.right) / b.x
261
- };
262
- }
263
- const ee = (t) => ({
264
- name: "arrow",
265
- options: t,
266
- async fn(e) {
267
- const {
268
- x: n,
269
- y: o,
270
- placement: i,
271
- rects: r,
272
- platform: s,
273
- elements: c,
274
- middlewareData: f
275
- } = e, {
276
- element: l,
277
- padding: a = 0
278
- } = I(t, e) || {};
279
- if (l == null)
280
- return {};
281
- const u = kt(a), m = {
282
- x: n,
283
- y: o
284
- }, d = vt(i), h = yt(d), g = await s.getDimensions(l), p = d === "y", w = p ? "top" : "left", v = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", b = r.reference[h] + r.reference[d] - m[d] - r.floating[h], x = m[d] - r.reference[d], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
285
- let R = O ? O[y] : 0;
286
- (!R || !await (s.isElement == null ? void 0 : s.isElement(O))) && (R = c.floating[y] || r.floating[h]);
287
- const L = b / 2 - x / 2, W = R / 2 - g[h] / 2 - 1, D = X(u[w], W), B = X(u[v], W), T = D, P = R - g[h] - B, C = R / 2 - g[h] / 2 + L, j = gt(T, C, P), E = !f.arrow && Z(i) != null && C !== j && r.reference[h] / 2 - (C < T ? D : B) - g[h] / 2 < 0, M = E ? C < T ? C - T : C - P : 0;
288
- return {
289
- [d]: m[d] + M,
290
- data: {
291
- [d]: j,
292
- centerOffset: C - j - M,
293
- ...E && {
294
- alignmentOffset: M
295
- }
296
- },
297
- reset: E
298
- };
299
- }
300
- }), ne = function(t) {
301
- return t === void 0 && (t = {}), {
302
- name: "flip",
303
- options: t,
304
- async fn(e) {
305
- var n, o;
306
- const {
307
- placement: i,
308
- middlewareData: r,
309
- rects: s,
310
- initialPlacement: c,
311
- platform: f,
312
- elements: l
313
- } = e, {
314
- mainAxis: a = !0,
315
- crossAxis: u = !0,
316
- fallbackPlacements: m,
317
- fallbackStrategy: d = "bestFit",
318
- fallbackAxisSideDirection: h = "none",
319
- flipAlignment: g = !0,
320
- ...p
321
- } = I(t, e);
322
- if ((n = r.arrow) != null && n.alignmentOffset)
323
- return {};
324
- const w = Y(i), v = U(c), y = Y(c) === c, b = await (f.isRTL == null ? void 0 : f.isRTL(l.floating)), x = m || (y || !g ? [ct(c)] : Gt(c)), O = h !== "none";
325
- !m && O && x.push(...Qt(c, g, h, b));
326
- const R = [c, ...x], L = await et(e, p), W = [];
327
- let D = ((o = r.flip) == null ? void 0 : o.overflows) || [];
328
- if (a && W.push(L[w]), u) {
329
- const C = Kt(i, s, b);
330
- W.push(L[C[0]], L[C[1]]);
331
- }
332
- if (D = [...D, {
333
- placement: i,
334
- overflows: W
335
- }], !W.every((C) => C <= 0)) {
336
- var B, T;
337
- const C = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, j = R[C];
338
- if (j)
339
- return {
340
- data: {
341
- index: C,
342
- overflows: D
343
- },
344
- reset: {
345
- placement: j
346
- }
347
- };
348
- let E = (T = D.filter((M) => M.overflows[0] <= 0).sort((M, A) => M.overflows[1] - A.overflows[1])[0]) == null ? void 0 : T.placement;
349
- if (!E)
350
- switch (d) {
351
- case "bestFit": {
352
- var P;
353
- const M = (P = D.filter((A) => {
354
- if (O) {
355
- const k = U(A.placement);
356
- return k === v || // Create a bias to the `y` side axis due to horizontal
357
- // reading directions favoring greater width.
358
- k === "y";
359
- }
360
- return !0;
361
- }).map((A) => [A.placement, A.overflows.filter((k) => k > 0).reduce((k, q) => k + q, 0)]).sort((A, k) => A[1] - k[1])[0]) == null ? void 0 : P[0];
362
- M && (E = M);
363
- break;
364
- }
365
- case "initialPlacement":
366
- E = c;
367
- break;
368
- }
369
- if (i !== E)
370
- return {
371
- reset: {
372
- placement: E
373
- }
374
- };
375
- }
376
- return {};
377
- }
378
- };
379
- };
380
- function Et(t, e) {
381
- return {
382
- top: t.top - e.height,
383
- right: t.right - e.width,
384
- bottom: t.bottom - e.height,
385
- left: t.left - e.width
386
- };
387
- }
388
- function St(t) {
389
- return qt.some((e) => t[e] >= 0);
390
- }
391
- const oe = function(t) {
392
- return t === void 0 && (t = {}), {
393
- name: "hide",
394
- options: t,
395
- async fn(e) {
396
- const {
397
- rects: n
398
- } = e, {
399
- strategy: o = "referenceHidden",
400
- ...i
401
- } = I(t, e);
402
- switch (o) {
403
- case "referenceHidden": {
404
- const r = await et(e, {
405
- ...i,
406
- elementContext: "reference"
407
- }), s = Et(r, n.reference);
408
- return {
409
- data: {
410
- referenceHiddenOffsets: s,
411
- referenceHidden: St(s)
412
- }
413
- };
414
- }
415
- case "escaped": {
416
- const r = await et(e, {
417
- ...i,
418
- altBoundary: !0
419
- }), s = Et(r, n.floating);
420
- return {
421
- data: {
422
- escapedOffsets: s,
423
- escaped: St(s)
424
- }
425
- };
426
- }
427
- default:
428
- return {};
429
- }
430
- }
431
- };
432
- };
433
- async function ie(t, e) {
434
- const {
435
- placement: n,
436
- platform: o,
437
- elements: i
438
- } = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = Y(n), c = Z(n), f = U(n) === "y", l = ["left", "top"].includes(s) ? -1 : 1, a = r && f ? -1 : 1, u = I(e, t);
439
- let {
440
- mainAxis: m,
441
- crossAxis: d,
442
- alignmentAxis: h
443
- } = typeof u == "number" ? {
444
- mainAxis: u,
445
- crossAxis: 0,
446
- alignmentAxis: null
447
- } : {
448
- mainAxis: u.mainAxis || 0,
449
- crossAxis: u.crossAxis || 0,
450
- alignmentAxis: u.alignmentAxis
451
- };
452
- return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), f ? {
453
- x: d * a,
454
- y: m * l
455
- } : {
456
- x: m * l,
457
- y: d * a
458
- };
459
- }
460
- const re = function(t) {
461
- return t === void 0 && (t = 0), {
462
- name: "offset",
463
- options: t,
464
- async fn(e) {
465
- var n, o;
466
- const {
467
- x: i,
468
- y: r,
469
- placement: s,
470
- middlewareData: c
471
- } = e, f = await ie(e, t);
472
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
473
- x: i + f.x,
474
- y: r + f.y,
475
- data: {
476
- ...f,
477
- placement: s
478
- }
479
- };
480
- }
481
- };
482
- }, se = function(t) {
483
- return t === void 0 && (t = {}), {
484
- name: "shift",
485
- options: t,
486
- async fn(e) {
487
- const {
488
- x: n,
489
- y: o,
490
- placement: i
491
- } = e, {
492
- mainAxis: r = !0,
493
- crossAxis: s = !1,
494
- limiter: c = {
495
- fn: (p) => {
496
- let {
497
- x: w,
498
- y: v
499
- } = p;
500
- return {
501
- x: w,
502
- y: v
503
- };
504
- }
505
- },
506
- ...f
507
- } = I(t, e), l = {
508
- x: n,
509
- y: o
510
- }, a = await et(e, f), u = U(Y(i)), m = xt(u);
511
- let d = l[m], h = l[u];
512
- if (r) {
513
- const p = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", v = d + a[p], y = d - a[w];
514
- d = gt(v, d, y);
515
- }
516
- if (s) {
517
- const p = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", v = h + a[p], y = h - a[w];
518
- h = gt(v, h, y);
519
- }
520
- const g = c.fn({
521
- ...e,
522
- [m]: d,
523
- [u]: h
524
- });
525
- return {
526
- ...g,
527
- data: {
528
- x: g.x - n,
529
- y: g.y - o,
530
- enabled: {
531
- [m]: r,
532
- [u]: s
533
- }
534
- }
535
- };
536
- }
537
- };
538
- }, ce = function(t) {
539
- return t === void 0 && (t = {}), {
540
- options: t,
541
- fn(e) {
542
- const {
543
- x: n,
544
- y: o,
545
- placement: i,
546
- rects: r,
547
- middlewareData: s
548
- } = e, {
549
- offset: c = 0,
550
- mainAxis: f = !0,
551
- crossAxis: l = !0
552
- } = I(t, e), a = {
553
- x: n,
554
- y: o
555
- }, u = U(i), m = xt(u);
556
- let d = a[m], h = a[u];
557
- const g = I(c, e), p = typeof g == "number" ? {
558
- mainAxis: g,
559
- crossAxis: 0
560
- } : {
561
- mainAxis: 0,
562
- crossAxis: 0,
563
- ...g
564
- };
565
- if (f) {
566
- const y = m === "y" ? "height" : "width", b = r.reference[m] - r.floating[y] + p.mainAxis, x = r.reference[m] + r.reference[y] - p.mainAxis;
567
- d < b ? d = b : d > x && (d = x);
568
- }
569
- if (l) {
570
- var w, v;
571
- const y = m === "y" ? "width" : "height", b = ["top", "left"].includes(Y(i)), x = r.reference[u] - r.floating[y] + (b && ((w = s.offset) == null ? void 0 : w[u]) || 0) + (b ? 0 : p.crossAxis), O = r.reference[u] + r.reference[y] + (b ? 0 : ((v = s.offset) == null ? void 0 : v[u]) || 0) - (b ? p.crossAxis : 0);
572
- h < x ? h = x : h > O && (h = O);
573
- }
574
- return {
575
- [m]: d,
576
- [u]: h
577
- };
578
- }
579
- };
580
- }, le = function(t) {
581
- return t === void 0 && (t = {}), {
582
- name: "size",
583
- options: t,
584
- async fn(e) {
585
- var n, o;
586
- const {
587
- placement: i,
588
- rects: r,
589
- platform: s,
590
- elements: c
591
- } = e, {
592
- apply: f = () => {
593
- },
594
- ...l
595
- } = I(t, e), a = await et(e, l), u = Y(i), m = Z(i), d = U(i) === "y", {
596
- width: h,
597
- height: g
598
- } = r.floating;
599
- let p, w;
600
- u === "top" || u === "bottom" ? (p = u, w = m === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (w = u, p = m === "end" ? "top" : "bottom");
601
- const v = g - a.top - a.bottom, y = h - a.left - a.right, b = X(g - a[p], v), x = X(h - a[w], y), O = !e.middlewareData.shift;
602
- let R = b, L = x;
603
- if ((n = e.middlewareData.shift) != null && n.enabled.x && (L = y), (o = e.middlewareData.shift) != null && o.enabled.y && (R = v), O && !m) {
604
- const D = F(a.left, 0), B = F(a.right, 0), T = F(a.top, 0), P = F(a.bottom, 0);
605
- d ? L = h - 2 * (D !== 0 || B !== 0 ? D + B : F(a.left, a.right)) : R = g - 2 * (T !== 0 || P !== 0 ? T + P : F(a.top, a.bottom));
606
- }
607
- await f({
608
- ...e,
609
- availableWidth: L,
610
- availableHeight: R
611
- });
612
- const W = await s.getDimensions(c.floating);
613
- return h !== W.width || g !== W.height ? {
614
- reset: {
615
- rects: !0
616
- }
617
- } : {};
618
- }
619
- };
620
- };
621
- function at() {
622
- return typeof window < "u";
623
- }
624
- function tt(t) {
625
- return Ft(t) ? (t.nodeName || "").toLowerCase() : "#document";
626
- }
627
- function $(t) {
628
- var e;
629
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
630
- }
631
- function z(t) {
632
- var e;
633
- return (e = (Ft(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
634
- }
635
- function Ft(t) {
636
- return at() ? t instanceof Node || t instanceof $(t).Node : !1;
637
- }
638
- function H(t) {
639
- return at() ? t instanceof Element || t instanceof $(t).Element : !1;
640
- }
641
- function _(t) {
642
- return at() ? t instanceof HTMLElement || t instanceof $(t).HTMLElement : !1;
643
- }
644
- function Dt(t) {
645
- return !at() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof $(t).ShadowRoot;
646
- }
647
- function ot(t) {
648
- const {
649
- overflow: e,
650
- overflowX: n,
651
- overflowY: o,
652
- display: i
653
- } = N(t);
654
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
655
- }
656
- function fe(t) {
657
- return ["table", "td", "th"].includes(tt(t));
658
- }
659
- function ut(t) {
660
- return [":popover-open", ":modal"].some((e) => {
661
- try {
662
- return t.matches(e);
663
- } catch {
664
- return !1;
665
- }
666
- });
667
- }
668
- function bt(t) {
669
- const e = At(), n = H(t) ? N(t) : t;
670
- return ["transform", "translate", "scale", "rotate", "perspective"].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) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
671
- }
672
- function ae(t) {
673
- let e = K(t);
674
- for (; _(e) && !Q(e); ) {
675
- if (bt(e))
676
- return e;
677
- if (ut(e))
678
- return null;
679
- e = K(e);
680
- }
681
- return null;
682
- }
683
- function At() {
684
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
685
- }
686
- function Q(t) {
687
- return ["html", "body", "#document"].includes(tt(t));
688
- }
689
- function N(t) {
690
- return $(t).getComputedStyle(t);
691
- }
692
- function dt(t) {
693
- return H(t) ? {
694
- scrollLeft: t.scrollLeft,
695
- scrollTop: t.scrollTop
696
- } : {
697
- scrollLeft: t.scrollX,
698
- scrollTop: t.scrollY
699
- };
700
- }
701
- function K(t) {
702
- if (tt(t) === "html")
703
- return t;
704
- const e = (
705
- // Step into the shadow DOM of the parent of a slotted node.
706
- t.assignedSlot || // DOM Element detected.
707
- t.parentNode || // ShadowRoot detected.
708
- Dt(t) && t.host || // Fallback.
709
- z(t)
710
- );
711
- return Dt(e) ? e.host : e;
712
- }
713
- function $t(t) {
714
- const e = K(t);
715
- return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : _(e) && ot(e) ? e : $t(e);
716
- }
717
- function nt(t, e, n) {
718
- var o;
719
- e === void 0 && (e = []), n === void 0 && (n = !0);
720
- const i = $t(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = $(i);
721
- if (r) {
722
- const c = wt(s);
723
- return e.concat(s, s.visualViewport || [], ot(i) ? i : [], c && n ? nt(c) : []);
724
- }
725
- return e.concat(i, nt(i, [], n));
726
- }
727
- function wt(t) {
728
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
729
- }
730
- function Wt(t) {
731
- const e = N(t);
732
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
733
- const i = _(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, c = st(n) !== r || st(o) !== s;
734
- return c && (n = r, o = s), {
735
- width: n,
736
- height: o,
737
- $: c
738
- };
739
- }
740
- function Rt(t) {
741
- return H(t) ? t : t.contextElement;
742
- }
743
- function J(t) {
744
- const e = Rt(t);
745
- if (!_(e))
746
- return V(1);
747
- const n = e.getBoundingClientRect(), {
748
- width: o,
749
- height: i,
750
- $: r
751
- } = Wt(e);
752
- let s = (r ? st(n.width) : n.width) / o, c = (r ? st(n.height) : n.height) / i;
753
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
754
- x: s,
755
- y: c
756
- };
757
- }
758
- const ue = /* @__PURE__ */ V(0);
759
- function Bt(t) {
760
- const e = $(t);
761
- return !At() || !e.visualViewport ? ue : {
762
- x: e.visualViewport.offsetLeft,
763
- y: e.visualViewport.offsetTop
764
- };
765
- }
766
- function de(t, e, n) {
767
- return e === void 0 && (e = !1), !n || e && n !== $(t) ? !1 : e;
768
- }
769
- function G(t, e, n, o) {
770
- e === void 0 && (e = !1), n === void 0 && (n = !1);
771
- const i = t.getBoundingClientRect(), r = Rt(t);
772
- let s = V(1);
773
- e && (o ? H(o) && (s = J(o)) : s = J(t));
774
- const c = de(r, n, o) ? Bt(r) : V(0);
775
- let f = (i.left + c.x) / s.x, l = (i.top + c.y) / s.y, a = i.width / s.x, u = i.height / s.y;
776
- if (r) {
777
- const m = $(r), d = o && H(o) ? $(o) : o;
778
- let h = m, g = wt(h);
779
- for (; g && o && d !== h; ) {
780
- const p = J(g), w = g.getBoundingClientRect(), v = N(g), y = w.left + (g.clientLeft + parseFloat(v.paddingLeft)) * p.x, b = w.top + (g.clientTop + parseFloat(v.paddingTop)) * p.y;
781
- f *= p.x, l *= p.y, a *= p.x, u *= p.y, f += y, l += b, h = $(g), g = wt(h);
782
- }
783
- }
784
- return lt({
785
- width: a,
786
- height: u,
787
- x: f,
788
- y: l
789
- });
790
- }
791
- function Ot(t, e) {
792
- const n = dt(t).scrollLeft;
793
- return e ? e.left + n : G(z(t)).left + n;
794
- }
795
- function Ht(t, e, n) {
796
- n === void 0 && (n = !1);
797
- const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - (n ? 0 : (
798
- // RTL <body> scrollbar.
799
- Ot(t, o)
800
- )), r = o.top + e.scrollTop;
801
- return {
802
- x: i,
803
- y: r
804
- };
805
- }
806
- function me(t) {
807
- let {
808
- elements: e,
809
- rect: n,
810
- offsetParent: o,
811
- strategy: i
812
- } = t;
813
- const r = i === "fixed", s = z(o), c = e ? ut(e.floating) : !1;
814
- if (o === s || c && r)
815
- return n;
816
- let f = {
817
- scrollLeft: 0,
818
- scrollTop: 0
819
- }, l = V(1);
820
- const a = V(0), u = _(o);
821
- if ((u || !u && !r) && ((tt(o) !== "body" || ot(s)) && (f = dt(o)), _(o))) {
822
- const d = G(o);
823
- l = J(o), a.x = d.x + o.clientLeft, a.y = d.y + o.clientTop;
824
- }
825
- const m = s && !u && !r ? Ht(s, f, !0) : V(0);
826
- return {
827
- width: n.width * l.x,
828
- height: n.height * l.y,
829
- x: n.x * l.x - f.scrollLeft * l.x + a.x + m.x,
830
- y: n.y * l.y - f.scrollTop * l.y + a.y + m.y
831
- };
832
- }
833
- function he(t) {
834
- return Array.from(t.getClientRects());
835
- }
836
- function ge(t) {
837
- const e = z(t), n = dt(t), o = t.ownerDocument.body, i = F(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = F(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
838
- let s = -n.scrollLeft + Ot(t);
839
- const c = -n.scrollTop;
840
- return N(o).direction === "rtl" && (s += F(e.clientWidth, o.clientWidth) - i), {
841
- width: i,
842
- height: r,
843
- x: s,
844
- y: c
845
- };
846
- }
847
- function pe(t, e) {
848
- const n = $(t), o = z(t), i = n.visualViewport;
849
- let r = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
850
- if (i) {
851
- r = i.width, s = i.height;
852
- const l = At();
853
- (!l || l && e === "fixed") && (c = i.offsetLeft, f = i.offsetTop);
854
- }
855
- return {
856
- width: r,
857
- height: s,
858
- x: c,
859
- y: f
860
- };
861
- }
862
- function we(t, e) {
863
- const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = _(t) ? J(t) : V(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, f = i * r.x, l = o * r.y;
864
- return {
865
- width: s,
866
- height: c,
867
- x: f,
868
- y: l
869
- };
870
- }
871
- function Lt(t, e, n) {
872
- let o;
873
- if (e === "viewport")
874
- o = pe(t, n);
875
- else if (e === "document")
876
- o = ge(z(t));
877
- else if (H(e))
878
- o = we(e, n);
879
- else {
880
- const i = Bt(t);
881
- o = {
882
- x: e.x - i.x,
883
- y: e.y - i.y,
884
- width: e.width,
885
- height: e.height
886
- };
887
- }
888
- return lt(o);
889
- }
890
- function Nt(t, e) {
891
- const n = K(t);
892
- return n === e || !H(n) || Q(n) ? !1 : N(n).position === "fixed" || Nt(n, e);
893
- }
894
- function xe(t, e) {
895
- const n = e.get(t);
896
- if (n)
897
- return n;
898
- let o = nt(t, [], !1).filter((c) => H(c) && tt(c) !== "body"), i = null;
899
- const r = N(t).position === "fixed";
900
- let s = r ? K(t) : t;
901
- for (; H(s) && !Q(s); ) {
902
- const c = N(s), f = bt(s);
903
- !f && c.position === "fixed" && (i = null), (r ? !f && !i : !f && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || ot(s) && !f && Nt(t, s)) ? o = o.filter((a) => a !== s) : i = c, s = K(s);
904
- }
905
- return e.set(t, o), o;
906
- }
907
- function ye(t) {
908
- let {
909
- element: e,
910
- boundary: n,
911
- rootBoundary: o,
912
- strategy: i
913
- } = t;
914
- const s = [...n === "clippingAncestors" ? ut(e) ? [] : xe(e, this._c) : [].concat(n), o], c = s[0], f = s.reduce((l, a) => {
915
- const u = Lt(e, a, i);
916
- return l.top = F(u.top, l.top), l.right = X(u.right, l.right), l.bottom = X(u.bottom, l.bottom), l.left = F(u.left, l.left), l;
917
- }, Lt(e, c, i));
918
- return {
919
- width: f.right - f.left,
920
- height: f.bottom - f.top,
921
- x: f.left,
922
- y: f.top
923
- };
924
- }
925
- function ve(t) {
926
- const {
927
- width: e,
928
- height: n
929
- } = Wt(t);
930
- return {
931
- width: e,
932
- height: n
933
- };
934
- }
935
- function be(t, e, n) {
936
- const o = _(e), i = z(e), r = n === "fixed", s = G(t, !0, r, e);
937
- let c = {
938
- scrollLeft: 0,
939
- scrollTop: 0
940
- };
941
- const f = V(0);
942
- if (o || !o && !r)
943
- if ((tt(e) !== "body" || ot(i)) && (c = dt(e)), o) {
944
- const m = G(e, !0, r, e);
945
- f.x = m.x + e.clientLeft, f.y = m.y + e.clientTop;
946
- } else
947
- i && (f.x = Ot(i));
948
- const l = i && !o && !r ? Ht(i, c) : V(0), a = s.left + c.scrollLeft - f.x - l.x, u = s.top + c.scrollTop - f.y - l.y;
949
- return {
950
- x: a,
951
- y: u,
952
- width: s.width,
953
- height: s.height
954
- };
955
- }
956
- function mt(t) {
957
- return N(t).position === "static";
958
- }
959
- function Pt(t, e) {
960
- if (!_(t) || N(t).position === "fixed")
961
- return null;
962
- if (e)
963
- return e(t);
964
- let n = t.offsetParent;
965
- return z(t) === n && (n = n.ownerDocument.body), n;
966
- }
967
- function Vt(t, e) {
968
- const n = $(t);
969
- if (ut(t))
970
- return n;
971
- if (!_(t)) {
972
- let i = K(t);
973
- for (; i && !Q(i); ) {
974
- if (H(i) && !mt(i))
975
- return i;
976
- i = K(i);
977
- }
978
- return n;
979
- }
980
- let o = Pt(t, e);
981
- for (; o && fe(o) && mt(o); )
982
- o = Pt(o, e);
983
- return o && Q(o) && mt(o) && !bt(o) ? n : o || ae(t) || n;
984
- }
985
- const Ae = async function(t) {
986
- const e = this.getOffsetParent || Vt, n = this.getDimensions, o = await n(t.floating);
987
- return {
988
- reference: be(t.reference, await e(t.floating), t.strategy),
989
- floating: {
990
- x: 0,
991
- y: 0,
992
- width: o.width,
993
- height: o.height
994
- }
995
- };
996
- };
997
- function Re(t) {
998
- return N(t).direction === "rtl";
999
- }
1000
- const Oe = {
1001
- convertOffsetParentRelativeRectToViewportRelativeRect: me,
1002
- getDocumentElement: z,
1003
- getClippingRect: ye,
1004
- getOffsetParent: Vt,
1005
- getElementRects: Ae,
1006
- getClientRects: he,
1007
- getDimensions: ve,
1008
- getScale: J,
1009
- isElement: H,
1010
- isRTL: Re
1011
- };
1012
- function _t(t, e) {
1013
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1014
- }
1015
- function Ce(t, e) {
1016
- let n = null, o;
1017
- const i = z(t);
1018
- function r() {
1019
- var c;
1020
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1021
- }
1022
- function s(c, f) {
1023
- c === void 0 && (c = !1), f === void 0 && (f = 1), r();
1024
- const l = t.getBoundingClientRect(), {
1025
- left: a,
1026
- top: u,
1027
- width: m,
1028
- height: d
1029
- } = l;
1030
- if (c || e(), !m || !d)
1031
- return;
1032
- const h = it(u), g = it(i.clientWidth - (a + m)), p = it(i.clientHeight - (u + d)), w = it(a), y = {
1033
- rootMargin: -h + "px " + -g + "px " + -p + "px " + -w + "px",
1034
- threshold: F(0, X(1, f)) || 1
1035
- };
1036
- let b = !0;
1037
- function x(O) {
1038
- const R = O[0].intersectionRatio;
1039
- if (R !== f) {
1040
- if (!b)
1041
- return s();
1042
- R ? s(!1, R) : o = setTimeout(() => {
1043
- s(!1, 1e-7);
1044
- }, 1e3);
1045
- }
1046
- R === 1 && !_t(l, t.getBoundingClientRect()) && s(), b = !1;
1047
- }
1048
- try {
1049
- n = new IntersectionObserver(x, {
1050
- ...y,
1051
- // Handle <iframe>s
1052
- root: i.ownerDocument
1053
- });
1054
- } catch {
1055
- n = new IntersectionObserver(x, y);
1056
- }
1057
- n.observe(t);
1058
- }
1059
- return s(!0), r;
1060
- }
1061
- function $e(t, e, n, o) {
1062
- o === void 0 && (o = {});
1063
- const {
1064
- ancestorScroll: i = !0,
1065
- ancestorResize: r = !0,
1066
- elementResize: s = typeof ResizeObserver == "function",
1067
- layoutShift: c = typeof IntersectionObserver == "function",
1068
- animationFrame: f = !1
1069
- } = o, l = Rt(t), a = i || r ? [...l ? nt(l) : [], ...nt(e)] : [];
1070
- a.forEach((w) => {
1071
- i && w.addEventListener("scroll", n, {
1072
- passive: !0
1073
- }), r && w.addEventListener("resize", n);
1074
- });
1075
- const u = l && c ? Ce(l, n) : null;
1076
- let m = -1, d = null;
1077
- s && (d = new ResizeObserver((w) => {
1078
- let [v] = w;
1079
- v && v.target === l && d && (d.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1080
- var y;
1081
- (y = d) == null || y.observe(e);
1082
- })), n();
1083
- }), l && !f && d.observe(l), d.observe(e));
1084
- let h, g = f ? G(t) : null;
1085
- f && p();
1086
- function p() {
1087
- const w = G(t);
1088
- g && !_t(g, w) && n(), g = w, h = requestAnimationFrame(p);
1089
- }
1090
- return n(), () => {
1091
- var w;
1092
- a.forEach((v) => {
1093
- i && v.removeEventListener("scroll", n), r && v.removeEventListener("resize", n);
1094
- }), u == null || u(), (w = d) == null || w.disconnect(), d = null, f && cancelAnimationFrame(h);
1095
- };
1096
- }
1097
- const Ee = re, Se = se, De = ne, Le = le, Pe = oe, Tt = ee, Te = ce, Me = (t, e, n) => {
1098
- const o = /* @__PURE__ */ new Map(), i = {
1099
- platform: Oe,
1100
- ...n
1101
- }, r = {
1102
- ...i.platform,
1103
- _c: o
1104
- };
1105
- return te(t, e, {
1106
- ...i,
1107
- platform: r
1108
- });
1109
- };
1110
- var rt = typeof document < "u" ? jt : It;
1111
- function ft(t, e) {
1112
- if (t === e)
1113
- return !0;
1114
- if (typeof t != typeof e)
1115
- return !1;
1116
- if (typeof t == "function" && t.toString() === e.toString())
1117
- return !0;
1118
- let n, o, i;
1119
- if (t && e && typeof t == "object") {
1120
- if (Array.isArray(t)) {
1121
- if (n = t.length, n !== e.length)
1122
- return !1;
1123
- for (o = n; o-- !== 0; )
1124
- if (!ft(t[o], e[o]))
1125
- return !1;
1126
- return !0;
1127
- }
1128
- if (i = Object.keys(t), n = i.length, n !== Object.keys(e).length)
1129
- return !1;
1130
- for (o = n; o-- !== 0; )
1131
- if (!{}.hasOwnProperty.call(e, i[o]))
1132
- return !1;
1133
- for (o = n; o-- !== 0; ) {
1134
- const r = i[o];
1135
- if (!(r === "_owner" && t.$$typeof) && !ft(t[r], e[r]))
1136
- return !1;
1137
- }
1138
- return !0;
1139
- }
1140
- return t !== t && e !== e;
1141
- }
1142
- function zt(t) {
1143
- return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1144
- }
1145
- function Mt(t, e) {
1146
- const n = zt(t);
1147
- return Math.round(e * n) / n;
1148
- }
1149
- function ht(t) {
1150
- const e = S.useRef(t);
1151
- return rt(() => {
1152
- e.current = t;
1153
- }), e;
1154
- }
1155
- function We(t) {
1156
- t === void 0 && (t = {});
1157
- const {
1158
- placement: e = "bottom",
1159
- strategy: n = "absolute",
1160
- middleware: o = [],
1161
- platform: i,
1162
- elements: {
1163
- reference: r,
1164
- floating: s
1165
- } = {},
1166
- transform: c = !0,
1167
- whileElementsMounted: f,
1168
- open: l
1169
- } = t, [a, u] = S.useState({
1170
- x: 0,
1171
- y: 0,
1172
- strategy: n,
1173
- placement: e,
1174
- middlewareData: {},
1175
- isPositioned: !1
1176
- }), [m, d] = S.useState(o);
1177
- ft(m, o) || d(o);
1178
- const [h, g] = S.useState(null), [p, w] = S.useState(null), v = S.useCallback((A) => {
1179
- A !== O.current && (O.current = A, g(A));
1180
- }, []), y = S.useCallback((A) => {
1181
- A !== R.current && (R.current = A, w(A));
1182
- }, []), b = r || h, x = s || p, O = S.useRef(null), R = S.useRef(null), L = S.useRef(a), W = f != null, D = ht(f), B = ht(i), T = ht(l), P = S.useCallback(() => {
1183
- if (!O.current || !R.current)
1184
- return;
1185
- const A = {
1186
- placement: e,
1187
- strategy: n,
1188
- middleware: m
1189
- };
1190
- B.current && (A.platform = B.current), Me(O.current, R.current, A).then((k) => {
1191
- const q = {
1192
- ...k,
1193
- // The floating element's position may be recomputed while it's closed
1194
- // but still mounted (such as when transitioning out). To ensure
1195
- // `isPositioned` will be `false` initially on the next open, avoid
1196
- // setting it to `true` when `open === false` (must be specified).
1197
- isPositioned: T.current !== !1
1198
- };
1199
- C.current && !ft(L.current, q) && (L.current = q, Yt.flushSync(() => {
1200
- u(q);
1201
- }));
1202
- });
1203
- }, [m, e, n, B, T]);
1204
- rt(() => {
1205
- l === !1 && L.current.isPositioned && (L.current.isPositioned = !1, u((A) => ({
1206
- ...A,
1207
- isPositioned: !1
1208
- })));
1209
- }, [l]);
1210
- const C = S.useRef(!1);
1211
- rt(() => (C.current = !0, () => {
1212
- C.current = !1;
1213
- }), []), rt(() => {
1214
- if (b && (O.current = b), x && (R.current = x), b && x) {
1215
- if (D.current)
1216
- return D.current(b, x, P);
1217
- P();
1218
- }
1219
- }, [b, x, P, D, W]);
1220
- const j = S.useMemo(() => ({
1221
- reference: O,
1222
- floating: R,
1223
- setReference: v,
1224
- setFloating: y
1225
- }), [v, y]), E = S.useMemo(() => ({
1226
- reference: b,
1227
- floating: x
1228
- }), [b, x]), M = S.useMemo(() => {
1229
- const A = {
1230
- position: n,
1231
- left: 0,
1232
- top: 0
1233
- };
1234
- if (!E.floating)
1235
- return A;
1236
- const k = Mt(E.floating, a.x), q = Mt(E.floating, a.y);
1237
- return c ? {
1238
- ...A,
1239
- transform: "translate(" + k + "px, " + q + "px)",
1240
- ...zt(E.floating) >= 1.5 && {
1241
- willChange: "transform"
1242
- }
1243
- } : {
1244
- position: n,
1245
- left: k,
1246
- top: q
1247
- };
1248
- }, [n, c, E.floating, a.x, a.y]);
1249
- return S.useMemo(() => ({
1250
- ...a,
1251
- update: P,
1252
- refs: j,
1253
- elements: E,
1254
- floatingStyles: M
1255
- }), [a, P, j, E, M]);
1256
- }
1257
- const ke = (t) => {
1258
- function e(n) {
1259
- return {}.hasOwnProperty.call(n, "current");
1260
- }
1261
- return {
1262
- name: "arrow",
1263
- options: t,
1264
- fn(n) {
1265
- const {
1266
- element: o,
1267
- padding: i
1268
- } = typeof t == "function" ? t(n) : t;
1269
- return o && e(o) ? o.current != null ? Tt({
1270
- element: o.current,
1271
- padding: i
1272
- }).fn(n) : {} : o ? Tt({
1273
- element: o,
1274
- padding: i
1275
- }).fn(n) : {};
1276
- }
1277
- };
1278
- }, Be = (t, e) => ({
1279
- ...Ee(t),
1280
- options: [t, e]
1281
- }), He = (t, e) => ({
1282
- ...Se(t),
1283
- options: [t, e]
1284
- }), Ne = (t, e) => ({
1285
- ...Te(t),
1286
- options: [t, e]
1287
- }), Ve = (t, e) => ({
1288
- ...De(t),
1289
- options: [t, e]
1290
- }), _e = (t, e) => ({
1291
- ...Le(t),
1292
- options: [t, e]
1293
- }), ze = (t, e) => ({
1294
- ...Pe(t),
1295
- options: [t, e]
1296
- }), je = (t, e) => ({
1297
- ...ke(t),
1298
- options: [t, e]
1299
- });
1300
- export {
1301
- $e as a,
1302
- _e as b,
1303
- je as c,
1304
- Ve as f,
1305
- ze as h,
1306
- Ne as l,
1307
- Be as o,
1308
- He as s,
1309
- We as u
1310
- };