@pismo/marola 0.0.1-alpha.9 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +1 -1
  2. package/dist/{Button-B1umG8kJ.js → Button-2b1peDFT.js} +25 -26
  3. package/dist/{ClickAwayListener-BKznXF1d.js → ClickAwayListener-BSW-Nd-y.js} +3 -2
  4. package/dist/Dialog.module-DFEmFdYT.js +30 -0
  5. package/dist/Group-B3p31ftp.js +26 -0
  6. package/dist/Popup-B6ZSGIEI.js +1248 -0
  7. package/dist/{Portal-BcdMtRGF.js → Portal-DIeBsWdL.js} +2 -2
  8. package/dist/SelectButton-C8JQKaf4.js +61 -0
  9. package/dist/Tabs.module-jkH1Qjn7.js +22 -0
  10. package/dist/Toggle-BCgIItCc.js +142 -0
  11. package/dist/assets/Advice.css +1 -1
  12. package/dist/assets/Button.css +1 -1
  13. package/dist/assets/Checkbox.css +1 -1
  14. package/dist/assets/Dialog.css +1 -1
  15. package/dist/assets/EllipsisTooltip.css +1 -0
  16. package/dist/assets/Group.css +1 -0
  17. package/dist/assets/IconButton.css +1 -1
  18. package/dist/assets/Input.css +1 -1
  19. package/dist/assets/InputSearch.css +1 -1
  20. package/dist/assets/PageHeader.css +1 -1
  21. package/dist/assets/Pagination.css +1 -1
  22. package/dist/assets/SelectButton.css +1 -0
  23. package/dist/assets/Skeleton.css +1 -1
  24. package/dist/assets/Snackbar.css +1 -1
  25. package/dist/assets/SortTooltip.css +1 -1
  26. package/dist/assets/Stepper.css +1 -1
  27. package/dist/assets/Table.css +1 -1
  28. package/dist/assets/TextDisplay.css +1 -0
  29. package/dist/assets/Toggle.css +1 -1
  30. package/dist/assets/Toggle2.css +1 -0
  31. package/dist/assets/Typography.css +1 -1
  32. package/dist/combineHooksSlotProps-DVjg9PRh.js +80 -0
  33. package/dist/components/Advice/Advice.d.ts +17 -3
  34. package/dist/components/Advice/Advice.js +39 -17
  35. package/dist/components/Advice/Advice.stories.d.ts +18 -0
  36. package/dist/components/Button/Button.d.ts +6 -3
  37. package/dist/components/Button/Button.js +60 -65
  38. package/dist/components/Button/Button.stories.d.ts +3 -1
  39. package/dist/components/Checkbox/Checkbox.d.ts +19 -2
  40. package/dist/components/Checkbox/Checkbox.js +63 -40
  41. package/dist/components/Checkbox/Checkbox.stories.d.ts +31 -0
  42. package/dist/components/Chip/Chip.d.ts +39 -0
  43. package/dist/components/Chip/Chip.js +19 -0
  44. package/dist/components/Chip/Chip.stories.d.ts +42 -0
  45. package/dist/components/Chip/chip.test.d.ts +1 -0
  46. package/dist/components/Dialog/Actions.js +1 -1
  47. package/dist/components/Dialog/Backdrop.js +1 -1
  48. package/dist/components/Dialog/CloseIconButton.js +2 -2
  49. package/dist/components/Dialog/Dialog.d.ts +1 -1
  50. package/dist/components/Dialog/Dialog.js +13 -13
  51. package/dist/components/Dialog/Dialog.stories.d.ts +10 -10
  52. package/dist/components/Dialog/{Title.d.ts → DialogTitle.d.ts} +3 -3
  53. package/dist/components/Dialog/DialogTitle.js +29 -0
  54. package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +7 -0
  55. package/dist/components/EllipsisTooltip/EllipsisTooltip.js +23 -0
  56. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +31 -0
  57. package/dist/components/Icon/Icon.d.ts +8 -15
  58. package/dist/components/Icon/Icon.js +108 -57
  59. package/dist/components/Icon/Icon.stories.d.ts +14 -0
  60. package/dist/components/Icon/types.d.ts +5 -0
  61. package/dist/components/Icon/types.js +1 -0
  62. package/dist/components/IconButton/Icon.stories.d.ts +15 -0
  63. package/dist/components/IconButton/IconButton.d.ts +18 -2
  64. package/dist/components/IconButton/IconButton.js +58 -63
  65. package/dist/components/Input/Input.d.ts +1 -1
  66. package/dist/components/Input/Input.js +241 -230
  67. package/dist/components/InputSearch/InputSearch.d.ts +7 -9
  68. package/dist/components/InputSearch/InputSearch.js +30 -25
  69. package/dist/components/InputSearch/InputSearch.stories.d.ts +21 -4
  70. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +1 -1
  71. package/dist/components/PageHeader/PageHeader.d.ts +36 -6
  72. package/dist/components/PageHeader/PageHeader.js +83 -47
  73. package/dist/components/PageHeader/PageHeader.stories.d.ts +2 -31
  74. package/dist/components/Pagination/Pagination.d.ts +24 -5
  75. package/dist/components/Pagination/Pagination.js +127 -109
  76. package/dist/components/Pagination/Pagination.stories.d.ts +17 -0
  77. package/dist/components/Select/Select.d.ts +26 -0
  78. package/dist/components/Select/Select.js +857 -0
  79. package/dist/components/Select/Select.stories.d.ts +22 -0
  80. package/dist/components/Select/SelectButton.d.ts +12 -0
  81. package/dist/components/Select/SelectButton.js +8 -0
  82. package/dist/components/Skeleton/Skeleton.d.ts +10 -3
  83. package/dist/components/Skeleton/Skeleton.js +16 -19
  84. package/dist/components/Skeleton/Skeleton.stories.d.ts +14 -0
  85. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +14 -0
  86. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +16 -0
  87. package/dist/components/Snackbar/Snackbar.d.ts +19 -5
  88. package/dist/components/Snackbar/Snackbar.js +247 -230
  89. package/dist/components/Snackbar/Snackbar.stories.d.ts +319 -0
  90. package/dist/components/SortTooltip/SortTooltip.d.ts +3 -1
  91. package/dist/components/SortTooltip/SortTooltip.js +55 -29
  92. package/dist/components/Stepper/Stepper.d.ts +11 -1
  93. package/dist/components/Stepper/Stepper.js +37 -22
  94. package/dist/components/Stepper/Stepper.stories.d.ts +16 -0
  95. package/dist/components/Table/Table.d.ts +33 -16
  96. package/dist/components/Table/Table.js +106 -91
  97. package/dist/components/Table/Table.stories.d.ts +29 -0
  98. package/dist/components/Table/_Table.TBody.stories.d.ts +14 -0
  99. package/dist/components/Table/_Table.THead.stories.d.ts +14 -0
  100. package/dist/components/Table/_Table.Td.stories.d.ts +16 -0
  101. package/dist/components/Table/_Table.Th.stories.d.ts +15 -0
  102. package/dist/components/Table/_Table.Tr.stories.d.ts +15 -0
  103. package/dist/components/Tabs/Tab.d.ts +5 -0
  104. package/dist/components/Tabs/Tab.js +179 -6
  105. package/dist/components/Tabs/Tab.stories.d.ts +15 -0
  106. package/dist/components/Tabs/TabPanel.d.ts +4 -0
  107. package/dist/components/Tabs/TabPanel.js +12 -12
  108. package/dist/components/Tabs/TabPanel.stories.d.ts +14 -0
  109. package/dist/components/Tabs/Tabs.d.ts +5 -1
  110. package/dist/components/Tabs/Tabs.js +242 -668
  111. package/dist/components/Tabs/Tabs.stories.d.ts +14 -0
  112. package/dist/components/TextDisplay/TextDisplay.d.ts +23 -0
  113. package/dist/components/TextDisplay/TextDisplay.js +37 -0
  114. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +13 -0
  115. package/dist/components/TextDisplay/textDisplay.test.d.ts +1 -0
  116. package/dist/components/Toggle/Toggle.js +143 -129
  117. package/dist/components/ToggleGroup/Group.d.ts +18 -0
  118. package/dist/components/ToggleGroup/Group.js +7 -0
  119. package/dist/components/ToggleGroup/Group.test.d.ts +1 -0
  120. package/dist/components/ToggleGroup/Toggle.d.ts +15 -0
  121. package/dist/components/ToggleGroup/Toggle.js +17 -0
  122. package/dist/components/ToggleGroup/Toggle.test.d.ts +1 -0
  123. package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -0
  124. package/dist/components/ToggleGroup/ToggleGroup.js +6 -0
  125. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +25 -0
  126. package/dist/components/Tooltip/Tooltip.d.ts +22 -6
  127. package/dist/components/Tooltip/Tooltip.js +114 -1339
  128. package/dist/components/Tooltip/Tooltip.stories.d.ts +35 -0
  129. package/dist/components/Typography/Typography.d.ts +5 -2
  130. package/dist/components/Typography/Typography.js +58 -74
  131. package/dist/components/Typography/Typography.stories.d.ts +1 -0
  132. package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +11 -0
  133. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +50 -0
  134. package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +21 -0
  135. package/dist/{index-CqjC7P5Y.js → index-CH45lKw7.js} +333 -307
  136. package/dist/{index-BNWbc5Kh.js → index-CjW42-M-.js} +3108 -3152
  137. package/dist/main.d.ts +10 -1
  138. package/dist/main.js +74 -55
  139. package/dist/marola.css +1 -0
  140. package/dist/{useButton-Bc8IAgyk.js → useButton-DNk3wrQp.js} +3 -4
  141. package/dist/useCompoundItem-D1iRfg8D.js +84 -0
  142. package/dist/useEventCallback-xTG9piMa.js +45 -0
  143. package/dist/useList-B0hog_3-.js +436 -0
  144. package/dist/utils/styleStrings.d.ts +1 -1
  145. package/dist/utils/styleStrings.js +7 -7
  146. package/package.json +4 -4
  147. package/dist/Dialog.module-CGVM5V_D.js +0 -15
  148. package/dist/Tab-CRwnhsj5.js +0 -254
  149. package/dist/Tabs.module-yYcTJnj6.js +0 -103
  150. package/dist/_commonjsHelpers-CT_km90n.js +0 -30
  151. package/dist/assets/global.css +0 -1
  152. package/dist/components/Button/Button.stories.js +0 -40
  153. package/dist/components/Dialog/Dialog.stories.js +0 -59
  154. package/dist/components/Dialog/Title.js +0 -29
  155. package/dist/components/Input/Input.stories.js +0 -106
  156. package/dist/components/InputSearch/InputSearch.stories.js +0 -36
  157. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +0 -38
  158. package/dist/components/PageHeader/PageHeader.stories.js +0 -49
  159. package/dist/components/Toggle/Toggle.stories.js +0 -33
  160. package/dist/components/Typography/Typography.stories.js +0 -30
  161. package/dist/components/Typography/typography.test.js +0 -11357
  162. package/dist/magic-string.es-O_8lTkE3.js +0 -738
  163. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +0 -26
  164. package/dist/utils/styleStrings.test.js +0 -41
  165. package/dist/vi.Y_w82WR8-Df0JUamG.js +0 -9860
