@boxcustodia/library 0.0.7 → 0.0.8

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 (272) hide show
  1. package/dist/index.d.ts +6 -1
  2. package/dist/index.es100.js +4 -4
  3. package/dist/index.es101.js +4 -14
  4. package/dist/index.es102.js +3 -4
  5. package/dist/index.es103.js +14 -57
  6. package/dist/index.es104.js +5 -29
  7. package/dist/index.es105.js +57 -12
  8. package/dist/index.es106.js +29 -11
  9. package/dist/index.es111.js +243 -1046
  10. package/dist/index.es112.js +12 -4
  11. package/dist/index.es113.js +11 -4
  12. package/dist/index.es114.js +7 -7
  13. package/dist/index.es117.js +14 -14
  14. package/dist/index.es118.js +813 -55
  15. package/dist/index.es119.js +9 -822
  16. package/dist/index.es120.js +5 -3
  17. package/dist/index.es121.js +64 -11
  18. package/dist/index.es122.js +88 -11
  19. package/dist/index.es123.js +11 -88
  20. package/dist/index.es124.js +4 -216
  21. package/dist/index.es127.js +5 -5
  22. package/dist/index.es128.js +216 -4
  23. package/dist/index.es129.js +2 -2
  24. package/dist/index.es134.js +1 -1
  25. package/dist/index.es137.js +20 -11
  26. package/dist/index.es138.js +37 -205
  27. package/dist/index.es139.js +10 -10
  28. package/dist/index.es140.js +11 -20
  29. package/dist/index.es141.js +205 -37
  30. package/dist/index.es142.js +10 -10
  31. package/dist/index.es143.js +5 -6
  32. package/dist/index.es144.js +2 -65
  33. package/dist/index.es145.js +44 -11
  34. package/dist/index.es146.js +5 -123
  35. package/dist/index.es147.js +58 -128
  36. package/dist/index.es148.js +11 -14
  37. package/dist/index.es149.js +122 -30
  38. package/dist/index.es150.js +134 -14
  39. package/dist/index.es151.js +12 -7
  40. package/dist/index.es152.js +32 -49
  41. package/dist/index.es153.js +14 -5
  42. package/dist/index.es154.js +9 -2
  43. package/dist/index.es155.js +48 -648
  44. package/dist/index.es156.js +5 -5
  45. package/dist/index.es157.js +649 -3
  46. package/dist/index.es158.js +4 -4
  47. package/dist/index.es159.js +3 -45
  48. package/dist/index.es160.js +45 -7
  49. package/dist/index.es161.js +7 -5
  50. package/dist/index.es162.js +6 -28
  51. package/dist/index.es163.js +27 -43
  52. package/dist/index.es164.js +3 -3
  53. package/dist/index.es166.js +5 -5
  54. package/dist/index.es168.js +2 -2
  55. package/dist/index.es179.js +1 -1
  56. package/dist/index.es180.js +1 -1
  57. package/dist/index.es181.js +2 -2
  58. package/dist/index.es182.js +1 -1
  59. package/dist/index.es184.js +1 -1
  60. package/dist/index.es207.js +1 -1
  61. package/dist/index.es240.js +1 -1
  62. package/dist/index.es241.js +24 -177
  63. package/dist/index.es242.js +5 -5
  64. package/dist/index.es243.js +2 -2
  65. package/dist/index.es246.js +1 -1
  66. package/dist/index.es247.js +1 -1
  67. package/dist/index.es248.js +3 -3
  68. package/dist/index.es249.js +178 -2
  69. package/dist/index.es250.js +25 -397
  70. package/dist/index.es251.js +4 -722
  71. package/dist/index.es252.js +7 -282
  72. package/dist/index.es253.js +13 -60
  73. package/dist/index.es254.js +13 -9
  74. package/dist/index.es255.js +134 -28
  75. package/dist/index.es256.js +32 -199
  76. package/dist/index.es257.js +462 -25
  77. package/dist/index.es258.js +131 -4
  78. package/dist/index.es259.js +27 -8
  79. package/dist/index.es260.js +4 -13
  80. package/dist/index.es261.js +26 -13
  81. package/dist/index.es262.js +7 -134
  82. package/dist/index.es263.js +11 -31
  83. package/dist/index.es264.js +26 -460
  84. package/dist/index.es265.js +47 -130
  85. package/dist/index.es266.js +31 -27
  86. package/dist/index.es267.js +43 -4
  87. package/dist/index.es268.js +158 -26
  88. package/dist/index.es269.js +32 -6
  89. package/dist/index.es27.js +1 -1
  90. package/dist/index.es270.js +2 -12
  91. package/dist/index.es271.js +77 -26
  92. package/dist/index.es272.js +18 -48
  93. package/dist/index.es273.js +2 -31
  94. package/dist/index.es274.js +397 -43
  95. package/dist/index.es275.js +715 -151
  96. package/dist/index.es276.js +278 -29
  97. package/dist/index.es277.js +61 -2
  98. package/dist/index.es278.js +8 -78
  99. package/dist/index.es279.js +28 -18
  100. package/dist/index.es28.js +3 -3
  101. package/dist/index.es280.js +199 -25
  102. package/dist/index.es281.js +15 -16
  103. package/dist/index.es282.js +3 -8
  104. package/dist/index.es283.js +16 -4
  105. package/dist/index.es284.js +8 -14
  106. package/dist/index.es285.js +4 -15
  107. package/dist/index.es286.js +14 -15
  108. package/dist/index.es287.js +15 -3
  109. package/dist/index.es29.js +6 -6
  110. package/dist/index.es31.js +2 -2
  111. package/dist/index.es32.js +2 -2
  112. package/dist/index.es322.js +3 -3
  113. package/dist/index.es323.js +3 -3
  114. package/dist/index.es325.js +1 -1
  115. package/dist/index.es326.js +5 -5
  116. package/dist/index.es327.js +1 -1
  117. package/dist/index.es336.js +6 -2
  118. package/dist/index.es337.js +34 -2
  119. package/dist/index.es338.js +26 -6
  120. package/dist/index.es339.js +18 -34
  121. package/dist/index.es34.js +5 -5
  122. package/dist/index.es340.js +4 -25
  123. package/dist/index.es341.js +231 -18
  124. package/dist/index.es342.js +100 -5
  125. package/dist/index.es343.js +26 -229
  126. package/dist/index.es344.js +35 -80
  127. package/dist/index.es345.js +2 -28
  128. package/dist/index.es346.js +2 -55
  129. package/dist/index.es347.js +334 -2
  130. package/dist/index.es348.js +31 -106
  131. package/dist/index.es349.js +16 -75
  132. package/dist/index.es35.js +2 -2
  133. package/dist/index.es350.js +29 -35
  134. package/dist/index.es351.js +3 -64
  135. package/dist/index.es352.js +107 -34
  136. package/dist/index.es353.js +71 -60
  137. package/dist/index.es354.js +34 -111
  138. package/dist/index.es355.js +60 -90
  139. package/dist/index.es356.js +32 -41
  140. package/dist/index.es357.js +66 -3
  141. package/dist/index.es358.js +113 -3
  142. package/dist/index.es359.js +94 -3
  143. package/dist/index.es360.js +43 -3
  144. package/dist/index.es361.js +2 -2
  145. package/dist/index.es362.js +2 -2
  146. package/dist/index.es363.js +2 -2
  147. package/dist/index.es364.js +2 -2
  148. package/dist/index.es365.js +2 -2
  149. package/dist/index.es366.js +4 -241
  150. package/dist/index.es367.js +4 -384
  151. package/dist/index.es368.js +4 -169
  152. package/dist/index.es369.js +4 -153
  153. package/dist/index.es370.js +187 -88
  154. package/dist/index.es371.js +384 -4
  155. package/dist/index.es372.js +169 -4
  156. package/dist/index.es373.js +153 -4
  157. package/dist/index.es374.js +142 -4
  158. package/dist/index.es375.js +2 -2
  159. package/dist/index.es376.js +2 -2
  160. package/dist/index.es377.js +2 -334
  161. package/dist/index.es378.js +2 -31
  162. package/dist/index.es379.js +2 -17
  163. package/dist/index.es38.js +51 -46
  164. package/dist/index.es380.js +2 -29
  165. package/dist/index.es381.js +2 -2
  166. package/dist/index.es382.js +1 -1
  167. package/dist/index.es384.js +1 -1
  168. package/dist/index.es385.js +1 -1
  169. package/dist/index.es39.js +2 -2
  170. package/dist/index.es394.js +68 -5
  171. package/dist/index.es395.js +31 -3
  172. package/dist/index.es396.js +16 -24
  173. package/dist/index.es397.js +141 -110
  174. package/dist/index.es398.js +113 -15
  175. package/dist/index.es399.js +5 -6
  176. package/dist/index.es40.js +3 -3
  177. package/dist/index.es400.js +3 -2
  178. package/dist/index.es401.js +23 -7
  179. package/dist/index.es402.js +108 -325
  180. package/dist/index.es403.js +15 -49
  181. package/dist/index.es404.js +518 -3
  182. package/dist/index.es405.js +113 -505
  183. package/dist/index.es406.js +120 -121
  184. package/dist/index.es407.js +5 -125
  185. package/dist/index.es408.js +2 -68
  186. package/dist/index.es409.js +8 -31
  187. package/dist/index.es41.js +1 -1
  188. package/dist/index.es410.js +327 -16
  189. package/dist/index.es411.js +48 -139
  190. package/dist/index.es412.js +4 -114
  191. package/dist/index.es416.js +1 -1
  192. package/dist/index.es418.js +1 -1
  193. package/dist/index.es419.js +4 -4
  194. package/dist/index.es42.js +1 -1
  195. package/dist/index.es437.js +21 -271
  196. package/dist/index.es438.js +10 -79
  197. package/dist/index.es439.js +31 -164
  198. package/dist/index.es44.js +1 -1
  199. package/dist/index.es440.js +29 -24
  200. package/dist/index.es441.js +11 -10
  201. package/dist/index.es442.js +274 -32
  202. package/dist/index.es443.js +79 -29
  203. package/dist/index.es444.js +165 -11
  204. package/dist/index.es448.js +2 -2
  205. package/dist/index.es45.js +1 -1
  206. package/dist/index.es454.js +1 -1
  207. package/dist/index.es455.js +1 -1
  208. package/dist/index.es461.js +1 -1
  209. package/dist/index.es476.js +1 -1
  210. package/dist/index.es477.js +1 -1
  211. package/dist/index.es50.js +2 -2
  212. package/dist/index.es51.js +1 -1
  213. package/dist/index.es52.js +4 -4
  214. package/dist/index.es55.js +1 -1
  215. package/dist/index.es56.js +1 -1
  216. package/dist/index.es57.js +2 -2
  217. package/dist/index.es59.js +2 -2
  218. package/dist/index.es62.js +1 -1
  219. package/dist/index.es63.js +1 -1
  220. package/dist/index.es65.js +2 -2
  221. package/dist/index.es66.js +2 -2
  222. package/dist/index.es754.js +13 -21
  223. package/dist/index.es755.js +18 -79
  224. package/dist/index.es756.js +82 -13
  225. package/dist/index.es757.js +14 -2
  226. package/dist/index.es758.js +60 -2
  227. package/dist/index.es759.js +2 -14
  228. package/dist/index.es760.js +2 -60
  229. package/dist/index.es768.js +2 -5
  230. package/dist/index.es769.js +2 -17
  231. package/dist/index.es770.js +5 -2
  232. package/dist/index.es771.js +17 -2
  233. package/dist/index.es772.js +1 -1
  234. package/dist/index.es773.js +2 -2
  235. package/dist/index.es78.js +1 -1
  236. package/dist/index.es781.js +1 -1
  237. package/dist/index.es784.js +1 -1
  238. package/dist/index.es787.js +56 -26
  239. package/dist/index.es788.js +10 -3
  240. package/dist/index.es789.js +14 -57
  241. package/dist/index.es79.js +1 -1
  242. package/dist/index.es790.js +3 -6
  243. package/dist/index.es791.js +28 -15
  244. package/dist/index.es792.js +3 -7
  245. package/dist/index.es808.js +1 -1
  246. package/dist/index.es811.js +5 -5
  247. package/dist/index.es812.js +2 -2
  248. package/dist/index.es813.js +1 -1
  249. package/dist/index.es815.js +2 -2
  250. package/dist/index.es827.js +64 -15
  251. package/dist/index.es828.js +11 -7
  252. package/dist/index.es829.js +38 -61
  253. package/dist/index.es830.js +54 -7
  254. package/dist/index.es831.js +16 -40
  255. package/dist/index.es832.js +17 -57
  256. package/dist/index.es833.js +7 -20
  257. package/dist/index.es834.js +1 -1
  258. package/dist/index.es86.js +55 -33
  259. package/dist/index.es87.js +53 -44
  260. package/dist/index.es88.js +89 -29
  261. package/dist/index.es89.js +37 -30
  262. package/dist/index.es90.js +24 -9
  263. package/dist/index.es91.js +30 -55
  264. package/dist/index.es92.js +31 -53
  265. package/dist/index.es93.js +46 -90
  266. package/dist/index.es94.js +29 -36
  267. package/dist/index.es95.js +29 -23
  268. package/dist/index.es96.js +9 -30
  269. package/dist/index.es97.js +12 -259
  270. package/dist/index.es98.js +1062 -12
  271. package/dist/index.es99.js +2 -2
  272. package/package.json +1 -1
