@commercetools/nimbus 0.0.0-canary-20250826065101 → 0.0.0-canary-20250826133439

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 (89) hide show
  1. package/dist/chunks/DatePicker-5cKqpUC9.cjs.js +2 -0
  2. package/dist/chunks/{DatePicker-BQ6EfAU2.cjs.js.map → DatePicker-5cKqpUC9.cjs.js.map} +1 -1
  3. package/dist/chunks/{DatePicker-ByWwypbW.es.js → DatePicker-8Z6Kf838.es.js} +17 -18
  4. package/dist/chunks/{DatePicker-ByWwypbW.es.js.map → DatePicker-8Z6Kf838.es.js.map} +1 -1
  5. package/dist/chunks/{Dialog-DNPIKkGE.es.js → Dialog-C7IjW1jR.es.js} +24 -25
  6. package/dist/chunks/{Dialog-DNPIKkGE.es.js.map → Dialog-C7IjW1jR.es.js.map} +1 -1
  7. package/dist/chunks/Dialog-Cbq66gyc.cjs.js +2 -0
  8. package/dist/chunks/{Dialog-B4OIDU7t.cjs.js.map → Dialog-Cbq66gyc.cjs.js.map} +1 -1
  9. package/dist/chunks/OverlayArrow-C5Ymp9MC.cjs.js +2 -0
  10. package/dist/chunks/OverlayArrow-C5Ymp9MC.cjs.js.map +1 -0
  11. package/dist/chunks/OverlayArrow-ERS8ZqL3.es.js +479 -0
  12. package/dist/chunks/OverlayArrow-ERS8ZqL3.es.js.map +1 -0
  13. package/dist/chunks/combobox-CFH0OaAM.cjs.js +2 -0
  14. package/dist/chunks/{combobox-BYyNTj5m.cjs.js.map → combobox-CFH0OaAM.cjs.js.map} +1 -1
  15. package/dist/chunks/{combobox-qA8TjWPw.es.js → combobox-CkVqkKdA.es.js} +14 -15
  16. package/dist/chunks/{combobox-qA8TjWPw.es.js.map → combobox-CkVqkKdA.es.js.map} +1 -1
  17. package/dist/chunks/data-table-DIXPr3ke.cjs.js +2 -0
  18. package/dist/chunks/{data-table-D6qEg2qp.cjs.js.map → data-table-DIXPr3ke.cjs.js.map} +1 -1
  19. package/dist/chunks/{data-table-D7Gq4ZYT.es.js → data-table-cBq9JXG7.es.js} +1606 -1476
  20. package/dist/chunks/{data-table-D7Gq4ZYT.es.js.map → data-table-cBq9JXG7.es.js.map} +1 -1
  21. package/dist/chunks/{date-picker-COI-tlHx.es.js → date-picker-Bx2J-sPg.es.js} +3 -3
  22. package/dist/chunks/{date-picker-COI-tlHx.es.js.map → date-picker-Bx2J-sPg.es.js.map} +1 -1
  23. package/dist/chunks/{date-picker-RC0pSYZe.cjs.js → date-picker-UEQeFHA8.cjs.js} +2 -2
  24. package/dist/chunks/{date-picker-RC0pSYZe.cjs.js.map → date-picker-UEQeFHA8.cjs.js.map} +1 -1
  25. package/dist/chunks/{date-range-picker-BnI3m8z-.es.js → date-range-picker-DvaRIy3T.es.js} +3 -3
  26. package/dist/chunks/{date-range-picker-BnI3m8z-.es.js.map → date-range-picker-DvaRIy3T.es.js.map} +1 -1
  27. package/dist/chunks/{date-range-picker-BMAaQ7cS.cjs.js → date-range-picker-Dx1nE1Br.cjs.js} +2 -2
  28. package/dist/chunks/{date-range-picker-BMAaQ7cS.cjs.js.map → date-range-picker-Dx1nE1Br.cjs.js.map} +1 -1
  29. package/dist/chunks/{form-field-B6lCvcf4.cjs.js → form-field-DiW_0hSy.cjs.js} +2 -2
  30. package/dist/chunks/{form-field-B6lCvcf4.cjs.js.map → form-field-DiW_0hSy.cjs.js.map} +1 -1
  31. package/dist/chunks/{form-field-BgKHtyTH.es.js → form-field-Do0NhI0D.es.js} +2 -2
  32. package/dist/chunks/{form-field-BgKHtyTH.es.js.map → form-field-Do0NhI0D.es.js.map} +1 -1
  33. package/dist/chunks/{password-input-XSc2MhLG.es.js → password-input-BT594v5p.es.js} +2 -2
  34. package/dist/chunks/{password-input-XSc2MhLG.es.js.map → password-input-BT594v5p.es.js.map} +1 -1
  35. package/dist/chunks/{password-input--fYkZAW3.cjs.js → password-input-D1LSzb9p.cjs.js} +2 -2
  36. package/dist/chunks/{password-input--fYkZAW3.cjs.js.map → password-input-D1LSzb9p.cjs.js.map} +1 -1
  37. package/dist/chunks/select-BnN5zaBu.cjs.js +2 -0
  38. package/dist/chunks/{select-CxIiux8H.cjs.js.map → select-BnN5zaBu.cjs.js.map} +1 -1
  39. package/dist/chunks/{select-CMZAeYTf.es.js → select-Cr0CSahh.es.js} +12 -13
  40. package/dist/chunks/{select-CMZAeYTf.es.js.map → select-Cr0CSahh.es.js.map} +1 -1
  41. package/dist/chunks/{split-button-BZHi7r1E.es.js → split-button-DhYWuU3x.es.js} +2 -2
  42. package/dist/chunks/{split-button-BZHi7r1E.es.js.map → split-button-DhYWuU3x.es.js.map} +1 -1
  43. package/dist/chunks/{split-button-hRYYvfbx.cjs.js → split-button-DrujRAqS.cjs.js} +2 -2
  44. package/dist/chunks/{split-button-hRYYvfbx.cjs.js.map → split-button-DrujRAqS.cjs.js.map} +1 -1
  45. package/dist/chunks/{tooltip-BLyAAnK-.es.js → tooltip-BOK0Uejw.es.js} +2 -2
  46. package/dist/chunks/{tooltip-BLyAAnK-.es.js.map → tooltip-BOK0Uejw.es.js.map} +1 -1
  47. package/dist/chunks/{tooltip-tZKuAv4E.cjs.js → tooltip-DjUjwciC.cjs.js} +2 -2
  48. package/dist/chunks/{tooltip-tZKuAv4E.cjs.js.map → tooltip-DjUjwciC.cjs.js.map} +1 -1
  49. package/dist/components/combobox.cjs +1 -1
  50. package/dist/components/combobox.es.js +1 -1
  51. package/dist/components/components.cjs +1 -1
  52. package/dist/components/components.es.js +9 -9
  53. package/dist/components/data-table.cjs +1 -1
  54. package/dist/components/data-table.es.js +1 -1
  55. package/dist/components/date-picker.cjs +1 -1
  56. package/dist/components/date-picker.es.js +1 -1
  57. package/dist/components/date-range-picker.cjs +1 -1
  58. package/dist/components/date-range-picker.es.js +1 -1
  59. package/dist/components/form-field.cjs +1 -1
  60. package/dist/components/form-field.es.js +1 -1
  61. package/dist/components/password-input.cjs +1 -1
  62. package/dist/components/password-input.es.js +1 -1
  63. package/dist/components/popover.cjs +1 -1
  64. package/dist/components/popover.es.js +1 -1
  65. package/dist/components/select.cjs +1 -1
  66. package/dist/components/select.es.js +1 -1
  67. package/dist/components/split-button.cjs +1 -1
  68. package/dist/components/split-button.es.js +1 -1
  69. package/dist/components/tooltip.cjs +1 -1
  70. package/dist/components/tooltip.es.js +1 -1
  71. package/dist/components.d.ts +6 -0
  72. package/dist/data-table.d.ts +6 -0
  73. package/dist/index.cjs +1 -1
  74. package/dist/index.d.ts +6 -0
  75. package/dist/index.es.js +9 -9
  76. package/package.json +5 -5
  77. package/dist/chunks/DatePicker-BQ6EfAU2.cjs.js +0 -2
  78. package/dist/chunks/Dialog-B4OIDU7t.cjs.js +0 -2
  79. package/dist/chunks/OverlayArrow-BD-oGsXg.es.js +0 -452
  80. package/dist/chunks/OverlayArrow-BD-oGsXg.es.js.map +0 -1
  81. package/dist/chunks/OverlayArrow-aq8OInch.cjs.js +0 -2
  82. package/dist/chunks/OverlayArrow-aq8OInch.cjs.js.map +0 -1
  83. package/dist/chunks/combobox-BYyNTj5m.cjs.js +0 -2
  84. package/dist/chunks/data-table-D6qEg2qp.cjs.js +0 -2
  85. package/dist/chunks/select-CxIiux8H.cjs.js +0 -2
  86. package/dist/chunks/useResizeObserver-Dx-vDLiW.cjs.js +0 -2
  87. package/dist/chunks/useResizeObserver-Dx-vDLiW.cjs.js.map +0 -1
  88. package/dist/chunks/useResizeObserver-FIPBIG5S.es.js +0 -32
  89. package/dist/chunks/useResizeObserver-FIPBIG5S.es.js.map +0 -1