@@ -0,0 +1,1248 @@
1
+ import { g as jt, a as zt, _ as It, u as Ut, b as ut, c as Xt, P as x, d as Yt, e as Kt } from "./index-CH45lKw7.js";
2
+ import * as b from "react";
3
+ import { useLayoutEffect as Gt, useEffect as Jt } from "react";
4
+ import { r as Qt } from "./index-CjW42-M-.js";
5
+ import { jsx as Z } from "react/jsx-runtime";
6
+ import { u as Zt } from "./useEnhancedEffect-CJGo-L3B.js";
7
+ import { P as qt, H as gt } from "./Portal-DIeBsWdL.js";
8
+ const et = Math.min, z = Math.max, nt = Math.round, q = Math.floor, H = (t) => ({
9
+ x: t,
10
+ y: t
11
+ }), te = {
12
+ left: "right",
13
+ right: "left",
14
+ bottom: "top",
15
+ top: "bottom"
16
+ }, ee = {
17
+ start: "end",
18
+ end: "start"
19
+ };
20
+ function yt(t, e, o) {
21
+ return z(t, et(e, o));
22
+ }
23
+ function st(t, e) {
24
+ return typeof t == "function" ? t(e) : t;
25
+ }
26
+ function I(t) {
27
+ return t.split("-")[0];
28
+ }
29
+ function ct(t) {
30
+ return t.split("-")[1];
31
+ }
32
+ function Ot(t) {
33
+ return t === "x" ? "y" : "x";
34
+ }
35
+ function At(t) {
36
+ return t === "y" ? "height" : "width";
37
+ }
38
+ function lt(t) {
39
+ return ["top", "bottom"].includes(I(t)) ? "y" : "x";
40
+ }
41
+ function Pt(t) {
42
+ return Ot(lt(t));
43
+ }
44
+ function ne(t, e, o) {
45
+ o === void 0 && (o = !1);
46
+ const n = ct(t), i = Pt(t), s = At(i);
47
+ let r = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
48
+ return e.reference[s] > e.floating[s] && (r = ot(r)), [r, ot(r)];
49
+ }
50
+ function oe(t) {
51
+ const e = ot(t);
52
+ return [dt(t), e, dt(e)];
53
+ }
54
+ function dt(t) {
55
+ return t.replace(/start|end/g, (e) => ee[e]);
56
+ }
57
+ function ie(t, e, o) {
58
+ const n = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
59
+ switch (t) {
60
+ case "top":
61
+ case "bottom":
62
+ return o ? e ? i : n : e ? n : i;
63
+ case "left":
64
+ case "right":
65
+ return e ? s : r;
66
+ default:
67
+ return [];
68
+ }
69
+ }
70
+ function re(t, e, o, n) {
71
+ const i = ct(t);
72
+ let s = ie(I(t), o === "start", n);
73
+ return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(dt)))), s;
74
+ }
75
+ function ot(t) {
76
+ return t.replace(/left|right|bottom|top/g, (e) => te[e]);
77
+ }
78
+ function se(t) {
79
+ return {
80
+ top: 0,
81
+ right: 0,
82
+ bottom: 0,
83
+ left: 0,
84
+ ...t
85
+ };
86
+ }
87
+ function ce(t) {
88
+ return typeof t != "number" ? se(t) : {
89
+ top: t,
90
+ right: t,
91
+ bottom: t,
92
+ left: t
93
+ };
94
+ }
95
+ function it(t) {
96
+ const {
97
+ x: e,
98
+ y: o,
99
+ width: n,
100
+ height: i
101
+ } = t;
102
+ return {
103
+ width: n,
104
+ height: i,
105
+ top: o,
106
+ left: e,
107
+ right: e + n,
108
+ bottom: o + i,
109
+ x: e,
110
+ y: o
111
+ };
112
+ }
113
+ function xt(t, e, o) {
114
+ let {
115
+ reference: n,
116
+ floating: i
117
+ } = t;
118
+ const s = lt(e), r = Pt(e), c = At(r), l = I(e), f = s === "y", a = n.x + n.width / 2 - i.width / 2, u = n.y + n.height / 2 - i.height / 2, m = n[c] / 2 - i[c] / 2;
119
+ let d;
120
+ switch (l) {
121
+ case "top":
122
+ d = {
123
+ x: a,
124
+ y: n.y - i.height
125
+ };
126
+ break;
127
+ case "bottom":
128
+ d = {
129
+ x: a,
130
+ y: n.y + n.height
131
+ };
132
+ break;
133
+ case "right":
134
+ d = {
135
+ x: n.x + n.width,
136
+ y: u
137
+ };
138
+ break;
139
+ case "left":
140
+ d = {
141
+ x: n.x - i.width,
142
+ y: u
143
+ };
144
+ break;
145
+ default:
146
+ d = {
147
+ x: n.x,
148
+ y: n.y
149
+ };
150
+ }
151
+ switch (ct(e)) {
152
+ case "start":
153
+ d[r] -= m * (o && f ? -1 : 1);
154
+ break;
155
+ case "end":
156
+ d[r] += m * (o && f ? -1 : 1);
157
+ break;
158
+ }
159
+ return d;
160
+ }
161
+ const le = async (t, e, o) => {
162
+ const {
163
+ placement: n = "bottom",
164
+ strategy: i = "absolute",
165
+ middleware: s = [],
166
+ platform: r
167
+ } = o, c = s.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(e));
168
+ let f = await r.getElementRects({
169
+ reference: t,
170
+ floating: e,
171
+ strategy: i
172
+ }), {
173
+ x: a,
174
+ y: u
175
+ } = xt(f, n, l), m = n, d = {}, h = 0;
176
+ for (let g = 0; g < c.length; g++) {
177
+ const {
178
+ name: w,
179
+ fn: p
180
+ } = c[g], {
181
+ x: y,
182
+ y: R,
183
+ data: C,
184
+ reset: v
185
+ } = await p({
186
+ x: a,
187
+ y: u,
188
+ initialPlacement: n,
189
+ placement: m,
190
+ strategy: i,
191
+ middlewareData: d,
192
+ rects: f,
193
+ platform: r,
194
+ elements: {
195
+ reference: t,
196
+ floating: e
197
+ }
198
+ });
199
+ a = y ?? a, u = R ?? u, d = {
200
+ ...d,
201
+ [w]: {
202
+ ...d[w],
203
+ ...C
204
+ }
205
+ }, v && h <= 50 && (h++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (f = v.rects === !0 ? await r.getElementRects({
206
+ reference: t,
207
+ floating: e,
208
+ strategy: i
209
+ }) : v.rects), {
210
+ x: a,
211
+ y: u
212
+ } = xt(f, m, l)), g = -1);
213
+ }
214
+ return {
215
+ x: a,
216
+ y: u,
217
+ placement: m,
218
+ strategy: i,
219
+ middlewareData: d
220
+ };
221
+ };
222
+ async function St(t, e) {
223
+ var o;
224
+ e === void 0 && (e = {});
225
+ const {
226
+ x: n,
227
+ y: i,
228
+ platform: s,
229
+ rects: r,
230
+ elements: c,
231
+ strategy: l
232
+ } = t, {
233
+ boundary: f = "clippingAncestors",
234
+ rootBoundary: a = "viewport",
235
+ elementContext: u = "floating",
236
+ altBoundary: m = !1,
237
+ padding: d = 0
238
+ } = st(e, t), h = ce(d), w = c[m ? u === "floating" ? "reference" : "floating" : u], p = it(await s.getClippingRect({
239
+ element: (o = await (s.isElement == null ? void 0 : s.isElement(w))) == null || o ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
240
+ boundary: f,
241
+ rootBoundary: a,
242
+ strategy: l
243
+ })), y = u === "floating" ? {
244
+ x: n,
245
+ y: i,
246
+ width: r.floating.width,
247
+ height: r.floating.height
248
+ } : r.reference, R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), C = await (s.isElement == null ? void 0 : s.isElement(R)) ? await (s.getScale == null ? void 0 : s.getScale(R)) || {
249
+ x: 1,
250
+ y: 1
251
+ } : {
252
+ x: 1,
253
+ y: 1
254
+ }, v = it(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
255
+ elements: c,
256
+ rect: y,
257
+ offsetParent: R,
258
+ strategy: l
259
+ }) : y);
260
+ return {
261
+ top: (p.top - v.top + h.top) / C.y,
262
+ bottom: (v.bottom - p.bottom + h.bottom) / C.y,
263
+ left: (p.left - v.left + h.left) / C.x,
264
+ right: (v.right - p.right + h.right) / C.x
265
+ };
266
+ }
267
+ const fe = function(t) {
268
+ return t === void 0 && (t = {}), {
269
+ name: "flip",
270
+ options: t,
271
+ async fn(e) {
272
+ var o, n;
273
+ const {
274
+ placement: i,
275
+ middlewareData: s,
276
+ rects: r,
277
+ initialPlacement: c,
278
+ platform: l,
279
+ elements: f
280
+ } = e, {
281
+ mainAxis: a = !0,
282
+ crossAxis: u = !0,
283
+ fallbackPlacements: m,
284
+ fallbackStrategy: d = "bestFit",
285
+ fallbackAxisSideDirection: h = "none",
286
+ flipAlignment: g = !0,
287
+ ...w
288
+ } = st(t, e);
289
+ if ((o = s.arrow) != null && o.alignmentOffset)
290
+ return {};
291
+ const p = I(i), y = I(c) === c, R = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), C = m || (y || !g ? [ot(c)] : oe(c));
292
+ !m && h !== "none" && C.push(...re(c, g, h, R));
293
+ const v = [c, ...C], T = await St(e, w), P = [];
294
+ let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
295
+ if (a && P.push(T[p]), u) {
296
+ const O = ne(i, r, R);
297
+ P.push(T[O[0]], T[O[1]]);
298
+ }
299
+ if (L = [...L, {
300
+ placement: i,
301
+ overflows: P
302
+ }], !P.every((O) => O <= 0)) {
303
+ var j, _;
304
+ const O = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, W = v[O];
305
+ if (W)
306
+ return {
307
+ data: {
308
+ index: O,
309
+ overflows: L
310
+ },
311
+ reset: {
312
+ placement: W
313
+ }
314
+ };
315
+ let k = (_ = L.filter((A) => A.overflows[0] <= 0).sort((A, D) => A.overflows[1] - D.overflows[1])[0]) == null ? void 0 : _.placement;
316
+ if (!k)
317
+ switch (d) {
318
+ case "bestFit": {
319
+ var B;
320
+ const A = (B = L.map((D) => [D.placement, D.overflows.filter((E) => E > 0).reduce((E, X) => E + X, 0)]).sort((D, E) => D[1] - E[1])[0]) == null ? void 0 : B[0];
321
+ A && (k = A);
322
+ break;
323
+ }
324
+ case "initialPlacement":
325
+ k = c;
326
+ break;
327
+ }
328
+ if (i !== k)
329
+ return {
330
+ reset: {
331
+ placement: k
332
+ }
333
+ };
334
+ }
335
+ return {};
336
+ }
337
+ };
338
+ };
339
+ async function ae(t, e) {
340
+ const {
341
+ placement: o,
342
+ platform: n,
343
+ elements: i
344
+ } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = I(o), c = ct(o), l = lt(o) === "y", f = ["left", "top"].includes(r) ? -1 : 1, a = s && l ? -1 : 1, u = st(e, t);
345
+ let {
346
+ mainAxis: m,
347
+ crossAxis: d,
348
+ alignmentAxis: h
349
+ } = typeof u == "number" ? {
350
+ mainAxis: u,
351
+ crossAxis: 0,
352
+ alignmentAxis: null
353
+ } : {
354
+ mainAxis: 0,
355
+ crossAxis: 0,
356
+ alignmentAxis: null,
357
+ ...u
358
+ };
359
+ return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), l ? {
360
+ x: d * a,
361
+ y: m * f
362
+ } : {
363
+ x: m * f,
364
+ y: d * a
365
+ };
366
+ }
367
+ const ue = function(t) {
368
+ return t === void 0 && (t = 0), {
369
+ name: "offset",
370
+ options: t,
371
+ async fn(e) {
372
+ var o, n;
373
+ const {
374
+ x: i,
375
+ y: s,
376
+ placement: r,
377
+ middlewareData: c
378
+ } = e, l = await ae(e, t);
379
+ return r === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
380
+ x: i + l.x,
381
+ y: s + l.y,
382
+ data: {
383
+ ...l,
384
+ placement: r
385
+ }
386
+ };
387
+ }
388
+ };
389
+ }, de = function(t) {
390
+ return t === void 0 && (t = {}), {
391
+ name: "shift",
392
+ options: t,
393
+ async fn(e) {
394
+ const {
395
+ x: o,
396
+ y: n,
397
+ placement: i
398
+ } = e, {
399
+ mainAxis: s = !0,
400
+ crossAxis: r = !1,
401
+ limiter: c = {
402
+ fn: (w) => {
403
+ let {
404
+ x: p,
405
+ y
406
+ } = w;
407
+ return {
408
+ x: p,
409
+ y
410
+ };
411
+ }
412
+ },
413
+ ...l
414
+ } = st(t, e), f = {
415
+ x: o,
416
+ y: n
417
+ }, a = await St(e, l), u = lt(I(i)), m = Ot(u);
418
+ let d = f[m], h = f[u];
419
+ if (s) {
420
+ const w = m === "y" ? "top" : "left", p = m === "y" ? "bottom" : "right", y = d + a[w], R = d - a[p];
421
+ d = yt(y, d, R);
422
+ }
423
+ if (r) {
424
+ const w = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", y = h + a[w], R = h - a[p];
425
+ h = yt(y, h, R);
426
+ }
427
+ const g = c.fn({
428
+ ...e,
429
+ [m]: d,
430
+ [u]: h
431
+ });
432
+ return {
433
+ ...g,
434
+ data: {
435
+ x: g.x - o,
436
+ y: g.y - n
437
+ }
438
+ };
439
+ }
440
+ };
441
+ };
442
+ function $(t) {
443
+ return Lt(t) ? (t.nodeName || "").toLowerCase() : "#document";
444
+ }
445
+ function S(t) {
446
+ var e;
447
+ return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
448
+ }
449
+ function V(t) {
450
+ var e;
451
+ return (e = (Lt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
452
+ }
453
+ function Lt(t) {
454
+ return t instanceof Node || t instanceof S(t).Node;
455
+ }
456
+ function N(t) {
457
+ return t instanceof Element || t instanceof S(t).Element;
458
+ }
459
+ function F(t) {
460
+ return t instanceof HTMLElement || t instanceof S(t).HTMLElement;
461
+ }
462
+ function wt(t) {
463
+ return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof S(t).ShadowRoot;
464
+ }
465
+ function Q(t) {
466
+ const {
467
+ overflow: e,
468
+ overflowX: o,
469
+ overflowY: n,
470
+ display: i
471
+ } = M(t);
472
+ return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
473
+ }
474
+ function me(t) {
475
+ return ["table", "td", "th"].includes($(t));
476
+ }
477
+ function mt(t) {
478
+ const e = pt(), o = M(t);
479
+ return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
480
+ }
481
+ function pe(t) {
482
+ let e = G(t);
483
+ for (; F(e) && !ft(e); ) {
484
+ if (mt(e))
485
+ return e;
486
+ e = G(e);
487
+ }
488
+ return null;
489
+ }
490
+ function pt() {
491
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
492
+ }
493
+ function ft(t) {
494
+ return ["html", "body", "#document"].includes($(t));
495
+ }
496
+ function M(t) {
497
+ return S(t).getComputedStyle(t);
498
+ }
499
+ function at(t) {
500
+ return N(t) ? {
501
+ scrollLeft: t.scrollLeft,
502
+ scrollTop: t.scrollTop
503
+ } : {
504
+ scrollLeft: t.pageXOffset,
505
+ scrollTop: t.pageYOffset
506
+ };
507
+ }
508
+ function G(t) {
509
+ if ($(t) === "html")
510
+ return t;
511
+ const e = (
512
+ // Step into the shadow DOM of the parent of a slotted node.
513
+ t.assignedSlot || // DOM Element detected.
514
+ t.parentNode || // ShadowRoot detected.
515
+ wt(t) && t.host || // Fallback.
516
+ V(t)
517
+ );
518
+ return wt(e) ? e.host : e;
519
+ }
520
+ function Mt(t) {
521
+ const e = G(t);
522
+ return ft(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : F(e) && Q(e) ? e : Mt(e);
523
+ }
524
+ function J(t, e, o) {
525
+ var n;
526
+ e === void 0 && (e = []), o === void 0 && (o = !0);
527
+ const i = Mt(t), s = i === ((n = t.ownerDocument) == null ? void 0 : n.body), r = S(i);
528
+ return s ? e.concat(r, r.visualViewport || [], Q(i) ? i : [], r.frameElement && o ? J(r.frameElement) : []) : e.concat(i, J(i, [], o));
529
+ }
530
+ function kt(t) {
531
+ const e = M(t);
532
+ let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
533
+ const i = F(t), s = i ? t.offsetWidth : o, r = i ? t.offsetHeight : n, c = nt(o) !== s || nt(n) !== r;
534
+ return c && (o = s, n = r), {
535
+ width: o,
536
+ height: n,
537
+ $: c
538
+ };
539
+ }
540
+ function ht(t) {
541
+ return N(t) ? t : t.contextElement;
542
+ }
543
+ function K(t) {
544
+ const e = ht(t);
545
+ if (!F(e))
546
+ return H(1);
547
+ const o = e.getBoundingClientRect(), {
548
+ width: n,
549
+ height: i,
550
+ $: s
551
+ } = kt(e);
552
+ let r = (s ? nt(o.width) : o.width) / n, c = (s ? nt(o.height) : o.height) / i;
553
+ return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
554
+ x: r,
555
+ y: c
556
+ };
557
+ }
558
+ const he = /* @__PURE__ */ H(0);
559
+ function Dt(t) {
560
+ const e = S(t);
561
+ return !pt() || !e.visualViewport ? he : {
562
+ x: e.visualViewport.offsetLeft,
563
+ y: e.visualViewport.offsetTop
564
+ };
565
+ }
566
+ function ge(t, e, o) {
567
+ return e === void 0 && (e = !1), !o || e && o !== S(t) ? !1 : e;
568
+ }
569
+ function U(t, e, o, n) {
570
+ e === void 0 && (e = !1), o === void 0 && (o = !1);
571
+ const i = t.getBoundingClientRect(), s = ht(t);
572
+ let r = H(1);
573
+ e && (n ? N(n) && (r = K(n)) : r = K(t));
574
+ const c = ge(s, o, n) ? Dt(s) : H(0);
575
+ let l = (i.left + c.x) / r.x, f = (i.top + c.y) / r.y, a = i.width / r.x, u = i.height / r.y;
576
+ if (s) {
577
+ const m = S(s), d = n && N(n) ? S(n) : n;
578
+ let h = m, g = h.frameElement;
579
+ for (; g && n && d !== h; ) {
580
+ const w = K(g), p = g.getBoundingClientRect(), y = M(g), R = p.left + (g.clientLeft + parseFloat(y.paddingLeft)) * w.x, C = p.top + (g.clientTop + parseFloat(y.paddingTop)) * w.y;
581
+ l *= w.x, f *= w.y, a *= w.x, u *= w.y, l += R, f += C, h = S(g), g = h.frameElement;
582
+ }
583
+ }
584
+ return it({
585
+ width: a,
586
+ height: u,
587
+ x: l,
588
+ y: f
589
+ });
590
+ }
591
+ const ye = [":popover-open", ":modal"];
592
+ function Ft(t) {
593
+ return ye.some((e) => {
594
+ try {
595
+ return t.matches(e);
596
+ } catch {
597
+ return !1;
598
+ }
599
+ });
600
+ }
601
+ function xe(t) {
602
+ let {
603
+ elements: e,
604
+ rect: o,
605
+ offsetParent: n,
606
+ strategy: i
607
+ } = t;
608
+ const s = i === "fixed", r = V(n), c = e ? Ft(e.floating) : !1;
609
+ if (n === r || c && s)
610
+ return o;
611
+ let l = {
612
+ scrollLeft: 0,
613
+ scrollTop: 0
614
+ }, f = H(1);
615
+ const a = H(0), u = F(n);
616
+ if ((u || !u && !s) && (($(n) !== "body" || Q(r)) && (l = at(n)), F(n))) {
617
+ const m = U(n);
618
+ f = K(n), a.x = m.x + n.clientLeft, a.y = m.y + n.clientTop;
619
+ }
620
+ return {
621
+ width: o.width * f.x,
622
+ height: o.height * f.y,
623
+ x: o.x * f.x - l.scrollLeft * f.x + a.x,
624
+ y: o.y * f.y - l.scrollTop * f.y + a.y
625
+ };
626
+ }
627
+ function we(t) {
628
+ return Array.from(t.getClientRects());
629
+ }
630
+ function Nt(t) {
631
+ return U(V(t)).left + at(t).scrollLeft;
632
+ }
633
+ function ve(t) {
634
+ const e = V(t), o = at(t), n = t.ownerDocument.body, i = z(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = z(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
635
+ let r = -o.scrollLeft + Nt(t);
636
+ const c = -o.scrollTop;
637
+ return M(n).direction === "rtl" && (r += z(e.clientWidth, n.clientWidth) - i), {
638
+ width: i,
639
+ height: s,
640
+ x: r,
641
+ y: c
642
+ };
643
+ }
644
+ function be(t, e) {
645
+ const o = S(t), n = V(t), i = o.visualViewport;
646
+ let s = n.clientWidth, r = n.clientHeight, c = 0, l = 0;
647
+ if (i) {
648
+ s = i.width, r = i.height;
649
+ const f = pt();
650
+ (!f || f && e === "fixed") && (c = i.offsetLeft, l = i.offsetTop);
651
+ }
652
+ return {
653
+ width: s,
654
+ height: r,
655
+ x: c,
656
+ y: l
657
+ };
658
+ }
659
+ function Re(t, e) {
660
+ const o = U(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, s = F(t) ? K(t) : H(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, l = i * s.x, f = n * s.y;
661
+ return {
662
+ width: r,
663
+ height: c,
664
+ x: l,
665
+ y: f
666
+ };
667
+ }
668
+ function vt(t, e, o) {
669
+ let n;
670
+ if (e === "viewport")
671
+ n = be(t, o);
672
+ else if (e === "document")
673
+ n = ve(V(t));
674
+ else if (N(e))
675
+ n = Re(e, o);
676
+ else {
677
+ const i = Dt(t);
678
+ n = {
679
+ ...e,
680
+ x: e.x - i.x,
681
+ y: e.y - i.y
682
+ };
683
+ }
684
+ return it(n);
685
+ }
686
+ function Vt(t, e) {
687
+ const o = G(t);
688
+ return o === e || !N(o) || ft(o) ? !1 : M(o).position === "fixed" || Vt(o, e);
689
+ }
690
+ function Ce(t, e) {
691
+ const o = e.get(t);
692
+ if (o)
693
+ return o;
694
+ let n = J(t, [], !1).filter((c) => N(c) && $(c) !== "body"), i = null;
695
+ const s = M(t).position === "fixed";
696
+ let r = s ? G(t) : t;
697
+ for (; N(r) && !ft(r); ) {
698
+ const c = M(r), l = mt(r);
699
+ !l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Q(r) && !l && Vt(t, r)) ? n = n.filter((a) => a !== r) : i = c, r = G(r);
700
+ }
701
+ return e.set(t, n), n;
702
+ }
703
+ function Ee(t) {
704
+ let {
705
+ element: e,
706
+ boundary: o,
707
+ rootBoundary: n,
708
+ strategy: i
709
+ } = t;
710
+ const r = [...o === "clippingAncestors" ? Ce(e, this._c) : [].concat(o), n], c = r[0], l = r.reduce((f, a) => {
711
+ const u = vt(e, a, i);
712
+ return f.top = z(u.top, f.top), f.right = et(u.right, f.right), f.bottom = et(u.bottom, f.bottom), f.left = z(u.left, f.left), f;
713
+ }, vt(e, c, i));
714
+ return {
715
+ width: l.right - l.left,
716
+ height: l.bottom - l.top,
717
+ x: l.left,
718
+ y: l.top
719
+ };
720
+ }
721
+ function Te(t) {
722
+ const {
723
+ width: e,
724
+ height: o
725
+ } = kt(t);
726
+ return {
727
+ width: e,
728
+ height: o
729
+ };
730
+ }
731
+ function Oe(t, e, o) {
732
+ const n = F(e), i = V(e), s = o === "fixed", r = U(t, !0, s, e);
733
+ let c = {
734
+ scrollLeft: 0,
735
+ scrollTop: 0
736
+ };
737
+ const l = H(0);
738
+ if (n || !n && !s)
739
+ if (($(e) !== "body" || Q(i)) && (c = at(e)), n) {
740
+ const u = U(e, !0, s, e);
741
+ l.x = u.x + e.clientLeft, l.y = u.y + e.clientTop;
742
+ } else
743
+ i && (l.x = Nt(i));
744
+ const f = r.left + c.scrollLeft - l.x, a = r.top + c.scrollTop - l.y;
745
+ return {
746
+ x: f,
747
+ y: a,
748
+ width: r.width,
749
+ height: r.height
750
+ };
751
+ }
752
+ function bt(t, e) {
753
+ return !F(t) || M(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
754
+ }
755
+ function _t(t, e) {
756
+ const o = S(t);
757
+ if (!F(t) || Ft(t))
758
+ return o;
759
+ let n = bt(t, e);
760
+ for (; n && me(n) && M(n).position === "static"; )
761
+ n = bt(n, e);
762
+ return n && ($(n) === "html" || $(n) === "body" && M(n).position === "static" && !mt(n)) ? o : n || pe(t) || o;
763
+ }
764
+ const Ae = async function(t) {
765
+ const e = this.getOffsetParent || _t, o = this.getDimensions, n = await o(t.floating);
766
+ return {
767
+ reference: Oe(t.reference, await e(t.floating), t.strategy),
768
+ floating: {
769
+ x: 0,
770
+ y: 0,
771
+ width: n.width,
772
+ height: n.height
773
+ }
774
+ };
775
+ };
776
+ function Pe(t) {
777
+ return M(t).direction === "rtl";
778
+ }
779
+ const Se = {
780
+ convertOffsetParentRelativeRectToViewportRelativeRect: xe,
781
+ getDocumentElement: V,
782
+ getClippingRect: Ee,
783
+ getOffsetParent: _t,
784
+ getElementRects: Ae,
785
+ getClientRects: we,
786
+ getDimensions: Te,
787
+ getScale: K,
788
+ isElement: N,
789
+ isRTL: Pe
790
+ };
791
+ function Le(t, e) {
792
+ let o = null, n;
793
+ const i = V(t);
794
+ function s() {
795
+ var c;
796
+ clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
797
+ }
798
+ function r(c, l) {
799
+ c === void 0 && (c = !1), l === void 0 && (l = 1), s();
800
+ const {
801
+ left: f,
802
+ top: a,
803
+ width: u,
804
+ height: m
805
+ } = t.getBoundingClientRect();
806
+ if (c || e(), !u || !m)
807
+ return;
808
+ const d = q(a), h = q(i.clientWidth - (f + u)), g = q(i.clientHeight - (a + m)), w = q(f), y = {
809
+ rootMargin: -d + "px " + -h + "px " + -g + "px " + -w + "px",
810
+ threshold: z(0, et(1, l)) || 1
811
+ };
812
+ let R = !0;
813
+ function C(v) {
814
+ const T = v[0].intersectionRatio;
815
+ if (T !== l) {
816
+ if (!R)
817
+ return r();
818
+ T ? r(!1, T) : n = setTimeout(() => {
819
+ r(!1, 1e-7);
820
+ }, 1e3);
821
+ }
822
+ R = !1;
823
+ }
824
+ try {
825
+ o = new IntersectionObserver(C, {
826
+ ...y,
827
+ // Handle <iframe>s
828
+ root: i.ownerDocument
829
+ });
830
+ } catch {
831
+ o = new IntersectionObserver(C, y);
832
+ }
833
+ o.observe(t);
834
+ }
835
+ return r(!0), s;
836
+ }
837
+ function Rt(t, e, o, n) {
838
+ n === void 0 && (n = {});
839
+ const {
840
+ ancestorScroll: i = !0,
841
+ ancestorResize: s = !0,
842
+ elementResize: r = typeof ResizeObserver == "function",
843
+ layoutShift: c = typeof IntersectionObserver == "function",
844
+ animationFrame: l = !1
845
+ } = n, f = ht(t), a = i || s ? [...f ? J(f) : [], ...J(e)] : [];
846
+ a.forEach((p) => {
847
+ i && p.addEventListener("scroll", o, {
848
+ passive: !0
849
+ }), s && p.addEventListener("resize", o);
850
+ });
851
+ const u = f && c ? Le(f, o) : null;
852
+ let m = -1, d = null;
853
+ r && (d = new ResizeObserver((p) => {
854
+ let [y] = p;
855
+ y && y.target === f && d && (d.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
856
+ var R;
857
+ (R = d) == null || R.observe(e);
858
+ })), o();
859
+ }), f && !l && d.observe(f), d.observe(e));
860
+ let h, g = l ? U(t) : null;
861
+ l && w();
862
+ function w() {
863
+ const p = U(t);
864
+ g && (p.x !== g.x || p.y !== g.y || p.width !== g.width || p.height !== g.height) && o(), g = p, h = requestAnimationFrame(w);
865
+ }
866
+ return o(), () => {
867
+ var p;
868
+ a.forEach((y) => {
869
+ i && y.removeEventListener("scroll", o), s && y.removeEventListener("resize", o);
870
+ }), u == null || u(), (p = d) == null || p.disconnect(), d = null, l && cancelAnimationFrame(h);
871
+ };
872
+ }
873
+ const Ct = ue, Me = de, ke = fe, De = (t, e, o) => {
874
+ const n = /* @__PURE__ */ new Map(), i = {
875
+ platform: Se,
876
+ ...o
877
+ }, s = {
878
+ ...i.platform,
879
+ _c: n
880
+ };
881
+ return le(t, e, {
882
+ ...i,
883
+ platform: s
884
+ });
885
+ };
886
+ var tt = typeof document < "u" ? Gt : Jt;
887
+ function rt(t, e) {
888
+ if (t === e)
889
+ return !0;
890
+ if (typeof t != typeof e)
891
+ return !1;
892
+ if (typeof t == "function" && t.toString() === e.toString())
893
+ return !0;
894
+ let o, n, i;
895
+ if (t && e && typeof t == "object") {
896
+ if (Array.isArray(t)) {
897
+ if (o = t.length, o !== e.length)
898
+ return !1;
899
+ for (n = o; n-- !== 0; )
900
+ if (!rt(t[n], e[n]))
901
+ return !1;
902
+ return !0;
903
+ }
904
+ if (i = Object.keys(t), o = i.length, o !== Object.keys(e).length)
905
+ return !1;
906
+ for (n = o; n-- !== 0; )
907
+ if (!{}.hasOwnProperty.call(e, i[n]))
908
+ return !1;
909
+ for (n = o; n-- !== 0; ) {
910
+ const s = i[n];
911
+ if (!(s === "_owner" && t.$$typeof) && !rt(t[s], e[s]))
912
+ return !1;
913
+ }
914
+ return !0;
915
+ }
916
+ return t !== t && e !== e;
917
+ }
918
+ function Bt(t) {
919
+ return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
920
+ }
921
+ function Et(t, e) {
922
+ const o = Bt(t);
923
+ return Math.round(e * o) / o;
924
+ }
925
+ function Tt(t) {
926
+ const e = b.useRef(t);
927
+ return tt(() => {
928
+ e.current = t;
929
+ }), e;
930
+ }
931
+ function Fe(t) {
932
+ t === void 0 && (t = {});
933
+ const {
934
+ placement: e = "bottom",
935
+ strategy: o = "absolute",
936
+ middleware: n = [],
937
+ platform: i,
938
+ elements: {
939
+ reference: s,
940
+ floating: r
941
+ } = {},
942
+ transform: c = !0,
943
+ whileElementsMounted: l,
944
+ open: f
945
+ } = t, [a, u] = b.useState({
946
+ x: 0,
947
+ y: 0,
948
+ strategy: o,
949
+ placement: e,
950
+ middlewareData: {},
951
+ isPositioned: !1
952
+ }), [m, d] = b.useState(n);
953
+ rt(m, n) || d(n);
954
+ const [h, g] = b.useState(null), [w, p] = b.useState(null), y = b.useCallback((E) => {
955
+ E !== T.current && (T.current = E, g(E));
956
+ }, []), R = b.useCallback((E) => {
957
+ E !== P.current && (P.current = E, p(E));
958
+ }, []), C = s || h, v = r || w, T = b.useRef(null), P = b.useRef(null), L = b.useRef(a), j = l != null, _ = Tt(l), B = Tt(i), O = b.useCallback(() => {
959
+ if (!T.current || !P.current)
960
+ return;
961
+ const E = {
962
+ placement: e,
963
+ strategy: o,
964
+ middleware: m
965
+ };
966
+ B.current && (E.platform = B.current), De(T.current, P.current, E).then((X) => {
967
+ const Y = {
968
+ ...X,
969
+ isPositioned: !0
970
+ };
971
+ W.current && !rt(L.current, Y) && (L.current = Y, Qt.flushSync(() => {
972
+ u(Y);
973
+ }));
974
+ });
975
+ }, [m, e, o, B]);
976
+ tt(() => {
977
+ f === !1 && L.current.isPositioned && (L.current.isPositioned = !1, u((E) => ({
978
+ ...E,
979
+ isPositioned: !1
980
+ })));
981
+ }, [f]);
982
+ const W = b.useRef(!1);
983
+ tt(() => (W.current = !0, () => {
984
+ W.current = !1;
985
+ }), []), tt(() => {
986
+ if (C && (T.current = C), v && (P.current = v), C && v) {
987
+ if (_.current)
988
+ return _.current(C, v, O);
989
+ O();
990
+ }
991
+ }, [C, v, O, _, j]);
992
+ const k = b.useMemo(() => ({
993
+ reference: T,
994
+ floating: P,
995
+ setReference: y,
996
+ setFloating: R
997
+ }), [y, R]), A = b.useMemo(() => ({
998
+ reference: C,
999
+ floating: v
1000
+ }), [C, v]), D = b.useMemo(() => {
1001
+ const E = {
1002
+ position: o,
1003
+ left: 0,
1004
+ top: 0
1005
+ };
1006
+ if (!A.floating)
1007
+ return E;
1008
+ const X = Et(A.floating, a.x), Y = Et(A.floating, a.y);
1009
+ return c ? {
1010
+ ...E,
1011
+ transform: "translate(" + X + "px, " + Y + "px)",
1012
+ ...Bt(A.floating) >= 1.5 && {
1013
+ willChange: "transform"
1014
+ }
1015
+ } : {
1016
+ position: o,
1017
+ left: X,
1018
+ top: Y
1019
+ };
1020
+ }, [o, c, A.floating, a.x, a.y]);
1021
+ return b.useMemo(() => ({
1022
+ ...a,
1023
+ update: O,
1024
+ refs: k,
1025
+ elements: A,
1026
+ floatingStyles: D
1027
+ }), [a, O, k, A, D]);
1028
+ }
1029
+ const Wt = "Popup";
1030
+ function Ne(t) {
1031
+ return jt(Wt, t);
1032
+ }
1033
+ zt(Wt, ["root", "open"]);
1034
+ const Ht = /* @__PURE__ */ b.createContext(null);
1035
+ process.env.NODE_ENV !== "production" && (Ht.displayName = "TransitionContext");
1036
+ function Ve(t) {
1037
+ const [e, o] = b.useState(!0), n = b.useRef(!1), i = b.useRef(0), [s, r] = b.useState(!1), c = b.useRef(t);
1038
+ b.useEffect(() => {
1039
+ !t && // checking registeredTransitions.current instead of hasTransition to avoid this effect re-firing whenever hasTransition changes
1040
+ i.current > 0 && // prevents waiting for a pending transition right after mounting
1041
+ c.current !== t && (n.current = !0, o(!1)), c.current = t;
1042
+ }, [t]);
1043
+ const l = b.useCallback(() => {
1044
+ n.current = !1, o(!0);
1045
+ }, []), f = b.useCallback(() => (i.current += 1, r(!0), () => {
1046
+ i.current -= 1, i.current === 0 && r(!1);
1047
+ }), []);
1048
+ let a;
1049
+ return s ? t ? a = !1 : a = !n.current && e : a = !t, {
1050
+ contextValue: b.useMemo(() => ({
1051
+ requestedEnter: t,
1052
+ onExited: l,
1053
+ registerTransition: f,
1054
+ hasExited: a
1055
+ }), [l, t, f, a]),
1056
+ hasExited: a
1057
+ };
1058
+ }
1059
+ const $t = /* @__PURE__ */ b.createContext(null);
1060
+ process.env.NODE_ENV !== "production" && ($t.displayName = "PopupContext");
1061
+ const _e = ["anchor", "children", "container", "disablePortal", "keepMounted", "middleware", "offset", "open", "placement", "slotProps", "slots", "strategy"];
1062
+ function Be(t) {
1063
+ const {
1064
+ open: e
1065
+ } = t;
1066
+ return Yt({
1067
+ root: ["root", e && "open"]
1068
+ }, Kt(Ne));
1069
+ }
1070
+ function We(t) {
1071
+ return typeof t == "function" ? t() : t;
1072
+ }
1073
+ const He = /* @__PURE__ */ b.forwardRef(function(e, o) {
1074
+ var n;
1075
+ const {
1076
+ anchor: i,
1077
+ children: s,
1078
+ container: r,
1079
+ disablePortal: c = !1,
1080
+ keepMounted: l = !1,
1081
+ middleware: f,
1082
+ offset: a = 0,
1083
+ open: u = !1,
1084
+ placement: m = "bottom",
1085
+ slotProps: d = {},
1086
+ slots: h = {},
1087
+ strategy: g = "absolute"
1088
+ } = e, w = It(e, _e), {
1089
+ refs: p,
1090
+ elements: y,
1091
+ floatingStyles: R,
1092
+ update: C,
1093
+ placement: v
1094
+ } = Fe({
1095
+ elements: {
1096
+ reference: We(i)
1097
+ },
1098
+ open: u,
1099
+ middleware: f ?? [Ct(a ?? 0), ke(), Me()],
1100
+ placement: m,
1101
+ strategy: g,
1102
+ whileElementsMounted: l ? void 0 : Rt
1103
+ }), T = Ut(p.setFloating, o);
1104
+ Zt(() => {
1105
+ if (l && u && y.reference && y.floating)
1106
+ return Rt(y.reference, y.floating, C);
1107
+ }, [l, u, y, C]);
1108
+ const P = ut({}, e, {
1109
+ disablePortal: c,
1110
+ keepMounted: l,
1111
+ offset: Ct,
1112
+ open: u,
1113
+ placement: m,
1114
+ finalPlacement: v,
1115
+ strategy: g
1116
+ }), {
1117
+ contextValue: L,
1118
+ hasExited: j
1119
+ } = Ve(u), _ = l && j ? "hidden" : void 0, B = Be(P), O = (n = h == null ? void 0 : h.root) != null ? n : "div", W = Xt({
1120
+ elementType: O,
1121
+ externalSlotProps: d.root,
1122
+ externalForwardedProps: w,
1123
+ ownerState: P,
1124
+ className: B.root,
1125
+ additionalProps: {
1126
+ ref: T,
1127
+ role: "tooltip",
1128
+ style: ut({}, R, {
1129
+ visibility: _
1130
+ })
1131
+ }
1132
+ }), k = b.useMemo(() => ({
1133
+ placement: v
1134
+ }), [v]);
1135
+ return l || !j ? /* @__PURE__ */ Z(qt, {
1136
+ disablePortal: c,
1137
+ container: r,
1138
+ children: /* @__PURE__ */ Z($t.Provider, {
1139
+ value: k,
1140
+ children: /* @__PURE__ */ Z(Ht.Provider, {
1141
+ value: L,
1142
+ children: /* @__PURE__ */ Z(O, ut({}, W, {
1143
+ children: s
1144
+ }))
1145
+ })
1146
+ })
1147
+ }) : null;
1148
+ });
1149
+ process.env.NODE_ENV !== "production" && (He.propTypes = {
1150
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
1151
+ // │ These PropTypes are generated from the TypeScript type definitions. │
1152
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1153
+ // └─────────────────────────────────────────────────────────────────────┘
1154
+ /**
1155
+ * An HTML element, [virtual element](https://floating-ui.com/docs/virtual-elements),
1156
+ * or a function that returns either.
1157
+ * It's used to set the position of the popup.
1158
+ */
1159
+ anchor: x.oneOfType([gt, x.object, x.func]),
1160
+ /**
1161
+ * @ignore
1162
+ */
1163
+ children: x.oneOfType([x.node, x.func]),
1164
+ /**
1165
+ * An HTML element or function that returns one. The container will have the portal children appended to it.
1166
+ * By default, it uses the body of the top-level document object, so it's `document.body` in these cases.
1167
+ */
1168
+ container: x.oneOfType([gt, x.func]),
1169
+ /**
1170
+ * If `true`, the popup will be rendered where it is defined, without the use of portals.
1171
+ * @default false
1172
+ */
1173
+ disablePortal: x.bool,
1174
+ /**
1175
+ * If `true`, the popup will exist in the DOM even if it's closed.
1176
+ * Its visibility will be controlled by the `visibility` CSS property.
1177
+ *
1178
+ * Otherwise, a closed popup will be removed from the DOM.
1179
+ *
1180
+ * @default false
1181
+ */
1182
+ keepMounted: x.bool,
1183
+ /**
1184
+ * Collection of Floating UI middleware to use when positioning the popup.
1185
+ * If not provided, the [`offset`](https://floating-ui.com/docs/offset)
1186
+ * and [`flip`](https://floating-ui.com/docs/flip) functions will be used.
1187
+ *
1188
+ * @see https://floating-ui.com/docs/computePosition#middleware
1189
+ */
1190
+ middleware: x.arrayOf(x.oneOfType([x.oneOf([!1]), x.shape({
1191
+ fn: x.func.isRequired,
1192
+ name: x.string.isRequired,
1193
+ options: x.any
1194
+ })])),
1195
+ /**
1196
+ * Distance between a popup and the trigger element.
1197
+ * This prop is ignored when custom `middleware` is provided.
1198
+ *
1199
+ * @default 0
1200
+ * @see https://floating-ui.com/docs/offset
1201
+ */
1202
+ offset: x.oneOfType([x.func, x.number, x.shape({
1203
+ alignmentAxis: x.number,
1204
+ crossAxis: x.number,
1205
+ mainAxis: x.number
1206
+ })]),
1207
+ /**
1208
+ * If `true`, the popup is visible.
1209
+ *
1210
+ * @default false
1211
+ */
1212
+ open: x.bool,
1213
+ /**
1214
+ * Determines where to place the popup relative to the trigger element.
1215
+ *
1216
+ * @default 'bottom'
1217
+ * @see https://floating-ui.com/docs/computePosition#placement
1218
+ */
1219
+ placement: x.oneOf(["bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1220
+ /**
1221
+ * The props used for each slot inside the Popup.
1222
+ *
1223
+ * @default {}
1224
+ */
1225
+ slotProps: x.shape({
1226
+ root: x.oneOfType([x.func, x.object])
1227
+ }),
1228
+ /**
1229
+ * The components used for each slot inside the Popup.
1230
+ * Either a string to use a HTML element or a component.
1231
+ *
1232
+ * @default {}
1233
+ */
1234
+ slots: x.shape({
1235
+ root: x.elementType
1236
+ }),
1237
+ /**
1238
+ * The type of CSS position property to use (absolute or fixed).
1239
+ *
1240
+ * @default 'absolute'
1241
+ * @see https://floating-ui.com/docs/computePosition#strategy
1242
+ */
1243
+ strategy: x.oneOf(["absolute", "fixed"])
1244
+ });
1245
+ export {
1246
+ He as P,
1247
+ Ht as T
1248
+ };