@opengis/partsmap 0.0.104 → 0.1.1

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/index.js ADDED
@@ -0,0 +1,3589 @@
1
+ import { defineComponent as N, ref as $, createElementBlock as k, openBlock as p, createElementVNode as o, withModifiers as Fe, normalizeClass as z, createCommentVNode as V, toDisplayString as L, computed as H, watch as A, createStaticVNode as Le, Fragment as F, renderList as W, unref as e, createBlock as j, createVNode as I, createTextVNode as Y, withDirectives as O, vShow as ee, vModelText as le, onMounted as ue, onBeforeUnmount as ge, Teleport as Ke, normalizeStyle as xe, renderSlot as te, nextTick as we, isRef as Ye, withCtx as ne, resolveDynamicComponent as ae, mergeProps as Z, toRaw as fe, cloneVNode as We, useSlots as ke, resolveDirective as qe } from "vue";
2
+ const Ge = { class: "flex items-center justify-between w-full text-sm" }, Qe = { class: "flex items-center cursor-pointer w-full" }, Ze = {
3
+ key: 0,
4
+ width: "16",
5
+ height: "auto",
6
+ src: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="
7
+ }, Xe = ["value"], Je = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, et = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, tt = {
8
+ key: 0,
9
+ class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
10
+ }, Ce = /* @__PURE__ */ N({
11
+ __name: "list-item",
12
+ props: {
13
+ layout: {},
14
+ count: {},
15
+ type: {},
16
+ label: {},
17
+ value: {},
18
+ isSelected: { type: Boolean },
19
+ color: {},
20
+ highlighted: { type: Boolean }
21
+ },
22
+ emits: ["itemClick"],
23
+ setup(s, { expose: a, emit: d }) {
24
+ const l = s, n = d;
25
+ function r() {
26
+ n("itemClick", l.value);
27
+ }
28
+ const v = $(null);
29
+ return a({ el: v }), (y, g) => (p(), k("div", {
30
+ class: "flex items-center w-full rounded-lg group hover:bg-gray-100",
31
+ ref_key: "el",
32
+ ref: v
33
+ }, [
34
+ o("div", Ge, [
35
+ o("div", Qe, [
36
+ o("label", {
37
+ for: "radio-9740",
38
+ class: z([
39
+ ["inline", "popover"].includes(y.layout) ? "text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center" : "flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",
40
+ { "bg-blue-100": y.highlighted }
41
+ ]),
42
+ onClick: Fe(r, ["stop", "prevent"])
43
+ }, [
44
+ o("div", {
45
+ class: z(["w-[18px] h-[18px] border flex items-center justify-center", [
46
+ y.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
47
+ y.color ? `bg-[${y.color}] border-[#ffffff]` : y.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
48
+ ]])
49
+ }, [
50
+ y.isSelected ? (p(), k("img", Ze)) : V("", !0)
51
+ ], 2),
52
+ o("input", {
53
+ type: "checkbox",
54
+ class: "hidden",
55
+ id: "radio-9740",
56
+ value: y.value
57
+ }, null, 8, Xe),
58
+ o("div", Je, [
59
+ o("span", et, L(y.label ?? "Відсутні данні"), 1),
60
+ y.count ? (p(), k("div", tt, " (" + L(y.count) + ") ", 1)) : V("", !0)
61
+ ])
62
+ ], 2)
63
+ ])
64
+ ])
65
+ ], 512));
66
+ }
67
+ });
68
+ function Ee(s, a) {
69
+ const {
70
+ options: d = [],
71
+ limit: l = 20
72
+ } = s;
73
+ function n(i) {
74
+ return Array.isArray(i) ? i[0] : i;
75
+ }
76
+ const r = $(n(s.modelValue)), v = $(""), y = $(!1), g = $([]), C = $("id"), b = $("text"), f = $(!1), h = $(s.layout !== "popover" && d.length > l);
77
+ function _(i) {
78
+ const w = i.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((K) => K in w) ?? "id", S = ["text", "label", "name", "title"].find((K) => K in w) ?? "text";
79
+ return { autoValueKey: B, autoLabelKey: S };
80
+ }
81
+ if (d.length > 0) {
82
+ const i = _(d);
83
+ C.value = i.autoValueKey, b.value = i.autoLabelKey;
84
+ }
85
+ const c = H(() => {
86
+ const i = g.value;
87
+ return s.layout === "popover" || f.value ? i : i.slice(0, l);
88
+ });
89
+ A(() => s.modelValue, (i) => {
90
+ r.value = n(i);
91
+ }, { immediate: !0 }), g.value = [...d].sort((i, w) => s.sort === "count" ? w.count && i.count ? w.count - i.count : 0 : s.sort === "name" ? String(i[b.value] ?? "").localeCompare(String(w[b.value] ?? "")) : 0);
92
+ function u(i) {
93
+ return r.value === i[C.value];
94
+ }
95
+ function t(i) {
96
+ r.value = i[C.value], a("update:modelValue", r.value), a("change", { name: s.name, value: r.value });
97
+ }
98
+ function x() {
99
+ r.value = void 0, a("update:modelValue", r.value), a("clear", s.name);
100
+ }
101
+ function m() {
102
+ f.value = !f.value;
103
+ }
104
+ return {
105
+ innerValue: r,
106
+ searchTerm: v,
107
+ filteredOptions: c,
108
+ isSelected: u,
109
+ selectItem: t,
110
+ clear: x,
111
+ toggleShowAll: m,
112
+ isReqProc: y,
113
+ showAll: f,
114
+ isEnableShowAll: h,
115
+ labelKey: b,
116
+ valueKey: C,
117
+ allOptions: g
118
+ };
119
+ }
120
+ const X = (s, a) => {
121
+ const d = s.__vccOpts || s;
122
+ for (const [l, n] of a)
123
+ d[l] = n;
124
+ return d;
125
+ }, lt = {}, ot = {
126
+ class: "w-48 mx-auto",
127
+ viewBox: "0 0 178 90",
128
+ fill: "none",
129
+ xmlns: "http://www.w3.org/2000/svg"
130
+ };
131
+ function nt(s, a) {
132
+ return p(), k("svg", ot, a[0] || (a[0] = [
133
+ Le('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
134
+ ]));
135
+ }
136
+ const _e = /* @__PURE__ */ X(lt, [["render", nt]]), at = {}, rt = {
137
+ xmlns: "http://www.w3.org/2000/svg",
138
+ width: "24",
139
+ height: "24",
140
+ viewBox: "0 0 24 24",
141
+ fill: "none",
142
+ stroke: "currentColor",
143
+ "stroke-width": "2",
144
+ "stroke-linecap": "round",
145
+ "stroke-linejoin": "round",
146
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"
147
+ };
148
+ function st(s, a) {
149
+ return p(), k("svg", rt, a[0] || (a[0] = [
150
+ o("path", {
151
+ stroke: "none",
152
+ d: "M0 0h24v24H0z",
153
+ fill: "none"
154
+ }, null, -1),
155
+ o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
156
+ ]));
157
+ }
158
+ const ye = /* @__PURE__ */ X(at, [["render", st]]), it = {}, ut = {
159
+ xmlns: "http://www.w3.org/2000/svg",
160
+ width: "24",
161
+ height: "24",
162
+ viewBox: "0 0 24 24",
163
+ fill: "none",
164
+ stroke: "currentColor",
165
+ "stroke-width": "2",
166
+ "stroke-linecap": "round",
167
+ "stroke-linejoin": "round",
168
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"
169
+ };
170
+ function dt(s, a) {
171
+ return p(), k("svg", ut, a[0] || (a[0] = [
172
+ o("path", {
173
+ stroke: "none",
174
+ d: "M0 0h24v24H0z",
175
+ fill: "none"
176
+ }, null, -1),
177
+ o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
178
+ ]));
179
+ }
180
+ const $e = /* @__PURE__ */ X(it, [["render", dt]]), ct = {
181
+ key: 0,
182
+ class: "w-full"
183
+ }, pt = { class: "flex flex-col items-center justify-center p-5 text-center" }, ft = {
184
+ key: 0,
185
+ class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
186
+ }, mt = {
187
+ key: 1,
188
+ class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
189
+ }, vt = /* @__PURE__ */ N({
190
+ __name: "radio",
191
+ props: {
192
+ id: {},
193
+ name: {},
194
+ type: {},
195
+ label: {},
196
+ width: {},
197
+ options: { default: () => [] },
198
+ placeHolder: {},
199
+ api: {},
200
+ data: {},
201
+ default: {},
202
+ modelValue: {},
203
+ disabled: { type: Boolean, default: !1 },
204
+ layout: { default: "inline" },
205
+ cleanable: { type: Boolean },
206
+ limit: { default: 10 },
207
+ multi: { type: Boolean },
208
+ dataKey: {},
209
+ valueKey: {},
210
+ mode: {},
211
+ labelKey: {},
212
+ sort: {}
213
+ },
214
+ emits: ["update:modelValue", "change", "clear"],
215
+ setup(s, { expose: a, emit: d }) {
216
+ const l = s, n = $(null), r = d, {
217
+ innerValue: v,
218
+ filteredOptions: y,
219
+ isSelected: g,
220
+ selectItem: C,
221
+ clear: b,
222
+ toggleShowAll: f,
223
+ isReqProc: h,
224
+ showAll: _,
225
+ isEnableShowAll: c,
226
+ labelKey: u,
227
+ valueKey: t,
228
+ allOptions: x
229
+ } = Ee({
230
+ ...l,
231
+ modelValue: l.modelValue ?? l.default ?? ""
232
+ }, r);
233
+ return a({
234
+ clear: b,
235
+ inputTextRef: n
236
+ }), A(
237
+ () => l.modelValue,
238
+ (m) => {
239
+ m === void 0 && (v.value = void 0);
240
+ }
241
+ ), (m, i) => (p(), k("div", {
242
+ class: z([m.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
243
+ }, [
244
+ o("div", {
245
+ class: z([
246
+ m.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
247
+ m.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
248
+ ])
249
+ }, [
250
+ (p(!0), k(F, null, W(e(y), (w) => (p(), j(Ce, {
251
+ layout: m.layout,
252
+ key: w[e(t)],
253
+ count: w.count,
254
+ label: w[e(u)],
255
+ color: w.color,
256
+ type: "radio",
257
+ value: w[e(t)],
258
+ "is-selected": e(g)(w),
259
+ onItemClick: (B) => e(C)(w)
260
+ }, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
261
+ ], 2),
262
+ m.type === "select" && e(y).length === 0 && !e(h) ? (p(), k("div", ct, [
263
+ o("div", pt, [
264
+ I(_e),
265
+ i[4] || (i[4] = o("div", { class: "max-w-sm mx-auto mt-6" }, [
266
+ o("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
267
+ o("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
268
+ ], -1))
269
+ ])
270
+ ])) : V("", !0),
271
+ m.layout !== "popover" && m.type !== "select" ? (p(), k(F, { key: 1 }, [
272
+ !e(_) && e(c) ? (p(), k("div", {
273
+ key: 0,
274
+ onClick: i[0] || (i[0] = //@ts-ignore
275
+ (...w) => e(f) && e(f)(...w)),
276
+ class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
277
+ }, [
278
+ i[5] || (i[5] = Y(" Показати більше ", -1)),
279
+ I(ye)
280
+ ])) : V("", !0),
281
+ e(_) ? (p(), k("div", {
282
+ key: 1,
283
+ onClick: i[1] || (i[1] = //@ts-ignore
284
+ (...w) => e(f) && e(f)(...w)),
285
+ class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
286
+ }, [
287
+ i[6] || (i[6] = Y(" Показати менше ", -1)),
288
+ I($e)
289
+ ])) : V("", !0)
290
+ ], 64)) : V("", !0),
291
+ m.cleanable ? (p(), k(F, { key: 2 }, [
292
+ m.layout === "inline" ? (p(), k("div", ft, [
293
+ Y(L(e(v) || e(v) === null ? 1 : 0) + " з " + L(e(x).length) + " обрано ", 1),
294
+ O(o("button", {
295
+ class: "text-gray-600 hover:text-gray-800",
296
+ onClick: i[2] || (i[2] = //@ts-ignore
297
+ (...w) => e(b) && e(b)(...w))
298
+ }, " Очистити ", 512), [
299
+ [ee, e(v) !== "" && e(v) !== void 0]
300
+ ])
301
+ ])) : V("", !0),
302
+ m.layout === "popover" ? (p(), k("div", mt, [
303
+ o("span", null, L(e(v) || e(v) === null ? 1 : 0) + " з " + L(e(x).length) + " обрано", 1),
304
+ O(o("button", {
305
+ class: "text-gray-600 hover:text-gray-800",
306
+ onClick: i[3] || (i[3] = //@ts-ignore
307
+ (...w) => e(b) && e(b)(...w))
308
+ }, " Очистити ", 512), [
309
+ [ee, e(v) !== "" && e(v) !== void 0]
310
+ ])
311
+ ])) : V("", !0)
312
+ ], 64)) : V("", !0)
313
+ ], 2));
314
+ }
315
+ });
316
+ function Te(s, a) {
317
+ const {
318
+ options: d = [],
319
+ limit: l = 20
320
+ } = s;
321
+ function n(i) {
322
+ return Array.isArray(i) ? i : i ? [i] : [];
323
+ }
324
+ const r = $(n(s.modelValue)), v = $(""), y = $(!1), g = $([]), C = $("id"), b = $("text"), f = $(!1), h = $(s.layout !== "popover" && d.length > l);
325
+ function _(i) {
326
+ const w = i.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((K) => K in w) ?? "id", S = ["text", "label", "name", "title"].find((K) => K in w) ?? "text";
327
+ return { autoValueKey: B, autoLabelKey: S };
328
+ }
329
+ if (d.length > 0) {
330
+ const i = _(d);
331
+ C.value = i.autoValueKey, b.value = i.autoLabelKey;
332
+ }
333
+ const c = H(() => {
334
+ const i = g.value;
335
+ return s.layout === "popover" || f.value ? i : i.slice(0, l);
336
+ });
337
+ A(() => s.modelValue, (i) => {
338
+ r.value = n(i);
339
+ }, { immediate: !0 }), g.value = [...d].sort((i, w) => s.sort === "count" ? w.count && i.count ? w.count - i.count : 0 : s.sort === "name" ? String(i[b.value]).localeCompare(String(w[b.value])) : 0);
340
+ function u(i) {
341
+ return r.value && r.value.includes(i[C.value]);
342
+ }
343
+ function t(i) {
344
+ const w = r.value.includes(i[C.value]);
345
+ r.value = w ? r.value.filter((B) => B !== i[C.value]) : [...r.value, i[C.value]], a("update:modelValue", r.value), a("change", { name: s.name, value: r.value });
346
+ }
347
+ function x() {
348
+ r.value = [], a("update:modelValue", r.value), a("clear", s.name);
349
+ }
350
+ function m() {
351
+ f.value = !f.value;
352
+ }
353
+ return {
354
+ innerValue: r,
355
+ searchTerm: v,
356
+ filteredOptions: c,
357
+ isSelected: u,
358
+ selectItem: t,
359
+ clear: x,
360
+ toggleShowAll: m,
361
+ isReqProc: y,
362
+ showAll: f,
363
+ isEnableShowAll: h,
364
+ labelKey: b,
365
+ valueKey: C,
366
+ allOptions: g
367
+ };
368
+ }
369
+ const gt = {
370
+ key: 0,
371
+ class: "w-full"
372
+ }, yt = { class: "flex flex-col items-center justify-center p-5 text-center" }, bt = {
373
+ key: 0,
374
+ class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
375
+ }, ht = {
376
+ key: 1,
377
+ class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
378
+ }, De = /* @__PURE__ */ N({
379
+ __name: "checkbox",
380
+ props: {
381
+ id: {},
382
+ name: {},
383
+ type: {},
384
+ label: {},
385
+ width: {},
386
+ options: { default: () => [] },
387
+ placeHolder: {},
388
+ api: {},
389
+ data: {},
390
+ default: {},
391
+ modelValue: {},
392
+ disabled: { type: Boolean, default: !1 },
393
+ layout: { default: "inline" },
394
+ cleanable: { type: Boolean },
395
+ limit: { default: 10 },
396
+ multi: { type: Boolean },
397
+ dataKey: {},
398
+ valueKey: {},
399
+ mode: {},
400
+ labelKey: {},
401
+ sort: {}
402
+ },
403
+ emits: ["update:modelValue", "change", "clear"],
404
+ setup(s, { expose: a, emit: d }) {
405
+ const l = s, n = d, {
406
+ innerValue: r,
407
+ filteredOptions: v,
408
+ isSelected: y,
409
+ selectItem: g,
410
+ clear: C,
411
+ toggleShowAll: b,
412
+ isReqProc: f,
413
+ showAll: h,
414
+ isEnableShowAll: _,
415
+ labelKey: c,
416
+ valueKey: u,
417
+ allOptions: t
418
+ } = Te({
419
+ ...l,
420
+ modelValue: l.modelValue
421
+ }, n);
422
+ return A(
423
+ () => l.modelValue,
424
+ (x) => {
425
+ x === void 0 && (r.value = []);
426
+ }
427
+ ), a({
428
+ clear: C
429
+ }), (x, m) => (p(), k("div", {
430
+ class: z([x.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
431
+ }, [
432
+ o("div", {
433
+ class: z([
434
+ x.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
435
+ x.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
436
+ ])
437
+ }, [
438
+ (p(!0), k(F, null, W(e(v), (i) => (p(), j(Ce, {
439
+ layout: x.layout,
440
+ count: i.count,
441
+ label: i[e(c)],
442
+ color: i.color,
443
+ type: "checkbox",
444
+ value: i[e(u)],
445
+ "is-selected": e(y)(i),
446
+ onItemClick: (w) => e(g)(i)
447
+ }, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
448
+ ], 2),
449
+ x.type === "select" && e(v).length === 0 && !e(f) ? (p(), k("div", gt, [
450
+ o("div", yt, [
451
+ I(_e),
452
+ m[4] || (m[4] = o("div", { class: "max-w-sm mx-auto mt-6" }, [
453
+ o("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
454
+ o("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
455
+ ], -1))
456
+ ])
457
+ ])) : V("", !0),
458
+ x.layout !== "popover" && x.type !== "select" ? (p(), k(F, { key: 1 }, [
459
+ !e(h) && e(_) ? (p(), k("div", {
460
+ key: 0,
461
+ onClick: m[0] || (m[0] = //@ts-ignore
462
+ (...i) => e(b) && e(b)(...i)),
463
+ class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
464
+ }, [
465
+ m[5] || (m[5] = Y(" Показати більше ", -1)),
466
+ I(ye)
467
+ ])) : V("", !0),
468
+ e(h) ? (p(), k("div", {
469
+ key: 1,
470
+ onClick: m[1] || (m[1] = //@ts-ignore
471
+ (...i) => e(b) && e(b)(...i)),
472
+ class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
473
+ }, [
474
+ m[6] || (m[6] = Y(" Показати менше ", -1)),
475
+ I($e)
476
+ ])) : V("", !0)
477
+ ], 64)) : V("", !0),
478
+ x.cleanable ? (p(), k(F, { key: 2 }, [
479
+ x.layout === "inline" ? (p(), k("div", bt, [
480
+ Y(L(e(r).length) + " з " + L(e(t).length) + " обрано ", 1),
481
+ O(o("button", {
482
+ class: "text-gray-600 hover:text-gray-800",
483
+ onClick: m[2] || (m[2] = //@ts-ignore
484
+ (...i) => e(C) && e(C)(...i))
485
+ }, " Очистити ", 512), [
486
+ [ee, e(r).length !== 0]
487
+ ])
488
+ ])) : V("", !0),
489
+ x.layout === "popover" ? (p(), k("div", ht, [
490
+ o("span", null, L(e(r).length) + " з " + L(e(t).length) + " обрано", 1),
491
+ O(o("button", {
492
+ class: "text-gray-600 hover:text-gray-800",
493
+ onClick: m[3] || (m[3] = //@ts-ignore
494
+ (...i) => e(C) && e(C)(...i))
495
+ }, " Очистити ", 512), [
496
+ [ee, e(r).length !== 0]
497
+ ])
498
+ ])) : V("", !0)
499
+ ], 64)) : V("", !0)
500
+ ], 2));
501
+ }
502
+ }), xt = {}, wt = {
503
+ xmlns: "http://www.w3.org/2000/svg",
504
+ width: "15px",
505
+ height: "15px",
506
+ viewBox: "0 0 24 24",
507
+ fill: "none",
508
+ stroke: "currentColor",
509
+ "stroke-width": "2",
510
+ "stroke-linecap": "round",
511
+ "stroke-linejoin": "round",
512
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
513
+ };
514
+ function kt(s, a) {
515
+ return p(), k("svg", wt, a[0] || (a[0] = [
516
+ o("path", {
517
+ stroke: "none",
518
+ d: "M0 0h24v24H0z",
519
+ fill: "none"
520
+ }, null, -1),
521
+ o("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }, null, -1),
522
+ o("path", { d: "M21 21l-6 -6" }, null, -1)
523
+ ]));
524
+ }
525
+ const Ie = /* @__PURE__ */ X(xt, [["render", kt]]), Ct = {}, _t = {
526
+ xmlns: "http://www.w3.org/2000/svg",
527
+ viewBox: "0 0 24 24",
528
+ fill: "none",
529
+ stroke: "currentColor",
530
+ "stroke-width": "2",
531
+ "stroke-linecap": "round",
532
+ "stroke-linejoin": "round",
533
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-x stroke-gray-500 hover:stroke-red-500 transition-all",
534
+ width: "15px",
535
+ height: "15px"
536
+ };
537
+ function $t(s, a) {
538
+ return p(), k("svg", _t, a[0] || (a[0] = [
539
+ o("path", {
540
+ stroke: "none",
541
+ d: "M0 0h24v24H0z",
542
+ fill: "none"
543
+ }, null, -1),
544
+ o("path", { d: "M18 6l-12 12" }, null, -1),
545
+ o("path", { d: "M6 6l12 12" }, null, -1)
546
+ ]));
547
+ }
548
+ const Oe = /* @__PURE__ */ X(Ct, [["render", $t]]);
549
+ class be {
550
+ static getWidthClass(a) {
551
+ return typeof a == "number" ? `max-w-[${a}px]` : typeof a == "string" ? a.endsWith("%") || a.endsWith("px") ? `max-w-[${a}]` : `max-w-${a}` : "w-full";
552
+ }
553
+ }
554
+ const Vt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, St = ["placeholder"], Bt = /* @__PURE__ */ N({
555
+ __name: "text-input",
556
+ props: {
557
+ id: {},
558
+ name: {},
559
+ type: {},
560
+ label: {},
561
+ width: { default: 220 },
562
+ options: {},
563
+ placeHolder: {},
564
+ api: {},
565
+ data: {},
566
+ default: {},
567
+ modelValue: {},
568
+ disabled: { type: Boolean },
569
+ layout: { default: "inline" },
570
+ cleanable: { type: Boolean },
571
+ limit: {},
572
+ multi: { type: Boolean },
573
+ dataKey: {},
574
+ valueKey: {},
575
+ mode: {},
576
+ labelKey: {},
577
+ sort: {}
578
+ },
579
+ emits: ["update:modelValue", "change", "clear"],
580
+ setup(s, { emit: a }) {
581
+ const d = s, l = $((d.placeHolder || d.label || d.name || "search").toString()), n = a, r = $(d.modelValue ?? "");
582
+ A(
583
+ () => d.modelValue,
584
+ (g) => {
585
+ g !== r.value && (r.value = g ?? "");
586
+ }
587
+ );
588
+ function v() {
589
+ n("update:modelValue", r.value), n("change", { name: d.name, value: r.value });
590
+ }
591
+ function y() {
592
+ r.value = "", n("update:modelValue", ""), n("clear", d.name), n("change", { name: d.name, value: null });
593
+ }
594
+ return (g, C) => (p(), k("div", {
595
+ class: z([
596
+ "vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",
597
+ g.layout === "inline" ? e(be).getWidthClass(g.width) : "mb-2" + (g.layout === "popover" ? " m-2" : "")
598
+ ])
599
+ }, [
600
+ o("div", Vt, [
601
+ I(Ie)
602
+ ]),
603
+ r.value !== "" ? (p(), k("div", {
604
+ key: 0,
605
+ onClick: y,
606
+ class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
607
+ }, [
608
+ I(Oe)
609
+ ])) : V("", !0),
610
+ O(o("input", {
611
+ type: "text",
612
+ "onUpdate:modelValue": C[0] || (C[0] = (b) => r.value = b),
613
+ onInput: v,
614
+ placeholder: l.value,
615
+ class: "!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
616
+ }, null, 40, St), [
617
+ [le, r.value]
618
+ ])
619
+ ], 2));
620
+ }
621
+ });
622
+ function Ue(s = { color: "blue" }) {
623
+ return H(() => {
624
+ const d = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${s.color}-500 focus:border-transparent`;
625
+ return (s == null ? void 0 : s.size) === "sm" ? `${d}h-[32px]` : `${d}h-[38px]`;
626
+ });
627
+ }
628
+ function Mt() {
629
+ return "rounded-md font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 px-4 py-2 w-full bg-transparent border text-black text-sm h-[38px]";
630
+ }
631
+ function At() {
632
+ return "font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 border h-7 rounded-md text-xs px-2 py-1 hover:bg-gray-100";
633
+ }
634
+ function Pe(s) {
635
+ return s === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : s === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]";
636
+ }
637
+ const Dt = {
638
+ key: 0,
639
+ class: "block text-xs font-medium text-gray-600 mb-1"
640
+ }, Rt = ["placeholder", "disabled"], jt = {
641
+ key: 0,
642
+ class: "block text-xs font-medium text-gray-600 mb-1"
643
+ }, zt = {
644
+ key: 0,
645
+ class: "block text-xs font-medium text-gray-600 mb-1"
646
+ }, Ft = ["placeholder", "disabled"], Lt = ["disabled"];
647
+ const Kt = /* @__PURE__ */ N({
648
+ __name: "range-input",
649
+ props: {
650
+ id: {},
651
+ name: {},
652
+ type: {},
653
+ label: {},
654
+ width: {},
655
+ options: {},
656
+ placeHolder: {},
657
+ api: {},
658
+ data: {},
659
+ default: {},
660
+ modelValue: {},
661
+ disabled: { type: Boolean, default: !1 },
662
+ layout: { default: "inline" },
663
+ cleanable: { type: Boolean },
664
+ limit: {},
665
+ multi: { type: Boolean },
666
+ dataKey: {},
667
+ valueKey: {},
668
+ mode: {},
669
+ labelKey: {},
670
+ sort: {}
671
+ },
672
+ emits: ["update:modelValue", "change", "clear"],
673
+ setup(s, { expose: a, emit: d }) {
674
+ const l = Ue(), n = Mt(), r = s, v = $(
675
+ r.modelValue ?? r.default ?? []
676
+ ), y = d, g = H({
677
+ get: () => r.modelValue ?? v.value,
678
+ set: (f) => {
679
+ r.modelValue !== void 0 ? y("update:modelValue", f) : v.value = f;
680
+ }
681
+ });
682
+ function C() {
683
+ y("change", { name: r.name, value: g.value || v.value });
684
+ }
685
+ function b() {
686
+ v.value = [], g.value = v.value, y("clear", r.name);
687
+ }
688
+ return A(() => r.modelValue, (f) => {
689
+ f !== void 0 && r.layout !== "popover" ? (v.value = f, y("update:modelValue", f)) : v.value = [];
690
+ }), a({
691
+ clear: b,
692
+ currentValue: g
693
+ }), (f, h) => {
694
+ var _, c;
695
+ return p(), k(F, null, [
696
+ o("div", null, [
697
+ o("div", {
698
+ class: z(f.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
699
+ }, [
700
+ o("div", null, [
701
+ f.layout !== "vertical" ? (p(), k("label", Dt, "Від")) : V("", !0),
702
+ O(o("input", {
703
+ type: "number",
704
+ class: z(e(l)),
705
+ placeholder: ((_ = f.placeHolder) == null ? void 0 : _[0]) ?? "min",
706
+ step: "1",
707
+ style: { outline: "none" },
708
+ "onUpdate:modelValue": h[0] || (h[0] = (u) => g.value[0] = u),
709
+ disabled: f.disabled
710
+ }, null, 10, Rt), [
711
+ [le, g.value[0]]
712
+ ])
713
+ ]),
714
+ f.layout === "vertical" ? (p(), k("label", jt, " - ")) : V("", !0),
715
+ o("div", null, [
716
+ f.layout !== "vertical" ? (p(), k("label", zt, "До")) : V("", !0),
717
+ O(o("input", {
718
+ type: "number",
719
+ class: z(e(l)),
720
+ placeholder: ((c = f.placeHolder) == null ? void 0 : c[1]) ?? "max",
721
+ min: "0",
722
+ max: "1000000000000000",
723
+ step: "1",
724
+ style: { outline: "none" },
725
+ "onUpdate:modelValue": h[1] || (h[1] = (u) => g.value[1] = u),
726
+ disabled: f.disabled
727
+ }, null, 10, Ft), [
728
+ [le, g.value[1]]
729
+ ])
730
+ ]),
731
+ ["popover", "inline", "vertical"].includes(f.layout) ? (p(), k("button", {
732
+ key: 1,
733
+ onClick: C,
734
+ class: z(e(n) + (f.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
735
+ }, L(f.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : V("", !0),
736
+ ["popover", "inline"].includes(f.layout) ? (p(), k("button", {
737
+ key: 2,
738
+ disabled: !(g.value[0] || g.value[1]),
739
+ onClick: b,
740
+ class: z(e(n) + " hover:bg-gray-100")
741
+ }, "Очистити", 10, Lt)) : V("", !0)
742
+ ], 2)
743
+ ]),
744
+ (f.cleanable && v.value.length, V("", !0))
745
+ ], 64);
746
+ };
747
+ }
748
+ }), Et = ["disabled", "title"], Tt = {
749
+ key: 0,
750
+ class: "absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"
751
+ }, It = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, Ot = { class: "w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2" }, Ve = /* @__PURE__ */ N({
752
+ __name: "popover-field",
753
+ props: {
754
+ disabled: { type: Boolean, default: !1 },
755
+ label: {},
756
+ currentValue: {},
757
+ fieldRef: {},
758
+ width: {},
759
+ mode: {},
760
+ layout: {}
761
+ },
762
+ setup(s, { expose: a }) {
763
+ const d = s, l = H(() => Pe(d.mode)), n = $(!1), r = $({ top: 0, left: 0 }), v = $(null), y = $(null), g = $(null);
764
+ function C() {
765
+ const t = y.value, x = g.value;
766
+ if (!t || !x) return;
767
+ const m = t.getBoundingClientRect(), i = x.offsetWidth, w = window.innerWidth, B = m.bottom + 8;
768
+ let { left: S } = m;
769
+ S + i > w && (S = Math.max(w - i - 10, 10)), r.value = { top: B, left: S };
770
+ }
771
+ function b() {
772
+ n.value = !n.value, n.value && we(() => {
773
+ var t, x;
774
+ C(), (t = d.fieldRef) != null && t.inputTextRef && ((x = d.fieldRef) == null || x.inputTextRef.focus());
775
+ });
776
+ }
777
+ function f(t) {
778
+ var x, m;
779
+ !((x = v.value) != null && x.contains(t.target)) && !((m = g.value) != null && m.contains(t.target)) && (n.value = !1);
780
+ }
781
+ function h(t) {
782
+ t.key === "Escape" && (n.value = !1);
783
+ }
784
+ const _ = $(!1);
785
+ ue(() => {
786
+ _.value = !0;
787
+ }), ue(() => {
788
+ document.addEventListener("click", f, !0), document.addEventListener("keydown", h), window.addEventListener("scroll", C, !0);
789
+ }), ge(() => {
790
+ document.removeEventListener("click", f, !0), document.removeEventListener("keydown", h), window.removeEventListener("scroll", C, !0);
791
+ });
792
+ function c() {
793
+ n.value = !1;
794
+ }
795
+ a({ close: c });
796
+ const u = H(() => {
797
+ var x;
798
+ const t = (x = d.fieldRef) == null ? void 0 : x.selectedLabels;
799
+ return t ? Array.isArray(t) ? t.length > 0 ? t.join(", ") : d.label ?? "" : String(t) : d.label ?? "";
800
+ });
801
+ return (t, x) => (p(), k("div", null, [
802
+ o("button", {
803
+ onClick: b,
804
+ disabled: t.disabled,
805
+ ref_key: "triggerRef",
806
+ ref: y,
807
+ title: t.label,
808
+ class: z(l.value + " " + (t.width ? e(be).getWidthClass(t.width) : "w-full"))
809
+ }, [
810
+ o("span", {
811
+ class: z(["truncate text-ellipsis block", t.width ? e(be).getWidthClass(t.width - 50) : "w-full"])
812
+ }, L(u.value), 3),
813
+ I(ye, { class: "h-4 w-4" }),
814
+ (Array.isArray(t.currentValue) ? t.currentValue === null || t.currentValue.length > 0 : t.currentValue === null || t.currentValue) && t.layout === "inline" ? (p(), k("span", Tt)) : V("", !0)
815
+ ], 10, Et),
816
+ _.value ? (p(), j(Ke, {
817
+ key: 0,
818
+ to: "body"
819
+ }, [
820
+ O(o("div", {
821
+ ref_key: "popperRef",
822
+ ref: g,
823
+ class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
824
+ style: xe({ top: `${r.value.top}px`, left: `${r.value.left}px` }),
825
+ "data-inside-popover": ""
826
+ }, [
827
+ o("div", It, [
828
+ o("div", Ot, [
829
+ te(t.$slots, "default")
830
+ ])
831
+ ])
832
+ ], 4), [
833
+ [ee, n.value]
834
+ ])
835
+ ])) : V("", !0)
836
+ ]));
837
+ }
838
+ });
839
+ function Ut(s) {
840
+ return String(s).charAt(0).toUpperCase() + String(s).slice(1);
841
+ }
842
+ class q {
843
+ static format(a) {
844
+ const d = a.getFullYear(), l = (a.getMonth() + 1).toString().padStart(2, "0"), n = a.getDate().toString().padStart(2, "0");
845
+ return `${d}-${l}-${n}`;
846
+ }
847
+ static getShiftedDay(a, d = 0) {
848
+ const l = a ? new Date(a) : /* @__PURE__ */ new Date();
849
+ return l.setDate(l.getDate() + d), this.format(l);
850
+ }
851
+ static getLastWeekRange(a, d, l = 0) {
852
+ if (a && d) {
853
+ const C = new Date(a), b = new Date(d);
854
+ return C.setDate(C.getDate() + l * 7), b.setDate(b.getDate() + l * 7), [this.format(C), this.format(b)];
855
+ }
856
+ const n = /* @__PURE__ */ new Date(), r = n.getDay(), v = r === 0 ? 13 : r - 1 + 7, y = new Date(n);
857
+ y.setDate(n.getDate() - v + l * 7);
858
+ const g = new Date(y);
859
+ return g.setDate(y.getDate() + 6), [this.format(y), this.format(g)];
860
+ }
861
+ static getMonthRange(a, d, l = 0) {
862
+ let n;
863
+ a ? n = new Date(a) : n = /* @__PURE__ */ new Date(), n = new Date(n.getFullYear(), n.getMonth() + l, 1);
864
+ const r = n, v = new Date(n.getFullYear(), n.getMonth() + 1, 0);
865
+ return [this.format(r), this.format(v)];
866
+ }
867
+ static getQuarterRange(a, d, l = 0) {
868
+ const n = a || d, r = n ? new Date(n) : /* @__PURE__ */ new Date();
869
+ let v = Math.floor(r.getMonth() / 3);
870
+ v += l;
871
+ const y = (v % 4 + 4) % 4 * 3, g = r.getFullYear() + Math.floor(v / 4), C = new Date(g, y, 1), b = new Date(g, y + 3, 0);
872
+ return [this.format(C), this.format(b)];
873
+ }
874
+ static getYear(a, d = 0) {
875
+ let l;
876
+ return a && /^\d{4}$/.test(a) ? l = parseInt(a, 10) : a ? l = new Date(a).getFullYear() : l = (/* @__PURE__ */ new Date()).getFullYear(), String(l + d);
877
+ }
878
+ static getYearRange(a, d = 0) {
879
+ let l;
880
+ return a && /^\d{4}$/.test(a) ? l = parseInt(a, 10) : a ? l = new Date(a).getFullYear() : l = (/* @__PURE__ */ new Date()).getFullYear(), [
881
+ this.format(new Date(l + d, 0, 1)),
882
+ this.format(new Date(l + d + 1, 0, 0))
883
+ ];
884
+ }
885
+ static getRangeFromDaysBefore(a) {
886
+ const d = /* @__PURE__ */ new Date(), l = new Date(d.getTime());
887
+ return l.setDate(d.getDate() - a), [this.format(l), this.format(d)];
888
+ }
889
+ }
890
+ function He(s, a) {
891
+ const {
892
+ popoverRef: d
893
+ } = s, l = $(""), n = $(
894
+ s.modelValue ?? s.default ?? []
895
+ ), r = $(0);
896
+ function v() {
897
+ const u = q.getRangeFromDaysBefore(r.value);
898
+ return n.value = [...u], a("change", { name: s.name, value: n.value }), a("update:modelValue", n.value), u;
899
+ }
900
+ function y(u) {
901
+ var x;
902
+ l.value = u, (x = d.value) == null || x.close();
903
+ const t = [];
904
+ switch (l.value) {
905
+ case "today":
906
+ t.push(q.getShiftedDay()), t.push(q.getShiftedDay());
907
+ break;
908
+ case "week":
909
+ t.push(...q.getLastWeekRange());
910
+ break;
911
+ case "month":
912
+ t.push(...q.getMonthRange());
913
+ break;
914
+ case "quarter":
915
+ t.push(...q.getQuarterRange());
916
+ break;
917
+ case "year":
918
+ t.push(...q.getYearRange());
919
+ break;
920
+ case "last_7_days":
921
+ r.value = 7, v();
922
+ break;
923
+ case "range":
924
+ r.value = 7, t.push(...v());
925
+ break;
926
+ }
927
+ n.value = [...t], a("change", { name: s.name, value: n.value }), a("update:modelValue", n.value);
928
+ }
929
+ function g() {
930
+ const u = [];
931
+ switch (l.value) {
932
+ case "today":
933
+ u.push(q.getShiftedDay(n.value[0], 1));
934
+ break;
935
+ case "week":
936
+ u.push(...q.getLastWeekRange(n.value[0], n.value[1], 1));
937
+ break;
938
+ case "month":
939
+ u.push(...q.getMonthRange(n.value[0], n.value[1], 1));
940
+ break;
941
+ case "quarter":
942
+ u.push(...q.getQuarterRange(n.value[0], n.value[1], 1));
943
+ break;
944
+ case "year":
945
+ u.push(...q.getYearRange(n.value[0], 1));
946
+ break;
947
+ }
948
+ n.value = [...u], a("change", { name: s.name, value: n.value }), a("update:modelValue", n.value);
949
+ }
950
+ function C() {
951
+ const u = [];
952
+ switch (l.value) {
953
+ case "today":
954
+ u.push(q.getShiftedDay(n.value[0], -1));
955
+ break;
956
+ case "week":
957
+ u.push(...q.getLastWeekRange(n.value[0], n.value[1], -1));
958
+ break;
959
+ case "month":
960
+ u.push(...q.getMonthRange(n.value[0], n.value[1], -1));
961
+ break;
962
+ case "quarter":
963
+ u.push(...q.getQuarterRange(n.value[0], n.value[1], -1));
964
+ break;
965
+ case "year":
966
+ u.push(...q.getYearRange(n.value[0], -1));
967
+ break;
968
+ }
969
+ n.value = [...u], a("change", { name: s.name, value: n.value }), a("update:modelValue", n.value);
970
+ }
971
+ const b = [
972
+ "Січень",
973
+ "Лютий",
974
+ "Березень",
975
+ "Квітень",
976
+ "Травень",
977
+ "Червень",
978
+ "Липень",
979
+ "Серпень",
980
+ "Вересень",
981
+ "Жовтень",
982
+ "Листопад",
983
+ "Грудень"
984
+ ];
985
+ function f(u) {
986
+ const [t, x, m] = u.split("-");
987
+ return `${m}.${x}.${t}`;
988
+ }
989
+ function h(u) {
990
+ const { value: t } = n;
991
+ switch (u) {
992
+ case "today":
993
+ return f(t[0]);
994
+ case "range":
995
+ return "Період";
996
+ case "week":
997
+ return t[0] && t[1] ? `${f(t[0])} – ${f(t[1])}` : "";
998
+ case "quarter":
999
+ if (t[0]) {
1000
+ const x = new Date(t[0]), m = x.getFullYear(), i = x.getMonth();
1001
+ return `${Math.floor(i / 3) + 1} квартал ${m}`;
1002
+ }
1003
+ return "";
1004
+ case "month":
1005
+ if (t[0]) {
1006
+ const [x, m] = t[0].split("-");
1007
+ return `${b[parseInt(m, 10) - 1]} ${x}`;
1008
+ }
1009
+ return "";
1010
+ case "year":
1011
+ return t[0] || "";
1012
+ case "last_7_days":
1013
+ return "За останні дні";
1014
+ default:
1015
+ return s.label ?? "";
1016
+ }
1017
+ }
1018
+ const _ = H(() => l.value ? h(l.value) : s.label ?? "");
1019
+ function c() {
1020
+ l.value = "", n.value = [], a("update:modelValue", []), a("clear", s.name);
1021
+ }
1022
+ return {
1023
+ activeMode: l,
1024
+ innerValue: n,
1025
+ daysBefore: r,
1026
+ onDaysBeforeChange: v,
1027
+ onSelectChange: y,
1028
+ nextClick: g,
1029
+ prevClick: C,
1030
+ ukMonths: b,
1031
+ formatDisplayDate: f,
1032
+ getModeLabel: h,
1033
+ currentLabel: _,
1034
+ clear: c
1035
+ };
1036
+ }
1037
+ const Pt = {
1038
+ key: 0,
1039
+ class: "relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"
1040
+ }, Ht = {
1041
+ key: 0,
1042
+ class: "flex gap-1 !w-[75%] rounded-lg"
1043
+ }, Nt = ["max", "disabled"], Yt = ["min", "disabled"], Wt = {
1044
+ key: 0,
1045
+ class: "block text-xs font-medium text-gray-600 mb-1"
1046
+ }, qt = ["max", "disabled"], Gt = {
1047
+ key: 0,
1048
+ class: "block text-xs font-medium text-gray-600 mb-1"
1049
+ }, Qt = {
1050
+ key: 0,
1051
+ class: "block text-xs font-medium text-gray-600 mb-1"
1052
+ }, Zt = ["min", "disabled"], Xt = { class: "flex gap-1 pt-2" }, Jt = ["onClick"];
1053
+ const el = /* @__PURE__ */ N({
1054
+ __name: "date-input",
1055
+ props: {
1056
+ id: {},
1057
+ name: {},
1058
+ type: {},
1059
+ label: {},
1060
+ width: {},
1061
+ options: {},
1062
+ placeHolder: {},
1063
+ api: {},
1064
+ data: {},
1065
+ default: {},
1066
+ modelValue: {},
1067
+ disabled: { type: Boolean },
1068
+ layout: { default: "inline" },
1069
+ cleanable: { type: Boolean },
1070
+ limit: {},
1071
+ multi: { type: Boolean },
1072
+ dataKey: {},
1073
+ valueKey: {},
1074
+ mode: {},
1075
+ labelKey: {},
1076
+ sort: {}
1077
+ },
1078
+ emits: ["update:modelValue", "change", "clear"],
1079
+ setup(s, { expose: a, emit: d }) {
1080
+ const l = s, n = Ue(), r = At(), v = d, y = $(null), {
1081
+ activeMode: g,
1082
+ innerValue: C,
1083
+ onSelectChange: b,
1084
+ nextClick: f,
1085
+ prevClick: h,
1086
+ clear: _
1087
+ } = He({
1088
+ ...l,
1089
+ popoverRef: y
1090
+ }, v);
1091
+ return A(() => l.modelValue, (c) => {
1092
+ c !== void 0 ? (C.value = c, v("update:modelValue", c)) : (g.value = "", C.value = []);
1093
+ }), a({
1094
+ clear: _,
1095
+ popoverRef: y
1096
+ }), (c, u) => (p(), k(F, null, [
1097
+ c.layout === "inline" ? (p(), k("div", Pt, [
1098
+ e(g) !== "" && e(g) === "range" ? (p(), k("div", Ht, [
1099
+ O(o("input", {
1100
+ type: "date",
1101
+ max: e(C)[1],
1102
+ locale: "uk-UA",
1103
+ "onUpdate:modelValue": u[0] || (u[0] = (t) => e(C)[0] = t),
1104
+ class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
1105
+ disabled: c.disabled
1106
+ }, null, 8, Nt), [
1107
+ [le, e(C)[0]]
1108
+ ]),
1109
+ O(o("input", {
1110
+ type: "date",
1111
+ min: e(C)[0],
1112
+ locale: "uk-UA",
1113
+ "onUpdate:modelValue": u[1] || (u[1] = (t) => e(C)[1] = t),
1114
+ class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
1115
+ disabled: c.disabled
1116
+ }, null, 8, Yt), [
1117
+ [le, e(C)[1]]
1118
+ ])
1119
+ ])) : V("", !0)
1120
+ ])) : V("", !0),
1121
+ o("div", {
1122
+ class: z(c.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
1123
+ }, [
1124
+ o("div", {
1125
+ class: z(c.layout !== "popover" ? "w-[48%]" : "")
1126
+ }, [
1127
+ c.layout === "popover" ? (p(), k("label", Wt, "Від")) : V("", !0),
1128
+ O(o("input", {
1129
+ type: "date",
1130
+ max: e(C)[1],
1131
+ locale: "uk-UA",
1132
+ "onUpdate:modelValue": u[2] || (u[2] = (t) => e(C)[0] = t),
1133
+ class: z(e(n)),
1134
+ disabled: c.disabled
1135
+ }, null, 10, qt), [
1136
+ [le, e(C)[0]]
1137
+ ])
1138
+ ], 2),
1139
+ c.layout !== "popover" ? (p(), k("label", Gt, " - ")) : V("", !0),
1140
+ o("div", {
1141
+ class: z(c.layout !== "popover" ? "w-[48%]" : "")
1142
+ }, [
1143
+ c.layout === "popover" ? (p(), k("label", Qt, "До")) : V("", !0),
1144
+ O(o("input", {
1145
+ type: "date",
1146
+ min: e(C)[0],
1147
+ locale: "uk-UA",
1148
+ "onUpdate:modelValue": u[3] || (u[3] = (t) => e(C)[1] = t),
1149
+ class: z(e(n)),
1150
+ disabled: c.disabled
1151
+ }, null, 10, Zt), [
1152
+ [le, e(C)[1]]
1153
+ ])
1154
+ ], 2)
1155
+ ], 2),
1156
+ o("div", Xt, [
1157
+ (p(), k(F, null, W(["today", "week", "month", "quarter", "year"], (t) => o("button", {
1158
+ key: t,
1159
+ class: z(e(r) + (e(g) === t ? " bg-blue-100" : "")),
1160
+ onClick: (x) => e(b)(t)
1161
+ }, L(e(Ut)(t)), 11, Jt)), 64)),
1162
+ o("button", {
1163
+ class: z(e(r)),
1164
+ onClick: u[4] || (u[4] = //@ts-ignore
1165
+ (...t) => e(h) && e(h)(...t))
1166
+ }, " <", 2),
1167
+ o("button", {
1168
+ class: z(e(r)),
1169
+ onClick: u[5] || (u[5] = //@ts-ignore
1170
+ (...t) => e(f) && e(f)(...t))
1171
+ }, " >", 2)
1172
+ ]),
1173
+ (c.cleanable, V("", !0))
1174
+ ], 64));
1175
+ }
1176
+ });
1177
+ function tl(s, a) {
1178
+ const {
1179
+ api: d,
1180
+ options: l = [],
1181
+ limit: n = 20,
1182
+ dataKey: r = "data"
1183
+ } = s, v = s.multi;
1184
+ function y(M) {
1185
+ return v ? Array.isArray(M) ? M : M ? [M] : [] : Array.isArray(M) ? M[0] : M;
1186
+ }
1187
+ const g = $(y(s.modelValue)), C = $(""), b = $(!1), f = $([]), h = $("id"), _ = $("text"), c = $(!1), u = $(s.layout !== "popover" && l.length > n), t = $([]), x = $(0);
1188
+ function m(M) {
1189
+ const T = M.find(Boolean) ?? {}, G = ["id", "value", "code", "key"].find((oe) => oe in T) ?? "id", se = ["text", "label", "name", "title"].find((oe) => oe in T) ?? "text";
1190
+ return { autoValueKey: G, autoLabelKey: se };
1191
+ }
1192
+ if (l.length > 0) {
1193
+ const M = m(l);
1194
+ h.value = M.autoValueKey, _.value = M.autoLabelKey;
1195
+ }
1196
+ const i = H(() => {
1197
+ if (d) return f.value;
1198
+ const M = f.value;
1199
+ if (s.layout === "popover") return M;
1200
+ if (!C.value)
1201
+ return c.value ? M : M.slice(0, n);
1202
+ const T = C.value.toLowerCase();
1203
+ return M.filter((G) => G[_.value].toLowerCase().includes(T));
1204
+ });
1205
+ let w = null;
1206
+ async function B(M) {
1207
+ if (d) {
1208
+ b.value = !0;
1209
+ try {
1210
+ const T = new URL(d, window.location.origin);
1211
+ T.searchParams.set("json", "1"), T.searchParams.set("key", M), T.searchParams.set("limit", n.toString());
1212
+ const G = await fetch(T.toString());
1213
+ if (!G.ok)
1214
+ throw new Error(`HTTP error! status: ${G.status}`);
1215
+ const se = await G.json();
1216
+ if (f.value = se[r], f.value.length > 0) {
1217
+ const oe = m(f.value);
1218
+ h.value = oe.autoValueKey, _.value = oe.autoLabelKey;
1219
+ }
1220
+ x.value = se.total;
1221
+ } catch (T) {
1222
+ console.error("Failed to fetch remote options:", T);
1223
+ } finally {
1224
+ b.value = !1;
1225
+ }
1226
+ }
1227
+ }
1228
+ A(C, (M) => {
1229
+ d && (w && clearTimeout(w), w = setTimeout(() => {
1230
+ B(M);
1231
+ }, 200));
1232
+ }), A(() => s.modelValue, (M) => {
1233
+ g.value = y(M);
1234
+ }, { immediate: !0 }), d ? B("") : f.value = l;
1235
+ function S(M) {
1236
+ return v && Array.isArray(g.value) ? g.value.includes(M[h.value]) : g.value && g.value === M[h.value];
1237
+ }
1238
+ function K(M) {
1239
+ if (v && !Array.isArray(g.value) && (g.value = []), v && Array.isArray(g.value)) {
1240
+ const T = g.value.includes(M[h.value]);
1241
+ g.value = T ? g.value.filter((G) => G !== M[h.value]) : [...g.value, M[h.value]], t.value = T ? t.value.filter((G) => G !== M[_.value]) : [...t.value, M[_.value]];
1242
+ } else
1243
+ g.value = M[h.value], t.value = M[_.value];
1244
+ a("update:modelValue", g.value), a("change", { name: s.name, value: g.value });
1245
+ }
1246
+ function U() {
1247
+ v ? (g.value = [], t.value = []) : (g.value = void 0, t.value = []), a("update:modelValue", g.value), a("clear", s.name);
1248
+ }
1249
+ function E() {
1250
+ w && clearTimeout(w), C.value = "", c.value = !1;
1251
+ }
1252
+ function de() {
1253
+ c.value = !c.value;
1254
+ }
1255
+ ge(() => {
1256
+ w && clearTimeout(w);
1257
+ });
1258
+ const J = $(-1);
1259
+ A(i, () => {
1260
+ J.value = i.value.length > 0 ? 0 : -1;
1261
+ });
1262
+ function P(M) {
1263
+ const T = i.value.length;
1264
+ if (M.key === "ArrowDown")
1265
+ M.preventDefault(), J.value = (J.value + 1) % T;
1266
+ else if (M.key === "ArrowUp")
1267
+ M.preventDefault(), J.value = (J.value - 1 + T) % T;
1268
+ else if (M.key === "Enter" && (M.preventDefault(), J.value >= 0 && J.value < i.value.length)) {
1269
+ const G = i.value[J.value];
1270
+ K(G);
1271
+ }
1272
+ }
1273
+ return {
1274
+ innerValue: g,
1275
+ searchTerm: C,
1276
+ filteredOptions: i,
1277
+ isSelected: S,
1278
+ selectItem: K,
1279
+ clear: U,
1280
+ resetSearch: E,
1281
+ toggleShowAll: de,
1282
+ isReqProc: b,
1283
+ showAll: c,
1284
+ isEnableShowAll: u,
1285
+ labelKey: _,
1286
+ valueKey: h,
1287
+ allOptions: f,
1288
+ highlightedIndex: J,
1289
+ onKeyDown: P,
1290
+ selectedLabels: t,
1291
+ totalCount: x
1292
+ };
1293
+ }
1294
+ const ll = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, ol = {
1295
+ key: 0,
1296
+ class: "w-full"
1297
+ }, nl = { class: "flex flex-col items-center justify-center p-5 text-center" }, al = {
1298
+ key: 0,
1299
+ class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
1300
+ }, rl = {
1301
+ key: 1,
1302
+ class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1303
+ }, sl = /* @__PURE__ */ N({
1304
+ __name: "select",
1305
+ props: {
1306
+ id: {},
1307
+ name: {},
1308
+ type: {},
1309
+ label: {},
1310
+ width: {},
1311
+ options: { default: () => [] },
1312
+ placeHolder: {},
1313
+ api: {},
1314
+ data: {},
1315
+ default: {},
1316
+ modelValue: {},
1317
+ disabled: { type: Boolean, default: !1 },
1318
+ layout: { default: "inline" },
1319
+ cleanable: { type: Boolean },
1320
+ limit: { default: 10 },
1321
+ multi: { type: Boolean },
1322
+ dataKey: {},
1323
+ valueKey: {},
1324
+ mode: {},
1325
+ labelKey: {},
1326
+ sort: {}
1327
+ },
1328
+ emits: ["update:modelValue", "change", "clear"],
1329
+ setup(s, { expose: a, emit: d }) {
1330
+ const l = s, n = d, r = $(null), {
1331
+ innerValue: v,
1332
+ filteredOptions: y,
1333
+ isSelected: g,
1334
+ selectItem: C,
1335
+ clear: b,
1336
+ resetSearch: f,
1337
+ toggleShowAll: h,
1338
+ isReqProc: _,
1339
+ showAll: c,
1340
+ isEnableShowAll: u,
1341
+ searchTerm: t,
1342
+ labelKey: x,
1343
+ valueKey: m,
1344
+ highlightedIndex: i,
1345
+ onKeyDown: w,
1346
+ selectedLabels: B,
1347
+ totalCount: S
1348
+ } = tl({
1349
+ ...l,
1350
+ modelValue: l.modelValue
1351
+ }, n);
1352
+ ue(() => {
1353
+ f();
1354
+ }), A(
1355
+ () => l.modelValue,
1356
+ (U) => {
1357
+ U === void 0 && (l.multi ? v.value = [] : v.value = void 0);
1358
+ }
1359
+ );
1360
+ const K = $([]);
1361
+ return A(i, (U) => {
1362
+ var E;
1363
+ U >= 0 && K.value[U] && ((E = K.value[U]) == null || E.scrollIntoView({
1364
+ block: "nearest",
1365
+ behavior: "smooth"
1366
+ }));
1367
+ }), A(y, () => {
1368
+ K.value = [];
1369
+ }), a({
1370
+ clear: b,
1371
+ inputTextRef: r,
1372
+ selectedLabels: B
1373
+ }), (U, E) => {
1374
+ var de, J;
1375
+ return p(), k("div", {
1376
+ class: z([U.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
1377
+ }, [
1378
+ o("div", ll, [
1379
+ O(o("input", {
1380
+ "onUpdate:modelValue": E[0] || (E[0] = (P) => Ye(t) ? t.value = P : null),
1381
+ onKeydown: E[1] || (E[1] = //@ts-ignore
1382
+ (...P) => e(w) && e(w)(...P)),
1383
+ class: "w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",
1384
+ placeholder: "Пошук",
1385
+ type: "text",
1386
+ ref_key: "inputTextRef",
1387
+ ref: r
1388
+ }, null, 544), [
1389
+ [le, e(t)]
1390
+ ]),
1391
+ I(Ie, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
1392
+ I(Oe, {
1393
+ onClick: E[2] || (E[2] = (P) => t.value = ""),
1394
+ class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
1395
+ })
1396
+ ]),
1397
+ o("div", {
1398
+ class: z([
1399
+ U.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
1400
+ U.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
1401
+ ])
1402
+ }, [
1403
+ (p(!0), k(F, null, W(e(y), (P, M) => (p(), j(Ce, {
1404
+ layout: U.layout,
1405
+ count: P.count,
1406
+ label: P[e(x)],
1407
+ color: P.color,
1408
+ type: U.multi ? "checkbox" : "radio",
1409
+ value: P[e(m)],
1410
+ "is-selected": e(g)(P),
1411
+ highlighted: M === e(i),
1412
+ onItemClick: (T) => e(C)(P),
1413
+ ref_for: !0,
1414
+ ref: (T) => K.value[M] = T == null ? void 0 : T.el
1415
+ }, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
1416
+ ], 2),
1417
+ U.type === "select" && e(y).length === 0 && !e(_) ? (p(), k("div", ol, [
1418
+ o("div", nl, [
1419
+ I(_e),
1420
+ E[7] || (E[7] = o("div", { class: "max-w-sm mx-auto mt-6" }, [
1421
+ o("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
1422
+ o("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
1423
+ ], -1))
1424
+ ])
1425
+ ])) : V("", !0),
1426
+ U.layout !== "popover" && U.type !== "select" ? (p(), k(F, { key: 1 }, [
1427
+ !e(c) && e(u) ? (p(), k("div", {
1428
+ key: 0,
1429
+ onClick: E[3] || (E[3] = //@ts-ignore
1430
+ (...P) => e(h) && e(h)(...P)),
1431
+ class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
1432
+ }, [
1433
+ E[8] || (E[8] = Y(" Показати більше ", -1)),
1434
+ I(ye)
1435
+ ])) : V("", !0),
1436
+ e(c) ? (p(), k("div", {
1437
+ key: 1,
1438
+ onClick: E[4] || (E[4] = //@ts-ignore
1439
+ (...P) => e(h) && e(h)(...P)),
1440
+ class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
1441
+ }, [
1442
+ E[9] || (E[9] = Y(" Показати менше ", -1)),
1443
+ I($e)
1444
+ ])) : V("", !0)
1445
+ ], 64)) : V("", !0),
1446
+ U.cleanable ? (p(), k(F, { key: 2 }, [
1447
+ U.layout === "inline" ? (p(), k("div", al, [
1448
+ Y(L(U.multi && Array.isArray(e(v)) ? (de = e(v)) == null ? void 0 : de.length : e(v) !== void 0 && (e(v) || e(v) === null) ? 1 : 0) + " з " + L(e(S)) + " обрано ", 1),
1449
+ O(o("button", {
1450
+ class: "text-gray-600 hover:text-gray-800",
1451
+ onClick: E[5] || (E[5] = //@ts-ignore
1452
+ (...P) => e(b) && e(b)(...P))
1453
+ }, " Очистити ", 512), [
1454
+ [ee, e(v) !== "" && e(v) !== void 0 || e(v)]
1455
+ ])
1456
+ ])) : V("", !0),
1457
+ U.layout === "popover" ? (p(), k("div", rl, [
1458
+ o("span", null, L(U.multi && Array.isArray(e(v)) ? (J = e(v)) == null ? void 0 : J.length : e(v) !== void 0 && (e(v) || e(v) === null) ? 1 : 0) + " з " + L(e(S)) + " обрано", 1),
1459
+ O(o("button", {
1460
+ class: "text-gray-600 hover:text-gray-800",
1461
+ onClick: E[6] || (E[6] = //@ts-ignore
1462
+ (...P) => e(b) && e(b)(...P))
1463
+ }, " Очистити ", 512), [
1464
+ [ee, e(v) !== "" && e(v) !== void 0 || e(v)]
1465
+ ])
1466
+ ])) : V("", !0)
1467
+ ], 64)) : V("", !0)
1468
+ ], 2);
1469
+ };
1470
+ }
1471
+ }), il = ["for", "onClick"], ul = ["id", "name", "value"], dl = { class: "block" }, cl = {
1472
+ key: 0,
1473
+ class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
1474
+ }, pl = {
1475
+ key: 1,
1476
+ class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1477
+ }, fl = /* @__PURE__ */ N({
1478
+ __name: "tag-field",
1479
+ props: {
1480
+ id: {},
1481
+ name: {},
1482
+ type: {},
1483
+ label: {},
1484
+ width: {},
1485
+ options: { default: () => [] },
1486
+ placeHolder: {},
1487
+ api: {},
1488
+ data: {},
1489
+ default: {},
1490
+ modelValue: {},
1491
+ disabled: { type: Boolean, default: !1 },
1492
+ layout: { default: "inline" },
1493
+ cleanable: { type: Boolean },
1494
+ limit: {},
1495
+ multi: { type: Boolean },
1496
+ dataKey: {},
1497
+ valueKey: {},
1498
+ mode: {},
1499
+ labelKey: {},
1500
+ sort: {}
1501
+ },
1502
+ emits: ["update:modelValue", "change", "clear"],
1503
+ setup(s, { expose: a, emit: d }) {
1504
+ const l = s, n = d, {
1505
+ innerValue: r,
1506
+ isSelected: v,
1507
+ selectItem: y,
1508
+ clear: g,
1509
+ labelKey: C,
1510
+ valueKey: b,
1511
+ allOptions: f
1512
+ } = l.multi ? Te({
1513
+ ...l,
1514
+ modelValue: l.modelValue ?? l.default ?? []
1515
+ }, n) : Ee({
1516
+ ...l,
1517
+ modelValue: l.modelValue !== void 0 ? l.modelValue : l.default ?? ""
1518
+ }, n);
1519
+ return a({
1520
+ clear: g
1521
+ }), A(
1522
+ () => l.modelValue,
1523
+ (h) => {
1524
+ h === void 0 && (l.multi ? r.value = [] : r.value = void 0);
1525
+ }
1526
+ ), (h, _) => {
1527
+ var c, u;
1528
+ return p(), k(F, null, [
1529
+ o("div", {
1530
+ class: z(["grid grid-cols-3 gap-2 mx-[1px]", h.layout === "popover" ? "m-1" : "mb-1"])
1531
+ }, [
1532
+ (p(!0), k(F, null, W(e(f), (t) => (p(), k("label", {
1533
+ key: `item-${t[e(b)]}`,
1534
+ for: `item-${t[e(b)]}`,
1535
+ onClick: Fe((x) => e(y)(t), ["stop", "prevent"]),
1536
+ class: z([e(v)(t) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])
1537
+ }, [
1538
+ o("input", {
1539
+ type: "checkbox",
1540
+ id: `item-${t[e(b)]}`,
1541
+ class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
1542
+ name: `item-${t[e(b)]}`,
1543
+ value: t[e(b)]
1544
+ }, null, 8, ul),
1545
+ o("span", dl, L(t[e(C)]), 1)
1546
+ ], 10, il))), 128))
1547
+ ], 2),
1548
+ h.cleanable ? (p(), k(F, { key: 0 }, [
1549
+ h.layout === "inline" ? (p(), k("div", cl, [
1550
+ Y(L(h.multi && Array.isArray(e(r)) ? (c = e(r)) == null ? void 0 : c.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + L(e(f).length) + " обрано ", 1),
1551
+ O(o("button", {
1552
+ class: "text-gray-600 hover:text-gray-800",
1553
+ onClick: _[0] || (_[0] = //@ts-ignore
1554
+ (...t) => e(g) && e(g)(...t))
1555
+ }, " Очистити ", 512), [
1556
+ [ee, e(r) !== "" && e(r) !== void 0 || e(r)]
1557
+ ])
1558
+ ])) : V("", !0),
1559
+ h.layout === "popover" ? (p(), k("div", pl, [
1560
+ o("span", null, L(h.multi && Array.isArray(e(r)) ? (u = e(r)) == null ? void 0 : u.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + L(e(f).length) + " обрано", 1),
1561
+ O(o("button", {
1562
+ class: "text-gray-600 hover:text-gray-800",
1563
+ onClick: _[1] || (_[1] = //@ts-ignore
1564
+ (...t) => e(g) && e(g)(...t))
1565
+ }, " Очистити ", 512), [
1566
+ [ee, e(r) !== void 0 && e(r) !== "" || e(r)]
1567
+ ])
1568
+ ])) : V("", !0)
1569
+ ], 64)) : V("", !0)
1570
+ ], 64);
1571
+ };
1572
+ }
1573
+ }), ml = {}, vl = {
1574
+ xmlns: "http://www.w3.org/2000/svg",
1575
+ width: "24",
1576
+ height: "24",
1577
+ viewBox: "0 0 24 24",
1578
+ fill: "none",
1579
+ stroke: "currentColor",
1580
+ "stroke-width": "2",
1581
+ "stroke-linecap": "round",
1582
+ "stroke-linejoin": "round",
1583
+ class: "text-blue-600 w-[16px] h-[16px]"
1584
+ };
1585
+ function gl(s, a) {
1586
+ return p(), k("svg", vl, a[0] || (a[0] = [
1587
+ o("path", { d: "M20 6 9 17l-5-5" }, null, -1)
1588
+ ]));
1589
+ }
1590
+ const ie = /* @__PURE__ */ X(ml, [["render", gl]]), yl = {}, bl = {
1591
+ xmlns: "http://www.w3.org/2000/svg",
1592
+ width: "15px",
1593
+ height: "24",
1594
+ viewBox: "0 0 24 24",
1595
+ fill: "none",
1596
+ stroke: "currentColor",
1597
+ "stroke-width": "2",
1598
+ "stroke-linecap": "round",
1599
+ "stroke-linejoin": "round",
1600
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
1601
+ };
1602
+ function hl(s, a) {
1603
+ return p(), k("svg", bl, a[0] || (a[0] = [
1604
+ o("path", {
1605
+ stroke: "none",
1606
+ d: "M0 0h24v24H0z",
1607
+ fill: "none"
1608
+ }, null, -1),
1609
+ o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1610
+ ]));
1611
+ }
1612
+ const xl = /* @__PURE__ */ X(yl, [["render", hl]]), wl = {}, kl = {
1613
+ xmlns: "http://www.w3.org/2000/svg",
1614
+ width: "15px",
1615
+ height: "24",
1616
+ viewBox: "0 0 24 24",
1617
+ fill: "none",
1618
+ stroke: "currentColor",
1619
+ "stroke-width": "2",
1620
+ "stroke-linecap": "round",
1621
+ "stroke-linejoin": "round",
1622
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
1623
+ };
1624
+ function Cl(s, a) {
1625
+ return p(), k("svg", kl, a[0] || (a[0] = [
1626
+ o("path", {
1627
+ stroke: "none",
1628
+ d: "M0 0h24v24H0z",
1629
+ fill: "none"
1630
+ }, null, -1),
1631
+ o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1632
+ ]));
1633
+ }
1634
+ const _l = /* @__PURE__ */ X(wl, [["render", Cl]]), $l = { class: "flex" }, Vl = { class: "mb-1" }, Sl = { class: "mb-1" }, Bl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, Ml = { class: "inline-flex rounded-lg shrink-0 pl-1" }, Al = {
1635
+ key: 1,
1636
+ class: "flex gap-1 !w-[75%] rounded-lg"
1637
+ }, Dl = ["max", "disabled"], Rl = ["min", "disabled"];
1638
+ const jl = /* @__PURE__ */ N({
1639
+ __name: "date-input-inline",
1640
+ props: {
1641
+ id: {},
1642
+ name: {},
1643
+ type: {},
1644
+ label: {},
1645
+ width: {},
1646
+ options: {},
1647
+ placeHolder: {},
1648
+ api: {},
1649
+ data: {},
1650
+ default: {},
1651
+ modelValue: {},
1652
+ disabled: { type: Boolean },
1653
+ layout: { default: "inline" },
1654
+ cleanable: { type: Boolean },
1655
+ limit: {},
1656
+ multi: { type: Boolean },
1657
+ dataKey: {},
1658
+ valueKey: {},
1659
+ mode: {},
1660
+ labelKey: {},
1661
+ sort: {}
1662
+ },
1663
+ emits: ["update:modelValue", "change", "clear"],
1664
+ setup(s, { expose: a, emit: d }) {
1665
+ const l = s, n = d, r = $(null), {
1666
+ activeMode: v,
1667
+ innerValue: y,
1668
+ onSelectChange: g,
1669
+ nextClick: C,
1670
+ prevClick: b,
1671
+ currentLabel: f,
1672
+ clear: h
1673
+ } = He({
1674
+ ...l,
1675
+ popoverRef: r
1676
+ }, n);
1677
+ return A(() => l.modelValue, (_) => {
1678
+ _ !== void 0 ? (y.value = _, n("update:modelValue", _)) : (v.value = "", y.value = []);
1679
+ }), a({
1680
+ clear: h,
1681
+ popoverRef: r
1682
+ }), (_, c) => (p(), k(F, null, [
1683
+ o("div", $l, [
1684
+ I(Ve, {
1685
+ ref_key: "popoverRef",
1686
+ ref: r,
1687
+ label: e(f),
1688
+ "current-value": e(y),
1689
+ mode: _.mode,
1690
+ onClear: e(h),
1691
+ layout: _.layout
1692
+ }, {
1693
+ default: ne(() => [
1694
+ o("div", null, [
1695
+ o("button", {
1696
+ type: "button",
1697
+ onClick: c[0] || (c[0] = (u) => e(g)("range")),
1698
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1699
+ }, [
1700
+ c[12] || (c[12] = Y(" Період ", -1)),
1701
+ e(v) === "range" ? (p(), j(ie, { key: 0 })) : V("", !0)
1702
+ ])
1703
+ ]),
1704
+ c[19] || (c[19] = o("div", null, [
1705
+ o("div", { class: "pt-1 mt-1 border-t" })
1706
+ ], -1)),
1707
+ o("div", null, [
1708
+ o("button", {
1709
+ type: "button",
1710
+ onClick: c[1] || (c[1] = (u) => e(g)("today")),
1711
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1712
+ }, [
1713
+ c[13] || (c[13] = Y(" Сьогодні ", -1)),
1714
+ e(v) === "today" ? (p(), j(ie, { key: 0 })) : V("", !0)
1715
+ ])
1716
+ ]),
1717
+ o("div", null, [
1718
+ o("button", {
1719
+ type: "button",
1720
+ onClick: c[2] || (c[2] = (u) => e(g)("week")),
1721
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1722
+ }, [
1723
+ c[14] || (c[14] = Y(" Тиждень ", -1)),
1724
+ e(v) === "week" ? (p(), j(ie, { key: 0 })) : V("", !0)
1725
+ ])
1726
+ ]),
1727
+ o("div", null, [
1728
+ o("button", {
1729
+ type: "button",
1730
+ onClick: c[3] || (c[3] = (u) => e(g)("month")),
1731
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1732
+ }, [
1733
+ c[15] || (c[15] = Y(" Місяць ", -1)),
1734
+ e(v) === "month" ? (p(), j(ie, { key: 0 })) : V("", !0)
1735
+ ])
1736
+ ]),
1737
+ o("div", null, [
1738
+ o("button", {
1739
+ type: "button",
1740
+ onClick: c[4] || (c[4] = (u) => e(g)("quarter")),
1741
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1742
+ }, [
1743
+ c[16] || (c[16] = Y(" Квартал ", -1)),
1744
+ e(v) === "quarter" ? (p(), j(ie, { key: 0 })) : V("", !0)
1745
+ ])
1746
+ ]),
1747
+ o("div", Vl, [
1748
+ o("button", {
1749
+ type: "button",
1750
+ onClick: c[5] || (c[5] = (u) => e(g)("year")),
1751
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1752
+ }, [
1753
+ c[17] || (c[17] = Y(" Рік ", -1)),
1754
+ e(v) === "year" ? (p(), j(ie, { key: 0 })) : V("", !0)
1755
+ ])
1756
+ ]),
1757
+ o("div", Sl, [
1758
+ o("button", {
1759
+ type: "button",
1760
+ onClick: c[6] || (c[6] = (u) => e(h)()),
1761
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1762
+ }, [
1763
+ c[18] || (c[18] = Y(" Весь час ", -1)),
1764
+ e(y)[0] ? V("", !0) : (p(), j(ie, { key: 0 }))
1765
+ ])
1766
+ ])
1767
+ ]),
1768
+ _: 1,
1769
+ __: [19]
1770
+ }, 8, ["label", "current-value", "mode", "onClear", "layout"]),
1771
+ e(v) !== "" && e(v) !== "range" && e(v) !== "last_7_days" ? (p(), k(F, { key: 0 }, [
1772
+ o("div", Bl, [
1773
+ o("button", {
1774
+ type: "button",
1775
+ title: "Попередній період",
1776
+ class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1777
+ onClick: c[7] || (c[7] = //@ts-ignore
1778
+ (...u) => e(b) && e(b)(...u))
1779
+ }, [
1780
+ I(xl)
1781
+ ])
1782
+ ]),
1783
+ o("div", Ml, [
1784
+ o("button", {
1785
+ type: "button",
1786
+ title: "Наступний період",
1787
+ class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1788
+ onClick: c[8] || (c[8] = //@ts-ignore
1789
+ (...u) => e(C) && e(C)(...u))
1790
+ }, [
1791
+ I(_l)
1792
+ ])
1793
+ ])
1794
+ ], 64)) : V("", !0),
1795
+ e(v) !== "" && e(v) === "range" ? (p(), k("div", Al, [
1796
+ O(o("input", {
1797
+ type: "date",
1798
+ max: e(y)[1],
1799
+ locale: "uk-UA",
1800
+ "onUpdate:modelValue": c[9] || (c[9] = (u) => e(y)[0] = u),
1801
+ class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
1802
+ disabled: _.disabled
1803
+ }, null, 8, Dl), [
1804
+ [le, e(y)[0]]
1805
+ ]),
1806
+ O(o("input", {
1807
+ type: "date",
1808
+ min: e(y)[0],
1809
+ locale: "uk-UA",
1810
+ "onUpdate:modelValue": c[10] || (c[10] = (u) => e(y)[1] = u),
1811
+ class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
1812
+ disabled: _.disabled
1813
+ }, null, 8, Rl), [
1814
+ [le, e(y)[1]]
1815
+ ])
1816
+ ])) : V("", !0)
1817
+ ]),
1818
+ (_.cleanable, V("", !0))
1819
+ ], 64));
1820
+ }
1821
+ }), Re = {
1822
+ radio: vt,
1823
+ checkbox: De,
1824
+ check: De,
1825
+ text: Bt,
1826
+ range: Kt,
1827
+ date: el,
1828
+ select: sl,
1829
+ tag: fl,
1830
+ "date:inline": jl
1831
+ };
1832
+ function Se(s, a) {
1833
+ let d;
1834
+ switch (s.toLowerCase()) {
1835
+ case "autocomplete":
1836
+ d = "select";
1837
+ break;
1838
+ case "check":
1839
+ d = "checkbox";
1840
+ break;
1841
+ default:
1842
+ d = s == null ? void 0 : s.toString().toLowerCase();
1843
+ }
1844
+ return d === "date" && a && a === "inline" && (d = "date:inline"), {
1845
+ component: Re[d] || Re.text,
1846
+ type: d
1847
+ };
1848
+ }
1849
+ const zl = {}, Fl = {
1850
+ xmlns: "http://www.w3.org/2000/svg",
1851
+ width: "15px",
1852
+ height: "24",
1853
+ viewBox: "0 0 24 24",
1854
+ fill: "none",
1855
+ stroke: "currentColor",
1856
+ "stroke-width": "2",
1857
+ "stroke-linecap": "round",
1858
+ "stroke-linejoin": "round",
1859
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"
1860
+ };
1861
+ function Ll(s, a) {
1862
+ return p(), k("svg", Fl, a[0] || (a[0] = [
1863
+ o("path", {
1864
+ stroke: "none",
1865
+ d: "M0 0h24v24H0z",
1866
+ fill: "none"
1867
+ }, null, -1),
1868
+ o("path", { d: "M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747" }, null, -1),
1869
+ o("path", { d: "M20 4v5h-5" }, null, -1)
1870
+ ]));
1871
+ }
1872
+ const Kl = /* @__PURE__ */ X(zl, [["render", Ll]]), El = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Tl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Il = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Ol = { class: "flex items-center" }, Ul = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Pl = { class: "filter-layout__body" }, Hl = /* @__PURE__ */ N({
1873
+ __name: "vertical-layout",
1874
+ props: {
1875
+ id: {},
1876
+ name: {},
1877
+ type: {},
1878
+ label: {},
1879
+ width: {},
1880
+ options: {},
1881
+ placeHolder: {},
1882
+ api: {},
1883
+ data: {},
1884
+ default: {},
1885
+ modelValue: {},
1886
+ disabled: { type: Boolean },
1887
+ layout: {},
1888
+ cleanable: { type: Boolean },
1889
+ limit: {},
1890
+ multi: { type: Boolean },
1891
+ dataKey: {},
1892
+ valueKey: {},
1893
+ mode: {},
1894
+ labelKey: {},
1895
+ sort: {}
1896
+ },
1897
+ emits: ["update:modelValue", "change", "clear"],
1898
+ setup(s, { expose: a, emit: d }) {
1899
+ const l = s, n = d, r = $(), v = Se(l.type, l.layout), y = H({
1900
+ get: () => l.modelValue,
1901
+ set: (f) => n("update:modelValue", f)
1902
+ });
1903
+ function g(f) {
1904
+ n("clear", f);
1905
+ }
1906
+ function C(f, h) {
1907
+ n("change", { name: f, value: h }), l.modelValue !== void 0 && n("update:modelValue", h);
1908
+ }
1909
+ function b() {
1910
+ r.value && r.value.clear(), n("clear", l.name);
1911
+ }
1912
+ return A(
1913
+ () => l.default,
1914
+ (f) => {
1915
+ y.value = f;
1916
+ }
1917
+ ), A(
1918
+ () => l.modelValue,
1919
+ (f) => {
1920
+ y.value = f;
1921
+ }
1922
+ ), a({
1923
+ filterRef: r
1924
+ }), (f, h) => {
1925
+ var _, c, u;
1926
+ return p(), k("div", El, [
1927
+ o("div", Tl, [
1928
+ o("div", Il, [
1929
+ o("div", Ol, [
1930
+ o("span", Ul, L(f.label), 1)
1931
+ ]),
1932
+ typeof y.value == "string" && y.value.trim() !== "" || Array.isArray(y.value) && y.value.length > 0 && y.value.some((t) => t !== void 0) || y.value === null ? (p(), j(Kl, {
1933
+ key: 0,
1934
+ onClick: b
1935
+ })) : V("", !0)
1936
+ ]),
1937
+ o("div", Pl, [
1938
+ ((_ = e(v)) == null ? void 0 : _.type) !== "select" ? (p(), j(ae((c = e(v)) == null ? void 0 : c.component), Z({ key: 0 }, l, {
1939
+ type: (u = e(v)) == null ? void 0 : u.type,
1940
+ onChange: h[0] || (h[0] = (t) => C(t.name, t.value)),
1941
+ onClear: h[1] || (h[1] = (t) => g(t)),
1942
+ ref_key: "filterRef",
1943
+ ref: r
1944
+ }), null, 16, ["type"])) : (p(), j(Ve, {
1945
+ key: 1,
1946
+ "current-value": y.value,
1947
+ label: f.label,
1948
+ mode: f.mode,
1949
+ onClear: b,
1950
+ fieldRef: r.value,
1951
+ width: void 0,
1952
+ disabled: f.disabled,
1953
+ layout: "vertical"
1954
+ }, {
1955
+ default: ne(() => {
1956
+ var t, x;
1957
+ return [
1958
+ (p(), j(ae((t = e(v)) == null ? void 0 : t.component), Z({
1959
+ ref_key: "filterRef",
1960
+ ref: r
1961
+ }, l, {
1962
+ type: (x = e(v)) == null ? void 0 : x.type,
1963
+ onChange: h[2] || (h[2] = (m) => C(m.name, m.value)),
1964
+ onClear: h[3] || (h[3] = (m) => g(m))
1965
+ }), null, 16, ["type"]))
1966
+ ];
1967
+ }),
1968
+ _: 1
1969
+ }, 8, ["current-value", "label", "mode", "fieldRef", "disabled"]))
1970
+ ])
1971
+ ])
1972
+ ]);
1973
+ };
1974
+ }
1975
+ }), je = /* @__PURE__ */ N({
1976
+ __name: "inline-layout",
1977
+ props: {
1978
+ id: {},
1979
+ name: {},
1980
+ type: {},
1981
+ label: {},
1982
+ width: {},
1983
+ options: {},
1984
+ placeHolder: {},
1985
+ api: {},
1986
+ data: {},
1987
+ default: {},
1988
+ modelValue: {},
1989
+ disabled: { type: Boolean },
1990
+ layout: {},
1991
+ cleanable: { type: Boolean },
1992
+ limit: {},
1993
+ multi: { type: Boolean },
1994
+ dataKey: {},
1995
+ valueKey: {},
1996
+ mode: {},
1997
+ labelKey: {},
1998
+ sort: {}
1999
+ },
2000
+ emits: ["update:modelValue", "change", "clear"],
2001
+ setup(s, { expose: a, emit: d }) {
2002
+ const l = s, n = d, r = $(), v = Se(l.type, l.layout), y = H({
2003
+ get: () => l.modelValue,
2004
+ set: (b) => n("update:modelValue", b)
2005
+ });
2006
+ function g(b = l.name) {
2007
+ n("clear", b);
2008
+ }
2009
+ function C(b, f) {
2010
+ n("change", { name: b, value: f }), l.modelValue !== void 0 && n("update:modelValue", f);
2011
+ }
2012
+ return A(
2013
+ () => l.default,
2014
+ (b) => {
2015
+ y.value = b;
2016
+ }
2017
+ ), A(
2018
+ () => l.modelValue,
2019
+ (b) => {
2020
+ y.value = b;
2021
+ }
2022
+ ), a({
2023
+ filterRef: r
2024
+ }), (b, f) => {
2025
+ var h, _;
2026
+ return ["text", "date"].includes(b.type.toLocaleLowerCase()) ? (p(), j(ae((h = e(v)) == null ? void 0 : h.component), Z({ key: 0 }, l, {
2027
+ type: (_ = e(v)) == null ? void 0 : _.type,
2028
+ onChange: f[0] || (f[0] = (c) => C(c.name, c.value)),
2029
+ onClear: f[1] || (f[1] = (c) => g(c)),
2030
+ disabled: b.disabled,
2031
+ modelValue: y.value,
2032
+ "onUpdate:modelValue": f[2] || (f[2] = (c) => y.value = c)
2033
+ }), null, 16, ["type", "disabled", "modelValue"])) : (p(), j(Ve, {
2034
+ key: 1,
2035
+ "current-value": y.value,
2036
+ label: b.label,
2037
+ mode: b.mode,
2038
+ onClear: g,
2039
+ fieldRef: r.value,
2040
+ width: l.width,
2041
+ disabled: b.disabled,
2042
+ layout: "inline"
2043
+ }, {
2044
+ default: ne(() => {
2045
+ var c, u;
2046
+ return [
2047
+ (p(), j(ae((c = e(v)) == null ? void 0 : c.component), Z({
2048
+ ref_key: "filterRef",
2049
+ ref: r
2050
+ }, l, {
2051
+ modelValue: y.value,
2052
+ "onUpdate:modelValue": f[3] || (f[3] = (t) => y.value = t),
2053
+ type: (u = e(v)) == null ? void 0 : u.type,
2054
+ onChange: f[4] || (f[4] = (t) => C(t.name, t.value)),
2055
+ onClear: f[5] || (f[5] = (t) => g(t))
2056
+ }), null, 16, ["modelValue", "type"]))
2057
+ ];
2058
+ }),
2059
+ _: 1
2060
+ }, 8, ["current-value", "label", "mode", "fieldRef", "width", "disabled"]));
2061
+ };
2062
+ }
2063
+ }), Nl = /* @__PURE__ */ N({
2064
+ __name: "popover-layout",
2065
+ props: {
2066
+ id: {},
2067
+ name: {},
2068
+ type: {},
2069
+ label: {},
2070
+ width: {},
2071
+ options: {},
2072
+ placeHolder: {},
2073
+ api: {},
2074
+ data: {},
2075
+ default: {},
2076
+ modelValue: {},
2077
+ disabled: { type: Boolean },
2078
+ layout: {},
2079
+ cleanable: { type: Boolean },
2080
+ limit: {},
2081
+ multi: { type: Boolean },
2082
+ dataKey: {},
2083
+ valueKey: {},
2084
+ mode: {},
2085
+ labelKey: {},
2086
+ sort: {}
2087
+ },
2088
+ emits: ["update:modelValue", "change", "clear"],
2089
+ setup(s, { expose: a, emit: d }) {
2090
+ const l = s, n = d, r = $(), v = $(Se(l.type, l.layout)), y = H({
2091
+ get: () => l.modelValue,
2092
+ set: (b) => n("update:modelValue", b)
2093
+ });
2094
+ function g(b) {
2095
+ n("clear", b);
2096
+ }
2097
+ function C(b, f) {
2098
+ n("change", { name: b, value: f }), l.modelValue !== void 0 && n("update:modelValue", f);
2099
+ }
2100
+ return A(
2101
+ () => l.default,
2102
+ (b) => {
2103
+ y.value = b;
2104
+ }
2105
+ ), A(
2106
+ () => l.modelValue,
2107
+ (b) => {
2108
+ y.value = b;
2109
+ }
2110
+ ), A(
2111
+ () => l,
2112
+ (b) => {
2113
+ y.value = b;
2114
+ }
2115
+ ), a({
2116
+ filterRef: r
2117
+ }), (b, f) => {
2118
+ var h, _;
2119
+ return p(), j(ae((h = v.value) == null ? void 0 : h.component), Z(l, {
2120
+ type: (_ = v.value) == null ? void 0 : _.type,
2121
+ modelValue: y.value,
2122
+ "onUpdate:modelValue": f[0] || (f[0] = (c) => y.value = c),
2123
+ onChange: f[1] || (f[1] = (c) => C(c.name, c.value)),
2124
+ onClear: f[2] || (f[2] = (c) => g(c)),
2125
+ ref_key: "filterRef",
2126
+ ref: r
2127
+ }), null, 16, ["type", "modelValue"]);
2128
+ };
2129
+ }
2130
+ }), re = /* @__PURE__ */ N({
2131
+ __name: "filter-field",
2132
+ props: {
2133
+ id: {},
2134
+ name: {},
2135
+ type: {},
2136
+ label: {},
2137
+ width: {},
2138
+ options: { default: () => [] },
2139
+ placeHolder: {},
2140
+ api: {},
2141
+ data: {},
2142
+ default: {},
2143
+ modelValue: {},
2144
+ disabled: { type: Boolean, default: !1 },
2145
+ layout: { default: "inline" },
2146
+ cleanable: { type: Boolean },
2147
+ limit: { default: 10 },
2148
+ multi: { type: Boolean, default: !0 },
2149
+ dataKey: {},
2150
+ valueKey: {},
2151
+ mode: {},
2152
+ labelKey: {},
2153
+ sort: { default: "name" }
2154
+ },
2155
+ emits: ["update:modelValue", "change", "clear"],
2156
+ setup(s, { expose: a, emit: d }) {
2157
+ const l = s, n = d, r = $(), v = H({
2158
+ get: () => l.modelValue,
2159
+ set: (b) => n("update:modelValue", b)
2160
+ });
2161
+ function y(b) {
2162
+ n("clear", b);
2163
+ }
2164
+ function g(b, f) {
2165
+ n("change", { name: b, value: f }), l.modelValue !== void 0 && n("update:modelValue", f);
2166
+ }
2167
+ A(
2168
+ () => l.default,
2169
+ (b) => {
2170
+ v.value = b;
2171
+ }
2172
+ ), A(
2173
+ () => l.modelValue,
2174
+ (b) => {
2175
+ v.value = b;
2176
+ }
2177
+ ), a({
2178
+ filterRef: r
2179
+ });
2180
+ function C() {
2181
+ switch (l.layout) {
2182
+ case "inline":
2183
+ return je;
2184
+ case "vertical":
2185
+ return Hl;
2186
+ case "popover":
2187
+ return Nl;
2188
+ default:
2189
+ return je;
2190
+ }
2191
+ }
2192
+ return (b, f) => (p(), j(ae(C()), Z(l, {
2193
+ onChange: f[0] || (f[0] = (h) => g(h.name, h.value)),
2194
+ onClear: f[1] || (f[1] = (h) => y(h)),
2195
+ modelValue: v.value,
2196
+ "onUpdate:modelValue": f[2] || (f[2] = (h) => v.value = h)
2197
+ }), null, 16, ["modelValue"]));
2198
+ }
2199
+ });
2200
+ function Be(s, a) {
2201
+ const {
2202
+ slots: d
2203
+ } = s, l = $(s.value ?? {}), n = H(() => {
2204
+ var i;
2205
+ return (fe((i = d == null ? void 0 : d.default) == null ? void 0 : i.call(d)) ?? []).flatMap((w) => Array.isArray(w.children) ? w.children : [w]);
2206
+ });
2207
+ function r(m) {
2208
+ delete l.value[m], a("clear", {
2209
+ data: fe(l.value),
2210
+ name: m
2211
+ });
2212
+ }
2213
+ function v(m, i) {
2214
+ i === void 0 ? r(m) : l.value = {
2215
+ ...l.value,
2216
+ [m]: i
2217
+ }, a("change", {
2218
+ data: fe(l.value),
2219
+ name: m,
2220
+ value: i
2221
+ });
2222
+ }
2223
+ const y = H(() => n.value.map((m) => {
2224
+ var w;
2225
+ const i = (w = m.props) == null ? void 0 : w.name;
2226
+ return We(m, {
2227
+ ...m.props,
2228
+ layout: s.view,
2229
+ showClean: !0,
2230
+ modelValue: l[i],
2231
+ "onUpdate:modelValue": (B) => {
2232
+ v(i, B);
2233
+ },
2234
+ onClear: () => r(i)
2235
+ });
2236
+ })), g = H(
2237
+ () => new Map(
2238
+ y.value.map((m) => {
2239
+ var w;
2240
+ const i = (w = m.props) == null ? void 0 : w.name;
2241
+ return i ? [i, m] : null;
2242
+ }).filter((m) => m !== null)
2243
+ )
2244
+ );
2245
+ function C(m = !1) {
2246
+ l.value = {}, m || a("clearAll", {
2247
+ data: fe(l.value),
2248
+ name: "ALL"
2249
+ });
2250
+ }
2251
+ const b = $(""), f = H(() => {
2252
+ var m;
2253
+ return (m = s.schema) != null && m.value ? Object.entries(l.value).filter(([i, w]) => s.schema && !(i in s.schema.value) ? !1 : Array.isArray(w) ? w.some((B) => B !== "" && B !== void 0) : w !== "" && w !== void 0).length : 0;
2254
+ }), h = $();
2255
+ A(b, async () => {
2256
+ var m, i;
2257
+ await we(), (i = (m = h == null ? void 0 : h.value) == null ? void 0 : m.filterRef) != null && i.inputTextRef && h.value.filterRef.inputTextRef.focus();
2258
+ });
2259
+ const _ = H(() => {
2260
+ var m, i;
2261
+ return (m = s.schema) != null && m.value ? Object.fromEntries(Object.entries((i = s.schema) == null ? void 0 : i.value).slice(0, s.limit)) : {};
2262
+ }), c = H(() => {
2263
+ var m, i, w;
2264
+ return (m = s.schema) != null && m.value ? s.view !== "inline" ? (i = s.schema) == null ? void 0 : i.value : Object.fromEntries(Object.entries((w = s.schema) == null ? void 0 : w.value).slice(s.limit)) : {};
2265
+ }), u = H(() => {
2266
+ var i;
2267
+ if (y.value.length === 0) return [];
2268
+ let m = 0;
2269
+ if ((i = s.schema) != null && i.value) {
2270
+ const w = Object.entries(s.schema.value).length;
2271
+ w < s.limit ? m = s.limit - w : m = 0;
2272
+ }
2273
+ return y.value.slice(0, m);
2274
+ }), t = H(() => y.value.length === 0 ? [] : s.view !== "inline" ? y.value : y.value.slice(u.value.length));
2275
+ function x() {
2276
+ if (c.value) {
2277
+ const [m] = Object.keys(c.value);
2278
+ b.value = m;
2279
+ } else t.value.length > 0 ? b.value = t.value[0].props.name : b.value = "";
2280
+ }
2281
+ return {
2282
+ activeFilter: l,
2283
+ activeFilterCount: f,
2284
+ onFilterChange: v,
2285
+ clearFilter: r,
2286
+ clearAllFilters: C,
2287
+ limitedSchema: _,
2288
+ popoverSchema: c,
2289
+ filtersSlot: y,
2290
+ limitedFiltersSlot: u,
2291
+ popoverFiltersSlot: t,
2292
+ vnodeMap: g,
2293
+ onPopoverOpen: x,
2294
+ selectedFilter: b,
2295
+ filterRef: h
2296
+ };
2297
+ }
2298
+ const Yl = /* @__PURE__ */ N({
2299
+ __name: "popover",
2300
+ emits: ["open", "close"],
2301
+ setup(s, { emit: a }) {
2302
+ const d = $(!1), l = $(null), n = $(null), r = $(null), v = $({ top: "0px", left: "0px", position: "absolute" });
2303
+ function y() {
2304
+ d.value = !d.value;
2305
+ }
2306
+ function g() {
2307
+ const h = r.value, _ = l.value;
2308
+ if (!h || !_) return;
2309
+ const c = h.getBoundingClientRect(), u = _.offsetWidth, t = window.innerWidth - c.left;
2310
+ let x = c.left + window.scrollX;
2311
+ u > t && (x = window.innerWidth - u - 8, x < 8 && (x = 8)), v.value = {
2312
+ position: "absolute",
2313
+ top: `${c.bottom + window.scrollY + 8}px`,
2314
+ left: `${x}px`
2315
+ };
2316
+ }
2317
+ function C(h) {
2318
+ var c, u;
2319
+ const _ = h.target;
2320
+ !((c = r.value) != null && c.contains(h.target)) && !((u = l.value) != null && u.contains(h.target)) && !_.closest("[data-inside-popover]") && (d.value = !1);
2321
+ }
2322
+ const b = $(!1);
2323
+ ue(() => {
2324
+ b.value = !0;
2325
+ }), ue(() => {
2326
+ var h, _;
2327
+ r.value = ((h = n.value) == null ? void 0 : h.querySelector("[data-popover-trigger]")) || null, (_ = r.value) == null || _.addEventListener("click", y), document.addEventListener("click", C), window.addEventListener("resize", g), window.addEventListener("scroll", g, !0);
2328
+ }), ge(() => {
2329
+ var h;
2330
+ (h = r.value) == null || h.removeEventListener("click", y), document.removeEventListener("click", C), window.removeEventListener("resize", g), window.removeEventListener("scroll", g, !0);
2331
+ });
2332
+ const f = a;
2333
+ return A(d, async (h) => {
2334
+ h ? (f("open"), await we(), g()) : f("close");
2335
+ }), (h, _) => (p(), k("div", {
2336
+ ref_key: "wrapperRef",
2337
+ ref: n
2338
+ }, [
2339
+ te(h.$slots, "trigger"),
2340
+ b.value ? (p(), j(Ke, {
2341
+ key: 0,
2342
+ to: "body"
2343
+ }, [
2344
+ O(o("div", {
2345
+ ref_key: "popoverRef",
2346
+ ref: l,
2347
+ class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
2348
+ style: xe(v.value)
2349
+ }, [
2350
+ te(h.$slots, "default")
2351
+ ], 4), [
2352
+ [ee, d.value]
2353
+ ])
2354
+ ])) : V("", !0)
2355
+ ], 512));
2356
+ }
2357
+ }), Wl = {}, ql = {
2358
+ xmlns: "http://www.w3.org/2000/svg",
2359
+ width: "24",
2360
+ height: "24",
2361
+ viewBox: "0 0 24 24",
2362
+ fill: "none",
2363
+ stroke: "currentColor",
2364
+ "stroke-width": "2",
2365
+ "stroke-linecap": "round",
2366
+ "stroke-linejoin": "round",
2367
+ class: "lucide lucide-filter h-4 w-4"
2368
+ };
2369
+ function Gl(s, a) {
2370
+ return p(), k("svg", ql, a[0] || (a[0] = [
2371
+ o("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
2372
+ ]));
2373
+ }
2374
+ const Ql = /* @__PURE__ */ X(Wl, [["render", Gl]]), Zl = {
2375
+ key: 0,
2376
+ class: "inline-flex rounded-sm items-center border font-semibold border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5"
2377
+ }, Xl = { class: "flex" }, Jl = { class: "w-64 border-r border-gray-200" }, eo = { class: "p-2" }, to = ["onClick"], lo = { class: "flex items-center gap-2" }, oo = { class: "text-sm font-medium" }, no = {
2378
+ key: 0,
2379
+ class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
2380
+ }, ao = ["onClick"], ro = { class: "flex items-center gap-2" }, so = { class: "text-sm font-medium" }, io = {
2381
+ key: 0,
2382
+ class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
2383
+ }, uo = {
2384
+ key: 0,
2385
+ class: "p-2 border-t"
2386
+ }, co = { class: "flex-1 min-h-[300px] overflow-y-auto" }, po = {
2387
+ key: 0,
2388
+ class: "flex items-center justify-center h-full text-gray-500"
2389
+ }, Ne = /* @__PURE__ */ N({
2390
+ __name: "popover-filter-layout",
2391
+ props: {
2392
+ schema: {},
2393
+ view: {},
2394
+ value: {},
2395
+ history: { type: Boolean },
2396
+ mode: {},
2397
+ limit: { default: 3 }
2398
+ },
2399
+ emits: ["change", "clear", "clearAll"],
2400
+ setup(s, { expose: a, emit: d }) {
2401
+ const l = s, n = Pe(l.mode), r = ke(), v = d, y = $({}), {
2402
+ activeFilter: g,
2403
+ activeFilterCount: C,
2404
+ onFilterChange: b,
2405
+ clearFilter: f,
2406
+ clearAllFilters: h,
2407
+ popoverSchema: _,
2408
+ popoverFiltersSlot: c,
2409
+ onPopoverOpen: u,
2410
+ selectedFilter: t,
2411
+ filterRef: x
2412
+ } = Be({
2413
+ ...l,
2414
+ schema: y,
2415
+ slots: r
2416
+ }, v);
2417
+ return A(
2418
+ () => l.schema,
2419
+ (m) => {
2420
+ y.value = m;
2421
+ },
2422
+ { deep: !0, immediate: !0 }
2423
+ ), a({
2424
+ clearFilter: f,
2425
+ clearAllFilters: h
2426
+ }), (m, i) => (p(), j(Yl, {
2427
+ onOpen: e(u),
2428
+ onClose: i[5] || (i[5] = (w) => t.value = "")
2429
+ }, {
2430
+ trigger: ne(() => [
2431
+ o("button", {
2432
+ "data-popover-trigger": "",
2433
+ "aria-haspopup": "dialog",
2434
+ "aria-expanded": "false",
2435
+ class: z(
2436
+ e(n) + (e(C) > 0 ? "bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100" : "text-gray-800 hover:bg-gray-200 focus:bg-gray-200")
2437
+ ),
2438
+ type: "button"
2439
+ }, [
2440
+ I(Ql),
2441
+ i[6] || (i[6] = Y(" Фільтр ", -1)),
2442
+ e(C) > 0 ? (p(), k("div", Zl, L(e(C)), 1)) : V("", !0)
2443
+ ], 2)
2444
+ ]),
2445
+ default: ne(() => [
2446
+ o("div", Xl, [
2447
+ o("div", Jl, [
2448
+ i[7] || (i[7] = o("div", { class: "p-4 border-b" }, [
2449
+ o("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
2450
+ ], -1)),
2451
+ o("div", eo, [
2452
+ m.schema ? (p(!0), k(F, { key: 0 }, W(Object.entries(e(_)), ([w, B]) => {
2453
+ var S;
2454
+ return p(), k("button", {
2455
+ key: w,
2456
+ onClick: () => {
2457
+ t.value = w;
2458
+ },
2459
+ class: z([
2460
+ "w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
2461
+ e(t) === w ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2462
+ ])
2463
+ }, [
2464
+ o("div", lo, [
2465
+ o("span", oo, L(B.label), 1)
2466
+ ]),
2467
+ (Array.isArray(e(g)[w]) ? ((S = e(g)[w]) == null ? void 0 : S.length) > 0 : e(g)[w] || e(g)[w] === null) ? (p(), k("div", no)) : V("", !0)
2468
+ ], 10, to);
2469
+ }), 128)) : V("", !0),
2470
+ (p(!0), k(F, null, W(e(c), (w, B) => {
2471
+ var S;
2472
+ return p(), k("button", {
2473
+ key: "slot-" + B,
2474
+ onClick: (K) => t.value = w.props.name,
2475
+ class: z([
2476
+ "w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
2477
+ e(t) === w.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2478
+ ])
2479
+ }, [
2480
+ o("div", ro, [
2481
+ o("span", so, L(w.props.label), 1)
2482
+ ]),
2483
+ ((S = e(g)[w.props.name]) == null ? void 0 : S.length) > 0 ? (p(), k("div", io)) : V("", !0)
2484
+ ], 10, ao);
2485
+ }), 128))
2486
+ ]),
2487
+ e(C) > 0 ? (p(), k("div", uo, [
2488
+ o("button", {
2489
+ class: "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",
2490
+ onClick: i[0] || (i[0] = (w) => e(h)()),
2491
+ "data-inside-popover": ""
2492
+ }, " Очистити всі ")
2493
+ ])) : V("", !0)
2494
+ ]),
2495
+ o("div", co, [
2496
+ e(t) === "" ? (p(), k("div", po, i[8] || (i[8] = [
2497
+ o("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
2498
+ ]))) : V("", !0),
2499
+ e(t) ? (p(), k(F, { key: 1 }, [
2500
+ e(_) ? (p(!0), k(F, { key: 0 }, W(Object.entries(e(_)), ([w, B]) => (p(), k(F, null, [
2501
+ e(t) === w ? (p(), j(re, Z({
2502
+ name: w,
2503
+ key: w,
2504
+ layout: "popover",
2505
+ ref_for: !0,
2506
+ ref_key: "filterRef",
2507
+ ref: x
2508
+ }, { ref_for: !0 }, B, {
2509
+ onChange: i[1] || (i[1] = (S) => e(b)(S.name, S.value)),
2510
+ onClear: i[2] || (i[2] = (S) => {
2511
+ e(f)(S), e(b)(S, void 0);
2512
+ }),
2513
+ modelValue: e(g)[w],
2514
+ "onUpdate:modelValue": (S) => e(g)[w] = S,
2515
+ cleanable: !0
2516
+ }), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : V("", !0)
2517
+ ], 64))), 256)) : V("", !0),
2518
+ (p(!0), k(F, null, W(e(c), (w, B) => (p(), k(F, {
2519
+ key: "slot-" + B
2520
+ }, [
2521
+ e(t) === w.props.name ? (p(), j(re, Z({
2522
+ key: 0,
2523
+ layout: "popover"
2524
+ }, { ref_for: !0 }, w.props, {
2525
+ ref_for: !0,
2526
+ ref_key: "filterRef",
2527
+ ref: x,
2528
+ onChange: i[3] || (i[3] = (S) => e(b)(S.name, S.value)),
2529
+ onClear: i[4] || (i[4] = (S) => {
2530
+ e(f)(S), e(b)(S, void 0);
2531
+ }),
2532
+ modelValue: e(g)[w.props.name],
2533
+ "onUpdate:modelValue": (S) => e(g)[w.props.name] = S,
2534
+ cleanable: !0
2535
+ }), null, 16, ["modelValue", "onUpdate:modelValue"])) : V("", !0)
2536
+ ], 64))), 128))
2537
+ ], 64)) : V("", !0)
2538
+ ])
2539
+ ])
2540
+ ]),
2541
+ _: 1
2542
+ }, 8, ["onOpen"]));
2543
+ }
2544
+ }), fo = { class: "flex gap-1 items-center flex-wrap" }, ze = /* @__PURE__ */ N({
2545
+ __name: "inline-filter-layout",
2546
+ props: {
2547
+ schema: {},
2548
+ view: {},
2549
+ value: {},
2550
+ history: { type: Boolean },
2551
+ mode: {},
2552
+ limit: { default: 3 }
2553
+ },
2554
+ emits: ["change", "clear", "clearAll"],
2555
+ setup(s, { expose: a, emit: d }) {
2556
+ const l = s, n = d, r = ke(), v = $({}), {
2557
+ activeFilter: y,
2558
+ activeFilterCount: g,
2559
+ onFilterChange: C,
2560
+ clearFilter: b,
2561
+ clearAllFilters: f,
2562
+ limitedSchema: h,
2563
+ popoverSchema: _,
2564
+ filtersSlot: c,
2565
+ limitedFiltersSlot: u,
2566
+ popoverFiltersSlot: t
2567
+ } = Be(
2568
+ {
2569
+ ...l,
2570
+ schema: v,
2571
+ slots: r
2572
+ },
2573
+ n
2574
+ ), x = $();
2575
+ function m() {
2576
+ x.value && x.value.clearAllFilters(!0), f();
2577
+ }
2578
+ return A(
2579
+ () => l.schema,
2580
+ (i) => {
2581
+ v.value = i;
2582
+ },
2583
+ { deep: !0, immediate: !0 }
2584
+ ), a({
2585
+ clearFilter: b,
2586
+ clearAllFilters: f
2587
+ }), (i, w) => (p(), k("div", fo, [
2588
+ i.schema ? (p(!0), k(F, { key: 0 }, W(Object.entries(e(h)), ([B, S]) => (p(), j(re, Z({
2589
+ key: B,
2590
+ name: B,
2591
+ mode: i.mode
2592
+ }, { ref_for: !0 }, S, {
2593
+ onChange: w[0] || (w[0] = (K) => e(C)(K.name, K.value)),
2594
+ onClear: e(b),
2595
+ layout: "inline",
2596
+ cleanable: !0,
2597
+ modelValue: e(y)[B],
2598
+ "onUpdate:modelValue": (K) => e(y)[B] = K
2599
+ }), null, 16, ["name", "mode", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : V("", !0),
2600
+ (p(!0), k(F, null, W(e(u), (B, S) => (p(), j(re, Z({
2601
+ key: "slot-" + S,
2602
+ layout: "inline"
2603
+ }, { ref_for: !0 }, B.props, {
2604
+ onChange: w[1] || (w[1] = (K) => e(C)(K.name, K.value)),
2605
+ onClear: w[2] || (w[2] = (K) => {
2606
+ e(b)(K), e(C)(K, void 0);
2607
+ }),
2608
+ cleanable: !0,
2609
+ modelValue: e(y)[B.props.name],
2610
+ "onUpdate:modelValue": (K) => e(y)[B.props.name] = K
2611
+ }), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128)),
2612
+ Object.entries(e(_)).length > 0 || e(t).length > 0 ? (p(), j(Ne, Z({ key: 1 }, l, {
2613
+ schema: e(_),
2614
+ limit: 0,
2615
+ onChange: w[3] || (w[3] = (B) => e(C)(B.name, B.value)),
2616
+ onClearAll: w[4] || (w[4] = (B) => e(f)()),
2617
+ onClear: w[5] || (w[5] = (B) => e(b)(B.name)),
2618
+ mode: i.mode,
2619
+ ref_key: "popoverRef",
2620
+ ref: x,
2621
+ cleanable: !0
2622
+ }), {
2623
+ default: ne(() => [
2624
+ (p(!0), k(F, null, W(e(c), (B, S) => (p(), j(ae(B), Z({
2625
+ key: "slot-" + S,
2626
+ layout: "popover"
2627
+ }, { ref_for: !0 }, B.props, { cleanable: !0 }), null, 16))), 128))
2628
+ ]),
2629
+ _: 1
2630
+ }, 16, ["schema", "mode"])) : V("", !0),
2631
+ e(g) > 0 ? (p(), k("button", {
2632
+ key: 2,
2633
+ onClick: m,
2634
+ class: "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"
2635
+ }, " Очистити ")) : V("", !0)
2636
+ ]));
2637
+ }
2638
+ }), mo = {
2639
+ key: 0,
2640
+ class: "p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"
2641
+ }, vo = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, go = /* @__PURE__ */ N({
2642
+ __name: "vertical-filter-layout",
2643
+ props: {
2644
+ schema: {},
2645
+ view: {},
2646
+ value: {},
2647
+ history: { type: Boolean },
2648
+ mode: {},
2649
+ limit: { default: 3 }
2650
+ },
2651
+ emits: ["change", "clear", "clearAll"],
2652
+ setup(s, { expose: a, emit: d }) {
2653
+ const l = s, n = d, r = ke(), {
2654
+ activeFilter: v,
2655
+ activeFilterCount: y,
2656
+ onFilterChange: g,
2657
+ clearFilter: C,
2658
+ clearAllFilters: b,
2659
+ filtersSlot: f
2660
+ } = Be({
2661
+ ...l,
2662
+ slots: r
2663
+ }, n);
2664
+ return a({
2665
+ clearFilter: C,
2666
+ clearAllFilters: b
2667
+ }), (h, _) => h.view === "vertical" ? (p(), k("div", mo, [
2668
+ o("div", vo, [
2669
+ e(y) > 0 ? (p(), k("button", {
2670
+ key: 0,
2671
+ onClick: _[0] || (_[0] = (c) => e(b)()),
2672
+ "data-popover-trigger": "",
2673
+ "aria-haspopup": "dialog",
2674
+ "aria-expanded": "false",
2675
+ class: "w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md 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 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",
2676
+ type: "button"
2677
+ }, " Очистити ")) : V("", !0),
2678
+ h.schema ? (p(!0), k(F, { key: 1 }, W(Object.entries(h.schema), ([c, u]) => (p(), j(re, Z({
2679
+ name: c,
2680
+ layout: "vertical"
2681
+ }, { ref_for: !0 }, u, {
2682
+ onChange: _[1] || (_[1] = (t) => e(g)(t.name, t.value)),
2683
+ onClear: _[2] || (_[2] = (t) => {
2684
+ e(C)(t), e(g)(t, void 0);
2685
+ }),
2686
+ modelValue: e(v)[c],
2687
+ "onUpdate:modelValue": (t) => e(v)[c] = t,
2688
+ showClean: !0
2689
+ }), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : V("", !0),
2690
+ (p(!0), k(F, null, W(e(f), (c, u) => (p(), j(re, Z({
2691
+ key: "slot-" + u,
2692
+ layout: "vertical"
2693
+ }, { ref_for: !0 }, c.props, {
2694
+ onChange: _[3] || (_[3] = (t) => e(g)(t.name, t.value)),
2695
+ onClear: _[4] || (_[4] = (t) => {
2696
+ e(C)(t), e(g)(t, void 0);
2697
+ }),
2698
+ modelValue: e(v)[c.props.name],
2699
+ "onUpdate:modelValue": (t) => e(v)[c.props.name] = t,
2700
+ showClean: !0
2701
+ }), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
2702
+ ])
2703
+ ])) : V("", !0);
2704
+ }
2705
+ }), he = /* @__PURE__ */ N({
2706
+ __name: "filter",
2707
+ props: {
2708
+ schema: {},
2709
+ view: { default: "inline" },
2710
+ value: {},
2711
+ history: { type: Boolean },
2712
+ mode: {},
2713
+ limit: { default: 3 }
2714
+ },
2715
+ emits: ["change", "clear", "clearAll"],
2716
+ setup(s, { expose: a, emit: d }) {
2717
+ const l = s, n = $(l.value ?? {}), r = d, v = $();
2718
+ function y(u) {
2719
+ if (Array.isArray(u))
2720
+ return u.map((t) => y(t));
2721
+ if (u !== null && typeof u == "object") {
2722
+ const t = fe(u), x = {};
2723
+ for (const m in t)
2724
+ x[m] = y(t[m]);
2725
+ return x;
2726
+ }
2727
+ return u;
2728
+ }
2729
+ function g(u, t) {
2730
+ t !== void 0 ? n.value = {
2731
+ ...n.value,
2732
+ [u]: t
2733
+ } : delete n.value[u], r("change", {
2734
+ data: y(n.value),
2735
+ name: u,
2736
+ value: y(t)
2737
+ });
2738
+ }
2739
+ function C(u) {
2740
+ delete n.value[u], r("clear", {
2741
+ data: y(n.value),
2742
+ name: u
2743
+ }), r("change", {
2744
+ data: y(n.value),
2745
+ name: u,
2746
+ value: null
2747
+ });
2748
+ }
2749
+ function b() {
2750
+ n.value = {}, r("clear", {
2751
+ data: y(n.value),
2752
+ name: "ALL"
2753
+ }), r("change", {
2754
+ data: y(n.value),
2755
+ name: "ALL",
2756
+ value: null
2757
+ });
2758
+ }
2759
+ const f = $({});
2760
+ function h() {
2761
+ switch (l.view) {
2762
+ case "inline":
2763
+ return ze;
2764
+ case "vertical":
2765
+ return go;
2766
+ case "popover":
2767
+ return Ne;
2768
+ default:
2769
+ return ze;
2770
+ }
2771
+ }
2772
+ A(
2773
+ () => l.schema,
2774
+ (u) => {
2775
+ if (!u) {
2776
+ f.value = {};
2777
+ return;
2778
+ }
2779
+ if (Array.isArray(u) && !u.length) {
2780
+ f.value = {};
2781
+ return;
2782
+ }
2783
+ Array.isArray(u) ? f.value = u.filter((t) => t.type).reduce((t, x) => (Object.assign(x, { name: x.id || x.name, type: x.type.toLowerCase() }), t[x.name] = x, x.data && !x.api && !x.options && Object.assign(x, { api: `/api/suggest/${x.data}` }), t), {}) : (Object.entries(u).forEach(([t, x]) => {
2784
+ Object.assign(x, { name: t || x.name || x.id, type: x.type.toLowerCase() });
2785
+ }), f.value = { ...u });
2786
+ },
2787
+ { immediate: !0, deep: !0 }
2788
+ );
2789
+ function _(u) {
2790
+ v.value.clearFilter(u), C(u);
2791
+ }
2792
+ function c() {
2793
+ v.value.clearAllFilters(), b();
2794
+ }
2795
+ return a({
2796
+ clearAllFilters: c,
2797
+ clearFilter: _
2798
+ }), (u, t) => (p(), j(ae(h()), Z(l, {
2799
+ schema: f.value,
2800
+ onChange: t[0] || (t[0] = (x) => g(x.name, x.value)),
2801
+ onClear: t[1] || (t[1] = (x) => C(x.name)),
2802
+ onClearAll: b,
2803
+ ref_key: "filterRef",
2804
+ ref: v
2805
+ }), {
2806
+ default: ne(() => [
2807
+ te(u.$slots, "default")
2808
+ ]),
2809
+ _: 3
2810
+ }, 16, ["schema"]));
2811
+ }
2812
+ });
2813
+ he.install = function(a) {
2814
+ a.component("Filter", he), a.component("FilterField", re);
2815
+ };
2816
+ function yo(s) {
2817
+ const { page: a, id: d, filter: l } = s, n = new URL(window.location.href), r = new URLSearchParams(window.location.search);
2818
+ a ? r.set("page", a.toString()) : r.delete("page"), d ? r.set("id", d.toString()) : r.delete("id"), l ? r.set("filter", l) : r.delete("filter"), n.search = decodeURI(r.toString()), window.history.pushState({}, "", n);
2819
+ }
2820
+ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = { class: "flex items-center" }, xo = ["disabled"], wo = { class: "flex items-center gap-x-1" }, ko = ["onClick"], Co = ["disabled"], _o = { class: "flex justify-center items-center gap-x-5 ml-3" }, $o = { class: "relative" }, Vo = {
2821
+ class: "hs-dropdown-menu z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 right-0 dark:divide-neutral-700 absolute bottom-[100%]",
2822
+ role: "menu",
2823
+ "aria-orientation": "vertical",
2824
+ "aria-labelledby": "dropdown-button"
2825
+ }, So = ["onClick"], Bo = {
2826
+ key: 0,
2827
+ xmlns: "http://www.w3.org/2000/svg",
2828
+ viewBox: "0 0 24 24",
2829
+ fill: "none",
2830
+ stroke: "currentColor",
2831
+ "stroke-width": "4",
2832
+ "stroke-linecap": "round",
2833
+ "stroke-linejoin": "round",
2834
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-check text-blue-600",
2835
+ width: "14",
2836
+ height: "14"
2837
+ }, Mo = /* @__PURE__ */ N({
2838
+ __name: "pagination",
2839
+ props: {
2840
+ total: {},
2841
+ currentPage: {},
2842
+ pageSize: {}
2843
+ },
2844
+ emits: ["update:currentPage", "update:pageSize", "pageChange", "pageSizeChange"],
2845
+ setup(s, { emit: a }) {
2846
+ const d = s, l = a, n = $(d.currentPage), r = $(d.pageSize), v = $(!1);
2847
+ A(() => d.pageSize, (_) => {
2848
+ r.value = _;
2849
+ });
2850
+ const y = H(() => Math.ceil(d.total / d.pageSize)), g = H(() => {
2851
+ const c = Math.floor(3.5);
2852
+ let u = n.value - c, t = n.value + c;
2853
+ u < 1 && (t += 1 - u, u = 1), t > y.value && (u -= t - y.value, t = y.value), u = Math.max(1, u);
2854
+ const x = [];
2855
+ for (let m = u; m <= t; m += 1)
2856
+ x.push(m);
2857
+ return x;
2858
+ }), C = () => {
2859
+ n.value > 1 && (n.value -= 1, l("update:currentPage", n.value));
2860
+ }, b = () => {
2861
+ n.value < y.value && (n.value += 1, l("update:currentPage", n.value));
2862
+ }, f = (_) => {
2863
+ n.value = _, l("update:currentPage", _), l("pageChange", _);
2864
+ }, h = (_ = r.value) => {
2865
+ r.value = _, v.value = !1, l("update:pageSize", r.value), l("update:currentPage", 1), l("pageSizeChange", r.value);
2866
+ };
2867
+ return (_, c) => (p(), k("nav", bo, [
2868
+ o("div", ho, [
2869
+ o("button", {
2870
+ type: "button",
2871
+ "aria-label": "Previous",
2872
+ onClick: C,
2873
+ disabled: n.value === 1,
2874
+ class: "border-white last:rounded-e-lg text-base h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 border text-sm rounded-lg bg-white text-gray-800 hover:shadow-sm hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-700 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 py-2"
2875
+ }, c[1] || (c[1] = [
2876
+ o("svg", {
2877
+ xmlns: "http://www.w3.org/2000/svg",
2878
+ viewBox: "0 0 24 24",
2879
+ fill: "none",
2880
+ stroke: "currentColor",
2881
+ "stroke-width": "2",
2882
+ "stroke-linecap": "round",
2883
+ "stroke-linejoin": "round",
2884
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down rotate-90",
2885
+ height: "16",
2886
+ width: "16"
2887
+ }, [
2888
+ o("path", {
2889
+ stroke: "none",
2890
+ d: "M0 0h24v24H0z",
2891
+ fill: "none"
2892
+ }),
2893
+ o("path", { d: "M6 9l6 6l6 -6" })
2894
+ ], -1),
2895
+ o("span", {
2896
+ "aria-hidden": "true",
2897
+ class: "sr-only"
2898
+ }, "Previous", -1)
2899
+ ]), 8, xo),
2900
+ o("div", wo, [
2901
+ (p(!0), k(F, null, W(g.value, (u) => (p(), k("button", {
2902
+ type: "button",
2903
+ key: u,
2904
+ onClick: (t) => f(u),
2905
+ class: z(n.value === u ? "flex justify-center items-center rounded-lg text-sm dark:text-neutral-300 py-2 px-3 focus:outline-none disabled:opacity-50 disabled:pointer-events-none bg-[#e5e7eb] dark:bg-[#242424] border border-gray-200 text-base h-[38px] min-w-[38px]" : "flex justify-center items-center rounded-lg text-sm dark:text-neutral-400 hover:bg-gray-100 py-2 px-3 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 text-base h-[38px] min-w-[38px]")
2906
+ }, L(u), 11, ko))), 128))
2907
+ ]),
2908
+ o("button", {
2909
+ type: "button",
2910
+ "aria-label": "Next",
2911
+ onClick: b,
2912
+ disabled: n.value === y.value,
2913
+ class: "border-white last:rounded-e-lg text-base h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 border text-sm rounded-lg bg-white text-gray-800 hover:shadow-sm hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-700 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 py-2"
2914
+ }, c[2] || (c[2] = [
2915
+ o("span", {
2916
+ "aria-hidden": "true",
2917
+ class: "sr-only"
2918
+ }, "Next", -1),
2919
+ o("svg", {
2920
+ xmlns: "http://www.w3.org/2000/svg",
2921
+ viewBox: "0 0 24 24",
2922
+ fill: "none",
2923
+ stroke: "currentColor",
2924
+ "stroke-width": "2",
2925
+ "stroke-linecap": "round",
2926
+ "stroke-linejoin": "round",
2927
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down -rotate-90",
2928
+ height: "16",
2929
+ width: "16"
2930
+ }, [
2931
+ o("path", {
2932
+ stroke: "none",
2933
+ d: "M0 0h24v24H0z",
2934
+ fill: "none"
2935
+ }),
2936
+ o("path", { d: "M6 9l6 6l6 -6" })
2937
+ ], -1)
2938
+ ]), 8, Co)
2939
+ ]),
2940
+ o("div", _o, [
2941
+ o("div", $o, [
2942
+ O(o("div", Vo, [
2943
+ (p(), k(F, null, W([10, 20, 30], (u) => o("button", {
2944
+ type: "button",
2945
+ key: u,
2946
+ onClick: (t) => h(u),
2947
+ class: "w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 dark:focus:bg-neutral-700"
2948
+ }, [
2949
+ Y(L(u) + " ", 1),
2950
+ r.value === u ? (p(), k("svg", Bo, c[3] || (c[3] = [
2951
+ o("path", {
2952
+ stroke: "none",
2953
+ d: "M0 0h24v24H0z",
2954
+ fill: "none"
2955
+ }, null, -1),
2956
+ o("path", { d: "M5 12l5 5l10 -10" }, null, -1)
2957
+ ]))) : V("", !0)
2958
+ ], 8, So)), 64))
2959
+ ], 512), [
2960
+ [ee, v.value]
2961
+ ]),
2962
+ o("button", {
2963
+ type: "button",
2964
+ class: "py-3 px-3.5 inline-flex items-center gap-x-1 text-sm rounded-lg border border-gray-200 text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 text-base h-[38px] min-w-[38px]",
2965
+ "aria-haspopup": "menu",
2966
+ "aria-expanded": "false",
2967
+ "aria-label": "Dropdown",
2968
+ onClick: c[0] || (c[0] = (u) => v.value = !v.value)
2969
+ }, [
2970
+ Y(L(r.value) + " ", 1),
2971
+ c[4] || (c[4] = o("svg", {
2972
+ xmlns: "http://www.w3.org/2000/svg",
2973
+ viewBox: "0 0 24 24",
2974
+ fill: "none",
2975
+ stroke: "currentColor",
2976
+ "stroke-width": "2",
2977
+ "stroke-linecap": "round",
2978
+ "stroke-linejoin": "round",
2979
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down",
2980
+ height: "16",
2981
+ width: "16"
2982
+ }, [
2983
+ o("path", {
2984
+ stroke: "none",
2985
+ d: "M0 0h24v24H0z",
2986
+ fill: "none"
2987
+ }),
2988
+ o("path", { d: "M6 9l6 6l6 -6" })
2989
+ ], -1))
2990
+ ])
2991
+ ])
2992
+ ])
2993
+ ]));
2994
+ }
2995
+ }), Ao = {}, Do = {
2996
+ class: "w-48 mx-auto mb-4",
2997
+ width: "178",
2998
+ height: "90",
2999
+ viewBox: "0 0 178 90",
3000
+ fill: "none",
3001
+ xmlns: "http://www.w3.org/2000/svg"
3002
+ };
3003
+ function Ro(s, a) {
3004
+ return p(), k("svg", Do, a[0] || (a[0] = [
3005
+ Le('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-stone-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-stone-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter2)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-stone-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter2" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
3006
+ ]));
3007
+ }
3008
+ const jo = /* @__PURE__ */ X(Ao, [["render", Ro]]), zo = {}, Fo = {
3009
+ xmlns: "http://www.w3.org/2000/svg",
3010
+ width: "21",
3011
+ height: "20",
3012
+ viewBox: "0 0 24 24",
3013
+ fill: "none",
3014
+ stroke: "currentColor",
3015
+ "stroke-width": "2",
3016
+ "stroke-linecap": "round",
3017
+ "stroke-linejoin": "round",
3018
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-collapse"
3019
+ };
3020
+ function Lo(s, a) {
3021
+ return p(), k("svg", Fo, a[0] || (a[0] = [
3022
+ o("path", {
3023
+ stroke: "none",
3024
+ d: "M0 0h24v24H0z",
3025
+ fill: "none"
3026
+ }, null, -1),
3027
+ o("path", { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1),
3028
+ o("path", { d: "M15 4v16" }, null, -1),
3029
+ o("path", { d: "M9 10l2 2l-2 2" }, null, -1)
3030
+ ]));
3031
+ }
3032
+ const Ko = /* @__PURE__ */ X(zo, [["render", Lo]]), Eo = {}, To = {
3033
+ xmlns: "http://www.w3.org/2000/svg",
3034
+ width: "21",
3035
+ height: "20",
3036
+ viewBox: "0 0 24 24",
3037
+ fill: "none",
3038
+ stroke: "currentColor",
3039
+ "stroke-width": "2",
3040
+ "stroke-linecap": "round",
3041
+ "stroke-linejoin": "round",
3042
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-expand"
3043
+ };
3044
+ function Io(s, a) {
3045
+ return p(), k("svg", To, a[0] || (a[0] = [
3046
+ o("path", {
3047
+ stroke: "none",
3048
+ d: "M0 0h24v24H0z",
3049
+ fill: "none"
3050
+ }, null, -1),
3051
+ o("path", { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1),
3052
+ o("path", { d: "M15 4v16" }, null, -1),
3053
+ o("path", { d: "M10 10l-2 2l2 2" }, null, -1)
3054
+ ]));
3055
+ }
3056
+ const Oo = /* @__PURE__ */ X(Eo, [["render", Io]]), Uo = {}, Po = {
3057
+ xmlns: "http://www.w3.org/2000/svg",
3058
+ width: "24",
3059
+ height: "24",
3060
+ viewBox: "0 0 24 24",
3061
+ fill: "none",
3062
+ stroke: "currentColor",
3063
+ "stroke-width": "2",
3064
+ "stroke-linecap": "round",
3065
+ "stroke-linejoin": "round",
3066
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-map"
3067
+ };
3068
+ function Ho(s, a) {
3069
+ return p(), k("svg", Po, a[0] || (a[0] = [
3070
+ o("path", {
3071
+ stroke: "none",
3072
+ d: "M0 0h24v24H0z",
3073
+ fill: "none"
3074
+ }, null, -1),
3075
+ o("path", { d: "M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13" }, null, -1),
3076
+ o("path", { d: "M9 4v13" }, null, -1),
3077
+ o("path", { d: "M15 7v13" }, null, -1)
3078
+ ]));
3079
+ }
3080
+ const No = /* @__PURE__ */ X(Uo, [["render", Ho]]), Yo = {}, Wo = {
3081
+ xmlns: "http://www.w3.org/2000/svg",
3082
+ width: "24",
3083
+ height: "24",
3084
+ viewBox: "0 0 24 24",
3085
+ fill: "none",
3086
+ stroke: "currentColor",
3087
+ "stroke-width": "2",
3088
+ "stroke-linecap": "round",
3089
+ "stroke-linejoin": "round",
3090
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-table"
3091
+ };
3092
+ function qo(s, a) {
3093
+ return p(), k("svg", Wo, a[0] || (a[0] = [
3094
+ o("path", {
3095
+ stroke: "none",
3096
+ d: "M0 0h24v24H0z",
3097
+ fill: "none"
3098
+ }, null, -1),
3099
+ o("path", { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }, null, -1),
3100
+ o("path", { d: "M3 10h18" }, null, -1),
3101
+ o("path", { d: "M10 3v18" }, null, -1)
3102
+ ]));
3103
+ }
3104
+ const Go = /* @__PURE__ */ X(Yo, [["render", qo]]);
3105
+ function Qo(s, a) {
3106
+ let d;
3107
+ return function(...l) {
3108
+ clearTimeout(d), d = setTimeout(() => s(...l), a);
3109
+ };
3110
+ }
3111
+ function Zo(s, a, d) {
3112
+ a && (a.addSource("vector", {
3113
+ type: "vector",
3114
+ tiles: [
3115
+ `http://${window.location.host}/api/vtile/${s}/ua/{z}/{x}/{y}.vmt?pointZoom=12`
3116
+ ],
3117
+ minzoom: 0,
3118
+ maxzoom: 12
3119
+ }), a.addLayer({
3120
+ id: "vector-circle",
3121
+ type: "circle",
3122
+ maxzoom: 12,
3123
+ source: "vector",
3124
+ "source-layer": s,
3125
+ // must match the layer name in the vector tile source
3126
+ paint: {
3127
+ "circle-color": d,
3128
+ "circle-stroke-color": "#eee",
3129
+ "circle-stroke-width": 1,
3130
+ "circle-radius": ["interpolate", ["linear"], ["zoom"], 10, 5, 15, 12]
3131
+ }
3132
+ }), a.addLayer({
3133
+ id: "vector-fill",
3134
+ type: "fill",
3135
+ minzoom: 12,
3136
+ source: "vector",
3137
+ "source-layer": s,
3138
+ // must match the layer name in the vector tile source
3139
+ paint: {
3140
+ "fill-color": d,
3141
+ "fill-opacity": 0.6
3142
+ }
3143
+ }));
3144
+ }
3145
+ const ve = [
3146
+ {
3147
+ name: "voyager",
3148
+ label: "Базова карта (voyager)",
3149
+ url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
3150
+ preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/12/2422/1400.png"
3151
+ },
3152
+ {
3153
+ name: "orto",
3154
+ label: "Ортофото 10К",
3155
+ url: "https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",
3156
+ preview: "https://data.gki.com.ua/api-user/rtile/orto10/ua/12/2422/1400.png"
3157
+ },
3158
+ {
3159
+ name: "esri",
3160
+ label: "Esri ",
3161
+ url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
3162
+ preview: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/12/2422/1400.png"
3163
+ },
3164
+ {
3165
+ name: "google",
3166
+ label: "Google ",
3167
+ url: "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
3168
+ preview: "https://mt1.google.com/vt/lyrs=s&x=2422&y=1400&z=12"
3169
+ }
3170
+ ], Xo = { class: "relative w-auto h-full" }, Jo = { class: "absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border" }, en = { class: "flex justify-start items-center gap-2" }, tn = { class: "ml-1 text-[0.875rem]" }, ln = {
3171
+ class: "vs-map-slot-layers z-10 select-none",
3172
+ style: { display: "flex" }
3173
+ }, on = ["title", "onClick"], nn = ["src"], an = { class: "absolute py-2 px-4 text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg top-[-46px] hidden whitespace-nowrap left-1/2 -translate-x-1/2" }, rn = /* @__PURE__ */ N({
3174
+ __name: "map",
3175
+ props: {
3176
+ table: {},
3177
+ center: {},
3178
+ colorAttr: {},
3179
+ filter: {},
3180
+ modelValue: {},
3181
+ zoom: {},
3182
+ map: {}
3183
+ },
3184
+ emits: ["update:modelValue", "update:map"],
3185
+ setup(s, { emit: a }) {
3186
+ const d = s, l = a;
3187
+ let n, r;
3188
+ const v = $(null), y = $(!1), g = $(ve[0].name), C = ve[0], b = $(null), f = $(null), h = [
3189
+ "#2563EB",
3190
+ // Primary Blue
3191
+ "#60A5FA",
3192
+ // Sky Blue
3193
+ "#10B981",
3194
+ // Soft Green
3195
+ "#34D399",
3196
+ // Mint Green
3197
+ "#F59E0B",
3198
+ // Warm Yellow
3199
+ "#F97316",
3200
+ // Soft Orange
3201
+ "#EF4444",
3202
+ // Light Red
3203
+ "#F43F5E",
3204
+ // Rose Pink
3205
+ "#374151",
3206
+ // Dark Gray
3207
+ "#D1D5DB"
3208
+ // Light Gray
3209
+ ];
3210
+ let _;
3211
+ const c = [30, 48];
3212
+ return ue(async () => {
3213
+ _ = (await fetch(`/api/data/${d.table}/${d.colorAttr}`).then((t) => t.json())).rows, _.forEach((t, x) => {
3214
+ t.color || Object.assign(t, { color: h[x % 10] });
3215
+ }), r = new maplibregl.Popup({
3216
+ closeButton: !1,
3217
+ closeOnClick: !1
3218
+ }), n = new maplibregl.Map({
3219
+ container: v.value,
3220
+ style: {
3221
+ version: 8,
3222
+ sources: {
3223
+ [C.name]: { type: "raster", tiles: [C.url], tileSize: 256 }
3224
+ },
3225
+ layers: [{
3226
+ id: C.name,
3227
+ type: "raster",
3228
+ source: C.name,
3229
+ minzoom: 0,
3230
+ maxzoom: 19
3231
+ }]
3232
+ },
3233
+ center: d.center || c,
3234
+ // [lng, lat] → Paris
3235
+ zoom: d.zoom || 5,
3236
+ minZoom: 3,
3237
+ maxZoom: 18,
3238
+ attributionControl: !1
3239
+ }), l("update:map", n), n.addControl(new maplibregl.NavigationControl(), "top-right"), n.on("load", () => {
3240
+ n == null || n.resize(), y.value = !0;
3241
+ const t = _.filter((m) => m.id).reduce((m, i) => [i.id, i.color].concat(m), []), x = ["match", ["get", d.colorAttr], ...t, "#808080"];
3242
+ Zo(d.table, n, x);
3243
+ }), n.on("click", (t) => {
3244
+ const x = n.queryRenderedFeatures(t.point);
3245
+ x.length && l("update:modelValue", x[0].properties.id);
3246
+ }), n.on("mousemove", (t) => {
3247
+ var B;
3248
+ const x = n.queryRenderedFeatures(t.point);
3249
+ if (!x || !x.length) {
3250
+ r.remove(), n.getCanvas().style.cursor = "";
3251
+ return;
3252
+ }
3253
+ n.getCanvas().style.cursor = "pointer";
3254
+ const m = x[0], { coordinates: i } = m.geometry, w = m.geometry.type === "Point" ? i : i[0][0];
3255
+ f.value = m.properties, r.setLngLat(w).setHTML((B = b.value) == null ? void 0 : B.innerHTML).addTo(n);
3256
+ });
3257
+ }), A(() => d.center, (u) => {
3258
+ n && n.setCenter(u || c);
3259
+ }), A(() => d.zoom, (u) => {
3260
+ n && n.setZoom(u);
3261
+ }), A(() => d.filter, (u) => {
3262
+ const t = `http://${window.location.host}/api/vtile/${d.table}/ua/{z}/{x}/{y}.vmt?pointZoom=12&filter=${u}`;
3263
+ n.getSource("vector").setTiles([t]);
3264
+ }), A(g, (u, t) => {
3265
+ const x = ve.find((m) => m.name === u);
3266
+ x && (n.removeLayer(t), n.removeSource(t), n.addSource(u, { type: "raster", tiles: [x.url], tileSize: 256 }), n.addLayer({
3267
+ id: x.name,
3268
+ type: "raster",
3269
+ source: x.name,
3270
+ minzoom: 0,
3271
+ maxzoom: 19
3272
+ }, "vector-circle"));
3273
+ }), ge(() => {
3274
+ n && n.remove();
3275
+ }), (u, t) => {
3276
+ const x = qe("tooltip");
3277
+ return O((p(), k("div", Xo, [
3278
+ o("div", {
3279
+ ref_key: "mapContainer",
3280
+ ref: v,
3281
+ class: "map-container w-auto relative"
3282
+ }, null, 512),
3283
+ o("div", Jo, [
3284
+ (p(!0), k(F, null, W(e(_), (m) => (p(), k("div", {
3285
+ class: "legend-item",
3286
+ key: m.id
3287
+ }, [
3288
+ o("div", en, [
3289
+ o("div", {
3290
+ class: "w-[15px] h-[15px] rounded-[50%] min-w-[15px]",
3291
+ style: xe("background-color:" + m.color)
3292
+ }, null, 4),
3293
+ o("div", tn, L(m.text), 1)
3294
+ ])
3295
+ ]))), 128))
3296
+ ]),
3297
+ o("div", {
3298
+ ref_key: "popupDiv",
3299
+ ref: b,
3300
+ style: { display: "none" }
3301
+ }, [
3302
+ te(u.$slots, "default", { hoverData: f.value })
3303
+ ], 512),
3304
+ o("div", ln, [
3305
+ (p(!0), k(F, null, W(e(ve), (m) => O((p(), k("div", {
3306
+ key: m.name,
3307
+ title: m.label || m.name,
3308
+ class: z(["vs-map-slot-layers__layer relative", { focused: g.value === m.name }]),
3309
+ onClick: (i) => g.value = m.name
3310
+ }, [
3311
+ o("img", {
3312
+ src: m.preview,
3313
+ class: "vs-map-slot-layers__image"
3314
+ }, null, 8, nn),
3315
+ o("div", an, L(m.label), 1)
3316
+ ], 10, on)), [
3317
+ [x, m.label || m.name]
3318
+ ])), 128))
3319
+ ])
3320
+ ], 512)), [
3321
+ [ee, y.value]
3322
+ ]);
3323
+ };
3324
+ }
3325
+ }), sn = { class: "pt-[20px]" }, un = { class: "w-full gap-5 inline-flex mb-[6px] pr-3" }, dn = { class: "flex items-center" }, cn = ["title"], pn = { class: "max-[1000px]:flex gap-2 min-[1001px]:hidden" }, fn = { class: "flex" }, mn = {
3326
+ key: 0,
3327
+ class: "py-[15px] pb-[24px] pl-2"
3328
+ }, vn = { class: "font-bold text-2xl mr-[10px]" }, gn = { class: "text-sm text-stone-500 font-medium" }, yn = {
3329
+ class: "wrapperTable flex flex-col",
3330
+ style: { height: "calc(100vh - 302px)" }
3331
+ }, bn = {
3332
+ key: 1,
3333
+ class: "text-center py-28"
3334
+ }, hn = { key: 1 }, xn = {
3335
+ key: 2,
3336
+ class: "my-5 pr-2"
3337
+ }, wn = { class: "flex justify-between" }, kn = { class: "w-full lg:w-1/2 relative" }, Cn = /* @__PURE__ */ N({
3338
+ __name: "vs-parts-map",
3339
+ props: {
3340
+ title: {},
3341
+ table: {},
3342
+ map: {},
3343
+ rows: {},
3344
+ zoom: {},
3345
+ center: {},
3346
+ initTotal: {},
3347
+ colorAttr: {},
3348
+ id: {},
3349
+ filters: {},
3350
+ history: { type: Boolean }
3351
+ },
3352
+ emits: ["change:filter", "update:map"],
3353
+ setup(s, { emit: a }) {
3354
+ var G, se, oe, Me, Ae;
3355
+ function d(D) {
3356
+ return (D.type === "Point" ? D.coordinates : null) || (D.type.includes("Multi") ? D.coordinates[0][0][0] : D.coordinates[0][0]);
3357
+ }
3358
+ const l = s, n = a, r = $(0);
3359
+ r.value = l.initTotal ?? ((G = l.rows) == null ? void 0 : G.length) ?? 0;
3360
+ const v = $(""), y = $(null), g = $(!0), C = $(((se = l.rows) == null ? void 0 : se.length) === 1), b = $(0), f = $(l.rows), h = $(1), _ = $(20), c = $(l.filters || []), u = $(""), t = $({}), x = $(((oe = l.rows) == null ? void 0 : oe.length) === 1 ? l.rows[0] : {}), m = $(((Me = l.rows) == null ? void 0 : Me.length) === 1 ? l.rows[0].id : ""), i = $(((Ae = l.rows) == null ? void 0 : Ae.length) === 1 ? d(l.rows[0].geom) : l.center || null), w = $(l.zoom || 5);
3361
+ function B(D) {
3362
+ return Object.entries(D).filter(([, R]) => R).map(([R, ce]) => `${R}=${ce}`).join("|");
3363
+ }
3364
+ async function S() {
3365
+ const D = B(t.value);
3366
+ u.value = D;
3367
+ try {
3368
+ const R = {
3369
+ search: v.value,
3370
+ limit: _.value.toString(),
3371
+ page: h.value.toString(),
3372
+ filter: D
3373
+ }, ce = new URL(`/api/data/${l.table}`, window.location.origin) + (m.value ? `/${m.value}` : ""), Q = new URLSearchParams(R).toString(), pe = await fetch(`${ce.toString()}?${Q}`).then((me) => me.json());
3374
+ if (m.value) {
3375
+ const [me] = pe.rows;
3376
+ x.value = me, i.value = d(me.geom), w.value = 14, C.value = !0;
3377
+ } else
3378
+ C.value = !1, i.value = l.center || null, w.value = l.zoom || 5, f.value = pe == null ? void 0 : pe.rows;
3379
+ r.value = pe.filtered, yo({ page: h.value, filter: D, id: m.value });
3380
+ } catch (R) {
3381
+ console.error(R.message);
3382
+ }
3383
+ }
3384
+ const K = Qo(S, 300);
3385
+ function U(D) {
3386
+ _.value = D, h.value = 1, S();
3387
+ }
3388
+ function E(D) {
3389
+ h.value = D, S();
3390
+ }
3391
+ function de(D) {
3392
+ t.value = D.data, h.value = 1, m.value ? m.value = "" : S(), n("change:filter", D);
3393
+ }
3394
+ async function J() {
3395
+ if (l.filters) return;
3396
+ const R = await (await fetch(`/api/filter/${l.table}`)).json();
3397
+ c.value = R.list;
3398
+ }
3399
+ function P() {
3400
+ t.value = {}, v.value = "", S();
3401
+ }
3402
+ ue(async () => {
3403
+ b.value = window.innerWidth, b.value < 1e3 && (g.value = !1);
3404
+ const D = new URLSearchParams(window.location.search);
3405
+ h.value = Number(D.get("page")) || 1, _.value = Number(D.get("limit")) || _.value, m.value = D.get("id") || "", C.value = !!m.value, J(), !f.value && !m.value && S();
3406
+ });
3407
+ function M() {
3408
+ C.value = !1, x.value = null, m.value = "", S();
3409
+ }
3410
+ function T(D) {
3411
+ m.value = D.id;
3412
+ }
3413
+ return A(y, (D) => {
3414
+ n("update:map", D);
3415
+ }), A(v, (D) => {
3416
+ D || S();
3417
+ }), A(m, () => {
3418
+ S();
3419
+ }), (D, R) => {
3420
+ var ce;
3421
+ return p(), k("section", sn, [
3422
+ te(D.$slots, "header", {
3423
+ title: l.title,
3424
+ total: r.value
3425
+ }),
3426
+ o("div", un, [
3427
+ I(e(re), {
3428
+ type: "text",
3429
+ modelValue: v.value,
3430
+ "onUpdate:modelValue": R[0] || (R[0] = (Q) => v.value = Q),
3431
+ name: "search",
3432
+ label: "Пошук",
3433
+ onChange: e(K)
3434
+ }, null, 8, ["modelValue", "onChange"]),
3435
+ c.value.length ? (p(), j(e(he), {
3436
+ key: 0,
3437
+ schema: c.value,
3438
+ view: "inline",
3439
+ onChange: de,
3440
+ limit: 5,
3441
+ value: t.value,
3442
+ ref: "filterRef"
3443
+ }, null, 8, ["schema", "value"])) : V("", !0),
3444
+ o("div", dn, [
3445
+ o("button", {
3446
+ type: "button",
3447
+ class: "map-visible-button py-2 px-2 hidden min-[1001px]:inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100",
3448
+ title: g.value ? "Приховати карту" : "Показати карту",
3449
+ onClick: R[1] || (R[1] = (Q) => g.value = !g.value)
3450
+ }, [
3451
+ g.value ? (p(), j(Ko, { key: 0 })) : (p(), j(Oo, { key: 1 })),
3452
+ R[8] || (R[8] = o("span", { class: "sr-only" }, "Відкрити мапу", -1))
3453
+ ], 8, cn),
3454
+ o("div", pn, [
3455
+ o("button", {
3456
+ onClick: R[2] || (R[2] = (Q) => g.value = !1),
3457
+ class: "py-2 px-2 h-[38px] inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"
3458
+ }, [
3459
+ I(Go)
3460
+ ]),
3461
+ o("button", {
3462
+ onClick: R[3] || (R[3] = (Q) => g.value = !0),
3463
+ class: "py-2 px-2 h-[38px] inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"
3464
+ }, [
3465
+ I(No)
3466
+ ])
3467
+ ])
3468
+ ])
3469
+ ]),
3470
+ o("div", fn, [
3471
+ o("div", {
3472
+ class: z([
3473
+ "relative overflow-hidden shrink-0",
3474
+ g.value ? "w-2/4 mr-0" : "w-full mr-3",
3475
+ C.value ? "hidden" : ""
3476
+ ])
3477
+ }, [
3478
+ (ce = D.$slots) != null && ce.header ? V("", !0) : (p(), k("h1", mn, [
3479
+ o("span", vn, L(l.title), 1),
3480
+ o("span", gn, L(r.value), 1),
3481
+ R[9] || (R[9] = o("span", { class: "text-sm text-stone-500 font-medium" }, " об'єктів", -1))
3482
+ ])),
3483
+ o("div", yn, [
3484
+ r.value >= 1 ? te(D.$slots, "table", {
3485
+ key: 0,
3486
+ rows: f.value,
3487
+ selectRow: T
3488
+ }) : (p(), k("div", bn, [
3489
+ I(jo),
3490
+ R[10] || (R[10] = o("h2", { class: "font-medium text-base text-gray-500 rounded-xl" }, " За вашим запитом даних не знайдено! ", -1)),
3491
+ R[11] || (R[11] = o("p", { class: "font-normal text-sm text-gray-500 rounded-xl" }, " Введіть, будь ласка, інші значення для пошуку. ", -1)),
3492
+ o("button", {
3493
+ type: "button",
3494
+ class: "mt-[10px] py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",
3495
+ onClick: P
3496
+ }, " Очистити дані пошуку ")
3497
+ ]))
3498
+ ]),
3499
+ r.value >= 1 ? (p(), k("hr", hn)) : V("", !0),
3500
+ r.value >= 1 ? (p(), k("div", xn, [
3501
+ o("div", wn, [
3502
+ I(Mo, {
3503
+ total: r.value,
3504
+ currentPage: h.value ?? 1,
3505
+ pageSize: _.value,
3506
+ onPageChange: R[4] || (R[4] = (Q) => E(Q)),
3507
+ onPageSizeChange: R[5] || (R[5] = (Q) => U(Q))
3508
+ }, null, 8, ["total", "currentPage", "pageSize"])
3509
+ ])
3510
+ ])) : V("", !0)
3511
+ ], 2),
3512
+ C.value ? (p(), k("div", {
3513
+ key: 0,
3514
+ class: z(
3515
+ g.value ? "lg:static lg:w-1/2 mr-0 pb-5" : "pb-5 mr-3"
3516
+ ),
3517
+ style: { height: "calc(100vh - 152px)" }
3518
+ }, [
3519
+ te(D.$slots, "details", {
3520
+ table: l.table,
3521
+ selectedRow: x.value,
3522
+ closeObjCard: M
3523
+ })
3524
+ ], 2)) : V("", !0),
3525
+ O(o("div", kn, [
3526
+ I(rn, {
3527
+ table: l.table,
3528
+ map: y.value,
3529
+ "onUpdate:map": R[6] || (R[6] = (Q) => y.value = Q),
3530
+ zoom: w.value,
3531
+ colorAttr: l.colorAttr,
3532
+ filter: u.value,
3533
+ center: i.value,
3534
+ modelValue: m.value,
3535
+ "onUpdate:modelValue": R[7] || (R[7] = (Q) => m.value = Q)
3536
+ }, {
3537
+ default: ne(({ hoverData: Q }) => [
3538
+ te(D.$slots, "popup", { data: Q })
3539
+ ]),
3540
+ _: 3
3541
+ }, 8, ["table", "map", "zoom", "colorAttr", "filter", "center", "modelValue"]),
3542
+ te(D.$slots, "default", {
3543
+ table: l.table,
3544
+ map: y.value,
3545
+ selectedRow: x.value
3546
+ })
3547
+ ], 512), [
3548
+ [ee, g.value]
3549
+ ])
3550
+ ])
3551
+ ]);
3552
+ };
3553
+ }
3554
+ }), _n = {
3555
+ mounted(s, a) {
3556
+ if (typeof document > "u") return;
3557
+ let d = null;
3558
+ const l = () => {
3559
+ d = document.createElement("div"), d.textContent = a.value, Object.assign(d.style, {
3560
+ position: "absolute",
3561
+ background: "#333",
3562
+ color: "#fff",
3563
+ padding: "4px 8px",
3564
+ borderRadius: "4px",
3565
+ fontSize: "12px",
3566
+ whiteSpace: "nowrap",
3567
+ pointerEvents: "none",
3568
+ zIndex: "9999"
3569
+ }), document.body.appendChild(d);
3570
+ const r = s.getBoundingClientRect();
3571
+ d.style.left = `${r.left + window.scrollX}px`, d.style.top = `${r.top + window.scrollY - d.offsetHeight - 5}px`;
3572
+ }, n = () => {
3573
+ d && d.parentNode && (d.parentNode.removeChild(d), d = null);
3574
+ };
3575
+ s.addEventListener("mouseenter", l), s.addEventListener("mouseleave", n), Object.assign(s, { tooltipHandlers: { showTooltip: l, hideTooltip: n } });
3576
+ },
3577
+ unmounted(s) {
3578
+ if (typeof document > "u") return;
3579
+ const a = s.tooltipHandlers;
3580
+ a && (s.removeEventListener("mouseenter", a.showTooltip), s.removeEventListener("mouseleave", a.hideTooltip));
3581
+ }
3582
+ }, Vn = {
3583
+ install: (s) => {
3584
+ s.component("VsPartsMap", Cn), s._context.directives.tooltip || s.directive("tooltip", _n);
3585
+ }
3586
+ };
3587
+ export {
3588
+ Vn as default
3589
+ };