@rinzai/zen 0.1.4 → 0.1.6

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.
package/dist/index.js DELETED
@@ -1,2537 +0,0 @@
1
- import * as M from "react";
2
- import Vt, { useLayoutEffect as Ft, useEffect as Oe, useState as je, useId as $t, useMemo as Ye, useRef as yt } from "react";
3
- import * as Bt from "react-dom";
4
- import { createPortal as Yt, flushSync as Ht } from "react-dom";
5
- var Ee = { exports: {} }, xe = {};
6
- /**
7
- * @license React
8
- * react-jsx-runtime.production.js
9
- *
10
- * Copyright (c) Meta Platforms, Inc. and affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
- var at;
16
- function Ut() {
17
- if (at) return xe;
18
- at = 1;
19
- var e = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
20
- function t(n, r, s) {
21
- var l = null;
22
- if (s !== void 0 && (l = "" + s), r.key !== void 0 && (l = "" + r.key), "key" in r) {
23
- s = {};
24
- for (var c in r)
25
- c !== "key" && (s[c] = r[c]);
26
- } else s = r;
27
- return r = s.ref, {
28
- $$typeof: e,
29
- type: n,
30
- key: l,
31
- ref: r !== void 0 ? r : null,
32
- props: s
33
- };
34
- }
35
- return xe.Fragment = o, xe.jsx = t, xe.jsxs = t, xe;
36
- }
37
- var ve = {};
38
- /**
39
- * @license React
40
- * react-jsx-runtime.development.js
41
- *
42
- * Copyright (c) Meta Platforms, Inc. and affiliates.
43
- *
44
- * This source code is licensed under the MIT license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */
47
- var ut;
48
- function qt() {
49
- return ut || (ut = 1, process.env.NODE_ENV !== "production" && function() {
50
- function e(i) {
51
- if (i == null) return null;
52
- if (typeof i == "function")
53
- return i.$$typeof === k ? null : i.displayName || i.name || null;
54
- if (typeof i == "string") return i;
55
- switch (i) {
56
- case j:
57
- return "Fragment";
58
- case S:
59
- return "Portal";
60
- case W:
61
- return "Profiler";
62
- case D:
63
- return "StrictMode";
64
- case Z:
65
- return "Suspense";
66
- case $:
67
- return "SuspenseList";
68
- }
69
- if (typeof i == "object")
70
- switch (typeof i.tag == "number" && console.error(
71
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
- ), i.$$typeof) {
73
- case F:
74
- return (i.displayName || "Context") + ".Provider";
75
- case K:
76
- return (i._context.displayName || "Context") + ".Consumer";
77
- case q:
78
- var x = i.render;
79
- return i = i.displayName, i || (i = x.displayName || x.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
80
- case z:
81
- return x = i.displayName || null, x !== null ? x : e(i.type) || "Memo";
82
- case Q:
83
- x = i._payload, i = i._init;
84
- try {
85
- return e(i(x));
86
- } catch {
87
- }
88
- }
89
- return null;
90
- }
91
- function o(i) {
92
- return "" + i;
93
- }
94
- function t(i) {
95
- try {
96
- o(i);
97
- var x = !1;
98
- } catch {
99
- x = !0;
100
- }
101
- if (x) {
102
- x = console;
103
- var v = x.error, T = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
104
- return v.call(
105
- x,
106
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- T
108
- ), o(i);
109
- }
110
- }
111
- function n() {
112
- }
113
- function r() {
114
- if (ge === 0) {
115
- Ke = console.log, Ze = console.info, Qe = console.warn, et = console.error, tt = console.group, nt = console.groupCollapsed, ot = console.groupEnd;
116
- var i = {
117
- configurable: !0,
118
- enumerable: !0,
119
- value: n,
120
- writable: !0
121
- };
122
- Object.defineProperties(console, {
123
- info: i,
124
- log: i,
125
- warn: i,
126
- error: i,
127
- group: i,
128
- groupCollapsed: i,
129
- groupEnd: i
130
- });
131
- }
132
- ge++;
133
- }
134
- function s() {
135
- if (ge--, ge === 0) {
136
- var i = { configurable: !0, enumerable: !0, writable: !0 };
137
- Object.defineProperties(console, {
138
- log: re({}, i, { value: Ke }),
139
- info: re({}, i, { value: Ze }),
140
- warn: re({}, i, { value: Qe }),
141
- error: re({}, i, { value: et }),
142
- group: re({}, i, { value: tt }),
143
- groupCollapsed: re({}, i, { value: nt }),
144
- groupEnd: re({}, i, { value: ot })
145
- });
146
- }
147
- 0 > ge && console.error(
148
- "disabledDepth fell below zero. This is a bug in React. Please file an issue."
149
- );
150
- }
151
- function l(i) {
152
- if (De === void 0)
153
- try {
154
- throw Error();
155
- } catch (v) {
156
- var x = v.stack.trim().match(/\n( *(at )?)/);
157
- De = x && x[1] || "", rt = -1 < v.stack.indexOf(`
158
- at`) ? " (<anonymous>)" : -1 < v.stack.indexOf("@") ? "@unknown:0:0" : "";
159
- }
160
- return `
161
- ` + De + i + rt;
162
- }
163
- function c(i, x) {
164
- if (!i || We) return "";
165
- var v = Ve.get(i);
166
- if (v !== void 0) return v;
167
- We = !0, v = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
168
- var T = null;
169
- T = _.H, _.H = null, r();
170
- try {
171
- var N = {
172
- DetermineComponentFrameRoot: function() {
173
- try {
174
- if (x) {
175
- var ne = function() {
176
- throw Error();
177
- };
178
- if (Object.defineProperty(ne.prototype, "props", {
179
- set: function() {
180
- throw Error();
181
- }
182
- }), typeof Reflect == "object" && Reflect.construct) {
183
- try {
184
- Reflect.construct(ne, []);
185
- } catch (te) {
186
- var ye = te;
187
- }
188
- Reflect.construct(i, [], ne);
189
- } else {
190
- try {
191
- ne.call();
192
- } catch (te) {
193
- ye = te;
194
- }
195
- i.call(ne.prototype);
196
- }
197
- } else {
198
- try {
199
- throw Error();
200
- } catch (te) {
201
- ye = te;
202
- }
203
- (ne = i()) && typeof ne.catch == "function" && ne.catch(function() {
204
- });
205
- }
206
- } catch (te) {
207
- if (te && ye && typeof te.stack == "string")
208
- return [te.stack, ye.stack];
209
- }
210
- return [null, null];
211
- }
212
- };
213
- N.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
214
- var A = Object.getOwnPropertyDescriptor(
215
- N.DetermineComponentFrameRoot,
216
- "name"
217
- );
218
- A && A.configurable && Object.defineProperty(
219
- N.DetermineComponentFrameRoot,
220
- "name",
221
- { value: "DetermineComponentFrameRoot" }
222
- );
223
- var C = N.DetermineComponentFrameRoot(), ee = C[0], ae = C[1];
224
- if (ee && ae) {
225
- var P = ee.split(`
226
- `), se = ae.split(`
227
- `);
228
- for (C = A = 0; A < P.length && !P[A].includes(
229
- "DetermineComponentFrameRoot"
230
- ); )
231
- A++;
232
- for (; C < se.length && !se[C].includes(
233
- "DetermineComponentFrameRoot"
234
- ); )
235
- C++;
236
- if (A === P.length || C === se.length)
237
- for (A = P.length - 1, C = se.length - 1; 1 <= A && 0 <= C && P[A] !== se[C]; )
238
- C--;
239
- for (; 1 <= A && 0 <= C; A--, C--)
240
- if (P[A] !== se[C]) {
241
- if (A !== 1 || C !== 1)
242
- do
243
- if (A--, C--, 0 > C || P[A] !== se[C]) {
244
- var pe = `
245
- ` + P[A].replace(
246
- " at new ",
247
- " at "
248
- );
249
- return i.displayName && pe.includes("<anonymous>") && (pe = pe.replace("<anonymous>", i.displayName)), typeof i == "function" && Ve.set(i, pe), pe;
250
- }
251
- while (1 <= A && 0 <= C);
252
- break;
253
- }
254
- }
255
- } finally {
256
- We = !1, _.H = T, s(), Error.prepareStackTrace = v;
257
- }
258
- return P = (P = i ? i.displayName || i.name : "") ? l(P) : "", typeof i == "function" && Ve.set(i, P), P;
259
- }
260
- function a(i) {
261
- if (i == null) return "";
262
- if (typeof i == "function") {
263
- var x = i.prototype;
264
- return c(
265
- i,
266
- !(!x || !x.isReactComponent)
267
- );
268
- }
269
- if (typeof i == "string") return l(i);
270
- switch (i) {
271
- case Z:
272
- return l("Suspense");
273
- case $:
274
- return l("SuspenseList");
275
- }
276
- if (typeof i == "object")
277
- switch (i.$$typeof) {
278
- case q:
279
- return i = c(i.render, !1), i;
280
- case z:
281
- return a(i.type);
282
- case Q:
283
- x = i._payload, i = i._init;
284
- try {
285
- return a(i(x));
286
- } catch {
287
- }
288
- }
289
- return "";
290
- }
291
- function u() {
292
- var i = _.A;
293
- return i === null ? null : i.getOwner();
294
- }
295
- function f(i) {
296
- if (Y.call(i, "key")) {
297
- var x = Object.getOwnPropertyDescriptor(i, "key").get;
298
- if (x && x.isReactWarning) return !1;
299
- }
300
- return i.key !== void 0;
301
- }
302
- function d(i, x) {
303
- function v() {
304
- st || (st = !0, console.error(
305
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
306
- x
307
- ));
308
- }
309
- v.isReactWarning = !0, Object.defineProperty(i, "key", {
310
- get: v,
311
- configurable: !0
312
- });
313
- }
314
- function p() {
315
- var i = e(this.type);
316
- return it[i] || (it[i] = !0, console.error(
317
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
318
- )), i = this.props.ref, i !== void 0 ? i : null;
319
- }
320
- function m(i, x, v, T, N, A) {
321
- return v = A.ref, i = {
322
- $$typeof: R,
323
- type: i,
324
- key: x,
325
- props: A,
326
- _owner: N
327
- }, (v !== void 0 ? v : null) !== null ? Object.defineProperty(i, "ref", {
328
- enumerable: !1,
329
- get: p
330
- }) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", {
331
- configurable: !1,
332
- enumerable: !1,
333
- writable: !0,
334
- value: 0
335
- }), Object.defineProperty(i, "_debugInfo", {
336
- configurable: !1,
337
- enumerable: !1,
338
- writable: !0,
339
- value: null
340
- }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
341
- }
342
- function h(i, x, v, T, N, A) {
343
- if (typeof i == "string" || typeof i == "function" || i === j || i === W || i === D || i === Z || i === $ || i === I || typeof i == "object" && i !== null && (i.$$typeof === Q || i.$$typeof === z || i.$$typeof === F || i.$$typeof === K || i.$$typeof === q || i.$$typeof === Dt || i.getModuleId !== void 0)) {
344
- var C = x.children;
345
- if (C !== void 0)
346
- if (T)
347
- if (Le(C)) {
348
- for (T = 0; T < C.length; T++)
349
- b(C[T], i);
350
- Object.freeze && Object.freeze(C);
351
- } else
352
- console.error(
353
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
354
- );
355
- else b(C, i);
356
- } else
357
- C = "", (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), i === null ? T = "null" : Le(i) ? T = "array" : i !== void 0 && i.$$typeof === R ? (T = "<" + (e(i.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : T = typeof i, console.error(
358
- "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
359
- T,
360
- C
361
- );
362
- if (Y.call(x, "key")) {
363
- C = e(i);
364
- var ee = Object.keys(x).filter(function(P) {
365
- return P !== "key";
366
- });
367
- T = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", lt[C + T] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
368
- `A props object containing a "key" prop is being spread into JSX:
369
- let props = %s;
370
- <%s {...props} />
371
- React keys must be passed directly to JSX without using spread:
372
- let props = %s;
373
- <%s key={someKey} {...props} />`,
374
- T,
375
- C,
376
- ee,
377
- C
378
- ), lt[C + T] = !0);
379
- }
380
- if (C = null, v !== void 0 && (t(v), C = "" + v), f(x) && (t(x.key), C = "" + x.key), "key" in x) {
381
- v = {};
382
- for (var ae in x)
383
- ae !== "key" && (v[ae] = x[ae]);
384
- } else v = x;
385
- return C && d(
386
- v,
387
- typeof i == "function" ? i.displayName || i.name || "Unknown" : i
388
- ), m(i, C, A, N, u(), v);
389
- }
390
- function b(i, x) {
391
- if (typeof i == "object" && i && i.$$typeof !== Wt) {
392
- if (Le(i))
393
- for (var v = 0; v < i.length; v++) {
394
- var T = i[v];
395
- y(T) && g(T, x);
396
- }
397
- else if (y(i))
398
- i._store && (i._store.validated = 1);
399
- else if (i === null || typeof i != "object" ? v = null : (v = B && i[B] || i["@@iterator"], v = typeof v == "function" ? v : null), typeof v == "function" && v !== i.entries && (v = v.call(i), v !== i))
400
- for (; !(i = v.next()).done; )
401
- y(i.value) && g(i.value, x);
402
- }
403
- }
404
- function y(i) {
405
- return typeof i == "object" && i !== null && i.$$typeof === R;
406
- }
407
- function g(i, x) {
408
- if (i._store && !i._store.validated && i.key == null && (i._store.validated = 1, x = w(x), !ct[x])) {
409
- ct[x] = !0;
410
- var v = "";
411
- i && i._owner != null && i._owner !== u() && (v = null, typeof i._owner.tag == "number" ? v = e(i._owner.type) : typeof i._owner.name == "string" && (v = i._owner.name), v = " It was passed a child from " + v + ".");
412
- var T = _.getCurrentStack;
413
- _.getCurrentStack = function() {
414
- var N = a(i.type);
415
- return T && (N += T() || ""), N;
416
- }, console.error(
417
- 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
418
- x,
419
- v
420
- ), _.getCurrentStack = T;
421
- }
422
- }
423
- function w(i) {
424
- var x = "", v = u();
425
- return v && (v = e(v.type)) && (x = `
426
-
427
- Check the render method of \`` + v + "`."), x || (i = e(i)) && (x = `
428
-
429
- Check the top-level render call using <` + i + ">."), x;
430
- }
431
- var O = Vt, R = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), D = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), K = Symbol.for("react.consumer"), F = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), $ = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), Q = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), B = Symbol.iterator, k = Symbol.for("react.client.reference"), _ = O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, re = Object.assign, Dt = Symbol.for("react.client.reference"), Le = Array.isArray, ge = 0, Ke, Ze, Qe, et, tt, nt, ot;
432
- n.__reactDisabledLog = !0;
433
- var De, rt, We = !1, Ve = new (typeof WeakMap == "function" ? WeakMap : Map)(), Wt = Symbol.for("react.client.reference"), st, it = {}, lt = {}, ct = {};
434
- ve.Fragment = j, ve.jsx = function(i, x, v, T, N) {
435
- return h(i, x, v, !1, T, N);
436
- }, ve.jsxs = function(i, x, v, T, N) {
437
- return h(i, x, v, !0, T, N);
438
- };
439
- }()), ve;
440
- }
441
- var ft;
442
- function Xt() {
443
- return ft || (ft = 1, process.env.NODE_ENV === "production" ? Ee.exports = Ut() : Ee.exports = qt()), Ee.exports;
444
- }
445
- var E = Xt();
446
- const L = (...e) => e.reduce((o, t) => t == null || t === !1 ? o : typeof t == "string" || typeof t == "number" ? o + " " + t : Array.isArray(t) ? o + " " + L(...t) : typeof t == "object" ? o + " " + Object.entries(t).reduce((n, [r, s]) => s == null || s === !1 ? n : typeof s == "string" || typeof s == "number" ? n + " " + r + "-" + s : typeof s == "boolean" && s ? n + " " + r : n, "") : o, ""), dt = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Et = (e, o) => (t) => {
447
- var a;
448
- if ((o == null ? void 0 : o.variants) == null) return L(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
449
- const { variants: n, defaultVariants: r } = o, s = Object.keys(n).map((u) => {
450
- const f = t == null ? void 0 : t[u], d = r == null ? void 0 : r[u];
451
- if (f === null) return null;
452
- const p = dt(f) || dt(d);
453
- return n[u][p];
454
- }), l = t && Object.entries(t).reduce(
455
- (u, [f, d]) => (d === void 0 || (u[f] = d), u),
456
- {}
457
- ), c = (a = o == null ? void 0 : o.compoundVariants) == null ? void 0 : a.reduce(
458
- (u, { class: f, className: d, ...p }) => Object.entries(p).every(
459
- ([m, h]) => Array.isArray(h) ? h.includes(
460
- {
461
- ...r,
462
- ...l
463
- }[m]
464
- ) : {
465
- ...r,
466
- ...l
467
- }[m] === h
468
- ) ? [...u, f, d] : u,
469
- []
470
- );
471
- return L(e, s, c, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
472
- };
473
- function Ct({ variant: e, className: o, ...t }) {
474
- return /* @__PURE__ */ E.jsx("span", { ...t, className: Jt({ variant: e, className: o }) });
475
- }
476
- const Jt = Et(
477
- "zen__badge inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors whitespace-nowrap",
478
- {
479
- variants: {
480
- variant: {
481
- default: "border-transparent bg-primary text-primary-foreground shadow",
482
- secondary: "border-transparent bg-secondary text-secondary-foreground",
483
- destructive: "border-transparent bg-destructive text-destructive-foreground shadow",
484
- outline: "text-foreground"
485
- }
486
- },
487
- defaultVariants: {
488
- variant: "default"
489
- }
490
- }
491
- );
492
- function Gt({ className: e, variant: o, size: t, ...n }) {
493
- return /* @__PURE__ */ E.jsx("button", { className: Kt({ variant: o, size: t, className: e }), ...n });
494
- }
495
- const Kt = Et(
496
- "zen__button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
497
- {
498
- variants: {
499
- variant: {
500
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
501
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
502
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
503
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
504
- ghost: "hover:bg-accent hover:text-accent-foreground",
505
- link: "text-primary underline-offset-4 hover:underline",
506
- icon: ""
507
- },
508
- size: {
509
- default: "h-9 px-4 py-2",
510
- sm: "h-8 rounded-md px-3 text-xs",
511
- lg: "h-10 rounded-md px-8",
512
- icon: ""
513
- }
514
- },
515
- defaultVariants: {
516
- variant: "default",
517
- size: "default"
518
- }
519
- }
520
- ), Re = Math.min, ie = Math.max, Te = Math.round, Ce = Math.floor, X = (e) => ({
521
- x: e,
522
- y: e
523
- }), Zt = {
524
- left: "right",
525
- right: "left",
526
- bottom: "top",
527
- top: "bottom"
528
- }, Qt = {
529
- start: "end",
530
- end: "start"
531
- };
532
- function ht(e, o, t) {
533
- return ie(e, Re(o, t));
534
- }
535
- function Me(e, o) {
536
- return typeof e == "function" ? e(o) : e;
537
- }
538
- function le(e) {
539
- return e.split("-")[0];
540
- }
541
- function Ne(e) {
542
- return e.split("-")[1];
543
- }
544
- function St(e) {
545
- return e === "x" ? "y" : "x";
546
- }
547
- function Ot(e) {
548
- return e === "y" ? "height" : "width";
549
- }
550
- function de(e) {
551
- return ["top", "bottom"].includes(le(e)) ? "y" : "x";
552
- }
553
- function Rt(e) {
554
- return St(de(e));
555
- }
556
- function en(e, o, t) {
557
- t === void 0 && (t = !1);
558
- const n = Ne(e), r = Rt(e), s = Ot(r);
559
- let l = r === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
560
- return o.reference[s] > o.floating[s] && (l = ke(l)), [l, ke(l)];
561
- }
562
- function tn(e) {
563
- const o = ke(e);
564
- return [He(e), o, He(o)];
565
- }
566
- function He(e) {
567
- return e.replace(/start|end/g, (o) => Qt[o]);
568
- }
569
- function nn(e, o, t) {
570
- const n = ["left", "right"], r = ["right", "left"], s = ["top", "bottom"], l = ["bottom", "top"];
571
- switch (e) {
572
- case "top":
573
- case "bottom":
574
- return t ? o ? r : n : o ? n : r;
575
- case "left":
576
- case "right":
577
- return o ? s : l;
578
- default:
579
- return [];
580
- }
581
- }
582
- function on(e, o, t, n) {
583
- const r = Ne(e);
584
- let s = nn(le(e), t === "start", n);
585
- return r && (s = s.map((l) => l + "-" + r), o && (s = s.concat(s.map(He)))), s;
586
- }
587
- function ke(e) {
588
- return e.replace(/left|right|bottom|top/g, (o) => Zt[o]);
589
- }
590
- function rn(e) {
591
- return {
592
- top: 0,
593
- right: 0,
594
- bottom: 0,
595
- left: 0,
596
- ...e
597
- };
598
- }
599
- function sn(e) {
600
- return typeof e != "number" ? rn(e) : {
601
- top: e,
602
- right: e,
603
- bottom: e,
604
- left: e
605
- };
606
- }
607
- function Ae(e) {
608
- const {
609
- x: o,
610
- y: t,
611
- width: n,
612
- height: r
613
- } = e;
614
- return {
615
- width: n,
616
- height: r,
617
- top: t,
618
- left: o,
619
- right: o + n,
620
- bottom: t + r,
621
- x: o,
622
- y: t
623
- };
624
- }
625
- function mt(e, o, t) {
626
- let {
627
- reference: n,
628
- floating: r
629
- } = e;
630
- const s = de(o), l = Rt(o), c = Ot(l), a = le(o), u = s === "y", f = n.x + n.width / 2 - r.width / 2, d = n.y + n.height / 2 - r.height / 2, p = n[c] / 2 - r[c] / 2;
631
- let m;
632
- switch (a) {
633
- case "top":
634
- m = {
635
- x: f,
636
- y: n.y - r.height
637
- };
638
- break;
639
- case "bottom":
640
- m = {
641
- x: f,
642
- y: n.y + n.height
643
- };
644
- break;
645
- case "right":
646
- m = {
647
- x: n.x + n.width,
648
- y: d
649
- };
650
- break;
651
- case "left":
652
- m = {
653
- x: n.x - r.width,
654
- y: d
655
- };
656
- break;
657
- default:
658
- m = {
659
- x: n.x,
660
- y: n.y
661
- };
662
- }
663
- switch (Ne(o)) {
664
- case "start":
665
- m[l] -= p * (t && u ? -1 : 1);
666
- break;
667
- case "end":
668
- m[l] += p * (t && u ? -1 : 1);
669
- break;
670
- }
671
- return m;
672
- }
673
- const ln = async (e, o, t) => {
674
- const {
675
- placement: n = "bottom",
676
- strategy: r = "absolute",
677
- middleware: s = [],
678
- platform: l
679
- } = t, c = s.filter(Boolean), a = await (l.isRTL == null ? void 0 : l.isRTL(o));
680
- let u = await l.getElementRects({
681
- reference: e,
682
- floating: o,
683
- strategy: r
684
- }), {
685
- x: f,
686
- y: d
687
- } = mt(u, n, a), p = n, m = {}, h = 0;
688
- for (let b = 0; b < c.length; b++) {
689
- const {
690
- name: y,
691
- fn: g
692
- } = c[b], {
693
- x: w,
694
- y: O,
695
- data: R,
696
- reset: S
697
- } = await g({
698
- x: f,
699
- y: d,
700
- initialPlacement: n,
701
- placement: p,
702
- strategy: r,
703
- middlewareData: m,
704
- rects: u,
705
- platform: l,
706
- elements: {
707
- reference: e,
708
- floating: o
709
- }
710
- });
711
- f = w ?? f, d = O ?? d, m = {
712
- ...m,
713
- [y]: {
714
- ...m[y],
715
- ...R
716
- }
717
- }, S && h <= 50 && (h++, typeof S == "object" && (S.placement && (p = S.placement), S.rects && (u = S.rects === !0 ? await l.getElementRects({
718
- reference: e,
719
- floating: o,
720
- strategy: r
721
- }) : S.rects), {
722
- x: f,
723
- y: d
724
- } = mt(u, p, a)), b = -1);
725
- }
726
- return {
727
- x: f,
728
- y: d,
729
- placement: p,
730
- strategy: r,
731
- middlewareData: m
732
- };
733
- };
734
- async function Tt(e, o) {
735
- var t;
736
- o === void 0 && (o = {});
737
- const {
738
- x: n,
739
- y: r,
740
- platform: s,
741
- rects: l,
742
- elements: c,
743
- strategy: a
744
- } = e, {
745
- boundary: u = "clippingAncestors",
746
- rootBoundary: f = "viewport",
747
- elementContext: d = "floating",
748
- altBoundary: p = !1,
749
- padding: m = 0
750
- } = Me(o, e), h = sn(m), y = c[p ? d === "floating" ? "reference" : "floating" : d], g = Ae(await s.getClippingRect({
751
- element: (t = await (s.isElement == null ? void 0 : s.isElement(y))) == null || t ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
752
- boundary: u,
753
- rootBoundary: f,
754
- strategy: a
755
- })), w = d === "floating" ? {
756
- x: n,
757
- y: r,
758
- width: l.floating.width,
759
- height: l.floating.height
760
- } : l.reference, O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), R = await (s.isElement == null ? void 0 : s.isElement(O)) ? await (s.getScale == null ? void 0 : s.getScale(O)) || {
761
- x: 1,
762
- y: 1
763
- } : {
764
- x: 1,
765
- y: 1
766
- }, S = Ae(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
767
- elements: c,
768
- rect: w,
769
- offsetParent: O,
770
- strategy: a
771
- }) : w);
772
- return {
773
- top: (g.top - S.top + h.top) / R.y,
774
- bottom: (S.bottom - g.bottom + h.bottom) / R.y,
775
- left: (g.left - S.left + h.left) / R.x,
776
- right: (S.right - g.right + h.right) / R.x
777
- };
778
- }
779
- const cn = function(e) {
780
- return e === void 0 && (e = {}), {
781
- name: "flip",
782
- options: e,
783
- async fn(o) {
784
- var t, n;
785
- const {
786
- placement: r,
787
- middlewareData: s,
788
- rects: l,
789
- initialPlacement: c,
790
- platform: a,
791
- elements: u
792
- } = o, {
793
- mainAxis: f = !0,
794
- crossAxis: d = !0,
795
- fallbackPlacements: p,
796
- fallbackStrategy: m = "bestFit",
797
- fallbackAxisSideDirection: h = "none",
798
- flipAlignment: b = !0,
799
- ...y
800
- } = Me(e, o);
801
- if ((t = s.arrow) != null && t.alignmentOffset)
802
- return {};
803
- const g = le(r), w = de(c), O = le(c) === c, R = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), S = p || (O || !b ? [ke(c)] : tn(c)), j = h !== "none";
804
- !p && j && S.push(...on(c, b, h, R));
805
- const D = [c, ...S], W = await Tt(o, y), K = [];
806
- let F = ((n = s.flip) == null ? void 0 : n.overflows) || [];
807
- if (f && K.push(W[g]), d) {
808
- const z = en(r, l, R);
809
- K.push(W[z[0]], W[z[1]]);
810
- }
811
- if (F = [...F, {
812
- placement: r,
813
- overflows: K
814
- }], !K.every((z) => z <= 0)) {
815
- var q, Z;
816
- const z = (((q = s.flip) == null ? void 0 : q.index) || 0) + 1, Q = D[z];
817
- if (Q)
818
- return {
819
- data: {
820
- index: z,
821
- overflows: F
822
- },
823
- reset: {
824
- placement: Q
825
- }
826
- };
827
- let I = (Z = F.filter((B) => B.overflows[0] <= 0).sort((B, k) => B.overflows[1] - k.overflows[1])[0]) == null ? void 0 : Z.placement;
828
- if (!I)
829
- switch (m) {
830
- case "bestFit": {
831
- var $;
832
- const B = ($ = F.filter((k) => {
833
- if (j) {
834
- const _ = de(k.placement);
835
- return _ === w || // Create a bias to the `y` side axis due to horizontal
836
- // reading directions favoring greater width.
837
- _ === "y";
838
- }
839
- return !0;
840
- }).map((k) => [k.placement, k.overflows.filter((_) => _ > 0).reduce((_, Y) => _ + Y, 0)]).sort((k, _) => k[1] - _[1])[0]) == null ? void 0 : $[0];
841
- B && (I = B);
842
- break;
843
- }
844
- case "initialPlacement":
845
- I = c;
846
- break;
847
- }
848
- if (r !== I)
849
- return {
850
- reset: {
851
- placement: I
852
- }
853
- };
854
- }
855
- return {};
856
- }
857
- };
858
- };
859
- async function an(e, o) {
860
- const {
861
- placement: t,
862
- platform: n,
863
- elements: r
864
- } = e, s = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), l = le(t), c = Ne(t), a = de(t) === "y", u = ["left", "top"].includes(l) ? -1 : 1, f = s && a ? -1 : 1, d = Me(o, e);
865
- let {
866
- mainAxis: p,
867
- crossAxis: m,
868
- alignmentAxis: h
869
- } = typeof d == "number" ? {
870
- mainAxis: d,
871
- crossAxis: 0,
872
- alignmentAxis: null
873
- } : {
874
- mainAxis: d.mainAxis || 0,
875
- crossAxis: d.crossAxis || 0,
876
- alignmentAxis: d.alignmentAxis
877
- };
878
- return c && typeof h == "number" && (m = c === "end" ? h * -1 : h), a ? {
879
- x: m * f,
880
- y: p * u
881
- } : {
882
- x: p * u,
883
- y: m * f
884
- };
885
- }
886
- const un = function(e) {
887
- return e === void 0 && (e = 0), {
888
- name: "offset",
889
- options: e,
890
- async fn(o) {
891
- var t, n;
892
- const {
893
- x: r,
894
- y: s,
895
- placement: l,
896
- middlewareData: c
897
- } = o, a = await an(o, e);
898
- return l === ((t = c.offset) == null ? void 0 : t.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
899
- x: r + a.x,
900
- y: s + a.y,
901
- data: {
902
- ...a,
903
- placement: l
904
- }
905
- };
906
- }
907
- };
908
- }, fn = function(e) {
909
- return e === void 0 && (e = {}), {
910
- name: "shift",
911
- options: e,
912
- async fn(o) {
913
- const {
914
- x: t,
915
- y: n,
916
- placement: r
917
- } = o, {
918
- mainAxis: s = !0,
919
- crossAxis: l = !1,
920
- limiter: c = {
921
- fn: (y) => {
922
- let {
923
- x: g,
924
- y: w
925
- } = y;
926
- return {
927
- x: g,
928
- y: w
929
- };
930
- }
931
- },
932
- ...a
933
- } = Me(e, o), u = {
934
- x: t,
935
- y: n
936
- }, f = await Tt(o, a), d = de(le(r)), p = St(d);
937
- let m = u[p], h = u[d];
938
- if (s) {
939
- const y = p === "y" ? "top" : "left", g = p === "y" ? "bottom" : "right", w = m + f[y], O = m - f[g];
940
- m = ht(w, m, O);
941
- }
942
- if (l) {
943
- const y = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", w = h + f[y], O = h - f[g];
944
- h = ht(w, h, O);
945
- }
946
- const b = c.fn({
947
- ...o,
948
- [p]: m,
949
- [d]: h
950
- });
951
- return {
952
- ...b,
953
- data: {
954
- x: b.x - t,
955
- y: b.y - n,
956
- enabled: {
957
- [p]: s,
958
- [d]: l
959
- }
960
- }
961
- };
962
- }
963
- };
964
- };
965
- function ze() {
966
- return typeof window < "u";
967
- }
968
- function me(e) {
969
- return kt(e) ? (e.nodeName || "").toLowerCase() : "#document";
970
- }
971
- function V(e) {
972
- var o;
973
- return (e == null || (o = e.ownerDocument) == null ? void 0 : o.defaultView) || window;
974
- }
975
- function G(e) {
976
- var o;
977
- return (o = (kt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : o.documentElement;
978
- }
979
- function kt(e) {
980
- return ze() ? e instanceof Node || e instanceof V(e).Node : !1;
981
- }
982
- function H(e) {
983
- return ze() ? e instanceof Element || e instanceof V(e).Element : !1;
984
- }
985
- function J(e) {
986
- return ze() ? e instanceof HTMLElement || e instanceof V(e).HTMLElement : !1;
987
- }
988
- function gt(e) {
989
- return !ze() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof V(e).ShadowRoot;
990
- }
991
- function we(e) {
992
- const {
993
- overflow: o,
994
- overflowX: t,
995
- overflowY: n,
996
- display: r
997
- } = U(e);
998
- return /auto|scroll|overlay|hidden|clip/.test(o + n + t) && !["inline", "contents"].includes(r);
999
- }
1000
- function dn(e) {
1001
- return ["table", "td", "th"].includes(me(e));
1002
- }
1003
- function Ie(e) {
1004
- return [":popover-open", ":modal"].some((o) => {
1005
- try {
1006
- return e.matches(o);
1007
- } catch {
1008
- return !1;
1009
- }
1010
- });
1011
- }
1012
- function qe(e) {
1013
- const o = Xe(), t = H(e) ? U(e) : e;
1014
- return t.transform !== "none" || t.perspective !== "none" || (t.containerType ? t.containerType !== "normal" : !1) || !o && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !o && (t.filter ? t.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (t.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (t.contain || "").includes(n));
1015
- }
1016
- function hn(e) {
1017
- let o = oe(e);
1018
- for (; J(o) && !he(o); ) {
1019
- if (qe(o))
1020
- return o;
1021
- if (Ie(o))
1022
- return null;
1023
- o = oe(o);
1024
- }
1025
- return null;
1026
- }
1027
- function Xe() {
1028
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1029
- }
1030
- function he(e) {
1031
- return ["html", "body", "#document"].includes(me(e));
1032
- }
1033
- function U(e) {
1034
- return V(e).getComputedStyle(e);
1035
- }
1036
- function Pe(e) {
1037
- return H(e) ? {
1038
- scrollLeft: e.scrollLeft,
1039
- scrollTop: e.scrollTop
1040
- } : {
1041
- scrollLeft: e.scrollX,
1042
- scrollTop: e.scrollY
1043
- };
1044
- }
1045
- function oe(e) {
1046
- if (me(e) === "html")
1047
- return e;
1048
- const o = (
1049
- // Step into the shadow DOM of the parent of a slotted node.
1050
- e.assignedSlot || // DOM Element detected.
1051
- e.parentNode || // ShadowRoot detected.
1052
- gt(e) && e.host || // Fallback.
1053
- G(e)
1054
- );
1055
- return gt(o) ? o.host : o;
1056
- }
1057
- function At(e) {
1058
- const o = oe(e);
1059
- return he(o) ? e.ownerDocument ? e.ownerDocument.body : e.body : J(o) && we(o) ? o : At(o);
1060
- }
1061
- function be(e, o, t) {
1062
- var n;
1063
- o === void 0 && (o = []), t === void 0 && (t = !0);
1064
- const r = At(e), s = r === ((n = e.ownerDocument) == null ? void 0 : n.body), l = V(r);
1065
- if (s) {
1066
- const c = Ue(l);
1067
- return o.concat(l, l.visualViewport || [], we(r) ? r : [], c && t ? be(c) : []);
1068
- }
1069
- return o.concat(r, be(r, [], t));
1070
- }
1071
- function Ue(e) {
1072
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1073
- }
1074
- function _t(e) {
1075
- const o = U(e);
1076
- let t = parseFloat(o.width) || 0, n = parseFloat(o.height) || 0;
1077
- const r = J(e), s = r ? e.offsetWidth : t, l = r ? e.offsetHeight : n, c = Te(t) !== s || Te(n) !== l;
1078
- return c && (t = s, n = l), {
1079
- width: t,
1080
- height: n,
1081
- $: c
1082
- };
1083
- }
1084
- function Je(e) {
1085
- return H(e) ? e : e.contextElement;
1086
- }
1087
- function fe(e) {
1088
- const o = Je(e);
1089
- if (!J(o))
1090
- return X(1);
1091
- const t = o.getBoundingClientRect(), {
1092
- width: n,
1093
- height: r,
1094
- $: s
1095
- } = _t(o);
1096
- let l = (s ? Te(t.width) : t.width) / n, c = (s ? Te(t.height) : t.height) / r;
1097
- return (!l || !Number.isFinite(l)) && (l = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1098
- x: l,
1099
- y: c
1100
- };
1101
- }
1102
- const mn = /* @__PURE__ */ X(0);
1103
- function jt(e) {
1104
- const o = V(e);
1105
- return !Xe() || !o.visualViewport ? mn : {
1106
- x: o.visualViewport.offsetLeft,
1107
- y: o.visualViewport.offsetTop
1108
- };
1109
- }
1110
- function gn(e, o, t) {
1111
- return o === void 0 && (o = !1), !t || o && t !== V(e) ? !1 : o;
1112
- }
1113
- function ce(e, o, t, n) {
1114
- o === void 0 && (o = !1), t === void 0 && (t = !1);
1115
- const r = e.getBoundingClientRect(), s = Je(e);
1116
- let l = X(1);
1117
- o && (n ? H(n) && (l = fe(n)) : l = fe(e));
1118
- const c = gn(s, t, n) ? jt(s) : X(0);
1119
- let a = (r.left + c.x) / l.x, u = (r.top + c.y) / l.y, f = r.width / l.x, d = r.height / l.y;
1120
- if (s) {
1121
- const p = V(s), m = n && H(n) ? V(n) : n;
1122
- let h = p, b = Ue(h);
1123
- for (; b && n && m !== h; ) {
1124
- const y = fe(b), g = b.getBoundingClientRect(), w = U(b), O = g.left + (b.clientLeft + parseFloat(w.paddingLeft)) * y.x, R = g.top + (b.clientTop + parseFloat(w.paddingTop)) * y.y;
1125
- a *= y.x, u *= y.y, f *= y.x, d *= y.y, a += O, u += R, h = V(b), b = Ue(h);
1126
- }
1127
- }
1128
- return Ae({
1129
- width: f,
1130
- height: d,
1131
- x: a,
1132
- y: u
1133
- });
1134
- }
1135
- function Ge(e, o) {
1136
- const t = Pe(e).scrollLeft;
1137
- return o ? o.left + t : ce(G(e)).left + t;
1138
- }
1139
- function Mt(e, o, t) {
1140
- t === void 0 && (t = !1);
1141
- const n = e.getBoundingClientRect(), r = n.left + o.scrollLeft - (t ? 0 : (
1142
- // RTL <body> scrollbar.
1143
- Ge(e, n)
1144
- )), s = n.top + o.scrollTop;
1145
- return {
1146
- x: r,
1147
- y: s
1148
- };
1149
- }
1150
- function pn(e) {
1151
- let {
1152
- elements: o,
1153
- rect: t,
1154
- offsetParent: n,
1155
- strategy: r
1156
- } = e;
1157
- const s = r === "fixed", l = G(n), c = o ? Ie(o.floating) : !1;
1158
- if (n === l || c && s)
1159
- return t;
1160
- let a = {
1161
- scrollLeft: 0,
1162
- scrollTop: 0
1163
- }, u = X(1);
1164
- const f = X(0), d = J(n);
1165
- if ((d || !d && !s) && ((me(n) !== "body" || we(l)) && (a = Pe(n)), J(n))) {
1166
- const m = ce(n);
1167
- u = fe(n), f.x = m.x + n.clientLeft, f.y = m.y + n.clientTop;
1168
- }
1169
- const p = l && !d && !s ? Mt(l, a, !0) : X(0);
1170
- return {
1171
- width: t.width * u.x,
1172
- height: t.height * u.y,
1173
- x: t.x * u.x - a.scrollLeft * u.x + f.x + p.x,
1174
- y: t.y * u.y - a.scrollTop * u.y + f.y + p.y
1175
- };
1176
- }
1177
- function xn(e) {
1178
- return Array.from(e.getClientRects());
1179
- }
1180
- function vn(e) {
1181
- const o = G(e), t = Pe(e), n = e.ownerDocument.body, r = ie(o.scrollWidth, o.clientWidth, n.scrollWidth, n.clientWidth), s = ie(o.scrollHeight, o.clientHeight, n.scrollHeight, n.clientHeight);
1182
- let l = -t.scrollLeft + Ge(e);
1183
- const c = -t.scrollTop;
1184
- return U(n).direction === "rtl" && (l += ie(o.clientWidth, n.clientWidth) - r), {
1185
- width: r,
1186
- height: s,
1187
- x: l,
1188
- y: c
1189
- };
1190
- }
1191
- function bn(e, o) {
1192
- const t = V(e), n = G(e), r = t.visualViewport;
1193
- let s = n.clientWidth, l = n.clientHeight, c = 0, a = 0;
1194
- if (r) {
1195
- s = r.width, l = r.height;
1196
- const u = Xe();
1197
- (!u || u && o === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
1198
- }
1199
- return {
1200
- width: s,
1201
- height: l,
1202
- x: c,
1203
- y: a
1204
- };
1205
- }
1206
- function wn(e, o) {
1207
- const t = ce(e, !0, o === "fixed"), n = t.top + e.clientTop, r = t.left + e.clientLeft, s = J(e) ? fe(e) : X(1), l = e.clientWidth * s.x, c = e.clientHeight * s.y, a = r * s.x, u = n * s.y;
1208
- return {
1209
- width: l,
1210
- height: c,
1211
- x: a,
1212
- y: u
1213
- };
1214
- }
1215
- function pt(e, o, t) {
1216
- let n;
1217
- if (o === "viewport")
1218
- n = bn(e, t);
1219
- else if (o === "document")
1220
- n = vn(G(e));
1221
- else if (H(o))
1222
- n = wn(o, t);
1223
- else {
1224
- const r = jt(e);
1225
- n = {
1226
- x: o.x - r.x,
1227
- y: o.y - r.y,
1228
- width: o.width,
1229
- height: o.height
1230
- };
1231
- }
1232
- return Ae(n);
1233
- }
1234
- function Nt(e, o) {
1235
- const t = oe(e);
1236
- return t === o || !H(t) || he(t) ? !1 : U(t).position === "fixed" || Nt(t, o);
1237
- }
1238
- function yn(e, o) {
1239
- const t = o.get(e);
1240
- if (t)
1241
- return t;
1242
- let n = be(e, [], !1).filter((c) => H(c) && me(c) !== "body"), r = null;
1243
- const s = U(e).position === "fixed";
1244
- let l = s ? oe(e) : e;
1245
- for (; H(l) && !he(l); ) {
1246
- const c = U(l), a = qe(l);
1247
- !a && c.position === "fixed" && (r = null), (s ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || we(l) && !a && Nt(e, l)) ? n = n.filter((f) => f !== l) : r = c, l = oe(l);
1248
- }
1249
- return o.set(e, n), n;
1250
- }
1251
- function En(e) {
1252
- let {
1253
- element: o,
1254
- boundary: t,
1255
- rootBoundary: n,
1256
- strategy: r
1257
- } = e;
1258
- const l = [...t === "clippingAncestors" ? Ie(o) ? [] : yn(o, this._c) : [].concat(t), n], c = l[0], a = l.reduce((u, f) => {
1259
- const d = pt(o, f, r);
1260
- return u.top = ie(d.top, u.top), u.right = Re(d.right, u.right), u.bottom = Re(d.bottom, u.bottom), u.left = ie(d.left, u.left), u;
1261
- }, pt(o, c, r));
1262
- return {
1263
- width: a.right - a.left,
1264
- height: a.bottom - a.top,
1265
- x: a.left,
1266
- y: a.top
1267
- };
1268
- }
1269
- function Cn(e) {
1270
- const {
1271
- width: o,
1272
- height: t
1273
- } = _t(e);
1274
- return {
1275
- width: o,
1276
- height: t
1277
- };
1278
- }
1279
- function Sn(e, o, t) {
1280
- const n = J(o), r = G(o), s = t === "fixed", l = ce(e, !0, s, o);
1281
- let c = {
1282
- scrollLeft: 0,
1283
- scrollTop: 0
1284
- };
1285
- const a = X(0);
1286
- if (n || !n && !s)
1287
- if ((me(o) !== "body" || we(r)) && (c = Pe(o)), n) {
1288
- const p = ce(o, !0, s, o);
1289
- a.x = p.x + o.clientLeft, a.y = p.y + o.clientTop;
1290
- } else r && (a.x = Ge(r));
1291
- const u = r && !n && !s ? Mt(r, c) : X(0), f = l.left + c.scrollLeft - a.x - u.x, d = l.top + c.scrollTop - a.y - u.y;
1292
- return {
1293
- x: f,
1294
- y: d,
1295
- width: l.width,
1296
- height: l.height
1297
- };
1298
- }
1299
- function Fe(e) {
1300
- return U(e).position === "static";
1301
- }
1302
- function xt(e, o) {
1303
- if (!J(e) || U(e).position === "fixed")
1304
- return null;
1305
- if (o)
1306
- return o(e);
1307
- let t = e.offsetParent;
1308
- return G(e) === t && (t = t.ownerDocument.body), t;
1309
- }
1310
- function zt(e, o) {
1311
- const t = V(e);
1312
- if (Ie(e))
1313
- return t;
1314
- if (!J(e)) {
1315
- let r = oe(e);
1316
- for (; r && !he(r); ) {
1317
- if (H(r) && !Fe(r))
1318
- return r;
1319
- r = oe(r);
1320
- }
1321
- return t;
1322
- }
1323
- let n = xt(e, o);
1324
- for (; n && dn(n) && Fe(n); )
1325
- n = xt(n, o);
1326
- return n && he(n) && Fe(n) && !qe(n) ? t : n || hn(e) || t;
1327
- }
1328
- const On = async function(e) {
1329
- const o = this.getOffsetParent || zt, t = this.getDimensions, n = await t(e.floating);
1330
- return {
1331
- reference: Sn(e.reference, await o(e.floating), e.strategy),
1332
- floating: {
1333
- x: 0,
1334
- y: 0,
1335
- width: n.width,
1336
- height: n.height
1337
- }
1338
- };
1339
- };
1340
- function Rn(e) {
1341
- return U(e).direction === "rtl";
1342
- }
1343
- const Tn = {
1344
- convertOffsetParentRelativeRectToViewportRelativeRect: pn,
1345
- getDocumentElement: G,
1346
- getClippingRect: En,
1347
- getOffsetParent: zt,
1348
- getElementRects: On,
1349
- getClientRects: xn,
1350
- getDimensions: Cn,
1351
- getScale: fe,
1352
- isElement: H,
1353
- isRTL: Rn
1354
- };
1355
- function kn(e, o) {
1356
- let t = null, n;
1357
- const r = G(e);
1358
- function s() {
1359
- var c;
1360
- clearTimeout(n), (c = t) == null || c.disconnect(), t = null;
1361
- }
1362
- function l(c, a) {
1363
- c === void 0 && (c = !1), a === void 0 && (a = 1), s();
1364
- const {
1365
- left: u,
1366
- top: f,
1367
- width: d,
1368
- height: p
1369
- } = e.getBoundingClientRect();
1370
- if (c || o(), !d || !p)
1371
- return;
1372
- const m = Ce(f), h = Ce(r.clientWidth - (u + d)), b = Ce(r.clientHeight - (f + p)), y = Ce(u), w = {
1373
- rootMargin: -m + "px " + -h + "px " + -b + "px " + -y + "px",
1374
- threshold: ie(0, Re(1, a)) || 1
1375
- };
1376
- let O = !0;
1377
- function R(S) {
1378
- const j = S[0].intersectionRatio;
1379
- if (j !== a) {
1380
- if (!O)
1381
- return l();
1382
- j ? l(!1, j) : n = setTimeout(() => {
1383
- l(!1, 1e-7);
1384
- }, 1e3);
1385
- }
1386
- O = !1;
1387
- }
1388
- try {
1389
- t = new IntersectionObserver(R, {
1390
- ...w,
1391
- // Handle <iframe>s
1392
- root: r.ownerDocument
1393
- });
1394
- } catch {
1395
- t = new IntersectionObserver(R, w);
1396
- }
1397
- t.observe(e);
1398
- }
1399
- return l(!0), s;
1400
- }
1401
- function An(e, o, t, n) {
1402
- n === void 0 && (n = {});
1403
- const {
1404
- ancestorScroll: r = !0,
1405
- ancestorResize: s = !0,
1406
- elementResize: l = typeof ResizeObserver == "function",
1407
- layoutShift: c = typeof IntersectionObserver == "function",
1408
- animationFrame: a = !1
1409
- } = n, u = Je(e), f = r || s ? [...u ? be(u) : [], ...be(o)] : [];
1410
- f.forEach((g) => {
1411
- r && g.addEventListener("scroll", t, {
1412
- passive: !0
1413
- }), s && g.addEventListener("resize", t);
1414
- });
1415
- const d = u && c ? kn(u, t) : null;
1416
- let p = -1, m = null;
1417
- l && (m = new ResizeObserver((g) => {
1418
- let [w] = g;
1419
- w && w.target === u && m && (m.unobserve(o), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1420
- var O;
1421
- (O = m) == null || O.observe(o);
1422
- })), t();
1423
- }), u && !a && m.observe(u), m.observe(o));
1424
- let h, b = a ? ce(e) : null;
1425
- a && y();
1426
- function y() {
1427
- const g = ce(e);
1428
- b && (g.x !== b.x || g.y !== b.y || g.width !== b.width || g.height !== b.height) && t(), b = g, h = requestAnimationFrame(y);
1429
- }
1430
- return t(), () => {
1431
- var g;
1432
- f.forEach((w) => {
1433
- r && w.removeEventListener("scroll", t), s && w.removeEventListener("resize", t);
1434
- }), d == null || d(), (g = m) == null || g.disconnect(), m = null, a && cancelAnimationFrame(h);
1435
- };
1436
- }
1437
- const _n = un, jn = fn, Mn = cn, Nn = (e, o, t) => {
1438
- const n = /* @__PURE__ */ new Map(), r = {
1439
- platform: Tn,
1440
- ...t
1441
- }, s = {
1442
- ...r.platform,
1443
- _c: n
1444
- };
1445
- return ln(e, o, {
1446
- ...r,
1447
- platform: s
1448
- });
1449
- };
1450
- var Se = typeof document < "u" ? Ft : Oe;
1451
- function _e(e, o) {
1452
- if (e === o)
1453
- return !0;
1454
- if (typeof e != typeof o)
1455
- return !1;
1456
- if (typeof e == "function" && e.toString() === o.toString())
1457
- return !0;
1458
- let t, n, r;
1459
- if (e && o && typeof e == "object") {
1460
- if (Array.isArray(e)) {
1461
- if (t = e.length, t !== o.length) return !1;
1462
- for (n = t; n-- !== 0; )
1463
- if (!_e(e[n], o[n]))
1464
- return !1;
1465
- return !0;
1466
- }
1467
- if (r = Object.keys(e), t = r.length, t !== Object.keys(o).length)
1468
- return !1;
1469
- for (n = t; n-- !== 0; )
1470
- if (!{}.hasOwnProperty.call(o, r[n]))
1471
- return !1;
1472
- for (n = t; n-- !== 0; ) {
1473
- const s = r[n];
1474
- if (!(s === "_owner" && e.$$typeof) && !_e(e[s], o[s]))
1475
- return !1;
1476
- }
1477
- return !0;
1478
- }
1479
- return e !== e && o !== o;
1480
- }
1481
- function It(e) {
1482
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1483
- }
1484
- function vt(e, o) {
1485
- const t = It(e);
1486
- return Math.round(o * t) / t;
1487
- }
1488
- function $e(e) {
1489
- const o = M.useRef(e);
1490
- return Se(() => {
1491
- o.current = e;
1492
- }), o;
1493
- }
1494
- function zn(e) {
1495
- e === void 0 && (e = {});
1496
- const {
1497
- placement: o = "bottom",
1498
- strategy: t = "absolute",
1499
- middleware: n = [],
1500
- platform: r,
1501
- elements: {
1502
- reference: s,
1503
- floating: l
1504
- } = {},
1505
- transform: c = !0,
1506
- whileElementsMounted: a,
1507
- open: u
1508
- } = e, [f, d] = M.useState({
1509
- x: 0,
1510
- y: 0,
1511
- strategy: t,
1512
- placement: o,
1513
- middlewareData: {},
1514
- isPositioned: !1
1515
- }), [p, m] = M.useState(n);
1516
- _e(p, n) || m(n);
1517
- const [h, b] = M.useState(null), [y, g] = M.useState(null), w = M.useCallback((k) => {
1518
- k !== j.current && (j.current = k, b(k));
1519
- }, []), O = M.useCallback((k) => {
1520
- k !== D.current && (D.current = k, g(k));
1521
- }, []), R = s || h, S = l || y, j = M.useRef(null), D = M.useRef(null), W = M.useRef(f), K = a != null, F = $e(a), q = $e(r), Z = $e(u), $ = M.useCallback(() => {
1522
- if (!j.current || !D.current)
1523
- return;
1524
- const k = {
1525
- placement: o,
1526
- strategy: t,
1527
- middleware: p
1528
- };
1529
- q.current && (k.platform = q.current), Nn(j.current, D.current, k).then((_) => {
1530
- const Y = {
1531
- ..._,
1532
- // The floating element's position may be recomputed while it's closed
1533
- // but still mounted (such as when transitioning out). To ensure
1534
- // `isPositioned` will be `false` initially on the next open, avoid
1535
- // setting it to `true` when `open === false` (must be specified).
1536
- isPositioned: Z.current !== !1
1537
- };
1538
- z.current && !_e(W.current, Y) && (W.current = Y, Bt.flushSync(() => {
1539
- d(Y);
1540
- }));
1541
- });
1542
- }, [p, o, t, q, Z]);
1543
- Se(() => {
1544
- u === !1 && W.current.isPositioned && (W.current.isPositioned = !1, d((k) => ({
1545
- ...k,
1546
- isPositioned: !1
1547
- })));
1548
- }, [u]);
1549
- const z = M.useRef(!1);
1550
- Se(() => (z.current = !0, () => {
1551
- z.current = !1;
1552
- }), []), Se(() => {
1553
- if (R && (j.current = R), S && (D.current = S), R && S) {
1554
- if (F.current)
1555
- return F.current(R, S, $);
1556
- $();
1557
- }
1558
- }, [R, S, $, F, K]);
1559
- const Q = M.useMemo(() => ({
1560
- reference: j,
1561
- floating: D,
1562
- setReference: w,
1563
- setFloating: O
1564
- }), [w, O]), I = M.useMemo(() => ({
1565
- reference: R,
1566
- floating: S
1567
- }), [R, S]), B = M.useMemo(() => {
1568
- const k = {
1569
- position: t,
1570
- left: 0,
1571
- top: 0
1572
- };
1573
- if (!I.floating)
1574
- return k;
1575
- const _ = vt(I.floating, f.x), Y = vt(I.floating, f.y);
1576
- return c ? {
1577
- ...k,
1578
- transform: "translate(" + _ + "px, " + Y + "px)",
1579
- ...It(I.floating) >= 1.5 && {
1580
- willChange: "transform"
1581
- }
1582
- } : {
1583
- position: t,
1584
- left: _,
1585
- top: Y
1586
- };
1587
- }, [t, c, I.floating, f.x, f.y]);
1588
- return M.useMemo(() => ({
1589
- ...f,
1590
- update: $,
1591
- refs: Q,
1592
- elements: I,
1593
- floatingStyles: B
1594
- }), [f, $, Q, I, B]);
1595
- }
1596
- const In = (e, o) => ({
1597
- ..._n(e),
1598
- options: [e, o]
1599
- }), Pn = (e, o) => ({
1600
- ...jn(e),
1601
- options: [e, o]
1602
- }), Ln = (e, o) => ({
1603
- ...Mn(e),
1604
- options: [e, o]
1605
- });
1606
- function Dn(e, o) {
1607
- return () => {
1608
- if (typeof document > "u")
1609
- return;
1610
- const t = (n) => {
1611
- !e.current || e.current.contains(n.target) || o(!0);
1612
- };
1613
- return document.addEventListener("mousedown", t), () => {
1614
- document.removeEventListener("mousedown", t);
1615
- };
1616
- };
1617
- }
1618
- function Pt(e) {
1619
- const {
1620
- className: o,
1621
- placement: t = "bottom-start",
1622
- trigger: n = "hover",
1623
- content: r,
1624
- children: s,
1625
- onClose: l,
1626
- onOpen: c,
1627
- disabled: a = !1,
1628
- show: u = !1,
1629
- setShow: f,
1630
- role: d = "tooltip"
1631
- } = e, [p, m] = je(u), h = () => f !== void 0 && u !== void 0 ? u : p, b = () => f !== void 0 && u !== void 0 ? f : m, { x: y, y: g, strategy: w, refs: O } = zn({
1632
- open: h(),
1633
- middleware: [In(4), Ln(), Pn()],
1634
- whileElementsMounted: An,
1635
- placement: t
1636
- }), R = $t();
1637
- return Oe(
1638
- Dn(O.floating, (S) => {
1639
- S && b()(!1);
1640
- }),
1641
- []
1642
- ), /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
1643
- /* @__PURE__ */ E.jsx(
1644
- "div",
1645
- {
1646
- className: "z-auto block min-w-max",
1647
- id: `zen__popover-${R}`,
1648
- ref: O.setReference,
1649
- onClick: (S) => {
1650
- if (n === "click") {
1651
- if (a)
1652
- return;
1653
- h() ? (b()(!1), l == null || l()) : (b()(!0), c == null || c());
1654
- }
1655
- S.stopPropagation();
1656
- },
1657
- role: d,
1658
- children: s
1659
- }
1660
- ),
1661
- h() && Yt(
1662
- /* @__PURE__ */ E.jsx(
1663
- "div",
1664
- {
1665
- onClick: (S) => S.stopPropagation(),
1666
- role: "tooltip",
1667
- className: L(
1668
- "zen__popover z-50 w-fit rounded border border-border bg-background shadow-secondary",
1669
- o
1670
- ),
1671
- ref: O.setFloating,
1672
- style: {
1673
- position: w,
1674
- top: g ?? 0,
1675
- left: y ?? 0
1676
- },
1677
- children: r
1678
- }
1679
- ),
1680
- document.body
1681
- )
1682
- ] });
1683
- }
1684
- function Wn(e) {
1685
- var b, y;
1686
- const {
1687
- items: o = [],
1688
- children: t,
1689
- moreItemsLabel: n = "",
1690
- parentRef: r,
1691
- data: s,
1692
- estimator: l = (g, w) => w + 30,
1693
- font: c = "12px Inter",
1694
- badgeVariant: a = "secondary",
1695
- badgeStyles: u
1696
- } = e, [f, d] = je({
1697
- visible: o,
1698
- hidden: []
1699
- }), p = Ye(() => {
1700
- if (typeof document > "u")
1701
- return null;
1702
- const w = document.createElement("canvas").getContext("2d");
1703
- return w && (w.font = c), w;
1704
- }, []), m = () => {
1705
- const g = r == null ? void 0 : r.current;
1706
- if (!g)
1707
- return;
1708
- const w = g.offsetWidth, O = [], R = [], S = l(n, p.measureText(n).width + 10);
1709
- h == null || h.reduce((j, D, W) => (j + D + S > w - 20 ? R.push(o[W]) : O.push(o[W]), j + D), 0), d({
1710
- visible: O,
1711
- hidden: R
1712
- });
1713
- }, h = Ye(
1714
- () => (o == null ? void 0 : o.map((g) => l(g, p.measureText(g).width))) ?? [],
1715
- [o]
1716
- );
1717
- return Oe(() => {
1718
- m();
1719
- }, [o]), Oe(() => {
1720
- if (!(r != null && r.current)) return;
1721
- const g = new ResizeObserver(() => {
1722
- m();
1723
- });
1724
- return g.observe(r.current), () => {
1725
- g.disconnect();
1726
- };
1727
- }, [o]), /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
1728
- (b = f.visible) == null ? void 0 : b.map((g, w) => t(g, w, s == null ? void 0 : s[w])),
1729
- ((y = f.hidden) == null ? void 0 : y.length) > 0 && /* @__PURE__ */ E.jsx(
1730
- Pt,
1731
- {
1732
- trigger: "click",
1733
- content: /* @__PURE__ */ E.jsx("div", { className: "grid max-h-60 grid-flow-row grid-cols-2 gap-3 overflow-auto p-2", children: f.hidden.map(
1734
- (g, w) => t(
1735
- g,
1736
- f.visible.length + w,
1737
- s == null ? void 0 : s[f.visible.length + w]
1738
- )
1739
- ) }),
1740
- children: /* @__PURE__ */ E.jsx(Ct, { className: u, variant: a, children: /* @__PURE__ */ E.jsx("p", { children: `+${f.hidden.length} ${n}` }) }, "more_items_button")
1741
- }
1742
- )
1743
- ] });
1744
- }
1745
- function ue(e, o, t) {
1746
- let n = t.initialDeps ?? [], r;
1747
- return () => {
1748
- var s, l, c, a;
1749
- let u;
1750
- t.key && ((s = t.debug) != null && s.call(t)) && (u = Date.now());
1751
- const f = e();
1752
- if (!(f.length !== n.length || f.some((m, h) => n[h] !== m)))
1753
- return r;
1754
- n = f;
1755
- let p;
1756
- if (t.key && ((l = t.debug) != null && l.call(t)) && (p = Date.now()), r = o(...f), t.key && ((c = t.debug) != null && c.call(t))) {
1757
- const m = Math.round((Date.now() - u) * 100) / 100, h = Math.round((Date.now() - p) * 100) / 100, b = h / 16, y = (g, w) => {
1758
- for (g = String(g); g.length < w; )
1759
- g = " " + g;
1760
- return g;
1761
- };
1762
- console.info(
1763
- `%c⏱ ${y(h, 5)} /${y(m, 5)} ms`,
1764
- `
1765
- font-size: .6rem;
1766
- font-weight: bold;
1767
- color: hsl(${Math.max(
1768
- 0,
1769
- Math.min(120 - 120 * b, 120)
1770
- )}deg 100% 31%);`,
1771
- t == null ? void 0 : t.key
1772
- );
1773
- }
1774
- return (a = t == null ? void 0 : t.onChange) == null || a.call(t, r), r;
1775
- };
1776
- }
1777
- function Be(e, o) {
1778
- if (e === void 0)
1779
- throw new Error("Unexpected undefined");
1780
- return e;
1781
- }
1782
- const Vn = (e, o) => Math.abs(e - o) < 1, Fn = (e, o, t) => {
1783
- let n;
1784
- return function(...r) {
1785
- e.clearTimeout(n), n = e.setTimeout(() => o.apply(this, r), t);
1786
- };
1787
- }, $n = (e) => e, Bn = (e) => {
1788
- const o = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
1789
- for (let r = o; r <= t; r++)
1790
- n.push(r);
1791
- return n;
1792
- }, Yn = (e, o) => {
1793
- const t = e.scrollElement;
1794
- if (!t)
1795
- return;
1796
- const n = e.targetWindow;
1797
- if (!n)
1798
- return;
1799
- const r = (l) => {
1800
- const { width: c, height: a } = l;
1801
- o({ width: Math.round(c), height: Math.round(a) });
1802
- };
1803
- if (r(t.getBoundingClientRect()), !n.ResizeObserver)
1804
- return () => {
1805
- };
1806
- const s = new n.ResizeObserver((l) => {
1807
- const c = l[0];
1808
- if (c != null && c.borderBoxSize) {
1809
- const a = c.borderBoxSize[0];
1810
- if (a) {
1811
- r({ width: a.inlineSize, height: a.blockSize });
1812
- return;
1813
- }
1814
- }
1815
- r(t.getBoundingClientRect());
1816
- });
1817
- return s.observe(t, { box: "border-box" }), () => {
1818
- s.unobserve(t);
1819
- };
1820
- }, bt = {
1821
- passive: !0
1822
- }, Hn = typeof window > "u" ? !0 : "onscrollend" in window, Un = (e, o) => {
1823
- const t = e.scrollElement;
1824
- if (!t)
1825
- return;
1826
- const n = e.targetWindow;
1827
- if (!n)
1828
- return;
1829
- let r = 0;
1830
- const s = e.options.useScrollendEvent && Hn ? () => {
1831
- } : Fn(
1832
- n,
1833
- () => {
1834
- o(r, !1);
1835
- },
1836
- e.options.isScrollingResetDelay
1837
- ), l = (u) => () => {
1838
- const { horizontal: f, isRtl: d } = e.options;
1839
- r = f ? t.scrollLeft * (d && -1 || 1) : t.scrollTop, s(), o(r, u);
1840
- }, c = l(!0), a = l(!1);
1841
- return a(), t.addEventListener("scroll", c, bt), t.addEventListener("scrollend", a, bt), () => {
1842
- t.removeEventListener("scroll", c), t.removeEventListener("scrollend", a);
1843
- };
1844
- }, qn = (e, o, t) => {
1845
- if (o != null && o.borderBoxSize) {
1846
- const n = o.borderBoxSize[0];
1847
- if (n)
1848
- return Math.round(
1849
- n[t.options.horizontal ? "inlineSize" : "blockSize"]
1850
- );
1851
- }
1852
- return Math.round(
1853
- e.getBoundingClientRect()[t.options.horizontal ? "width" : "height"]
1854
- );
1855
- }, Xn = (e, {
1856
- adjustments: o = 0,
1857
- behavior: t
1858
- }, n) => {
1859
- var r, s;
1860
- const l = e + o;
1861
- (s = (r = n.scrollElement) == null ? void 0 : r.scrollTo) == null || s.call(r, {
1862
- [n.options.horizontal ? "left" : "top"]: l,
1863
- behavior: t
1864
- });
1865
- };
1866
- class Jn {
1867
- constructor(o) {
1868
- this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
1869
- let t = null;
1870
- const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((r) => {
1871
- r.forEach((s) => {
1872
- this._measureElement(s.target, s);
1873
- });
1874
- }));
1875
- return {
1876
- disconnect: () => {
1877
- var r;
1878
- (r = n()) == null || r.disconnect(), t = null;
1879
- },
1880
- observe: (r) => {
1881
- var s;
1882
- return (s = n()) == null ? void 0 : s.observe(r, { box: "border-box" });
1883
- },
1884
- unobserve: (r) => {
1885
- var s;
1886
- return (s = n()) == null ? void 0 : s.unobserve(r);
1887
- }
1888
- };
1889
- })(), this.range = null, this.setOptions = (t) => {
1890
- Object.entries(t).forEach(([n, r]) => {
1891
- typeof r > "u" && delete t[n];
1892
- }), this.options = {
1893
- debug: !1,
1894
- initialOffset: 0,
1895
- overscan: 1,
1896
- paddingStart: 0,
1897
- paddingEnd: 0,
1898
- scrollPaddingStart: 0,
1899
- scrollPaddingEnd: 0,
1900
- horizontal: !1,
1901
- getItemKey: $n,
1902
- rangeExtractor: Bn,
1903
- onChange: () => {
1904
- },
1905
- measureElement: qn,
1906
- initialRect: { width: 0, height: 0 },
1907
- scrollMargin: 0,
1908
- gap: 0,
1909
- indexAttribute: "data-index",
1910
- initialMeasurementsCache: [],
1911
- lanes: 1,
1912
- isScrollingResetDelay: 150,
1913
- enabled: !0,
1914
- isRtl: !1,
1915
- useScrollendEvent: !0,
1916
- ...t
1917
- };
1918
- }, this.notify = (t) => {
1919
- var n, r;
1920
- (r = (n = this.options).onChange) == null || r.call(n, this, t);
1921
- }, this.maybeNotify = ue(
1922
- () => (this.calculateRange(), [
1923
- this.isScrolling,
1924
- this.range ? this.range.startIndex : null,
1925
- this.range ? this.range.endIndex : null
1926
- ]),
1927
- (t) => {
1928
- this.notify(t);
1929
- },
1930
- {
1931
- key: process.env.NODE_ENV !== "production" && "maybeNotify",
1932
- debug: () => this.options.debug,
1933
- initialDeps: [
1934
- this.isScrolling,
1935
- this.range ? this.range.startIndex : null,
1936
- this.range ? this.range.endIndex : null
1937
- ]
1938
- }
1939
- ), this.cleanup = () => {
1940
- this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
1941
- }, this._didMount = () => () => {
1942
- this.cleanup();
1943
- }, this._willUpdate = () => {
1944
- var t;
1945
- const n = this.options.enabled ? this.options.getScrollElement() : null;
1946
- if (this.scrollElement !== n) {
1947
- if (this.cleanup(), !n) {
1948
- this.maybeNotify();
1949
- return;
1950
- }
1951
- this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((r) => {
1952
- this.observer.observe(r);
1953
- }), this._scrollToOffset(this.getScrollOffset(), {
1954
- adjustments: void 0,
1955
- behavior: void 0
1956
- }), this.unsubs.push(
1957
- this.options.observeElementRect(this, (r) => {
1958
- this.scrollRect = r, this.maybeNotify();
1959
- })
1960
- ), this.unsubs.push(
1961
- this.options.observeElementOffset(this, (r, s) => {
1962
- this.scrollAdjustments = 0, this.scrollDirection = s ? this.getScrollOffset() < r ? "forward" : "backward" : null, this.scrollOffset = r, this.isScrolling = s, this.maybeNotify();
1963
- })
1964
- );
1965
- }
1966
- }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
1967
- const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1968
- for (let l = n - 1; l >= 0; l--) {
1969
- const c = t[l];
1970
- if (r.has(c.lane))
1971
- continue;
1972
- const a = s.get(
1973
- c.lane
1974
- );
1975
- if (a == null || c.end > a.end ? s.set(c.lane, c) : c.end < a.end && r.set(c.lane, !0), r.size === this.options.lanes)
1976
- break;
1977
- }
1978
- return s.size === this.options.lanes ? Array.from(s.values()).sort((l, c) => l.end === c.end ? l.index - c.index : l.end - c.end)[0] : void 0;
1979
- }, this.getMeasurementOptions = ue(
1980
- () => [
1981
- this.options.count,
1982
- this.options.paddingStart,
1983
- this.options.scrollMargin,
1984
- this.options.getItemKey,
1985
- this.options.enabled
1986
- ],
1987
- (t, n, r, s, l) => (this.pendingMeasuredCacheIndexes = [], {
1988
- count: t,
1989
- paddingStart: n,
1990
- scrollMargin: r,
1991
- getItemKey: s,
1992
- enabled: l
1993
- }),
1994
- {
1995
- key: !1
1996
- }
1997
- ), this.getMeasurements = ue(
1998
- () => [this.getMeasurementOptions(), this.itemSizeCache],
1999
- ({ count: t, paddingStart: n, scrollMargin: r, getItemKey: s, enabled: l }, c) => {
2000
- if (!l)
2001
- return this.measurementsCache = [], this.itemSizeCache.clear(), [];
2002
- this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((f) => {
2003
- this.itemSizeCache.set(f.key, f.size);
2004
- }));
2005
- const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
2006
- this.pendingMeasuredCacheIndexes = [];
2007
- const u = this.measurementsCache.slice(0, a);
2008
- for (let f = a; f < t; f++) {
2009
- const d = s(f), p = this.options.lanes === 1 ? u[f - 1] : this.getFurthestMeasurement(u, f), m = p ? p.end + this.options.gap : n + r, h = c.get(d), b = typeof h == "number" ? h : this.options.estimateSize(f), y = m + b, g = p ? p.lane : f % this.options.lanes;
2010
- u[f] = {
2011
- index: f,
2012
- start: m,
2013
- size: b,
2014
- end: y,
2015
- key: d,
2016
- lane: g
2017
- };
2018
- }
2019
- return this.measurementsCache = u, u;
2020
- },
2021
- {
2022
- key: process.env.NODE_ENV !== "production" && "getMeasurements",
2023
- debug: () => this.options.debug
2024
- }
2025
- ), this.calculateRange = ue(
2026
- () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
2027
- (t, n, r) => this.range = t.length > 0 && n > 0 ? Gn({
2028
- measurements: t,
2029
- outerSize: n,
2030
- scrollOffset: r
2031
- }) : null,
2032
- {
2033
- key: process.env.NODE_ENV !== "production" && "calculateRange",
2034
- debug: () => this.options.debug
2035
- }
2036
- ), this.getIndexes = ue(
2037
- () => [
2038
- this.options.rangeExtractor,
2039
- this.calculateRange(),
2040
- this.options.overscan,
2041
- this.options.count
2042
- ],
2043
- (t, n, r, s) => n === null ? [] : t({
2044
- startIndex: n.startIndex,
2045
- endIndex: n.endIndex,
2046
- overscan: r,
2047
- count: s
2048
- }),
2049
- {
2050
- key: process.env.NODE_ENV !== "production" && "getIndexes",
2051
- debug: () => this.options.debug
2052
- }
2053
- ), this.indexFromElement = (t) => {
2054
- const n = this.options.indexAttribute, r = t.getAttribute(n);
2055
- return r ? parseInt(r, 10) : (console.warn(
2056
- `Missing attribute name '${n}={index}' on measured element.`
2057
- ), -1);
2058
- }, this._measureElement = (t, n) => {
2059
- const r = this.indexFromElement(t), s = this.measurementsCache[r];
2060
- if (!s)
2061
- return;
2062
- const l = s.key, c = this.elementsCache.get(l);
2063
- c !== t && (c && this.observer.unobserve(c), this.observer.observe(t), this.elementsCache.set(l, t)), t.isConnected && this.resizeItem(r, this.options.measureElement(t, n, this));
2064
- }, this.resizeItem = (t, n) => {
2065
- const r = this.measurementsCache[t];
2066
- if (!r)
2067
- return;
2068
- const s = this.itemSizeCache.get(r.key) ?? r.size, l = n - s;
2069
- l !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(r, l, this) : r.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", l), this._scrollToOffset(this.getScrollOffset(), {
2070
- adjustments: this.scrollAdjustments += l,
2071
- behavior: void 0
2072
- })), this.pendingMeasuredCacheIndexes.push(r.index), this.itemSizeCache = new Map(this.itemSizeCache.set(r.key, n)), this.notify(!1));
2073
- }, this.measureElement = (t) => {
2074
- if (!t) {
2075
- this.elementsCache.forEach((n, r) => {
2076
- n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(r));
2077
- });
2078
- return;
2079
- }
2080
- this._measureElement(t, void 0);
2081
- }, this.getVirtualItems = ue(
2082
- () => [this.getIndexes(), this.getMeasurements()],
2083
- (t, n) => {
2084
- const r = [];
2085
- for (let s = 0, l = t.length; s < l; s++) {
2086
- const c = t[s], a = n[c];
2087
- r.push(a);
2088
- }
2089
- return r;
2090
- },
2091
- {
2092
- key: process.env.NODE_ENV !== "production" && "getVirtualItems",
2093
- debug: () => this.options.debug
2094
- }
2095
- ), this.getVirtualItemForOffset = (t) => {
2096
- const n = this.getMeasurements();
2097
- if (n.length !== 0)
2098
- return Be(
2099
- n[Lt(
2100
- 0,
2101
- n.length - 1,
2102
- (r) => Be(n[r]).start,
2103
- t
2104
- )]
2105
- );
2106
- }, this.getOffsetForAlignment = (t, n) => {
2107
- const r = this.getSize(), s = this.getScrollOffset();
2108
- n === "auto" && (t <= s ? n = "start" : t >= s + r ? n = "end" : n = "start"), n === "start" ? t = t : n === "end" ? t = t - r : n === "center" && (t = t - r / 2);
2109
- const l = this.options.horizontal ? "scrollWidth" : "scrollHeight", a = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[l] : this.scrollElement[l] : 0) - r;
2110
- return Math.max(Math.min(a, t), 0);
2111
- }, this.getOffsetForIndex = (t, n = "auto") => {
2112
- t = Math.max(0, Math.min(t, this.options.count - 1));
2113
- const r = this.measurementsCache[t];
2114
- if (!r)
2115
- return;
2116
- const s = this.getSize(), l = this.getScrollOffset();
2117
- if (n === "auto")
2118
- if (r.end >= l + s - this.options.scrollPaddingEnd)
2119
- n = "end";
2120
- else if (r.start <= l + this.options.scrollPaddingStart)
2121
- n = "start";
2122
- else
2123
- return [l, n];
2124
- const c = n === "end" ? r.end + this.options.scrollPaddingEnd : r.start - this.options.scrollPaddingStart;
2125
- return [this.getOffsetForAlignment(c, n), n];
2126
- }, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
2127
- this.scrollToIndexTimeoutId !== null && this.targetWindow && (this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId), this.scrollToIndexTimeoutId = null);
2128
- }, this.scrollToOffset = (t, { align: n = "start", behavior: r } = {}) => {
2129
- this.cancelScrollToIndex(), r === "smooth" && this.isDynamicMode() && console.warn(
2130
- "The `smooth` scroll behavior is not fully supported with dynamic size."
2131
- ), this._scrollToOffset(this.getOffsetForAlignment(t, n), {
2132
- adjustments: void 0,
2133
- behavior: r
2134
- });
2135
- }, this.scrollToIndex = (t, { align: n = "auto", behavior: r } = {}) => {
2136
- t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), r === "smooth" && this.isDynamicMode() && console.warn(
2137
- "The `smooth` scroll behavior is not fully supported with dynamic size."
2138
- );
2139
- const s = this.getOffsetForIndex(t, n);
2140
- if (!s) return;
2141
- const [l, c] = s;
2142
- this._scrollToOffset(l, { adjustments: void 0, behavior: r }), r !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
2143
- if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
2144
- this.options.getItemKey(t)
2145
- )) {
2146
- const [u] = Be(
2147
- this.getOffsetForIndex(t, c)
2148
- );
2149
- Vn(u, this.getScrollOffset()) || this.scrollToIndex(t, { align: c, behavior: r });
2150
- } else
2151
- this.scrollToIndex(t, { align: c, behavior: r });
2152
- }));
2153
- }, this.scrollBy = (t, { behavior: n } = {}) => {
2154
- this.cancelScrollToIndex(), n === "smooth" && this.isDynamicMode() && console.warn(
2155
- "The `smooth` scroll behavior is not fully supported with dynamic size."
2156
- ), this._scrollToOffset(this.getScrollOffset() + t, {
2157
- adjustments: void 0,
2158
- behavior: n
2159
- });
2160
- }, this.getTotalSize = () => {
2161
- var t;
2162
- const n = this.getMeasurements();
2163
- let r;
2164
- return n.length === 0 ? r = this.options.paddingStart : r = this.options.lanes === 1 ? ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0 : Math.max(
2165
- ...n.slice(-this.options.lanes).map((s) => s.end)
2166
- ), Math.max(
2167
- r - this.options.scrollMargin + this.options.paddingEnd,
2168
- 0
2169
- );
2170
- }, this._scrollToOffset = (t, {
2171
- adjustments: n,
2172
- behavior: r
2173
- }) => {
2174
- this.options.scrollToFn(t, { behavior: r, adjustments: n }, this);
2175
- }, this.measure = () => {
2176
- this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
2177
- }, this.setOptions(o);
2178
- }
2179
- }
2180
- const Lt = (e, o, t, n) => {
2181
- for (; e <= o; ) {
2182
- const r = (e + o) / 2 | 0, s = t(r);
2183
- if (s < n)
2184
- e = r + 1;
2185
- else if (s > n)
2186
- o = r - 1;
2187
- else
2188
- return r;
2189
- }
2190
- return e > 0 ? e - 1 : 0;
2191
- };
2192
- function Gn({
2193
- measurements: e,
2194
- outerSize: o,
2195
- scrollOffset: t
2196
- }) {
2197
- const n = e.length - 1, s = Lt(0, n, (c) => e[c].start, t);
2198
- let l = s;
2199
- for (; l < n && e[l].end < t + o; )
2200
- l++;
2201
- return { startIndex: s, endIndex: l };
2202
- }
2203
- const wt = typeof document < "u" ? M.useLayoutEffect : M.useEffect;
2204
- function Kn(e) {
2205
- const o = M.useReducer(() => ({}), {})[1], t = {
2206
- ...e,
2207
- onChange: (r, s) => {
2208
- var l;
2209
- s ? Ht(o) : o(), (l = e.onChange) == null || l.call(e, r, s);
2210
- }
2211
- }, [n] = M.useState(
2212
- () => new Jn(t)
2213
- );
2214
- return n.setOptions(t), wt(() => n._didMount(), []), wt(() => n._willUpdate()), n;
2215
- }
2216
- function Zn(e) {
2217
- return Kn({
2218
- observeElementRect: Yn,
2219
- observeElementOffset: Un,
2220
- scrollToFn: Xn,
2221
- ...e
2222
- });
2223
- }
2224
- function Qn(e) {
2225
- return /* @__PURE__ */ E.jsx(
2226
- "svg",
2227
- {
2228
- xmlns: "http://www.w3.org/2000/svg",
2229
- fill: "none",
2230
- viewBox: "0 0 24 24",
2231
- strokeWidth: 1.5,
2232
- stroke: "currentColor",
2233
- className: "h-6 w-6",
2234
- ...e,
2235
- children: /* @__PURE__ */ E.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m19.5 8.25-7.5 7.5-7.5-7.5" })
2236
- }
2237
- );
2238
- }
2239
- function eo(e) {
2240
- return /* @__PURE__ */ E.jsx(
2241
- "svg",
2242
- {
2243
- xmlns: "http://www.w3.org/2000/svg",
2244
- fill: "none",
2245
- viewBox: "0 0 24 24",
2246
- strokeWidth: 1.5,
2247
- stroke: "currentColor",
2248
- className: "h-6 w-6",
2249
- ...e,
2250
- children: /* @__PURE__ */ E.jsx(
2251
- "path",
2252
- {
2253
- strokeLinecap: "round",
2254
- strokeLinejoin: "round",
2255
- d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
2256
- }
2257
- )
2258
- }
2259
- );
2260
- }
2261
- function to(e) {
2262
- return /* @__PURE__ */ E.jsx(
2263
- "svg",
2264
- {
2265
- xmlns: "http://www.w3.org/2000/svg",
2266
- fill: "none",
2267
- viewBox: "0 0 24 24",
2268
- strokeWidth: 1.5,
2269
- stroke: "currentColor",
2270
- className: "h-6 w-6",
2271
- ...e,
2272
- children: /* @__PURE__ */ E.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18 18 6M6 6l12 12" })
2273
- }
2274
- );
2275
- }
2276
- function so(e) {
2277
- const {
2278
- items: o,
2279
- selected: t,
2280
- className: n,
2281
- onChange: r,
2282
- disabled: s,
2283
- placeholder: l = "Select an Item",
2284
- multiple: c,
2285
- width: a = "215px",
2286
- height: u = "40px",
2287
- mutable: f,
2288
- onAdd: d
2289
- } = e, p = yt(null), [m, h] = je(!1);
2290
- return /* @__PURE__ */ E.jsx(
2291
- Pt,
2292
- {
2293
- placement: "bottom",
2294
- trigger: "click",
2295
- show: m,
2296
- setShow: h,
2297
- role: "combobox",
2298
- disabled: s,
2299
- content: /* @__PURE__ */ E.jsx(
2300
- no,
2301
- {
2302
- ...f ? { mutable: f, onAdd: d } : { mutable: f },
2303
- ...c ? { multiple: c, items: o, onChange: r, selected: t } : { items: o, onChange: r, selected: t },
2304
- width: a
2305
- }
2306
- ),
2307
- children: /* @__PURE__ */ E.jsxs(
2308
- "div",
2309
- {
2310
- style: { width: a, height: u },
2311
- className: L(
2312
- "inline-flex grow items-center justify-between rounded border-2 border-input bg-background p-2 transition",
2313
- s ? "cursor-not-allowed bg-muted text-muted" : "cursor-pointer",
2314
- m && "border-primary shadow-sm shadow-ring",
2315
- n
2316
- ),
2317
- children: [
2318
- /* @__PURE__ */ E.jsx(
2319
- "div",
2320
- {
2321
- className: L(
2322
- "flex max-w-[calc(100%-30px)] flex-none grow items-center gap-1 text-sm",
2323
- s ? "text-muted-foreground" : "text-foreground"
2324
- ),
2325
- ref: p,
2326
- children: c ? /* @__PURE__ */ E.jsx(
2327
- Wn,
2328
- {
2329
- items: t.map((b) => b.text),
2330
- data: t,
2331
- parentRef: p,
2332
- badgeVariant: "secondary",
2333
- badgeStyles: "!bg-input h-6 min-w-min gap-2 !bg-input",
2334
- children: (b, y, g) => /* @__PURE__ */ E.jsxs(
2335
- Ct,
2336
- {
2337
- className: "flex h-6 min-w-min gap-2 !bg-input pr-1",
2338
- variant: "secondary",
2339
- children: [
2340
- b,
2341
- /* @__PURE__ */ E.jsx(
2342
- Gt,
2343
- {
2344
- onClick: () => {
2345
- r(t.filter((w) => w.key !== (g == null ? void 0 : g.key)));
2346
- },
2347
- variant: "icon",
2348
- size: "icon",
2349
- className: "group bg-muted p-0.5 hover:bg-muted-foreground",
2350
- children: /* @__PURE__ */ E.jsx(to, { className: "size-3 transition duration-300 group-hover:rotate-90 group-hover:text-muted" })
2351
- }
2352
- )
2353
- ]
2354
- },
2355
- `collapsed_item_${y}`
2356
- )
2357
- }
2358
- ) : t.text ?? l
2359
- }
2360
- ),
2361
- /* @__PURE__ */ E.jsx(
2362
- Qn,
2363
- {
2364
- className: L(
2365
- "size-4 rounded-full bg-input p-0.5 transition duration-300 ease-in-out",
2366
- m ? "rotate-180" : "rotate-0",
2367
- s ? "text-muted-foreground" : "text-foreground"
2368
- )
2369
- }
2370
- )
2371
- ]
2372
- }
2373
- )
2374
- }
2375
- );
2376
- }
2377
- function no(e) {
2378
- const { items: o, multiple: t, selected: n, onChange: r, width: s, mutable: l, onAdd: c } = e, [a, u] = je(""), f = yt(null), d = Ye(
2379
- () => o.reduce((h, b) => ((!a.length || b.text.toLowerCase().includes(a.toLowerCase())) && h.push(b), h), []),
2380
- [o, a]
2381
- ), p = Zn({
2382
- count: d.length,
2383
- getScrollElement: () => f.current,
2384
- estimateSize: () => 35
2385
- }), m = n instanceof Array ? n.map((h) => h.key) : [n.key];
2386
- return /* @__PURE__ */ E.jsxs(
2387
- "div",
2388
- {
2389
- className: "flex flex-col divide-y-2 divide-border overflow-hidden rounded border border-input bg-background",
2390
- style: { width: s },
2391
- children: [
2392
- /* @__PURE__ */ E.jsxs("div", { className: L("inline-flex grow items-center rounded px-3 py-2"), children: [
2393
- /* @__PURE__ */ E.jsx(eo, { className: "left-3 top-3 mr-2 size-4 text-muted-foreground" }),
2394
- /* @__PURE__ */ E.jsx(
2395
- "input",
2396
- {
2397
- className: "inline-flex grow bg-transparent text-sm text-foreground outline-none",
2398
- placeholder: "Search",
2399
- value: a,
2400
- onChange: (h) => u(h.target.value)
2401
- }
2402
- )
2403
- ] }),
2404
- /* @__PURE__ */ E.jsxs(
2405
- "ul",
2406
- {
2407
- className: L("max-h-60 grow overflow-auto shadow", "focus:outline-none focus:ring-0"),
2408
- ref: f,
2409
- children: [
2410
- /* @__PURE__ */ E.jsx(
2411
- "div",
2412
- {
2413
- style: {
2414
- height: `${p.getTotalSize()}px`,
2415
- width: "100%",
2416
- position: "relative"
2417
- },
2418
- children: p.getVirtualItems().map((h) => /* @__PURE__ */ E.jsx(
2419
- "li",
2420
- {
2421
- style: {
2422
- height: `${h.size}px`,
2423
- transform: `translateY(${h.start}px)`
2424
- },
2425
- className: L(
2426
- "absolute left-0 top-0 w-full cursor-pointer px-3 py-2 text-sm text-foreground",
2427
- m.includes(d[h.index].key) ? "bg-primary/90 text-primary-foreground" : "transition hover:bg-primary/60"
2428
- ),
2429
- onClick: () => {
2430
- t ? m.includes(d[h.index].key) ? r(
2431
- structuredClone(
2432
- n.filter(
2433
- (b) => b.key !== d[h.index].key
2434
- )
2435
- )
2436
- ) : r(structuredClone([...n, d[h.index]])) : r(d[h.index]);
2437
- },
2438
- children: d[h.index].text
2439
- },
2440
- h.key
2441
- ))
2442
- }
2443
- ),
2444
- a.length > 0 && d.length === 0 && (l ? /* @__PURE__ */ E.jsxs(
2445
- "li",
2446
- {
2447
- className: L("px-3 py-2 text-sm text-foreground"),
2448
- onClick: () => {
2449
- c({ text: a, key: a }), u("");
2450
- },
2451
- children: [
2452
- "Add ",
2453
- a
2454
- ]
2455
- }
2456
- ) : /* @__PURE__ */ E.jsx("li", { className: L("cursor-not-allowed px-3 py-2 text-sm text-foreground"), children: "No results found" }))
2457
- ]
2458
- }
2459
- )
2460
- ]
2461
- }
2462
- );
2463
- }
2464
- function io(e) {
2465
- return /* @__PURE__ */ E.jsx(
2466
- "svg",
2467
- {
2468
- xmlns: "http://www.w3.org/2000/svg",
2469
- fill: "none",
2470
- viewBox: "0 0 24 24",
2471
- strokeWidth: 1.5,
2472
- stroke: "currentColor",
2473
- className: "h-6 w-6",
2474
- ...e,
2475
- children: /* @__PURE__ */ E.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 15.75 7.5-7.5 7.5 7.5" })
2476
- }
2477
- );
2478
- }
2479
- function lo(e) {
2480
- const { className: o, ...t } = e;
2481
- return /* @__PURE__ */ E.jsx(
2482
- "input",
2483
- {
2484
- className: L(
2485
- "h-10 w-full rounded border-2 border-input bg-background px-3 py-2 text-sm text-foreground transition",
2486
- "focus-visible:border-primary focus-visible:shadow-sm focus-visible:shadow-ring focus-visible:outline-none",
2487
- "read-only:cursor-pointer read-only:!border-none read-only:bg-transparent read-only:text-foreground read-only:!shadow-none read-only:!outline-none",
2488
- "disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted",
2489
- "file:border-0 file:bg-transparent file:text-sm file:font-medium",
2490
- o
2491
- ),
2492
- ...t
2493
- }
2494
- );
2495
- }
2496
- function co(e) {
2497
- const { className: o, checked: t, onChange: n, defaultChecked: r, ...s } = e;
2498
- return /* @__PURE__ */ E.jsxs(
2499
- "div",
2500
- {
2501
- className: L(
2502
- "rounded-full",
2503
- "h-5 w-10",
2504
- "border border-muted bg-secondary",
2505
- "flex items-center",
2506
- o
2507
- ),
2508
- onClick: () => n == null ? void 0 : n(!t),
2509
- children: [
2510
- /* @__PURE__ */ E.jsx("input", { type: "hidden", readOnly: !0, ...s, defaultChecked: r, checked: t }),
2511
- /* @__PURE__ */ E.jsx(
2512
- "div",
2513
- {
2514
- className: L(
2515
- "[animation-timing-function:cubic-bezier(1, 0, 0, 1)] duration-250 h-4 w-4 rounded-full bg-primary transition-all",
2516
- t ? "translate-x-5" : "translate-x-1"
2517
- )
2518
- }
2519
- )
2520
- ]
2521
- }
2522
- );
2523
- }
2524
- export {
2525
- Ct as Badge,
2526
- Gt as Button,
2527
- io as ChevronDown,
2528
- Qn as ChevronUp,
2529
- Wn as Collapse,
2530
- so as Dropdown,
2531
- lo as Input,
2532
- Pt as Popover,
2533
- eo as Search,
2534
- co as Toggle,
2535
- Et as cva,
2536
- L as cx
2537
- };