@opengis/admin 0.2.34 → 0.2.36

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,4 +1,4 @@
1
- import { _ as g, u as f, d as u } from "./import-file-D9va23Wq.js";
1
+ import { _ as g, u as f, d as u } from "./import-file-DipOleMT.js";
2
2
  import { resolveComponent as x, openBlock as d, createElementBlock as w, createElementVNode as n, createBlock as k, createCommentVNode as y } from "vue";
3
3
  const v = {
4
4
  data() {
@@ -1,6 +1,6 @@
1
- import { _ as C, e as qe, f as Pe, g as Be, d as F, I as Le, V as ze, h as Ue, i as Oe, j as Ne, A as Ee, a as He, u as Ce, s as Re } from "./import-file-D9va23Wq.js";
2
- import { openBlock as o, createElementBlock as c, createTextVNode as j, toDisplayString as T, createCommentVNode as w, resolveComponent as p, Fragment as I, createElementVNode as l, createVNode as y, withCtx as $, createBlock as _, renderList as D, withModifiers as We, normalizeClass as V, createStaticVNode as Ae, withDirectives as z, vModelCheckbox as Ze, resolveDynamicComponent as q, Transition as U, renderSlot as Ge, vShow as Ie, getCurrentInstance as Te, ref as L, normalizeStyle as $e } from "vue";
3
- const Je = {
1
+ import { _ as C, e as qe, f as Pe, g as Be, d as F, I as Le, V as ze, h as Oe, i as Ue, j as Ne, A as Ee, a as He, u as Ce, s as Re } from "./import-file-DipOleMT.js";
2
+ import { openBlock as o, createElementBlock as c, createTextVNode as j, toDisplayString as I, createCommentVNode as w, resolveComponent as p, Fragment as T, createElementVNode as l, createVNode as y, withCtx as $, createBlock as _, renderList as D, withModifiers as We, normalizeClass as V, createStaticVNode as Ae, withDirectives as z, vModelCheckbox as Je, resolveDynamicComponent as q, Transition as O, renderSlot as Ze, vShow as Te, getCurrentInstance as Ie, ref as L, normalizeStyle as $e } from "vue";
3
+ const Ge = {
4
4
  data() {
5
5
  return {
6
6
  currentSort: ""
@@ -90,15 +90,15 @@ function tt(t, e, s, a, n, r) {
90
90
  class: "text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal flex items-center gap-[6px]",
91
91
  onClick: e[0] || (e[0] = (u) => r.handleClickSortBtn(n.currentSort))
92
92
  }, [
93
- j(T(r.label) + " ", 1),
93
+ j(I(r.label) + " ", 1),
94
94
  (o(), c("svg", Qe, [
95
95
  n.currentSort === "asc" || n.currentSort === "" ? (o(), c("path", Xe)) : w("", !0),
96
96
  n.currentSort === "desc" || n.currentSort === "" ? (o(), c("path", Ye)) : w("", !0)
97
97
  ]))
98
- ])) : (o(), c("p", et, T(r.label), 1))
98
+ ])) : (o(), c("p", et, I(r.label), 1))
99
99
  ]);
100
100
  }
