@opengis/form 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { defineComponent as F, ref as w, onMounted as be, onUnmounted as He, createElementBlock as d, openBlock as i, normalizeClass as M, createCommentVNode as A, renderSlot as $e, createElementVNode as l, toDisplayString as T, normalizeProps as Ne, guardReactiveProps as qe, createTextVNode as pe, computed as O, mergeModels as Q, useModel as X, withDirectives as K, unref as q, vModelText as re, vModelCheckbox as ut, createVNode as j, createBlock as ae, resolveDynamicComponent as Se, normalizeStyle as ge, withCtx as Be, withModifiers as ve, onBeforeUnmount as _t, watch as te, createStaticVNode as de, vModelRadio as dt, Fragment as Y, renderList as le, mergeProps as Ee, reactive as $t, vModelDynamic as Ct, vShow as Ge, inject as Me, resolveComponent as tt, Transition as ct, nextTick as ze, Teleport as Vt, getCurrentInstance as Mt, provide as lt } from "vue";
2
- import { notify as ke, modal as Lt, VsModal as St } from "@opengis/core";
3
- const Bt = {
1
+ import { defineComponent as F, ref as x, onMounted as xe, onUnmounted as Ne, createElementBlock as d, openBlock as i, normalizeClass as V, createCommentVNode as D, renderSlot as $e, createElementVNode as l, toDisplayString as T, normalizeProps as qe, guardReactiveProps as Ge, createTextVNode as fe, computed as A, mergeModels as Z, useModel as W, withDirectives as K, unref as q, vModelText as se, vModelCheckbox as ft, createVNode as B, createBlock as ae, resolveDynamicComponent as Be, normalizeStyle as ye, withCtx as Le, withModifiers as ve, onBeforeUnmount as St, watch as te, createStaticVNode as ce, vModelRadio as vt, Fragment as Y, renderList as le, mergeProps as Ee, reactive as Bt, vModelDynamic as jt, vShow as Je, inject as Me, resolveComponent as at, Transition as mt, nextTick as ze, Teleport as It, getCurrentInstance as zt, provide as st } from "vue";
2
+ import { notify as be, VsModal as ht, modal as Et } from "@opengis/core";
3
+ const Ft = {
4
4
  key: 0,
5
5
  class: "text-[14px] font-medium text-gray-900 mb-2"
6
- }, jt = { class: "opacity-100" }, It = {
6
+ }, Dt = { class: "opacity-100" }, Ot = {
7
7
  key: 0,
8
8
  class: "text-red-500 text-[14px]"
9
- }, zt = {
9
+ }, At = {
10
10
  key: 1,
11
11
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
12
- }, Et = /* @__PURE__ */ F({
12
+ }, Ut = /* @__PURE__ */ F({
13
13
  __name: "vs-layout-default",
14
14
  props: {
15
15
  ua: { default: "" },
@@ -23,34 +23,34 @@ const Bt = {
23
23
  label: { default: "" }
24
24
  },
25
25
  setup(o) {
26
- const e = w("uk"), t = (n) => {
26
+ const e = x("uk"), t = (n) => {
27
27
  n.detail.key === "locale" && (e.value = n.detail.newValue);
28
28
  };
29
- return be(() => {
29
+ return xe(() => {
30
30
  e.value = localStorage.locale, window.addEventListener("storage", t);
31
- }), He(() => {
31
+ }), Ne(() => {
32
32
  window.removeEventListener("resize", t);
33
33
  }), (n, s) => (i(), d("div", {
34
- class: M(["w-full relative", { "opacity-60": n.item.disabled }])
34
+ class: V(["w-full relative", { "opacity-60": n.item.disabled }])
35
35
  }, [
36
- n.ua || n.label ? (i(), d("div", Bt, [
37
- l("span", jt, T(n.item[e.value] || n.ua || n.label), 1),
38
- n.item?.rules?.includes("required") ? (i(), d("span", It, "*")) : A("", !0)
39
- ])) : A("", !0),
40
- $e(n.$slots, "default", Ne(qe(n.$attrs))),
41
- n.error ? (i(), d("span", zt, T(n.error), 1)) : A("", !0)
36
+ n.ua || n.label ? (i(), d("div", Ft, [
37
+ l("span", Dt, T(n.item[e.value] || n.ua || n.label), 1),
38
+ n.item?.rules?.includes("required") ? (i(), d("span", Ot, "*")) : D("", !0)
39
+ ])) : D("", !0),
40
+ $e(n.$slots, "default", qe(Ge(n.$attrs))),
41
+ n.error ? (i(), d("span", At, T(n.error), 1)) : D("", !0)
42
42
  ], 2));
43
43
  }
44
- }), At = { class: "w-full relative flex flex-row items-center gap-2" }, Ft = {
44
+ }), Tt = { class: "w-full relative flex flex-row items-center gap-2" }, Rt = {
45
45
  key: 0,
46
46
  class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"
47
- }, Dt = {
47
+ }, Pt = {
48
48
  key: 0,
49
49
  class: "text-red-500 text-[14px]"
50
- }, Ot = {
50
+ }, Ht = {
51
51
  key: 1,
52
52
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
53
- }, Ut = /* @__PURE__ */ F({
53
+ }, Nt = /* @__PURE__ */ F({
54
54
  __name: "vs-layout-horizontal",
55
55
  props: {
56
56
  ua: { default: "" },
@@ -64,19 +64,19 @@ const Bt = {
64
64
  label: { default: "" }
65
65
  },
66
66
  setup(o) {
67
- return (e, t) => (i(), d("div", At, [
68
- e.item?.type !== "html" ? (i(), d("span", Ft, [
69
- pe(T(e.ua || e.label) + " ", 1),
70
- e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), d("span", Dt, "*")) : A("", !0)
71
- ])) : A("", !0),
72
- $e(e.$slots, "default", Ne(qe(e.$attrs))),
73
- e.error ? (i(), d("span", Ot, T(e.error), 1)) : A("", !0)
67
+ return (e, t) => (i(), d("div", Tt, [
68
+ e.item?.type !== "html" ? (i(), d("span", Rt, [
69
+ fe(T(e.ua || e.label) + " ", 1),
70
+ e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), d("span", Pt, "*")) : D("", !0)
71
+ ])) : D("", !0),
72
+ $e(e.$slots, "default", qe(Ge(e.$attrs))),
73
+ e.error ? (i(), d("span", Ht, T(e.error), 1)) : D("", !0)
74
74
  ]));
75
75
  }
76
- }), Tt = { class: "w-full relative" }, Rt = {
76
+ }), qt = { class: "w-full relative" }, Gt = {
77
77
  key: 0,
78
78
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
79
- }, Pt = /* @__PURE__ */ F({
79
+ }, Jt = /* @__PURE__ */ F({
80
80
  __name: "vs-layout-inline",
81
81
  props: {
82
82
  ua: { default: "" },
@@ -90,27 +90,57 @@ const Bt = {
90
90
  label: { default: "" }
91
91
  },
92
92
  setup(o) {
93
- return (e, t) => (i(), d("div", Tt, [
94
- $e(e.$slots, "default", Ne(qe(e.$attrs))),
95
- e.error ? (i(), d("span", Rt, T(e.error), 1)) : A("", !0)
93
+ return (e, t) => (i(), d("div", qt, [
94
+ $e(e.$slots, "default", qe(Ge(e.$attrs))),
95
+ e.error ? (i(), d("span", Gt, T(e.error), 1)) : D("", !0)
96
96
  ]));
97
97
  }
98
- }), Ht = {
99
- default: Et,
100
- horizontal: Ut,
101
- inline: Pt
98
+ }), Kt = {
99
+ default: Ut,
100
+ horizontal: Nt,
101
+ inline: Jt
102
102
  };
103
- function ye(o) {
103
+ function me(o) {
104
104
  return {
105
- inputClass: O(() => {
105
+ inputClass: A(() => {
106
106
  const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
107
107
  return o?.size === "sm" ? `${t}h-[32px]` : `${t}h-[38px]`;
108
108
  })
109
109
  };
110
110
  }
111
- const Nt = ["placeholder", "disabled"], De = /* @__PURE__ */ F({
111
+ const Zt = ["placeholder", "disabled"], Wt = /* @__PURE__ */ F({
112
+ __name: "vs-input-password",
113
+ props: /* @__PURE__ */ Z({
114
+ style: { default: () => ({}) },
115
+ customClass: { default: "" },
116
+ disabled: { type: Boolean, default: !1 },
117
+ modelValue: {},
118
+ error: { default: "" },
119
+ name: {},
120
+ placeholder: { default: "" }
121
+ }, {
122
+ modelValue: { default: "" },
123
+ modelModifiers: {}
124
+ }),
125
+ emits: ["update:modelValue"],
126
+ setup(o) {
127
+ const e = o, { inputClass: t } = me(e.style), n = W(o, "modelValue");
128
+ return (s, r) => K((i(), d("input", {
129
+ type: "password",
130
+ "onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
131
+ placeholder: s.placeholder,
132
+ disabled: s.disabled,
133
+ class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
134
+ style: {
135
+ border: "1px solid #CFD9E0"
136
+ }
137
+ }, null, 10, Zt)), [
138
+ [se, n.value]
139
+ ]);
140
+ }
141
+ }), Qt = ["placeholder", "disabled"], Ue = /* @__PURE__ */ F({
112
142
  __name: "vs-input-text",
113
- props: /* @__PURE__ */ Q({
143
+ props: /* @__PURE__ */ Z({
114
144
  style: { default: () => ({}) },
115
145
  customClass: { default: "" },
116
146
  disabled: { type: Boolean, default: !1 },
@@ -124,23 +154,23 @@ const Nt = ["placeholder", "disabled"], De = /* @__PURE__ */ F({
124
154
  }),
125
155
  emits: ["update:modelValue"],
126
156
  setup(o) {
127
- const e = o, { inputClass: t } = ye(e.style), n = X(o, "modelValue");
157
+ const e = o, { inputClass: t } = me(e.style), n = W(o, "modelValue");
128
158
  return (s, r) => K((i(), d("input", {
129
159
  type: "text",
130
160
  "onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
131
161
  placeholder: s.placeholder,
132
162
  disabled: s.disabled,
133
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
163
+ class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
134
164
  style: {
135
165
  border: "1px solid #CFD9E0"
136
166
  }
137
- }, null, 10, Nt)), [
138
- [re, n.value]
167
+ }, null, 10, Qt)), [
168
+ [se, n.value]
139
169
  ]);
140
170
  }
141
- }), qt = ["placeholder"], Gt = /* @__PURE__ */ F({
171
+ }), Xt = ["placeholder"], Yt = /* @__PURE__ */ F({
142
172
  __name: "vs-input-number",
143
- props: /* @__PURE__ */ Q({
173
+ props: /* @__PURE__ */ Z({
144
174
  style: { default: () => ({}) },
145
175
  customClass: {},
146
176
  disabled: { type: Boolean },
@@ -154,18 +184,18 @@ const Nt = ["placeholder", "disabled"], De = /* @__PURE__ */ F({
154
184
  }),
155
185
  emits: ["update:modelValue"],
156
186
  setup(o) {
157
- const e = o, { inputClass: t } = ye(e.style), n = X(o, "modelValue");
187
+ const e = o, { inputClass: t } = me(e.style), n = W(o, "modelValue");
158
188
  return (s, r) => K((i(), d("input", {
159
189
  type: "number",
160
190
  step: "any",
161
191
  "onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
162
192
  placeholder: s.placeholder,
163
- class: M(["py-1.5 px-3 block w-full bg-white", [q(t)]]),
193
+ class: V(["py-1.5 px-3 block w-full bg-white", [q(t)]]),
164
194
  style: {
165
195
  border: "1px solid #CFD9E0"
166
196
  }
167
- }, null, 10, qt)), [
168
- [re, n.value]
197
+ }, null, 10, Xt)), [
198
+ [se, n.value]
169
199
  ]);
170
200
  }
171
201
  }), H = (o, e) => {
@@ -173,7 +203,7 @@ const Nt = ["placeholder", "disabled"], De = /* @__PURE__ */ F({
173
203
  for (const [n, s] of e)
174
204
  t[n] = s;
175
205
  return t;
176
- }, Jt = {}, Kt = {
206
+ }, el = {}, tl = {
177
207
  xmlns: "http://www.w3.org/2000/svg",
178
208
  viewBox: "0 0 24 24",
179
209
  fill: "none",
@@ -183,8 +213,8 @@ const Nt = ["placeholder", "disabled"], De = /* @__PURE__ */ F({
183
213
  "stroke-linejoin": "round",
184
214
  class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
185
215
  };
186
- function Zt(o, e) {
187
- return i(), d("svg", Kt, e[0] || (e[0] = [
216
+ function ll(o, e) {
217
+ return i(), d("svg", tl, e[0] || (e[0] = [
188
218
  l("path", {
189
219
  stroke: "none",
190
220
  d: "M0 0h24v24H0z",
@@ -193,7 +223,7 @@ function Zt(o, e) {
193
223
  l("path", { d: "M5 12l5 5l10 -10" }, null, -1)
194
224
  ]));
195
225
  }
196
- const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-center gap-[4px]" }, Xt = ["value", "id", "disabled"], Yt = ["for"], el = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, tl = /* @__PURE__ */ F({
226
+ const ol = /* @__PURE__ */ H(el, [["render", ll]]), al = { class: "flex items-center gap-[4px]" }, sl = ["value", "id", "disabled"], nl = ["for"], rl = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, il = /* @__PURE__ */ F({
197
227
  __name: "vs-checkbox-default",
198
228
  props: {
199
229
  value: { default: "" },
@@ -206,45 +236,45 @@ const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-ce
206
236
  },
207
237
  emits: ["update:modelValue"],
208
238
  setup(o, { emit: e }) {
209
- const t = e, n = o, s = O({
239
+ const t = e, n = o, s = A({
210
240
  get: () => n.modelValue,
211
241
  set: (r) => t("update:modelValue", r)
212
242
  });
213
- return (r, a) => (i(), d("div", Qt, [
243
+ return (r, a) => (i(), d("div", al, [
214
244
  K(l("input", {
215
245
  type: "checkbox",
216
246
  value: r.value,
217
247
  "onUpdate:modelValue": a[0] || (a[0] = (u) => s.value = u),
218
- class: M(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": r.disabled }]),
248
+ class: V(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": r.disabled }]),
219
249
  id: r.id,
220
250
  disabled: r.disabled
221
- }, null, 10, Xt), [
222
- [ut, s.value]
251
+ }, null, 10, sl), [
252
+ [ft, s.value]
223
253
  ]),
224
254
  l("label", {
225
255
  for: r.id,
226
- class: M(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": r.disabled }])
256
+ class: V(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": r.disabled }])
227
257
  }, [
228
258
  l("div", {
229
- class: M(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [s.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", r.error ? "border-red-600" : ""]])
259
+ class: V(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [s.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", r.error ? "border-red-600" : ""]])
230
260
  }, [
231
- j(Wt, {
261
+ B(ol, {
232
262
  height: "12",
233
263
  width: "12"
234
264
  })
235
265
  ], 2),
236
- l("span", el, [
266
+ l("span", rl, [
237
267
  $e(r.$slots, "default", {}, () => [
238
- pe(T(r.label), 1)
268
+ fe(T(r.label), 1)
239
269
  ])
240
270
  ])
241
- ], 10, Yt)
271
+ ], 10, nl)
242
272
  ]));
243
273
  }
244
- }), ll = ["name", "value", "disabled"], ol = { class: "flex items-center gap-[6px] text-[14px]" }, al = {
274
+ }), ul = ["name", "value", "disabled"], dl = { class: "flex items-center gap-[6px] text-[14px]" }, cl = {
245
275
  key: 0,
246
276
  class: "text-[16px]"
247
- }, sl = ["src"], nl = /* @__PURE__ */ F({
277
+ }, pl = ["src"], fl = /* @__PURE__ */ F({
248
278
  __name: "vs-checkbox-buttons",
249
279
  props: {
250
280
  value: { type: [String, Number, Boolean], default: "" },
@@ -258,14 +288,14 @@ const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-ce
258
288
  },
259
289
  emits: ["update:modelValue"],
260
290
  setup(o, { emit: e }) {
261
- const t = o, n = e, s = O({
291
+ const t = o, n = e, s = A({
262
292
  get: () => t.modelValue,
263
293
  set: (u) => {
264
294
  n("update:modelValue", u);
265
295
  }
266
- }), r = O(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), a = O(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
296
+ }), r = A(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), a = A(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
267
297
  return (u, c) => (i(), d("label", {
268
- class: M(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [a.value, r.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
298
+ class: V(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [a.value, r.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
269
299
  }, [
270
300
  K(l("input", {
271
301
  type: "checkbox",
@@ -274,30 +304,30 @@ const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-ce
274
304
  value: u.value,
275
305
  "onUpdate:modelValue": c[0] || (c[0] = (v) => s.value = v),
276
306
  disabled: u.disabled
277
- }, null, 8, ll), [
278
- [ut, s.value]
307
+ }, null, 8, ul), [
308
+ [ft, s.value]
279
309
  ]),
280
- l("span", ol, [
281
- u.icon || u.imgUrl ? (i(), d("span", al, [
310
+ l("span", dl, [
311
+ u.icon || u.imgUrl ? (i(), d("span", cl, [
282
312
  u.icon ? (i(), d("i", {
283
313
  key: 0,
284
- class: M(u.icon)
285
- }, null, 2)) : A("", !0),
314
+ class: V(u.icon)
315
+ }, null, 2)) : D("", !0),
286
316
  u.imgUrl ? (i(), d("img", {
287
317
  key: 1,
288
318
  src: u.imgUrl,
289
319
  width: "16",
290
320
  height: "16",
291
321
  alt: "icon"
292
- }, null, 8, sl)) : A("", !0)
293
- ])) : A("", !0),
322
+ }, null, 8, pl)) : D("", !0)
323
+ ])) : D("", !0),
294
324
  $e(u.$slots, "default", {}, () => [
295
- pe(T(u.label), 1)
325
+ fe(T(u.label), 1)
296
326
  ])
297
327
  ])
298
328
  ], 2));
299
329
  }
300
- }), rl = { class: "flex items-center" }, pt = /* @__PURE__ */ F({
330
+ }), vl = { class: "flex items-center" }, gt = /* @__PURE__ */ F({
301
331
  __name: "vs-input-checkbox-item",
302
332
  props: {
303
333
  value: { default: "" },
@@ -314,7 +344,7 @@ const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-ce
314
344
  },
315
345
  emits: ["update:modelValue"],
316
346
  setup(o, { emit: e }) {
317
- const t = o, n = e, s = `radio-${Math.floor(Math.random() * 1e4)}`, r = O({
347
+ const t = o, n = e, s = `radio-${Math.floor(Math.random() * 1e4)}`, r = A({
318
348
  get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
319
349
  set: (u) => {
320
350
  if (Array.isArray(t.modelValue)) {
@@ -323,9 +353,9 @@ const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-ce
323
353
  } else
324
354
  n("update:modelValue", u);
325
355
  }
326
- }), a = w(`vs-checkbox-${t.view || "default"}`);
327
- return (u, c) => (i(), d("div", rl, [
328
- (i(), ae(Se(a.value === "vs-checkbox-buttons" ? q(nl) : q(tl)), {
356
+ }), a = x(`vs-checkbox-${t.view || "default"}`);
357
+ return (u, c) => (i(), d("div", vl, [
358
+ (i(), ae(Be(a.value === "vs-checkbox-buttons" ? q(fl) : q(il)), {
329
359
  value: u.value,
330
360
  label: u.label,
331
361
  info: u.option?.info,
@@ -335,17 +365,17 @@ const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-ce
335
365
  id: s,
336
366
  icon: u.icon,
337
367
  imgUrl: u.imgUrl,
338
- style: ge(u.style),
368
+ style: ye(u.style),
339
369
  error: u.error
340
370
  }, {
341
- default: Be(() => [
342
- pe(T(u.label), 1)
371
+ default: Le(() => [
372
+ fe(T(u.label), 1)
343
373
  ]),
344
374
  _: 1
345
375
  }, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
346
376
  ]));
347
377
  }
348
- }), il = {}, ul = {
378
+ }), ml = {}, hl = {
349
379
  xmlns: "http://www.w3.org/2000/svg",
350
380
  viewBox: "0 0 24 24",
351
381
  fill: "none",
@@ -355,8 +385,8 @@ const Wt = /* @__PURE__ */ H(Jt, [["render", Zt]]), Qt = { class: "flex items-ce
355
385
  "stroke-linejoin": "round",
356
386
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
357
387
  };
358
- function dl(o, e) {
359
- return i(), d("svg", ul, e[0] || (e[0] = [
388
+ function gl(o, e) {
389
+ return i(), d("svg", hl, e[0] || (e[0] = [
360
390
  l("path", {
361
391
  stroke: "none",
362
392
  d: "M0 0h24v24H0z",
@@ -365,7 +395,7 @@ function dl(o, e) {
365
395
  l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
366
396
  ]));
367
397
  }
368
- const cl = /* @__PURE__ */ H(il, [["render", dl]]), pl = {}, fl = {
398
+ const bl = /* @__PURE__ */ H(ml, [["render", gl]]), yl = {}, xl = {
369
399
  xmlns: "http://www.w3.org/2000/svg",
370
400
  viewBox: "0 0 24 24",
371
401
  fill: "none",
@@ -375,8 +405,8 @@ const cl = /* @__PURE__ */ H(il, [["render", dl]]), pl = {}, fl = {
375
405
  "stroke-linejoin": "round",
376
406
  class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
377
407
  };
378
- function vl(o, e) {
379
- return i(), d("svg", fl, e[0] || (e[0] = [
408
+ function wl(o, e) {
409
+ return i(), d("svg", xl, e[0] || (e[0] = [
380
410
  l("path", {
381
411
  stroke: "none",
382
412
  d: "M0 0h24v24H0z",
@@ -386,7 +416,7 @@ function vl(o, e) {
386
416
  l("path", { d: "M6 6l12 12" }, null, -1)
387
417
  ]));
388
418
  }
389
- const ml = /* @__PURE__ */ H(pl, [["render", vl]]), hl = {}, gl = {
419
+ const kl = /* @__PURE__ */ H(yl, [["render", wl]]), _l = {}, $l = {
390
420
  xmlns: "http://www.w3.org/2000/svg",
391
421
  width: "24",
392
422
  height: "24",
@@ -397,8 +427,8 @@ const ml = /* @__PURE__ */ H(pl, [["render", vl]]), hl = {}, gl = {
397
427
  "stroke-linecap": "round",
398
428
  "stroke-linejoin": "round"
399
429
  };
400
- function bl(o, e) {
401
- return i(), d("svg", gl, e[0] || (e[0] = [
430
+ function Cl(o, e) {
431
+ return i(), d("svg", $l, e[0] || (e[0] = [
402
432
  l("path", {
403
433
  stroke: "none",
404
434
  d: "M0 0h24v24H0z",
@@ -409,15 +439,15 @@ function bl(o, e) {
409
439
  l("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
410
440
  ]));
411
441
  }
412
- const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
442
+ const Vl = /* @__PURE__ */ H(_l, [["render", Cl]]), Ml = {
413
443
  key: 0,
414
444
  class: "flex items-start gap-x-1"
415
- }, wl = {
445
+ }, Ll = {
416
446
  key: 0,
417
447
  class: "text-red-500 text-[14px]"
418
- }, kl = ["title"], _l = ["disabled"], ft = /* @__PURE__ */ F({
448
+ }, Sl = ["title"], Bl = ["disabled"], bt = /* @__PURE__ */ F({
419
449
  __name: "vs-input-switcher",
420
- props: /* @__PURE__ */ Q({
450
+ props: /* @__PURE__ */ Z({
421
451
  rules: { default: () => [] },
422
452
  view: { default: "checkbox" },
423
453
  label: { default: "" },
@@ -436,15 +466,15 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
436
466
  }),
437
467
  emits: ["update:modelValue"],
438
468
  setup(o) {
439
- const e = o, t = X(o, "modelValue");
440
- return (n, s) => e.view === "checkbox" ? (i(), d("div", xl, [
441
- j(pt, {
469
+ const e = o, t = W(o, "modelValue");
470
+ return (n, s) => e.view === "checkbox" ? (i(), d("div", Ml, [
471
+ B(gt, {
442
472
  modelValue: t.value,
443
473
  "onUpdate:modelValue": s[0] || (s[0] = (r) => t.value = r),
444
474
  label: n.text,
445
475
  error: n.error || ""
446
476
  }, null, 8, ["modelValue", "label", "error"]),
447
- n.rules?.includes("required") ? (i(), d("span", wl, "*")) : A("", !0),
477
+ n.rules?.includes("required") ? (i(), d("span", Ll, "*")) : D("", !0),
448
478
  n.i ? (i(), d("button", {
449
479
  key: 1,
450
480
  class: "cursor-pointer",
@@ -452,22 +482,22 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
452
482
  onClick: s[1] || (s[1] = ve(() => {
453
483
  }, ["prevent"]))
454
484
  }, [
455
- j(q(yl), { class: "text-gray-500 w-[14px] h-[14px]" })
456
- ], 8, kl)) : A("", !0)
485
+ B(q(Vl), { class: "text-gray-500 w-[14px] h-[14px]" })
486
+ ], 8, Sl)) : D("", !0)
457
487
  ])) : (i(), d("button", {
458
488
  key: 1,
459
489
  type: "button",
460
- class: M(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${n.style?.primaryColor || "blue"}-500` : "bg-stone-200", n.customClass]]),
490
+ class: V(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${n.style?.primaryColor || "blue"}-500` : "bg-stone-200", n.customClass]]),
461
491
  disabled: n.disabled,
462
492
  onClick: s[2] || (s[2] = (r) => t.value = !t.value)
463
493
  }, [
464
494
  l("span", {
465
495
  "data-state": "checked",
466
- class: M(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
496
+ class: V(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
467
497
  }, null, 2)
468
- ], 10, _l));
498
+ ], 10, Bl));
469
499
  }
470
- }), $l = ["innerHTML"], ot = /* @__PURE__ */ F({
500
+ }), jl = ["innerHTML"], nt = /* @__PURE__ */ F({
471
501
  __name: "vs-input-static",
472
502
  props: {
473
503
  text: { default: "" },
@@ -482,13 +512,13 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
482
512
  },
483
513
  setup(o) {
484
514
  return (e, t) => (i(), d("div", {
485
- class: M(e.customClass),
515
+ class: V(e.customClass),
486
516
  innerHTML: e.html ? e.html : e.text
487
- }, null, 10, $l));
517
+ }, null, 10, jl));
488
518
  }
489
- }), Cl = ["placeholder", "disabled", "name"], Vl = /* @__PURE__ */ F({
519
+ }), Il = ["placeholder", "disabled", "name"], zl = /* @__PURE__ */ F({
490
520
  __name: "vs-input-mask",
491
- props: /* @__PURE__ */ Q({
521
+ props: /* @__PURE__ */ Z({
492
522
  name: {},
493
523
  mask: { default: "" },
494
524
  unmask: { type: Boolean, default: !1 },
@@ -504,9 +534,9 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
504
534
  }),
505
535
  emits: ["update:modelValue"],
506
536
  setup(o) {
507
- const e = o, { inputClass: t } = ye(e.style), n = X(o, "modelValue"), s = w(null);
537
+ const e = o, { inputClass: t } = me(e.style), n = W(o, "modelValue"), s = x(null);
508
538
  let r = null;
509
- return be(async () => {
539
+ return xe(async () => {
510
540
  if (s.value) {
511
541
  const { default: a } = await import("./index-W-qQIppj.js");
512
542
  r = a(s.value, {
@@ -523,7 +553,7 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
523
553
  n.value = e.unmask ? r.unmaskedValue : r.value;
524
554
  }), r.value = n.value ?? "";
525
555
  }
526
- }), _t(() => {
556
+ }), St(() => {
527
557
  r?.destroy();
528
558
  }), te(() => e.mask, (a) => {
529
559
  r && r.updateOptions({
@@ -543,15 +573,15 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
543
573
  placeholder: a.placeholder,
544
574
  disabled: a.disabled,
545
575
  name: a.name,
546
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t)]]),
576
+ class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t)]]),
547
577
  style: {
548
578
  border: "1px solid #CFD9E0"
549
579
  }
550
- }, null, 10, Cl));
580
+ }, null, 10, Il));
551
581
  }
552
- }), Ml = { class: "relative w-full bg-white rounded-lg" }, Ll = ["placeholder", "disabled"], Sl = /* @__PURE__ */ F({
582
+ }), El = { class: "relative w-full bg-white rounded-lg" }, Fl = ["placeholder", "disabled"], Dl = /* @__PURE__ */ F({
553
583
  __name: "vs-input-email",
554
- props: /* @__PURE__ */ Q({
584
+ props: /* @__PURE__ */ Z({
555
585
  style: { default: () => ({}) },
556
586
  customClass: { default: "" },
557
587
  disabled: { type: Boolean, default: !1 },
@@ -565,26 +595,26 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
565
595
  }),
566
596
  emits: ["update:modelValue"],
567
597
  setup(o) {
568
- const e = o, { inputClass: t } = ye(e.style), n = X(o, "modelValue");
569
- return (s, r) => (i(), d("div", Ml, [
570
- r[1] || (r[1] = de('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
598
+ const e = o, { inputClass: t } = me(e.style), n = W(o, "modelValue");
599
+ return (s, r) => (i(), d("div", El, [
600
+ r[1] || (r[1] = ce('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
571
601
  K(l("input", {
572
602
  type: "email",
573
603
  "onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
574
604
  placeholder: s.placeholder,
575
605
  disabled: s.disabled,
576
- class: M(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
606
+ class: V(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
577
607
  style: {
578
608
  border: "1px solid #CFD9E0"
579
609
  }
580
- }, null, 10, Ll), [
581
- [re, n.value]
610
+ }, null, 10, Fl), [
611
+ [se, n.value]
582
612
  ])
583
613
  ]));
584
614
  }
585
- }), Bl = ["value", "disabled"], jl = { class: "text-[13px] text-gray-700" }, Il = /* @__PURE__ */ F({
615
+ }), Ol = ["value", "disabled"], Al = { class: "text-[13px] text-gray-700" }, Ul = /* @__PURE__ */ F({
586
616
  __name: "vs-input-radio-default",
587
- props: /* @__PURE__ */ Q({
617
+ props: /* @__PURE__ */ Z({
588
618
  style: {},
589
619
  customClass: { default: "" },
590
620
  disabled: { type: Boolean, default: !1 },
@@ -600,9 +630,9 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
600
630
  }),
601
631
  emits: ["update:modelValue"],
602
632
  setup(o) {
603
- const e = X(o, "modelValue");
633
+ const e = W(o, "modelValue");
604
634
  return (t, n) => (i(), d("label", {
605
- class: M(["flex items-center gap-0", [t.customClass]])
635
+ class: V(["flex items-center gap-0", [t.customClass]])
606
636
  }, [
607
637
  K(l("input", {
608
638
  "onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
@@ -610,26 +640,26 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
610
640
  value: t.value,
611
641
  disabled: t.disabled,
612
642
  class: "hidden"
613
- }, null, 8, Bl), [
614
- [dt, e.value]
643
+ }, null, 8, Ol), [
644
+ [vt, e.value]
615
645
  ]),
616
646
  l("span", {
617
- class: M(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
647
+ class: V(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
618
648
  `border-${t.style?.primaryColor || "blue"}-500`,
619
649
  t.disabled ? "opacity-50 cursor-not-allowed" : ""
620
650
  ]])
621
651
  }, [
622
652
  e.value == t.value ? (i(), d("span", {
623
653
  key: 0,
624
- class: M(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
625
- }, null, 2)) : A("", !0)
654
+ class: V(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
655
+ }, null, 2)) : D("", !0)
626
656
  ], 2),
627
- l("span", jl, T(t.text), 1)
657
+ l("span", Al, T(t.text), 1)
628
658
  ], 2));
629
659
  }
630
- }), zl = ["value", "disabled"], El = { class: "text-[13px] text-gray-700" }, Al = /* @__PURE__ */ F({
660
+ }), Tl = ["value", "disabled"], Rl = { class: "text-[13px] text-gray-700" }, Pl = /* @__PURE__ */ F({
631
661
  __name: "vs-input-radio-buttons",
632
- props: /* @__PURE__ */ Q({
662
+ props: /* @__PURE__ */ Z({
633
663
  style: {},
634
664
  customClass: { default: "" },
635
665
  disabled: { type: Boolean, default: !1 },
@@ -645,9 +675,9 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
645
675
  }),
646
676
  emits: ["update:modelValue"],
647
677
  setup(o) {
648
- const e = X(o, "modelValue");
678
+ const e = W(o, "modelValue");
649
679
  return (t, n) => (i(), d("label", {
650
- class: M(["flex items-center border rounded-lg px-2 py-1", [
680
+ class: V(["flex items-center border rounded-lg px-2 py-1", [
651
681
  e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
652
682
  t.customClass
653
683
  ]])
@@ -658,18 +688,18 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
658
688
  value: t.value,
659
689
  disabled: t.disabled,
660
690
  class: "hidden"
661
- }, null, 8, zl), [
662
- [dt, e.value]
691
+ }, null, 8, Tl), [
692
+ [vt, e.value]
663
693
  ]),
664
- l("span", El, T(t.text), 1)
694
+ l("span", Rl, T(t.text), 1)
665
695
  ], 2));
666
696
  }
667
- }), Fl = {
668
- "vs-input-radio-default": Il,
669
- "vs-input-radio-buttons": Al
670
- }, at = /* @__PURE__ */ F({
697
+ }), Hl = {
698
+ "vs-input-radio-default": Ul,
699
+ "vs-input-radio-buttons": Pl
700
+ }, rt = /* @__PURE__ */ F({
671
701
  __name: "vs-input-radio",
672
- props: /* @__PURE__ */ Q({
702
+ props: /* @__PURE__ */ Z({
673
703
  options: {},
674
704
  position: { default: "vertical" },
675
705
  view: { default: "default" },
@@ -686,11 +716,11 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
686
716
  }),
687
717
  emits: ["update:modelValue"],
688
718
  setup(o) {
689
- const e = o, t = X(o, "modelValue"), n = O(() => Fl[`vs-input-radio-${e.view}`]);
719
+ const e = o, t = W(o, "modelValue"), n = A(() => Hl[`vs-input-radio-${e.view}`]);
690
720
  return (s, r) => (i(), d("div", {
691
- class: M([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
721
+ class: V([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
692
722
  }, [
693
- (i(!0), d(Y, null, le(s.options, (a) => (i(), ae(Se(n.value), Ee({
723
+ (i(!0), d(Y, null, le(s.options, (a) => (i(), ae(Be(n.value), Ee({
694
724
  key: a?.id,
695
725
  text: a.text,
696
726
  value: a.id.toString(),
@@ -700,7 +730,7 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
700
730
  }, { ref_for: !0 }, s.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
701
731
  ], 2));
702
732
  }
703
- }), Dl = /* @__PURE__ */ F({
733
+ }), Nl = /* @__PURE__ */ F({
704
734
  __name: "vs-input-checkbox",
705
735
  props: {
706
736
  options: { default: () => [] },
@@ -719,9 +749,9 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
719
749
  },
720
750
  emits: ["update:modelValue"],
721
751
  setup(o, { emit: e }) {
722
- const t = o, n = e, s = w([]), r = $t({}), a = (p) => p?.value || p?.id || p?.text || p, u = (p) => p.text || String(p), c = (p) => `lg:col-span-${p || 12}`, v = async () => {
752
+ const t = o, n = e, s = x([]), r = Bt({}), a = (p) => p?.value || p?.id || p?.text || p, u = (p) => p.text || String(p), c = (p) => `lg:col-span-${p || 12}`, v = async () => {
723
753
  try {
724
- const p = await fetch(`/api/suggest/${t.data}`).then((x) => x.json());
754
+ const p = await fetch(`/api/suggest/${t.data}`).then((w) => w.json());
725
755
  s.value = p?.data || p;
726
756
  } catch (p) {
727
757
  console.error(p);
@@ -731,14 +761,14 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
731
761
  () => t.modelValue,
732
762
  (p) => {
733
763
  if (typeof p == "boolean" && s.value.length === 1) {
734
- const x = a(s.value[0]);
735
- r[x] = p;
764
+ const w = a(s.value[0]);
765
+ r[w] = p;
736
766
  } else if (Array.isArray(p)) {
737
- const x = new Set(p);
738
- s.value.forEach((g) => {
739
- if (!g.disabled) {
740
- const _ = a(g);
741
- r[_] = x.has(_);
767
+ const w = new Set(p);
768
+ s.value.forEach((b) => {
769
+ if (!b.disabled) {
770
+ const $ = a(b);
771
+ r[$] = w.has($);
742
772
  }
743
773
  });
744
774
  }
@@ -751,11 +781,11 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
751
781
  n("update:modelValue", null);
752
782
  return;
753
783
  }
754
- const p = Object.entries(r).filter(([, x]) => x).map(([x]) => x);
784
+ const p = Object.entries(r).filter(([, w]) => w).map(([w]) => w);
755
785
  n("update:modelValue", p.length === 0 ? [] : p);
756
786
  },
757
787
  { deep: !0 }
758
- ), be(() => {
788
+ ), xe(() => {
759
789
  if (t.data)
760
790
  v().then(() => {
761
791
  if (typeof t.modelValue == "boolean" && s.value.length === 1) {
@@ -763,10 +793,10 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
763
793
  r[p] = t.modelValue;
764
794
  } else if (Array.isArray(t.modelValue)) {
765
795
  const p = new Set(t.modelValue);
766
- s.value.forEach((x) => {
767
- if (!x.disabled) {
768
- const g = a(x);
769
- r[g] = p.has(g);
796
+ s.value.forEach((w) => {
797
+ if (!w.disabled) {
798
+ const b = a(w);
799
+ r[b] = p.has(b);
770
800
  }
771
801
  });
772
802
  }
@@ -776,32 +806,32 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
776
806
  r[p] = t.modelValue;
777
807
  } else if (Array.isArray(t.modelValue)) {
778
808
  const p = new Set(t.modelValue);
779
- s.value.forEach((x) => {
780
- if (!x.disabled) {
781
- const g = a(x);
782
- r[g] = p.has(g);
809
+ s.value.forEach((w) => {
810
+ if (!w.disabled) {
811
+ const b = a(w);
812
+ r[b] = p.has(b);
783
813
  }
784
814
  });
785
815
  }
786
- }), (p, x) => (i(), d("div", {
787
- class: M(["p-0 w-full gap-[6px]", [p.position === "vertical" ? "flex-col" : "", p.colSpan ? "grid" : "flex justify-start"]])
816
+ }), (p, w) => (i(), d("div", {
817
+ class: V(["p-0 w-full gap-[6px]", [p.position === "vertical" ? "flex-col" : "", p.colSpan ? "grid" : "flex justify-start"]])
788
818
  }, [
789
- (i(!0), d(Y, null, le(s.value, (g) => (i(), ae(pt, {
790
- modelValue: r[a(g)],
791
- "onUpdate:modelValue": (_) => r[a(g)] = _,
792
- value: a(g),
793
- class: M(c(p.colSpan)),
794
- disabled: g.disabled,
795
- label: u(g),
796
- key: a(g),
797
- icon: g?.icon,
798
- imgUrl: g?.imgUrl,
799
- option: g,
819
+ (i(!0), d(Y, null, le(s.value, (b) => (i(), ae(gt, {
820
+ modelValue: r[a(b)],
821
+ "onUpdate:modelValue": ($) => r[a(b)] = $,
822
+ value: a(b),
823
+ class: V(c(p.colSpan)),
824
+ disabled: b.disabled,
825
+ label: u(b),
826
+ key: a(b),
827
+ icon: b?.icon,
828
+ imgUrl: b?.imgUrl,
829
+ option: b,
800
830
  view: p.view
801
831
  }, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
802
832
  ], 2));
803
833
  }
804
- }), Ol = /* @__PURE__ */ H(Dl, [["__scopeId", "data-v-91f3584a"]]), Ul = ["type", "placeholder", "disabled"], Tl = /* @__PURE__ */ F({
834
+ }), ql = /* @__PURE__ */ H(Nl, [["__scopeId", "data-v-91f3584a"]]), Gl = ["type", "placeholder", "disabled"], Jl = /* @__PURE__ */ F({
805
835
  __name: "vs-input-date1",
806
836
  props: {
807
837
  style: { default: () => ({}) },
@@ -815,27 +845,25 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
815
845
  },
816
846
  emits: ["update:modelValue"],
817
847
  setup(o, { emit: e }) {
818
- const t = o;
819
- console.log(t.mode);
820
- const { inputClass: n } = ye(t.style), s = e, r = O({
848
+ const t = o, { inputClass: n } = me(t.style), s = e, r = A({
821
849
  get: () => t.modelValue?.split(" ")[0],
822
850
  set: (u) => s("update:modelValue", u)
823
- }), a = O(() => t.mode === "datetime" ? "datetime-local" : t.mode);
851
+ }), a = A(() => t.mode === "datetime" ? "datetime-local" : t.mode);
824
852
  return (u, c) => K((i(), d("input", {
825
853
  type: a.value,
826
854
  "onUpdate:modelValue": c[0] || (c[0] = (v) => r.value = v),
827
855
  placeholder: u.placeholder,
828
856
  disabled: u.disabled,
829
857
  ref: "date",
830
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [u.modelValue ? "" : "text-opacity-50", q(n)].join(" ")]),
858
+ class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [u.modelValue ? "" : "text-opacity-50", q(n)].join(" ")]),
831
859
  style: {
832
860
  border: "1px solid #CFD9E0"
833
861
  }
834
- }, null, 10, Ul)), [
835
- [Ct, r.value]
862
+ }, null, 10, Gl)), [
863
+ [jt, r.value]
836
864
  ]);
837
865
  }
838
- }), Rl = async (o, e, t, n) => {
866
+ }), Kl = async (o, e, t, n) => {
839
867
  try {
840
868
  const s = new FormData();
841
869
  return s.append("unique", "true"), s.append("file", o), (await fetch(
@@ -846,27 +874,27 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
846
874
  }
847
875
  ).then((a) => a.json()))?.result;
848
876
  } catch (s) {
849
- return ke({
877
+ return be({
850
878
  type: "error",
851
879
  title: "Помилка!",
852
880
  message: "Сталась помилка під час завантаження файлу",
853
881
  position: "right-bottom"
854
882
  }), console.error("Сталась помилка завантаження файлу", s), null;
855
883
  }
856
- }, Pl = async (o) => {
884
+ }, Zl = async (o) => {
857
885
  try {
858
886
  return await fetch(`file/delete${o}`), !0;
859
887
  } catch (e) {
860
888
  return console.error(e), !1;
861
889
  }
862
- }, st = async (o) => {
890
+ }, it = async (o) => {
863
891
  try {
864
892
  const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), n = e.headers["content-type"], s = new TextDecoder("utf-8").decode(t), r = new Blob([s], { type: n }), a = document.createElement("a");
865
893
  a.setAttribute("download", o), a.href = window.URL.createObjectURL(r), a.click();
866
894
  } catch (e) {
867
895
  console.error(e.message);
868
896
  }
869
- }, Hl = {}, Nl = {
897
+ }, Wl = {}, Ql = {
870
898
  xmlns: "http://www.w3.org/2000/svg",
871
899
  width: "24",
872
900
  height: "24",
@@ -877,13 +905,13 @@ const yl = /* @__PURE__ */ H(hl, [["render", bl]]), xl = {
877
905
  "stroke-linecap": "round",
878
906
  "stroke-linejoin": "round"
879
907
  };
880
- function ql(o, e) {
881
- return i(), d("svg", Nl, e[0] || (e[0] = [
908
+ function Xl(o, e) {
909
+ return i(), d("svg", Ql, e[0] || (e[0] = [
882
910
  l("path", { d: "M5 12h14" }, null, -1),
883
911
  l("path", { d: "M12 5v14" }, null, -1)
884
912
  ]));
885
913
  }
886
- const Ae = /* @__PURE__ */ H(Hl, [["render", ql]]), Gl = {}, Jl = {
914
+ const Fe = /* @__PURE__ */ H(Wl, [["render", Xl]]), Yl = {}, eo = {
887
915
  xmlns: "http://www.w3.org/2000/svg",
888
916
  class: "icon icon-tabler icon-tabler-file-text",
889
917
  width: "44",
@@ -895,12 +923,12 @@ const Ae = /* @__PURE__ */ H(Hl, [["render", ql]]), Gl = {}, Jl = {
895
923
  "stroke-linecap": "round",
896
924
  "stroke-linejoin": "round"
897
925
  };
898
- function Kl(o, e, t, n, s, r) {
899
- return i(), d("svg", Jl, e[0] || (e[0] = [
900
- de('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
926
+ function to(o, e, t, n, s, r) {
927
+ return i(), d("svg", eo, e[0] || (e[0] = [
928
+ ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
901
929
  ]));
902
930
  }
903
- const Zl = /* @__PURE__ */ H(Gl, [["render", Kl]]), Wl = {}, Ql = {
931
+ const lo = /* @__PURE__ */ H(Yl, [["render", to]]), oo = {}, ao = {
904
932
  xmlns: "http://www.w3.org/2000/svg",
905
933
  class: "icon icon-tabler icon-tabler-table",
906
934
  width: "44",
@@ -912,8 +940,8 @@ const Zl = /* @__PURE__ */ H(Gl, [["render", Kl]]), Wl = {}, Ql = {
912
940
  "stroke-linecap": "round",
913
941
  "stroke-linejoin": "round"
914
942
  };
915
- function Xl(o, e, t, n, s, r) {
916
- return i(), d("svg", Ql, e[0] || (e[0] = [
943
+ function so(o, e, t, n, s, r) {
944
+ return i(), d("svg", ao, e[0] || (e[0] = [
917
945
  l("path", {
918
946
  stroke: "none",
919
947
  d: "M0 0h24v24H0z",
@@ -940,7 +968,7 @@ function Xl(o, e, t, n, s, r) {
940
968
  }, null, -1)
941
969
  ]));
942
970
  }
943
- const Yl = /* @__PURE__ */ H(Wl, [["render", Xl]]), eo = {}, to = {
971
+ const no = /* @__PURE__ */ H(oo, [["render", so]]), ro = {}, io = {
944
972
  xmlns: "http://www.w3.org/2000/svg",
945
973
  width: "24",
946
974
  height: "24",
@@ -952,12 +980,12 @@ const Yl = /* @__PURE__ */ H(Wl, [["render", Xl]]), eo = {}, to = {
952
980
  "stroke-linejoin": "round",
953
981
  class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
954
982
  };
955
- function lo(o, e, t, n, s, r) {
956
- return i(), d("svg", to, e[0] || (e[0] = [
957
- de('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
983
+ function uo(o, e, t, n, s, r) {
984
+ return i(), d("svg", io, e[0] || (e[0] = [
985
+ ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
958
986
  ]));
959
987
  }
960
- const oo = /* @__PURE__ */ H(eo, [["render", lo]]), ao = {}, so = {
988
+ const co = /* @__PURE__ */ H(ro, [["render", uo]]), po = {}, fo = {
961
989
  xmlns: "http://www.w3.org/2000/svg",
962
990
  class: "icon icon-tabler icon-tabler-file-zip",
963
991
  width: "44",
@@ -969,12 +997,12 @@ const oo = /* @__PURE__ */ H(eo, [["render", lo]]), ao = {}, so = {
969
997
  "stroke-linecap": "round",
970
998
  "stroke-linejoin": "round"
971
999
  };
972
- function no(o, e, t, n, s, r) {
973
- return i(), d("svg", so, e[0] || (e[0] = [
974
- de('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
1000
+ function vo(o, e, t, n, s, r) {
1001
+ return i(), d("svg", fo, e[0] || (e[0] = [
1002
+ ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
975
1003
  ]));
976
1004
  }
977
- const ro = /* @__PURE__ */ H(ao, [["render", no]]), io = {}, uo = {
1005
+ const mo = /* @__PURE__ */ H(po, [["render", vo]]), ho = {}, go = {
978
1006
  xmlns: "http://www.w3.org/2000/svg",
979
1007
  class: "icon icon-tabler icon-tabler-file-code",
980
1008
  width: "44",
@@ -986,25 +1014,25 @@ const ro = /* @__PURE__ */ H(ao, [["render", no]]), io = {}, uo = {
986
1014
  "stroke-linecap": "round",
987
1015
  "stroke-linejoin": "round"
988
1016
  };
989
- function co(o, e, t, n, s, r) {
990
- return i(), d("svg", uo, e[0] || (e[0] = [
991
- de('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
1017
+ function bo(o, e, t, n, s, r) {
1018
+ return i(), d("svg", go, e[0] || (e[0] = [
1019
+ ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
992
1020
  ]));
993
1021
  }
994
- const po = /* @__PURE__ */ H(io, [["render", co]]), fo = (o) => {
1022
+ const yo = /* @__PURE__ */ H(ho, [["render", bo]]), xo = (o) => {
995
1023
  if (!o) return "";
996
1024
  const e = o?.split(".");
997
1025
  return e[e.length - 1];
998
- }, vo = (o) => {
999
- const e = fo(o), t = {
1026
+ }, wo = (o) => {
1027
+ const e = xo(o), t = {
1000
1028
  imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
1001
1029
  sheetsFormat: ["xls", "csv", "xlsx"],
1002
1030
  archivesFormat: ["zip", "rar"],
1003
1031
  textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
1004
1032
  documentsFormat: ["pdf"]
1005
1033
  };
1006
- return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? Yl : t.textsFormat.includes(e) ? po : t.documentsFormat.includes(e) ? Zl : t.archivesFormat.includes(e) ? ro : oo;
1007
- }, mo = {}, ho = {
1034
+ return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? no : t.textsFormat.includes(e) ? yo : t.documentsFormat.includes(e) ? lo : t.archivesFormat.includes(e) ? mo : co;
1035
+ }, ko = {}, _o = {
1008
1036
  xmlns: "http://www.w3.org/2000/svg",
1009
1037
  width: "24",
1010
1038
  height: "24",
@@ -1016,12 +1044,12 @@ const po = /* @__PURE__ */ H(io, [["render", co]]), fo = (o) => {
1016
1044
  "stroke-linejoin": "round",
1017
1045
  class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
1018
1046
  };
1019
- function go(o, e) {
1020
- return i(), d("svg", ho, e[0] || (e[0] = [
1021
- de('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
1047
+ function $o(o, e) {
1048
+ return i(), d("svg", _o, e[0] || (e[0] = [
1049
+ ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
1022
1050
  ]));
1023
1051
  }
1024
- const Ue = /* @__PURE__ */ H(mo, [["render", go]]), bo = {}, yo = {
1052
+ const Te = /* @__PURE__ */ H(ko, [["render", $o]]), Co = {}, Vo = {
1025
1053
  xmlns: "http://www.w3.org/2000/svg",
1026
1054
  width: "24",
1027
1055
  height: "24",
@@ -1033,8 +1061,8 @@ const Ue = /* @__PURE__ */ H(mo, [["render", go]]), bo = {}, yo = {
1033
1061
  "stroke-linejoin": "round",
1034
1062
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1035
1063
  };
1036
- function xo(o, e) {
1037
- return i(), d("svg", yo, e[0] || (e[0] = [
1064
+ function Mo(o, e) {
1065
+ return i(), d("svg", Vo, e[0] || (e[0] = [
1038
1066
  l("path", {
1039
1067
  stroke: "none",
1040
1068
  d: "M0 0h24v24H0z",
@@ -1045,9 +1073,9 @@ function xo(o, e) {
1045
1073
  l("path", { d: "M12 4l0 12" }, null, -1)
1046
1074
  ]));
1047
1075
  }
1048
- const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, ko = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, _o = /* @__PURE__ */ F({
1076
+ const yt = /* @__PURE__ */ H(Co, [["render", Mo]]), Lo = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, So = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, Bo = /* @__PURE__ */ F({
1049
1077
  __name: "vs-input-file-list-item",
1050
- props: /* @__PURE__ */ Q({
1078
+ props: /* @__PURE__ */ Z({
1051
1079
  format: {},
1052
1080
  multiple: { type: Boolean },
1053
1081
  style: {},
@@ -1065,40 +1093,40 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1065
1093
  }),
1066
1094
  emits: ["update:value", "update:item"],
1067
1095
  setup(o) {
1068
- const e = X(o, "value"), t = X(o, "item"), n = o;
1069
- return (s, r) => (i(), d("div", wo, [
1070
- (i(), ae(Se(q(vo)(t.value)), {
1096
+ const e = W(o, "value"), t = W(o, "item"), n = o;
1097
+ return (s, r) => (i(), d("div", Lo, [
1098
+ (i(), ae(Be(q(wo)(t.value)), {
1071
1099
  src: t.value,
1072
1100
  alt: "file",
1073
1101
  class: "w-full h-full object-cover cursor-pointer",
1074
- onClick: r[0] || (r[0] = (a) => q(st)(t.value))
1102
+ onClick: r[0] || (r[0] = (a) => q(it)(t.value))
1075
1103
  }, null, 8, ["src"])),
1076
- l("div", ko, [
1104
+ l("div", So, [
1077
1105
  l("button", {
1078
1106
  type: "button",
1079
1107
  onClick: r[1] || (r[1] = (a) => {
1080
- q(Pl)(t.value), e.value = n.multiple ? e.value?.filter((u) => u !== t.value) : "";
1108
+ q(Zl)(t.value), e.value = n.multiple ? e.value?.filter((u) => u !== t.value) : "";
1081
1109
  }),
1082
1110
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
1083
1111
  }, [
1084
- j(Ue, { class: "w-4 h-4" })
1112
+ B(Te, { class: "w-4 h-4" })
1085
1113
  ]),
1086
1114
  l("button", {
1087
1115
  type: "button",
1088
- onClick: r[2] || (r[2] = (a) => q(st)(t.value)),
1116
+ onClick: r[2] || (r[2] = (a) => q(it)(t.value)),
1089
1117
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
1090
1118
  }, [
1091
- j(vt, { class: "w-4 h-4" })
1119
+ B(yt, { class: "w-4 h-4" })
1092
1120
  ])
1093
1121
  ])
1094
1122
  ]));
1095
1123
  }
1096
- }), nt = /* @__PURE__ */ H(_o, [["__scopeId", "data-v-0ca886b3"]]), $o = { class: "flex items-center gap-x-2" }, Co = {
1124
+ }), ut = /* @__PURE__ */ H(Bo, [["__scopeId", "data-v-0ca886b3"]]), jo = { class: "flex items-center gap-x-2" }, Io = {
1097
1125
  key: 1,
1098
1126
  class: "flex items-center flex-wrap gap-2"
1099
- }, Vo = /* @__PURE__ */ F({
1127
+ }, zo = /* @__PURE__ */ F({
1100
1128
  __name: "vs-input-file",
1101
- props: /* @__PURE__ */ Q({
1129
+ props: /* @__PURE__ */ Z({
1102
1130
  format: {},
1103
1131
  multiple: { type: Boolean },
1104
1132
  style: {},
@@ -1114,7 +1142,7 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1114
1142
  }),
1115
1143
  emits: ["update:modelValue"],
1116
1144
  setup(o) {
1117
- const e = o, t = X(o, "modelValue"), n = w(null), s = (a) => Array.isArray(t.value) && t.value[a] || "", r = async (a) => {
1145
+ const e = o, t = W(o, "modelValue"), n = x(null), s = (a) => Array.isArray(t.value) && t.value[a] || "", r = async (a) => {
1118
1146
  if (e.format) {
1119
1147
  const v = a.target.files?.[0];
1120
1148
  if (!v || !v.name.endsWith(e.format))
@@ -1122,10 +1150,10 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1122
1150
  }
1123
1151
  const u = a.target.files?.[0];
1124
1152
  if (!u) return;
1125
- const c = await Rl(u, "1", "form", "table");
1153
+ const c = await Kl(u, "1", "form", "table");
1126
1154
  t.value = e.multiple ? [...t.value || [], c?.file_path] : c?.file_path;
1127
1155
  };
1128
- return (a, u) => (i(), d("div", $o, [
1156
+ return (a, u) => (i(), d("div", jo, [
1129
1157
  l("input", {
1130
1158
  class: "hidden",
1131
1159
  ref_key: "fileInput",
@@ -1133,14 +1161,14 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1133
1161
  type: "file",
1134
1162
  onChange: r
1135
1163
  }, null, 544),
1136
- !a.multiple && t.value ? (i(), ae(nt, {
1164
+ !a.multiple && t.value ? (i(), ae(ut, {
1137
1165
  key: 0,
1138
1166
  item: t.value,
1139
1167
  "onUpdate:item": u[0] || (u[0] = (c) => t.value = c),
1140
1168
  value: t.value,
1141
1169
  "onUpdate:value": u[1] || (u[1] = (c) => t.value = c)
1142
- }, null, 8, ["item", "value"])) : a.multiple ? (i(), d("div", Co, [
1143
- (i(!0), d(Y, null, le(t.value, (c, v) => (i(), ae(nt, {
1170
+ }, null, 8, ["item", "value"])) : a.multiple ? (i(), d("div", Io, [
1171
+ (i(!0), d(Y, null, le(t.value, (c, v) => (i(), ae(ut, {
1144
1172
  multiple: a.multiple,
1145
1173
  key: v,
1146
1174
  value: t.value,
@@ -1149,30 +1177,30 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1149
1177
  }, null, 8, ["multiple", "value", "item"]))), 128)),
1150
1178
  l("div", {
1151
1179
  onClick: u[3] || (u[3] = (c) => !a.disabled && n.value?.click()),
1152
- class: M([
1180
+ class: V([
1153
1181
  "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",
1154
1182
  a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1155
1183
  ])
1156
1184
  }, [
1157
- j(Ae, { class: "w-6 h-6" })
1185
+ B(Fe, { class: "w-6 h-6" })
1158
1186
  ], 2)
1159
- ])) : A("", !0),
1160
- a.multiple ? A("", !0) : (i(), d("div", {
1187
+ ])) : D("", !0),
1188
+ a.multiple ? D("", !0) : (i(), d("div", {
1161
1189
  key: 2,
1162
1190
  onClick: u[4] || (u[4] = (c) => n.value?.click()),
1163
- class: M([a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
1191
+ class: V([a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
1164
1192
  }, [
1165
- j(Ae, { class: "w-6 h-6" })
1193
+ B(Fe, { class: "w-6 h-6" })
1166
1194
  ], 2))
1167
1195
  ]));
1168
1196
  }
1169
- }), Mo = { class: "max-w-[55vw]" }, Lo = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, So = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, Bo = { class: "px-[5px]" }, jo = { class: "" }, Fe = /* @__PURE__ */ F({
1197
+ }), Eo = { class: "max-w-[55vw]" }, Fo = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, Do = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, Oo = { class: "px-[5px]" }, Ao = { class: "" }, Ae = /* @__PURE__ */ F({
1170
1198
  __name: "vs-widget-file-info",
1171
1199
  props: {
1172
1200
  item: { default: null }
1173
1201
  },
1174
1202
  setup(o) {
1175
- const e = o, t = O(() => {
1203
+ const e = o, t = A(() => {
1176
1204
  try {
1177
1205
  return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
1178
1206
  day: "2-digit",
@@ -1190,34 +1218,34 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1190
1218
  return r < 1024 ? `${r.toFixed(2)} KB` : `${(r / 1024).toFixed(2)} MB`;
1191
1219
  }
1192
1220
  return (s, r) => (i(), d(Y, null, [
1193
- r[1] || (r[1] = de('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="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-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
1194
- l("div", Mo, [
1195
- l("p", Lo, T(s.item?.uploaded_name), 1),
1196
- l("p", So, [
1221
+ r[1] || (r[1] = ce('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="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-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
1222
+ l("div", Eo, [
1223
+ l("p", Fo, T(s.item?.uploaded_name), 1),
1224
+ l("p", Do, [
1197
1225
  l("span", null, T(s.item?.username), 1),
1198
- K(l("span", Bo, "|", 512), [
1199
- [Ge, s.item?.username]
1226
+ K(l("span", Oo, "|", 512), [
1227
+ [Je, s.item?.username]
1200
1228
  ]),
1201
1229
  l("span", null, T(t.value), 1),
1202
1230
  r[0] || (r[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1203
- l("span", jo, T(n(s.item?.size)), 1)
1231
+ l("span", Ao, T(n(s.item?.size)), 1)
1204
1232
  ])
1205
1233
  ])
1206
1234
  ], 64));
1207
1235
  }
1208
- }), Io = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, zo = {
1236
+ }), Uo = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, To = {
1209
1237
  key: 0,
1210
1238
  class: "flex w-full gap-x-3 items-center"
1211
- }, Eo = {
1239
+ }, Ro = {
1212
1240
  key: 1,
1213
1241
  class: "flex gap-x-3 w-full items-center"
1214
- }, Ao = {
1242
+ }, Po = {
1215
1243
  key: 2,
1216
1244
  class: "flex gap-x-3 w-full items-center"
1217
- }, Fo = ["href"], Do = {
1245
+ }, Ho = ["href"], No = {
1218
1246
  key: 3,
1219
1247
  class: "flex gap-x-3 w-full items-center"
1220
- }, Oo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, Uo = { class: "p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700" }, To = { class: "inline-block" }, Ro = { class: "inline-block" }, Po = /* @__PURE__ */ F({
1248
+ }, qo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, Go = { class: "p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700" }, Jo = { class: "inline-block" }, Ko = { class: "inline-block" }, Zo = /* @__PURE__ */ F({
1221
1249
  __name: "vs-widget-file-item",
1222
1250
  props: {
1223
1251
  item: { default: null },
@@ -1234,8 +1262,8 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1234
1262
  return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(p.ext);
1235
1263
  }
1236
1264
  function a(p) {
1237
- const x = document.createElement("a");
1238
- x.setAttribute("download", p?.uploaded_name), x.href = p?.file_path, x.click();
1265
+ const w = document.createElement("a");
1266
+ w.setAttribute("download", p?.uploaded_name), w.href = p?.file_path, w.click();
1239
1267
  }
1240
1268
  async function u() {
1241
1269
  try {
@@ -1259,48 +1287,48 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1259
1287
  function v(p) {
1260
1288
  (t.item.ext === "jpg" || t.item.ext === "png") && n("openLightbox", { item: t.item, index: p });
1261
1289
  }
1262
- return (p, x) => (i(), d("div", Io, [
1263
- p.item.ext === "jpg" || p.item.ext === "png" ? (i(), d("div", zo, [
1290
+ return (p, w) => (i(), d("div", Uo, [
1291
+ p.item.ext === "jpg" || p.item.ext === "png" ? (i(), d("div", To, [
1264
1292
  l("div", {
1265
1293
  class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
1266
- onClick: x[0] || (x[0] = (g) => v(p.index))
1294
+ onClick: w[0] || (w[0] = (b) => v(p.index))
1267
1295
  }, [
1268
- j(Fe, { item: p.item }, null, 8, ["item"])
1296
+ B(Ae, { item: p.item }, null, 8, ["item"])
1269
1297
  ])
1270
- ])) : s(p.item) ? (i(), d("div", Eo, [
1271
- j(Fe, { item: p.item }, null, 8, ["item"])
1272
- ])) : r(p.item) ? (i(), d("div", Ao, [
1298
+ ])) : s(p.item) ? (i(), d("div", Ro, [
1299
+ B(Ae, { item: p.item }, null, 8, ["item"])
1300
+ ])) : r(p.item) ? (i(), d("div", Po, [
1273
1301
  l("a", {
1274
1302
  href: `/api/file-preview?id=${p.item.file_id}`,
1275
1303
  target: "_blank",
1276
1304
  class: "flex gap-x-3 w-full items-center"
1277
1305
  }, [
1278
- j(Fe, { item: p.item }, null, 8, ["item"])
1279
- ], 8, Fo)
1280
- ])) : (i(), d("div", Do, [
1281
- j(Fe, { item: p.item }, null, 8, ["item"])
1306
+ B(Ae, { item: p.item }, null, 8, ["item"])
1307
+ ], 8, Ho)
1308
+ ])) : (i(), d("div", No, [
1309
+ B(Ae, { item: p.item }, null, 8, ["item"])
1282
1310
  ])),
1283
- l("div", Oo, [
1284
- l("div", Uo, [
1285
- l("div", To, [
1311
+ l("div", qo, [
1312
+ l("div", Go, [
1313
+ l("div", Jo, [
1286
1314
  l("button", {
1287
1315
  class: "inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
1288
- onClick: x[1] || (x[1] = (g) => a(p.item))
1316
+ onClick: w[1] || (w[1] = (b) => a(p.item))
1289
1317
  }, [
1290
- j(vt, {
1318
+ B(yt, {
1291
1319
  height: "14",
1292
1320
  width: "14"
1293
1321
  })
1294
1322
  ])
1295
1323
  ]),
1296
- x[3] || (x[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1297
- l("div", Ro, [
1324
+ w[3] || (w[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1325
+ l("div", Ko, [
1298
1326
  l("button", {
1299
1327
  type: "button",
1300
1328
  class: "size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",
1301
- onClick: x[2] || (x[2] = (g) => c())
1329
+ onClick: w[2] || (w[2] = (b) => c())
1302
1330
  }, [
1303
- j(Ue, {
1331
+ B(Te, {
1304
1332
  height: "14",
1305
1333
  width: "14"
1306
1334
  })
@@ -1310,7 +1338,7 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1310
1338
  ])
1311
1339
  ]));
1312
1340
  }
1313
- }), Ho = {}, No = {
1341
+ }), Wo = {}, Qo = {
1314
1342
  xmlns: "http://www.w3.org/2000/svg",
1315
1343
  width: "24",
1316
1344
  height: "24",
@@ -1322,8 +1350,8 @@ const vt = /* @__PURE__ */ H(bo, [["render", xo]]), wo = { class: "h-[120px] w-[
1322
1350
  "stroke-linejoin": "round",
1323
1351
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1324
1352
  };
1325
- function qo(o, e) {
1326
- return i(), d("svg", No, e[0] || (e[0] = [
1353
+ function Xo(o, e) {
1354
+ return i(), d("svg", Qo, e[0] || (e[0] = [
1327
1355
  l("path", {
1328
1356
  stroke: "none",
1329
1357
  d: "M0 0h24v24H0z",
@@ -1334,13 +1362,13 @@ function qo(o, e) {
1334
1362
  l("path", { d: "M12 4l0 12" }, null, -1)
1335
1363
  ]));
1336
1364
  }
1337
- const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, Ko = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Zo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, Wo = { class1: "ml-auto" }, Qo = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Xo = {
1365
+ const Yo = /* @__PURE__ */ H(Wo, [["render", Xo]]), ea = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, ta = { class: "flex w-full mb-[12px] items-center gap-x-2" }, la = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, oa = { class1: "ml-auto" }, aa = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, sa = {
1338
1366
  key: 0,
1339
1367
  class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
1340
- }, Yo = { class: "relative" }, ea = {
1368
+ }, na = { class: "relative" }, ra = {
1341
1369
  key: 1,
1342
1370
  class: "space-y-3 max-h-[300px] 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"
1343
- }, ta = { key: 0 }, la = /* @__PURE__ */ F({
1371
+ }, ia = { key: 0 }, ua = /* @__PURE__ */ F({
1344
1372
  __name: "vs-input-file-list",
1345
1373
  props: {
1346
1374
  id: { default: "" },
@@ -1355,8 +1383,8 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1355
1383
  },
1356
1384
  emits: ["update"],
1357
1385
  setup(o, { emit: e }) {
1358
- const t = o, n = Me("form"), s = O(() => n.value.formId), r = w(!1), a = w(0), u = e, c = w(!1), v = w({}), p = w([]), x = w(""), g = O(() => Array.isArray(p.value) ? p.value.filter((m) => m.ext === "jpg" || m.ext === "png").map((m) => m?.file_path) : []), _ = O(() => x.value === "" ? p.value : p.value.filter((m) => m?.uploaded_name?.includes(x.value))), S = (m) => {
1359
- const f = g.value.findIndex((Z) => Z === m.item.file_path);
1386
+ const t = o, n = Me("form"), s = A(() => n.value.formId), r = x(!1), a = x(0), u = e, c = x(!1), v = x({}), p = x([]), w = x(""), b = A(() => Array.isArray(p.value) ? p.value.filter((m) => m.ext === "jpg" || m.ext === "png").map((m) => m?.file_path) : []), $ = A(() => w.value === "" ? p.value : p.value.filter((m) => m?.uploaded_name?.includes(w.value))), S = (m) => {
1387
+ const f = b.value.findIndex((Q) => Q === m.item.file_path);
1360
1388
  f !== -1 && (r.value = !0, a.value = f);
1361
1389
  }, R = async () => {
1362
1390
  try {
@@ -1365,47 +1393,47 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1365
1393
  } catch (m) {
1366
1394
  console.error(m);
1367
1395
  }
1368
- }, $ = async (m) => {
1396
+ }, C = async (m) => {
1369
1397
  await Promise.all(
1370
1398
  Array.from(m.target.files).map(async (f) => {
1371
- const Z = new FormData();
1372
- Z.append("file", f);
1399
+ const Q = new FormData();
1400
+ Q.append("file", f);
1373
1401
  try {
1374
1402
  const U = `${t.prefix}/widget/file/${s.value}`;
1375
- return await fetch(U, { method: "POST", body: Z }), u("update", "file-list"), f;
1403
+ return await fetch(U, { method: "POST", body: Q }), u("update", "file-list"), f;
1376
1404
  } catch (U) {
1377
1405
  return console.error(U), null;
1378
1406
  }
1379
1407
  })
1380
1408
  ), await R();
1381
- }, z = (m) => {
1409
+ }, E = (m) => {
1382
1410
  const f = { ...m };
1383
1411
  return m.cancel || (f.cancel = () => {
1384
1412
  c.value = !1;
1385
1413
  }), m.updateListOnConfirm && (f.confirm = async () => {
1386
1414
  await m.confirm(), c.value = !1, R();
1387
1415
  }), f;
1388
- }, B = (m) => {
1389
- v.value = z(m), c.value = !0;
1416
+ }, j = (m) => {
1417
+ v.value = E(m), c.value = !0;
1390
1418
  };
1391
1419
  return te(s, (m) => {
1392
1420
  m && R();
1393
- }), be(() => {
1421
+ }), xe(() => {
1394
1422
  s.value && R();
1395
1423
  }), (m, f) => {
1396
- const Z = tt("Lightbox"), U = tt("MessageBox");
1397
- return i(), d("div", Jo, [
1398
- l("div", Ko, [
1399
- l("h2", Zo, " Файлів: " + T(p.value?.length), 1),
1400
- l("div", Wo, [
1424
+ const Q = at("Lightbox"), U = at("MessageBox");
1425
+ return i(), d("div", ea, [
1426
+ l("div", ta, [
1427
+ l("h2", la, " Файлів: " + T(p.value?.length), 1),
1428
+ l("div", oa, [
1401
1429
  l("label", null, [
1402
1430
  l("input", {
1403
1431
  type: "file",
1404
1432
  class: "hidden",
1405
- onChange: f[0] || (f[0] = (D) => $(D))
1433
+ onChange: f[0] || (f[0] = (O) => C(O))
1406
1434
  }, null, 32),
1407
- l("div", Qo, [
1408
- j(Go, {
1435
+ l("div", aa, [
1436
+ B(Yo, {
1409
1437
  height: "16",
1410
1438
  width: "16"
1411
1439
  })
@@ -1413,9 +1441,9 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1413
1441
  ])
1414
1442
  ])
1415
1443
  ]),
1416
- p.value?.length > 4 ? (i(), d("div", Xo, [
1444
+ p.value?.length > 4 ? (i(), d("div", sa, [
1417
1445
  l("div", null, [
1418
- l("div", Yo, [
1446
+ l("div", na, [
1419
1447
  f[8] || (f[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
1420
1448
  l("svg", {
1421
1449
  class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
@@ -1439,50 +1467,50 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1439
1467
  ], -1)),
1440
1468
  K(l("input", {
1441
1469
  type: "text",
1442
- "onUpdate:modelValue": f[1] || (f[1] = (D) => x.value = D),
1470
+ "onUpdate:modelValue": f[1] || (f[1] = (O) => w.value = O),
1443
1471
  class: "py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",
1444
1472
  placeholder: "Введіть назву файлу"
1445
1473
  }, null, 512), [
1446
1474
  [
1447
- re,
1448
- x.value,
1475
+ se,
1476
+ w.value,
1449
1477
  void 0,
1450
1478
  { trim: !0 }
1451
1479
  ]
1452
1480
  ])
1453
1481
  ])
1454
1482
  ])
1455
- ])) : A("", !0),
1456
- p.value?.length ? (i(), d("div", ea, [
1457
- (i(!0), d(Y, null, le(_.value, (D, ie) => (i(), ae(Po, {
1458
- key: ie,
1483
+ ])) : D("", !0),
1484
+ p.value?.length ? (i(), d("div", ra, [
1485
+ (i(!0), d(Y, null, le($.value, (O, ue) => (i(), ae(Zo, {
1486
+ key: ue,
1459
1487
  prefix: m.prefix,
1460
- item: D,
1461
- index: ie,
1488
+ item: O,
1489
+ index: ue,
1462
1490
  onUpdate: f[2] || (f[2] = (ee) => m.$emit("update", "file-list")),
1463
- onOpenModal: f[3] || (f[3] = (ee) => B(ee)),
1491
+ onOpenModal: f[3] || (f[3] = (ee) => j(ee)),
1464
1492
  onOpenLightbox: f[4] || (f[4] = (ee) => S(ee))
1465
1493
  }, null, 8, ["prefix", "item", "index"]))), 128)),
1466
- _.value.length ? A("", !0) : (i(), d("div", ta, f[9] || (f[9] = [
1494
+ $.value.length ? D("", !0) : (i(), d("div", ia, f[9] || (f[9] = [
1467
1495
  l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
1468
1496
  ])))
1469
- ])) : A("", !0),
1470
- j(Z, {
1497
+ ])) : D("", !0),
1498
+ B(Q, {
1471
1499
  modelValue: r.value,
1472
- "onUpdate:modelValue": f[5] || (f[5] = (D) => r.value = D),
1500
+ "onUpdate:modelValue": f[5] || (f[5] = (O) => r.value = O),
1473
1501
  startIndex: a.value,
1474
- "onUpdate:index": f[6] || (f[6] = (D) => a.value = D),
1475
- images: g.value
1502
+ "onUpdate:index": f[6] || (f[6] = (O) => a.value = O),
1503
+ images: b.value
1476
1504
  }, null, 8, ["modelValue", "startIndex", "images"]),
1477
- j(U, Ee({
1505
+ B(U, Ee({
1478
1506
  modelValue: c.value,
1479
- "onUpdate:modelValue": f[7] || (f[7] = (D) => c.value = D),
1507
+ "onUpdate:modelValue": f[7] || (f[7] = (O) => c.value = O),
1480
1508
  onConfirm: v.value.confirm
1481
1509
  }, v.value), null, 16, ["modelValue", "onConfirm"])
1482
1510
  ]);
1483
1511
  };
1484
1512
  }
1485
- }), oa = { class: "flex items-center justify-between" }, aa = { class: "text-[16px] text-gray-900 font-medium" }, sa = { class: "grid gap-3" }, na = /* @__PURE__ */ F({
1513
+ }), da = { class: "flex items-center justify-between" }, ca = { class: "text-[16px] text-gray-900 font-medium" }, pa = { class: "grid gap-3" }, fa = /* @__PURE__ */ F({
1486
1514
  __name: "vs-container-switcher",
1487
1515
  props: {
1488
1516
  title: {
@@ -1499,34 +1527,34 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1499
1527
  }
1500
1528
  },
1501
1529
  setup(o) {
1502
- const e = o, t = w(e.isOpen);
1530
+ const e = o, t = x(e.isOpen);
1503
1531
  return te(
1504
1532
  () => e.isOpen,
1505
1533
  (n) => {
1506
1534
  t.value = n;
1507
1535
  }
1508
1536
  ), (n, s) => (i(), d("div", null, [
1509
- l("div", oa, [
1510
- l("p", aa, T(o.title), 1),
1511
- j(ft, {
1537
+ l("div", da, [
1538
+ l("p", ca, T(o.title), 1),
1539
+ B(bt, {
1512
1540
  modelValue: t.value,
1513
1541
  "onUpdate:modelValue": s[0] || (s[0] = (r) => t.value = r),
1514
- style: ge(o.style)
1542
+ style: ye(o.style)
1515
1543
  }, null, 8, ["modelValue", "style"])
1516
1544
  ]),
1517
- j(ct, { name: "slide-fade" }, {
1518
- default: Be(() => [
1519
- K(l("div", sa, [
1545
+ B(mt, { name: "slide-fade" }, {
1546
+ default: Le(() => [
1547
+ K(l("div", pa, [
1520
1548
  $e(n.$slots, "default", {}, void 0, !0)
1521
1549
  ], 512), [
1522
- [Ge, t.value]
1550
+ [Je, t.value]
1523
1551
  ])
1524
1552
  ]),
1525
1553
  _: 3
1526
1554
  })
1527
1555
  ]));
1528
1556
  }
1529
- }), ra = /* @__PURE__ */ H(na, [["__scopeId", "data-v-90320b87"]]), ia = { class: "text-[16px] text-gray-900 font-medium" }, ua = { class: "grid gap-3" }, da = /* @__PURE__ */ F({
1557
+ }), va = /* @__PURE__ */ H(fa, [["__scopeId", "data-v-90320b87"]]), ma = { class: "text-[16px] text-gray-900 font-medium" }, ha = { class: "grid gap-3" }, ga = /* @__PURE__ */ F({
1530
1558
  __name: "vs-container-accordion",
1531
1559
  props: {
1532
1560
  title: {
@@ -1543,7 +1571,7 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1543
1571
  }
1544
1572
  },
1545
1573
  setup(o) {
1546
- const e = o, t = w(e.isOpen);
1574
+ const e = o, t = x(e.isOpen);
1547
1575
  return te(
1548
1576
  () => e.isOpen,
1549
1577
  (n) => {
@@ -1555,24 +1583,24 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1555
1583
  onClick: s[0] || (s[0] = (r) => t.value = !t.value),
1556
1584
  class: "flex items-center gap-2"
1557
1585
  }, [
1558
- j(q(cl), {
1559
- class: M(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1586
+ B(q(bl), {
1587
+ class: V(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1560
1588
  }, null, 8, ["class"]),
1561
- l("span", ia, T(o.title), 1)
1589
+ l("span", ma, T(o.title), 1)
1562
1590
  ]),
1563
- j(ct, { name: "slide-fade" }, {
1564
- default: Be(() => [
1565
- K(l("div", ua, [
1591
+ B(mt, { name: "slide-fade" }, {
1592
+ default: Le(() => [
1593
+ K(l("div", ha, [
1566
1594
  $e(n.$slots, "default", {}, void 0, !0)
1567
1595
  ], 512), [
1568
- [Ge, t.value]
1596
+ [Je, t.value]
1569
1597
  ])
1570
1598
  ]),
1571
1599
  _: 3
1572
1600
  })
1573
1601
  ]));
1574
1602
  }
1575
- }), ca = /* @__PURE__ */ H(da, [["__scopeId", "data-v-590eff11"]]), pa = { class: "flex items-center justify-between" }, fa = /* @__PURE__ */ F({
1603
+ }), ba = /* @__PURE__ */ H(ga, [["__scopeId", "data-v-590eff11"]]), ya = { class: "flex items-center justify-between" }, xa = /* @__PURE__ */ F({
1576
1604
  __name: "vs-container-default",
1577
1605
  props: {
1578
1606
  title: {
@@ -1586,17 +1614,17 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1586
1614
  },
1587
1615
  setup(o) {
1588
1616
  return (e, t) => (i(), d("div", null, [
1589
- l("div", pa, [
1617
+ l("div", ya, [
1590
1618
  l("p", null, T(o.title), 1)
1591
1619
  ]),
1592
1620
  $e(e.$slots, "default")
1593
1621
  ]));
1594
1622
  }
1595
- }), va = {
1596
- switcher: ra,
1597
- accordion: ca,
1598
- default: fa
1599
- }, ce = {
1623
+ }), wa = {
1624
+ switcher: va,
1625
+ accordion: ba,
1626
+ default: xa
1627
+ }, pe = {
1600
1628
  Equal: "==",
1601
1629
  Inequal: "!=",
1602
1630
  Higer: ">",
@@ -1609,37 +1637,37 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1609
1637
  Contain: "*",
1610
1638
  In: "in",
1611
1639
  NotIn: "not_in"
1612
- }, ma = (o, e) => String(o) === String(e), ha = (o, e) => String(o) !== String(e), ga = (o, e) => o > e, ba = (o, e) => o >= e, ya = (o, e) => o < e, xa = (o, e) => o <= e, wa = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, ka = (o, e) => String(o).startsWith(String(e)), _a = (o, e) => String(o).endsWith(String(e)), $a = (o, e) => String(o).includes(String(e)), Ca = (o, e) => Array.isArray(e) ? e.includes(o) : !1, Va = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, mt = (o, e) => {
1640
+ }, ka = (o, e) => String(o) === String(e), _a = (o, e) => String(o) !== String(e), $a = (o, e) => o > e, Ca = (o, e) => o >= e, Va = (o, e) => o < e, Ma = (o, e) => o <= e, La = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, Sa = (o, e) => String(o).startsWith(String(e)), Ba = (o, e) => String(o).endsWith(String(e)), ja = (o, e) => String(o).includes(String(e)), Ia = (o, e) => Array.isArray(e) ? e.includes(o) : !1, za = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, xt = (o, e) => {
1613
1641
  if (!e) return !0;
1614
1642
  switch (e?.[1]) {
1615
- case ce.Equal:
1616
- return ma(o, e?.[2]);
1617
- case ce.Inequal:
1618
- return ha(o, e?.[2]);
1619
- case ce.Higer:
1620
- return ga(o, e?.[2]);
1621
- case ce.HigerOrEqual:
1622
- return ba(o, e?.[2]);
1623
- case ce.Lower:
1624
- return ya(o, e?.[2]);
1625
- case ce.LowerOrEqual:
1626
- return xa(o, e?.[2]);
1627
- case ce.Between:
1628
- return wa(o, e?.[2]);
1629
- case ce.StartWith:
1643
+ case pe.Equal:
1630
1644
  return ka(o, e?.[2]);
1631
- case ce.EndWith:
1645
+ case pe.Inequal:
1632
1646
  return _a(o, e?.[2]);
1633
- case ce.Contain:
1647
+ case pe.Higer:
1634
1648
  return $a(o, e?.[2]);
1635
- case ce.In:
1649
+ case pe.HigerOrEqual:
1636
1650
  return Ca(o, e?.[2]);
1637
- case ce.NotIn:
1651
+ case pe.Lower:
1638
1652
  return Va(o, e?.[2]);
1653
+ case pe.LowerOrEqual:
1654
+ return Ma(o, e?.[2]);
1655
+ case pe.Between:
1656
+ return La(o, e?.[2]);
1657
+ case pe.StartWith:
1658
+ return Sa(o, e?.[2]);
1659
+ case pe.EndWith:
1660
+ return Ba(o, e?.[2]);
1661
+ case pe.Contain:
1662
+ return ja(o, e?.[2]);
1663
+ case pe.In:
1664
+ return Ia(o, e?.[2]);
1665
+ case pe.NotIn:
1666
+ return za(o, e?.[2]);
1639
1667
  default:
1640
1668
  return !0;
1641
1669
  }
1642
- }, Ma = /* @__PURE__ */ F({
1670
+ }, Ea = /* @__PURE__ */ F({
1643
1671
  __name: "vs-input-container",
1644
1672
  props: {
1645
1673
  style: {
@@ -1660,19 +1688,19 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1660
1688
  }
1661
1689
  },
1662
1690
  setup(o) {
1663
- const e = o, t = Me("formValues", { default: {} }), n = Me("form"), s = O(() => e.schema?.filter((a) => {
1691
+ const e = o, t = Me("formValues", { default: {} }), n = Me("form"), s = A(() => e.schema?.filter((a) => {
1664
1692
  const u = a?.conditions;
1665
1693
  if (!u) return !0;
1666
1694
  const c = Array.isArray(u) ? u[0] : u, v = t?.value?.[c];
1667
- return mt(v, u);
1668
- })), r = O(() => va[e.view]);
1669
- return (a, u) => o.schema?.length ? (i(), ae(Se(r.value), {
1695
+ return xt(v, u);
1696
+ })), r = A(() => wa[e.view]);
1697
+ return (a, u) => o.schema?.length ? (i(), ae(Be(r.value), {
1670
1698
  key: 0,
1671
1699
  title: o.title,
1672
- style: ge(o.style)
1700
+ style: ye(o.style)
1673
1701
  }, {
1674
- default: Be(() => [
1675
- (i(!0), d(Y, null, le(s.value, (c) => (i(), ae(ht, Ee({
1702
+ default: Le(() => [
1703
+ (i(!0), d(Y, null, le(s.value, (c) => (i(), ae(wt, Ee({
1676
1704
  key: c.name
1677
1705
  }, { ref_for: !0 }, c, {
1678
1706
  item: c,
@@ -1683,151 +1711,9 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1683
1711
  }), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
1684
1712
  ]),
1685
1713
  _: 1
1686
- }, 8, ["title", "style"])) : A("", !0);
1714
+ }, 8, ["title", "style"])) : D("", !0);
1687
1715
  }
1688
- }), La = { class: "relative" }, Sa = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, Ba = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, ja = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Ia = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, za = { class: "p-4 mim-h-0 h-full overflow-auto" }, Ea = /* @__PURE__ */ F({
1689
- __name: "modal-edit",
1690
- props: {
1691
- schema: {},
1692
- defaultValue: {},
1693
- mode: {},
1694
- token: {},
1695
- form: {}
1696
- },
1697
- emits: ["close", "save", "edit"],
1698
- setup(o, { emit: e }) {
1699
- const t = o, n = e, s = w(t.schema), r = w(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), a = w({}), u = w(), c = w(t.mode);
1700
- async function v() {
1701
- const x = a.value.validate();
1702
- if (x) {
1703
- ke({ type: "warning", title: "Помилка валідації", message: Object.entries(x).map(([g, _]) => `${g}: ${_}`).join(`
1704
- `) });
1705
- return;
1706
- }
1707
- if (u.value)
1708
- try {
1709
- const g = await fetch(`/api/table/${u.value}`, {
1710
- method: c.value === "add" ? "POST" : "PUT",
1711
- headers: {
1712
- "Content-Type": "application/json"
1713
- },
1714
- body: JSON.stringify(r.value)
1715
- });
1716
- if (g.ok)
1717
- await g.json(), ke({
1718
- type: "success",
1719
- title: "Успішно",
1720
- message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
1721
- }), n("save", r.value);
1722
- else if (g.status === 400) {
1723
- const _ = await g.json().catch(() => ({}));
1724
- ke({
1725
- type: "warning",
1726
- title: "Помилка валідації",
1727
- message: _.message || "Некоректні дані (400)"
1728
- });
1729
- } else g.status === 500 ? ke({
1730
- type: "error",
1731
- title: "Серверна помилка",
1732
- message: "Виникла помилка на сервері (500)"
1733
- }) : ke({
1734
- type: "error",
1735
- title: "Помилка",
1736
- message: `Статус: ${g.status}`
1737
- });
1738
- } catch (g) {
1739
- ke({
1740
- type: "error",
1741
- title: "Помилка з’єднання",
1742
- message: g.message || "Не вдалося виконати запит"
1743
- });
1744
- }
1745
- }
1746
- function p() {
1747
- n("close");
1748
- }
1749
- return be(async () => {
1750
- if (t.form) {
1751
- const x = await fetch(`/api/template/form/${t.form}`).then((g) => g.json());
1752
- s.value = x.schema, u.value = x.token;
1753
- } else if (t.token) {
1754
- u.value = t.token;
1755
- const x = await fetch(`/api/form/${u.value}`).then((g) => g.json());
1756
- s.value = x.schema, x.data ? r.value = x.data : c.value = "add";
1757
- }
1758
- }), (x, g) => (i(), d("div", La, [
1759
- l("div", Sa, [
1760
- l("div", Ba, [
1761
- l("div", ja, [
1762
- l("h3", Ia, T(c.value === "add" ? "Додати" : "Змінити"), 1),
1763
- l("button", {
1764
- onClick: p,
1765
- type: "button",
1766
- class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
1767
- }, g[2] || (g[2] = [
1768
- l("span", { class: "sr-only" }, "Close", -1),
1769
- l("svg", {
1770
- class: "flex-shrink-0 w-4 h-4",
1771
- xmlns: "http://www.w3.org/2000/svg",
1772
- width: "24",
1773
- height: "24",
1774
- viewBox: "0 0 24 24",
1775
- fill: "none",
1776
- stroke: "currentColor",
1777
- "stroke-width": "2",
1778
- "stroke-linecap": "round",
1779
- "stroke-linejoin": "round"
1780
- }, [
1781
- l("path", { d: "M18 6 6 18" }),
1782
- l("path", { d: "m6 6 12 12" })
1783
- ], -1)
1784
- ]))
1785
- ]),
1786
- l("div", za, [
1787
- s.value ? (i(), ae(Oe, {
1788
- key: 0,
1789
- schema: s.value,
1790
- values: r.value,
1791
- "onUpdate:values": g[0] || (g[0] = (_) => r.value = _),
1792
- form: a.value,
1793
- "onUpdate:form": g[1] || (g[1] = (_) => a.value = _)
1794
- }, null, 8, ["schema", "values", "form"])) : A("", !0)
1795
- ]),
1796
- l("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
1797
- l("button", {
1798
- type: "button",
1799
- onClick: p,
1800
- class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
1801
- }, " Скасувати "),
1802
- l("button", {
1803
- onClick: v,
1804
- type: "button",
1805
- class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
1806
- }, " Зберегти ")
1807
- ])
1808
- ])
1809
- ])
1810
- ]));
1811
- }
1812
- }), Pe = (o = { mode: "edit", schema: null }) => new Promise((e) => {
1813
- const { close: t } = Lt({
1814
- title: o.mode === "add" ? "Додати" : "Редагувати",
1815
- template: "",
1816
- visible: !0,
1817
- size: "medium",
1818
- closeClickBack: !0,
1819
- content: Ea,
1820
- contentProps: {
1821
- ...o,
1822
- onClose: () => {
1823
- e(null), t();
1824
- },
1825
- onSave: (n) => {
1826
- e(n), t();
1827
- }
1828
- }
1829
- });
1830
- }), Aa = ["aria-expanded", "data-focus"], Fa = { class: "flex items-center" }, Da = ["title"], Oa = ["onClick"], Ua = ["title"], Ta = {
1716
+ }), Fa = ["aria-expanded", "data-focus"], Da = { class: "flex items-center" }, Oa = ["title"], Aa = ["onClick"], Ua = ["title"], Ta = {
1831
1717
  key: 2,
1832
1718
  class: "text-gray-500 truncate"
1833
1719
  }, Ra = { class: "flex-1 min-w-[2px]" }, Pa = ["placeholder"], Ha = { class: "flex items-center shrink-0" }, Na = ["disabled"], qa = ["disabled", "title"], Ga = ["aria-disabled", "onClick"], Ja = {
@@ -1858,409 +1744,438 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
1858
1744
  },
1859
1745
  emits: ["change", "update:modelValue"],
1860
1746
  setup(o, { emit: e }) {
1861
- const t = o, n = e, s = O(() => t.multiple), r = O(() => t.disabled);
1862
- ye(t.style);
1863
- const a = O({
1747
+ const t = o, n = e, s = A(() => t.multiple), r = A(() => t.disabled);
1748
+ me(t.style);
1749
+ const a = A({
1864
1750
  get: () => t.modelValue,
1865
- set: (h) => n("update:modelValue", h)
1751
+ set: (g) => n("update:modelValue", g)
1866
1752
  });
1867
1753
  !a.value && t.defaultValue && (a.value = t.defaultValue);
1868
- const u = w(null), c = w(null), v = w(null), p = w(!1), x = w(!1), g = w(null), _ = w([]), S = w(-1), R = w([]), $ = w(""), z = w(null), B = w("bottom"), m = w({}), f = w([]), Z = O(() => {
1754
+ const u = x(null), c = x(null), v = x(null), p = x(!1), w = x(!1), b = x(null), $ = x([]), S = x(-1), R = x([]), C = x(""), E = x(null), j = x("bottom"), m = x({}), f = x([]), Q = A(() => {
1869
1755
  if (!f.value.length) return [];
1870
- const h = new Map(_.value.map((b) => [b.id?.toString(), b]));
1871
- return f.value.map((b) => h.get(b?.toString())).filter((b) => !!b);
1872
- }), U = O(() => t.placeholder || "Select..."), D = O(() => s.value ? !f.value.length && $.value === "" : !g.value?.text && $.value === ""), ie = O(() => r.value ? !1 : s.value ? f.value.length > 0 : !!a.value), ee = (h) => s.value ? f.value.some((b) => b?.toString() === h?.toString()) : a.value?.toString() === h?.toString(), W = O(() => {
1873
- let h = _.value ?? [];
1874
- if (!t.data && $.value.trim() !== "") {
1875
- const b = $.value.toLowerCase();
1876
- h = h.filter((V) => V.text?.toLowerCase?.().includes(b));
1756
+ const g = new Map($.value.map((h) => [h.id?.toString(), h]));
1757
+ return f.value.map((h) => g.get(h?.toString())).filter((h) => !!h);
1758
+ }), U = A(() => t.placeholder || "Select..."), O = A(() => s.value ? !f.value.length && C.value === "" : !b.value?.text && C.value === ""), ue = A(() => r.value ? !1 : s.value ? f.value.length > 0 : !!a.value), ee = (g) => s.value ? f.value.some((h) => h?.toString() === g?.toString()) : a.value?.toString() === g?.toString(), X = A(() => {
1759
+ let g = $.value ?? [];
1760
+ if (!t.data && C.value.trim() !== "") {
1761
+ const h = C.value.toLowerCase();
1762
+ g = g.filter((_) => _.text?.toLowerCase?.().includes(h));
1877
1763
  }
1878
1764
  if (s.value && f.value.length) {
1879
- const b = new Set(f.value.map((V) => V?.toString()));
1880
- h = h.filter((V) => !b.has(V.id?.toString()));
1765
+ const h = new Set(f.value.map((_) => _?.toString()));
1766
+ g = g.filter((_) => !h.has(_.id?.toString()));
1881
1767
  }
1882
- return h;
1883
- }), je = Me("values"), xe = O(() => t.parent ? je?.value?.[t.parent] ?? null : null), I = async (h) => {
1768
+ return g;
1769
+ }), je = Me("values"), we = A(() => t.parent ? je?.value?.[t.parent] ?? null : null), z = async (g) => {
1884
1770
  if (!t.data) {
1885
- let b = t.options ?? [];
1886
- if (h?.trim()) {
1887
- const V = h.toLowerCase();
1888
- b = b.filter((N) => N.text?.toLowerCase?.().includes(V));
1771
+ let h = t.options ?? [];
1772
+ if (g?.trim()) {
1773
+ const _ = g.toLowerCase();
1774
+ h = h.filter((N) => N.text?.toLowerCase?.().includes(_));
1889
1775
  }
1890
- return b;
1776
+ return h;
1891
1777
  }
1892
1778
  try {
1893
- const b = t.host ?? "", V = t.prefix ?? "api", N = t.api ?? `/${V}/suggest/${t.data}`, se = `${b}${N}`, ne = new URLSearchParams();
1894
- return ne.set("json", "1"), h && ne.set("key", h), xe.value !== void 0 && xe.value !== null && xe.value !== "" && ne.set("parent", String(xe.value)), (await fetch(`${se}?${ne.toString()}`).then((Ie) => Ie.json()))?.data ?? [];
1779
+ const h = t.host ?? "", _ = t.prefix ?? "api", N = t.api ?? `/${_}/suggest/${t.data}`, re = `${h}${N}`, ie = new URLSearchParams();
1780
+ return ie.set("json", "1"), g && ie.set("key", g), we.value !== void 0 && we.value !== null && we.value !== "" && ie.set("parent", String(we.value)), (await fetch(`${re}?${ie.toString()}`).then((Ie) => Ie.json()))?.data ?? [];
1895
1781
  } catch {
1896
1782
  return [];
1897
1783
  }
1898
- }, C = async () => {
1899
- t.data ? _.value = await I($.value) : _.value = t.options ? [...t.options] : [];
1900
- }, E = async (h) => {
1901
- if (h == null) return null;
1902
- const b = _.value?.find((N) => N?.id?.toString() === String(h));
1903
- return b || ((await I(String(h)))?.[0] ?? null);
1904
- }, G = async (h) => {
1905
- const b = new Set(_.value.map((N) => N.id?.toString())), V = h.filter((N) => !b.has(N?.toString()));
1906
- V.length && await V.reduce(async (N, se) => {
1784
+ }, M = async () => {
1785
+ t.data ? $.value = await z(C.value) : $.value = t.options ? [...t.options] : [];
1786
+ }, I = async (g) => {
1787
+ if (g == null) return null;
1788
+ const h = $.value?.find((N) => N?.id?.toString() === String(g));
1789
+ return h || ((await z(String(g)))?.[0] ?? null);
1790
+ }, G = async (g) => {
1791
+ const h = new Set($.value.map((N) => N.id?.toString())), _ = g.filter((N) => !h.has(N?.toString()));
1792
+ _.length && await _.reduce(async (N, re) => {
1907
1793
  await N;
1908
- const ne = await E(se);
1909
- ne && _.value.push(ne);
1794
+ const ie = await I(re);
1795
+ ie && $.value.push(ie);
1910
1796
  }, Promise.resolve());
1911
1797
  }, oe = async () => {
1912
- r.value || (p.value = !0, await C(), await ze(() => {
1913
- he(), z.value?.focus(), W.value.length ? S.value = 0 : S.value = -1;
1798
+ r.value || (p.value = !0, await M(), await ze(() => {
1799
+ ge(), E.value?.focus(), X.value.length ? S.value = 0 : S.value = -1;
1914
1800
  }));
1915
- }, ue = () => {
1801
+ }, de = () => {
1916
1802
  p.value = !1, S.value = -1;
1917
- }, we = async (h) => {
1803
+ }, ke = async (g) => {
1918
1804
  if (r.value) return;
1919
- !p.value ? await oe() : ue();
1805
+ !p.value ? await oe() : de();
1920
1806
  }, y = async () => {
1921
- p.value ? z.value?.focus() : await oe();
1807
+ p.value ? E.value?.focus() : await oe();
1922
1808
  }, k = () => {
1923
- s.value ? (f.value = [], a.value = [], n("change", [])) : (g.value = null, a.value = null, n("change", null)), $.value = "", ze(() => z.value?.focus());
1924
- }, P = (h) => {
1925
- s.value && (f.value = f.value.filter((b) => b?.toString() !== h?.toString()), a.value = [...f.value], n("change", a.value), ze(() => z.value?.focus()));
1926
- }, J = (h) => {
1927
- s.value ? (ee(h.id) || (f.value = [...f.value, h.id], a.value = [...f.value], n("change", a.value)), $.value = "", ze(() => {
1928
- z.value?.focus(), S.value = Math.min(S.value, W.value.length - 1);
1929
- })) : (g.value = h, a.value = h.id, n("change", a.value), $.value = "", ue());
1930
- }, fe = (h) => {
1931
- ee(h.id) || J(h);
1932
- }, _e = (h, b) => {
1933
- if (!h || !b) return;
1934
- const V = h.offsetTop, N = V + h.offsetHeight, se = b.scrollTop, ne = se + b.clientHeight;
1935
- let Le = b.scrollTop;
1936
- V < se ? Le = V - 80 : N > ne && (Le = N - b.clientHeight + 4);
1937
- const Ie = b;
1938
- Ie.scrollTop = Le;
1939
- }, me = (h) => {
1940
- let b = h.parentElement;
1941
- for (; b; ) {
1942
- if (b.classList.contains("ui-dialog__content"))
1943
- return b;
1944
- {
1945
- const V = window.getComputedStyle(b), N = V.overflow + V.overflowY + V.overflowX;
1946
- if (N.includes("auto") || N.includes("scroll") || b === document.body || b === document.documentElement)
1947
- return b;
1948
- b = b.parentElement;
1949
- }
1809
+ s.value ? (f.value = [], a.value = [], n("change", [])) : (b.value = null, a.value = null, n("change", null)), C.value = "", ze(() => E.value?.focus());
1810
+ }, P = (g) => {
1811
+ s.value && (f.value = f.value.filter((h) => h?.toString() !== g?.toString()), a.value = [...f.value], n("change", a.value), ze(() => E.value?.focus()));
1812
+ }, J = (g) => {
1813
+ s.value ? (ee(g.id) || (f.value = [...f.value, g.id], a.value = [...f.value], n("change", a.value)), C.value = "", ze(() => {
1814
+ E.value?.focus(), S.value = Math.min(S.value, X.value.length - 1);
1815
+ })) : (b.value = g, a.value = g.id, n("change", a.value), C.value = "", de());
1816
+ }, ne = (g) => {
1817
+ ee(g.id) || J(g);
1818
+ }, _e = (g, h) => {
1819
+ if (!g || !h) return;
1820
+ const _ = g.offsetTop, N = _ + g.offsetHeight, re = h.scrollTop, ie = re + h.clientHeight;
1821
+ let Se = h.scrollTop;
1822
+ _ < re ? Se = _ - 80 : N > ie && (Se = N - h.clientHeight + 4);
1823
+ const Ie = h;
1824
+ Ie.scrollTop = Se;
1825
+ }, he = (g) => {
1826
+ let h = g.parentElement;
1827
+ for (; h; ) {
1828
+ if (h.classList.contains("ui-dialog__content"))
1829
+ return h;
1830
+ const _ = window.getComputedStyle(h), N = _.overflow + _.overflowY + _.overflowX;
1831
+ if (N.includes("auto") || N.includes("scroll") || h === document.body || h === document.documentElement)
1832
+ return h;
1833
+ h = h.parentElement;
1950
1834
  }
1951
1835
  return document.body;
1952
- }, he = () => {
1836
+ }, ge = () => {
1953
1837
  if (!c.value) return;
1954
- const h = c.value.getBoundingClientRect(), V = me(c.value).getBoundingClientRect(), N = 300, se = 20, ne = 8, Le = h.top - V.top, Ie = h.bottom - V.top, Ye = V.height - Ie - ne - se, et = Le - ne - se;
1955
- let Te = !1;
1956
- if (Ye >= et ? Te = !0 : Te = !1, Te) {
1957
- B.value = "bottom";
1958
- const Re = Math.min(N, Math.max(Ye + se, 50));
1838
+ const g = c.value.getBoundingClientRect(), _ = he(c.value).getBoundingClientRect(), N = 300, re = 20, ie = 8, Se = g.top - _.top, Ie = g.bottom - _.top, lt = _.height - Ie - ie - re, ot = Se - ie - re;
1839
+ let Pe = !1;
1840
+ if (lt >= ot ? Pe = !0 : Pe = !1, Pe) {
1841
+ j.value = "bottom";
1842
+ const He = Math.min(N, Math.max(lt + re, 50));
1959
1843
  m.value = {
1960
- top: `${h.height + ne}px`,
1844
+ top: `${g.height + ie}px`,
1961
1845
  left: "0px",
1962
1846
  right: "0px",
1963
1847
  bottom: "auto",
1964
- maxHeight: `${Re}px`
1848
+ maxHeight: `${He}px`
1965
1849
  };
1966
1850
  } else {
1967
- B.value = "top";
1968
- const Re = Math.min(N, Math.max(et + se, 50));
1851
+ j.value = "top";
1852
+ const He = Math.min(N, Math.max(ot + re, 50));
1969
1853
  m.value = {
1970
1854
  top: "auto",
1971
1855
  left: "0px",
1972
1856
  right: "0px",
1973
- bottom: `${h.height + ne}px`,
1974
- maxHeight: `${Re}px`
1857
+ bottom: `${g.height + ie}px`,
1858
+ maxHeight: `${He}px`
1975
1859
  };
1976
1860
  }
1977
- }, Ce = async (h) => {
1978
- r.value || !p.value && (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), await oe());
1979
- }, Ve = (h) => {
1861
+ }, Ce = async (g) => {
1862
+ r.value || !p.value && (g.key === "ArrowDown" || g.key === "ArrowUp") && (g.preventDefault(), await oe());
1863
+ }, Ve = (g) => {
1980
1864
  if (!p.value) return;
1981
- const { key: b } = h;
1982
- if (b === "ArrowDown")
1983
- h.preventDefault(), S.value + 1 < W.value.length && (S.value += 1, _e(R.value[S.value], v.value));
1984
- else if (b === "ArrowUp")
1985
- h.preventDefault(), S.value > 0 && (S.value -= 1, _e(R.value[S.value], v.value));
1986
- else if (b === "Enter") {
1987
- h.preventDefault();
1988
- const V = W.value[S.value];
1989
- V && J(V), z.value?.blur();
1990
- } else b === "Escape" ? (h.preventDefault(), ue()) : b === "Backspace" ? s.value && $.value === "" && f.value.length && (f.value = f.value.slice(0, -1), a.value = [...f.value], n("change", a.value)) : b === "Home" ? (S.value = 0, _e(R.value[0], v.value)) : b === "End" ? (S.value = W.value.length - 1, _e(R.value[S.value], v.value)) : b === "Tab" && ue();
1991
- }, bt = () => {
1992
- r.value || (x.value = !0);
1993
- }, yt = () => {
1994
- x.value = !1, $.value = "";
1995
- }, Je = (h) => {
1996
- h.key === "Escape" && p.value && ue();
1997
- }, Ke = (h) => {
1998
- u.value && (u.value.contains(h.target) || ue());
1999
- }, Ze = (h) => {
2000
- p.value && v.value && !v.value.contains(h.target) && he();
2001
- }, We = () => {
2002
- p.value && he();
1865
+ const { key: h } = g;
1866
+ if (h === "ArrowDown")
1867
+ g.preventDefault(), S.value + 1 < X.value.length && (S.value += 1, _e(R.value[S.value], v.value));
1868
+ else if (h === "ArrowUp")
1869
+ g.preventDefault(), S.value > 0 && (S.value -= 1, _e(R.value[S.value], v.value));
1870
+ else if (h === "Enter") {
1871
+ g.preventDefault();
1872
+ const _ = X.value[S.value];
1873
+ _ && J(_), E.value?.blur();
1874
+ } else h === "Escape" ? (g.preventDefault(), de()) : h === "Backspace" ? s.value && C.value === "" && f.value.length && (f.value = f.value.slice(0, -1), a.value = [...f.value], n("change", a.value)) : h === "Home" ? (S.value = 0, _e(R.value[0], v.value)) : h === "End" ? (S.value = X.value.length - 1, _e(R.value[S.value], v.value)) : h === "Tab" && de();
1875
+ }, _t = () => {
1876
+ r.value || (w.value = !0);
1877
+ }, $t = () => {
1878
+ w.value = !1, C.value = "";
1879
+ }, Ke = (g) => {
1880
+ g.key === "Escape" && p.value && de();
1881
+ }, Ze = (g) => {
1882
+ u.value && (u.value.contains(g.target) || de());
1883
+ }, We = (g) => {
1884
+ p.value && v.value && !v.value.contains(g.target) && ge();
2003
1885
  }, Qe = () => {
2004
- p.value && he();
1886
+ p.value && ge();
1887
+ }, Xe = () => {
1888
+ p.value && ge();
2005
1889
  };
2006
- te(() => t.options, (h) => {
2007
- h?.length && (_.value = [...h]);
1890
+ te(() => t.options, (g) => {
1891
+ g?.length && ($.value = [...g]);
2008
1892
  }, { immediate: !0 });
2009
- const Xe = async () => {
1893
+ const Ye = async () => {
2010
1894
  if (s.value)
2011
1895
  Array.isArray(a.value) ? f.value = [...a.value] : (f.value = a.value == null ? [] : [a.value], a.value = [...f.value]), !t.options?.length && t.data && await G(f.value);
2012
1896
  else {
2013
1897
  if (Array.isArray(a.value)) {
2014
- const h = a.value[0] ?? null;
2015
- a.value = h ?? null;
1898
+ const g = a.value[0] ?? null;
1899
+ a.value = g ?? null;
2016
1900
  }
2017
- g.value = await E(a.value);
1901
+ b.value = await I(a.value);
2018
1902
  }
2019
1903
  };
2020
1904
  te(a, () => {
2021
- Xe();
2022
- }), be(async () => {
2023
- addEventListener("keydown", Je), addEventListener("scroll", Ze, !0), addEventListener("resize", We), document.addEventListener("click", Ke, !0), c.value && me(c.value).addEventListener("scroll", Qe, !0), t.options?.length ? _.value = [...t.options] : t.data && (_.value = await I("")), await Xe();
2024
- }), He(() => {
2025
- removeEventListener("keydown", Je), removeEventListener("scroll", Ze, !0), removeEventListener("resize", We), document.removeEventListener("click", Ke, !0), c.value && me(c.value).removeEventListener("scroll", Qe, !0);
1905
+ Ye();
1906
+ }), xe(async () => {
1907
+ addEventListener("keydown", Ke), addEventListener("scroll", We, !0), addEventListener("resize", Qe), document.addEventListener("click", Ze, !0), c.value && he(c.value).addEventListener("scroll", Xe, !0), t.options?.length ? $.value = [...t.options] : t.data && ($.value = await z("")), await Ye();
1908
+ }), Ne(() => {
1909
+ removeEventListener("keydown", Ke), removeEventListener("scroll", We, !0), removeEventListener("resize", Qe), document.removeEventListener("click", Ze, !0), c.value && he(c.value).removeEventListener("scroll", Xe, !0);
2026
1910
  });
2027
- async function xt() {
2028
- if (!t.add) return;
2029
- const h = await Pe({ form: t.add.form, mode: "add" });
2030
- h && (await fetch(`/api/table/${t.add.token}`, {
1911
+ const Oe = x(!1), Re = x({}), et = x([]), tt = x(null);
1912
+ async function Ct() {
1913
+ if (!t.add?.token || tt?.value.validate())
1914
+ return;
1915
+ const { id: h } = await fetch(`/api/table/${t.add.token}`, {
2031
1916
  method: "POST",
2032
1917
  headers: { "Content-Type": "application/json" },
2033
- body: JSON.stringify(h)
2034
- }).then((b) => b.json()), !t.options?.length && t.data && (_.value = await I($.value)));
1918
+ body: JSON.stringify(Re.value)
1919
+ }).then((_) => _.json());
1920
+ if (!t.options?.length && t.data) {
1921
+ const { data: _ } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${h}`).then((N) => N.json());
1922
+ b.value = _[0], $.value.push(_[0]), a.value = h;
1923
+ }
1924
+ Oe.value = !1, be({ title: "Success!", message: "Object created." });
1925
+ }
1926
+ async function Vt() {
1927
+ if (!t.add) return null;
1928
+ const g = await fetch(`/api/template/form/${t.add.form}`).then((h) => h.json());
1929
+ return et.value = g.schema, Oe.value = !0, null;
2035
1930
  }
2036
- function wt(h, b = 200) {
2037
- let V;
1931
+ function Mt(g, h = 200) {
1932
+ let _;
2038
1933
  return (...N) => {
2039
- V && clearTimeout(V), V = window.setTimeout(() => h(...N), b);
1934
+ _ && clearTimeout(_), _ = window.setTimeout(() => g(...N), h);
2040
1935
  };
2041
1936
  }
2042
- const kt = wt(async (h) => {
2043
- _.value = await I(h);
1937
+ const Lt = Mt(async (g) => {
1938
+ $.value = await z(g);
2044
1939
  }, 200);
2045
- return te($, (h) => {
2046
- t.data && kt(h.trim());
2047
- }), te(() => t.options, (h) => {
2048
- !t.data && h?.length && (_.value = [...h]);
1940
+ return te(C, (g) => {
1941
+ t.data && Lt(g.trim());
1942
+ }), te(() => t.options, (g) => {
1943
+ !t.data && g?.length && ($.value = [...g]);
2049
1944
  }, { immediate: !0 }), te(() => t.parent ?? t.parentValue, () => {
2050
- t.data && C();
2051
- }), te(xe, async () => {
2052
- t.data && (s.value ? (f.value = [], a.value = [], n("change", [])) : (g.value = null, a.value = null, n("change", null)));
2053
- }), (h, b) => (i(), d("div", {
2054
- class: "flex gap-1 w-full",
2055
- ref_key: "selectRoot",
2056
- ref: u,
2057
- onClick: b[2] || (b[2] = ve(() => {
2058
- }, ["stop"]))
2059
- }, [
1945
+ t.data && M();
1946
+ }), te(we, async () => {
1947
+ t.data && (s.value ? (f.value = [], a.value = [], n("change", [])) : (b.value = null, a.value = null, n("change", null)));
1948
+ }), (g, h) => (i(), d(Y, null, [
1949
+ B(q(ht), {
1950
+ visible: Oe.value,
1951
+ "onUpdate:visible": h[1] || (h[1] = (_) => Oe.value = _),
1952
+ title: "Додати",
1953
+ buttonText: "Додати",
1954
+ onDone: Ct
1955
+ }, {
1956
+ default: Le(() => [
1957
+ B(De, {
1958
+ schema: et.value,
1959
+ modelValue: Re.value,
1960
+ "onUpdate:modelValue": h[0] || (h[0] = (_) => Re.value = _),
1961
+ ref_key: "addForm",
1962
+ ref: tt
1963
+ }, null, 8, ["schema", "modelValue"])
1964
+ ]),
1965
+ _: 1
1966
+ }, 8, ["visible"]),
2060
1967
  l("div", {
2061
- class: M(["relative w-full font-sans", t.customClass])
1968
+ class: "flex gap-1 w-full",
1969
+ ref_key: "selectRoot",
1970
+ ref: u,
1971
+ onClick: h[4] || (h[4] = ve(() => {
1972
+ }, ["stop"]))
2062
1973
  }, [
2063
- b[7] || (b[7] = l("span", {
2064
- id: "react-select-live-region",
2065
- class: "sr-only"
2066
- }, null, -1)),
2067
- b[8] || (b[8] = l("span", {
2068
- "aria-live": "polite",
2069
- "aria-atomic": "false",
2070
- "aria-relevant": "additions text",
2071
- role: "log",
2072
- class: "sr-only"
2073
- }, null, -1)),
2074
1974
  l("div", {
2075
- class: M([
2076
- "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
2077
- "border-gray-300 hover:border-gray-400",
2078
- p.value || x.value ? "border-blue-500 ring-1 ring-blue-500" : "",
2079
- r.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
2080
- ]),
2081
- role: "combobox",
2082
- "aria-expanded": p.value,
2083
- "aria-haspopup": "listbox",
2084
- onKeydown: Ce,
2085
- onClick: y,
2086
- "data-focus": p.value || x.value ? "true" : "false"
1975
+ class: V(["relative w-full font-sans", t.customClass])
2087
1976
  }, [
1977
+ h[9] || (h[9] = l("span", {
1978
+ id: "react-select-live-region",
1979
+ class: "sr-only"
1980
+ }, null, -1)),
1981
+ h[10] || (h[10] = l("span", {
1982
+ "aria-live": "polite",
1983
+ "aria-atomic": "false",
1984
+ "aria-relevant": "additions text",
1985
+ role: "log",
1986
+ class: "sr-only"
1987
+ }, null, -1)),
2088
1988
  l("div", {
2089
- class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
2090
- ref_key: "triggerRef",
2091
- ref: c
1989
+ class: V([
1990
+ "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
1991
+ "border-gray-300 hover:border-gray-400",
1992
+ p.value || w.value ? "border-blue-500 ring-1 ring-blue-500" : "",
1993
+ r.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
1994
+ ]),
1995
+ role: "combobox",
1996
+ "aria-expanded": p.value,
1997
+ "aria-haspopup": "listbox",
1998
+ onKeydown: Ce,
1999
+ onClick: y,
2000
+ "data-focus": p.value || w.value ? "true" : "false"
2092
2001
  }, [
2093
- s.value && f.value.length ? (i(!0), d(Y, { key: 0 }, le(Z.value, (V) => (i(), d("div", {
2094
- class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
2095
- key: V.id
2002
+ l("div", {
2003
+ class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
2004
+ ref_key: "triggerRef",
2005
+ ref: c
2096
2006
  }, [
2097
- l("div", Fa, [
2098
- V?.color ? (i(), d("span", {
2099
- key: 0,
2100
- class: "w-[16px] h-[16px] rounded-md block ml-1.5",
2101
- style: ge({ backgroundColor: V?.color })
2102
- }, null, 4)) : A("", !0),
2007
+ s.value && f.value.length ? (i(!0), d(Y, { key: 0 }, le(Q.value, (_) => (i(), d("div", {
2008
+ class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
2009
+ key: _.id
2010
+ }, [
2011
+ l("div", Da, [
2012
+ _?.color ? (i(), d("span", {
2013
+ key: 0,
2014
+ class: "w-[16px] h-[16px] rounded-md block ml-1.5",
2015
+ style: ye({ backgroundColor: _?.color })
2016
+ }, null, 4)) : D("", !0),
2017
+ l("div", {
2018
+ class: "truncate text-gray-900 overflow-hidden",
2019
+ title: _.text
2020
+ }, T(_.text), 9, Oa)
2021
+ ]),
2103
2022
  l("div", {
2104
- class: "truncate text-gray-900 overflow-hidden",
2105
- title: V.text
2106
- }, T(V.text), 9, Da)
2107
- ]),
2108
- l("div", {
2109
- role: "button",
2110
- class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
2111
- onClick: ve((N) => P(V.id), ["stop"])
2112
- }, b[3] || (b[3] = [
2023
+ role: "button",
2024
+ class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
2025
+ onClick: ve((N) => P(_.id), ["stop"])
2026
+ }, h[5] || (h[5] = [
2027
+ l("svg", {
2028
+ height: "14",
2029
+ width: "14",
2030
+ viewBox: "0 0 20 20",
2031
+ "aria-hidden": "true",
2032
+ focusable: "false",
2033
+ class: "inline-block fill-current stroke-current leading-none stroke-0"
2034
+ }, [
2035
+ l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
2036
+ ], -1)
2037
+ ]), 8, Aa)
2038
+ ]))), 128)) : !s.value && !w.value && b.value?.text && C.value === "" ? (i(), d("div", {
2039
+ key: 1,
2040
+ class: V(["truncate text-gray-900"]),
2041
+ title: b.value.text
2042
+ }, [
2043
+ b.value?.color ? (i(), d("span", {
2044
+ key: 0,
2045
+ class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
2046
+ style: ye({ backgroundColor: b.value?.color })
2047
+ }, null, 4)) : D("", !0),
2048
+ l("span", {
2049
+ class: V({ "pl-5": b.value?.color })
2050
+ }, T(b.value.text), 3)
2051
+ ], 8, Ua)) : D("", !0),
2052
+ O.value ? (i(), d("div", Ta, T(U.value), 1)) : D("", !0),
2053
+ l("div", Ra, [
2054
+ !r.value && g.search ? K((i(), d("input", {
2055
+ key: 0,
2056
+ ref_key: "inputRef",
2057
+ ref: E,
2058
+ class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
2059
+ autocapitalize: "none",
2060
+ autocomplete: "off",
2061
+ autocorrect: "off",
2062
+ spellcheck: "false",
2063
+ type: "text",
2064
+ tabindex: "0",
2065
+ "aria-autocomplete": "list",
2066
+ placeholder: (s.value && f.value.length ? " " : null) || (w.value && !C.value?.length ? b.value?.text : " "),
2067
+ "onUpdate:modelValue": h[2] || (h[2] = (_) => C.value = _),
2068
+ onFocus: _t,
2069
+ onBlur: $t,
2070
+ onKeydown: Ve
2071
+ }, null, 40, Pa)), [
2072
+ [se, C.value]
2073
+ ]) : D("", !0)
2074
+ ])
2075
+ ], 512),
2076
+ l("div", Ha, [
2077
+ ue.value ? (i(), d("button", {
2078
+ key: 0,
2079
+ type: "button",
2080
+ class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2081
+ "aria-hidden": "true",
2082
+ disabled: r.value,
2083
+ onClick: ve(k, ["stop"])
2084
+ }, h[6] || (h[6] = [
2113
2085
  l("svg", {
2114
- height: "14",
2115
- width: "14",
2086
+ height: "20",
2087
+ width: "20",
2116
2088
  viewBox: "0 0 20 20",
2117
- "aria-hidden": "true",
2118
- focusable: "false",
2119
- class: "inline-block fill-current stroke-current leading-none stroke-0"
2089
+ class: "fill-current"
2120
2090
  }, [
2121
2091
  l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
2122
2092
  ], -1)
2123
- ]), 8, Oa)
2124
- ]))), 128)) : !s.value && !x.value && g.value?.text && $.value === "" ? (i(), d("div", {
2125
- key: 1,
2126
- class: M(["truncate text-gray-900"]),
2127
- title: g.value.text
2128
- }, [
2129
- g.value?.color ? (i(), d("span", {
2130
- key: 0,
2131
- class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
2132
- style: ge({ backgroundColor: g.value?.color })
2133
- }, null, 4)) : A("", !0),
2134
- l("span", {
2135
- class: M({ "pl-5": g.value?.color })
2136
- }, T(g.value.text), 3)
2137
- ], 8, Ua)) : A("", !0),
2138
- D.value ? (i(), d("div", Ta, T(U.value), 1)) : A("", !0),
2139
- l("div", Ra, [
2140
- !r.value && h.search ? K((i(), d("input", {
2141
- key: 0,
2142
- ref_key: "inputRef",
2143
- ref: z,
2144
- class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
2145
- autocapitalize: "none",
2146
- autocomplete: "off",
2147
- autocorrect: "off",
2148
- spellcheck: "false",
2149
- type: "text",
2150
- tabindex: "0",
2151
- "aria-autocomplete": "list",
2152
- placeholder: (s.value && f.value.length ? " " : null) || (x.value && !$.value?.length ? g.value?.text : " "),
2153
- "onUpdate:modelValue": b[0] || (b[0] = (V) => $.value = V),
2154
- onFocus: bt,
2155
- onBlur: yt,
2156
- onKeydown: Ve
2157
- }, null, 40, Pa)), [
2158
- [re, $.value]
2159
- ]) : A("", !0)
2093
+ ]), 8, Na)) : D("", !0),
2094
+ h[8] || (h[8] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
2095
+ l("button", {
2096
+ type: "button",
2097
+ class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2098
+ "aria-hidden": "true",
2099
+ disabled: r.value,
2100
+ onClick: h[3] || (h[3] = ve((_) => ke(), ["stop"])),
2101
+ title: p.value ? "Закрити список" : "Відкрити список"
2102
+ }, h[7] || (h[7] = [
2103
+ l("svg", {
2104
+ height: "20",
2105
+ width: "20",
2106
+ viewBox: "0 0 20 20",
2107
+ class: "fill-current"
2108
+ }, [
2109
+ l("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" })
2110
+ ], -1)
2111
+ ]), 8, qa)
2160
2112
  ])
2161
- ], 512),
2162
- l("div", Ha, [
2163
- ie.value ? (i(), d("button", {
2164
- key: 0,
2165
- type: "button",
2166
- class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2167
- "aria-hidden": "true",
2168
- disabled: r.value,
2169
- onClick: ve(k, ["stop"])
2170
- }, b[4] || (b[4] = [
2171
- l("svg", {
2172
- height: "20",
2173
- width: "20",
2174
- viewBox: "0 0 20 20",
2175
- class: "fill-current"
2176
- }, [
2177
- l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
2178
- ], -1)
2179
- ]), 8, Na)) : A("", !0),
2180
- b[6] || (b[6] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
2181
- l("button", {
2182
- type: "button",
2183
- class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2184
- "aria-hidden": "true",
2185
- disabled: r.value,
2186
- onClick: b[1] || (b[1] = ve((V) => we(), ["stop"])),
2187
- title: p.value ? "Закрити список" : "Відкрити список"
2188
- }, b[5] || (b[5] = [
2189
- l("svg", {
2190
- height: "20",
2191
- width: "20",
2192
- viewBox: "0 0 20 20",
2193
- class: "fill-current"
2113
+ ], 42, Fa),
2114
+ p.value ? (i(), d("div", {
2115
+ key: 0,
2116
+ class: V([
2117
+ "absolute z-10 w-full rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]",
2118
+ j.value === "bottom" ? "mt-2" : "mb-2"
2119
+ ]),
2120
+ style: ye(m.value),
2121
+ role: "listbox"
2122
+ }, [
2123
+ l("div", {
2124
+ class: "overflow-y-auto py-1",
2125
+ style: ye({ maxHeight: m.value.maxHeight || "300px" }),
2126
+ ref_key: "listRef",
2127
+ ref: v
2128
+ }, [
2129
+ X.value.length ? (i(!0), d(Y, { key: 0 }, le(X.value, (_, N) => (i(), d("div", {
2130
+ key: _.id,
2131
+ ref_for: !0,
2132
+ ref: (re) => R.value[N] = re,
2133
+ class: V([
2134
+ "flex px-3 py-2 cursor-default select-none text-gray-900 hover:bg-blue-100",
2135
+ S.value === N ? "bg-blue-100" : "",
2136
+ ee(_.id) ? "bg-blue-50" : "bg-white"
2137
+ ]),
2138
+ "aria-disabled": ee(_.id) ? "true" : "false",
2139
+ role: "option",
2140
+ tabindex: "-1",
2141
+ onClick: (re) => ne(_)
2194
2142
  }, [
2195
- l("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" })
2196
- ], -1)
2197
- ]), 8, qa)
2198
- ])
2199
- ], 42, Aa),
2200
- p.value ? (i(), d("div", {
2143
+ _?.color ? (i(), d("span", {
2144
+ key: 0,
2145
+ class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
2146
+ style: ye({ backgroundColor: _?.color })
2147
+ }, null, 4)) : D("", !0),
2148
+ l("div", {
2149
+ class: V([
2150
+ "leading-[19px]",
2151
+ S.value === _.id ? "text-white" : "",
2152
+ // active style like react-select
2153
+ (S.value === N, "")
2154
+ ])
2155
+ }, T(_.text), 3)
2156
+ ], 10, Ga))), 128)) : (i(), d("div", Ja, " No options "))
2157
+ ], 4)
2158
+ ], 6)) : D("", !0)
2159
+ ], 2),
2160
+ t.add ? (i(), d("button", {
2201
2161
  key: 0,
2202
- class: M([
2203
- "absolute z-10 w-full rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]",
2204
- B.value === "bottom" ? "mt-2" : "mb-2"
2205
- ]),
2206
- style: ge(m.value),
2207
- role: "listbox"
2162
+ onClick: Vt,
2163
+ class: "bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",
2164
+ disabled: r.value,
2165
+ type: "button"
2208
2166
  }, [
2209
- l("div", {
2210
- class: "overflow-y-auto py-1",
2211
- style: ge({ maxHeight: m.value.maxHeight || "300px" }),
2212
- ref_key: "listRef",
2213
- ref: v
2214
- }, [
2215
- W.value.length ? (i(!0), d(Y, { key: 0 }, le(W.value, (V, N) => (i(), d("div", {
2216
- key: V.id,
2217
- ref_for: !0,
2218
- ref: (se) => R.value[N] = se,
2219
- class: M([
2220
- "flex px-3 py-2 cursor-default select-none hover:bg-blue-300",
2221
- S.value === N ? "bg-blue-300" : "",
2222
- ee(V.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
2223
- ]),
2224
- "aria-disabled": ee(V.id) ? "true" : "false",
2225
- role: "option",
2226
- tabindex: "-1",
2227
- onClick: (se) => fe(V)
2228
- }, [
2229
- V?.color ? (i(), d("span", {
2230
- key: 0,
2231
- class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
2232
- style: ge({ backgroundColor: V?.color })
2233
- }, null, 4)) : A("", !0),
2234
- l("div", {
2235
- class: M([
2236
- "leading-[19px]",
2237
- S.value === V.id ? "text-white" : "",
2238
- // active style like react-select
2239
- (S.value === N, "")
2240
- ])
2241
- }, T(V.text), 3)
2242
- ], 10, Ga))), 128)) : (i(), d("div", Ja, " No options "))
2243
- ], 4)
2244
- ], 6)) : A("", !0)
2245
- ], 2),
2246
- t.add ? (i(), d("button", {
2247
- key: 0,
2248
- onClick: xt,
2249
- class: "bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",
2250
- disabled: r.value,
2251
- type: "button"
2252
- }, [
2253
- j(Ae, {
2254
- width: "16",
2255
- height: "16"
2256
- }),
2257
- b[9] || (b[9] = l("span", null, "Додати", -1))
2258
- ], 8, Ka)) : A("", !0)
2259
- ], 512));
2167
+ B(Fe, {
2168
+ width: "16",
2169
+ height: "16"
2170
+ }),
2171
+ h[11] || (h[11] = l("span", null, "Додати", -1))
2172
+ ], 8, Ka)) : D("", !0)
2173
+ ], 512)
2174
+ ], 64));
2260
2175
  }
2261
2176
  }), Wa = ["placeholder", "disabled"], Qa = /* @__PURE__ */ F({
2262
2177
  __name: "vs-input-textarea",
2263
- props: /* @__PURE__ */ Q({
2178
+ props: /* @__PURE__ */ Z({
2264
2179
  style: { default: () => ({}) },
2265
2180
  customClass: { default: "" },
2266
2181
  disabled: { type: Boolean, default: !1 },
@@ -2274,18 +2189,18 @@ const Go = /* @__PURE__ */ H(Ho, [["render", qo]]), Jo = { class: "flex flex-col
2274
2189
  }),
2275
2190
  emits: ["update:modelValue"],
2276
2191
  setup(o) {
2277
- const e = o, { inputClass: t } = ye(e.style), n = X(o, "modelValue");
2192
+ const e = o, { inputClass: t } = me(e.style), n = W(o, "modelValue");
2278
2193
  return (s, r) => K((i(), d("textarea", {
2279
2194
  "onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
2280
2195
  placeholder: s.placeholder,
2281
2196
  disabled: s.disabled,
2282
2197
  row: "2",
2283
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [q(t)]]),
2198
+ class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [q(t)]]),
2284
2199
  style: {
2285
2200
  border: "1px solid #CFD9E0"
2286
2201
  }
2287
2202
  }, null, 10, Wa)), [
2288
- [re, n.value]
2203
+ [se, n.value]
2289
2204
  ]);
2290
2205
  }
2291
2206
  }), Xa = {}, Ya = {
@@ -2382,17 +2297,17 @@ const fs = /* @__PURE__ */ H(ds, [["render", ps]]), vs = {}, ms = {
2382
2297
  };
2383
2298
  function hs(o, e) {
2384
2299
  return i(), d("svg", ms, e[0] || (e[0] = [
2385
- de('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
2300
+ ce('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
2386
2301
  ]));
2387
2302
  }
2388
- const rt = /* @__PURE__ */ H(vs, [["render", hs]]), gs = {}, bs = {
2303
+ const dt = /* @__PURE__ */ H(vs, [["render", hs]]), gs = {}, bs = {
2389
2304
  viewBox: "0 0 178 90",
2390
2305
  fill: "none",
2391
2306
  xmlns: "http://www.w3.org/2000/svg"
2392
2307
  };
2393
2308
  function ys(o, e) {
2394
2309
  return i(), d("svg", bs, e[0] || (e[0] = [
2395
- de('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
2310
+ ce('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
2396
2311
  ]));
2397
2312
  }
2398
2313
  const xs = /* @__PURE__ */ H(gs, [["render", ys]]), ws = {}, ks = {
@@ -2409,13 +2324,13 @@ function _s(o, e) {
2409
2324
  l("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }, null, -1)
2410
2325
  ]));
2411
2326
  }
2412
- const $s = /* @__PURE__ */ H(ws, [["render", _s]]), Cs = { class: "vs-datatable border rounded-xl w-full flex-grow" }, Vs = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, Ms = { class: "relative w-full" }, Ls = { class: "table-wrapper flex gap-2" }, Ss = { class: "vs-popover inline-block text-slate-700" }, Bs = { class: "text-center" }, js = { class: "" }, Is = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, zs = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, Es = { class: "text-sm items-center text-gray-800 flex gap-1" }, As = { class: "w-full overflow-x-auto" }, Fs = { class: "w-full table-auto caption-bottom text-sm" }, Ds = { class: "[&_tr]:border-b" }, Os = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, Us = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, Ts = {
2327
+ const $s = /* @__PURE__ */ H(ws, [["render", _s]]), Cs = { class: "vs-datatable border rounded-xl w-full flex-grow" }, Vs = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, Ms = { class: "relative w-full" }, Ls = { class: "table-wrapper flex gap-2" }, Ss = { class: "vs-popover inline-block text-slate-700" }, Bs = { class: "text-center" }, js = { class: "" }, Is = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, zs = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, Es = { class: "text-sm items-center text-gray-800 flex gap-1" }, Fs = { class: "w-full overflow-x-auto" }, Ds = { class: "w-full table-auto caption-bottom text-sm" }, Os = { class: "[&_tr]:border-b" }, As = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, Us = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, Ts = {
2413
2328
  key: 0,
2414
2329
  colspan: "100%",
2415
2330
  class: "text-center"
2416
2331
  }, Rs = { class: "w-full" }, Ps = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, Hs = ["onDragstart", "onDragover", "onDrop"], Ns = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, qs = { class: "flex items-center justify-center" }, Gs = { class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors" }, Js = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, Ks = { class: "flex items-center justify-center gap-2" }, Zs = ["onClick"], Ws = ["onClick"], Qs = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, Xs = /* @__PURE__ */ F({
2417
2332
  __name: "vs-input-datatable",
2418
- props: /* @__PURE__ */ Q({
2333
+ props: /* @__PURE__ */ Z({
2419
2334
  colModel: {},
2420
2335
  style: {},
2421
2336
  customClass: {},
@@ -2430,101 +2345,102 @@ const $s = /* @__PURE__ */ H(ws, [["render", _s]]), Cs = { class: "vs-datatable
2430
2345
  }),
2431
2346
  emits: ["update:modelValue"],
2432
2347
  setup(o) {
2433
- const e = o, t = X(o, "modelValue"), n = w({}), s = w(""), r = O(() => {
2348
+ const e = o, t = W(o, "modelValue"), n = x({}), s = x(""), r = A(() => {
2434
2349
  if (!s.value) return t.value ?? [];
2435
- const I = s.value.toLowerCase();
2436
- return t.value.filter((C) => e.colModel?.some((E) => {
2437
- const G = C[E.key];
2438
- return G ? Array.isArray(G) ? G.join(", ").toLowerCase().includes(I) : String(G).toLowerCase().includes(I) : !1;
2350
+ const z = s.value.toLowerCase();
2351
+ return t.value.filter((M) => e.colModel?.some((I) => {
2352
+ const G = M[I.key];
2353
+ return G ? Array.isArray(G) ? G.join(", ").toLowerCase().includes(z) : String(G).toLowerCase().includes(z) : !1;
2439
2354
  }));
2440
- }), a = w(null), u = w(null), c = w(!1), v = w(null), p = w({ top: 0, left: 0 }), x = (I) => {
2441
- a.value = I;
2442
- }, g = (I) => {
2443
- u.value = I;
2444
- }, _ = (I) => {
2445
- if (a.value === null || a.value === I) {
2355
+ }), a = x(null), u = x(null), c = x(!1), v = x(null), p = x({ top: 0, left: 0 }), w = (z) => {
2356
+ a.value = z;
2357
+ }, b = (z) => {
2358
+ u.value = z;
2359
+ }, $ = (z) => {
2360
+ if (a.value === null || a.value === z) {
2446
2361
  a.value = null, u.value = null;
2447
2362
  return;
2448
2363
  }
2449
- const C = [...t.value], [E] = C.splice(a.value, 1);
2450
- C.splice(I, 0, E), t.value = C, a.value = null, u.value = null;
2451
- }, S = (I) => {
2452
- const E = I.currentTarget.getBoundingClientRect();
2453
- p.value = { top: E.bottom + window.scrollY, left: E.left + window.scrollX }, c.value = !c.value;
2364
+ const M = [...t.value], [I] = M.splice(a.value, 1);
2365
+ M.splice(z, 0, I), t.value = M, a.value = null, u.value = null;
2366
+ }, S = (z) => {
2367
+ const I = z.currentTarget.getBoundingClientRect();
2368
+ p.value = { top: I.bottom + window.scrollY, left: I.left + window.scrollX }, c.value = !c.value;
2454
2369
  }, R = () => {
2455
2370
  v.value && v.value.click();
2456
- }, $ = (I) => {
2457
- const E = I.target.files?.[0];
2458
- if (!E) return;
2371
+ }, C = (z) => {
2372
+ const I = z.target.files?.[0];
2373
+ if (!I) return;
2459
2374
  const G = new FileReader();
2460
2375
  G.onload = (oe) => {
2461
2376
  try {
2462
- const ue = oe.target?.result;
2463
- if (typeof ue == "string") {
2464
- const we = JSON.parse(ue);
2465
- Array.isArray(we) && t.value.push(...we);
2377
+ const de = oe.target?.result;
2378
+ if (typeof de == "string") {
2379
+ const ke = JSON.parse(de);
2380
+ Array.isArray(ke) && t.value.push(...ke);
2466
2381
  }
2467
- } catch (ue) {
2468
- console.error("Error parsing file:", ue);
2382
+ } catch (de) {
2383
+ console.error("Error parsing file:", de);
2469
2384
  }
2470
- }, G.readAsText(E);
2471
- }, z = () => {
2472
- const I = JSON.stringify(t.value, null, 2), C = new Blob([I], { type: "application/json" }), E = URL.createObjectURL(C), G = document.createElement("a");
2473
- G.href = E, G.download = "data.json", G.click(), URL.revokeObjectURL(E);
2385
+ }, G.readAsText(I);
2386
+ }, E = () => {
2387
+ const z = JSON.stringify(t.value, null, 2), M = new Blob([z], { type: "application/json" }), I = URL.createObjectURL(M), G = document.createElement("a");
2388
+ G.href = I, G.download = "data.json", G.click(), URL.revokeObjectURL(I);
2474
2389
  };
2475
- be(async () => {
2476
- const I = e.colModel?.filter((C) => C.data);
2477
- I?.length && Promise.all(I.map(async (C) => {
2478
- const G = await (await fetch(`/api/suggest/${C.data}`)).json();
2479
- n.value[C.key] = G.data;
2390
+ xe(async () => {
2391
+ const z = e.colModel?.filter((M) => M.data);
2392
+ z?.length && Promise.all(z.map(async (M) => {
2393
+ const G = await (await fetch(`/api/suggest/${M.data}`)).json();
2394
+ n.value[M.key] = G.data;
2480
2395
  }));
2481
2396
  });
2482
- const B = w(""), m = w(!1);
2483
- let f = "edit", Z = 0;
2484
- const U = w({}), D = w({});
2485
- async function ie() {
2486
- B.value = "Додати", m.value = !0, f = "add", U.value = {};
2397
+ const j = x(""), m = x(!1);
2398
+ let f = "edit", Q = 0;
2399
+ const U = x({}), O = x({});
2400
+ async function ue() {
2401
+ j.value = "Додати", m.value = !0, f = "add", U.value = {};
2487
2402
  }
2488
- function ee(I, C) {
2489
- return n.value[C.key] && I[C.key] ? n.value[C.key].find((E) => E.id.toString() === I[C.key].toString())?.text ?? I[C.key] : I[C.key] || "-";
2403
+ function ee(z, M) {
2404
+ const I = M.key || M.name;
2405
+ return n.value[I] && z[I] ? n.value[I].find((G) => G.id.toString() === z[I].toString())?.text ?? z[I] : z[I] || "-";
2490
2406
  }
2491
- async function W(I, C) {
2492
- B.value = "Редагувати", m.value = !0, f = "edit", Z = C, U.value = { ...I };
2407
+ async function X(z, M) {
2408
+ j.value = "Редагувати", m.value = !0, f = "edit", Q = M, U.value = { ...z };
2493
2409
  }
2494
2410
  function je() {
2495
- const I = D.value.validate();
2496
- if (I) {
2497
- ke({ type: "warning", title: "Помилка валідації", message: Object.entries(I).map(([C, E]) => `${C}: ${E}`).join(`
2411
+ const z = O.value.validate();
2412
+ if (z) {
2413
+ be({ type: "warning", title: "Помилка валідації", message: Object.entries(z).map(([M, I]) => `${M}: ${I}`).join(`
2498
2414
  `) });
2499
2415
  return;
2500
2416
  }
2501
- f === "add" ? Array.isArray(t.value) ? t.value = [...t.value, U.value] : t.value = [U.value] : t.value = t.value.map((C, E) => E === Z ? U.value : C), m.value = !1;
2417
+ f === "add" ? Array.isArray(t.value) ? t.value = [...t.value, U.value] : t.value = [U.value] : t.value = t.value.map((M, I) => I === Q ? U.value : M), m.value = !1;
2502
2418
  }
2503
- function xe(I) {
2504
- t.value = t.value.filter((C, E) => E !== I);
2419
+ function we(z) {
2420
+ t.value = t.value.filter((M, I) => I !== z);
2505
2421
  }
2506
- return (I, C) => (i(), d("div", Cs, [
2422
+ return (z, M) => (i(), d("div", Cs, [
2507
2423
  l("div", Vs, [
2508
2424
  l("div", Ms, [
2509
- j(ts, {
2425
+ B(ts, {
2510
2426
  width: "14",
2511
2427
  height: "14",
2512
2428
  class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
2513
2429
  }),
2514
2430
  K(l("input", {
2515
2431
  type: "text",
2516
- "onUpdate:modelValue": C[0] || (C[0] = (E) => s.value = E),
2432
+ "onUpdate:modelValue": M[0] || (M[0] = (I) => s.value = I),
2517
2433
  placeholder: "Пошук",
2518
2434
  class: "py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"
2519
2435
  }, null, 512), [
2520
- [re, s.value]
2436
+ [se, s.value]
2521
2437
  ])
2522
2438
  ]),
2523
2439
  l("div", Ls, [
2524
2440
  l("input", {
2525
2441
  ref_key: "fileInput",
2526
2442
  ref: v,
2527
- onChange: $,
2443
+ onChange: C,
2528
2444
  class: "hidden",
2529
2445
  accept: ".json",
2530
2446
  type: "file"
@@ -2536,7 +2452,7 @@ const $s = /* @__PURE__ */ H(ws, [["render", _s]]), Cs = { class: "vs-datatable
2536
2452
  onClick: S,
2537
2453
  class: "bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
2538
2454
  }, [
2539
- j(ss, {
2455
+ B(ss, {
2540
2456
  height: "16",
2541
2457
  width: "16"
2542
2458
  })
@@ -2545,11 +2461,11 @@ const $s = /* @__PURE__ */ H(ws, [["render", _s]]), Cs = { class: "vs-datatable
2545
2461
  ])
2546
2462
  ])
2547
2463
  ]),
2548
- (i(), ae(Vt, { to: "body" }, [
2464
+ (i(), ae(It, { to: "body" }, [
2549
2465
  c.value ? (i(), d("div", {
2550
2466
  key: 0,
2551
2467
  class: "text-slate-700 vsTailwind vs-popover__content bottom",
2552
- style: ge([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: p.value.top + "px", left: p.value.left + "px" }])
2468
+ style: ye([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: p.value.top + "px", left: p.value.left + "px" }])
2553
2469
  }, [
2554
2470
  l("div", Is, [
2555
2471
  l("div", zs, [
@@ -2557,113 +2473,113 @@ const $s = /* @__PURE__ */ H(ws, [["render", _s]]), Cs = { class: "vs-datatable
2557
2473
  onClick: R,
2558
2474
  class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2559
2475
  }, [
2560
- j(us, {
2476
+ B(us, {
2561
2477
  class: "text-black",
2562
2478
  width: "14",
2563
2479
  height: "14"
2564
2480
  }),
2565
- C[4] || (C[4] = pe(" Імпортувати ", -1))
2481
+ M[4] || (M[4] = fe(" Імпортувати ", -1))
2566
2482
  ]),
2567
2483
  l("button", {
2568
- onClick: z,
2484
+ onClick: E,
2569
2485
  class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2570
2486
  }, [
2571
2487
  l("span", Es, [
2572
- j(fs, {
2488
+ B(fs, {
2573
2489
  class: "text-black",
2574
2490
  width: "14",
2575
2491
  height: "14"
2576
2492
  }),
2577
- C[5] || (C[5] = pe(" Експортувати ", -1))
2493
+ M[5] || (M[5] = fe(" Експортувати ", -1))
2578
2494
  ])
2579
2495
  ])
2580
2496
  ])
2581
2497
  ])
2582
- ], 4)) : A("", !0)
2498
+ ], 4)) : D("", !0)
2583
2499
  ])),
2584
2500
  l("button", {
2585
- onClick: ie,
2501
+ onClick: ue,
2586
2502
  class: "text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
2587
2503
  }, [
2588
- j(Ae),
2589
- C[6] || (C[6] = pe(" Додати ", -1))
2504
+ B(Fe),
2505
+ M[6] || (M[6] = fe(" Додати ", -1))
2590
2506
  ])
2591
2507
  ]),
2592
- l("div", As, [
2593
- l("table", Fs, [
2594
- l("thead", Ds, [
2595
- l("tr", Os, [
2508
+ l("div", Fs, [
2509
+ l("table", Ds, [
2510
+ l("thead", Os, [
2511
+ l("tr", As, [
2596
2512
  l("th", Us, [
2597
- j(rt, {
2513
+ B(dt, {
2598
2514
  width: "24",
2599
2515
  height: "24",
2600
2516
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2601
2517
  })
2602
2518
  ]),
2603
- (i(!0), d(Y, null, le(I.colModel, (E) => (i(), d("th", {
2604
- key: E.key,
2519
+ (i(!0), d(Y, null, le(z.colModel, (I) => (i(), d("th", {
2520
+ key: I.key,
2605
2521
  class: "h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"
2606
- }, T(E.ua || E.label), 1))), 128)),
2607
- C[7] || (C[7] = l("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
2522
+ }, T(I.ua || I.label), 1))), 128)),
2523
+ M[7] || (M[7] = l("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
2608
2524
  ])
2609
2525
  ]),
2610
2526
  l("tbody", {
2611
- class: M({ "[&_tr:last-child]:border-0": !u.value })
2527
+ class: V({ "[&_tr:last-child]:border-0": !u.value })
2612
2528
  }, [
2613
2529
  r.value.length === 0 ? (i(), d("td", Ts, [
2614
2530
  l("div", Rs, [
2615
2531
  l("div", Ps, [
2616
- j(xs, { class: "w-48 mx-auto" }),
2617
- C[8] || (C[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2532
+ B(xs, { class: "w-48 mx-auto" }),
2533
+ M[8] || (M[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2618
2534
  l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
2619
2535
  l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
2620
2536
  ], -1))
2621
2537
  ])
2622
2538
  ])
2623
- ])) : A("", !0),
2624
- (i(!0), d(Y, null, le(r.value, (E, G) => (i(), d("tr", {
2625
- key: E.id,
2626
- class: M(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2539
+ ])) : D("", !0),
2540
+ (i(!0), d(Y, null, le(r.value, (I, G) => (i(), d("tr", {
2541
+ key: I.id,
2542
+ class: V(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2627
2543
  "opacity-50": a.value === G,
2628
2544
  "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value === G
2629
2545
  }]),
2630
2546
  draggable: "true",
2631
- onDragstart: (oe) => x(G),
2632
- onDragover: ve((oe) => g(G), ["prevent"]),
2633
- onDrop: (oe) => _(G)
2547
+ onDragstart: (oe) => w(G),
2548
+ onDragover: ve((oe) => b(G), ["prevent"]),
2549
+ onDrop: (oe) => $(G)
2634
2550
  }, [
2635
2551
  l("td", Ns, [
2636
2552
  l("div", qs, [
2637
- j(rt, {
2553
+ B(dt, {
2638
2554
  width: "24",
2639
2555
  height: "24",
2640
2556
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2641
2557
  })
2642
2558
  ])
2643
2559
  ]),
2644
- (i(!0), d(Y, null, le(I.colModel, (oe) => (i(), d("td", {
2560
+ (i(!0), d(Y, null, le(z.colModel, (oe) => (i(), d("td", {
2645
2561
  key: oe.key,
2646
2562
  class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
2647
2563
  }, [
2648
- l("div", Gs, T(ee(E, oe)), 1)
2564
+ l("div", Gs, T(ee(I, oe)), 1)
2649
2565
  ]))), 128)),
2650
2566
  l("td", Js, [
2651
2567
  l("div", Ks, [
2652
2568
  l("button", {
2653
- onClick: (oe) => W(E, G),
2569
+ onClick: (oe) => X(I, G),
2654
2570
  class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
2655
2571
  }, [
2656
- j($s, {
2572
+ B($s, {
2657
2573
  width: "24",
2658
2574
  height: "24",
2659
2575
  class: "w-3 h-3"
2660
2576
  })
2661
2577
  ], 8, Zs),
2662
2578
  l("button", {
2663
- onClick: (oe) => xe(G),
2579
+ onClick: (oe) => we(G),
2664
2580
  class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
2665
2581
  }, [
2666
- j(Ue, {
2582
+ B(Te, {
2667
2583
  width: "24",
2668
2584
  height: "24",
2669
2585
  class: "w-3 h-3"
@@ -2675,23 +2591,23 @@ const $s = /* @__PURE__ */ H(ws, [["render", _s]]), Cs = { class: "vs-datatable
2675
2591
  ], 2)
2676
2592
  ])
2677
2593
  ]),
2678
- j(q(St), {
2594
+ B(q(ht), {
2679
2595
  visible: m.value,
2680
- title: B.value,
2596
+ title: j.value,
2681
2597
  size: "lg"
2682
2598
  }, {
2683
- default: Be(() => [
2684
- j(Oe, {
2599
+ default: Le(() => [
2600
+ B(De, {
2685
2601
  schema: e.colModel,
2686
2602
  values: U.value,
2687
- "onUpdate:values": C[1] || (C[1] = (E) => U.value = E),
2688
- form: D.value,
2689
- "onUpdate:form": C[2] || (C[2] = (E) => D.value = E)
2603
+ "onUpdate:values": M[1] || (M[1] = (I) => U.value = I),
2604
+ form: O.value,
2605
+ "onUpdate:form": M[2] || (M[2] = (I) => O.value = I)
2690
2606
  }, null, 8, ["schema", "values", "form"]),
2691
2607
  l("div", Qs, [
2692
2608
  l("button", {
2693
2609
  type: "button",
2694
- onClick: C[3] || (C[3] = (E) => m.value = !1),
2610
+ onClick: M[3] || (M[3] = (I) => m.value = !1),
2695
2611
  class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
2696
2612
  }, " Скасувати "),
2697
2613
  l("button", {
@@ -2882,7 +2798,7 @@ const un = /* @__PURE__ */ H(sn, [["render", rn]]), dn = {}, cn = {
2882
2798
  };
2883
2799
  function pn(o, e) {
2884
2800
  return i(), d("svg", cn, e[0] || (e[0] = [
2885
- de('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
2801
+ ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
2886
2802
  ]));
2887
2803
  }
2888
2804
  const fn = /* @__PURE__ */ H(dn, [["render", pn]]), vn = {}, mn = {
@@ -2897,7 +2813,7 @@ const fn = /* @__PURE__ */ H(dn, [["render", pn]]), vn = {}, mn = {
2897
2813
  };
2898
2814
  function hn(o, e) {
2899
2815
  return i(), d("svg", mn, e[0] || (e[0] = [
2900
- de('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
2816
+ ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
2901
2817
  ]));
2902
2818
  }
2903
2819
  const gn = /* @__PURE__ */ H(vn, [["render", hn]]), bn = {}, yn = {
@@ -2952,10 +2868,10 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
2952
2868
  "stroke-width": "2",
2953
2869
  "stroke-linecap": "round",
2954
2870
  "stroke-linejoin": "round"
2955
- }, An = { class: "relative w-full" }, Fn = { class: "vs-form-text relative bg-white rounded-lg" }, Dn = {
2871
+ }, Fn = { class: "relative w-full" }, Dn = { class: "vs-form-text relative bg-white rounded-lg" }, On = {
2956
2872
  key: 1,
2957
2873
  class: "absolute left-0 right-0 top-full z-[3200] bg-white border border-gray-200 rounded-b-lg shadow-lg max-h-72 overflow-auto"
2958
- }, On = { key: 0 }, Un = ["onClick"], Tn = {
2874
+ }, An = { key: 0 }, Un = ["onClick"], Tn = {
2959
2875
  key: 1,
2960
2876
  class: "px-3 py-2 text-xs text-gray-500"
2961
2877
  }, Rn = {
@@ -2968,44 +2884,44 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
2968
2884
  },
2969
2885
  emits: ["goToCoordinates"],
2970
2886
  setup(o, { emit: e }) {
2971
- const t = e, n = w(!1), s = w("coordinates"), r = w(""), a = w([]), u = w(!1), c = w(!1);
2887
+ const t = e, n = x(!1), s = x("coordinates"), r = x(""), a = x([]), u = x(!1), c = x(!1);
2972
2888
  let v;
2973
2889
  const p = [
2974
2890
  { value: "coordinates", label: "Пошук по кординатам" },
2975
2891
  { value: "atu", label: "АТУ" },
2976
2892
  { value: "address", label: "Адресса" },
2977
2893
  { value: "search_here", label: "Пошук HERE" }
2978
- ], x = O(() => p.find((B) => B.value === s.value)?.label ?? "АТУ");
2979
- function g(B) {
2980
- s.value = B.value, n.value = !1, r.value = "", r.value && R();
2894
+ ], w = A(() => p.find((j) => j.value === s.value)?.label ?? "АТУ");
2895
+ function b(j) {
2896
+ s.value = j.value, n.value = !1, r.value = "", r.value && R();
2981
2897
  }
2982
- function _(B) {
2983
- B.target.closest(".map-search__input") || (n.value = !1);
2898
+ function $(j) {
2899
+ j.target.closest(".map-search__input") || (n.value = !1);
2984
2900
  }
2985
- be(() => document.addEventListener("click", _)), He(() => document.removeEventListener("click", _));
2986
- async function S(B) {
2901
+ xe(() => document.addEventListener("click", $)), Ne(() => document.removeEventListener("click", $));
2902
+ async function S(j) {
2987
2903
  let m;
2988
2904
  s.value === "atu" ? m = "/api/suggest/atu.nsdi.ato_level" : s.value === "address" ? m = "/api/suggest/map.address_id" : s.value === "search_here" && (m = "/api/gis-url-proxy");
2989
2905
  const f = new URL(m || "");
2990
- return s.value === "search_here" ? f.searchParams.set("searchtext", B) : (s.value === "atu" || s.value === "address") && f.searchParams.set("key", B), f.searchParams.set("limit", "20"), f.searchParams.set("q", B), (await fetch(f.toString())).json();
2906
+ return s.value === "search_here" ? f.searchParams.set("searchtext", j) : (s.value === "atu" || s.value === "address") && f.searchParams.set("key", j), f.searchParams.set("limit", "20"), f.searchParams.set("q", j), (await fetch(f.toString())).json();
2991
2907
  }
2992
2908
  function R() {
2993
2909
  if (u.value = !0, c.value = !0, s.value === "coordinates") {
2994
- const B = r.value.trim().split(",");
2995
- if (B.length === 2) {
2996
- const m = parseFloat(B[0]), f = parseFloat(B[1]);
2910
+ const j = r.value.trim().split(",");
2911
+ if (j.length === 2) {
2912
+ const m = parseFloat(j[0]), f = parseFloat(j[1]);
2997
2913
  !Number.isNaN(m) && !Number.isNaN(f) && t("goToCoordinates", [m, f]);
2998
2914
  }
2999
2915
  return;
3000
2916
  }
3001
2917
  v && window.clearTimeout(v), v = window.setTimeout(async () => {
3002
- const B = r.value.trim();
3003
- if (!B) {
2918
+ const j = r.value.trim();
2919
+ if (!j) {
3004
2920
  a.value = [], c.value = !1;
3005
2921
  return;
3006
2922
  }
3007
2923
  try {
3008
- const m = await S(B);
2924
+ const m = await S(j);
3009
2925
  a.value = Array.isArray(m.features) ? m.features : [];
3010
2926
  } catch {
3011
2927
  a.value = [];
@@ -3014,13 +2930,13 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3014
2930
  }
3015
2931
  }, 300);
3016
2932
  }
3017
- function $() {
2933
+ function C() {
3018
2934
  r.value = "", a.value = [], u.value = !1, c.value = !1;
3019
2935
  }
3020
- function z(B) {
3021
- t("goToCoordinates", B), u.value = !1, c.value = !1, a.value = [];
2936
+ function E(j) {
2937
+ t("goToCoordinates", j), u.value = !1, c.value = !1, a.value = [];
3022
2938
  }
3023
- return (B, m) => (i(), d("div", kn, [
2939
+ return (j, m) => (i(), d("div", kn, [
3024
2940
  l("div", _n, [
3025
2941
  l("div", $n, [
3026
2942
  l("div", Cn, [
@@ -3030,7 +2946,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3030
2946
  class: "h-[40px] relative px-4 pe-9 flex text-nowrap w-full cursor-pointer bg-white border border-solid border-stone-200 rounded-lg text-start text-sm text-stone-800 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200"
3031
2947
  }, [
3032
2948
  l("div", Vn, [
3033
- l("span", Mn, T(x.value), 1)
2949
+ l("span", Mn, T(w.value), 1)
3034
2950
  ]),
3035
2951
  m[3] || (m[3] = l("svg", {
3036
2952
  class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
@@ -3051,7 +2967,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3051
2967
  l("div", Sn, [
3052
2968
  l("div", Bn, [
3053
2969
  (i(), d(Y, null, le(p, (f) => l("div", {
3054
- onClick: (Z) => g(f),
2970
+ onClick: (Q) => b(f),
3055
2971
  key: f.value,
3056
2972
  class: "form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"
3057
2973
  }, [
@@ -3061,15 +2977,15 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3061
2977
  ]),
3062
2978
  f.value === s.value ? (i(), d("svg", En, m[4] || (m[4] = [
3063
2979
  l("polyline", { points: "20 6 9 17 4 12" }, null, -1)
3064
- ]))) : A("", !0)
2980
+ ]))) : D("", !0)
3065
2981
  ])
3066
2982
  ], 8, jn)), 64))
3067
2983
  ])
3068
2984
  ])
3069
- ])) : A("", !0)
2985
+ ])) : D("", !0)
3070
2986
  ]),
3071
- l("div", An, [
3072
- l("div", Fn, [
2987
+ l("div", Fn, [
2988
+ l("div", Dn, [
3073
2989
  m[6] || (m[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
3074
2990
  l("svg", {
3075
2991
  width: "16",
@@ -3101,11 +3017,11 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3101
3017
  placeholder: "lat, lng ex. 50, 30",
3102
3018
  class: "bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
3103
3019
  }, null, 544), [
3104
- [re, r.value]
3020
+ [se, r.value]
3105
3021
  ]),
3106
3022
  r.value ? (i(), d("button", {
3107
3023
  key: 0,
3108
- onClick: $,
3024
+ onClick: C,
3109
3025
  class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
3110
3026
  "aria-label": "Очистити",
3111
3027
  type: "button"
@@ -3124,16 +3040,16 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3124
3040
  "stroke-linejoin": "round"
3125
3041
  })
3126
3042
  ], -1)
3127
- ]))) : A("", !0),
3128
- u.value && s.value !== "coordinates" ? (i(), d("div", Dn, [
3129
- a.value.length ? (i(), d("ul", On, [
3043
+ ]))) : D("", !0),
3044
+ u.value && s.value !== "coordinates" ? (i(), d("div", On, [
3045
+ a.value.length ? (i(), d("ul", An, [
3130
3046
  (i(!0), d(Y, null, le(a.value, (f) => (i(), d("li", {
3131
3047
  key: f.properties.place_id,
3132
- onClick: (Z) => z(f),
3048
+ onClick: (Q) => E(f),
3133
3049
  class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
3134
3050
  }, T(f.properties.display_name), 9, Un))), 128))
3135
3051
  ])) : c.value ? (i(), d("div", Tn, "Шукаю…")) : (i(), d("div", Rn, "Нічого не знайдено"))
3136
- ])) : A("", !0)
3052
+ ])) : D("", !0)
3137
3053
  ])
3138
3054
  ])
3139
3055
  ])
@@ -3147,7 +3063,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3147
3063
  },
3148
3064
  emits: ["onLayerChange"],
3149
3065
  setup(o, { emit: e }) {
3150
- const n = w(Object.keys(o.basemaps)[0]), s = e;
3066
+ const n = x(Object.keys(o.basemaps)[0]), s = e;
3151
3067
  function r(a) {
3152
3068
  s("onLayerChange", a), n.value = a;
3153
3069
  }
@@ -3155,7 +3071,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3155
3071
  l("div", Nn, [
3156
3072
  (i(!0), d(Y, null, le(a.basemaps, (c, v) => (i(), d("div", {
3157
3073
  key: v,
3158
- class: M(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === v }]),
3074
+ class: V(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === v }]),
3159
3075
  onClick: (p) => r(v),
3160
3076
  title: c.name || v,
3161
3077
  role: "button",
@@ -3193,26 +3109,26 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3193
3109
  },
3194
3110
  emits: ["update:modelValue"],
3195
3111
  setup(o, { emit: e }) {
3196
- const t = Mt(), n = o, s = e, r = w(null);
3112
+ const t = zt(), n = o, s = e, r = x(null);
3197
3113
  let a, u, c;
3198
- const v = w(null), p = w(null), x = w(6), g = w(0), _ = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), S = w(null), R = ue();
3199
- let $;
3200
- const z = w("topo100");
3201
- function B() {
3114
+ const v = x(null), p = x(null), w = x(6), b = x(0), $ = x(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), S = x(null), R = de();
3115
+ let C;
3116
+ const E = x("topo100");
3117
+ function j() {
3202
3118
  return new Promise((y, k) => {
3203
3119
  window.L && window.L.Draw && y(0);
3204
- const P = (fe) => {
3205
- if (Array.from(document.styleSheets).some((he) => he?.href?.includes(fe))) return;
3206
- const me = document.createElement("link");
3207
- me.rel = "stylesheet", me.href = fe, document.head.appendChild(me);
3208
- }, J = (fe) => new Promise((_e, me) => {
3209
- const he = Array.from(document.scripts).find((Ve) => Ve.src === fe);
3210
- if (he) {
3211
- he.addEventListener("load", () => _e()), he.addEventListener("error", (Ve) => me(Ve));
3120
+ const P = (ne) => {
3121
+ if (Array.from(document.styleSheets).some((ge) => ge?.href?.includes(ne))) return;
3122
+ const he = document.createElement("link");
3123
+ he.rel = "stylesheet", he.href = ne, document.head.appendChild(he);
3124
+ }, J = (ne) => new Promise((_e, he) => {
3125
+ const ge = Array.from(document.scripts).find((Ve) => Ve.src === ne);
3126
+ if (ge) {
3127
+ ge.addEventListener("load", () => _e()), ge.addEventListener("error", (Ve) => he(Ve));
3212
3128
  return;
3213
3129
  }
3214
3130
  const Ce = document.createElement("script");
3215
- Ce.src = fe, Ce.async = !0, Ce.onload = () => _e(), Ce.onerror = (Ve) => me(Ve), document.body.appendChild(Ce);
3131
+ Ce.src = ne, Ce.async = !0, Ce.onload = () => _e(), Ce.onerror = (Ve) => he(Ve), document.body.appendChild(Ce);
3216
3132
  });
3217
3133
  P("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), P("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), J("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => J("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => y(0)).catch(k);
3218
3134
  });
@@ -3220,7 +3136,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3220
3136
  function m() {
3221
3137
  const y = u.toGeoJSON();
3222
3138
  let k = null;
3223
- y?.features?.length && (k = y.features[0].geometry), s("update:modelValue", k), g.value = u.getLayers().length;
3139
+ y?.features?.length && (k = y.features[0].geometry), s("update:modelValue", k), b.value = u.getLayers().length;
3224
3140
  }
3225
3141
  function f(y = 30) {
3226
3142
  const k = u.getLayers();
@@ -3228,14 +3144,14 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3228
3144
  const J = L.featureGroup(k).getBounds();
3229
3145
  J && J.isValid() && a.fitBounds(J, { padding: [y, y] });
3230
3146
  }
3231
- function Z() {
3147
+ function Q() {
3232
3148
  v.value?.click();
3233
3149
  }
3234
- const U = w("");
3235
- function D(y) {
3150
+ const U = x("");
3151
+ function O(y) {
3236
3152
  return y instanceof L.Circle ? "Circle" : y instanceof L.Rectangle ? "Rectangle" : y instanceof L.Polygon && !(y instanceof L.Rectangle) ? "Polygon" : y instanceof L.Polyline && !(y instanceof L.Polygon) ? "Polyline" : y instanceof L.Marker ? "Point" : "Feature";
3237
3153
  }
3238
- function ie(y) {
3154
+ function ue(y) {
3239
3155
  if (y instanceof L.Circle) {
3240
3156
  const k = y.getRadius();
3241
3157
  return Math.PI * (k * k) / 1e6;
@@ -3252,50 +3168,50 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3252
3168
  function ee(y) {
3253
3169
  return y instanceof L.Circle ? y.getLatLng() : y.getBounds ? y.getBounds().getCenter() : y.getLatLng ? y.getLatLng() : a.getCenter();
3254
3170
  }
3255
- function W() {
3171
+ function X() {
3256
3172
  const y = u.getLayers();
3257
3173
  if (!y.length) {
3258
- S.value = null, g.value = 0;
3174
+ S.value = null, b.value = 0;
3259
3175
  return;
3260
3176
  }
3261
- const k = y[y.length - 1], P = D(k), J = ee(k), fe = ie(k);
3177
+ const k = y[y.length - 1], P = O(k), J = ee(k), ne = ue(k);
3262
3178
  S.value = {
3263
3179
  type: P,
3264
3180
  center: J,
3265
- areaKm2: fe,
3181
+ areaKm2: ne,
3266
3182
  layer: k
3267
- }, g.value = y.length;
3183
+ }, b.value = y.length;
3268
3184
  }
3269
3185
  function je() {
3270
3186
  const y = S.value?.layer;
3271
- y && (y instanceof L.Circle && y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getLatLng && a.setView(y.getLatLng(), Math.max(x.value, 14)));
3187
+ y && (y instanceof L.Circle && y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getLatLng && a.setView(y.getLatLng(), Math.max(w.value, 14)));
3272
3188
  }
3273
- function xe() {
3189
+ function we() {
3274
3190
  const y = S.value?.layer;
3275
- y && (u.removeLayer(y), m(), W());
3191
+ y && (u.removeLayer(y), m(), X());
3276
3192
  }
3277
- be(async () => {
3278
- await B(), L.drawLocal = Ys, a = L.map(r.value, { zoomControl: !1 }).setView(_.value, 10), L.control.zoom({ position: "bottomright" }).addTo(a), z.value = Object.keys(R)[0], $ = L.tileLayer(R[z.value].url, { maxZoom: 19, minZoom: 6 }).addTo(a), u = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (P) => {
3193
+ xe(async () => {
3194
+ await j(), L.drawLocal = Ys, a = L.map(r.value, { zoomControl: !1 }).setView($.value, 10), L.control.zoom({ position: "bottomright" }).addTo(a), E.value = Object.keys(R)[0], C = L.tileLayer(R[E.value].url, { maxZoom: 19, minZoom: 6 }).addTo(a), u = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (P) => {
3279
3195
  const { layer: J } = P;
3280
- u.clearLayers(), u.addLayer(J), m(), W(), f(), U.value = "";
3196
+ u.clearLayers(), u.addLayer(J), m(), X(), f(), U.value = "";
3281
3197
  }), a.on(L.Draw.Event.EDITED, () => {
3282
- m(), W(), f();
3198
+ m(), X(), f();
3283
3199
  }), a.on(L.Draw.Event.DELETED, () => {
3284
- m(), W(), f();
3200
+ m(), X(), f();
3285
3201
  });
3286
3202
  let y = !1;
3287
3203
  a.on("mousemove", (P) => {
3288
3204
  y || (a.invalidateSize(), y = !0), p.value = P.latlng;
3289
3205
  }), a.on("zoomend", () => {
3290
- x.value = a.getZoom();
3206
+ w.value = a.getZoom();
3291
3207
  });
3292
3208
  const k = en(n.modelValue);
3293
3209
  if (k) {
3294
3210
  const P = [];
3295
- L.geoJSON(k).eachLayer((J) => P.push(J)), P.length && u.addLayer(P[0]), m(), W(), f();
3211
+ L.geoJSON(k).eachLayer((J) => P.push(J)), P.length && u.addLayer(P[0]), m(), X(), f();
3296
3212
  }
3297
3213
  });
3298
- function I(y) {
3214
+ function z(y) {
3299
3215
  if (a) {
3300
3216
  switch (c && c.disable(), y) {
3301
3217
  case "marker":
@@ -3317,11 +3233,11 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3317
3233
  c && (c.enable(), U.value = y);
3318
3234
  }
3319
3235
  }
3320
- function C() {
3236
+ function M() {
3321
3237
  const y = u.toGeoJSON(), k = new Blob([JSON.stringify(y, null, 2)], { type: "application/json" }), P = URL.createObjectURL(k), J = document.createElement("a");
3322
3238
  J.href = P, J.download = "data.geojson", J.click(), URL.revokeObjectURL(P);
3323
3239
  }
3324
- function E(y) {
3240
+ function I(y) {
3325
3241
  const k = y.target.files?.[0];
3326
3242
  if (!k) return;
3327
3243
  const P = new FileReader();
@@ -3329,16 +3245,16 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3329
3245
  if (typeof P.result == "string")
3330
3246
  try {
3331
3247
  const J = JSON.parse(P.result);
3332
- u.clearLayers(), J && L.geoJSON({ type: "Feature", geometry: J }).eachLayer((fe) => {
3333
- u.addLayer(fe);
3334
- }), m(), W(), f();
3248
+ u.clearLayers(), J && L.geoJSON({ type: "Feature", geometry: J }).eachLayer((ne) => {
3249
+ u.addLayer(ne);
3250
+ }), m(), X(), f();
3335
3251
  } finally {
3336
3252
  y.target.value = "";
3337
3253
  }
3338
3254
  }, P.readAsText(k);
3339
3255
  }
3340
3256
  function G(y) {
3341
- a && ($ && a.removeLayer($), $ = L.tileLayer(R[y].url, { maxZoom: 19, minZoom: 6 }).addTo(a), z.value = y);
3257
+ a && (C && a.removeLayer(C), C = L.tileLayer(R[y].url, { maxZoom: 19, minZoom: 6 }).addTo(a), E.value = y);
3342
3258
  }
3343
3259
  function oe(y) {
3344
3260
  const k = L.latLng(y[0], y[1]);
@@ -3347,12 +3263,15 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3347
3263
  te(
3348
3264
  () => n.modelValue,
3349
3265
  (y) => {
3350
- u.clearLayers(), y && L.geoJSON({ type: "Feature", geometry: y }).eachLayer((k) => {
3351
- u.addLayer(k);
3352
- }), g.value = u.getLayers().length, W(), f();
3266
+ console.log("update map"), u.clearLayers(), y && L.geoJSON({ type: "Feature", geometry: y }).eachLayer((k) => {
3267
+ u.addLayer(k), k.dragging?.enable(), k.dragging?.enabled(), k.on("dragend", (P) => {
3268
+ const ne = P.target.getLatLng();
3269
+ s("update:modelValue", { type: "Point", coordinates: [ne.lng, ne.lat] });
3270
+ });
3271
+ }), b.value = u.getLayers().length, X(), f();
3353
3272
  }
3354
3273
  );
3355
- function ue() {
3274
+ function de() {
3356
3275
  return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((y, k) => Object.assign(y, { key: `b${k}`, preview: y.preview || y.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((y, k) => ({ ...y, [k.key]: k }), {}) : {
3357
3276
  topo100: {
3358
3277
  url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
@@ -3368,13 +3287,13 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3368
3287
  }
3369
3288
  };
3370
3289
  }
3371
- const we = w(!1);
3372
- return te(we, () => {
3290
+ const ke = x(!1);
3291
+ return te(ke, () => {
3373
3292
  setTimeout(() => {
3374
3293
  a.invalidateSize();
3375
3294
  }, 50);
3376
3295
  }), (y, k) => (i(), d("div", {
3377
- class: M(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: we.value }])
3296
+ class: V(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: ke.value }])
3378
3297
  }, [
3379
3298
  l("div", {
3380
3299
  ref_key: "mapContainer",
@@ -3382,26 +3301,26 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3382
3301
  class: "w-full h-full"
3383
3302
  }, null, 512),
3384
3303
  l("div", Kn, [
3385
- j(Pn, { onGoToCoordinates: oe }),
3304
+ B(Pn, { onGoToCoordinates: oe }),
3386
3305
  l("div", Zn, [
3387
3306
  l("div", Wn, [
3388
3307
  l("button", {
3389
3308
  type: "button",
3390
3309
  class: "vs-btn-row",
3391
- onClick: Z
3310
+ onClick: Q
3392
3311
  }, "Import"),
3393
3312
  l("button", {
3394
3313
  type: "button",
3395
3314
  class: "vs-btn-row",
3396
- onClick: C,
3397
- disabled: g.value === 0
3315
+ onClick: M,
3316
+ disabled: b.value === 0
3398
3317
  }, "Export ", 8, Qn)
3399
3318
  ]),
3400
3319
  l("input", {
3401
3320
  ref_key: "importRef",
3402
3321
  ref: v,
3403
3322
  type: "file",
3404
- onChange: E,
3323
+ onChange: I,
3405
3324
  accept: ".json,.geojson",
3406
3325
  class: "hidden"
3407
3326
  }, null, 544)
@@ -3410,57 +3329,57 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3410
3329
  l("div", Xn, [
3411
3330
  l("div", Yn, [
3412
3331
  l("button", {
3413
- class: M(["vs-btn", { "vs-active": U.value === "marker" }]),
3332
+ class: V(["vs-btn", { "vs-active": U.value === "marker" }]),
3414
3333
  "aria-pressed": U.value === "marker",
3415
3334
  title: "Point (P)",
3416
3335
  "aria-label": "Draw point",
3417
- onClick: k[0] || (k[0] = (P) => I("marker"))
3336
+ onClick: k[0] || (k[0] = (P) => z("marker"))
3418
3337
  }, [
3419
- j(an)
3338
+ B(an)
3420
3339
  ], 10, er),
3421
3340
  l("button", {
3422
- class: M(["vs-btn", { "vs-active": U.value === "polyline" }]),
3341
+ class: V(["vs-btn", { "vs-active": U.value === "polyline" }]),
3423
3342
  "aria-pressed": U.value === "polyline",
3424
3343
  title: "Line (L)",
3425
3344
  "aria-label": "Draw polyline",
3426
- onClick: k[1] || (k[1] = (P) => I("polyline"))
3345
+ onClick: k[1] || (k[1] = (P) => z("polyline"))
3427
3346
  }, [
3428
- j(un)
3347
+ B(un)
3429
3348
  ], 10, tr),
3430
3349
  l("button", {
3431
- class: M(["vs-btn", { "vs-active": U.value === "polygon" }]),
3350
+ class: V(["vs-btn", { "vs-active": U.value === "polygon" }]),
3432
3351
  "aria-pressed": U.value === "polygon",
3433
3352
  title: "Polygon (G)",
3434
3353
  "aria-label": "Draw polygon",
3435
- onClick: k[2] || (k[2] = (P) => I("polygon"))
3354
+ onClick: k[2] || (k[2] = (P) => z("polygon"))
3436
3355
  }, [
3437
- j(fn)
3356
+ B(fn)
3438
3357
  ], 10, lr),
3439
3358
  l("button", {
3440
- class: M(["vs-btn", { "vs-active": U.value === "rectangle" }]),
3359
+ class: V(["vs-btn", { "vs-active": U.value === "rectangle" }]),
3441
3360
  "aria-pressed": U.value === "rectangle",
3442
3361
  title: "Rectangle (R)",
3443
3362
  "aria-label": "Draw rectangle",
3444
- onClick: k[3] || (k[3] = (P) => I("rectangle"))
3363
+ onClick: k[3] || (k[3] = (P) => z("rectangle"))
3445
3364
  }, [
3446
- j(gn)
3365
+ B(gn)
3447
3366
  ], 10, or),
3448
3367
  l("button", {
3449
3368
  class: "vs-btn mt-5",
3450
3369
  onClick: k[4] || (k[4] = (P) => {
3451
- we.value = !we.value;
3370
+ ke.value = !ke.value;
3452
3371
  }),
3453
3372
  title: "Full Screen",
3454
3373
  "aria-label": "Full Screen"
3455
3374
  }, [
3456
- j(wn, { style: { width: "12px", height: "12px" } })
3375
+ B(wn, { style: { width: "12px", height: "12px" } })
3457
3376
  ])
3458
3377
  ])
3459
3378
  ]),
3460
3379
  l("div", {
3461
- class: M(["absolute left-4 z-[1000]", S.value ? "bottom-8" : "bottom-4"])
3380
+ class: V(["absolute left-4 z-[1000]", S.value ? "bottom-8" : "bottom-4"])
3462
3381
  }, [
3463
- j(Jn, {
3382
+ B(Jn, {
3464
3383
  basemaps: q(R),
3465
3384
  onOnLayerChange: G
3466
3385
  }, null, 8, ["basemaps"])
@@ -3468,19 +3387,19 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3468
3387
  l("div", ar, [
3469
3388
  S.value ? (i(), d("div", sr, [
3470
3389
  l("div", nr, [
3471
- k[7] || (k[7] = pe(" Тип: ", -1)),
3390
+ k[7] || (k[7] = fe(" Тип: ", -1)),
3472
3391
  l("span", rr, T(S.value.type), 1)
3473
3392
  ]),
3474
3393
  l("div", ir, [
3475
3394
  l("div", ur, [
3476
- k[8] || (k[8] = pe(" Центр: ", -1)),
3395
+ k[8] || (k[8] = fe(" Центр: ", -1)),
3477
3396
  l("b", null, T(S.value.center.lat.toFixed(5)) + ", " + T(S.value.center.lng.toFixed(5)), 1)
3478
3397
  ]),
3479
3398
  S.value.areaKm2 !== null ? (i(), d("div", dr, [
3480
- k[9] || (k[9] = pe(" Площа: ", -1)),
3399
+ k[9] || (k[9] = fe(" Площа: ", -1)),
3481
3400
  l("b", null, T(S.value.areaKm2.toFixed(1)) + "км²", 1)
3482
3401
  ])) : (i(), d("div", cr, k[10] || (k[10] = [
3483
- pe(" Площа: ", -1),
3402
+ fe(" Площа: ", -1),
3484
3403
  l("b", null, "—", -1)
3485
3404
  ]))),
3486
3405
  l("button", {
@@ -3488,26 +3407,26 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3488
3407
  title: "Наблизити",
3489
3408
  onClick: k[5] || (k[5] = (P) => je())
3490
3409
  }, k[11] || (k[11] = [
3491
- de('<svg 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="w-3 h-3" data-v-e82d2d97><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-e82d2d97></path><path d="M7 10l6 0" data-v-e82d2d97></path><path d="M10 7l0 6" data-v-e82d2d97></path><path d="M21 21l-6 -6" data-v-e82d2d97></path></svg>', 1)
3410
+ ce('<svg 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="w-3 h-3" data-v-5a4c21a7><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-5a4c21a7></path><path d="M7 10l6 0" data-v-5a4c21a7></path><path d="M10 7l0 6" data-v-5a4c21a7></path><path d="M21 21l-6 -6" data-v-5a4c21a7></path></svg>', 1)
3492
3411
  ])),
3493
3412
  l("button", {
3494
3413
  class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
3495
3414
  title: "Видалити",
3496
- onClick: k[6] || (k[6] = (P) => xe())
3415
+ onClick: k[6] || (k[6] = (P) => we())
3497
3416
  }, [
3498
- j(Ue, { class: "w-3 h-3" })
3417
+ B(Te, { class: "w-3 h-3" })
3499
3418
  ])
3500
3419
  ])
3501
- ])) : A("", !0)
3420
+ ])) : D("", !0)
3502
3421
  ])
3503
3422
  ], 2));
3504
3423
  }
3505
- }), fr = /* @__PURE__ */ H(pr, [["__scopeId", "data-v-e82d2d97"]]), vr = ["data-focus"], mr = { class: "flex items-center" }, hr = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, gr = ["onClick", "aria-label"], br = {
3424
+ }), fr = /* @__PURE__ */ H(pr, [["__scopeId", "data-v-5a4c21a7"]]), vr = ["data-focus"], mr = { class: "flex items-center" }, hr = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, gr = ["onClick", "aria-label"], br = {
3506
3425
  key: 0,
3507
3426
  class: "absolute text-gray-500 truncate pl-2"
3508
3427
  }, yr = { class: "flex-1 min-w-[2px]" }, xr = ["placeholder"], wr = { class: "flex items-center shrink-0" }, kr = ["disabled"], _r = /* @__PURE__ */ F({
3509
3428
  __name: "vs-input-tag",
3510
- props: /* @__PURE__ */ Q({
3429
+ props: /* @__PURE__ */ Z({
3511
3430
  unique: { type: Boolean, default: !0 },
3512
3431
  style: { default: () => ({}) },
3513
3432
  customClass: { default: "" },
@@ -3520,49 +3439,49 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3520
3439
  modelValue: { default: [] },
3521
3440
  modelModifiers: {}
3522
3441
  }),
3523
- emits: /* @__PURE__ */ Q(["update:modelValue"], ["update:modelValue"]),
3442
+ emits: /* @__PURE__ */ Z(["update:modelValue"], ["update:modelValue"]),
3524
3443
  setup(o, { emit: e }) {
3525
3444
  const t = o, n = e;
3526
- ye(t.style);
3527
- const s = w(null), r = w(null), a = w(null), u = w(!1), c = w(""), v = X(o, "modelValue"), p = O(() => t.placeholder || "Add tag…"), x = O(() => v.value?.length === 0 && c.value === ""), g = O(() => !t.disabled && v.value?.length > 0), _ = O(() => t.disabled), S = async () => {
3528
- _.value || await ze(() => a.value?.focus());
3445
+ me(t.style);
3446
+ const s = x(null), r = x(null), a = x(null), u = x(!1), c = x(""), v = W(o, "modelValue"), p = A(() => t.placeholder || "Add tag…"), w = A(() => v.value?.length === 0 && c.value === ""), b = A(() => !t.disabled && v.value?.length > 0), $ = A(() => t.disabled), S = async () => {
3447
+ $.value || await ze(() => a.value?.focus());
3529
3448
  }, R = (U) => {
3530
- const D = U.trim();
3531
- D !== "" && (!v.value || !Array.isArray(v.value) ? v.value = [D] : t.unique ? v.value.includes(D) || (v.value = [...v.value, D]) : v.value = [...v.value, D], c.value = "");
3532
- }, $ = () => {
3449
+ const O = U.trim();
3450
+ O !== "" && (!v.value || !Array.isArray(v.value) ? v.value = [O] : t.unique ? v.value.includes(O) || (v.value = [...v.value, O]) : v.value = [...v.value, O], c.value = "");
3451
+ }, C = () => {
3533
3452
  const U = c.value;
3534
3453
  U.trim() !== "" && R(U), c.value = "";
3535
- }, z = (U) => {
3536
- const D = v.value.slice();
3537
- D.splice(U, 1), n("update:modelValue", D);
3538
- }, B = () => {
3454
+ }, E = (U) => {
3455
+ const O = v.value.slice();
3456
+ O.splice(U, 1), n("update:modelValue", O);
3457
+ }, j = () => {
3539
3458
  n("update:modelValue", []);
3540
3459
  }, m = () => {
3541
- _.value || (u.value = !0);
3460
+ $.value || (u.value = !0);
3542
3461
  }, f = () => {
3543
3462
  u.value = !1;
3544
- }, Z = (U) => {
3545
- const { key: D } = U;
3546
- D === "Enter" ? (U.preventDefault(), $()) : D === "Backspace" && c.value === "" && v.value.length > 0 && z(v.value.length - 1);
3463
+ }, Q = (U) => {
3464
+ const { key: O } = U;
3465
+ O === "Enter" ? (U.preventDefault(), C()) : O === "Backspace" && c.value === "" && v.value.length > 0 && E(v.value.length - 1);
3547
3466
  };
3548
- return (U, D) => (i(), d("div", {
3467
+ return (U, O) => (i(), d("div", {
3549
3468
  class: "flex gap-1 w-full",
3550
3469
  ref_key: "root",
3551
3470
  ref: s,
3552
- onClick: D[1] || (D[1] = ve(() => {
3471
+ onClick: O[1] || (O[1] = ve(() => {
3553
3472
  }, ["stop"]))
3554
3473
  }, [
3555
3474
  l("div", {
3556
- class: M(["relative w-full font-sans", t.customClass]),
3475
+ class: V(["relative w-full font-sans", t.customClass]),
3557
3476
  role: "group",
3558
3477
  "aria-label": "Tag input"
3559
3478
  }, [
3560
3479
  l("div", {
3561
- class: M([
3480
+ class: V([
3562
3481
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
3563
3482
  "border-gray-300 hover:border-gray-400",
3564
3483
  u.value ? "border-blue-500 ring-1 ring-blue-500" : "",
3565
- _.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3484
+ $.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3566
3485
  ]),
3567
3486
  "data-focus": u.value ? "true" : "false",
3568
3487
  onClick: S
@@ -3572,19 +3491,19 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3572
3491
  ref_key: "chipsRef",
3573
3492
  ref: r
3574
3493
  }, [
3575
- (i(!0), d(Y, null, le(v.value, (ie, ee) => (i(), d("div", {
3494
+ (i(!0), d(Y, null, le(v.value, (ue, ee) => (i(), d("div", {
3576
3495
  key: ee,
3577
3496
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
3578
3497
  }, [
3579
3498
  l("div", mr, [
3580
- l("div", hr, T(ie), 1)
3499
+ l("div", hr, T(ue), 1)
3581
3500
  ]),
3582
3501
  l("div", {
3583
3502
  role: "button",
3584
3503
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
3585
- onClick: ve((W) => z(ee), ["stop"]),
3586
- "aria-label": `Remove ${ie}`
3587
- }, D[2] || (D[2] = [
3504
+ onClick: ve((X) => E(ee), ["stop"]),
3505
+ "aria-label": `Remove ${ue}`
3506
+ }, O[2] || (O[2] = [
3588
3507
  l("svg", {
3589
3508
  height: "14",
3590
3509
  width: "14",
@@ -3597,9 +3516,9 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3597
3516
  ], -1)
3598
3517
  ]), 8, gr)
3599
3518
  ]))), 128)),
3600
- x.value ? (i(), d("div", br, T(p.value), 1)) : A("", !0),
3519
+ w.value ? (i(), d("div", br, T(p.value), 1)) : D("", !0),
3601
3520
  l("div", yr, [
3602
- _.value ? A("", !0) : K((i(), d("input", {
3521
+ $.value ? D("", !0) : K((i(), d("input", {
3603
3522
  key: 0,
3604
3523
  ref_key: "inputRef",
3605
3524
  ref: a,
@@ -3611,25 +3530,25 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3611
3530
  type: "text",
3612
3531
  tabindex: "0",
3613
3532
  "aria-label": "Add tag",
3614
- "onUpdate:modelValue": D[0] || (D[0] = (ie) => c.value = ie),
3533
+ "onUpdate:modelValue": O[0] || (O[0] = (ue) => c.value = ue),
3615
3534
  onFocus: m,
3616
3535
  onBlur: f,
3617
- onKeydown: Z,
3536
+ onKeydown: Q,
3618
3537
  placeholder: v.value && v.value.length ? "" : void 0
3619
3538
  }, null, 40, xr)), [
3620
- [re, c.value]
3539
+ [se, c.value]
3621
3540
  ])
3622
3541
  ])
3623
3542
  ], 512),
3624
3543
  l("div", wr, [
3625
- g.value ? (i(), d("button", {
3544
+ b.value ? (i(), d("button", {
3626
3545
  key: 0,
3627
3546
  type: "button",
3628
3547
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
3629
3548
  "aria-label": "Clear all tags",
3630
- disabled: _.value,
3631
- onClick: ve(B, ["stop"])
3632
- }, D[3] || (D[3] = [
3549
+ disabled: $.value,
3550
+ onClick: ve(j, ["stop"])
3551
+ }, O[3] || (O[3] = [
3633
3552
  l("svg", {
3634
3553
  height: "20",
3635
3554
  width: "20",
@@ -3638,7 +3557,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3638
3557
  }, [
3639
3558
  l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
3640
3559
  ], -1)
3641
- ]), 8, kr)) : A("", !0)
3560
+ ]), 8, kr)) : D("", !0)
3642
3561
  ])
3643
3562
  ], 10, vr)
3644
3563
  ], 2)
@@ -3646,7 +3565,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3646
3565
  }
3647
3566
  }), $r = { class: "relative flex gap-1 bg-white w-full" }, Cr = ["disabled", "placeholder"], Vr = /* @__PURE__ */ F({
3648
3567
  __name: "vs-input-slug",
3649
- props: /* @__PURE__ */ Q({
3568
+ props: /* @__PURE__ */ Z({
3650
3569
  disabled: { type: Boolean },
3651
3570
  placeholder: {},
3652
3571
  parent: {}
@@ -3656,7 +3575,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3656
3575
  }),
3657
3576
  emits: ["update:modelValue"],
3658
3577
  setup(o) {
3659
- const e = Me("values"), t = o, n = X(o, "modelValue");
3578
+ const e = Me("values"), t = o, n = W(o, "modelValue");
3660
3579
  function s(a) {
3661
3580
  const u = {
3662
3581
  а: "a",
@@ -3711,7 +3630,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3711
3630
  "onUpdate:modelValue": u[0] || (u[0] = (c) => n.value = c),
3712
3631
  class: "block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
3713
3632
  }, null, 8, Cr), [
3714
- [re, n.value]
3633
+ [se, n.value]
3715
3634
  ]),
3716
3635
  l("button", {
3717
3636
  class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",
@@ -3725,7 +3644,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3725
3644
  }, Br = ["onDragstart", "onDrop"], jr = { class: "w-1/3" }, Ir = { class: "w-2/3" }, zr = ["onClick"], Er = {
3726
3645
  key: 0,
3727
3646
  class: "text-[14px] text-gray-700"
3728
- }, Ar = { class: "mt-2 w-full flex items-center" }, Fr = ["disabled"], Dr = /* @__PURE__ */ F({
3647
+ }, Fr = { class: "mt-2 w-full flex items-center" }, Dr = ["disabled"], Or = /* @__PURE__ */ F({
3729
3648
  __name: "vs-input-key-value",
3730
3649
  props: {
3731
3650
  parent: {},
@@ -3735,101 +3654,101 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3735
3654
  },
3736
3655
  emits: ["update:modelValue"],
3737
3656
  setup(o, { emit: e }) {
3738
- const t = ($) => `${$}-${Math.random().toString(36).substring(2, 15)}`, n = Me("values"), s = o, r = e, a = s.addButtonText ?? "Додати", u = s.ignore ?? [], c = w([]), v = w(null);
3657
+ const t = (C) => `${C}-${Math.random().toString(36).substring(2, 15)}`, n = Me("values"), s = o, r = e, a = s.addButtonText ?? "Додати", u = s.ignore ?? [], c = x([]), v = x(null);
3739
3658
  (() => {
3740
- const $ = s.parent && n?.value?.[s.parent] || s.modelValue || {};
3741
- c.value = Object.entries($).filter(([z]) => !u.includes(z)).map(([z, B]) => ({
3659
+ const C = s.parent && n?.value?.[s.parent] || s.modelValue || {};
3660
+ c.value = Object.entries(C).filter(([E]) => !u.includes(E)).map(([E, j]) => ({
3742
3661
  id: t("key-value-"),
3743
- key: z,
3744
- value: B
3662
+ key: E,
3663
+ value: j
3745
3664
  }));
3746
3665
  })();
3747
- function x($) {
3748
- v.value = $;
3666
+ function w(C) {
3667
+ v.value = C;
3749
3668
  }
3750
- function g($) {
3751
- if (v.value === null || v.value === $) return;
3752
- const z = c.value.splice(v.value, 1)[0];
3753
- c.value.splice($, 0, z), v.value = null;
3669
+ function b(C) {
3670
+ if (v.value === null || v.value === C) return;
3671
+ const E = c.value.splice(v.value, 1)[0];
3672
+ c.value.splice(C, 0, E), v.value = null;
3754
3673
  }
3755
- const _ = O(
3756
- () => c.value.some(($) => $.key && !$.value || !$.key && $.value)
3674
+ const $ = A(
3675
+ () => c.value.some((C) => C.key && !C.value || !C.key && C.value)
3757
3676
  ), S = () => {
3758
3677
  c.value.push({ id: t("key-value-"), key: "", value: "" });
3759
- }, R = ($) => {
3760
- c.value = c.value.filter((z) => z.id !== $);
3678
+ }, R = (C) => {
3679
+ c.value = c.value.filter((E) => E.id !== C);
3761
3680
  };
3762
3681
  return te(
3763
3682
  c,
3764
- ($) => {
3765
- const z = {};
3766
- $.forEach((m) => {
3767
- m.key && m.value !== void 0 && (z[m.key] = m.value);
3683
+ (C) => {
3684
+ const E = {};
3685
+ C.forEach((m) => {
3686
+ m.key && m.value !== void 0 && (E[m.key] = m.value);
3768
3687
  });
3769
- const B = {};
3688
+ const j = {};
3770
3689
  u.length && u.forEach((m) => {
3771
- B[m] = s.parent ? n?.value?.[s.parent]?.[m] : void 0;
3690
+ j[m] = s.parent ? n?.value?.[s.parent]?.[m] : void 0;
3772
3691
  }), n?.value && s.parent && (n.value[s.parent] = {
3773
- ...B,
3774
- ...z
3775
- }), r("update:modelValue", z);
3692
+ ...j,
3693
+ ...E
3694
+ }), r("update:modelValue", E);
3776
3695
  },
3777
3696
  { deep: !0 }
3778
- ), ($, z) => (i(), d("div", Lr, [
3697
+ ), (C, E) => (i(), d("div", Lr, [
3779
3698
  l("div", Sr, [
3780
- (i(!0), d(Y, null, le(c.value, (B, m) => (i(), d("div", {
3781
- key: B.id,
3782
- class: M(["flex items-center gap-2 w-full", { "opacity-50": v.value === m }]),
3699
+ (i(!0), d(Y, null, le(c.value, (j, m) => (i(), d("div", {
3700
+ key: j.id,
3701
+ class: V(["flex items-center gap-2 w-full", { "opacity-50": v.value === m }]),
3783
3702
  draggable: "true",
3784
- onDragstart: (f) => x(m),
3785
- onDragover: z[0] || (z[0] = ve(() => {
3703
+ onDragstart: (f) => w(m),
3704
+ onDragover: E[0] || (E[0] = ve(() => {
3786
3705
  }, ["prevent"])),
3787
- onDrop: (f) => g(m)
3706
+ onDrop: (f) => b(m)
3788
3707
  }, [
3789
- z[1] || (z[1] = de('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>', 1)),
3708
+ E[1] || (E[1] = ce('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>', 1)),
3790
3709
  l("div", jr, [
3791
- j(De, {
3792
- modelValue: B.key,
3793
- "onUpdate:modelValue": (f) => B.key = f,
3710
+ B(Ue, {
3711
+ modelValue: j.key,
3712
+ "onUpdate:modelValue": (f) => j.key = f,
3794
3713
  placeholder: "Ключ"
3795
3714
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
3796
3715
  ]),
3797
3716
  l("div", Ir, [
3798
- j(De, {
3799
- modelValue: B.value,
3800
- "onUpdate:modelValue": (f) => B.value = f,
3717
+ B(Ue, {
3718
+ modelValue: j.value,
3719
+ "onUpdate:modelValue": (f) => j.value = f,
3801
3720
  placeholder: "Значення"
3802
3721
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
3803
3722
  ]),
3804
3723
  l("button", {
3805
- onClick: (f) => R(B.id),
3724
+ onClick: (f) => R(j.id),
3806
3725
  class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"
3807
3726
  }, [
3808
- j(q(ml), {
3727
+ B(q(kl), {
3809
3728
  height: "16",
3810
3729
  width: "16"
3811
3730
  })
3812
3731
  ], 8, zr)
3813
3732
  ], 42, Br))), 128))
3814
3733
  ], 512),
3815
- c.value.length ? A("", !0) : (i(), d("span", Er, " Дані для відображення відсутні ")),
3816
- l("div", Ar, [
3734
+ c.value.length ? D("", !0) : (i(), d("span", Er, " Дані для відображення відсутні ")),
3735
+ l("div", Fr, [
3817
3736
  l("button", {
3818
3737
  type: "button",
3819
3738
  onClick: S,
3820
- disabled: _.value,
3739
+ disabled: $.value,
3821
3740
  class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
3822
3741
  }, [
3823
- j(Ae, {
3742
+ B(Fe, {
3824
3743
  height: "14",
3825
3744
  width: "14"
3826
3745
  }),
3827
- pe(" " + T(q(a)), 1)
3828
- ], 8, Fr)
3746
+ fe(" " + T(q(a)), 1)
3747
+ ], 8, Dr)
3829
3748
  ])
3830
3749
  ]));
3831
3750
  }
3832
- }), Or = /* @__PURE__ */ H(Dr, [["__scopeId", "data-v-a0f7fbfc"]]), Ur = { class: "flex items-center gap-2 w-full" }, Tr = ["disabled"], Rr = /* @__PURE__ */ F({
3751
+ }), Ar = /* @__PURE__ */ H(Or, [["__scopeId", "data-v-a0f7fbfc"]]), Ur = { class: "flex items-center gap-2 w-full" }, Tr = ["disabled"], Rr = /* @__PURE__ */ F({
3833
3752
  __name: "vs-input-color",
3834
3753
  props: {
3835
3754
  style: { default: () => ({}) },
@@ -3842,7 +3761,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3842
3761
  },
3843
3762
  emits: ["update:modelValue"],
3844
3763
  setup(o, { emit: e }) {
3845
- const t = o, { inputClass: n } = ye(t.style), s = e, r = O({
3764
+ const t = o, { inputClass: n } = me(t.style), s = e, r = A({
3846
3765
  get: () => t.modelValue || "#000000",
3847
3766
  set: (a) => s("update:modelValue", a)
3848
3767
  });
@@ -3852,16 +3771,16 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3852
3771
  "onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
3853
3772
  disabled: a.disabled,
3854
3773
  ref: "color",
3855
- class: M(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [a.modelValue ? "" : "text-opacity-50", q(n)].join(" ")]),
3774
+ class: V(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [a.modelValue ? "" : "text-opacity-50", q(n)].join(" ")]),
3856
3775
  style: { border: "1px solid #CFD9E0" }
3857
3776
  }, null, 10, Tr), [
3858
- [re, r.value]
3777
+ [se, r.value]
3859
3778
  ]),
3860
3779
  K(l("input", {
3861
3780
  class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2",
3862
3781
  "onUpdate:modelValue": u[1] || (u[1] = (c) => r.value = c)
3863
3782
  }, null, 512), [
3864
- [re, r.value]
3783
+ [se, r.value]
3865
3784
  ])
3866
3785
  ]));
3867
3786
  }
@@ -3881,7 +3800,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3881
3800
  },
3882
3801
  emits: ["update:modelValue"],
3883
3802
  setup(o, { emit: e }) {
3884
- const t = o, { inputClass: n } = ye(t.style), s = e, r = O({
3803
+ const t = o, { inputClass: n } = me(t.style), s = e, r = A({
3885
3804
  get: () => Number(t.modelValue ?? t.min),
3886
3805
  set: (a) => s("update:modelValue", Number(a))
3887
3806
  });
@@ -3894,42 +3813,43 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3894
3813
  step: a.step,
3895
3814
  disabled: a.disabled,
3896
3815
  ref: "range",
3897
- class: M(["w-full cursor-pointer accent-blue-500", [a.modelValue ? "" : "text-opacity-50", q(n)].join(" ")])
3816
+ class: V(["w-full cursor-pointer accent-blue-500", [a.modelValue ? "" : "text-opacity-50", q(n)].join(" ")])
3898
3817
  }, null, 10, Hr), [
3899
- [re, r.value]
3818
+ [se, r.value]
3900
3819
  ]),
3901
3820
  K(l("input", {
3902
3821
  class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",
3903
3822
  type: "number",
3904
3823
  "onUpdate:modelValue": u[1] || (u[1] = (c) => r.value = c)
3905
3824
  }, null, 512), [
3906
- [re, r.value]
3825
+ [se, r.value]
3907
3826
  ])
3908
3827
  ]));
3909
3828
  }
3910
3829
  }), qr = {
3911
- VsInputText: De,
3912
- VsInputRadio: at,
3913
- "vs-input-text": De,
3830
+ VsInputText: Ue,
3831
+ VsInputRadio: rt,
3832
+ "vs-input-text": Ue,
3833
+ "vs-input-password": Wt,
3914
3834
  "vs-input-textarea": Qa,
3915
- "vs-input-mask": Vl,
3916
- "vs-input-number": Gt,
3917
- "vs-input-radio": at,
3835
+ "vs-input-mask": zl,
3836
+ "vs-input-number": Yt,
3837
+ "vs-input-radio": rt,
3918
3838
  "vs-input-select": Za,
3919
- "vs-input-switcher": ft,
3920
- "vs-input-static": ot,
3921
- "vs-input-container": Ma,
3922
- "vs-input-date": Tl,
3923
- "vs-input-checkbox": Ol,
3924
- "vs-input-file": Vo,
3925
- "vs-input-html": ot,
3926
- "vs-input-email": Sl,
3839
+ "vs-input-switcher": bt,
3840
+ "vs-input-static": nt,
3841
+ "vs-input-container": Ea,
3842
+ "vs-input-date": Jl,
3843
+ "vs-input-checkbox": ql,
3844
+ "vs-input-file": zo,
3845
+ "vs-input-html": nt,
3846
+ "vs-input-email": Dl,
3927
3847
  "vs-input-datatable": Xs,
3928
3848
  "vs-input-map": fr,
3929
- "vs-input-file-list": la,
3849
+ "vs-input-file-list": ua,
3930
3850
  "vs-input-tag": _r,
3931
3851
  "vs-input-slug": Mr,
3932
- "vs-input-key-value": Or,
3852
+ "vs-input-key-value": Ar,
3933
3853
  "vs-input-range": Nr,
3934
3854
  "vs-input-color": Rr
3935
3855
  }, Gr = /* @__PURE__ */ F({
@@ -3948,7 +3868,7 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3948
3868
  if (!e.api) return;
3949
3869
  const s = e.api.replace("{{value}}", e.value), r = await fetch(s);
3950
3870
  if (!r.ok) {
3951
- ke({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3871
+ be({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3952
3872
  return;
3953
3873
  }
3954
3874
  const a = await r.json();
@@ -3964,9 +3884,9 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3964
3884
  class: "vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"
3965
3885
  }, T(s.button), 1));
3966
3886
  }
3967
- }), Jr = { class: "flex w-full" }, ht = /* @__PURE__ */ F({
3887
+ }), wt = /* @__PURE__ */ F({
3968
3888
  __name: "vs-compact-form-layout",
3969
- props: /* @__PURE__ */ Q({
3889
+ props: /* @__PURE__ */ Z({
3970
3890
  item: { default: {} },
3971
3891
  layout: { default: "default" },
3972
3892
  style: { default: {} },
@@ -3978,55 +3898,57 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
3978
3898
  }),
3979
3899
  emits: ["update:modelValue"],
3980
3900
  setup(o) {
3981
- const e = o, t = X(o, "modelValue"), n = O(() => Ht[`${e.layout}`]), s = O(() => qr?.[`vs-input-${e.item.type}`]), r = O(() => {
3901
+ const e = o, t = W(o, "modelValue"), n = A(() => Kt[`${e.layout}`]), s = A(() => qr?.[`vs-input-${e.item.type}`]), r = A(() => {
3982
3902
  const u = q(s);
3983
3903
  if (!u) return /* @__PURE__ */ new Set();
3984
3904
  const c = u.props ?? u.__vccOpts?.props;
3985
3905
  if (!c) return /* @__PURE__ */ new Set();
3986
3906
  const v = Array.isArray(c) ? c : Object.keys(c);
3987
3907
  return new Set(v);
3988
- }), a = O(() => {
3908
+ }), a = A(() => {
3989
3909
  const u = e.item ?? {}, c = r.value;
3990
3910
  return c.size ? Object.fromEntries(Object.entries(u).filter(([v]) => c.has(v))) : {};
3991
3911
  });
3992
- return (u, c) => (i(), ae(Se(n.value), {
3912
+ return (u, c) => (i(), ae(Be(n.value), {
3993
3913
  ua: e.item.ua,
3994
3914
  error: e.error || "",
3995
3915
  item: u.item,
3996
3916
  label: e.item.label
3997
3917
  }, {
3998
- default: Be(() => [
3999
- l("div", Jr, [
4000
- (i(), ae(Se(s.value), Ee(a.value, {
3918
+ default: Le(() => [
3919
+ l("div", {
3920
+ class: V(["flex w-full", `${e.item.type}-component`])
3921
+ }, [
3922
+ (i(), ae(Be(s.value), Ee(a.value, {
4001
3923
  modelValue: t.value,
4002
3924
  "onUpdate:modelValue": c[0] || (c[0] = (v) => t.value = v)
4003
3925
  }), null, 16, ["modelValue"])),
4004
- u.item.behavior?.api && u.item.behavior?.button ? (i(), ae(Gr, Ee({ key: 0 }, u.item.behavior, { value: t.value }), null, 16, ["value"])) : A("", !0)
4005
- ])
3926
+ u.item.behavior?.api && u.item.behavior?.button ? (i(), ae(Gr, Ee({ key: 0 }, u.item.behavior, { value: t.value }), null, 16, ["value"])) : D("", !0)
3927
+ ], 2)
4006
3928
  ]),
4007
3929
  _: 1
4008
3930
  }, 8, ["ua", "error", "item", "label"]));
4009
3931
  }
4010
- }), gt = {
3932
+ }), kt = {
4011
3933
  required: "Це поле є обов’язковим",
4012
3934
  email: "Неправильний email"
4013
- }, Kr = (o) => o ? !1 : gt.required, Zr = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? gt.email : !1, Wr = (o, e) => {
3935
+ }, Jr = (o) => o ? !1 : kt.required, Kr = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? kt.email : !1, Zr = (o, e) => {
4014
3936
  const t = e.pattern ?? e.regexp;
4015
3937
  return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
4016
- }, Qr = (o, e) => !1, Xr = (o, e) => {
3938
+ }, Wr = (o, e) => !1, Qr = (o, e) => {
4017
3939
  switch (typeof e == "string" ? e : e.type) {
4018
3940
  case "required":
4019
- return Kr(o);
3941
+ return Jr(o);
4020
3942
  case "email":
4021
- return Zr(o);
3943
+ return Kr(o);
4022
3944
  case "regexp":
4023
- return Wr(o, e);
3945
+ return Zr(o, e);
4024
3946
  case "custom":
4025
- return Qr();
3947
+ return Wr();
4026
3948
  default:
4027
3949
  return !1;
4028
3950
  }
4029
- }, Yr = {
3951
+ }, Xr = {
4030
3952
  autocomplete: "select",
4031
3953
  combobox: "select",
4032
3954
  datepicker: "date",
@@ -4038,16 +3960,16 @@ const wn = /* @__PURE__ */ H(bn, [["render", xn]]), kn = { class: "form-geom__se
4038
3960
  file: "file"
4039
3961
  // mask: 'text',
4040
3962
  };
4041
- function it(o) {
3963
+ function ct(o) {
4042
3964
  const e = o.toLowerCase();
4043
- return Yr[e] || e;
3965
+ return Xr[e] || e;
4044
3966
  }
4045
- function ei(o) {
3967
+ function Yr(o) {
4046
3968
  if (Array.isArray(o)) {
4047
3969
  const t = [];
4048
3970
  return o.forEach((n) => {
4049
3971
  const s = { ...n };
4050
- s.name = (n.name || n.id || n.key || "").toString(), s.type = it(n.type), s.label = n.label || n.ua, s.rules = n.rules || n.validators, n.data && (s.api = `/api/suggest/${n.data}`), t.push(s);
3972
+ s.name = (n.name || n.id || n.key || "").toString(), s.type = ct(n.type), s.label = n.label || n.ua, s.rules = n.rules || n.validators, n.data && (s.api = `/api/suggest/${n.data}`), t.push(s);
4051
3973
  }), t;
4052
3974
  }
4053
3975
  const e = [];
@@ -4055,20 +3977,20 @@ function ei(o) {
4055
3977
  const n = {
4056
3978
  name: t[0],
4057
3979
  ...t[1],
4058
- type: it(t[1].type),
3980
+ type: ct(t[1].type),
4059
3981
  label: t[1].label || t[1].ua,
4060
3982
  rules: t[1].rules || t[1].validators
4061
3983
  };
4062
3984
  t[1].type.includes("list") && (n.multiple = !0), t[1].data && (n.api = `/api/suggest/${t[1].data}`), e.push(n);
4063
3985
  }), e;
4064
3986
  }
4065
- function ti(o, e) {
4066
- const t = ei(e), n = w({});
3987
+ function ei(o, e) {
3988
+ const t = Yr(e), n = x({});
4067
3989
  function s(c) {
4068
3990
  const v = c?.conditions;
4069
3991
  if (!v) return !0;
4070
- const p = Array.isArray(v) ? v[0] : v, x = o?.value?.[p];
4071
- return mt(x, v);
3992
+ const p = Array.isArray(v) ? v[0] : v, w = o?.value?.[p];
3993
+ return xt(w, v);
4072
3994
  }
4073
3995
  const r = (c = t, v = !0) => (c.forEach((p) => {
4074
3996
  if (p.rules) {
@@ -4076,13 +3998,13 @@ function ti(o, e) {
4076
3998
  delete n.value[p.name];
4077
3999
  return;
4078
4000
  }
4079
- p.rules.forEach((x) => {
4080
- const g = Xr(o.value[p.name], x);
4081
- g ? n.value[p.name] = g : delete n.value[p.name];
4001
+ p.rules.forEach((w) => {
4002
+ const b = Qr(o.value[p.name], w);
4003
+ b ? n.value[p.name] = b : delete n.value[p.name];
4082
4004
  });
4083
4005
  }
4084
4006
  p.schema && r(p.schema, !1);
4085
- }), v && Object.values(n.value).some(Boolean) ? n.value : null), a = O(() => t?.filter((c) => s(c)));
4007
+ }), v && Object.values(n.value).some(Boolean) ? n.value : null), a = A(() => t?.filter((c) => s(c)));
4086
4008
  return {
4087
4009
  errors: n,
4088
4010
  validate: r,
@@ -4092,9 +4014,9 @@ function ti(o, e) {
4092
4014
  visibleSchema: a
4093
4015
  };
4094
4016
  }
4095
- const Oe = /* @__PURE__ */ F({
4017
+ const De = /* @__PURE__ */ F({
4096
4018
  __name: "vs-compact-form",
4097
- props: /* @__PURE__ */ Q({
4019
+ props: /* @__PURE__ */ Z({
4098
4020
  schema: { default: () => [] },
4099
4021
  style: { default: () => ({}) },
4100
4022
  modelValue: {},
@@ -4106,77 +4028,219 @@ const Oe = /* @__PURE__ */ F({
4106
4028
  values: { default: () => ({}) },
4107
4029
  valuesModifiers: {}
4108
4030
  }),
4109
- emits: /* @__PURE__ */ Q(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
4031
+ emits: /* @__PURE__ */ Z(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
4110
4032
  setup(o, { expose: e, emit: t }) {
4111
- const n = t, s = o, r = X(o, "form"), a = X(o, "values"), {
4033
+ const n = t, s = o, r = W(o, "form"), a = W(o, "values"), {
4112
4034
  errors: u,
4113
4035
  validate: c,
4114
4036
  reset: v,
4115
4037
  visibleSchema: p
4116
- } = ti(a, s.schema), x = () => {
4038
+ } = ei(a, s.schema), w = () => {
4117
4039
  n("update:modelValue", a.value), c(), n("handle-submit", a.value);
4118
4040
  };
4119
4041
  e({
4120
4042
  validate: c,
4121
4043
  reset: v,
4122
4044
  errors: u
4123
- }), be(() => {
4045
+ }), xe(() => {
4124
4046
  s.modelValue && (a.value = s.modelValue), r.value.value = a.value, r.value.errors = u.value, r.value.reset = v, r.value.validate = c, r.value.formId = s.formId;
4125
4047
  });
4126
- function g(_, S) {
4127
- if (_ === S) return !0;
4128
- if (typeof _ != "object" || typeof S != "object" || !_ || !S) return !1;
4129
- const R = Object.keys(_), $ = Object.keys(S);
4130
- return R.length !== $.length ? !1 : R.every((z) => _[z] === S[z]);
4048
+ function b($, S) {
4049
+ if ($ === S) return !0;
4050
+ if (typeof $ != "object" || typeof S != "object" || !$ || !S) return !1;
4051
+ const R = Object.keys($), C = Object.keys(S);
4052
+ return R.length !== C.length ? !1 : R.every((E) => $[E] === S[E]);
4131
4053
  }
4132
- return lt("form", r), lt("values", a), (_, S) => (i(), d("form", {
4133
- onSubmit: ve(x, ["prevent"]),
4134
- class: M(["grid grid-cols-12", _.layout === "default" ? "gap-6" : "gap-4"])
4054
+ return st("form", r), st("values", a), ($, S) => (i(), d("form", {
4055
+ onSubmit: ve(w, ["prevent"]),
4056
+ class: V(["grid grid-cols-12", $.layout === "default" ? "gap-6" : "gap-4"])
4135
4057
  }, [
4136
- (i(!0), d(Y, null, le(q(p), (R) => (i(), ae(ht, {
4058
+ (i(!0), d(Y, null, le(q(p), (R) => (i(), ae(wt, {
4137
4059
  key: R.name,
4138
- class: M(_.layout === "horizontal" ? "col-span-12" : `col-span-${R.col || 12} `),
4139
- style: ge(_.style),
4060
+ class: V($.layout === "horizontal" ? "col-span-12" : `col-span-${R.col || 12} `),
4061
+ style: ye($.style),
4140
4062
  item: R,
4141
- layout: _.layout,
4063
+ layout: $.layout,
4142
4064
  "model-value": a.value[R.name],
4143
- "onUpdate:modelValue": ($) => {
4144
- const z = a.value[R.name];
4145
- g(z, $) || (a.value[R.name] = $);
4065
+ "onUpdate:modelValue": (C) => {
4066
+ const E = a.value[R.name];
4067
+ b(E, C) || (a.value[R.name] = C);
4146
4068
  },
4147
4069
  error: q(u)[R.name]
4148
4070
  }, null, 8, ["class", "style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]))), 128))
4149
4071
  ], 34));
4150
4072
  }
4073
+ }), ti = { class: "relative" }, li = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, oi = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, ai = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, si = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, ni = { class: "p-4 mim-h-0 h-full overflow-auto" }, ri = /* @__PURE__ */ F({
4074
+ __name: "modal-edit",
4075
+ props: {
4076
+ schema: {},
4077
+ defaultValue: {},
4078
+ mode: {},
4079
+ token: {},
4080
+ form: {}
4081
+ },
4082
+ emits: ["close", "save", "edit"],
4083
+ setup(o, { emit: e }) {
4084
+ const t = o, n = e, s = x(t.schema), r = x(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), a = x({}), u = x(), c = x(t.mode);
4085
+ async function v() {
4086
+ const w = a.value.validate();
4087
+ if (w) {
4088
+ be({ type: "warning", title: "Помилка валідації", message: Object.entries(w).map(([b, $]) => `${b}: ${$}`).join(`
4089
+ `) });
4090
+ return;
4091
+ }
4092
+ if (u.value)
4093
+ try {
4094
+ const b = await fetch(`/api/table/${u.value}`, {
4095
+ method: c.value === "add" ? "POST" : "PUT",
4096
+ headers: {
4097
+ "Content-Type": "application/json"
4098
+ },
4099
+ body: JSON.stringify(r.value)
4100
+ });
4101
+ if (b.ok)
4102
+ await b.json(), be({
4103
+ type: "success",
4104
+ title: "Успішно",
4105
+ message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
4106
+ }), n("save", r.value);
4107
+ else if (b.status === 400) {
4108
+ const $ = await b.json().catch(() => ({}));
4109
+ be({
4110
+ type: "warning",
4111
+ title: "Помилка валідації",
4112
+ message: $.message || "Некоректні дані (400)"
4113
+ });
4114
+ } else b.status === 500 ? be({
4115
+ type: "error",
4116
+ title: "Серверна помилка",
4117
+ message: "Виникла помилка на сервері (500)"
4118
+ }) : be({
4119
+ type: "error",
4120
+ title: "Помилка",
4121
+ message: `Статус: ${b.status}`
4122
+ });
4123
+ } catch (b) {
4124
+ be({
4125
+ type: "error",
4126
+ title: "Помилка з’єднання",
4127
+ message: b.message || "Не вдалося виконати запит"
4128
+ });
4129
+ }
4130
+ }
4131
+ function p() {
4132
+ n("close");
4133
+ }
4134
+ return xe(async () => {
4135
+ if (t.form) {
4136
+ const w = await fetch(`/api/template/form/${t.form}`).then((b) => b.json());
4137
+ s.value = w.schema, u.value = w.token;
4138
+ } else if (t.token) {
4139
+ u.value = t.token;
4140
+ const w = await fetch(`/api/form/${u.value}`).then((b) => b.json());
4141
+ s.value = w.schema, w.data ? r.value = w.data : c.value = "add";
4142
+ }
4143
+ }), (w, b) => (i(), d("div", ti, [
4144
+ l("div", li, [
4145
+ l("div", oi, [
4146
+ l("div", ai, [
4147
+ l("h3", si, T(c.value === "add" ? "Додати" : "Змінити"), 1),
4148
+ l("button", {
4149
+ onClick: p,
4150
+ type: "button",
4151
+ class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
4152
+ }, b[2] || (b[2] = [
4153
+ l("span", { class: "sr-only" }, "Close", -1),
4154
+ l("svg", {
4155
+ class: "flex-shrink-0 w-4 h-4",
4156
+ xmlns: "http://www.w3.org/2000/svg",
4157
+ width: "24",
4158
+ height: "24",
4159
+ viewBox: "0 0 24 24",
4160
+ fill: "none",
4161
+ stroke: "currentColor",
4162
+ "stroke-width": "2",
4163
+ "stroke-linecap": "round",
4164
+ "stroke-linejoin": "round"
4165
+ }, [
4166
+ l("path", { d: "M18 6 6 18" }),
4167
+ l("path", { d: "m6 6 12 12" })
4168
+ ], -1)
4169
+ ]))
4170
+ ]),
4171
+ l("div", ni, [
4172
+ s.value ? (i(), ae(De, {
4173
+ key: 0,
4174
+ schema: s.value,
4175
+ values: r.value,
4176
+ "onUpdate:values": b[0] || (b[0] = ($) => r.value = $),
4177
+ form: a.value,
4178
+ "onUpdate:form": b[1] || (b[1] = ($) => a.value = $)
4179
+ }, null, 8, ["schema", "values", "form"])) : D("", !0)
4180
+ ]),
4181
+ l("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
4182
+ l("button", {
4183
+ type: "button",
4184
+ onClick: p,
4185
+ class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
4186
+ }, " Скасувати "),
4187
+ l("button", {
4188
+ onClick: v,
4189
+ type: "button",
4190
+ class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
4191
+ }, " Зберегти ")
4192
+ ])
4193
+ ])
4194
+ ])
4195
+ ]));
4196
+ }
4197
+ }), pt = (o = { mode: "edit", schema: null }) => new Promise((e) => {
4198
+ const { close: t } = Et({
4199
+ title: o.mode === "add" ? "Додати" : "Редагувати",
4200
+ template: "",
4201
+ visible: !0,
4202
+ size: "medium",
4203
+ closeClickBack: !0,
4204
+ content: ri,
4205
+ contentProps: {
4206
+ ...o,
4207
+ onClose: () => {
4208
+ e(null), t();
4209
+ },
4210
+ onSave: (n) => {
4211
+ e(n), t();
4212
+ }
4213
+ }
4214
+ });
4151
4215
  });
4152
- Oe.install = function(e) {
4153
- e.component("VForm", Oe), Object.assign(e.config.globalProperties, {
4154
- $form: Pe
4155
- }), e.provide("form", Pe), window.v3plugin || (window.v3plugin = {});
4216
+ De.install = function(e) {
4217
+ e.component("VForm", De), Object.assign(e.config.globalProperties, {
4218
+ $form: pt
4219
+ }), e.provide("form", pt), window.v3plugin || (window.v3plugin = {});
4156
4220
  };
4157
4221
  export {
4158
- Ea as ModalEdit,
4159
- Oe as VForm,
4160
- Ol as VsInputCheckbox,
4222
+ ri as ModalEdit,
4223
+ De as VForm,
4224
+ ql as VsInputCheckbox,
4161
4225
  Rr as VsInputColor,
4162
- Ma as VsInputContainer,
4163
- Tl as VsInputDate,
4164
- Sl as VsInputEmail,
4165
- Vo as VsInputFile,
4166
- la as VsInputFileList,
4167
- Or as VsInputKeyValue,
4168
- Vl as VsInputMask,
4169
- Gt as VsInputNumber,
4170
- at as VsInputRadio,
4226
+ Ea as VsInputContainer,
4227
+ Jl as VsInputDate,
4228
+ Dl as VsInputEmail,
4229
+ zo as VsInputFile,
4230
+ ua as VsInputFileList,
4231
+ Ar as VsInputKeyValue,
4232
+ zl as VsInputMask,
4233
+ Yt as VsInputNumber,
4234
+ rt as VsInputRadio,
4171
4235
  Nr as VsInputRange,
4172
4236
  Za as VsInputSelect,
4173
4237
  Mr as VsInputSlug,
4174
- ot as VsInputStatic,
4175
- ft as VsInputSwitcher,
4238
+ nt as VsInputStatic,
4239
+ bt as VsInputSwitcher,
4176
4240
  _r as VsInputTag,
4177
- De as VsInputText,
4241
+ Ue as VsInputText,
4178
4242
  Qa as VsInputTextarea,
4179
- Oe as default,
4243
+ De as default,
4180
4244
  qr as inputs,
4181
4245
  Xs as vsInputDatatable,
4182
4246
  fr as vsInputMap