@oneb/ui-vue 0.4.2 → 0.4.5

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,12 +1,12 @@
1
- import { openBlock as l, createElementBlock as s, defineComponent as ae, computed as I, ref as A, createBlock as G, withCtx as S, createElementVNode as t, normalizeClass as h, createVNode as U, unref as v, normalizeStyle as H, toDisplayString as u, Fragment as x, renderList as B, createCommentVNode as p, onMounted as ce, onUnmounted as ve, watch as me, renderSlot as K, normalizeProps as ee, guardReactiveProps as te, withDirectives as oe, vModelText as le, mergeProps as P, createTextVNode as se, nextTick as N } from "vue";
2
- import { _ as he } from "../_plugin-vue_export-helper-dad06003.js";
3
- import { d as ye, _ as fe, r as we } from "../OneHelpMenu-2a2051d7.js";
4
- import { O as Xt, a as Yt, c as Zt, b as Qt } from "../OneHelpMenu-2a2051d7.js";
5
- import { _ as ke } from "../OneDropdownAuto.vue_vue_type_script_setup_true_lang-2c508e8a.js";
1
+ import { openBlock as l, createElementBlock as s, defineComponent as ae, computed as I, ref as A, createBlock as G, withCtx as S, createElementVNode as t, normalizeClass as y, createVNode as U, unref as v, normalizeStyle as H, toDisplayString as u, Fragment as x, renderList as B, createCommentVNode as p, onMounted as ce, onUnmounted as ve, watch as me, renderSlot as K, normalizeProps as ee, guardReactiveProps as te, withDirectives as oe, vModelText as le, mergeProps as P, createTextVNode as se, nextTick as N } from "vue";
2
+ import { _ as ye } from "../_plugin-vue_export-helper-dad06003.js";
3
+ import { d as he, _ as fe, r as we } from "../OneHelpMenu-485d8bff.js";
4
+ import { O as Xt, a as Yt, c as Zt, b as Qt } from "../OneHelpMenu-485d8bff.js";
5
+ import { _ as be } from "../OneDropdownAuto.vue_vue_type_script_setup_true_lang-2c508e8a.js";
6
6
  import { _ as re } from "../OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
7
7
  import { useOnebI18n as ie } from "../i18n/index.js";
8
- import { b as ge } from "../dropdown-c81fb945.js";
9
- import { O as be } from "../OneModal-02a9a173.js";
8
+ import { b as ke } from "../dropdown-c81fb945.js";
9
+ import { O as ge } from "../OneModal-02a9a173.js";
10
10
  import { u as xe } from "../useModal-6a5d870b.js";
11
11
  import "@floating-ui/dom";
12
12
  import "@floating-ui/vue";
@@ -19,10 +19,10 @@ import "../SpinnerIcon-516264ba.js";
19
19
  import "../useIsMobile-98fc0cf9.js";
20
20
  import "../useMediaQuery-77a19b18.js";
21
21
  const Ce = {}, _e = { class: "border-t border-secondary-stroke my-1" };
