@trintel/zooy 1.0.16 → 1.1.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 (213) hide show
  1. package/dist/chunks/component-library-registry-BBQV6Kpv.js +1 -0
  2. package/dist/chunks/component-library-registry-DB5UeqC2.js +58 -0
  3. package/dist/chunks/register-D3pWAXhm.js +266 -0
  4. package/dist/chunks/register-D7SMu1Gy.js +1372 -0
  5. package/dist/chunks/register-HYODt48Q.js +1 -0
  6. package/dist/chunks/register-g5KUNRdI.js +1 -0
  7. package/dist/chunks/tree-utils-B2JEGXHR.js +267 -0
  8. package/dist/chunks/tree-utils-BYnipT-p.js +1 -0
  9. package/dist/chunks/zoo-CY2QpG41.js +52 -0
  10. package/dist/chunks/zoo-DgdxBjlN.js +390 -0
  11. package/dist/zooy.cjs.js +19 -1
  12. package/dist/zooy.es.js +1298 -20
  13. package/package.json +8 -6
  14. package/dist/chunks/16-30f5E9no.js +0 -1
  15. package/dist/chunks/16-4Ffg4DOO.js +0 -1
  16. package/dist/chunks/16-8pr5mbIO.js +0 -28
  17. package/dist/chunks/16-B56B50XT.js +0 -1
  18. package/dist/chunks/16-BFJN6B6d.js +0 -39
  19. package/dist/chunks/16-BTonF5Je.js +0 -29
  20. package/dist/chunks/16-BXti8Tu-.js +0 -62
  21. package/dist/chunks/16-BiShwKPX.js +0 -28
  22. package/dist/chunks/16-BwDdccyH.js +0 -33
  23. package/dist/chunks/16-C7Xs-wKv.js +0 -1
  24. package/dist/chunks/16-CDRTWf-C.js +0 -21
  25. package/dist/chunks/16-CMCRqVYz.js +0 -1
  26. package/dist/chunks/16-CSWwhDUY.js +0 -21
  27. package/dist/chunks/16-CpNRIuiB.js +0 -1
  28. package/dist/chunks/16-CqC9427V.js +0 -21
  29. package/dist/chunks/16-Cubm18Em.js +0 -1
  30. package/dist/chunks/16-D3Ol0pdg.js +0 -21
  31. package/dist/chunks/16-DH311Of_.js +0 -1
  32. package/dist/chunks/16-Dlq3qxDh.js +0 -1
  33. package/dist/chunks/16-Drl9-5Gn.js +0 -21
  34. package/dist/chunks/16-Dt4v0bcc.js +0 -1
  35. package/dist/chunks/16-DylBiJnm.js +0 -1
  36. package/dist/chunks/20-CQLnFcRb.js +0 -84
  37. package/dist/chunks/20-Df0dXwyx.js +0 -1
  38. package/dist/chunks/button-D3QMXGP6.js +0 -66
  39. package/dist/chunks/button-cEVHuDC9.js +0 -272
  40. package/dist/chunks/button-skeleton-BuDQrAgi.js +0 -21
  41. package/dist/chunks/button-skeleton-CxKOKEQr.js +0 -49
  42. package/dist/chunks/carbon-element-CbfPUYRT.js +0 -1
  43. package/dist/chunks/carbon-element-DzDuXiyl.js +0 -25
  44. package/dist/chunks/checkbox-B_b_oOJ5.js +0 -40
  45. package/dist/chunks/checkbox-CsuLOYIT.js +0 -201
  46. package/dist/chunks/class-map-BwrbvkxB.js +0 -5
  47. package/dist/chunks/class-map-CgGieoOz.js +0 -32
  48. package/dist/chunks/collection-helpers-Bk68Vaau.js +0 -7
  49. package/dist/chunks/collection-helpers-afBvMQaC.js +0 -1
  50. package/dist/chunks/content-switcher-item-C1gdd6k4.js +0 -351
  51. package/dist/chunks/content-switcher-item-c0sXBGJ-.js +0 -27
  52. package/dist/chunks/defs-C88lSWuJ.js +0 -1
  53. package/dist/chunks/defs-Do0OvCKd.js +0 -1165
  54. package/dist/chunks/directive-Dp4ZTz-F.js +0 -5
  55. package/dist/chunks/directive-kLG6oqUu.js +0 -27
  56. package/dist/chunks/dropdown-item-T1jCm1fo.js +0 -69
  57. package/dist/chunks/dropdown-item-Wc8Nj3w-.js +0 -632
  58. package/dist/chunks/focus-B3iymVyL.js +0 -1
  59. package/dist/chunks/focus-WnKGH_xB.js +0 -20
  60. package/dist/chunks/form-D6Tce4-W.js +0 -1
  61. package/dist/chunks/form-DpI-v6DA.js +0 -20
  62. package/dist/chunks/host-listener-CN245INl.js +0 -37
  63. package/dist/chunks/host-listener-DD3oGxvg.js +0 -16
  64. package/dist/chunks/host-listener-gxrTpxgv.js +0 -1
  65. package/dist/chunks/host-listener-rUcT_LUW.js +0 -1
  66. package/dist/chunks/icon-loader-CTCoE5GC.js +0 -7
  67. package/dist/chunks/icon-loader-C_ze306U.js +0 -1
  68. package/dist/chunks/icon-loader-utils-DSajrZop.js +0 -117
  69. package/dist/chunks/icon-loader-utils-DxaQOvJB.js +0 -5
  70. package/dist/chunks/if-defined-7syLabv-.js +0 -10
  71. package/dist/chunks/if-defined-CfI-rREy.js +0 -5
  72. package/dist/chunks/if-non-empty-CsjL_4Ck.js +0 -5
  73. package/dist/chunks/if-non-empty-Dp8CFMva.js +0 -1
  74. package/dist/chunks/index-24ucriY6.js +0 -4
  75. package/dist/chunks/index-5uuGFlSc.js +0 -1
  76. package/dist/chunks/index-ACUVets3.js +0 -188
  77. package/dist/chunks/index-B-VOos8Q.js +0 -108
  78. package/dist/chunks/index-B-qA_3dy.js +0 -52
  79. package/dist/chunks/index-B0PkuE0I.js +0 -188
  80. package/dist/chunks/index-B1QlHHpn.js +0 -381
  81. package/dist/chunks/index-B2dVOGmx.js +0 -458
  82. package/dist/chunks/index-BEAD73rD.js +0 -17
  83. package/dist/chunks/index-BEyeMcZh.js +0 -25
  84. package/dist/chunks/index-BJ3okuBC.js +0 -78
  85. package/dist/chunks/index-BJNdKx6x.js +0 -23
  86. package/dist/chunks/index-BL8xz2V4.js +0 -161
  87. package/dist/chunks/index-BL_Y57_H.js +0 -57
  88. package/dist/chunks/index-BLxE94Et.js +0 -3
  89. package/dist/chunks/index-BP0bDhTG.js +0 -2340
  90. package/dist/chunks/index-BUXzbqzT.js +0 -364
  91. package/dist/chunks/index-BVDZj6Fh.js +0 -76
  92. package/dist/chunks/index-BWqDKfds.js +0 -62
  93. package/dist/chunks/index-BaVSzIan.js +0 -79
  94. package/dist/chunks/index-BatQ1Mfz.js +0 -25
  95. package/dist/chunks/index-BefBe_sK.js +0 -19
  96. package/dist/chunks/index-BekoThXC.js +0 -49
  97. package/dist/chunks/index-BnOH6_4r.js +0 -103
  98. package/dist/chunks/index-Bnfa6YBY.js +0 -71
  99. package/dist/chunks/index-BrtdLKIG.js +0 -455
  100. package/dist/chunks/index-BtFYirUg.js +0 -44
  101. package/dist/chunks/index-BtHVJn7K.js +0 -75
  102. package/dist/chunks/index-Bu7ZAHDG.js +0 -12
  103. package/dist/chunks/index-BxRbUwdY.js +0 -30
  104. package/dist/chunks/index-ByQl0Dwz.js +0 -9
  105. package/dist/chunks/index-C-PAoN2Y.js +0 -25
  106. package/dist/chunks/index-C2-pFkgT.js +0 -406
  107. package/dist/chunks/index-C2r3MkpB.js +0 -252
  108. package/dist/chunks/index-C5DwYOee.js +0 -89
  109. package/dist/chunks/index-C5euLddc.js +0 -46
  110. package/dist/chunks/index-C89rc2i5.js +0 -35
  111. package/dist/chunks/index-C8IUL9KS.js +0 -22
  112. package/dist/chunks/index-C99Nf_aK.js +0 -15
  113. package/dist/chunks/index-CDaECc1q.js +0 -12
  114. package/dist/chunks/index-CIeU44CB.js +0 -97
  115. package/dist/chunks/index-CL8Un64Y.js +0 -150
  116. package/dist/chunks/index-CQ1zfW-Z.js +0 -22
  117. package/dist/chunks/index-CR6HxSEn.js +0 -15
  118. package/dist/chunks/index-CSH8oUIN.js +0 -36
  119. package/dist/chunks/index-CTB8Esah.js +0 -1
  120. package/dist/chunks/index-CX6f-3xD.js +0 -563
  121. package/dist/chunks/index-CXSCYGFC.js +0 -452
  122. package/dist/chunks/index-CZQ45Dj9.js +0 -1
  123. package/dist/chunks/index-Cc-HBEN2.js +0 -150
  124. package/dist/chunks/index-Cf3ALdZ-.js +0 -4
  125. package/dist/chunks/index-Cid77wr3.js +0 -45
  126. package/dist/chunks/index-ClBPGpC0.js +0 -129
  127. package/dist/chunks/index-CmXHpydu.js +0 -121
  128. package/dist/chunks/index-CsaKV6jI.js +0 -511
  129. package/dist/chunks/index-CvxrJ8vE.js +0 -39
  130. package/dist/chunks/index-Cy6EogCp.js +0 -429
  131. package/dist/chunks/index-CyTN35KA.js +0 -424
  132. package/dist/chunks/index-D3hwHwSn.js +0 -243
  133. package/dist/chunks/index-D6Eg6Zh4.js +0 -22
  134. package/dist/chunks/index-D7GY2E-B.js +0 -8
  135. package/dist/chunks/index-DCqxl0e0.js +0 -26
  136. package/dist/chunks/index-DDKqKtU4.js +0 -15
  137. package/dist/chunks/index-DHksIe-y.js +0 -1
  138. package/dist/chunks/index-DI-PunST.js +0 -224
  139. package/dist/chunks/index-DIWoAC3Z.js +0 -74
  140. package/dist/chunks/index-DLWyvZrE.js +0 -21
  141. package/dist/chunks/index-DLa-KLg_.js +0 -881
  142. package/dist/chunks/index-DLwGUJd2.js +0 -25
  143. package/dist/chunks/index-DMIKb9St.js +0 -2
  144. package/dist/chunks/index-DOfvb1f6.js +0 -79
  145. package/dist/chunks/index-DQoGlgyI.js +0 -1
  146. package/dist/chunks/index-DR8UmItB.js +0 -1
  147. package/dist/chunks/index-DUiT0Yz_.js +0 -57
  148. package/dist/chunks/index-DW1p-hc-.js +0 -1604
  149. package/dist/chunks/index-DbPU3mfX.js +0 -368
  150. package/dist/chunks/index-DgI4_4yz.js +0 -37
  151. package/dist/chunks/index-DhPg7DCD.js +0 -1
  152. package/dist/chunks/index-Dj-7w7wt.js +0 -65
  153. package/dist/chunks/index-DjSdHUmw.js +0 -284
  154. package/dist/chunks/index-DpCo2duE.js +0 -87
  155. package/dist/chunks/index-DqLDehu6.js +0 -111
  156. package/dist/chunks/index-Ds3e0NlH.js +0 -285
  157. package/dist/chunks/index-DsKNYemW.js +0 -295
  158. package/dist/chunks/index-DwGKd66A.js +0 -259
  159. package/dist/chunks/index-FAwjNd-C.js +0 -4
  160. package/dist/chunks/index-HTZtnvAV.js +0 -81
  161. package/dist/chunks/index-JUJu4Jsu.js +0 -235
  162. package/dist/chunks/index-JmiGhJR9.js +0 -1
  163. package/dist/chunks/index-K3aE8_a_.js +0 -45
  164. package/dist/chunks/index-LVNWqV95.js +0 -683
  165. package/dist/chunks/index-NduNWecG.js +0 -88
  166. package/dist/chunks/index-QOHPo0v8.js +0 -19
  167. package/dist/chunks/index-TnoTOPwm.js +0 -158
  168. package/dist/chunks/index-UIEjSWhu.js +0 -58
  169. package/dist/chunks/index-WQ40q6Fp.js +0 -77
  170. package/dist/chunks/index-a_56_OA-.js +0 -776
  171. package/dist/chunks/index-azaqRvif.js +0 -27
  172. package/dist/chunks/index-dT_yGOFJ.js +0 -1
  173. package/dist/chunks/index-kjtnf5Y1.js +0 -66
  174. package/dist/chunks/index-lOiJBnZe.js +0 -160
  175. package/dist/chunks/index-sl9jQQX-.js +0 -36
  176. package/dist/chunks/index-vkfOeAd5.js +0 -260
  177. package/dist/chunks/index-z2pAR1iR.js +0 -337
  178. package/dist/chunks/loading-icon-9-L_8sVv.js +0 -16
  179. package/dist/chunks/loading-icon-CMPQny72.js +0 -24
  180. package/dist/chunks/main-CXPn-jnk.js +0 -4260
  181. package/dist/chunks/main-CZIPBRMI.js +0 -88
  182. package/dist/chunks/on-BPhwbVf3.js +0 -10
  183. package/dist/chunks/on-XRofyGQh.js +0 -1
  184. package/dist/chunks/property-BIgIlh0E.js +0 -5
  185. package/dist/chunks/property-CTp3Zz2M.js +0 -36
  186. package/dist/chunks/query-CbRg6ZGy.js +0 -23
  187. package/dist/chunks/query-Dh8joWcT.js +0 -9
  188. package/dist/chunks/radio-group-manager-DBAEmhDM.js +0 -1
  189. package/dist/chunks/radio-group-manager-Du5wSOS1.js +0 -102
  190. package/dist/chunks/register-BgvWUC9m.js +0 -11035
  191. package/dist/chunks/register-CFDNay1l.js +0 -1
  192. package/dist/chunks/register-DyYwnhHb.js +0 -2157
  193. package/dist/chunks/register-HH_4Uw0Q.js +0 -1678
  194. package/dist/chunks/search-CC47funo.js +0 -241
  195. package/dist/chunks/search-DB4cjN-w.js +0 -31
  196. package/dist/chunks/select-item-D6rKfA9z.js +0 -80
  197. package/dist/chunks/select-item-Dj2fYOn6.js +0 -364
  198. package/dist/chunks/settings-Bgpv8zuU.js +0 -62
  199. package/dist/chunks/settings-jvP7vP60.js +0 -66
  200. package/dist/chunks/shared-enums-BJDDuJr7.js +0 -1
  201. package/dist/chunks/shared-enums-DALKjQ7e.js +0 -7
  202. package/dist/chunks/state-4XYw1ZN5.js +0 -12
  203. package/dist/chunks/state-BoZ0xvIn.js +0 -5
  204. package/dist/chunks/text-input-BUBwT5gK.js +0 -68
  205. package/dist/chunks/text-input-Dpl3TIYz.js +0 -372
  206. package/dist/chunks/tooltip-content-BV1N7BVi.js +0 -3
  207. package/dist/chunks/tooltip-content-UQcG3dlT.js +0 -135
  208. package/dist/chunks/tslib.es6-B07k2eac.js +0 -1
  209. package/dist/chunks/tslib.es6-C5gLNDSD.js +0 -160
  210. package/dist/chunks/unsafe-html-CCJqBESk.js +0 -5
  211. package/dist/chunks/unsafe-html-KUWR4Xn7.js +0 -27
  212. package/dist/chunks/validity-BMLNCMmP.js +0 -1
  213. package/dist/chunks/validity-CTz7ivUd.js +0 -59
