@oneb/ui-vue 0.3.30 → 0.3.32

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.
@@ -0,0 +1,922 @@
1
+ import { defineComponent as O, ref as B, provide as G, watch as J, nextTick as Q, onBeforeUnmount as X, computed as C, openBlock as t, createElementBlock as o, createElementVNode as e, renderSlot as E, normalizeProps as H, guardReactiveProps as P, createBlock as S, Teleport as Y, createCommentVNode as h, createVNode as _, Transition as R, withCtx as T, normalizeClass as z, toDisplayString as d, Fragment as $, inject as Z, withModifiers as ee, resolveDynamicComponent as V, renderList as F, mergeProps as te, unref as A } from "vue";
2
+ import { autoUpdate as oe, computePosition as ne, offset as se, shift as le } from "@floating-ui/dom";
3
+ import { flip as re } from "@floating-ui/vue";
4
+ import { _ as L } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
5
+ import { useOnebI18n as I } from "./i18n/index.js";
6
+ import { r as q } from "./XMarkIcon-51ef0691.js";
7
+ import { r as U } from "./ChevronDownIcon-6805ce6c.js";
8
+ import { r as W, a as ie } from "./ChevronRightIcon-4549a26b.js";
9
+ import { OneButton as ae } from "./button/index.js";
10
+ import { _ as K } from "./_plugin-vue_export-helper-dad06003.js";
11
+ const ce = {
12
+ title: {
13
+ type: String
14
+ },
15
+ stick: {
16
+ type: String,
17
+ default: "right"
18
+ },
19
+ appendBody: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ trigger: {
24
+ type: String,
25
+ default: "click"
26
+ },
27
+ offset: {
28
+ type: Number,
29
+ default: 5
30
+ }
31
+ }, ue = {
32
+ variant: {
33
+ type: String,
34
+ default: "primary"
35
+ },
36
+ label: {
37
+ type: String
38
+ },
39
+ icon: {
40
+ type: [Function, Object]
41
+ }
42
+ }, It = {
43
+ modelValue: {
44
+ type: [Object, Array],
45
+ default: null
46
+ },
47
+ multiple: {
48
+ type: Boolean,
49
+ default: !1
50
+ },
51
+ items: {
52
+ type: Array,
53
+ default: () => []
54
+ },
55
+ title: {
56
+ type: String
57
+ },
58
+ placeholder: {
59
+ type: String,
60
+ default: "Select"
61
+ },
62
+ searchPlaceholder: {
63
+ type: String,
64
+ default: "Search"
65
+ },
66
+ labelKey: {
67
+ type: String,
68
+ default: "label"
69
+ },
70
+ valueKey: {
71
+ type: String,
72
+ default: "id"
73
+ },
74
+ stick: {
75
+ type: String,
76
+ default: "bottom-start"
77
+ },
78
+ allowEmpty: {
79
+ type: Boolean,
80
+ default: !1
81
+ },
82
+ emptyLabel: {
83
+ type: String
84
+ },
85
+ createLabel: {
86
+ type: String
87
+ },
88
+ searchable: {
89
+ type: Boolean,
90
+ default: !0
91
+ },
92
+ isLoading: {
93
+ type: Boolean,
94
+ default: !1
95
+ },
96
+ groupKey: {
97
+ type: String
98
+ },
99
+ maxWidth: {
100
+ type: String
101
+ },
102
+ view: {
103
+ type: String,
104
+ default: "default"
105
+ }
106
+ }, de = ["data-opened"], pe = {
107
+ key: 0,
108
+ class: "text-sm text-secondary-content px-3 py-2 text-left"
109
+ }, he = {
110
+ key: 0,
111
+ class: "text-sm text-secondary-content px-3 py-2 text-left"
112
+ }, fe = /* @__PURE__ */ O({
113
+ __name: "OneDropdown",
114
+ props: ce,
115
+ emits: ["open", "close"],
116
+ setup(y, { emit: f }) {
117
+ const c = B(!1), v = B(null), w = B(null), a = B(null), i = f, n = y, u = () => {
118
+ c.value = !c.value, c.value ? i("open") : i("close");
119
+ };
120
+ let m = null;
121
+ const g = () => {
122
+ n.trigger === "hover" && (m && (clearTimeout(m), m = null), c.value || (c.value = !0, i("open")));
123
+ }, p = () => {
124
+ n.trigger === "hover" && (m = setTimeout(() => {
125
+ c.value && (c.value = !1, i("close"));
126
+ }, 100));
127
+ };
128
+ G("OneDropdown", {
129
+ onToggle: u
130
+ });
131
+ let x = null;
132
+ function b() {
133
+ !w.value || !a.value || ne(w.value, a.value, {
134
+ placement: n.stick ? n.stick : "bottom-start",
135
+ strategy: "fixed",
136
+ middleware: [se(n.offset), re(), le({ padding: 8 })]
137
+ }).then(({ x: s, y: r }) => {
138
+ a.value && Object.assign(a.value.style, {
139
+ left: `${s}px`,
140
+ top: `${r}px`,
141
+ visibility: "visible"
142
+ });
143
+ });
144
+ }
145
+ J(c, async (s) => {
146
+ n.appendBody && (s ? (await Q(), w.value && a.value && (a.value.style.visibility = "hidden", b(), x = oe(w.value, a.value, b))) : x && (x(), x = null));
147
+ }), X(() => {
148
+ x && x();
149
+ });
150
+ const k = C(() => {
151
+ var j;
152
+ if (n.appendBody)
153
+ return "";
154
+ const s = (j = v.value) == null ? void 0 : j.getBoundingClientRect(), r = s ? s.x < 270 : !1;
155
+ return s && s.top + 270 > window.innerHeight ? "up" + (r ? "-right" : "-left") : "down" + (r ? "-right" : "-left");
156
+ }), M = C(() => {
157
+ const s = [
158
+ "absolute z-10 w-fit rounded-md bg-white",
159
+ "py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
160
+ "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
161
+ ];
162
+ return k.value.startsWith("up") ? s.push("bottom-1 mb-10") : k.value.startsWith("down") && s.push("top-1 mt-10"), n.stick === "right" ? s.push("right-0") : n.stick === "left" && s.push("left-0"), s;
163
+ }), l = C(() => [
164
+ "fixed z-[10000] w-fit rounded-md bg-white",
165
+ "py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
166
+ "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
167
+ ]);
168
+ return (s, r) => (t(), o("div", {
169
+ class: "relative inline-block",
170
+ ref_key: "containerRef",
171
+ ref: v,
172
+ "data-opened": c.value,
173
+ onMouseenter: g,
174
+ onMouseleave: p
175
+ }, [
176
+ e("div", {
177
+ ref_key: "buttonRef",
178
+ ref: w
179
+ }, [
180
+ E(s.$slots, "button", H(P({ onToggle: u, isExpanded: c.value })))
181
+ ], 512),
182
+ n.appendBody ? (t(), S(Y, {
183
+ key: 0,
184
+ to: "body"
185
+ }, [
186
+ c.value && s.trigger === "click" ? (t(), o("div", {
187
+ key: 0,
188
+ class: "fixed top-0 left-0 w-screen h-screen z-[9999]",
189
+ onClick: u
190
+ })) : h("", !0),
191
+ _(R, {
192
+ "enter-active-class": "transition ease-out duration-100",
193
+ "enter-from-class": "transform opacity-0 scale-95",
194
+ "enter-to-class": "transform opacity-100 scale-100",
195
+ "leave-active-class": "transition ease-in duration-75",
196
+ "leave-from-class": "transform opacity-100 scale-100",
197
+ "leave-to-class": "transform opacity-0 scale-95"
198
+ }, {
199
+ default: T(() => [
200
+ c.value ? (t(), o("div", {
201
+ key: 0,
202
+ ref_key: "menuRef",
203
+ ref: a,
204
+ class: z(["menu", l.value]),
205
+ role: "menu",
206
+ "aria-orientation": "vertical",
207
+ tabindex: "-1",
208
+ onMouseenter: g,
209
+ onMouseleave: p
210
+ }, [
211
+ s.title ? (t(), o("div", pe, d(s.title), 1)) : h("", !0),
212
+ E(s.$slots, "menu", H(P({ onToggle: u })))
213
+ ], 34)) : h("", !0)
214
+ ]),
215
+ _: 3
216
+ })
217
+ ])) : (t(), o($, { key: 1 }, [
218
+ c.value && s.trigger === "click" ? (t(), o("div", {
219
+ key: 0,
220
+ class: "fixed top-0 left-0 w-screen h-screen z-10",
221
+ onClick: u
222
+ })) : h("", !0),
223
+ _(R, {
224
+ "enter-active-class": "transition ease-out duration-100",
225
+ "enter-from-class": "transform opacity-0 scale-95",
226
+ "enter-to-class": "transform opacity-100 scale-100",
227
+ "leave-active-class": "transition ease-in duration-75",
228
+ "leave-from-class": "transform opacity-100 scale-100",
229
+ "leave-to-class": "transform opacity-0 scale-95"
230
+ }, {
231
+ default: T(() => [
232
+ c.value ? (t(), o("div", {
233
+ key: 0,
234
+ class: z(["menu", M.value]),
235
+ role: "menu",
236
+ "aria-orientation": "vertical",
237
+ tabindex: "-1"
238
+ }, [
239
+ s.title ? (t(), o("div", he, d(s.title), 1)) : h("", !0),
240
+ E(s.$slots, "menu", H(P({ onToggle: u })))
241
+ ], 2)) : h("", !0)
242
+ ]),
243
+ _: 3
244
+ })
245
+ ], 64))
246
+ ], 40, de));
247
+ }
248
+ }), N = /* @__PURE__ */ O({
249
+ __name: "OneDropdownItem",
250
+ props: ue,
251
+ emits: ["click"],
252
+ setup(y, { emit: f }) {
253
+ const c = f, v = y, w = Z("OneDropdown"), a = () => {
254
+ w !== void 0 && w.onToggle(), c("click");
255
+ }, i = C(() => {
256
+ const n = [];
257
+ return v.variant === "secondary" ? n.push("text-secondary-content hover:bg-secondary-body-hover") : v.variant === "danger" ? n.push("text-danger-content hover:bg-danger-10") : v.variant === "warning" ? n.push("text-warning-content hover:bg-warning-10") : v.variant === "info" ? n.push("text-info-content hover:bg-info-10") : n.push("hover:bg-secondary-body-hover"), n;
258
+ });
259
+ return (n, u) => (t(), o("button", {
260
+ class: z(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", i.value]),
261
+ onClick: ee(a, ["prevent"])
262
+ }, [
263
+ n.icon ? (t(), S(V(n.icon), {
264
+ key: 0,
265
+ class: "w-4 h-4"
266
+ })) : h("", !0),
267
+ e("span", null, d(n.label), 1)
268
+ ], 2));
269
+ }
270
+ });
271
+ function ve(y, f) {
272
+ return t(), o("svg", {
273
+ xmlns: "http://www.w3.org/2000/svg",
274
+ fill: "none",
275
+ viewBox: "0 0 24 24",
276
+ "stroke-width": "1.8",
277
+ stroke: "currentColor",
278
+ "aria-hidden": "true"
279
+ }, [
280
+ e("path", {
281
+ "stroke-linecap": "round",
282
+ "stroke-linejoin": "round",
283
+ d: "M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"
284
+ })
285
+ ]);
286
+ }
287
+ const me = {
288
+ user: {
289
+ type: Object,
290
+ required: !0
291
+ },
292
+ menu: {
293
+ type: Array,
294
+ default: () => []
295
+ },
296
+ iconSize: {
297
+ type: String,
298
+ default: "34"
299
+ },
300
+ app: {
301
+ type: Object
302
+ },
303
+ onAccount: {
304
+ type: Function
305
+ },
306
+ onLogout: {
307
+ type: Function
308
+ },
309
+ t: {
310
+ type: Function
311
+ }
312
+ }, xe = {
313
+ workspace: {
314
+ type: Object,
315
+ required: !0
316
+ },
317
+ workspaces: {
318
+ type: Array
319
+ },
320
+ apps: {
321
+ type: Array,
322
+ required: !0
323
+ },
324
+ iconSize: {
325
+ type: String,
326
+ default: "24"
327
+ },
328
+ onChange: {
329
+ type: Function
330
+ },
331
+ onApp: {
332
+ type: Function
333
+ },
334
+ t: {
335
+ type: Function
336
+ }
337
+ }, ye = {
338
+ help: {
339
+ type: Object
340
+ },
341
+ // Project slug for the default "Reference" link → oneb.app/help/{slug}
342
+ helpSlug: {
343
+ type: String
344
+ },
345
+ t: {
346
+ type: Function
347
+ }
348
+ }, ge = ["onClick"], _e = { class: "flex flex-col items-center pt-5 pb-2 h-full" }, we = { class: "flex flex-col px-10 py-1 mt-2 text-center" }, ke = { class: "self-center text-base font-medium tracking-wide text-black" }, be = { class: "mt-1 text-xs leading-5 text-blue-500 font-light" }, Ce = { class: "text-left w-full mt-5 px-3" }, $e = { class: "-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400" }, Rt = /* @__PURE__ */ O({
349
+ __name: "OneUserMenu",
350
+ props: me,
351
+ setup(y) {
352
+ const f = y, c = I(), v = C(() => f.t ?? c), w = C(() => {
353
+ var n;
354
+ return (n = f.menu) == null ? void 0 : n.map((u) => {
355
+ let m = { label: u.label };
356
+ u.icon != null && (m = { ...m, icon: u.icon });
357
+ const g = typeof u.click == "function" ? u.click : () => {
358
+ };
359
+ return {
360
+ key: u.label,
361
+ args: m,
362
+ click: g
363
+ };
364
+ });
365
+ }), a = () => {
366
+ typeof f.onAccount == "function" && f.onAccount();
367
+ }, i = () => {
368
+ typeof f.onLogout == "function" && f.onLogout();
369
+ };
370
+ return (n, u) => (t(), S(fe, { stick: "right" }, {
371
+ button: T(({ onToggle: m, isExpanded: g }) => {
372
+ var p, x;
373
+ return [
374
+ e("button", {
375
+ onClick: m,
376
+ class: z(["p-1 rounded-full hover:bg-secondary-10", [g ? "bg-secondary-25" : ""]])
377
+ }, [
378
+ _(L, {
379
+ text: ((p = n.user) == null ? void 0 : p.name) || "",
380
+ size: n.iconSize,
381
+ src: (x = n.user) == null ? void 0 : x.photo_url,
382
+ rounded: !0
383
+ }, null, 8, ["text", "size", "src"])
384
+ ], 10, ge)
385
+ ];
386
+ }),
387
+ menu: T(() => {
388
+ var m, g, p, x, b;
389
+ return [
390
+ e("div", _e, [
391
+ _(L, {
392
+ text: ((m = n.user) == null ? void 0 : m.name) || "",
393
+ size: 80,
394
+ src: (g = n.user) == null ? void 0 : g.photo_url,
395
+ rounded: !0,
396
+ class: "mx-auto"
397
+ }, null, 8, ["text", "src"]),
398
+ e("div", we, [
399
+ e("div", ke, d((p = n.user) == null ? void 0 : p.name), 1),
400
+ e("div", be, d((x = n.user) == null ? void 0 : x.email), 1)
401
+ ]),
402
+ typeof f.onAccount == "function" ? (t(), o("a", {
403
+ key: 0,
404
+ onClick: a,
405
+ class: "cursor-pointer justify-center px-8 py-2 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"
406
+ }, d(v.value("ui.layout.account")), 1)) : h("", !0),
407
+ e("div", Ce, [
408
+ (t(!0), o($, null, F(w.value, (k) => (t(), S(N, te({
409
+ key: k.key
410
+ }, { ref_for: !0 }, k.args, {
411
+ onClick: k.click
412
+ }), null, 16, ["onClick"]))), 128)),
413
+ typeof n.onLogout == "function" ? (t(), S(N, {
414
+ key: 0,
415
+ icon: A(ve),
416
+ label: v.value("ui.layout.logout"),
417
+ class: "rounded py-3",
418
+ onClick: i
419
+ }, null, 8, ["icon", "label"])) : h("", !0)
420
+ ]),
421
+ u[0] || (u[0] = e("div", {
422
+ class: "space-y-2 text-center",
423
+ style: { width: "240px" }
424
+ }, null, -1)),
425
+ e("div", $e, d((b = n.app) == null ? void 0 : b.version), 1)
426
+ ])
427
+ ];
428
+ }),
429
+ _: 1
430
+ }));
431
+ }
432
+ });
433
+ function Ae(y, f) {
434
+ return t(), o("svg", {
435
+ xmlns: "http://www.w3.org/2000/svg",
436
+ fill: "none",
437
+ viewBox: "0 0 24 24",
438
+ "stroke-width": "1.8",
439
+ stroke: "currentColor",
440
+ "aria-hidden": "true"
441
+ }, [
442
+ e("rect", {
443
+ width: "2.94",
444
+ height: "2.94",
445
+ x: "17.16",
446
+ y: "3.9",
447
+ fill: "currentColor",
448
+ "stroke-width": "1.8",
449
+ rx: "1.1"
450
+ }),
451
+ e("rect", {
452
+ width: "2.94",
453
+ height: "2.94",
454
+ x: "10.53",
455
+ y: "3.9",
456
+ fill: "currentColor",
457
+ "stroke-width": "1.8",
458
+ rx: "1.1"
459
+ }),
460
+ e("rect", {
461
+ width: "2.94",
462
+ height: "2.94",
463
+ x: "3.9",
464
+ y: "3.9",
465
+ fill: "currentColor",
466
+ "stroke-width": "1.8",
467
+ rx: "1.1"
468
+ }),
469
+ e("rect", {
470
+ width: "2.94",
471
+ height: "2.94",
472
+ x: "17.16",
473
+ y: "10.53",
474
+ fill: "currentColor",
475
+ "stroke-width": "1.8",
476
+ rx: "1.1"
477
+ }),
478
+ e("rect", {
479
+ width: "2.94",
480
+ height: "2.94",
481
+ x: "10.53",
482
+ y: "10.53",
483
+ fill: "currentColor",
484
+ "stroke-width": "1.8",
485
+ rx: "1.1"
486
+ }),
487
+ e("rect", {
488
+ width: "2.94",
489
+ height: "2.94",
490
+ x: "3.9",
491
+ y: "10.53",
492
+ fill: "currentColor",
493
+ "stroke-width": "1.8",
494
+ rx: "1.1"
495
+ }),
496
+ e("rect", {
497
+ width: "2.94",
498
+ height: "2.94",
499
+ x: "17.16",
500
+ y: "17.16",
501
+ fill: "currentColor",
502
+ "stroke-width": "1.8",
503
+ rx: "1.1"
504
+ }),
505
+ e("rect", {
506
+ width: "2.94",
507
+ height: "2.94",
508
+ x: "10.53",
509
+ y: "17.16",
510
+ fill: "currentColor",
511
+ "stroke-width": "1.8",
512
+ rx: "1.1"
513
+ }),
514
+ e("rect", {
515
+ width: "2.94",
516
+ height: "2.94",
517
+ x: "3.9",
518
+ y: "17.16",
519
+ fill: "currentColor",
520
+ "stroke-width": "1.8",
521
+ rx: "1.1"
522
+ })
523
+ ]);
524
+ }
525
+ const Be = ["data-opened"], Fe = {
526
+ key: 1,
527
+ class: "absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"
528
+ }, Se = { class: "flex justify-between items-center pt-3 mb-3" }, Me = { class: "font-semibold text-xl px-3" }, je = { class: "grid" }, ze = { class: "rounded-lg m-3 border" }, Le = {
529
+ class: "space-x-2 flex items-center px-3 py-2",
530
+ style: { width: "300px" }
531
+ }, Oe = { class: "flex justify-between relative" }, Te = { class: "flex items-center justify-between w-full text-left text-sm font-semibold" }, Ee = { key: 0 }, He = { class: "text-xs font-semibold" }, Pe = { class: "px-3 py-2" }, Ve = { class: "text-secondary-content text-left pb-1 text-xs uppercase" }, Ie = { class: "overflow-auto max-h-full" }, Re = {
532
+ key: 0,
533
+ class: "space-y-2"
534
+ }, Ne = ["onClick"], De = { class: "flex" }, qe = { class: "border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center" }, Ue = { class: "pl-2" }, We = { class: "text-sm mt-1 font-semibold" }, Ke = { class: "text9 mt-1" }, Ge = {
535
+ key: 1,
536
+ class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"
537
+ }, Je = /* @__PURE__ */ O({
538
+ __name: "OneBrowserMenu",
539
+ props: xe,
540
+ emits: ["open", "close"],
541
+ setup(y, { emit: f }) {
542
+ const c = f, v = y, w = I(), a = C(() => v.t ?? w), i = B(!1), n = () => {
543
+ i.value = !i.value, i.value ? c("open") : c("close");
544
+ }, u = B(!1);
545
+ C(() => u.value ? W : U);
546
+ const m = () => {
547
+ typeof v.onChange == "function" && v.onChange();
548
+ }, g = (p) => {
549
+ typeof v.onApp == "function" && v.onApp(p);
550
+ };
551
+ return (p, x) => {
552
+ var b, k, M;
553
+ return t(), o("div", { "data-opened": i.value }, [
554
+ e("button", {
555
+ onClick: n,
556
+ class: z(["sm:p-1 sm:w-[44px] sm:h-[44px] w-8 h-8 rounded-md hover:bg-secondary-10 flex", { "bg-secondary-10": i.value }])
557
+ }, [
558
+ _(A(Ae), { class: "text-secondary-base w-full p-1 hover:text-blue-600 m-auto" })
559
+ ], 2),
560
+ i.value ? (t(), o("div", {
561
+ key: 0,
562
+ class: "fixed top-0 left-0 w-screen h-screen z-10 bg-black/10",
563
+ onClick: n
564
+ })) : h("", !0),
565
+ i.value ? (t(), o("div", Fe, [
566
+ e("div", Se, [
567
+ e("div", Me, d(a.value("ui.layout.workspaces")), 1),
568
+ _(A(q), {
569
+ class: "w-6 cursor-pointer",
570
+ onClick: n
571
+ })
572
+ ]),
573
+ e("div", je, [
574
+ e("div", ze, [
575
+ e("div", Le, [
576
+ e("div", Oe, [
577
+ _(L, {
578
+ text: ((b = p.workspace) == null ? void 0 : b.name) || "",
579
+ src: (k = p.workspace) == null ? void 0 : k.photo_url,
580
+ size: 44,
581
+ rounded: !1,
582
+ class: "mx-auto"
583
+ }, null, 8, ["text", "src"])
584
+ ]),
585
+ e("div", Te, d((M = p.workspace) == null ? void 0 : M.name), 1)
586
+ ]),
587
+ u.value ? (t(), o("div", Ee, [
588
+ (t(!0), o($, null, F(p.workspaces, (l) => (t(), o("div", {
589
+ key: l.name,
590
+ class: "flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"
591
+ }, [
592
+ _(L, {
593
+ text: l.name,
594
+ src: l.photo_url,
595
+ size: 30,
596
+ rounded: !1
597
+ }, null, 8, ["text", "src"]),
598
+ e("span", He, d(l.name), 1)
599
+ ]))), 128))
600
+ ])) : h("", !0),
601
+ x[0] || (x[0] = e("hr", null, null, -1)),
602
+ e("div", {
603
+ onClick: m,
604
+ class: "text-center py-2 cursor-pointer",
605
+ style: { "font-size": "10px" }
606
+ }, d(a.value("ui.layout.change_workspace")), 1)
607
+ ])
608
+ ]),
609
+ e("div", Pe, [
610
+ e("div", Ve, d(a.value("ui.layout.apps")), 1),
611
+ e("div", Ie, [
612
+ p.apps && p.apps.length ? (t(), o("div", Re, [
613
+ (t(!0), o($, null, F(p.apps, (l) => (t(), o("div", {
614
+ key: l.id,
615
+ onClick: (s) => g(l),
616
+ class: "flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"
617
+ }, [
618
+ e("div", De, [
619
+ e("div", qe, [
620
+ _(L, {
621
+ text: l.name,
622
+ src: l.photo_url,
623
+ size: 44,
624
+ rounded: !1
625
+ }, null, 8, ["text", "src"])
626
+ ]),
627
+ e("div", Ue, [
628
+ e("p", We, d(l.name), 1),
629
+ e("p", Ke, d(l == null ? void 0 : l.short), 1)
630
+ ])
631
+ ]),
632
+ e("div", null, [
633
+ _(ae, {
634
+ variant: "touch",
635
+ icon: A(ie),
636
+ onClick: (s) => g(l)
637
+ }, null, 8, ["icon", "onClick"])
638
+ ])
639
+ ], 8, Ne))), 128))
640
+ ])) : h("", !0),
641
+ p.apps && p.apps.length ? (t(), o("button", Ge, d(a.value("ui.layout.view_all")), 1)) : h("", !0)
642
+ ])
643
+ ])
644
+ ])) : h("", !0)
645
+ ], 8, Be);
646
+ };
647
+ }
648
+ });
649
+ const Nt = /* @__PURE__ */ K(Je, [["__scopeId", "data-v-3675784e"]]);
650
+ function D(y, f) {
651
+ return t(), o("svg", {
652
+ xmlns: "http://www.w3.org/2000/svg",
653
+ fill: "none",
654
+ viewBox: "0 0 24 24",
655
+ "stroke-width": "1.8",
656
+ stroke: "currentColor",
657
+ "aria-hidden": "true"
658
+ }, [
659
+ e("path", {
660
+ "stroke-linecap": "round",
661
+ "stroke-linejoin": "round",
662
+ d: "M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"
663
+ })
664
+ ]);
665
+ }
666
+ function Qe(y, f) {
667
+ return t(), o("svg", {
668
+ xmlns: "http://www.w3.org/2000/svg",
669
+ fill: "none",
670
+ viewBox: "0 0 24 24",
671
+ "stroke-width": "1.8",
672
+ stroke: "currentColor",
673
+ "aria-hidden": "true"
674
+ }, [
675
+ e("path", {
676
+ "stroke-linecap": "round",
677
+ "stroke-linejoin": "round",
678
+ d: "M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
679
+ }),
680
+ e("path", {
681
+ "stroke-linecap": "round",
682
+ "stroke-linejoin": "round",
683
+ d: "M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"
684
+ })
685
+ ]);
686
+ }
687
+ function Xe(y, f) {
688
+ return t(), o("svg", {
689
+ xmlns: "http://www.w3.org/2000/svg",
690
+ fill: "none",
691
+ viewBox: "0 0 24 24",
692
+ "stroke-width": "1.8",
693
+ stroke: "currentColor",
694
+ "aria-hidden": "true"
695
+ }, [
696
+ e("path", {
697
+ "stroke-linecap": "round",
698
+ "stroke-linejoin": "round",
699
+ d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"
700
+ })
701
+ ]);
702
+ }
703
+ function Ye(y, f) {
704
+ return t(), o("svg", {
705
+ xmlns: "http://www.w3.org/2000/svg",
706
+ fill: "none",
707
+ viewBox: "0 0 24 24",
708
+ "stroke-width": "1.8",
709
+ stroke: "currentColor",
710
+ "aria-hidden": "true"
711
+ }, [
712
+ e("path", {
713
+ "stroke-linecap": "round",
714
+ "stroke-linejoin": "round",
715
+ d: "M8.625 9.75a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 01.778-.332 48.294 48.294 0 005.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"
716
+ })
717
+ ]);
718
+ }
719
+ function Ze(y, f) {
720
+ return t(), o("svg", {
721
+ xmlns: "http://www.w3.org/2000/svg",
722
+ fill: "none",
723
+ viewBox: "0 0 24 24",
724
+ "stroke-width": "1.8",
725
+ stroke: "currentColor",
726
+ "aria-hidden": "true"
727
+ }, [
728
+ e("path", {
729
+ "stroke-linecap": "round",
730
+ "stroke-linejoin": "round",
731
+ d: "M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"
732
+ })
733
+ ]);
734
+ }
735
+ const et = ["data-opened"], tt = {
736
+ key: 1,
737
+ class: "absolute top-0 right-0 h-screen max-w-96 bg-white px-3 z-10 flex flex-col"
738
+ }, ot = { class: "flex justify-between items-center pt-3 mb-3" }, nt = { class: "font-semibold text-xl px-3" }, st = {
739
+ key: 0,
740
+ class: "grid grid-cols-3 bg-[#FAFAFA] rounded-xl text-[#525B66] mb-2"
741
+ }, lt = ["onClick"], rt = { class: "uppercase text-[8px]" }, it = { class: "overflow-y-auto grid rounded-xl" }, at = { class: "max-h-full bg-[#FAFAFA]" }, ct = {
742
+ key: 0,
743
+ class: "space-y-2"
744
+ }, ut = ["onClick"], dt = { class: "flex" }, pt = { class: "pl-2" }, ht = { class: "text-sm mt-1 font-semibold" }, ft = { class: "text-[10px] mt-1 text-[#979CA9]" }, vt = { class: "mt-auto" }, mt = { key: 0 }, xt = ["onClick"], yt = { class: "flex items-center space-x-3" }, gt = { class: "h-16" }, _t = {
745
+ key: 0,
746
+ class: "bg-[#FAFAFA] rounded-lg p-3"
747
+ }, wt = { class: "flex justify-between" }, kt = ["onClick"], bt = {
748
+ key: 0,
749
+ class: "tooltip-text min-w-[70px]"
750
+ }, Ct = { class: "flex justify-between mb-4" }, $t = ["href"], At = { class: "flex flex-nowrap items-center w-max h-[24px]" }, Bt = { class: "whitespace-nowrap overflow-hidden text-ellipsis text-left flex-shrink w-full text-[#525B66]" }, Ft = { class: "py-[8px] pl-0 pr-[8px]" }, St = /* @__PURE__ */ O({
751
+ __name: "OneHelpMenu",
752
+ props: ye,
753
+ emits: ["open", "close"],
754
+ setup(y, { emit: f }) {
755
+ const c = f, v = y, w = I(), a = C(() => v.t ?? w), i = C(() => {
756
+ const l = v.help ?? {};
757
+ return {
758
+ label: l.label ?? a.value("ui.help.title"),
759
+ social: l.social ?? a.value("ui.help.social"),
760
+ socialButt: l.socialButt ?? a.value("ui.help.social"),
761
+ buttMore: l.buttMore ?? a.value("ui.help.more"),
762
+ buttNoMore: l.buttNoMore ?? a.value("ui.help.hide"),
763
+ helpButton: l.helpButton ?? [
764
+ { name: a.value("ui.help.support"), link: "https://t.me/onebapp_bot", icon: Ye },
765
+ {
766
+ name: a.value("ui.help.reference"),
767
+ link: v.helpSlug ? `https://oneb.app/help/${v.helpSlug}` : "https://oneb.app/help",
768
+ icon: D
769
+ },
770
+ { name: a.value("ui.help.leave_request"), link: "https://oneb.app/support", icon: Ze }
771
+ ],
772
+ helpList: l.helpList ?? [],
773
+ video: l.video ?? [],
774
+ socialList: l.socialList ?? [],
775
+ termsOffer: l.termsOffer ?? [
776
+ { name: a.value("ui.help.terms"), link: "https://oneb.app/terms-of-service" },
777
+ { name: a.value("ui.help.offer"), link: "https://oneb.app/offer" }
778
+ ]
779
+ };
780
+ }), n = B(!1), u = () => {
781
+ n.value = !n.value, n.value ? c("open") : c("close");
782
+ }, m = C(() => k.value ? W : U), g = B(3), p = C(() => {
783
+ var s;
784
+ const l = ((s = i.value.helpList) == null ? void 0 : s.length) || 0;
785
+ return g.value === l;
786
+ });
787
+ C(() => (i.value.helpList || []).slice(0, g.value));
788
+ const x = () => {
789
+ var s;
790
+ const l = ((s = i.value.helpList) == null ? void 0 : s.length) || 0;
791
+ g.value = p.value ? 3 : l;
792
+ }, b = (l, s) => {
793
+ l && s && typeof s.openLink == "function" ? s.openLink(s) : l && window.open(l, "_blank");
794
+ }, k = B(!1), M = () => {
795
+ k.value = !k.value;
796
+ };
797
+ return (l, s) => (t(), o("div", { "data-opened": n.value }, [
798
+ e("button", {
799
+ onClick: u,
800
+ class: z(["sm:p-1 sm:w-[44px] sm:h-[44px] w-8 h-8 rounded-md hover:bg-secondary-10 flex", { "bg-secondary-10": n.value }])
801
+ }, [
802
+ _(A(D), { class: "text-secondary-base w-full p-1 hover:text-blue-600 m-auto" })
803
+ ], 2),
804
+ n.value ? (t(), o("div", {
805
+ key: 0,
806
+ class: "fixed top-0 left-0 w-screen h-screen z-10 bg-black/10 flex flex-col",
807
+ onClick: u
808
+ })) : h("", !0),
809
+ n.value ? (t(), o("div", tt, [
810
+ e("div", ot, [
811
+ e("div", nt, d(i.value.label), 1),
812
+ _(A(q), {
813
+ class: "w-6 cursor-pointer",
814
+ onClick: u
815
+ })
816
+ ]),
817
+ i.value.helpButton ? (t(), o("div", st, [
818
+ (t(!0), o($, null, F(i.value.helpButton, (r) => (t(), o("button", {
819
+ key: r.name,
820
+ onClick: (j) => b(r.link, r),
821
+ class: "grid justify-center space-y-2 hover:bg-slate-100 p-3 rounded-xl hover:text-blue-500"
822
+ }, [
823
+ e("div", null, [
824
+ (t(), S(V(r == null ? void 0 : r.icon), { class: "w-[16px] h-[16px] mx-auto" }))
825
+ ]),
826
+ e("span", rt, d(r.name), 1)
827
+ ], 8, lt))), 128))
828
+ ])) : h("", !0),
829
+ e("div", it, [
830
+ e("div", at, [
831
+ i.value.helpList && i.value.helpList.length ? (t(), o("div", ct, [
832
+ (t(!0), o($, null, F(i.value.helpList, (r) => (t(), o("div", {
833
+ key: r.id,
834
+ onClick: (j) => b(r.link, r),
835
+ class: "flex justify-between items-center rounded-lg hover:bg-slate-100 p-2 cursor-pointer hover:text-[#4089E0]"
836
+ }, [
837
+ e("div", dt, [
838
+ e("div", pt, [
839
+ e("p", ht, d(r.name), 1),
840
+ e("p", ft, d(r.category), 1)
841
+ ])
842
+ ])
843
+ ], 8, ut))), 128))
844
+ ])) : h("", !0)
845
+ ])
846
+ ]),
847
+ i.value.helpList && i.value.helpList.length < 0 ? (t(), o("button", {
848
+ key: 1,
849
+ onClick: x,
850
+ class: "h-11 w-full bg-[#FAFAFA] hover:bg-slate-100 p-3 text-[#525B66] rounded-b-xl text-xs hover:text-[#4089E0] font-medium"
851
+ }, d(p.value ? i.value.buttNoMore : i.value.buttMore), 1)) : h("", !0),
852
+ e("div", vt, [
853
+ i.value.video ? (t(), o("div", mt, [
854
+ (t(!0), o($, null, F(i.value.video, (r) => (t(), o("button", {
855
+ key: r.id,
856
+ onClick: (j) => b(r.link, r),
857
+ class: "flex items-center space-x-3 mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"
858
+ }, [
859
+ _(A(Qe), { class: "w-6 h-6" }),
860
+ e("span", null, d(r.name), 1)
861
+ ], 8, xt))), 128))
862
+ ])) : h("", !0),
863
+ i.value.socialList ? (t(), o("button", {
864
+ key: 1,
865
+ onClick: M,
866
+ class: "flex items-center justify-between mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"
867
+ }, [
868
+ e("div", yt, [
869
+ _(A(Xe), { class: "w-6 h-6" }),
870
+ e("span", null, d(i.value.socialButt), 1)
871
+ ]),
872
+ _(A(m), { class: "w-4 h-4" })
873
+ ])) : h("", !0),
874
+ e("div", gt, [
875
+ k.value ? (t(), o("div", _t, [
876
+ e("div", wt, [
877
+ (t(!0), o($, null, F(i.value.socialList, (r) => (t(), o("button", {
878
+ key: r.id,
879
+ onClick: (j) => b(r.link, r),
880
+ class: "flex items-center space-x-2 p-2 rounded-lg hover:bg-slate-100 hover:text-blue-500 tooltip"
881
+ }, [
882
+ e("div", null, [
883
+ r.name ? (t(), o("div", bt, d(r.name), 1)) : h("", !0),
884
+ (t(), S(V(r == null ? void 0 : r.icon), { class: "w-[24px] h-[24px] mx-auto" }))
885
+ ])
886
+ ], 8, kt))), 128))
887
+ ])
888
+ ])) : h("", !0)
889
+ ]),
890
+ e("div", Ct, [
891
+ (t(!0), o($, null, F(i.value.termsOffer, (r) => (t(), o("a", {
892
+ key: r.name,
893
+ target: "_blank",
894
+ href: r.link,
895
+ class: "ml-2 flex items-center rounded-lg text-xs hover:underline font-extralight cursor-pointer"
896
+ }, [
897
+ e("div", At, [
898
+ e("div", Bt, [
899
+ e("span", Ft, d(r.name), 1)
900
+ ])
901
+ ])
902
+ ], 8, $t))), 128))
903
+ ])
904
+ ])
905
+ ])) : h("", !0)
906
+ ], 8, et));
907
+ }
908
+ });
909
+ const Dt = /* @__PURE__ */ K(St, [["__scopeId", "data-v-56eccaba"]]);
910
+ export {
911
+ Nt as O,
912
+ fe as _,
913
+ N as a,
914
+ Rt as b,
915
+ Dt as c,
916
+ ce as d,
917
+ xe as e,
918
+ It as f,
919
+ Xe as g,
920
+ Ye as h,
921
+ Ae as r
922
+ };