@oneb/ui-vue 0.2.25 → 0.2.27

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.
@@ -1,1886 +0,0 @@
1
- import { d as mt, e as ht, _ as gt, r as vt, f as wt } from "./OneHelpMenu-1e8e1e45.js";
2
- import { defineComponent as ke, ref as V, watch as Ze, onBeforeUnmount as Qe, provide as yt, computed as P, openBlock as g, createElementBlock as w, createElementVNode as p, renderSlot as B, normalizeProps as me, guardReactiveProps as he, createBlock as ge, Teleport as xt, createCommentVNode as _, withDirectives as Se, normalizeClass as T, toDisplayString as L, vShow as bt, withCtx as ae, createVNode as _e, unref as q, normalizeStyle as ve, Fragment as I, renderList as J, onMounted as et, onUnmounted as kt, vModelText as je, mergeProps as fe, createTextVNode as We, nextTick as Le } from "vue";
3
- import { _ as tt } from "./_plugin-vue_export-helper-dad06003.js";
4
- import { _ as Ie } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
5
- const we = Math.min, Z = Math.max, ye = Math.round, pe = Math.floor, K = (e) => ({
6
- x: e,
7
- y: e
8
- }), Ct = {
9
- left: "right",
10
- right: "left",
11
- bottom: "top",
12
- top: "bottom"
13
- }, At = {
14
- start: "end",
15
- end: "start"
16
- };
17
- function Ke(e, t, n) {
18
- return Z(e, we(t, n));
19
- }
20
- function Ce(e, t) {
21
- return typeof e == "function" ? e(t) : e;
22
- }
23
- function Q(e) {
24
- return e.split("-")[0];
25
- }
26
- function Ae(e) {
27
- return e.split("-")[1];
28
- }
29
- function nt(e) {
30
- return e === "x" ? "y" : "x";
31
- }
32
- function ot(e) {
33
- return e === "y" ? "height" : "width";
34
- }
35
- function oe(e) {
36
- return ["top", "bottom"].includes(Q(e)) ? "y" : "x";
37
- }
38
- function st(e) {
39
- return nt(oe(e));
40
- }
41
- function Ot(e, t, n) {
42
- n === void 0 && (n = !1);
43
- const o = Ae(e), s = st(e), r = ot(s);
44
- let l = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
45
- return t.reference[r] > t.floating[r] && (l = xe(l)), [l, xe(l)];
46
- }
47
- function Rt(e) {
48
- const t = xe(e);
49
- return [Te(e), t, Te(t)];
50
- }
51
- function Te(e) {
52
- return e.replace(/start|end/g, (t) => At[t]);
53
- }
54
- function $t(e, t, n) {
55
- const o = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], l = ["bottom", "top"];
56
- switch (e) {
57
- case "top":
58
- case "bottom":
59
- return n ? t ? s : o : t ? o : s;
60
- case "left":
61
- case "right":
62
- return t ? r : l;
63
- default:
64
- return [];
65
- }
66
- }
67
- function Mt(e, t, n, o) {
68
- const s = Ae(e);
69
- let r = $t(Q(e), n === "start", o);
70
- return s && (r = r.map((l) => l + "-" + s), t && (r = r.concat(r.map(Te)))), r;
71
- }
72
- function xe(e) {
73
- return e.replace(/left|right|bottom|top/g, (t) => Ct[t]);
74
- }
75
- function _t(e) {
76
- return {
77
- top: 0,
78
- right: 0,
79
- bottom: 0,
80
- left: 0,
81
- ...e
82
- };
83
- }
84
- function Lt(e) {
85
- return typeof e != "number" ? _t(e) : {
86
- top: e,
87
- right: e,
88
- bottom: e,
89
- left: e
90
- };
91
- }
92
- function be(e) {
93
- const {
94
- x: t,
95
- y: n,
96
- width: o,
97
- height: s
98
- } = e;
99
- return {
100
- width: o,
101
- height: s,
102
- top: n,
103
- left: t,
104
- right: t + o,
105
- bottom: n + s,
106
- x: t,
107
- y: n
108
- };
109
- }
110
- function ze(e, t, n) {
111
- let {
112
- reference: o,
113
- floating: s
114
- } = e;
115
- const r = oe(t), l = st(t), i = ot(l), c = Q(t), u = r === "y", d = o.x + o.width / 2 - s.width / 2, h = o.y + o.height / 2 - s.height / 2, x = o[i] / 2 - s[i] / 2;
116
- let v;
117
- switch (c) {
118
- case "top":
119
- v = {
120
- x: d,
121
- y: o.y - s.height
122
- };
123
- break;
124
- case "bottom":
125
- v = {
126
- x: d,
127
- y: o.y + o.height
128
- };
129
- break;
130
- case "right":
131
- v = {
132
- x: o.x + o.width,
133
- y: h
134
- };
135
- break;
136
- case "left":
137
- v = {
138
- x: o.x - s.width,
139
- y: h
140
- };
141
- break;
142
- default:
143
- v = {
144
- x: o.x,
145
- y: o.y
146
- };
147
- }
148
- switch (Ae(t)) {
149
- case "start":
150
- v[l] -= x * (n && u ? -1 : 1);
151
- break;
152
- case "end":
153
- v[l] += x * (n && u ? -1 : 1);
154
- break;
155
- }
156
- return v;
157
- }
158
- const Et = async (e, t, n) => {
159
- const {
160
- placement: o = "bottom",
161
- strategy: s = "absolute",
162
- middleware: r = [],
163
- platform: l
164
- } = n, i = r.filter(Boolean), c = await (l.isRTL == null ? void 0 : l.isRTL(t));
165
- let u = await l.getElementRects({
166
- reference: e,
167
- floating: t,
168
- strategy: s
169
- }), {
170
- x: d,
171
- y: h
172
- } = ze(u, o, c), x = o, v = {}, f = 0;
173
- for (let b = 0; b < i.length; b++) {
174
- const {
175
- name: C,
176
- fn: O
177
- } = i[b], {
178
- x: A,
179
- y: $,
180
- data: R,
181
- reset: E
182
- } = await O({
183
- x: d,
184
- y: h,
185
- initialPlacement: o,
186
- placement: x,
187
- strategy: s,
188
- middlewareData: v,
189
- rects: u,
190
- platform: l,
191
- elements: {
192
- reference: e,
193
- floating: t
194
- }
195
- });
196
- d = A ?? d, h = $ ?? h, v = {
197
- ...v,
198
- [C]: {
199
- ...v[C],
200
- ...R
201
- }
202
- }, E && f <= 50 && (f++, typeof E == "object" && (E.placement && (x = E.placement), E.rects && (u = E.rects === !0 ? await l.getElementRects({
203
- reference: e,
204
- floating: t,
205
- strategy: s
206
- }) : E.rects), {
207
- x: d,
208
- y: h
209
- } = ze(u, x, c)), b = -1);
210
- }
211
- return {
212
- x: d,
213
- y: h,
214
- placement: x,
215
- strategy: s,
216
- middlewareData: v
217
- };
218
- };
219
- async function lt(e, t) {
220
- var n;
221
- t === void 0 && (t = {});
222
- const {
223
- x: o,
224
- y: s,
225
- platform: r,
226
- rects: l,
227
- elements: i,
228
- strategy: c
229
- } = e, {
230
- boundary: u = "clippingAncestors",
231
- rootBoundary: d = "viewport",
232
- elementContext: h = "floating",
233
- altBoundary: x = !1,
234
- padding: v = 0
235
- } = Ce(t, e), f = Lt(v), C = i[x ? h === "floating" ? "reference" : "floating" : h], O = be(await r.getClippingRect({
236
- element: (n = await (r.isElement == null ? void 0 : r.isElement(C))) == null || n ? C : C.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(i.floating)),
237
- boundary: u,
238
- rootBoundary: d,
239
- strategy: c
240
- })), A = h === "floating" ? {
241
- x: o,
242
- y: s,
243
- width: l.floating.width,
244
- height: l.floating.height
245
- } : l.reference, $ = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(i.floating)), R = await (r.isElement == null ? void 0 : r.isElement($)) ? await (r.getScale == null ? void 0 : r.getScale($)) || {
246
- x: 1,
247
- y: 1
248
- } : {
249
- x: 1,
250
- y: 1
251
- }, E = be(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
252
- elements: i,
253
- rect: A,
254
- offsetParent: $,
255
- strategy: c
256
- }) : A);
257
- return {
258
- top: (O.top - E.top + f.top) / R.y,
259
- bottom: (E.bottom - O.bottom + f.bottom) / R.y,
260
- left: (O.left - E.left + f.left) / R.x,
261
- right: (E.right - O.right + f.right) / R.x
262
- };
263
- }
264
- const St = function(e) {
265
- return e === void 0 && (e = {}), {
266
- name: "flip",
267
- options: e,
268
- async fn(t) {
269
- var n, o;
270
- const {
271
- placement: s,
272
- middlewareData: r,
273
- rects: l,
274
- initialPlacement: i,
275
- platform: c,
276
- elements: u
277
- } = t, {
278
- mainAxis: d = !0,
279
- crossAxis: h = !0,
280
- fallbackPlacements: x,
281
- fallbackStrategy: v = "bestFit",
282
- fallbackAxisSideDirection: f = "none",
283
- flipAlignment: b = !0,
284
- ...C
285
- } = Ce(e, t);
286
- if ((n = r.arrow) != null && n.alignmentOffset)
287
- return {};
288
- const O = Q(s), A = oe(i), $ = Q(i) === i, R = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), E = x || ($ || !b ? [xe(i)] : Rt(i)), D = f !== "none";
289
- !x && D && E.push(...Mt(i, b, f, R));
290
- const H = [i, ...E], te = await lt(t, C), X = [];
291
- let G = ((o = r.flip) == null ? void 0 : o.overflows) || [];
292
- if (d && X.push(te[O]), h) {
293
- const U = Ot(s, l, R);
294
- X.push(te[U[0]], te[U[1]]);
295
- }
296
- if (G = [...G, {
297
- placement: s,
298
- overflows: X
299
- }], !X.every((U) => U <= 0)) {
300
- var de, re;
301
- const U = (((de = r.flip) == null ? void 0 : de.index) || 0) + 1, a = H[U];
302
- if (a)
303
- return {
304
- data: {
305
- index: U,
306
- overflows: G
307
- },
308
- reset: {
309
- placement: a
310
- }
311
- };
312
- let m = (re = G.filter((k) => k.overflows[0] <= 0).sort((k, y) => k.overflows[1] - y.overflows[1])[0]) == null ? void 0 : re.placement;
313
- if (!m)
314
- switch (v) {
315
- case "bestFit": {
316
- var ie;
317
- const k = (ie = G.filter((y) => {
318
- if (D) {
319
- const S = oe(y.placement);
320
- return S === A || // Create a bias to the `y` side axis due to horizontal
321
- // reading directions favoring greater width.
322
- S === "y";
323
- }
324
- return !0;
325
- }).map((y) => [y.placement, y.overflows.filter((S) => S > 0).reduce((S, M) => S + M, 0)]).sort((y, S) => y[1] - S[1])[0]) == null ? void 0 : ie[0];
326
- k && (m = k);
327
- break;
328
- }
329
- case "initialPlacement":
330
- m = i;
331
- break;
332
- }
333
- if (s !== m)
334
- return {
335
- reset: {
336
- placement: m
337
- }
338
- };
339
- }
340
- return {};
341
- }
342
- };
343
- };
344
- async function Tt(e, t) {
345
- const {
346
- placement: n,
347
- platform: o,
348
- elements: s
349
- } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), l = Q(n), i = Ae(n), c = oe(n) === "y", u = ["left", "top"].includes(l) ? -1 : 1, d = r && c ? -1 : 1, h = Ce(t, e);
350
- let {
351
- mainAxis: x,
352
- crossAxis: v,
353
- alignmentAxis: f
354
- } = typeof h == "number" ? {
355
- mainAxis: h,
356
- crossAxis: 0,
357
- alignmentAxis: null
358
- } : {
359
- mainAxis: h.mainAxis || 0,
360
- crossAxis: h.crossAxis || 0,
361
- alignmentAxis: h.alignmentAxis
362
- };
363
- return i && typeof f == "number" && (v = i === "end" ? f * -1 : f), c ? {
364
- x: v * d,
365
- y: x * u
366
- } : {
367
- x: x * u,
368
- y: v * d
369
- };
370
- }
371
- const Vt = function(e) {
372
- return e === void 0 && (e = 0), {
373
- name: "offset",
374
- options: e,
375
- async fn(t) {
376
- var n, o;
377
- const {
378
- x: s,
379
- y: r,
380
- placement: l,
381
- middlewareData: i
382
- } = t, c = await Tt(t, e);
383
- return l === ((n = i.offset) == null ? void 0 : n.placement) && (o = i.arrow) != null && o.alignmentOffset ? {} : {
384
- x: s + c.x,
385
- y: r + c.y,
386
- data: {
387
- ...c,
388
- placement: l
389
- }
390
- };
391
- }
392
- };
393
- }, Dt = function(e) {
394
- return e === void 0 && (e = {}), {
395
- name: "shift",
396
- options: e,
397
- async fn(t) {
398
- const {
399
- x: n,
400
- y: o,
401
- placement: s
402
- } = t, {
403
- mainAxis: r = !0,
404
- crossAxis: l = !1,
405
- limiter: i = {
406
- fn: (C) => {
407
- let {
408
- x: O,
409
- y: A
410
- } = C;
411
- return {
412
- x: O,
413
- y: A
414
- };
415
- }
416
- },
417
- ...c
418
- } = Ce(e, t), u = {
419
- x: n,
420
- y: o
421
- }, d = await lt(t, c), h = oe(Q(s)), x = nt(h);
422
- let v = u[x], f = u[h];
423
- if (r) {
424
- const C = x === "y" ? "top" : "left", O = x === "y" ? "bottom" : "right", A = v + d[C], $ = v - d[O];
425
- v = Ke(A, v, $);
426
- }
427
- if (l) {
428
- const C = h === "y" ? "top" : "left", O = h === "y" ? "bottom" : "right", A = f + d[C], $ = f - d[O];
429
- f = Ke(A, f, $);
430
- }
431
- const b = i.fn({
432
- ...t,
433
- [x]: v,
434
- [h]: f
435
- });
436
- return {
437
- ...b,
438
- data: {
439
- x: b.x - n,
440
- y: b.y - o,
441
- enabled: {
442
- [x]: r,
443
- [h]: l
444
- }
445
- }
446
- };
447
- }
448
- };
449
- };
450
- function Oe() {
451
- return typeof window < "u";
452
- }
453
- function le(e) {
454
- return rt(e) ? (e.nodeName || "").toLowerCase() : "#document";
455
- }
456
- function F(e) {
457
- var t;
458
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
459
- }
460
- function N(e) {
461
- var t;
462
- return (t = (rt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
463
- }
464
- function rt(e) {
465
- return Oe() ? e instanceof Node || e instanceof F(e).Node : !1;
466
- }
467
- function j(e) {
468
- return Oe() ? e instanceof Element || e instanceof F(e).Element : !1;
469
- }
470
- function z(e) {
471
- return Oe() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
472
- }
473
- function Ne(e) {
474
- return !Oe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
475
- }
476
- function ue(e) {
477
- const {
478
- overflow: t,
479
- overflowX: n,
480
- overflowY: o,
481
- display: s
482
- } = W(e);
483
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(s);
484
- }
485
- function Bt(e) {
486
- return ["table", "td", "th"].includes(le(e));
487
- }
488
- function Re(e) {
489
- return [":popover-open", ":modal"].some((t) => {
490
- try {
491
- return e.matches(t);
492
- } catch {
493
- return !1;
494
- }
495
- });
496
- }
497
- function De(e) {
498
- const t = Be(), n = j(e) ? W(e) : e;
499
- return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
500
- }
501
- function Ft(e) {
502
- let t = Y(e);
503
- for (; z(t) && !se(t); ) {
504
- if (De(t))
505
- return t;
506
- if (Re(t))
507
- return null;
508
- t = Y(t);
509
- }
510
- return null;
511
- }
512
- function Be() {
513
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
514
- }
515
- function se(e) {
516
- return ["html", "body", "#document"].includes(le(e));
517
- }
518
- function W(e) {
519
- return F(e).getComputedStyle(e);
520
- }
521
- function $e(e) {
522
- return j(e) ? {
523
- scrollLeft: e.scrollLeft,
524
- scrollTop: e.scrollTop
525
- } : {
526
- scrollLeft: e.scrollX,
527
- scrollTop: e.scrollY
528
- };
529
- }
530
- function Y(e) {
531
- if (le(e) === "html")
532
- return e;
533
- const t = (
534
- // Step into the shadow DOM of the parent of a slotted node.
535
- e.assignedSlot || // DOM Element detected.
536
- e.parentNode || // ShadowRoot detected.
537
- Ne(e) && e.host || // Fallback.
538
- N(e)
539
- );
540
- return Ne(t) ? t.host : t;
541
- }
542
- function it(e) {
543
- const t = Y(e);
544
- return se(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : z(t) && ue(t) ? t : it(t);
545
- }
546
- function ce(e, t, n) {
547
- var o;
548
- t === void 0 && (t = []), n === void 0 && (n = !0);
549
- const s = it(e), r = s === ((o = e.ownerDocument) == null ? void 0 : o.body), l = F(s);
550
- if (r) {
551
- const i = Ve(l);
552
- return t.concat(l, l.visualViewport || [], ue(s) ? s : [], i && n ? ce(i) : []);
553
- }
554
- return t.concat(s, ce(s, [], n));
555
- }
556
- function Ve(e) {
557
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
558
- }
559
- function at(e) {
560
- const t = W(e);
561
- let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
562
- const s = z(e), r = s ? e.offsetWidth : n, l = s ? e.offsetHeight : o, i = ye(n) !== r || ye(o) !== l;
563
- return i && (n = r, o = l), {
564
- width: n,
565
- height: o,
566
- $: i
567
- };
568
- }
569
- function Fe(e) {
570
- return j(e) ? e : e.contextElement;
571
- }
572
- function ne(e) {
573
- const t = Fe(e);
574
- if (!z(t))
575
- return K(1);
576
- const n = t.getBoundingClientRect(), {
577
- width: o,
578
- height: s,
579
- $: r
580
- } = at(t);
581
- let l = (r ? ye(n.width) : n.width) / o, i = (r ? ye(n.height) : n.height) / s;
582
- return (!l || !Number.isFinite(l)) && (l = 1), (!i || !Number.isFinite(i)) && (i = 1), {
583
- x: l,
584
- y: i
585
- };
586
- }
587
- const Pt = /* @__PURE__ */ K(0);
588
- function ct(e) {
589
- const t = F(e);
590
- return !Be() || !t.visualViewport ? Pt : {
591
- x: t.visualViewport.offsetLeft,
592
- y: t.visualViewport.offsetTop
593
- };
594
- }
595
- function jt(e, t, n) {
596
- return t === void 0 && (t = !1), !n || t && n !== F(e) ? !1 : t;
597
- }
598
- function ee(e, t, n, o) {
599
- t === void 0 && (t = !1), n === void 0 && (n = !1);
600
- const s = e.getBoundingClientRect(), r = Fe(e);
601
- let l = K(1);
602
- t && (o ? j(o) && (l = ne(o)) : l = ne(e));
603
- const i = jt(r, n, o) ? ct(r) : K(0);
604
- let c = (s.left + i.x) / l.x, u = (s.top + i.y) / l.y, d = s.width / l.x, h = s.height / l.y;
605
- if (r) {
606
- const x = F(r), v = o && j(o) ? F(o) : o;
607
- let f = x, b = Ve(f);
608
- for (; b && o && v !== f; ) {
609
- const C = ne(b), O = b.getBoundingClientRect(), A = W(b), $ = O.left + (b.clientLeft + parseFloat(A.paddingLeft)) * C.x, R = O.top + (b.clientTop + parseFloat(A.paddingTop)) * C.y;
610
- c *= C.x, u *= C.y, d *= C.x, h *= C.y, c += $, u += R, f = F(b), b = Ve(f);
611
- }
612
- }
613
- return be({
614
- width: d,
615
- height: h,
616
- x: c,
617
- y: u
618
- });
619
- }
620
- function Pe(e, t) {
621
- const n = $e(e).scrollLeft;
622
- return t ? t.left + n : ee(N(e)).left + n;
623
- }
624
- function ut(e, t, n) {
625
- n === void 0 && (n = !1);
626
- const o = e.getBoundingClientRect(), s = o.left + t.scrollLeft - (n ? 0 : (
627
- // RTL <body> scrollbar.
628
- Pe(e, o)
629
- )), r = o.top + t.scrollTop;
630
- return {
631
- x: s,
632
- y: r
633
- };
634
- }
635
- function Wt(e) {
636
- let {
637
- elements: t,
638
- rect: n,
639
- offsetParent: o,
640
- strategy: s
641
- } = e;
642
- const r = s === "fixed", l = N(o), i = t ? Re(t.floating) : !1;
643
- if (o === l || i && r)
644
- return n;
645
- let c = {
646
- scrollLeft: 0,
647
- scrollTop: 0
648
- }, u = K(1);
649
- const d = K(0), h = z(o);
650
- if ((h || !h && !r) && ((le(o) !== "body" || ue(l)) && (c = $e(o)), z(o))) {
651
- const v = ee(o);
652
- u = ne(o), d.x = v.x + o.clientLeft, d.y = v.y + o.clientTop;
653
- }
654
- const x = l && !h && !r ? ut(l, c, !0) : K(0);
655
- return {
656
- width: n.width * u.x,
657
- height: n.height * u.y,
658
- x: n.x * u.x - c.scrollLeft * u.x + d.x + x.x,
659
- y: n.y * u.y - c.scrollTop * u.y + d.y + x.y
660
- };
661
- }
662
- function It(e) {
663
- return Array.from(e.getClientRects());
664
- }
665
- function Kt(e) {
666
- const t = N(e), n = $e(e), o = e.ownerDocument.body, s = Z(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = Z(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
667
- let l = -n.scrollLeft + Pe(e);
668
- const i = -n.scrollTop;
669
- return W(o).direction === "rtl" && (l += Z(t.clientWidth, o.clientWidth) - s), {
670
- width: s,
671
- height: r,
672
- x: l,
673
- y: i
674
- };
675
- }
676
- function zt(e, t) {
677
- const n = F(e), o = N(e), s = n.visualViewport;
678
- let r = o.clientWidth, l = o.clientHeight, i = 0, c = 0;
679
- if (s) {
680
- r = s.width, l = s.height;
681
- const u = Be();
682
- (!u || u && t === "fixed") && (i = s.offsetLeft, c = s.offsetTop);
683
- }
684
- return {
685
- width: r,
686
- height: l,
687
- x: i,
688
- y: c
689
- };
690
- }
691
- function Nt(e, t) {
692
- const n = ee(e, !0, t === "fixed"), o = n.top + e.clientTop, s = n.left + e.clientLeft, r = z(e) ? ne(e) : K(1), l = e.clientWidth * r.x, i = e.clientHeight * r.y, c = s * r.x, u = o * r.y;
693
- return {
694
- width: l,
695
- height: i,
696
- x: c,
697
- y: u
698
- };
699
- }
700
- function He(e, t, n) {
701
- let o;
702
- if (t === "viewport")
703
- o = zt(e, n);
704
- else if (t === "document")
705
- o = Kt(N(e));
706
- else if (j(t))
707
- o = Nt(t, n);
708
- else {
709
- const s = ct(e);
710
- o = {
711
- x: t.x - s.x,
712
- y: t.y - s.y,
713
- width: t.width,
714
- height: t.height
715
- };
716
- }
717
- return be(o);
718
- }
719
- function dt(e, t) {
720
- const n = Y(e);
721
- return n === t || !j(n) || se(n) ? !1 : W(n).position === "fixed" || dt(n, t);
722
- }
723
- function Ht(e, t) {
724
- const n = t.get(e);
725
- if (n)
726
- return n;
727
- let o = ce(e, [], !1).filter((i) => j(i) && le(i) !== "body"), s = null;
728
- const r = W(e).position === "fixed";
729
- let l = r ? Y(e) : e;
730
- for (; j(l) && !se(l); ) {
731
- const i = W(l), c = De(l);
732
- !c && i.position === "fixed" && (s = null), (r ? !c && !s : !c && i.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ue(l) && !c && dt(e, l)) ? o = o.filter((d) => d !== l) : s = i, l = Y(l);
733
- }
734
- return t.set(e, o), o;
735
- }
736
- function Ut(e) {
737
- let {
738
- element: t,
739
- boundary: n,
740
- rootBoundary: o,
741
- strategy: s
742
- } = e;
743
- const l = [...n === "clippingAncestors" ? Re(t) ? [] : Ht(t, this._c) : [].concat(n), o], i = l[0], c = l.reduce((u, d) => {
744
- const h = He(t, d, s);
745
- return u.top = Z(h.top, u.top), u.right = we(h.right, u.right), u.bottom = we(h.bottom, u.bottom), u.left = Z(h.left, u.left), u;
746
- }, He(t, i, s));
747
- return {
748
- width: c.right - c.left,
749
- height: c.bottom - c.top,
750
- x: c.left,
751
- y: c.top
752
- };
753
- }
754
- function qt(e) {
755
- const {
756
- width: t,
757
- height: n
758
- } = at(e);
759
- return {
760
- width: t,
761
- height: n
762
- };
763
- }
764
- function Yt(e, t, n) {
765
- const o = z(t), s = N(t), r = n === "fixed", l = ee(e, !0, r, t);
766
- let i = {
767
- scrollLeft: 0,
768
- scrollTop: 0
769
- };
770
- const c = K(0);
771
- if (o || !o && !r)
772
- if ((le(t) !== "body" || ue(s)) && (i = $e(t)), o) {
773
- const x = ee(t, !0, r, t);
774
- c.x = x.x + t.clientLeft, c.y = x.y + t.clientTop;
775
- } else
776
- s && (c.x = Pe(s));
777
- const u = s && !o && !r ? ut(s, i) : K(0), d = l.left + i.scrollLeft - c.x - u.x, h = l.top + i.scrollTop - c.y - u.y;
778
- return {
779
- x: d,
780
- y: h,
781
- width: l.width,
782
- height: l.height
783
- };
784
- }
785
- function Ee(e) {
786
- return W(e).position === "static";
787
- }
788
- function Ue(e, t) {
789
- if (!z(e) || W(e).position === "fixed")
790
- return null;
791
- if (t)
792
- return t(e);
793
- let n = e.offsetParent;
794
- return N(e) === n && (n = n.ownerDocument.body), n;
795
- }
796
- function ft(e, t) {
797
- const n = F(e);
798
- if (Re(e))
799
- return n;
800
- if (!z(e)) {
801
- let s = Y(e);
802
- for (; s && !se(s); ) {
803
- if (j(s) && !Ee(s))
804
- return s;
805
- s = Y(s);
806
- }
807
- return n;
808
- }
809
- let o = Ue(e, t);
810
- for (; o && Bt(o) && Ee(o); )
811
- o = Ue(o, t);
812
- return o && se(o) && Ee(o) && !De(o) ? n : o || Ft(e) || n;
813
- }
814
- const Xt = async function(e) {
815
- const t = this.getOffsetParent || ft, n = this.getDimensions, o = await n(e.floating);
816
- return {
817
- reference: Yt(e.reference, await t(e.floating), e.strategy),
818
- floating: {
819
- x: 0,
820
- y: 0,
821
- width: o.width,
822
- height: o.height
823
- }
824
- };
825
- };
826
- function Gt(e) {
827
- return W(e).direction === "rtl";
828
- }
829
- const Jt = {
830
- convertOffsetParentRelativeRectToViewportRelativeRect: Wt,
831
- getDocumentElement: N,
832
- getClippingRect: Ut,
833
- getOffsetParent: ft,
834
- getElementRects: Xt,
835
- getClientRects: It,
836
- getDimensions: qt,
837
- getScale: ne,
838
- isElement: j,
839
- isRTL: Gt
840
- };
841
- function pt(e, t) {
842
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
843
- }
844
- function Zt(e, t) {
845
- let n = null, o;
846
- const s = N(e);
847
- function r() {
848
- var i;
849
- clearTimeout(o), (i = n) == null || i.disconnect(), n = null;
850
- }
851
- function l(i, c) {
852
- i === void 0 && (i = !1), c === void 0 && (c = 1), r();
853
- const u = e.getBoundingClientRect(), {
854
- left: d,
855
- top: h,
856
- width: x,
857
- height: v
858
- } = u;
859
- if (i || t(), !x || !v)
860
- return;
861
- const f = pe(h), b = pe(s.clientWidth - (d + x)), C = pe(s.clientHeight - (h + v)), O = pe(d), $ = {
862
- rootMargin: -f + "px " + -b + "px " + -C + "px " + -O + "px",
863
- threshold: Z(0, we(1, c)) || 1
864
- };
865
- let R = !0;
866
- function E(D) {
867
- const H = D[0].intersectionRatio;
868
- if (H !== c) {
869
- if (!R)
870
- return l();
871
- H ? l(!1, H) : o = setTimeout(() => {
872
- l(!1, 1e-7);
873
- }, 1e3);
874
- }
875
- H === 1 && !pt(u, e.getBoundingClientRect()) && l(), R = !1;
876
- }
877
- try {
878
- n = new IntersectionObserver(E, {
879
- ...$,
880
- // Handle <iframe>s
881
- root: s.ownerDocument
882
- });
883
- } catch {
884
- n = new IntersectionObserver(E, $);
885
- }
886
- n.observe(e);
887
- }
888
- return l(!0), r;
889
- }
890
- function Qt(e, t, n, o) {
891
- o === void 0 && (o = {});
892
- const {
893
- ancestorScroll: s = !0,
894
- ancestorResize: r = !0,
895
- elementResize: l = typeof ResizeObserver == "function",
896
- layoutShift: i = typeof IntersectionObserver == "function",
897
- animationFrame: c = !1
898
- } = o, u = Fe(e), d = s || r ? [...u ? ce(u) : [], ...ce(t)] : [];
899
- d.forEach((O) => {
900
- s && O.addEventListener("scroll", n, {
901
- passive: !0
902
- }), r && O.addEventListener("resize", n);
903
- });
904
- const h = u && i ? Zt(u, n) : null;
905
- let x = -1, v = null;
906
- l && (v = new ResizeObserver((O) => {
907
- let [A] = O;
908
- A && A.target === u && v && (v.unobserve(t), cancelAnimationFrame(x), x = requestAnimationFrame(() => {
909
- var $;
910
- ($ = v) == null || $.observe(t);
911
- })), n();
912
- }), u && !c && v.observe(u), v.observe(t));
913
- let f, b = c ? ee(e) : null;
914
- c && C();
915
- function C() {
916
- const O = ee(e);
917
- b && !pt(b, O) && n(), b = O, f = requestAnimationFrame(C);
918
- }
919
- return n(), () => {
920
- var O;
921
- d.forEach((A) => {
922
- s && A.removeEventListener("scroll", n), r && A.removeEventListener("resize", n);
923
- }), h == null || h(), (O = v) == null || O.disconnect(), v = null, c && cancelAnimationFrame(f);
924
- };
925
- }
926
- const qe = Vt, Ye = Dt, Xe = St, Ge = (e, t, n) => {
927
- const o = /* @__PURE__ */ new Map(), s = {
928
- platform: Jt,
929
- ...n
930
- }, r = {
931
- ...s.platform,
932
- _c: o
933
- };
934
- return Et(e, t, {
935
- ...s,
936
- platform: r
937
- });
938
- }, en = ["data-opened"], tn = {
939
- key: 0,
940
- class: "text-sm text-secondary-content px-3 py-2 text-left"
941
- }, nn = /* @__PURE__ */ ke({
942
- __name: "OneDropdownAuto",
943
- props: mt,
944
- emits: ["open", "close"],
945
- setup(e, { emit: t }) {
946
- const n = e, o = V(!1), s = V(null), r = V(null);
947
- let l = null;
948
- Ze(o, (d) => {
949
- d && r.value && s.value ? (Ge(r.value, s.value, {
950
- placement: n.stick ? n.stick : "bottom-start",
951
- strategy: "fixed",
952
- middleware: [qe(5), Xe(), Ye({ padding: 8 })]
953
- }).then(({ x: h, y: x }) => {
954
- Object.assign(s.value.style, {
955
- left: `${h}px`,
956
- top: `${x}px`
957
- });
958
- }), l = Qt(r.value, s.value, () => {
959
- Ge(r.value, s.value, {
960
- placement: n.stick ? n.stick : "bottom-start",
961
- strategy: "fixed",
962
- middleware: [qe(4), Xe(), Ye({ padding: 8 })]
963
- }).then(({ x: h, y: x }) => {
964
- Object.assign(s.value.style, {
965
- left: `${h}px`,
966
- top: `${x}px`
967
- });
968
- });
969
- })) : l && (l(), l = null);
970
- }), Qe(() => {
971
- l && l();
972
- });
973
- const i = t, c = () => {
974
- o.value = !o.value, o.value ? i("open") : i("close");
975
- };
976
- yt("OneDropdown", {
977
- onToggle: c
978
- });
979
- const u = P(() => [
980
- "fixed z-[10000] w-fit rounded-md bg-white",
981
- "py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none",
982
- "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
983
- ]);
984
- return (d, h) => (g(), w("div", {
985
- class: "relative inline-block",
986
- "data-opened": o.value
987
- }, [
988
- p("div", {
989
- ref_key: "buttonRef",
990
- ref: r
991
- }, [
992
- B(d.$slots, "button", me(he({ onToggle: c, isExpanded: o.value })))
993
- ], 512),
994
- (g(), ge(xt, { to: "body" }, [
995
- o.value ? (g(), w("div", {
996
- key: 0,
997
- class: "fixed top-0 left-0 w-screen h-screen z-[9999]",
998
- onClick: c
999
- })) : _("", !0),
1000
- Se(p("div", {
1001
- ref_key: "menuRef",
1002
- ref: s,
1003
- class: T(["menu", u.value]),
1004
- role: "menu",
1005
- "aria-orientation": "vertical",
1006
- tabindex: "-1",
1007
- style: { display: "none" }
1008
- }, [
1009
- d.title ? (g(), w("div", tn, L(d.title), 1)) : _("", !0),
1010
- B(d.$slots, "menu", me(he({ onToggle: c })))
1011
- ], 2), [
1012
- [bt, o.value]
1013
- ])
1014
- ]))
1015
- ], 8, en));
1016
- }
1017
- }), on = {}, sn = { class: "border-t border-secondary-stroke my-1" };
1018
- function ln(e, t) {
1019
- return g(), w("div", sn);
1020
- }
1021
- const yo = /* @__PURE__ */ tt(on, [["render", ln]]), rn = ["onClick"], an = { class: "grid" }, cn = { class: "font-semibold px-3" }, un = { class: "rounded-lg m-3 border" }, dn = {
1022
- class: "space-x-2 flex items-center px-3 py-2",
1023
- style: { width: "300px" }
1024
- }, fn = { class: "flex-shrink-0" }, pn = { class: "w-full text-left" }, mn = { class: "flex-shrink-0" }, hn = { class: "px-3 py-2" }, gn = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, vn = {
1025
- key: 0,
1026
- class: "space-y-2"
1027
- }, wn = ["onClick"], yn = { class: "pl-2" }, xn = { class: "text-sm mt-1" }, bn = { class: "text-xs mt-1" }, Je = 3, xo = /* @__PURE__ */ ke({
1028
- __name: "OneBrowserMenuGrid",
1029
- props: ht,
1030
- setup(e) {
1031
- const t = e, n = () => {
1032
- typeof t.onChange == "function" && t.onChange();
1033
- }, o = V(!1), s = P(() => t.apps ? o.value ? t.apps : t.apps.slice(0, Je) : []), r = () => {
1034
- o.value = !o.value;
1035
- }, l = (i) => {
1036
- typeof t.onApp == "function" && t.onApp(i);
1037
- };
1038
- return (i, c) => (g(), ge(gt, { stick: "right" }, {
1039
- button: ae(({ onToggle: u, isExpanded: d }) => [
1040
- p("button", {
1041
- onClick: u,
1042
- class: T(["p-1 rounded-md hover:bg-secondary-10", [d ? "bg-secondary-25" : ""]])
1043
- }, [
1044
- _e(q(vt), {
1045
- class: "text-secondary-base",
1046
- style: ve(`width: ${i.iconSize}px; height: ${i.iconSize}px`)
1047
- }, null, 8, ["style"])
1048
- ], 10, rn)
1049
- ]),
1050
- menu: ae(() => {
1051
- var u, d, h, x;
1052
- return [
1053
- p("div", an, [
1054
- p("div", cn, L((u = i.workspace) == null ? void 0 : u.title), 1),
1055
- p("div", un, [
1056
- p("div", dn, [
1057
- p("div", fn, [
1058
- _e(Ie, {
1059
- text: ((d = i.workspace) == null ? void 0 : d.name) || "",
1060
- src: (h = i.workspace) == null ? void 0 : h.photo_url,
1061
- size: 44,
1062
- rounded: !1,
1063
- class: "mx-auto"
1064
- }, null, 8, ["text", "src"])
1065
- ]),
1066
- p("div", pn, L((x = i.workspace) == null ? void 0 : x.name), 1),
1067
- p("div", mn, [
1068
- p("button", {
1069
- class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
1070
- onClick: n
1071
- }, L(i.changeLabel), 1)
1072
- ])
1073
- ]),
1074
- c[0] || (c[0] = p("hr", null, null, -1))
1075
- ])
1076
- ]),
1077
- p("div", hn, [
1078
- p("div", gn, L(i.appsTitle), 1),
1079
- p("div", null, [
1080
- i.apps && i.apps.length ? (g(), w("div", vn, [
1081
- (g(!0), w(I, null, J(s.value, (v) => (g(), w("div", {
1082
- key: v.id,
1083
- onClick: (f) => l(v),
1084
- class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
1085
- }, [
1086
- _e(Ie, {
1087
- text: v.name,
1088
- src: v.photo_url,
1089
- size: 44,
1090
- rounded: !1
1091
- }, null, 8, ["text", "src"]),
1092
- p("div", yn, [
1093
- p("p", xn, L(v.name), 1),
1094
- p("p", bn, L(v.short), 1)
1095
- ])
1096
- ], 8, wn))), 128))
1097
- ])) : _("", !0),
1098
- i.apps && i.apps.length > Je ? (g(), w("button", {
1099
- key: 1,
1100
- onClick: r,
1101
- class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"
1102
- }, L(o.value ? "Приховати" : "Дивитися всі"), 1)) : _("", !0)
1103
- ])
1104
- ])
1105
- ];
1106
- }),
1107
- _: 1
1108
- }));
1109
- }
1110
- }), kn = {
1111
- useModal: {
1112
- required: !0,
1113
- type: Object
1114
- },
1115
- title: {
1116
- required: !1,
1117
- type: String
1118
- },
1119
- size: {
1120
- type: String,
1121
- default: "medium"
1122
- },
1123
- onClose: {
1124
- type: Function
1125
- },
1126
- classModal: {
1127
- type: Boolean,
1128
- default: !1
1129
- },
1130
- titleCenter: {
1131
- type: Boolean,
1132
- default: !1
1133
- },
1134
- classTitle: {
1135
- type: String,
1136
- default: ""
1137
- },
1138
- canClose: {
1139
- type: Function,
1140
- default: () => !0
1141
- },
1142
- customWidth: {
1143
- type: String,
1144
- default: ""
1145
- }
1146
- }, Cn = {
1147
- "3xs": ["max-w-xs"],
1148
- xs: ["max-w-sm"],
1149
- sm: ["max-w-md"],
1150
- small: ["max-w-lg"],
1151
- md: ["max-w-xl"],
1152
- medium: ["max-w-xl"],
1153
- large: ["max-w-2xl"],
1154
- xl: ["max-w-3xl"],
1155
- "2xl": ["max-w-4xl"],
1156
- "3xl": ["max-w-4xl"],
1157
- "4xl": ["max-w-5xl"],
1158
- "5xl": ["max-w-5xl"],
1159
- "7xl": ["max-w-7xl"]
1160
- }, An = (e = "medium") => {
1161
- const t = [];
1162
- return t.push(...Cn[e] ?? []), t;
1163
- }, On = { class: "relative bg-white rounded-lg shadow h-full" }, Rn = /* @__PURE__ */ ke({
1164
- __name: "OneModal",
1165
- props: kn,
1166
- emits: ["isOpen", "closed"],
1167
- setup(e, { expose: t, emit: n }) {
1168
- const o = e, s = n, r = P(() => {
1169
- var b, C;
1170
- const f = o.useModal;
1171
- return ((b = f == null ? void 0 : f.isOpened) == null ? void 0 : b.value) ?? ((C = f == null ? void 0 : f.isOpen) == null ? void 0 : C.value) ?? !1;
1172
- }), l = P(() => An(o.size)), i = P(() => o.customWidth ? { width: o.customWidth } : {}), c = V(null), u = V(!1);
1173
- function d(f) {
1174
- u.value = !1, c.value && !c.value.contains(f.target) && (u.value = !0);
1175
- }
1176
- function h(f) {
1177
- u.value && c.value && !c.value.contains(f.target) && x();
1178
- }
1179
- const x = () => {
1180
- var b, C;
1181
- if (o.canClose && !o.canClose())
1182
- return;
1183
- const f = o.useModal;
1184
- (b = f == null ? void 0 : f.close) == null || b.call(f), (C = o.onClose) == null || C.call(o), s("closed"), s("isOpen");
1185
- };
1186
- return t({
1187
- open: () => {
1188
- var b;
1189
- const f = o.useModal;
1190
- (b = f == null ? void 0 : f.open) == null || b.call(f), s("isOpen");
1191
- },
1192
- close: x
1193
- }), (f, b) => r.value ? (g(), w("div", {
1194
- key: 0,
1195
- tabindex: "-1",
1196
- onMousedown: d,
1197
- onMouseup: h,
1198
- class: T(["modal backdrop !m-0", { "modal-mobile": f.classModal }])
1199
- }, [
1200
- p("div", {
1201
- class: T([
1202
- "relative w-full max-h-full",
1203
- l.value,
1204
- { "fixed bottom-0 left-0 right-0 w-full bg-white rounded-t-xl mobile-modal": f.classModal }
1205
- ]),
1206
- style: ve(i.value),
1207
- ref_key: "modalContent",
1208
- ref: c
1209
- }, [
1210
- p("div", On, [
1211
- f.title ? (g(), w("div", {
1212
- key: 0,
1213
- class: T([
1214
- f.titleCenter ? "grid grid-cols-4" : "flex items-start justify-between",
1215
- "p-3 border-b rounded-t",
1216
- f.classTitle
1217
- ])
1218
- }, [
1219
- p("h3", {
1220
- class: T(["text-xl font-semibold text-gray-900 whitespace-nowrap overflow-hidden text-ellipsis", f.titleCenter ? "col-span-2 text-center col-start-2" : ""])
1221
- }, L(f.title), 3),
1222
- p("button", {
1223
- type: "button",
1224
- class: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center",
1225
- onClick: x
1226
- }, [...b[0] || (b[0] = [
1227
- p("svg", {
1228
- xmlns: "http://www.w3.org/2000/svg",
1229
- fill: "none",
1230
- viewBox: "0 0 24 24",
1231
- "stroke-width": "1.8",
1232
- stroke: "currentColor",
1233
- "aria-hidden": "true",
1234
- class: "w-5 h-5"
1235
- }, [
1236
- p("path", {
1237
- "stroke-linecap": "round",
1238
- "stroke-linejoin": "round",
1239
- d: "M6 18L18 6M6 6l12 12"
1240
- })
1241
- ], -1)
1242
- ])])
1243
- ], 2)) : _("", !0),
1244
- B(f.$slots, "header", {}, void 0, !0),
1245
- B(f.$slots, "body", {}, void 0, !0),
1246
- B(f.$slots, "default", {}, void 0, !0),
1247
- B(f.$slots, "footer", { close: x }, void 0, !0)
1248
- ])
1249
- ], 6)
1250
- ], 34)) : _("", !0);
1251
- }
1252
- });
1253
- const $n = /* @__PURE__ */ tt(Rn, [["__scopeId", "data-v-3560b61e"]]);
1254
- function Mn(e = !1) {
1255
- const t = V(e), n = V(void 0);
1256
- let o = null;
1257
- const s = () => {
1258
- o && (clearTimeout(o), o = null), t.value = !1, n.value = void 0;
1259
- }, r = (c) => {
1260
- n.value = c, t.value = !0;
1261
- }, l = (c) => {
1262
- o && clearTimeout(o), o = setTimeout(s, c * 1e3);
1263
- }, i = (c) => {
1264
- c.key === "Escape" && t.value && s();
1265
- };
1266
- return et(() => {
1267
- document.addEventListener("keydown", i);
1268
- }), Qe(() => {
1269
- document.removeEventListener("keydown", i), o && clearTimeout(o);
1270
- }), {
1271
- isOpened: t,
1272
- isOpen: t,
1273
- // alias for backward compatibility
1274
- data: n,
1275
- open: r,
1276
- close: s,
1277
- closeWithDelay: l
1278
- };
1279
- }
1280
- const _n = ["onClick"], Ln = ["onKeydown"], En = {
1281
- key: 0,
1282
- class: "text-sm font-medium text-gray-700 px-3 pt-2.5 pb-1.5"
1283
- }, Sn = {
1284
- key: 1,
1285
- class: "px-3 py-2"
1286
- }, Tn = { class: "relative" }, Vn = ["placeholder"], Dn = {
1287
- key: 2,
1288
- class: "border-b border-gray-100"
1289
- }, Bn = ["onClick"], Fn = {
1290
- key: 3,
1291
- class: "flex items-center justify-between px-3 py-1.5 border-b border-gray-100"
1292
- }, Pn = {
1293
- key: 4,
1294
- class: "flex justify-center py-4"
1295
- }, jn = ["aria-selected", "onClick"], Wn = {
1296
- key: 0,
1297
- xmlns: "http://www.w3.org/2000/svg",
1298
- fill: "none",
1299
- viewBox: "0 0 24 24",
1300
- "stroke-width": "1.5",
1301
- stroke: "currentColor",
1302
- class: "w-4 h-4 text-blue-600 shrink-0"
1303
- }, In = {
1304
- key: 1,
1305
- class: "w-4 h-4 shrink-0"
1306
- }, Kn = ["aria-selected", "onClick", "onMouseenter"], zn = {
1307
- key: 0,
1308
- xmlns: "http://www.w3.org/2000/svg",
1309
- fill: "none",
1310
- viewBox: "0 0 24 24",
1311
- "stroke-width": "1.5",
1312
- stroke: "currentColor",
1313
- class: "w-4 h-4 text-blue-600 shrink-0"
1314
- }, Nn = {
1315
- key: 1,
1316
- class: "w-4 h-4 shrink-0"
1317
- }, Hn = ["aria-selected", "onClick", "onMouseenter"], Un = {
1318
- key: 0,
1319
- xmlns: "http://www.w3.org/2000/svg",
1320
- fill: "none",
1321
- viewBox: "0 0 24 24",
1322
- "stroke-width": "1.5",
1323
- stroke: "currentColor",
1324
- class: "w-4 h-4 text-blue-600 shrink-0"
1325
- }, qn = {
1326
- key: 1,
1327
- class: "w-4 h-4 shrink-0"
1328
- }, Yn = {
1329
- key: 3,
1330
- class: "px-3 py-4 text-sm text-gray-500 text-center"
1331
- }, Xn = { class: "pb-6" }, Gn = {
1332
- key: 0,
1333
- class: "relative px-3 py-3"
1334
- }, Jn = { class: "relative" }, Zn = ["placeholder"], Qn = {
1335
- key: 1,
1336
- class: "px-3 py-2"
1337
- }, eo = {
1338
- key: 2,
1339
- class: "flex items-center justify-between px-3 py-2 border-b border-gray-100"
1340
- }, to = {
1341
- key: 3,
1342
- class: "flex justify-center py-8"
1343
- }, no = {
1344
- key: 4,
1345
- class: "overflow-auto h-[60dvh] divide-y",
1346
- role: "listbox"
1347
- }, oo = ["aria-selected"], so = {
1348
- key: 0,
1349
- xmlns: "http://www.w3.org/2000/svg",
1350
- fill: "none",
1351
- viewBox: "0 0 24 24",
1352
- "stroke-width": "1.5",
1353
- stroke: "currentColor",
1354
- class: "w-5 h-5 text-blue-600 shrink-0"
1355
- }, lo = {
1356
- key: 1,
1357
- class: "w-5 h-5 shrink-0"
1358
- }, ro = {
1359
- key: 0,
1360
- class: "px-3 pt-3 pb-2 text-xs font-semibold text-gray-400 uppercase tracking-wide"
1361
- }, io = ["aria-selected", "onClick"], ao = {
1362
- key: 0,
1363
- xmlns: "http://www.w3.org/2000/svg",
1364
- fill: "none",
1365
- viewBox: "0 0 24 24",
1366
- "stroke-width": "1.5",
1367
- stroke: "currentColor",
1368
- class: "w-5 h-5 text-blue-600 shrink-0"
1369
- }, co = {
1370
- key: 1,
1371
- class: "w-5 h-5 shrink-0"
1372
- }, uo = ["aria-selected", "onClick"], fo = {
1373
- key: 0,
1374
- xmlns: "http://www.w3.org/2000/svg",
1375
- fill: "none",
1376
- viewBox: "0 0 24 24",
1377
- "stroke-width": "1.5",
1378
- stroke: "currentColor",
1379
- class: "w-5 h-5 text-blue-600 shrink-0"
1380
- }, po = {
1381
- key: 1,
1382
- class: "w-5 h-5 shrink-0"
1383
- }, mo = {
1384
- key: 3,
1385
- class: "px-3 py-8 text-sm text-gray-500 text-center"
1386
- }, bo = /* @__PURE__ */ ke({
1387
- __name: "OneDropdownSelect",
1388
- props: wt,
1389
- emits: ["update:modelValue", "search", "create"],
1390
- setup(e, { emit: t }) {
1391
- const n = e, o = t, s = V(!1);
1392
- let r = null;
1393
- et(() => {
1394
- r = window.matchMedia("(max-width: 767px)"), s.value = r.matches;
1395
- const a = (m) => {
1396
- s.value = m.matches;
1397
- };
1398
- r.addEventListener("change", a), kt(() => {
1399
- r == null || r.removeEventListener("change", a);
1400
- });
1401
- });
1402
- const l = Mn(), i = V(null), c = () => {
1403
- u.value = "", d.value = -1, l.open(), Le(() => {
1404
- var a;
1405
- (a = i.value) == null || a.focus();
1406
- });
1407
- }, u = V(""), d = V(-1), h = V(null), x = V(null), v = V({}), f = (a, m) => {
1408
- a && (v.value[m] = a);
1409
- }, b = P(() => n.allowEmpty ? 1 : 0), C = P(() => {
1410
- if (!u.value.trim())
1411
- return n.items;
1412
- const a = u.value.toLowerCase();
1413
- return n.items.filter(
1414
- (m) => String(m[n.labelKey] ?? "").toLowerCase().includes(a)
1415
- );
1416
- }), O = P(() => {
1417
- if (!n.groupKey)
1418
- return [];
1419
- const a = [], m = /* @__PURE__ */ new Map();
1420
- let k = b.value;
1421
- for (const y of C.value) {
1422
- const S = String(y[n.groupKey] ?? "");
1423
- let M = m.get(S);
1424
- M || (M = { label: S, entries: [] }, m.set(S, M), a.push(M)), M.entries.push({ item: y, flatIndex: k }), k++;
1425
- }
1426
- return a;
1427
- }), A = P(() => n.multiple ? (n.modelValue ?? []).length > 0 : n.modelValue !== null && n.modelValue !== void 0), $ = P(() => {
1428
- if (n.multiple) {
1429
- const a = n.modelValue ?? [];
1430
- return a.length === 0 ? n.placeholder : a.length === 1 ? a[0][n.labelKey] ?? n.placeholder : `${a[0][n.labelKey]} +${a.length - 1}`;
1431
- }
1432
- return n.modelValue === null || n.modelValue === void 0 ? n.placeholder : n.modelValue[n.labelKey] ?? n.placeholder;
1433
- }), R = (a) => n.modelValue ? n.multiple ? n.modelValue.some((k) => k[n.valueKey] === a[n.valueKey]) : n.modelValue[n.valueKey] === a[n.valueKey] : !1, E = P(() => C.value.length + b.value), D = (a, m) => {
1434
- if (n.multiple) {
1435
- const k = (n.modelValue ?? []).slice();
1436
- if (a === null) {
1437
- o("update:modelValue", []);
1438
- return;
1439
- }
1440
- const y = k.findIndex((S) => S[n.valueKey] === a[n.valueKey]);
1441
- y >= 0 ? k.splice(y, 1) : k.push(a), o("update:modelValue", k);
1442
- return;
1443
- }
1444
- o("update:modelValue", a), m();
1445
- }, H = () => {
1446
- o("update:modelValue", [...n.items]);
1447
- }, te = () => {
1448
- o("update:modelValue", []);
1449
- }, X = (a) => {
1450
- o("create", u.value), a();
1451
- }, G = () => {
1452
- u.value = "", d.value = -1, Le(() => {
1453
- var a;
1454
- (a = h.value) == null || a.focus();
1455
- });
1456
- }, de = () => {
1457
- u.value = "", d.value = -1;
1458
- }, re = () => {
1459
- d.value = 0, o("search", u.value);
1460
- }, ie = () => {
1461
- Le(() => {
1462
- const a = v.value[d.value];
1463
- a && a.scrollIntoView({ block: "nearest" });
1464
- });
1465
- }, U = (a, m) => {
1466
- switch (a.key) {
1467
- case "ArrowDown":
1468
- a.preventDefault(), d.value < E.value - 1 ? d.value++ : d.value = 0, ie();
1469
- break;
1470
- case "ArrowUp":
1471
- a.preventDefault(), d.value > 0 ? d.value-- : d.value = E.value - 1, ie();
1472
- break;
1473
- case "Enter":
1474
- if (a.preventDefault(), d.value >= 0)
1475
- if (n.allowEmpty && d.value === 0)
1476
- D(null, m);
1477
- else {
1478
- const k = d.value - b.value, y = C.value[k];
1479
- y && D(y, m);
1480
- }
1481
- break;
1482
- case "Escape":
1483
- a.preventDefault(), m();
1484
- break;
1485
- }
1486
- };
1487
- return Ze(u, () => {
1488
- d.value = 0;
1489
- }), (a, m) => s.value ? (g(), w(I, { key: 1 }, [
1490
- B(a.$slots, "button", me(he({ onToggle: c, isExpanded: q(l).isOpened.value, selectedLabel: $.value })), () => [
1491
- p("button", {
1492
- class: T(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
1493
- a.view === "pill" ? "rounded-full bg-gray-100 px-3.5 py-1.5 hover:bg-gray-200 text-gray-700" : "rounded-lg border border-gray-300 bg-white px-3 py-2 hover:bg-gray-50 min-w-[180px]"
1494
- ]]),
1495
- style: ve(a.maxWidth ? { maxWidth: a.maxWidth } : void 0),
1496
- onClick: c
1497
- }, [
1498
- p("span", {
1499
- class: T(["truncate", a.view === "pill" ? "" : A.value ? "text-gray-900" : "text-gray-500"])
1500
- }, L($.value), 3),
1501
- m[13] || (m[13] = p("svg", {
1502
- xmlns: "http://www.w3.org/2000/svg",
1503
- fill: "none",
1504
- viewBox: "0 0 24 24",
1505
- "stroke-width": "1.5",
1506
- stroke: "currentColor",
1507
- class: "w-4 h-4 text-gray-400 shrink-0"
1508
- }, [
1509
- p("path", {
1510
- "stroke-linecap": "round",
1511
- "stroke-linejoin": "round",
1512
- d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
1513
- })
1514
- ], -1))
1515
- ], 6)
1516
- ]),
1517
- q(l).isOpened.value ? (g(), ge(q($n), {
1518
- key: 0,
1519
- useModal: q(l),
1520
- title: a.title || a.placeholder,
1521
- size: "sm",
1522
- classModal: !0,
1523
- titleCenter: !0
1524
- }, {
1525
- default: ae(() => [
1526
- p("div", Xn, [
1527
- a.searchable ? (g(), w("div", Gn, [
1528
- p("div", Jn, [
1529
- m[14] || (m[14] = p("svg", {
1530
- xmlns: "http://www.w3.org/2000/svg",
1531
- fill: "none",
1532
- viewBox: "0 0 24 24",
1533
- "stroke-width": "1.5",
1534
- stroke: "currentColor",
1535
- class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
1536
- }, [
1537
- p("path", {
1538
- "stroke-linecap": "round",
1539
- "stroke-linejoin": "round",
1540
- d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
1541
- })
1542
- ], -1)),
1543
- Se(p("input", {
1544
- ref_key: "mobileSearchInputRef",
1545
- ref: i,
1546
- "onUpdate:modelValue": m[2] || (m[2] = (k) => u.value = k),
1547
- type: "text",
1548
- placeholder: a.searchPlaceholder,
1549
- class: "w-full rounded-md border border-gray-300 py-2 pl-8 pr-3 text-sm outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
1550
- onInput: re
1551
- }, null, 40, Zn), [
1552
- [je, u.value]
1553
- ])
1554
- ])
1555
- ])) : _("", !0),
1556
- a.createLabel ? (g(), w("div", Qn, [
1557
- p("button", {
1558
- class: "w-full flex items-center justify-center gap-2 py-2 text-sm text-blue-700 hover:text-blue-500",
1559
- onClick: m[3] || (m[3] = (k) => X(() => q(l).close()))
1560
- }, [
1561
- m[15] || (m[15] = p("svg", {
1562
- xmlns: "http://www.w3.org/2000/svg",
1563
- fill: "none",
1564
- viewBox: "0 0 24 24",
1565
- "stroke-width": "1.5",
1566
- stroke: "currentColor",
1567
- class: "w-4 h-4"
1568
- }, [
1569
- p("path", {
1570
- "stroke-linecap": "round",
1571
- "stroke-linejoin": "round",
1572
- d: "M12 4.5v15m7.5-7.5h-15"
1573
- })
1574
- ], -1)),
1575
- p("span", null, L(a.createLabel), 1)
1576
- ])
1577
- ])) : _("", !0),
1578
- a.multiple ? (g(), w("div", eo, [
1579
- p("button", {
1580
- class: "text-sm text-blue-600 hover:text-blue-800 transition-colors",
1581
- onClick: H
1582
- }, " Обрати все "),
1583
- A.value ? (g(), w("button", {
1584
- key: 0,
1585
- class: "text-sm text-gray-500 hover:text-gray-700 transition-colors",
1586
- onClick: te
1587
- }, " Очистити ")) : _("", !0)
1588
- ])) : _("", !0),
1589
- a.isLoading ? (g(), w("div", to, [...m[16] || (m[16] = [
1590
- p("div", { class: "animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full" }, null, -1)
1591
- ])])) : (g(), w("div", no, [
1592
- a.allowEmpty ? (g(), w("button", {
1593
- key: 0,
1594
- class: T(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", A.value ? "" : "bg-gray-50 font-medium"]),
1595
- role: "option",
1596
- "aria-selected": !A.value,
1597
- onClick: m[4] || (m[4] = (k) => D(null, () => q(l).close()))
1598
- }, [
1599
- A.value ? (g(), w("span", lo)) : (g(), w("svg", so, [...m[17] || (m[17] = [
1600
- p("path", {
1601
- "stroke-linecap": "round",
1602
- "stroke-linejoin": "round",
1603
- d: "M4.5 12.75l6 6 9-13.5"
1604
- }, null, -1)
1605
- ])])),
1606
- p("span", null, L(a.emptyLabel ?? a.placeholder), 1)
1607
- ], 10, oo)) : _("", !0),
1608
- a.groupKey ? (g(!0), w(I, { key: 1 }, J(O.value, (k) => (g(), w(I, {
1609
- key: k.label
1610
- }, [
1611
- k.label ? (g(), w("div", ro, L(k.label), 1)) : _("", !0),
1612
- (g(!0), w(I, null, J(k.entries, (y) => (g(), w("button", {
1613
- key: y.item[a.valueKey],
1614
- class: T(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", R(y.item) ? "bg-gray-50 font-medium" : ""]),
1615
- role: "option",
1616
- "aria-selected": R(y.item),
1617
- onClick: (S) => D(y.item, () => q(l).close())
1618
- }, [
1619
- R(y.item) ? (g(), w("svg", ao, [...m[18] || (m[18] = [
1620
- p("path", {
1621
- "stroke-linecap": "round",
1622
- "stroke-linejoin": "round",
1623
- d: "M4.5 12.75l6 6 9-13.5"
1624
- }, null, -1)
1625
- ])])) : (g(), w("span", co)),
1626
- B(a.$slots, "item", fe({ ref_for: !0 }, { item: y.item }), () => [
1627
- p("span", null, L(y.item[a.labelKey]), 1)
1628
- ])
1629
- ], 10, io))), 128))
1630
- ], 64))), 128)) : (g(!0), w(I, { key: 2 }, J(C.value, (k) => (g(), w("button", {
1631
- key: k[a.valueKey],
1632
- class: T(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", R(k) ? "bg-gray-50 font-medium" : ""]),
1633
- role: "option",
1634
- "aria-selected": R(k),
1635
- onClick: (y) => D(k, () => q(l).close())
1636
- }, [
1637
- R(k) ? (g(), w("svg", fo, [...m[19] || (m[19] = [
1638
- p("path", {
1639
- "stroke-linecap": "round",
1640
- "stroke-linejoin": "round",
1641
- d: "M4.5 12.75l6 6 9-13.5"
1642
- }, null, -1)
1643
- ])])) : (g(), w("span", po)),
1644
- B(a.$slots, "item", fe({ ref_for: !0 }, { item: k }), () => [
1645
- p("span", null, L(k[a.labelKey]), 1)
1646
- ])
1647
- ], 10, uo))), 128)),
1648
- C.value.length === 0 && !a.allowEmpty ? (g(), w("div", mo, [
1649
- B(a.$slots, "empty", {}, () => [
1650
- m[20] || (m[20] = We(" Nothing found ", -1))
1651
- ])
1652
- ])) : _("", !0)
1653
- ]))
1654
- ])
1655
- ]),
1656
- _: 3
1657
- }, 8, ["useModal", "title"])) : _("", !0)
1658
- ], 64)) : (g(), ge(nn, {
1659
- key: 0,
1660
- stick: a.stick,
1661
- onOpen: G,
1662
- onClose: de
1663
- }, {
1664
- button: ae(({ onToggle: k, isExpanded: y }) => [
1665
- B(a.$slots, "button", me(he({ onToggle: k, isExpanded: y, selectedLabel: $.value })), () => [
1666
- p("button", {
1667
- class: T(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
1668
- a.view === "pill" ? "rounded-full bg-gray-100 px-3.5 py-1.5 hover:bg-gray-200 text-gray-700" : "rounded-lg border border-gray-300 bg-white px-3 py-2 hover:bg-gray-50 min-w-[180px]",
1669
- a.view === "default" && y ? "ring-1 ring-blue-500 border-blue-500" : ""
1670
- ]]),
1671
- style: ve(a.maxWidth ? { maxWidth: a.maxWidth } : void 0),
1672
- onClick: k
1673
- }, [
1674
- p("span", {
1675
- class: T(["truncate", a.view === "pill" ? "" : A.value ? "text-gray-900" : "text-gray-500"])
1676
- }, L($.value), 3),
1677
- (g(), w("svg", {
1678
- xmlns: "http://www.w3.org/2000/svg",
1679
- fill: "none",
1680
- viewBox: "0 0 24 24",
1681
- "stroke-width": "1.5",
1682
- stroke: "currentColor",
1683
- class: T(["w-4 h-4 text-gray-400 transition-transform shrink-0", y ? "rotate-180" : ""])
1684
- }, [...m[5] || (m[5] = [
1685
- p("path", {
1686
- "stroke-linecap": "round",
1687
- "stroke-linejoin": "round",
1688
- d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
1689
- }, null, -1)
1690
- ])], 2))
1691
- ], 14, _n)
1692
- ])
1693
- ]),
1694
- menu: ae(({ onToggle: k }) => [
1695
- p("div", {
1696
- class: "min-w-[240px] w-full",
1697
- onKeydown: (y) => U(y, k)
1698
- }, [
1699
- a.title ? (g(), w("div", En, L(a.title), 1)) : _("", !0),
1700
- a.searchable ? (g(), w("div", Sn, [
1701
- p("div", Tn, [
1702
- m[6] || (m[6] = p("svg", {
1703
- xmlns: "http://www.w3.org/2000/svg",
1704
- fill: "none",
1705
- viewBox: "0 0 24 24",
1706
- "stroke-width": "1.5",
1707
- stroke: "currentColor",
1708
- class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
1709
- }, [
1710
- p("path", {
1711
- "stroke-linecap": "round",
1712
- "stroke-linejoin": "round",
1713
- d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
1714
- })
1715
- ], -1)),
1716
- Se(p("input", {
1717
- ref_key: "searchInputRef",
1718
- ref: h,
1719
- "onUpdate:modelValue": m[0] || (m[0] = (y) => u.value = y),
1720
- type: "text",
1721
- placeholder: a.searchPlaceholder,
1722
- class: "w-full rounded-md border border-gray-300 py-1.5 pl-8 pr-3 text-sm outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",
1723
- onInput: re
1724
- }, null, 40, Vn), [
1725
- [je, u.value]
1726
- ])
1727
- ])
1728
- ])) : _("", !0),
1729
- a.createLabel ? (g(), w("div", Dn, [
1730
- p("button", {
1731
- class: "flex items-center gap-2 w-full px-3 py-2 text-sm text-blue-700 hover:bg-gray-50 transition-colors",
1732
- onClick: (y) => X(k)
1733
- }, [
1734
- m[7] || (m[7] = p("svg", {
1735
- xmlns: "http://www.w3.org/2000/svg",
1736
- fill: "none",
1737
- viewBox: "0 0 24 24",
1738
- "stroke-width": "1.5",
1739
- stroke: "currentColor",
1740
- class: "w-4 h-4"
1741
- }, [
1742
- p("path", {
1743
- "stroke-linecap": "round",
1744
- "stroke-linejoin": "round",
1745
- d: "M12 4.5v15m7.5-7.5h-15"
1746
- })
1747
- ], -1)),
1748
- p("span", null, L(a.createLabel), 1)
1749
- ], 8, Bn)
1750
- ])) : _("", !0),
1751
- a.multiple ? (g(), w("div", Fn, [
1752
- p("button", {
1753
- class: "text-xs text-blue-600 hover:text-blue-800 transition-colors",
1754
- onClick: H
1755
- }, " Обрати все "),
1756
- A.value ? (g(), w("button", {
1757
- key: 0,
1758
- class: "text-xs text-gray-500 hover:text-gray-700 transition-colors",
1759
- onClick: te
1760
- }, " Очистити ")) : _("", !0)
1761
- ])) : _("", !0),
1762
- a.isLoading ? (g(), w("div", Pn, [...m[8] || (m[8] = [
1763
- p("svg", {
1764
- class: "animate-spin h-5 w-5 text-gray-400",
1765
- xmlns: "http://www.w3.org/2000/svg",
1766
- fill: "none",
1767
- viewBox: "0 0 24 24"
1768
- }, [
1769
- p("circle", {
1770
- class: "opacity-25",
1771
- cx: "12",
1772
- cy: "12",
1773
- r: "10",
1774
- stroke: "currentColor",
1775
- "stroke-width": "4"
1776
- }),
1777
- p("path", {
1778
- class: "opacity-75",
1779
- fill: "currentColor",
1780
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
1781
- })
1782
- ], -1)
1783
- ])])) : (g(), w("div", {
1784
- key: 5,
1785
- ref_key: "listRef",
1786
- ref: x,
1787
- class: "max-h-[300px] overflow-y-auto",
1788
- role: "listbox"
1789
- }, [
1790
- a.allowEmpty ? (g(), w("button", {
1791
- key: 0,
1792
- ref: (y) => f(y, 0),
1793
- class: T(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
1794
- A.value ? "hover:bg-gray-50" : "bg-gray-100 font-medium",
1795
- d.value === 0 ? "bg-gray-50" : ""
1796
- ]]),
1797
- role: "option",
1798
- "aria-selected": !A.value,
1799
- onClick: (y) => D(null, k),
1800
- onMouseenter: m[1] || (m[1] = (y) => d.value = 0)
1801
- }, [
1802
- A.value ? (g(), w("span", In)) : (g(), w("svg", Wn, [...m[9] || (m[9] = [
1803
- p("path", {
1804
- "stroke-linecap": "round",
1805
- "stroke-linejoin": "round",
1806
- d: "M4.5 12.75l6 6 9-13.5"
1807
- }, null, -1)
1808
- ])])),
1809
- p("span", null, L(a.emptyLabel ?? a.placeholder), 1)
1810
- ], 42, jn)) : _("", !0),
1811
- a.groupKey ? (g(!0), w(I, { key: 1 }, J(O.value, (y, S) => (g(), w(I, {
1812
- key: y.label
1813
- }, [
1814
- y.label ? (g(), w("div", {
1815
- key: 0,
1816
- class: T(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", S > 0 ? "border-t border-gray-100 mt-1" : ""])
1817
- }, L(y.label), 3)) : _("", !0),
1818
- (g(!0), w(I, null, J(y.entries, (M) => (g(), w("button", {
1819
- key: M.item[a.valueKey],
1820
- ref_for: !0,
1821
- ref: (Me) => f(Me, M.flatIndex),
1822
- class: T(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
1823
- R(M.item) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
1824
- d.value === M.flatIndex ? "bg-gray-50" : ""
1825
- ]]),
1826
- role: "option",
1827
- "aria-selected": R(M.item),
1828
- onClick: (Me) => D(M.item, k),
1829
- onMouseenter: (Me) => d.value = M.flatIndex
1830
- }, [
1831
- R(M.item) ? (g(), w("svg", zn, [...m[10] || (m[10] = [
1832
- p("path", {
1833
- "stroke-linecap": "round",
1834
- "stroke-linejoin": "round",
1835
- d: "M4.5 12.75l6 6 9-13.5"
1836
- }, null, -1)
1837
- ])])) : (g(), w("span", Nn)),
1838
- B(a.$slots, "item", fe({ ref_for: !0 }, { item: M.item }), () => [
1839
- p("span", null, L(M.item[a.labelKey]), 1)
1840
- ])
1841
- ], 42, Kn))), 128))
1842
- ], 64))), 128)) : (g(!0), w(I, { key: 2 }, J(C.value, (y, S) => (g(), w("button", {
1843
- key: y[a.valueKey],
1844
- ref_for: !0,
1845
- ref: (M) => f(M, b.value + S),
1846
- class: T(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
1847
- R(y) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
1848
- d.value === b.value + S ? "bg-gray-50" : ""
1849
- ]]),
1850
- role: "option",
1851
- "aria-selected": R(y),
1852
- onClick: (M) => D(y, k),
1853
- onMouseenter: (M) => d.value = b.value + S
1854
- }, [
1855
- R(y) ? (g(), w("svg", Un, [...m[11] || (m[11] = [
1856
- p("path", {
1857
- "stroke-linecap": "round",
1858
- "stroke-linejoin": "round",
1859
- d: "M4.5 12.75l6 6 9-13.5"
1860
- }, null, -1)
1861
- ])])) : (g(), w("span", qn)),
1862
- B(a.$slots, "item", fe({ ref_for: !0 }, { item: y }), () => [
1863
- p("span", null, L(y[a.labelKey]), 1)
1864
- ])
1865
- ], 42, Hn))), 128)),
1866
- C.value.length === 0 && !a.allowEmpty ? (g(), w("div", Yn, [
1867
- B(a.$slots, "empty", {}, () => [
1868
- m[12] || (m[12] = We(" Nothing found ", -1))
1869
- ])
1870
- ])) : _("", !0)
1871
- ], 512))
1872
- ], 40, Ln)
1873
- ]),
1874
- _: 3
1875
- }, 8, ["stick"]));
1876
- }
1877
- });
1878
- export {
1879
- $n as O,
1880
- nn as _,
1881
- yo as a,
1882
- xo as b,
1883
- bo as c,
1884
- kn as m,
1885
- Mn as u
1886
- };