@@ -1,1165 +0,0 @@
1
- const zt = ["top", "right", "bottom", "left"], j = Math.min, R = Math.max, nt = Math.round, et = Math.floor, P = (t) => ({
2
- x: t,
3
- y: t
4
- }), Xt = {
5
- left: "right",
6
- right: "left",
7
- bottom: "top",
8
- top: "bottom"
9
- }, Yt = {
10
- start: "end",
11
- end: "start"
12
- };
13
- function jt(t, e, n) {
14
- return R(t, j(e, n));
15
- }
16
- function Z(t, e) {
17
- return typeof t == "function" ? t(e) : t;
18
- }
19
- function q(t) {
20
- return t.split("-")[0];
21
- }
22
- function I(t) {
23
- return t.split("-")[1];
24
- }
25
- function Ut(t) {
26
- return t === "x" ? "y" : "x";
27
- }
28
- function mt(t) {
29
- return t === "y" ? "height" : "width";
30
- }
31
- const Vt = /* @__PURE__ */ new Set(["top", "bottom"]);
32
- function Y(t) {
33
- return Vt.has(q(t)) ? "y" : "x";
34
- }
35
- function ht(t) {
36
- return Ut(Y(t));
37
- }
38
- function qt(t, e, n) {
39
- n === void 0 && (n = !1);
40
- const o = I(t), i = ht(t), r = mt(i);
41
- let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
42
- return e.reference[r] > e.floating[r] && (s = ot(s)), [s, ot(s)];
43
- }
44
- function Kt(t) {
45
- const e = ot(t);
46
- return [ut(t), e, ut(e)];
47
- }
48
- function ut(t) {
49
- return t.replace(/start|end/g, (e) => Yt[e]);
50
- }
51
- const yt = ["left", "right"], bt = ["right", "left"], Jt = ["top", "bottom"], Qt = ["bottom", "top"];
52
- function Zt(t, e, n) {
53
- switch (t) {
54
- case "top":
55
- case "bottom":
56
- return n ? e ? bt : yt : e ? yt : bt;
57
- case "left":
58
- case "right":
59
- return e ? Jt : Qt;
60
- default:
61
- return [];
62
- }
63
- }
64
- function It(t, e, n, o) {
65
- const i = I(t);
66
- let r = Zt(q(t), n === "start", o);
67
- return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ut)))), r;
68
- }
69
- function ot(t) {
70
- return t.replace(/left|right|bottom|top/g, (e) => Xt[e]);
71
- }
72
- function Nt(t) {
73
- return {
74
- top: 0,
75
- right: 0,
76
- bottom: 0,
77
- left: 0,
78
- ...t
79
- };
80
- }
81
- function Ft(t) {
82
- return typeof t != "number" ? Nt(t) : {
83
- top: t,
84
- right: t,
85
- bottom: t,
86
- left: t
87
- };
88
- }
89
- function it(t) {
90
- const {
91
- x: e,
92
- y: n,
93
- width: o,
94
- height: i
95
- } = t;
96
- return {
97
- width: o,
98
- height: i,
99
- top: n,
100
- left: e,
101
- right: e + o,
102
- bottom: n + i,
103
- x: e,
104
- y: n
105
- };
106
- }
107
- function xt(t, e, n) {
108
- let {
109
- reference: o,
110
- floating: i
111
- } = t;
112
- const r = Y(e), s = ht(e), l = mt(s), a = q(e), c = r === "y", f = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
113
- let u;
114
- switch (a) {
115
- case "top":
116
- u = {
117
- x: f,
118
- y: o.y - i.height
119
- };
120
- break;
121
- case "bottom":
122
- u = {
123
- x: f,
124
- y: o.y + o.height
125
- };
126
- break;
127
- case "right":
128
- u = {
129
- x: o.x + o.width,
130
- y: d
131
- };
132
- break;
133
- case "left":
134
- u = {
135
- x: o.x - i.width,
136
- y: d
137
- };
138
- break;
139
- default:
140
- u = {
141
- x: o.x,
142
- y: o.y
143
- };
144
- }
145
- switch (I(e)) {
146
- case "start":
147
- u[s] -= p * (n && c ? -1 : 1);
148
- break;
149
- case "end":
150
- u[s] += p * (n && c ? -1 : 1);
151
- break;
152
- }
153
- return u;
154
- }
155
- const Gt = async (t, e, n) => {
156
- const {
157
- placement: o = "bottom",
158
- strategy: i = "absolute",
159
- middleware: r = [],
160
- platform: s
161
- } = n, l = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(e));
162
- let c = await s.getElementRects({
163
- reference: t,
164
- floating: e,
165
- strategy: i
166
- }), {
167
- x: f,
168
- y: d
169
- } = xt(c, o, a), p = o, u = {}, m = 0;
170
- for (let g = 0; g < l.length; g++) {
171
- const {
172
- name: h,
173
- fn: w
174
- } = l[g], {
175
- x: b,
176
- y: x,
177
- data: v,
178
- reset: y
179
- } = await w({
180
- x: f,
181
- y: d,
182
- initialPlacement: o,
183
- placement: p,
184
- strategy: i,
185
- middlewareData: u,
186
- rects: c,
187
- platform: s,
188
- elements: {
189
- reference: t,
190
- floating: e
191
- }
192
- });
193
- f = b ?? f, d = x ?? d, u = {
194
- ...u,
195
- [h]: {
196
- ...u[h],
197
- ...v
198
- }
199
- }, y && m <= 50 && (m++, typeof y == "object" && (y.placement && (p = y.placement), y.rects && (c = y.rects === !0 ? await s.getElementRects({
200
- reference: t,
201
- floating: e,
202
- strategy: i
203
- }) : y.rects), {
204
- x: f,
205
- y: d
206
- } = xt(c, p, a)), g = -1);
207
- }
208
- return {
209
- x: f,
210
- y: d,
211
- placement: p,
212
- strategy: i,
213
- middlewareData: u
214
- };
215
- };
216
- async function st(t, e) {
217
- var n;
218
- e === void 0 && (e = {});
219
- const {
220
- x: o,
221
- y: i,
222
- platform: r,
223
- rects: s,
224
- elements: l,
225
- strategy: a
226
- } = t, {
227
- boundary: c = "clippingAncestors",
228
- rootBoundary: f = "viewport",
229
- elementContext: d = "floating",
230
- altBoundary: p = !1,
231
- padding: u = 0
232
- } = Z(e, t), m = Ft(u), h = l[p ? d === "floating" ? "reference" : "floating" : d], w = it(await r.getClippingRect({
233
- element: (n = await (r.isElement == null ? void 0 : r.isElement(h))) == null || n ? h : h.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
234
- boundary: c,
235
- rootBoundary: f,
236
- strategy: a
237
- })), b = d === "floating" ? {
238
- x: o,
239
- y: i,
240
- width: s.floating.width,
241
- height: s.floating.height
242
- } : s.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), v = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
243
- x: 1,
244
- y: 1
245
- } : {
246
- x: 1,
247
- y: 1
248
- }, y = it(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
249
- elements: l,
250
- rect: b,
251
- offsetParent: x,
252
- strategy: a
253
- }) : b);
254
- return {
255
- top: (w.top - y.top + m.top) / v.y,
256
- bottom: (y.bottom - w.bottom + m.bottom) / v.y,
257
- left: (w.left - y.left + m.left) / v.x,
258
- right: (y.right - w.right + m.right) / v.x
259
- };
260
- }
261
- const te = (t) => ({
262
- name: "arrow",
263
- options: t,
264
- async fn(e) {
265
- const {
266
- x: n,
267
- y: o,
268
- placement: i,
269
- rects: r,
270
- platform: s,
271
- elements: l,
272
- middlewareData: a
273
- } = e, {
274
- element: c,
275
- padding: f = 0
276
- } = Z(t, e) || {};
277
- if (c == null)
278
- return {};
279
- const d = Ft(f), p = {
280
- x: n,
281
- y: o
282
- }, u = ht(i), m = mt(u), g = await s.getDimensions(c), h = u === "y", w = h ? "top" : "left", b = h ? "bottom" : "right", x = h ? "clientHeight" : "clientWidth", v = r.reference[m] + r.reference[u] - p[u] - r.floating[m], y = p[u] - r.reference[u], S = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c));
283
- let T = S ? S[x] : 0;
284
- (!T || !await (s.isElement == null ? void 0 : s.isElement(S))) && (T = l.floating[x] || r.floating[m]);
285
- const D = v / 2 - y / 2, L = T / 2 - g[m] / 2 - 1, A = j(d[w], L), k = j(d[b], L), F = A, z = T - g[m] - k, C = T / 2 - g[m] / 2 + D, V = jt(F, C, z), M = !a.arrow && I(i) != null && C !== V && r.reference[m] / 2 - (C < F ? A : k) - g[m] / 2 < 0, B = M ? C < F ? C - F : C - z : 0;
286
- return {
287
- [u]: p[u] + B,
288
- data: {
289
- [u]: V,
290
- centerOffset: C - V - B,
291
- ...M && {
292
- alignmentOffset: B
293
- }
294
- },
295
- reset: M
296
- };
297
- }
298
- }), ee = function(t) {
299
- return t === void 0 && (t = {}), {
300
- name: "flip",
301
- options: t,
302
- async fn(e) {
303
- var n, o;
304
- const {
305
- placement: i,
306
- middlewareData: r,
307
- rects: s,
308
- initialPlacement: l,
309
- platform: a,
310
- elements: c
311
- } = e, {
312
- mainAxis: f = !0,
313
- crossAxis: d = !0,
314
- fallbackPlacements: p,
315
- fallbackStrategy: u = "bestFit",
316
- fallbackAxisSideDirection: m = "none",
317
- flipAlignment: g = !0,
318
- ...h
319
- } = Z(t, e);
320
- if ((n = r.arrow) != null && n.alignmentOffset)
321
- return {};
322
- const w = q(i), b = Y(l), x = q(l) === l, v = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), y = p || (x || !g ? [ot(l)] : Kt(l)), S = m !== "none";
323
- !p && S && y.push(...It(l, g, m, v));
324
- const T = [l, ...y], D = await st(e, h), L = [];
325
- let A = ((o = r.flip) == null ? void 0 : o.overflows) || [];
326
- if (f && L.push(D[w]), d) {
327
- const C = qt(i, s, v);
328
- L.push(D[C[0]], D[C[1]]);
329
- }
330
- if (A = [...A, {
331
- placement: i,
332
- overflows: L
333
- }], !L.every((C) => C <= 0)) {
334
- var k, F;
335
- const C = (((k = r.flip) == null ? void 0 : k.index) || 0) + 1, V = T[C];
336
- if (V && (!(d === "alignment" ? b !== Y(V) : !1) || // We leave the current main axis only if every placement on that axis
337
- // overflows the main axis.
338
- A.every((H) => Y(H.placement) === b ? H.overflows[0] > 0 : !0)))
339
- return {
340
- data: {
341
- index: C,
342
- overflows: A
343
- },
344
- reset: {
345
- placement: V
346
- }
347
- };
348
- let M = (F = A.filter((B) => B.overflows[0] <= 0).sort((B, H) => B.overflows[1] - H.overflows[1])[0]) == null ? void 0 : F.placement;
349
- if (!M)
350
- switch (u) {
351
- case "bestFit": {
352
- var z;
353
- const B = (z = A.filter((H) => {
354
- if (S) {
355
- const X = Y(H.placement);
356
- return X === b || // Create a bias to the `y` side axis due to horizontal
357
- // reading directions favoring greater width.
358
- X === "y";
359
- }
360
- return !0;
361
- }).map((H) => [H.placement, H.overflows.filter((X) => X > 0).reduce((X, Mt) => X + Mt, 0)]).sort((H, X) => H[1] - X[1])[0]) == null ? void 0 : z[0];
362
- B && (M = B);
363
- break;
364
- }
365
- case "initialPlacement":
366
- M = l;
367
- break;
368
- }
369
- if (i !== M)
370
- return {
371
- reset: {
372
- placement: M
373
- }
374
- };
375
- }
376
- return {};
377
- }
378
- };
379
- };
380
- function vt(t, e) {
381
- return {
382
- top: t.top - e.height,
383
- right: t.right - e.width,
384
- bottom: t.bottom - e.height,
385
- left: t.left - e.width
386
- };
387
- }
388
- function Tt(t) {
389
- return zt.some((e) => t[e] >= 0);
390
- }
391
- const ne = function(t) {
392
- return t === void 0 && (t = {}), {
393
- name: "hide",
394
- options: t,
395
- async fn(e) {
396
- const {
397
- rects: n
398
- } = e, {
399
- strategy: o = "referenceHidden",
400
- ...i
401
- } = Z(t, e);
402
- switch (o) {
403
- case "referenceHidden": {
404
- const r = await st(e, {
405
- ...i,
406
- elementContext: "reference"
407
- }), s = vt(r, n.reference);
408
- return {
409
- data: {
410
- referenceHiddenOffsets: s,
411
- referenceHidden: Tt(s)
412
- }
413
- };
414
- }
415
- case "escaped": {
416
- const r = await st(e, {
417
- ...i,
418
- altBoundary: !0
419
- }), s = vt(r, n.floating);
420
- return {
421
- data: {
422
- escapedOffsets: s,
423
- escaped: Tt(s)
424
- }
425
- };
426
- }
427
- default:
428
- return {};
429
- }
430
- }
431
- };
432
- }, oe = /* @__PURE__ */ new Set(["left", "top"]);
433
- async function ie(t, e) {
434
- const {
435
- placement: n,
436
- platform: o,
437
- elements: i
438
- } = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = q(n), l = I(n), a = Y(n) === "y", c = oe.has(s) ? -1 : 1, f = r && a ? -1 : 1, d = Z(e, t);
439
- let {
440
- mainAxis: p,
441
- crossAxis: u,
442
- alignmentAxis: m
443
- } = typeof d == "number" ? {
444
- mainAxis: d,
445
- crossAxis: 0,
446
- alignmentAxis: null
447
- } : {
448
- mainAxis: d.mainAxis || 0,
449
- crossAxis: d.crossAxis || 0,
450
- alignmentAxis: d.alignmentAxis
451
- };
452
- return l && typeof m == "number" && (u = l === "end" ? m * -1 : m), a ? {
453
- x: u * f,
454
- y: p * c
455
- } : {
456
- x: p * c,
457
- y: u * f
458
- };
459
- }
460
- const se = function(t) {
461
- return t === void 0 && (t = 0), {
462
- name: "offset",
463
- options: t,
464
- async fn(e) {
465
- var n, o;
466
- const {
467
- x: i,
468
- y: r,
469
- placement: s,
470
- middlewareData: l
471
- } = e, a = await ie(e, t);
472
- return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
473
- x: i + a.x,
474
- y: r + a.y,
475
- data: {
476
- ...a,
477
- placement: s
478
- }
479
- };
480
- }
481
- };
482
- }, re = function(t) {
483
- return t === void 0 && (t = {}), {
484
- name: "size",
485
- options: t,
486
- async fn(e) {
487
- var n, o;
488
- const {
489
- placement: i,
490
- rects: r,
491
- platform: s,
492
- elements: l
493
- } = e, {
494
- apply: a = () => {
495
- },
496
- ...c
497
- } = Z(t, e), f = await st(e, c), d = q(i), p = I(i), u = Y(i) === "y", {
498
- width: m,
499
- height: g
500
- } = r.floating;
501
- let h, w;
502
- d === "top" || d === "bottom" ? (h = d, w = p === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (w = d, h = p === "end" ? "top" : "bottom");
503
- const b = g - f.top - f.bottom, x = m - f.left - f.right, v = j(g - f[h], b), y = j(m - f[w], x), S = !e.middlewareData.shift;
504
- let T = v, D = y;
505
- if ((n = e.middlewareData.shift) != null && n.enabled.x && (D = x), (o = e.middlewareData.shift) != null && o.enabled.y && (T = b), S && !p) {
506
- const A = R(f.left, 0), k = R(f.right, 0), F = R(f.top, 0), z = R(f.bottom, 0);
507
- u ? D = m - 2 * (A !== 0 || k !== 0 ? A + k : R(f.left, f.right)) : T = g - 2 * (F !== 0 || z !== 0 ? F + z : R(f.top, f.bottom));
508
- }
509
- await a({
510
- ...e,
511
- availableWidth: D,
512
- availableHeight: T
513
- });
514
- const L = await s.getDimensions(l.floating);
515
- return m !== L.width || g !== L.height ? {
516
- reset: {
517
- rects: !0
518
- }
519
- } : {};
520
- }
521
- };
522
- };
523
- function rt() {
524
- return typeof window < "u";
525
- }
526
- function N(t) {
527
- return kt(t) ? (t.nodeName || "").toLowerCase() : "#document";
528
- }
529
- function O(t) {
530
- var e;
531
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
532
- }
533
- function _(t) {
534
- var e;
535
- return (e = (kt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
536
- }
537
- function kt(t) {
538
- return rt() ? t instanceof Node || t instanceof O(t).Node : !1;
539
- }
540
- function W(t) {
541
- return rt() ? t instanceof Element || t instanceof O(t).Element : !1;
542
- }
543
- function $(t) {
544
- return rt() ? t instanceof HTMLElement || t instanceof O(t).HTMLElement : !1;
545
- }
546
- function St(t) {
547
- return !rt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof O(t).ShadowRoot;
548
- }
549
- const le = /* @__PURE__ */ new Set(["inline", "contents"]);
550
- function tt(t) {
551
- const {
552
- overflow: e,
553
- overflowX: n,
554
- overflowY: o,
555
- display: i
556
- } = E(t);
557
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !le.has(i);
558
- }
559
- const ce = /* @__PURE__ */ new Set(["table", "td", "th"]);
560
- function ae(t) {
561
- return ce.has(N(t));
562
- }
563
- const fe = [":popover-open", ":modal"];
564
- function lt(t) {
565
- return fe.some((e) => {
566
- try {
567
- return t.matches(e);
568
- } catch {
569
- return !1;
570
- }
571
- });
572
- }
573
- const ue = ["transform", "translate", "scale", "rotate", "perspective"], de = ["transform", "translate", "scale", "rotate", "perspective", "filter"], me = ["paint", "layout", "strict", "content"];
574
- function gt(t) {
575
- const e = pt(), n = W(t) ? E(t) : t;
576
- return ue.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || de.some((o) => (n.willChange || "").includes(o)) || me.some((o) => (n.contain || "").includes(o));
577
- }
578
- function he(t) {
579
- let e = U(t);
580
- for (; $(e) && !Q(e); ) {
581
- if (gt(e))
582
- return e;
583
- if (lt(e))
584
- return null;
585
- e = U(e);
586
- }
587
- return null;
588
- }
589
- function pt() {
590
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
591
- }
592
- const ge = /* @__PURE__ */ new Set(["html", "body", "#document"]);
593
- function Q(t) {
594
- return ge.has(N(t));
595
- }
596
- function E(t) {
597
- return O(t).getComputedStyle(t);
598
- }
599
- function ct(t) {
600
- return W(t) ? {
601
- scrollLeft: t.scrollLeft,
602
- scrollTop: t.scrollTop
603
- } : {
604
- scrollLeft: t.scrollX,
605
- scrollTop: t.scrollY
606
- };
607
- }
608
- function U(t) {
609
- if (N(t) === "html")
610
- return t;
611
- const e = (
612
- // Step into the shadow DOM of the parent of a slotted node.
613
- t.assignedSlot || // DOM Element detected.
614
- t.parentNode || // ShadowRoot detected.
615
- St(t) && t.host || // Fallback.
616
- _(t)
617
- );
618
- return St(e) ? e.host : e;
619
- }
620
- function Bt(t) {
621
- const e = U(t);
622
- return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : $(e) && tt(e) ? e : Bt(e);
623
- }
624
- function G(t, e, n) {
625
- var o;
626
- e === void 0 && (e = []), n === void 0 && (n = !0);
627
- const i = Bt(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = O(i);
628
- if (r) {
629
- const l = dt(s);
630
- return e.concat(s, s.visualViewport || [], tt(i) ? i : [], l && n ? G(l) : []);
631
- }
632
- return e.concat(i, G(i, [], n));
633
- }
634
- function dt(t) {
635
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
636
- }
637
- function Ht(t) {
638
- const e = E(t);
639
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
640
- const i = $(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, l = nt(n) !== r || nt(o) !== s;
641
- return l && (n = r, o = s), {
642
- width: n,
643
- height: o,
644
- $: l
645
- };
646
- }
647
- function wt(t) {
648
- return W(t) ? t : t.contextElement;
649
- }
650
- function J(t) {
651
- const e = wt(t);
652
- if (!$(e))
653
- return P(1);
654
- const n = e.getBoundingClientRect(), {
655
- width: o,
656
- height: i,
657
- $: r
658
- } = Ht(e);
659
- let s = (r ? nt(n.width) : n.width) / o, l = (r ? nt(n.height) : n.height) / i;
660
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
661
- x: s,
662
- y: l
663
- };
664
- }
665
- const pe = /* @__PURE__ */ P(0);
666
- function Wt(t) {
667
- const e = O(t);
668
- return !pt() || !e.visualViewport ? pe : {
669
- x: e.visualViewport.offsetLeft,
670
- y: e.visualViewport.offsetTop
671
- };
672
- }
673
- function we(t, e, n) {
674
- return e === void 0 && (e = !1), !n || e && n !== O(t) ? !1 : e;
675
- }
676
- function K(t, e, n, o) {
677
- e === void 0 && (e = !1), n === void 0 && (n = !1);
678
- const i = t.getBoundingClientRect(), r = wt(t);
679
- let s = P(1);
680
- e && (o ? W(o) && (s = J(o)) : s = J(t));
681
- const l = we(r, n, o) ? Wt(r) : P(0);
682
- let a = (i.left + l.x) / s.x, c = (i.top + l.y) / s.y, f = i.width / s.x, d = i.height / s.y;
683
- if (r) {
684
- const p = O(r), u = o && W(o) ? O(o) : o;
685
- let m = p, g = dt(m);
686
- for (; g && o && u !== m; ) {
687
- const h = J(g), w = g.getBoundingClientRect(), b = E(g), x = w.left + (g.clientLeft + parseFloat(b.paddingLeft)) * h.x, v = w.top + (g.clientTop + parseFloat(b.paddingTop)) * h.y;
688
- a *= h.x, c *= h.y, f *= h.x, d *= h.y, a += x, c += v, m = O(g), g = dt(m);
689
- }
690
- }
691
- return it({
692
- width: f,
693
- height: d,
694
- x: a,
695
- y: c
696
- });
697
- }
698
- function at(t, e) {
699
- const n = ct(t).scrollLeft;
700
- return e ? e.left + n : K(_(t)).left + n;
701
- }
702
- function Et(t, e) {
703
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - at(t, n), i = n.top + e.scrollTop;
704
- return {
705
- x: o,
706
- y: i
707
- };
708
- }
709
- function ye(t) {
710
- let {
711
- elements: e,
712
- rect: n,
713
- offsetParent: o,
714
- strategy: i
715
- } = t;
716
- const r = i === "fixed", s = _(o), l = e ? lt(e.floating) : !1;
717
- if (o === s || l && r)
718
- return n;
719
- let a = {
720
- scrollLeft: 0,
721
- scrollTop: 0
722
- }, c = P(1);
723
- const f = P(0), d = $(o);
724
- if ((d || !d && !r) && ((N(o) !== "body" || tt(s)) && (a = ct(o)), $(o))) {
725
- const u = K(o);
726
- c = J(o), f.x = u.x + o.clientLeft, f.y = u.y + o.clientTop;
727
- }
728
- const p = s && !d && !r ? Et(s, a) : P(0);
729
- return {
730
- width: n.width * c.x,
731
- height: n.height * c.y,
732
- x: n.x * c.x - a.scrollLeft * c.x + f.x + p.x,
733
- y: n.y * c.y - a.scrollTop * c.y + f.y + p.y
734
- };
735
- }
736
- function be(t) {
737
- return Array.from(t.getClientRects());
738
- }
739
- function xe(t) {
740
- const e = _(t), n = ct(t), o = t.ownerDocument.body, i = R(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = R(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
741
- let s = -n.scrollLeft + at(t);
742
- const l = -n.scrollTop;
743
- return E(o).direction === "rtl" && (s += R(e.clientWidth, o.clientWidth) - i), {
744
- width: i,
745
- height: r,
746
- x: s,
747
- y: l
748
- };
749
- }
750
- const At = 25;
751
- function ve(t, e) {
752
- const n = O(t), o = _(t), i = n.visualViewport;
753
- let r = o.clientWidth, s = o.clientHeight, l = 0, a = 0;
754
- if (i) {
755
- r = i.width, s = i.height;
756
- const f = pt();
757
- (!f || f && e === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
758
- }
759
- const c = at(o);
760
- if (c <= 0) {
761
- const f = o.ownerDocument, d = f.body, p = getComputedStyle(d), u = f.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, m = Math.abs(o.clientWidth - d.clientWidth - u);
762
- m <= At && (r -= m);
763
- } else c <= At && (r += c);
764
- return {
765
- width: r,
766
- height: s,
767
- x: l,
768
- y: a
769
- };
770
- }
771
- const Te = /* @__PURE__ */ new Set(["absolute", "fixed"]);
772
- function Se(t, e) {
773
- const n = K(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = $(t) ? J(t) : P(1), s = t.clientWidth * r.x, l = t.clientHeight * r.y, a = i * r.x, c = o * r.y;
774
- return {
775
- width: s,
776
- height: l,
777
- x: a,
778
- y: c
779
- };
780
- }
781
- function Ct(t, e, n) {
782
- let o;
783
- if (e === "viewport")
784
- o = ve(t, n);
785
- else if (e === "document")
786
- o = xe(_(t));
787
- else if (W(e))
788
- o = Se(e, n);
789
- else {
790
- const i = Wt(t);
791
- o = {
792
- x: e.x - i.x,
793
- y: e.y - i.y,
794
- width: e.width,
795
- height: e.height
796
- };
797
- }
798
- return it(o);
799
- }
800
- function Pt(t, e) {
801
- const n = U(t);
802
- return n === e || !W(n) || Q(n) ? !1 : E(n).position === "fixed" || Pt(n, e);
803
- }
804
- function Ae(t, e) {
805
- const n = e.get(t);
806
- if (n)
807
- return n;
808
- let o = G(t, [], !1).filter((l) => W(l) && N(l) !== "body"), i = null;
809
- const r = E(t).position === "fixed";
810
- let s = r ? U(t) : t;
811
- for (; W(s) && !Q(s); ) {
812
- const l = E(s), a = gt(s);
813
- !a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && Te.has(i.position) || tt(s) && !a && Pt(t, s)) ? o = o.filter((f) => f !== s) : i = l, s = U(s);
814
- }
815
- return e.set(t, o), o;
816
- }
817
- function Ce(t) {
818
- let {
819
- element: e,
820
- boundary: n,
821
- rootBoundary: o,
822
- strategy: i
823
- } = t;
824
- const s = [...n === "clippingAncestors" ? lt(e) ? [] : Ae(e, this._c) : [].concat(n), o], l = s[0], a = s.reduce((c, f) => {
825
- const d = Ct(e, f, i);
826
- return c.top = R(d.top, c.top), c.right = j(d.right, c.right), c.bottom = j(d.bottom, c.bottom), c.left = R(d.left, c.left), c;
827
- }, Ct(e, l, i));
828
- return {
829
- width: a.right - a.left,
830
- height: a.bottom - a.top,
831
- x: a.left,
832
- y: a.top
833
- };
834
- }
835
- function Re(t) {
836
- const {
837
- width: e,
838
- height: n
839
- } = Ht(t);
840
- return {
841
- width: e,
842
- height: n
843
- };
844
- }
845
- function Oe(t, e, n) {
846
- const o = $(e), i = _(e), r = n === "fixed", s = K(t, !0, r, e);
847
- let l = {
848
- scrollLeft: 0,
849
- scrollTop: 0
850
- };
851
- const a = P(0);
852
- function c() {
853
- a.x = at(i);
854
- }
855
- if (o || !o && !r)
856
- if ((N(e) !== "body" || tt(i)) && (l = ct(e)), o) {
857
- const u = K(e, !0, r, e);
858
- a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
859
- } else i && c();
860
- r && !o && i && c();
861
- const f = i && !o && !r ? Et(i, l) : P(0), d = s.left + l.scrollLeft - a.x - f.x, p = s.top + l.scrollTop - a.y - f.y;
862
- return {
863
- x: d,
864
- y: p,
865
- width: s.width,
866
- height: s.height
867
- };
868
- }
869
- function ft(t) {
870
- return E(t).position === "static";
871
- }
872
- function Rt(t, e) {
873
- if (!$(t) || E(t).position === "fixed")
874
- return null;
875
- if (e)
876
- return e(t);
877
- let n = t.offsetParent;
878
- return _(t) === n && (n = n.ownerDocument.body), n;
879
- }
880
- function $t(t, e) {
881
- const n = O(t);
882
- if (lt(t))
883
- return n;
884
- if (!$(t)) {
885
- let i = U(t);
886
- for (; i && !Q(i); ) {
887
- if (W(i) && !ft(i))
888
- return i;
889
- i = U(i);
890
- }
891
- return n;
892
- }
893
- let o = Rt(t, e);
894
- for (; o && ae(o) && ft(o); )
895
- o = Rt(o, e);
896
- return o && Q(o) && ft(o) && !gt(o) ? n : o || he(t) || n;
897
- }
898
- const De = async function(t) {
899
- const e = this.getOffsetParent || $t, n = this.getDimensions, o = await n(t.floating);
900
- return {
901
- reference: Oe(t.reference, await e(t.floating), t.strategy),
902
- floating: {
903
- x: 0,
904
- y: 0,
905
- width: o.width,
906
- height: o.height
907
- }
908
- };
909
- };
910
- function Le(t) {
911
- return E(t).direction === "rtl";
912
- }
913
- const Fe = {
914
- convertOffsetParentRelativeRectToViewportRelativeRect: ye,
915
- getDocumentElement: _,
916
- getClippingRect: Ce,
917
- getOffsetParent: $t,
918
- getElementRects: De,
919
- getClientRects: be,
920
- getDimensions: Re,
921
- getScale: J,
922
- isElement: W,
923
- isRTL: Le
924
- };
925
- function _t(t, e) {
926
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
927
- }
928
- function ke(t, e) {
929
- let n = null, o;
930
- const i = _(t);
931
- function r() {
932
- var l;
933
- clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
934
- }
935
- function s(l, a) {
936
- l === void 0 && (l = !1), a === void 0 && (a = 1), r();
937
- const c = t.getBoundingClientRect(), {
938
- left: f,
939
- top: d,
940
- width: p,
941
- height: u
942
- } = c;
943
- if (l || e(), !p || !u)
944
- return;
945
- const m = et(d), g = et(i.clientWidth - (f + p)), h = et(i.clientHeight - (d + u)), w = et(f), x = {
946
- rootMargin: -m + "px " + -g + "px " + -h + "px " + -w + "px",
947
- threshold: R(0, j(1, a)) || 1
948
- };
949
- let v = !0;
950
- function y(S) {
951
- const T = S[0].intersectionRatio;
952
- if (T !== a) {
953
- if (!v)
954
- return s();
955
- T ? s(!1, T) : o = setTimeout(() => {
956
- s(!1, 1e-7);
957
- }, 1e3);
958
- }
959
- T === 1 && !_t(c, t.getBoundingClientRect()) && s(), v = !1;
960
- }
961
- try {
962
- n = new IntersectionObserver(y, {
963
- ...x,
964
- // Handle <iframe>s
965
- root: i.ownerDocument
966
- });
967
- } catch {
968
- n = new IntersectionObserver(y, x);
969
- }
970
- n.observe(t);
971
- }
972
- return s(!0), r;
973
- }
974
- function Be(t, e, n, o) {
975
- o === void 0 && (o = {});
976
- const {
977
- ancestorScroll: i = !0,
978
- ancestorResize: r = !0,
979
- elementResize: s = typeof ResizeObserver == "function",
980
- layoutShift: l = typeof IntersectionObserver == "function",
981
- animationFrame: a = !1
982
- } = o, c = wt(t), f = i || r ? [...c ? G(c) : [], ...G(e)] : [];
983
- f.forEach((w) => {
984
- i && w.addEventListener("scroll", n, {
985
- passive: !0
986
- }), r && w.addEventListener("resize", n);
987
- });
988
- const d = c && l ? ke(c, n) : null;
989
- let p = -1, u = null;
990
- s && (u = new ResizeObserver((w) => {
991
- let [b] = w;
992
- b && b.target === c && u && (u.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
993
- var x;
994
- (x = u) == null || x.observe(e);
995
- })), n();
996
- }), c && !a && u.observe(c), u.observe(e));
997
- let m, g = a ? K(t) : null;
998
- a && h();
999
- function h() {
1000
- const w = K(t);
1001
- g && !_t(g, w) && n(), g = w, m = requestAnimationFrame(h);
1002
- }
1003
- return n(), () => {
1004
- var w;
1005
- f.forEach((b) => {
1006
- i && b.removeEventListener("scroll", n), r && b.removeEventListener("resize", n);
1007
- }), d?.(), (w = u) == null || w.disconnect(), u = null, a && cancelAnimationFrame(m);
1008
- };
1009
- }
1010
- const He = se, We = ee, Ot = re, Ee = ne, Pe = te, $e = (t, e, n) => {
1011
- const o = /* @__PURE__ */ new Map(), i = {
1012
- platform: Fe,
1013
- ...n
1014
- }, r = {
1015
- ...i.platform,
1016
- _c: o
1017
- };
1018
- return Gt(t, e, {
1019
- ...i,
1020
- platform: r
1021
- });
1022
- };
1023
- class _e {
1024
- /**
1025
- * register with host component
1026
- * @param host host component
1027
- */
1028
- constructor(e) {
1029
- this.updatePlacement = () => {
1030
- this.computePlacement();
1031
- }, this.host = e, e.addController(this);
1032
- }
1033
- async setPlacement(e = this.options) {
1034
- this.options = e;
1035
- const { trigger: n, target: o } = e;
1036
- this.cleanup = Be(n, o, this.updatePlacement);
1037
- }
1038
- async computePlacement() {
1039
- var e, n, o;
1040
- const { arrowElement: i, alignment: r, caret: s, trigger: l, target: a, styleElement: c, matchWidth: f, open: d, alignmentAxisOffset: p, autoAlignBoundary: u, isTabTip: m } = this.options, g = c ?? a;
1041
- if (!g)
1042
- return;
1043
- let h;
1044
- switch (r) {
1045
- case "top-left":
1046
- h = "top-start";
1047
- break;
1048
- case "top-right":
1049
- h = "top-end";
1050
- break;
1051
- case "bottom-left":
1052
- h = "bottom-start";
1053
- break;
1054
- case "bottom-right":
1055
- h = "bottom-end";
1056
- break;
1057
- case "left-bottom":
1058
- h = "left-end";
1059
- break;
1060
- case "left-top":
1061
- h = "left-start";
1062
- break;
1063
- case "right-bottom":
1064
- h = "right-end";
1065
- break;
1066
- case "right-top":
1067
- h = "right-start";
1068
- break;
1069
- default:
1070
- h = r;
1071
- break;
1072
- }
1073
- const w = getComputedStyle(g), x = m ? 0 : (e = ((y) => {
1074
- const S = parseFloat(y);
1075
- return y.trim().endsWith("rem") ? S * 16 : S;
1076
- })(w.getPropertyValue("--cds-popover-offset").trim())) !== null && e !== void 0 ? e : 10, v = [
1077
- He(s && !m ? { alignmentAxis: p, mainAxis: x } : 0),
1078
- We({
1079
- fallbackPlacements: m ? h.includes("bottom") ? ["bottom-start", "bottom-end", "top-start", "top-end"] : ["top-start", "top-end", "bottom-start", "bottom-end"] : h.includes("bottom") ? [
1080
- "bottom",
1081
- "bottom-start",
1082
- "bottom-end",
1083
- "right",
1084
- "right-start",
1085
- "right-end",
1086
- "left",
1087
- "left-start",
1088
- "left-end",
1089
- "top",
1090
- "top-start",
1091
- "top-end"
1092
- ] : [
1093
- "top",
1094
- "top-start",
1095
- "top-end",
1096
- "left",
1097
- "left-start",
1098
- "left-end",
1099
- "right",
1100
- "right-start",
1101
- "right-end",
1102
- "bottom",
1103
- "bottom-start",
1104
- "bottom-end"
1105
- ],
1106
- fallbackStrategy: "initialPlacement",
1107
- fallbackAxisSideDirection: "start",
1108
- boundary: u
1109
- }),
1110
- ...f && (h === "bottom" || h === "top") ? [
1111
- Ot({
1112
- apply({ rects: y, elements: S }) {
1113
- S.floating.style.width = `${y.reference.width}px`;
1114
- }
1115
- })
1116
- ] : [
1117
- Ot({
1118
- apply({ elements: y }) {
1119
- y.floating.style.removeProperty("width");
1120
- }
1121
- })
1122
- ],
1123
- ...s && i ? [Pe({ element: i, padding: 15 })] : [],
1124
- Ee()
1125
- ];
1126
- if (d) {
1127
- const { x: y, y: S, placement: T, middlewareData: D, strategy: L } = await $e(l, g, {
1128
- strategy: "fixed",
1129
- middleware: v,
1130
- placement: h
1131
- });
1132
- if (g.setAttribute("align", T), g.style.left = `${y}px`, g.style.top = `${S}px`, g.style.position = `${L}`, g.style.visibility = !((n = D.hide) === null || n === void 0) && n.referenceHidden ? "hidden" : "visible", i) {
1133
- const { x: A, y: k } = D.arrow, F = {
1134
- top: "bottom",
1135
- right: "left",
1136
- bottom: "top",
1137
- left: "right"
1138
- }[T.split("-")[0]];
1139
- i.style.left = A != null ? `${A}px` : "", i.style.top = k != null ? `${k}px` : "", i.style.right = "", i.style.bottom = "", i.style[F] = `${-i.offsetWidth / 2}px`;
1140
- }
1141
- (this.host.tagName === "CDS-AI-LABEL" || this.host.tagName === "CDS-SLUG") && ((o = this.host) === null || o === void 0 || o.setAttribute("alignment", T));
1142
- }
1143
- }
1144
- hostUpdated() {
1145
- var e;
1146
- this.host.hasAttribute("open") || ((e = this.cleanup) === null || e === void 0 || e.call(this), this.cleanup = void 0);
1147
- }
1148
- hostDisconnected() {
1149
- var e;
1150
- (e = this.cleanup) === null || e === void 0 || e.call(this), this.cleanup = void 0;
1151
- }
1152
- }
1153
- var Dt;
1154
- (function(t) {
1155
- t.TOP = "top", t.TOP_LEFT = "top-left", t.TOP_RIGHT = "top-right", t.TOP_START = "top-start", t.TOP_END = "top-end", t.BOTTOM = "bottom", t.BOTTOM_LEFT = "bottom-left", t.BOTTOM_RIGHT = "bottom-right", t.BOTTOM_START = "bottom-start", t.BOTTOM_END = "bottom-end", t.LEFT = "left", t.LEFT_BOTTOM = "left-bottom", t.LEFT_TOP = "left-top", t.LEFT_START = "left-start", t.LEFT_END = "left-end", t.RIGHT = "right", t.RIGHT_BOTTOM = "right-bottom", t.RIGHT_TOP = "right-top", t.RIGHT_START = "right-start", t.RIGHT_END = "right-end";
1156
- })(Dt || (Dt = {}));
1157
- var Lt;
1158
- (function(t) {
1159
- t.LAYER = "layer", t.BACKGROUND = "background";
1160
- })(Lt || (Lt = {}));
1161
- export {
1162
- _e as F,
1163
- Dt as P,
1164
- Lt as a
1165
- };