@opengis/widgets 0.0.13 → 0.0.15

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,24 +1,24 @@
1
- import { h as Y, defineComponent as I, mergeModels as J, useModel as le, ref as M, createElementBlock as r, openBlock as a, createElementVNode as e, createVNode as w, unref as _, withDirectives as U, vModelText as ye, createCommentVNode as $, createTextVNode as H, onMounted as re, onUnmounted as de, resolveComponent as ee, normalizeClass as D, createBlock as j, toDisplayString as k, Fragment as A, renderList as S, normalizeStyle as R, resolveDynamicComponent as N, withModifiers as K, computed as O, Teleport as be, TransitionGroup as Me, withCtx as Le, nextTick as De, renderSlot as G, vModelRadio as Q, vModelCheckbox as Te, mergeProps as te, vShow as Ie } from "vue";
1
+ import { h as te, defineComponent as j, mergeModels as X, useModel as ae, ref as $, createElementBlock as i, openBlock as s, createElementVNode as t, createVNode as M, unref as w, withDirectives as R, vModelText as fe, createCommentVNode as b, createTextVNode as F, onMounted as re, onUnmounted as ye, resolveComponent as Q, normalizeClass as D, createBlock as A, toDisplayString as x, Fragment as I, renderList as E, normalizeStyle as Z, resolveDynamicComponent as B, withModifiers as U, computed as N, renderSlot as q, vModelRadio as Y, vModelCheckbox as Te, getCurrentInstance as De, createStaticVNode as Ie, mergeProps as K, vShow as je, Teleport as Ve, TransitionGroup as Ae, withCtx as ze } from "vue";
2
2
  /**
3
3
  * @license lucide-vue-next v0.535.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const me = (l) => l.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ze = (l) => l.replace(
8
+ const pe = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), He = (a) => a.replace(
9
9
  /^([A-Z])|[\s-_]+(\w)/g,
10
- (i, n, t) => t ? t.toUpperCase() : n.toLowerCase()
11
- ), je = (l) => {
12
- const i = ze(l);
13
- return i.charAt(0).toUpperCase() + i.slice(1);
14
- }, Ve = (...l) => l.filter((i, n, t) => !!i && i.trim() !== "" && t.indexOf(i) === n).join(" ").trim();
10
+ (l, o, e) => e ? e.toUpperCase() : o.toLowerCase()
11
+ ), Ee = (a) => {
12
+ const l = He(a);
13
+ return l.charAt(0).toUpperCase() + l.slice(1);
14
+ }, Fe = (...a) => a.filter((l, o, e) => !!l && l.trim() !== "" && e.indexOf(l) === o).join(" ").trim();
15
15
  /**
16
16
  * @license lucide-vue-next v0.535.0 - ISC
17
17
  *
18
18
  * This source code is licensed under the ISC license.
19
19
  * See the LICENSE file in the root directory of this source tree.
20
20
  */
