@alixpartners/ui-components 2.5.7 → 2.6.0

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