101
- const nt = /* @__PURE__ */ C(Je, [["render", tt]]), st = {
101
+ const nt = /* @__PURE__ */ C(Ge, [["render", tt]]), st = {
102
102
  components: {
103
103
  IconMore: qe,
104
104
  IconDelete: Pe,
@@ -187,7 +187,7 @@ const nt = /* @__PURE__ */ C(Je, [["render", tt]]), st = {
187
187
  }, ut = { class: "p-4" }, dt = { class: "flex justify-end mt-4 gap-x-3" };
188
188
  function bt(t, e, s, a, n, r) {
189
189
  const u = p("IconMore"), f = p("IconEdit"), h = p("router-link"), m = p("IconDelete"), v = p("VsPopover"), i = p("VsDialog");
190
- return o(), c(I, null, [
190
+ return o(), c(T, null, [
191
191
  l("div", lt, [
192
192
  y(v, {
193
193
  trigger: "click",
@@ -216,13 +216,13 @@ function bt(t, e, s, a, n, r) {
216
216
  ]),
217
217
  _: 1
218
218
  }, 8, ["to"])) : w("", !0),
219
- (o(!0), c(I, null, D(r.getCustomActions, (S, P) => (o(), c("button", {
219
+ (o(!0), c(T, null, D(r.getCustomActions, (S, P) => (o(), c("button", {
220
220
  key: P,
221
221
  onClick: (B) => r.customButtonAction(S),
222
222
  class: "w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"
223
223
  }, [
224
224
  y(m, { class: "opacity-0" }),
225
- l("span", it, T(S == null ? void 0 : S.label), 1)
225
+ l("span", it, I(S == null ? void 0 : S.label), 1)
226
226
  ], 8, at))), 128)),
227
227
  s.isForm ? (o(), c("div", ct)) : w("", !0),
228
228
  (A = s.actions) != null && A.includes("del") ? (o(), c("button", {
@@ -372,19 +372,23 @@ const vt = /* @__PURE__ */ C(xt, [["render", _t]]), kt = {
372
372
  custom: this.filterCustom || null
373
373
  },
374
374
  responseType: "blob"
375
- }), s = new Blob([e.data], {
375
+ }), s = await e.data.text(), a = s != null && s.includes(";") ? null : JSON == null ? void 0 : JSON.parse(s), n = new Blob([e.data], {
376
376
  type: "application/octet-stream"
377
- }), a = window.URL.createObjectURL(s), n = document.createElement("a");
378
- n.href = a, n.setAttribute(
377
+ }), r = window.URL.createObjectURL(n), u = document.createElement("a");
378
+ if (u.href = r, u.setAttribute(
379
379
  "download",
380
380
  `${this.table.split(".")[0]}.${this.format}`
381
- ), document.body.appendChild(n), n.click(), document.body.removeChild(n), window.URL.revokeObjectURL(a), this.$notify({
381
+ ), document.body.appendChild(u), typeof a == "string") {
382
+ this.exportTable();
383
+ return;
384
+ }
385
+ u.click(), document.body.removeChild(u), window.URL.revokeObjectURL(r), this.$notify({
382
386
  type: "success",
383
387
  title: "Експорт",
384
388
  message: "Файл успішно експортовано!"
385
389
  }), this.isSuccessTemplate = !0;
386
390
  } catch (e) {
387
- console.error("Ошибка при экспорте файла:", e), this.$notify({
391
+ console.log(e), this.$notify({
388
392
  type: "error",
389
393
  title: "Помилка",
390
394
  message: "Не вдалося експортувати файл."
@@ -412,7 +416,7 @@ const vt = /* @__PURE__ */ C(xt, [["render", _t]]), kt = {
412
416
  }, Ct = {
413
417
  key: 1,
414
418
  class: "p-4"
415
- }, $t = { class: "pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700" }, At = { class: "flex items-center" }, It = { class: "flex items-center gap-[10px] ml-auto" }, Tt = ["onClick"], St = {
419
+ }, $t = { class: "pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700" }, At = { class: "flex items-center" }, Tt = { class: "flex items-center gap-[10px] ml-auto" }, It = ["onClick"], St = {
416
420
  key: 0,
417
421
  class: "block h-[8px] w-[8px] rounded-full bg-blue-500"
418
422
  }, Vt = { class: "mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]" }, Dt = { class: "pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700" }, Ft = { class: "mt-2 space-y-2" }, jt = ["id", "onChange"], Mt = ["for"], qt = {
@@ -424,7 +428,7 @@ const vt = /* @__PURE__ */ C(xt, [["render", _t]]), kt = {
424
428
  };
425
429
  function Bt(t, e, s, a, n, r) {
426
430
  const u = p("IconExport"), f = p("IconChevronDown"), h = p("IconSuccess"), m = p("VsCheckbox"), v = p("VsDialog");
427
- return o(), c(I, null, [
431
+ return o(), c(T, null, [
428
432
  l("button", {
429
433
  onClick: e[0] || (e[0] = (i) => n.isOpen = !0),
430
434
  class: "py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"
@@ -483,8 +487,8 @@ function Bt(t, e, s, a, n, r) {
483
487
  l("div", $t, [
484
488
  l("div", At, [
485
489
  e[9] || (e[9] = l("h2", { class: "text-sm text-gray-500" }, " Виберіть стовпці таблиці для експорту: ", -1)),
486
- l("div", It, [
487
- (o(!0), c(I, null, D(n.actions, (i) => (o(), c("button", {
490
+ l("div", Tt, [
491
+ (o(!0), c(T, null, D(n.actions, (i) => (o(), c("button", {
488
492
  key: i == null ? void 0 : i.name,
489
493
  onClick: i == null ? void 0 : i.function,
490
494
  class: "inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"
@@ -494,12 +498,12 @@ function Bt(t, e, s, a, n, r) {
494
498
  }, [
495
499
  (i == null ? void 0 : i.name) === n.activeAction ? (o(), c("span", St)) : w("", !0)
496
500
  ], 2),
497
- j(" " + T(i == null ? void 0 : i.label), 1)
498
- ], 8, Tt))), 128))
501
+ j(" " + I(i == null ? void 0 : i.label), 1)
502
+ ], 8, It))), 128))
499
503
  ])
500
504
  ]),
501
505
  l("div", Vt, [
502
- (o(!0), c(I, null, D(s.columns, (i, g) => (o(), c("div", {
506
+ (o(!0), c(T, null, D(s.columns, (i, g) => (o(), c("div", {
503
507
  class: "flex items-center",
504
508
  key: g,
505
509
  style: { width: "calc((100% - 10px) / 2)" }
@@ -517,7 +521,7 @@ function Bt(t, e, s, a, n, r) {
517
521
  l("div", Dt, [
518
522
  e[10] || (e[10] = l("h2", { class: "text-sm text-gray-500" }, "Виберіть формат таблиці:", -1)),
519
523
  l("div", Ft, [
520
- (o(!0), c(I, null, D(n.tableFormats, (i, g) => (o(), c("div", {
524
+ (o(!0), c(T, null, D(n.tableFormats, (i, g) => (o(), c("div", {
521
525
  class: "flex items-center",
522
526
  key: g
523
527
  }, [
@@ -531,7 +535,7 @@ function Bt(t, e, s, a, n, r) {
531
535
  l("label", {
532
536
  for: i,
533
537
  class: "text-sm text-gray-800 ms-3 dark:text-neutral-400"
534
- }, " Формат " + T(i), 9, Mt)
538
+ }, " Формат " + I(i), 9, Mt)
535
539
  ]))), 128))
536
540
  ])
537
541
  ])
@@ -541,7 +545,7 @@ function Bt(t, e, s, a, n, r) {
541
545
  }, 8, ["visible"])
542
546
  ], 64);
543
547
  }
544
- const Lt = /* @__PURE__ */ C(kt, [["render", Bt]]), zt = {}, Ut = {
548
+ const Lt = /* @__PURE__ */ C(kt, [["render", Bt]]), zt = {}, Ot = {
545
549
  xmlns: "http://www.w3.org/2000/svg",
546
550
  viewBox: "0 0 24 24",
547
551
  fill: "none",
@@ -551,12 +555,12 @@ const Lt = /* @__PURE__ */ C(kt, [["render", Bt]]), zt = {}, Ut = {
551
555
  "stroke-linejoin": "round",
552
556
  class: "icon icon-tabler icons-tabler-outline icon-tabler-columns"
553
557
  };
554
- function Ot(t, e, s, a, n, r) {
555
- return o(), c("svg", Ut, e[0] || (e[0] = [
558
+ function Ut(t, e, s, a, n, r) {
559
+ return o(), c("svg", Ot, e[0] || (e[0] = [
556
560
  Ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>', 9)
557
561
  ]));
558
562
  }
559
- const Nt = /* @__PURE__ */ C(zt, [["render", Ot]]), Et = {
563
+ const Nt = /* @__PURE__ */ C(zt, [["render", Ut]]), Et = {
560
564
  props: { column: Object },
561
565
  emits: ["update-column"],
562
566
  data() {
@@ -581,12 +585,12 @@ function Rt(t, e, s, a, n, r) {
581
585
  "onUpdate:modelValue": e[0] || (e[0] = (h) => n.value = h),
582
586
  type: "checkbox"
583
587
  }, null, 512), [
584
- [Ze, n.value]
588
+ [Je, n.value]
585
589
  ]),
586
- j(" " + T(((u = s.column) == null ? void 0 : u.ua) || ((f = s.column) == null ? void 0 : f.title)), 1)
590
+ j(" " + I(((u = s.column) == null ? void 0 : u.ua) || ((f = s.column) == null ? void 0 : f.title)), 1)
587
591
  ]);
588
592
  }
589
- const Wt = /* @__PURE__ */ C(Et, [["render", Rt]]), Zt = {
593
+ const Wt = /* @__PURE__ */ C(Et, [["render", Rt]]), Jt = {
590
594
  components: { IconColumns: Nt, AdminTableColumnsHiddenItem: Wt },
591
595
  emits: ["update-columns"],
592
596
  props: { columns: Array },
@@ -596,7 +600,7 @@ const Wt = /* @__PURE__ */ C(Et, [["render", Rt]]), Zt = {
596
600
  s[e] = t, this.$emit("update-columns", [...s]);
597
601
  }
598
602
  }
599
- }, Gt = { class: "py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Jt = { class: "py-[10px] px-[10px] w-[260px]" }, Kt = { class: "flex flex-col gap-[3px] max-h-[400px] w-full overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500" };
603
+ }, Zt = { class: "py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Gt = { class: "py-[10px] px-[10px] w-[260px]" }, Kt = { class: "flex flex-col gap-[3px] max-h-[400px] w-full overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500" };
600
604
  function Qt(t, e, s, a, n, r) {
601
605
  const u = p("IconColumns"), f = p("AdminTableColumnsHiddenItem"), h = p("VsPopover");
602
606
  return o(), _(h, {
@@ -604,7 +608,7 @@ function Qt(t, e, s, a, n, r) {
604
608
  placement: "bottom"
605
609
  }, {
606
610
  reference: $(() => [
607
- l("button", Gt, [
611
+ l("button", Zt, [
608
612
  y(u, {
609
613
  height: "20",
610
614
  width: "16"
@@ -612,10 +616,10 @@ function Qt(t, e, s, a, n, r) {
612
616
  ])
613
617
  ]),
614
618
  default: $(() => [
615
- l("div", Jt, [
619
+ l("div", Gt, [
616
620
  e[0] || (e[0] = l("h2", { class: "text-sm mb-[8px]" }, "Оберіть колонки, щоб приховати", -1)),
617
621
  l("ul", Kt, [
618
- (o(!0), c(I, null, D(s.columns, (m, v) => (o(), c("li", { key: v }, [
622
+ (o(!0), c(T, null, D(s.columns, (m, v) => (o(), c("li", { key: v }, [
619
623
  y(f, {
620
624
  column: m,
621
625
  onUpdateColumn: r.updateColumn
@@ -627,7 +631,7 @@ function Qt(t, e, s, a, n, r) {
627
631
  _: 1
628
632
  });
629
633
  }
630
- const Xt = /* @__PURE__ */ C(Zt, [["render", Qt]]), Yt = {}, en = {
634
+ const Xt = /* @__PURE__ */ C(Jt, [["render", Qt]]), Yt = {}, en = {
631
635
  class: "hidden sm:block shrink-0 size-3",
632
636
  xmlns: "http://www.w3.org/2000/svg",
633
637
  fill: "currentColor",
@@ -642,7 +646,7 @@ function tn(t, e, s, a, n, r) {
642
646
  }, null, -1)
643
647
  ]));
644
648
  }
645
- const O = /* @__PURE__ */ C(Yt, [["render", tn]]), nn = {
649
+ const U = /* @__PURE__ */ C(Yt, [["render", tn]]), nn = {
646
650
  props: { row: Object, column: Object, table: String }
647
651
  };
648
652
  function sn(t, e, s, a, n, r) {
@@ -680,7 +684,7 @@ function rn(t, e, s, a, n, r) {
680
684
  ]));
681
685
  }
682
686
  const an = /* @__PURE__ */ C(ln, [["render", rn]]), cn = {
683
- components: { IconPlus: O, IconMinus: an },
687
+ components: { IconPlus: U, IconMinus: an },
684
688
  props: {
685
689
  title: String,
686
690
  defaultValue: { type: Boolean, default: () => !1 }
@@ -699,7 +703,7 @@ function hn(t, e, s, a, n, r) {
699
703
  onClick: e[0] || (e[0] = (h) => n.expanded = !n.expanded),
700
704
  class: "rounded-md cursor-pointer grow"
701
705
  }, [
702
- l("span", bn, T(s.title), 1)
706
+ l("span", bn, I(s.title), 1)
703
707
  ]),
704
708
  l("button", {
705
709
  class: "flex items-center justify-center rounded-md size-6 hover:bg-gray-100",
@@ -711,12 +715,12 @@ function hn(t, e, s, a, n, r) {
711
715
  })) : (o(), _(u, { key: 0 }))
712
716
  ])
713
717
  ]),
714
- y(U, { name: "fade" }, {
718
+ y(O, { name: "fade" }, {
715
719
  default: $(() => [
716
720
  z(l("div", pn, [
717
- Ge(t.$slots, "default", {}, void 0, !0)
721
+ Ze(t.$slots, "default", {}, void 0, !0)
718
722
  ], 512), [
719
- [Ie, n.expanded]
723
+ [Te, n.expanded]
720
724
  ])
721
725
  ]),
722
726
  _: 3
@@ -730,8 +734,8 @@ const fn = /* @__PURE__ */ C(cn, [["render", hn], ["__scopeId", "data-v-c6318482
730
734
  AdminComponentIs: Se,
731
735
  AdminTree: fn,
732
736
  VsNoData: ze,
733
- VsWidgetComments: Ue,
734
- VsWidgetMap: Oe,
737
+ VsWidgetComments: Oe,
738
+ VsWidgetMap: Ue,
735
739
  VsWidgetFileList: Ne
736
740
  },
737
741
  props: { table: String, columns: Array, row: Object }
@@ -750,7 +754,7 @@ function An(t, e, s, a, n, r) {
750
754
  l("h2", { class: "text-sm font-medium" }, "Інформація про об'єкт")
751
755
  ], -1)),
752
756
  l("div", xn, [
753
- (d = (g = t.$route) == null ? void 0 : g.query) != null && d.card ? (o(), c(I, { key: 0 }, [
757
+ (d = (g = t.$route) == null ? void 0 : g.query) != null && d.card ? (o(), c(T, { key: 0 }, [
754
758
  s.row ? (o(), _(f, {
755
759
  key: 0,
756
760
  defaultValue: !0,
@@ -758,9 +762,9 @@ function An(t, e, s, a, n, r) {
758
762
  class: "border-b p-[10px] py-[16px]"
759
763
  }, {
760
764
  default: $(() => [
761
- (o(!0), c(I, null, D(s.columns, (x) => (o(), c("dl", yn, [
765
+ (o(!0), c(T, null, D(s.columns, (x) => (o(), c("dl", yn, [
762
766
  l("dt", _n, [
763
- l("p", vn, T((x == null ? void 0 : x.ua) || (x == null ? void 0 : x.title)) + ": ", 1)
767
+ l("p", vn, I((x == null ? void 0 : x.ua) || (x == null ? void 0 : x.title)) + ": ", 1)
764
768
  ]),
765
769
  l("dd", kn, [
766
770
  l("p", wn, [
@@ -836,7 +840,7 @@ function An(t, e, s, a, n, r) {
836
840
  ])
837
841
  ]);
838
842
  }
839
- const In = /* @__PURE__ */ C(mn, [["render", An]]), Tn = {}, Sn = {
843
+ const Tn = /* @__PURE__ */ C(mn, [["render", An]]), In = {}, Sn = {
840
844
  class: "size-4",
841
845
  xmlns: "http://www.w3.org/2000/svg",
842
846
  viewBox: "0 0 24 24",
@@ -859,7 +863,7 @@ function Vn(t, e, s, a, n, r) {
859
863
  l("path", { d: "m8 9 3 3-3 3" }, null, -1)
860
864
  ]));
861
865
  }
862
- const Dn = /* @__PURE__ */ C(Tn, [["render", Vn]]), Fn = {}, jn = {
866
+ const Dn = /* @__PURE__ */ C(In, [["render", Vn]]), Fn = {}, jn = {
863
867
  class: "h21yx vs0hq",
864
868
  xmlns: "http://www.w3.org/2000/svg",
865
869
  width: "24",
@@ -896,7 +900,7 @@ const qn = /* @__PURE__ */ C(Fn, [["render", Mn]]), Pn = {
896
900
  }, Ln = { class: "filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500" };
897
901
  function zn(t, e, s, a, n, r) {
898
902
  const u = p("IconFilter"), f = p("VsFilter");
899
- return o(), c(I, null, [
903
+ return o(), c(T, null, [
900
904
  l("button", {
901
905
  onClick: e[0] || (e[0] = (h) => n.isFilters = !n.isFilters),
902
906
  class: "py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"
@@ -906,9 +910,9 @@ function zn(t, e, s, a, n, r) {
906
910
  width: "16"
907
911
  }),
908
912
  e[4] || (e[4] = j(" Фільтри ")),
909
- s.onFilters ? (o(), c("span", Bn, T(s.onFilters), 1)) : w("", !0)
913
+ s.onFilters ? (o(), c("span", Bn, I(s.onFilters), 1)) : w("", !0)
910
914
  ]),
911
- y(U, { name: "fade" }, {
915
+ y(O, { name: "fade" }, {
912
916
  default: $(() => {
913
917
  var h;
914
918
  return [
@@ -932,7 +936,7 @@ function zn(t, e, s, a, n, r) {
932
936
  }, null, 8, ["scheme"])) : w("", !0)
933
937
  ])
934
938
  ], 512), [
935
- [Ie, n.isFilters]
939
+ [Te, n.isFilters]
936
940
  ])
937
941
  ];
938
942
  }),
@@ -940,7 +944,7 @@ function zn(t, e, s, a, n, r) {
940
944
  })
941
945
  ], 64);
942
946
  }
943
- const Un = /* @__PURE__ */ C(Pn, [["render", zn]]), On = {
947
+ const On = /* @__PURE__ */ C(Pn, [["render", zn]]), Un = {
944
948
  props: { tabsList: { type: Array, default: () => [] }, filterState: String }
945
949
  }, Nn = {
946
950
  class: "relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700",
@@ -950,15 +954,15 @@ const Un = /* @__PURE__ */ C(Pn, [["render", zn]]), On = {
950
954
  }, En = ["onClick"];
951
955
  function Hn(t, e, s, a, n, r) {
952
956
  return o(), c("nav", Nn, [
953
- (o(!0), c(I, null, D(s.tabsList, (u) => (o(), c("button", {
957
+ (o(!0), c(T, null, D(s.tabsList, (u) => (o(), c("button", {
954
958
  onClick: (f) => t.$emit("update:filterState", u == null ? void 0 : u.name),
955
959
  class: V(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active", {
956
960
  " font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800": (u == null ? void 0 : u.name) === s.filterState
957
961
  }])
958
- }, T(u == null ? void 0 : u.label), 11, En))), 256))
962
+ }, I(u == null ? void 0 : u.label), 11, En))), 256))
959
963
  ]);
960
964
  }
961
- const Rn = /* @__PURE__ */ C(On, [["render", Hn]]), Wn = {}, Zn = {
965
+ const Rn = /* @__PURE__ */ C(Un, [["render", Hn]]), Wn = {}, Jn = {
962
966
  xmlns: "http://www.w3.org/2000/svg",
963
967
  viewBox: "0 0 24 24",
964
968
  fill: "none",
@@ -968,8 +972,8 @@ const Rn = /* @__PURE__ */ C(On, [["render", Hn]]), Wn = {}, Zn = {
968
972
  "stroke-linejoin": "round",
969
973
  class: "icon icon-tabler icons-tabler-outline icon-tabler-filter"
970
974
  };
971
- function Gn(t, e, s, a, n, r) {
972
- return o(), c("svg", Zn, e[0] || (e[0] = [
975
+ function Zn(t, e, s, a, n, r) {
976
+ return o(), c("svg", Jn, e[0] || (e[0] = [
973
977
  l("path", {
974
978
  stroke: "none",
975
979
  d: "M0 0h24v24H0z",
@@ -978,8 +982,8 @@ function Gn(t, e, s, a, n, r) {
978
982
  l("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" }, null, -1)
979
983
  ]));
980
984
  }
981
- const Jn = /* @__PURE__ */ C(Wn, [["render", Gn]]), Kn = {
982
- components: { IconFilter2: Jn },
985
+ const Gn = /* @__PURE__ */ C(Wn, [["render", Zn]]), Kn = {
986
+ components: { IconFilter2: Gn },
983
987
  props: { filterCustom: String, customList: Array }
984
988
  }, Qn = { class: "py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Xn = { class: "flex flex-col gap-[4px]" }, Yn = ["onClick"];
985
989
  function es(t, e, s, a, n, r) {
@@ -998,14 +1002,14 @@ function es(t, e, s, a, n, r) {
998
1002
  ]),
999
1003
  default: $(() => [
1000
1004
  l("div", Xn, [
1001
- (o(!0), c(I, null, D(s.customList, (h, m) => (o(), c("button", {
1005
+ (o(!0), c(T, null, D(s.customList, (h, m) => (o(), c("button", {
1002
1006
  onClick: (v) => {
1003
1007
  var i;
1004
1008
  t.$emit("update:filterCustom", h == null ? void 0 : h.name), (i = t.$refs) == null || i.popover.togglePopover();
1005
1009
  },
1006
1010
  key: m,
1007
1011
  class: V(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300", { "bg-gray-100": s.filterCustom === (h == null ? void 0 : h.name) }])
1008
- }, T(h == null ? void 0 : h.label), 11, Yn))), 128)),
1012
+ }, I(h == null ? void 0 : h.label), 11, Yn))), 128)),
1009
1013
  l("button", {
1010
1014
  class: "p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",
1011
1015
  onClick: e[0] || (e[0] = (h) => {
@@ -1025,7 +1029,7 @@ const ts = /* @__PURE__ */ C(Kn, [["render", es]]), ns = { class: "flex items-ce
1025
1029
  },
1026
1030
  setup(t) {
1027
1031
  var f, h, m, v, i;
1028
- const { asyncTemplateSlot: e } = (i = (v = (m = (h = (f = Te()) == null ? void 0 : f.appContext) == null ? void 0 : h.app) == null ? void 0 : m.config) == null ? void 0 : v.globalProperties) == null ? void 0 : i.utils, s = L(""), a = L(""), n = t, r = () => {
1032
+ const { asyncTemplateSlot: e } = (i = (v = (m = (h = (f = Ie()) == null ? void 0 : f.appContext) == null ? void 0 : h.app) == null ? void 0 : m.config) == null ? void 0 : v.globalProperties) == null ? void 0 : i.utils, s = L(""), a = L(""), n = t, r = () => {
1029
1033
  var g, d, k, x, A;
1030
1034
  if ((g = n.slots) != null && g.panelLeft || (a.value = "div"), (k = (d = n.slots) == null ? void 0 : d.panelLeft) != null && k.includes("<")) {
1031
1035
  const S = e("PanelLeft", (x = n.slots) == null ? void 0 : x.panelLeft, [
@@ -1063,7 +1067,7 @@ const ts = /* @__PURE__ */ C(Kn, [["render", es]]), ns = { class: "flex items-ce
1063
1067
  },
1064
1068
  setup(t) {
1065
1069
  var r, u, f, h, m;
1066
- const { asyncTemplateSlot: e } = (m = (h = (f = (u = (r = Te()) == null ? void 0 : r.appContext) == null ? void 0 : u.app) == null ? void 0 : f.config) == null ? void 0 : h.globalProperties) == null ? void 0 : m.utils, s = L(""), a = t;
1070
+ const { asyncTemplateSlot: e } = (m = (h = (f = (u = (r = Ie()) == null ? void 0 : r.appContext) == null ? void 0 : u.app) == null ? void 0 : f.config) == null ? void 0 : h.globalProperties) == null ? void 0 : m.utils, s = L(""), a = t;
1067
1071
  return (() => {
1068
1072
  var v, i, g, d, k;
1069
1073
  if ((v = a.slots) != null && v.addButton || (s.value = "div"), (g = (i = a.slots) == null ? void 0 : i.addButton) != null && g.includes("<")) {
@@ -1075,7 +1079,7 @@ const ts = /* @__PURE__ */ C(Kn, [["render", es]]), ns = { class: "flex items-ce
1075
1079
  s.value = (k = a.slots) == null ? void 0 : k.addButton;
1076
1080
  })(), (v, i) => s.value ? (o(), _(q(s.value), {
1077
1081
  key: 0,
1078
- IconPlus: O
1082
+ IconPlus: U
1079
1083
  })) : w("", !0);
1080
1084
  }
1081
1085
  }, rs = {
@@ -1086,12 +1090,12 @@ const ts = /* @__PURE__ */ C(Kn, [["render", es]]), ns = { class: "flex items-ce
1086
1090
  AdminTableColumnsHidden: Xt,
1087
1091
  AdminTableColumn: nt,
1088
1092
  AdminNodata: Ee,
1089
- IconPlus: O,
1093
+ IconPlus: U,
1090
1094
  IconSearch: He,
1091
- AdminTableCardInfo: In,
1095
+ AdminTableCardInfo: Tn,
1092
1096
  IconOpenCard: Dn,
1093
1097
  AdminComponentIs: Se,
1094
- AdminTableFilters: Un,
1098
+ AdminTableFilters: On,
1095
1099
  AdminTableTabs: Rn,
1096
1100
  AdminTableCustomFilters: ts,
1097
1101
  AdminTableCustomButtons: ss,
@@ -1288,17 +1292,17 @@ const ts = /* @__PURE__ */ C(Kn, [["render", es]]), ns = { class: "flex items-ce
1288
1292
  }, ms = { class: "sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200" }, gs = { class: "right-0 border-t border-stone-200" }, xs = {
1289
1293
  key: 0,
1290
1294
  class: "w-[70px] sticky right-0 top-0"
1291
- }, ys = { class: "divide-y divide-gray-200" }, _s = { class: "px-4 py-3 text-sm text-gray-600" }, vs = ["onClick"], ks = ["onClick"], ws = { class: "p-[20px] flex justify-start items-center w-full" }, Cs = { class: "w-[200px] md:inline-flex hidden" }, $s = { class: "text-sm text-gray-600 dark:text-neutral-400" }, As = { class: "font-semibold text-gray-800 dark:text-neutral-200" }, Is = { key: 0 }, Ts = {
1295
+ }, ys = { class: "divide-y divide-gray-200" }, _s = { class: "px-4 py-3 text-sm text-gray-600" }, vs = ["onClick"], ks = ["onClick"], ws = { class: "p-[20px] flex justify-start items-center w-full" }, Cs = { class: "w-[200px] md:inline-flex hidden" }, $s = { class: "text-sm text-gray-600 dark:text-neutral-400" }, As = { class: "font-semibold text-gray-800 dark:text-neutral-200" }, Ts = { key: 0 }, Is = {
1292
1296
  key: 0,
1293
1297
  class: "font-semibold text-gray-800 dark:text-neutral-200"
1294
1298
  };
1295
1299
  function Ss(t, e, s, a, n, r) {
1296
- var N, E, H, R, W, Z, G, J, K, Q, X, Y, ee, te, ne, se, le, oe, re, ae, ie, ce, ue, de, be, pe;
1300
+ var N, E, H, R, W, J, Z, G, K, Q, X, Y, ee, te, ne, se, le, oe, re, ae, ie, ce, ue, de, be, pe;
1297
1301
  const u = p("AdminCustomButtonAdd"), f = p("IconPlus"), h = p("router-link"), m = p("AdminTableTabs"), v = p("IconSearch"), i = p("VsText"), g = p("AdminTableCustomButtons"), d = p("AdminTableCustomFilters"), k = p("AdminTableColumnsHidden"), x = p("AdminTableExport"), A = p("AdminTableFilters"), S = p("IconOpenCard"), P = p("AdminTableColumn"), B = p("AdminComponentIs"), Ve = p("AdminTableControl"), De = p("AdminNodata"), Fe = p("VsPagination"), je = p("AdminTableCardInfo");
1298
1302
  return o(), c("div", as, [
1299
1303
  l("div", is, [
1300
- l("h2", cs, T(s.title), 1),
1301
- r.isForm ? (o(), c(I, { key: 0 }, [
1304
+ l("h2", cs, I(s.title), 1),
1305
+ r.isForm ? (o(), c(T, { key: 0 }, [
1302
1306
  (E = (N = n.tableData) == null ? void 0 : N.slots) != null && E.addButton ? (o(), _(u, {
1303
1307
  key: 0,
1304
1308
  slots: (H = n.tableData) == null ? void 0 : H.slots
@@ -1320,9 +1324,9 @@ function Ss(t, e, s, a, n, r) {
1320
1324
  ]),
1321
1325
  l("div", us, [
1322
1326
  l("div", ds, [
1323
- (G = (Z = n.tableData) == null ? void 0 : Z.filterState) != null && G.length ? (o(), _(m, {
1327
+ (Z = (J = n.tableData) == null ? void 0 : J.filterState) != null && Z.length ? (o(), _(m, {
1324
1328
  key: 0,
1325
- tabsList: (J = n.tableData) == null ? void 0 : J.filterState,
1329
+ tabsList: (G = n.tableData) == null ? void 0 : G.filterState,
1326
1330
  filterState: n.filterState,
1327
1331
  "onUpdate:filterState": e[0] || (e[0] = (b) => n.filterState = b)
1328
1332
  }, null, 8, ["tabsList", "filterState"])) : w("", !0),
@@ -1398,7 +1402,7 @@ function Ss(t, e, s, a, n, r) {
1398
1402
  r.isNoData ? (o(), _(De, { key: 1 })) : (o(), c("table", fs, [
1399
1403
  l("thead", ms, [
1400
1404
  l("tr", gs, [
1401
- (o(!0), c(I, null, D(r.columns, (b) => (o(), _(P, {
1405
+ (o(!0), c(T, null, D(r.columns, (b) => (o(), _(P, {
1402
1406
  key: b.name,
1403
1407
  style: $e({
1404
1408
  width: r.rowWidth(b == null ? void 0 : b.name),
@@ -1415,7 +1419,7 @@ function Ss(t, e, s, a, n, r) {
1415
1419
  ])
1416
1420
  ]),
1417
1421
  l("tbody", ys, [
1418
- (o(!0), c(I, null, D((ce = n.tableData) == null ? void 0 : ce.rows, (b, Me) => {
1422
+ (o(!0), c(T, null, D((ce = n.tableData) == null ? void 0 : ce.rows, (b, Me) => {
1419
1423
  var he, fe, me, ge, xe, ye, _e, ve, ke, we;
1420
1424
  return o(), c("tr", {
1421
1425
  key: Me,
@@ -1438,7 +1442,7 @@ function Ss(t, e, s, a, n, r) {
1438
1442
  }, null, 8, ["row", "column", "table", "onUpdateTable"])
1439
1443
  ], 10, vs)
1440
1444
  ]),
1441
- (o(!0), c(I, null, D((ge = r.columns) == null ? void 0 : ge.slice(1), (M) => (o(), c("td", {
1445
+ (o(!0), c(T, null, D((ge = r.columns) == null ? void 0 : ge.slice(1), (M) => (o(), c("td", {
1442
1446
  onClick: (Ms) => r.changeActiveCardInfo(b == null ? void 0 : b.id),
1443
1447
  class: V(["px-3 py-3 text-sm text-gray-600 text-start", { "cursor-pointer": n.isVisibleCardInfo }]),
1444
1448
  key: M.name
@@ -1478,10 +1482,10 @@ function Ss(t, e, s, a, n, r) {
1478
1482
  l("div", Cs, [
1479
1483
  l("p", $s, [
1480
1484
  l("span", As, [
1481
- j(T(n.filters || n.searchValue ? "Знайдено" : "Об'єктів") + " " + T(((ue = n.tableData) == null ? void 0 : ue.count) || "0 ") + " ", 1),
1482
- n.filters || n.searchValue ? (o(), c("span", Is, " з")) : w("", !0)
1485
+ j(I(n.filters || n.searchValue ? "Знайдено" : "Об'єктів") + " " + I(((ue = n.tableData) == null ? void 0 : ue.count) || "0 ") + " ", 1),
1486
+ n.filters || n.searchValue ? (o(), c("span", Ts, " з")) : w("", !0)
1483
1487
  ]),
1484
- n.filters || n.searchValue ? (o(), c("span", Ts, T(" " + ((de = n.tableData) == null ? void 0 : de.filtered) || 0), 1)) : w("", !0)
1488
+ n.filters || n.searchValue ? (o(), c("span", Is, I(" " + ((de = n.tableData) == null ? void 0 : de.filtered) || 0), 1)) : w("", !0)
1485
1489
  ])
1486
1490
  ]),
1487
1491
  Math.ceil(((be = n.tableData) == null ? void 0 : be.filtered) / n.limit) > 1 ? (o(), _(Fe, {
@@ -1498,7 +1502,7 @@ function Ss(t, e, s, a, n, r) {
1498
1502
  }, null, 8, ["default-page", "total", "pageSize", "onPageChange", "onPageSizeChange"])) : w("", !0)
1499
1503
  ])
1500
1504
  ], 2),
1501
- y(U, { name: "slide-fade" }, {
1505
+ y(O, { name: "slide-fade" }, {
1502
1506
  default: $(() => {
1503
1507
  var b;
1504
1508
  return [
@@ -1,4 +1,4 @@
1
- import { _, I as R, a as q, u as Z, s as T, b as G, c as J, d as S } from "./import-file-D9va23Wq.js";
1
+ import { _, I as R, a as q, u as Z, s as T, b as G, c as J, d as S } from "./import-file-DipOleMT.js";
2
2
  import { openBlock as l, createElementBlock as a, createElementVNode as n, createStaticVNode as B, resolveComponent as p, normalizeClass as L, createTextVNode as U, toDisplayString as A, createVNode as c, Transition as K, withCtx as Q, withDirectives as P, Fragment as E, renderList as F, vShow as W, createCommentVNode as D, withModifiers as X, createBlock as Y, resolveDynamicComponent as e1 } from "vue";
3
3
  const t1 = {}, o1 = {
4
4
  xmlns: "http://www.w3.org/2000/svg",
package/dist/admin.js CHANGED
@@ -1,4 +1,4 @@
1
- import { k as f } from "./import-file-D9va23Wq.js";
1
+ import { k as f } from "./import-file-DipOleMT.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -791,4 +791,4 @@ img.ProseMirror-separator {
791
791
  </div>
792
792
  `}).mount(u)},{Fancybox:dU}=My,o_={$form:lU,$api:uU,$map:hU,$preview:({media:n})=>{const e=document.querySelector("#app");if(!e){console.error('Modal root element with id "#app" not found!');return}const t=document.createElement("div");e.appendChild(t),f.createApp({data(){return{items:Array.isArray(n)?n:[n]}},mounted(){this.$nextTick(()=>{dU.show(this.items.map(r=>{const a=typeof r=="string"&&r.endsWith(".pdf");return{src:r,type:a?"iframe":"image"}}),{groupAll:!0,Thumbs:{autoStart:!0}})})},template:`
793
793
  <div style="display: none;"></div> <!-- Keeps container hidden -->
794
- `}).mount(t)}},pU=async()=>{try{const{data:n}=await ut.get("/api/user-menu");return Jr.value=n,t_(n)}catch(n){return console.error(n),[]}},fU=(n,e)=>{Object.entries(e).forEach(([t,i])=>{n.component(t,i)})},mU={async install(n,{componentsApp:e={},settings:t,routes:i=[]}){ia.value={...ia,...t};try{const a=(await pU()).filter(l=>l==null?void 0:l.component).map(l=>({...l,component:{...s_,...e}[l==null?void 0:l.component]}));fU(n,{...s_,...e}),n.component("admin",QT);const{router:u}=await BA(a.concat(i));window.app={...n,router:u},window.v3plugin={...n.config.globalProperties,...o_},n.config.globalProperties={...n.config.globalProperties,$componentsConfig:{...TB,componentsApp:e},$router:u,$v3plugin:o_,$utils:{reloadCardPage:Zf}},n.use(u)}catch(r){console.error(r)}},components:s_,plugins:o_},gU={data(){return{formValues:{},scheme:null,table:"",token:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const{data:{form:a}}=await ut.get(`/api/template/table/${t}`),{data:u}=await ut.get(`/api/table/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.token=(u==null?void 0:u.token)||"",this.formValues=u||{};const{data:l}=await ut.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},yU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},_U={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},bU={class:"flex items-center gap-[6px]"},xU={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},vU={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function wU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",yU,[f.createElementVNode("div",_U,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",bU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Повернутися "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.onlyEditObject&&a.onlyEditObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти "),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...l)=>a.editObjectAndRedirect&&a.editObjectAndRedirect(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти і повернутися ")])]),f.createElementVNode("div",xU,[f.createElementVNode("div",vU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[3]||(e[3]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const kU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(gU,[["render",wU]])},Symbol.toStringTag,{value:"Module"})),SU={data(){return{formValues:{},scheme:null,table:"",token:"",api:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const a=await ut.get(`/api/table-data/${t}`),{data:u}=await ut.get(`/api/template/form/${(i=a==null?void 0:a.data)==null?void 0:i.form}`);this.scheme=(u==null?void 0:u.schema)||u,this.api=(u==null?void 0:u.api)||"",this.token=(r=a==null?void 0:a.data)==null?void 0:r.addToken}catch{}},async createObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},EU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},CU={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},TU={class:"flex items-center gap-[6px]"},MU={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},AU={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function PU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",EU,[f.createElementVNode("div",CU,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",TU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),f.createElementVNode("div",MU,[f.createElementVNode("div",AU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const IU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(SU,[["render",PU]])},Symbol.toStringTag,{value:"Module"})),DU={};function OU(n,e,t,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const US=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(DU,[["render",OU]])},Symbol.toStringTag,{value:"Module"})),BU={},NU={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function zU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",NU,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),f.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),f.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const RU=Ue(BU,[["render",zU]]),LU={},VU={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",VU,e[0]||(e[0]=[f.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const $U=Ue(LU,[["render",FU]]),jU={components:{IconChevronDown:i_},props:{route:Object,searchable:String},mounted(){var n,e,t;(n=this.route)!=null&&n.menu&&(t=(e=this.route)==null?void 0:e.menu)!=null&&t.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},watch:{route(n){n!=null&&n.open&&(this.isOpen=!0)}},data(){return{isOpen:!1}},methods:{highLight(n){if(!this.searchable)return n;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`(${e})(\\s*)`,"gi");return n.replace(t,(i,r,a)=>`<span style="color:#1989fa;">${r}</span>${a}`)}}},UU={key:0,class:""},HU={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},qU={key:1};function WU(n,e,t,i,r,a){var g,b,w,E,C,P,D,R,$,G,ee,ce,U,Me,ke;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=t.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",UU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Pe=>r.isOpen=!r.isOpen),class:f.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((w=(b=t.route)==null?void 0:b.menu)==null?void 0:w.some(Pe=>{var Fe,Be;return(Pe==null?void 0:Pe.path)===n.$route.path.replace("/","")||(Pe==null?void 0:Pe.table)===((Be=(Fe=n.$route)==null?void 0:Fe.params)==null?void 0:Be.table)&&(Pe==null?void 0:Pe.table)}))&&"bg-gray-100"]])},[f.createTextVNode(f.toDisplayString((E=t.route)==null?void 0:E.ua)+" ",1),f.createVNode(u,{class:f.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var Pe;return[f.withDirectives(f.createElementVNode("ul",HU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Pe=t.route)==null?void 0:Pe.menu,(Fe,Be)=>{var pt,tt;return f.openBlock(),f.createElementBlock("li",{key:Be,class:"w-full"},[f.createVNode(l,{innerHTML:a.highLight(Fe==null?void 0:Fe.ua),to:"/"+(Fe==null?void 0:Fe.path),class:f.normalizeClass([[((Fe==null?void 0:Fe.path)===n.$route.path.replace("/","")||((tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.table)===(Fe==null?void 0:Fe.table)&&(Fe==null?void 0:Fe.table))&&"bg-gray-100"],"block px-3 py-2 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(C=t.route)!=null&&C.hidden?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",qU,[f.createVNode(l,{innerHTML:a.highLight((P=t.route)==null?void 0:P.ua),to:((R=(D=t.route)==null?void 0:D.path)==null?void 0:R[0])==="/"?($=t.route)==null?void 0:$.path:"/"+((G=t.route)==null?void 0:G.path),class:f.normalizeClass([[(((ee=t.route)==null?void 0:ee.path.replace("/",""))===n.$route.path.replace("/","")||((U=(ce=n.$route)==null?void 0:ce.params)==null?void 0:U.table)===((Me=t.route)==null?void 0:Me.table)&&((ke=t.route)==null?void 0:ke.table))&&"bg-gray-100"],"inline-block py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},null,8,["innerHTML","to","class"])]))}const GU={components:{IconLogout:RU,NavbarItem:Ue(jU,[["render",WU]]),IconLogo:$U,IconSearch:n_},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var n;return(n=this.searchValue)!=null&&n.trim()?this.filterMenu(Jr.value,this.searchValue):Jr.value},logo(){var n;return((n=ia.value)==null?void 0:n.logo)||"/assets/logo.svg"}},methods:{filterMenu(n,e){return n.map(t=>{var i,r;if(t.menu){const a=this.filterMenu(t.menu,e);if(a.length>0)return{...t,menu:a,open:!0}}else if((r=(i=t.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e.toLowerCase()))return t;return null}).filter(Boolean)}}},ZU={class:"h-[59px] w-full p-[4px] mb-[10px]"},YU=["src"],XU={class:"relative mx-[16px] pl"},KU={class:"p-[16px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},JU={class:"flex flex-col flex-wrap w-full pb-3"},QU={key:0,class:"flex flex-col gap-[6px]"},e9={key:1,class:"text-gray-800 text-lg mt-[20px]"};function t9(n,e,t,i,r,a){var b;const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] border-r w-[260px] shrink-0 absolute transition left-[-100%] z-[11] bg-white",[{"left-0":n.$parent.showMenu}]])},[f.createElementVNode("div",ZU,[f.createElementVNode("img",{src:a.logo,class:"object-contain w-full h-full"},null,8,YU)]),f.createElementVNode("div",XU,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[16px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=w=>r.searchValue=w),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:pl-[40px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("div",KU,[f.createElementVNode("nav",JU,[(b=a.data)!=null&&b.length?(f.openBlock(),f.createElementBlock("ul",QU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(w,E)=>(f.openBlock(),f.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[f.createVNode(g,{route:w,searchable:r.searchValue},null,8,["route","searchable"])]))),128))])):(f.openBlock(),f.createElementBlock("div",e9,"Не знайдено"))])])],2)}const n9=Ue(GU,[["render",t9]]),i9={},r9={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function s9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",r9,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),f.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),f.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const o9={components:{IconQuestion:Ue(i9,[["render",s9]]),IconUser:VS,AdminNotification:FS},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(n){n?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:n}=await ut.get("/user");this.userData=n}catch{}},async logout(){try{await ut.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},a9={class:"h-[60px] border-b flex lg:justify-end justify-between items-center px-[20px]"},l9={class:"flex items-center gap-[6px]"},c9={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},u9={class:"relative"},h9=["src"],d9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},p9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},f9=["src"],m9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},g9={class:"text-[14px] mr-[10px] text-gray-500"},y9={class:"flex flex-col p-[4px]"};function _9(n,e,t,i,r,a){var w,E,C,P,D,R,$,G,ee,ce;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",a9,[f.createElementVNode("div",{class:"lg:hidden flex",onClick:e[0]||(e[0]=U=>n.$parent.showMenu=!0)},e[4]||(e[4]=[f.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),f.createElementVNode("div",l9,[f.createElementVNode("a",c9,[f.createVNode(u,{height:"24",width:"24"})]),f.createVNode(l),e[6]||(e[6]=f.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),f.createElementVNode("div",u9,[f.createElementVNode("div",{onClick:e[1]||(e[1]=U=>r.isVisible=!0),class:"cursor-pointer"},[(E=(w=r.userData)==null?void 0:w.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(P=(C=r.userData)==null?void 0:C.user)==null?void 0:P.avatar,alt:"Image Description"},null,8,h9)):(f.openBlock(),f.createElementBlock("div",d9,[f.createVNode(g)]))]),r.isVisible?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=f.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[f.createElementVNode("div",p9,[(R=(D=r.userData)==null?void 0:D.user)!=null&&R.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=($=r.userData)==null?void 0:$.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,f9)):(f.openBlock(),f.createElementBlock("div",m9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",g9,f.toDisplayString((ce=(ee=r.userData)==null?void 0:ee.user)==null?void 0:ce.username),1)])]),f.createElementVNode("div",y9,[f.createVNode(b,{to:"profile",disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:f.withCtx(()=>e[5]||(e[5]=[f.createTextVNode("Профіль")])),_:1}),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...U)=>a.logout&&a.logout(...U)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const b9={components:{navbar:n9,AdminHeader:Ue(o9,[["render",_9]])},data(){return{showMenu:!1}},computed:{isMenu(){return Jr.value||null},header(){var n;return((n=ia.value)==null?void 0:n.header)||"admin-header"}}},x9={class:"admin-wrapper"},v9={class:"flex flex-col w-full"};function w9(n,e,t,i,r,a){const u=f.resolveComponent("navbar"),l=f.resolveComponent("router-view");return f.openBlock(),f.createElementBlock("div",x9,[f.createVNode(u),r.showMenu?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=g=>r.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):f.createCommentVNode("",!0),f.createElementVNode("div",v9,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.header))),f.createVNode(l)],64)):f.createCommentVNode("",!0)])])}const k9=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(b9,[["render",w9],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),S9={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var n,e;return((n=this.data)==null?void 0:n.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var n,e;return(e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(n){n!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(n){switch(n){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(n){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(n);const e=this.$route.query,{sort:t,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(n){return`${this.data.name}-${n}`===this.selectedSortParam}}},E9={scope:"col",class:"text-start px-2 py-1"},C9={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},T9={key:0,d:"m7 15 5 5 5-5"},M9={key:1,d:"m7 9 5-5 5 5"},A9={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal"};function P9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("th",E9,[a.getVisibleIcon?(f.openBlock(),f.createElementBlock("button",{key:0,type:"button",class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[f.createTextVNode(f.toDisplayString(a.label)+" ",1),(f.openBlock(),f.createElementBlock("svg",C9,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",T9)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",M9)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",A9,f.toDisplayString(a.label),1))])}const I9=Ue(S9,[["render",P9]]),D9={components:{IconMore:J0,IconDelete:zS,IconEdit:RS},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(n=>typeof n=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);await ut.delete(`/api/table/${e==null?void 0:e.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(n){var e,t;document.querySelector("body").click(),n!=null&&n.form?(await this.$v3plugin.$form({form:n==null?void 0:n.form,id:(e=this.item)==null?void 0:e.id,api:n==null?void 0:n.api,title:n==null?void 0:n.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:n==null?void 0:n.confirm,api:n==null?void 0:n.api,method:n==null?void 0:n.method,id:(t=this.item)==null?void 0:t.id,isId:(n==null?void 0:n.isId)||!1})}}},O9={class:"hs-dropdown [--placement:bottom-right] inline-flex"},B9={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},N9={class:"flex flex-col items-start"},z9=["onClick"],R9={class:"text-gray-800"},L9={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},V9={class:"p-4"},F9={class:"flex justify-end mt-4 gap-x-3"};function $9(n,e,t,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),w=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",O9,[f.createVNode(w,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",B9,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D,R,$;return[f.createElementVNode("div",N9,[(C=t.actions)!=null&&C.includes("edit")&&t.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(P=n.$route)==null?void 0:P.params)==null?void 0:D.catchAll}&id=${(R=t.item)==null?void 0:R.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:f.withCtx(()=>[f.createVNode(l,{color:"#000"}),e[4]||(e[4]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"])):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getCustomActions,(G,ee)=>(f.openBlock(),f.createElementBlock("button",{key:ee,onClick:ce=>a.customButtonAction(G),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[f.createVNode(b,{class:"opacity-0"}),f.createElementVNode("span",R9,f.toDisplayString(G==null?void 0:G.label),1)],8,z9))),128)),t.isForm?(f.openBlock(),f.createElementBlock("div",L9)):f.createCommentVNode("",!0),($=t.actions)!=null&&$.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[f.createVNode(b),e[5]||(e[5]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):f.createCommentVNode("",!0)])]}),_:1})]),f.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=C=>r.isDeleteConfirm=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",V9,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",F9,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=C=>r.isDeleteConfirm=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...C)=>a.deleteElement&&a.deleteElement(...C))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const j9=Ue(D9,[["render",$9]]),U9={},H9={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function q9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",H9,e[0]||(e[0]=[f.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),f.createElementVNode("path",{d:"M7 20V4"},null,-1),f.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),f.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const W9=Ue(U9,[["render",q9]]),G9={},Z9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function Y9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",Z9,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),f.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const X9={components:{IconExport:W9,IconChevronDown:i_,IconSuccess:Ue(G9,[["render",Y9]])},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}]}},watch:{isOpen(n){n||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var n;if(!((n=this.cols)!=null&&n.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await ut.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),t=new Blob([e.data],{type:"application/octet-stream"}),i=window.URL.createObjectURL(t),r=document.createElement("a");r.href=i,r.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(i),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.error("Ошибка при экспорте файла:",e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(n){this.format=n},choceAll(){var n;this.cols=(n=this.columns)==null?void 0:n.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var n,e;this.cols=(e=(n=this.columns)==null?void 0:n.filter(t=>(t==null?void 0:t.hidden)!==!0))==null?void 0:e.map(t=>t==null?void 0:t.name),this.activeAction="choceVisible"}}},K9={key:0,class:"flex flex-col items-center"},J9={key:1,class:"p-4"},Q9={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},eH={class:"flex items-center"},tH={class:"flex items-center gap-[10px] ml-auto"},nH=["onClick"],iH={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},rH={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},sH={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},oH={class:"mt-2 space-y-2"},aH=["id","onChange"],lH=["for"],cH={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},uH={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function hH(n,e,t,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),w=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=E=>r.isOpen=!0),class:"py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[f.createVNode(u,{height:"16",width:"16"}),e[7]||(e[7]=f.createTextVNode(" Експорт ")),f.createVNode(l,{height:"12",width:"16"})]),f.createVNode(w,{visible:r.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>r.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",cH,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=E=>r.isOpen=!1)}," Закрити "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=E=>r.isSuccessTemplate=!1)}," Вигрузити ще ")])):(f.openBlock(),f.createElementBlock("div",uH,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=E=>r.isOpen=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[5]||(e[5]=(...E)=>a.exportTable&&a.exportTable(...E))}," Завантажити таблицю ")]))]),default:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",K9,[f.createVNode(g,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=f.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(f.openBlock(),f.createElementBlock("div",J9,[f.createElementVNode("div",Q9,[f.createElementVNode("div",eH,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",tH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.actions,E=>(f.openBlock(),f.createElementBlock("button",{key:E==null?void 0:E.name,onClick:E==null?void 0:E.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[f.createElementVNode("span",{class:f.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===r.activeAction}])},[(E==null?void 0:E.name)===r.activeAction?(f.openBlock(),f.createElementBlock("span",iH)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,nH))),128))])]),f.createElementVNode("div",rH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[f.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=P=>r.cols=P),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",sH,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",oH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.tableFormats,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C},[f.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:E,onChange:P=>a.selectFormat(E)},null,40,aH),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,lH)]))),128))])])]))]),_:1},8,["visible"])],64)}const dH=Ue(X9,[["render",hH]]),pH={},fH={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-columns"};function mH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",fH,e[0]||(e[0]=[f.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const gH=Ue(pH,[["render",mH]]),yH={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(n){this.$emit("update-column",{...this.column,hidden:!n})}},mounted(){var n;((n=this.column)==null?void 0:n.hidden)!==!0&&(this.value=!0)}},_H={class:"flex w-full gap-[8px] items-centr"};function bH(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",_H,[f.withDirectives(f.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=g=>r.value=g),type:"checkbox"},null,512),[[f.vModelCheckbox,r.value]]),f.createTextVNode(" "+f.toDisplayString(((u=t.column)==null?void 0:u.ua)||((l=t.column)==null?void 0:l.title)),1)])}const xH={components:{IconColumns:gH,AdminTableColumnsHiddenItem:Ue(yH,[["render",bH]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(n){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(n==null?void 0:n.name)),t=this.columns;t[e]=n,this.$emit("update-columns",[...t])}}},vH={class:"py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},wH={class:"py-[10px] px-[10px] w-[260px]"},kH={class:"flex flex-col gap-[3px] max-h-[400px] w-full overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function SH(n,e,t,i,r,a){const u=f.resolveComponent("IconColumns"),l=f.resolveComponent("AdminTableColumnsHiddenItem"),g=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(g,{trigger:"click",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",vH,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",wH,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",kH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(b,w)=>(f.openBlock(),f.createElementBlock("li",{key:w},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const EH=Ue(xH,[["render",SH]]),CH={},TH={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function MH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",TH,e[0]||(e[0]=[f.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const a_=Ue(CH,[["render",MH]]),AH={props:{row:Object,column:Object,table:String}};function PH(n,e,t,i,r,a){var u,l,g,b,w,E,C,P;return f.openBlock(),f.createBlock(f.resolveDynamicComponent(((u=t.column)==null?void 0:u.format)==="custom"?(l=t.column)==null?void 0:l.component:`table-format-${((b=(g=t.column)==null?void 0:g.format)==null?void 0:b.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>n.$emit("update-table")),name:(w=t.column)==null?void 0:w.name,data:t.row,value:(C=t.row)==null?void 0:C[(E=t.column)==null?void 0:E.name],table:t.table,column:t.column,edit:(P=t.column)==null?void 0:P.edit},null,40,["name","data","value","table","column","edit"])}const HS=Ue(AH,[["render",PH]]),IH={},DH={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function OH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",DH,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const BH={components:{IconPlus:a_,IconMinus:Ue(IH,[["render",OH]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},NH={class:"hs-accordion"},zH={class:"py-0.5 flex items-center gap-x-0.5 w-full"},RH={class:"text-sm font-medium"},LH={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function VH(n,e,t,i,r,a){const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("IconMinus");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[f.createElementVNode("div",NH,[f.createElementVNode("div",zH,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"rounded-md cursor-pointer grow"},[f.createElementVNode("span",RH,f.toDisplayString(t.title),1)]),f.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=g=>r.expanded=!r.expanded)},[r.expanded?(f.openBlock(),f.createBlock(l,{key:1,width:"14"})):(f.openBlock(),f.createBlock(u,{key:0}))])]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",LH,[f.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const FH={components:{AdminComponentIs:HS,AdminTree:Ue(BH,[["render",VH],["__scopeId","data-v-c6318482"]]),VsNoData:$S,VsWidgetComments:BS,VsWidgetMap:sy,VsWidgetFileList:Kv},props:{table:String,columns:Array,row:Object}},$H={class:"hs-accordion border-gray-100 w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},jH={class:"border-l",style:{height:"calc(100vh - 360px)"}},UH={class:"flex items-center justify-between py-1 gap-x-4"},HH={class:"col-span-1"},qH={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},WH={class:"col-span-2"},GH={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},ZH={class:"table-info-card"},YH={class:"table-info-card"};function XH(n,e,t,i,r,a){var C,P,D;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),w=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",$H,[e[0]||(e[0]=f.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[f.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),f.createElementVNode("div",jH,[(P=(C=n.$route)==null?void 0:C.query)!=null&&P.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[t.row?(f.openBlock(),f.createBlock(l,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,R=>(f.openBlock(),f.createElementBlock("dl",UH,[f.createElementVNode("dt",HH,[f.createElementVNode("p",qH,f.toDisplayString((R==null?void 0:R.ua)||(R==null?void 0:R.title))+": ",1)]),f.createElementVNode("dd",WH,[f.createElementVNode("p",GH,[f.createVNode(u,{row:t.row,column:R,table:t.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),(D=t.row)!=null&&D.geom?(f.openBlock(),f.createBlock(l,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R,$;return[(R=t.row)!=null&&R.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:($=t.row)==null?void 0:$.geom,zoom:14},null,8,["geometry"])):(f.openBlock(),f.createBlock(b,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",ZH,[f.createVNode(w,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",YH,[f.createVNode(E,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const KH=Ue(FH,[["render",XH]]),JH={},QH={class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function eq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",QH,e[0]||(e[0]=[f.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),f.createElementVNode("path",{d:"M15 3v18"},null,-1),f.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const tq=Ue(JH,[["render",eq]]),nq={},iq={class:"h21yx vs0hq",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function rq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",iq,e[0]||(e[0]=[f.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const sq={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Ue(nq,[["render",rq]])},data(){return{isFilters:!1}},methods:{closeFilter({target:n}){this.isFilters&&n.classList.contains("filter-container")&&(this.isFilters=!1)}}},oq={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},aq={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function lq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter"),l=f.resolveComponent("VsFilter");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=g=>r.isFilters=!r.isFilters),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[f.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=f.createTextVNode(" Фільтри ")),t.onFilters?(f.openBlock(),f.createElementBlock("span",oq,f.toDisplayString(t.onFilters),1)):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var g;return[f.withDirectives(f.createElementVNode("div",{onClick:e[3]||(e[3]=(...b)=>a.closeFilter&&a.closeFilter(...b)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[f.createElementVNode("div",aq,[(g=t.scheme)!=null&&g.length?(f.openBlock(),f.createBlock(l,{key:0,ref:"filter",scheme:t.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=b=>n.$emit("filterChange",b)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=b=>r.isFilters=!1)},null,8,["scheme"])):f.createCommentVNode("",!0)])],512),[[f.vShow,r.isFilters]])]}),_:1})],64)}const cq=Ue(sq,[["render",lq]]),uq={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},hq={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},dq=["onClick"];function pq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("nav",hq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.tabsList,u=>(f.openBlock(),f.createElementBlock("button",{onClick:l=>n.$emit("update:filterState",u==null?void 0:u.name),class:f.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(u==null?void 0:u.name)===t.filterState}])},f.toDisplayString(u==null?void 0:u.label),11,dq))),256))])}const fq=Ue(uq,[["render",pq]]),mq={},gq={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function yq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",gq,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const _q={components:{IconFilter2:Ue(mq,[["render",yq]])},props:{filterCustom:String,customList:Array}},bq={class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},xq={class:"flex flex-col gap-[4px]"},vq=["onClick"];function wq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter2"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",bq,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",xq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:w=>{var E;n.$emit("update:filterCustom",g==null?void 0:g.name),(E=n.$refs)==null||E.popover.togglePopover()},key:b,class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":t.filterCustom===(g==null?void 0:g.name)}])},f.toDisplayString(g==null?void 0:g.label),11,vq))),128)),f.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=g=>{var b;n.$emit("update:filterCustom",void 0),(b=n.$refs)==null||b.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const kq=Ue(_q,[["render",wq]]),Sq={class:"flex items-center gap-x-2"},Eq={props:{table:String,title:String},components:{AdminTableControl:j9,AdminTableExport:dH,AdminTableColumnsHidden:EH,AdminTableColumn:I9,AdminNodata:e_,IconPlus:a_,IconSearch:n_,AdminTableCardInfo:KH,IconOpenCard:tq,AdminComponentIs:HS,AdminTableFilters:cq,AdminTableTabs:fq,AdminTableCustomFilters:kq,AdminTableCustomButtons:{__name:"admin-table-custom-buttons",props:{slots:Object},setup(n){var l,g,b,w,E;const{asyncTemplateSlot:e}=(E=(w=(b=(g=(l=f.getCurrentInstance())==null?void 0:l.appContext)==null?void 0:g.app)==null?void 0:b.config)==null?void 0:w.globalProperties)==null?void 0:E.utils,t=f.ref(""),i=f.ref(""),r=n,a=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelLeft||(i.value="div"),(D=(P=r.slots)==null?void 0:P.panelLeft)!=null&&D.includes("<")){const G=e("PanelLeft",(R=r.slots)==null?void 0:R.panelLeft,["name"]);i.value=G}else i.value=($=r.slots)==null?void 0:$.panelLeft},u=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelRight||(t.value="div"),(D=(P=r.slots)==null?void 0:P.panelRight)!=null&&D.includes("<")){const G=e("PanelRight",(R=r.slots)==null?void 0:R.panelRight,["name"]);t.value=G}else t.value=($=r.slots)==null?void 0:$.panelRight};return a(),u(),(C,P)=>(f.openBlock(),f.createElementBlock("div",Sq,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(i.value))),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value)))]))}},AdminCustomButtonAdd:{__name:"admin-custom-button-add",props:{slots:Object},setup(n){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,t=f.ref(""),i=n;return(()=>{var w,E,C,P,D;if((w=i.slots)!=null&&w.addButton||(t.value="div"),(C=(E=i.slots)==null?void 0:E.addButton)!=null&&C.includes("<")){const R=e("addButton",(P=i.slots)==null?void 0:P.addButton,["IconPlus"]);t.value=R}else t.value=(D=i.slots)==null?void 0:D.addButton})(),(w,E)=>t.value?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value),{key:0,IconPlus:a_})):f.createCommentVNode("",!0)}}},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters()},computed:{defaultPage(){var n,e;return((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1},columns(){var n,e;return(e=(n=this.tableData)==null?void 0:n.columns)==null?void 0:e.filter(t=>(t==null?void 0:t.hidden)!==!0)},isForm(){var n,e,t;return((n=this.tableData)==null?void 0:n.form)&&((t=(e=this.tableData)==null?void 0:e.actions)==null?void 0:t.includes("add"))},isNoData(){var n,e;return!((n=this.tableData)!=null&&n.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var n,e;return((e=(n=this.tableData)==null?void 0:n.rows)==null?void 0:e.find(t=>{var i,r;return(t==null?void 0:t.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var n;return(n=this.tableData)==null?void 0:n.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:((n,e=300)=>{let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}})(async function(n){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:n||void 0}})},500)},$route:{handler(n,e){var t,i;((t=n==null?void 0:n.params)==null?void 0:t.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(n){var e;this.$router.replace({query:{...(e=this.$route)==null?void 0:e.query,limit:n}})},filterState(n){var e;n&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:n}}),this.getTableData())},filterCustom(n){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:n}}),this.getTableData()},columns(n){var e,t,i,r;this.visibleColumns=n==null?void 0:n.map(a=>a==null?void 0:a.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,columns:(i=this.visibleColumns)!=null&&i.length?(r=this.visibleColumns)==null?void 0:r.join(","):void 0}})}},methods:{async checkUrlMounted(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R,$;this.page=((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1,this.limit=((i=(t=this.$route)==null?void 0:t.query)==null?void 0:i.limit)||20,this.filters=((u=decodeURI((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filter))==null?void 0:u.replaceAll("+"," "))||null,this.filterState=((g=(l=this.$route)==null?void 0:l.query)==null?void 0:g.filterState)||null,this.filterCustom=((w=(b=this.$route)==null?void 0:b.query)==null?void 0:w.custom)||null,this.searchValue=((C=(E=this.$route)==null?void 0:E.query)==null?void 0:C.search)||"",this.visibleColumns=((R=(D=(P=this.$route)==null?void 0:P.query)==null?void 0:D.columns)==null?void 0:R.split(","))||[],($=this.$route)!=null&&$.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(n){var t,i;const e=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.find(r=>r.name===n);if(e){const r=e==null?void 0:e.width;return typeof r=="number"?`${r}px`:r!=null&&r.includes("px")?r:`${r}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var n,e,t,i,r,a,u,l,g,b,w;try{const{data:E}=await ut.get(`/api/template/table/${this.table}`),C=await ut.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...E,...(C==null?void 0:C.data)||{}},this.initialHiddenColumns=(a=(r=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:r.map(P=>P==null?void 0:P.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(P=>{var D;(D=this.visibleColumns)!=null&&D.includes(P==null?void 0:P.name)?P.hidden=!1:P.hidden=!0}):this.visibleColumns=(w=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:w.map(P=>P==null?void 0:P.name)}catch{}},async getFilters(){var n;try{const{data:e}=await ut.get(`/api/table-filter/${this.table}`);this.filterScheme=(n=e==null?void 0:e.list)==null?void 0:n.map(t=>({...t,label:(t==null?void 0:t.label)||(t==null?void 0:t.ua)}))}catch{}},async handlePageChange(n){const e=this.$route.query;this.page=n,!(!(e!=null&&e.page)&&n===1||e.page===n)&&(await this.$router.replace({query:{...e,page:n}}),await this.getTableData())},async changeLimit(n){this.limit=await n,this.defaultPage=1,await this.getTableData()},async filterChange({url:n,state:e}){var t;this.filters=n!=="no-url"?n:null,this.onFilters=(t=Object.entries(e))==null?void 0:t.length,this.page=1,await this.getTableData()},changeActiveColumn(n){this.activeColumn=n,this.getTableData()},pushToCard(n){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${n}`)},changeActiveCardInfo(n){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:n}})},toggleCardInfo(){var n;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,card:void 0}})}}},Cq={class:"w-[calc(100vw - 320px)] bg-gray-50"},Tq={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Mq={class:"text-xl font-medium"},Aq={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Pq={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Iq={class:"flex"},Dq={class:"flex gap-[6px] ml-auto"},Oq={class:"inline-block w-full align-middle"},Bq={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Nq={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},zq={class:"right-0 border-t border-stone-200"},Rq={key:0,class:"w-[70px] sticky right-0 top-0"},Lq={class:"divide-y divide-gray-200"},Vq={class:"px-4 py-3 text-sm text-gray-600"},Fq=["onClick"],$q=["onClick"],jq={class:"p-[20px] flex justify-start items-center w-full"},Uq={class:"w-[200px] md:inline-flex hidden"},Hq={class:"text-sm text-gray-600 dark:text-neutral-400"},qq={class:"font-semibold text-gray-800 dark:text-neutral-200"},Wq={key:0},Gq={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function Zq(n,e,t,i,r,a){var Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt,Ht,yn,dn,wn,pn,ti,zn,In,Rn,Ee,je,Ye,ot,Lt,Qt,At;const u=f.resolveComponent("AdminCustomButtonAdd"),l=f.resolveComponent("IconPlus"),g=f.resolveComponent("router-link"),b=f.resolveComponent("AdminTableTabs"),w=f.resolveComponent("IconSearch"),E=f.resolveComponent("VsText"),C=f.resolveComponent("AdminTableCustomButtons"),P=f.resolveComponent("AdminTableCustomFilters"),D=f.resolveComponent("AdminTableColumnsHidden"),R=f.resolveComponent("AdminTableExport"),$=f.resolveComponent("AdminTableFilters"),G=f.resolveComponent("IconOpenCard"),ee=f.resolveComponent("AdminTableColumn"),ce=f.resolveComponent("AdminComponentIs"),U=f.resolveComponent("AdminTableControl"),Me=f.resolveComponent("AdminNodata"),ke=f.resolveComponent("VsPagination"),Pe=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",Cq,[f.createElementVNode("div",Tq,[f.createElementVNode("h2",Mq,f.toDisplayString(t.title),1),a.isForm?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(Be=(Fe=r.tableData)==null?void 0:Fe.slots)!=null&&Be.addButton?(f.openBlock(),f.createBlock(u,{key:0,slots:(pt=r.tableData)==null?void 0:pt.slots},null,8,["slots"])):(f.openBlock(),f.createBlock(g,{key:1,to:`/add?table=${(Nt=(tt=n.$route)==null?void 0:tt.params)==null?void 0:Nt.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:f.withCtx(()=>[f.createVNode(l,{height:"16",width:"16"}),e[5]||(e[5]=f.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):f.createCommentVNode("",!0)]),f.createElementVNode("div",Aq,[f.createElementVNode("div",Pq,[(Mt=(rt=r.tableData)==null?void 0:rt.filterState)!=null&&Mt.length?(f.openBlock(),f.createBlock(b,{key:0,tabsList:(Rt=r.tableData)==null?void 0:Rt.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=Re=>r.filterState=Re)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",Iq,[f.createElementVNode("div",{class:f.normalizeClass([r.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[f.createElementVNode("div",{class:f.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createVNode(w,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),f.createVNode(E,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=Re=>r.searchValue=Re),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),f.createElementVNode("div",Dq,[(Ft=r.tableData)!=null&&Ft.slots?(f.openBlock(),f.createBlock(C,{key:0,slots:(zt=r.tableData)==null?void 0:zt.slots},null,8,["slots"])):f.createCommentVNode("",!0),(yn=(Ht=r.tableData)==null?void 0:Ht.filterCustom)!=null&&yn.length?(f.openBlock(),f.createBlock(P,{key:1,customList:(dn=r.tableData)==null?void 0:dn.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=Re=>r.filterCustom=Re)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(D,{columns:(wn=r.tableData)==null?void 0:wn.columns,onUpdateColumns:e[3]||(e[3]=Re=>r.tableData.columns=Re)},null,8,["columns"]),((pn=r.tableData)==null?void 0:pn.export)!==!1?(f.openBlock(),f.createBlock(R,{key:2,table:t.table,columns:(ti=r.tableData)==null?void 0:ti.columns,page:r.page,"filter-state":r.filterState,"filter-custom":r.filterCustom,filters:r.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):f.createCommentVNode("",!0),(zn=r.filterScheme)!=null&&zn.length?(f.openBlock(),f.createBlock($,{key:3,scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"])):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...Re)=>a.toggleCardInfo&&a.toggleCardInfo(...Re)),class:"py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[f.createVNode(G,{class:f.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),f.createElementVNode("div",{class:f.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createElementVNode("div",{style:f.normalizeStyle({height:(Rn=(In=r.tableData)==null?void 0:In.filterState)!=null&&Rn.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[f.createElementVNode("div",Oq,[a.isNoData?(f.openBlock(),f.createBlock(Me,{key:1})):(f.openBlock(),f.createElementBlock("table",Bq,[f.createElementVNode("thead",Nq,[f.createElementVNode("tr",zq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,Re=>(f.openBlock(),f.createBlock(ee,{key:Re.name,style:f.normalizeStyle({width:a.rowWidth(Re==null?void 0:Re.name),textAlign:Re==null?void 0:Re.align,wordBreak:Re==null?void 0:Re.wrap}),data:Re,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(je=(Ee=a.getActions)==null?void 0:Ee.filter(Re=>Re!=="add"&&Re!=="view"))!=null&&je.length?(f.openBlock(),f.createElementBlock("th",Rq)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",Lq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Ye=r.tableData)==null?void 0:Ye.rows,(Re,sn)=>{var ve,_n,mr,qt,on,vi,wi,si,Wi,oi;return f.openBlock(),f.createElementBlock("tr",{key:sn,class:f.normalizeClass({"bg-gray-50":((_n=(ve=n.$route)==null?void 0:ve.query)==null?void 0:_n.card)===(Re==null?void 0:Re.id)})},[f.createElementVNode("td",Vq,[f.createElementVNode("button",{onClick:()=>a.pushToCard(Re==null?void 0:Re.id),class:f.normalizeClass(["text-sm font-medium",[((mr=r.tableData)==null?void 0:mr.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(ce,{row:Re,column:a.columns[0],table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Fq)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((qt=a.columns)==null?void 0:qt.slice(1),Oi=>(f.openBlock(),f.createElementBlock("td",{onClick:Qr=>a.changeActiveCardInfo(Re==null?void 0:Re.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start",{"cursor-pointer":r.isVisibleCardInfo}]),key:Oi.name},[f.createVNode(ce,{row:Re,column:Oi,table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,$q))),128)),(vi=(on=a.getActions)==null?void 0:on.filter(Oi=>Oi!=="add"&&Oi!=="view"))!=null&&vi.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((si=(wi=n.$route)==null?void 0:wi.query)==null?void 0:si.card)===(Re==null?void 0:Re.id),"bg-white":((oi=(Wi=n.$route)==null?void 0:Wi.query)==null?void 0:oi.card)!==(Re==null?void 0:Re.id)}])},[f.createVNode(U,{actions:a.getActions,isForm:a.isForm,item:Re,table:t.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):f.createCommentVNode("",!0)],2)}),128))])]))])],4)],2),f.createElementVNode("div",jq,[f.createElementVNode("div",Uq,[f.createElementVNode("p",Hq,[f.createElementVNode("span",qq,[f.createTextVNode(f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((ot=r.tableData)==null?void 0:ot.count)||"0 ")+" ",1),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Wq," з")):f.createCommentVNode("",!0)]),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Gq,f.toDisplayString(" "+((Lt=r.tableData)==null?void 0:Lt.filtered)||0),1)):f.createCommentVNode("",!0)])]),Math.ceil(((Qt=r.tableData)==null?void 0:Qt.filtered)/r.limit)>1?(f.openBlock(),f.createBlock(ke,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((At=r.tableData)==null?void 0:At.filtered)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit,backgroundColor:"#F3F4F6"},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>{var Re;return[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(Pe,{key:0,table:t.table,columns:(Re=r.tableData)==null?void 0:Re.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]}),_:1})])])])])}const Yq={components:{AdminTable:Ue(Eq,[["render",Zq],["__scopeId","data-v-c086c7f4"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){Jr!=null&&Jr.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(n){var e;n&&(document.title=(((e=ia.value)==null?void 0:e.titlePrefix)||"")+n)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async checkPageType(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.catchAll);const t=e==null?void 0:e.table;this.table=t||!1,!t&&this.getInterface()},async getInterface(){var n,e;try{const{data:t}=await ut.get(`/api/template/interface/${((e=(n=this.$route)==null?void 0:n.params)==null?void 0:e.catchAll)||""}`);this.interface=t||""}catch{this.interface=""}}}},Xq=["innerHTML"];function Kq(n,e,t,i,r,a){const u=f.resolveComponent("AdminTable");return r.table?(f.openBlock(),f.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,Xq))}const Jq=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(Yq,[["render",Kq]])},Symbol.toStringTag,{value:"Module"}));return mU});
794
+ `}).mount(t)}},pU=async()=>{try{const{data:n}=await ut.get("/api/user-menu");return Jr.value=n,t_(n)}catch(n){return console.error(n),[]}},fU=(n,e)=>{Object.entries(e).forEach(([t,i])=>{n.component(t,i)})},mU={async install(n,{componentsApp:e={},settings:t,routes:i=[]}){ia.value={...ia,...t};try{const a=(await pU()).filter(l=>l==null?void 0:l.component).map(l=>({...l,component:{...s_,...e}[l==null?void 0:l.component]}));fU(n,{...s_,...e}),n.component("admin",QT);const{router:u}=await BA(a.concat(i));window.app={...n,router:u},window.v3plugin={...n.config.globalProperties,...o_},n.config.globalProperties={...n.config.globalProperties,$componentsConfig:{...TB,componentsApp:e},$router:u,$v3plugin:o_,$utils:{reloadCardPage:Zf}},n.use(u)}catch(r){console.error(r)}},components:s_,plugins:o_},gU={data(){return{formValues:{},scheme:null,table:"",token:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const{data:{form:a}}=await ut.get(`/api/template/table/${t}`),{data:u}=await ut.get(`/api/table/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.token=(u==null?void 0:u.token)||"",this.formValues=u||{};const{data:l}=await ut.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},yU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},_U={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},bU={class:"flex items-center gap-[6px]"},xU={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},vU={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function wU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",yU,[f.createElementVNode("div",_U,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",bU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Повернутися "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.onlyEditObject&&a.onlyEditObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти "),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...l)=>a.editObjectAndRedirect&&a.editObjectAndRedirect(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти і повернутися ")])]),f.createElementVNode("div",xU,[f.createElementVNode("div",vU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[3]||(e[3]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const kU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(gU,[["render",wU]])},Symbol.toStringTag,{value:"Module"})),SU={data(){return{formValues:{},scheme:null,table:"",token:"",api:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const a=await ut.get(`/api/table-data/${t}`),{data:u}=await ut.get(`/api/template/form/${(i=a==null?void 0:a.data)==null?void 0:i.form}`);this.scheme=(u==null?void 0:u.schema)||u,this.api=(u==null?void 0:u.api)||"",this.token=(r=a==null?void 0:a.data)==null?void 0:r.addToken}catch{}},async createObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},EU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},CU={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},TU={class:"flex items-center gap-[6px]"},MU={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},AU={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function PU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",EU,[f.createElementVNode("div",CU,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",TU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),f.createElementVNode("div",MU,[f.createElementVNode("div",AU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const IU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(SU,[["render",PU]])},Symbol.toStringTag,{value:"Module"})),DU={};function OU(n,e,t,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const US=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(DU,[["render",OU]])},Symbol.toStringTag,{value:"Module"})),BU={},NU={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function zU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",NU,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),f.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),f.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const RU=Ue(BU,[["render",zU]]),LU={},VU={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",VU,e[0]||(e[0]=[f.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const $U=Ue(LU,[["render",FU]]),jU={components:{IconChevronDown:i_},props:{route:Object,searchable:String},mounted(){var n,e,t;(n=this.route)!=null&&n.menu&&(t=(e=this.route)==null?void 0:e.menu)!=null&&t.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},watch:{route(n){n!=null&&n.open&&(this.isOpen=!0)}},data(){return{isOpen:!1}},methods:{highLight(n){if(!this.searchable)return n;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`(${e})(\\s*)`,"gi");return n.replace(t,(i,r,a)=>`<span style="color:#1989fa;">${r}</span>${a}`)}}},UU={key:0,class:""},HU={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},qU={key:1};function WU(n,e,t,i,r,a){var g,b,w,E,C,P,D,R,$,G,ee,ce,U,Me,ke;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=t.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",UU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Pe=>r.isOpen=!r.isOpen),class:f.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((w=(b=t.route)==null?void 0:b.menu)==null?void 0:w.some(Pe=>{var Fe,Be;return(Pe==null?void 0:Pe.path)===n.$route.path.replace("/","")||(Pe==null?void 0:Pe.table)===((Be=(Fe=n.$route)==null?void 0:Fe.params)==null?void 0:Be.table)&&(Pe==null?void 0:Pe.table)}))&&"bg-gray-100"]])},[f.createTextVNode(f.toDisplayString((E=t.route)==null?void 0:E.ua)+" ",1),f.createVNode(u,{class:f.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var Pe;return[f.withDirectives(f.createElementVNode("ul",HU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Pe=t.route)==null?void 0:Pe.menu,(Fe,Be)=>{var pt,tt;return f.openBlock(),f.createElementBlock("li",{key:Be,class:"w-full"},[f.createVNode(l,{innerHTML:a.highLight(Fe==null?void 0:Fe.ua),to:"/"+(Fe==null?void 0:Fe.path),class:f.normalizeClass([[((Fe==null?void 0:Fe.path)===n.$route.path.replace("/","")||((tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.table)===(Fe==null?void 0:Fe.table)&&(Fe==null?void 0:Fe.table))&&"bg-gray-100"],"block px-3 py-2 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(C=t.route)!=null&&C.hidden?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",qU,[f.createVNode(l,{innerHTML:a.highLight((P=t.route)==null?void 0:P.ua),to:((R=(D=t.route)==null?void 0:D.path)==null?void 0:R[0])==="/"?($=t.route)==null?void 0:$.path:"/"+((G=t.route)==null?void 0:G.path),class:f.normalizeClass([[(((ee=t.route)==null?void 0:ee.path.replace("/",""))===n.$route.path.replace("/","")||((U=(ce=n.$route)==null?void 0:ce.params)==null?void 0:U.table)===((Me=t.route)==null?void 0:Me.table)&&((ke=t.route)==null?void 0:ke.table))&&"bg-gray-100"],"inline-block py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},null,8,["innerHTML","to","class"])]))}const GU={components:{IconLogout:RU,NavbarItem:Ue(jU,[["render",WU]]),IconLogo:$U,IconSearch:n_},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var n;return(n=this.searchValue)!=null&&n.trim()?this.filterMenu(Jr.value,this.searchValue):Jr.value},logo(){var n;return((n=ia.value)==null?void 0:n.logo)||"/assets/logo.svg"}},methods:{filterMenu(n,e){return n.map(t=>{var i,r;if(t.menu){const a=this.filterMenu(t.menu,e);if(a.length>0)return{...t,menu:a,open:!0}}else if((r=(i=t.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e.toLowerCase()))return t;return null}).filter(Boolean)}}},ZU={class:"h-[59px] w-full p-[4px] mb-[10px]"},YU=["src"],XU={class:"relative mx-[16px] pl"},KU={class:"p-[16px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},JU={class:"flex flex-col flex-wrap w-full pb-3"},QU={key:0,class:"flex flex-col gap-[6px]"},e9={key:1,class:"text-gray-800 text-lg mt-[20px]"};function t9(n,e,t,i,r,a){var b;const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] border-r w-[260px] shrink-0 absolute transition left-[-100%] z-[11] bg-white",[{"left-0":n.$parent.showMenu}]])},[f.createElementVNode("div",ZU,[f.createElementVNode("img",{src:a.logo,class:"object-contain w-full h-full"},null,8,YU)]),f.createElementVNode("div",XU,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[16px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=w=>r.searchValue=w),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:pl-[40px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("div",KU,[f.createElementVNode("nav",JU,[(b=a.data)!=null&&b.length?(f.openBlock(),f.createElementBlock("ul",QU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(w,E)=>(f.openBlock(),f.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[f.createVNode(g,{route:w,searchable:r.searchValue},null,8,["route","searchable"])]))),128))])):(f.openBlock(),f.createElementBlock("div",e9,"Не знайдено"))])])],2)}const n9=Ue(GU,[["render",t9]]),i9={},r9={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function s9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",r9,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),f.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),f.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const o9={components:{IconQuestion:Ue(i9,[["render",s9]]),IconUser:VS,AdminNotification:FS},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(n){n?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:n}=await ut.get("/user");this.userData=n}catch{}},async logout(){try{await ut.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},a9={class:"h-[60px] border-b flex lg:justify-end justify-between items-center px-[20px]"},l9={class:"flex items-center gap-[6px]"},c9={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},u9={class:"relative"},h9=["src"],d9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},p9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},f9=["src"],m9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},g9={class:"text-[14px] mr-[10px] text-gray-500"},y9={class:"flex flex-col p-[4px]"};function _9(n,e,t,i,r,a){var w,E,C,P,D,R,$,G,ee,ce;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",a9,[f.createElementVNode("div",{class:"lg:hidden flex",onClick:e[0]||(e[0]=U=>n.$parent.showMenu=!0)},e[4]||(e[4]=[f.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),f.createElementVNode("div",l9,[f.createElementVNode("a",c9,[f.createVNode(u,{height:"24",width:"24"})]),f.createVNode(l),e[6]||(e[6]=f.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),f.createElementVNode("div",u9,[f.createElementVNode("div",{onClick:e[1]||(e[1]=U=>r.isVisible=!0),class:"cursor-pointer"},[(E=(w=r.userData)==null?void 0:w.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(P=(C=r.userData)==null?void 0:C.user)==null?void 0:P.avatar,alt:"Image Description"},null,8,h9)):(f.openBlock(),f.createElementBlock("div",d9,[f.createVNode(g)]))]),r.isVisible?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=f.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[f.createElementVNode("div",p9,[(R=(D=r.userData)==null?void 0:D.user)!=null&&R.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=($=r.userData)==null?void 0:$.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,f9)):(f.openBlock(),f.createElementBlock("div",m9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",g9,f.toDisplayString((ce=(ee=r.userData)==null?void 0:ee.user)==null?void 0:ce.username),1)])]),f.createElementVNode("div",y9,[f.createVNode(b,{to:"profile",disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:f.withCtx(()=>e[5]||(e[5]=[f.createTextVNode("Профіль")])),_:1}),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...U)=>a.logout&&a.logout(...U)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const b9={components:{navbar:n9,AdminHeader:Ue(o9,[["render",_9]])},data(){return{showMenu:!1}},computed:{isMenu(){return Jr.value||null},header(){var n;return((n=ia.value)==null?void 0:n.header)||"admin-header"}}},x9={class:"admin-wrapper"},v9={class:"flex flex-col w-full"};function w9(n,e,t,i,r,a){const u=f.resolveComponent("navbar"),l=f.resolveComponent("router-view");return f.openBlock(),f.createElementBlock("div",x9,[f.createVNode(u),r.showMenu?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=g=>r.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):f.createCommentVNode("",!0),f.createElementVNode("div",v9,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.header))),f.createVNode(l)],64)):f.createCommentVNode("",!0)])])}const k9=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(b9,[["render",w9],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),S9={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var n,e;return((n=this.data)==null?void 0:n.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var n,e;return(e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(n){n!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(n){switch(n){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(n){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(n);const e=this.$route.query,{sort:t,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(n){return`${this.data.name}-${n}`===this.selectedSortParam}}},E9={scope:"col",class:"text-start px-2 py-1"},C9={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},T9={key:0,d:"m7 15 5 5 5-5"},M9={key:1,d:"m7 9 5-5 5 5"},A9={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal"};function P9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("th",E9,[a.getVisibleIcon?(f.openBlock(),f.createElementBlock("button",{key:0,type:"button",class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[f.createTextVNode(f.toDisplayString(a.label)+" ",1),(f.openBlock(),f.createElementBlock("svg",C9,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",T9)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",M9)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",A9,f.toDisplayString(a.label),1))])}const I9=Ue(S9,[["render",P9]]),D9={components:{IconMore:J0,IconDelete:zS,IconEdit:RS},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(n=>typeof n=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);await ut.delete(`/api/table/${e==null?void 0:e.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(n){var e,t;document.querySelector("body").click(),n!=null&&n.form?(await this.$v3plugin.$form({form:n==null?void 0:n.form,id:(e=this.item)==null?void 0:e.id,api:n==null?void 0:n.api,title:n==null?void 0:n.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:n==null?void 0:n.confirm,api:n==null?void 0:n.api,method:n==null?void 0:n.method,id:(t=this.item)==null?void 0:t.id,isId:(n==null?void 0:n.isId)||!1})}}},O9={class:"hs-dropdown [--placement:bottom-right] inline-flex"},B9={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},N9={class:"flex flex-col items-start"},z9=["onClick"],R9={class:"text-gray-800"},L9={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},V9={class:"p-4"},F9={class:"flex justify-end mt-4 gap-x-3"};function $9(n,e,t,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),w=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",O9,[f.createVNode(w,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",B9,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D,R,$;return[f.createElementVNode("div",N9,[(C=t.actions)!=null&&C.includes("edit")&&t.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(P=n.$route)==null?void 0:P.params)==null?void 0:D.catchAll}&id=${(R=t.item)==null?void 0:R.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:f.withCtx(()=>[f.createVNode(l,{color:"#000"}),e[4]||(e[4]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"])):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getCustomActions,(G,ee)=>(f.openBlock(),f.createElementBlock("button",{key:ee,onClick:ce=>a.customButtonAction(G),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[f.createVNode(b,{class:"opacity-0"}),f.createElementVNode("span",R9,f.toDisplayString(G==null?void 0:G.label),1)],8,z9))),128)),t.isForm?(f.openBlock(),f.createElementBlock("div",L9)):f.createCommentVNode("",!0),($=t.actions)!=null&&$.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[f.createVNode(b),e[5]||(e[5]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):f.createCommentVNode("",!0)])]}),_:1})]),f.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=C=>r.isDeleteConfirm=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",V9,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",F9,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=C=>r.isDeleteConfirm=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...C)=>a.deleteElement&&a.deleteElement(...C))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const j9=Ue(D9,[["render",$9]]),U9={},H9={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function q9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",H9,e[0]||(e[0]=[f.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),f.createElementVNode("path",{d:"M7 20V4"},null,-1),f.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),f.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const W9=Ue(U9,[["render",q9]]),G9={},Z9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function Y9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",Z9,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),f.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const X9={components:{IconExport:W9,IconChevronDown:i_,IconSuccess:Ue(G9,[["render",Y9]])},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}]}},watch:{isOpen(n){n||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var n;if(!((n=this.cols)!=null&&n.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await ut.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),t=await e.data.text(),i=t!=null&&t.includes(";")?null:JSON==null?void 0:JSON.parse(t),r=new Blob([e.data],{type:"application/octet-stream"}),a=window.URL.createObjectURL(r),u=document.createElement("a");if(u.href=a,u.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(u),typeof i=="string"){this.exportTable();return}u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(a),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.log(e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(n){this.format=n},choceAll(){var n;this.cols=(n=this.columns)==null?void 0:n.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var n,e;this.cols=(e=(n=this.columns)==null?void 0:n.filter(t=>(t==null?void 0:t.hidden)!==!0))==null?void 0:e.map(t=>t==null?void 0:t.name),this.activeAction="choceVisible"}}},K9={key:0,class:"flex flex-col items-center"},J9={key:1,class:"p-4"},Q9={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},eH={class:"flex items-center"},tH={class:"flex items-center gap-[10px] ml-auto"},nH=["onClick"],iH={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},rH={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},sH={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},oH={class:"mt-2 space-y-2"},aH=["id","onChange"],lH=["for"],cH={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},uH={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function hH(n,e,t,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),w=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=E=>r.isOpen=!0),class:"py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[f.createVNode(u,{height:"16",width:"16"}),e[7]||(e[7]=f.createTextVNode(" Експорт ")),f.createVNode(l,{height:"12",width:"16"})]),f.createVNode(w,{visible:r.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>r.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",cH,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=E=>r.isOpen=!1)}," Закрити "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=E=>r.isSuccessTemplate=!1)}," Вигрузити ще ")])):(f.openBlock(),f.createElementBlock("div",uH,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=E=>r.isOpen=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[5]||(e[5]=(...E)=>a.exportTable&&a.exportTable(...E))}," Завантажити таблицю ")]))]),default:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",K9,[f.createVNode(g,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=f.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(f.openBlock(),f.createElementBlock("div",J9,[f.createElementVNode("div",Q9,[f.createElementVNode("div",eH,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",tH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.actions,E=>(f.openBlock(),f.createElementBlock("button",{key:E==null?void 0:E.name,onClick:E==null?void 0:E.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[f.createElementVNode("span",{class:f.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===r.activeAction}])},[(E==null?void 0:E.name)===r.activeAction?(f.openBlock(),f.createElementBlock("span",iH)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,nH))),128))])]),f.createElementVNode("div",rH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[f.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=P=>r.cols=P),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",sH,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",oH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.tableFormats,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C},[f.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:E,onChange:P=>a.selectFormat(E)},null,40,aH),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,lH)]))),128))])])]))]),_:1},8,["visible"])],64)}const dH=Ue(X9,[["render",hH]]),pH={},fH={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-columns"};function mH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",fH,e[0]||(e[0]=[f.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const gH=Ue(pH,[["render",mH]]),yH={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(n){this.$emit("update-column",{...this.column,hidden:!n})}},mounted(){var n;((n=this.column)==null?void 0:n.hidden)!==!0&&(this.value=!0)}},_H={class:"flex w-full gap-[8px] items-centr"};function bH(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",_H,[f.withDirectives(f.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=g=>r.value=g),type:"checkbox"},null,512),[[f.vModelCheckbox,r.value]]),f.createTextVNode(" "+f.toDisplayString(((u=t.column)==null?void 0:u.ua)||((l=t.column)==null?void 0:l.title)),1)])}const xH={components:{IconColumns:gH,AdminTableColumnsHiddenItem:Ue(yH,[["render",bH]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(n){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(n==null?void 0:n.name)),t=this.columns;t[e]=n,this.$emit("update-columns",[...t])}}},vH={class:"py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},wH={class:"py-[10px] px-[10px] w-[260px]"},kH={class:"flex flex-col gap-[3px] max-h-[400px] w-full overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function SH(n,e,t,i,r,a){const u=f.resolveComponent("IconColumns"),l=f.resolveComponent("AdminTableColumnsHiddenItem"),g=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(g,{trigger:"click",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",vH,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",wH,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",kH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(b,w)=>(f.openBlock(),f.createElementBlock("li",{key:w},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const EH=Ue(xH,[["render",SH]]),CH={},TH={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function MH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",TH,e[0]||(e[0]=[f.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const a_=Ue(CH,[["render",MH]]),AH={props:{row:Object,column:Object,table:String}};function PH(n,e,t,i,r,a){var u,l,g,b,w,E,C,P;return f.openBlock(),f.createBlock(f.resolveDynamicComponent(((u=t.column)==null?void 0:u.format)==="custom"?(l=t.column)==null?void 0:l.component:`table-format-${((b=(g=t.column)==null?void 0:g.format)==null?void 0:b.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>n.$emit("update-table")),name:(w=t.column)==null?void 0:w.name,data:t.row,value:(C=t.row)==null?void 0:C[(E=t.column)==null?void 0:E.name],table:t.table,column:t.column,edit:(P=t.column)==null?void 0:P.edit},null,40,["name","data","value","table","column","edit"])}const HS=Ue(AH,[["render",PH]]),IH={},DH={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function OH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",DH,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const BH={components:{IconPlus:a_,IconMinus:Ue(IH,[["render",OH]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},NH={class:"hs-accordion"},zH={class:"py-0.5 flex items-center gap-x-0.5 w-full"},RH={class:"text-sm font-medium"},LH={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function VH(n,e,t,i,r,a){const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("IconMinus");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[f.createElementVNode("div",NH,[f.createElementVNode("div",zH,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"rounded-md cursor-pointer grow"},[f.createElementVNode("span",RH,f.toDisplayString(t.title),1)]),f.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=g=>r.expanded=!r.expanded)},[r.expanded?(f.openBlock(),f.createBlock(l,{key:1,width:"14"})):(f.openBlock(),f.createBlock(u,{key:0}))])]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",LH,[f.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const FH={components:{AdminComponentIs:HS,AdminTree:Ue(BH,[["render",VH],["__scopeId","data-v-c6318482"]]),VsNoData:$S,VsWidgetComments:BS,VsWidgetMap:sy,VsWidgetFileList:Kv},props:{table:String,columns:Array,row:Object}},$H={class:"hs-accordion border-gray-100 w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},jH={class:"border-l",style:{height:"calc(100vh - 360px)"}},UH={class:"flex items-center justify-between py-1 gap-x-4"},HH={class:"col-span-1"},qH={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},WH={class:"col-span-2"},GH={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},ZH={class:"table-info-card"},YH={class:"table-info-card"};function XH(n,e,t,i,r,a){var C,P,D;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),w=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",$H,[e[0]||(e[0]=f.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[f.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),f.createElementVNode("div",jH,[(P=(C=n.$route)==null?void 0:C.query)!=null&&P.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[t.row?(f.openBlock(),f.createBlock(l,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,R=>(f.openBlock(),f.createElementBlock("dl",UH,[f.createElementVNode("dt",HH,[f.createElementVNode("p",qH,f.toDisplayString((R==null?void 0:R.ua)||(R==null?void 0:R.title))+": ",1)]),f.createElementVNode("dd",WH,[f.createElementVNode("p",GH,[f.createVNode(u,{row:t.row,column:R,table:t.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),(D=t.row)!=null&&D.geom?(f.openBlock(),f.createBlock(l,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R,$;return[(R=t.row)!=null&&R.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:($=t.row)==null?void 0:$.geom,zoom:14},null,8,["geometry"])):(f.openBlock(),f.createBlock(b,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",ZH,[f.createVNode(w,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",YH,[f.createVNode(E,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const KH=Ue(FH,[["render",XH]]),JH={},QH={class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function eq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",QH,e[0]||(e[0]=[f.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),f.createElementVNode("path",{d:"M15 3v18"},null,-1),f.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const tq=Ue(JH,[["render",eq]]),nq={},iq={class:"h21yx vs0hq",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function rq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",iq,e[0]||(e[0]=[f.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const sq={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Ue(nq,[["render",rq]])},data(){return{isFilters:!1}},methods:{closeFilter({target:n}){this.isFilters&&n.classList.contains("filter-container")&&(this.isFilters=!1)}}},oq={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},aq={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function lq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter"),l=f.resolveComponent("VsFilter");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=g=>r.isFilters=!r.isFilters),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[f.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=f.createTextVNode(" Фільтри ")),t.onFilters?(f.openBlock(),f.createElementBlock("span",oq,f.toDisplayString(t.onFilters),1)):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var g;return[f.withDirectives(f.createElementVNode("div",{onClick:e[3]||(e[3]=(...b)=>a.closeFilter&&a.closeFilter(...b)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[f.createElementVNode("div",aq,[(g=t.scheme)!=null&&g.length?(f.openBlock(),f.createBlock(l,{key:0,ref:"filter",scheme:t.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=b=>n.$emit("filterChange",b)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=b=>r.isFilters=!1)},null,8,["scheme"])):f.createCommentVNode("",!0)])],512),[[f.vShow,r.isFilters]])]}),_:1})],64)}const cq=Ue(sq,[["render",lq]]),uq={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},hq={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},dq=["onClick"];function pq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("nav",hq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.tabsList,u=>(f.openBlock(),f.createElementBlock("button",{onClick:l=>n.$emit("update:filterState",u==null?void 0:u.name),class:f.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(u==null?void 0:u.name)===t.filterState}])},f.toDisplayString(u==null?void 0:u.label),11,dq))),256))])}const fq=Ue(uq,[["render",pq]]),mq={},gq={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function yq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",gq,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const _q={components:{IconFilter2:Ue(mq,[["render",yq]])},props:{filterCustom:String,customList:Array}},bq={class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},xq={class:"flex flex-col gap-[4px]"},vq=["onClick"];function wq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter2"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",bq,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",xq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:w=>{var E;n.$emit("update:filterCustom",g==null?void 0:g.name),(E=n.$refs)==null||E.popover.togglePopover()},key:b,class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":t.filterCustom===(g==null?void 0:g.name)}])},f.toDisplayString(g==null?void 0:g.label),11,vq))),128)),f.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=g=>{var b;n.$emit("update:filterCustom",void 0),(b=n.$refs)==null||b.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const kq=Ue(_q,[["render",wq]]),Sq={class:"flex items-center gap-x-2"},Eq={props:{table:String,title:String},components:{AdminTableControl:j9,AdminTableExport:dH,AdminTableColumnsHidden:EH,AdminTableColumn:I9,AdminNodata:e_,IconPlus:a_,IconSearch:n_,AdminTableCardInfo:KH,IconOpenCard:tq,AdminComponentIs:HS,AdminTableFilters:cq,AdminTableTabs:fq,AdminTableCustomFilters:kq,AdminTableCustomButtons:{__name:"admin-table-custom-buttons",props:{slots:Object},setup(n){var l,g,b,w,E;const{asyncTemplateSlot:e}=(E=(w=(b=(g=(l=f.getCurrentInstance())==null?void 0:l.appContext)==null?void 0:g.app)==null?void 0:b.config)==null?void 0:w.globalProperties)==null?void 0:E.utils,t=f.ref(""),i=f.ref(""),r=n,a=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelLeft||(i.value="div"),(D=(P=r.slots)==null?void 0:P.panelLeft)!=null&&D.includes("<")){const G=e("PanelLeft",(R=r.slots)==null?void 0:R.panelLeft,["name"]);i.value=G}else i.value=($=r.slots)==null?void 0:$.panelLeft},u=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelRight||(t.value="div"),(D=(P=r.slots)==null?void 0:P.panelRight)!=null&&D.includes("<")){const G=e("PanelRight",(R=r.slots)==null?void 0:R.panelRight,["name"]);t.value=G}else t.value=($=r.slots)==null?void 0:$.panelRight};return a(),u(),(C,P)=>(f.openBlock(),f.createElementBlock("div",Sq,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(i.value))),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value)))]))}},AdminCustomButtonAdd:{__name:"admin-custom-button-add",props:{slots:Object},setup(n){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,t=f.ref(""),i=n;return(()=>{var w,E,C,P,D;if((w=i.slots)!=null&&w.addButton||(t.value="div"),(C=(E=i.slots)==null?void 0:E.addButton)!=null&&C.includes("<")){const R=e("addButton",(P=i.slots)==null?void 0:P.addButton,["IconPlus"]);t.value=R}else t.value=(D=i.slots)==null?void 0:D.addButton})(),(w,E)=>t.value?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value),{key:0,IconPlus:a_})):f.createCommentVNode("",!0)}}},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters()},computed:{defaultPage(){var n,e;return((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1},columns(){var n,e;return(e=(n=this.tableData)==null?void 0:n.columns)==null?void 0:e.filter(t=>(t==null?void 0:t.hidden)!==!0)},isForm(){var n,e,t;return((n=this.tableData)==null?void 0:n.form)&&((t=(e=this.tableData)==null?void 0:e.actions)==null?void 0:t.includes("add"))},isNoData(){var n,e;return!((n=this.tableData)!=null&&n.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var n,e;return((e=(n=this.tableData)==null?void 0:n.rows)==null?void 0:e.find(t=>{var i,r;return(t==null?void 0:t.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var n;return(n=this.tableData)==null?void 0:n.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:((n,e=300)=>{let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}})(async function(n){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:n||void 0}})},500)},$route:{handler(n,e){var t,i;((t=n==null?void 0:n.params)==null?void 0:t.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(n){var e;this.$router.replace({query:{...(e=this.$route)==null?void 0:e.query,limit:n}})},filterState(n){var e;n&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:n}}),this.getTableData())},filterCustom(n){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:n}}),this.getTableData()},columns(n){var e,t,i,r;this.visibleColumns=n==null?void 0:n.map(a=>a==null?void 0:a.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,columns:(i=this.visibleColumns)!=null&&i.length?(r=this.visibleColumns)==null?void 0:r.join(","):void 0}})}},methods:{async checkUrlMounted(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R,$;this.page=((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1,this.limit=((i=(t=this.$route)==null?void 0:t.query)==null?void 0:i.limit)||20,this.filters=((u=decodeURI((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filter))==null?void 0:u.replaceAll("+"," "))||null,this.filterState=((g=(l=this.$route)==null?void 0:l.query)==null?void 0:g.filterState)||null,this.filterCustom=((w=(b=this.$route)==null?void 0:b.query)==null?void 0:w.custom)||null,this.searchValue=((C=(E=this.$route)==null?void 0:E.query)==null?void 0:C.search)||"",this.visibleColumns=((R=(D=(P=this.$route)==null?void 0:P.query)==null?void 0:D.columns)==null?void 0:R.split(","))||[],($=this.$route)!=null&&$.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(n){var t,i;const e=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.find(r=>r.name===n);if(e){const r=e==null?void 0:e.width;return typeof r=="number"?`${r}px`:r!=null&&r.includes("px")?r:`${r}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var n,e,t,i,r,a,u,l,g,b,w;try{const{data:E}=await ut.get(`/api/template/table/${this.table}`),C=await ut.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...E,...(C==null?void 0:C.data)||{}},this.initialHiddenColumns=(a=(r=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:r.map(P=>P==null?void 0:P.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(P=>{var D;(D=this.visibleColumns)!=null&&D.includes(P==null?void 0:P.name)?P.hidden=!1:P.hidden=!0}):this.visibleColumns=(w=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:w.map(P=>P==null?void 0:P.name)}catch{}},async getFilters(){var n;try{const{data:e}=await ut.get(`/api/table-filter/${this.table}`);this.filterScheme=(n=e==null?void 0:e.list)==null?void 0:n.map(t=>({...t,label:(t==null?void 0:t.label)||(t==null?void 0:t.ua)}))}catch{}},async handlePageChange(n){const e=this.$route.query;this.page=n,!(!(e!=null&&e.page)&&n===1||e.page===n)&&(await this.$router.replace({query:{...e,page:n}}),await this.getTableData())},async changeLimit(n){this.limit=await n,this.defaultPage=1,await this.getTableData()},async filterChange({url:n,state:e}){var t;this.filters=n!=="no-url"?n:null,this.onFilters=(t=Object.entries(e))==null?void 0:t.length,this.page=1,await this.getTableData()},changeActiveColumn(n){this.activeColumn=n,this.getTableData()},pushToCard(n){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${n}`)},changeActiveCardInfo(n){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:n}})},toggleCardInfo(){var n;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,card:void 0}})}}},Cq={class:"w-[calc(100vw - 320px)] bg-gray-50"},Tq={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Mq={class:"text-xl font-medium"},Aq={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Pq={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Iq={class:"flex"},Dq={class:"flex gap-[6px] ml-auto"},Oq={class:"inline-block w-full align-middle"},Bq={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Nq={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},zq={class:"right-0 border-t border-stone-200"},Rq={key:0,class:"w-[70px] sticky right-0 top-0"},Lq={class:"divide-y divide-gray-200"},Vq={class:"px-4 py-3 text-sm text-gray-600"},Fq=["onClick"],$q=["onClick"],jq={class:"p-[20px] flex justify-start items-center w-full"},Uq={class:"w-[200px] md:inline-flex hidden"},Hq={class:"text-sm text-gray-600 dark:text-neutral-400"},qq={class:"font-semibold text-gray-800 dark:text-neutral-200"},Wq={key:0},Gq={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function Zq(n,e,t,i,r,a){var Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt,Ht,yn,dn,wn,pn,ti,zn,In,Rn,Ee,je,Ye,ot,Lt,Qt,At;const u=f.resolveComponent("AdminCustomButtonAdd"),l=f.resolveComponent("IconPlus"),g=f.resolveComponent("router-link"),b=f.resolveComponent("AdminTableTabs"),w=f.resolveComponent("IconSearch"),E=f.resolveComponent("VsText"),C=f.resolveComponent("AdminTableCustomButtons"),P=f.resolveComponent("AdminTableCustomFilters"),D=f.resolveComponent("AdminTableColumnsHidden"),R=f.resolveComponent("AdminTableExport"),$=f.resolveComponent("AdminTableFilters"),G=f.resolveComponent("IconOpenCard"),ee=f.resolveComponent("AdminTableColumn"),ce=f.resolveComponent("AdminComponentIs"),U=f.resolveComponent("AdminTableControl"),Me=f.resolveComponent("AdminNodata"),ke=f.resolveComponent("VsPagination"),Pe=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",Cq,[f.createElementVNode("div",Tq,[f.createElementVNode("h2",Mq,f.toDisplayString(t.title),1),a.isForm?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(Be=(Fe=r.tableData)==null?void 0:Fe.slots)!=null&&Be.addButton?(f.openBlock(),f.createBlock(u,{key:0,slots:(pt=r.tableData)==null?void 0:pt.slots},null,8,["slots"])):(f.openBlock(),f.createBlock(g,{key:1,to:`/add?table=${(Nt=(tt=n.$route)==null?void 0:tt.params)==null?void 0:Nt.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:f.withCtx(()=>[f.createVNode(l,{height:"16",width:"16"}),e[5]||(e[5]=f.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):f.createCommentVNode("",!0)]),f.createElementVNode("div",Aq,[f.createElementVNode("div",Pq,[(Mt=(rt=r.tableData)==null?void 0:rt.filterState)!=null&&Mt.length?(f.openBlock(),f.createBlock(b,{key:0,tabsList:(Rt=r.tableData)==null?void 0:Rt.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=Re=>r.filterState=Re)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",Iq,[f.createElementVNode("div",{class:f.normalizeClass([r.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[f.createElementVNode("div",{class:f.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createVNode(w,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),f.createVNode(E,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=Re=>r.searchValue=Re),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),f.createElementVNode("div",Dq,[(Ft=r.tableData)!=null&&Ft.slots?(f.openBlock(),f.createBlock(C,{key:0,slots:(zt=r.tableData)==null?void 0:zt.slots},null,8,["slots"])):f.createCommentVNode("",!0),(yn=(Ht=r.tableData)==null?void 0:Ht.filterCustom)!=null&&yn.length?(f.openBlock(),f.createBlock(P,{key:1,customList:(dn=r.tableData)==null?void 0:dn.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=Re=>r.filterCustom=Re)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(D,{columns:(wn=r.tableData)==null?void 0:wn.columns,onUpdateColumns:e[3]||(e[3]=Re=>r.tableData.columns=Re)},null,8,["columns"]),((pn=r.tableData)==null?void 0:pn.export)!==!1?(f.openBlock(),f.createBlock(R,{key:2,table:t.table,columns:(ti=r.tableData)==null?void 0:ti.columns,page:r.page,"filter-state":r.filterState,"filter-custom":r.filterCustom,filters:r.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):f.createCommentVNode("",!0),(zn=r.filterScheme)!=null&&zn.length?(f.openBlock(),f.createBlock($,{key:3,scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"])):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...Re)=>a.toggleCardInfo&&a.toggleCardInfo(...Re)),class:"py-2 px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[f.createVNode(G,{class:f.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),f.createElementVNode("div",{class:f.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createElementVNode("div",{style:f.normalizeStyle({height:(Rn=(In=r.tableData)==null?void 0:In.filterState)!=null&&Rn.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[f.createElementVNode("div",Oq,[a.isNoData?(f.openBlock(),f.createBlock(Me,{key:1})):(f.openBlock(),f.createElementBlock("table",Bq,[f.createElementVNode("thead",Nq,[f.createElementVNode("tr",zq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,Re=>(f.openBlock(),f.createBlock(ee,{key:Re.name,style:f.normalizeStyle({width:a.rowWidth(Re==null?void 0:Re.name),textAlign:Re==null?void 0:Re.align,wordBreak:Re==null?void 0:Re.wrap}),data:Re,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(je=(Ee=a.getActions)==null?void 0:Ee.filter(Re=>Re!=="add"&&Re!=="view"))!=null&&je.length?(f.openBlock(),f.createElementBlock("th",Rq)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",Lq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Ye=r.tableData)==null?void 0:Ye.rows,(Re,sn)=>{var ve,_n,mr,qt,on,vi,wi,si,Wi,oi;return f.openBlock(),f.createElementBlock("tr",{key:sn,class:f.normalizeClass({"bg-gray-50":((_n=(ve=n.$route)==null?void 0:ve.query)==null?void 0:_n.card)===(Re==null?void 0:Re.id)})},[f.createElementVNode("td",Vq,[f.createElementVNode("button",{onClick:()=>a.pushToCard(Re==null?void 0:Re.id),class:f.normalizeClass(["text-sm font-medium",[((mr=r.tableData)==null?void 0:mr.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(ce,{row:Re,column:a.columns[0],table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Fq)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((qt=a.columns)==null?void 0:qt.slice(1),Oi=>(f.openBlock(),f.createElementBlock("td",{onClick:Qr=>a.changeActiveCardInfo(Re==null?void 0:Re.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start",{"cursor-pointer":r.isVisibleCardInfo}]),key:Oi.name},[f.createVNode(ce,{row:Re,column:Oi,table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,$q))),128)),(vi=(on=a.getActions)==null?void 0:on.filter(Oi=>Oi!=="add"&&Oi!=="view"))!=null&&vi.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((si=(wi=n.$route)==null?void 0:wi.query)==null?void 0:si.card)===(Re==null?void 0:Re.id),"bg-white":((oi=(Wi=n.$route)==null?void 0:Wi.query)==null?void 0:oi.card)!==(Re==null?void 0:Re.id)}])},[f.createVNode(U,{actions:a.getActions,isForm:a.isForm,item:Re,table:t.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):f.createCommentVNode("",!0)],2)}),128))])]))])],4)],2),f.createElementVNode("div",jq,[f.createElementVNode("div",Uq,[f.createElementVNode("p",Hq,[f.createElementVNode("span",qq,[f.createTextVNode(f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((ot=r.tableData)==null?void 0:ot.count)||"0 ")+" ",1),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Wq," з")):f.createCommentVNode("",!0)]),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Gq,f.toDisplayString(" "+((Lt=r.tableData)==null?void 0:Lt.filtered)||0),1)):f.createCommentVNode("",!0)])]),Math.ceil(((Qt=r.tableData)==null?void 0:Qt.filtered)/r.limit)>1?(f.openBlock(),f.createBlock(ke,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((At=r.tableData)==null?void 0:At.filtered)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit,backgroundColor:"#F3F4F6"},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>{var Re;return[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(Pe,{key:0,table:t.table,columns:(Re=r.tableData)==null?void 0:Re.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]}),_:1})])])])])}const Yq={components:{AdminTable:Ue(Eq,[["render",Zq],["__scopeId","data-v-c086c7f4"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){Jr!=null&&Jr.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(n){var e;n&&(document.title=(((e=ia.value)==null?void 0:e.titlePrefix)||"")+n)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async checkPageType(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.catchAll);const t=e==null?void 0:e.table;this.table=t||!1,!t&&this.getInterface()},async getInterface(){var n,e;try{const{data:t}=await ut.get(`/api/template/interface/${((e=(n=this.$route)==null?void 0:n.params)==null?void 0:e.catchAll)||""}`);this.interface=t||""}catch{this.interface=""}}}},Xq=["innerHTML"];function Kq(n,e,t,i,r,a){const u=f.resolveComponent("AdminTable");return r.table?(f.openBlock(),f.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,Xq))}const Jq=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(Yq,[["render",Kq]])},Symbol.toStringTag,{value:"Module"}));return mU});
@@ -1,5 +1,5 @@
1
1
  import { resolveComponent as e, openBlock as r, createBlock as t } from "vue";
2
- import { _ as c } from "./import-file-D9va23Wq.js";
2
+ import { _ as c } from "./import-file-DipOleMT.js";
3
3
  const n = {};
4
4
  function s(_, p, a, i, f, m) {
5
5
  const o = e("router-view");
@@ -1,4 +1,4 @@
1
- import { _ as g, u as x, d as m } from "./import-file-D9va23Wq.js";
1
+ import { _ as g, u as x, d as m } from "./import-file-DipOleMT.js";
2
2
  import { resolveComponent as f, openBlock as p, createElementBlock as w, createElementVNode as i, createBlock as y, createCommentVNode as k } from "vue";
3
3
  const v = {
4
4
  data() {
@@ -3594,16 +3594,16 @@ function nD(n) {
3594
3594
  }
3595
3595
  const iD = [
3596
3596
  // { name: 'profile', path: '/profile', component: () => import('../components/profile/vs-profile.vue') },
3597
- { name: "edit", path: "/edit", component: () => import("./edit-page-BQS-sWRT.js") },
3598
- { name: "add", path: "/add", component: () => import("./add-page-BAVqoEu1.js") },
3597
+ { name: "edit", path: "/edit", component: () => import("./edit-page-Ct5vFga9.js") },
3598
+ { name: "add", path: "/add", component: () => import("./add-page-DlAzVcqF.js") },
3599
3599
  {
3600
3600
  name: "card-view",
3601
3601
  path: "/card",
3602
- component: () => import("./card-view-CaQ17nvO.js"),
3602
+ component: () => import("./card-view-Cue9tc_s.js"),
3603
3603
  children: [{
3604
3604
  name: "table",
3605
3605
  path: ":table",
3606
- component: () => import("./card-view-CaQ17nvO.js"),
3606
+ component: () => import("./card-view-Cue9tc_s.js"),
3607
3607
  children: [{ name: "card", path: ":id", component: () => Promise.resolve().then(() => u7) }]
3608
3608
  }]
3609
3609
  }
@@ -3657,14 +3657,14 @@ const lD = /* @__PURE__ */ Tt(rD, [["render", aD]]), cD = (n) => {
3657
3657
  {
3658
3658
  path: "/",
3659
3659
  name: "home",
3660
- component: () => import("./admin-view-XE5MZDBn.js"),
3660
+ component: () => import("./admin-view-O2VCvJxh.js"),
3661
3661
  children: [
3662
3662
  ...e,
3663
3663
  ...n,
3664
3664
  // { path: '/', redirect: '/home' },
3665
3665
  {
3666
3666
  path: "/:catchAll(.*)",
3667
- component: () => import("./admin-interface-BVaKhOCD.js")
3667
+ component: () => import("./admin-interface-DNWo7SKe.js")
3668
3668
  }
3669
3669
  ]
3670
3670
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/admin",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "description": "This project Softpro Admin",
5
5
  "main": "dist/admin.js",
6
6
  "type": "module",
@@ -51,6 +51,7 @@ export default async function tableFilter(req) {
51
51
  Object.assign(el, { options: cls.map((item) => ({ count: 0, ...item })) });
52
52
  return;
53
53
  } */
54
+ if (el.type === 'Autocomplete') return;
54
55
  const options = countArr.rows.map(cel => {
55
56
  const data = cls.find(c => c.id === cel.id);
56
57
  return { ...cel, ...data };