highsoft-ui 1.0.111 → 1.0.113

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 (68) hide show
  1. package/dist/Button-Bbc4vmW_.js +45 -0
  2. package/dist/Container-LAkF4ShX.js +11 -0
  3. package/dist/CookiePolicyModal-BH2uHybE.js +90 -0
  4. package/dist/Footer-DY0QJnxb.js +783 -0
  5. package/dist/GPTInput-DRFGKJ2u.js +66 -0
  6. package/dist/Header-DbSqXuvO.js +383 -0
  7. package/dist/Logo-CZ5LYqub.js +194 -0
  8. package/dist/NewTag-C-3mRyvV.js +26 -0
  9. package/dist/Notification-_vWBqFiA.js +96 -0
  10. package/dist/PrefPanel-DmiRZs1n.js +1548 -0
  11. package/dist/Search-D_fsZ-hm.js +4673 -0
  12. package/dist/clsx-ROFf4vs9.js +16 -0
  13. package/dist/components/Button/index.js +2 -81
  14. package/dist/components/Container/index.js +2 -11
  15. package/dist/components/Footer/CookiePolicyModal.js +2 -9
  16. package/dist/components/Footer/index.js +2 -833
  17. package/dist/components/GPTInput/index.js +2 -86
  18. package/dist/components/Header/index.js +2 -611
  19. package/dist/components/Logo/index.js +2 -255
  20. package/dist/components/NewTag/index.js +2 -54
  21. package/dist/components/Notification/index.js +2 -100
  22. package/dist/components/PrefPanel/index.js +2 -1945
  23. package/dist/components/Search/index.js +2 -9
  24. package/dist/components/ThemeLoader/index.js +6 -34
  25. package/dist/components/icons/Bubble.js +37 -52
  26. package/dist/components/icons/MadeInNorway.js +110 -145
  27. package/dist/components/icons/Plane.js +17 -23
  28. package/dist/dist-0f0-S8_q.js +211 -0
  29. package/dist/dist-CjrKJb_1.js +27 -0
  30. package/dist/es2015-CzBBLWyD.js +1140 -0
  31. package/dist/esm-C1TDRARf.js +479 -0
  32. package/dist/highsoft-ui.css +2 -1
  33. package/dist/main.js +12 -28
  34. package/dist/php-client.js +9 -9
  35. package/dist/php.js +10 -16
  36. package/dist/utils-C4QGLbxr.js +162 -0
  37. package/dist/utils.js +2 -11
  38. package/package.json +14 -8
  39. package/dist/Announcement03-obPaH4LK.js +0 -23
  40. package/dist/Check-Cm4roSEj.js +0 -23
  41. package/dist/CookiePolicyModal-C5FOuvB-.js +0 -82
  42. package/dist/XClose-CCu1vrNS.js +0 -23
  43. package/dist/clsx-OuTLNxxd.js +0 -16
  44. package/dist/extends-hS2Bh-Yp.js +0 -12
  45. package/dist/index-CUCGgBGk.js +0 -5654
  46. package/dist/index-CYz8LhDn.js +0 -1110
  47. package/dist/index-DThcOQDt.js +0 -234
  48. package/dist/index-hYJmp-0x.js +0 -30
  49. package/dist/utils-BKDJp1i0.js +0 -140
  50. /package/dist/{components → lib/components}/Button/index.d.ts +0 -0
  51. /package/dist/{components → lib/components}/Container/index.d.ts +0 -0
  52. /package/dist/{components → lib/components}/Footer/CookiePolicyModal.d.ts +0 -0
  53. /package/dist/{components → lib/components}/Footer/index.d.ts +0 -0
  54. /package/dist/{components → lib/components}/GPTInput/index.d.ts +0 -0
  55. /package/dist/{components → lib/components}/Header/index.d.ts +0 -0
  56. /package/dist/{components → lib/components}/Logo/index.d.ts +0 -0
  57. /package/dist/{components → lib/components}/NewTag/index.d.ts +0 -0
  58. /package/dist/{components → lib/components}/Notification/index.d.ts +0 -0
  59. /package/dist/{components → lib/components}/PrefPanel/index.d.ts +0 -0
  60. /package/dist/{components → lib/components}/Search/index.d.ts +0 -0
  61. /package/dist/{components → lib/components}/ThemeLoader/index.d.ts +0 -0
  62. /package/dist/{components → lib/components}/icons/Bubble.d.ts +0 -0
  63. /package/dist/{components → lib/components}/icons/MadeInNorway.d.ts +0 -0
  64. /package/dist/{components → lib/components}/icons/Plane.d.ts +0 -0
  65. /package/dist/{main.d.ts → lib/main.d.ts} +0 -0
  66. /package/dist/{php-client.d.ts → lib/php-client.d.ts} +0 -0
  67. /package/dist/{php.d.ts → lib/php.d.ts} +0 -0
  68. /package/dist/{utils.d.ts → lib/utils.d.ts} +0 -0