@@ -1,52 +1,18 @@
1
- import { __require as u } from "./index.es457.js";
2
- var o, p;
3
- function g() {
4
- if (p) return o;
5
- p = 1;
6
- var c = u();
7
- function n() {
8
- }
9
- function i() {
10
- }
11
- return i.resetWarningCache = n, o = function() {
12
- function e(h, y, m, f, l, s) {
13
- if (s !== c) {
14
- var a = new Error(
15
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
16
- );
17
- throw a.name = "Invariant Violation", a;
18
- }
19
- }
20
- e.isRequired = e;
21
- function r() {
22
- return e;
23
- }
24
- var t = {
25
- array: e,
26
- bigint: e,
27
- bool: e,
28
- func: e,
29
- number: e,
30
- object: e,
31
- string: e,
32
- symbol: e,
33
- any: e,
34
- arrayOf: r,
35
- element: e,
36
- elementType: e,
37
- instanceOf: r,
38
- node: e,
39
- objectOf: r,
40
- oneOf: r,
41
- oneOfType: r,
42
- shape: r,
43
- exact: r,
44
- checkPropTypes: i,
45
- resetWarningCache: n
46
- };
47
- return t.PropTypes = t, t;
48
- }, o;
1
+ import { __rest as o, __assign as d } from "./index.es321.js";
2
+ import * as n from "react";
3
+ var i = function(r) {
4
+ var e = r.sideCar, a = o(r, ["sideCar"]);
5
+ if (!e)
6
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
7
+ var t = e.read();
8
+ if (!t)
9
+ throw new Error("Sidecar medium not found");
10
+ return n.createElement(t, d({}, a));
11
+ };
12
+ i.isSideCarExport = !0;
13
+ function p(r, e) {
14
+ return r.useMedium(e), i;
49
15
  }
50
16
  export {
51
- g as __require
17
+ p as exportSidecar
52
18
  };
@@ -1,6 +1,521 @@
1
- function i(s, a) {
2
- return s.classList ? !!a && s.classList.contains(a) : (" " + (s.className.baseVal || s.className) + " ").indexOf(" " + a + " ") !== -1;
1
+ import { evaluate as D, getSide as F, getSideAxis as V, getOppositePlacement as _, getExpandedPlacements as ee, getOppositeAxisPlacements as te, getAlignmentSides as ne, clamp as $, getAlignment as X, min as W, max as j, getAlignmentAxis as K, getPaddingObject as N, rectToClientRect as I, sides as ie, getOppositeAxis as Q, getAxisLength as U } from "./index.es405.js";
2
+ function q(t, e, d) {
3
+ let {
4
+ reference: s,
5
+ floating: r
6
+ } = t;
7
+ const n = V(e), o = K(e), m = U(o), a = F(e), g = n === "y", u = s.x + s.width / 2 - r.width / 2, l = s.y + s.height / 2 - r.height / 2, f = s[m] / 2 - r[m] / 2;
8
+ let i;
9
+ switch (a) {
10
+ case "top":
11
+ i = {
12
+ x: u,
13
+ y: s.y - r.height
14
+ };
15
+ break;
16
+ case "bottom":
17
+ i = {
18
+ x: u,
19
+ y: s.y + s.height
20
+ };
21
+ break;
22
+ case "right":
23
+ i = {
24
+ x: s.x + s.width,
25
+ y: l
26
+ };
27
+ break;
28
+ case "left":
29
+ i = {
30
+ x: s.x - r.width,
31
+ y: l
32
+ };
33
+ break;
34
+ default:
35
+ i = {
36
+ x: s.x,
37
+ y: s.y
38
+ };
39
+ }
40
+ switch (X(e)) {
41
+ case "start":
42
+ i[o] -= f * (d && g ? -1 : 1);
43
+ break;
44
+ case "end":
45
+ i[o] += f * (d && g ? -1 : 1);
46
+ break;
47
+ }
48
+ return i;
3
49
  }
50
+ const ce = async (t, e, d) => {
51
+ const {
52
+ placement: s = "bottom",
53
+ strategy: r = "absolute",
54
+ middleware: n = [],
55
+ platform: o
56
+ } = d, m = n.filter(Boolean), a = await (o.isRTL == null ? void 0 : o.isRTL(e));
57
+ let g = await o.getElementRects({
58
+ reference: t,
59
+ floating: e,
60
+ strategy: r
61
+ }), {
62
+ x: u,
63
+ y: l
64
+ } = q(g, s, a), f = s, i = {}, c = 0;
65
+ for (let w = 0; w < m.length; w++) {
66
+ const {
67
+ name: x,
68
+ fn: y
69
+ } = m[w], {
70
+ x: v,
71
+ y: p,
72
+ data: A,
73
+ reset: h
74
+ } = await y({
75
+ x: u,
76
+ y: l,
77
+ initialPlacement: s,
78
+ placement: f,
79
+ strategy: r,
80
+ middlewareData: i,
81
+ rects: g,
82
+ platform: o,
83
+ elements: {
84
+ reference: t,
85
+ floating: e
86
+ }
87
+ });
88
+ u = v ?? u, l = p ?? l, i = {
89
+ ...i,
90
+ [x]: {
91
+ ...i[x],
92
+ ...A
93
+ }
94
+ }, h && c <= 50 && (c++, typeof h == "object" && (h.placement && (f = h.placement), h.rects && (g = h.rects === !0 ? await o.getElementRects({
95
+ reference: t,
96
+ floating: e,
97
+ strategy: r
98
+ }) : h.rects), {
99
+ x: u,
100
+ y: l
101
+ } = q(g, f, a)), w = -1);
102
+ }
103
+ return {
104
+ x: u,
105
+ y: l,
106
+ placement: f,
107
+ strategy: r,
108
+ middlewareData: i
109
+ };
110
+ };
111
+ async function z(t, e) {
112
+ var d;
113
+ e === void 0 && (e = {});
114
+ const {
115
+ x: s,
116
+ y: r,
117
+ platform: n,
118
+ rects: o,
119
+ elements: m,
120
+ strategy: a
121
+ } = t, {
122
+ boundary: g = "clippingAncestors",
123
+ rootBoundary: u = "viewport",
124
+ elementContext: l = "floating",
125
+ altBoundary: f = !1,
126
+ padding: i = 0
127
+ } = D(e, t), c = N(i), x = m[f ? l === "floating" ? "reference" : "floating" : l], y = I(await n.getClippingRect({
128
+ element: (d = await (n.isElement == null ? void 0 : n.isElement(x))) == null || d ? x : x.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(m.floating)),
129
+ boundary: g,
130
+ rootBoundary: u,
131
+ strategy: a
132
+ })), v = l === "floating" ? {
133
+ x: s,
134
+ y: r,
135
+ width: o.floating.width,
136
+ height: o.floating.height
137
+ } : o.reference, p = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(m.floating)), A = await (n.isElement == null ? void 0 : n.isElement(p)) ? await (n.getScale == null ? void 0 : n.getScale(p)) || {
138
+ x: 1,
139
+ y: 1
140
+ } : {
141
+ x: 1,
142
+ y: 1
143
+ }, h = I(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({
144
+ elements: m,
145
+ rect: v,
146
+ offsetParent: p,
147
+ strategy: a
148
+ }) : v);
149
+ return {
150
+ top: (y.top - h.top + c.top) / A.y,
151
+ bottom: (h.bottom - y.bottom + c.bottom) / A.y,
152
+ left: (y.left - h.left + c.left) / A.x,
153
+ right: (h.right - y.right + c.right) / A.x
154
+ };
155
+ }
156
+ const ae = (t) => ({
157
+ name: "arrow",
158
+ options: t,
159
+ async fn(e) {
160
+ const {
161
+ x: d,
162
+ y: s,
163
+ placement: r,
164
+ rects: n,
165
+ platform: o,
166
+ elements: m,
167
+ middlewareData: a
168
+ } = e, {
169
+ element: g,
170
+ padding: u = 0
171
+ } = D(t, e) || {};
172
+ if (g == null)
173
+ return {};
174
+ const l = N(u), f = {
175
+ x: d,
176
+ y: s
177
+ }, i = K(r), c = U(i), w = await o.getDimensions(g), x = i === "y", y = x ? "top" : "left", v = x ? "bottom" : "right", p = x ? "clientHeight" : "clientWidth", A = n.reference[c] + n.reference[i] - f[i] - n.floating[c], h = f[i] - n.reference[i], O = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(g));
178
+ let C = O ? O[p] : 0;
179
+ (!C || !await (o.isElement == null ? void 0 : o.isElement(O))) && (C = m.floating[p] || n.floating[c]);
180
+ const M = A / 2 - h / 2, R = C / 2 - w[c] / 2 - 1, P = W(l[y], R), E = W(l[v], R), H = P, Y = C - w[c] - E, b = C / 2 - w[c] / 2 + M, B = $(H, b, Y), k = !a.arrow && X(r) != null && b !== B && n.reference[c] / 2 - (b < H ? P : E) - w[c] / 2 < 0, S = k ? b < H ? b - H : b - Y : 0;
181
+ return {
182
+ [i]: f[i] + S,
183
+ data: {
184
+ [i]: B,
185
+ centerOffset: b - B - S,
186
+ ...k && {
187
+ alignmentOffset: S
188
+ }
189
+ },
190
+ reset: k
191
+ };
192
+ }
193
+ }), le = function(t) {
194
+ return t === void 0 && (t = {}), {
195
+ name: "flip",
196
+ options: t,
197
+ async fn(e) {
198
+ var d, s;
199
+ const {
200
+ placement: r,
201
+ middlewareData: n,
202
+ rects: o,
203
+ initialPlacement: m,
204
+ platform: a,
205
+ elements: g
206
+ } = e, {
207
+ mainAxis: u = !0,
208
+ crossAxis: l = !0,
209
+ fallbackPlacements: f,
210
+ fallbackStrategy: i = "bestFit",
211
+ fallbackAxisSideDirection: c = "none",
212
+ flipAlignment: w = !0,
213
+ ...x
214
+ } = D(t, e);
215
+ if ((d = n.arrow) != null && d.alignmentOffset)
216
+ return {};
217
+ const y = F(r), v = V(m), p = F(m) === m, A = await (a.isRTL == null ? void 0 : a.isRTL(g.floating)), h = f || (p || !w ? [_(m)] : ee(m)), O = c !== "none";
218
+ !f && O && h.push(...te(m, w, c, A));
219
+ const C = [m, ...h], M = await z(e, x), R = [];
220
+ let P = ((s = n.flip) == null ? void 0 : s.overflows) || [];
221
+ if (u && R.push(M[y]), l) {
222
+ const b = ne(r, o, A);
223
+ R.push(M[b[0]], M[b[1]]);
224
+ }
225
+ if (P = [...P, {
226
+ placement: r,
227
+ overflows: R
228
+ }], !R.every((b) => b <= 0)) {
229
+ var E, H;
230
+ const b = (((E = n.flip) == null ? void 0 : E.index) || 0) + 1, B = C[b];
231
+ if (B)
232
+ return {
233
+ data: {
234
+ index: b,
235
+ overflows: P
236
+ },
237
+ reset: {
238
+ placement: B
239
+ }
240
+ };
241
+ let k = (H = P.filter((S) => S.overflows[0] <= 0).sort((S, T) => S.overflows[1] - T.overflows[1])[0]) == null ? void 0 : H.placement;
242
+ if (!k)
243
+ switch (i) {
244
+ case "bestFit": {
245
+ var Y;
246
+ const S = (Y = P.filter((T) => {
247
+ if (O) {
248
+ const L = V(T.placement);
249
+ return L === v || // Create a bias to the `y` side axis due to horizontal
250
+ // reading directions favoring greater width.
251
+ L === "y";
252
+ }
253
+ return !0;
254
+ }).map((T) => [T.placement, T.overflows.filter((L) => L > 0).reduce((L, Z) => L + Z, 0)]).sort((T, L) => T[1] - L[1])[0]) == null ? void 0 : Y[0];
255
+ S && (k = S);
256
+ break;
257
+ }
258
+ case "initialPlacement":
259
+ k = m;
260
+ break;
261
+ }
262
+ if (r !== k)
263
+ return {
264
+ reset: {
265
+ placement: k
266
+ }
267
+ };
268
+ }
269
+ return {};
270
+ }
271
+ };
272
+ };
273
+ function G(t, e) {
274
+ return {
275
+ top: t.top - e.height,
276
+ right: t.right - e.width,
277
+ bottom: t.bottom - e.height,
278
+ left: t.left - e.width
279
+ };
280
+ }
281
+ function J(t) {
282
+ return ie.some((e) => t[e] >= 0);
283
+ }
284
+ const re = function(t) {
285
+ return t === void 0 && (t = {}), {
286
+ name: "hide",
287
+ options: t,
288
+ async fn(e) {
289
+ const {
290
+ rects: d
291
+ } = e, {
292
+ strategy: s = "referenceHidden",
293
+ ...r
294
+ } = D(t, e);
295
+ switch (s) {
296
+ case "referenceHidden": {
297
+ const n = await z(e, {
298
+ ...r,
299
+ elementContext: "reference"
300
+ }), o = G(n, d.reference);
301
+ return {
302
+ data: {
303
+ referenceHiddenOffsets: o,
304
+ referenceHidden: J(o)
305
+ }
306
+ };
307
+ }
308
+ case "escaped": {
309
+ const n = await z(e, {
310
+ ...r,
311
+ altBoundary: !0
312
+ }), o = G(n, d.floating);
313
+ return {
314
+ data: {
315
+ escapedOffsets: o,
316
+ escaped: J(o)
317
+ }
318
+ };
319
+ }
320
+ default:
321
+ return {};
322
+ }
323
+ }
324
+ };
325
+ };
326
+ async function se(t, e) {
327
+ const {
328
+ placement: d,
329
+ platform: s,
330
+ elements: r
331
+ } = t, n = await (s.isRTL == null ? void 0 : s.isRTL(r.floating)), o = F(d), m = X(d), a = V(d) === "y", g = ["left", "top"].includes(o) ? -1 : 1, u = n && a ? -1 : 1, l = D(e, t);
332
+ let {
333
+ mainAxis: f,
334
+ crossAxis: i,
335
+ alignmentAxis: c
336
+ } = typeof l == "number" ? {
337
+ mainAxis: l,
338
+ crossAxis: 0,
339
+ alignmentAxis: null
340
+ } : {
341
+ mainAxis: 0,
342
+ crossAxis: 0,
343
+ alignmentAxis: null,
344
+ ...l
345
+ };
346
+ return m && typeof c == "number" && (i = m === "end" ? c * -1 : c), a ? {
347
+ x: i * u,
348
+ y: f * g
349
+ } : {
350
+ x: f * g,
351
+ y: i * u
352
+ };
353
+ }
354
+ const fe = function(t) {
355
+ return t === void 0 && (t = 0), {
356
+ name: "offset",
357
+ options: t,
358
+ async fn(e) {
359
+ var d, s;
360
+ const {
361
+ x: r,
362
+ y: n,
363
+ placement: o,
364
+ middlewareData: m
365
+ } = e, a = await se(e, t);
366
+ return o === ((d = m.offset) == null ? void 0 : d.placement) && (s = m.arrow) != null && s.alignmentOffset ? {} : {
367
+ x: r + a.x,
368
+ y: n + a.y,
369
+ data: {
370
+ ...a,
371
+ placement: o
372
+ }
373
+ };
374
+ }
375
+ };
376
+ }, me = function(t) {
377
+ return t === void 0 && (t = {}), {
378
+ name: "shift",
379
+ options: t,
380
+ async fn(e) {
381
+ const {
382
+ x: d,
383
+ y: s,
384
+ placement: r
385
+ } = e, {
386
+ mainAxis: n = !0,
387
+ crossAxis: o = !1,
388
+ limiter: m = {
389
+ fn: (x) => {
390
+ let {
391
+ x: y,
392
+ y: v
393
+ } = x;
394
+ return {
395
+ x: y,
396
+ y: v
397
+ };
398
+ }
399
+ },
400
+ ...a
401
+ } = D(t, e), g = {
402
+ x: d,
403
+ y: s
404
+ }, u = await z(e, a), l = V(F(r)), f = Q(l);
405
+ let i = g[f], c = g[l];
406
+ if (n) {
407
+ const x = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", v = i + u[x], p = i - u[y];
408
+ i = $(v, i, p);
409
+ }
410
+ if (o) {
411
+ const x = l === "y" ? "top" : "left", y = l === "y" ? "bottom" : "right", v = c + u[x], p = c - u[y];
412
+ c = $(v, c, p);
413
+ }
414
+ const w = m.fn({
415
+ ...e,
416
+ [f]: i,
417
+ [l]: c
418
+ });
419
+ return {
420
+ ...w,
421
+ data: {
422
+ x: w.x - d,
423
+ y: w.y - s
424
+ }
425
+ };
426
+ }
427
+ };
428
+ }, de = function(t) {
429
+ return t === void 0 && (t = {}), {
430
+ options: t,
431
+ fn(e) {
432
+ const {
433
+ x: d,
434
+ y: s,
435
+ placement: r,
436
+ rects: n,
437
+ middlewareData: o
438
+ } = e, {
439
+ offset: m = 0,
440
+ mainAxis: a = !0,
441
+ crossAxis: g = !0
442
+ } = D(t, e), u = {
443
+ x: d,
444
+ y: s
445
+ }, l = V(r), f = Q(l);
446
+ let i = u[f], c = u[l];
447
+ const w = D(m, e), x = typeof w == "number" ? {
448
+ mainAxis: w,
449
+ crossAxis: 0
450
+ } : {
451
+ mainAxis: 0,
452
+ crossAxis: 0,
453
+ ...w
454
+ };
455
+ if (a) {
456
+ const p = f === "y" ? "height" : "width", A = n.reference[f] - n.floating[p] + x.mainAxis, h = n.reference[f] + n.reference[p] - x.mainAxis;
457
+ i < A ? i = A : i > h && (i = h);
458
+ }
459
+ if (g) {
460
+ var y, v;
461
+ const p = f === "y" ? "width" : "height", A = ["top", "left"].includes(F(r)), h = n.reference[l] - n.floating[p] + (A && ((y = o.offset) == null ? void 0 : y[l]) || 0) + (A ? 0 : x.crossAxis), O = n.reference[l] + n.reference[p] + (A ? 0 : ((v = o.offset) == null ? void 0 : v[l]) || 0) - (A ? x.crossAxis : 0);
462
+ c < h ? c = h : c > O && (c = O);
463
+ }
464
+ return {
465
+ [f]: i,
466
+ [l]: c
467
+ };
468
+ }
469
+ };
470
+ }, ue = function(t) {
471
+ return t === void 0 && (t = {}), {
472
+ name: "size",
473
+ options: t,
474
+ async fn(e) {
475
+ const {
476
+ placement: d,
477
+ rects: s,
478
+ platform: r,
479
+ elements: n
480
+ } = e, {
481
+ apply: o = () => {
482
+ },
483
+ ...m
484
+ } = D(t, e), a = await z(e, m), g = F(d), u = X(d), l = V(d) === "y", {
485
+ width: f,
486
+ height: i
487
+ } = s.floating;
488
+ let c, w;
489
+ g === "top" || g === "bottom" ? (c = g, w = u === (await (r.isRTL == null ? void 0 : r.isRTL(n.floating)) ? "start" : "end") ? "left" : "right") : (w = g, c = u === "end" ? "top" : "bottom");
490
+ const x = i - a.top - a.bottom, y = f - a.left - a.right, v = W(i - a[c], x), p = W(f - a[w], y), A = !e.middlewareData.shift;
491
+ let h = v, O = p;
492
+ if (l ? O = u || A ? W(p, y) : y : h = u || A ? W(v, x) : x, A && !u) {
493
+ const M = j(a.left, 0), R = j(a.right, 0), P = j(a.top, 0), E = j(a.bottom, 0);
494
+ l ? O = f - 2 * (M !== 0 || R !== 0 ? M + R : j(a.left, a.right)) : h = i - 2 * (P !== 0 || E !== 0 ? P + E : j(a.top, a.bottom));
495
+ }
496
+ await o({
497
+ ...e,
498
+ availableWidth: O,
499
+ availableHeight: h
500
+ });
501
+ const C = await r.getDimensions(n.floating);
502
+ return f !== C.width || i !== C.height ? {
503
+ reset: {
504
+ rects: !0
505
+ }
506
+ } : {};
507
+ }
508
+ };
509
+ };
4
510
  export {
5
- i as default
511
+ ae as arrow,
512
+ ce as computePosition,
513
+ z as detectOverflow,
514
+ le as flip,
515
+ re as hide,
516
+ de as limitShift,
517
+ fe as offset,
518
+ I as rectToClientRect,
519
+ me as shift,
520
+ ue as size
6
521
  };