@opengis/gis 0.2.31 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +889 -889
- package/dist/index.umd.cjs +14 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -756,10 +756,10 @@ const wi = /* @__PURE__ */ ce(xi, [["render", _i]]), rr = {
|
|
|
756
756
|
}),
|
|
757
757
|
emits: ["update:modelValue"],
|
|
758
758
|
setup(e, { expose: t }) {
|
|
759
|
-
function n(
|
|
760
|
-
return
|
|
759
|
+
function n(M) {
|
|
760
|
+
return M.charAt(0).toUpperCase() + M.slice(1);
|
|
761
761
|
}
|
|
762
|
-
const r = st(() => import("@opengis/core").then((
|
|
762
|
+
const r = st(() => import("@opengis/core").then((M) => M.VsModal)), o = st(() => import("@opengis/form")), l = rt(e, "modelValue"), i = e, a = P({}), f = P(!1), p = P({}), _ = P(null), u = qo(), v = (M) => !!(M && u[M]);
|
|
763
763
|
t({
|
|
764
764
|
openCreateDialog: () => {
|
|
765
765
|
f.value = !0;
|
|
@@ -769,12 +769,12 @@ const wi = /* @__PURE__ */ ce(xi, [["render", _i]]), rr = {
|
|
|
769
769
|
get() {
|
|
770
770
|
return Array.isArray(l.value) ? l.value : l.value && Array.isArray(l.value.columns) ? l.value.columns : [];
|
|
771
771
|
},
|
|
772
|
-
set(
|
|
773
|
-
Array.isArray(l.value) ? l.value =
|
|
772
|
+
set(M) {
|
|
773
|
+
Array.isArray(l.value) ? l.value = M : l.value && Array.isArray(l.value.columns) && (l.value.columns = M);
|
|
774
774
|
}
|
|
775
775
|
}), d = D(() => {
|
|
776
|
-
const
|
|
777
|
-
return
|
|
776
|
+
const M = i.columnsScheme.map((S) => S.key);
|
|
777
|
+
return M.includes("name") && M.includes("label") || M.includes("id") && M.includes("label") ? [
|
|
778
778
|
{
|
|
779
779
|
key: "main",
|
|
780
780
|
label: "Назва",
|
|
@@ -790,12 +790,12 @@ const wi = /* @__PURE__ */ ce(xi, [["render", _i]]), rr = {
|
|
|
790
790
|
f.value = !1, p.value = {}, _.value = null;
|
|
791
791
|
}
|
|
792
792
|
async function h() {
|
|
793
|
-
const
|
|
794
|
-
if (
|
|
793
|
+
const M = a.value.validate();
|
|
794
|
+
if (M) {
|
|
795
795
|
je({
|
|
796
796
|
type: "warning",
|
|
797
797
|
title: "Validation",
|
|
798
|
-
message: Object.entries(
|
|
798
|
+
message: Object.entries(M).map(([S, x]) => `${S}: ${x}`).join(`
|
|
799
799
|
`)
|
|
800
800
|
});
|
|
801
801
|
return;
|
|
@@ -808,19 +808,19 @@ const wi = /* @__PURE__ */ ce(xi, [["render", _i]]), rr = {
|
|
|
808
808
|
}
|
|
809
809
|
g();
|
|
810
810
|
}
|
|
811
|
-
const y = P(null), w = P(null), E = (
|
|
812
|
-
y.value =
|
|
813
|
-
}, z = (
|
|
814
|
-
w.value =
|
|
815
|
-
}, V = (
|
|
816
|
-
if (y.value === null || y.value ===
|
|
811
|
+
const y = P(null), w = P(null), E = (M) => {
|
|
812
|
+
y.value = M;
|
|
813
|
+
}, z = (M) => {
|
|
814
|
+
w.value = M;
|
|
815
|
+
}, V = (M) => {
|
|
816
|
+
if (y.value === null || y.value === M) {
|
|
817
817
|
y.value = null, w.value = null;
|
|
818
818
|
return;
|
|
819
819
|
}
|
|
820
820
|
const S = [...c.value], [x] = S.splice(y.value, 1);
|
|
821
|
-
S.splice(
|
|
821
|
+
S.splice(M, 0, x), c.value = S, y.value = null, w.value = null;
|
|
822
822
|
};
|
|
823
|
-
return (
|
|
823
|
+
return (M, S) => (m(), b(K, null, [
|
|
824
824
|
e.addButton ? (m(), b("div", ki, [
|
|
825
825
|
s("div", $i, [
|
|
826
826
|
s("button", {
|
|
@@ -867,22 +867,22 @@ const wi = /* @__PURE__ */ ce(xi, [["render", _i]]), rr = {
|
|
|
867
867
|
])
|
|
868
868
|
]),
|
|
869
869
|
c.value.length ? (m(), b("tbody", Ei, [
|
|
870
|
-
(m(!0), b(K, null, oe(c.value, (x,
|
|
871
|
-
key: x.id || x.name ||
|
|
870
|
+
(m(!0), b(K, null, oe(c.value, (x, k) => (m(), b("tr", {
|
|
871
|
+
key: x.id || x.name || k,
|
|
872
872
|
class: we(["transition-colors hover:bg-gray-50/50 cursor-move", {
|
|
873
|
-
"opacity-50": y.value ===
|
|
874
|
-
"border-t-2 border-b-2 border-blue-500 bg-blue-50": w.value ===
|
|
873
|
+
"opacity-50": y.value === k,
|
|
874
|
+
"border-t-2 border-b-2 border-blue-500 bg-blue-50": w.value === k
|
|
875
875
|
}]),
|
|
876
876
|
draggable: "true",
|
|
877
|
-
onDragstart: (
|
|
878
|
-
onDragover: qe((
|
|
879
|
-
onDrop: (
|
|
877
|
+
onDragstart: (I) => E(k),
|
|
878
|
+
onDragover: qe((I) => z(k), ["prevent"]),
|
|
879
|
+
onDrop: (I) => V(k)
|
|
880
880
|
}, [
|
|
881
|
-
(m(!0), b(K, null, oe(d.value, (
|
|
882
|
-
key:
|
|
881
|
+
(m(!0), b(K, null, oe(d.value, (I) => (m(), b("td", {
|
|
882
|
+
key: I.key,
|
|
883
883
|
class: "px-6 py-4 align-middle text-center"
|
|
884
884
|
}, [
|
|
885
|
-
|
|
885
|
+
I.type === "main" ? (m(), b("div", Ti, [
|
|
886
886
|
S[7] || (S[7] = s("span", { class: "drag-handle cursor-move mr-2 text-gray-400" }, "☰", -1)),
|
|
887
887
|
ie(Ir)(
|
|
888
888
|
x.format === "yes/no" ? "check" : x.format || x.type
|
|
@@ -905,27 +905,27 @@ const wi = /* @__PURE__ */ ce(xi, [["render", _i]]), rr = {
|
|
|
905
905
|
s("p", ji, Y(x.label || x.ua || x.name || x.id), 1)
|
|
906
906
|
])
|
|
907
907
|
])) : (m(), b(K, { key: 1 }, [
|
|
908
|
-
|
|
908
|
+
I.slot && v(I.slot) ? Xt(M.$slots, I.slot, {
|
|
909
909
|
key: 0,
|
|
910
910
|
row: x,
|
|
911
|
-
column:
|
|
912
|
-
value: x[
|
|
913
|
-
rowIndex:
|
|
914
|
-
}, void 0, !0) :
|
|
911
|
+
column: I,
|
|
912
|
+
value: x[I.key],
|
|
913
|
+
rowIndex: k
|
|
914
|
+
}, void 0, !0) : I.type === "color" ? (m(), b("div", Oi, [
|
|
915
915
|
s("div", {
|
|
916
|
-
class: we(["w-4 h-4 rounded-full align-middle", `bg-[${x[
|
|
916
|
+
class: we(["w-4 h-4 rounded-full align-middle", `bg-[${x[I.key]}]`])
|
|
917
917
|
}, null, 2)
|
|
918
|
-
])) : ["format", "type", "meta"].includes(
|
|
919
|
-
x[
|
|
920
|
-
], 64)) : (m(), b("span", Pi, Y(x[
|
|
918
|
+
])) : ["format", "type", "meta"].includes(I.key) ? (m(), b(K, { key: 2 }, [
|
|
919
|
+
x[I.key] ? (m(), b("span", Ni, Y(x[I.key]), 1)) : (m(), b("span", zi, "Не вказано"))
|
|
920
|
+
], 64)) : (m(), b("span", Pi, Y(x[I.key]), 1))
|
|
921
921
|
], 64))
|
|
922
922
|
]))), 128)),
|
|
923
923
|
s("td", Di, [
|
|
924
924
|
le(ul, {
|
|
925
925
|
columns: c.value,
|
|
926
|
-
"onUpdate:columns": S[1] || (S[1] = (
|
|
926
|
+
"onUpdate:columns": S[1] || (S[1] = (I) => c.value = I),
|
|
927
927
|
data: x,
|
|
928
|
-
index:
|
|
928
|
+
index: k,
|
|
929
929
|
scheme: e.formScheme
|
|
930
930
|
}, null, 8, ["columns", "data", "index", "scheme"])
|
|
931
931
|
])
|
|
@@ -1136,10 +1136,10 @@ const Gi = { class: "vs-form" }, Xi = { class: "vs-form__body auto-rows-max cont
|
|
|
1136
1136
|
const w = new Set(
|
|
1137
1137
|
p.value.map((V) => Nt(V)).filter((V) => V.length > 0)
|
|
1138
1138
|
), E = Array.isArray(v.value) ? [...v.value] : [], z = o.value.filter((V) => w.has(l(V))).map((V) => {
|
|
1139
|
-
const
|
|
1139
|
+
const M = l(V), S = V.title ?? V.label ?? M;
|
|
1140
1140
|
return {
|
|
1141
1141
|
...V,
|
|
1142
|
-
name:
|
|
1142
|
+
name: M,
|
|
1143
1143
|
label: S,
|
|
1144
1144
|
type: V.type || "text",
|
|
1145
1145
|
meta: V.meta ?? "features"
|
|
@@ -2115,7 +2115,7 @@ const gs = { class: "flex justify-between p-4 pb-2 bg-slate-50 gap-4" }, hs = {
|
|
|
2115
2115
|
return `/map?layers=${d}&info=${d},${g}`;
|
|
2116
2116
|
};
|
|
2117
2117
|
return (c, d) => (m(!0), b(K, null, oe(n.value, (g) => {
|
|
2118
|
-
var h, y, w, E, z, V;
|
|
2118
|
+
var h, y, w, E, z, V, M, S, x;
|
|
2119
2119
|
return m(), b("div", {
|
|
2120
2120
|
key: g.id,
|
|
2121
2121
|
class: "bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200 hover:shadow-md"
|
|
@@ -2138,35 +2138,35 @@ const gs = { class: "flex justify-between p-4 pb-2 bg-slate-50 gap-4" }, hs = {
|
|
|
2138
2138
|
s("div", Ca, [
|
|
2139
2139
|
s("div", Aa, [
|
|
2140
2140
|
s("h3", La, Y(g[`${(w = o.value) == null ? void 0 : w.name}_text`] || g[(E = o.value) == null ? void 0 : E.name] || g[(z = o.value) == null ? void 0 : z.label] || "Не вказано"), 1),
|
|
2141
|
-
Array.isArray(l.value) && l.value.length ? (m(!0), b(K, { key: 0 }, oe(l.value, (
|
|
2142
|
-
key:
|
|
2141
|
+
Array.isArray(l.value) && l.value.length ? (m(!0), b(K, { key: 0 }, oe(l.value, (k) => (m(), b(K, {
|
|
2142
|
+
key: k.name
|
|
2143
2143
|
}, [
|
|
2144
|
-
g[
|
|
2144
|
+
g[k.name] ? (m(), b("div", Sa, Y(g[`${k.name}_text`] || g[k.name]), 1)) : W("", !0)
|
|
2145
2145
|
], 64))), 128)) : W("", !0)
|
|
2146
2146
|
]),
|
|
2147
|
-
s("p", Ea, Y(g[(V = p.value) == null ? void 0 : V.name]), 1),
|
|
2147
|
+
s("p", Ea, Y(((M = g[((V = p.value) == null ? void 0 : V.name) + "_data"]) == null ? void 0 : M.text) || g[((S = p.value) == null ? void 0 : S.name) + "_text"] || g[(x = p.value) == null ? void 0 : x.name]), 1),
|
|
2148
2148
|
s("div", Fa, [
|
|
2149
|
-
(m(!0), b(K, null, oe(a.value, (
|
|
2150
|
-
var
|
|
2149
|
+
(m(!0), b(K, null, oe(a.value, (k) => {
|
|
2150
|
+
var I;
|
|
2151
2151
|
return m(), b("div", {
|
|
2152
|
-
key:
|
|
2152
|
+
key: k.name,
|
|
2153
2153
|
class: "flex items-center"
|
|
2154
2154
|
}, [
|
|
2155
|
-
s("span", Ta, Y((
|
|
2156
|
-
|
|
2155
|
+
s("span", Ta, Y((k == null ? void 0 : k.ua) || k.label || k.name) + ":", 1),
|
|
2156
|
+
k.icon ? (m(), b("span", {
|
|
2157
2157
|
key: 0,
|
|
2158
2158
|
class: "mr-1 flex-shrink-0",
|
|
2159
|
-
innerHTML:
|
|
2159
|
+
innerHTML: k.icon
|
|
2160
2160
|
}, null, 8, Ma)) : W("", !0),
|
|
2161
2161
|
s("span", Ia, [
|
|
2162
|
-
Array.isArray(g[
|
|
2163
|
-
key:
|
|
2162
|
+
Array.isArray(g[k == null ? void 0 : k.name]) ? (m(!0), b(K, { key: 0 }, oe(g[k == null ? void 0 : k.name], (R, T) => (m(), b("span", {
|
|
2163
|
+
key: T,
|
|
2164
2164
|
class: "bg-gray-200 px-1 py-0.5 rounded-lg mr-1"
|
|
2165
|
-
}, Y(
|
|
2166
|
-
|
|
2167
|
-
me(Y(ie(Jt)(g[
|
|
2165
|
+
}, Y(R), 1))), 128)) : (m(), b(K, { key: 1 }, [
|
|
2166
|
+
k.type === "date" ? (m(), b(K, { key: 0 }, [
|
|
2167
|
+
me(Y(ie(Jt)(g[k == null ? void 0 : k.name]) || "Немає даних"), 1)
|
|
2168
2168
|
], 64)) : (m(), b(K, { key: 1 }, [
|
|
2169
|
-
me(Y(((
|
|
2169
|
+
me(Y(((I = g[(k == null ? void 0 : k.name) + "_data"]) == null ? void 0 : I.text) || g[(k == null ? void 0 : k.name) + "_text"] || g[k == null ? void 0 : k.name] || "Немає даних"), 1)
|
|
2170
2170
|
], 64))
|
|
2171
2171
|
], 64))
|
|
2172
2172
|
])
|
|
@@ -2177,11 +2177,11 @@ const gs = { class: "flex justify-between p-4 pb-2 bg-slate-50 gap-4" }, hs = {
|
|
|
2177
2177
|
s("div", ja, [
|
|
2178
2178
|
s("p", Oa, " Теги: " + Y(i.value.length && g[i.value[0].name] ? "" : "відсутні"), 1),
|
|
2179
2179
|
Array.isArray(i.value) && i.value.length ? (m(), b("div", Na, [
|
|
2180
|
-
(m(!0), b(K, null, oe(i.value, (
|
|
2181
|
-
key:
|
|
2180
|
+
(m(!0), b(K, null, oe(i.value, (k) => (m(), b("div", {
|
|
2181
|
+
key: k.name,
|
|
2182
2182
|
class: "flex flex-wrap gap-1"
|
|
2183
2183
|
}, [
|
|
2184
|
-
g[
|
|
2184
|
+
g[k.name] ? (m(), b("span", za, Y(g[`${k.name}_text`] || g[k.name]), 1)) : W("", !0)
|
|
2185
2185
|
]))), 128))
|
|
2186
2186
|
])) : W("", !0)
|
|
2187
2187
|
]),
|
|
@@ -4045,7 +4045,7 @@ function Gd(e) {
|
|
|
4045
4045
|
const d = Number(typeof v == "string" ? v.trim() : v);
|
|
4046
4046
|
return Number.isFinite(d) ? d : c;
|
|
4047
4047
|
}, p = async () => {
|
|
4048
|
-
var E, z, V,
|
|
4048
|
+
var E, z, V, M, S, x, k;
|
|
4049
4049
|
if (typeof window > "u" || t.value) return;
|
|
4050
4050
|
const v = i();
|
|
4051
4051
|
if (!v) throw new Error("Map container not found");
|
|
@@ -4060,11 +4060,11 @@ function Gd(e) {
|
|
|
4060
4060
|
...e.mapOptions || {},
|
|
4061
4061
|
container: v
|
|
4062
4062
|
};
|
|
4063
|
-
w.maxZoom == null && (w.maxZoom = h), t.value = new maplibregl.Map(w), (
|
|
4063
|
+
w.maxZoom == null && (w.maxZoom = h), t.value = new maplibregl.Map(w), (M = e.controls) != null && M.navigation && t.value.addControl(new maplibregl.NavigationControl(
|
|
4064
4064
|
typeof e.controls.navigation == "object" ? e.controls.navigation : {}
|
|
4065
4065
|
), "top-right"), (S = e.controls) != null && S.scale && t.value.addControl(new maplibregl.ScaleControl(
|
|
4066
4066
|
typeof e.controls.scale == "object" ? e.controls.scale : {}
|
|
4067
|
-
), "bottom-left"), (x = e.controls) != null && x.fullscreen && t.value.addControl(new maplibregl.FullscreenControl(), "top-right"), (
|
|
4067
|
+
), "bottom-left"), (x = e.controls) != null && x.fullscreen && t.value.addControl(new maplibregl.FullscreenControl(), "top-right"), (k = e.controls) != null && k.geolocate && t.value.addControl(new maplibregl.GeolocateControl(
|
|
4068
4068
|
typeof e.controls.geolocate == "object" ? e.controls.geolocate : {}
|
|
4069
4069
|
), "top-right"), t.value.once("load", () => {
|
|
4070
4070
|
n.value = !0, l();
|
|
@@ -4187,32 +4187,32 @@ function lf(e, t = {}) {
|
|
|
4187
4187
|
"textMinZoom",
|
|
4188
4188
|
"textZoom",
|
|
4189
4189
|
"text-zoom"
|
|
4190
|
-
]), _ = Ce(e, ["text-maxzoom", "textMaxZoom", "maxzoom"]), u = Ce(e, ["text-color", "textColor"]) || Qd, v = Ce(e, ["text-halo-color", "textHaloColor"]) || ef, c = Ce(e, ["text-halo-width", "textHaloWidth"]), d = Ce(e, ["text-halo-blur", "textHaloBlur"]), g = Ce(e, ["text-offset", "textOffset"]), h = Ce(e, ["text-anchor", "textAnchor"]), y = Ce(e, ["text-justify", "textJustify"]), w = Ce(e, ["text-letter-spacing", "textLetterSpacing"]), E = Ce(e, ["text-transform", "textTransform"]), z = Ce(e, ["symbol-placement", "symbolPlacement"]), V = Ce(e, ["symbol-spacing", "symbolSpacing"]),
|
|
4190
|
+
]), _ = Ce(e, ["text-maxzoom", "textMaxZoom", "maxzoom"]), u = Ce(e, ["text-color", "textColor"]) || Qd, v = Ce(e, ["text-halo-color", "textHaloColor"]) || ef, c = Ce(e, ["text-halo-width", "textHaloWidth"]), d = Ce(e, ["text-halo-blur", "textHaloBlur"]), g = Ce(e, ["text-offset", "textOffset"]), h = Ce(e, ["text-anchor", "textAnchor"]), y = Ce(e, ["text-justify", "textJustify"]), w = Ce(e, ["text-letter-spacing", "textLetterSpacing"]), E = Ce(e, ["text-transform", "textTransform"]), z = Ce(e, ["symbol-placement", "symbolPlacement"]), V = Ce(e, ["symbol-spacing", "symbolSpacing"]), M = Ce(e, [
|
|
4191
4191
|
"text-rotation-alignment",
|
|
4192
4192
|
"textRotationAlignment"
|
|
4193
|
-
]), S = Ce(e, ["text-pitch-alignment", "textPitchAlignment"]), x = Ce(e, ["text-opacity", "textOpacity"]),
|
|
4193
|
+
]), S = Ce(e, ["text-pitch-alignment", "textPitchAlignment"]), x = Ce(e, ["text-opacity", "textOpacity"]), k = {
|
|
4194
4194
|
"text-field": o,
|
|
4195
4195
|
"text-font": nf(i),
|
|
4196
4196
|
"text-size": a,
|
|
4197
4197
|
"text-allow-overlap": f ?? !1
|
|
4198
4198
|
};
|
|
4199
|
-
g && (
|
|
4200
|
-
const
|
|
4199
|
+
g && (k["text-offset"] = g), l !== "line" && (k["text-anchor"] = h ?? "center"), y && (k["text-justify"] = y), w !== void 0 && (k["text-letter-spacing"] = w), E && (k["text-transform"] = E), V !== void 0 && (k["symbol-spacing"] = V), l === "line" ? (k["symbol-placement"] = z || "line", k["text-rotation-alignment"] = M || "map", k["text-pitch-alignment"] = S || "map") : (M && (k["text-rotation-alignment"] = M), S && (k["text-pitch-alignment"] = S), z && (k["symbol-placement"] = z)), h && l === "line" && (k["text-anchor"] = h);
|
|
4200
|
+
const I = {
|
|
4201
4201
|
"text-color": u,
|
|
4202
4202
|
"text-opacity": x ?? 1
|
|
4203
4203
|
};
|
|
4204
|
-
|
|
4204
|
+
I["text-halo-color"] = v, c !== void 0 && (I["text-halo-width"] = c), d !== void 0 && (I["text-halo-blur"] = d);
|
|
4205
4205
|
const R = {
|
|
4206
4206
|
type: "symbol",
|
|
4207
|
-
layout:
|
|
4208
|
-
paint:
|
|
4209
|
-
},
|
|
4210
|
-
if (R.minzoom =
|
|
4211
|
-
const
|
|
4212
|
-
|
|
4207
|
+
layout: k,
|
|
4208
|
+
paint: I
|
|
4209
|
+
}, T = bn(p, tf);
|
|
4210
|
+
if (R.minzoom = T, _ !== void 0) {
|
|
4211
|
+
const A = bn(_, void 0);
|
|
4212
|
+
A !== void 0 && (R.maxzoom = A);
|
|
4213
4213
|
}
|
|
4214
|
-
const
|
|
4215
|
-
return
|
|
4214
|
+
const j = of(t.filter, t.excludeClusters);
|
|
4215
|
+
return j && (R.filter = j), [R];
|
|
4216
4216
|
}
|
|
4217
4217
|
const _n = /* @__PURE__ */ new Map(), wn = {};
|
|
4218
4218
|
function Un(e) {
|
|
@@ -4409,23 +4409,23 @@ async function wr(e, t, n) {
|
|
|
4409
4409
|
}
|
|
4410
4410
|
}
|
|
4411
4411
|
function ge(e, t, n) {
|
|
4412
|
-
var
|
|
4412
|
+
var T, j;
|
|
4413
4413
|
if (!e) return wn;
|
|
4414
4414
|
if (!t) return wn[e];
|
|
4415
|
-
const { map: r, ready: o = () => Promise.resolve() } = He(n), l = e || ((
|
|
4416
|
-
a.point && (a.source = pf(a.point)), !a.layer && ((
|
|
4415
|
+
const { map: r, ready: o = () => Promise.resolve() } = He(n), l = e || ((T = t.layer) == null ? void 0 : T.id), i = t.sourceId ?? e, a = { ...t };
|
|
4416
|
+
a.point && (a.source = pf(a.point)), !a.layer && ((j = a.source) == null ? void 0 : j.type) === "raster" && (a.layer = { id: i, type: "raster", source: i }), a.layer && !a.layer.source && Object.assign(a.layer, { source: i });
|
|
4417
4417
|
let f = !1, p = !1;
|
|
4418
4418
|
const _ = () => {
|
|
4419
|
-
var
|
|
4419
|
+
var A, U, N, O, L, F, B, Z;
|
|
4420
4420
|
if (!(p || !r.value)) {
|
|
4421
4421
|
if (a.source && !r.value.getSource(i) && r.value.addSource(i, a.source), !r.value.getLayer(l)) {
|
|
4422
|
-
const J = a.beforeId === 0 ? (U = (
|
|
4422
|
+
const J = a.beforeId === 0 ? (U = (A = r.value.getStyle().layers) == null ? void 0 : A[0]) == null ? void 0 : U.id : a.beforeId;
|
|
4423
4423
|
(O = (N = a.layer) == null ? void 0 : N.style) != null && O.icon && wr(r.value, a.layer.style.icon, a.layer.style.colors);
|
|
4424
4424
|
const G = a.style || ((L = a.layer) == null ? void 0 : L.style);
|
|
4425
4425
|
let ve = [];
|
|
4426
4426
|
if (G) {
|
|
4427
4427
|
const de = { ...G };
|
|
4428
|
-
(
|
|
4428
|
+
(F = a.layer) != null && F.filter && (de.filter = a.layer.filter);
|
|
4429
4429
|
const pe = ((B = a.source) == null ? void 0 : B.type) || ((Z = a.layer) == null ? void 0 : Z.type);
|
|
4430
4430
|
ve = _r(de, { sourceType: pe });
|
|
4431
4431
|
}
|
|
@@ -4443,130 +4443,130 @@ function ge(e, t, n) {
|
|
|
4443
4443
|
}
|
|
4444
4444
|
};
|
|
4445
4445
|
o().then(_);
|
|
4446
|
-
const u = (
|
|
4446
|
+
const u = (A, U) => r.value ? (r.value.on(A, l, U), () => {
|
|
4447
4447
|
var N;
|
|
4448
|
-
return (N = r.value) == null ? void 0 : N.off(
|
|
4448
|
+
return (N = r.value) == null ? void 0 : N.off(A, l, U);
|
|
4449
4449
|
}) : () => {
|
|
4450
|
-
}, v = (
|
|
4450
|
+
}, v = (A) => {
|
|
4451
4451
|
r.value && r.value.getStyle().layers.filter((U) => U.source === l).forEach((U) => {
|
|
4452
|
-
r.value.setLayoutProperty(U.id, "visibility",
|
|
4452
|
+
r.value.setLayoutProperty(U.id, "visibility", A ? "visible" : "none");
|
|
4453
4453
|
});
|
|
4454
|
-
}, c = (
|
|
4454
|
+
}, c = (A = !0) => {
|
|
4455
4455
|
r.value && (r.value.getStyle().layers.filter((U) => U.source === l).forEach((U) => {
|
|
4456
4456
|
r.value.removeLayer(U.id);
|
|
4457
|
-
}), p = !0, a.source &&
|
|
4458
|
-
}, d = async (
|
|
4457
|
+
}), p = !0, a.source && A && r.value.getSource(i) && r.value.removeSource(i));
|
|
4458
|
+
}, d = async (A) => {
|
|
4459
4459
|
var O, L;
|
|
4460
4460
|
if (!r.value) return;
|
|
4461
|
-
|
|
4462
|
-
const U = ((O = a.source) == null ? void 0 : O.type) || ((L = a.layer) == null ? void 0 : L.type), N =
|
|
4463
|
-
c(!1), N.forEach((
|
|
4461
|
+
A.icon && wr(r.value, A.icon, A.colors);
|
|
4462
|
+
const U = ((O = a.source) == null ? void 0 : O.type) || ((L = a.layer) == null ? void 0 : L.type), N = A ? _r(A, { sourceType: U }) : [];
|
|
4463
|
+
c(!1), N.forEach((F, B) => {
|
|
4464
4464
|
const Z = {
|
|
4465
|
-
...
|
|
4465
|
+
...F,
|
|
4466
4466
|
id: `${l}${B}`,
|
|
4467
4467
|
source: a.layer.source,
|
|
4468
4468
|
"source-layer": a.layer.source
|
|
4469
4469
|
};
|
|
4470
4470
|
r.value.addLayer(Z);
|
|
4471
4471
|
});
|
|
4472
|
-
}, g = (
|
|
4473
|
-
r.value && Object.entries(
|
|
4472
|
+
}, g = (A) => {
|
|
4473
|
+
r.value && Object.entries(A).forEach(([U, N]) => {
|
|
4474
4474
|
r.value.setPaintProperty(l, U, N);
|
|
4475
4475
|
});
|
|
4476
|
-
}, h = (
|
|
4476
|
+
}, h = (A, U, N) => {
|
|
4477
4477
|
const O = r.value;
|
|
4478
4478
|
if (O)
|
|
4479
4479
|
switch (U) {
|
|
4480
4480
|
case "raster":
|
|
4481
|
-
O.setPaintProperty(
|
|
4481
|
+
O.setPaintProperty(A, "raster-opacity", N);
|
|
4482
4482
|
break;
|
|
4483
4483
|
case "fill":
|
|
4484
|
-
O.setPaintProperty(
|
|
4484
|
+
O.setPaintProperty(A, "fill-opacity", N);
|
|
4485
4485
|
break;
|
|
4486
4486
|
case "line":
|
|
4487
|
-
O.setPaintProperty(
|
|
4487
|
+
O.setPaintProperty(A, "line-opacity", N);
|
|
4488
4488
|
break;
|
|
4489
4489
|
case "circle":
|
|
4490
|
-
O.setPaintProperty(
|
|
4490
|
+
O.setPaintProperty(A, "circle-opacity", N);
|
|
4491
4491
|
break;
|
|
4492
4492
|
case "symbol":
|
|
4493
|
-
O.setPaintProperty(
|
|
4493
|
+
O.setPaintProperty(A, "icon-opacity", N), O.setPaintProperty(A, "text-opacity", N);
|
|
4494
4494
|
break;
|
|
4495
4495
|
}
|
|
4496
|
-
},
|
|
4496
|
+
}, k = {
|
|
4497
4497
|
ids: { layerId: l, sourceId: i },
|
|
4498
4498
|
isMounted: () => {
|
|
4499
|
-
var
|
|
4500
|
-
return f && !!((
|
|
4499
|
+
var A;
|
|
4500
|
+
return f && !!((A = r.value) != null && A.getLayer(l));
|
|
4501
4501
|
},
|
|
4502
4502
|
setVisible: v,
|
|
4503
4503
|
updatePaint: g,
|
|
4504
|
-
updateLayout: (
|
|
4505
|
-
r.value && Object.entries(
|
|
4504
|
+
updateLayout: (A) => {
|
|
4505
|
+
r.value && Object.entries(A).forEach(([U, N]) => {
|
|
4506
4506
|
r.value.setLayoutProperty(l, U, N);
|
|
4507
4507
|
});
|
|
4508
4508
|
},
|
|
4509
|
-
updateFilter: (
|
|
4510
|
-
r.value && r.value.setFilter(l,
|
|
4509
|
+
updateFilter: (A) => {
|
|
4510
|
+
r.value && r.value.setFilter(l, A);
|
|
4511
4511
|
},
|
|
4512
|
-
setOpacity: (
|
|
4512
|
+
setOpacity: (A) => {
|
|
4513
4513
|
var O;
|
|
4514
4514
|
if (!r.value) return;
|
|
4515
4515
|
const N = (((O = r.value.getStyle()) == null ? void 0 : O.layers) || []).filter((L) => L.source === i);
|
|
4516
4516
|
if (!N.length) {
|
|
4517
4517
|
const L = r.value.getLayer(l);
|
|
4518
|
-
L && h(l, L.type,
|
|
4518
|
+
L && h(l, L.type, A);
|
|
4519
4519
|
return;
|
|
4520
4520
|
}
|
|
4521
|
-
N.forEach((L) => h(L.id, L.type,
|
|
4521
|
+
N.forEach((L) => h(L.id, L.type, A));
|
|
4522
4522
|
},
|
|
4523
|
-
setData: (
|
|
4523
|
+
setData: (A) => {
|
|
4524
4524
|
if (!r.value) return;
|
|
4525
4525
|
const U = r.value.getSource(i);
|
|
4526
|
-
U && "setData" in U && U.setData(
|
|
4526
|
+
U && "setData" in U && U.setData(A);
|
|
4527
4527
|
},
|
|
4528
|
-
setTiles: (
|
|
4528
|
+
setTiles: (A) => {
|
|
4529
4529
|
if (!r.value) return;
|
|
4530
4530
|
const U = r.value.getSource(i);
|
|
4531
|
-
U && "setTiles" in U && U.setTiles(
|
|
4531
|
+
U && "setTiles" in U && U.setTiles(A);
|
|
4532
4532
|
},
|
|
4533
4533
|
setStyle: d,
|
|
4534
|
-
setFilter: (
|
|
4534
|
+
setFilter: (A) => {
|
|
4535
4535
|
var N, O;
|
|
4536
4536
|
if (!r.value) return;
|
|
4537
4537
|
const U = r.value.getSource(i);
|
|
4538
4538
|
if (U && "setTiles" in U && ((O = (N = a.source) == null ? void 0 : N.tiles) != null && O[0])) {
|
|
4539
4539
|
const L = a.source.tiles[0];
|
|
4540
|
-
U.setTiles([`${L}${L.includes("?") ? "&" : "?"}filter=${
|
|
4540
|
+
U.setTiles([`${L}${L.includes("?") ? "&" : "?"}filter=${A}`]);
|
|
4541
4541
|
}
|
|
4542
4542
|
},
|
|
4543
|
-
setFeatureState: (
|
|
4544
|
-
r.value && r.value.setFeatureState({ source: i, ...
|
|
4543
|
+
setFeatureState: (A, U) => {
|
|
4544
|
+
r.value && r.value.setFeatureState({ source: i, ...A }, U);
|
|
4545
4545
|
},
|
|
4546
|
-
removeFeatureState: (
|
|
4547
|
-
r.value && r.value.removeFeatureState({ source: i, ...
|
|
4546
|
+
removeFeatureState: (A, U) => {
|
|
4547
|
+
r.value && r.value.removeFeatureState({ source: i, ...A }, U ? { key: U } : void 0);
|
|
4548
4548
|
},
|
|
4549
4549
|
remove: c,
|
|
4550
4550
|
card: a.card,
|
|
4551
4551
|
popup: a.popup,
|
|
4552
4552
|
opts: a,
|
|
4553
4553
|
getSource: () => {
|
|
4554
|
-
var
|
|
4555
|
-
return (
|
|
4554
|
+
var A;
|
|
4555
|
+
return (A = r.value) == null ? void 0 : A.getSource(i);
|
|
4556
4556
|
},
|
|
4557
4557
|
getLayer: () => {
|
|
4558
|
-
var
|
|
4559
|
-
return (
|
|
4558
|
+
var A;
|
|
4559
|
+
return (A = r.value) == null ? void 0 : A.getLayer(l);
|
|
4560
4560
|
},
|
|
4561
4561
|
on: u
|
|
4562
4562
|
};
|
|
4563
|
-
_n.set(l,
|
|
4564
|
-
const
|
|
4565
|
-
_n.get(l) ===
|
|
4566
|
-
}, R =
|
|
4567
|
-
return
|
|
4568
|
-
|
|
4569
|
-
}, ke(
|
|
4563
|
+
_n.set(l, k);
|
|
4564
|
+
const I = () => {
|
|
4565
|
+
_n.get(l) === k && _n.delete(l);
|
|
4566
|
+
}, R = k.remove;
|
|
4567
|
+
return k.remove = () => {
|
|
4568
|
+
I(), R();
|
|
4569
|
+
}, ke(k.remove), wn[e] = k, k;
|
|
4570
4570
|
}
|
|
4571
4571
|
const vf = { class: "flex flex-col flex-1 min-h-0" }, mf = { class: "flex flex-col flex-1 min-h-0" }, gf = /* @__PURE__ */ se({
|
|
4572
4572
|
__name: "vs-tab-popup",
|
|
@@ -4941,10 +4941,10 @@ const vf = { class: "flex flex-col flex-1 min-h-0" }, mf = { class: "flex flex-c
|
|
|
4941
4941
|
function v() {
|
|
4942
4942
|
var E;
|
|
4943
4943
|
const h = [...o.value], y = ((E = n.fields) == null ? void 0 : E.filter((z) => f.value.includes(z.name)).map((z) => {
|
|
4944
|
-
const { type: V, format:
|
|
4944
|
+
const { type: V, format: M, ...S } = z;
|
|
4945
4945
|
return {
|
|
4946
4946
|
...S,
|
|
4947
|
-
format:
|
|
4947
|
+
format: M ?? V ?? "text"
|
|
4948
4948
|
};
|
|
4949
4949
|
})) || [], w = Ut(h, y, {
|
|
4950
4950
|
selectedKeys: f.value,
|
|
@@ -4952,12 +4952,12 @@ const vf = { class: "flex flex-col flex-1 min-h-0" }, mf = { class: "flex flex-c
|
|
|
4952
4952
|
});
|
|
4953
4953
|
if (o.value = w, l.value === "html" && y.length) {
|
|
4954
4954
|
const z = y.map((S) => {
|
|
4955
|
-
const x = S.label ?? "",
|
|
4955
|
+
const x = S.label ?? "", k = S.name ?? S.id ?? "";
|
|
4956
4956
|
return `<dd>${x}</dd>
|
|
4957
|
-
<dt>{{ ${
|
|
4957
|
+
<dt>{{ ${k} }}</dt>`;
|
|
4958
4958
|
}).join(`
|
|
4959
|
-
`),
|
|
4960
|
-
i.value =
|
|
4959
|
+
`), M = (i.value ?? "").trimEnd();
|
|
4960
|
+
i.value = M ? `${M}
|
|
4961
4961
|
${z}` : z;
|
|
4962
4962
|
}
|
|
4963
4963
|
a.value = !1, f.value = [];
|
|
@@ -5272,7 +5272,7 @@ const Pf = { class: "map-filter" }, Df = { class: "map-filter__header" }, Rf = {
|
|
|
5272
5272
|
}), h = D(() => g.value.length > 0), y = D(() => {
|
|
5273
5273
|
var B;
|
|
5274
5274
|
return ((B = n.layer) == null ? void 0 : B.name) ?? "";
|
|
5275
|
-
}), w = D(() => g.value), E = P(null), z = D(() => g.value.length), V = D(() => z.value <= 2),
|
|
5275
|
+
}), w = D(() => g.value), E = P(null), z = D(() => g.value.length), V = D(() => z.value <= 2), M = D(() => V.value ? "body" : typeof window > "u" || E.value ? kn : "body"), S = D(() => !d.value || !V.value ? {} : {
|
|
5276
5276
|
position: "absolute",
|
|
5277
5277
|
top: `${f.top}px`,
|
|
5278
5278
|
left: `${f.left}px`,
|
|
@@ -5283,57 +5283,57 @@ const Pf = { class: "map-filter" }, Df = { class: "map-filter__header" }, Rf = {
|
|
|
5283
5283
|
function x() {
|
|
5284
5284
|
i();
|
|
5285
5285
|
}
|
|
5286
|
-
function
|
|
5286
|
+
function k(B, Z, J = 8) {
|
|
5287
5287
|
const G = window.scrollY + J, ve = window.scrollY + window.innerHeight - J;
|
|
5288
5288
|
let de = B;
|
|
5289
5289
|
return de + Z > ve && (de = ve - Z), de < G && (de = G), de;
|
|
5290
5290
|
}
|
|
5291
|
-
function
|
|
5291
|
+
function I() {
|
|
5292
5292
|
var $e, ze, Be;
|
|
5293
5293
|
if (!p.value || !V.value) return;
|
|
5294
5294
|
const B = p.value.getBoundingClientRect(), Z = window.scrollX + 8, J = window.scrollX + window.innerWidth - 8, G = (($e = _.value) == null ? void 0 : $e.offsetWidth) || 280, ve = ((ze = _.value) == null ? void 0 : ze.offsetHeight) || 0;
|
|
5295
5295
|
let de = 0, pe = 0;
|
|
5296
5296
|
if ((Be = n.catalogAnchor) != null && Be.value) {
|
|
5297
5297
|
const Ye = n.catalogAnchor.value.getBoundingClientRect(), Pe = Ye.top + window.scrollY;
|
|
5298
|
-
de =
|
|
5298
|
+
de = k(Pe, ve, 8);
|
|
5299
5299
|
const Ze = Ye.right + window.scrollX + 12, et = J - G, ot = Z;
|
|
5300
5300
|
pe = Math.min(Math.max(Ze, ot), Math.max(ot, et));
|
|
5301
5301
|
} else {
|
|
5302
5302
|
const Ye = B.bottom + window.scrollY + 8;
|
|
5303
|
-
de =
|
|
5303
|
+
de = k(Ye, ve, 8);
|
|
5304
5304
|
let Pe = B.left + window.scrollX;
|
|
5305
5305
|
Pe < Z && (Pe = Z), Pe + G > J && (Pe = Math.max(Z, J - G)), pe = Pe;
|
|
5306
5306
|
}
|
|
5307
5307
|
f.left = pe, f.top = de, f.transform = "none";
|
|
5308
5308
|
}
|
|
5309
5309
|
function R() {
|
|
5310
|
-
V.value ||
|
|
5311
|
-
|
|
5310
|
+
V.value || F(), a(), l.value && V.value && Fe(() => {
|
|
5311
|
+
I(), O(), requestAnimationFrame(() => I());
|
|
5312
5312
|
});
|
|
5313
5313
|
}
|
|
5314
|
-
function
|
|
5314
|
+
function T() {
|
|
5315
5315
|
n.disabled || R();
|
|
5316
5316
|
}
|
|
5317
5317
|
X(d, (B) => {
|
|
5318
5318
|
B && V.value ? Fe(() => {
|
|
5319
|
-
|
|
5320
|
-
}) : (L(), V.value ||
|
|
5319
|
+
I(), O(), requestAnimationFrame(() => I());
|
|
5320
|
+
}) : (L(), V.value || F());
|
|
5321
5321
|
}), X(w, () => {
|
|
5322
|
-
!d.value || !V.value || Fe(() =>
|
|
5322
|
+
!d.value || !V.value || Fe(() => I());
|
|
5323
5323
|
}, { deep: !0 }), X(V, (B) => {
|
|
5324
5324
|
d.value && (B ? Fe(() => {
|
|
5325
|
-
|
|
5326
|
-
}) : (L(),
|
|
5325
|
+
I(), O();
|
|
5326
|
+
}) : (L(), F()));
|
|
5327
5327
|
}), X(
|
|
5328
5328
|
() => n.disabled,
|
|
5329
5329
|
(B) => {
|
|
5330
5330
|
B && (i(), v.value = {});
|
|
5331
5331
|
}
|
|
5332
5332
|
);
|
|
5333
|
-
function
|
|
5334
|
-
!d.value || !V.value ||
|
|
5333
|
+
function j() {
|
|
5334
|
+
!d.value || !V.value || I();
|
|
5335
5335
|
}
|
|
5336
|
-
function
|
|
5336
|
+
function A(B) {
|
|
5337
5337
|
const Z = r.value;
|
|
5338
5338
|
if (!Z) return;
|
|
5339
5339
|
const J = ge(Z);
|
|
@@ -5353,19 +5353,19 @@ const Pf = { class: "map-filter" }, Df = { class: "map-filter__header" }, Rf = {
|
|
|
5353
5353
|
c.visible = !1;
|
|
5354
5354
|
}
|
|
5355
5355
|
Le(() => {
|
|
5356
|
-
|
|
5356
|
+
F(), window.addEventListener("resize", j), window.addEventListener("scroll", j, !0);
|
|
5357
5357
|
}), ke(() => {
|
|
5358
|
-
window.removeEventListener("resize",
|
|
5358
|
+
window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0), L();
|
|
5359
5359
|
});
|
|
5360
5360
|
function O() {
|
|
5361
5361
|
L(), !(!_.value || !V.value) && (u = new ResizeObserver(() => {
|
|
5362
|
-
!d.value || !V.value ||
|
|
5362
|
+
!d.value || !V.value || I();
|
|
5363
5363
|
}), u.observe(_.value));
|
|
5364
5364
|
}
|
|
5365
5365
|
function L() {
|
|
5366
5366
|
u && (u.disconnect(), u = null);
|
|
5367
5367
|
}
|
|
5368
|
-
function
|
|
5368
|
+
function F() {
|
|
5369
5369
|
typeof window > "u" || typeof document > "u" || (E.value = document.querySelector(kn));
|
|
5370
5370
|
}
|
|
5371
5371
|
return (B, Z) => h.value ? (m(), b("div", {
|
|
@@ -5377,7 +5377,7 @@ const Pf = { class: "map-filter" }, Df = { class: "map-filter__header" }, Rf = {
|
|
|
5377
5377
|
s("a", {
|
|
5378
5378
|
class: we(["mapLayer-filter__trigger", { "mapLayer-filter__trigger--disabled": n.disabled }]),
|
|
5379
5379
|
href: "#",
|
|
5380
|
-
onClick: qe(
|
|
5380
|
+
onClick: qe(T, ["prevent", "stop"]),
|
|
5381
5381
|
onMouseenter: U,
|
|
5382
5382
|
onMouseleave: N,
|
|
5383
5383
|
onFocus: U,
|
|
@@ -5401,7 +5401,7 @@ const Pf = { class: "map-filter" }, Df = { class: "map-filter__header" }, Rf = {
|
|
|
5401
5401
|
])], 34),
|
|
5402
5402
|
d.value ? (m(), te(gt, {
|
|
5403
5403
|
key: 0,
|
|
5404
|
-
to:
|
|
5404
|
+
to: M.value
|
|
5405
5405
|
}, [
|
|
5406
5406
|
s("div", {
|
|
5407
5407
|
class: we(["vst-popover__content inline-block z-50 rounded-[16px] bg-white text-sm text-gray-500 rounded-md shadow-lg bottom mapLayer-filter__popover", { "mapLayer-filter__popover--static": !V.value }]),
|
|
@@ -5430,7 +5430,7 @@ const Pf = { class: "map-filter" }, Df = { class: "map-filter__header" }, Rf = {
|
|
|
5430
5430
|
schema: w.value,
|
|
5431
5431
|
value: v.value,
|
|
5432
5432
|
limit: 10,
|
|
5433
|
-
onChange: Z[0] || (Z[0] = (J) =>
|
|
5433
|
+
onChange: Z[0] || (Z[0] = (J) => A(J.data)),
|
|
5434
5434
|
width: 250
|
|
5435
5435
|
}, null, 8, ["schema", "value"])
|
|
5436
5436
|
])
|
|
@@ -5723,28 +5723,28 @@ function np() {
|
|
|
5723
5723
|
}
|
|
5724
5724
|
async function h() {
|
|
5725
5725
|
await t();
|
|
5726
|
-
const
|
|
5727
|
-
|
|
5726
|
+
const T = e.value;
|
|
5727
|
+
T && (g(), d(), T.on("click", y), v = () => T.off("click", y), R(x()));
|
|
5728
5728
|
}
|
|
5729
|
-
function y(
|
|
5730
|
-
const
|
|
5731
|
-
if (!
|
|
5732
|
-
const
|
|
5729
|
+
function y(T) {
|
|
5730
|
+
const j = e.value;
|
|
5731
|
+
if (!j) return;
|
|
5732
|
+
const A = (j.queryRenderedFeatures(T.point) || []).filter((U) => {
|
|
5733
5733
|
var N;
|
|
5734
5734
|
return (N = U == null ? void 0 : U.properties) == null ? void 0 : N.id;
|
|
5735
5735
|
});
|
|
5736
|
-
if (!
|
|
5737
|
-
d(),
|
|
5736
|
+
if (!A.length) {
|
|
5737
|
+
d(), I(null);
|
|
5738
5738
|
return;
|
|
5739
5739
|
}
|
|
5740
|
-
f.value =
|
|
5740
|
+
f.value = A, p.value = 0, w(p.value);
|
|
5741
5741
|
}
|
|
5742
|
-
function w(
|
|
5743
|
-
const
|
|
5744
|
-
if (!
|
|
5745
|
-
p.value =
|
|
5746
|
-
const
|
|
5747
|
-
V(
|
|
5742
|
+
function w(T) {
|
|
5743
|
+
const j = f.value[T];
|
|
5744
|
+
if (!j) return;
|
|
5745
|
+
p.value = T;
|
|
5746
|
+
const A = ge(j.source);
|
|
5747
|
+
V(j, A == null ? void 0 : A.card);
|
|
5748
5748
|
}
|
|
5749
5749
|
function E() {
|
|
5750
5750
|
p.value >= f.value.length - 1 || w(p.value + 1);
|
|
@@ -5752,21 +5752,21 @@ function np() {
|
|
|
5752
5752
|
function z() {
|
|
5753
5753
|
p.value <= 0 || w(p.value - 1);
|
|
5754
5754
|
}
|
|
5755
|
-
async function V(
|
|
5755
|
+
async function V(T, j) {
|
|
5756
5756
|
var U, N, O, L;
|
|
5757
|
-
if (!((U =
|
|
5758
|
-
const
|
|
5759
|
-
|
|
5757
|
+
if (!((U = T == null ? void 0 : T.properties) != null && U.id)) return;
|
|
5758
|
+
const A = new URLSearchParams();
|
|
5759
|
+
A.set("layer", T.source), A.set("id", String((N = T.properties) == null ? void 0 : N.id)), a.value = !0, i.value = null, o.value = null, l.value = T || null;
|
|
5760
5760
|
try {
|
|
5761
|
-
const
|
|
5762
|
-
if (!
|
|
5763
|
-
const B = await
|
|
5761
|
+
const F = await fetch(`/api/map-format?${A.toString()}`);
|
|
5762
|
+
if (!F.ok) throw new Error(`Failed (${F.status})`);
|
|
5763
|
+
const B = await F.json(), Z = Array.isArray(B.columns) ? B.columns : [];
|
|
5764
5764
|
o.value = {
|
|
5765
5765
|
rows: B.rows || {},
|
|
5766
|
-
fields:
|
|
5766
|
+
fields: j || [],
|
|
5767
5767
|
columns: Z,
|
|
5768
5768
|
html: B.html || null
|
|
5769
|
-
}, c ||
|
|
5769
|
+
}, c || I(l.value);
|
|
5770
5770
|
const J = (O = B.rows) == null ? void 0 : O.geom;
|
|
5771
5771
|
if (J) {
|
|
5772
5772
|
const G = typeof J == "string" ? JSON.parse(J) : J;
|
|
@@ -5786,39 +5786,39 @@ function np() {
|
|
|
5786
5786
|
a.value = !1;
|
|
5787
5787
|
}
|
|
5788
5788
|
}
|
|
5789
|
-
function
|
|
5790
|
-
d(),
|
|
5789
|
+
function M() {
|
|
5790
|
+
d(), I(null);
|
|
5791
5791
|
}
|
|
5792
5792
|
function S() {
|
|
5793
5793
|
g(), d();
|
|
5794
5794
|
}
|
|
5795
5795
|
t().then(h), ke(() => S());
|
|
5796
5796
|
function x() {
|
|
5797
|
-
const
|
|
5798
|
-
return typeof
|
|
5797
|
+
const T = Array.isArray(n.query.info) ? n.query.info[0] : n.query.info;
|
|
5798
|
+
return typeof T != "string" ? null : T.trim() || null;
|
|
5799
5799
|
}
|
|
5800
|
-
function
|
|
5800
|
+
function k(T) {
|
|
5801
5801
|
var N, O;
|
|
5802
|
-
const
|
|
5803
|
-
return !
|
|
5802
|
+
const j = (T == null ? void 0 : T.source) ?? ((N = T == null ? void 0 : T.layer) == null ? void 0 : N.id), A = (O = T == null ? void 0 : T.properties) == null ? void 0 : O.id;
|
|
5803
|
+
return !j || A === void 0 || A === null ? null : `${j},${A}`.trim() || null;
|
|
5804
5804
|
}
|
|
5805
|
-
function
|
|
5806
|
-
const
|
|
5807
|
-
if (
|
|
5805
|
+
function I(T) {
|
|
5806
|
+
const j = k(T), A = x();
|
|
5807
|
+
if (j === A) return;
|
|
5808
5808
|
const U = { ...n.query };
|
|
5809
|
-
|
|
5809
|
+
j ? U.info = j : delete U.info, r.push({ query: U }).catch(() => {
|
|
5810
5810
|
});
|
|
5811
5811
|
}
|
|
5812
|
-
async function R(
|
|
5813
|
-
if (!
|
|
5812
|
+
async function R(T) {
|
|
5813
|
+
if (!T) {
|
|
5814
5814
|
d();
|
|
5815
5815
|
return;
|
|
5816
5816
|
}
|
|
5817
|
-
if (
|
|
5817
|
+
if (T === k(l.value))
|
|
5818
5818
|
return;
|
|
5819
|
-
const [
|
|
5819
|
+
const [j, A] = T.split(","), U = j == null ? void 0 : j.trim(), N = A == null ? void 0 : A.trim();
|
|
5820
5820
|
if (!U || !N) {
|
|
5821
|
-
d(),
|
|
5821
|
+
d(), I(null);
|
|
5822
5822
|
return;
|
|
5823
5823
|
}
|
|
5824
5824
|
c = !0;
|
|
@@ -5836,8 +5836,8 @@ function np() {
|
|
|
5836
5836
|
}
|
|
5837
5837
|
return X(
|
|
5838
5838
|
() => x(),
|
|
5839
|
-
(
|
|
5840
|
-
|
|
5839
|
+
(T) => {
|
|
5840
|
+
T !== k(l.value) && (c = !0, R(T).finally(() => {
|
|
5841
5841
|
c = !1;
|
|
5842
5842
|
}));
|
|
5843
5843
|
}
|
|
@@ -5847,7 +5847,7 @@ function np() {
|
|
|
5847
5847
|
cardError: i,
|
|
5848
5848
|
cardLoading: a,
|
|
5849
5849
|
isOpen: u,
|
|
5850
|
-
close:
|
|
5850
|
+
close: M,
|
|
5851
5851
|
next: E,
|
|
5852
5852
|
prev: z,
|
|
5853
5853
|
count: _,
|
|
@@ -5869,22 +5869,22 @@ function rp() {
|
|
|
5869
5869
|
opacity: 0.95
|
|
5870
5870
|
}), h = (x) => Number(x.toFixed(5)), y = async (x) => {
|
|
5871
5871
|
if (await t(), !e.value) return;
|
|
5872
|
-
const
|
|
5873
|
-
|
|
5872
|
+
const k = d(x);
|
|
5873
|
+
k && (c(), v = ge(
|
|
5874
5874
|
"feature-highlight",
|
|
5875
5875
|
{
|
|
5876
|
-
source: { type: "geojson", data:
|
|
5876
|
+
source: { type: "geojson", data: k },
|
|
5877
5877
|
style: g()
|
|
5878
5878
|
},
|
|
5879
5879
|
e
|
|
5880
5880
|
));
|
|
5881
|
-
}, w = async (x,
|
|
5882
|
-
var
|
|
5883
|
-
const [R,
|
|
5884
|
-
f.value = { x: R, y:
|
|
5881
|
+
}, w = async (x, k, I) => {
|
|
5882
|
+
var j, A;
|
|
5883
|
+
const [R, T] = [h(x), h(k)];
|
|
5884
|
+
f.value = { x: R, y: T }, p.value = I, l.value = !0, i.value = null, n.value = [], a.value = {}, o.value = 0;
|
|
5885
5885
|
try {
|
|
5886
|
-
const U =
|
|
5887
|
-
const Z = `/api/map-info-point?x=${R}&y=${
|
|
5886
|
+
const U = I.map(async (B) => {
|
|
5887
|
+
const Z = `/api/map-info-point?x=${R}&y=${T}&layers=${B}`, J = await fetch(Z);
|
|
5888
5888
|
if (!J.ok) return null;
|
|
5889
5889
|
const G = await J.json();
|
|
5890
5890
|
if (!G.count) return null;
|
|
@@ -5898,8 +5898,8 @@ function rp() {
|
|
|
5898
5898
|
n.value = O.map((B) => B.data);
|
|
5899
5899
|
const [L] = n.value;
|
|
5900
5900
|
r.value = O.reduce((B, Z) => B + (Z.count || 0), 0), a.value[0] = L;
|
|
5901
|
-
const
|
|
5902
|
-
await y(
|
|
5901
|
+
const F = ((j = L == null ? void 0 : L.data) == null ? void 0 : j.geom_4326) ?? ((A = L == null ? void 0 : L.data) == null ? void 0 : A.geom);
|
|
5902
|
+
await y(F);
|
|
5903
5903
|
} catch (U) {
|
|
5904
5904
|
i.value = U.message;
|
|
5905
5905
|
} finally {
|
|
@@ -5911,15 +5911,15 @@ function rp() {
|
|
|
5911
5911
|
n.value[x] = a.value[x];
|
|
5912
5912
|
return;
|
|
5913
5913
|
}
|
|
5914
|
-
const { x:
|
|
5914
|
+
const { x: k, y: I } = f.value, R = p.value.join(","), T = `/api/map-info-point?x=${k}&y=${I}&index=${x}&layers=${R}`;
|
|
5915
5915
|
try {
|
|
5916
5916
|
l.value = !0;
|
|
5917
|
-
const
|
|
5918
|
-
if (!
|
|
5919
|
-
const
|
|
5920
|
-
n.value[x] =
|
|
5921
|
-
} catch (
|
|
5922
|
-
i.value =
|
|
5917
|
+
const j = await fetch(T);
|
|
5918
|
+
if (!j.ok) throw new Error("Failed to fetch feature by index");
|
|
5919
|
+
const A = await j.json();
|
|
5920
|
+
n.value[x] = A, a.value[x] = A;
|
|
5921
|
+
} catch (j) {
|
|
5922
|
+
i.value = j.message;
|
|
5923
5923
|
} finally {
|
|
5924
5924
|
l.value = !1;
|
|
5925
5925
|
}
|
|
@@ -5927,37 +5927,37 @@ function rp() {
|
|
|
5927
5927
|
o.value < r.value - 1 && (o.value += 1, a.value[o.value] || await E(o.value));
|
|
5928
5928
|
}, V = async () => {
|
|
5929
5929
|
o.value > 0 && (o.value -= 1, a.value[o.value] || await E(o.value));
|
|
5930
|
-
},
|
|
5930
|
+
}, M = () => {
|
|
5931
5931
|
n.value = [], r.value = 0, o.value = 0, a.value = {}, f.value = null, p.value = [], c();
|
|
5932
5932
|
};
|
|
5933
5933
|
X(o, async () => {
|
|
5934
|
-
var
|
|
5934
|
+
var k, I;
|
|
5935
5935
|
const x = _.value;
|
|
5936
5936
|
if (x) {
|
|
5937
|
-
const R = ((
|
|
5937
|
+
const R = ((k = x == null ? void 0 : x.data) == null ? void 0 : k.geom_4326) ?? ((I = x == null ? void 0 : x.data) == null ? void 0 : I.geom);
|
|
5938
5938
|
await y(R);
|
|
5939
5939
|
}
|
|
5940
5940
|
});
|
|
5941
5941
|
let S = null;
|
|
5942
5942
|
return Le(async () => {
|
|
5943
5943
|
await t(), e.value && (S = async (x) => {
|
|
5944
|
-
const { lng:
|
|
5945
|
-
var N, O, L,
|
|
5944
|
+
const { lng: k, lat: I } = x.lngLat, R = ge(), j = Object.entries(R).map(([A, U]) => {
|
|
5945
|
+
var N, O, L, F;
|
|
5946
5946
|
return {
|
|
5947
|
-
id:
|
|
5947
|
+
id: A,
|
|
5948
5948
|
service: ((N = U == null ? void 0 : U.opts) == null ? void 0 : N.service) ?? ((L = (O = U == null ? void 0 : U.opts) == null ? void 0 : O.source) == null ? void 0 : L.service) ?? null,
|
|
5949
|
-
count: ((
|
|
5949
|
+
count: ((F = U == null ? void 0 : U.opts) == null ? void 0 : F.count) ?? null,
|
|
5950
5950
|
visible: (() => {
|
|
5951
5951
|
var B;
|
|
5952
5952
|
try {
|
|
5953
|
-
return ((B = e.value) == null ? void 0 : B.getLayer(
|
|
5953
|
+
return ((B = e.value) == null ? void 0 : B.getLayer(A)) ? e.value.getLayoutProperty(A, "visibility") !== "none" : !0;
|
|
5954
5954
|
} catch {
|
|
5955
5955
|
return !0;
|
|
5956
5956
|
}
|
|
5957
5957
|
})()
|
|
5958
5958
|
};
|
|
5959
|
-
}).filter((
|
|
5960
|
-
|
|
5959
|
+
}).filter((A) => A.service === "ogc" && A.visible).map((A) => A.id);
|
|
5960
|
+
j.length > 0 && await w(k, I, j);
|
|
5961
5961
|
}, e.value.on("dblclick", S));
|
|
5962
5962
|
}), ke(() => {
|
|
5963
5963
|
e.value && S && e.value.off("dblclick", S), c();
|
|
@@ -5971,7 +5971,7 @@ function rp() {
|
|
|
5971
5971
|
active: u,
|
|
5972
5972
|
next: z,
|
|
5973
5973
|
prev: V,
|
|
5974
|
-
close:
|
|
5974
|
+
close: M
|
|
5975
5975
|
};
|
|
5976
5976
|
}
|
|
5977
5977
|
const kr = /* @__PURE__ */ se({
|
|
@@ -6170,77 +6170,77 @@ const sp = {
|
|
|
6170
6170
|
setup(e) {
|
|
6171
6171
|
var nn, Gn;
|
|
6172
6172
|
const t = e, n = np(), r = rp(), o = D(() => r.active.value), l = D(() => o.value || n.isOpen.value), i = D(() => o.value ? r.loading.value : n.cardLoading.value), a = D(() => o.value ? r.error.value : n.cardError.value), f = D(() => {
|
|
6173
|
-
var
|
|
6174
|
-
return o.value ? ((
|
|
6173
|
+
var $, C;
|
|
6174
|
+
return o.value ? (($ = r.current.value) == null ? void 0 : $.html) || null : ((C = n.card.value) == null ? void 0 : C.html) || null;
|
|
6175
6175
|
}), p = He(), _ = Rt(), {
|
|
6176
6176
|
activateTemporaryLayer: u,
|
|
6177
6177
|
deactivateTemporaryLayer: v,
|
|
6178
6178
|
clearTemporaryLayers: c,
|
|
6179
6179
|
isTemporaryLayerActive: d
|
|
6180
6180
|
} = Lo(p.map);
|
|
6181
|
-
function g(
|
|
6182
|
-
window.dispatchEvent(new CustomEvent(Np, { detail:
|
|
6181
|
+
function g($) {
|
|
6182
|
+
window.dispatchEvent(new CustomEvent(Np, { detail: $ }));
|
|
6183
6183
|
}
|
|
6184
6184
|
const h = D(() => {
|
|
6185
|
-
var
|
|
6186
|
-
return ((
|
|
6185
|
+
var $;
|
|
6186
|
+
return (($ = n.cardFeature.value) == null ? void 0 : $.source) ?? null;
|
|
6187
6187
|
}), y = D(() => h.value ? `map-card:${h.value}` : "map-card"), w = D(() => {
|
|
6188
6188
|
var ne, fe;
|
|
6189
|
-
const
|
|
6190
|
-
return
|
|
6191
|
-
}), E = P(null), z = P(null), V = P(0),
|
|
6189
|
+
const $ = n.cardFeature.value, C = ($ == null ? void 0 : $.source) || ((ne = $ == null ? void 0 : $.layer) == null ? void 0 : ne.id), H = ((fe = $ == null ? void 0 : $.properties) == null ? void 0 : fe.id) ?? ($ == null ? void 0 : $.id);
|
|
6190
|
+
return C && H != null ? `${C}:${H}` : null;
|
|
6191
|
+
}), E = P(null), z = P(null), V = P(0), M = /* @__PURE__ */ new Map();
|
|
6192
6192
|
function S() {
|
|
6193
6193
|
if (typeof window > "u") return null;
|
|
6194
|
-
const
|
|
6195
|
-
return
|
|
6194
|
+
const C = (window.location.pathname || "").match(/\/maps?\/([^/]+)/i);
|
|
6195
|
+
return C && C[1] ? C[1] : null;
|
|
6196
6196
|
}
|
|
6197
6197
|
const x = D(() => {
|
|
6198
|
-
const
|
|
6199
|
-
if (k.length) return k;
|
|
6200
|
-
const $ = typeof _.params.slug == "string" ? _.params.slug.trim() : "";
|
|
6198
|
+
const $ = typeof t.mapId == "string" ? t.mapId.trim() : "";
|
|
6201
6199
|
if ($.length) return $;
|
|
6200
|
+
const C = typeof _.params.slug == "string" ? _.params.slug.trim() : "";
|
|
6201
|
+
if (C.length) return C;
|
|
6202
6202
|
const H = typeof _.query.slug == "string" ? _.query.slug.trim() : "";
|
|
6203
6203
|
return H.length ? H : S();
|
|
6204
|
-
}),
|
|
6205
|
-
function
|
|
6206
|
-
const
|
|
6207
|
-
if (
|
|
6208
|
-
const H = Array.from(
|
|
6204
|
+
}), k = P(null), I = P(null), R = /* @__PURE__ */ new Map();
|
|
6205
|
+
function T($) {
|
|
6206
|
+
const C = $.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
|
6207
|
+
if (C) return C;
|
|
6208
|
+
const H = Array.from($).map((ne) => ne.charCodeAt(0).toString(16)).join("").slice(0, 8);
|
|
6209
6209
|
return H ? `layer-${H}` : `layer-${Math.random().toString(36).slice(2, 8)}`;
|
|
6210
6210
|
}
|
|
6211
|
-
function
|
|
6212
|
-
if (typeof
|
|
6213
|
-
const
|
|
6214
|
-
if (
|
|
6215
|
-
if (/^https?:\/\//i.test(
|
|
6216
|
-
if (
|
|
6217
|
-
return typeof window > "u" ? `https:${
|
|
6211
|
+
function j($) {
|
|
6212
|
+
if (typeof $ != "string") return "";
|
|
6213
|
+
const C = $.trim();
|
|
6214
|
+
if (!C) return "";
|
|
6215
|
+
if (/^https?:\/\//i.test(C)) return C;
|
|
6216
|
+
if (C.startsWith("//"))
|
|
6217
|
+
return typeof window > "u" ? `https:${C}` : `${window.location.protocol}${C}`;
|
|
6218
6218
|
const H = typeof window < "u" ? window.location.origin : "";
|
|
6219
|
-
return
|
|
6219
|
+
return C.startsWith("/") ? H ? `${H}${C}` : C : H ? `${H}/${C}` : C;
|
|
6220
6220
|
}
|
|
6221
|
-
function
|
|
6222
|
-
const
|
|
6221
|
+
function A($) {
|
|
6222
|
+
const C = {}, H = /([:@\w-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;
|
|
6223
6223
|
let ne;
|
|
6224
|
-
for (; (ne = H.exec(
|
|
6224
|
+
for (; (ne = H.exec($)) !== null; ) {
|
|
6225
6225
|
const fe = ne[1], he = ne[2] ?? ne[3] ?? ne[4] ?? "";
|
|
6226
|
-
fe && (
|
|
6226
|
+
fe && (C[fe] = he);
|
|
6227
6227
|
}
|
|
6228
|
-
return
|
|
6228
|
+
return C;
|
|
6229
6229
|
}
|
|
6230
|
-
function U(
|
|
6231
|
-
for (const H of
|
|
6232
|
-
if (
|
|
6233
|
-
return String(
|
|
6230
|
+
function U($, C) {
|
|
6231
|
+
for (const H of C)
|
|
6232
|
+
if ($[H] != null && String($[H]).trim().length)
|
|
6233
|
+
return String($[H]).trim();
|
|
6234
6234
|
return "";
|
|
6235
6235
|
}
|
|
6236
|
-
function N(
|
|
6237
|
-
if (!(
|
|
6238
|
-
const
|
|
6239
|
-
return Number.isFinite(
|
|
6236
|
+
function N($) {
|
|
6237
|
+
if (!($ != null && $.length)) return;
|
|
6238
|
+
const C = Number($);
|
|
6239
|
+
return Number.isFinite(C) ? C : void 0;
|
|
6240
6240
|
}
|
|
6241
|
-
function O(
|
|
6242
|
-
if (typeof
|
|
6243
|
-
const
|
|
6241
|
+
function O($) {
|
|
6242
|
+
if (typeof $ != "string" || !$.length) return [];
|
|
6243
|
+
const C = [], H = /<LayerSwitcher\b([^>]*)>([\s\S]*?)<\/LayerSwitcher>/gi;
|
|
6244
6244
|
let ne = 0, fe;
|
|
6245
6245
|
const he = /* @__PURE__ */ new Set(), xe = (_e) => {
|
|
6246
6246
|
let Te = _e, nt = 2;
|
|
@@ -6248,19 +6248,19 @@ const sp = {
|
|
|
6248
6248
|
Te = `${_e}-${nt}`, nt += 1;
|
|
6249
6249
|
return he.add(Te), Te;
|
|
6250
6250
|
};
|
|
6251
|
-
for (; (fe = H.exec(
|
|
6251
|
+
for (; (fe = H.exec($)) !== null; ) {
|
|
6252
6252
|
const [_e, Te = "", nt = ""] = fe, Ie = fe.index;
|
|
6253
6253
|
if (Ie > ne) {
|
|
6254
|
-
const Qn =
|
|
6255
|
-
Qn.trim().length &&
|
|
6254
|
+
const Qn = $.slice(ne, Ie);
|
|
6255
|
+
Qn.trim().length && C.push({ type: "html", content: Qn });
|
|
6256
6256
|
}
|
|
6257
|
-
const Ge =
|
|
6257
|
+
const Ge = A(Te), Ve = U(Ge, ["title"]) || "Тимчасовий шар", vt = j(U(Ge, ["url"]));
|
|
6258
6258
|
if (!vt) {
|
|
6259
|
-
|
|
6259
|
+
C.push({ type: "html", content: _e }), ne = Ie + _e.length;
|
|
6260
6260
|
continue;
|
|
6261
6261
|
}
|
|
6262
|
-
const qt = U(Ge, ["id"]), vn = U(Ge, ["button-text", "buttonText", "show", "show-label", "showLabel"]), zo = N(U(Ge, ["tile-size", "tileSize"])), Po = N(U(Ge, ["minzoom", "minZoom"])), Do = N(U(Ge, ["maxzoom", "maxZoom"])), Ro = N(U(Ge, ["opacity"])), Bo = qt ||
|
|
6263
|
-
|
|
6262
|
+
const qt = U(Ge, ["id"]), vn = U(Ge, ["button-text", "buttonText", "show", "show-label", "showLabel"]), zo = N(U(Ge, ["tile-size", "tileSize"])), Po = N(U(Ge, ["minzoom", "minZoom"])), Do = N(U(Ge, ["maxzoom", "maxZoom"])), Ro = N(U(Ge, ["opacity"])), Bo = qt || T(`${Ve}-${vt}`) || T(Ve), Xn = xe(Bo || `layer-${C.length + 1}`), mn = nt.trim(), Jn = /<[^>]+>/.test(mn), Vo = Jn ? mn : null, gn = Jn ? null : mn, Uo = vn && vn.trim().length ? vn.trim() : gn && gn.trim().length ? gn.trim() : void 0;
|
|
6263
|
+
C.push({
|
|
6264
6264
|
type: "layer",
|
|
6265
6265
|
spec: {
|
|
6266
6266
|
id: Xn,
|
|
@@ -6280,76 +6280,76 @@ const sp = {
|
|
|
6280
6280
|
slotText: Vo
|
|
6281
6281
|
}), ne = Ie + _e.length;
|
|
6282
6282
|
}
|
|
6283
|
-
if (ne <
|
|
6284
|
-
const _e =
|
|
6285
|
-
_e.trim().length &&
|
|
6283
|
+
if (ne < $.length) {
|
|
6284
|
+
const _e = $.slice(ne);
|
|
6285
|
+
_e.trim().length && C.push({ type: "html", content: _e });
|
|
6286
6286
|
}
|
|
6287
|
-
return
|
|
6288
|
-
}
|
|
6289
|
-
function L(
|
|
6290
|
-
if (
|
|
6291
|
-
const
|
|
6292
|
-
return
|
|
6293
|
-
id:
|
|
6294
|
-
title: H ||
|
|
6287
|
+
return !C.length && $.trim().length && C.push({ type: "html", content: $ }), C;
|
|
6288
|
+
}
|
|
6289
|
+
function L($) {
|
|
6290
|
+
if (!$) return null;
|
|
6291
|
+
const C = typeof $.id == "string" ? $.id.trim() : "", H = typeof $.title == "string" ? $.title.trim() : "", ne = j(typeof $.url == "string" ? $.url : "");
|
|
6292
|
+
return !C || !ne ? null : {
|
|
6293
|
+
id: C,
|
|
6294
|
+
title: H || C,
|
|
6295
6295
|
url: ne,
|
|
6296
|
-
tileSize:
|
|
6297
|
-
minzoom:
|
|
6298
|
-
maxzoom:
|
|
6299
|
-
opacity:
|
|
6296
|
+
tileSize: $.tileSize,
|
|
6297
|
+
minzoom: $.minzoom,
|
|
6298
|
+
maxzoom: $.maxzoom,
|
|
6299
|
+
opacity: $.opacity
|
|
6300
6300
|
};
|
|
6301
6301
|
}
|
|
6302
|
-
const
|
|
6302
|
+
const F = D(() => {
|
|
6303
6303
|
if (o.value && r.current.value)
|
|
6304
6304
|
return r.current.value.data ?? {};
|
|
6305
|
-
const
|
|
6306
|
-
return (
|
|
6305
|
+
const $ = n.card.value;
|
|
6306
|
+
return ($ == null ? void 0 : $.rows) ?? {};
|
|
6307
6307
|
}), B = D(() => {
|
|
6308
6308
|
if (o.value && r.current.value)
|
|
6309
6309
|
return r.current.value.fields ?? [];
|
|
6310
|
-
const
|
|
6311
|
-
if (
|
|
6312
|
-
const
|
|
6313
|
-
if (
|
|
6310
|
+
const $ = n.card.value;
|
|
6311
|
+
if (!$) return [];
|
|
6312
|
+
const C = Array.isArray($.columns) ? $.columns : [], H = Array.isArray($.fields) ? $.fields : [];
|
|
6313
|
+
if (!C.length)
|
|
6314
6314
|
return H;
|
|
6315
6315
|
const ne = /* @__PURE__ */ new Set(), fe = [], he = (xe) => {
|
|
6316
6316
|
const _e = typeof (xe == null ? void 0 : xe.name) == "string" ? xe.name.trim() : "";
|
|
6317
6317
|
!_e || ne.has(_e) || (ne.add(_e), fe.push(xe));
|
|
6318
6318
|
};
|
|
6319
|
-
return
|
|
6319
|
+
return C.forEach(he), H.forEach(he), fe;
|
|
6320
6320
|
}), Z = D(() => {
|
|
6321
|
-
const
|
|
6322
|
-
if (
|
|
6323
|
-
const
|
|
6324
|
-
return
|
|
6321
|
+
const $ = B.value;
|
|
6322
|
+
if (!$.length) return [];
|
|
6323
|
+
const C = F.value;
|
|
6324
|
+
return $.map((H) => ({
|
|
6325
6325
|
key: H.name,
|
|
6326
6326
|
label: H.ua || H.label || H.title || H.name,
|
|
6327
|
-
value:
|
|
6327
|
+
value: C[H.name] ?? "—",
|
|
6328
6328
|
format: H.format || "text"
|
|
6329
6329
|
}));
|
|
6330
6330
|
}), J = /* @__PURE__ */ new Set(["—", "-", "–", "−"]);
|
|
6331
|
-
function G(
|
|
6332
|
-
if (
|
|
6333
|
-
if (typeof
|
|
6334
|
-
const
|
|
6335
|
-
return
|
|
6331
|
+
function G($) {
|
|
6332
|
+
if ($ == null) return !0;
|
|
6333
|
+
if (typeof $ == "string") {
|
|
6334
|
+
const C = $.trim();
|
|
6335
|
+
return C.length ? J.has(C) : !0;
|
|
6336
6336
|
}
|
|
6337
6337
|
return !1;
|
|
6338
6338
|
}
|
|
6339
6339
|
const ve = P(!1), de = P(!0);
|
|
6340
6340
|
if (typeof window < "u") {
|
|
6341
|
-
const
|
|
6342
|
-
ve.value =
|
|
6341
|
+
const $ = (Gn = (nn = window.localStorage) == null ? void 0 : nn.getItem) == null ? void 0 : Gn.call(nn, "cardHideEmpty"), C = typeof $ == "string" && $.toLowerCase() === "true";
|
|
6342
|
+
ve.value = C, de.value = !C;
|
|
6343
6343
|
}
|
|
6344
6344
|
const pe = D(
|
|
6345
|
-
() => Z.value.filter((
|
|
6346
|
-
), $e = D(() => ve.value && !de.value ? Z.value.filter((
|
|
6347
|
-
function ze(
|
|
6348
|
-
const
|
|
6349
|
-
if (
|
|
6345
|
+
() => Z.value.filter(($) => G($.value)).length
|
|
6346
|
+
), $e = D(() => ve.value && !de.value ? Z.value.filter(($) => !G($.value)) : Z.value);
|
|
6347
|
+
function ze($) {
|
|
6348
|
+
const C = typeof $ == "string" ? $ : "";
|
|
6349
|
+
if (!C.length) return { sanitized: "", hiddenCount: 0 };
|
|
6350
6350
|
if (typeof DOMParser > "u")
|
|
6351
|
-
return { sanitized:
|
|
6352
|
-
const ne = new DOMParser().parseFromString(
|
|
6351
|
+
return { sanitized: C, hiddenCount: 0 };
|
|
6352
|
+
const ne = new DOMParser().parseFromString(C, "text/html");
|
|
6353
6353
|
let fe = 0;
|
|
6354
6354
|
return ne.querySelectorAll("dd").forEach((he) => {
|
|
6355
6355
|
var Te;
|
|
@@ -6362,8 +6362,8 @@ const sp = {
|
|
|
6362
6362
|
}
|
|
6363
6363
|
const Be = D(() => ze(f.value)), Ye = D(() => f.value ? Be.value.hiddenCount : 0), Pe = D(() => pe.value + Ye.value), Ze = D(
|
|
6364
6364
|
() => {
|
|
6365
|
-
var
|
|
6366
|
-
return ve.value && !de.value && !!((
|
|
6365
|
+
var $;
|
|
6366
|
+
return ve.value && !de.value && !!(($ = f.value) != null && $.trim());
|
|
6367
6367
|
}
|
|
6368
6368
|
), et = D(
|
|
6369
6369
|
() => ve.value && Pe.value > 0
|
|
@@ -6374,12 +6374,12 @@ const sp = {
|
|
|
6374
6374
|
de.value = !de.value;
|
|
6375
6375
|
}
|
|
6376
6376
|
const xt = D(() => {
|
|
6377
|
-
const
|
|
6378
|
-
return O(
|
|
6379
|
-
}), At = D(() => xt.value.filter((
|
|
6380
|
-
function q(
|
|
6381
|
-
return Array.isArray(
|
|
6382
|
-
const ne =
|
|
6377
|
+
const $ = Ze.value ? Be.value.sanitized : f.value ?? "";
|
|
6378
|
+
return O($);
|
|
6379
|
+
}), At = D(() => xt.value.filter(($) => $.type === "layer"));
|
|
6380
|
+
function q($) {
|
|
6381
|
+
return Array.isArray($) ? $.map((C, H) => {
|
|
6382
|
+
const ne = j(typeof (C == null ? void 0 : C.url) == "string" ? C.url : ""), fe = typeof (C == null ? void 0 : C.geohub) == "string" && C.geohub.trim().length ? `/api-hub/tms/${C.geohub.trim()}/ua/{z}/{x}/{y}.png` : "", he = ((C == null ? void 0 : C.name) || (C == null ? void 0 : C.title) || (C == null ? void 0 : C.label) || `Шар ${H + 1}`).toString(), xe = (C == null ? void 0 : C.id) != null ? String(C.id) : T(`${he}-${H + 1}`), _e = (C == null ? void 0 : C.buttonText) || (C == null ? void 0 : C.button_text) || null, Te = (C == null ? void 0 : C.description) || (C == null ? void 0 : C.subtitle) || null, nt = ne || j(fe) || "";
|
|
6383
6383
|
if (!nt) return null;
|
|
6384
6384
|
const Ie = {
|
|
6385
6385
|
id: xe,
|
|
@@ -6388,16 +6388,16 @@ const sp = {
|
|
|
6388
6388
|
subtitle: Te,
|
|
6389
6389
|
buttonText: _e || void 0
|
|
6390
6390
|
};
|
|
6391
|
-
return typeof (
|
|
6391
|
+
return typeof (C == null ? void 0 : C.tileSize) == "number" && (Ie.tileSize = C.tileSize), typeof (C == null ? void 0 : C.tile_size) == "number" && (Ie.tileSize = C.tile_size), typeof (C == null ? void 0 : C.minzoom) == "number" && (Ie.minzoom = C.minzoom), typeof (C == null ? void 0 : C.maxzoom) == "number" && (Ie.maxzoom = C.maxzoom), typeof (C == null ? void 0 : C.opacity) == "number" && (Ie.opacity = C.opacity), Ie;
|
|
6392
6392
|
}).filter(Boolean) : [];
|
|
6393
6393
|
}
|
|
6394
6394
|
const Q = D(() => {
|
|
6395
6395
|
var ne, fe;
|
|
6396
|
-
const
|
|
6397
|
-
(ne =
|
|
6398
|
-
|
|
6399
|
-
(fe =
|
|
6400
|
-
|
|
6396
|
+
const $ = n.card.value, C = r.current.value, H = [
|
|
6397
|
+
(ne = $ == null ? void 0 : $.rows) == null ? void 0 : ne.layers,
|
|
6398
|
+
$ == null ? void 0 : $.layers,
|
|
6399
|
+
(fe = C == null ? void 0 : C.data) == null ? void 0 : fe.layers,
|
|
6400
|
+
C == null ? void 0 : C.layers
|
|
6401
6401
|
];
|
|
6402
6402
|
for (const he of H) {
|
|
6403
6403
|
const xe = q(he);
|
|
@@ -6409,72 +6409,72 @@ const sp = {
|
|
|
6409
6409
|
() => xt.value.length > 0 || Z.value.length > 0 || Q.value.length > 0
|
|
6410
6410
|
);
|
|
6411
6411
|
function ye() {
|
|
6412
|
-
const
|
|
6413
|
-
if (
|
|
6414
|
-
typeof ne == "string" && (
|
|
6415
|
-
}), h.value && (
|
|
6416
|
-
const H = typeof (
|
|
6417
|
-
|
|
6412
|
+
const $ = {}, C = k.value;
|
|
6413
|
+
if (C && typeof C == "object" && Object.entries(C).forEach(([H, ne]) => {
|
|
6414
|
+
typeof ne == "string" && ($[H] = ne);
|
|
6415
|
+
}), h.value && ($.layer = h.value), !$.geohub) {
|
|
6416
|
+
const H = typeof (C == null ? void 0 : C.geohub) == "string" ? C.geohub : null, ne = typeof (C == null ? void 0 : C.geohub_key) == "string" ? C.geohub_key : null, fe = typeof (C == null ? void 0 : C.geohubId) == "string" ? C.geohubId : null;
|
|
6417
|
+
$.geohub = H || ne || fe || $.layer || "";
|
|
6418
6418
|
}
|
|
6419
|
-
return
|
|
6419
|
+
return $;
|
|
6420
6420
|
}
|
|
6421
6421
|
async function ae() {
|
|
6422
|
-
const
|
|
6423
|
-
if (
|
|
6424
|
-
return
|
|
6425
|
-
if (
|
|
6426
|
-
return
|
|
6427
|
-
if (R.has(
|
|
6428
|
-
const
|
|
6429
|
-
return
|
|
6422
|
+
const $ = h.value;
|
|
6423
|
+
if (!$)
|
|
6424
|
+
return k.value = null, I.value = null, null;
|
|
6425
|
+
if (I.value === $ && k.value)
|
|
6426
|
+
return k.value;
|
|
6427
|
+
if (R.has($)) {
|
|
6428
|
+
const C = R.get($);
|
|
6429
|
+
return k.value = C, I.value = $, C;
|
|
6430
6430
|
}
|
|
6431
6431
|
try {
|
|
6432
|
-
const
|
|
6433
|
-
if (
|
|
6432
|
+
const C = await fetch(`/api/gis-service/${encodeURIComponent($)}`);
|
|
6433
|
+
if (!C.ok)
|
|
6434
6434
|
return null;
|
|
6435
|
-
const H = await
|
|
6436
|
-
return R.set(
|
|
6435
|
+
const H = await C.json();
|
|
6436
|
+
return R.set($, H), k.value = H, I.value = $, H;
|
|
6437
6437
|
} catch {
|
|
6438
6438
|
return null;
|
|
6439
6439
|
}
|
|
6440
6440
|
}
|
|
6441
|
-
async function be(
|
|
6442
|
-
if (!(
|
|
6441
|
+
async function be($) {
|
|
6442
|
+
if (!($ != null && $.id)) return;
|
|
6443
6443
|
await ae();
|
|
6444
|
-
const
|
|
6444
|
+
const C = ye(), H = At.value.find((xe) => xe.spec.id === $.id), ne = Q.value.find((xe) => xe.id === $.id), fe = (H == null ? void 0 : H.spec) || L(ne) || L($);
|
|
6445
6445
|
if (!fe || d(fe.id, y.value))
|
|
6446
6446
|
return;
|
|
6447
6447
|
const he = y.value || void 0;
|
|
6448
|
-
E.value = he ?? null, u(fe,
|
|
6448
|
+
E.value = he ?? null, u(fe, C, he), g({
|
|
6449
6449
|
action: "activate",
|
|
6450
6450
|
owner: he,
|
|
6451
6451
|
spec: fe,
|
|
6452
|
-
context:
|
|
6452
|
+
context: C
|
|
6453
6453
|
});
|
|
6454
6454
|
}
|
|
6455
|
-
function Ee(
|
|
6456
|
-
if (
|
|
6457
|
-
const
|
|
6458
|
-
v(
|
|
6455
|
+
function Ee($) {
|
|
6456
|
+
if (!$) return;
|
|
6457
|
+
const C = Ke() || void 0;
|
|
6458
|
+
v($, C), g({
|
|
6459
6459
|
action: "deactivate",
|
|
6460
|
-
owner:
|
|
6461
|
-
spec: { id:
|
|
6460
|
+
owner: C,
|
|
6461
|
+
spec: { id: $ }
|
|
6462
6462
|
});
|
|
6463
6463
|
}
|
|
6464
|
-
function ee(
|
|
6465
|
-
return d(
|
|
6464
|
+
function ee($) {
|
|
6465
|
+
return d($, Ke());
|
|
6466
6466
|
}
|
|
6467
|
-
function We(
|
|
6468
|
-
const H =
|
|
6469
|
-
!!(H != null && H.checked) ? be(
|
|
6467
|
+
function We($, C) {
|
|
6468
|
+
const H = C.target;
|
|
6469
|
+
!!(H != null && H.checked) ? be($) : Ee($.id);
|
|
6470
6470
|
}
|
|
6471
6471
|
function Ke() {
|
|
6472
6472
|
return E.value || y.value || null;
|
|
6473
6473
|
}
|
|
6474
6474
|
X(
|
|
6475
6475
|
h,
|
|
6476
|
-
(
|
|
6477
|
-
|
|
6476
|
+
($, C) => {
|
|
6477
|
+
$ !== C && (k.value = null, I.value = null);
|
|
6478
6478
|
}
|
|
6479
6479
|
);
|
|
6480
6480
|
const {
|
|
@@ -6484,16 +6484,16 @@ const sp = {
|
|
|
6484
6484
|
index: lt
|
|
6485
6485
|
} = r, ct = D(() => n.count.value), dt = D(() => n.index.value), Lt = D(() => ct.value > 1), Hn = D(() => o.value ? ut.value : ct.value), Yn = D(() => o.value ? lt.value : dt.value), Zn = n.next, Wn = n.prev;
|
|
6486
6486
|
function bt() {
|
|
6487
|
-
const
|
|
6488
|
-
|
|
6487
|
+
const $ = Ke();
|
|
6488
|
+
$ && (c($), g({ action: "clear", owner: $ }), E.value = null);
|
|
6489
6489
|
}
|
|
6490
6490
|
function To() {
|
|
6491
6491
|
n.close(), r.close(), bt();
|
|
6492
6492
|
}
|
|
6493
6493
|
X(
|
|
6494
6494
|
l,
|
|
6495
|
-
(
|
|
6496
|
-
|
|
6495
|
+
($, C) => {
|
|
6496
|
+
!$ && C && (bt(), _t());
|
|
6497
6497
|
}
|
|
6498
6498
|
);
|
|
6499
6499
|
function Kn() {
|
|
@@ -6503,34 +6503,34 @@ const sp = {
|
|
|
6503
6503
|
Kn();
|
|
6504
6504
|
}), X(() => r.active.value, () => {
|
|
6505
6505
|
Kn();
|
|
6506
|
-
}), X(h, (
|
|
6507
|
-
|
|
6508
|
-
}), X(lt, (
|
|
6509
|
-
|
|
6510
|
-
}), X(w, (
|
|
6511
|
-
|
|
6506
|
+
}), X(h, ($, C) => {
|
|
6507
|
+
$ && C && $ !== C && bt();
|
|
6508
|
+
}), X(lt, ($, C) => {
|
|
6509
|
+
$ !== C && bt();
|
|
6510
|
+
}), X(w, ($, C) => {
|
|
6511
|
+
$ && C && $ !== C && bt();
|
|
6512
6512
|
});
|
|
6513
|
-
function Mo(
|
|
6514
|
-
if (
|
|
6515
|
-
if (
|
|
6516
|
-
const
|
|
6517
|
-
return
|
|
6513
|
+
function Mo($) {
|
|
6514
|
+
if (!$) return null;
|
|
6515
|
+
if ($.geometry) return $.geometry;
|
|
6516
|
+
const C = ($ == null ? void 0 : $.data) ?? ($ == null ? void 0 : $.properties);
|
|
6517
|
+
return C != null && C.geom_4326 ? C.geom_4326 : C != null && C.geom ? C.geom : null;
|
|
6518
6518
|
}
|
|
6519
6519
|
function _t() {
|
|
6520
|
-
var
|
|
6521
|
-
(
|
|
6520
|
+
var $, C;
|
|
6521
|
+
(C = ($ = z.value) == null ? void 0 : $.remove) == null || C.call($), z.value = null;
|
|
6522
6522
|
}
|
|
6523
|
-
function Io(
|
|
6523
|
+
function Io($) {
|
|
6524
6524
|
var H, ne, fe;
|
|
6525
|
-
const
|
|
6526
|
-
return
|
|
6525
|
+
const C = ($ == null ? void 0 : $.type) || ((fe = (ne = (H = $ == null ? void 0 : $.features) == null ? void 0 : H[0]) == null ? void 0 : ne.geometry) == null ? void 0 : fe.type) || "";
|
|
6526
|
+
return C.includes("Polygon") ? {
|
|
6527
6527
|
type: "fill",
|
|
6528
6528
|
paint: {
|
|
6529
6529
|
"fill-color": "#0a57ff",
|
|
6530
6530
|
"fill-opacity": 0.2,
|
|
6531
6531
|
"fill-outline-color": "#0a57ff"
|
|
6532
6532
|
}
|
|
6533
|
-
} :
|
|
6533
|
+
} : C.includes("LineString") ? {
|
|
6534
6534
|
type: "line",
|
|
6535
6535
|
paint: {
|
|
6536
6536
|
"line-color": "#0a57ff",
|
|
@@ -6548,18 +6548,18 @@ const sp = {
|
|
|
6548
6548
|
}
|
|
6549
6549
|
};
|
|
6550
6550
|
}
|
|
6551
|
-
function jo(
|
|
6551
|
+
function jo($) {
|
|
6552
6552
|
var fe;
|
|
6553
|
-
if (
|
|
6553
|
+
if (!$) {
|
|
6554
6554
|
_t();
|
|
6555
6555
|
return;
|
|
6556
6556
|
}
|
|
6557
|
-
const
|
|
6557
|
+
const C = (fe = p.map) == null ? void 0 : fe.value, H = {
|
|
6558
6558
|
type: "FeatureCollection",
|
|
6559
|
-
features: [{ type: "Feature", geometry:
|
|
6559
|
+
features: [{ type: "Feature", geometry: $, properties: {} }]
|
|
6560
6560
|
};
|
|
6561
6561
|
_t();
|
|
6562
|
-
const ne = Io(
|
|
6562
|
+
const ne = Io($);
|
|
6563
6563
|
if (z.value = ge("feature-card-highlight", {
|
|
6564
6564
|
source: { type: "geojson", data: H },
|
|
6565
6565
|
layer: {
|
|
@@ -6568,10 +6568,10 @@ const sp = {
|
|
|
6568
6568
|
source: "feature-card-highlight",
|
|
6569
6569
|
paint: ne.paint
|
|
6570
6570
|
}
|
|
6571
|
-
}, p.map),
|
|
6571
|
+
}, p.map), C != null && C.moveLayer) {
|
|
6572
6572
|
const he = () => {
|
|
6573
6573
|
try {
|
|
6574
|
-
|
|
6574
|
+
C.moveLayer("feature-card-highlight");
|
|
6575
6575
|
} catch {
|
|
6576
6576
|
}
|
|
6577
6577
|
}, xe = () => {
|
|
@@ -6581,29 +6581,29 @@ const sp = {
|
|
|
6581
6581
|
};
|
|
6582
6582
|
xe();
|
|
6583
6583
|
const _e = () => xe();
|
|
6584
|
-
|
|
6584
|
+
C.once("styledata", _e);
|
|
6585
6585
|
const Te = () => {
|
|
6586
|
-
xe(),
|
|
6586
|
+
xe(), C.off("styledata", _e), C.off("idle", Te);
|
|
6587
6587
|
};
|
|
6588
|
-
|
|
6588
|
+
C.on("idle", Te);
|
|
6589
6589
|
}
|
|
6590
6590
|
}
|
|
6591
|
-
function Oo(
|
|
6591
|
+
function Oo($) {
|
|
6592
6592
|
var ne, fe;
|
|
6593
|
-
const
|
|
6594
|
-
return `${
|
|
6593
|
+
const C = ($ == null ? void 0 : $.source) || ((ne = $ == null ? void 0 : $.layer) == null ? void 0 : ne.id) || "unknown", H = ((fe = $ == null ? void 0 : $.properties) == null ? void 0 : fe.id) ?? ($ == null ? void 0 : $.id) ?? "unknown";
|
|
6594
|
+
return `${C}:${H}`;
|
|
6595
6595
|
}
|
|
6596
|
-
async function No(
|
|
6596
|
+
async function No($) {
|
|
6597
6597
|
var he, xe, _e, Te, nt;
|
|
6598
|
-
if (
|
|
6599
|
-
const
|
|
6600
|
-
if (
|
|
6601
|
-
const H = ((he =
|
|
6598
|
+
if (!$) return null;
|
|
6599
|
+
const C = Mo($);
|
|
6600
|
+
if (C) return C;
|
|
6601
|
+
const H = ((he = $ == null ? void 0 : $.properties) == null ? void 0 : he.id) ?? ($ == null ? void 0 : $.id);
|
|
6602
6602
|
if (!H) return null;
|
|
6603
|
-
const ne = Oo(
|
|
6604
|
-
if (
|
|
6605
|
-
return
|
|
6606
|
-
const fe = [x.value,
|
|
6603
|
+
const ne = Oo($);
|
|
6604
|
+
if (M.has(ne))
|
|
6605
|
+
return M.get(ne);
|
|
6606
|
+
const fe = [x.value, $ == null ? void 0 : $.source, (xe = $ == null ? void 0 : $.layer) == null ? void 0 : xe.id].map((Ie) => typeof Ie == "string" ? Ie.trim() : "").filter(Boolean);
|
|
6607
6607
|
for (const Ie of fe)
|
|
6608
6608
|
try {
|
|
6609
6609
|
const Ge = await fetch(`/api/map-features/${encodeURIComponent(Ie)}/${encodeURIComponent(String(H))}`);
|
|
@@ -6611,21 +6611,21 @@ const sp = {
|
|
|
6611
6611
|
continue;
|
|
6612
6612
|
const Ve = await Ge.json(), vt = ((_e = Ve == null ? void 0 : Ve.data) == null ? void 0 : _e.geom) || ((Te = Ve == null ? void 0 : Ve.data) == null ? void 0 : Te.geometry) || ((nt = Ve == null ? void 0 : Ve.data) == null ? void 0 : nt.geom_4326) || null, qt = typeof vt == "string" ? JSON.parse(vt) : vt;
|
|
6613
6613
|
if (qt)
|
|
6614
|
-
return
|
|
6614
|
+
return M.set(ne, qt), qt;
|
|
6615
6615
|
} catch {
|
|
6616
6616
|
continue;
|
|
6617
6617
|
}
|
|
6618
6618
|
return null;
|
|
6619
6619
|
}
|
|
6620
|
-
async function tn(
|
|
6620
|
+
async function tn($) {
|
|
6621
6621
|
V.value += 1;
|
|
6622
|
-
const
|
|
6623
|
-
if (
|
|
6622
|
+
const C = V.value;
|
|
6623
|
+
if (!$ || o.value) {
|
|
6624
6624
|
_t();
|
|
6625
6625
|
return;
|
|
6626
6626
|
}
|
|
6627
|
-
const H = await No(
|
|
6628
|
-
if (
|
|
6627
|
+
const H = await No($);
|
|
6628
|
+
if (C === V.value) {
|
|
6629
6629
|
if (!H) {
|
|
6630
6630
|
_t();
|
|
6631
6631
|
return;
|
|
@@ -6635,8 +6635,8 @@ const sp = {
|
|
|
6635
6635
|
}
|
|
6636
6636
|
return X(
|
|
6637
6637
|
() => n.cardFeature.value,
|
|
6638
|
-
(
|
|
6639
|
-
tn(
|
|
6638
|
+
($) => {
|
|
6639
|
+
tn($);
|
|
6640
6640
|
},
|
|
6641
6641
|
{ immediate: !0 }
|
|
6642
6642
|
), X(
|
|
@@ -6644,13 +6644,13 @@ const sp = {
|
|
|
6644
6644
|
() => {
|
|
6645
6645
|
o.value || tn(n.cardFeature.value);
|
|
6646
6646
|
}
|
|
6647
|
-
), X(o, (
|
|
6648
|
-
|
|
6647
|
+
), X(o, ($) => {
|
|
6648
|
+
$ ? _t() : tn(n.cardFeature.value);
|
|
6649
6649
|
}), X(x, () => {
|
|
6650
6650
|
!o.value && n.cardFeature.value && tn(n.cardFeature.value);
|
|
6651
6651
|
}), ke(() => {
|
|
6652
6652
|
bt(), _t();
|
|
6653
|
-
}), (
|
|
6653
|
+
}), ($, C) => (m(), te(Nn, { name: "fade" }, {
|
|
6654
6654
|
default: Oe(() => [
|
|
6655
6655
|
l.value ? (m(), b("div", sp, [
|
|
6656
6656
|
s("div", ap, [
|
|
@@ -6669,7 +6669,7 @@ const sp = {
|
|
|
6669
6669
|
]),
|
|
6670
6670
|
o.value && ie(ut) > 1 ? (m(), b("div", dp, [
|
|
6671
6671
|
s("button", {
|
|
6672
|
-
onClick:
|
|
6672
|
+
onClick: C[0] || (C[0] = //@ts-ignore
|
|
6673
6673
|
(...H) => ie(pt) && ie(pt)(...H)),
|
|
6674
6674
|
disabled: ie(lt) === 0,
|
|
6675
6675
|
class: "border p-1 rounded text-xs disabled:opacity-40"
|
|
@@ -6677,7 +6677,7 @@ const sp = {
|
|
|
6677
6677
|
le(ie(tr), { class: "h-4 w-4" })
|
|
6678
6678
|
], 8, fp),
|
|
6679
6679
|
s("button", {
|
|
6680
|
-
onClick:
|
|
6680
|
+
onClick: C[1] || (C[1] = //@ts-ignore
|
|
6681
6681
|
(...H) => ie(tt) && ie(tt)(...H)),
|
|
6682
6682
|
disabled: ie(lt) === ie(ut) - 1,
|
|
6683
6683
|
class: "border p-1 rounded text-xs disabled:opacity-40"
|
|
@@ -6686,7 +6686,7 @@ const sp = {
|
|
|
6686
6686
|
], 8, pp)
|
|
6687
6687
|
])) : !o.value && Lt.value ? (m(), b("div", vp, [
|
|
6688
6688
|
s("button", {
|
|
6689
|
-
onClick:
|
|
6689
|
+
onClick: C[2] || (C[2] = //@ts-ignore
|
|
6690
6690
|
(...H) => ie(Wn) && ie(Wn)(...H)),
|
|
6691
6691
|
disabled: dt.value === 0,
|
|
6692
6692
|
class: "border p-1 rounded text-xs disabled:opacity-40"
|
|
@@ -6694,7 +6694,7 @@ const sp = {
|
|
|
6694
6694
|
le(ie(tr), { class: "h-4 w-4" })
|
|
6695
6695
|
], 8, mp),
|
|
6696
6696
|
s("button", {
|
|
6697
|
-
onClick:
|
|
6697
|
+
onClick: C[3] || (C[3] = //@ts-ignore
|
|
6698
6698
|
(...H) => ie(Zn) && ie(Zn)(...H)),
|
|
6699
6699
|
disabled: dt.value === ct.value - 1,
|
|
6700
6700
|
class: "border p-1 rounded text-xs disabled:opacity-40"
|
|
@@ -6768,7 +6768,7 @@ const sp = {
|
|
|
6768
6768
|
])
|
|
6769
6769
|
])) : W("", !0),
|
|
6770
6770
|
Q.value.length ? (m(), b("div", Ep, [
|
|
6771
|
-
|
|
6771
|
+
C[5] || (C[5] = s("p", { class: "text-xs font-semibold uppercase tracking-wide text-slate-500" }, "Шари", -1)),
|
|
6772
6772
|
s("div", Fp, [
|
|
6773
6773
|
(m(!0), b(K, null, oe(Q.value, (H) => (m(), b("div", {
|
|
6774
6774
|
key: H.id,
|
|
@@ -6781,7 +6781,7 @@ const sp = {
|
|
|
6781
6781
|
checked: ee(H.id),
|
|
6782
6782
|
onChange: (ne) => We(H, ne)
|
|
6783
6783
|
}, null, 40, Mp),
|
|
6784
|
-
|
|
6784
|
+
C[4] || (C[4] = s("div", { class: "w-4 h-4 rounded border border-blue-800 flex items-center justify-center peer-checked:bg-blue-600 peer-checked:border-blue-600" }, [
|
|
6785
6785
|
s("svg", {
|
|
6786
6786
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6787
6787
|
width: "12",
|
|
@@ -6902,110 +6902,110 @@ const sp = {
|
|
|
6902
6902
|
}), Pp = { class: "flex h-screen bg-gradient-to-br from-slate-50 to-white" }, Dp = { class: "flex-1 relative overflow-hidden" }, Rp = { class: "absolute top-0 left-0 w-full z-20" }, Bp = { class: "flex items-center justify-between bg-white/80 backdrop-blur border-b border-gray-200 px-6 py-3 shadow-sm gap-4" }, Vp = { class: "flex items-center gap-3" }, Up = { class: "font-semibold text-lg text-gray-800 line-clamp-1" }, qp = { class: "text-xs text-gray-500 truncate" }, Hp = ["title"], Yp = { class: "w-full h-full bg-gradient-to-br from-sky-50 via-white to-blue-50 flex items-center justify-center relative pt-[64px]" }, Zp = { class: "relative w-full h-full" }, Wp = { style: { top: "17px", left: "230px", position: "absolute", "z-index": "1" } }, Kp = { class: "absolute top-4 left-4 z-20" }, Gp = { class: "absolute bottom-4 left-4 z-20" }, Xp = { class: "w-[650px] bg-white border-l border-gray-100 flex flex-col overflow-hidden shadow-lg" }, Jp = { class: "flex-1 flex flex-col h-full" }, Qp = { class: "px-3 pt-3 pb-2 border-b border-gray-100" }, ev = { class: "items-center justify-center text-muted-foreground grid w-full grid-cols-6 h-12 p-1 bg-gray-50 rounded-xl shadow-sm" }, tv = ["aria-selected", "onClick"], nv = { class: "leading-none" }, rv = { class: "flex flex-col flex-1 overflow-y-hidden p-3" }, ov = /* @__PURE__ */ se({
|
|
6903
6903
|
__name: "service",
|
|
6904
6904
|
setup(e) {
|
|
6905
|
-
var R,
|
|
6906
|
-
const t = Rt(), n = Bt(), { id: r } = t.params, o = P(null), l = P({}), i = P(null), a = ((
|
|
6907
|
-
var
|
|
6908
|
-
return ((
|
|
6905
|
+
var R, T;
|
|
6906
|
+
const t = Rt(), n = Bt(), { id: r } = t.params, o = P(null), l = P({}), i = P(null), a = ((T = (R = Dt()) == null ? void 0 : R.appContext.config.globalProperties) == null ? void 0 : T.$settings) || null, f = P(null), p = P([]), _ = P([]), u = P([]), v = P("list"), c = P(""), d = P([]), g = D(() => {
|
|
6907
|
+
var j, A;
|
|
6908
|
+
return ((j = i.value) == null ? void 0 : j.id) ?? ((A = i.value) == null ? void 0 : A.service_id) ?? null;
|
|
6909
6909
|
}), h = D(() => {
|
|
6910
|
-
const
|
|
6911
|
-
return !
|
|
6910
|
+
const j = (a == null ? void 0 : a.map) || null, A = (j == null ? void 0 : j.boundary) ?? null, U = (j == null ? void 0 : j.katottg) ?? null;
|
|
6911
|
+
return !A && !U ? null : { boundary: A, katottg: U };
|
|
6912
6912
|
}), y = [
|
|
6913
6913
|
{ key: "style", label: "Стиль", icon: Cd },
|
|
6914
6914
|
{ key: "popup", label: "Попап", icon: zd },
|
|
6915
6915
|
{ key: "filter", label: "Фільтр", icon: Bd },
|
|
6916
6916
|
{ key: "legend", label: "Легенда", icon: Ed },
|
|
6917
6917
|
{ key: "card", label: "Картка", icon: Id }
|
|
6918
|
-
], w = y.map((
|
|
6918
|
+
], w = y.map((j) => j.key), E = P("style");
|
|
6919
6919
|
Le(async () => {
|
|
6920
|
-
const
|
|
6921
|
-
|
|
6922
|
-
}), X(E, (
|
|
6923
|
-
t.query.tab !==
|
|
6920
|
+
const j = t.query.tab;
|
|
6921
|
+
j && w.includes(j) && (E.value = j), await M();
|
|
6922
|
+
}), X(E, (j) => {
|
|
6923
|
+
t.query.tab !== j && n.replace({ query: { ...t.query, tab: j } });
|
|
6924
6924
|
}), X(
|
|
6925
6925
|
() => t.query.tab,
|
|
6926
|
-
(
|
|
6927
|
-
|
|
6926
|
+
(j) => {
|
|
6927
|
+
j && w.includes(j) && E.value !== j && (E.value = j);
|
|
6928
6928
|
}
|
|
6929
6929
|
);
|
|
6930
|
-
function z(
|
|
6931
|
-
if (!
|
|
6930
|
+
function z(j) {
|
|
6931
|
+
if (!j) return null;
|
|
6932
6932
|
try {
|
|
6933
|
-
return JSON.parse(JSON.stringify(
|
|
6934
|
-
} catch (
|
|
6935
|
-
return console.warn("Failed to clone style",
|
|
6933
|
+
return JSON.parse(JSON.stringify(j));
|
|
6934
|
+
} catch (A) {
|
|
6935
|
+
return console.warn("Failed to clone style", A), null;
|
|
6936
6936
|
}
|
|
6937
6937
|
}
|
|
6938
|
-
function V(
|
|
6939
|
-
if (!
|
|
6940
|
-
if (typeof
|
|
6938
|
+
function V(j) {
|
|
6939
|
+
if (!j) return null;
|
|
6940
|
+
if (typeof j == "string")
|
|
6941
6941
|
try {
|
|
6942
|
-
return _d.load(
|
|
6943
|
-
} catch (
|
|
6944
|
-
return console.warn("Failed to parse style yaml",
|
|
6942
|
+
return _d.load(j) || null;
|
|
6943
|
+
} catch (A) {
|
|
6944
|
+
return console.warn("Failed to parse style yaml", A), null;
|
|
6945
6945
|
}
|
|
6946
|
-
return z(
|
|
6946
|
+
return z(j);
|
|
6947
6947
|
}
|
|
6948
|
-
const
|
|
6948
|
+
const M = async () => {
|
|
6949
6949
|
try {
|
|
6950
|
-
const
|
|
6951
|
-
if (!
|
|
6952
|
-
const
|
|
6953
|
-
l.value =
|
|
6954
|
-
const U = V(
|
|
6955
|
-
i.value =
|
|
6956
|
-
} catch (
|
|
6957
|
-
console.error("Failed to fetch map info",
|
|
6950
|
+
const j = await fetch(`/api/gis-service/${r}`);
|
|
6951
|
+
if (!j.ok) throw new Error(`${j.status}`);
|
|
6952
|
+
const A = await j.json();
|
|
6953
|
+
l.value = A || {}, o.value = r;
|
|
6954
|
+
const U = V(A.style);
|
|
6955
|
+
i.value = A ? { ...A, style: z(U) } : null, f.value = U, _.value = (A == null ? void 0 : A.popup) || [], v.value = A.card_mode === "html" ? "html" : "list", u.value = A.card, c.value = A.html, p.value = (A == null ? void 0 : A.legend) || [], d.value = (A == null ? void 0 : A.filters) || [];
|
|
6956
|
+
} catch (j) {
|
|
6957
|
+
console.error("Failed to fetch map info", j);
|
|
6958
6958
|
}
|
|
6959
6959
|
};
|
|
6960
6960
|
X(
|
|
6961
6961
|
() => {
|
|
6962
|
-
var
|
|
6963
|
-
return (
|
|
6962
|
+
var j;
|
|
6963
|
+
return (j = i.value) == null ? void 0 : j.style;
|
|
6964
6964
|
},
|
|
6965
|
-
(
|
|
6966
|
-
f.value = V(
|
|
6965
|
+
(j) => {
|
|
6966
|
+
f.value = V(j);
|
|
6967
6967
|
},
|
|
6968
6968
|
{ deep: !0 }
|
|
6969
6969
|
);
|
|
6970
|
-
async function S(
|
|
6971
|
-
await
|
|
6970
|
+
async function S(j, A) {
|
|
6971
|
+
await k({ [j]: A }, j);
|
|
6972
6972
|
}
|
|
6973
6973
|
function x() {
|
|
6974
|
-
const
|
|
6975
|
-
|
|
6974
|
+
const j = z(f.value);
|
|
6975
|
+
j && (i.value = i.value ? { ...i.value, style: j } : i.value);
|
|
6976
6976
|
}
|
|
6977
|
-
async function
|
|
6977
|
+
async function k(j, A) {
|
|
6978
6978
|
if (i.value = {
|
|
6979
6979
|
...i.value || {},
|
|
6980
|
-
...
|
|
6981
|
-
}, typeof
|
|
6980
|
+
...j
|
|
6981
|
+
}, typeof j.html < "u" && (l.value = {
|
|
6982
6982
|
...l.value || {},
|
|
6983
|
-
html:
|
|
6983
|
+
html: j.html
|
|
6984
6984
|
}), !!g.value)
|
|
6985
6985
|
try {
|
|
6986
6986
|
if (!(await fetch(`/api/gis-service/${g.value}`, {
|
|
6987
6987
|
method: "PUT",
|
|
6988
6988
|
headers: { "Content-Type": "application/json" },
|
|
6989
|
-
body: JSON.stringify(
|
|
6989
|
+
body: JSON.stringify(j)
|
|
6990
6990
|
})).ok) throw new Error("Save failed");
|
|
6991
|
-
je({ type: "success", title: "Успіх", message: `${
|
|
6991
|
+
je({ type: "success", title: "Успіх", message: `${A} saved` }), await M();
|
|
6992
6992
|
} catch (U) {
|
|
6993
|
-
je({ type: "error", title: "Помилка", message: `Failed to save ${
|
|
6993
|
+
je({ type: "error", title: "Помилка", message: `Failed to save ${A}` }), console.error(U);
|
|
6994
6994
|
}
|
|
6995
6995
|
}
|
|
6996
|
-
async function j
|
|
6997
|
-
if (
|
|
6998
|
-
await S(
|
|
6996
|
+
async function I(j, A) {
|
|
6997
|
+
if (j !== "card") {
|
|
6998
|
+
await S(j, A);
|
|
6999
6999
|
return;
|
|
7000
7000
|
}
|
|
7001
|
-
const U = (
|
|
7001
|
+
const U = (A == null ? void 0 : A.card_mode) === "html" ? "html" : "list", N = U === "html" && typeof (A == null ? void 0 : A.html) == "string" ? A.html : "", O = (U === "html" ? [] : null) || (Array.isArray(A == null ? void 0 : A.list) ? A.list : []);
|
|
7002
7002
|
u.value = O, v.value = U, c.value = N;
|
|
7003
7003
|
const L = {
|
|
7004
7004
|
card_mode: U
|
|
7005
7005
|
};
|
|
7006
|
-
U === "html" && (L.html = N), U === "list" && (L.card = O), await
|
|
7006
|
+
U === "html" && (L.html = N), U === "list" && (L.card = O), await k(L, "card");
|
|
7007
7007
|
}
|
|
7008
|
-
return (
|
|
7008
|
+
return (j, A) => {
|
|
7009
7009
|
var U, N, O, L;
|
|
7010
7010
|
return m(), b("div", Pp, [
|
|
7011
7011
|
s("div", Dp, [
|
|
@@ -7013,9 +7013,9 @@ const sp = {
|
|
|
7013
7013
|
s("div", Bp, [
|
|
7014
7014
|
s("div", Vp, [
|
|
7015
7015
|
s("button", {
|
|
7016
|
-
onClick:
|
|
7016
|
+
onClick: A[0] || (A[0] = (F) => j.$router.back()),
|
|
7017
7017
|
class: "inline-flex items-center px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition"
|
|
7018
|
-
}, [...
|
|
7018
|
+
}, [...A[9] || (A[9] = [
|
|
7019
7019
|
s("svg", {
|
|
7020
7020
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7021
7021
|
class: "h-4 w-4 mr-1",
|
|
@@ -7047,9 +7047,9 @@ const sp = {
|
|
|
7047
7047
|
s("div", Zp, [
|
|
7048
7048
|
le(Co, null, {
|
|
7049
7049
|
default: Oe(() => {
|
|
7050
|
-
var
|
|
7050
|
+
var F, B, Z, J, G, ve, de, pe;
|
|
7051
7051
|
return [
|
|
7052
|
-
(
|
|
7052
|
+
(F = i.value) != null && F.service_id ? (m(), te(Of, {
|
|
7053
7053
|
key: 0,
|
|
7054
7054
|
id: (B = i.value) == null ? void 0 : B.service_id,
|
|
7055
7055
|
layer: i.value,
|
|
@@ -7068,7 +7068,7 @@ const sp = {
|
|
|
7068
7068
|
filters: d.value
|
|
7069
7069
|
}, null, 8, ["layer-id", "filters"])) : W("", !0)
|
|
7070
7070
|
]),
|
|
7071
|
-
|
|
7071
|
+
A[10] || (A[10] = s("div", {
|
|
7072
7072
|
id: "map-filter-popover-host",
|
|
7073
7073
|
class: "map-widget__filter-host"
|
|
7074
7074
|
}, null, -1)),
|
|
@@ -7095,16 +7095,16 @@ const sp = {
|
|
|
7095
7095
|
s("div", Jp, [
|
|
7096
7096
|
s("div", Qp, [
|
|
7097
7097
|
s("div", ev, [
|
|
7098
|
-
(m(), b(K, null, oe(y, (
|
|
7099
|
-
key:
|
|
7098
|
+
(m(), b(K, null, oe(y, (F) => s("button", {
|
|
7099
|
+
key: F.key,
|
|
7100
7100
|
type: "button",
|
|
7101
7101
|
role: "tab",
|
|
7102
|
-
"aria-selected": E.value ===
|
|
7103
|
-
class: we(["whitespace-nowrap flex flex-col items-center justify-center gap-0.5 py-1 px-1 text-[9px] font-medium transition-all duration-300 hover:bg-white/70 rounded-lg group", E.value ===
|
|
7104
|
-
onClick: (B) => E.value =
|
|
7102
|
+
"aria-selected": E.value === F.key,
|
|
7103
|
+
class: we(["whitespace-nowrap flex flex-col items-center justify-center gap-0.5 py-1 px-1 text-[9px] font-medium transition-all duration-300 hover:bg-white/70 rounded-lg group", E.value === F.key ? "bg-white shadow-sm text-gray-700" : ""]),
|
|
7104
|
+
onClick: (B) => E.value = F.key
|
|
7105
7105
|
}, [
|
|
7106
|
-
(m(), te(Pt(
|
|
7107
|
-
s("span", nv, Y(
|
|
7106
|
+
(m(), te(Pt(F.icon), { class: "h-3.5 w-3.5 mb-0.5" })),
|
|
7107
|
+
s("span", nv, Y(F.label), 1)
|
|
7108
7108
|
], 10, tv)), 64))
|
|
7109
7109
|
])
|
|
7110
7110
|
]),
|
|
@@ -7113,21 +7113,21 @@ const sp = {
|
|
|
7113
7113
|
key: 0,
|
|
7114
7114
|
token: g.value,
|
|
7115
7115
|
"style-yaml": f.value,
|
|
7116
|
-
"onUpdate:styleYaml":
|
|
7116
|
+
"onUpdate:styleYaml": A[1] || (A[1] = (F) => f.value = F),
|
|
7117
7117
|
onUpdate: x
|
|
7118
7118
|
}, null, 8, ["token", "style-yaml"])) : E.value === "legend" ? (m(), te($f, {
|
|
7119
7119
|
key: 1,
|
|
7120
7120
|
token: g.value,
|
|
7121
7121
|
columns: p.value,
|
|
7122
|
-
"onUpdate:columns":
|
|
7123
|
-
onSave:
|
|
7122
|
+
"onUpdate:columns": A[2] || (A[2] = (F) => p.value = F),
|
|
7123
|
+
onSave: A[3] || (A[3] = (F) => S("legend", F))
|
|
7124
7124
|
}, null, 8, ["token", "columns"])) : E.value === "popup" ? (m(), te(gf, {
|
|
7125
7125
|
key: 2,
|
|
7126
7126
|
token: g.value,
|
|
7127
7127
|
columns: _.value,
|
|
7128
7128
|
fields: l.value.fields,
|
|
7129
|
-
"onUpdate:columns":
|
|
7130
|
-
onSave:
|
|
7129
|
+
"onUpdate:columns": A[4] || (A[4] = (F) => _.value = F),
|
|
7130
|
+
onSave: A[5] || (A[5] = (F) => S("popup", F))
|
|
7131
7131
|
}, null, 8, ["token", "columns", "fields"])) : E.value === "card" ? (m(), te(Mf, {
|
|
7132
7132
|
key: 3,
|
|
7133
7133
|
token: g.value,
|
|
@@ -7135,15 +7135,15 @@ const sp = {
|
|
|
7135
7135
|
fields: l.value.fields,
|
|
7136
7136
|
"view-mode": v.value,
|
|
7137
7137
|
html: c.value,
|
|
7138
|
-
"onUpdate:columns":
|
|
7139
|
-
onSave:
|
|
7138
|
+
"onUpdate:columns": A[6] || (A[6] = (F) => u.value = F),
|
|
7139
|
+
onSave: I
|
|
7140
7140
|
}, null, 8, ["token", "columns", "fields", "view-mode", "html"])) : E.value === "filter" ? (m(), te(jf, {
|
|
7141
7141
|
key: 4,
|
|
7142
7142
|
token: g.value,
|
|
7143
7143
|
fields: l.value.fields,
|
|
7144
7144
|
columns: d.value,
|
|
7145
|
-
"onUpdate:columns":
|
|
7146
|
-
onSave:
|
|
7145
|
+
"onUpdate:columns": A[7] || (A[7] = (F) => d.value = F),
|
|
7146
|
+
onSave: A[8] || (A[8] = (F) => S("filters", F))
|
|
7147
7147
|
}, null, 8, ["token", "fields", "columns"])) : W("", !0)
|
|
7148
7148
|
])
|
|
7149
7149
|
])
|
|
@@ -7184,13 +7184,13 @@ const sp = {
|
|
|
7184
7184
|
});
|
|
7185
7185
|
}
|
|
7186
7186
|
function p() {
|
|
7187
|
-
var
|
|
7187
|
+
var k, I;
|
|
7188
7188
|
if (!r.open || !o.value) return;
|
|
7189
|
-
const g = o.value.getBoundingClientRect(), h = 8, y = window.scrollX + h, w = window.scrollX + window.innerWidth - h, E = window.scrollY + h, z = window.scrollY + window.innerHeight - h, V = ((
|
|
7189
|
+
const g = o.value.getBoundingClientRect(), h = 8, y = window.scrollX + h, w = window.scrollX + window.innerWidth - h, E = window.scrollY + h, z = window.scrollY + window.innerHeight - h, V = ((k = l.value) == null ? void 0 : k.offsetWidth) || 460, M = ((I = l.value) == null ? void 0 : I.offsetHeight) || 0;
|
|
7190
7190
|
let S = g.left + window.scrollX + (g.width - V) / 2;
|
|
7191
7191
|
S < y && (S = y), S + V > w && (S = Math.max(y, w - V)), r.left = S;
|
|
7192
7192
|
let x = g.bottom + window.scrollY + h;
|
|
7193
|
-
x +
|
|
7193
|
+
x + M > z && (x = g.top + window.scrollY - M - h, x < E && (x = Math.max(E, z - M))), r.top = x, r.transform = "none";
|
|
7194
7194
|
}
|
|
7195
7195
|
function _(g) {
|
|
7196
7196
|
var y, w;
|
|
@@ -7514,50 +7514,50 @@ const sp = {
|
|
|
7514
7514
|
deactivateTemporaryLayer: a,
|
|
7515
7515
|
clearTemporaryLayers: f
|
|
7516
7516
|
} = Lo(o.map), p = D(() => {
|
|
7517
|
-
const x = n.layers.map((
|
|
7518
|
-
...
|
|
7517
|
+
const x = n.layers.map((I) => ({
|
|
7518
|
+
...I,
|
|
7519
7519
|
isTemporary: !1,
|
|
7520
7520
|
owner: null,
|
|
7521
|
-
visible:
|
|
7522
|
-
})),
|
|
7523
|
-
id:
|
|
7524
|
-
name:
|
|
7525
|
-
visible: r.value[
|
|
7521
|
+
visible: I.visible !== !1
|
|
7522
|
+
})), k = l.value.map((I) => ({
|
|
7523
|
+
id: I.id,
|
|
7524
|
+
name: I.title,
|
|
7525
|
+
visible: r.value[I.id] ?? !0,
|
|
7526
7526
|
actions: [],
|
|
7527
7527
|
filters: null,
|
|
7528
7528
|
isTemporary: !0,
|
|
7529
|
-
owner:
|
|
7530
|
-
handle:
|
|
7531
|
-
card:
|
|
7532
|
-
popup:
|
|
7533
|
-
style:
|
|
7529
|
+
owner: I.owner ?? null,
|
|
7530
|
+
handle: I.handle ?? null,
|
|
7531
|
+
card: I.card ?? null,
|
|
7532
|
+
popup: I.popup ?? null,
|
|
7533
|
+
style: I.style ?? null,
|
|
7534
7534
|
group_name: null,
|
|
7535
7535
|
count: null,
|
|
7536
7536
|
holder: null
|
|
7537
7537
|
}));
|
|
7538
|
-
return [...x, ...
|
|
7538
|
+
return [...x, ...k];
|
|
7539
7539
|
}), _ = D(() => l.value.length > 0), u = t;
|
|
7540
7540
|
function v() {
|
|
7541
7541
|
var x;
|
|
7542
|
-
for (let
|
|
7543
|
-
const
|
|
7542
|
+
for (let k = 0; k < n.layers.length; k++) {
|
|
7543
|
+
const I = n.layers[k], R = c(I);
|
|
7544
7544
|
if (!R)
|
|
7545
7545
|
continue;
|
|
7546
|
-
const
|
|
7547
|
-
r.value[
|
|
7546
|
+
const T = ge(I.id, R), j = I.visible !== !1;
|
|
7547
|
+
r.value[I.id] = j, j || (x = T == null ? void 0 : T.setVisible) == null || x.call(T, !1);
|
|
7548
7548
|
}
|
|
7549
7549
|
}
|
|
7550
7550
|
function c(x) {
|
|
7551
|
-
const
|
|
7552
|
-
if (!
|
|
7553
|
-
const
|
|
7554
|
-
if (!!R && (
|
|
7555
|
-
const
|
|
7556
|
-
return
|
|
7557
|
-
sourceId:
|
|
7551
|
+
const k = x.id;
|
|
7552
|
+
if (!k) return null;
|
|
7553
|
+
const I = (x.service || x.service_type || x.type || "").toString().toLowerCase(), R = x.service_url || x.url || null;
|
|
7554
|
+
if (!!R && (I === "tms" || I === "wmts" || I === "wms" || I === "ogc")) {
|
|
7555
|
+
const A = d(R);
|
|
7556
|
+
return A ? {
|
|
7557
|
+
sourceId: k,
|
|
7558
7558
|
source: {
|
|
7559
7559
|
type: "raster",
|
|
7560
|
-
tiles: [
|
|
7560
|
+
tiles: [A],
|
|
7561
7561
|
tileSize: x.tileSize || 256,
|
|
7562
7562
|
minzoom: x.minzoom ?? 0,
|
|
7563
7563
|
maxzoom: x.maxzoom ?? 22,
|
|
@@ -7565,27 +7565,27 @@ const sp = {
|
|
|
7565
7565
|
scheme: x.scheme || "xyz"
|
|
7566
7566
|
},
|
|
7567
7567
|
layer: {
|
|
7568
|
-
id:
|
|
7568
|
+
id: k,
|
|
7569
7569
|
type: "raster",
|
|
7570
|
-
source:
|
|
7570
|
+
source: k
|
|
7571
7571
|
},
|
|
7572
7572
|
card: x.card,
|
|
7573
7573
|
popup: x.popup
|
|
7574
7574
|
} : null;
|
|
7575
7575
|
}
|
|
7576
|
-
const
|
|
7576
|
+
const j = `${location.origin}/api/vtile/${k}/ua/{z}/{x}/{y}.vmt`;
|
|
7577
7577
|
return {
|
|
7578
|
-
sourceId:
|
|
7578
|
+
sourceId: k,
|
|
7579
7579
|
source: {
|
|
7580
7580
|
type: "vector",
|
|
7581
|
-
tiles: [
|
|
7581
|
+
tiles: [j],
|
|
7582
7582
|
minZoom: 4,
|
|
7583
7583
|
maxZoom: 14
|
|
7584
7584
|
},
|
|
7585
7585
|
layer: {
|
|
7586
|
-
id:
|
|
7587
|
-
source:
|
|
7588
|
-
"source-layer":
|
|
7586
|
+
id: k,
|
|
7587
|
+
source: k,
|
|
7588
|
+
"source-layer": k,
|
|
7589
7589
|
style: x.style
|
|
7590
7590
|
},
|
|
7591
7591
|
card: x.card,
|
|
@@ -7596,17 +7596,17 @@ const sp = {
|
|
|
7596
7596
|
return x ? /^https?:\/\//i.test(x) ? x : x.startsWith("//") ? `${window.location.protocol}${x}` : x.startsWith("/") ? `${location.origin}${x}` : `${location.origin}/${x}` : null;
|
|
7597
7597
|
}
|
|
7598
7598
|
function g(x) {
|
|
7599
|
-
const
|
|
7600
|
-
return
|
|
7599
|
+
const k = r.value[x];
|
|
7600
|
+
return k ?? !0;
|
|
7601
7601
|
}
|
|
7602
7602
|
function h(x) {
|
|
7603
|
-
var R,
|
|
7603
|
+
var R, T;
|
|
7604
7604
|
if (!(x != null && x.id)) return null;
|
|
7605
|
-
const
|
|
7606
|
-
return !
|
|
7605
|
+
const k = (R = x.title) == null ? void 0 : R.trim(), I = (T = x.url) == null ? void 0 : T.trim();
|
|
7606
|
+
return !k || !I ? null : {
|
|
7607
7607
|
id: x.id,
|
|
7608
|
-
title:
|
|
7609
|
-
url:
|
|
7608
|
+
title: k,
|
|
7609
|
+
url: I,
|
|
7610
7610
|
tileSize: x.tileSize,
|
|
7611
7611
|
minzoom: x.minzoom,
|
|
7612
7612
|
maxzoom: x.maxzoom,
|
|
@@ -7615,21 +7615,21 @@ const sp = {
|
|
|
7615
7615
|
}
|
|
7616
7616
|
function y(x) {
|
|
7617
7617
|
if (!x) return;
|
|
7618
|
-
const
|
|
7618
|
+
const k = x.owner;
|
|
7619
7619
|
if (x.action === "clear") {
|
|
7620
|
-
const R = l.value.filter((
|
|
7621
|
-
f(
|
|
7622
|
-
|
|
7620
|
+
const R = l.value.filter((T) => !k || T.owner === k).map((T) => T.id);
|
|
7621
|
+
f(k), R.forEach((T) => {
|
|
7622
|
+
T in r.value && delete r.value[T];
|
|
7623
7623
|
});
|
|
7624
7624
|
return;
|
|
7625
7625
|
}
|
|
7626
|
-
const
|
|
7627
|
-
if (
|
|
7626
|
+
const I = h(x.spec);
|
|
7627
|
+
if (I) {
|
|
7628
7628
|
if (x.action === "activate") {
|
|
7629
|
-
i(
|
|
7629
|
+
i(I, x.context || {}, k), r.value[I.id] = !0;
|
|
7630
7630
|
return;
|
|
7631
7631
|
}
|
|
7632
|
-
x.action === "deactivate" && (a(
|
|
7632
|
+
x.action === "deactivate" && (a(I.id, k), delete r.value[I.id]);
|
|
7633
7633
|
}
|
|
7634
7634
|
}
|
|
7635
7635
|
function w(x) {
|
|
@@ -7637,12 +7637,12 @@ const sp = {
|
|
|
7637
7637
|
}
|
|
7638
7638
|
X(
|
|
7639
7639
|
() => l.value.map((x) => x.id),
|
|
7640
|
-
(x,
|
|
7641
|
-
const
|
|
7642
|
-
x.forEach((
|
|
7643
|
-
|
|
7644
|
-
}),
|
|
7645
|
-
R.has(
|
|
7640
|
+
(x, k) => {
|
|
7641
|
+
const I = new Set(k || []), R = new Set(x);
|
|
7642
|
+
x.forEach((T) => {
|
|
7643
|
+
T in r.value || (r.value[T] = !0);
|
|
7644
|
+
}), I.forEach((T) => {
|
|
7645
|
+
R.has(T) || delete r.value[T];
|
|
7646
7646
|
});
|
|
7647
7647
|
},
|
|
7648
7648
|
{ immediate: !0 }
|
|
@@ -7651,20 +7651,20 @@ const sp = {
|
|
|
7651
7651
|
}), ke(() => {
|
|
7652
7652
|
window.removeEventListener(Cr, w);
|
|
7653
7653
|
});
|
|
7654
|
-
function E(x,
|
|
7655
|
-
var
|
|
7656
|
-
const R =
|
|
7654
|
+
function E(x, k) {
|
|
7655
|
+
var j, A, U;
|
|
7656
|
+
const R = k.target.checked;
|
|
7657
7657
|
if (r.value[x.id] = R, x.isTemporary) {
|
|
7658
7658
|
if (!R) {
|
|
7659
7659
|
a(x.id, x.owner || void 0), delete r.value[x.id];
|
|
7660
7660
|
return;
|
|
7661
7661
|
}
|
|
7662
|
-
const N = x.handle || ((
|
|
7663
|
-
(
|
|
7662
|
+
const N = x.handle || ((j = l.value.find((O) => O.id === x.id)) == null ? void 0 : j.handle);
|
|
7663
|
+
(A = N == null ? void 0 : N.setVisible) == null || A.call(N, !0);
|
|
7664
7664
|
return;
|
|
7665
7665
|
}
|
|
7666
|
-
const
|
|
7667
|
-
(U =
|
|
7666
|
+
const T = ge(x.id);
|
|
7667
|
+
(U = T == null ? void 0 : T.setVisible) == null || U.call(T, R);
|
|
7668
7668
|
}
|
|
7669
7669
|
function z(x) {
|
|
7670
7670
|
return x.isTemporary ? [
|
|
@@ -7679,24 +7679,24 @@ const sp = {
|
|
|
7679
7679
|
];
|
|
7680
7680
|
}
|
|
7681
7681
|
function V(x) {
|
|
7682
|
-
var
|
|
7683
|
-
return ((
|
|
7682
|
+
var k, I, R;
|
|
7683
|
+
return ((k = x == null ? void 0 : x.style) == null ? void 0 : k.color) || ((I = x == null ? void 0 : x.style) == null ? void 0 : I.stroke) || ((R = x == null ? void 0 : x.style) == null ? void 0 : R.fill) || null;
|
|
7684
7684
|
}
|
|
7685
|
-
function
|
|
7686
|
-
var
|
|
7687
|
-
return ((
|
|
7685
|
+
function M(x) {
|
|
7686
|
+
var k, I;
|
|
7687
|
+
return ((I = (k = x == null ? void 0 : x.legend) == null ? void 0 : k[0]) == null ? void 0 : I.name) || null;
|
|
7688
7688
|
}
|
|
7689
7689
|
function S() {
|
|
7690
7690
|
if (!l.value.length) return;
|
|
7691
|
-
const x = l.value.map((
|
|
7692
|
-
f(), x.forEach((
|
|
7691
|
+
const x = l.value.map((k) => k.id);
|
|
7692
|
+
f(), x.forEach((k) => delete r.value[k]);
|
|
7693
7693
|
}
|
|
7694
|
-
return (x,
|
|
7695
|
-
var
|
|
7694
|
+
return (x, k) => {
|
|
7695
|
+
var I, R;
|
|
7696
7696
|
return m(), b("div", yv, [
|
|
7697
7697
|
s("div", xv, [
|
|
7698
7698
|
s("div", bv, [
|
|
7699
|
-
s("h2", _v, Y(((
|
|
7699
|
+
s("h2", _v, Y(((I = e.config) == null ? void 0 : I.title) || "Шари"), 1),
|
|
7700
7700
|
(R = e.config) != null && R.description ? (m(), b("div", wv, [
|
|
7701
7701
|
s("p", null, Y(e.config.description), 1)
|
|
7702
7702
|
])) : W("", !0)
|
|
@@ -7708,10 +7708,10 @@ const sp = {
|
|
|
7708
7708
|
onClick: S
|
|
7709
7709
|
}, " Очистити тимчасові шари ")) : W("", !0)
|
|
7710
7710
|
]),
|
|
7711
|
-
(m(!0), b(K, null, oe(p.value, (
|
|
7712
|
-
var
|
|
7711
|
+
(m(!0), b(K, null, oe(p.value, (T) => {
|
|
7712
|
+
var j;
|
|
7713
7713
|
return m(), b("div", {
|
|
7714
|
-
key:
|
|
7714
|
+
key: T.id,
|
|
7715
7715
|
class: "layers-panel__item"
|
|
7716
7716
|
}, [
|
|
7717
7717
|
s("label", kv, [
|
|
@@ -7719,20 +7719,20 @@ const sp = {
|
|
|
7719
7719
|
s("input", {
|
|
7720
7720
|
type: "checkbox",
|
|
7721
7721
|
class: "layers-panel__checkbox",
|
|
7722
|
-
checked: g(
|
|
7723
|
-
onChange: (
|
|
7722
|
+
checked: g(T.id),
|
|
7723
|
+
onChange: (A) => E(T, A)
|
|
7724
7724
|
}, null, 40, Cv),
|
|
7725
|
-
s("span", Av, Y(
|
|
7725
|
+
s("span", Av, Y(T.name), 1),
|
|
7726
7726
|
s("div", Lv, [
|
|
7727
|
-
g(
|
|
7727
|
+
g(T.id) && !T.isTemporary ? (m(), b(K, { key: 0 }, [
|
|
7728
7728
|
le(Fo, {
|
|
7729
|
-
"layer-id":
|
|
7729
|
+
"layer-id": T.id,
|
|
7730
7730
|
class: "flex"
|
|
7731
7731
|
}, {
|
|
7732
|
-
trigger: Oe(({ toggle:
|
|
7732
|
+
trigger: Oe(({ toggle: A }) => [
|
|
7733
7733
|
s("button", {
|
|
7734
7734
|
class: "inline-flex items-center justify-center p-0 text-inherit no-underline cursor-pointer",
|
|
7735
|
-
onClick: qe(
|
|
7735
|
+
onClick: qe(A, ["prevent", "stop"])
|
|
7736
7736
|
}, [
|
|
7737
7737
|
s("div", Ev, [
|
|
7738
7738
|
le(ie(nl))
|
|
@@ -7742,30 +7742,30 @@ const sp = {
|
|
|
7742
7742
|
_: 1
|
|
7743
7743
|
}, 8, ["layer-id"]),
|
|
7744
7744
|
le(pn, {
|
|
7745
|
-
count: Array.isArray(
|
|
7746
|
-
layer:
|
|
7745
|
+
count: Array.isArray(T.filters) ? T.filters.length : 0,
|
|
7746
|
+
layer: T
|
|
7747
7747
|
}, null, 8, ["count", "layer"])
|
|
7748
7748
|
], 64)) : W("", !0),
|
|
7749
7749
|
le(qn, {
|
|
7750
|
-
items: z(
|
|
7750
|
+
items: z(T)
|
|
7751
7751
|
}, null, 8, ["items"])
|
|
7752
7752
|
])
|
|
7753
7753
|
]),
|
|
7754
|
-
g(
|
|
7754
|
+
g(T.id) && V(T) ? (m(), b("span", Fv, [
|
|
7755
7755
|
s("span", {
|
|
7756
7756
|
class: "layers-panel__legend-dot",
|
|
7757
|
-
style: Re({ background: V(
|
|
7757
|
+
style: Re({ background: V(T) })
|
|
7758
7758
|
}, null, 4),
|
|
7759
|
-
|
|
7759
|
+
M(T) ? (m(), b("span", Tv, Y(M(T)), 1)) : W("", !0)
|
|
7760
7760
|
])) : W("", !0)
|
|
7761
7761
|
]),
|
|
7762
|
-
(
|
|
7763
|
-
(m(!0), b(K, null, oe(
|
|
7764
|
-
key:
|
|
7762
|
+
(j = T.actions) != null && j.length ? (m(), b("div", Mv, [
|
|
7763
|
+
(m(!0), b(K, null, oe(T.actions, (A) => (m(), b("button", {
|
|
7764
|
+
key: A.widget || A.id || A.icon,
|
|
7765
7765
|
type: "button",
|
|
7766
7766
|
class: "layers-panel__action",
|
|
7767
|
-
innerHTML:
|
|
7768
|
-
onClick: (U) => u("action", { layerId:
|
|
7767
|
+
innerHTML: A.icon,
|
|
7768
|
+
onClick: (U) => u("action", { layerId: A.widget })
|
|
7769
7769
|
}, null, 8, Iv))), 128))
|
|
7770
7770
|
])) : W("", !0)
|
|
7771
7771
|
]);
|
|
@@ -8012,13 +8012,13 @@ const sp = {
|
|
|
8012
8012
|
});
|
|
8013
8013
|
}
|
|
8014
8014
|
function p() {
|
|
8015
|
-
var
|
|
8015
|
+
var k, I;
|
|
8016
8016
|
if (!r.open || !o.value) return;
|
|
8017
|
-
const g = o.value.getBoundingClientRect(), h = 8, y = window.scrollX + h, w = window.scrollX + window.innerWidth - h, E = window.scrollY + h, z = window.scrollY + window.innerHeight - h, V = ((
|
|
8017
|
+
const g = o.value.getBoundingClientRect(), h = 8, y = window.scrollX + h, w = window.scrollX + window.innerWidth - h, E = window.scrollY + h, z = window.scrollY + window.innerHeight - h, V = ((k = l.value) == null ? void 0 : k.offsetWidth) || 460, M = ((I = l.value) == null ? void 0 : I.offsetHeight) || 0;
|
|
8018
8018
|
let S = g.left + window.scrollX + (g.width - V) / 2;
|
|
8019
8019
|
S < y && (S = y), S + V > w && (S = Math.max(y, w - V)), r.left = S;
|
|
8020
8020
|
let x = g.bottom + window.scrollY + h;
|
|
8021
|
-
x +
|
|
8021
|
+
x + M > z && (x = g.top + window.scrollY - M - h, x < E && (x = Math.max(E, z - M))), r.top = x, r.transform = "none";
|
|
8022
8022
|
}
|
|
8023
8023
|
function _(g) {
|
|
8024
8024
|
var y, w;
|
|
@@ -8098,78 +8098,78 @@ const sp = {
|
|
|
8098
8098
|
setup(e, { emit: t }) {
|
|
8099
8099
|
const n = e, r = t, o = Je({}), l = P(null), i = P(null), a = /* @__PURE__ */ new Map(), f = Je({ top: 0, left: 0 }), p = P(null), _ = Je({ top: 0, left: 0 }), u = P(null), v = /* @__PURE__ */ new Map(), c = Je({});
|
|
8100
8100
|
function d(L) {
|
|
8101
|
-
var
|
|
8102
|
-
for (const B of ((
|
|
8101
|
+
var F;
|
|
8102
|
+
for (const B of ((F = n.catalog) == null ? void 0 : F.groups) ?? []) {
|
|
8103
8103
|
const Z = B.layers.find((J) => J.id === L);
|
|
8104
8104
|
if (Z) return Z;
|
|
8105
8105
|
}
|
|
8106
8106
|
return null;
|
|
8107
8107
|
}
|
|
8108
8108
|
X(() => n.selected, (L) => {
|
|
8109
|
-
L.forEach((
|
|
8110
|
-
o[
|
|
8109
|
+
L.forEach((F) => {
|
|
8110
|
+
o[F] == null && (o[F] = 100);
|
|
8111
8111
|
});
|
|
8112
8112
|
}, { immediate: !0 });
|
|
8113
8113
|
function g() {
|
|
8114
8114
|
if (!l.value) return;
|
|
8115
8115
|
const L = a.get(l.value);
|
|
8116
8116
|
if (!L) return;
|
|
8117
|
-
const
|
|
8118
|
-
f.top =
|
|
8117
|
+
const F = L.getBoundingClientRect();
|
|
8118
|
+
f.top = F.bottom + 8 + window.scrollY, f.left = F.left + window.scrollX;
|
|
8119
8119
|
}
|
|
8120
8120
|
X(() => n.selected, (L) => {
|
|
8121
|
-
L.forEach((
|
|
8122
|
-
c[
|
|
8121
|
+
L.forEach((F) => {
|
|
8122
|
+
c[F] == null && (c[F] = !0);
|
|
8123
8123
|
});
|
|
8124
8124
|
}, { immediate: !0 });
|
|
8125
|
-
function h(L,
|
|
8126
|
-
c[L] =
|
|
8125
|
+
function h(L, F) {
|
|
8126
|
+
c[L] = F;
|
|
8127
8127
|
const B = ge(L);
|
|
8128
|
-
B && B.setVisible(
|
|
8128
|
+
B && B.setVisible(F);
|
|
8129
8129
|
}
|
|
8130
|
-
function y(L,
|
|
8131
|
-
|
|
8130
|
+
function y(L, F) {
|
|
8131
|
+
F ? v.set(L, F) : v.delete(L);
|
|
8132
8132
|
}
|
|
8133
8133
|
function w(L) {
|
|
8134
8134
|
p.value = p.value === L ? null : L, p.value && Fe(() => E(L));
|
|
8135
8135
|
}
|
|
8136
8136
|
function E(L) {
|
|
8137
|
-
const
|
|
8138
|
-
if (!
|
|
8139
|
-
const B =
|
|
8137
|
+
const F = v.get(L);
|
|
8138
|
+
if (!F) return;
|
|
8139
|
+
const B = F.getBoundingClientRect();
|
|
8140
8140
|
_.top = B.bottom + 6 + window.scrollY, _.left = B.left + window.scrollX;
|
|
8141
8141
|
}
|
|
8142
8142
|
function z(L) {
|
|
8143
|
-
const
|
|
8144
|
-
|
|
8143
|
+
const F = ge(L);
|
|
8144
|
+
F && F.remove(), r("remove", L), p.value = null;
|
|
8145
8145
|
}
|
|
8146
8146
|
function V(L) {
|
|
8147
|
-
const
|
|
8147
|
+
const F = L.target, B = l.value, Z = p.value;
|
|
8148
8148
|
if (B) {
|
|
8149
8149
|
const J = i.value, G = a.get(B);
|
|
8150
|
-
if (J && J.contains(
|
|
8150
|
+
if (J && J.contains(F) || G && G.contains(F)) return;
|
|
8151
8151
|
l.value = null;
|
|
8152
8152
|
}
|
|
8153
8153
|
if (Z) {
|
|
8154
8154
|
const J = u.value, G = v.get(Z);
|
|
8155
|
-
if (J && J.contains(
|
|
8155
|
+
if (J && J.contains(F) || G && G.contains(F)) return;
|
|
8156
8156
|
p.value = null;
|
|
8157
8157
|
}
|
|
8158
8158
|
}
|
|
8159
|
-
function
|
|
8159
|
+
function M() {
|
|
8160
8160
|
l.value && g(), p.value && E(p.value);
|
|
8161
8161
|
}
|
|
8162
8162
|
Le(() => {
|
|
8163
|
-
document.addEventListener("click", V), window.addEventListener("resize",
|
|
8163
|
+
document.addEventListener("click", V), window.addEventListener("resize", M), window.addEventListener("scroll", M, !0);
|
|
8164
8164
|
}), ke(() => {
|
|
8165
|
-
document.removeEventListener("click", V), window.removeEventListener("resize",
|
|
8165
|
+
document.removeEventListener("click", V), window.removeEventListener("resize", M), window.removeEventListener("scroll", M, !0);
|
|
8166
8166
|
});
|
|
8167
8167
|
const { map: S } = He();
|
|
8168
8168
|
function x(L) {
|
|
8169
8169
|
var J, G, ve;
|
|
8170
8170
|
if (!L) return;
|
|
8171
|
-
const
|
|
8172
|
-
if (!
|
|
8171
|
+
const F = ge(L), B = d(L);
|
|
8172
|
+
if (!F && !B) return;
|
|
8173
8173
|
if (((J = B == null ? void 0 : B.extent) == null ? void 0 : J.length) === 4 && ((G = S.value) != null && G.fitBounds)) {
|
|
8174
8174
|
const de = B.extent.map((pe) => Number(pe));
|
|
8175
8175
|
if (de.every((pe) => Number.isFinite(pe))) {
|
|
@@ -8181,37 +8181,37 @@ const sp = {
|
|
|
8181
8181
|
return;
|
|
8182
8182
|
}
|
|
8183
8183
|
}
|
|
8184
|
-
(ve =
|
|
8184
|
+
(ve = F == null ? void 0 : F.getSource) != null && ve.call(F) && (p.value = null);
|
|
8185
8185
|
}
|
|
8186
|
-
const
|
|
8187
|
-
function R(L,
|
|
8188
|
-
|
|
8186
|
+
const k = P(null), I = P(null);
|
|
8187
|
+
function R(L, F) {
|
|
8188
|
+
k.value = F, I.value = F, L.dataTransfer && (L.dataTransfer.effectAllowed = "move", L.dataTransfer.setData("text/plain", String(F)));
|
|
8189
8189
|
}
|
|
8190
|
-
function
|
|
8191
|
-
|
|
8190
|
+
function T(L) {
|
|
8191
|
+
I.value = L;
|
|
8192
8192
|
}
|
|
8193
|
-
function
|
|
8194
|
-
if (L.preventDefault(),
|
|
8195
|
-
|
|
8193
|
+
function j(L, F) {
|
|
8194
|
+
if (L.preventDefault(), k.value === null || k.value === F) {
|
|
8195
|
+
k.value = null, I.value = null;
|
|
8196
8196
|
return;
|
|
8197
8197
|
}
|
|
8198
|
-
const B = [...n.selected], [Z] = B.splice(
|
|
8199
|
-
B.splice(
|
|
8198
|
+
const B = [...n.selected], [Z] = B.splice(k.value, 1);
|
|
8199
|
+
B.splice(F, 0, Z), r("reorder", B), k.value = null, I.value = null;
|
|
8200
8200
|
}
|
|
8201
|
-
function
|
|
8202
|
-
|
|
8201
|
+
function A() {
|
|
8202
|
+
k.value = null, I.value = null;
|
|
8203
8203
|
}
|
|
8204
8204
|
function U(L) {
|
|
8205
8205
|
return L == null || L === "" ? null : String(L);
|
|
8206
8206
|
}
|
|
8207
|
-
function N(L,
|
|
8208
|
-
return !Array.isArray(L) || L.length === 0 ? null : `${L.length} ${
|
|
8207
|
+
function N(L, F) {
|
|
8208
|
+
return !Array.isArray(L) || L.length === 0 ? null : `${L.length} ${F}`;
|
|
8209
8209
|
}
|
|
8210
8210
|
function O(L) {
|
|
8211
8211
|
var Be, Ye, Pe, Ze, et, ot;
|
|
8212
|
-
const
|
|
8213
|
-
if (!
|
|
8214
|
-
const Z = (B == null ? void 0 : B.name) || ((Ye = (Be =
|
|
8212
|
+
const F = ge(L), B = d(L);
|
|
8213
|
+
if (!F && !B) return [];
|
|
8214
|
+
const Z = (B == null ? void 0 : B.name) || ((Ye = (Be = F == null ? void 0 : F.opts) == null ? void 0 : Be.layer) == null ? void 0 : Ye.name) || null, J = (B == null ? void 0 : B.service) || ((Pe = F == null ? void 0 : F.opts) == null ? void 0 : Pe.service) || null, G = (Ze = F == null ? void 0 : F.getSource) == null ? void 0 : Ze.call(F), ve = G && "tiles" in G ? (et = G.tiles) == null ? void 0 : et[0] : (B == null ? void 0 : B.url) || null, de = (B == null ? void 0 : B.source_path) || null, pe = (F == null ? void 0 : F.popup) || (B == null ? void 0 : B.popup), $e = (F == null ? void 0 : F.card) || (B == null ? void 0 : B.card), ze = (B == null ? void 0 : B.filters) || ((ot = F == null ? void 0 : F.opts) == null ? void 0 : ot.filters);
|
|
8215
8215
|
return [
|
|
8216
8216
|
{ label: "Назва", value: U(Z) },
|
|
8217
8217
|
{ label: "Сервіс", value: U(J) },
|
|
@@ -8222,12 +8222,12 @@ const sp = {
|
|
|
8222
8222
|
{ label: "Фільтри", value: N(ze, "фільтрів") }
|
|
8223
8223
|
];
|
|
8224
8224
|
}
|
|
8225
|
-
return (L,
|
|
8225
|
+
return (L, F) => (m(), b("div", Xv, [
|
|
8226
8226
|
s("div", Jv, [
|
|
8227
8227
|
s("button", {
|
|
8228
8228
|
class: "selected-tab__add",
|
|
8229
|
-
onClick:
|
|
8230
|
-
}, [...
|
|
8229
|
+
onClick: F[0] || (F[0] = (B) => r("select-layer"))
|
|
8230
|
+
}, [...F[3] || (F[3] = [
|
|
8231
8231
|
s("svg", {
|
|
8232
8232
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8233
8233
|
width: "16",
|
|
@@ -8253,18 +8253,18 @@ const sp = {
|
|
|
8253
8253
|
return m(), b("div", {
|
|
8254
8254
|
key: B,
|
|
8255
8255
|
class: we(["selected-tab__item", {
|
|
8256
|
-
"selected-tab__item--dragging":
|
|
8257
|
-
"selected-tab__item--over":
|
|
8256
|
+
"selected-tab__item--dragging": k.value === Z,
|
|
8257
|
+
"selected-tab__item--over": I.value === Z
|
|
8258
8258
|
}]),
|
|
8259
8259
|
draggable: "true",
|
|
8260
8260
|
onDragstart: (G) => R(G, Z),
|
|
8261
|
-
onDragover: qe((G) =>
|
|
8262
|
-
onDrop: (G) =>
|
|
8263
|
-
onDragend:
|
|
8261
|
+
onDragover: qe((G) => T(Z), ["prevent"]),
|
|
8262
|
+
onDrop: (G) => j(G, Z),
|
|
8263
|
+
onDragend: A
|
|
8264
8264
|
}, [
|
|
8265
8265
|
s("div", tm, [
|
|
8266
8266
|
s("div", nm, [
|
|
8267
|
-
|
|
8267
|
+
F[4] || (F[4] = s("span", { class: "selected-tab__item-handle" }, "☰", -1)),
|
|
8268
8268
|
s("input", {
|
|
8269
8269
|
type: "checkbox",
|
|
8270
8270
|
class: "selected-tab__item-checkbox",
|
|
@@ -8281,7 +8281,7 @@ const sp = {
|
|
|
8281
8281
|
ref_for: !0,
|
|
8282
8282
|
ref: (G) => y(B, G),
|
|
8283
8283
|
onClick: qe((G) => w(B), ["stop"])
|
|
8284
|
-
}, [...
|
|
8284
|
+
}, [...F[5] || (F[5] = [
|
|
8285
8285
|
s("svg", {
|
|
8286
8286
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8287
8287
|
width: "18",
|
|
@@ -8328,8 +8328,8 @@ const sp = {
|
|
|
8328
8328
|
s("div", sm, [
|
|
8329
8329
|
s("button", {
|
|
8330
8330
|
class: "selected-tab__menu-item",
|
|
8331
|
-
onClick:
|
|
8332
|
-
}, [...
|
|
8331
|
+
onClick: F[1] || (F[1] = (B) => x(p.value))
|
|
8332
|
+
}, [...F[6] || (F[6] = [
|
|
8333
8333
|
s("svg", {
|
|
8334
8334
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8335
8335
|
width: "16",
|
|
@@ -8371,7 +8371,7 @@ const sp = {
|
|
|
8371
8371
|
le(Gv, {
|
|
8372
8372
|
items: O(p.value)
|
|
8373
8373
|
}, {
|
|
8374
|
-
default: Oe(() => [...
|
|
8374
|
+
default: Oe(() => [...F[7] || (F[7] = [
|
|
8375
8375
|
s("button", { class: "selected-tab__menu-item" }, [
|
|
8376
8376
|
s("svg", {
|
|
8377
8377
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8398,11 +8398,11 @@ const sp = {
|
|
|
8398
8398
|
])]),
|
|
8399
8399
|
_: 1
|
|
8400
8400
|
}, 8, ["items"]),
|
|
8401
|
-
|
|
8401
|
+
F[9] || (F[9] = s("hr", null, null, -1)),
|
|
8402
8402
|
s("button", {
|
|
8403
8403
|
class: "selected-tab__menu-item selected-tab__menu-item--danger",
|
|
8404
|
-
onClick:
|
|
8405
|
-
}, [...
|
|
8404
|
+
onClick: F[2] || (F[2] = (B) => z(p.value))
|
|
8405
|
+
}, [...F[8] || (F[8] = [
|
|
8406
8406
|
s("svg", {
|
|
8407
8407
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8408
8408
|
width: "16",
|
|
@@ -8493,46 +8493,46 @@ const sp = {
|
|
|
8493
8493
|
setup(e) {
|
|
8494
8494
|
const t = P("catalog"), n = P({ groups: [] }), r = P([]), o = P(""), { map: l } = He(), i = Rt(), a = Bt(), f = Je({}), p = P(null);
|
|
8495
8495
|
function _(R) {
|
|
8496
|
-
return n.value.groups.map((
|
|
8496
|
+
return n.value.groups.map((T) => T.layers.find((j) => j.id === R)).find(Boolean) || null;
|
|
8497
8497
|
}
|
|
8498
8498
|
function u() {
|
|
8499
8499
|
const R = p.value;
|
|
8500
8500
|
if (!R) return;
|
|
8501
8501
|
delete f[R];
|
|
8502
|
-
const
|
|
8503
|
-
|
|
8502
|
+
const T = ge(R);
|
|
8503
|
+
T != null && T.setFilter && T.setFilter("");
|
|
8504
8504
|
}
|
|
8505
|
-
function v(R,
|
|
8506
|
-
const
|
|
8507
|
-
if (f[R] = { ...
|
|
8508
|
-
const
|
|
8509
|
-
|
|
8505
|
+
function v(R, T) {
|
|
8506
|
+
const j = ge(R);
|
|
8507
|
+
if (f[R] = { ...T }, !(j != null && j.setFilter)) return;
|
|
8508
|
+
const A = Object.entries(T).filter(([, U]) => U != null && U !== "").map(([U, N]) => `${U}=${N}`);
|
|
8509
|
+
j.setFilter(A.join("|"));
|
|
8510
8510
|
}
|
|
8511
8511
|
function c(R) {
|
|
8512
|
-
const
|
|
8513
|
-
|
|
8512
|
+
const T = p.value;
|
|
8513
|
+
T && v(T, R);
|
|
8514
8514
|
}
|
|
8515
8515
|
function d(R) {
|
|
8516
|
-
const
|
|
8517
|
-
let
|
|
8518
|
-
if (
|
|
8519
|
-
const
|
|
8520
|
-
return
|
|
8521
|
-
service:
|
|
8516
|
+
const T = R.url;
|
|
8517
|
+
let j = null;
|
|
8518
|
+
if (T && (j = T.startsWith("http") ? T : `${window.location.origin}${T}`), !j) return null;
|
|
8519
|
+
const A = (R.service || "").toString().toLowerCase(), U = R.count ?? null;
|
|
8520
|
+
return A && A !== "vtile" ? {
|
|
8521
|
+
service: A,
|
|
8522
8522
|
count: U,
|
|
8523
8523
|
source: {
|
|
8524
8524
|
type: "raster",
|
|
8525
|
-
tiles: [
|
|
8525
|
+
tiles: [j],
|
|
8526
8526
|
tileSize: 256,
|
|
8527
8527
|
minzoom: 0,
|
|
8528
8528
|
maxzoom: 20
|
|
8529
8529
|
}
|
|
8530
8530
|
} : {
|
|
8531
|
-
service:
|
|
8531
|
+
service: A,
|
|
8532
8532
|
count: U,
|
|
8533
8533
|
source: {
|
|
8534
8534
|
type: "vector",
|
|
8535
|
-
tiles: [
|
|
8535
|
+
tiles: [j],
|
|
8536
8536
|
minzoom: 0,
|
|
8537
8537
|
maxzoom: 14
|
|
8538
8538
|
},
|
|
@@ -8541,15 +8541,15 @@ const sp = {
|
|
|
8541
8541
|
popup: R.popup
|
|
8542
8542
|
};
|
|
8543
8543
|
}
|
|
8544
|
-
function g(R,
|
|
8544
|
+
function g(R, T, j) {
|
|
8545
8545
|
var O;
|
|
8546
|
-
const
|
|
8547
|
-
if (!
|
|
8548
|
-
const U = d(
|
|
8546
|
+
const A = j ?? _(R);
|
|
8547
|
+
if (!A) return;
|
|
8548
|
+
const U = d(A);
|
|
8549
8549
|
if (!U) return;
|
|
8550
|
-
const N = ge(
|
|
8550
|
+
const N = ge(A.id, U, l);
|
|
8551
8551
|
if (N)
|
|
8552
|
-
if (N.setVisible(
|
|
8552
|
+
if (N.setVisible(T), T) {
|
|
8553
8553
|
if (!r.value.includes(R) && (r.value.push(R), (O = l.value) != null && O.getLayer(R)))
|
|
8554
8554
|
try {
|
|
8555
8555
|
l.value.moveLayer(R);
|
|
@@ -8561,31 +8561,31 @@ const sp = {
|
|
|
8561
8561
|
}
|
|
8562
8562
|
function h() {
|
|
8563
8563
|
r.value.forEach((R) => {
|
|
8564
|
-
const
|
|
8565
|
-
|
|
8564
|
+
const T = ge(R);
|
|
8565
|
+
T && T.setVisible(!1);
|
|
8566
8566
|
}), r.value = [];
|
|
8567
8567
|
}
|
|
8568
8568
|
function y(R) {
|
|
8569
8569
|
r.value = [...R], Fe(() => {
|
|
8570
8570
|
var U;
|
|
8571
8571
|
if (!l.value) return;
|
|
8572
|
-
const
|
|
8573
|
-
let
|
|
8574
|
-
const
|
|
8575
|
-
var L,
|
|
8576
|
-
return (O == null ? void 0 : O.source) === N || (O == null ? void 0 : O.id) === N || ((
|
|
8572
|
+
const T = ((U = l.value.getStyle()) == null ? void 0 : U.layers) ?? [];
|
|
8573
|
+
let j;
|
|
8574
|
+
const A = (N) => T.filter((O) => {
|
|
8575
|
+
var L, F;
|
|
8576
|
+
return (O == null ? void 0 : O.source) === N || (O == null ? void 0 : O.id) === N || ((F = (L = O == null ? void 0 : O.id) == null ? void 0 : L.startsWith) == null ? void 0 : F.call(L, `${N}`));
|
|
8577
8577
|
}).map((O) => O.id);
|
|
8578
8578
|
for (let N = R.length - 1; N >= 0; N -= 1) {
|
|
8579
|
-
const O = R[N], L =
|
|
8580
|
-
L.length && (L.forEach((
|
|
8579
|
+
const O = R[N], L = A(O);
|
|
8580
|
+
L.length && (L.forEach((F) => {
|
|
8581
8581
|
var B;
|
|
8582
|
-
if ((B = l.value) != null && B.getLayer(
|
|
8582
|
+
if ((B = l.value) != null && B.getLayer(F))
|
|
8583
8583
|
try {
|
|
8584
|
-
l.value.moveLayer(
|
|
8584
|
+
l.value.moveLayer(F, j);
|
|
8585
8585
|
} catch (Z) {
|
|
8586
|
-
console.warn("Cannot move layer",
|
|
8586
|
+
console.warn("Cannot move layer", F, Z);
|
|
8587
8587
|
}
|
|
8588
|
-
}),
|
|
8588
|
+
}), j = L[0]);
|
|
8589
8589
|
}
|
|
8590
8590
|
});
|
|
8591
8591
|
}
|
|
@@ -8598,23 +8598,23 @@ const sp = {
|
|
|
8598
8598
|
const z = D(() => p.value ? _(p.value) : null), V = D(() => {
|
|
8599
8599
|
const R = p.value;
|
|
8600
8600
|
return R ? f[R] ?? {} : {};
|
|
8601
|
-
}),
|
|
8601
|
+
}), M = D(() => n.value.groups.reduce((R, T) => R + T.layers.length, 0)), S = D(() => t.value === "selected" ? "Вибрані шари" : t.value === "filter" ? "Фільтр шарів" : "Каталог"), x = D(() => t.value === "selected" ? r.value.length : t.value === "catalog" ? M.value : null), k = D(() => {
|
|
8602
8602
|
var R;
|
|
8603
8603
|
return t.value === "filter" ? ((R = z.value) == null ? void 0 : R.name) ?? "" : "";
|
|
8604
8604
|
});
|
|
8605
|
-
async function
|
|
8606
|
-
const
|
|
8607
|
-
|
|
8605
|
+
async function I() {
|
|
8606
|
+
const T = await (await fetch("/api/gis-layer-list")).json(), j = /* @__PURE__ */ new Map();
|
|
8607
|
+
T.forEach((N) => {
|
|
8608
8608
|
const O = N.group_id ?? "other";
|
|
8609
|
-
|
|
8609
|
+
j.has(O) || j.set(O, {
|
|
8610
8610
|
id: O,
|
|
8611
8611
|
name: N.group_name || "Інші шари",
|
|
8612
8612
|
layers: []
|
|
8613
|
-
}),
|
|
8614
|
-
}), n.value = { groups: Array.from(
|
|
8615
|
-
const
|
|
8616
|
-
if (!
|
|
8617
|
-
const U = Array.isArray(
|
|
8613
|
+
}), j.get(O).layers.push(N);
|
|
8614
|
+
}), n.value = { groups: Array.from(j.values()) };
|
|
8615
|
+
const A = i.query.layers;
|
|
8616
|
+
if (!A) return;
|
|
8617
|
+
const U = Array.isArray(A) ? A[0] : A;
|
|
8618
8618
|
typeof U == "string" && U.split(",").forEach((N) => {
|
|
8619
8619
|
const O = N.trim();
|
|
8620
8620
|
if (!O) return;
|
|
@@ -8629,15 +8629,15 @@ const sp = {
|
|
|
8629
8629
|
}), X(
|
|
8630
8630
|
r,
|
|
8631
8631
|
(R) => {
|
|
8632
|
-
const
|
|
8633
|
-
R.length ?
|
|
8632
|
+
const T = { ...i.query };
|
|
8633
|
+
R.length ? T.layers = R.join(",") : delete T.layers, a.replace({ query: T }).catch(() => {
|
|
8634
8634
|
});
|
|
8635
8635
|
},
|
|
8636
8636
|
{ deep: !0 }
|
|
8637
|
-
), Le(
|
|
8637
|
+
), Le(I), (R, T) => (m(), b("div", ym, [
|
|
8638
8638
|
s("div", xm, [
|
|
8639
8639
|
s("div", bm, [
|
|
8640
|
-
|
|
8640
|
+
T[5] || (T[5] = s("svg", {
|
|
8641
8641
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8642
8642
|
width: "20",
|
|
8643
8643
|
height: "20",
|
|
@@ -8656,27 +8656,27 @@ const sp = {
|
|
|
8656
8656
|
s("h2", _m, [
|
|
8657
8657
|
me(Y(S.value) + " ", 1),
|
|
8658
8658
|
x.value !== null ? (m(), b("span", wm, "(" + Y(x.value) + ")", 1)) : W("", !0),
|
|
8659
|
-
|
|
8659
|
+
k.value ? (m(), b("span", km, Y(k.value), 1)) : W("", !0)
|
|
8660
8660
|
])
|
|
8661
8661
|
]),
|
|
8662
8662
|
s("button", {
|
|
8663
8663
|
onClick: h,
|
|
8664
8664
|
class: "p-1 rounded-full hover:bg-gray-200 transition-colors",
|
|
8665
8665
|
"aria-label": "Reset layers"
|
|
8666
|
-
}, [...
|
|
8666
|
+
}, [...T[6] || (T[6] = [
|
|
8667
8667
|
$t('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw text-gray-600" data-v-205c8f6a><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" data-v-205c8f6a></path><path d="M21 3v5h-5" data-v-205c8f6a></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" data-v-205c8f6a></path><path d="M8 16H3v5" data-v-205c8f6a></path></svg>', 1)
|
|
8668
8668
|
])])
|
|
8669
8669
|
]),
|
|
8670
8670
|
s("div", $m, [
|
|
8671
8671
|
s("button", {
|
|
8672
|
-
onClick:
|
|
8672
|
+
onClick: T[0] || (T[0] = (j) => t.value = "catalog"),
|
|
8673
8673
|
class: we([
|
|
8674
8674
|
"px-4 py-2 text-sm font-medium",
|
|
8675
8675
|
t.value === "catalog" ? "text-blue-600 border-b-2 border-blue-600" : "text-gray-600 hover:text-gray-800"
|
|
8676
8676
|
])
|
|
8677
8677
|
}, " Каталог ", 2),
|
|
8678
8678
|
s("button", {
|
|
8679
|
-
onClick:
|
|
8679
|
+
onClick: T[1] || (T[1] = (j) => t.value = "selected"),
|
|
8680
8680
|
class: we([
|
|
8681
8681
|
"px-4 py-2 text-sm font-medium",
|
|
8682
8682
|
t.value === "selected" ? "text-blue-600 border-b-2 border-blue-600" : "text-gray-600 hover:text-gray-800"
|
|
@@ -8690,7 +8690,7 @@ const sp = {
|
|
|
8690
8690
|
catalog: n.value,
|
|
8691
8691
|
selected: r.value,
|
|
8692
8692
|
search: o.value,
|
|
8693
|
-
"onUpdate:search":
|
|
8693
|
+
"onUpdate:search": T[2] || (T[2] = (j) => o.value = j),
|
|
8694
8694
|
onToggleLayer: g,
|
|
8695
8695
|
onOpenFilter: w
|
|
8696
8696
|
}, null, 8, ["catalog", "selected", "search"])) : t.value === "selected" ? (m(), te(um, {
|
|
@@ -8698,9 +8698,9 @@ const sp = {
|
|
|
8698
8698
|
catalog: n.value,
|
|
8699
8699
|
selected: r.value,
|
|
8700
8700
|
onToggleLayer: g,
|
|
8701
|
-
onSelectLayer:
|
|
8701
|
+
onSelectLayer: T[3] || (T[3] = (j) => t.value = "catalog"),
|
|
8702
8702
|
onReorder: y,
|
|
8703
|
-
onRemove:
|
|
8703
|
+
onRemove: T[4] || (T[4] = (j) => r.value = r.value.filter((A) => A !== j))
|
|
8704
8704
|
}, null, 8, ["catalog", "selected"])) : (m(), te(hm, {
|
|
8705
8705
|
key: 2,
|
|
8706
8706
|
layer: z.value,
|
|
@@ -8792,13 +8792,13 @@ const sp = {
|
|
|
8792
8792
|
return ((O = (N = w.value) == null ? void 0 : N.filters) == null ? void 0 : O.length) || 0;
|
|
8793
8793
|
});
|
|
8794
8794
|
async function z(N) {
|
|
8795
|
-
var
|
|
8795
|
+
var F;
|
|
8796
8796
|
const O = await fetch(`/api/gis-service/${encodeURIComponent(N)}`);
|
|
8797
8797
|
if (!O.ok) {
|
|
8798
8798
|
let B = "Не вдалося завантажити налаштування шару";
|
|
8799
8799
|
try {
|
|
8800
8800
|
const Z = await O.json();
|
|
8801
|
-
B = ((
|
|
8801
|
+
B = ((F = Z == null ? void 0 : Z.message) == null ? void 0 : F.error) || (Z == null ? void 0 : Z.message) || B;
|
|
8802
8802
|
} catch {
|
|
8803
8803
|
}
|
|
8804
8804
|
throw new Error(B);
|
|
@@ -8812,11 +8812,11 @@ const sp = {
|
|
|
8812
8812
|
function V(N, O) {
|
|
8813
8813
|
let L = ge(N);
|
|
8814
8814
|
if (!L) {
|
|
8815
|
-
const
|
|
8815
|
+
const F = `${location.origin}/api/vtile/${N}/ua/{z}/{x}/{y}.vmt`;
|
|
8816
8816
|
L = ge(N, {
|
|
8817
8817
|
source: {
|
|
8818
8818
|
type: "vector",
|
|
8819
|
-
tiles: [
|
|
8819
|
+
tiles: [F],
|
|
8820
8820
|
minzoom: 0,
|
|
8821
8821
|
maxzoom: 14
|
|
8822
8822
|
},
|
|
@@ -8832,44 +8832,44 @@ const sp = {
|
|
|
8832
8832
|
}
|
|
8833
8833
|
return a.value = L, L;
|
|
8834
8834
|
}
|
|
8835
|
-
async function
|
|
8835
|
+
async function M(N, O) {
|
|
8836
8836
|
var B;
|
|
8837
|
-
const L = `/api/gis-service/${encodeURIComponent(N)}/${encodeURIComponent(O)}`,
|
|
8838
|
-
if (!
|
|
8837
|
+
const L = `/api/gis-service/${encodeURIComponent(N)}/${encodeURIComponent(O)}`, F = await fetch(L);
|
|
8838
|
+
if (!F.ok) {
|
|
8839
8839
|
let Z = "Не вдалося отримати статистику";
|
|
8840
8840
|
try {
|
|
8841
|
-
const J = await
|
|
8841
|
+
const J = await F.json();
|
|
8842
8842
|
Z = ((B = J == null ? void 0 : J.message) == null ? void 0 : B.error) || (J == null ? void 0 : J.message) || Z;
|
|
8843
8843
|
} catch {
|
|
8844
8844
|
}
|
|
8845
8845
|
throw new Error(Z);
|
|
8846
8846
|
}
|
|
8847
|
-
return
|
|
8847
|
+
return F.json();
|
|
8848
8848
|
}
|
|
8849
8849
|
function S(N) {
|
|
8850
8850
|
const O = /* @__PURE__ */ new Map();
|
|
8851
|
-
return N && (N.rules || []).forEach((
|
|
8852
|
-
const B = (
|
|
8853
|
-
B != null && O.set(String(B),
|
|
8851
|
+
return N && (N.rules || []).forEach((F) => {
|
|
8852
|
+
const B = (F == null ? void 0 : F.value) ?? (F == null ? void 0 : F.id);
|
|
8853
|
+
B != null && O.set(String(B), F);
|
|
8854
8854
|
}), O;
|
|
8855
8855
|
}
|
|
8856
|
-
function x(N, O, L,
|
|
8856
|
+
function x(N, O, L, F, B) {
|
|
8857
8857
|
if (typeof (O == null ? void 0 : O.color) == "string" && O.color.trim()) return O.color.trim();
|
|
8858
8858
|
const Z = n.config.colors || {};
|
|
8859
8859
|
if (Z[N]) return Z[N];
|
|
8860
8860
|
const G = S(L == null ? void 0 : L.style).get(N);
|
|
8861
8861
|
return typeof (G == null ? void 0 : G.color) == "string" && G.color.trim() ? G.color.trim() : t[B % t.length];
|
|
8862
8862
|
}
|
|
8863
|
-
function
|
|
8863
|
+
function k(N, O, L, F) {
|
|
8864
8864
|
var B;
|
|
8865
|
-
return (O == null ? void 0 : O.text) || (O == null ? void 0 : O.label) || (O == null ? void 0 : O.name) || (O == null ? void 0 : O[`${
|
|
8865
|
+
return (O == null ? void 0 : O.text) || (O == null ? void 0 : O.label) || (O == null ? void 0 : O.name) || (O == null ? void 0 : O[`${F}_text`]) || ((B = S(L == null ? void 0 : L.style).get(N)) == null ? void 0 : B.label) || N;
|
|
8866
8866
|
}
|
|
8867
|
-
function
|
|
8867
|
+
function I(N, O, L, F) {
|
|
8868
8868
|
if (!N) return;
|
|
8869
|
-
const B = c((O == null ? void 0 : O.style) || _.value) || {}, Z =
|
|
8869
|
+
const B = c((O == null ? void 0 : O.style) || _.value) || {}, Z = F.trim();
|
|
8870
8870
|
if (!Z) return;
|
|
8871
8871
|
const J = { ...B.colors || {}, ...n.config.colors || {} };
|
|
8872
|
-
Z ===
|
|
8872
|
+
Z === F && L.forEach((G) => {
|
|
8873
8873
|
G.color.trim() && (J[G.id] = G.color);
|
|
8874
8874
|
}), N.setStyle({
|
|
8875
8875
|
...B,
|
|
@@ -8889,10 +8889,10 @@ const sp = {
|
|
|
8889
8889
|
o.value = !0;
|
|
8890
8890
|
const L = await z(N);
|
|
8891
8891
|
V(N, L);
|
|
8892
|
-
const
|
|
8892
|
+
const F = await M(N, O), B = Array.isArray(F == null ? void 0 : F.rows) ? F.rows.map((G, ve) => {
|
|
8893
8893
|
const de = (G == null ? void 0 : G.id) ?? (G == null ? void 0 : G.value), pe = de != null ? String(de) : "";
|
|
8894
8894
|
if (!pe) return null;
|
|
8895
|
-
const $e =
|
|
8895
|
+
const $e = k(pe, G, L, O), ze = Number((G == null ? void 0 : G.count) ?? 0) || 0, Be = x(pe, G, L, O, ve);
|
|
8896
8896
|
return {
|
|
8897
8897
|
id: pe,
|
|
8898
8898
|
label: $e,
|
|
@@ -8900,7 +8900,7 @@ const sp = {
|
|
|
8900
8900
|
color: Be
|
|
8901
8901
|
};
|
|
8902
8902
|
}).filter(Boolean) : [];
|
|
8903
|
-
l.value = B, i.value = ((Z =
|
|
8903
|
+
l.value = B, i.value = ((Z = F == null ? void 0 : F.field) == null ? void 0 : Z.label) || ((J = F == null ? void 0 : F.field) == null ? void 0 : J.name) || null, I(a.value, L, B, O), o.value = !1;
|
|
8904
8904
|
}
|
|
8905
8905
|
X(
|
|
8906
8906
|
() => [d.value, y.value],
|
|
@@ -8909,13 +8909,13 @@ const sp = {
|
|
|
8909
8909
|
},
|
|
8910
8910
|
{ immediate: !0 }
|
|
8911
8911
|
);
|
|
8912
|
-
const
|
|
8912
|
+
const T = D(() => "Набори даних"), j = D(() => l.value.reduce((N, O) => N + O.count, 0)), A = D(() => {
|
|
8913
8913
|
var L;
|
|
8914
8914
|
const N = y.value;
|
|
8915
|
-
return ((L = h.value.find((
|
|
8915
|
+
return ((L = h.value.find((F) => F.id === N)) == null ? void 0 : L.label) || null || i.value || N || null;
|
|
8916
8916
|
});
|
|
8917
8917
|
function U(N) {
|
|
8918
|
-
return
|
|
8918
|
+
return j.value ? `${(N / j.value * 100).toFixed(2)}%` : "0.00%";
|
|
8919
8919
|
}
|
|
8920
8920
|
return ke(() => {
|
|
8921
8921
|
var N, O;
|
|
@@ -8923,8 +8923,8 @@ const sp = {
|
|
|
8923
8923
|
}), (N, O) => r.value ? (m(), b("div", Lm, [
|
|
8924
8924
|
s("div", Sm, [
|
|
8925
8925
|
s("div", null, [
|
|
8926
|
-
s("h2", Em, Y(
|
|
8927
|
-
|
|
8926
|
+
s("h2", Em, Y(T.value), 1),
|
|
8927
|
+
A.value && h.value.length === 1 ? (m(), b("p", Fm, Y(A.value), 1)) : W("", !0)
|
|
8928
8928
|
]),
|
|
8929
8929
|
s("div", Tm, [
|
|
8930
8930
|
w.value ? (m(), te(pn, {
|
|
@@ -8964,7 +8964,7 @@ const sp = {
|
|
|
8964
8964
|
type: "radio",
|
|
8965
8965
|
class: "text-sky-600 focus:ring-sky-500",
|
|
8966
8966
|
value: L.id,
|
|
8967
|
-
"onUpdate:modelValue": O[2] || (O[2] = (
|
|
8967
|
+
"onUpdate:modelValue": O[2] || (O[2] = (F) => v.value = F)
|
|
8968
8968
|
}, null, 8, Om), [
|
|
8969
8969
|
[Wo, v.value]
|
|
8970
8970
|
]),
|
|
@@ -8973,7 +8973,7 @@ const sp = {
|
|
|
8973
8973
|
])
|
|
8974
8974
|
])) : W("", !0),
|
|
8975
8975
|
o.value ? (m(), b("div", Nm, "Завантаження…")) : l.value.length ? (m(), b(K, { key: 3 }, [
|
|
8976
|
-
s("h4", Pm, Y(
|
|
8976
|
+
s("h4", Pm, Y(j.value), 1),
|
|
8977
8977
|
s("ul", Dm, [
|
|
8978
8978
|
(m(!0), b(K, null, oe(l.value, (L) => (m(), b("li", {
|
|
8979
8979
|
key: L.id,
|
|
@@ -9011,7 +9011,7 @@ const sp = {
|
|
|
9011
9011
|
setup(e) {
|
|
9012
9012
|
const t = e, n = He(), r = ["xy", "parcel"], o = D(() => {
|
|
9013
9013
|
var z, V;
|
|
9014
|
-
const E = (V = (z = t.config) == null ? void 0 : z.tools) == null ? void 0 : V.filter((
|
|
9014
|
+
const E = (V = (z = t.config) == null ? void 0 : z.tools) == null ? void 0 : V.filter((M) => r.includes(M));
|
|
9015
9015
|
return E && E.length ? E : r;
|
|
9016
9016
|
}), l = D(() => {
|
|
9017
9017
|
var E, z;
|
|
@@ -9045,25 +9045,25 @@ const sp = {
|
|
|
9045
9045
|
if (!z) return null;
|
|
9046
9046
|
const V = z.split(/\s+/).filter(Boolean);
|
|
9047
9047
|
if (V.length < 2) return null;
|
|
9048
|
-
const
|
|
9049
|
-
if (!
|
|
9050
|
-
let [S, x] =
|
|
9051
|
-
const R = (
|
|
9052
|
-
if (!R(
|
|
9053
|
-
if (R(
|
|
9054
|
-
|
|
9048
|
+
const M = V.slice(0, 2).map(Number);
|
|
9049
|
+
if (!M.every((j) => Number.isFinite(j))) return null;
|
|
9050
|
+
let [S, x] = M, k = S, I = x;
|
|
9051
|
+
const R = (j) => Math.abs(j) <= 90, T = (j) => Math.abs(j) <= 180;
|
|
9052
|
+
if (!R(k) || !T(I))
|
|
9053
|
+
if (R(I) && T(k))
|
|
9054
|
+
k = x, I = S;
|
|
9055
9055
|
else
|
|
9056
9056
|
return null;
|
|
9057
|
-
return { lat:
|
|
9057
|
+
return { lat: k, lng: I };
|
|
9058
9058
|
}
|
|
9059
9059
|
function d(E) {
|
|
9060
|
-
return ((E == null ? void 0 : E.items) || []).map((V,
|
|
9061
|
-
var S, x,
|
|
9060
|
+
return ((E == null ? void 0 : E.items) || []).map((V, M) => {
|
|
9061
|
+
var S, x, k;
|
|
9062
9062
|
return {
|
|
9063
|
-
id: String((V == null ? void 0 : V.id) ??
|
|
9063
|
+
id: String((V == null ? void 0 : V.id) ?? M),
|
|
9064
9064
|
title: (V == null ? void 0 : V.title) || ((S = V == null ? void 0 : V.address) == null ? void 0 : S.label) || "Знайдений обʼєкт",
|
|
9065
9065
|
lat: Number((x = V == null ? void 0 : V.position) == null ? void 0 : x.lat),
|
|
9066
|
-
lng: Number((
|
|
9066
|
+
lng: Number((k = V == null ? void 0 : V.position) == null ? void 0 : k.lng)
|
|
9067
9067
|
};
|
|
9068
9068
|
});
|
|
9069
9069
|
}
|
|
@@ -9072,26 +9072,26 @@ const sp = {
|
|
|
9072
9072
|
if (!z) return [];
|
|
9073
9073
|
const V = z.geom_centroid;
|
|
9074
9074
|
if (!V || !Array.isArray(V.coordinates)) return [];
|
|
9075
|
-
const [
|
|
9076
|
-
return !Number.isFinite(S) || !Number.isFinite(
|
|
9075
|
+
const [M, S] = V.coordinates;
|
|
9076
|
+
return !Number.isFinite(S) || !Number.isFinite(M) ? [] : [
|
|
9077
9077
|
{
|
|
9078
9078
|
id: "parcel",
|
|
9079
9079
|
title: z.cadnum || z.cad_num || "Земельна ділянка",
|
|
9080
9080
|
lat: S,
|
|
9081
|
-
lng:
|
|
9081
|
+
lng: M
|
|
9082
9082
|
}
|
|
9083
9083
|
];
|
|
9084
9084
|
}
|
|
9085
9085
|
function h(E) {
|
|
9086
9086
|
const V = E.replace(/\s+/g, "").split(":");
|
|
9087
9087
|
if (console.log(V), V.length !== 4) return !1;
|
|
9088
|
-
const
|
|
9089
|
-
return V.every((S, x) => S.length ===
|
|
9088
|
+
const M = [10, 2, 3, 4];
|
|
9089
|
+
return V.every((S, x) => S.length === M[x] && /^\d+$/.test(S));
|
|
9090
9090
|
}
|
|
9091
9091
|
function y(E) {
|
|
9092
|
-
var V,
|
|
9092
|
+
var V, M;
|
|
9093
9093
|
const z = ((V = t.config) == null ? void 0 : V.zoom) ?? 17;
|
|
9094
|
-
(
|
|
9094
|
+
(M = n.flyTo) == null || M.call(n, { center: [E.lng, E.lat], zoom: z });
|
|
9095
9095
|
}
|
|
9096
9096
|
async function w() {
|
|
9097
9097
|
const E = a.value.trim();
|
|
@@ -9118,7 +9118,7 @@ const sp = {
|
|
|
9118
9118
|
}
|
|
9119
9119
|
const V = await fetch(z.toString());
|
|
9120
9120
|
if (!V.ok) throw new Error(`HTTP ${V.status}`);
|
|
9121
|
-
const
|
|
9121
|
+
const M = await V.json(), S = i.value === "here" ? d(M) : g(M);
|
|
9122
9122
|
if (!S.length)
|
|
9123
9123
|
je({ type: "warning", title: "Пошук", message: "Не знайдено результатів" });
|
|
9124
9124
|
else {
|
|
@@ -9168,7 +9168,7 @@ const sp = {
|
|
|
9168
9168
|
(m(!0), b(K, null, oe(o.value, (V) => (m(), b("li", {
|
|
9169
9169
|
key: V,
|
|
9170
9170
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100",
|
|
9171
|
-
onClick: (
|
|
9171
|
+
onClick: (M) => _(V)
|
|
9172
9172
|
}, Y(v(V)), 9, Wm))), 128))
|
|
9173
9173
|
])
|
|
9174
9174
|
])) : W("", !0)
|
|
@@ -9219,82 +9219,82 @@ const sp = {
|
|
|
9219
9219
|
function _() {
|
|
9220
9220
|
!window.mapboxgl && window.maplibregl && (window.mapboxgl = window.maplibregl);
|
|
9221
9221
|
}
|
|
9222
|
-
function u(
|
|
9223
|
-
if (Array.from(document.styleSheets).some((
|
|
9224
|
-
var
|
|
9225
|
-
return (
|
|
9222
|
+
function u(M) {
|
|
9223
|
+
if (Array.from(document.styleSheets).some((k) => {
|
|
9224
|
+
var I;
|
|
9225
|
+
return (I = k == null ? void 0 : k.href) == null ? void 0 : I.includes(M);
|
|
9226
9226
|
})) return;
|
|
9227
9227
|
const x = document.createElement("link");
|
|
9228
|
-
x.rel = "stylesheet", x.href =
|
|
9228
|
+
x.rel = "stylesheet", x.href = M, document.head.appendChild(x);
|
|
9229
9229
|
}
|
|
9230
|
-
function v(
|
|
9230
|
+
function v(M) {
|
|
9231
9231
|
return new Promise((S, x) => {
|
|
9232
|
-
const
|
|
9233
|
-
if (
|
|
9234
|
-
if (
|
|
9235
|
-
|
|
9232
|
+
const k = Array.from(document.scripts).find((R) => R.src === M);
|
|
9233
|
+
if (k) {
|
|
9234
|
+
if (k._loaded) return S();
|
|
9235
|
+
k.addEventListener("load", () => S()), k.addEventListener("error", () => x(new Error(`Failed ${M}`)));
|
|
9236
9236
|
return;
|
|
9237
9237
|
}
|
|
9238
|
-
const
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
},
|
|
9238
|
+
const I = document.createElement("script");
|
|
9239
|
+
I.src = M, I.async = !0, I.onload = () => {
|
|
9240
|
+
I._loaded = !0, S();
|
|
9241
|
+
}, I.onerror = () => x(new Error(`Failed ${M}`)), document.head.appendChild(I);
|
|
9242
9242
|
});
|
|
9243
9243
|
}
|
|
9244
9244
|
function c() {
|
|
9245
|
-
var S, x,
|
|
9246
|
-
const
|
|
9247
|
-
return
|
|
9245
|
+
var S, x, k;
|
|
9246
|
+
const M = window;
|
|
9247
|
+
return M.MapboxExportControl || ((S = M.mapboxgl) == null ? void 0 : S.MapboxExportControl) || ((x = M.mapboxglExport) == null ? void 0 : x.MapboxExportControl) || ((k = M.mapboxglExport) == null ? void 0 : k.default) || null;
|
|
9248
9248
|
}
|
|
9249
9249
|
function d() {
|
|
9250
|
-
const
|
|
9251
|
-
return
|
|
9250
|
+
const M = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
9251
|
+
return M.setAttribute("xmlns", "http://www.w3.org/2000/svg"), M.setAttribute("viewBox", "0 0 24 24"), M.setAttribute("width", "18"), M.setAttribute("height", "18"), M.setAttribute("fill", "none"), M.setAttribute("stroke", "currentColor"), M.setAttribute("stroke-width", "2"), M.setAttribute("stroke-linecap", "round"), M.setAttribute("stroke-linejoin", "round"), M.classList.add("map-control-button__icon"), [
|
|
9252
9252
|
{ d: "M0 0h24v24H0z", stroke: "none", fill: "none" },
|
|
9253
9253
|
{ d: "M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2" },
|
|
9254
9254
|
{ d: "M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4" },
|
|
9255
9255
|
{ d: "M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z" }
|
|
9256
|
-
].forEach((x,
|
|
9257
|
-
const
|
|
9258
|
-
Object.entries(x).forEach(([R,
|
|
9259
|
-
|
|
9260
|
-
}),
|
|
9261
|
-
}),
|
|
9256
|
+
].forEach((x, k) => {
|
|
9257
|
+
const I = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
9258
|
+
Object.entries(x).forEach(([R, T]) => {
|
|
9259
|
+
I.setAttribute(R, T);
|
|
9260
|
+
}), M.appendChild(I);
|
|
9261
|
+
}), M;
|
|
9262
9262
|
}
|
|
9263
9263
|
function g() {
|
|
9264
|
-
const
|
|
9265
|
-
|
|
9264
|
+
const M = document.createElement("button");
|
|
9265
|
+
M.id = "print-btn", M.type = "button", M.className = [
|
|
9266
9266
|
"group relative flex items-center justify-center",
|
|
9267
9267
|
"w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200",
|
|
9268
9268
|
"bg-white text-gray-700 hover:bg-gray-50 hover:scale-105",
|
|
9269
9269
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2"
|
|
9270
|
-
].join(" "),
|
|
9270
|
+
].join(" "), M.setAttribute("aria-label", "Друк");
|
|
9271
9271
|
const S = d(), x = document.createElement("span");
|
|
9272
9272
|
return x.className = [
|
|
9273
9273
|
"absolute left-full ml-3 px-3 py-1.5",
|
|
9274
9274
|
"bg-gray-900 text-white text-sm font-medium rounded-md",
|
|
9275
9275
|
"opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
9276
9276
|
"pointer-events-none transition-opacity duration-200 whitespace-nowrap"
|
|
9277
|
-
].join(" "), x.textContent = "Друк", x.setAttribute("aria-hidden", "true"),
|
|
9278
|
-
|
|
9279
|
-
}), f.value =
|
|
9277
|
+
].join(" "), x.textContent = "Друк", x.setAttribute("aria-hidden", "true"), M.appendChild(S), M.appendChild(x), M.addEventListener("click", (k) => {
|
|
9278
|
+
k.stopPropagation(), h();
|
|
9279
|
+
}), f.value = M, M;
|
|
9280
9280
|
}
|
|
9281
9281
|
function h() {
|
|
9282
9282
|
if (!a.value) return;
|
|
9283
9283
|
a.value.style.display === "block" ? w() : y();
|
|
9284
9284
|
}
|
|
9285
9285
|
function y() {
|
|
9286
|
-
var
|
|
9287
|
-
a.value && (a.value.style.display = "block", (
|
|
9286
|
+
var M, S, x;
|
|
9287
|
+
a.value && (a.value.style.display = "block", (M = f.value) == null || M.classList.add("scale-105", "shadow-xl"), (S = i.value) == null || S.toggleCrosshair(!0), (x = i.value) == null || x.togglePrintableArea(!0), document.addEventListener("click", E));
|
|
9288
9288
|
}
|
|
9289
9289
|
function w() {
|
|
9290
|
-
var
|
|
9291
|
-
a.value && (a.value.style.display = "none", (
|
|
9290
|
+
var M, S, x;
|
|
9291
|
+
a.value && (a.value.style.display = "none", (M = f.value) == null || M.classList.remove("scale-105", "shadow-xl"), (S = i.value) == null || S.toggleCrosshair(!1), (x = i.value) == null || x.togglePrintableArea(!1), document.removeEventListener("click", E));
|
|
9292
9292
|
}
|
|
9293
|
-
function E(
|
|
9293
|
+
function E(M) {
|
|
9294
9294
|
const S = l.value;
|
|
9295
|
-
S && (
|
|
9295
|
+
S && (M.target && S.contains(M.target) || w());
|
|
9296
9296
|
}
|
|
9297
|
-
function z(
|
|
9297
|
+
function z(M) {
|
|
9298
9298
|
const S = {
|
|
9299
9299
|
Size: "Розмір",
|
|
9300
9300
|
Orientation: "Орієнтація",
|
|
@@ -9309,40 +9309,40 @@ const sp = {
|
|
|
9309
9309
|
"Page Size": "Розмір",
|
|
9310
9310
|
"Page Orientation": "Орієнтація"
|
|
9311
9311
|
};
|
|
9312
|
-
|
|
9312
|
+
M.querySelectorAll("label, option").forEach((k) => {
|
|
9313
9313
|
var R;
|
|
9314
|
-
const
|
|
9315
|
-
|
|
9314
|
+
const I = (R = k.textContent) == null ? void 0 : R.trim();
|
|
9315
|
+
I && S[I] && (k.textContent = S[I]);
|
|
9316
9316
|
});
|
|
9317
|
-
const x =
|
|
9317
|
+
const x = M.querySelector("button");
|
|
9318
9318
|
x && (x.textContent = "Друкувати");
|
|
9319
9319
|
}
|
|
9320
|
-
function V(
|
|
9321
|
-
const S =
|
|
9320
|
+
function V(M) {
|
|
9321
|
+
const S = M.querySelector(".mapboxgl-export-list");
|
|
9322
9322
|
if (!S || !l.value) return;
|
|
9323
9323
|
a.value = S;
|
|
9324
|
-
const x =
|
|
9325
|
-
if (x && (x.style.display = "none"),
|
|
9326
|
-
const
|
|
9327
|
-
l.value.appendChild(
|
|
9324
|
+
const x = M.querySelector("button");
|
|
9325
|
+
if (x && (x.style.display = "none"), M.style.display = "none", !f.value) {
|
|
9326
|
+
const I = g();
|
|
9327
|
+
l.value.appendChild(I);
|
|
9328
9328
|
}
|
|
9329
9329
|
S.style.display = "none";
|
|
9330
|
-
const
|
|
9331
|
-
if (!S[
|
|
9332
|
-
const
|
|
9333
|
-
S.addEventListener("click",
|
|
9330
|
+
const k = "_printControlBound";
|
|
9331
|
+
if (!S[k]) {
|
|
9332
|
+
const I = (R) => R.stopPropagation();
|
|
9333
|
+
S.addEventListener("click", I), S.addEventListener("mousedown", I), S[k] = !0;
|
|
9334
9334
|
}
|
|
9335
9335
|
l.value.appendChild(S), z(S);
|
|
9336
9336
|
}
|
|
9337
9337
|
return Le(async () => {
|
|
9338
9338
|
await (n == null ? void 0 : n());
|
|
9339
|
-
const
|
|
9340
|
-
if (!
|
|
9339
|
+
const M = t.value;
|
|
9340
|
+
if (!M) return;
|
|
9341
9341
|
u(e0), _();
|
|
9342
9342
|
try {
|
|
9343
9343
|
await v(t0);
|
|
9344
|
-
} catch (
|
|
9345
|
-
console.warn("[MapPrintControl] load error",
|
|
9344
|
+
} catch (k) {
|
|
9345
|
+
console.warn("[MapPrintControl] load error", k);
|
|
9346
9346
|
return;
|
|
9347
9347
|
}
|
|
9348
9348
|
const S = c();
|
|
@@ -9356,25 +9356,25 @@ const sp = {
|
|
|
9356
9356
|
PrintableArea: !0
|
|
9357
9357
|
});
|
|
9358
9358
|
if (i.value = x, typeof x.onAdd == "function") {
|
|
9359
|
-
const
|
|
9360
|
-
x.onAdd = (
|
|
9361
|
-
const R =
|
|
9359
|
+
const k = x.onAdd.bind(x);
|
|
9360
|
+
x.onAdd = (I) => {
|
|
9361
|
+
const R = k(I);
|
|
9362
9362
|
return setTimeout(() => R && V(R), 50), R;
|
|
9363
9363
|
};
|
|
9364
9364
|
}
|
|
9365
|
-
r ? r(x, "top-right") :
|
|
9366
|
-
|
|
9365
|
+
r ? r(x, "top-right") : M.addControl(x, "top-right"), p = (k) => {
|
|
9366
|
+
k.key === "Escape" && w();
|
|
9367
9367
|
}, document.addEventListener("keyup", p);
|
|
9368
9368
|
}), ke(() => {
|
|
9369
9369
|
w(), p && (document.removeEventListener("keyup", p), p = null);
|
|
9370
|
-
const
|
|
9370
|
+
const M = t.value;
|
|
9371
9371
|
if (i.value)
|
|
9372
9372
|
try {
|
|
9373
|
-
o ? o(i.value) :
|
|
9373
|
+
o ? o(i.value) : M == null || M.removeControl(i.value);
|
|
9374
9374
|
} catch {
|
|
9375
9375
|
}
|
|
9376
9376
|
i.value = null;
|
|
9377
|
-
}), (
|
|
9377
|
+
}), (M, S) => (m(), b("div", {
|
|
9378
9378
|
ref_key: "root",
|
|
9379
9379
|
ref: l,
|
|
9380
9380
|
class: "map-print-control"
|
|
@@ -9477,26 +9477,26 @@ const sp = {
|
|
|
9477
9477
|
options: {}
|
|
9478
9478
|
},
|
|
9479
9479
|
setup(e) {
|
|
9480
|
-
var E, z, V,
|
|
9481
|
-
const t = e, n = ((z = (E = Dt()) == null ? void 0 : E.appContext.config.globalProperties) == null ? void 0 : z.$settings) || null, r = Ot((V = n == null ? void 0 : n.map) == null ? void 0 : V.center) || [30, 50], o = P(null), l = Fr(null), i = (
|
|
9480
|
+
var E, z, V, M;
|
|
9481
|
+
const t = e, n = ((z = (E = Dt()) == null ? void 0 : E.appContext.config.globalProperties) == null ? void 0 : z.$settings) || null, r = Ot((V = n == null ? void 0 : n.map) == null ? void 0 : V.center) || [30, 50], o = P(null), l = Fr(null), i = (M = t.options) == null ? void 0 : M.active, a = P(i === void 0 ? !1 : !!i);
|
|
9482
9482
|
function f(S, x) {
|
|
9483
9483
|
return typeof S == "number" && Number.isFinite(S) ? S : x;
|
|
9484
9484
|
}
|
|
9485
9485
|
const p = D(() => {
|
|
9486
|
-
var R,
|
|
9487
|
-
const S = (R = t.options) == null ? void 0 : R.width, x = (
|
|
9486
|
+
var R, T;
|
|
9487
|
+
const S = (R = t.options) == null ? void 0 : R.width, x = (T = t.options) == null ? void 0 : T.height, k = f(t.width ?? S, 210), I = f(t.height ?? x, 150);
|
|
9488
9488
|
return {
|
|
9489
|
-
width: `${
|
|
9490
|
-
height: `${
|
|
9489
|
+
width: `${k}px`,
|
|
9490
|
+
height: `${I}px`
|
|
9491
9491
|
};
|
|
9492
9492
|
});
|
|
9493
9493
|
function _() {
|
|
9494
|
-
var x,
|
|
9495
|
-
const S = (
|
|
9494
|
+
var x, k;
|
|
9495
|
+
const S = (k = (x = t.mapContext) == null ? void 0 : x.map) == null ? void 0 : k.value;
|
|
9496
9496
|
if (!S || typeof S.getStyle != "function") return null;
|
|
9497
9497
|
try {
|
|
9498
|
-
const
|
|
9499
|
-
return
|
|
9498
|
+
const I = S.getStyle();
|
|
9499
|
+
return I ? JSON.parse(JSON.stringify(I)) : null;
|
|
9500
9500
|
} catch {
|
|
9501
9501
|
return null;
|
|
9502
9502
|
}
|
|
@@ -9505,7 +9505,7 @@ const sp = {
|
|
|
9505
9505
|
function v() {
|
|
9506
9506
|
var R;
|
|
9507
9507
|
if (typeof window > "u" || l.value || !o.value) return;
|
|
9508
|
-
const S = _(), x = r,
|
|
9508
|
+
const S = _(), x = r, k = {
|
|
9509
9509
|
container: o.value,
|
|
9510
9510
|
style: S ?? {
|
|
9511
9511
|
version: 8,
|
|
@@ -9528,11 +9528,11 @@ const sp = {
|
|
|
9528
9528
|
zoom: ((R = t.options) == null ? void 0 : R.zoom) ?? 3,
|
|
9529
9529
|
interactive: !1,
|
|
9530
9530
|
attributionControl: !1
|
|
9531
|
-
},
|
|
9532
|
-
...
|
|
9531
|
+
}, I = {
|
|
9532
|
+
...k,
|
|
9533
9533
|
...t.options ?? {}
|
|
9534
9534
|
};
|
|
9535
|
-
|
|
9535
|
+
I.container = k.container, l.value = new maplibregl.Map(I), l.value.on("load", () => {
|
|
9536
9536
|
d(), h();
|
|
9537
9537
|
});
|
|
9538
9538
|
}
|
|
@@ -9588,8 +9588,8 @@ const sp = {
|
|
|
9588
9588
|
});
|
|
9589
9589
|
}
|
|
9590
9590
|
function h() {
|
|
9591
|
-
var
|
|
9592
|
-
const S = (
|
|
9591
|
+
var j, A;
|
|
9592
|
+
const S = (A = (j = t.mapContext) == null ? void 0 : j.map) == null ? void 0 : A.value;
|
|
9593
9593
|
if (!l.value || !S || !S.getBounds) return;
|
|
9594
9594
|
if (typeof l.value.isStyleLoaded == "function" && !l.value.isStyleLoaded()) {
|
|
9595
9595
|
l.value.once("styledata", () => {
|
|
@@ -9599,20 +9599,20 @@ const sp = {
|
|
|
9599
9599
|
}
|
|
9600
9600
|
const x = S.getBounds();
|
|
9601
9601
|
if (!x) return;
|
|
9602
|
-
const
|
|
9603
|
-
if (!
|
|
9602
|
+
const k = x.getNorthEast(), I = x.getSouthWest();
|
|
9603
|
+
if (!k || !I) return;
|
|
9604
9604
|
const R = [
|
|
9605
|
-
[
|
|
9606
|
-
[
|
|
9607
|
-
[
|
|
9608
|
-
[
|
|
9609
|
-
[
|
|
9610
|
-
],
|
|
9611
|
-
if (!
|
|
9605
|
+
[I.lng, k.lat],
|
|
9606
|
+
[k.lng, k.lat],
|
|
9607
|
+
[k.lng, I.lat],
|
|
9608
|
+
[I.lng, I.lat],
|
|
9609
|
+
[I.lng, k.lat]
|
|
9610
|
+
], T = l.value.getSource(on);
|
|
9611
|
+
if (!T) {
|
|
9612
9612
|
d();
|
|
9613
9613
|
return;
|
|
9614
9614
|
}
|
|
9615
|
-
|
|
9615
|
+
T.setData({
|
|
9616
9616
|
type: "Feature",
|
|
9617
9617
|
geometry: {
|
|
9618
9618
|
type: "Polygon",
|
|
@@ -9622,8 +9622,8 @@ const sp = {
|
|
|
9622
9622
|
});
|
|
9623
9623
|
}
|
|
9624
9624
|
function y() {
|
|
9625
|
-
var
|
|
9626
|
-
const S = t.mapContext, x = (
|
|
9625
|
+
var k;
|
|
9626
|
+
const S = t.mapContext, x = (k = S == null ? void 0 : S.map) == null ? void 0 : k.value;
|
|
9627
9627
|
!(S != null && S.on) || !x || (u == null || u(), u = S.on("move", h), h());
|
|
9628
9628
|
}
|
|
9629
9629
|
async function w() {
|
|
@@ -9744,7 +9744,7 @@ const sp = {
|
|
|
9744
9744
|
return ((q = l.value) == null ? void 0 : q.description) ?? null;
|
|
9745
9745
|
}), g = D(() => {
|
|
9746
9746
|
var q;
|
|
9747
|
-
return
|
|
9747
|
+
return j((q = l.value) == null ? void 0 : q.maps);
|
|
9748
9748
|
}), h = D(() => {
|
|
9749
9749
|
var Q, ue;
|
|
9750
9750
|
const q = ((Q = l.value) == null ? void 0 : Q.minZoom) ?? ((ue = l.value) == null ? void 0 : ue.minzoom) ?? null;
|
|
@@ -9764,7 +9764,7 @@ const sp = {
|
|
|
9764
9764
|
var q;
|
|
9765
9765
|
return ((q = l.value) == null ? void 0 : q.minimap) ?? null;
|
|
9766
9766
|
});
|
|
9767
|
-
function
|
|
9767
|
+
function M(q) {
|
|
9768
9768
|
if (!q || typeof q != "object") return q;
|
|
9769
9769
|
const Q = Ot(q.center);
|
|
9770
9770
|
return Q ? { ...q, center: Q } : q;
|
|
@@ -9775,19 +9775,19 @@ const sp = {
|
|
|
9775
9775
|
const Q = Number(typeof q == "string" ? q.trim() : q);
|
|
9776
9776
|
return Number.isFinite(Q) ? Q : null;
|
|
9777
9777
|
}
|
|
9778
|
-
const
|
|
9778
|
+
const k = Ot((xt = S == null ? void 0 : S.map) == null ? void 0 : xt.center), I = x((At = S == null ? void 0 : S.map) == null ? void 0 : At.zoom), R = D(() => {
|
|
9779
9779
|
const q = (S == null ? void 0 : S.map) || null, Q = (q == null ? void 0 : q.boundary) ?? null, ue = (q == null ? void 0 : q.katottg) ?? null;
|
|
9780
9780
|
return !Q && !ue ? null : { boundary: Q, katottg: ue };
|
|
9781
9781
|
});
|
|
9782
|
-
function
|
|
9782
|
+
function T(q) {
|
|
9783
9783
|
return typeof q == "string" && q.trim() ? q.trim().toLowerCase() : "top-left";
|
|
9784
9784
|
}
|
|
9785
|
-
function
|
|
9785
|
+
function j(q) {
|
|
9786
9786
|
return Array.isArray(q) ? q : q && typeof q == "object" ? Object.values(q).filter(Boolean) : [];
|
|
9787
9787
|
}
|
|
9788
|
-
const
|
|
9788
|
+
const A = D(() => {
|
|
9789
9789
|
var q;
|
|
9790
|
-
return
|
|
9790
|
+
return j((q = l.value) == null ? void 0 : q.widgets);
|
|
9791
9791
|
}), U = ["left", "right"], N = D(() => {
|
|
9792
9792
|
const q = {
|
|
9793
9793
|
left: { top: [], bottom: [] },
|
|
@@ -9798,8 +9798,8 @@ const sp = {
|
|
|
9798
9798
|
"top-right": { side: "right", align: "top" },
|
|
9799
9799
|
"bottom-right": { side: "right", align: "bottom" }
|
|
9800
9800
|
};
|
|
9801
|
-
return
|
|
9802
|
-
const ye =
|
|
9801
|
+
return A.value.forEach((ue) => {
|
|
9802
|
+
const ye = T(ue.position), ae = Q[ye] ?? { side: "left", align: "top" };
|
|
9803
9803
|
q[ae.side][ae.align].push(ue);
|
|
9804
9804
|
}), q;
|
|
9805
9805
|
});
|
|
@@ -9812,12 +9812,12 @@ const sp = {
|
|
|
9812
9812
|
const q = (Q = o.value) == null ? void 0 : Q.ctx;
|
|
9813
9813
|
return q ? (q.ready && await q.ready(), q) : null;
|
|
9814
9814
|
}
|
|
9815
|
-
function
|
|
9815
|
+
function F() {
|
|
9816
9816
|
var q, Q, ue;
|
|
9817
9817
|
return ((ue = (Q = (q = o.value) == null ? void 0 : q.ctx) == null ? void 0 : Q.map) == null ? void 0 : ue.value) ?? null;
|
|
9818
9818
|
}
|
|
9819
9819
|
function B() {
|
|
9820
|
-
const q =
|
|
9820
|
+
const q = F();
|
|
9821
9821
|
if (!q) return null;
|
|
9822
9822
|
const Q = q.getCenter();
|
|
9823
9823
|
return {
|
|
@@ -9880,7 +9880,7 @@ const sp = {
|
|
|
9880
9880
|
const ue = await fetch(`/api/gis-map/${encodeURIComponent(u.value)}`);
|
|
9881
9881
|
if (!ue.ok)
|
|
9882
9882
|
throw new Error(`Помилка завантаження (${ue.status})`);
|
|
9883
|
-
const ye = await ue.json(), ae = Ot(ye.center) ??
|
|
9883
|
+
const ye = await ue.json(), ae = Ot(ye.center) ?? k, be = j(ye.layers).map((We) => M(We)), Ee = x(ye.zoom) ?? I;
|
|
9884
9884
|
l.value = {
|
|
9885
9885
|
...ye,
|
|
9886
9886
|
center: ae ?? null,
|
|
@@ -9899,16 +9899,16 @@ const sp = {
|
|
|
9899
9899
|
const Pe = D(() => {
|
|
9900
9900
|
var ye;
|
|
9901
9901
|
const q = /* @__PURE__ */ new Map();
|
|
9902
|
-
return
|
|
9902
|
+
return j((ye = l.value) == null ? void 0 : ye.layers).forEach((ae) => {
|
|
9903
9903
|
if (!(ae != null && ae.id)) return;
|
|
9904
|
-
const be =
|
|
9904
|
+
const be = M(ae) || ae;
|
|
9905
9905
|
q.set(ae.id, { ...be });
|
|
9906
|
-
}),
|
|
9906
|
+
}), A.value.filter((ae) => (ae == null ? void 0 : ae.type) === "layers").flatMap((ae) => {
|
|
9907
9907
|
var be;
|
|
9908
|
-
return
|
|
9908
|
+
return j((be = ae == null ? void 0 : ae.config) == null ? void 0 : be.layers);
|
|
9909
9909
|
}).forEach((ae) => {
|
|
9910
9910
|
if (!(ae != null && ae.id)) return;
|
|
9911
|
-
const be = q.get(ae.id) || {}, Ee =
|
|
9911
|
+
const be = q.get(ae.id) || {}, Ee = M(ae) || ae;
|
|
9912
9912
|
q.set(ae.id, {
|
|
9913
9913
|
...be,
|
|
9914
9914
|
...Ee,
|