21
- var Z = {
21
+ var J = {
22
22
  xmlns: "http://www.w3.org/2000/svg",
23
23
  width: 24,
24
24
  height: 24,
@@ -35,21 +35,21 @@ var Z = {
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
37
  */
38
- const Fe = ({ size: l, strokeWidth: i = 2, absoluteStrokeWidth: n, color: t, iconNode: s, name: f, class: o, ...m }, { slots: v }) => Y(
38
+ const Se = ({ size: a, strokeWidth: l = 2, absoluteStrokeWidth: o, color: e, iconNode: n, name: g, class: d, ...y }, { slots: v }) => te(
39
39
  "svg",
40
40
  {
41
- ...Z,
42
- width: l || Z.width,
43
- height: l || Z.height,
44
- stroke: t || Z.stroke,
45
- "stroke-width": n ? Number(i) * 24 / Number(l) : i,
46
- class: Ve(
41
+ ...J,
42
+ width: a || J.width,
43
+ height: a || J.height,
44
+ stroke: e || J.stroke,
45
+ "stroke-width": o ? Number(l) * 24 / Number(a) : l,
46
+ class: Fe(
47
47
  "lucide",
48
- ...f ? [`lucide-${me(je(f))}-icon`, `lucide-${me(f)}`] : ["lucide-icon"]
48
+ ...g ? [`lucide-${pe(Ee(g))}-icon`, `lucide-${pe(g)}`] : ["lucide-icon"]
49
49
  ),
50
- ...m
50
+ ...y
51
51
  },
52
- [...s.map((g) => Y(...g)), ...v.default ? [v.default()] : []]
52
+ [...n.map((p) => te(...p)), ...v.default ? [v.default()] : []]
53
53
  );
54
54
  /**
55
55
  * @license lucide-vue-next v0.535.0 - ISC
@@ -57,14 +57,14 @@ const Fe = ({ size: l, strokeWidth: i = 2, absoluteStrokeWidth: n, color: t, ico
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
59
  */
60
- const T = (l, i) => (n, { slots: t }) => Y(
61
- Fe,
60
+ const V = (a, l) => (o, { slots: e }) => te(
61
+ Se,
62
62
  {
63
- ...n,
64
- iconNode: i,
65
- name: l
63
+ ...o,
64
+ iconNode: l,
65
+ name: a
66
66
  },
67
- t
67
+ e
68
68
  );
69
69
  /**
70
70
  * @license lucide-vue-next v0.535.0 - ISC
@@ -72,7 +72,7 @@ const T = (l, i) => (n, { slots: t }) => Y(
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
74
  */
75
- const He = T("archive", [
75
+ const Ne = V("archive", [
76
76
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
77
77
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
78
78
  ["path", { d: "M10 12h4", key: "a56b0p" }]
@@ -83,7 +83,7 @@ const He = T("archive", [
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
85
  */
86
- const Ae = T("arrow-right", [
86
+ const Oe = V("arrow-right", [
87
87
  ["path", { d: "M5 12h14", key: "1ays0h" }],
88
88
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
89
89
  ]);
@@ -93,7 +93,7 @@ const Ae = T("arrow-right", [
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
95
  */
96
- const Se = T("circle-check-big", [
96
+ const Be = V("circle-check-big", [
97
97
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
98
98
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
99
99
  ]);
@@ -103,7 +103,7 @@ const Se = T("circle-check-big", [
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
105
  */
106
- const ce = T("download", [
106
+ const ve = V("download", [
107
107
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
108
108
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
109
109
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
@@ -114,7 +114,7 @@ const ce = T("download", [
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
116
  */
117
- const Ee = T("ellipsis", [
117
+ const Pe = V("ellipsis", [
118
118
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
119
119
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
120
120
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
@@ -125,7 +125,7 @@ const Ee = T("ellipsis", [
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
127
  */
128
- const q = T("file-text", [
128
+ const G = V("file-text", [
129
129
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
130
130
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
131
131
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
@@ -138,7 +138,7 @@ const q = T("file-text", [
138
138
  * This source code is licensed under the ISC license.
139
139
  * See the LICENSE file in the root directory of this source tree.
140
140
  */
141
- const Oe = T("file", [
141
+ const Re = V("file", [
142
142
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
143
143
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
144
144
  ]);
@@ -148,7 +148,7 @@ const Oe = T("file", [
148
148
  * This source code is licensed under the ISC license.
149
149
  * See the LICENSE file in the root directory of this source tree.
150
150
  */
151
- const Be = T("grid-3x3", [
151
+ const Ue = V("grid-3x3", [
152
152
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
153
153
  ["path", { d: "M3 9h18", key: "1pudct" }],
154
154
  ["path", { d: "M3 15h18", key: "5xshup" }],
@@ -161,7 +161,7 @@ const Be = T("grid-3x3", [
161
161
  * This source code is licensed under the ISC license.
162
162
  * See the LICENSE file in the root directory of this source tree.
163
163
  */
164
- const Ne = T("heart", [
164
+ const We = V("heart", [
165
165
  [
166
166
  "path",
167
167
  {
@@ -176,7 +176,7 @@ const Ne = T("heart", [
176
176
  * This source code is licensed under the ISC license.
177
177
  * See the LICENSE file in the root directory of this source tree.
178
178
  */
179
- const Re = T("history", [
179
+ const qe = V("history", [
180
180
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
181
181
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
182
182
  ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
@@ -187,7 +187,7 @@ const Re = T("history", [
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
189
  */
190
- const ge = T("image", [
190
+ const me = V("image", [
191
191
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
192
192
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
193
193
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
@@ -198,7 +198,7 @@ const ge = T("image", [
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
200
  */
201
- const Ue = T("list", [
201
+ const Ge = V("list", [
202
202
  ["path", { d: "M3 12h.01", key: "nlz23k" }],
203
203
  ["path", { d: "M3 18h.01", key: "1tta3j" }],
204
204
  ["path", { d: "M3 6h.01", key: "1rqtza" }],
@@ -212,7 +212,7 @@ const Ue = T("list", [
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
214
  */
215
- const Pe = T("plus", [
215
+ const be = V("plus", [
216
216
  ["path", { d: "M5 12h14", key: "1ays0h" }],
217
217
  ["path", { d: "M12 5v14", key: "s699le" }]
218
218
  ]);
@@ -222,7 +222,7 @@ const Pe = T("plus", [
222
222
  * This source code is licensed under the ISC license.
223
223
  * See the LICENSE file in the root directory of this source tree.
224
224
  */
225
- const We = T("reply", [
225
+ const Ke = V("reply", [
226
226
  ["path", { d: "M20 18v-2a4 4 0 0 0-4-4H4", key: "5vmcpk" }],
227
227
  ["path", { d: "m9 17-5-5 5-5", key: "nvlc11" }]
228
228
  ]);
@@ -232,7 +232,7 @@ const We = T("reply", [
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
234
  */
235
- const xe = T("send", [
235
+ const xe = V("send", [
236
236
  [
237
237
  "path",
238
238
  {
@@ -248,18 +248,7 @@ const xe = T("send", [
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
250
  */
251
- const Ge = T("share", [
252
- ["path", { d: "M12 2v13", key: "1km8f5" }],
253
- ["path", { d: "m16 6-4-4-4 4", key: "13yo43" }],
254
- ["path", { d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8", key: "1b2hhj" }]
255
- ]);
256
- /**
257
- * @license lucide-vue-next v0.535.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */
262
- const qe = T("sheet", [
251
+ const Ze = V("sheet", [
263
252
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
264
253
  ["line", { x1: "3", x2: "21", y1: "9", y2: "9", key: "1vqk6q" }],
265
254
  ["line", { x1: "3", x2: "21", y1: "15", y2: "15", key: "o2sbyz" }],
@@ -272,7 +261,7 @@ const qe = T("sheet", [
272
261
  * This source code is licensed under the ISC license.
273
262
  * See the LICENSE file in the root directory of this source tree.
274
263
  */
275
- const Ke = T("square-pen", [
264
+ const Je = V("square-pen", [
276
265
  ["path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7", key: "1m0v6g" }],
277
266
  [
278
267
  "path",
@@ -288,7 +277,7 @@ const Ke = T("square-pen", [
288
277
  * This source code is licensed under the ISC license.
289
278
  * See the LICENSE file in the root directory of this source tree.
290
279
  */
291
- const ue = T("trash-2", [
280
+ const de = V("trash-2", [
292
281
  ["path", { d: "M10 11v6", key: "nco0om" }],
293
282
  ["path", { d: "M14 11v6", key: "outv1u" }],
294
283
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
@@ -301,7 +290,7 @@ const ue = T("trash-2", [
301
290
  * This source code is licensed under the ISC license.
302
291
  * See the LICENSE file in the root directory of this source tree.
303
292
  */
304
- const Ze = T("user-check", [
293
+ const Xe = V("user-check", [
305
294
  ["path", { d: "m16 11 2 2 4-4", key: "9rsbq5" }],
306
295
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
307
296
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
@@ -312,7 +301,7 @@ const Ze = T("user-check", [
312
301
  * This source code is licensed under the ISC license.
313
302
  * See the LICENSE file in the root directory of this source tree.
314
303
  */
315
- const pe = T("user", [
304
+ const ce = V("user", [
316
305
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
317
306
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
318
307
  ]);
@@ -322,7 +311,7 @@ const pe = T("user", [
322
311
  * This source code is licensed under the ISC license.
323
312
  * See the LICENSE file in the root directory of this source tree.
324
313
  */
325
- const Je = T("video", [
314
+ const Qe = V("video", [
326
315
  [
327
316
  "path",
328
317
  {
@@ -338,234 +327,234 @@ const Je = T("video", [
338
327
  * This source code is licensed under the ISC license.
339
328
  * See the LICENSE file in the root directory of this source tree.
340
329
  */
341
- const X = T("x", [
330
+ const ue = V("x", [
342
331
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
343
332
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
344
- ]), Xe = { class: "border-t pt-3 mt-4" }, Qe = { class: "flex gap-2" }, Ye = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, et = { class: "flex-1 space-y-2" }, tt = { class: "flex justify-between items-center" }, st = { class: "flex gap-2" }, ot = ["disabled"], ke = /* @__PURE__ */ I({
333
+ ]), Ye = { class: "border-t pt-3 mt-4" }, et = { class: "flex gap-2" }, tt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, st = { class: "flex-1 space-y-2" }, ot = { class: "flex justify-between items-center" }, nt = { class: "flex gap-2" }, it = ["disabled"], ke = /* @__PURE__ */ j({
345
334
  __name: "CommentInputZone",
346
335
  props: {
347
336
  isReply: { type: Boolean, required: !1, default: !1 },
348
337
  isReplyModifiers: {}
349
338
  },
350
- emits: /* @__PURE__ */ J(["sendComment"], ["update:isReply"]),
351
- setup(l, { emit: i }) {
352
- const n = le(l, "isReply"), t = M(""), s = i, f = () => {
353
- t.value.trim() && (s("sendComment", t.value), t.value = "");
354
- }, o = (m) => {
355
- (m.ctrlKey || m.metaKey) && m.key === "Enter" && (m.preventDefault(), f());
339
+ emits: /* @__PURE__ */ X(["sendComment"], ["update:isReply"]),
340
+ setup(a, { emit: l }) {
341
+ const o = ae(a, "isReply"), e = $(""), n = l, g = () => {
342
+ e.value.trim() && (n("sendComment", e.value), e.value = "");
343
+ }, d = (y) => {
344
+ (y.ctrlKey || y.metaKey) && y.key === "Enter" && (y.preventDefault(), g());
356
345
  };
357
- return (m, v) => (a(), r("div", Xe, [
358
- e("div", Qe, [
359
- e("span", Ye, [
360
- w(_(pe), { class: "h-3 w-3 text-gray-500" })
346
+ return (y, v) => (s(), i("div", Ye, [
347
+ t("div", et, [
348
+ t("span", tt, [
349
+ M(w(ce), { class: "h-3 w-3 text-gray-500" })
361
350
  ]),
362
- e("div", et, [
363
- U(e("textarea", {
364
- "onUpdate:modelValue": v[0] || (v[0] = (g) => t.value = g),
365
- onKeydown: o,
351
+ t("div", st, [
352
+ R(t("textarea", {
353
+ "onUpdate:modelValue": v[0] || (v[0] = (p) => e.value = p),
354
+ onKeydown: d,
366
355
  placeholder: "Add a comment...",
367
356
  class: "w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"
368
357
  }, null, 544), [
369
- [ye, t.value]
358
+ [fe, e.value]
370
359
  ]),
371
- e("div", tt, [
372
- v[4] || (v[4] = e("span", { class: "text-xs text-gray-500 hidden sm:inline" }, "Cmd+Enter to send", -1)),
373
- e("div", st, [
374
- n.value ? (a(), r("button", {
360
+ t("div", ot, [
361
+ v[4] || (v[4] = t("span", { class: "text-xs text-gray-500 hidden sm:inline" }, "Cmd+Enter to send", -1)),
362
+ t("div", nt, [
363
+ o.value ? (s(), i("button", {
375
364
  key: 0,
376
365
  class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
377
- onClick: v[1] || (v[1] = (g) => n.value = !1)
366
+ onClick: v[1] || (v[1] = (p) => o.value = !1)
378
367
  }, [
379
- w(_(X), { class: "h-3 w-3" }),
380
- v[2] || (v[2] = H(" Cancel ", -1))
381
- ])) : $("", !0),
382
- e("button", {
368
+ M(w(ue), { class: "h-3 w-3" }),
369
+ v[2] || (v[2] = F(" Cancel ", -1))
370
+ ])) : b("", !0),
371
+ t("button", {
383
372
  class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
384
- disabled: !t.value.trim(),
385
- onClick: f
373
+ disabled: !e.value.trim(),
374
+ onClick: g
386
375
  }, [
387
- w(_(xe), { class: "h-3 w-3 mr-1" }),
388
- v[3] || (v[3] = H(" Send ", -1))
389
- ], 8, ot)
376
+ M(w(xe), { class: "h-3 w-3 mr-1" }),
377
+ v[3] || (v[3] = F(" Send ", -1))
378
+ ], 8, it)
390
379
  ])
391
380
  ])
392
381
  ])
393
382
  ])
394
383
  ]));
395
384
  }
396
- }), nt = { class: "z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto" }, it = /* @__PURE__ */ I({
385
+ }), lt = { class: "z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto" }, at = /* @__PURE__ */ j({
397
386
  __name: "CommentDetails",
398
387
  props: {
399
388
  showMoreOptions: { type: Boolean, required: !0, default: !1 },
400
389
  showMoreOptionsModifiers: {}
401
390
  },
402
- emits: /* @__PURE__ */ J(["edit", "delete"], ["update:showMoreOptions"]),
403
- setup(l, { emit: i }) {
404
- const n = i, t = le(l, "showMoreOptions"), s = M(), f = M(!0), o = async (g) => {
405
- t.value && s.value && !s.value.contains(g.target) && !f.value && (t.value = !1), f.value = !1;
406
- }, m = () => {
407
- t.value = !1, n("edit");
391
+ emits: /* @__PURE__ */ X(["edit", "delete"], ["update:showMoreOptions"]),
392
+ setup(a, { emit: l }) {
393
+ const o = l, e = ae(a, "showMoreOptions"), n = $(), g = $(!0), d = async (p) => {
394
+ e.value && n.value && !n.value.contains(p.target) && !g.value && (e.value = !1), g.value = !1;
395
+ }, y = () => {
396
+ e.value = !1, o("edit");
408
397
  }, v = () => {
409
- t.value = !1, n("delete");
398
+ e.value = !1, o("delete");
410
399
  };
411
400
  return re(() => {
412
- document.addEventListener("click", o);
413
- }), de(() => {
414
- document.removeEventListener("click", o);
415
- }), (g, d) => (a(), r("div", {
401
+ document.addEventListener("click", d);
402
+ }), ye(() => {
403
+ document.removeEventListener("click", d);
404
+ }), (p, r) => (s(), i("div", {
416
405
  class: "absolute bg-white left-0 top-full transform min-w-max z-50",
417
406
  ref_key: "moreOptionsRef",
418
- ref: s
407
+ ref: n
419
408
  }, [
420
- e("div", nt, [
421
- e("div", {
409
+ t("div", lt, [
410
+ t("div", {
422
411
  class: "relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",
423
- onClick: m
412
+ onClick: y
424
413
  }, [
425
- w(_(Ke), { class: "h-3 w-3 mr-2" }),
426
- d[0] || (d[0] = H(" Edit ", -1))
414
+ M(w(Je), { class: "h-3 w-3 mr-2" }),
415
+ r[0] || (r[0] = F(" Edit ", -1))
427
416
  ]),
428
- e("div", {
417
+ t("div", {
429
418
  class: "relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",
430
419
  onClick: v
431
420
  }, [
432
- w(_(ue), { class: "h-3 w-3 mr-2" }),
433
- d[1] || (d[1] = H(" Delete ", -1))
421
+ M(w(de), { class: "h-3 w-3 mr-2" }),
422
+ r[1] || (r[1] = F(" Delete ", -1))
434
423
  ])
435
424
  ])
436
425
  ], 512));
437
426
  }
438
- }), at = { class: "space-y-2" }, lt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, rt = { class: "flex-1 min-w-0 space-y-1 relative" }, dt = { class: "flex items-center gap-2" }, ct = { class: "font-medium text-xs" }, ut = { class: "text-xs text-gray-500" }, pt = {
427
+ }), rt = { class: "space-y-2" }, dt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, ct = { class: "flex-1 min-w-0 space-y-1 relative" }, ut = { class: "flex items-center gap-2" }, pt = { class: "font-medium text-xs" }, mt = { class: "text-xs text-gray-500" }, gt = {
439
428
  key: 0,
440
429
  class: "text-xs text-gray-700 leading-relaxed"
441
- }, mt = { class: "flex justify-between text-xs" }, gt = { class: "flex items-center gap-2" }, ht = {
430
+ }, ht = { class: "flex justify-between text-xs" }, ft = { class: "flex items-center gap-2" }, yt = {
442
431
  key: 0,
443
432
  class: "flex gap-2"
444
- }, ft = ["disabled"], vt = {
433
+ }, vt = ["disabled"], bt = {
445
434
  key: 0,
446
435
  class: "ml-8 space-y-1 border-l-2 border-gray-100 pl-3"
447
- }, yt = /* @__PURE__ */ I({
436
+ }, xt = /* @__PURE__ */ j({
448
437
  __name: "CommentItem",
449
438
  props: {
450
439
  comment: {},
451
440
  isInside: { type: Boolean }
452
441
  },
453
442
  emits: ["like", "reply", "edit", "delete"],
454
- setup(l, { emit: i }) {
455
- const n = i, t = l, s = M(t.comment.text), f = M("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"), o = M("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"), m = M(!1), v = M(!1), g = M(!1), d = M(!1), y = (c) => {
456
- const h = /* @__PURE__ */ new Date(), F = Math.floor(
457
- (h.getTime() - c.getTime()) / (1e3 * 60 * 60)
443
+ setup(a, { emit: l }) {
444
+ const o = l, e = a, n = $(e.comment.text), g = $("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"), d = $("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"), y = $(!1), v = $(!1), p = $(!1), r = $(!1), f = (c) => {
445
+ const u = /* @__PURE__ */ new Date(), T = Math.floor(
446
+ (u.getTime() - c.getTime()) / (1e3 * 60 * 60)
458
447
  );
459
- return F < 1 ? `${Math.floor(
460
- (h.getTime() - c.getTime()) / 6e4
461
- )}m` : F < 24 ? `${F}h` : `${Math.floor(F / 24)}d`;
462
- }, p = () => {
463
- d.value = !d.value, d.value ? n("like", t.comment.id, "add") : n("like", t.comment.id, "delete");
464
- }, b = () => {
465
- n("edit", t.comment.id, s.value), g.value = !1;
466
- }, W = (c, h) => {
467
- n("like", c, h);
468
- }, V = (c, h) => {
469
- n("edit", c, h);
448
+ return T < 1 ? `${Math.floor(
449
+ (u.getTime() - c.getTime()) / 6e4
450
+ )}m` : T < 24 ? `${T}h` : `${Math.floor(T / 24)}d`;
451
+ }, m = () => {
452
+ r.value = !r.value, r.value ? o("like", e.comment.id, "add") : o("like", e.comment.id, "delete");
453
+ }, C = () => {
454
+ o("edit", e.comment.id, n.value), p.value = !1;
455
+ }, O = (c, u) => {
456
+ o("like", c, u);
457
+ }, z = (c, u) => {
458
+ o("edit", c, u);
470
459
  };
471
- return (c, h) => {
472
- const F = ee("CommentItem", !0);
473
- return a(), r("div", at, [
474
- e("div", {
475
- class: D(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative", g.value ? "bg-gray-50" : ""])
460
+ return (c, u) => {
461
+ const T = Q("CommentItem", !0);
462
+ return s(), i("div", rt, [
463
+ t("div", {
464
+ class: D(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative", p.value ? "bg-gray-50" : ""])
476
465
  }, [
477
- e("span", lt, [
478
- w(_(pe), { class: "h-3 w-3 text-gray-500" })
466
+ t("span", dt, [
467
+ M(w(ce), { class: "h-3 w-3 text-gray-500" })
479
468
  ]),
480
- e("div", rt, [
481
- e("div", dt, [
482
- e("span", ct, k(c.comment?.author), 1),
483
- e("span", ut, k(y(c.comment?.createdAt)), 1)
469
+ t("div", ct, [
470
+ t("div", ut, [
471
+ t("span", pt, x(c.comment?.author), 1),
472
+ t("span", mt, x(f(c.comment?.createdAt)), 1)
484
473
  ]),
485
- g.value ? U((a(), r("textarea", {
474
+ p.value ? R((s(), i("textarea", {
486
475
  key: 1,
487
- "onUpdate:modelValue": h[0] || (h[0] = (C) => s.value = C),
488
- class: D(g.value ? o.value : f.value)
476
+ "onUpdate:modelValue": u[0] || (u[0] = (k) => n.value = k),
477
+ class: D(p.value ? d.value : g.value)
489
478
  }, null, 2)), [
490
- [ye, s.value]
491
- ]) : (a(), r("p", pt, k(c.comment?.text), 1)),
492
- e("div", mt, [
493
- e("div", gt, [
494
- e("button", {
495
- class: D(["flex items-center gap-1", d.value ? "text-blue-600" : "text-gray-500 hover:text-blue-600 transition-colors"]),
496
- onClick: h[1] || (h[1] = (C) => p())
479
+ [fe, n.value]
480
+ ]) : (s(), i("p", gt, x(c.comment?.text), 1)),
481
+ t("div", ht, [
482
+ t("div", ft, [
483
+ t("button", {
484
+ class: D(["flex items-center gap-1", r.value ? "text-blue-600" : "text-gray-500 hover:text-blue-600 transition-colors"]),
485
+ onClick: u[1] || (u[1] = (k) => m())
497
486
  }, [
498
- w(_(Ne), {
499
- class: D(["h-3 w-3", d.value ? "fill-blue-600" : ""])
487
+ M(w(We), {
488
+ class: D(["h-3 w-3", r.value ? "fill-blue-600" : ""])
500
489
  }, null, 8, ["class"]),
501
- H(" " + k(c.comment?.likes), 1)
490
+ F(" " + x(c.comment?.likes), 1)
502
491
  ], 2),
503
- c.isInside ? $("", !0) : (a(), r("button", {
492
+ c.isInside ? b("", !0) : (s(), i("button", {
504
493
  key: 0,
505
494
  class: "text-gray-500 hover:text-blue-600 transition-colors",
506
- onClick: h[2] || (h[2] = (C) => v.value = !0)
495
+ onClick: u[2] || (u[2] = (k) => v.value = !0)
507
496
  }, [
508
- w(_(We), { class: "h-3 w-3" })
497
+ M(w(Ke), { class: "h-3 w-3" })
509
498
  ])),
510
- e("button", {
499
+ t("button", {
511
500
  class: "text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",
512
501
  type: "button",
513
- onClick: h[3] || (h[3] = (C) => m.value = !0)
502
+ onClick: u[3] || (u[3] = (k) => y.value = !0)
514
503
  }, [
515
- w(_(Ee), { class: "h-3 w-3" })
504
+ M(w(Pe), { class: "h-3 w-3" })
516
505
  ])
517
506
  ]),
518
- g.value ? (a(), r("div", ht, [
519
- e("button", {
507
+ p.value ? (s(), i("div", yt, [
508
+ t("button", {
520
509
  class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
521
- onClick: h[4] || (h[4] = (C) => g.value = !1)
510
+ onClick: u[4] || (u[4] = (k) => p.value = !1)
522
511
  }, [
523
- w(_(X), { class: "h-3 w-3" }),
524
- h[11] || (h[11] = H(" Cancel ", -1))
512
+ M(w(ue), { class: "h-3 w-3" }),
513
+ u[11] || (u[11] = F(" Cancel ", -1))
525
514
  ]),
526
- e("button", {
515
+ t("button", {
527
516
  class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
528
- disabled: !s.value.trim(),
529
- onClick: h[5] || (h[5] = (C) => b())
517
+ disabled: !n.value.trim(),
518
+ onClick: u[5] || (u[5] = (k) => C())
530
519
  }, [
531
- w(_(xe), { class: "h-3 w-3 mr-1" }),
532
- h[12] || (h[12] = H(" Send ", -1))
533
- ], 8, ft)
534
- ])) : $("", !0)
520
+ M(w(xe), { class: "h-3 w-3 mr-1" }),
521
+ u[12] || (u[12] = F(" Send ", -1))
522
+ ], 8, vt)
523
+ ])) : b("", !0)
535
524
  ])
536
525
  ]),
537
- m.value ? (a(), j(it, {
526
+ y.value ? (s(), A(at, {
538
527
  key: 0,
539
- showMoreOptions: m.value,
540
- "onUpdate:showMoreOptions": h[6] || (h[6] = (C) => m.value = C),
541
- onEdit: h[7] || (h[7] = (C) => g.value = !0),
542
- onDelete: h[8] || (h[8] = (C) => c.$emit("delete", c.comment?.id)),
528
+ showMoreOptions: y.value,
529
+ "onUpdate:showMoreOptions": u[6] || (u[6] = (k) => y.value = k),
530
+ onEdit: u[7] || (u[7] = (k) => p.value = !0),
531
+ onDelete: u[8] || (u[8] = (k) => c.$emit("delete", c.comment?.id)),
543
532
  comment: c.comment
544
- }, null, 8, ["showMoreOptions", "comment"])) : $("", !0)
533
+ }, null, 8, ["showMoreOptions", "comment"])) : b("", !0)
545
534
  ], 2),
546
- c.isInside ? $("", !0) : (a(), r("div", vt, [
547
- (a(!0), r(A, null, S(c.comment?.replies, (C) => (a(), j(F, {
548
- key: C.id,
549
- comment: C,
535
+ c.isInside ? b("", !0) : (s(), i("div", bt, [
536
+ (s(!0), i(I, null, E(c.comment?.replies, (k) => (s(), A(T, {
537
+ key: k.id,
538
+ comment: k,
550
539
  isInside: !0,
551
- onDelete: (x) => c.$emit("delete", C.id),
552
- onLike: W,
553
- onEdit: V
540
+ onDelete: (_) => c.$emit("delete", k.id),
541
+ onLike: O,
542
+ onEdit: z
554
543
  }, null, 8, ["comment", "onDelete"]))), 128)),
555
- v.value && !c.isInside ? (a(), j(ke, {
544
+ v.value && !c.isInside ? (s(), A(ke, {
556
545
  key: 0,
557
- onSendComment: h[9] || (h[9] = (C) => c.$emit("reply", c.comment?.id, C)),
546
+ onSendComment: u[9] || (u[9] = (k) => c.$emit("reply", c.comment?.id, k)),
558
547
  isReply: v.value,
559
- "onUpdate:isReply": h[10] || (h[10] = (C) => v.value = C)
560
- }, null, 8, ["isReply"])) : $("", !0)
548
+ "onUpdate:isReply": u[10] || (u[10] = (k) => v.value = k)
549
+ }, null, 8, ["isReply"])) : b("", !0)
561
550
  ]))
562
551
  ]);
563
552
  };
564
553
  }
565
- }), bt = ["id"], xt = {
554
+ }), kt = ["id"], _t = {
566
555
  key: 0,
567
556
  class: "text-xl font-semibold text-gray-900 mb-4"
568
- }, se = /* @__PURE__ */ I({
557
+ }, se = /* @__PURE__ */ j({
569
558
  __name: "CommentsWidget",
570
559
  props: {
571
560
  title: {},
@@ -581,79 +570,79 @@ const X = T("x", [
581
570
  style: {}
582
571
  },
583
572
  emits: ["add", "reply", "like", "delete", "edit"],
584
- setup(l, { emit: i }) {
585
- const n = l, t = i, s = (g) => {
586
- n?.onAddComment?.(g), t("add", g);
587
- }, f = (g, d) => {
588
- n?.onLike?.(g, d), t("like", g, d);
589
- }, o = (g, d) => {
590
- n.onReply?.(g, d), t("reply", g, d);
591
- }, m = (g, d) => {
592
- n.onEdit?.(g, d), t("edit", g, d);
593
- }, v = (g) => {
594
- n.onDelete?.(g), t("delete", g);
573
+ setup(a, { emit: l }) {
574
+ const o = a, e = l, n = (p) => {
575
+ o?.onAddComment?.(p), e("add", p);
576
+ }, g = (p, r) => {
577
+ o?.onLike?.(p, r), e("like", p, r);
578
+ }, d = (p, r) => {
579
+ o.onReply?.(p, r), e("reply", p, r);
580
+ }, y = (p, r) => {
581
+ o.onEdit?.(p, r), e("edit", p, r);
582
+ }, v = (p) => {
583
+ o.onDelete?.(p), e("delete", p);
595
584
  };
596
- return (g, d) => (a(), r("div", {
597
- class: D(["mx-auto font-sans", g.className]),
598
- id: g.id,
599
- style: R(g.style)
585
+ return (p, r) => (s(), i("div", {
586
+ class: D(["mx-auto font-sans", p.className]),
587
+ id: p.id,
588
+ style: Z(p.style)
600
589
  }, [
601
- g.title ? (a(), r("h3", xt, k(g.title), 1)) : $("", !0),
602
- e("div", {
603
- class: D([g.maxHeight ? "overflow-y-auto" : "", "space-y-3"]),
604
- style: R({ maxHeight: g.maxHeight + "px" })
590
+ p.title ? (s(), i("h3", _t, x(p.title), 1)) : b("", !0),
591
+ t("div", {
592
+ class: D([p.maxHeight ? "overflow-y-auto" : "", "space-y-3"]),
593
+ style: Z({ maxHeight: p.maxHeight + "px" })
605
594
  }, [
606
- (a(!0), r(A, null, S(g.comments, (y) => (a(), j(yt, {
607
- key: y.id,
608
- comment: y,
609
- onReply: o,
610
- onLike: f,
611
- onDelete: d[0] || (d[0] = (p) => v(p)),
612
- onEdit: m
595
+ (s(!0), i(I, null, E(p.comments, (f) => (s(), A(xt, {
596
+ key: f.id,
597
+ comment: f,
598
+ onReply: d,
599
+ onLike: g,
600
+ onDelete: r[0] || (r[0] = (m) => v(m)),
601
+ onEdit: y
613
602
  }, null, 8, ["comment"]))), 128))
614
603
  ], 6),
615
- w(ke, {
616
- onSendComment: d[1] || (d[1] = (y) => s(y))
604
+ M(ke, {
605
+ onSendComment: r[1] || (r[1] = (f) => n(f))
617
606
  })
618
- ], 14, bt));
607
+ ], 14, kt));
619
608
  }
620
- }), he = /* @__PURE__ */ new Map([
609
+ }), ge = /* @__PURE__ */ new Map([
621
610
  ["file", {
622
611
  name: "File",
623
612
  color: "bg-green-100 text-green-700 border-green-200",
624
- icon: q
613
+ icon: G
625
614
  }],
626
615
  ["post", {
627
616
  name: "Post",
628
617
  color: "bg-blue-100 text-blue-700 border-blue-200",
629
- icon: qe
618
+ icon: Ze
630
619
  }],
631
620
  ["user", {
632
621
  name: "User",
633
622
  color: "bg-purple-100 text-purple-700 border-purple-200",
634
- icon: Ze
623
+ icon: Xe
635
624
  }],
636
625
  ["custom", {
637
626
  name: "Custom",
638
627
  color: "bg-gray-100 text-gray-700 border-gray-200",
639
- icon: Re
628
+ icon: qe
640
629
  }]
641
- ]), kt = { class: "mx-auto font-sans" }, _t = {
630
+ ]), wt = { class: "mx-auto font-sans" }, $t = {
642
631
  key: 0,
643
632
  class: "text-xl font-semibold text-gray-900 mb-4"
644
- }, wt = { class: "relative" }, $t = { class: "space-y-3" }, Ct = { class: "flex-1 min-w-0 pb-2" }, Mt = { class: "flex items-center gap-1.5 mb-1 mt-0.5" }, Lt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, Dt = { class: "font-medium text-xs" }, Tt = { class: "text-xs text-gray-500" }, It = { class: "space-y-1" }, zt = { class: "text-xs text-gray-700" }, jt = { class: "capitalize mr-1" }, Vt = {
633
+ }, Ct = { class: "relative" }, Mt = { class: "space-y-3" }, Lt = { class: "flex-1 min-w-0 pb-2" }, Tt = { class: "flex items-center gap-1.5 mb-1 mt-0.5" }, Dt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, It = { class: "font-medium text-xs" }, jt = { class: "text-xs text-gray-500" }, Vt = { class: "space-y-1" }, At = { class: "text-xs text-gray-700" }, zt = { class: "capitalize mr-1" }, Ht = {
645
634
  key: 0,
646
635
  class: "inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"
647
- }, Ft = {
636
+ }, Et = {
648
637
  key: 0,
649
638
  class: "flex items-center gap-1 text-xs"
650
- }, Ht = {
639
+ }, Ft = {
651
640
  key: 0,
652
641
  class: "bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"
653
- }, At = {
642
+ }, St = {
654
643
  key: 2,
655
644
  class: "bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"
656
- }, oe = /* @__PURE__ */ I({
645
+ }, oe = /* @__PURE__ */ j({
657
646
  __name: "HistoryWidget",
658
647
  props: {
659
648
  data: {},
@@ -663,57 +652,57 @@ const X = T("x", [
663
652
  className: {},
664
653
  style: {}
665
654
  },
666
- setup(l) {
667
- const i = l, n = M(i.data ?? []);
668
- n.value.length === 0 && i.id && t(), console.log(i);
669
- async function t() {
670
- const s = await fetch(`/api/widget/history/${i.id}`);
671
- if (!s.ok)
655
+ setup(a) {
656
+ const l = a, o = $(Array.isArray(l.data) ? l.data : []);
657
+ o.value.length === 0 && l.id && e();
658
+ async function e() {
659
+ const n = await fetch(`/api/widget/history/${l.id}`);
660
+ if (!n.ok)
672
661
  return { data: [] };
673
- const f = await s.json();
674
- f.rows.forEach((o) => {
675
- o.timestamp = new Date(o.cdate), o.id = o.entity_id, o.entityType = o.entity_type, o.entityId = o.entity_id, o.action = o.change_type, o.userId = o.change_user_id, o.userName = o.username, o.timestamp = new Date(o.cdate), o.description = o.username, o.status = o.username;
676
- }), n.value = f.rows;
662
+ const g = await n.json();
663
+ g.rows.forEach((d) => {
664
+ d.timestamp = new Date(d.cdate), d.id = d.entity_id, d.entityType = d.entity_type, d.entityId = d.entity_id, d.action = d.change_type, d.userId = d.change_user_id, d.userName = d.username, d.timestamp = new Date(d.cdate), d.description = d.username, d.status = d.username;
665
+ }), o.value = g.rows;
677
666
  }
678
- return (s, f) => (a(), r("div", kt, [
679
- s.title ? (a(), r("h3", _t, k(s.title), 1)) : $("", !0),
680
- e("div", {
681
- class: D(s.maxHeight ? "overflow-y-auto" : ""),
682
- style: R({ maxHeight: s.maxHeight + "px" })
667
+ return (n, g) => (s(), i("div", wt, [
668
+ n.title ? (s(), i("h3", $t, x(n.title), 1)) : b("", !0),
669
+ t("div", {
670
+ class: D(n.maxHeight ? "overflow-y-auto" : ""),
671
+ style: Z({ maxHeight: n.maxHeight + "px" })
683
672
  }, [
684
- e("div", wt, [
685
- f[0] || (f[0] = e("div", { class: "absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200" }, null, -1)),
686
- e("div", $t, [
687
- (a(!0), r(A, null, S(n.value, (o) => (a(), r("div", {
673
+ t("div", Ct, [
674
+ g[0] || (g[0] = t("div", { class: "absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200" }, null, -1)),
675
+ t("div", Mt, [
676
+ (s(!0), i(I, null, E(o.value, (d) => (s(), i("div", {
688
677
  class: "relative flex items-start gap-2",
689
- key: o?.id
678
+ key: d?.id
690
679
  }, [
691
- e("div", {
692
- class: D(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${_(he).get(o?.entityType)?.color}`)
680
+ t("div", {
681
+ class: D(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${w(ge).get(d?.entityType)?.color}`)
693
682
  }, [
694
- (a(), j(N(_(he).get(o?.entityType)?.icon), { class: "h-3 w-3" }))
683
+ (s(), A(B(w(ge).get(d?.entityType)?.icon), { class: "h-3 w-3" }))
695
684
  ], 2),
696
- e("div", Ct, [
697
- e("div", Mt, [
698
- e("span", Lt, [
699
- w(_(pe), { class: "h-3 w-3 text-gray-500" })
685
+ t("div", Lt, [
686
+ t("div", Tt, [
687
+ t("span", Dt, [
688
+ M(w(ce), { class: "h-3 w-3 text-gray-500" })
700
689
  ]),
701
- e("span", Dt, k(o?.userName), 1),
702
- e("span", Tt, k(o?.timestamp.toLocaleTimeString("ua-UA", { hour: "2-digit", minute: "2-digit" })), 1)
690
+ t("span", It, x(d?.userName), 1),
691
+ t("span", jt, x(d?.timestamp.toLocaleTimeString("ua-UA", { hour: "2-digit", minute: "2-digit" })), 1)
703
692
  ]),
704
- e("div", It, [
705
- e("div", zt, [
706
- e("span", jt, k(o?.action), 1),
707
- o?.entityId ? (a(), r("span", Vt, k(o?.entityId), 1)) : $("", !0)
693
+ t("div", Vt, [
694
+ t("div", At, [
695
+ t("span", zt, x(d?.action), 1),
696
+ d?.entityId ? (s(), i("span", Ht, x(d?.entityId), 1)) : b("", !0)
708
697
  ]),
709
- o?.changes?.[o?.entityId] ? (a(), r("div", Ft, [
710
- o?.changes?.[o?.entityId]?.old ? (a(), r("span", Ht, k(o?.changes?.[o?.entityId]?.old), 1)) : $("", !0),
711
- o?.changes?.[o?.entityId]?.old && o?.changes?.[o?.entityId]?.new ? (a(), j(_(Ae), {
698
+ d?.changes?.[d?.entityId] ? (s(), i("div", Et, [
699
+ d?.changes?.[d?.entityId]?.old ? (s(), i("span", Ft, x(d?.changes?.[d?.entityId]?.old), 1)) : b("", !0),
700
+ d?.changes?.[d?.entityId]?.old && d?.changes?.[d?.entityId]?.new ? (s(), A(w(Oe), {
712
701
  key: 1,
713
702
  class: "h-2 w-2 text-gray-400"
714
- })) : $("", !0),
715
- o?.changes?.[o?.entityId]?.new ? (a(), r("span", At, k(o?.changes?.[o?.entityId]?.new), 1)) : $("", !0)
716
- ])) : $("", !0)
703
+ })) : b("", !0),
704
+ d?.changes?.[d?.entityId]?.new ? (s(), i("span", St, x(d?.changes?.[d?.entityId]?.new), 1)) : b("", !0)
705
+ ])) : b("", !0)
717
706
  ])
718
707
  ])
719
708
  ]))), 128))
@@ -722,209 +711,209 @@ const X = T("x", [
722
711
  ], 6)
723
712
  ]));
724
713
  }
725
- }), St = {
714
+ }), Nt = {
726
715
  key: 0,
727
716
  class: "text-xl font-semibold"
728
- }, Et = { class: "flex gap-1" }, Ot = { class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer" }, Bt = /* @__PURE__ */ I({
717
+ }, Ot = { class: "flex gap-1" }, Bt = { class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer" }, Pt = /* @__PURE__ */ j({
729
718
  __name: "FileHeader",
730
- props: /* @__PURE__ */ J({
719
+ props: /* @__PURE__ */ X({
731
720
  title: {}
732
721
  }, {
733
722
  modelValue: {},
734
723
  modelModifiers: {}
735
724
  }),
736
- emits: /* @__PURE__ */ J(["onAddFile"], ["update:modelValue"]),
737
- setup(l) {
738
- const i = le(l, "modelValue"), n = {
725
+ emits: /* @__PURE__ */ X(["onAddFile"], ["update:modelValue"]),
726
+ setup(a) {
727
+ const l = ae(a, "modelValue"), o = {
739
728
  active: "bg-blue-100 text-black hover:bg-blue-100",
740
729
  inactive: "bg-white text-black hover:bg-blue-100"
741
730
  };
742
- return (t, s) => (a(), r("div", {
743
- class: D(["flex flex-col sm:flex-row gap-3 mb-4", t.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
731
+ return (e, n) => (s(), i("div", {
732
+ class: D(["flex flex-col sm:flex-row gap-3 mb-4", e.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
744
733
  }, [
745
- t.title ? (a(), r("h3", St, k(t.title), 1)) : $("", !0),
746
- e("div", Et, [
747
- e("button", {
748
- class: D(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2", i.value === "list" ? n.active : n.inactive]),
749
- onClick: s[0] || (s[0] = (f) => i.value = "list")
734
+ e.title ? (s(), i("h3", Nt, x(e.title), 1)) : b("", !0),
735
+ t("div", Ot, [
736
+ t("button", {
737
+ class: D(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2", l.value === "list" ? o.active : o.inactive]),
738
+ onClick: n[0] || (n[0] = (g) => l.value = "list")
750
739
  }, [
751
- w(_(Ue), { class: "h-4 w-4" })
740
+ M(w(Ge), { class: "h-4 w-4" })
752
741
  ], 2),
753
- e("button", {
754
- class: D(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2", i.value === "grid" ? n.active : n.inactive]),
755
- onClick: s[1] || (s[1] = (f) => i.value = "grid")
742
+ t("button", {
743
+ class: D(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2", l.value === "grid" ? o.active : o.inactive]),
744
+ onClick: n[1] || (n[1] = (g) => l.value = "grid")
756
745
  }, [
757
- w(_(Be), { class: "h-4 w-4" })
746
+ M(w(Ue), { class: "h-4 w-4" })
758
747
  ], 2),
759
- e("label", null, [
760
- e("input", {
748
+ t("label", null, [
749
+ t("input", {
761
750
  type: "file",
762
751
  class: "hidden",
763
- onChange: s[2] || (s[2] = (f) => t.$emit("onAddFile", f))
752
+ onChange: n[2] || (n[2] = (g) => e.$emit("onAddFile", g))
764
753
  }, null, 32),
765
- e("div", Ot, [
766
- w(_(Pe), { class: "h-4 w-4" }),
767
- s[3] || (s[3] = H(" Додати файл ", -1))
754
+ t("div", Bt, [
755
+ M(w(be), { class: "h-4 w-4" }),
756
+ n[3] || (n[3] = F(" Додати файл ", -1))
768
757
  ])
769
758
  ])
770
759
  ])
771
760
  ], 2));
772
761
  }
773
- }), fe = {
762
+ }), ee = {
774
763
  pdf: {
775
764
  color: "bg-red-100 text-red-700 border-red-200",
776
- icon: q,
765
+ icon: G,
777
766
  label: "PDF"
778
767
  },
779
768
  sketch: {
780
769
  color: "bg-gray-100 text-gray-700 border-gray-200",
781
- icon: Oe,
770
+ icon: Re,
782
771
  label: "SKETCH"
783
772
  },
784
773
  mp4: {
785
774
  color: "bg-purple-100 text-purple-700 border-purple-200",
786
- icon: Je,
775
+ icon: Qe,
787
776
  label: "VIDEO"
788
777
  },
789
778
  docx: {
790
779
  color: "bg-blue-100 text-blue-700 border-blue-200",
791
- icon: q,
780
+ icon: G,
792
781
  label: "DOC"
793
782
  },
794
783
  zip: {
795
784
  color: "bg-orange-100 text-orange-700 border-orange-200",
796
- icon: He,
785
+ icon: Ne,
797
786
  label: "ARCHIVE"
798
787
  },
799
788
  png: {
800
789
  color: "bg-green-100 text-green-700 border-green-200",
801
- icon: ge,
790
+ icon: me,
802
791
  label: "IMAGE"
803
792
  },
804
793
  jpg: {
805
794
  color: "bg-green-100 text-green-700 border-green-200",
806
- icon: ge,
795
+ icon: me,
807
796
  label: "IMAGE"
808
797
  },
809
798
  xlsx: {
810
799
  color: "bg-emerald-100 text-emerald-700 border-emerald-200",
811
- icon: q,
800
+ icon: G,
812
801
  label: "EXCEL"
813
802
  },
814
803
  pptx: {
815
804
  color: "bg-amber-100 text-amber-700 border-amber-200",
816
- icon: q,
805
+ icon: G,
817
806
  label: "PPT"
818
807
  }
819
808
  };
820
- function _e(l, i = "en") {
821
- const n = {
809
+ function _e(a, l = "en") {
810
+ const o = {
822
811
  month: "short",
823
812
  day: "numeric"
824
813
  };
825
- return new Intl.DateTimeFormat(i, n).format(l);
814
+ return new Intl.DateTimeFormat(l, o).format(a);
826
815
  }
827
- function we(l) {
828
- if (l === 0) return "0 B";
829
- const i = 1024, n = ["B", "KB", "MB", "GB", "TB"], t = Math.floor(Math.log(l) / Math.log(i));
830
- return `${parseFloat((l / Math.pow(i, t)).toFixed(1))} ${n[t]}`;
816
+ function we(a) {
817
+ if (a === 0) return "0 B";
818
+ const l = 1024, o = ["B", "KB", "MB", "GB", "TB"], e = Math.floor(Math.log(a) / Math.log(l));
819
+ return `${parseFloat((a / Math.pow(l, e)).toFixed(1))} ${o[e]}`;
831
820
  }
832
- const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = { class: "flex items-center gap-2" }, Wt = { class: "font-medium text-xs truncate hover:text-blue-600 cursor-pointer" }, Gt = { class: "hidden sm:block text-xs text-gray-500 w-16 text-right" }, qt = { class: "hidden md:block text-xs text-gray-500 w-12 text-right" }, Kt = { class: "flex items-center gap-1" }, Zt = ["onClick"], Jt = ["onClick"], Xt = /* @__PURE__ */ I({
821
+ const Rt = { class: "space-y-0.5" }, Ut = ["onClick"], Wt = ["onClick"], qt = { class: "flex items-center gap-2" }, Gt = { class: "font-medium text-xs truncate hover:text-blue-600 cursor-pointer" }, Kt = { class: "hidden sm:block text-xs text-gray-500 w-16 text-right" }, Zt = { class: "hidden md:block text-xs text-gray-500 w-12 text-right" }, Jt = { class: "flex items-center gap-1" }, Xt = ["onClick"], Qt = ["onClick"], $e = /* @__PURE__ */ j({
833
822
  __name: "FileList",
834
823
  props: {
835
824
  files: {}
836
825
  },
837
826
  emits: ["delete", "download", "openLightbox"],
838
- setup(l) {
839
- return (i, n) => (a(), r("div", Nt, [
840
- (a(!0), r(A, null, S(i.files, (t) => (a(), r("div", {
827
+ setup(a) {
828
+ return (l, o) => (s(), i("div", Rt, [
829
+ (s(!0), i(I, null, E(l.files, (e) => (s(), i("div", {
841
830
  class: "flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",
842
- key: t.id,
843
- onClick: K((s) => i.$emit("openLightbox", t), ["stop"])
831
+ key: e.id,
832
+ onClick: U((n) => l.$emit("openLightbox", e), ["stop"])
844
833
  }, [
845
- e("div", {
846
- class: D(["p-1 rounded", _(fe)[t?.ext]?.color])
834
+ t("div", {
835
+ class: D(["p-1 rounded", w(ee)[e?.ext]?.color || "bg-blue-100 text-blue-700 border-blue-200"])
847
836
  }, [
848
- (a(), j(N(_(fe)[t?.ext]?.icon), { class: "h-3 w-3" }))
837
+ (s(), A(B(w(ee)[e?.ext]?.icon || w(ee).pdf.icon), { class: "h-3 w-3" }))
849
838
  ], 2),
850
- e("div", {
839
+ t("div", {
851
840
  class: "flex-1 min-w-0",
852
- onClick: (s) => i.$emit("openLightbox", t)
841
+ onClick: (n) => l.$emit("openLightbox", e)
853
842
  }, [
854
- e("div", Pt, [
855
- e("span", Wt, k(t?.uploaded_name || t?.name), 1)
843
+ t("div", qt, [
844
+ t("span", Gt, x(e?.uploaded_name || e?.name), 1)
856
845
  ])
857
- ], 8, Ut),
858
- e("div", Gt, k(_(we)(t.size)), 1),
859
- e("div", qt, k(_(_e)(t.createdAt)), 1),
860
- e("div", Kt, [
861
- e("button", {
862
- onClick: K((s) => i.$emit("download", t), ["stop"]),
846
+ ], 8, Wt),
847
+ t("div", Kt, x(w(we)(e.size)), 1),
848
+ t("div", Zt, x(w(_e)(e.createdAt)), 1),
849
+ t("div", Jt, [
850
+ t("button", {
851
+ onClick: U((n) => l.$emit("download", e), ["stop"]),
863
852
  class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"
864
853
  }, [
865
- w(_(ce), { class: "h-3 w-3" })
866
- ], 8, Zt),
867
- e("button", {
854
+ M(w(ve), { class: "h-3 w-3" })
855
+ ], 8, Xt),
856
+ t("button", {
868
857
  class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",
869
- onClick: K((s) => i.$emit("delete", s, t?.file_id), ["stop"])
858
+ onClick: U((n) => l.$emit("delete", n, e?.file_id), ["stop"])
870
859
  }, [
871
- w(_(ue), { class: "h-3 w-3" })
872
- ], 8, Jt)
860
+ M(w(de), { class: "h-3 w-3" })
861
+ ], 8, Qt)
873
862
  ])
874
- ], 8, Rt))), 128))
863
+ ], 8, Ut))), 128))
875
864
  ]));
876
865
  }
877
- }), Qt = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3" }, Yt = ["onClick"], es = { class: "space-y-2" }, ts = { class: "flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden" }, ss = ["src"], os = { class: "space-y-1" }, ns = ["title"], is = { class: "text-xs text-gray-500 text-left" }, as = { class: "absolute top-2 right-1 flex items-center gap-1" }, ls = ["onClick"], rs = ["onClick"], ds = /* @__PURE__ */ I({
866
+ }), Yt = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3" }, es = ["onClick"], ts = { class: "space-y-2" }, ss = { class: "flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden" }, os = ["src"], ns = { class: "space-y-1" }, is = ["title"], ls = { class: "text-xs text-gray-500 text-left" }, as = { class: "absolute top-2 right-1 flex items-center gap-1" }, rs = ["onClick"], ds = ["onClick"], cs = /* @__PURE__ */ j({
878
867
  __name: "FileGrid",
879
868
  props: {
880
869
  files: {}
881
870
  },
882
871
  emits: ["delete", "download", "openLightbox"],
883
- setup(l) {
884
- return (i, n) => (a(), r("div", Qt, [
885
- (a(!0), r(A, null, S(i.files, (t) => (a(), r("div", {
886
- key: t.id,
887
- onClick: K((s) => i.$emit("openLightbox", t), ["stop"]),
872
+ setup(a) {
873
+ return (l, o) => (s(), i("div", Yt, [
874
+ (s(!0), i(I, null, E(l.files, (e) => (s(), i("div", {
875
+ key: e.id,
876
+ onClick: U((n) => l.$emit("openLightbox", e), ["stop"]),
888
877
  class: "group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"
889
878
  }, [
890
- e("div", es, [
891
- e("div", ts, [
892
- t.ext === "png" || t.ext === "jpg" || t.ext === "jpeg" || t.ext === "gif" || t.ext === "svg" || t.ext === "webp" ? (a(), r("img", {
879
+ t("div", ts, [
880
+ t("div", ss, [
881
+ e.ext === "png" || e.ext === "jpg" || e.ext === "jpeg" || e.ext === "gif" || e.ext === "svg" || e.ext === "webp" ? (s(), i("img", {
893
882
  key: 0,
894
- src: `/file/resize?filepath=${t?.file_path}&w=500`,
883
+ src: `/file/resize?filepath=${e?.file_path}&w=500`,
895
884
  alt: "file",
896
885
  class: "w-full h-full object-cover"
897
- }, null, 8, ss)) : (a(), j(_(q), {
886
+ }, null, 8, os)) : (s(), A(w(G), {
898
887
  key: 1,
899
888
  class: "h-10 w-10 text-gray-500"
900
889
  }))
901
890
  ]),
902
- e("div", os, [
903
- e("h3", {
891
+ t("div", ns, [
892
+ t("h3", {
904
893
  class: "font-medium text-xs leading-tight text-left",
905
- title: t.uploaded_name || t.name
906
- }, k(t.uploaded_name || t.name), 9, ns),
907
- e("p", is, k(_(_e)(t.createdAt)) + ", " + k(_(we)(t.size)), 1)
894
+ title: e.uploaded_name || e.name
895
+ }, x(e.uploaded_name || e.name), 9, is),
896
+ t("p", ls, x(w(_e)(e.createdAt)) + ", " + x(w(we)(e.size)), 1)
908
897
  ])
909
898
  ]),
910
- e("div", as, [
911
- e("button", {
912
- onClick: K((s) => i.$emit("download", t), ["stop"]),
899
+ t("div", as, [
900
+ t("button", {
901
+ onClick: U((n) => l.$emit("download", e), ["stop"]),
913
902
  class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"
914
903
  }, [
915
- w(_(ce), { class: "h-3 w-3" })
916
- ], 8, ls),
917
- e("a", {
904
+ M(w(ve), { class: "h-3 w-3" })
905
+ ], 8, rs),
906
+ t("button", {
918
907
  class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",
919
- onClick: K((s) => i.$emit("delete", s, t?.file_id), ["stop"])
908
+ onClick: U((n) => l.$emit("delete", n, e?.file_id), ["stop"])
920
909
  }, [
921
- w(_(ue), { class: "h-3 w-3" })
922
- ], 8, rs)
910
+ M(w(de), { class: "h-3 w-3" })
911
+ ], 8, ds)
923
912
  ])
924
- ], 8, Yt))), 128))
913
+ ], 8, es))), 128))
925
914
  ]));
926
915
  }
927
- }), cs = { class: "mx-auto font-sans" }, us = { key: 1 }, ne = /* @__PURE__ */ I({
916
+ }), us = { class: "mx-auto font-sans" }, ps = { key: 1 }, he = /* @__PURE__ */ j({
928
917
  __name: "FilesWidget",
929
918
  props: {
930
919
  title: {},
@@ -938,392 +927,363 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
938
927
  onDelete: {}
939
928
  },
940
929
  emits: ["delete", "add", "openLightbox"],
941
- setup(l, { emit: i }) {
942
- const n = l, t = M(!1), s = M(null), f = M(!1), o = M(0), m = M(n.files ?? []), v = i;
943
- m.value.length === 0 && h();
944
- const g = (x, u) => {
945
- s.value = u, t.value = !0;
946
- }, d = () => {
947
- s.value && (W(s.value), s.value = null, t.value = !1);
948
- }, y = O(() => Array.isArray(m.value) ? m.value.map((x) => x?.file_path) : []), p = (x) => {
949
- const u = y.value.findIndex((E) => E === x.file_path);
950
- u !== -1 && (f.value = !0, o.value = u);
951
- }, b = (x) => {
952
- n.onAddFile ? n.onAddFile(x) : F(x), v("add", x);
953
- }, W = (x) => {
954
- n.onDelete ? n.onDelete(x) : C(x), v("delete", x);
955
- }, V = (x) => {
956
- const u = document.createElement("a");
957
- u.setAttribute("download", x?.uploaded_name || x?.name), u.href = x?.file_path || x?.path, u.click();
958
- }, c = M("list");
959
- async function h() {
960
- if (!n.id)
930
+ setup(a, { emit: l }) {
931
+ const o = a, e = $(!1), n = $(null), g = $(!1), d = $(0), y = $(o.files ?? []), v = l;
932
+ y.value.length === 0 && u();
933
+ const p = (_, h) => {
934
+ n.value = h, e.value = !0;
935
+ }, r = () => {
936
+ n.value && (O(n.value), n.value = null, e.value = !1);
937
+ }, f = N(() => Array.isArray(y.value) ? y.value.map((_) => _?.file_path) : []), m = (_) => {
938
+ const h = f.value.findIndex((S) => S === _.file_path);
939
+ h !== -1 && (g.value = !0, d.value = h);
940
+ }, C = (_) => {
941
+ o.onAddFile ? o.onAddFile(_) : T(_), v("add", _);
942
+ }, O = (_) => {
943
+ o.onDelete ? o.onDelete(_) : k(_), v("delete", _);
944
+ }, z = (_) => {
945
+ const h = document.createElement("a");
946
+ h.setAttribute("download", _?.uploaded_name || _?.name), h.href = _?.file_path || _?.path, h.click();
947
+ }, c = $("list");
948
+ async function u() {
949
+ if (!o.id)
961
950
  return;
962
- const x = await fetch(`/api/widget/file/${n.id}`).then((u) => u.json());
963
- x.rows.forEach((u) => {
964
- u.timestamp = new Date(u.cdate), u.id = u.entity_id, u.entityType = u.entity_type, u.entityId = u.entity_id, u.entityType = u.entity_type, u.action = u.change_type, u.userId = u.change_user_id, u.userName = u.username, u.timestamp = new Date(u.cdate), u.description = u.username, u.status = u.username;
965
- }), m.value = x.rows;
951
+ const _ = await fetch(`/api/widget/file/${o.id}`).then((h) => h.json());
952
+ _.rows.forEach((h) => {
953
+ h.timestamp = new Date(h.cdate), h.id = h.entity_id, h.entityType = h.entity_type, h.entityId = h.entity_id, h.entityType = h.entity_type, h.action = h.change_type, h.userId = h.change_user_id, h.userName = h.username, h.timestamp = new Date(h.cdate), h.description = h.username, h.status = h.username;
954
+ }), y.value = _.rows;
966
955
  }
967
- const F = async (x) => {
968
- if (!(!x.target || !x.target.files || x.target.files.length === 0))
956
+ const T = async (_) => {
957
+ if (!(!_.target || !_.target.files || _.target.files.length === 0))
969
958
  try {
970
959
  await Promise.all(
971
- Array.from(x.target.files).map(async (u) => {
972
- const E = new FormData();
973
- E.append("file", u);
974
- const B = `/api/widget/file/${n.id}`, z = await fetch(B, {
960
+ Array.from(_.target.files).map(async (h) => {
961
+ const S = new FormData();
962
+ S.append("file", h);
963
+ const P = `/api/widget/file/${o.id}`, H = await fetch(P, {
975
964
  method: "POST",
976
- body: E
965
+ body: S
977
966
  });
978
- if (!z.ok)
979
- throw new Error(`HTTP error! status: ${z.status}`);
980
- return u;
967
+ if (!H.ok)
968
+ throw new Error(`HTTP error! status: ${H.status}`);
969
+ return h;
981
970
  })
982
- ), await h();
983
- } catch (u) {
984
- console.error("Помилка при завантаженні файлів:", u);
971
+ ), await u();
972
+ } catch (h) {
973
+ console.error("Помилка при завантаженні файлів:", h);
985
974
  }
986
- }, C = async (x) => {
975
+ }, k = async (_) => {
987
976
  try {
988
977
  await fetch(
989
- `/api/widget/file/${n.id}/${x}`,
978
+ `/api/widget/file/${o.id}/${_}`,
990
979
  {
991
980
  method: "DELETE"
992
981
  }
993
- ), await h();
994
- } catch (u) {
995
- console.error(u);
982
+ ), await u();
983
+ } catch (h) {
984
+ console.error(h);
996
985
  }
997
986
  };
998
- return (x, u) => {
999
- const E = ee("MessageBox"), B = ee("Lightbox");
1000
- return a(), r(A, null, [
1001
- e("div", cs, [
1002
- w(Bt, {
987
+ return (_, h) => {
988
+ const S = Q("MessageBox"), P = Q("Lightbox");
989
+ return s(), i(I, null, [
990
+ t("div", us, [
991
+ M(Pt, {
1003
992
  modelValue: c.value,
1004
- "onUpdate:modelValue": u[0] || (u[0] = (z) => c.value = z),
1005
- title: n.title,
1006
- onOnAddFile: u[1] || (u[1] = (z) => b(z))
993
+ "onUpdate:modelValue": h[0] || (h[0] = (H) => c.value = H),
994
+ title: o.title,
995
+ onOnAddFile: h[1] || (h[1] = (H) => C(H))
1007
996
  }, null, 8, ["modelValue", "title"]),
1008
- m.value.length > 0 ? (a(), r("div", {
997
+ y.value.length > 0 ? (s(), i("div", {
1009
998
  key: 0,
1010
- class: D(x.maxHeight ? "overflow-y-auto" : ""),
1011
- style: R({ maxHeight: x.maxHeight + "px" })
999
+ class: D(_.maxHeight ? "overflow-y-auto" : ""),
1000
+ style: Z({ maxHeight: _.maxHeight + "px" })
1012
1001
  }, [
1013
- c.value === "list" ? (a(), j(Xt, {
1002
+ c.value === "list" ? (s(), A($e, {
1014
1003
  key: 0,
1015
- onDelete: g,
1016
- onDownload: V,
1017
- onOpenLightbox: u[2] || (u[2] = (z) => p(z)),
1018
- files: m.value
1019
- }, null, 8, ["files"])) : $("", !0),
1020
- c.value === "grid" ? (a(), j(ds, {
1004
+ onDelete: p,
1005
+ onDownload: z,
1006
+ onOpenLightbox: h[2] || (h[2] = (H) => m(H)),
1007
+ files: y.value
1008
+ }, null, 8, ["files"])) : b("", !0),
1009
+ c.value === "grid" ? (s(), A(cs, {
1021
1010
  key: 1,
1022
- onDelete: g,
1023
- onDownload: V,
1024
- onOpenLightbox: u[3] || (u[3] = (z) => p(z)),
1025
- files: m.value
1026
- }, null, 8, ["files"])) : $("", !0)
1027
- ], 6)) : (a(), r("div", us, u[6] || (u[6] = [
1028
- e("div", { class: "flex items-center justify-center h-full" }, [
1029
- e("p", { class: "text-gray-500 leading-[3]" }, "Файлів не знайдено")
1011
+ onDelete: p,
1012
+ onDownload: z,
1013
+ onOpenLightbox: h[3] || (h[3] = (H) => m(H)),
1014
+ files: y.value
1015
+ }, null, 8, ["files"])) : b("", !0)
1016
+ ], 6)) : (s(), i("div", ps, [...h[6] || (h[6] = [
1017
+ t("div", { class: "flex items-center justify-center h-full" }, [
1018
+ t("p", { class: "text-gray-500 leading-[3]" }, "Файлів не знайдено")
1030
1019
  ], -1)
1031
- ])))
1020
+ ])]))
1032
1021
  ]),
1033
- w(E, {
1034
- modelValue: t.value,
1035
- "onUpdate:modelValue": u[4] || (u[4] = (z) => t.value = z),
1036
- onConfirm: d,
1022
+ M(S, {
1023
+ modelValue: e.value,
1024
+ "onUpdate:modelValue": h[4] || (h[4] = (H) => e.value = H),
1025
+ onConfirm: r,
1037
1026
  title: "Ви впевнені?",
1038
1027
  message: "Ви впевнені, що хочете видалити цей файл?",
1039
1028
  confirmButtonText: "Так, я впевнена/ий",
1040
1029
  cancelButtonText: "Скасувати"
1041
1030
  }, null, 8, ["modelValue"]),
1042
- w(B, {
1043
- modelValue: f.value,
1044
- "onUpdate:modelValue": u[5] || (u[5] = (z) => f.value = z),
1045
- images: y.value,
1046
- "start-index": o.value
1031
+ M(P, {
1032
+ modelValue: g.value,
1033
+ "onUpdate:modelValue": h[5] || (h[5] = (H) => g.value = H),
1034
+ images: f.value,
1035
+ "start-index": d.value
1047
1036
  }, null, 8, ["modelValue", "images", "start-index"])
1048
1037
  ], 64);
1049
1038
  };
1050
1039
  }
1051
- }), ps = ["onClick"], ms = /* @__PURE__ */ I({
1052
- __name: "CopyNotification",
1053
- setup(l, { expose: i }) {
1054
- const n = M([]);
1055
- let t = 1;
1056
- const s = () => {
1057
- if (n.value.length >= 10) {
1058
- const m = n.value[0];
1059
- clearTimeout(m.timer), n.value.shift();
1060
- }
1061
- const o = {
1062
- id: t++,
1063
- timer: setTimeout(() => {
1064
- f(o.id);
1065
- }, 1500)
1066
- };
1067
- n.value.push(o);
1068
- }, f = (o) => {
1069
- const m = n.value.findIndex((v) => v.id === o);
1070
- if (m !== -1) {
1071
- const v = n.value[m];
1072
- clearTimeout(v.timer), n.value.splice(m, 1);
1073
- }
1074
- };
1075
- return i({
1076
- addNotification: s
1077
- }), de(() => {
1078
- n.value.forEach((o) => {
1079
- clearTimeout(o.timer);
1080
- });
1081
- }), (o, m) => (a(), j(be, { to: "body" }, [
1082
- w(Me, {
1083
- name: "notification",
1084
- tag: "div",
1085
- class: "fixed top-4 right-4 z-50 space-y-2"
1086
- }, {
1087
- default: Le(() => [
1088
- (a(!0), r(A, null, S(n.value, (v) => (a(), r("div", {
1089
- key: v.id,
1090
- class: "bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"
1091
- }, [
1092
- w(_(Se), { class: "h-5 w-5 text-green-100 flex-shrink-0" }),
1093
- m[0] || (m[0] = e("div", { class: "flex-1" }, [
1094
- e("p", { class: "font-medium text-sm" }, "Ссылка скопирована!"),
1095
- e("p", { class: "text-xs text-green-100 opacity-90" }, "Файл добавлен в буфер обмена")
1096
- ], -1)),
1097
- e("button", {
1098
- onClick: (g) => f(v.id),
1099
- class: "text-green-100 hover:text-white transition-colors flex-shrink-0"
1100
- }, [
1101
- w(_(X), { class: "h-4 w-4" })
1102
- ], 8, ps)
1103
- ]))), 128))
1104
- ]),
1105
- _: 1
1106
- })
1107
- ]));
1108
- }
1109
- }), P = (l, i) => {
1110
- const n = l.__vccOpts || l;
1111
- for (const [t, s] of i)
1112
- n[t] = s;
1113
- return n;
1114
- }, $e = /* @__PURE__ */ P(ms, [["__scopeId", "data-v-55903525"]]), gs = { class: "fixed inset-0 z-50 bg-black/80" }, hs = { class: "fixed bg-white left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 sm:rounded-lg max-w-4xl max-h-[90vh] p-0" }, fs = { class: "flex flex-col space-y-1.5 text-center sm:text-left p-4 pb-2" }, vs = { class: "flex items-center justify-between" }, ys = { class: "flex items-center gap-2" }, bs = { class: "tracking-tight text-base font-medium" }, xs = { class: "p-4 pt-0" }, ks = { class: "flex flex-col items-center" }, _s = ["src", "alt"], ws = { class: "mt-3 flex items-center gap-4 text-sm text-gray-600" }, $s = { class: "mt-3 flex gap-2" }, Cs = /* @__PURE__ */ I({
1115
- __name: "GalleryModal",
1040
+ }), ms = {
1041
+ key: 0,
1042
+ class: "image-wrapper h-full max-h-[400px]",
1043
+ id: "lightbox-gallery"
1044
+ }, gs = ["onClick"], hs = {
1045
+ key: 0,
1046
+ rel: "noreferrer",
1047
+ class: "relative block h-full w-full"
1048
+ }, fs = ["src"], ys = {
1049
+ key: 0,
1050
+ class: "thumb-cover"
1051
+ }, vs = /* @__PURE__ */ j({
1052
+ __name: "GalleryContent",
1116
1053
  props: {
1117
- item: {}
1054
+ title: {},
1055
+ items: {},
1056
+ columns: {},
1057
+ maxHeight: {},
1058
+ onAddImage: { type: Function },
1059
+ onDelete: { type: Function },
1060
+ id: {},
1061
+ className: {},
1062
+ style: {}
1118
1063
  },
1119
- emits: ["close"],
1120
- setup(l) {
1121
- const i = M(), n = (o) => new Date(o).toLocaleDateString("uk-UA", {
1122
- day: "2-digit",
1123
- month: "2-digit",
1124
- year: "numeric"
1125
- }), t = (o) => o >= 1024 * 1024 * 1024 ? (o / (1024 * 1024 * 1024)).toFixed(2) + " GB" : o >= 1024 * 1024 ? (o / (1024 * 1024)).toFixed(2) + " MB" : o >= 1024 ? (o / 1024).toFixed(2) + " KB" : o + " B", s = (o) => {
1126
- navigator.clipboard.writeText(o), i.value?.addNotification();
1127
- }, f = async (o, m) => {
1128
- try {
1129
- const g = await (await fetch(o)).blob(), d = window.URL.createObjectURL(g), y = document.createElement("a");
1130
- y.href = d, y.download = m, document.body.appendChild(y), y.click(), window.URL.revokeObjectURL(d), document.body.removeChild(y);
1131
- } catch (v) {
1132
- console.error("Download failed:", v), alert("Download failed. Please try opening the image in a new tab.");
1133
- }
1064
+ emits: ["delete"],
1065
+ setup(a, { emit: l }) {
1066
+ const o = l, e = $(!1), n = $(0), g = a, d = N(
1067
+ () => Array.isArray(g.items) ? g.items.map((v) => v?.file_path) : []
1068
+ ), y = (v) => {
1069
+ const p = d.value.findIndex(
1070
+ (r) => r === v.file_path
1071
+ );
1072
+ p !== -1 && (e.value = !0, n.value = p);
1134
1073
  };
1135
- return (o, m) => (a(), r("div", gs, [
1136
- e("div", hs, [
1137
- e("div", fs, [
1138
- e("div", vs, [
1139
- e("div", ys, [
1140
- e("h2", bs, k(o.item.name), 1)
1141
- ])
1142
- ])
1143
- ]),
1144
- e("div", xs, [
1145
- e("div", ks, [
1146
- e("img", {
1147
- src: o.item.path,
1148
- alt: o.item.name,
1149
- class: "max-w-full max-h-[60vh] object-contain rounded border"
1150
- }, null, 8, _s),
1151
- e("div", ws, [
1152
- e("span", null, "Size: " + k(t(o.item.size)), 1),
1153
- m[3] || (m[3] = e("span", null, "•", -1)),
1154
- e("span", null, "Date: " + k(n(o.item.createdAt)), 1)
1155
- ]),
1156
- e("div", $s, [
1157
- e("button", {
1158
- onClick: m[0] || (m[0] = (v) => f(o.item.path, o.item.name)),
1159
- class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border h-9 rounded-md px-3"
1160
- }, [
1161
- w(_(ce), { class: "h-3 w-3 mr-1" }),
1162
- m[4] || (m[4] = H(" Download ", -1))
1163
- ]),
1164
- e("button", {
1165
- onClick: m[1] || (m[1] = (v) => s(o.item.path)),
1166
- class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border h-9 rounded-md px-3"
1167
- }, [
1168
- w(_(Ge), { class: "h-3 w-3 mr-1" }),
1169
- m[5] || (m[5] = H(" Share ", -1))
1074
+ return (v, p) => {
1075
+ const r = Q("Lightbox");
1076
+ return v.items?.length >= 1 ? (s(), i("div", ms, [
1077
+ (s(!0), i(I, null, E(v.items, (f, m) => (s(), i("div", {
1078
+ class: D(["h-full w-full image" + m, "cursor-pointer bg-teal-500 rounded-[3px]"]),
1079
+ key: m,
1080
+ onClick: U((C) => y(f), ["stop"])
1081
+ }, [
1082
+ m < 5 ? (s(), i("div", hs, [
1083
+ t("img", {
1084
+ src: `/file/resize?filepath=${f?.file_path}&w=500`,
1085
+ alt: "alt",
1086
+ height: "auto",
1087
+ width: "100%",
1088
+ class: D([
1089
+ "object-cover h-full w-full bg-gray-200 rounded-[3px]",
1090
+ m === 0 ? "max-h-[411px]" : "max-h-[calc((411px-3px)/2)]"
1170
1091
  ])
1171
- ])
1092
+ }, null, 10, fs),
1093
+ m === 4 && v.items?.length > 5 ? (s(), i("div", ys, " +" + x(v.items?.length - 5), 1)) : b("", !0)
1094
+ ])) : b("", !0)
1095
+ ], 10, gs))), 128)),
1096
+ (s(!0), i(I, null, E(Math.max(0, 5 - v.items.length), (f) => (s(), i("div", {
1097
+ key: "empty-" + f,
1098
+ class: D(["h-full w-full image" + (v.items.length + f - 1), "bg-gray-300 rounded-[3px]"])
1099
+ }, null, 2))), 128)),
1100
+ M(r, {
1101
+ modelValue: e.value,
1102
+ "onUpdate:modelValue": p[0] || (p[0] = (f) => e.value = f),
1103
+ images: d.value,
1104
+ "start-index": n.value,
1105
+ delete: "true",
1106
+ download: "true",
1107
+ onDelete: p[1] || (p[1] = (f) => o("delete", f))
1108
+ }, null, 8, ["modelValue", "images", "start-index"])
1109
+ ])) : b("", !0);
1110
+ };
1111
+ }
1112
+ }), bs = {
1113
+ key: 0,
1114
+ class: "text-xl font-semibold"
1115
+ }, xs = { class: "flex gap-1" }, ks = { class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer" }, _s = /* @__PURE__ */ j({
1116
+ __name: "widgetHeader",
1117
+ props: {
1118
+ title: {}
1119
+ },
1120
+ emits: ["onAddImage"],
1121
+ setup(a) {
1122
+ return (l, o) => (s(), i("div", {
1123
+ class: D(["flex flex-col sm:flex-row gap-3 mb-4", l.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
1124
+ }, [
1125
+ l.title ? (s(), i("h3", bs, x(l.title), 1)) : b("", !0),
1126
+ t("div", xs, [
1127
+ t("label", null, [
1128
+ t("input", {
1129
+ type: "file",
1130
+ class: "hidden",
1131
+ onChange: o[0] || (o[0] = (e) => l.$emit("onAddImage", e))
1132
+ }, null, 32),
1133
+ t("div", ks, [
1134
+ M(w(be), { class: "h-4 w-4" }),
1135
+ o[1] || (o[1] = F(" Додати зображення ", -1))
1172
1136
  ])
1173
- ]),
1174
- e("button", {
1175
- type: "button",
1176
- onClick: m[2] || (m[2] = (v) => o.$emit("close")),
1177
- class: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
1178
- }, [
1179
- w(_(X), { class: "h-4 w-4" }),
1180
- m[6] || (m[6] = e("span", { class: "sr-only" }, "Close", -1))
1181
1137
  ])
1182
- ]),
1183
- w($e, {
1184
- ref_key: "copyNotificationRef",
1185
- ref: i
1186
- }, null, 512)
1187
- ]));
1138
+ ])
1139
+ ], 2));
1188
1140
  }
1189
- }), Ms = {
1190
- key: 0,
1191
- class: "text-xl font-semibold text-gray-900 mb-4"
1192
- }, Ls = ["onClick"], Ds = ["src", "alt"], ie = /* @__PURE__ */ I({
1141
+ }), ws = {
1142
+ class: "w-full mx-auto font-sans",
1143
+ ref: "containerRef"
1144
+ }, $s = { key: 1 }, ne = /* @__PURE__ */ j({
1193
1145
  __name: "GalleryWidget",
1194
1146
  props: {
1195
1147
  title: {},
1196
- items: {},
1148
+ items: { default: () => [] },
1197
1149
  columns: {},
1198
1150
  maxHeight: {},
1151
+ onAddImage: {},
1152
+ onDelete: {},
1199
1153
  id: {},
1200
1154
  className: {},
1201
1155
  style: {}
1202
1156
  },
1203
- setup(l) {
1204
- const i = l, n = M(!1), t = M(null), s = M(), f = M(0);
1205
- let o = null;
1206
- const m = O(() => {
1207
- const d = i.columns || 4;
1208
- return f.value >= 1440 ? d : f.value >= 1024 ? Math.max(1, d - 1) : f.value >= 768 ? Math.max(1, d - 2) : f.value >= 640 ? Math.max(1, d - 3) : 1;
1209
- }), v = () => {
1210
- s.value && (f.value = s.value.offsetWidth);
1157
+ emits: ["delete", "add", "openLightbox"],
1158
+ setup(a, { emit: l }) {
1159
+ const o = a, e = $(o.items ?? []), n = l;
1160
+ e.value.length === 0 && v();
1161
+ const g = (r) => {
1162
+ o.onAddImage ? o.onAddImage(r) : y(r), n("add", r);
1163
+ }, d = (r) => {
1164
+ const f = e.value.find(
1165
+ (m) => m.file_path === r
1166
+ )?.file_id;
1167
+ f && (o.onDelete ? o.onDelete(f) : p(f));
1168
+ }, y = async (r) => {
1169
+ if (!(!r.target || !r.target.files || r.target.files.length === 0))
1170
+ try {
1171
+ await Promise.all(
1172
+ Array.from(r.target.files).map(async (f) => {
1173
+ const m = new FormData();
1174
+ m.append("file", f);
1175
+ const C = `/api/widget/file/${o.id}`, O = await fetch(C, {
1176
+ method: "POST",
1177
+ body: m
1178
+ });
1179
+ if (!O.ok)
1180
+ throw new Error(`HTTP error! status: ${O.status}`);
1181
+ return f;
1182
+ })
1183
+ ), await v();
1184
+ } catch (f) {
1185
+ console.error("Помилка при завантаженні файлів:", f);
1186
+ }
1211
1187
  };
1212
- re(() => {
1213
- De(() => {
1214
- s.value && (o = new ResizeObserver((d) => {
1215
- for (const y of d)
1216
- y.target === s.value && (f.value = y.contentRect.width);
1217
- }), o.observe(s.value), v());
1218
- });
1219
- }), de(() => {
1220
- o && o.disconnect();
1221
- });
1222
- const g = (d) => {
1223
- t.value = d, n.value = !0;
1188
+ async function v() {
1189
+ if (!o.id)
1190
+ return;
1191
+ const r = await fetch(`/api/widget/file/${o.id}`).then(
1192
+ (f) => f.json()
1193
+ );
1194
+ e.value = r.rows;
1195
+ }
1196
+ const p = async (r) => {
1197
+ try {
1198
+ await fetch(`/api/widget/file/${o.id}/${r}`, {
1199
+ method: "DELETE"
1200
+ }), await v();
1201
+ } catch (f) {
1202
+ console.error(f);
1203
+ }
1224
1204
  };
1225
- return (d, y) => (a(), r("div", {
1226
- class: "w-full mx-auto font-sans",
1227
- ref_key: "containerRef",
1228
- ref: s
1229
- }, [
1230
- d.title ? (a(), r("h3", Ms, k(d.title), 1)) : $("", !0),
1231
- e("div", {
1232
- class: D(d.maxHeight ? "overflow-y-auto" : ""),
1233
- style: R({ maxHeight: d.maxHeight + "px" })
1234
- }, [
1235
- e("div", {
1236
- style: R({ columns: m.value + " auto", gap: "12px" }),
1237
- class: "space-y-3"
1238
- }, [
1239
- (a(!0), r(A, null, S(d.items, (p) => (a(), r("div", {
1240
- key: p.id,
1241
- onClick: (b) => g(p),
1242
- class: "group relative break-inside-avoid bg-gray-200 rounded-lg overflow-hidden cursor-pointer hover:shadow-md transition-all mb-3"
1243
- }, [
1244
- e("img", {
1245
- src: p.path,
1246
- alt: p.name,
1247
- class: "w-full h-auto min-h-40 rounded-md object-contain"
1248
- }, null, 8, Ds),
1249
- y[1] || (y[1] = e("div", { class: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-12" }, [
1250
- e("h3", { class: "text-white font-medium text-base leading-tight mb-1" }, "Mountain Landscape"),
1251
- e("p", { class: "text-white/90 text-sm" }, "2.4 MB")
1252
- ], -1)),
1253
- y[2] || (y[2] = e("div", { class: "absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-200" }, null, -1))
1254
- ], 8, Ls))), 128))
1255
- ], 4)
1256
- ], 6),
1257
- (a(), j(be, { to: "body" }, [
1258
- n.value && t.value ? (a(), j(Cs, {
1259
- key: 0,
1260
- item: t.value,
1261
- onClose: y[0] || (y[0] = (p) => n.value = !1)
1262
- }, null, 8, ["item"])) : $("", !0)
1263
- ]))
1205
+ return (r, f) => (s(), i("div", ws, [
1206
+ M(_s, {
1207
+ title: r.title,
1208
+ onOnAddImage: f[0] || (f[0] = (m) => g(m))
1209
+ }, null, 8, ["title"]),
1210
+ e.value.length > 0 ? (s(), A(vs, {
1211
+ key: 0,
1212
+ items: e.value,
1213
+ onDelete: f[1] || (f[1] = (m) => d(m))
1214
+ }, null, 8, ["items"])) : (s(), i("div", $s, [...f[2] || (f[2] = [
1215
+ t("div", { class: "flex items-center justify-center h-full" }, [
1216
+ t("p", { class: "text-gray-500 leading-[3]" }, "Зображень не знайдено")
1217
+ ], -1)
1218
+ ])]))
1264
1219
  ], 512));
1265
1220
  }
1266
- }), Ts = { class: "text-value" }, Is = { class: "text-sm text-gray-900" }, zs = /* @__PURE__ */ I({
1221
+ }), Cs = { class: "text-value" }, Ms = { class: "text-sm text-gray-900" }, Ls = /* @__PURE__ */ j({
1267
1222
  __name: "TextValue",
1268
1223
  props: {
1269
1224
  item: {}
1270
1225
  },
1271
- setup(l) {
1272
- const i = l, n = O(() => {
1273
- const t = i.item.value;
1274
- return typeof t == "boolean" ? t ? "Так" : "Ні" : t == null ? "—" : String(t);
1226
+ setup(a) {
1227
+ const l = a, o = N(() => {
1228
+ const e = l.item.value;
1229
+ return typeof e == "boolean" ? e ? "Так" : "Ні" : e == null ? "—" : String(e);
1275
1230
  });
1276
- return (t, s) => (a(), r("div", Ts, [
1277
- e("span", Is, k(n.value), 1)
1231
+ return (e, n) => (s(), i("div", Cs, [
1232
+ t("span", Ms, x(o.value), 1)
1278
1233
  ]));
1279
1234
  }
1280
- }), js = /* @__PURE__ */ P(zs, [["__scopeId", "data-v-c14550b7"]]), Vs = { class: "link-value" }, Fs = ["href"], Hs = /* @__PURE__ */ I({
1235
+ }), W = (a, l) => {
1236
+ const o = a.__vccOpts || a;
1237
+ for (const [e, n] of l)
1238
+ o[e] = n;
1239
+ return o;
1240
+ }, Ts = /* @__PURE__ */ W(Ls, [["__scopeId", "data-v-c14550b7"]]), Ds = { class: "link-value" }, Is = ["href"], js = /* @__PURE__ */ j({
1281
1241
  __name: "LinkValue",
1282
1242
  props: {
1283
1243
  item: {}
1284
1244
  },
1285
- setup(l) {
1286
- const i = l, n = O(() => {
1287
- const t = String(i.item.value);
1245
+ setup(a) {
1246
+ const l = a, o = N(() => {
1247
+ const e = String(l.item.value);
1288
1248
  try {
1289
- const s = new URL(t);
1290
- return s.hostname + s.pathname;
1249
+ const n = new URL(e);
1250
+ return n.hostname + n.pathname;
1291
1251
  } catch {
1292
- return t;
1252
+ return e;
1293
1253
  }
1294
1254
  });
1295
- return (t, s) => (a(), r("div", Vs, [
1296
- e("a", {
1297
- href: String(t.item.value),
1255
+ return (e, n) => (s(), i("div", Ds, [
1256
+ t("a", {
1257
+ href: String(e.item.value),
1298
1258
  target: "_blank",
1299
1259
  rel: "noopener noreferrer",
1300
1260
  class: "text-blue-600 hover:text-blue-800 underline text-sm"
1301
1261
  }, [
1302
- H(k(n.value) + " ", 1),
1303
- s[0] || (s[0] = e("i", { class: "fas fa-external-link-alt ml-1 text-xs" }, null, -1))
1304
- ], 8, Fs)
1262
+ F(x(o.value) + " ", 1),
1263
+ n[0] || (n[0] = t("i", { class: "fas fa-external-link-alt ml-1 text-xs" }, null, -1))
1264
+ ], 8, Is)
1305
1265
  ]));
1306
1266
  }
1307
- }), As = /* @__PURE__ */ P(Hs, [["__scopeId", "data-v-e6eb07a6"]]), Ss = { class: "date-value" }, Es = { class: "text-sm text-gray-900" }, Os = /* @__PURE__ */ I({
1267
+ }), Vs = /* @__PURE__ */ W(js, [["__scopeId", "data-v-e6eb07a6"]]), As = { class: "date-value" }, zs = { class: "text-sm text-gray-900" }, Hs = /* @__PURE__ */ j({
1308
1268
  __name: "DateValue",
1309
1269
  props: {
1310
1270
  item: {}
1311
1271
  },
1312
- setup(l) {
1313
- const i = l, n = O(() => {
1314
- const t = i.item.value;
1315
- if (t instanceof Date)
1316
- return t.toLocaleDateString("uk-UA", {
1272
+ setup(a) {
1273
+ const l = a, o = N(() => {
1274
+ const e = l.item.value;
1275
+ if (e instanceof Date)
1276
+ return e.toLocaleDateString("uk-UA", {
1317
1277
  year: "numeric",
1318
1278
  month: "long",
1319
1279
  day: "numeric",
1320
1280
  hour: "2-digit",
1321
1281
  minute: "2-digit"
1322
1282
  });
1323
- if (typeof t == "string") {
1324
- const s = new Date(t);
1325
- if (!isNaN(s.getTime()))
1326
- return s.toLocaleDateString("uk-UA", {
1283
+ if (typeof e == "string") {
1284
+ const n = new Date(e);
1285
+ if (!isNaN(n.getTime()))
1286
+ return n.toLocaleDateString("uk-UA", {
1327
1287
  year: "numeric",
1328
1288
  month: "long",
1329
1289
  day: "numeric",
@@ -1331,23 +1291,23 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
1331
1291
  minute: "2-digit"
1332
1292
  });
1333
1293
  }
1334
- return String(t);
1294
+ return String(e);
1335
1295
  });
1336
- return (t, s) => (a(), r("div", Ss, [
1337
- e("span", Es, k(n.value), 1)
1296
+ return (e, n) => (s(), i("div", As, [
1297
+ t("span", zs, x(o.value), 1)
1338
1298
  ]));
1339
1299
  }
1340
- }), Bs = /* @__PURE__ */ P(Os, [["__scopeId", "data-v-b9600618"]]), Ns = { class: "status-value" }, Rs = {
1300
+ }), Es = /* @__PURE__ */ W(Hs, [["__scopeId", "data-v-b9600618"]]), Fs = { class: "status-value" }, Ss = {
1341
1301
  key: 0,
1342
1302
  class: "mr-1"
1343
- }, Us = /* @__PURE__ */ I({
1303
+ }, Ns = /* @__PURE__ */ j({
1344
1304
  __name: "StatusValue",
1345
1305
  props: {
1346
1306
  item: {}
1347
1307
  },
1348
- setup(l) {
1349
- const i = l, n = O(() => {
1350
- switch (String(i.item.value).toLowerCase()) {
1308
+ setup(a) {
1309
+ const l = a, o = N(() => {
1310
+ switch (String(l.item.value).toLowerCase()) {
1351
1311
  case "active":
1352
1312
  case "активний":
1353
1313
  case "успішно":
@@ -1369,8 +1329,8 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
1369
1329
  default:
1370
1330
  return "bg-blue-100 text-blue-800";
1371
1331
  }
1372
- }), t = O(() => {
1373
- switch (String(i.item.value).toLowerCase()) {
1332
+ }), e = N(() => {
1333
+ switch (String(l.item.value).toLowerCase()) {
1374
1334
  case "active":
1375
1335
  case "активний":
1376
1336
  case "успішно":
@@ -1393,50 +1353,50 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
1393
1353
  return "fas fa-info-circle";
1394
1354
  }
1395
1355
  });
1396
- return (s, f) => (a(), r("div", Ns, [
1397
- e("span", {
1398
- class: D(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium", n.value])
1356
+ return (n, g) => (s(), i("div", Fs, [
1357
+ t("span", {
1358
+ class: D(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium", o.value])
1399
1359
  }, [
1400
- t.value ? (a(), r("span", Rs, [
1401
- e("i", {
1402
- class: D(t.value)
1360
+ e.value ? (s(), i("span", Ss, [
1361
+ t("i", {
1362
+ class: D(e.value)
1403
1363
  }, null, 2)
1404
- ])) : $("", !0),
1405
- H(" " + k(String(s.item.value)), 1)
1364
+ ])) : b("", !0),
1365
+ F(" " + x(String(n.item.value)), 1)
1406
1366
  ], 2)
1407
1367
  ]));
1408
1368
  }
1409
- }), Ps = /* @__PURE__ */ P(Us, [["__scopeId", "data-v-c72e0b01"]]), Ws = { class: "custom-value" }, Gs = { class: "text-sm text-gray-900" }, qs = /* @__PURE__ */ I({
1369
+ }), Os = /* @__PURE__ */ W(Ns, [["__scopeId", "data-v-c72e0b01"]]), Bs = { class: "custom-value" }, Ps = { class: "text-sm text-gray-900" }, Rs = /* @__PURE__ */ j({
1410
1370
  __name: "CustomValue",
1411
1371
  props: {
1412
1372
  item: {}
1413
1373
  },
1414
- setup(l) {
1415
- return (i, n) => (a(), r("div", Ws, [
1416
- G(i.$slots, "default", {
1417
- item: i.item,
1418
- value: i.item.value
1374
+ setup(a) {
1375
+ return (l, o) => (s(), i("div", Bs, [
1376
+ q(l.$slots, "default", {
1377
+ item: l.item,
1378
+ value: l.item.value
1419
1379
  }, () => [
1420
- e("span", Gs, k(String(i.item.value)), 1)
1380
+ t("span", Ps, x(String(l.item.value)), 1)
1421
1381
  ], !0)
1422
1382
  ]));
1423
1383
  }
1424
- }), Ks = /* @__PURE__ */ P(qs, [["__scopeId", "data-v-11a73810"]]), Zs = ["id"], Js = {
1384
+ }), Us = /* @__PURE__ */ W(Rs, [["__scopeId", "data-v-11a73810"]]), Ws = ["id"], qs = {
1425
1385
  key: 0,
1426
1386
  class: "text-xl font-semibold text-gray-900 mb-4"
1427
- }, Xs = {
1387
+ }, Gs = {
1428
1388
  key: 1,
1429
1389
  class: "overflow-x-auto"
1430
- }, Qs = { class: "min-w-full divide-y divide-gray-200" }, Ys = { class: "bg-white divide-y divide-gray-200" }, eo = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, to = { class: "flex items-center gap-2" }, so = ["title"], oo = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, no = {
1390
+ }, Ks = { class: "min-w-full divide-y divide-gray-200" }, Zs = { class: "bg-white divide-y divide-gray-200" }, Js = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, Xs = { class: "flex items-center gap-2" }, Qs = ["title"], Ys = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, eo = {
1431
1391
  key: 2,
1432
1392
  class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
1433
- }, io = { class: "flex items-start gap-3" }, ao = {
1393
+ }, to = { class: "flex items-start gap-3" }, so = {
1434
1394
  key: 0,
1435
1395
  class: "flex-shrink-0"
1436
- }, lo = { class: "flex-1 min-w-0" }, ro = { class: "flex items-center gap-2 mb-2" }, co = { class: "text-sm font-medium text-gray-900" }, uo = ["title"], po = {
1396
+ }, oo = { class: "flex-1 min-w-0" }, no = { class: "flex items-center gap-2 mb-2" }, io = { class: "text-sm font-medium text-gray-900" }, lo = ["title"], ao = {
1437
1397
  key: 3,
1438
1398
  class: "overflow-x-auto"
1439
- }, mo = { class: "min-w-full divide-y divide-gray-200" }, go = { class: "bg-white divide-y divide-gray-200" }, ho = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, fo = { class: "flex items-center gap-2" }, vo = ["title"], yo = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, bo = /* @__PURE__ */ I({
1399
+ }, ro = { class: "min-w-full divide-y divide-gray-200" }, co = { class: "bg-white divide-y divide-gray-200" }, uo = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, po = { class: "flex items-center gap-2" }, mo = ["title"], go = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, ho = /* @__PURE__ */ j({
1440
1400
  __name: "DescriptionListWidget",
1441
1401
  props: {
1442
1402
  title: {},
@@ -1446,113 +1406,113 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
1446
1406
  className: {},
1447
1407
  style: {}
1448
1408
  },
1449
- setup(l) {
1450
- const i = (n) => {
1451
- switch (n.type) {
1409
+ setup(a) {
1410
+ const l = (o) => {
1411
+ switch (o.type) {
1452
1412
  case "link":
1453
- return As;
1413
+ return Vs;
1454
1414
  case "date":
1455
- return Bs;
1415
+ return Es;
1456
1416
  case "status":
1457
- return Ps;
1417
+ return Os;
1458
1418
  case "custom":
1459
- return Ks;
1419
+ return Us;
1460
1420
  default:
1461
- return js;
1421
+ return Ts;
1462
1422
  }
1463
1423
  };
1464
- return (n, t) => (a(), r("div", {
1465
- class: D(["description-list-widget", n.className]),
1466
- id: n.id,
1467
- style: R(n.style)
1424
+ return (o, e) => (s(), i("div", {
1425
+ class: D(["description-list-widget", o.className]),
1426
+ id: o.id,
1427
+ style: Z(o.style)
1468
1428
  }, [
1469
- n.title ? (a(), r("h3", Js, k(n.title), 1)) : $("", !0),
1470
- n.view === "table" ? (a(), r("div", Xs, [
1471
- e("table", Qs, [
1472
- e("tbody", Ys, [
1473
- (a(!0), r(A, null, S(n.items, (s) => (a(), r("tr", {
1474
- key: s.id || s.label
1429
+ o.title ? (s(), i("h3", qs, x(o.title), 1)) : b("", !0),
1430
+ o.view === "table" ? (s(), i("div", Gs, [
1431
+ t("table", Ks, [
1432
+ t("tbody", Zs, [
1433
+ (s(!0), i(I, null, E(o.items, (n) => (s(), i("tr", {
1434
+ key: n.id || n.label
1475
1435
  }, [
1476
- e("td", eo, [
1477
- e("div", to, [
1478
- s.icon ? (a(), r("i", {
1436
+ t("td", Js, [
1437
+ t("div", Xs, [
1438
+ n.icon ? (s(), i("i", {
1479
1439
  key: 0,
1480
- class: D([s.icon, "text-gray-500"])
1481
- }, null, 2)) : $("", !0),
1482
- H(" " + k(s.label) + " ", 1),
1483
- s.tooltip ? (a(), r("span", {
1440
+ class: D([n.icon, "text-gray-500"])
1441
+ }, null, 2)) : b("", !0),
1442
+ F(" " + x(n.label) + " ", 1),
1443
+ n.tooltip ? (s(), i("span", {
1484
1444
  key: 1,
1485
1445
  class: "text-gray-400 cursor-help",
1486
- title: s.tooltip
1487
- }, t[0] || (t[0] = [
1488
- e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1489
- ]), 8, so)) : $("", !0)
1446
+ title: n.tooltip
1447
+ }, [...e[0] || (e[0] = [
1448
+ t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1449
+ ])], 8, Qs)) : b("", !0)
1490
1450
  ])
1491
1451
  ]),
1492
- e("td", oo, [
1493
- (a(), j(N(i(s)), { item: s }, null, 8, ["item"]))
1452
+ t("td", Ys, [
1453
+ (s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
1494
1454
  ])
1495
1455
  ]))), 128))
1496
1456
  ])
1497
1457
  ])
1498
- ])) : n.view === "grid" ? (a(), r("div", no, [
1499
- (a(!0), r(A, null, S(n.items, (s) => (a(), r("div", {
1500
- key: s.id || s.label,
1458
+ ])) : o.view === "grid" ? (s(), i("div", eo, [
1459
+ (s(!0), i(I, null, E(o.items, (n) => (s(), i("div", {
1460
+ key: n.id || n.label,
1501
1461
  class: "description-item-card bg-white border border-gray-200 rounded-lg p-4"
1502
1462
  }, [
1503
- e("div", io, [
1504
- s.icon ? (a(), r("div", ao, [
1505
- e("i", {
1506
- class: D([s.icon, "text-gray-500 text-lg"])
1463
+ t("div", to, [
1464
+ n.icon ? (s(), i("div", so, [
1465
+ t("i", {
1466
+ class: D([n.icon, "text-gray-500 text-lg"])
1507
1467
  }, null, 2)
1508
- ])) : $("", !0),
1509
- e("div", lo, [
1510
- e("div", ro, [
1511
- e("h4", co, k(s.label), 1),
1512
- s.tooltip ? (a(), r("span", {
1468
+ ])) : b("", !0),
1469
+ t("div", oo, [
1470
+ t("div", no, [
1471
+ t("h4", io, x(n.label), 1),
1472
+ n.tooltip ? (s(), i("span", {
1513
1473
  key: 0,
1514
1474
  class: "text-gray-400 cursor-help",
1515
- title: s.tooltip
1516
- }, t[1] || (t[1] = [
1517
- e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1518
- ]), 8, uo)) : $("", !0)
1475
+ title: n.tooltip
1476
+ }, [...e[1] || (e[1] = [
1477
+ t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1478
+ ])], 8, lo)) : b("", !0)
1519
1479
  ]),
1520
- (a(), j(N(i(s)), { item: s }, null, 8, ["item"]))
1480
+ (s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
1521
1481
  ])
1522
1482
  ])
1523
1483
  ]))), 128))
1524
- ])) : (a(), r("div", po, [
1525
- e("table", mo, [
1526
- e("tbody", go, [
1527
- (a(!0), r(A, null, S(n.items, (s) => (a(), r("tr", {
1528
- key: s.id || s.label
1484
+ ])) : (s(), i("div", ao, [
1485
+ t("table", ro, [
1486
+ t("tbody", co, [
1487
+ (s(!0), i(I, null, E(o.items, (n) => (s(), i("tr", {
1488
+ key: n.id || n.label
1529
1489
  }, [
1530
- e("td", ho, [
1531
- e("div", fo, [
1532
- s.icon ? (a(), r("i", {
1490
+ t("td", uo, [
1491
+ t("div", po, [
1492
+ n.icon ? (s(), i("i", {
1533
1493
  key: 0,
1534
- class: D([s.icon, "text-gray-500"])
1535
- }, null, 2)) : $("", !0),
1536
- H(" " + k(s.label) + " ", 1),
1537
- s.tooltip ? (a(), r("span", {
1494
+ class: D([n.icon, "text-gray-500"])
1495
+ }, null, 2)) : b("", !0),
1496
+ F(" " + x(n.label) + " ", 1),
1497
+ n.tooltip ? (s(), i("span", {
1538
1498
  key: 1,
1539
1499
  class: "text-gray-400 cursor-help",
1540
- title: s.tooltip
1541
- }, t[2] || (t[2] = [
1542
- e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1543
- ]), 8, vo)) : $("", !0)
1500
+ title: n.tooltip
1501
+ }, [...e[2] || (e[2] = [
1502
+ t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1503
+ ])], 8, mo)) : b("", !0)
1544
1504
  ])
1545
1505
  ]),
1546
- e("td", yo, [
1547
- (a(), j(N(i(s)), { item: s }, null, 8, ["item"]))
1506
+ t("td", go, [
1507
+ (s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
1548
1508
  ])
1549
1509
  ]))), 128))
1550
1510
  ])
1551
1511
  ])
1552
1512
  ]))
1553
- ], 14, Zs));
1513
+ ], 14, Ws));
1554
1514
  }
1555
- }), Ce = /* @__PURE__ */ P(bo, [["__scopeId", "data-v-36d43e50"]]), xo = {
1515
+ }), Ce = /* @__PURE__ */ W(ho, [["__scopeId", "data-v-36d43e50"]]), fo = {
1556
1516
  draw: {
1557
1517
  toolbar: {
1558
1518
  actions: {
@@ -1660,24 +1620,24 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
1660
1620
  }
1661
1621
  }
1662
1622
  };
1663
- function ko(l) {
1664
- return l ? l.type === "FeatureCollection" || l.type === "Feature" ? l : l.geom ? {
1623
+ function yo(a) {
1624
+ return a ? a.type === "FeatureCollection" || a.type === "Feature" ? a : a.geom ? {
1665
1625
  type: "Feature",
1666
1626
  geometry: {
1667
- type: l.geom.type,
1668
- coordinates: l.geom.coordinates
1627
+ type: a.geom.type,
1628
+ coordinates: a.geom.coordinates
1669
1629
  },
1670
1630
  properties: {}
1671
- } : l.type && l.coordinates ? {
1631
+ } : a.type && a.coordinates ? {
1672
1632
  type: "Feature",
1673
- geometry: l,
1633
+ geometry: a,
1674
1634
  properties: {}
1675
1635
  } : null : null;
1676
1636
  }
1677
- const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
1637
+ const vo = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, bo = {
1678
1638
  key: 1,
1679
1639
  class: "bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer"
1680
- }, $o = { class: "flex items-center justify-between p-2 border-b" }, Co = { class: "p-2 border-b" }, Mo = { class: "flex items-center" }, Lo = { class: "flex items-center" }, Do = { class: "flex items-center" }, To = { class: "p-2" }, Io = { class: "flex items-center" }, ae = /* @__PURE__ */ I({
1640
+ }, xo = { class: "flex items-center justify-between p-2 border-b" }, ko = { class: "p-2 border-b" }, _o = { class: "flex items-center" }, wo = { class: "flex items-center" }, $o = { class: "flex items-center" }, Co = { class: "p-2" }, Mo = { class: "flex items-center" }, ie = /* @__PURE__ */ j({
1681
1641
  __name: "MapWidget",
1682
1642
  props: {
1683
1643
  geom: {},
@@ -1685,10 +1645,10 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
1685
1645
  className: {},
1686
1646
  style: {}
1687
1647
  },
1688
- setup(l) {
1689
- const i = l, n = M(null);
1690
- let t, s;
1691
- const f = {
1648
+ setup(a) {
1649
+ const l = a, o = $(null);
1650
+ let e, n;
1651
+ const g = {
1692
1652
  topo100: {
1693
1653
  url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"
1694
1654
  },
@@ -1698,69 +1658,69 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
1698
1658
  osmb: {
1699
1659
  url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"
1700
1660
  }
1701
- }, o = M("topo100");
1702
- let m;
1703
- const v = M(!0), g = M(!1);
1704
- function d() {
1705
- return new Promise((V, c) => {
1706
- if (window.L && window.L.Draw) return V(0);
1707
- const h = (C) => {
1708
- if (Array.from(document.styleSheets).some((E) => E?.href?.includes(C))) return;
1709
- const u = document.createElement("link");
1710
- u.rel = "stylesheet", u.href = C, document.head.appendChild(u);
1711
- }, F = (C) => new Promise((x, u) => {
1712
- const E = Array.from(document.scripts).find((z) => z.src === C);
1713
- if (E) {
1714
- E.addEventListener("load", () => x()), E.addEventListener("error", (z) => u(z));
1661
+ }, d = $("topo100");
1662
+ let y;
1663
+ const v = $(!0), p = $(!1);
1664
+ function r() {
1665
+ return new Promise((z, c) => {
1666
+ if (window.L && window.L.Draw) return z(0);
1667
+ const u = (k) => {
1668
+ if (Array.from(document.styleSheets).some((S) => S?.href?.includes(k))) return;
1669
+ const h = document.createElement("link");
1670
+ h.rel = "stylesheet", h.href = k, document.head.appendChild(h);
1671
+ }, T = (k) => new Promise((_, h) => {
1672
+ const S = Array.from(document.scripts).find((H) => H.src === k);
1673
+ if (S) {
1674
+ S.addEventListener("load", () => _()), S.addEventListener("error", (H) => h(H));
1715
1675
  return;
1716
1676
  }
1717
- const B = document.createElement("script");
1718
- B.src = C, B.async = !0, B.onload = () => x(), B.onerror = (z) => u(z), document.body.appendChild(B);
1677
+ const P = document.createElement("script");
1678
+ P.src = k, P.async = !0, P.onload = () => _(), P.onerror = (H) => h(H), document.body.appendChild(P);
1719
1679
  });
1720
- h("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), h("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), F("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => F("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => V(0)).catch(c);
1680
+ u("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), u("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), T("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => T("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => z(0)).catch(c);
1721
1681
  });
1722
1682
  }
1723
1683
  re(async () => {
1724
- await d(), L.drawLocal = xo, t = L.map(n.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(t), m = L.tileLayer(f.topo100.url, { maxZoom: 19 }).addTo(t), o.value = "topo100", s = new L.FeatureGroup().addTo(t);
1725
- const V = ko(i.geom);
1726
- if (V) {
1684
+ await r(), L.drawLocal = fo, e = L.map(o.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(e), y = L.tileLayer(g.topo100.url, { maxZoom: 19 }).addTo(e), d.value = "topo100", n = new L.FeatureGroup().addTo(e);
1685
+ const z = yo(l.geom);
1686
+ if (z) {
1727
1687
  const c = [];
1728
- L.geoJSON(V).eachLayer((h) => c.push(h)), c.length && s.addLayer(c[0]), s.toGeoJSON(), y();
1688
+ L.geoJSON(z).eachLayer((u) => c.push(u)), c.length && n.addLayer(c[0]), n.toGeoJSON(), f();
1729
1689
  }
1730
1690
  });
1731
- function y(V = 30) {
1732
- const c = s.getLayers();
1691
+ function f(z = 30) {
1692
+ const c = n.getLayers();
1733
1693
  if (!c.length) return;
1734
- const F = L.featureGroup(c).getBounds();
1735
- F && F.isValid() && t.fitBounds(F, { padding: [V, V] });
1694
+ const T = L.featureGroup(c).getBounds();
1695
+ T && T.isValid() && e.fitBounds(T, { padding: [z, z] });
1736
1696
  }
1737
- function p(V) {
1738
- m && m.removeFrom(t);
1739
- const c = f[V];
1740
- m = L.tileLayer(c.url, c.options || {}).addTo(t), o.value = V;
1697
+ function m(z) {
1698
+ y && y.removeFrom(e);
1699
+ const c = g[z];
1700
+ y = L.tileLayer(c.url, c.options || {}).addTo(e), d.value = z;
1741
1701
  }
1742
- function b() {
1743
- p(o.value);
1702
+ function C() {
1703
+ m(d.value);
1744
1704
  }
1745
- function W() {
1746
- s && (v.value ? s.addTo(t) : s.removeFrom(t));
1705
+ function O() {
1706
+ n && (v.value ? n.addTo(e) : n.removeFrom(e));
1747
1707
  }
1748
- return (V, c) => (a(), r("div", _o, [
1749
- e("div", {
1708
+ return (z, c) => (s(), i("div", vo, [
1709
+ t("div", {
1750
1710
  ref_key: "mapContainer",
1751
- ref: n,
1752
- class: "w-full h-full"
1711
+ ref: o,
1712
+ class: "w-full h-full min-h-[300px]"
1753
1713
  }, null, 512),
1754
- g.value ? $("", !0) : (a(), r("div", {
1714
+ p.value ? b("", !0) : (s(), i("div", {
1755
1715
  key: 0,
1756
- onClick: c[0] || (c[0] = (h) => g.value = !0),
1716
+ onClick: c[0] || (c[0] = (u) => p.value = !0),
1757
1717
  class: "z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer"
1758
1718
  }, " Шари ")),
1759
- g.value ? (a(), r("div", wo, [
1760
- e("div", $o, [
1761
- c[7] || (c[7] = e("div", null, "Шари", -1)),
1762
- (a(), r("svg", {
1763
- onClick: c[1] || (c[1] = (h) => g.value = !1),
1719
+ p.value ? (s(), i("div", bo, [
1720
+ t("div", xo, [
1721
+ c[7] || (c[7] = t("div", null, "Шари", -1)),
1722
+ (s(), i("svg", {
1723
+ onClick: c[1] || (c[1] = (u) => p.value = !1),
1764
1724
  xmlns: "http://www.w3.org/2000/svg",
1765
1725
  viewBox: "0 0 24 24",
1766
1726
  fill: "none",
@@ -1769,92 +1729,288 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
1769
1729
  "stroke-linecap": "round",
1770
1730
  "stroke-linejoin": "round",
1771
1731
  class: "icon icon-tabler icons-tabler-outline icon-tabler-x w-4 h-4"
1772
- }, c[6] || (c[6] = [
1773
- e("path", {
1732
+ }, [...c[6] || (c[6] = [
1733
+ t("path", {
1774
1734
  stroke: "none",
1775
1735
  d: "M0 0h24v24H0z",
1776
1736
  fill: "none"
1777
1737
  }, null, -1),
1778
- e("path", { d: "M18 6l-12 12" }, null, -1),
1779
- e("path", { d: "M6 6l12 12" }, null, -1)
1780
- ])))
1738
+ t("path", { d: "M18 6l-12 12" }, null, -1),
1739
+ t("path", { d: "M6 6l12 12" }, null, -1)
1740
+ ])]))
1781
1741
  ]),
1782
- e("div", Co, [
1783
- e("div", null, [
1784
- e("label", Mo, [
1785
- U(e("input", {
1742
+ t("div", ko, [
1743
+ t("div", null, [
1744
+ t("label", _o, [
1745
+ R(t("input", {
1786
1746
  type: "radio",
1787
1747
  name: "base-layer",
1788
1748
  value: "topo100",
1789
- "onUpdate:modelValue": c[2] || (c[2] = (h) => o.value = h),
1790
- onChange: b
1749
+ "onUpdate:modelValue": c[2] || (c[2] = (u) => d.value = u),
1750
+ onChange: C
1791
1751
  }, null, 544), [
1792
- [Q, o.value]
1752
+ [Y, d.value]
1793
1753
  ]),
1794
- c[8] || (c[8] = e("span", { class: "ml-2" }, "Карта України", -1))
1754
+ c[8] || (c[8] = t("span", { class: "ml-2" }, "Карта України", -1))
1795
1755
  ])
1796
1756
  ]),
1797
- e("div", null, [
1798
- e("label", Lo, [
1799
- U(e("input", {
1757
+ t("div", null, [
1758
+ t("label", wo, [
1759
+ R(t("input", {
1800
1760
  type: "radio",
1801
1761
  name: "base-layer",
1802
1762
  value: "orto10",
1803
- "onUpdate:modelValue": c[3] || (c[3] = (h) => o.value = h),
1804
- onChange: b
1763
+ "onUpdate:modelValue": c[3] || (c[3] = (u) => d.value = u),
1764
+ onChange: C
1805
1765
  }, null, 544), [
1806
- [Q, o.value]
1766
+ [Y, d.value]
1807
1767
  ]),
1808
- c[9] || (c[9] = e("span", { class: "ml-2" }, "Ortophoto 1:10К", -1))
1768
+ c[9] || (c[9] = t("span", { class: "ml-2" }, "Ortophoto 1:10К", -1))
1809
1769
  ])
1810
1770
  ]),
1811
- e("div", null, [
1812
- e("label", Do, [
1813
- U(e("input", {
1771
+ t("div", null, [
1772
+ t("label", $o, [
1773
+ R(t("input", {
1814
1774
  type: "radio",
1815
1775
  name: "base-layer",
1816
1776
  value: "osmb",
1817
- "onUpdate:modelValue": c[4] || (c[4] = (h) => o.value = h),
1818
- onChange: b
1777
+ "onUpdate:modelValue": c[4] || (c[4] = (u) => d.value = u),
1778
+ onChange: C
1819
1779
  }, null, 544), [
1820
- [Q, o.value]
1780
+ [Y, d.value]
1821
1781
  ]),
1822
- c[10] || (c[10] = e("span", { class: "ml-2" }, "Open Street Map", -1))
1782
+ c[10] || (c[10] = t("span", { class: "ml-2" }, "Open Street Map", -1))
1823
1783
  ])
1824
1784
  ])
1825
1785
  ]),
1826
- e("div", To, [
1827
- e("label", Io, [
1828
- U(e("input", {
1786
+ t("div", Co, [
1787
+ t("label", Mo, [
1788
+ R(t("input", {
1829
1789
  type: "checkbox",
1830
- "onUpdate:modelValue": c[5] || (c[5] = (h) => v.value = h),
1831
- onChange: W
1790
+ "onUpdate:modelValue": c[5] || (c[5] = (u) => v.value = u),
1791
+ onChange: O
1832
1792
  }, null, 544), [
1833
1793
  [Te, v.value]
1834
1794
  ]),
1835
- c[11] || (c[11] = e("span", { class: "ml-2" }, " Показати геометрію ", -1))
1795
+ c[11] || (c[11] = t("span", { class: "ml-2" }, " Показати геометрію ", -1))
1796
+ ])
1797
+ ])
1798
+ ])) : b("", !0)
1799
+ ]));
1800
+ }
1801
+ }), Lo = { class: "flex justify-between items-center mb-[15px]" }, To = { class: "font-semibold text-[16px]" }, Do = { class: "overflow-x-auto" }, Io = { class: "min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600" }, jo = { class: "text-left font-medium text-gray-700" }, Vo = { class: "py-2 min-w-[200px]" }, Ao = {
1802
+ key: 0,
1803
+ class: "py-2 min-w-[200px]"
1804
+ }, zo = { class: "divide-y divide-gray-200" }, Ho = { class: "bg-white odd:bg-gray-50" }, Eo = { class: "py-2 pr-5" }, Fo = ["href"], So = { class: "py-2 pr-5 gap-2 inline-flex" }, No = ["onClick"], Oo = ["onClick"], Bo = /* @__PURE__ */ j({
1805
+ __name: "TableWidget",
1806
+ props: {
1807
+ name: {},
1808
+ label: {},
1809
+ component: {},
1810
+ slot: {},
1811
+ col: {},
1812
+ width: {},
1813
+ html: {},
1814
+ title: {},
1815
+ type: {},
1816
+ token: {},
1817
+ count: {},
1818
+ items: {}
1819
+ },
1820
+ setup(a) {
1821
+ const l = De(), o = $([]), e = $([]), n = a, g = $([]), d = $(""), y = $("");
1822
+ async function v() {
1823
+ const c = await fetch("/api/data/" + n.token).then((u) => u.json());
1824
+ o.value = c.rows, e.value = c.columns, g.value = c.actions, d.value = c.form, y.value = c.addToken;
1825
+ }
1826
+ const { $notify: p = console.log, $confirm: r, $form: f } = l?.appContext?.config?.globalProperties || {};
1827
+ async function m(c) {
1828
+ await f({ token: c.token }), v();
1829
+ }
1830
+ function C() {
1831
+ f({ token: y.value });
1832
+ }
1833
+ function O(c) {
1834
+ r({
1835
+ title: "Підтвердіть дію",
1836
+ type: "error",
1837
+ message: "Ви впевненні що бажаєте видалити даний рядок?",
1838
+ onConfirm: async () => {
1839
+ const u = await fetch(`/api/table/${c.token}`, { method: "DELETE" });
1840
+ if (!u.ok) {
1841
+ const { error: T, code: k } = await u.json();
1842
+ p({ title: "Помилка", type: "warning", message: T });
1843
+ return;
1844
+ }
1845
+ p({ title: "Видаленно", message: "Успішно видалено" }), await v();
1846
+ }
1847
+ });
1848
+ }
1849
+ re(async () => {
1850
+ await v();
1851
+ });
1852
+ function z(c, u) {
1853
+ return u.format?.toLowerCase() === "text" ? c[u.name] : c[u.name + "_data"] ?? c[u.name + "_text"] ?? "-";
1854
+ }
1855
+ return (c, u) => (s(), i("div", null, [
1856
+ t("div", Lo, [
1857
+ t("div", To, x(c.title), 1),
1858
+ g.value.includes("add") && y.value ? (s(), i("button", {
1859
+ key: 0,
1860
+ onClick: C,
1861
+ class: "px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-blue-100 text-blue-500 hover:bg-blue-500 focus:ring-blue-500"
1862
+ }, "Додати")) : b("", !0)
1863
+ ]),
1864
+ t("div", Do, [
1865
+ t("table", Io, [
1866
+ t("thead", jo, [
1867
+ t("tr", null, [
1868
+ (s(!0), i(I, null, E(e.value, (T) => (s(), i("th", Vo, x(T.ua), 1))), 256)),
1869
+ g.value.includes("edit") ? (s(), i("th", Ao, " Дії ")) : b("", !0)
1870
+ ])
1871
+ ]),
1872
+ t("tbody", zo, [
1873
+ (s(!0), i(I, null, E(o.value, (T) => (s(), i("tr", Ho, [
1874
+ (s(!0), i(I, null, E(e.value, (k) => (s(), i("td", Eo, [
1875
+ k.link ? (s(), i("a", {
1876
+ key: 0,
1877
+ href: k.link.replace("{{id}}", T.id),
1878
+ class: "font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"
1879
+ }, x(z(T, k)), 9, Fo)) : (s(), i(I, { key: 1 }, [
1880
+ F(x(z(T, k)), 1)
1881
+ ], 64))
1882
+ ]))), 256)),
1883
+ t("td", So, [
1884
+ T.token ? (s(), i("button", {
1885
+ key: 0,
1886
+ onClick: (k) => m(T),
1887
+ class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
1888
+ }, [...u[0] || (u[0] = [
1889
+ t("svg", {
1890
+ xmlns: "http://www.w3.org/2000/svg",
1891
+ width: "12px",
1892
+ height: "24",
1893
+ viewBox: "0 0 24 24",
1894
+ fill: "none",
1895
+ stroke: "currentColor",
1896
+ "stroke-width": "2",
1897
+ "stroke-linecap": "round",
1898
+ "stroke-linejoin": "round"
1899
+ }, [
1900
+ t("path", {
1901
+ d: "M20,16v4a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V6A2,2,0,0,1,4,4H8",
1902
+ fill: "none",
1903
+ stroke: "#000000",
1904
+ "stroke-linecap": "round",
1905
+ "stroke-linejoin": "round",
1906
+ "stroke-width": "2"
1907
+ }),
1908
+ t("polygon", {
1909
+ fill: "none",
1910
+ points: "12.5 15.8 22 6.2 17.8 2 8.3 11.5 8 16 12.5 15.8",
1911
+ stroke: "#000000",
1912
+ "stroke-linecap": "round",
1913
+ "stroke-linejoin": "round",
1914
+ "stroke-width": "2"
1915
+ })
1916
+ ], -1)
1917
+ ])], 8, No)) : b("", !0),
1918
+ T.token ? (s(), i("button", {
1919
+ key: 1,
1920
+ onClick: (k) => O(T),
1921
+ class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
1922
+ }, [...u[1] || (u[1] = [
1923
+ Ie('<svg class="flex-shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="12px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>', 1)
1924
+ ])], 8, Oo)) : b("", !0)
1925
+ ])
1926
+ ]))), 256))
1836
1927
  ])
1837
1928
  ])
1838
- ])) : $("", !0)
1929
+ ])
1839
1930
  ]));
1840
1931
  }
1841
- }), zo = {
1842
- "vs-widget-map": ae,
1932
+ }), Me = {
1933
+ "vs-widget-map": ie,
1843
1934
  "vs-widget-comments": se,
1844
1935
  "vs-widget-history": oe,
1845
- "vs-widget-gallery": ie,
1846
- "vs-widget-file": ne,
1847
- "vs-widget-list": Ce
1848
- }, jo = {
1936
+ "vs-widget-gallery": ne,
1937
+ "vs-widget-file": $e,
1938
+ "vs-widget-list": Ce,
1939
+ "vs-widget-table": Bo
1940
+ }, Po = {
1849
1941
  key: 0,
1850
- class: "overflow-hidden"
1851
- }, Vo = { class: "flex border-b border-gray-200 bg-gray-50" }, Fo = ["onClick"], Ho = { class: "p-1" }, Ao = ["innerHTML"], So = {
1852
- key: 1,
1853
- class: "p-1"
1854
- }, Eo = { class: "grid grid-cols-12 gap-4" }, Oo = {
1942
+ class: "mb-4 pb-2 border-b border-gray-200"
1943
+ }, Ro = { class: "text-lg font-semibold text-gray-900" }, Uo = ["innerHTML"], Wo = {
1855
1944
  key: 0,
1856
1945
  class: "mb-4 pb-2 border-b border-gray-200"
1857
- }, Bo = { class: "text-lg font-semibold text-gray-900" }, No = ["innerHTML"], ve = /* @__PURE__ */ I({
1946
+ }, qo = { class: "text-lg font-semibold text-gray-900" }, Go = ["innerHTML"], Le = /* @__PURE__ */ j({
1947
+ __name: "CardItem",
1948
+ props: {
1949
+ items: {},
1950
+ type: {},
1951
+ col: {},
1952
+ data: {},
1953
+ html: {},
1954
+ title: {},
1955
+ name: {},
1956
+ label: {},
1957
+ component: {},
1958
+ slot: {},
1959
+ id: {},
1960
+ className: {},
1961
+ style: {}
1962
+ },
1963
+ setup(a) {
1964
+ const l = a, o = N(() => l.col ? {
1965
+ [`lg:col-span-${l.col}`]: !0
1966
+ } : {});
1967
+ function e(g) {
1968
+ return Me[g] || g;
1969
+ }
1970
+ const n = N(() => {
1971
+ const g = {};
1972
+ return g.col && (g.col = g.col), g;
1973
+ });
1974
+ return (g, d) => (s(), i("div", {
1975
+ class: D(["w-full bg-gray-50 rounded-lg p-4 col-span-12", o.value])
1976
+ }, [
1977
+ g.title ? (s(), i("div", Po, [
1978
+ t("h3", Ro, x(g.title), 1)
1979
+ ])) : b("", !0),
1980
+ g.html ? (s(), i("div", {
1981
+ key: 1,
1982
+ innerHTML: g.html,
1983
+ class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
1984
+ }, null, 8, Uo)) : g.type?.includes("tabs") ? (s(), A(le, {
1985
+ key: 2,
1986
+ view: "tab",
1987
+ panels: g.items,
1988
+ data: g.data
1989
+ }, null, 8, ["panels", "data"])) : (s(!0), i(I, { key: 3 }, E(g.items, (y) => (s(), i(I, null, [
1990
+ y.title || y.label ? (s(), i("div", Wo, [
1991
+ t("h3", qo, x(y.title || y.label), 1)
1992
+ ])) : b("", !0),
1993
+ y.html ? (s(), i("div", {
1994
+ key: 1,
1995
+ innerHTML: y.html,
1996
+ class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
1997
+ }, null, 8, Go)) : y.component ? (s(), A(B(e(y.component)), K({
1998
+ key: 2,
1999
+ ref_for: !0
2000
+ }, { ...n.value, ...g.data }, { class: "w-full" }), null, 16)) : q(g.$slots, "default", { key: 3 })
2001
+ ], 64))), 256))
2002
+ ], 2));
2003
+ }
2004
+ }), Ko = { class: "md:flex gap-[20px]" }, Zo = {
2005
+ key: 0,
2006
+ class: "col-span-4"
2007
+ }, Jo = ["innerHTML"], Xo = {
2008
+ key: 1,
2009
+ class: "overflow-hidden w-full"
2010
+ }, Qo = { class: "flex border-b border-gray-200 bg-gray-50" }, Yo = ["onClick"], en = { class: "p-1" }, tn = ["innerHTML"], sn = {
2011
+ key: 2,
2012
+ class: "p-1 w-full"
2013
+ }, on = { class: "grid grid-cols-12 gap-4" }, le = /* @__PURE__ */ j({
1858
2014
  __name: "Card",
1859
2015
  props: {
1860
2016
  panels: { default: () => [] },
@@ -1862,161 +2018,190 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
1862
2018
  view: { default: "plain" },
1863
2019
  classWrapper: { default: "" },
1864
2020
  classPanel: {},
1865
- normalizeTabs: { type: Boolean, default: !1 },
2021
+ normalizeTabs: { type: Boolean, default: !0 },
1866
2022
  id: {},
1867
2023
  className: {},
1868
2024
  style: {}
1869
2025
  },
1870
- setup(l) {
1871
- const i = l, n = M(0);
1872
- function t(d) {
1873
- return zo[d] || d;
2026
+ setup(a) {
2027
+ const l = a, o = $(0), e = $([]);
2028
+ function n(r) {
2029
+ return Me[r] || r;
1874
2030
  }
1875
- function s(d) {
1876
- const y = [];
1877
- for (const p of d) {
1878
- if (!p?.items) {
1879
- y.push(p);
1880
- continue;
1881
- }
1882
- if (p.items.length === 1) {
1883
- let b = p.items[0];
1884
- delete p.items, b = { ...p, ...b }, y.push(b);
1885
- } else {
1886
- const b = p;
1887
- b.component = "Card", p.type && (b.view = p.type.includes("tab") ? "tab" : "plain"), b.panels = p.items, b.data = i.data, b.normalizeTabs = !1, y.push(b);
1888
- }
1889
- }
1890
- return y;
2031
+ function g(r) {
2032
+ return e.value = r.filter((f) => f.type === "pin"), r.filter((f) => f.type !== "pin");
1891
2033
  }
1892
- const f = O(() => i.panels && i.panels.length > 0 ? i.normalizeTabs ? s(i.panels) : i.panels : i.data && Array.isArray(i.data) ? i.data.filter((y) => y.type === "tabs")[0]?.items || [] : []), o = O(() => i.panels && i.panels.length > 0 ? i.normalizeTabs ? s(i.panels) : i.panels : i.data && Array.isArray(i.data) ? i.data : []), m = O(() => ({
1893
- [`view-${i.view}`]: !0
1894
- })), v = (d) => {
1895
- const y = i.data ? { ...i.data } : {};
1896
- return d.count && (y.count = d.count), d.col && (y.col = d.col), y;
1897
- }, g = (d) => d.width ? {
1898
- gridColumn: `span ${d.width}`
1899
- } : {};
1900
- return (d, y) => (a(), r("div", {
1901
- class: D(m.value + d.classWrapper)
2034
+ const d = N(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? g(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data.filter((f) => f.type === "tabs")[0]?.items || [] : []), y = N(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? g(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data : []), v = N(() => ({
2035
+ [`view-${l.view}`]: !0
2036
+ })), p = (r) => {
2037
+ const f = {};
2038
+ return r.count && (f.count = r.count), r.col && (f.col = r.col), r.html && (f.html = r.html), r.title && (f.title = r.title), r.type && (f.type = r.type), r.token && (f.token = r.token), l.data && (f.data = l.data), f;
2039
+ };
2040
+ return (r, f) => (s(), i("div", {
2041
+ class: D(r.classWrapper || v.value)
1902
2042
  }, [
1903
- d.view === "tab" ? (a(), r("div", jo, [
1904
- e("div", Vo, [
1905
- (a(!0), r(A, null, S(f.value, (p, b) => (a(), r("button", {
1906
- key: p.name || b,
1907
- onClick: (W) => n.value = b,
1908
- class: D([
1909
- "px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",
1910
- { "text-blue-600 bg-white border-b-2 border-blue-600": n.value === b }
1911
- ])
1912
- }, k(p.title || p.label || p.name || `Tab ${b + 1}`), 11, Fo))), 128))
1913
- ]),
1914
- e("div", Ho, [
1915
- (a(!0), r(A, null, S(f.value, (p, b) => U((a(), r("div", {
1916
- key: p.name || b,
1917
- class: D([
1918
- d.classPanel || "w-full border-gray-100",
1919
- `col-span-${p.col || 12}`
1920
- ])
2043
+ t("div", Ko, [
2044
+ e.value.length !== 0 ? (s(), i("div", Zo, [
2045
+ (s(!0), i(I, null, E(e.value[0].items, (m, C) => (s(), i("div", {
2046
+ key: m.name || C,
2047
+ class: "w-full bg-gray-50 rounded-lg p-4 col-span-12 w-full m-1 mb-3"
1921
2048
  }, [
1922
- p.html ? (a(), r("div", {
2049
+ m.html ? (s(), i("div", {
1923
2050
  key: 0,
1924
- innerHTML: p.html,
1925
- class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
1926
- }, null, 8, Ao)) : d.$slots[`tab-${b}`] ? G(d.$slots, `tab-${b}`, {
1927
- key: 1,
1928
- item: p,
1929
- data: d.data
1930
- }) : p.component ? (a(), j(N(p.component), te({
1931
- key: 2,
1932
- ref_for: !0
1933
- }, p.component === "Card" ? p : v(p), { class: "w-full h-full" }), null, 16)) : G(d.$slots, p.slot || `tab-${b}`, {
1934
- key: 3,
1935
- item: p,
1936
- data: d.data
1937
- })
1938
- ], 2)), [
1939
- [Ie, n.value === b]
1940
- ])), 128))
1941
- ])
1942
- ])) : (a(), r("div", So, [
1943
- e("div", Eo, [
1944
- (a(!0), r(A, null, S(o.value, (p, b) => (a(), r("div", {
1945
- key: p.name || b,
1946
- class: D([
1947
- d.classPanel || "bg-gray-50 rounded-lg p-4 border-gray-100",
1948
- `col-span-${p.col || 12}`
1949
- ]),
1950
- style: R(g(p))
1951
- }, [
1952
- p.title || p.label ? (a(), r("div", Oo, [
1953
- e("h3", Bo, k(p.title || p.label), 1)
1954
- ])) : $("", !0),
1955
- p.html ? (a(), r("div", {
2051
+ innerHTML: m.html,
2052
+ class: "text-gray-900 leading-relaxed"
2053
+ }, null, 8, Jo)) : m.component ? (s(), A(B(n(m.component)), K({
1956
2054
  key: 1,
1957
- innerHTML: p.html,
1958
- class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
1959
- }, null, 8, No)) : d.$slots[`panel-${b}`] ? G(d.$slots, `panel-${b}`, {
1960
- key: 2,
1961
- item: p,
1962
- data: d.data
1963
- }) : p.component ? (a(), j(N(t(p.component)), te({
1964
- key: 3,
1965
2055
  ref_for: !0
1966
- }, p.component === "Card" ? p : v(p), { class: "w-full h-full" }), null, 16)) : G(d.$slots, p.slot || `panel-${b}`, {
1967
- key: 4,
1968
- item: p,
1969
- data: d.data
1970
- })
1971
- ], 6))), 128))
1972
- ])
1973
- ]))
2056
+ }, m.component === "Card" ? m : p(m), {
2057
+ id: r.data.id,
2058
+ class: "w-full h-full"
2059
+ }), null, 16, ["id"])) : b("", !0)
2060
+ ]))), 128))
2061
+ ])) : b("", !0),
2062
+ r.view === "tab" ? (s(), i("div", Xo, [
2063
+ t("div", Qo, [
2064
+ (s(!0), i(I, null, E(d.value, (m, C) => (s(), i("button", {
2065
+ key: m.name || C,
2066
+ onClick: (O) => o.value = C,
2067
+ class: D([
2068
+ "px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",
2069
+ { "text-blue-600 bg-white border-b-2 border-blue-600": o.value === C }
2070
+ ])
2071
+ }, x(m.title || m.label || m.name || `Tab ${C + 1}`), 11, Yo))), 128))
2072
+ ]),
2073
+ t("div", en, [
2074
+ (s(!0), i(I, null, E(d.value, (m, C) => R((s(), i("div", {
2075
+ key: m.name || C,
2076
+ class: D([
2077
+ r.classPanel || "w-full border-gray-100 py-2",
2078
+ `col-span-${m.col || 12}`
2079
+ ])
2080
+ }, [
2081
+ m.html ? (s(), i("div", {
2082
+ key: 0,
2083
+ innerHTML: m.html,
2084
+ class: "text-gray-900 leading-relaxed"
2085
+ }, null, 8, tn)) : r.$slots[`tab-${C}`] ? q(r.$slots, `tab-${C}`, {
2086
+ key: 1,
2087
+ item: m,
2088
+ data: r.data
2089
+ }) : m.component || m.name ? (s(), A(B(n(m.component || m.name)), K({
2090
+ key: 2,
2091
+ ref_for: !0
2092
+ }, m.component === "Card" ? m : p(m), {
2093
+ id: r.data.id,
2094
+ class: "w-full h-full"
2095
+ }), null, 16, ["id"])) : q(r.$slots, m.slot || `tab-${C}`, {
2096
+ key: 3,
2097
+ item: m,
2098
+ data: r.data
2099
+ })
2100
+ ], 2)), [
2101
+ [je, o.value === C]
2102
+ ])), 128))
2103
+ ])
2104
+ ])) : (s(), i("div", sn, [
2105
+ t("div", on, [
2106
+ (s(!0), i(I, null, E(y.value, (m, C) => (s(), i(I, {
2107
+ key: m.name || C
2108
+ }, [
2109
+ r.$slots[`panel-${C}`] ? q(r.$slots, `panel-${C}`, {
2110
+ key: 0,
2111
+ item: m,
2112
+ data: r.data
2113
+ }) : m.items || m.html ? (s(), A(B(Le), K({
2114
+ key: 1,
2115
+ ref_for: !0
2116
+ }, p(m), {
2117
+ items: m.items,
2118
+ class: "w-full h-full"
2119
+ }), null, 16, ["items"])) : m.component ? (s(), A(B(n(m.component)), K({
2120
+ key: 2,
2121
+ ref_for: !0
2122
+ }, p(m), { class: "w-full h-full" }), null, 16)) : q(r.$slots, m.slot || `panel-${C}`, {
2123
+ key: 3,
2124
+ item: m,
2125
+ data: r.data
2126
+ })
2127
+ ], 64))), 128))
2128
+ ])
2129
+ ]))
2130
+ ])
1974
2131
  ], 2));
1975
2132
  }
1976
- }), Ro = ["innerHTML"], Uo = /* @__PURE__ */ I({
1977
- __name: "CardItem",
1978
- props: {
1979
- name: {},
1980
- label: {},
1981
- component: {},
1982
- slot: {},
1983
- col: { default: 12 },
1984
- html: {},
1985
- title: {},
1986
- id: {},
1987
- className: {},
1988
- style: {}
1989
- },
1990
- setup(l) {
1991
- const i = l, n = O(() => ({
1992
- [`col-span-${i.col}`]: !0
1993
- })), t = O(() => {
1994
- const s = {};
1995
- return s.col && (s.col = s.col), s;
1996
- });
1997
- return (s, f) => (a(), r("div", {
1998
- class: D(["w-full", n.value])
1999
- }, [
2000
- s.html ? (a(), r("div", {
2001
- key: 0,
2002
- innerHTML: s.html,
2003
- class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
2004
- }, null, 8, Ro)) : s.component ? (a(), j(N(s.component), te({ key: 1 }, t.value, { class: "w-full" }), null, 16)) : G(s.$slots, "default", { key: 2 })
2005
- ], 2));
2133
+ }), nn = ["onClick"], ln = /* @__PURE__ */ j({
2134
+ __name: "CopyNotification",
2135
+ setup(a, { expose: l }) {
2136
+ const o = $([]);
2137
+ let e = 1;
2138
+ const n = () => {
2139
+ if (o.value.length >= 10) {
2140
+ const y = o.value[0];
2141
+ clearTimeout(y.timer), o.value.shift();
2142
+ }
2143
+ const d = {
2144
+ id: e++,
2145
+ timer: setTimeout(() => {
2146
+ g(d.id);
2147
+ }, 1500)
2148
+ };
2149
+ o.value.push(d);
2150
+ }, g = (d) => {
2151
+ const y = o.value.findIndex((v) => v.id === d);
2152
+ if (y !== -1) {
2153
+ const v = o.value[y];
2154
+ clearTimeout(v.timer), o.value.splice(y, 1);
2155
+ }
2156
+ };
2157
+ return l({
2158
+ addNotification: n
2159
+ }), ye(() => {
2160
+ o.value.forEach((d) => {
2161
+ clearTimeout(d.timer);
2162
+ });
2163
+ }), (d, y) => (s(), A(Ve, { to: "body" }, [
2164
+ M(Ae, {
2165
+ name: "notification",
2166
+ tag: "div",
2167
+ class: "fixed top-4 right-4 z-50 space-y-2"
2168
+ }, {
2169
+ default: ze(() => [
2170
+ (s(!0), i(I, null, E(o.value, (v) => (s(), i("div", {
2171
+ key: v.id,
2172
+ class: "bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"
2173
+ }, [
2174
+ M(w(Be), { class: "h-5 w-5 text-green-100 flex-shrink-0" }),
2175
+ y[0] || (y[0] = t("div", { class: "flex-1" }, [
2176
+ t("p", { class: "font-medium text-sm" }, "Ссылка скопирована!"),
2177
+ t("p", { class: "text-xs text-green-100 opacity-90" }, "Файл добавлен в буфер обмена")
2178
+ ], -1)),
2179
+ t("button", {
2180
+ onClick: (p) => g(v.id),
2181
+ class: "text-green-100 hover:text-white transition-colors flex-shrink-0"
2182
+ }, [
2183
+ M(w(ue), { class: "h-4 w-4" })
2184
+ ], 8, nn)
2185
+ ]))), 128))
2186
+ ]),
2187
+ _: 1
2188
+ })
2189
+ ]));
2006
2190
  }
2007
- });
2008
- ve.install = function(l) {
2009
- l.component("vs-widget-file", ne), l.component("vs-widget-comments", se), l.component("vs-widget-history", oe), l.component("vs-widget-gallery", ie), l.component("vs-widget-map", ae), l.component("CommentsWidget", se), l.component("HistoryWidget", oe), l.component("GalleryWidget", ie), l.component("FilesWidget", ne), l.component("MapWidget", ae), l.component("Card", ve), l.component("CardItem", Uo), l.component("DescriptionListWidget", Ce), l.component("CopyNotification", $e);
2191
+ }), an = /* @__PURE__ */ W(ln, [["__scopeId", "data-v-55903525"]]);
2192
+ le.install = function(a) {
2193
+ a.component("vs-widget-file", he), a.component("vs-widget-comments", se), a.component("vs-widget-history", oe), a.component("vs-widget-gallery", ne), a.component("vs-widget-map", ie), a.component("CommentsWidget", se), a.component("HistoryWidget", oe), a.component("GalleryWidget", ne), a.component("FilesWidget", he), a.component("MapWidget", ie), a.component("Card", le), a.component("CardItem", Le), a.component("DescriptionListWidget", Ce), a.component("CopyNotification", an);
2010
2194
  };
2011
2195
  export {
2012
- ve as Card,
2013
- Uo as CardItem,
2196
+ le as Card,
2197
+ Le as CardItem,
2014
2198
  se as CommentsWidget,
2015
- $e as CopyNotification,
2199
+ an as CopyNotification,
2016
2200
  Ce as DescriptionListWidget,
2017
- ne as FilesWidget,
2018
- ie as GalleryWidget,
2201
+ he as FilesWidget,
2202
+ ne as GalleryWidget,
2019
2203
  oe as HistoryWidget,
2020
- ae as MapWidget,
2021
- ve as default
2204
+ ie as MapWidget,
2205
+ Bo as TableWidget,
2206
+ le as default
2022
2207
  };