@@ -1,1945 +1,2 @@
1
- import { jsx as w, jsxs as q, Fragment as oe } from "react/jsx-runtime";
2
- import { z as qe, c as Ue } from "../../utils-BKDJp1i0.js";
3
- import * as g from "react";
4
- import { useLayoutEffect as Ge } from "react";
5
- import { C as Ze } from "../../Check-Cm4roSEj.js";
6
- import { _ as yt } from "../../extends-hS2Bh-Yp.js";
7
- import { c as Je } from "../../clsx-OuTLNxxd.js";
8
- import { Button as tn } from "../Button/index.js";
9
- import { h as _t, P as ft, u as At, c as re, f as en, e as nn, b as on, d as ct, g as ie, i as rn, j as sn, R as cn, a as an, k as ln, F as fn, D as un } from "../../index-CYz8LhDn.js";
10
- import * as dn from "react-dom";
11
- var pn = function(e) {
12
- return /* @__PURE__ */ w("svg", yt({
13
- xmlns: "http://www.w3.org/2000/svg",
14
- width: 24,
15
- height: 24,
16
- fill: "none",
17
- viewBox: "0 0 24 24"
18
- }, e, {
19
- children: /* @__PURE__ */ w("path", {
20
- stroke: "currentColor",
21
- strokeLinecap: "round",
22
- strokeLinejoin: "round",
23
- strokeWidth: 2,
24
- d: "M15 17v4H9v-4m-3.8 0h13.6c1.1201 0 1.6802 0 2.108-.218a2 2 0 0 0 .874-.874C22 15.4802 22 14.9201 22 13.8V6.2c0-1.1201 0-1.6802-.218-2.108a2 2 0 0 0-.874-.874C20.4802 3 19.9201 3 18.8 3H5.2c-1.1201 0-1.6802 0-2.108.218a2 2 0 0 0-.874.874C2 4.5198 2 5.08 2 6.2v7.6c0 1.1201 0 1.6802.218 2.108.1917.3763.4977.6823.874.874C3.5198 17 4.08 17 5.2 17"
25
- })
26
- }));
27
- }, hn = function(e) {
28
- return /* @__PURE__ */ w("svg", yt({
29
- xmlns: "http://www.w3.org/2000/svg",
30
- width: 24,
31
- height: 24,
32
- fill: "none",
33
- viewBox: "0 0 24 24"
34
- }, e, {
35
- children: /* @__PURE__ */ w("path", {
36
- stroke: "currentColor",
37
- strokeLinecap: "round",
38
- strokeLinejoin: "round",
39
- strokeWidth: 2,
40
- d: "M21.9548 12.9564c-1.3769 2.4153-3.9757 4.0437-6.9548 4.0437-4.4183 0-8-3.5817-8-8 0-2.9794 1.6287-5.5783 4.0443-6.9552C5.9698 2.5261 2 6.7994 2 11.9998c0 5.5229 4.4772 10 10 10 5.2002 0 9.4733-3.9693 9.9548-9.0434"
41
- })
42
- }));
43
- }, mn = function(e) {
44
- return /* @__PURE__ */ w("svg", yt({
45
- xmlns: "http://www.w3.org/2000/svg",
46
- width: 24,
47
- height: 24,
48
- fill: "none",
49
- viewBox: "0 0 24 24"
50
- }, e, {
51
- children: /* @__PURE__ */ w("path", {
52
- stroke: "currentColor",
53
- strokeLinecap: "round",
54
- strokeLinejoin: "round",
55
- strokeWidth: 2,
56
- d: "M3 8h12m0 0c0 1.6569 1.3431 3 3 3s3-1.3431 3-3-1.3431-3-3-3-3 1.3431-3 3m-6 8h12M9 16c0 1.6569-1.3431 3-3 3s-3-1.3431-3-3 1.3431-3 3-3 3 1.3431 3 3"
57
- })
58
- }));
59
- }, gn = function(e) {
60
- return /* @__PURE__ */ w("svg", yt({
61
- xmlns: "http://www.w3.org/2000/svg",
62
- width: 24,
63
- height: 24,
64
- fill: "none",
65
- viewBox: "0 0 24 24"
66
- }, e, {
67
- children: /* @__PURE__ */ w("path", {
68
- stroke: "currentColor",
69
- strokeLinecap: "round",
70
- strokeLinejoin: "round",
71
- strokeWidth: 2,
72
- d: "M12 2v2m0 16v2M4 12H2m4.3141-5.6859L4.9 4.9m12.786 1.4142L19.1001 4.9M6.3141 17.69 4.9 19.1042M17.686 17.69l1.4142 1.4142M22 12h-2m-3 0c0 2.7614-2.2386 5-5 5s-5-2.2386-5-5 2.2386-5 5-5 5 2.2386 5 5"
73
- })
74
- }));
75
- };
76
- function wn(t) {
77
- const [e, n] = g.useState(void 0);
78
- return _t(() => {
79
- if (t) {
80
- n({ width: t.offsetWidth, height: t.offsetHeight });
81
- const o = new ResizeObserver((r) => {
82
- if (!Array.isArray(r) || !r.length)
83
- return;
84
- const i = r[0];
85
- let s, c;
86
- if ("borderBoxSize" in i) {
87
- const a = i.borderBoxSize, f = Array.isArray(a) ? a[0] : a;
88
- s = f.inlineSize, c = f.blockSize;
89
- } else
90
- s = t.offsetWidth, c = t.offsetHeight;
91
- n({ width: s, height: c });
92
- });
93
- return o.observe(t, { box: "border-box" }), () => o.unobserve(t);
94
- } else
95
- n(void 0);
96
- }, [t]), e;
97
- }
98
- const vn = ["top", "right", "bottom", "left"], U = Math.min, W = Math.max, gt = Math.round, ht = Math.floor, j = (t) => ({
99
- x: t,
100
- y: t
101
- }), xn = {
102
- left: "right",
103
- right: "left",
104
- bottom: "top",
105
- top: "bottom"
106
- };
107
- function Dt(t, e, n) {
108
- return W(t, U(e, n));
109
- }
110
- function Y(t, e) {
111
- return typeof t == "function" ? t(e) : t;
112
- }
113
- function K(t) {
114
- return t.split("-")[0];
115
- }
116
- function rt(t) {
117
- return t.split("-")[1];
118
- }
119
- function Nt(t) {
120
- return t === "x" ? "y" : "x";
121
- }
122
- function Ft(t) {
123
- return t === "y" ? "height" : "width";
124
- }
125
- function V(t) {
126
- const e = t[0];
127
- return e === "t" || e === "b" ? "y" : "x";
128
- }
129
- function $t(t) {
130
- return Nt(V(t));
131
- }
132
- function yn(t, e, n) {
133
- n === void 0 && (n = !1);
134
- const o = rt(t), r = $t(t), i = Ft(r);
135
- let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
136
- return e.reference[i] > e.floating[i] && (s = wt(s)), [s, wt(s)];
137
- }
138
- function An(t) {
139
- const e = wt(t);
140
- return [Lt(t), e, Lt(e)];
141
- }
142
- function Lt(t) {
143
- return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
144
- }
145
- const Yt = ["left", "right"], Kt = ["right", "left"], Pn = ["top", "bottom"], bn = ["bottom", "top"];
146
- function Cn(t, e, n) {
147
- switch (t) {
148
- case "top":
149
- case "bottom":
150
- return n ? e ? Kt : Yt : e ? Yt : Kt;
151
- case "left":
152
- case "right":
153
- return e ? Pn : bn;
154
- default:
155
- return [];
156
- }
157
- }
158
- function Rn(t, e, n, o) {
159
- const r = rt(t);
160
- let i = Cn(K(t), n === "start", o);
161
- return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(Lt)))), i;
162
- }
163
- function wt(t) {
164
- const e = K(t);
165
- return xn[e] + t.slice(e.length);
166
- }
167
- function On(t) {
168
- return {
169
- top: 0,
170
- right: 0,
171
- bottom: 0,
172
- left: 0,
173
- ...t
174
- };
175
- }
176
- function se(t) {
177
- return typeof t != "number" ? On(t) : {
178
- top: t,
179
- right: t,
180
- bottom: t,
181
- left: t
182
- };
183
- }
184
- function vt(t) {
185
- const {
186
- x: e,
187
- y: n,
188
- width: o,
189
- height: r
190
- } = t;
191
- return {
192
- width: o,
193
- height: r,
194
- top: n,
195
- left: e,
196
- right: e + o,
197
- bottom: n + r,
198
- x: e,
199
- y: n
200
- };
201
- }
202
- function Qt(t, e, n) {
203
- let {
204
- reference: o,
205
- floating: r
206
- } = t;
207
- const i = V(e), s = $t(e), c = Ft(s), a = K(e), f = i === "y", l = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, p = o[c] / 2 - r[c] / 2;
208
- let d;
209
- switch (a) {
210
- case "top":
211
- d = {
212
- x: l,
213
- y: o.y - r.height
214
- };
215
- break;
216
- case "bottom":
217
- d = {
218
- x: l,
219
- y: o.y + o.height
220
- };
221
- break;
222
- case "right":
223
- d = {
224
- x: o.x + o.width,
225
- y: u
226
- };
227
- break;
228
- case "left":
229
- d = {
230
- x: o.x - r.width,
231
- y: u
232
- };
233
- break;
234
- default:
235
- d = {
236
- x: o.x,
237
- y: o.y
238
- };
239
- }
240
- switch (rt(e)) {
241
- case "start":
242
- d[s] -= p * (n && f ? -1 : 1);
243
- break;
244
- case "end":
245
- d[s] += p * (n && f ? -1 : 1);
246
- break;
247
- }
248
- return d;
249
- }
250
- async function Sn(t, e) {
251
- var n;
252
- e === void 0 && (e = {});
253
- const {
254
- x: o,
255
- y: r,
256
- platform: i,
257
- rects: s,
258
- elements: c,
259
- strategy: a
260
- } = t, {
261
- boundary: f = "clippingAncestors",
262
- rootBoundary: l = "viewport",
263
- elementContext: u = "floating",
264
- altBoundary: p = !1,
265
- padding: d = 0
266
- } = Y(e, t), h = se(d), y = c[p ? u === "floating" ? "reference" : "floating" : u], v = vt(await i.getClippingRect({
267
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
268
- boundary: f,
269
- rootBoundary: l,
270
- strategy: a
271
- })), P = u === "floating" ? {
272
- x: o,
273
- y: r,
274
- width: s.floating.width,
275
- height: s.floating.height
276
- } : s.reference, A = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), x = await (i.isElement == null ? void 0 : i.isElement(A)) ? await (i.getScale == null ? void 0 : i.getScale(A)) || {
277
- x: 1,
278
- y: 1
279
- } : {
280
- x: 1,
281
- y: 1
282
- }, C = vt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
283
- elements: c,
284
- rect: P,
285
- offsetParent: A,
286
- strategy: a
287
- }) : P);
288
- return {
289
- top: (v.top - C.top + h.top) / x.y,
290
- bottom: (C.bottom - v.bottom + h.bottom) / x.y,
291
- left: (v.left - C.left + h.left) / x.x,
292
- right: (C.right - v.right + h.right) / x.x
293
- };
294
- }
295
- const En = 50, Mn = async (t, e, n) => {
296
- const {
297
- placement: o = "bottom",
298
- strategy: r = "absolute",
299
- middleware: i = [],
300
- platform: s
301
- } = n, c = s.detectOverflow ? s : {
302
- ...s,
303
- detectOverflow: Sn
304
- }, a = await (s.isRTL == null ? void 0 : s.isRTL(e));
305
- let f = await s.getElementRects({
306
- reference: t,
307
- floating: e,
308
- strategy: r
309
- }), {
310
- x: l,
311
- y: u
312
- } = Qt(f, o, a), p = o, d = 0;
313
- const h = {};
314
- for (let m = 0; m < i.length; m++) {
315
- const y = i[m];
316
- if (!y)
317
- continue;
318
- const {
319
- name: v,
320
- fn: P
321
- } = y, {
322
- x: A,
323
- y: x,
324
- data: C,
325
- reset: R
326
- } = await P({
327
- x: l,
328
- y: u,
329
- initialPlacement: o,
330
- placement: p,
331
- strategy: r,
332
- middlewareData: h,
333
- rects: f,
334
- platform: c,
335
- elements: {
336
- reference: t,
337
- floating: e
338
- }
339
- });
340
- l = A ?? l, u = x ?? u, h[v] = {
341
- ...h[v],
342
- ...C
343
- }, R && d < En && (d++, typeof R == "object" && (R.placement && (p = R.placement), R.rects && (f = R.rects === !0 ? await s.getElementRects({
344
- reference: t,
345
- floating: e,
346
- strategy: r
347
- }) : R.rects), {
348
- x: l,
349
- y: u
350
- } = Qt(f, p, a)), m = -1);
351
- }
352
- return {
353
- x: l,
354
- y: u,
355
- placement: p,
356
- strategy: r,
357
- middlewareData: h
358
- };
359
- }, kn = (t) => ({
360
- name: "arrow",
361
- options: t,
362
- async fn(e) {
363
- const {
364
- x: n,
365
- y: o,
366
- placement: r,
367
- rects: i,
368
- platform: s,
369
- elements: c,
370
- middlewareData: a
371
- } = e, {
372
- element: f,
373
- padding: l = 0
374
- } = Y(t, e) || {};
375
- if (f == null)
376
- return {};
377
- const u = se(l), p = {
378
- x: n,
379
- y: o
380
- }, d = $t(r), h = Ft(d), m = await s.getDimensions(f), y = d === "y", v = y ? "top" : "left", P = y ? "bottom" : "right", A = y ? "clientHeight" : "clientWidth", x = i.reference[h] + i.reference[d] - p[d] - i.floating[h], C = p[d] - i.reference[d], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f));
381
- let O = R ? R[A] : 0;
382
- (!O || !await (s.isElement == null ? void 0 : s.isElement(R))) && (O = c.floating[A] || i.floating[h]);
383
- const D = x / 2 - C / 2, F = O / 2 - m[h] / 2 - 1, _ = U(u[v], F), T = U(u[P], F), N = _, E = O - m[h] - T, S = O / 2 - m[h] / 2 + D, $ = Dt(N, S, E), M = !a.arrow && rt(r) != null && S !== $ && i.reference[h] / 2 - (S < N ? _ : T) - m[h] / 2 < 0, k = M ? S < N ? S - N : S - E : 0;
384
- return {
385
- [d]: p[d] + k,
386
- data: {
387
- [d]: $,
388
- centerOffset: S - $ - k,
389
- ...M && {
390
- alignmentOffset: k
391
- }
392
- },
393
- reset: M
394
- };
395
- }
396
- }), _n = function(t) {
397
- return t === void 0 && (t = {}), {
398
- name: "flip",
399
- options: t,
400
- async fn(e) {
401
- var n, o;
402
- const {
403
- placement: r,
404
- middlewareData: i,
405
- rects: s,
406
- initialPlacement: c,
407
- platform: a,
408
- elements: f
409
- } = e, {
410
- mainAxis: l = !0,
411
- crossAxis: u = !0,
412
- fallbackPlacements: p,
413
- fallbackStrategy: d = "bestFit",
414
- fallbackAxisSideDirection: h = "none",
415
- flipAlignment: m = !0,
416
- ...y
417
- } = Y(t, e);
418
- if ((n = i.arrow) != null && n.alignmentOffset)
419
- return {};
420
- const v = K(r), P = V(c), A = K(c) === c, x = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), C = p || (A || !m ? [wt(c)] : An(c)), R = h !== "none";
421
- !p && R && C.push(...Rn(c, m, h, x));
422
- const O = [c, ...C], D = await a.detectOverflow(e, y), F = [];
423
- let _ = ((o = i.flip) == null ? void 0 : o.overflows) || [];
424
- if (l && F.push(D[v]), u) {
425
- const S = yn(r, s, x);
426
- F.push(D[S[0]], D[S[1]]);
427
- }
428
- if (_ = [..._, {
429
- placement: r,
430
- overflows: F
431
- }], !F.every((S) => S <= 0)) {
432
- var T, N;
433
- const S = (((T = i.flip) == null ? void 0 : T.index) || 0) + 1, $ = O[S];
434
- if ($ && (!(u === "alignment" ? P !== V($) : !1) || // We leave the current main axis only if every placement on that axis
435
- // overflows the main axis.
436
- _.every((b) => V(b.placement) === P ? b.overflows[0] > 0 : !0)))
437
- return {
438
- data: {
439
- index: S,
440
- overflows: _
441
- },
442
- reset: {
443
- placement: $
444
- }
445
- };
446
- let M = (N = _.filter((k) => k.overflows[0] <= 0).sort((k, b) => k.overflows[1] - b.overflows[1])[0]) == null ? void 0 : N.placement;
447
- if (!M)
448
- switch (d) {
449
- case "bestFit": {
450
- var E;
451
- const k = (E = _.filter((b) => {
452
- if (R) {
453
- const L = V(b.placement);
454
- return L === P || // Create a bias to the `y` side axis due to horizontal
455
- // reading directions favoring greater width.
456
- L === "y";
457
- }
458
- return !0;
459
- }).map((b) => [b.placement, b.overflows.filter((L) => L > 0).reduce((L, z) => L + z, 0)]).sort((b, L) => b[1] - L[1])[0]) == null ? void 0 : E[0];
460
- k && (M = k);
461
- break;
462
- }
463
- case "initialPlacement":
464
- M = c;
465
- break;
466
- }
467
- if (r !== M)
468
- return {
469
- reset: {
470
- placement: M
471
- }
472
- };
473
- }
474
- return {};
475
- }
476
- };
477
- };
478
- function qt(t, e) {
479
- return {
480
- top: t.top - e.height,
481
- right: t.right - e.width,
482
- bottom: t.bottom - e.height,
483
- left: t.left - e.width
484
- };
485
- }
486
- function Ut(t) {
487
- return vn.some((e) => t[e] >= 0);
488
- }
489
- const Dn = function(t) {
490
- return t === void 0 && (t = {}), {
491
- name: "hide",
492
- options: t,
493
- async fn(e) {
494
- const {
495
- rects: n,
496
- platform: o
497
- } = e, {
498
- strategy: r = "referenceHidden",
499
- ...i
500
- } = Y(t, e);
501
- switch (r) {
502
- case "referenceHidden": {
503
- const s = await o.detectOverflow(e, {
504
- ...i,
505
- elementContext: "reference"
506
- }), c = qt(s, n.reference);
507
- return {
508
- data: {
509
- referenceHiddenOffsets: c,
510
- referenceHidden: Ut(c)
511
- }
512
- };
513
- }
514
- case "escaped": {
515
- const s = await o.detectOverflow(e, {
516
- ...i,
517
- altBoundary: !0
518
- }), c = qt(s, n.floating);
519
- return {
520
- data: {
521
- escapedOffsets: c,
522
- escaped: Ut(c)
523
- }
524
- };
525
- }
526
- default:
527
- return {};
528
- }
529
- }
530
- };
531
- }, ce = /* @__PURE__ */ new Set(["left", "top"]);
532
- async function Ln(t, e) {
533
- const {
534
- placement: n,
535
- platform: o,
536
- elements: r
537
- } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = K(n), c = rt(n), a = V(n) === "y", f = ce.has(s) ? -1 : 1, l = i && a ? -1 : 1, u = Y(e, t);
538
- let {
539
- mainAxis: p,
540
- crossAxis: d,
541
- alignmentAxis: h
542
- } = typeof u == "number" ? {
543
- mainAxis: u,
544
- crossAxis: 0,
545
- alignmentAxis: null
546
- } : {
547
- mainAxis: u.mainAxis || 0,
548
- crossAxis: u.crossAxis || 0,
549
- alignmentAxis: u.alignmentAxis
550
- };
551
- return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), a ? {
552
- x: d * l,
553
- y: p * f
554
- } : {
555
- x: p * f,
556
- y: d * l
557
- };
558
- }
559
- const Tn = function(t) {
560
- return t === void 0 && (t = 0), {
561
- name: "offset",
562
- options: t,
563
- async fn(e) {
564
- var n, o;
565
- const {
566
- x: r,
567
- y: i,
568
- placement: s,
569
- middlewareData: c
570
- } = e, a = await Ln(e, t);
571
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
572
- x: r + a.x,
573
- y: i + a.y,
574
- data: {
575
- ...a,
576
- placement: s
577
- }
578
- };
579
- }
580
- };
581
- }, Nn = function(t) {
582
- return t === void 0 && (t = {}), {
583
- name: "shift",
584
- options: t,
585
- async fn(e) {
586
- const {
587
- x: n,
588
- y: o,
589
- placement: r,
590
- platform: i
591
- } = e, {
592
- mainAxis: s = !0,
593
- crossAxis: c = !1,
594
- limiter: a = {
595
- fn: (v) => {
596
- let {
597
- x: P,
598
- y: A
599
- } = v;
600
- return {
601
- x: P,
602
- y: A
603
- };
604
- }
605
- },
606
- ...f
607
- } = Y(t, e), l = {
608
- x: n,
609
- y: o
610
- }, u = await i.detectOverflow(e, f), p = V(K(r)), d = Nt(p);
611
- let h = l[d], m = l[p];
612
- if (s) {
613
- const v = d === "y" ? "top" : "left", P = d === "y" ? "bottom" : "right", A = h + u[v], x = h - u[P];
614
- h = Dt(A, h, x);
615
- }
616
- if (c) {
617
- const v = p === "y" ? "top" : "left", P = p === "y" ? "bottom" : "right", A = m + u[v], x = m - u[P];
618
- m = Dt(A, m, x);
619
- }
620
- const y = a.fn({
621
- ...e,
622
- [d]: h,
623
- [p]: m
624
- });
625
- return {
626
- ...y,
627
- data: {
628
- x: y.x - n,
629
- y: y.y - o,
630
- enabled: {
631
- [d]: s,
632
- [p]: c
633
- }
634
- }
635
- };
636
- }
637
- };
638
- }, Fn = function(t) {
639
- return t === void 0 && (t = {}), {
640
- options: t,
641
- fn(e) {
642
- const {
643
- x: n,
644
- y: o,
645
- placement: r,
646
- rects: i,
647
- middlewareData: s
648
- } = e, {
649
- offset: c = 0,
650
- mainAxis: a = !0,
651
- crossAxis: f = !0
652
- } = Y(t, e), l = {
653
- x: n,
654
- y: o
655
- }, u = V(r), p = Nt(u);
656
- let d = l[p], h = l[u];
657
- const m = Y(c, e), y = typeof m == "number" ? {
658
- mainAxis: m,
659
- crossAxis: 0
660
- } : {
661
- mainAxis: 0,
662
- crossAxis: 0,
663
- ...m
664
- };
665
- if (a) {
666
- const A = p === "y" ? "height" : "width", x = i.reference[p] - i.floating[A] + y.mainAxis, C = i.reference[p] + i.reference[A] - y.mainAxis;
667
- d < x ? d = x : d > C && (d = C);
668
- }
669
- if (f) {
670
- var v, P;
671
- const A = p === "y" ? "width" : "height", x = ce.has(K(r)), C = i.reference[u] - i.floating[A] + (x && ((v = s.offset) == null ? void 0 : v[u]) || 0) + (x ? 0 : y.crossAxis), R = i.reference[u] + i.reference[A] + (x ? 0 : ((P = s.offset) == null ? void 0 : P[u]) || 0) - (x ? y.crossAxis : 0);
672
- h < C ? h = C : h > R && (h = R);
673
- }
674
- return {
675
- [p]: d,
676
- [u]: h
677
- };
678
- }
679
- };
680
- }, $n = function(t) {
681
- return t === void 0 && (t = {}), {
682
- name: "size",
683
- options: t,
684
- async fn(e) {
685
- var n, o;
686
- const {
687
- placement: r,
688
- rects: i,
689
- platform: s,
690
- elements: c
691
- } = e, {
692
- apply: a = () => {
693
- },
694
- ...f
695
- } = Y(t, e), l = await s.detectOverflow(e, f), u = K(r), p = rt(r), d = V(r) === "y", {
696
- width: h,
697
- height: m
698
- } = i.floating;
699
- let y, v;
700
- u === "top" || u === "bottom" ? (y = u, v = p === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (v = u, y = p === "end" ? "top" : "bottom");
701
- const P = m - l.top - l.bottom, A = h - l.left - l.right, x = U(m - l[y], P), C = U(h - l[v], A), R = !e.middlewareData.shift;
702
- let O = x, D = C;
703
- if ((n = e.middlewareData.shift) != null && n.enabled.x && (D = A), (o = e.middlewareData.shift) != null && o.enabled.y && (O = P), R && !p) {
704
- const _ = W(l.left, 0), T = W(l.right, 0), N = W(l.top, 0), E = W(l.bottom, 0);
705
- d ? D = h - 2 * (_ !== 0 || T !== 0 ? _ + T : W(l.left, l.right)) : O = m - 2 * (N !== 0 || E !== 0 ? N + E : W(l.top, l.bottom));
706
- }
707
- await a({
708
- ...e,
709
- availableWidth: D,
710
- availableHeight: O
711
- });
712
- const F = await s.getDimensions(c.floating);
713
- return h !== F.width || m !== F.height ? {
714
- reset: {
715
- rects: !0
716
- }
717
- } : {};
718
- }
719
- };
720
- };
721
- function Pt() {
722
- return typeof window < "u";
723
- }
724
- function it(t) {
725
- return ae(t) ? (t.nodeName || "").toLowerCase() : "#document";
726
- }
727
- function H(t) {
728
- var e;
729
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
730
- }
731
- function X(t) {
732
- var e;
733
- return (e = (ae(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
734
- }
735
- function ae(t) {
736
- return Pt() ? t instanceof Node || t instanceof H(t).Node : !1;
737
- }
738
- function I(t) {
739
- return Pt() ? t instanceof Element || t instanceof H(t).Element : !1;
740
- }
741
- function Q(t) {
742
- return Pt() ? t instanceof HTMLElement || t instanceof H(t).HTMLElement : !1;
743
- }
744
- function Gt(t) {
745
- return !Pt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof H(t).ShadowRoot;
746
- }
747
- function ut(t) {
748
- const {
749
- overflow: e,
750
- overflowX: n,
751
- overflowY: o,
752
- display: r
753
- } = B(t);
754
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && r !== "inline" && r !== "contents";
755
- }
756
- function Wn(t) {
757
- return /^(table|td|th)$/.test(it(t));
758
- }
759
- function bt(t) {
760
- try {
761
- if (t.matches(":popover-open"))
762
- return !0;
763
- } catch {
764
- }
765
- try {
766
- return t.matches(":modal");
767
- } catch {
768
- return !1;
769
- }
770
- }
771
- const Hn = /transform|translate|scale|rotate|perspective|filter/, In = /paint|layout|strict|content/, J = (t) => !!t && t !== "none";
772
- let St;
773
- function Wt(t) {
774
- const e = I(t) ? B(t) : t;
775
- return J(e.transform) || J(e.translate) || J(e.scale) || J(e.rotate) || J(e.perspective) || !Ht() && (J(e.backdropFilter) || J(e.filter)) || Hn.test(e.willChange || "") || In.test(e.contain || "");
776
- }
777
- function Bn(t) {
778
- let e = G(t);
779
- for (; Q(e) && !nt(e); ) {
780
- if (Wt(e))
781
- return e;
782
- if (bt(e))
783
- return null;
784
- e = G(e);
785
- }
786
- return null;
787
- }
788
- function Ht() {
789
- return St == null && (St = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), St;
790
- }
791
- function nt(t) {
792
- return /^(html|body|#document)$/.test(it(t));
793
- }
794
- function B(t) {
795
- return H(t).getComputedStyle(t);
796
- }
797
- function Ct(t) {
798
- return I(t) ? {
799
- scrollLeft: t.scrollLeft,
800
- scrollTop: t.scrollTop
801
- } : {
802
- scrollLeft: t.scrollX,
803
- scrollTop: t.scrollY
804
- };
805
- }
806
- function G(t) {
807
- if (it(t) === "html")
808
- return t;
809
- const e = (
810
- // Step into the shadow DOM of the parent of a slotted node.
811
- t.assignedSlot || // DOM Element detected.
812
- t.parentNode || // ShadowRoot detected.
813
- Gt(t) && t.host || // Fallback.
814
- X(t)
815
- );
816
- return Gt(e) ? e.host : e;
817
- }
818
- function le(t) {
819
- const e = G(t);
820
- return nt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : Q(e) && ut(e) ? e : le(e);
821
- }
822
- function lt(t, e, n) {
823
- var o;
824
- e === void 0 && (e = []), n === void 0 && (n = !0);
825
- const r = le(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = H(r);
826
- if (i) {
827
- const c = Tt(s);
828
- return e.concat(s, s.visualViewport || [], ut(r) ? r : [], c && n ? lt(c) : []);
829
- } else
830
- return e.concat(r, lt(r, [], n));
831
- }
832
- function Tt(t) {
833
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
834
- }
835
- function fe(t) {
836
- const e = B(t);
837
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
838
- const r = Q(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = gt(n) !== i || gt(o) !== s;
839
- return c && (n = i, o = s), {
840
- width: n,
841
- height: o,
842
- $: c
843
- };
844
- }
845
- function It(t) {
846
- return I(t) ? t : t.contextElement;
847
- }
848
- function et(t) {
849
- const e = It(t);
850
- if (!Q(e))
851
- return j(1);
852
- const n = e.getBoundingClientRect(), {
853
- width: o,
854
- height: r,
855
- $: i
856
- } = fe(e);
857
- let s = (i ? gt(n.width) : n.width) / o, c = (i ? gt(n.height) : n.height) / r;
858
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
859
- x: s,
860
- y: c
861
- };
862
- }
863
- const zn = /* @__PURE__ */ j(0);
864
- function ue(t) {
865
- const e = H(t);
866
- return !Ht() || !e.visualViewport ? zn : {
867
- x: e.visualViewport.offsetLeft,
868
- y: e.visualViewport.offsetTop
869
- };
870
- }
871
- function Vn(t, e, n) {
872
- return e === void 0 && (e = !1), !n || e && n !== H(t) ? !1 : e;
873
- }
874
- function tt(t, e, n, o) {
875
- e === void 0 && (e = !1), n === void 0 && (n = !1);
876
- const r = t.getBoundingClientRect(), i = It(t);
877
- let s = j(1);
878
- e && (o ? I(o) && (s = et(o)) : s = et(t));
879
- const c = Vn(i, n, o) ? ue(i) : j(0);
880
- let a = (r.left + c.x) / s.x, f = (r.top + c.y) / s.y, l = r.width / s.x, u = r.height / s.y;
881
- if (i) {
882
- const p = H(i), d = o && I(o) ? H(o) : o;
883
- let h = p, m = Tt(h);
884
- for (; m && o && d !== h; ) {
885
- const y = et(m), v = m.getBoundingClientRect(), P = B(m), A = v.left + (m.clientLeft + parseFloat(P.paddingLeft)) * y.x, x = v.top + (m.clientTop + parseFloat(P.paddingTop)) * y.y;
886
- a *= y.x, f *= y.y, l *= y.x, u *= y.y, a += A, f += x, h = H(m), m = Tt(h);
887
- }
888
- }
889
- return vt({
890
- width: l,
891
- height: u,
892
- x: a,
893
- y: f
894
- });
895
- }
896
- function Rt(t, e) {
897
- const n = Ct(t).scrollLeft;
898
- return e ? e.left + n : tt(X(t)).left + n;
899
- }
900
- function de(t, e) {
901
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - Rt(t, n), r = n.top + e.scrollTop;
902
- return {
903
- x: o,
904
- y: r
905
- };
906
- }
907
- function jn(t) {
908
- let {
909
- elements: e,
910
- rect: n,
911
- offsetParent: o,
912
- strategy: r
913
- } = t;
914
- const i = r === "fixed", s = X(o), c = e ? bt(e.floating) : !1;
915
- if (o === s || c && i)
916
- return n;
917
- let a = {
918
- scrollLeft: 0,
919
- scrollTop: 0
920
- }, f = j(1);
921
- const l = j(0), u = Q(o);
922
- if ((u || !u && !i) && ((it(o) !== "body" || ut(s)) && (a = Ct(o)), u)) {
923
- const d = tt(o);
924
- f = et(o), l.x = d.x + o.clientLeft, l.y = d.y + o.clientTop;
925
- }
926
- const p = s && !u && !i ? de(s, a) : j(0);
927
- return {
928
- width: n.width * f.x,
929
- height: n.height * f.y,
930
- x: n.x * f.x - a.scrollLeft * f.x + l.x + p.x,
931
- y: n.y * f.y - a.scrollTop * f.y + l.y + p.y
932
- };
933
- }
934
- function Xn(t) {
935
- return Array.from(t.getClientRects());
936
- }
937
- function Yn(t) {
938
- const e = X(t), n = Ct(t), o = t.ownerDocument.body, r = W(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = W(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
939
- let s = -n.scrollLeft + Rt(t);
940
- const c = -n.scrollTop;
941
- return B(o).direction === "rtl" && (s += W(e.clientWidth, o.clientWidth) - r), {
942
- width: r,
943
- height: i,
944
- x: s,
945
- y: c
946
- };
947
- }
948
- const Zt = 25;
949
- function Kn(t, e) {
950
- const n = H(t), o = X(t), r = n.visualViewport;
951
- let i = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
952
- if (r) {
953
- i = r.width, s = r.height;
954
- const l = Ht();
955
- (!l || l && e === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
956
- }
957
- const f = Rt(o);
958
- if (f <= 0) {
959
- const l = o.ownerDocument, u = l.body, p = getComputedStyle(u), d = l.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, h = Math.abs(o.clientWidth - u.clientWidth - d);
960
- h <= Zt && (i -= h);
961
- } else f <= Zt && (i += f);
962
- return {
963
- width: i,
964
- height: s,
965
- x: c,
966
- y: a
967
- };
968
- }
969
- function Qn(t, e) {
970
- const n = tt(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = Q(t) ? et(t) : j(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, a = r * i.x, f = o * i.y;
971
- return {
972
- width: s,
973
- height: c,
974
- x: a,
975
- y: f
976
- };
977
- }
978
- function Jt(t, e, n) {
979
- let o;
980
- if (e === "viewport")
981
- o = Kn(t, n);
982
- else if (e === "document")
983
- o = Yn(X(t));
984
- else if (I(e))
985
- o = Qn(e, n);
986
- else {
987
- const r = ue(t);
988
- o = {
989
- x: e.x - r.x,
990
- y: e.y - r.y,
991
- width: e.width,
992
- height: e.height
993
- };
994
- }
995
- return vt(o);
996
- }
997
- function pe(t, e) {
998
- const n = G(t);
999
- return n === e || !I(n) || nt(n) ? !1 : B(n).position === "fixed" || pe(n, e);
1000
- }
1001
- function qn(t, e) {
1002
- const n = e.get(t);
1003
- if (n)
1004
- return n;
1005
- let o = lt(t, [], !1).filter((c) => I(c) && it(c) !== "body"), r = null;
1006
- const i = B(t).position === "fixed";
1007
- let s = i ? G(t) : t;
1008
- for (; I(s) && !nt(s); ) {
1009
- const c = B(s), a = Wt(s);
1010
- !a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && (r.position === "absolute" || r.position === "fixed") || ut(s) && !a && pe(t, s)) ? o = o.filter((l) => l !== s) : r = c, s = G(s);
1011
- }
1012
- return e.set(t, o), o;
1013
- }
1014
- function Un(t) {
1015
- let {
1016
- element: e,
1017
- boundary: n,
1018
- rootBoundary: o,
1019
- strategy: r
1020
- } = t;
1021
- const s = [...n === "clippingAncestors" ? bt(e) ? [] : qn(e, this._c) : [].concat(n), o], c = Jt(e, s[0], r);
1022
- let a = c.top, f = c.right, l = c.bottom, u = c.left;
1023
- for (let p = 1; p < s.length; p++) {
1024
- const d = Jt(e, s[p], r);
1025
- a = W(d.top, a), f = U(d.right, f), l = U(d.bottom, l), u = W(d.left, u);
1026
- }
1027
- return {
1028
- width: f - u,
1029
- height: l - a,
1030
- x: u,
1031
- y: a
1032
- };
1033
- }
1034
- function Gn(t) {
1035
- const {
1036
- width: e,
1037
- height: n
1038
- } = fe(t);
1039
- return {
1040
- width: e,
1041
- height: n
1042
- };
1043
- }
1044
- function Zn(t, e, n) {
1045
- const o = Q(e), r = X(e), i = n === "fixed", s = tt(t, !0, i, e);
1046
- let c = {
1047
- scrollLeft: 0,
1048
- scrollTop: 0
1049
- };
1050
- const a = j(0);
1051
- function f() {
1052
- a.x = Rt(r);
1053
- }
1054
- if (o || !o && !i)
1055
- if ((it(e) !== "body" || ut(r)) && (c = Ct(e)), o) {
1056
- const d = tt(e, !0, i, e);
1057
- a.x = d.x + e.clientLeft, a.y = d.y + e.clientTop;
1058
- } else r && f();
1059
- i && !o && r && f();
1060
- const l = r && !o && !i ? de(r, c) : j(0), u = s.left + c.scrollLeft - a.x - l.x, p = s.top + c.scrollTop - a.y - l.y;
1061
- return {
1062
- x: u,
1063
- y: p,
1064
- width: s.width,
1065
- height: s.height
1066
- };
1067
- }
1068
- function Et(t) {
1069
- return B(t).position === "static";
1070
- }
1071
- function te(t, e) {
1072
- if (!Q(t) || B(t).position === "fixed")
1073
- return null;
1074
- if (e)
1075
- return e(t);
1076
- let n = t.offsetParent;
1077
- return X(t) === n && (n = n.ownerDocument.body), n;
1078
- }
1079
- function he(t, e) {
1080
- const n = H(t);
1081
- if (bt(t))
1082
- return n;
1083
- if (!Q(t)) {
1084
- let r = G(t);
1085
- for (; r && !nt(r); ) {
1086
- if (I(r) && !Et(r))
1087
- return r;
1088
- r = G(r);
1089
- }
1090
- return n;
1091
- }
1092
- let o = te(t, e);
1093
- for (; o && Wn(o) && Et(o); )
1094
- o = te(o, e);
1095
- return o && nt(o) && Et(o) && !Wt(o) ? n : o || Bn(t) || n;
1096
- }
1097
- const Jn = async function(t) {
1098
- const e = this.getOffsetParent || he, n = this.getDimensions, o = await n(t.floating);
1099
- return {
1100
- reference: Zn(t.reference, await e(t.floating), t.strategy),
1101
- floating: {
1102
- x: 0,
1103
- y: 0,
1104
- width: o.width,
1105
- height: o.height
1106
- }
1107
- };
1108
- };
1109
- function to(t) {
1110
- return B(t).direction === "rtl";
1111
- }
1112
- const eo = {
1113
- convertOffsetParentRelativeRectToViewportRelativeRect: jn,
1114
- getDocumentElement: X,
1115
- getClippingRect: Un,
1116
- getOffsetParent: he,
1117
- getElementRects: Jn,
1118
- getClientRects: Xn,
1119
- getDimensions: Gn,
1120
- getScale: et,
1121
- isElement: I,
1122
- isRTL: to
1123
- };
1124
- function me(t, e) {
1125
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1126
- }
1127
- function no(t, e) {
1128
- let n = null, o;
1129
- const r = X(t);
1130
- function i() {
1131
- var c;
1132
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1133
- }
1134
- function s(c, a) {
1135
- c === void 0 && (c = !1), a === void 0 && (a = 1), i();
1136
- const f = t.getBoundingClientRect(), {
1137
- left: l,
1138
- top: u,
1139
- width: p,
1140
- height: d
1141
- } = f;
1142
- if (c || e(), !p || !d)
1143
- return;
1144
- const h = ht(u), m = ht(r.clientWidth - (l + p)), y = ht(r.clientHeight - (u + d)), v = ht(l), A = {
1145
- rootMargin: -h + "px " + -m + "px " + -y + "px " + -v + "px",
1146
- threshold: W(0, U(1, a)) || 1
1147
- };
1148
- let x = !0;
1149
- function C(R) {
1150
- const O = R[0].intersectionRatio;
1151
- if (O !== a) {
1152
- if (!x)
1153
- return s();
1154
- O ? s(!1, O) : o = setTimeout(() => {
1155
- s(!1, 1e-7);
1156
- }, 1e3);
1157
- }
1158
- O === 1 && !me(f, t.getBoundingClientRect()) && s(), x = !1;
1159
- }
1160
- try {
1161
- n = new IntersectionObserver(C, {
1162
- ...A,
1163
- // Handle <iframe>s
1164
- root: r.ownerDocument
1165
- });
1166
- } catch {
1167
- n = new IntersectionObserver(C, A);
1168
- }
1169
- n.observe(t);
1170
- }
1171
- return s(!0), i;
1172
- }
1173
- function oo(t, e, n, o) {
1174
- o === void 0 && (o = {});
1175
- const {
1176
- ancestorScroll: r = !0,
1177
- ancestorResize: i = !0,
1178
- elementResize: s = typeof ResizeObserver == "function",
1179
- layoutShift: c = typeof IntersectionObserver == "function",
1180
- animationFrame: a = !1
1181
- } = o, f = It(t), l = r || i ? [...f ? lt(f) : [], ...e ? lt(e) : []] : [];
1182
- l.forEach((v) => {
1183
- r && v.addEventListener("scroll", n, {
1184
- passive: !0
1185
- }), i && v.addEventListener("resize", n);
1186
- });
1187
- const u = f && c ? no(f, n) : null;
1188
- let p = -1, d = null;
1189
- s && (d = new ResizeObserver((v) => {
1190
- let [P] = v;
1191
- P && P.target === f && d && e && (d.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1192
- var A;
1193
- (A = d) == null || A.observe(e);
1194
- })), n();
1195
- }), f && !a && d.observe(f), e && d.observe(e));
1196
- let h, m = a ? tt(t) : null;
1197
- a && y();
1198
- function y() {
1199
- const v = tt(t);
1200
- m && !me(m, v) && n(), m = v, h = requestAnimationFrame(y);
1201
- }
1202
- return n(), () => {
1203
- var v;
1204
- l.forEach((P) => {
1205
- r && P.removeEventListener("scroll", n), i && P.removeEventListener("resize", n);
1206
- }), u?.(), (v = d) == null || v.disconnect(), d = null, a && cancelAnimationFrame(h);
1207
- };
1208
- }
1209
- const ro = Tn, io = Nn, so = _n, co = $n, ao = Dn, ee = kn, lo = Fn, fo = (t, e, n) => {
1210
- const o = /* @__PURE__ */ new Map(), r = {
1211
- platform: eo,
1212
- ...n
1213
- }, i = {
1214
- ...r.platform,
1215
- _c: o
1216
- };
1217
- return Mn(t, e, {
1218
- ...r,
1219
- platform: i
1220
- });
1221
- };
1222
- var uo = typeof document < "u", po = function() {
1223
- }, mt = uo ? Ge : po;
1224
- function xt(t, e) {
1225
- if (t === e)
1226
- return !0;
1227
- if (typeof t != typeof e)
1228
- return !1;
1229
- if (typeof t == "function" && t.toString() === e.toString())
1230
- return !0;
1231
- let n, o, r;
1232
- if (t && e && typeof t == "object") {
1233
- if (Array.isArray(t)) {
1234
- if (n = t.length, n !== e.length) return !1;
1235
- for (o = n; o-- !== 0; )
1236
- if (!xt(t[o], e[o]))
1237
- return !1;
1238
- return !0;
1239
- }
1240
- if (r = Object.keys(t), n = r.length, n !== Object.keys(e).length)
1241
- return !1;
1242
- for (o = n; o-- !== 0; )
1243
- if (!{}.hasOwnProperty.call(e, r[o]))
1244
- return !1;
1245
- for (o = n; o-- !== 0; ) {
1246
- const i = r[o];
1247
- if (!(i === "_owner" && t.$$typeof) && !xt(t[i], e[i]))
1248
- return !1;
1249
- }
1250
- return !0;
1251
- }
1252
- return t !== t && e !== e;
1253
- }
1254
- function ge(t) {
1255
- return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1256
- }
1257
- function ne(t, e) {
1258
- const n = ge(t);
1259
- return Math.round(e * n) / n;
1260
- }
1261
- function Mt(t) {
1262
- const e = g.useRef(t);
1263
- return mt(() => {
1264
- e.current = t;
1265
- }), e;
1266
- }
1267
- function ho(t) {
1268
- t === void 0 && (t = {});
1269
- const {
1270
- placement: e = "bottom",
1271
- strategy: n = "absolute",
1272
- middleware: o = [],
1273
- platform: r,
1274
- elements: {
1275
- reference: i,
1276
- floating: s
1277
- } = {},
1278
- transform: c = !0,
1279
- whileElementsMounted: a,
1280
- open: f
1281
- } = t, [l, u] = g.useState({
1282
- x: 0,
1283
- y: 0,
1284
- strategy: n,
1285
- placement: e,
1286
- middlewareData: {},
1287
- isPositioned: !1
1288
- }), [p, d] = g.useState(o);
1289
- xt(p, o) || d(o);
1290
- const [h, m] = g.useState(null), [y, v] = g.useState(null), P = g.useCallback((b) => {
1291
- b !== R.current && (R.current = b, m(b));
1292
- }, []), A = g.useCallback((b) => {
1293
- b !== O.current && (O.current = b, v(b));
1294
- }, []), x = i || h, C = s || y, R = g.useRef(null), O = g.useRef(null), D = g.useRef(l), F = a != null, _ = Mt(a), T = Mt(r), N = Mt(f), E = g.useCallback(() => {
1295
- if (!R.current || !O.current)
1296
- return;
1297
- const b = {
1298
- placement: e,
1299
- strategy: n,
1300
- middleware: p
1301
- };
1302
- T.current && (b.platform = T.current), fo(R.current, O.current, b).then((L) => {
1303
- const z = {
1304
- ...L,
1305
- // The floating element's position may be recomputed while it's closed
1306
- // but still mounted (such as when transitioning out). To ensure
1307
- // `isPositioned` will be `false` initially on the next open, avoid
1308
- // setting it to `true` when `open === false` (must be specified).
1309
- isPositioned: N.current !== !1
1310
- };
1311
- S.current && !xt(D.current, z) && (D.current = z, dn.flushSync(() => {
1312
- u(z);
1313
- }));
1314
- });
1315
- }, [p, e, n, T, N]);
1316
- mt(() => {
1317
- f === !1 && D.current.isPositioned && (D.current.isPositioned = !1, u((b) => ({
1318
- ...b,
1319
- isPositioned: !1
1320
- })));
1321
- }, [f]);
1322
- const S = g.useRef(!1);
1323
- mt(() => (S.current = !0, () => {
1324
- S.current = !1;
1325
- }), []), mt(() => {
1326
- if (x && (R.current = x), C && (O.current = C), x && C) {
1327
- if (_.current)
1328
- return _.current(x, C, E);
1329
- E();
1330
- }
1331
- }, [x, C, E, _, F]);
1332
- const $ = g.useMemo(() => ({
1333
- reference: R,
1334
- floating: O,
1335
- setReference: P,
1336
- setFloating: A
1337
- }), [P, A]), M = g.useMemo(() => ({
1338
- reference: x,
1339
- floating: C
1340
- }), [x, C]), k = g.useMemo(() => {
1341
- const b = {
1342
- position: n,
1343
- left: 0,
1344
- top: 0
1345
- };
1346
- if (!M.floating)
1347
- return b;
1348
- const L = ne(M.floating, l.x), z = ne(M.floating, l.y);
1349
- return c ? {
1350
- ...b,
1351
- transform: "translate(" + L + "px, " + z + "px)",
1352
- ...ge(M.floating) >= 1.5 && {
1353
- willChange: "transform"
1354
- }
1355
- } : {
1356
- position: n,
1357
- left: L,
1358
- top: z
1359
- };
1360
- }, [n, c, M.floating, l.x, l.y]);
1361
- return g.useMemo(() => ({
1362
- ...l,
1363
- update: E,
1364
- refs: $,
1365
- elements: M,
1366
- floatingStyles: k
1367
- }), [l, E, $, M, k]);
1368
- }
1369
- const mo = (t) => {
1370
- function e(n) {
1371
- return {}.hasOwnProperty.call(n, "current");
1372
- }
1373
- return {
1374
- name: "arrow",
1375
- options: t,
1376
- fn(n) {
1377
- const {
1378
- element: o,
1379
- padding: r
1380
- } = typeof t == "function" ? t(n) : t;
1381
- return o && e(o) ? o.current != null ? ee({
1382
- element: o.current,
1383
- padding: r
1384
- }).fn(n) : {} : o ? ee({
1385
- element: o,
1386
- padding: r
1387
- }).fn(n) : {};
1388
- }
1389
- };
1390
- }, go = (t, e) => {
1391
- const n = ro(t);
1392
- return {
1393
- name: n.name,
1394
- fn: n.fn,
1395
- options: [t, e]
1396
- };
1397
- }, wo = (t, e) => {
1398
- const n = io(t);
1399
- return {
1400
- name: n.name,
1401
- fn: n.fn,
1402
- options: [t, e]
1403
- };
1404
- }, vo = (t, e) => ({
1405
- fn: lo(t).fn,
1406
- options: [t, e]
1407
- }), xo = (t, e) => {
1408
- const n = so(t);
1409
- return {
1410
- name: n.name,
1411
- fn: n.fn,
1412
- options: [t, e]
1413
- };
1414
- }, yo = (t, e) => {
1415
- const n = co(t);
1416
- return {
1417
- name: n.name,
1418
- fn: n.fn,
1419
- options: [t, e]
1420
- };
1421
- }, Ao = (t, e) => {
1422
- const n = ao(t);
1423
- return {
1424
- name: n.name,
1425
- fn: n.fn,
1426
- options: [t, e]
1427
- };
1428
- }, Po = (t, e) => {
1429
- const n = mo(t);
1430
- return {
1431
- name: n.name,
1432
- fn: n.fn,
1433
- options: [t, e]
1434
- };
1435
- };
1436
- var bo = "Arrow", we = g.forwardRef((t, e) => {
1437
- const { children: n, width: o = 10, height: r = 5, ...i } = t;
1438
- return /* @__PURE__ */ w(
1439
- ft.svg,
1440
- {
1441
- ...i,
1442
- ref: e,
1443
- width: o,
1444
- height: r,
1445
- viewBox: "0 0 30 10",
1446
- preserveAspectRatio: "none",
1447
- children: t.asChild ? n : /* @__PURE__ */ w("polygon", { points: "0,0 30,0 15,10" })
1448
- }
1449
- );
1450
- });
1451
- we.displayName = bo;
1452
- var Co = we, Bt = "Popper", [ve, xe] = re(Bt), [Ro, ye] = ve(Bt), Ae = (t) => {
1453
- const { __scopePopper: e, children: n } = t, [o, r] = g.useState(null);
1454
- return /* @__PURE__ */ w(Ro, { scope: e, anchor: o, onAnchorChange: r, children: n });
1455
- };
1456
- Ae.displayName = Bt;
1457
- var Pe = "PopperAnchor", be = g.forwardRef(
1458
- (t, e) => {
1459
- const { __scopePopper: n, virtualRef: o, ...r } = t, i = ye(Pe, n), s = g.useRef(null), c = At(e, s), a = g.useRef(null);
1460
- return g.useEffect(() => {
1461
- const f = a.current;
1462
- a.current = o?.current || s.current, f !== a.current && i.onAnchorChange(a.current);
1463
- }), o ? null : /* @__PURE__ */ w(ft.div, { ...r, ref: c });
1464
- }
1465
- );
1466
- be.displayName = Pe;
1467
- var zt = "PopperContent", [Oo, So] = ve(zt), Ce = g.forwardRef(
1468
- (t, e) => {
1469
- const {
1470
- __scopePopper: n,
1471
- side: o = "bottom",
1472
- sideOffset: r = 0,
1473
- align: i = "center",
1474
- alignOffset: s = 0,
1475
- arrowPadding: c = 0,
1476
- avoidCollisions: a = !0,
1477
- collisionBoundary: f = [],
1478
- collisionPadding: l = 0,
1479
- sticky: u = "partial",
1480
- hideWhenDetached: p = !1,
1481
- updatePositionStrategy: d = "optimized",
1482
- onPlaced: h,
1483
- ...m
1484
- } = t, y = ye(zt, n), [v, P] = g.useState(null), A = At(e, (st) => P(st)), [x, C] = g.useState(null), R = wn(x), O = R?.width ?? 0, D = R?.height ?? 0, F = o + (i !== "center" ? "-" + i : ""), _ = typeof l == "number" ? l : { top: 0, right: 0, bottom: 0, left: 0, ...l }, T = Array.isArray(f) ? f : [f], N = T.length > 0, E = {
1485
- padding: _,
1486
- boundary: T.filter(Mo),
1487
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1488
- altBoundary: N
1489
- }, { refs: S, floatingStyles: $, placement: M, isPositioned: k, middlewareData: b } = ho({
1490
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1491
- strategy: "fixed",
1492
- placement: F,
1493
- whileElementsMounted: (...st) => oo(...st, {
1494
- animationFrame: d === "always"
1495
- }),
1496
- elements: {
1497
- reference: y.anchor
1498
- },
1499
- middleware: [
1500
- go({ mainAxis: r + D, alignmentAxis: s }),
1501
- a && wo({
1502
- mainAxis: !0,
1503
- crossAxis: !1,
1504
- limiter: u === "partial" ? vo() : void 0,
1505
- ...E
1506
- }),
1507
- a && xo({ ...E }),
1508
- yo({
1509
- ...E,
1510
- apply: ({ elements: st, rects: Xt, availableWidth: Xe, availableHeight: Ye }) => {
1511
- const { width: Ke, height: Qe } = Xt.reference, pt = st.floating.style;
1512
- pt.setProperty("--radix-popper-available-width", `${Xe}px`), pt.setProperty("--radix-popper-available-height", `${Ye}px`), pt.setProperty("--radix-popper-anchor-width", `${Ke}px`), pt.setProperty("--radix-popper-anchor-height", `${Qe}px`);
1513
- }
1514
- }),
1515
- x && Po({ element: x, padding: c }),
1516
- ko({ arrowWidth: O, arrowHeight: D }),
1517
- p && Ao({ strategy: "referenceHidden", ...E })
1518
- ]
1519
- }), [L, z] = Se(M), jt = en(h);
1520
- _t(() => {
1521
- k && jt?.();
1522
- }, [k, jt]);
1523
- const Ie = b.arrow?.x, Be = b.arrow?.y, ze = b.arrow?.centerOffset !== 0, [Ve, je] = g.useState();
1524
- return _t(() => {
1525
- v && je(window.getComputedStyle(v).zIndex);
1526
- }, [v]), /* @__PURE__ */ w(
1527
- "div",
1528
- {
1529
- ref: S.setFloating,
1530
- "data-radix-popper-content-wrapper": "",
1531
- style: {
1532
- ...$,
1533
- transform: k ? $.transform : "translate(0, -200%)",
1534
- // keep off the page when measuring
1535
- minWidth: "max-content",
1536
- zIndex: Ve,
1537
- "--radix-popper-transform-origin": [
1538
- b.transformOrigin?.x,
1539
- b.transformOrigin?.y
1540
- ].join(" "),
1541
- // hide the content if using the hide middleware and should be hidden
1542
- // set visibility to hidden and disable pointer events so the UI behaves
1543
- // as if the PopperContent isn't there at all
1544
- ...b.hide?.referenceHidden && {
1545
- visibility: "hidden",
1546
- pointerEvents: "none"
1547
- }
1548
- },
1549
- dir: t.dir,
1550
- children: /* @__PURE__ */ w(
1551
- Oo,
1552
- {
1553
- scope: n,
1554
- placedSide: L,
1555
- onArrowChange: C,
1556
- arrowX: Ie,
1557
- arrowY: Be,
1558
- shouldHideArrow: ze,
1559
- children: /* @__PURE__ */ w(
1560
- ft.div,
1561
- {
1562
- "data-side": L,
1563
- "data-align": z,
1564
- ...m,
1565
- ref: A,
1566
- style: {
1567
- ...m.style,
1568
- // if the PopperContent hasn't been placed yet (not all measurements done)
1569
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
1570
- animation: k ? void 0 : "none"
1571
- }
1572
- }
1573
- )
1574
- }
1575
- )
1576
- }
1577
- );
1578
- }
1579
- );
1580
- Ce.displayName = zt;
1581
- var Re = "PopperArrow", Eo = {
1582
- top: "bottom",
1583
- right: "left",
1584
- bottom: "top",
1585
- left: "right"
1586
- }, Oe = g.forwardRef(function(e, n) {
1587
- const { __scopePopper: o, ...r } = e, i = So(Re, o), s = Eo[i.placedSide];
1588
- return (
1589
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1590
- // doesn't report size as we'd expect on SVG elements.
1591
- // it reports their bounding box which is effectively the largest path inside the SVG.
1592
- /* @__PURE__ */ w(
1593
- "span",
1594
- {
1595
- ref: i.onArrowChange,
1596
- style: {
1597
- position: "absolute",
1598
- left: i.arrowX,
1599
- top: i.arrowY,
1600
- [s]: 0,
1601
- transformOrigin: {
1602
- top: "",
1603
- right: "0 0",
1604
- bottom: "center 0",
1605
- left: "100% 0"
1606
- }[i.placedSide],
1607
- transform: {
1608
- top: "translateY(100%)",
1609
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
1610
- bottom: "rotate(180deg)",
1611
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
1612
- }[i.placedSide],
1613
- visibility: i.shouldHideArrow ? "hidden" : void 0
1614
- },
1615
- children: /* @__PURE__ */ w(
1616
- Co,
1617
- {
1618
- ...r,
1619
- ref: n,
1620
- style: {
1621
- ...r.style,
1622
- // ensures the element can be measured correctly (mostly for if SVG)
1623
- display: "block"
1624
- }
1625
- }
1626
- )
1627
- }
1628
- )
1629
- );
1630
- });
1631
- Oe.displayName = Re;
1632
- function Mo(t) {
1633
- return t !== null;
1634
- }
1635
- var ko = (t) => ({
1636
- name: "transformOrigin",
1637
- options: t,
1638
- fn(e) {
1639
- const { placement: n, rects: o, middlewareData: r } = e, s = r.arrow?.centerOffset !== 0, c = s ? 0 : t.arrowWidth, a = s ? 0 : t.arrowHeight, [f, l] = Se(n), u = { start: "0%", center: "50%", end: "100%" }[l], p = (r.arrow?.x ?? 0) + c / 2, d = (r.arrow?.y ?? 0) + a / 2;
1640
- let h = "", m = "";
1641
- return f === "bottom" ? (h = s ? u : `${p}px`, m = `${-a}px`) : f === "top" ? (h = s ? u : `${p}px`, m = `${o.floating.height + a}px`) : f === "right" ? (h = `${-a}px`, m = s ? u : `${d}px`) : f === "left" && (h = `${o.floating.width + a}px`, m = s ? u : `${d}px`), { data: { x: h, y: m } };
1642
- }
1643
- });
1644
- function Se(t) {
1645
- const [e, n = "center"] = t.split("-");
1646
- return [e, n];
1647
- }
1648
- var _o = Ae, Ee = be, Do = Ce, Lo = Oe, Ot = "Popover", [Me] = re(Ot, [
1649
- xe
1650
- ]), dt = xe(), [To, Z] = Me(Ot), ke = (t) => {
1651
- const {
1652
- __scopePopover: e,
1653
- children: n,
1654
- open: o,
1655
- defaultOpen: r,
1656
- onOpenChange: i,
1657
- modal: s = !1
1658
- } = t, c = dt(e), a = g.useRef(null), [f, l] = g.useState(!1), [u, p] = nn({
1659
- prop: o,
1660
- defaultProp: r ?? !1,
1661
- onChange: i,
1662
- caller: Ot
1663
- });
1664
- return /* @__PURE__ */ w(_o, { ...c, children: /* @__PURE__ */ w(
1665
- To,
1666
- {
1667
- scope: e,
1668
- contentId: on(),
1669
- triggerRef: a,
1670
- open: u,
1671
- onOpenChange: p,
1672
- onOpenToggle: g.useCallback(() => p((d) => !d), [p]),
1673
- hasCustomAnchor: f,
1674
- onCustomAnchorAdd: g.useCallback(() => l(!0), []),
1675
- onCustomAnchorRemove: g.useCallback(() => l(!1), []),
1676
- modal: s,
1677
- children: n
1678
- }
1679
- ) });
1680
- };
1681
- ke.displayName = Ot;
1682
- var _e = "PopoverAnchor", De = g.forwardRef(
1683
- (t, e) => {
1684
- const { __scopePopover: n, ...o } = t, r = Z(_e, n), i = dt(n), { onCustomAnchorAdd: s, onCustomAnchorRemove: c } = r;
1685
- return g.useEffect(() => (s(), () => c()), [s, c]), /* @__PURE__ */ w(Ee, { ...i, ...o, ref: e });
1686
- }
1687
- );
1688
- De.displayName = _e;
1689
- var Le = "PopoverTrigger", Te = g.forwardRef(
1690
- (t, e) => {
1691
- const { __scopePopover: n, ...o } = t, r = Z(Le, n), i = dt(n), s = At(e, r.triggerRef), c = /* @__PURE__ */ w(
1692
- ft.button,
1693
- {
1694
- type: "button",
1695
- "aria-haspopup": "dialog",
1696
- "aria-expanded": r.open,
1697
- "aria-controls": r.contentId,
1698
- "data-state": He(r.open),
1699
- ...o,
1700
- ref: s,
1701
- onClick: ct(t.onClick, r.onOpenToggle)
1702
- }
1703
- );
1704
- return r.hasCustomAnchor ? c : /* @__PURE__ */ w(Ee, { asChild: !0, ...i, children: c });
1705
- }
1706
- );
1707
- Te.displayName = Le;
1708
- var Vt = "PopoverPortal", [No, Fo] = Me(Vt, {
1709
- forceMount: void 0
1710
- }), Ne = (t) => {
1711
- const { __scopePopover: e, forceMount: n, children: o, container: r } = t, i = Z(Vt, e);
1712
- return /* @__PURE__ */ w(No, { scope: e, forceMount: n, children: /* @__PURE__ */ w(ie, { present: n || i.open, children: /* @__PURE__ */ w(rn, { asChild: !0, container: r, children: o }) }) });
1713
- };
1714
- Ne.displayName = Vt;
1715
- var ot = "PopoverContent", Fe = g.forwardRef(
1716
- (t, e) => {
1717
- const n = Fo(ot, t.__scopePopover), { forceMount: o = n.forceMount, ...r } = t, i = Z(ot, t.__scopePopover);
1718
- return /* @__PURE__ */ w(ie, { present: o || i.open, children: i.modal ? /* @__PURE__ */ w(Wo, { ...r, ref: e }) : /* @__PURE__ */ w(Ho, { ...r, ref: e }) });
1719
- }
1720
- );
1721
- Fe.displayName = ot;
1722
- var $o = an("PopoverContent.RemoveScroll"), Wo = g.forwardRef(
1723
- (t, e) => {
1724
- const n = Z(ot, t.__scopePopover), o = g.useRef(null), r = At(e, o), i = g.useRef(!1);
1725
- return g.useEffect(() => {
1726
- const s = o.current;
1727
- if (s) return sn(s);
1728
- }, []), /* @__PURE__ */ w(cn, { as: $o, allowPinchZoom: !0, children: /* @__PURE__ */ w(
1729
- $e,
1730
- {
1731
- ...t,
1732
- ref: r,
1733
- trapFocus: n.open,
1734
- disableOutsidePointerEvents: !0,
1735
- onCloseAutoFocus: ct(t.onCloseAutoFocus, (s) => {
1736
- s.preventDefault(), i.current || n.triggerRef.current?.focus();
1737
- }),
1738
- onPointerDownOutside: ct(
1739
- t.onPointerDownOutside,
1740
- (s) => {
1741
- const c = s.detail.originalEvent, a = c.button === 0 && c.ctrlKey === !0, f = c.button === 2 || a;
1742
- i.current = f;
1743
- },
1744
- { checkForDefaultPrevented: !1 }
1745
- ),
1746
- onFocusOutside: ct(
1747
- t.onFocusOutside,
1748
- (s) => s.preventDefault(),
1749
- { checkForDefaultPrevented: !1 }
1750
- )
1751
- }
1752
- ) });
1753
- }
1754
- ), Ho = g.forwardRef(
1755
- (t, e) => {
1756
- const n = Z(ot, t.__scopePopover), o = g.useRef(!1), r = g.useRef(!1);
1757
- return /* @__PURE__ */ w(
1758
- $e,
1759
- {
1760
- ...t,
1761
- ref: e,
1762
- trapFocus: !1,
1763
- disableOutsidePointerEvents: !1,
1764
- onCloseAutoFocus: (i) => {
1765
- t.onCloseAutoFocus?.(i), i.defaultPrevented || (o.current || n.triggerRef.current?.focus(), i.preventDefault()), o.current = !1, r.current = !1;
1766
- },
1767
- onInteractOutside: (i) => {
1768
- t.onInteractOutside?.(i), i.defaultPrevented || (o.current = !0, i.detail.originalEvent.type === "pointerdown" && (r.current = !0));
1769
- const s = i.target;
1770
- n.triggerRef.current?.contains(s) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && r.current && i.preventDefault();
1771
- }
1772
- }
1773
- );
1774
- }
1775
- ), $e = g.forwardRef(
1776
- (t, e) => {
1777
- const {
1778
- __scopePopover: n,
1779
- trapFocus: o,
1780
- onOpenAutoFocus: r,
1781
- onCloseAutoFocus: i,
1782
- disableOutsidePointerEvents: s,
1783
- onEscapeKeyDown: c,
1784
- onPointerDownOutside: a,
1785
- onFocusOutside: f,
1786
- onInteractOutside: l,
1787
- ...u
1788
- } = t, p = Z(ot, n), d = dt(n);
1789
- return ln(), /* @__PURE__ */ w(
1790
- fn,
1791
- {
1792
- asChild: !0,
1793
- loop: !0,
1794
- trapped: o,
1795
- onMountAutoFocus: r,
1796
- onUnmountAutoFocus: i,
1797
- children: /* @__PURE__ */ w(
1798
- un,
1799
- {
1800
- asChild: !0,
1801
- disableOutsidePointerEvents: s,
1802
- onInteractOutside: l,
1803
- onEscapeKeyDown: c,
1804
- onPointerDownOutside: a,
1805
- onFocusOutside: f,
1806
- onDismiss: () => p.onOpenChange(!1),
1807
- children: /* @__PURE__ */ w(
1808
- Do,
1809
- {
1810
- "data-state": He(p.open),
1811
- role: "dialog",
1812
- id: p.contentId,
1813
- ...d,
1814
- ...u,
1815
- ref: e,
1816
- style: {
1817
- ...u.style,
1818
- "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
1819
- "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
1820
- "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
1821
- "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
1822
- "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
1823
- }
1824
- }
1825
- )
1826
- }
1827
- )
1828
- }
1829
- );
1830
- }
1831
- ), We = "PopoverClose", Io = g.forwardRef(
1832
- (t, e) => {
1833
- const { __scopePopover: n, ...o } = t, r = Z(We, n);
1834
- return /* @__PURE__ */ w(
1835
- ft.button,
1836
- {
1837
- type: "button",
1838
- ...o,
1839
- ref: e,
1840
- onClick: ct(t.onClick, () => r.onOpenChange(!1))
1841
- }
1842
- );
1843
- }
1844
- );
1845
- Io.displayName = We;
1846
- var Bo = "PopoverArrow", zo = g.forwardRef(
1847
- (t, e) => {
1848
- const { __scopePopover: n, ...o } = t, r = dt(n);
1849
- return /* @__PURE__ */ w(Lo, { ...r, ...o, ref: e });
1850
- }
1851
- );
1852
- zo.displayName = Bo;
1853
- function He(t) {
1854
- return t ? "open" : "closed";
1855
- }
1856
- var Vo = ke, jo = De, Xo = Te, Yo = Ne, Ko = Fe;
1857
- const Qo = "gQIKVa_anchor", qo = "gQIKVa_check", Uo = "gQIKVa_container", Go = "gQIKVa_radio", Zo = "gQIKVa_radioInput", at = {
1858
- anchor: Qo,
1859
- check: qo,
1860
- container: Uo,
1861
- radio: Go,
1862
- radioInput: Zo
1863
- };
1864
- function kt({ children: t, id: e, ...n }) {
1865
- return /* @__PURE__ */ q(oe, { children: [
1866
- /* @__PURE__ */ w(
1867
- "input",
1868
- {
1869
- type: "radio",
1870
- id: e,
1871
- className: Je(at.radioInput, "sr-only"),
1872
- ...n
1873
- }
1874
- ),
1875
- /* @__PURE__ */ q("label", { htmlFor: e, className: at.radio, children: [
1876
- t,
1877
- /* @__PURE__ */ w(Ze, { className: at.check })
1878
- ] })
1879
- ] });
1880
- }
1881
- function cr() {
1882
- const { theme: t, systemTheme: e, setTheme: n } = qe(), o = Ue();
1883
- return /* @__PURE__ */ q(Vo, { children: [
1884
- /* @__PURE__ */ w(Xo, { asChild: !0, children: /* @__PURE__ */ q(tn, { variant: "transparent", "aria-label": "Preferences", children: [
1885
- /* @__PURE__ */ w(mn, {}),
1886
- /* @__PURE__ */ w(jo, { className: at.anchor })
1887
- ] }) }),
1888
- /* @__PURE__ */ w(Yo, { children: /* @__PURE__ */ w(
1889
- Ko,
1890
- {
1891
- sideOffset: 8,
1892
- hideWhenDetached: !0,
1893
- className: at.container,
1894
- children: o && /* @__PURE__ */ q(oe, { children: [
1895
- /* @__PURE__ */ w("span", { children: "Appearance" }),
1896
- /* @__PURE__ */ q(
1897
- kt,
1898
- {
1899
- id: "system",
1900
- name: "theme",
1901
- checked: t === "system",
1902
- onChange: () => n("system"),
1903
- children: [
1904
- /* @__PURE__ */ w(pn, {}),
1905
- "Auto (",
1906
- e,
1907
- ")"
1908
- ]
1909
- }
1910
- ),
1911
- /* @__PURE__ */ q(
1912
- kt,
1913
- {
1914
- id: "light",
1915
- name: "theme",
1916
- checked: t === "light",
1917
- onChange: () => n("light"),
1918
- children: [
1919
- /* @__PURE__ */ w(gn, {}),
1920
- "Light"
1921
- ]
1922
- }
1923
- ),
1924
- /* @__PURE__ */ q(
1925
- kt,
1926
- {
1927
- id: "dark",
1928
- name: "theme",
1929
- checked: t === "dark",
1930
- onChange: () => n("dark"),
1931
- children: [
1932
- /* @__PURE__ */ w(hn, {}),
1933
- "Dark"
1934
- ]
1935
- }
1936
- )
1937
- ] })
1938
- }
1939
- ) })
1940
- ] });
1941
- }
1942
- export {
1943
- cr as PrefPanel,
1944
- kt as PrefRadio
1945
- };
1
+ import { n as e, t } from "../../PrefPanel-DmiRZs1n.js";
2
+ export { t as PrefPanel, e as PrefRadio };