@@ -0,0 +1,479 @@
1
+ import { c as Y } from "./mergeProps-B_9syxhT.es.js";
2
+ import { flushSync as ue } from "react-dom";
3
+ import { useEffect as K, useState as Q, useCallback as F, useRef as W, useContext as pe, createContext as re } from "react";
4
+ import { a as me } from "./platform-Z5fvtFmM.es.js";
5
+ import { $ as q } from "./number-dMxJejI6.es.js";
6
+ import { $ as ve } from "./context-Pt-0ojuK.es.js";
7
+ import { $ as ge } from "./useControlledState-u436Wbp1.es.js";
8
+ function $e() {
9
+ return typeof window.ResizeObserver < "u";
10
+ }
11
+ function V(e) {
12
+ const { ref: t, box: l, onResize: n } = e;
13
+ K(() => {
14
+ let o = t?.current;
15
+ if (o)
16
+ if ($e()) {
17
+ const r = new window.ResizeObserver((c) => {
18
+ c.length && n();
19
+ });
20
+ return r.observe(o, {
21
+ box: l
22
+ }), () => {
23
+ o && r.unobserve(o);
24
+ };
25
+ } else
26
+ return window.addEventListener("resize", n, !1), () => {
27
+ window.removeEventListener("resize", n, !1);
28
+ };
29
+ }, [
30
+ n,
31
+ t,
32
+ l
33
+ ]);
34
+ }
35
+ function Ne(e, t = !0) {
36
+ let [l, n] = Q(!0), o = l && t;
37
+ return Y(() => {
38
+ if (o && e.current && "getAnimations" in e.current)
39
+ for (let r of e.current.getAnimations()) r instanceof CSSTransition && r.cancel();
40
+ }, [
41
+ e,
42
+ o
43
+ ]), ie(e, o, F(() => n(!1), [])), o;
44
+ }
45
+ function Fe(e, t) {
46
+ let [l, n] = Q(t ? "open" : "closed");
47
+ switch (l) {
48
+ case "open":
49
+ t || n("exiting");
50
+ break;
51
+ case "closed":
52
+ case "exiting":
53
+ t && n("open");
54
+ break;
55
+ }
56
+ let o = l === "exiting";
57
+ return ie(e, o, F(() => {
58
+ n((r) => r === "exiting" ? "closed" : r);
59
+ }, [])), o;
60
+ }
61
+ function ie(e, t, l) {
62
+ Y(() => {
63
+ if (t && e.current) {
64
+ if (!("getAnimations" in e.current)) {
65
+ l();
66
+ return;
67
+ }
68
+ let n = e.current.getAnimations();
69
+ if (n.length === 0) {
70
+ l();
71
+ return;
72
+ }
73
+ let o = !1;
74
+ return Promise.all(n.map((r) => r.finished)).then(() => {
75
+ o || ue(() => {
76
+ l();
77
+ });
78
+ }).catch(() => {
79
+ }), () => {
80
+ o = !0;
81
+ };
82
+ }
83
+ }, [
84
+ e,
85
+ t,
86
+ l
87
+ ]);
88
+ }
89
+ const M = {
90
+ top: "top",
91
+ bottom: "top",
92
+ left: "left",
93
+ right: "left"
94
+ }, Z = {
95
+ top: "bottom",
96
+ bottom: "top",
97
+ left: "right",
98
+ right: "left"
99
+ }, he = {
100
+ top: "left",
101
+ left: "top"
102
+ }, J = {
103
+ top: "height",
104
+ left: "width"
105
+ }, ae = {
106
+ width: "totalWidth",
107
+ height: "totalHeight"
108
+ }, X = {};
109
+ let C = typeof document < "u" ? window.visualViewport : null;
110
+ function D(e) {
111
+ let t = 0, l = 0, n = 0, o = 0, r = 0, c = 0, i = {};
112
+ var $;
113
+ let f = (($ = C?.scale) !== null && $ !== void 0 ? $ : 1) > 1;
114
+ if (e.tagName === "BODY") {
115
+ let d = document.documentElement;
116
+ n = d.clientWidth, o = d.clientHeight;
117
+ var u;
118
+ t = (u = C?.width) !== null && u !== void 0 ? u : n;
119
+ var g;
120
+ l = (g = C?.height) !== null && g !== void 0 ? g : o, i.top = d.scrollTop || e.scrollTop, i.left = d.scrollLeft || e.scrollLeft, C && (r = C.offsetTop, c = C.offsetLeft);
121
+ } else
122
+ ({ width: t, height: l, top: r, left: c } = B(e)), i.top = e.scrollTop, i.left = e.scrollLeft, n = t, o = l;
123
+ if (me() && (e.tagName === "BODY" || e.tagName === "HTML") && f) {
124
+ i.top = 0, i.left = 0;
125
+ var p;
126
+ r = (p = C?.pageTop) !== null && p !== void 0 ? p : 0;
127
+ var a;
128
+ c = (a = C?.pageLeft) !== null && a !== void 0 ? a : 0;
129
+ }
130
+ return {
131
+ width: t,
132
+ height: l,
133
+ totalWidth: n,
134
+ totalHeight: o,
135
+ scroll: i,
136
+ top: r,
137
+ left: c
138
+ };
139
+ }
140
+ function xe(e) {
141
+ return {
142
+ top: e.scrollTop,
143
+ left: e.scrollLeft,
144
+ width: e.scrollWidth,
145
+ height: e.scrollHeight
146
+ };
147
+ }
148
+ function ee(e, t, l, n, o, r, c) {
149
+ var i;
150
+ let $ = (i = o.scroll[e]) !== null && i !== void 0 ? i : 0, f = n[J[e]], u = n.scroll[M[e]] + r, g = f + n.scroll[M[e]] - r, p = t - $ + c[e] - n[M[e]], a = t - $ + l + c[e] - n[M[e]];
151
+ return p < u ? u - p : a > g ? Math.max(g - a, u - p) : 0;
152
+ }
153
+ function be(e) {
154
+ let t = window.getComputedStyle(e);
155
+ return {
156
+ top: parseInt(t.marginTop, 10) || 0,
157
+ bottom: parseInt(t.marginBottom, 10) || 0,
158
+ left: parseInt(t.marginLeft, 10) || 0,
159
+ right: parseInt(t.marginRight, 10) || 0
160
+ };
161
+ }
162
+ function te(e) {
163
+ if (X[e]) return X[e];
164
+ let [t, l] = e.split(" "), n = M[t] || "right", o = he[n];
165
+ M[l] || (l = "center");
166
+ let r = J[n], c = J[o];
167
+ return X[e] = {
168
+ placement: t,
169
+ crossPlacement: l,
170
+ axis: n,
171
+ crossAxis: o,
172
+ size: r,
173
+ crossSize: c
174
+ }, X[e];
175
+ }
176
+ function G(e, t, l, n, o, r, c, i, $, f) {
177
+ let { placement: u, crossPlacement: g, axis: p, crossAxis: a, size: d, crossSize: h } = n, s = {};
178
+ var m;
179
+ s[a] = (m = e[a]) !== null && m !== void 0 ? m : 0;
180
+ var v, E, T, P;
181
+ g === "center" ? s[a] += (((v = e[h]) !== null && v !== void 0 ? v : 0) - ((E = l[h]) !== null && E !== void 0 ? E : 0)) / 2 : g !== a && (s[a] += ((T = e[h]) !== null && T !== void 0 ? T : 0) - ((P = l[h]) !== null && P !== void 0 ? P : 0)), s[a] += r;
182
+ const x = e[a] - l[h] + $ + f, _ = e[a] + e[h] - $ - f;
183
+ if (s[a] = q(s[a], x, _), u === p) {
184
+ const I = i ? c[d] : t[ae[d]];
185
+ s[Z[p]] = Math.floor(I - e[p] + o);
186
+ } else s[p] = Math.floor(e[p] + e[d] + o);
187
+ return s;
188
+ }
189
+ function we(e, t, l, n, o, r, c, i) {
190
+ const $ = n ? l.height : t[ae.height];
191
+ var f;
192
+ let u = e.top != null ? l.top + e.top : l.top + ($ - ((f = e.bottom) !== null && f !== void 0 ? f : 0) - c);
193
+ var g, p, a, d, h, s;
194
+ let m = i !== "top" ? (
195
+ // We want the distance between the top of the overlay to the bottom of the boundary
196
+ Math.max(0, t.height + t.top + ((g = t.scroll.top) !== null && g !== void 0 ? g : 0) - u - (((p = o.top) !== null && p !== void 0 ? p : 0) + ((a = o.bottom) !== null && a !== void 0 ? a : 0) + r))
197
+ ) : Math.max(0, u + c - (t.top + ((d = t.scroll.top) !== null && d !== void 0 ? d : 0)) - (((h = o.top) !== null && h !== void 0 ? h : 0) + ((s = o.bottom) !== null && s !== void 0 ? s : 0) + r));
198
+ return Math.min(t.height - r * 2, m);
199
+ }
200
+ function oe(e, t, l, n, o, r) {
201
+ let { placement: c, axis: i, size: $ } = r;
202
+ var f, u;
203
+ if (c === i) return Math.max(0, l[i] - e[i] - ((f = e.scroll[i]) !== null && f !== void 0 ? f : 0) + t[i] - ((u = n[i]) !== null && u !== void 0 ? u : 0) - n[Z[i]] - o);
204
+ var g;
205
+ return Math.max(0, e[$] + e[i] + e.scroll[i] - t[i] - l[i] - l[$] - ((g = n[i]) !== null && g !== void 0 ? g : 0) - n[Z[i]] - o);
206
+ }
207
+ function Ee(e, t, l, n, o, r, c, i, $, f, u, g, p, a, d, h) {
208
+ let s = te(e), { size: m, crossAxis: v, crossSize: E, placement: T, crossPlacement: P } = s, x = G(t, i, l, s, u, g, f, p, d, h), _ = u, I = oe(i, f, t, o, r + u, s);
209
+ if (c && n[m] > I) {
210
+ let j = te(`${Z[T]} ${P}`), de = G(t, i, l, j, u, g, f, p, d, h);
211
+ oe(i, f, t, o, r + u, j) > I && (s = j, x = de, _ = u);
212
+ }
213
+ let z = "bottom";
214
+ s.axis === "top" ? s.placement === "top" ? z = "top" : s.placement === "bottom" && (z = "bottom") : s.crossAxis === "top" && (s.crossPlacement === "top" ? z = "bottom" : s.crossPlacement === "bottom" && (z = "top"));
215
+ let w = ee(v, x[v], l[E], i, $, r, f);
216
+ x[v] += w;
217
+ let S = we(x, i, f, p, o, r, l.height, z);
218
+ a && a < S && (S = a), l.height = Math.min(l.height, S), x = G(t, i, l, s, _, g, f, p, d, h), w = ee(v, x[v], l[E], i, $, r, f), x[v] += w;
219
+ let R = {}, y = t[v] + 0.5 * t[E] - x[v] - o[M[v]];
220
+ const H = d / 2 + h;
221
+ var O, k, A, L;
222
+ const N = M[v] === "left" ? ((O = o.left) !== null && O !== void 0 ? O : 0) + ((k = o.right) !== null && k !== void 0 ? k : 0) : ((A = o.top) !== null && A !== void 0 ? A : 0) + ((L = o.bottom) !== null && L !== void 0 ? L : 0), U = l[E] - N - d / 2 - h, ce = t[v] + d / 2 - (x[v] + o[M[v]]), se = t[v] + t[E] - d / 2 - (x[v] + o[M[v]]), fe = q(y, ce, se);
223
+ return R[v] = q(fe, H, U), {
224
+ position: x,
225
+ maxHeight: S,
226
+ arrowOffsetLeft: R.left,
227
+ arrowOffsetTop: R.top,
228
+ placement: s.placement
229
+ };
230
+ }
231
+ function Ce(e) {
232
+ let { placement: t, targetNode: l, overlayNode: n, scrollNode: o, padding: r, shouldFlip: c, boundaryElement: i, offset: $, crossOffset: f, maxHeight: u, arrowSize: g = 0, arrowBoundaryOffset: p = 0 } = e, a = n instanceof HTMLElement ? Pe(n) : document.documentElement, d = a === document.documentElement;
233
+ const h = window.getComputedStyle(a).position;
234
+ let s = !!h && h !== "static", m = d ? B(l) : le(l, a);
235
+ if (!d) {
236
+ let { marginTop: R, marginLeft: y } = window.getComputedStyle(l);
237
+ m.top += parseInt(R, 10) || 0, m.left += parseInt(y, 10) || 0;
238
+ }
239
+ let v = B(n), E = be(n);
240
+ var T, P;
241
+ v.width += ((T = E.left) !== null && T !== void 0 ? T : 0) + ((P = E.right) !== null && P !== void 0 ? P : 0);
242
+ var x, _;
243
+ v.height += ((x = E.top) !== null && x !== void 0 ? x : 0) + ((_ = E.bottom) !== null && _ !== void 0 ? _ : 0);
244
+ let I = xe(o), z = D(i), w = D(a), S = i.tagName === "BODY" ? B(a) : le(a, i);
245
+ return a.tagName === "HTML" && i.tagName === "BODY" && (w.scroll.top = 0, w.scroll.left = 0), Ee(t, m, v, I, E, r, c, z, w, S, $, f, s, u, g, p);
246
+ }
247
+ function B(e) {
248
+ let { top: t, left: l, width: n, height: o } = e.getBoundingClientRect(), { scrollTop: r, scrollLeft: c, clientTop: i, clientLeft: $ } = document.documentElement;
249
+ return {
250
+ top: t + r - i,
251
+ left: l + c - $,
252
+ width: n,
253
+ height: o
254
+ };
255
+ }
256
+ function le(e, t) {
257
+ let l = window.getComputedStyle(e), n;
258
+ if (l.position === "fixed") {
259
+ let { top: o, left: r, width: c, height: i } = e.getBoundingClientRect();
260
+ n = {
261
+ top: o,
262
+ left: r,
263
+ width: c,
264
+ height: i
265
+ };
266
+ } else {
267
+ n = B(e);
268
+ let o = B(t), r = window.getComputedStyle(t);
269
+ o.top += (parseInt(r.borderTopWidth, 10) || 0) - t.scrollTop, o.left += (parseInt(r.borderLeftWidth, 10) || 0) - t.scrollLeft, n.top -= o.top, n.left -= o.left;
270
+ }
271
+ return n.top -= parseInt(l.marginTop, 10) || 0, n.left -= parseInt(l.marginLeft, 10) || 0, n;
272
+ }
273
+ function Pe(e) {
274
+ let t = e.offsetParent;
275
+ if (t && t === document.body && window.getComputedStyle(t).position === "static" && !ne(t) && (t = document.documentElement), t == null)
276
+ for (t = e.parentElement; t && !ne(t); ) t = t.parentElement;
277
+ return t || document.documentElement;
278
+ }
279
+ function ne(e) {
280
+ let t = window.getComputedStyle(e);
281
+ return t.transform !== "none" || /transform|perspective/.test(t.willChange) || t.filter !== "none" || t.contain === "paint" || "backdropFilter" in t && t.backdropFilter !== "none" || "WebkitBackdropFilter" in t && t.WebkitBackdropFilter !== "none";
282
+ }
283
+ const Le = /* @__PURE__ */ new WeakMap();
284
+ function Se(e) {
285
+ let { triggerRef: t, isOpen: l, onClose: n } = e;
286
+ K(() => {
287
+ if (!l || n === null) return;
288
+ let o = (r) => {
289
+ let c = r.target;
290
+ if (!t.current || c instanceof Node && !c.contains(t.current) || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement) return;
291
+ let i = n || Le.get(t.current);
292
+ i && i();
293
+ };
294
+ return window.addEventListener("scroll", o, !0), () => {
295
+ window.removeEventListener("scroll", o, !0);
296
+ };
297
+ }, [
298
+ l,
299
+ n,
300
+ t
301
+ ]);
302
+ }
303
+ let b = typeof document < "u" ? window.visualViewport : null;
304
+ function Be(e) {
305
+ let { direction: t } = ve(), { arrowSize: l = 0, targetRef: n, overlayRef: o, scrollRef: r = o, placement: c = "bottom", containerPadding: i = 12, shouldFlip: $ = !0, boundaryElement: f = typeof document < "u" ? document.body : null, offset: u = 0, crossOffset: g = 0, shouldUpdatePosition: p = !0, isOpen: a = !0, onClose: d, maxHeight: h, arrowBoundaryOffset: s = 0 } = e, [m, v] = Q(null), E = [
306
+ p,
307
+ c,
308
+ o.current,
309
+ n.current,
310
+ r.current,
311
+ i,
312
+ $,
313
+ f,
314
+ u,
315
+ g,
316
+ a,
317
+ t,
318
+ h,
319
+ s,
320
+ l
321
+ ], T = W(b?.scale);
322
+ K(() => {
323
+ a && (T.current = b?.scale);
324
+ }, [
325
+ a
326
+ ]);
327
+ let P = F(() => {
328
+ if (p === !1 || !a || !o.current || !n.current || !f || b?.scale !== T.current) return;
329
+ let w = null;
330
+ if (r.current && r.current.contains(document.activeElement)) {
331
+ var S;
332
+ let L = (S = document.activeElement) === null || S === void 0 ? void 0 : S.getBoundingClientRect(), N = r.current.getBoundingClientRect();
333
+ var R;
334
+ if (w = {
335
+ type: "top",
336
+ offset: ((R = L?.top) !== null && R !== void 0 ? R : 0) - N.top
337
+ }, w.offset > N.height / 2) {
338
+ w.type = "bottom";
339
+ var y;
340
+ w.offset = ((y = L?.bottom) !== null && y !== void 0 ? y : 0) - N.bottom;
341
+ }
342
+ }
343
+ let H = o.current;
344
+ if (!h && o.current) {
345
+ var O;
346
+ H.style.top = "0px", H.style.bottom = "";
347
+ var k;
348
+ H.style.maxHeight = ((k = (O = window.visualViewport) === null || O === void 0 ? void 0 : O.height) !== null && k !== void 0 ? k : window.innerHeight) + "px";
349
+ }
350
+ let A = Ce({
351
+ placement: Re(c, t),
352
+ overlayNode: o.current,
353
+ targetNode: n.current,
354
+ scrollNode: r.current || o.current,
355
+ padding: i,
356
+ shouldFlip: $,
357
+ boundaryElement: f,
358
+ offset: u,
359
+ crossOffset: g,
360
+ maxHeight: h,
361
+ arrowSize: l,
362
+ arrowBoundaryOffset: s
363
+ });
364
+ if (A.position) {
365
+ if (H.style.top = "", H.style.bottom = "", H.style.left = "", H.style.right = "", Object.keys(A.position).forEach((L) => H.style[L] = A.position[L] + "px"), H.style.maxHeight = A.maxHeight != null ? A.maxHeight + "px" : "", w && document.activeElement && r.current) {
366
+ let L = document.activeElement.getBoundingClientRect(), N = r.current.getBoundingClientRect(), U = L[w.type] - N[w.type];
367
+ r.current.scrollTop += U - w.offset;
368
+ }
369
+ v(A);
370
+ }
371
+ }, E);
372
+ Y(P, E), Te(P), V({
373
+ ref: o,
374
+ onResize: P
375
+ }), V({
376
+ ref: n,
377
+ onResize: P
378
+ });
379
+ let x = W(!1);
380
+ Y(() => {
381
+ let w, S = () => {
382
+ x.current = !0, clearTimeout(w), w = setTimeout(() => {
383
+ x.current = !1;
384
+ }, 500), P();
385
+ }, R = () => {
386
+ x.current && S();
387
+ };
388
+ return b?.addEventListener("resize", S), b?.addEventListener("scroll", R), () => {
389
+ b?.removeEventListener("resize", S), b?.removeEventListener("scroll", R);
390
+ };
391
+ }, [
392
+ P
393
+ ]);
394
+ let _ = F(() => {
395
+ x.current || d?.();
396
+ }, [
397
+ d,
398
+ x
399
+ ]);
400
+ Se({
401
+ triggerRef: n,
402
+ isOpen: a,
403
+ onClose: d && _
404
+ });
405
+ var I, z;
406
+ return {
407
+ overlayProps: {
408
+ style: {
409
+ position: "absolute",
410
+ zIndex: 1e5,
411
+ ...m?.position,
412
+ maxHeight: (I = m?.maxHeight) !== null && I !== void 0 ? I : "100vh"
413
+ }
414
+ },
415
+ placement: (z = m?.placement) !== null && z !== void 0 ? z : null,
416
+ arrowProps: {
417
+ "aria-hidden": "true",
418
+ role: "presentation",
419
+ style: {
420
+ left: m?.arrowOffsetLeft,
421
+ top: m?.arrowOffsetTop
422
+ }
423
+ },
424
+ updatePosition: P
425
+ };
426
+ }
427
+ function Te(e) {
428
+ Y(() => (window.addEventListener("resize", e, !1), () => {
429
+ window.removeEventListener("resize", e, !1);
430
+ }), [
431
+ e
432
+ ]);
433
+ }
434
+ function Re(e, t) {
435
+ return t === "rtl" ? e.replace("start", "right").replace("end", "left") : e.replace("start", "left").replace("end", "right");
436
+ }
437
+ const ze = /* @__PURE__ */ re({});
438
+ function Ye() {
439
+ var e;
440
+ return (e = pe(ze)) !== null && e !== void 0 ? e : {};
441
+ }
442
+ function Xe(e) {
443
+ let [t, l] = ge(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
444
+ const n = F(() => {
445
+ l(!0);
446
+ }, [
447
+ l
448
+ ]), o = F(() => {
449
+ l(!1);
450
+ }, [
451
+ l
452
+ ]), r = F(() => {
453
+ l(!t);
454
+ }, [
455
+ l,
456
+ t
457
+ ]);
458
+ return {
459
+ isOpen: t,
460
+ setOpen: l,
461
+ open: n,
462
+ close: o,
463
+ toggle: r
464
+ };
465
+ }
466
+ const Ze = /* @__PURE__ */ re({
467
+ placement: "bottom"
468
+ });
469
+ export {
470
+ Xe as $,
471
+ V as a,
472
+ Ye as b,
473
+ Fe as c,
474
+ Be as d,
475
+ Ne as e,
476
+ Ze as f,
477
+ Le as g
478
+ };
479
+ //# sourceMappingURL=OverlayArrow-ERS8ZqL3.es.js.map