22
- function $e(D, k) {
22
+ function $e(D, b) {
23
23
  return l(), s("div", _e);
24
24
  }
25
- const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { class: "grid" }, Ke = { class: "font-semibold px-3" }, Ae = { class: "rounded-lg m-3 border" }, Ie = {
25
+ const Gt = /* @__PURE__ */ ye(Ce, [["render", $e]]), Me = ["onClick"], Ve = { class: "grid" }, Ke = { class: "font-semibold px-3" }, Ae = { class: "rounded-lg m-3 border" }, Ie = {
26
26
  class: "space-x-2 flex items-center px-3 py-2",
27
27
  style: { width: "300px" }
28
28
  }, je = { class: "flex-shrink-0" }, Oe = { class: "w-full text-left" }, Be = { class: "flex-shrink-0" }, Le = { class: "px-3 py-2" }, Se = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, De = {
@@ -30,20 +30,21 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
30
30
  class: "space-y-2"
31
31
  }, ze = ["onClick"], Ee = { class: "pl-2" }, Fe = { class: "text-sm mt-1" }, Re = { class: "text-xs mt-1" }, ne = 3, Ht = /* @__PURE__ */ ae({
32
32
  __name: "OneBrowserMenuGrid",
33
- props: ye,
33
+ props: he,
34
34
  setup(D) {
35
- const k = D, n = ie(), y = I(() => k.t ?? n), C = () => {
36
- typeof k.onChange == "function" && k.onChange();
37
- }, $ = A(!1), M = I(() => k.apps ? $.value ? k.apps : k.apps.slice(0, ne) : []), g = () => {
35
+ const b = D, n = ie(), h = I(() => b.t ?? n), C = () => {
36
+ typeof b.onChange == "function" && b.onChange();
37
+ }, $ = A(!1), M = I(() => b.apps ? $.value ? b.apps : b.apps.slice(0, ne) : []), k = () => {
38
38
  $.value = !$.value;
39
39
  }, z = (m) => {
40
- typeof k.onApp == "function" && k.onApp(m);
40
+ typeof b.onApp == "function" && b.onApp(m);
41
41
  };
42
42
  return (m, c) => (l(), G(fe, { stick: "right" }, {
43
43
  button: S(({ onToggle: i, isExpanded: j }) => [
44
44
  t("button", {
45
+ type: "button",
45
46
  onClick: i,
46
- class: h(["p-1 rounded-md hover:bg-secondary-10", [j ? "bg-secondary-25" : ""]])
47
+ class: y(["p-1 rounded-md hover:bg-secondary-10", [j ? "bg-secondary-25" : ""]])
47
48
  }, [
48
49
  U(v(we), {
49
50
  class: "text-secondary-base",
@@ -55,7 +56,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
55
56
  var i, j, E;
56
57
  return [
57
58
  t("div", Ve, [
58
- t("div", Ke, u(y.value("ui.layout.workspaces")), 1),
59
+ t("div", Ke, u(h.value("ui.layout.workspaces")), 1),
59
60
  t("div", Ae, [
60
61
  t("div", Ie, [
61
62
  t("div", je, [
@@ -70,16 +71,17 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
70
71
  t("div", Oe, u((E = m.workspace) == null ? void 0 : E.name), 1),
71
72
  t("div", Be, [
72
73
  t("button", {
74
+ type: "button",
73
75
  class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
74
76
  onClick: C
75
- }, u(y.value("ui.layout.change_workspace")), 1)
77
+ }, u(h.value("ui.layout.change_workspace")), 1)
76
78
  ])
77
79
  ]),
78
80
  c[0] || (c[0] = t("hr", null, null, -1))
79
81
  ])
80
82
  ]),
81
83
  t("div", Le, [
82
- t("div", Se, u(y.value("ui.layout.apps")), 1),
84
+ t("div", Se, u(h.value("ui.layout.apps")), 1),
83
85
  t("div", null, [
84
86
  m.apps && m.apps.length ? (l(), s("div", De, [
85
87
  (l(!0), s(x, null, B(M.value, (_) => (l(), s("div", {
@@ -101,9 +103,10 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
101
103
  ])) : p("", !0),
102
104
  m.apps && m.apps.length > ne ? (l(), s("button", {
103
105
  key: 1,
104
- onClick: g,
106
+ type: "button",
107
+ onClick: k,
105
108
  class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"
106
- }, u($.value ? y.value("ui.layout.hide") : y.value("ui.layout.view_all")), 1)) : p("", !0)
109
+ }, u($.value ? h.value("ui.layout.hide") : h.value("ui.layout.view_all")), 1)) : p("", !0)
107
110
  ])
108
111
  ])
109
112
  ];
@@ -178,7 +181,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
178
181
  key: 4,
179
182
  class: "overflow-auto h-[60dvh] divide-y",
180
183
  role: "listbox"
181
- }, ht = ["aria-selected"], yt = {
184
+ }, yt = ["aria-selected"], ht = {
182
185
  key: 0,
183
186
  xmlns: "http://www.w3.org/2000/svg",
184
187
  fill: "none",
@@ -192,7 +195,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
192
195
  }, wt = {
193
196
  key: 0,
194
197
  class: "px-3 pt-3 pb-2 text-xs font-semibold text-gray-400 uppercase tracking-wide"
195
- }, kt = ["aria-selected", "onClick"], gt = {
198
+ }, bt = ["aria-selected", "onClick"], kt = {
196
199
  key: 0,
197
200
  xmlns: "http://www.w3.org/2000/svg",
198
201
  fill: "none",
@@ -200,7 +203,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
200
203
  "stroke-width": "1.5",
201
204
  stroke: "currentColor",
202
205
  class: "w-5 h-5 text-blue-600 shrink-0"
203
- }, bt = {
206
+ }, gt = {
204
207
  key: 1,
205
208
  class: "w-5 h-5 shrink-0"
206
209
  }, xt = ["aria-selected", "onClick"], Ct = {
@@ -219,10 +222,10 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
219
222
  class: "px-3 py-8 text-sm text-gray-500 text-center"
220
223
  }, qt = /* @__PURE__ */ ae({
221
224
  __name: "OneDropdownSelect",
222
- props: ge,
225
+ props: ke,
223
226
  emits: ["update:modelValue", "search", "create"],
224
- setup(D, { emit: k }) {
225
- const n = D, y = ie(), C = k, $ = A(!1);
227
+ setup(D, { emit: b }) {
228
+ const n = D, h = ie(), C = b, $ = A(!1);
226
229
  let M = null;
227
230
  ce(() => {
228
231
  M = window.matchMedia("(max-width: 767px)"), $.value = M.matches;
@@ -233,8 +236,8 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
233
236
  M == null || M.removeEventListener("change", e);
234
237
  });
235
238
  });
236
- const g = xe(), z = A(null), m = () => {
237
- c.value = "", i.value = -1, g.open(), N(() => {
239
+ const k = xe(), z = A(null), m = () => {
240
+ c.value = "", i.value = -1, k.open(), N(() => {
238
241
  var e;
239
242
  (e = z.value) == null || e.focus();
240
243
  });
@@ -258,7 +261,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
258
261
  d || (d = { label: w, entries: [] }, o.set(w, d), e.push(d)), d.entries.push({ item: r, flatIndex: a }), a++;
259
262
  }
260
263
  return e;
261
- }), b = I(() => n.multiple ? (n.modelValue ?? []).length > 0 : n.modelValue !== null && n.modelValue !== void 0), R = I(() => {
264
+ }), g = I(() => n.multiple ? (n.modelValue ?? []).length > 0 : n.modelValue !== null && n.modelValue !== void 0), R = I(() => {
262
265
  if (n.multiple) {
263
266
  const e = n.modelValue ?? [];
264
267
  return e.length === 0 ? n.placeholder : e.length === 1 ? e[0][n.labelKey] ?? n.placeholder : `${e[0][n.labelKey]} +${e.length - 1}`;
@@ -321,16 +324,17 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
321
324
  return me(c, () => {
322
325
  i.value = 0;
323
326
  }), (e, o) => $.value ? (l(), s(x, { key: 1 }, [
324
- K(e.$slots, "button", ee(te({ onToggle: m, isExpanded: v(g).isOpened.value, selectedLabel: R.value })), () => [
327
+ K(e.$slots, "button", ee(te({ onToggle: m, isExpanded: v(k).isOpened.value, selectedLabel: R.value })), () => [
325
328
  t("button", {
326
- class: h(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
329
+ type: "button",
330
+ class: y(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
327
331
  e.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]"
328
332
  ]]),
329
333
  style: H(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
330
334
  onClick: m
331
335
  }, [
332
336
  t("span", {
333
- class: h(["truncate", e.view === "pill" ? "" : b.value ? "text-gray-900" : "text-gray-500"])
337
+ class: y(["truncate", e.view === "pill" ? "" : g.value ? "text-gray-900" : "text-gray-500"])
334
338
  }, u(R.value), 3),
335
339
  o[12] || (o[12] = t("svg", {
336
340
  xmlns: "http://www.w3.org/2000/svg",
@@ -348,9 +352,9 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
348
352
  ], -1))
349
353
  ], 6)
350
354
  ]),
351
- v(g).isOpened.value ? (l(), G(v(be), {
355
+ v(k).isOpened.value ? (l(), G(v(ge), {
352
356
  key: 0,
353
- useModal: v(g),
357
+ useModal: v(k),
354
358
  title: e.title || e.placeholder,
355
359
  size: "sm",
356
360
  classModal: !0,
@@ -389,8 +393,9 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
389
393
  ])) : p("", !0),
390
394
  e.createLabel ? (l(), s("div", pt, [
391
395
  t("button", {
396
+ type: "button",
392
397
  class: "w-full flex items-center justify-center gap-2 py-2 text-sm text-blue-700 hover:text-blue-500",
393
- onClick: o[3] || (o[3] = (a) => Y(() => v(g).close()))
398
+ onClick: o[3] || (o[3] = (a) => Y(() => v(k).close()))
394
399
  }, [
395
400
  o[14] || (o[14] = t("svg", {
396
401
  xmlns: "http://www.w3.org/2000/svg",
@@ -411,26 +416,29 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
411
416
  ])) : p("", !0),
412
417
  e.multiple ? (l(), s("div", ct, [
413
418
  t("button", {
419
+ type: "button",
414
420
  class: "text-sm text-blue-600 hover:text-blue-800 transition-colors",
415
421
  onClick: T
416
- }, u(v(y)("ui.dropdown.selectAll")), 1),
417
- b.value ? (l(), s("button", {
422
+ }, u(v(h)("ui.dropdown.selectAll")), 1),
423
+ g.value ? (l(), s("button", {
418
424
  key: 0,
425
+ type: "button",
419
426
  class: "text-sm text-gray-500 hover:text-gray-700 transition-colors",
420
427
  onClick: X
421
- }, u(v(y)("ui.dropdown.clear")), 1)) : p("", !0)
428
+ }, u(v(h)("ui.dropdown.clear")), 1)) : p("", !0)
422
429
  ])) : p("", !0),
423
430
  e.isLoading ? (l(), s("div", vt, [...o[15] || (o[15] = [
424
431
  t("div", { class: "animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full" }, null, -1)
425
432
  ])])) : (l(), s("div", mt, [
426
433
  e.allowEmpty ? (l(), s("button", {
427
434
  key: 0,
428
- class: h(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", b.value ? "" : "bg-gray-50 font-medium"]),
435
+ type: "button",
436
+ class: y(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", g.value ? "" : "bg-gray-50 font-medium"]),
429
437
  role: "option",
430
- "aria-selected": !b.value,
431
- onClick: o[4] || (o[4] = (a) => V(null, () => v(g).close()))
438
+ "aria-selected": !g.value,
439
+ onClick: o[4] || (o[4] = (a) => V(null, () => v(k).close()))
432
440
  }, [
433
- b.value ? (l(), s("span", ft)) : (l(), s("svg", yt, [...o[16] || (o[16] = [
441
+ g.value ? (l(), s("span", ft)) : (l(), s("svg", ht, [...o[16] || (o[16] = [
434
442
  t("path", {
435
443
  "stroke-linecap": "round",
436
444
  "stroke-linejoin": "round",
@@ -438,35 +446,37 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
438
446
  }, null, -1)
439
447
  ])])),
440
448
  t("span", null, u(e.emptyLabel ?? e.placeholder), 1)
441
- ], 10, ht)) : p("", !0),
449
+ ], 10, yt)) : p("", !0),
442
450
  e.groupKey ? (l(!0), s(x, { key: 1 }, B(q.value, (a) => (l(), s(x, {
443
451
  key: a.label
444
452
  }, [
445
453
  a.label ? (l(), s("div", wt, u(a.label), 1)) : p("", !0),
446
454
  (l(!0), s(x, null, B(a.entries, (r) => (l(), s("button", {
455
+ type: "button",
447
456
  key: r.item[e.valueKey],
448
- class: h(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", f(r.item) ? "bg-gray-50 font-medium" : ""]),
457
+ class: y(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", f(r.item) ? "bg-gray-50 font-medium" : ""]),
449
458
  role: "option",
450
459
  "aria-selected": f(r.item),
451
- onClick: (w) => V(r.item, () => v(g).close())
460
+ onClick: (w) => V(r.item, () => v(k).close())
452
461
  }, [
453
- f(r.item) ? (l(), s("svg", gt, [...o[17] || (o[17] = [
462
+ f(r.item) ? (l(), s("svg", kt, [...o[17] || (o[17] = [
454
463
  t("path", {
455
464
  "stroke-linecap": "round",
456
465
  "stroke-linejoin": "round",
457
466
  d: "M4.5 12.75l6 6 9-13.5"
458
467
  }, null, -1)
459
- ])])) : (l(), s("span", bt)),
468
+ ])])) : (l(), s("span", gt)),
460
469
  K(e.$slots, "item", P({ ref_for: !0 }, { item: r.item }), () => [
461
470
  t("span", null, u(r.item[e.labelKey]), 1)
462
471
  ])
463
- ], 10, kt))), 128))
472
+ ], 10, bt))), 128))
464
473
  ], 64))), 128)) : (l(!0), s(x, { key: 2 }, B(O.value, (a) => (l(), s("button", {
474
+ type: "button",
465
475
  key: a[e.valueKey],
466
- class: h(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", f(a) ? "bg-gray-50 font-medium" : ""]),
476
+ class: y(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", f(a) ? "bg-gray-50 font-medium" : ""]),
467
477
  role: "option",
468
478
  "aria-selected": f(a),
469
- onClick: (r) => V(a, () => v(g).close())
479
+ onClick: (r) => V(a, () => v(k).close())
470
480
  }, [
471
481
  f(a) ? (l(), s("svg", Ct, [...o[18] || (o[18] = [
472
482
  t("path", {
@@ -481,7 +491,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
481
491
  ], 10, xt))), 128)),
482
492
  O.value.length === 0 && !e.allowEmpty ? (l(), s("div", $t, [
483
493
  K(e.$slots, "empty", {}, () => [
484
- se(u(v(y)("ui.dropdown.nothingFound")), 1)
494
+ se(u(v(h)("ui.dropdown.nothingFound")), 1)
485
495
  ])
486
496
  ])) : p("", !0)
487
497
  ]))
@@ -489,7 +499,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
489
499
  ]),
490
500
  _: 3
491
501
  }, 8, ["useModal", "title"])) : p("", !0)
492
- ], 64)) : (l(), G(ke, {
502
+ ], 64)) : (l(), G(be, {
493
503
  key: 0,
494
504
  stick: e.stick,
495
505
  onOpen: ue,
@@ -498,7 +508,8 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
498
508
  button: S(({ onToggle: a, isExpanded: r }) => [
499
509
  K(e.$slots, "button", ee(te({ onToggle: a, isExpanded: r, selectedLabel: R.value })), () => [
500
510
  t("button", {
501
- class: h(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
511
+ type: "button",
512
+ class: y(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
502
513
  e.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]",
503
514
  e.view === "default" && r ? "ring-1 ring-blue-500 border-blue-500" : ""
504
515
  ]]),
@@ -506,7 +517,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
506
517
  onClick: a
507
518
  }, [
508
519
  t("span", {
509
- class: h(["truncate", e.view === "pill" ? "" : b.value ? "text-gray-900" : "text-gray-500"])
520
+ class: y(["truncate", e.view === "pill" ? "" : g.value ? "text-gray-900" : "text-gray-500"])
510
521
  }, u(R.value), 3),
511
522
  (l(), s("svg", {
512
523
  xmlns: "http://www.w3.org/2000/svg",
@@ -514,7 +525,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
514
525
  viewBox: "0 0 24 24",
515
526
  "stroke-width": "1.5",
516
527
  stroke: "currentColor",
517
- class: h(["w-4 h-4 text-gray-400 transition-transform shrink-0", r ? "rotate-180" : ""])
528
+ class: y(["w-4 h-4 text-gray-400 transition-transform shrink-0", r ? "rotate-180" : ""])
518
529
  }, [...o[5] || (o[5] = [
519
530
  t("path", {
520
531
  "stroke-linecap": "round",
@@ -562,6 +573,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
562
573
  ])) : p("", !0),
563
574
  e.createLabel ? (l(), s("div", qe, [
564
575
  t("button", {
576
+ type: "button",
565
577
  class: "flex items-center gap-2 w-full px-3 py-2 text-sm text-blue-700 hover:bg-gray-50 transition-colors",
566
578
  onClick: (r) => Y(a)
567
579
  }, [
@@ -584,14 +596,16 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
584
596
  ])) : p("", !0),
585
597
  e.multiple ? (l(), s("div", Te, [
586
598
  t("button", {
599
+ type: "button",
587
600
  class: "text-xs text-blue-600 hover:text-blue-800 transition-colors",
588
601
  onClick: T
589
- }, u(v(y)("ui.dropdown.selectAll")), 1),
590
- b.value ? (l(), s("button", {
602
+ }, u(v(h)("ui.dropdown.selectAll")), 1),
603
+ g.value ? (l(), s("button", {
591
604
  key: 0,
605
+ type: "button",
592
606
  class: "text-xs text-gray-500 hover:text-gray-700 transition-colors",
593
607
  onClick: X
594
- }, u(v(y)("ui.dropdown.clear")), 1)) : p("", !0)
608
+ }, u(v(h)("ui.dropdown.clear")), 1)) : p("", !0)
595
609
  ])) : p("", !0),
596
610
  e.isLoading ? (l(), s("div", Xe, [...o[8] || (o[8] = [
597
611
  t("svg", {
@@ -623,17 +637,18 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
623
637
  }, [
624
638
  e.allowEmpty ? (l(), s("button", {
625
639
  key: 0,
640
+ type: "button",
626
641
  ref: (r) => F(r, 0),
627
- class: h(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
628
- b.value ? "hover:bg-gray-50" : "bg-gray-100 font-medium",
642
+ class: y(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
643
+ g.value ? "hover:bg-gray-50" : "bg-gray-100 font-medium",
629
644
  i.value === 0 ? "bg-gray-50" : ""
630
645
  ]]),
631
646
  role: "option",
632
- "aria-selected": !b.value,
647
+ "aria-selected": !g.value,
633
648
  onClick: (r) => V(null, a),
634
649
  onMouseenter: o[1] || (o[1] = (r) => i.value = 0)
635
650
  }, [
636
- b.value ? (l(), s("span", Qe)) : (l(), s("svg", Ze, [...o[9] || (o[9] = [
651
+ g.value ? (l(), s("span", Qe)) : (l(), s("svg", Ze, [...o[9] || (o[9] = [
637
652
  t("path", {
638
653
  "stroke-linecap": "round",
639
654
  "stroke-linejoin": "round",
@@ -647,13 +662,14 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
647
662
  }, [
648
663
  r.label ? (l(), s("div", {
649
664
  key: 0,
650
- class: h(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", w > 0 ? "border-t border-gray-100 mt-1" : ""])
665
+ class: y(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", w > 0 ? "border-t border-gray-100 mt-1" : ""])
651
666
  }, u(r.label), 3)) : p("", !0),
652
667
  (l(!0), s(x, null, B(r.entries, (d) => (l(), s("button", {
668
+ type: "button",
653
669
  key: d.item[e.valueKey],
654
670
  ref_for: !0,
655
671
  ref: (W) => F(W, d.flatIndex),
656
- class: h(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
672
+ class: y(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
657
673
  f(d.item) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
658
674
  i.value === d.flatIndex ? "bg-gray-50" : ""
659
675
  ]]),
@@ -674,10 +690,11 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
674
690
  ])
675
691
  ], 42, et))), 128))
676
692
  ], 64))), 128)) : (l(!0), s(x, { key: 2 }, B(O.value, (r, w) => (l(), s("button", {
693
+ type: "button",
677
694
  key: r[e.valueKey],
678
695
  ref_for: !0,
679
696
  ref: (d) => F(d, L.value + w),
680
- class: h(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
697
+ class: y(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
681
698
  f(r) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
682
699
  i.value === L.value + w ? "bg-gray-50" : ""
683
700
  ]]),
@@ -699,7 +716,7 @@ const Gt = /* @__PURE__ */ he(Ce, [["render", $e]]), Me = ["onClick"], Ve = { cl
699
716
  ], 42, lt))), 128)),
700
717
  O.value.length === 0 && !e.allowEmpty ? (l(), s("div", nt, [
701
718
  K(e.$slots, "empty", {}, () => [
702
- se(u(v(y)("ui.dropdown.nothingFound")), 1)
719
+ se(u(v(h)("ui.dropdown.nothingFound")), 1)
703
720
  ])
704
721
  ])) : p("", !0)
705
722
  ], 512))
@@ -713,7 +730,7 @@ export {
713
730
  Xt as OneBrowserMenu,
714
731
  Ht as OneBrowserMenuGrid,
715
732
  fe as OneDropdown,
716
- ke as OneDropdownAuto,
733
+ be as OneDropdownAuto,
717
734
  Gt as OneDropdownDivider,
718
735
  Yt as OneDropdownItem,
719
736
  qt as OneDropdownSelect,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("../i18n/index.cjs"),L=require("../_plugin-vue_export-helper-f246444f.cjs"),P=require("vue-router"),G=require("../LogoOneb-b6ac382e.cjs"),U=require("../clipboard-494e1513.cjs"),A={statusMessage:{type:String,required:!1},statusText:{type:String,required:!1},requestId:{type:String,required:!1},statusCode:{type:String,default:"403"},t:{type:Function,default:void 0}},K=e.defineComponent({name:"ErrorPage",props:A,setup(t){const r=b.useOnebI18n();return{t:e.computed(()=>t.t??r)}}});const J={class:"error-container"},Q={class:"text-8xl text-secondary-content"},W={key:0},X={key:1,class:"pt-5"},Y={class:"request-info hidden"};function Z(t,r,m,o,u,d){const a=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("h1",Q,e.toDisplayString(t.statusCode),1),t.statusMessage?(e.openBlock(),e.createElementBlock("p",W,e.toDisplayString(t.statusMessage),1)):e.createCommentVNode("",!0),r[3]||(r[3]=e.createElementVNode("div",{class:"border-b border-secondary-stroke w-full pt-10"},null,-1)),t.statusText?(e.openBlock(),e.createElementBlock("p",X,e.toDisplayString(t.statusText),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Y,[e.createElementVNode("p",null,[r[0]||(r[0]=e.createElementVNode("strong",null,"Request ID:",-1)),e.createTextVNode(" "+e.toDisplayString(t.requestId),1)]),r[1]||(r[1]=e.createElementVNode("button",{class:"copy-btn"},"Скопіювати",-1)),r[2]||(r[2]=e.createElementVNode("p",null,[e.createTextVNode(" Передайте цю інформацію розробнику або напишіть в "),e.createElementVNode("a",{href:"https://t.me/telegram_bot",target:"_blank"},"Telegram-бот")],-1))]),e.createVNode(a,{to:"/",class:"home-link"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("ui.errors.go_home")),1)]),_:1})])}const ee=L._export_sfc(K,[["render",Z],["__scopeId","data-v-4ac01274"]]),te={class:"flex items-center justify-center gap-2 sm:gap-4"},oe={class:"relative"},re={class:"one-error-logo-bounce"},ne=["src"],se={key:0,class:"absolute inset-0 animate-ping opacity-20","aria-hidden":"true"},ae=["src"],z="text-[100px] sm:text-[160px] font-bold text-slate-200 leading-none select-none",le=e.defineComponent({__name:"OneErrorHero",props:{left:{type:String,required:!0},right:{type:String,required:!0},logoSrc:{type:String,default:void 0}},setup(t){const r=e.useSlots(),m=e.computed(()=>!!r.default);return(o,u)=>(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("span",{class:e.normalizeClass(z)},e.toDisplayString(t.left),1),e.createElementVNode("div",oe,[e.createElementVNode("div",re,[e.renderSlot(o.$slots,"default",{},()=>[t.logoSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.logoSrc,class:"w-24 h-24 sm:w-36 sm:h-36",alt:"Logo"},null,8,ne)):(e.openBlock(),e.createBlock(G.LogoOneb,{key:1,class:"w-24 h-24 sm:w-36 sm:h-36"}))],!0)]),t.logoSrc&&!m.value?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("img",{src:t.logoSrc,class:"w-24 h-24 sm:w-36 sm:h-36",alt:""},null,8,ae)])):e.createCommentVNode("",!0)]),e.createElementVNode("span",{class:e.normalizeClass(z)},e.toDisplayString(t.right),1)]))}});const j=L._export_sfc(le,[["__scopeId","data-v-957a8a83"]]),ce={class:"w-full"},ie={class:"flex items-center justify-between mb-4"},ue={class:"flex items-center gap-4"},de={class:"text-sm text-slate-600"},me={class:"text-emerald-700","data-test":"snake-score"},pe={key:0,class:"text-sm text-rose-600 font-medium","data-test":"snake-status"},ge={key:1,class:"text-sm text-emerald-700","data-test":"snake-status"},ye={key:2,class:"text-sm text-slate-500","data-test":"snake-status"},fe={class:"flex gap-2"},ve={class:"bg-slate-50 border border-slate-200 rounded-2xl p-4 shadow-sm"},xe=["data-snake"],he={key:0,class:"absolute inset-1 rounded-md border border-emerald-800/40"},_e={key:1,class:"absolute inset-2 rounded-sm bg-rose-600"},ke={class:"text-xs text-slate-500 text-center mt-3"},F=e.defineComponent({__name:"OneSnakeGame",props:{gridSize:{type:Number,default:15},tickMs:{type:Number,default:170},t:{type:Function,default:void 0}},emits:["score","game-over"],setup(t,{expose:r,emit:m}){const o=t,u=m,d=b.useOnebI18n(),a=e.computed(()=>o.t??d),i=e.ref([]),p=e.ref({x:1,y:0}),f=e.ref({x:1,y:0}),g=e.ref({x:0,y:0}),v=e.ref(0),y=e.ref(!1),c=e.ref(!1);let _=null;const R=e.computed(()=>Array.from({length:o.gridSize*o.gridSize},(s,n)=>({x:n%o.gridSize,y:Math.floor(n/o.gridSize)}))),w=s=>{var n,l;return((n=i.value[0])==null?void 0:n.x)===s.x&&((l=i.value[0])==null?void 0:l.y)===s.y},C=s=>i.value.some((n,l)=>l!==0&&n.x===s.x&&n.y===s.y),N=s=>g.value.x===s.x&&g.value.y===s.y,$=s=>{const n=[];for(let x=0;x<o.gridSize;x+=1)for(let h=0;h<o.gridSize;h+=1)s.some(I=>I.x===h&&I.y===x)||n.push({x:h,y:x});if(n.length===0)return{x:0,y:0};const l=Math.floor(Math.random()*n.length);return n[l]},S=()=>{_!=null&&(clearInterval(_),_=null),y.value=!1},D=()=>{S(),c.value=!0,u("game-over",v.value)},k=()=>{S(),i.value=[{x:Math.floor(o.gridSize/2),y:Math.floor(o.gridSize/2)}],p.value={x:1,y:0},f.value={x:1,y:0},g.value=$(i.value),v.value=0,c.value=!1},M=s=>{p.value.x+s.x===0&&p.value.y+s.y===0||(f.value=s)},H=()=>{p.value=f.value;const s=i.value[0],n={x:s.x+p.value.x,y:s.y+p.value.y};if(n.x<0||n.x>=o.gridSize||n.y<0||n.y>=o.gridSize){D();return}if(i.value.some(h=>h.x===n.x&&h.y===n.y)){D();return}const x=[n,...i.value];n.x===g.value.x&&n.y===g.value.y?(v.value+=1,u("score",v.value),g.value=$(x)):x.pop(),i.value=x},T=()=>{_!=null||c.value||(y.value=!0,_=setInterval(H,o.tickMs))},O=()=>{if(c.value){k();return}y.value?S():T()},q=s=>{const n=s.key.toLowerCase(),l={arrowup:{x:0,y:-1},w:{x:0,y:-1},arrowdown:{x:0,y:1},s:{x:0,y:1},arrowleft:{x:-1,y:0},a:{x:-1,y:0},arrowright:{x:1,y:0},d:{x:1,y:0}};l[n]?(M(l[n]),!y.value&&!c.value&&T()):n===" "?(s.preventDefault(),c.value||O()):n==="enter"&&c.value&&k()};return e.onMounted(()=>{k(),window.addEventListener("keydown",q)}),e.onUnmounted(()=>{S(),window.removeEventListener("keydown",q)}),r({score:v,isRunning:y,isGameOver:c,resetGame:k}),(s,n)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",ie,[e.createElementVNode("div",ue,[e.createElementVNode("span",de,[e.createTextVNode(e.toDisplayString(a.value("ui.errors.snake_score"))+": ",1),e.createElementVNode("strong",me,e.toDisplayString(v.value),1)]),c.value?(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(a.value("ui.errors.snake_game_over")),1)):y.value?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(a.value("ui.errors.snake_running")),1)):(e.openBlock(),e.createElementBlock("span",ye,e.toDisplayString(a.value("ui.errors.snake_paused")),1))]),e.createElementVNode("div",fe,[e.createElementVNode("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-sm text-white bg-emerald-600 hover:bg-emerald-700 transition","data-test":"snake-toggle",onClick:O},e.toDisplayString(c.value?a.value("ui.errors.snake_restart"):y.value?a.value("ui.errors.snake_pause"):a.value("ui.errors.snake_start")),1),e.createElementVNode("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-sm border border-slate-300 text-slate-700 hover:bg-slate-50 transition","data-test":"snake-reset",onClick:k},e.toDisplayString(a.value("ui.errors.snake_reset")),1)])]),e.createElementVNode("div",ve,[e.createElementVNode("div",{class:"w-full mx-auto",style:e.normalizeStyle({display:"grid",gridTemplateColumns:`repeat(${t.gridSize}, minmax(0, 1fr))`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,l=>(e.openBlock(),e.createElementBlock("div",{key:`${l.x}-${l.y}`,class:e.normalizeClass(["relative aspect-square border border-slate-200/60",[w(l)?"bg-emerald-600 shadow-inner":C(l)?"bg-emerald-300":N(l)?"bg-rose-400":"bg-white"]]),"data-test":"snake-cell","data-snake":w(l)?"head":C(l)?"body":N(l)?"food":void 0},[w(l)?(e.openBlock(),e.createElementBlock("div",he)):N(l)?(e.openBlock(),e.createElementBlock("div",_e)):e.createCommentVNode("",!0)],10,xe))),128))],4)]),e.createElementVNode("p",ke,e.toDisplayString(a.value("ui.errors.snake_instructions")),1)]))}}),be={class:"min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4"},Se={class:"text-center mb-8"},Ee={class:"text-xl text-gray-600 mt-2"},we={class:"flex gap-4 mt-4"},Ne=e.defineComponent({__name:"OneNotFoundPage",props:{logoSrc:{type:String,default:void 0},homeTo:{type:[String,Object],default:"/"},withGame:{type:Boolean,default:!0},t:{type:Function,default:void 0}},setup(t){const r=t,m=b.useOnebI18n(),o=e.computed(()=>r.t??m),u=P.useRouter(),d=e.ref(!1),a=()=>{u?u.back():typeof window<"u"&&window.history.back()};return(i,p)=>{const f=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",Se,[e.createVNode(j,{left:"4",right:"4","logo-src":t.logoSrc},e.createSlots({_:2},[i.$slots.logo?{name:"default",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"logo")]),key:"0"}:void 0]),1032,["logo-src"]),e.createElementVNode("p",Ee,e.toDisplayString(o.value("ui.errors.page_not_found")),1)]),t.withGame&&!d.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-6 py-2.5 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition font-medium shadow-lg","data-test":"nf-play",onClick:p[0]||(p[0]=g=>d.value=!0)},e.toDisplayString(o.value("ui.errors.play_snake")),1)):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(F,{key:1,class:"max-w-2xl",t:o.value},null,8,["t"])):e.createCommentVNode("",!0),e.createElementVNode("div",we,[e.createVNode(f,{to:t.homeTo,class:"text-blue-600 hover:text-blue-700 underline text-sm","data-test":"nf-home"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value("ui.errors.go_home")),1)]),_:1},8,["to"]),e.createElementVNode("button",{type:"button",class:"text-gray-600 hover:text-gray-700 underline text-sm","data-test":"nf-back",onClick:a},e.toDisplayString(o.value("ui.errors.go_back")),1)])])}}}),Ve={class:"min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4"},Be={class:"text-center mb-8"},Ce={class:"text-xl text-gray-600 mt-2"},$e={class:"text-sm text-gray-500 mt-2 max-w-md mx-auto"},De={key:0,class:"mb-6 text-sm text-gray-600 text-center","data-test":"se-request"},Te={class:"flex flex-col items-center gap-4"},Oe=e.defineComponent({__name:"OneServerErrorPage",props:{logoSrc:{type:String,default:void 0},homeTo:{type:[String,Object],default:"/"},requestId:{type:String,default:void 0},t:{type:Function,default:void 0}},setup(t){const r=t,m=b.useOnebI18n(),o=e.computed(()=>r.t??m),u=e.ref(!1);let d=null;const a=async()=>{!r.requestId||!await U.copyToClipboard(r.requestId)||(u.value=!0,d!=null&&clearTimeout(d),d=setTimeout(()=>{u.value=!1,d=null},2e3))},i=()=>{window.location.reload()};return e.onBeforeUnmount(()=>{d!=null&&clearTimeout(d)}),(p,f)=>{const g=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Be,[e.createVNode(j,{left:"5",right:"0","logo-src":t.logoSrc},e.createSlots({_:2},[p.$slots.logo?{name:"default",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"logo")]),key:"0"}:void 0]),1032,["logo-src"]),e.createElementVNode("p",Ce,e.toDisplayString(o.value("ui.errors.server_error")),1),e.createElementVNode("p",$e,e.toDisplayString(o.value("ui.errors.server_error_hint")),1)]),t.requestId?(e.openBlock(),e.createElementBlock("div",De,[e.createTextVNode(e.toDisplayString(o.value("ui.errors.request_id"))+": ",1),e.createElementVNode("strong",null,e.toDisplayString(t.requestId),1),e.createElementVNode("button",{type:"button",class:"ml-2 text-blue-600 hover:text-blue-700 underline","data-test":"se-copy",onClick:a},e.toDisplayString(u.value?o.value("ui.errors.copied"):o.value("ui.errors.copy")),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Te,[e.createElementVNode("button",{type:"button",class:"px-6 py-3 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition text-lg font-medium shadow-lg","data-test":"se-reload",onClick:i},e.toDisplayString(o.value("ui.errors.reload_page")),1),e.renderSlot(p.$slots,"support"),e.createVNode(g,{to:t.homeTo,class:"text-blue-600 hover:text-blue-700 underline text-sm","data-test":"se-home"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value("ui.errors.go_home")),1)]),_:1},8,["to"])])])}}}),E=e.ref(!1),V=e.ref(null);function B(){return{show:E,error:V,trigger:m=>{E.value||(V.value=m,E.value=!0)},dismiss:()=>{E.value=!1,V.value=null}}}const qe={key:0,class:"fixed inset-0 z-[10000] flex items-center justify-center bg-[#f5f7fb] p-6",role:"alert","aria-live":"assertive","data-test":"crash-screen"},Ie={class:"flex w-full max-w-[480px] flex-col items-center text-center"},ze={key:0,class:"mb-6"},Le=["src"],je={class:"mb-3 text-2xl font-semibold text-gray-900"},Fe={class:"mb-8 text-base text-gray-600","data-test":"crash-message"},Re={key:2,"data-test":"crash-details",class:"mt-6 text-xs text-gray-400"},Me=e.defineComponent({__name:"OneCrashScreen",props:{logoSrc:{type:String,default:void 0},accountUrl:{type:String,default:void 0},autoReloadSeconds:{type:Number,default:10},persistent:{type:Boolean,default:!1},showDetails:{type:Boolean,default:!1},t:{type:Function,default:void 0}},setup(t){const r=t,m=b.useOnebI18n(),o=e.computed(()=>r.t??m),{show:u,error:d}=B(),a=e.ref(r.autoReloadSeconds);let i=null;const p=e.computed(()=>{const c=d.value;return c instanceof Error?`${c.name}: ${c.message}`:String(c??"Unknown error")}),f=e.computed(()=>r.persistent?o.value("ui.crash.persistent"):a.value>0?o.value("ui.crash.countdown",{n:a.value}):o.value("ui.crash.reloading")),g=()=>{i!=null&&(clearInterval(i),i=null)},v=()=>{g(),window.location.reload()},y=()=>{r.accountUrl&&(g(),window.location.href=r.accountUrl)};return e.watch(u,c=>{g(),c&&(a.value=r.autoReloadSeconds,!r.persistent&&(i=setInterval(()=>{a.value-=1,a.value<=0&&(g(),window.location.reload())},1e3)))},{immediate:!0}),e.onBeforeUnmount(()=>{g()}),(c,_)=>e.unref(u)?(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",Ie,[t.logoSrc||c.$slots.logo?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(c.$slots,"logo",{},()=>[e.createElementVNode("img",{src:t.logoSrc,alt:"",class:"h-20 w-20"},null,8,Le)])])):e.createCommentVNode("",!0),e.createElementVNode("h1",je,e.toDisplayString(o.value("ui.crash.title")),1),e.createElementVNode("p",Fe,e.toDisplayString(f.value),1),e.createElementVNode("button",{type:"button",class:"mb-3 w-full rounded-lg bg-gradient-to-r from-[#E1A508] to-[#E04040] px-6 py-3 text-base font-medium text-white transition hover:opacity-90","data-test":"crash-reload",onClick:v},e.toDisplayString(o.value("ui.crash.reload_now")),1),t.accountUrl?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"w-full rounded-lg border border-gray-300 bg-white px-6 py-3 text-base font-medium text-gray-700 transition hover:bg-gray-50","data-test":"crash-account",onClick:y},e.toDisplayString(o.value("ui.crash.open_account")),1)):e.createCommentVNode("",!0),t.showDetails?(e.openBlock(),e.createElementBlock("p",Re,e.toDisplayString(p.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)}});function He(t={}){const r=t.criticalInfos??["setup function","render function"];return(m,o,u)=>{var d;try{(d=t.onError)==null||d.call(t,m,u)}catch{}console.error("[Vue Error]",m,u),r.includes(u)&&(t.onCritical??B().trigger)(m)}}exports.OneCrashScreen=Me;exports.OneErrorPage=ee;exports.OneNotFoundPage=Ne;exports.OneServerErrorPage=Oe;exports.OneSnakeGame=F;exports.createAppErrorHandler=He;exports.useCrashState=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("../i18n/index.cjs"),L=require("../_plugin-vue_export-helper-f246444f.cjs"),P=require("vue-router"),G=require("../LogoOneb-b6ac382e.cjs"),U=require("../clipboard-494e1513.cjs"),A={statusMessage:{type:String,required:!1},statusText:{type:String,required:!1},requestId:{type:String,required:!1},statusCode:{type:String,default:"403"},t:{type:Function,default:void 0}},K=e.defineComponent({name:"ErrorPage",props:A,setup(t){const r=b.useOnebI18n();return{t:e.computed(()=>t.t??r)}}});const J={class:"error-container"},Q={class:"text-8xl text-secondary-content"},W={key:0},X={key:1,class:"pt-5"},Y={class:"request-info hidden"};function Z(t,r,m,o,u,d){const a=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("h1",Q,e.toDisplayString(t.statusCode),1),t.statusMessage?(e.openBlock(),e.createElementBlock("p",W,e.toDisplayString(t.statusMessage),1)):e.createCommentVNode("",!0),r[3]||(r[3]=e.createElementVNode("div",{class:"border-b border-secondary-stroke w-full pt-10"},null,-1)),t.statusText?(e.openBlock(),e.createElementBlock("p",X,e.toDisplayString(t.statusText),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Y,[e.createElementVNode("p",null,[r[0]||(r[0]=e.createElementVNode("strong",null,"Request ID:",-1)),e.createTextVNode(" "+e.toDisplayString(t.requestId),1)]),r[1]||(r[1]=e.createElementVNode("button",{type:"button",class:"copy-btn"},"Скопіювати",-1)),r[2]||(r[2]=e.createElementVNode("p",null,[e.createTextVNode(" Передайте цю інформацію розробнику або напишіть в "),e.createElementVNode("a",{href:"https://t.me/telegram_bot",target:"_blank"},"Telegram-бот")],-1))]),e.createVNode(a,{to:"/",class:"home-link"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("ui.errors.go_home")),1)]),_:1})])}const ee=L._export_sfc(K,[["render",Z],["__scopeId","data-v-e59dc5d9"]]),te={class:"flex items-center justify-center gap-2 sm:gap-4"},oe={class:"relative"},re={class:"one-error-logo-bounce"},ne=["src"],se={key:0,class:"absolute inset-0 animate-ping opacity-20","aria-hidden":"true"},ae=["src"],z="text-[100px] sm:text-[160px] font-bold text-slate-200 leading-none select-none",le=e.defineComponent({__name:"OneErrorHero",props:{left:{type:String,required:!0},right:{type:String,required:!0},logoSrc:{type:String,default:void 0}},setup(t){const r=e.useSlots(),m=e.computed(()=>!!r.default);return(o,u)=>(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("span",{class:e.normalizeClass(z)},e.toDisplayString(t.left),1),e.createElementVNode("div",oe,[e.createElementVNode("div",re,[e.renderSlot(o.$slots,"default",{},()=>[t.logoSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.logoSrc,class:"w-24 h-24 sm:w-36 sm:h-36",alt:"Logo"},null,8,ne)):(e.openBlock(),e.createBlock(G.LogoOneb,{key:1,class:"w-24 h-24 sm:w-36 sm:h-36"}))],!0)]),t.logoSrc&&!m.value?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("img",{src:t.logoSrc,class:"w-24 h-24 sm:w-36 sm:h-36",alt:""},null,8,ae)])):e.createCommentVNode("",!0)]),e.createElementVNode("span",{class:e.normalizeClass(z)},e.toDisplayString(t.right),1)]))}});const j=L._export_sfc(le,[["__scopeId","data-v-957a8a83"]]),ce={class:"w-full"},ie={class:"flex items-center justify-between mb-4"},ue={class:"flex items-center gap-4"},de={class:"text-sm text-slate-600"},me={class:"text-emerald-700","data-test":"snake-score"},pe={key:0,class:"text-sm text-rose-600 font-medium","data-test":"snake-status"},ge={key:1,class:"text-sm text-emerald-700","data-test":"snake-status"},ye={key:2,class:"text-sm text-slate-500","data-test":"snake-status"},fe={class:"flex gap-2"},ve={class:"bg-slate-50 border border-slate-200 rounded-2xl p-4 shadow-sm"},xe=["data-snake"],he={key:0,class:"absolute inset-1 rounded-md border border-emerald-800/40"},_e={key:1,class:"absolute inset-2 rounded-sm bg-rose-600"},ke={class:"text-xs text-slate-500 text-center mt-3"},F=e.defineComponent({__name:"OneSnakeGame",props:{gridSize:{type:Number,default:15},tickMs:{type:Number,default:170},t:{type:Function,default:void 0}},emits:["score","game-over"],setup(t,{expose:r,emit:m}){const o=t,u=m,d=b.useOnebI18n(),a=e.computed(()=>o.t??d),i=e.ref([]),p=e.ref({x:1,y:0}),f=e.ref({x:1,y:0}),g=e.ref({x:0,y:0}),v=e.ref(0),y=e.ref(!1),c=e.ref(!1);let _=null;const R=e.computed(()=>Array.from({length:o.gridSize*o.gridSize},(s,n)=>({x:n%o.gridSize,y:Math.floor(n/o.gridSize)}))),w=s=>{var n,l;return((n=i.value[0])==null?void 0:n.x)===s.x&&((l=i.value[0])==null?void 0:l.y)===s.y},C=s=>i.value.some((n,l)=>l!==0&&n.x===s.x&&n.y===s.y),N=s=>g.value.x===s.x&&g.value.y===s.y,$=s=>{const n=[];for(let x=0;x<o.gridSize;x+=1)for(let h=0;h<o.gridSize;h+=1)s.some(I=>I.x===h&&I.y===x)||n.push({x:h,y:x});if(n.length===0)return{x:0,y:0};const l=Math.floor(Math.random()*n.length);return n[l]},S=()=>{_!=null&&(clearInterval(_),_=null),y.value=!1},D=()=>{S(),c.value=!0,u("game-over",v.value)},k=()=>{S(),i.value=[{x:Math.floor(o.gridSize/2),y:Math.floor(o.gridSize/2)}],p.value={x:1,y:0},f.value={x:1,y:0},g.value=$(i.value),v.value=0,c.value=!1},M=s=>{p.value.x+s.x===0&&p.value.y+s.y===0||(f.value=s)},H=()=>{p.value=f.value;const s=i.value[0],n={x:s.x+p.value.x,y:s.y+p.value.y};if(n.x<0||n.x>=o.gridSize||n.y<0||n.y>=o.gridSize){D();return}if(i.value.some(h=>h.x===n.x&&h.y===n.y)){D();return}const x=[n,...i.value];n.x===g.value.x&&n.y===g.value.y?(v.value+=1,u("score",v.value),g.value=$(x)):x.pop(),i.value=x},T=()=>{_!=null||c.value||(y.value=!0,_=setInterval(H,o.tickMs))},O=()=>{if(c.value){k();return}y.value?S():T()},q=s=>{const n=s.key.toLowerCase(),l={arrowup:{x:0,y:-1},w:{x:0,y:-1},arrowdown:{x:0,y:1},s:{x:0,y:1},arrowleft:{x:-1,y:0},a:{x:-1,y:0},arrowright:{x:1,y:0},d:{x:1,y:0}};l[n]?(M(l[n]),!y.value&&!c.value&&T()):n===" "?(s.preventDefault(),c.value||O()):n==="enter"&&c.value&&k()};return e.onMounted(()=>{k(),window.addEventListener("keydown",q)}),e.onUnmounted(()=>{S(),window.removeEventListener("keydown",q)}),r({score:v,isRunning:y,isGameOver:c,resetGame:k}),(s,n)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",ie,[e.createElementVNode("div",ue,[e.createElementVNode("span",de,[e.createTextVNode(e.toDisplayString(a.value("ui.errors.snake_score"))+": ",1),e.createElementVNode("strong",me,e.toDisplayString(v.value),1)]),c.value?(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(a.value("ui.errors.snake_game_over")),1)):y.value?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(a.value("ui.errors.snake_running")),1)):(e.openBlock(),e.createElementBlock("span",ye,e.toDisplayString(a.value("ui.errors.snake_paused")),1))]),e.createElementVNode("div",fe,[e.createElementVNode("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-sm text-white bg-emerald-600 hover:bg-emerald-700 transition","data-test":"snake-toggle",onClick:O},e.toDisplayString(c.value?a.value("ui.errors.snake_restart"):y.value?a.value("ui.errors.snake_pause"):a.value("ui.errors.snake_start")),1),e.createElementVNode("button",{type:"button",class:"px-3 py-1.5 rounded-lg text-sm border border-slate-300 text-slate-700 hover:bg-slate-50 transition","data-test":"snake-reset",onClick:k},e.toDisplayString(a.value("ui.errors.snake_reset")),1)])]),e.createElementVNode("div",ve,[e.createElementVNode("div",{class:"w-full mx-auto",style:e.normalizeStyle({display:"grid",gridTemplateColumns:`repeat(${t.gridSize}, minmax(0, 1fr))`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,l=>(e.openBlock(),e.createElementBlock("div",{key:`${l.x}-${l.y}`,class:e.normalizeClass(["relative aspect-square border border-slate-200/60",[w(l)?"bg-emerald-600 shadow-inner":C(l)?"bg-emerald-300":N(l)?"bg-rose-400":"bg-white"]]),"data-test":"snake-cell","data-snake":w(l)?"head":C(l)?"body":N(l)?"food":void 0},[w(l)?(e.openBlock(),e.createElementBlock("div",he)):N(l)?(e.openBlock(),e.createElementBlock("div",_e)):e.createCommentVNode("",!0)],10,xe))),128))],4)]),e.createElementVNode("p",ke,e.toDisplayString(a.value("ui.errors.snake_instructions")),1)]))}}),be={class:"min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4"},Se={class:"text-center mb-8"},Ee={class:"text-xl text-gray-600 mt-2"},we={class:"flex gap-4 mt-4"},Ne=e.defineComponent({__name:"OneNotFoundPage",props:{logoSrc:{type:String,default:void 0},homeTo:{type:[String,Object],default:"/"},withGame:{type:Boolean,default:!0},t:{type:Function,default:void 0}},setup(t){const r=t,m=b.useOnebI18n(),o=e.computed(()=>r.t??m),u=P.useRouter(),d=e.ref(!1),a=()=>{u?u.back():typeof window<"u"&&window.history.back()};return(i,p)=>{const f=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",Se,[e.createVNode(j,{left:"4",right:"4","logo-src":t.logoSrc},e.createSlots({_:2},[i.$slots.logo?{name:"default",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"logo")]),key:"0"}:void 0]),1032,["logo-src"]),e.createElementVNode("p",Ee,e.toDisplayString(o.value("ui.errors.page_not_found")),1)]),t.withGame&&!d.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-6 py-2.5 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition font-medium shadow-lg","data-test":"nf-play",onClick:p[0]||(p[0]=g=>d.value=!0)},e.toDisplayString(o.value("ui.errors.play_snake")),1)):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(F,{key:1,class:"max-w-2xl",t:o.value},null,8,["t"])):e.createCommentVNode("",!0),e.createElementVNode("div",we,[e.createVNode(f,{to:t.homeTo,class:"text-blue-600 hover:text-blue-700 underline text-sm","data-test":"nf-home"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value("ui.errors.go_home")),1)]),_:1},8,["to"]),e.createElementVNode("button",{type:"button",class:"text-gray-600 hover:text-gray-700 underline text-sm","data-test":"nf-back",onClick:a},e.toDisplayString(o.value("ui.errors.go_back")),1)])])}}}),Ve={class:"min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4"},Be={class:"text-center mb-8"},Ce={class:"text-xl text-gray-600 mt-2"},$e={class:"text-sm text-gray-500 mt-2 max-w-md mx-auto"},De={key:0,class:"mb-6 text-sm text-gray-600 text-center","data-test":"se-request"},Te={class:"flex flex-col items-center gap-4"},Oe=e.defineComponent({__name:"OneServerErrorPage",props:{logoSrc:{type:String,default:void 0},homeTo:{type:[String,Object],default:"/"},requestId:{type:String,default:void 0},t:{type:Function,default:void 0}},setup(t){const r=t,m=b.useOnebI18n(),o=e.computed(()=>r.t??m),u=e.ref(!1);let d=null;const a=async()=>{!r.requestId||!await U.copyToClipboard(r.requestId)||(u.value=!0,d!=null&&clearTimeout(d),d=setTimeout(()=>{u.value=!1,d=null},2e3))},i=()=>{window.location.reload()};return e.onBeforeUnmount(()=>{d!=null&&clearTimeout(d)}),(p,f)=>{const g=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Be,[e.createVNode(j,{left:"5",right:"0","logo-src":t.logoSrc},e.createSlots({_:2},[p.$slots.logo?{name:"default",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"logo")]),key:"0"}:void 0]),1032,["logo-src"]),e.createElementVNode("p",Ce,e.toDisplayString(o.value("ui.errors.server_error")),1),e.createElementVNode("p",$e,e.toDisplayString(o.value("ui.errors.server_error_hint")),1)]),t.requestId?(e.openBlock(),e.createElementBlock("div",De,[e.createTextVNode(e.toDisplayString(o.value("ui.errors.request_id"))+": ",1),e.createElementVNode("strong",null,e.toDisplayString(t.requestId),1),e.createElementVNode("button",{type:"button",class:"ml-2 text-blue-600 hover:text-blue-700 underline","data-test":"se-copy",onClick:a},e.toDisplayString(u.value?o.value("ui.errors.copied"):o.value("ui.errors.copy")),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Te,[e.createElementVNode("button",{type:"button",class:"px-6 py-3 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition text-lg font-medium shadow-lg","data-test":"se-reload",onClick:i},e.toDisplayString(o.value("ui.errors.reload_page")),1),e.renderSlot(p.$slots,"support"),e.createVNode(g,{to:t.homeTo,class:"text-blue-600 hover:text-blue-700 underline text-sm","data-test":"se-home"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value("ui.errors.go_home")),1)]),_:1},8,["to"])])])}}}),E=e.ref(!1),V=e.ref(null);function B(){return{show:E,error:V,trigger:m=>{E.value||(V.value=m,E.value=!0)},dismiss:()=>{E.value=!1,V.value=null}}}const qe={key:0,class:"fixed inset-0 z-[10000] flex items-center justify-center bg-[#f5f7fb] p-6",role:"alert","aria-live":"assertive","data-test":"crash-screen"},Ie={class:"flex w-full max-w-[480px] flex-col items-center text-center"},ze={key:0,class:"mb-6"},Le=["src"],je={class:"mb-3 text-2xl font-semibold text-gray-900"},Fe={class:"mb-8 text-base text-gray-600","data-test":"crash-message"},Re={key:2,"data-test":"crash-details",class:"mt-6 text-xs text-gray-400"},Me=e.defineComponent({__name:"OneCrashScreen",props:{logoSrc:{type:String,default:void 0},accountUrl:{type:String,default:void 0},autoReloadSeconds:{type:Number,default:10},persistent:{type:Boolean,default:!1},showDetails:{type:Boolean,default:!1},t:{type:Function,default:void 0}},setup(t){const r=t,m=b.useOnebI18n(),o=e.computed(()=>r.t??m),{show:u,error:d}=B(),a=e.ref(r.autoReloadSeconds);let i=null;const p=e.computed(()=>{const c=d.value;return c instanceof Error?`${c.name}: ${c.message}`:String(c??"Unknown error")}),f=e.computed(()=>r.persistent?o.value("ui.crash.persistent"):a.value>0?o.value("ui.crash.countdown",{n:a.value}):o.value("ui.crash.reloading")),g=()=>{i!=null&&(clearInterval(i),i=null)},v=()=>{g(),window.location.reload()},y=()=>{r.accountUrl&&(g(),window.location.href=r.accountUrl)};return e.watch(u,c=>{g(),c&&(a.value=r.autoReloadSeconds,!r.persistent&&(i=setInterval(()=>{a.value-=1,a.value<=0&&(g(),window.location.reload())},1e3)))},{immediate:!0}),e.onBeforeUnmount(()=>{g()}),(c,_)=>e.unref(u)?(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",Ie,[t.logoSrc||c.$slots.logo?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(c.$slots,"logo",{},()=>[e.createElementVNode("img",{src:t.logoSrc,alt:"",class:"h-20 w-20"},null,8,Le)])])):e.createCommentVNode("",!0),e.createElementVNode("h1",je,e.toDisplayString(o.value("ui.crash.title")),1),e.createElementVNode("p",Fe,e.toDisplayString(f.value),1),e.createElementVNode("button",{type:"button",class:"mb-3 w-full rounded-lg bg-gradient-to-r from-[#E1A508] to-[#E04040] px-6 py-3 text-base font-medium text-white transition hover:opacity-90","data-test":"crash-reload",onClick:v},e.toDisplayString(o.value("ui.crash.reload_now")),1),t.accountUrl?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"w-full rounded-lg border border-gray-300 bg-white px-6 py-3 text-base font-medium text-gray-700 transition hover:bg-gray-50","data-test":"crash-account",onClick:y},e.toDisplayString(o.value("ui.crash.open_account")),1)):e.createCommentVNode("",!0),t.showDetails?(e.openBlock(),e.createElementBlock("p",Re,e.toDisplayString(p.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)}});function He(t={}){const r=t.criticalInfos??["setup function","render function"];return(m,o,u)=>{var d;try{(d=t.onError)==null||d.call(t,m,u)}catch{}console.error("[Vue Error]",m,u),r.includes(u)&&(t.onCritical??B().trigger)(m)}}exports.OneCrashScreen=Me;exports.OneErrorPage=ee;exports.OneNotFoundPage=Ne;exports.OneServerErrorPage=Oe;exports.OneSnakeGame=F;exports.createAppErrorHandler=He;exports.useCrashState=B;