@opengis/partsmap 0.0.95 → 0.0.96
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/PartsMap.js +27 -16
- package/dist/PartsMap.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/PartsMap.js
CHANGED
@@ -20346,6 +20346,7 @@ const K_ = /* @__PURE__ */ hn(U_, [["render", J_]]), Y_ = {
|
|
20346
20346
|
legend: { type: Boolean, default: () => !0 }
|
20347
20347
|
},
|
20348
20348
|
mixins: [tu],
|
20349
|
+
inject: ["prefix"],
|
20349
20350
|
data() {
|
20350
20351
|
return {
|
20351
20352
|
map: null,
|
@@ -20434,7 +20435,7 @@ const K_ = /* @__PURE__ */ hn(U_, [["render", J_]]), Y_ = {
|
|
20434
20435
|
try {
|
20435
20436
|
const {
|
20436
20437
|
data: { rows: b }
|
20437
|
-
} = await Xt.get(
|
20438
|
+
} = await Xt.get(`${this.prefix}/data/${this.table}/${this.colorAttr}`), I = b.reduce(
|
20438
20439
|
(C, R, G) => R != null && R.id ? [
|
20439
20440
|
...C,
|
20440
20441
|
R.id.toString(),
|
@@ -20452,7 +20453,7 @@ const K_ = /* @__PURE__ */ hn(U_, [["render", J_]]), Y_ = {
|
|
20452
20453
|
try {
|
20453
20454
|
const {
|
20454
20455
|
data: { rows: m }
|
20455
|
-
} = await Xt.get(
|
20456
|
+
} = await Xt.get(`${this.prefix}/data/${this.table}/${this.strokeAttr}`), b = m.reduce((I, C, R) => C != null && C.id ? [
|
20456
20457
|
...I,
|
20457
20458
|
{
|
20458
20459
|
id: C.id.toString(),
|
@@ -20478,7 +20479,7 @@ const K_ = /* @__PURE__ */ hn(U_, [["render", J_]]), Y_ = {
|
|
20478
20479
|
await this.addLayer({
|
20479
20480
|
id: this.table,
|
20480
20481
|
service: "vector",
|
20481
|
-
url:
|
20482
|
+
url: `${this.prefix}/vtile/${this.table}/ua/{z}/{x}/{y}.vmt?pointZoom=${this.pointZoom}&dt=${(/* @__PURE__ */ new Date()).toISOString()}`,
|
20482
20483
|
layers: [
|
20483
20484
|
{
|
20484
20485
|
type: "fill",
|
@@ -20808,6 +20809,8 @@ function $y(m, b, I, C, R, G) {
|
|
20808
20809
|
}
|
20809
20810
|
const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-37405773"]]), Zy = jm({
|
20810
20811
|
props: {
|
20812
|
+
prefix: { type: String, default: "/api" },
|
20813
|
+
applyVueRouter: { type: Boolean, default: !0 },
|
20811
20814
|
dashedLine: { type: Boolean, default: !1 },
|
20812
20815
|
title: { type: String, default: () => "" },
|
20813
20816
|
table: { type: String, default: () => "" },
|
@@ -20836,7 +20839,8 @@ const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-3740577
|
|
20836
20839
|
pointZoom: { type: String, default: () => "12" },
|
20837
20840
|
legend: { type: Boolean, default: () => !0 },
|
20838
20841
|
defaultColor: { type: String, default: () => "blue" },
|
20839
|
-
polygonOpacity: { type: Number, default: () => null }
|
20842
|
+
polygonOpacity: { type: Number, default: () => null },
|
20843
|
+
history: { type: Boolean, default: !0 }
|
20840
20844
|
},
|
20841
20845
|
mixins: [tu],
|
20842
20846
|
components: {
|
@@ -20904,6 +20908,11 @@ const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-3740577
|
|
20904
20908
|
}, 300)
|
20905
20909
|
};
|
20906
20910
|
},
|
20911
|
+
provide() {
|
20912
|
+
return {
|
20913
|
+
prefix: this.prefix
|
20914
|
+
};
|
20915
|
+
},
|
20907
20916
|
watch: {
|
20908
20917
|
map() {
|
20909
20918
|
this.map.on("mousemove", this.handleMapHover), this.map.on("click", this.handleMapClick), this.$emit("update:map", this.map);
|
@@ -20995,18 +21004,18 @@ const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-3740577
|
|
20995
21004
|
polyline: this.polyline
|
20996
21005
|
};
|
20997
21006
|
m.filter = this.filtersParam;
|
20998
|
-
const { data: b } = await Xt.get(
|
21007
|
+
const { data: b } = await Xt.get(`${this.prefix}/data/${this.table}`, {
|
21008
|
+
params: m
|
21009
|
+
});
|
20999
21010
|
this.tableData = b == null ? void 0 : b.rows, this.total = b.filtered, this.filtered = b.filtered;
|
21000
21011
|
} catch (m) {
|
21001
21012
|
console.error(m.message);
|
21002
21013
|
}
|
21003
21014
|
},
|
21004
21015
|
moveToDefaultPage() {
|
21005
|
-
var
|
21016
|
+
var I;
|
21006
21017
|
const m = new URLSearchParams(window.location.search);
|
21007
|
-
m.delete("id");
|
21008
|
-
const I = `${window.location.pathname}?${m.toString()}`;
|
21009
|
-
(C = this.map) == null || C.fitBounds(this.maxBounds, { duration: 0 }), window.history.pushState({}, "", I), this.isSelectObj = !1;
|
21018
|
+
m.delete("id"), `${window.location.pathname}${m.toString()}`, (I = this.map) == null || I.fitBounds(this.maxBounds, { duration: 0 }), this.history && window.history.pushState({}, "", newUrl), this.isSelectObj = !1;
|
21010
21019
|
},
|
21011
21020
|
regionFullName(m) {
|
21012
21021
|
return m.region ? `${m.text} / ${m.region}` : m.text;
|
@@ -21034,7 +21043,7 @@ const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-3740577
|
|
21034
21043
|
async getFilter() {
|
21035
21044
|
var m;
|
21036
21045
|
try {
|
21037
|
-
const { data: b } = await Xt.get(
|
21046
|
+
const { data: b } = await Xt.get(`${this.prefix}/filter/${this.table}`);
|
21038
21047
|
this.filters = (m = b == null ? void 0 : b.list) == null ? void 0 : m.map((I) => ({
|
21039
21048
|
...I,
|
21040
21049
|
label: (I == null ? void 0 : I.label) || (I == null ? void 0 : I.ua),
|
@@ -21108,7 +21117,7 @@ const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-3740577
|
|
21108
21117
|
const I = window.location.pathname, C = new URLSearchParams(window.location.search);
|
21109
21118
|
C.set("id", `${(c = b[0]) == null ? void 0 : c.properties.id}`), this.getObjectData((_e = (fe = b[0]) == null ? void 0 : fe.properties) == null ? void 0 : _e.id);
|
21110
21119
|
const R = `${I}?${C.toString()}`;
|
21111
|
-
window.history.pushState({}, "", R), this.isSelectObj = !0, m.lngLat && ((Ne = this.map) == null || Ne.fitBounds(
|
21120
|
+
this.history && window.history.pushState({}, "", R), this.isSelectObj = !0, m.lngLat && ((Ne = this.map) == null || Ne.fitBounds(
|
21112
21121
|
[
|
21113
21122
|
[(xe = m.lngLat) == null ? void 0 : xe.lng, (ae = m.lngLat) == null ? void 0 : ae.lat],
|
21114
21123
|
[(oe = m.lngLat) == null ? void 0 : oe.lng, (ht = m.lngLat) == null ? void 0 : ht.lat]
|
@@ -21119,7 +21128,9 @@ const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-3740577
|
|
21119
21128
|
async getObjectData(m) {
|
21120
21129
|
var b, I;
|
21121
21130
|
try {
|
21122
|
-
const { data: C } = await Xt.get(
|
21131
|
+
const { data: C } = await Xt.get(
|
21132
|
+
`${this.prefix}/data/${this.table}/${m}`
|
21133
|
+
);
|
21123
21134
|
this.selectRow((b = C == null ? void 0 : C.rows) == null ? void 0 : b[0]), ((I = C == null ? void 0 : C.rows) == null ? void 0 : I.lenght) < 1 && this.deletePulsePoint();
|
21124
21135
|
} catch (C) {
|
21125
21136
|
console.error(C.message);
|
@@ -21128,12 +21139,12 @@ const qy = /* @__PURE__ */ hn(Dy, [["render", $y], ["__scopeId", "data-v-3740577
|
|
21128
21139
|
async selectRow(m, b = !0) {
|
21129
21140
|
var c;
|
21130
21141
|
this.isMapVisible = b;
|
21131
|
-
const C = await (await fetch(
|
21142
|
+
const C = await (await fetch(`${this.prefix}/data/${this.table}/${m.id}`)).json();
|
21132
21143
|
this.selectedRow = ((c = C == null ? void 0 : C.rows) == null ? void 0 : c[0]) || m;
|
21133
21144
|
const R = window.location.pathname, G = new URLSearchParams(window.location.search);
|
21134
21145
|
G.set("id", `${m.id}`);
|
21135
21146
|
const T = `${R}?${G.toString()}`;
|
21136
|
-
window.history.pushState({}, "", T), this.checkUrl(b), this.isSelectObj = !0;
|
21147
|
+
this.history && window.history.pushState({}, "", T), this.checkUrl(b), this.isSelectObj = !0;
|
21137
21148
|
},
|
21138
21149
|
deletePulsePoint() {
|
21139
21150
|
this.marker && this.marker.remove();
|
@@ -21306,7 +21317,7 @@ function b0(m, b, I, C, R, G) {
|
|
21306
21317
|
"onUpdate:modelValue": b[0] || (b[0] = (st) => m.mountedFilter = st),
|
21307
21318
|
scheme: m.filters,
|
21308
21319
|
isDialog: (Fe = m.filters) == null ? void 0 : Fe.some((st) => !(st != null && st.inline)),
|
21309
|
-
"apply-vue-router":
|
21320
|
+
"apply-vue-router": m.applyVueRouter,
|
21310
21321
|
history: "",
|
21311
21322
|
view: "plain",
|
21312
21323
|
clearable: !1,
|
@@ -21328,7 +21339,7 @@ function b0(m, b, I, C, R, G) {
|
|
21328
21339
|
], 2)
|
21329
21340
|
]),
|
21330
21341
|
_: 1
|
21331
|
-
}, 8, ["modelValue", "scheme", "isDialog"])) : Pr("", !0)
|
21342
|
+
}, 8, ["modelValue", "scheme", "isDialog", "apply-vue-router"])) : Pr("", !0)
|
21332
21343
|
])
|
21333
21344
|
]),
|
21334
21345
|
Qe("button", {
|
package/dist/PartsMap.umd.cjs
CHANGED
@@ -582,4 +582,4 @@ uniform ${k} ${E} u_${L};
|
|
582
582
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(b){return b instanceof this?b:new this(b)}static concat(b,...I){const A=new this(b);return I.forEach(R=>A.set(R)),A}static accessor(b){const A=(this[xu]=this[xu]={accessors:{}}).accessors,R=this.prototype;function G(T){const c=Uo(T);A[c]||(Hf(R,T),A[c]=!0)}return fe.isArray(b)?b.forEach(G):G(b),this}}Gi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),fe.reduceDescriptors(Gi.prototype,({value:m},b)=>{let I=b[0].toUpperCase()+b.slice(1);return{get:()=>m,set(A){this[I]=A}}}),fe.freezeMethods(Gi);function Ac(m,b){const I=this||No,A=b||I,R=Gi.from(A.headers);let G=A.data;return fe.forEach(m,function(c){G=c.call(I,G,R.normalize(),b?b.status:void 0)}),R.normalize(),G}function vu(m){return!!(m&&m.__CANCEL__)}function Ns(m,b,I){ct.call(this,m??"canceled",ct.ERR_CANCELED,b,I),this.name="CanceledError"}fe.inherits(Ns,ct,{__CANCEL__:!0});function bu(m,b,I){const A=I.config.validateStatus;!I.status||!A||A(I.status)?m(I):b(new ct("Request failed with status code "+I.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(I.status/100)-4],I.config,I.request,I))}function Wf(m){const b=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m);return b&&b[1]||""}function Xf(m,b){m=m||10;const I=new Array(m),A=new Array(m);let R=0,G=0,T;return b=b!==void 0?b:1e3,function(me){const ye=Date.now(),ve=A[G];T||(T=ye),I[R]=me,A[R]=ye;let le=G,ae=0;for(;le!==R;)ae+=I[le++],le=le%m;if(R=(R+1)%m,R===G&&(G=(G+1)%m),ye-T<b)return;const ht=ve&&ye-ve;return ht?Math.round(ae*1e3/ht):void 0}}function Jf(m,b){let I=0,A=1e3/b,R,G;const T=(ye,ve=Date.now())=>{I=ve,R=null,G&&(clearTimeout(G),G=null),m.apply(null,ye)};return[(...ye)=>{const ve=Date.now(),le=ve-I;le>=A?T(ye,ve):(R=ye,G||(G=setTimeout(()=>{G=null,T(R)},A-le)))},()=>R&&T(R)]}const ul=(m,b,I=3)=>{let A=0;const R=Xf(50,250);return Jf(G=>{const T=G.loaded,c=G.lengthComputable?G.total:void 0,me=T-A,ye=R(me),ve=T<=c;A=T;const le={loaded:T,total:c,progress:c?T/c:void 0,bytes:me,rate:ye||void 0,estimated:ye&&c&&ve?(c-T)/ye:void 0,event:G,lengthComputable:c!=null,[b?"download":"upload"]:!0};m(le)},I)},wu=(m,b)=>{const I=m!=null;return[A=>b[0]({lengthComputable:I,total:m,loaded:A}),b[1]]},Su=m=>(...b)=>fe.asap(()=>m(...b)),Kf=Ir.hasStandardBrowserEnv?function(){const b=/(msie|trident)/i.test(navigator.userAgent),I=document.createElement("a");let A;function R(G){let T=G;return b&&(I.setAttribute("href",T),T=I.href),I.setAttribute("href",T),{href:I.href,protocol:I.protocol?I.protocol.replace(/:$/,""):"",host:I.host,search:I.search?I.search.replace(/^\?/,""):"",hash:I.hash?I.hash.replace(/^#/,""):"",hostname:I.hostname,port:I.port,pathname:I.pathname.charAt(0)==="/"?I.pathname:"/"+I.pathname}}return A=R(window.location.href),function(T){const c=fe.isString(T)?R(T):T;return c.protocol===A.protocol&&c.host===A.host}}():function(){return function(){return!0}}(),Yf=Ir.hasStandardBrowserEnv?{write(m,b,I,A,R,G){const T=[m+"="+encodeURIComponent(b)];fe.isNumber(I)&&T.push("expires="+new Date(I).toGMTString()),fe.isString(A)&&T.push("path="+A),fe.isString(R)&&T.push("domain="+R),G===!0&&T.push("secure"),document.cookie=T.join("; ")},read(m){const b=document.cookie.match(new RegExp("(^|;\\s*)("+m+")=([^;]*)"));return b?decodeURIComponent(b[3]):null},remove(m){this.write(m,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Qf(m){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(m)}function em(m,b){return b?m.replace(/\/?\/$/,"")+"/"+b.replace(/^\/+/,""):m}function Tu(m,b){return m&&!Qf(b)?em(m,b):b}const Iu=m=>m instanceof Gi?{...m}:m;function ts(m,b){b=b||{};const I={};function A(ye,ve,le){return fe.isPlainObject(ye)&&fe.isPlainObject(ve)?fe.merge.call({caseless:le},ye,ve):fe.isPlainObject(ve)?fe.merge({},ve):fe.isArray(ve)?ve.slice():ve}function R(ye,ve,le){if(fe.isUndefined(ve)){if(!fe.isUndefined(ye))return A(void 0,ye,le)}else return A(ye,ve,le)}function G(ye,ve){if(!fe.isUndefined(ve))return A(void 0,ve)}function T(ye,ve){if(fe.isUndefined(ve)){if(!fe.isUndefined(ye))return A(void 0,ye)}else return A(void 0,ve)}function c(ye,ve,le){if(le in b)return A(ye,ve);if(le in m)return A(void 0,ye)}const me={url:G,method:G,data:G,baseURL:T,transformRequest:T,transformResponse:T,paramsSerializer:T,timeout:T,timeoutMessage:T,withCredentials:T,withXSRFToken:T,adapter:T,responseType:T,xsrfCookieName:T,xsrfHeaderName:T,onUploadProgress:T,onDownloadProgress:T,decompress:T,maxContentLength:T,maxBodyLength:T,beforeRedirect:T,transport:T,httpAgent:T,httpsAgent:T,cancelToken:T,socketPath:T,responseEncoding:T,validateStatus:c,headers:(ye,ve)=>R(Iu(ye),Iu(ve),!0)};return fe.forEach(Object.keys(Object.assign({},m,b)),function(ve){const le=me[ve]||R,ae=le(m[ve],b[ve],ve);fe.isUndefined(ae)&&le!==c||(I[ve]=ae)}),I}const Pu=m=>{const b=ts({},m);let{data:I,withXSRFToken:A,xsrfHeaderName:R,xsrfCookieName:G,headers:T,auth:c}=b;b.headers=T=Gi.from(T),b.url=mu(Tu(b.baseURL,b.url),m.params,m.paramsSerializer),c&&T.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let me;if(fe.isFormData(I)){if(Ir.hasStandardBrowserEnv||Ir.hasStandardBrowserWebWorkerEnv)T.setContentType(void 0);else if((me=T.getContentType())!==!1){const[ye,...ve]=me?me.split(";").map(le=>le.trim()).filter(Boolean):[];T.setContentType([ye||"multipart/form-data",...ve].join("; "))}}if(Ir.hasStandardBrowserEnv&&(A&&fe.isFunction(A)&&(A=A(b)),A||A!==!1&&Kf(b.url))){const ye=R&&G&&Yf.read(G);ye&&T.set(R,ye)}return b},tm=typeof XMLHttpRequest<"u"&&function(m){return new Promise(function(I,A){const R=Pu(m);let G=R.data;const T=Gi.from(R.headers).normalize();let{responseType:c,onUploadProgress:me,onDownloadProgress:ye}=R,ve,le,ae,ht,Ue;function Ke(){ht&&ht(),Ue&&Ue(),R.cancelToken&&R.cancelToken.unsubscribe(ve),R.signal&&R.signal.removeEventListener("abort",ve)}let Oe=new XMLHttpRequest;Oe.open(R.method.toUpperCase(),R.url,!0),Oe.timeout=R.timeout;function ft(){if(!Oe)return;const He=Gi.from("getAllResponseHeaders"in Oe&&Oe.getAllResponseHeaders()),wt={data:!c||c==="text"||c==="json"?Oe.responseText:Oe.response,status:Oe.status,statusText:Oe.statusText,headers:He,config:m,request:Oe};bu(function(Ut){I(Ut),Ke()},function(Ut){A(Ut),Ke()},wt),Oe=null}"onloadend"in Oe?Oe.onloadend=ft:Oe.onreadystatechange=function(){!Oe||Oe.readyState!==4||Oe.status===0&&!(Oe.responseURL&&Oe.responseURL.indexOf("file:")===0)||setTimeout(ft)},Oe.onabort=function(){Oe&&(A(new ct("Request aborted",ct.ECONNABORTED,m,Oe)),Oe=null)},Oe.onerror=function(){A(new ct("Network Error",ct.ERR_NETWORK,m,Oe)),Oe=null},Oe.ontimeout=function(){let Ft=R.timeout?"timeout of "+R.timeout+"ms exceeded":"timeout exceeded";const wt=R.transitional||_u;R.timeoutErrorMessage&&(Ft=R.timeoutErrorMessage),A(new ct(Ft,wt.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,m,Oe)),Oe=null},G===void 0&&T.setContentType(null),"setRequestHeader"in Oe&&fe.forEach(T.toJSON(),function(Ft,wt){Oe.setRequestHeader(wt,Ft)}),fe.isUndefined(R.withCredentials)||(Oe.withCredentials=!!R.withCredentials),c&&c!=="json"&&(Oe.responseType=R.responseType),ye&&([ae,Ue]=ul(ye,!0),Oe.addEventListener("progress",ae)),me&&Oe.upload&&([le,ht]=ul(me),Oe.upload.addEventListener("progress",le),Oe.upload.addEventListener("loadend",ht)),(R.cancelToken||R.signal)&&(ve=He=>{Oe&&(A(!He||He.type?new Ns(null,m,Oe):He),Oe.abort(),Oe=null)},R.cancelToken&&R.cancelToken.subscribe(ve),R.signal&&(R.signal.aborted?ve():R.signal.addEventListener("abort",ve)));const st=Wf(R.url);if(st&&Ir.protocols.indexOf(st)===-1){A(new ct("Unsupported protocol "+st+":",ct.ERR_BAD_REQUEST,m));return}Oe.send(G||null)})},im=(m,b)=>{let I=new AbortController,A;const R=function(me){if(!A){A=!0,T();const ye=me instanceof Error?me:this.reason;I.abort(ye instanceof ct?ye:new Ns(ye instanceof Error?ye.message:ye))}};let G=b&&setTimeout(()=>{R(new ct(`timeout ${b} of ms exceeded`,ct.ETIMEDOUT))},b);const T=()=>{m&&(G&&clearTimeout(G),G=null,m.forEach(me=>{me&&(me.removeEventListener?me.removeEventListener("abort",R):me.unsubscribe(R))}),m=null)};m.forEach(me=>me&&me.addEventListener&&me.addEventListener("abort",R));const{signal:c}=I;return c.unsubscribe=T,[c,()=>{G&&clearTimeout(G),G=null}]},rm=function*(m,b){let I=m.byteLength;if(!b||I<b){yield m;return}let A=0,R;for(;A<I;)R=A+b,yield m.slice(A,R),A=R},nm=async function*(m,b,I){for await(const A of m)yield*rm(ArrayBuffer.isView(A)?A:await I(String(A)),b)},ku=(m,b,I,A,R)=>{const G=nm(m,b,R);let T=0,c,me=ye=>{c||(c=!0,A&&A(ye))};return new ReadableStream({async pull(ye){try{const{done:ve,value:le}=await G.next();if(ve){me(),ye.close();return}let ae=le.byteLength;if(I){let ht=T+=ae;I(ht)}ye.enqueue(new Uint8Array(le))}catch(ve){throw me(ve),ve}},cancel(ye){return me(ye),G.return()}},{highWaterMark:2})},dl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Eu=dl&&typeof ReadableStream=="function",Cc=dl&&(typeof TextEncoder=="function"?(m=>b=>m.encode(b))(new TextEncoder):async m=>new Uint8Array(await new Response(m).arrayBuffer())),Au=(m,...b)=>{try{return!!m(...b)}catch{return!1}},sm=Eu&&Au(()=>{let m=!1;const b=new Request(Ir.origin,{body:new ReadableStream,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!b}),Cu=64*1024,Mc=Eu&&Au(()=>fe.isReadableStream(new Response("").body)),pl={stream:Mc&&(m=>m.body)};dl&&(m=>{["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!pl[b]&&(pl[b]=fe.isFunction(m[b])?I=>I[b]():(I,A)=>{throw new ct(`Response type '${b}' is not supported`,ct.ERR_NOT_SUPPORT,A)})})})(new Response);const om=async m=>{if(m==null)return 0;if(fe.isBlob(m))return m.size;if(fe.isSpecCompliantForm(m))return(await new Request(m).arrayBuffer()).byteLength;if(fe.isArrayBufferView(m)||fe.isArrayBuffer(m))return m.byteLength;if(fe.isURLSearchParams(m)&&(m=m+""),fe.isString(m))return(await Cc(m)).byteLength},am=async(m,b)=>{const I=fe.toFiniteNumber(m.getContentLength());return I??om(b)},zc={http:Cf,xhr:tm,fetch:dl&&(async m=>{let{url:b,method:I,data:A,signal:R,cancelToken:G,timeout:T,onDownloadProgress:c,onUploadProgress:me,responseType:ye,headers:ve,withCredentials:le="same-origin",fetchOptions:ae}=Pu(m);ye=ye?(ye+"").toLowerCase():"text";let[ht,Ue]=R||G||T?im([R,G],T):[],Ke,Oe;const ft=()=>{!Ke&&setTimeout(()=>{ht&&ht.unsubscribe()}),Ke=!0};let st;try{if(me&&sm&&I!=="get"&&I!=="head"&&(st=await am(ve,A))!==0){let Wt=new Request(b,{method:"POST",body:A,duplex:"half"}),Ut;if(fe.isFormData(A)&&(Ut=Wt.headers.get("content-type"))&&ve.setContentType(Ut),Wt.body){const[Vr,bi]=wu(st,ul(Su(me)));A=ku(Wt.body,Cu,Vr,bi,Cc)}}fe.isString(le)||(le=le?"include":"omit"),Oe=new Request(b,{...ae,signal:ht,method:I.toUpperCase(),headers:ve.normalize().toJSON(),body:A,duplex:"half",credentials:le});let He=await fetch(Oe);const Ft=Mc&&(ye==="stream"||ye==="response");if(Mc&&(c||Ft)){const Wt={};["status","statusText","headers"].forEach(Nr=>{Wt[Nr]=He[Nr]});const Ut=fe.toFiniteNumber(He.headers.get("content-length")),[Vr,bi]=c&&wu(Ut,ul(Su(c),!0))||[];He=new Response(ku(He.body,Cu,Vr,()=>{bi&&bi(),Ft&&ft()},Cc),Wt)}ye=ye||"text";let wt=await pl[fe.findKey(pl,ye)||"text"](He,m);return!Ft&&ft(),Ue&&Ue(),await new Promise((Wt,Ut)=>{bu(Wt,Ut,{data:wt,headers:Gi.from(He.headers),status:He.status,statusText:He.statusText,config:m,request:Oe})})}catch(He){throw ft(),He&&He.name==="TypeError"&&/fetch/i.test(He.message)?Object.assign(new ct("Network Error",ct.ERR_NETWORK,m,Oe),{cause:He.cause||He}):ct.from(He,He&&He.code,m,Oe)}})};fe.forEach(zc,(m,b)=>{if(m){try{Object.defineProperty(m,"name",{value:b})}catch{}Object.defineProperty(m,"adapterName",{value:b})}});const Mu=m=>`- ${m}`,lm=m=>fe.isFunction(m)||m===null||m===!1,zu={getAdapter:m=>{m=fe.isArray(m)?m:[m];const{length:b}=m;let I,A;const R={};for(let G=0;G<b;G++){I=m[G];let T;if(A=I,!lm(I)&&(A=zc[(T=String(I)).toLowerCase()],A===void 0))throw new ct(`Unknown adapter '${T}'`);if(A)break;R[T||"#"+G]=A}if(!A){const G=Object.entries(R).map(([c,me])=>`adapter ${c} `+(me===!1?"is not supported by the environment":"is not available in the build"));let T=b?G.length>1?`since :
|
583
583
|
`+G.map(Mu).join(`
|
584
584
|
`):" "+Mu(G[0]):"as no adapter specified";throw new ct("There is no suitable adapter to dispatch the request "+T,"ERR_NOT_SUPPORT")}return A},adapters:zc};function Dc(m){if(m.cancelToken&&m.cancelToken.throwIfRequested(),m.signal&&m.signal.aborted)throw new Ns(null,m)}function Du(m){return Dc(m),m.headers=Gi.from(m.headers),m.data=Ac.call(m,m.transformRequest),["post","put","patch"].indexOf(m.method)!==-1&&m.headers.setContentType("application/x-www-form-urlencoded",!1),zu.getAdapter(m.adapter||No.adapter)(m).then(function(A){return Dc(m),A.data=Ac.call(m,m.transformResponse,A),A.headers=Gi.from(A.headers),A},function(A){return vu(A)||(Dc(m),A&&A.response&&(A.response.data=Ac.call(m,m.transformResponse,A.response),A.response.headers=Gi.from(A.response.headers))),Promise.reject(A)})}const Lu="1.7.4",Lc={};["object","boolean","number","function","string","symbol"].forEach((m,b)=>{Lc[m]=function(A){return typeof A===m||"a"+(b<1?"n ":" ")+m}});const Ru={};Lc.transitional=function(b,I,A){function R(G,T){return"[Axios v"+Lu+"] Transitional option '"+G+"'"+T+(A?". "+A:"")}return(G,T,c)=>{if(b===!1)throw new ct(R(T," has been removed"+(I?" in "+I:"")),ct.ERR_DEPRECATED);return I&&!Ru[T]&&(Ru[T]=!0,console.warn(R(T," has been deprecated since v"+I+" and will be removed in the near future"))),b?b(G,T,c):!0}};function cm(m,b,I){if(typeof m!="object")throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const A=Object.keys(m);let R=A.length;for(;R-- >0;){const G=A[R],T=b[G];if(T){const c=m[G],me=c===void 0||T(c,G,m);if(me!==!0)throw new ct("option "+G+" must be "+me,ct.ERR_BAD_OPTION_VALUE);continue}if(I!==!0)throw new ct("Unknown option "+G,ct.ERR_BAD_OPTION)}}const Rc={assertOptions:cm,validators:Lc},Pn=Rc.validators;class is{constructor(b){this.defaults=b,this.interceptors={request:new gu,response:new gu}}async request(b,I){try{return await this._request(b,I)}catch(A){if(A instanceof Error){let R;Error.captureStackTrace?Error.captureStackTrace(R={}):R=new Error;const G=R.stack?R.stack.replace(/^.+\n/,""):"";try{A.stack?G&&!String(A.stack).endsWith(G.replace(/^.+\n.+\n/,""))&&(A.stack+=`
|
585
|
-
`+G):A.stack=G}catch{}}throw A}}_request(b,I){typeof b=="string"?(I=I||{},I.url=b):I=b||{},I=ts(this.defaults,I);const{transitional:A,paramsSerializer:R,headers:G}=I;A!==void 0&&Rc.assertOptions(A,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean)},!1),R!=null&&(fe.isFunction(R)?I.paramsSerializer={serialize:R}:Rc.assertOptions(R,{encode:Pn.function,serialize:Pn.function},!0)),I.method=(I.method||this.defaults.method||"get").toLowerCase();let T=G&&fe.merge(G.common,G[I.method]);G&&fe.forEach(["delete","get","head","post","put","patch","common"],Ue=>{delete G[Ue]}),I.headers=Gi.concat(T,G);const c=[];let me=!0;this.interceptors.request.forEach(function(Ke){typeof Ke.runWhen=="function"&&Ke.runWhen(I)===!1||(me=me&&Ke.synchronous,c.unshift(Ke.fulfilled,Ke.rejected))});const ye=[];this.interceptors.response.forEach(function(Ke){ye.push(Ke.fulfilled,Ke.rejected)});let ve,le=0,ae;if(!me){const Ue=[Du.bind(this),void 0];for(Ue.unshift.apply(Ue,c),Ue.push.apply(Ue,ye),ae=Ue.length,ve=Promise.resolve(I);le<ae;)ve=ve.then(Ue[le++],Ue[le++]);return ve}ae=c.length;let ht=I;for(le=0;le<ae;){const Ue=c[le++],Ke=c[le++];try{ht=Ue(ht)}catch(Oe){Ke.call(this,Oe);break}}try{ve=Du.call(this,ht)}catch(Ue){return Promise.reject(Ue)}for(le=0,ae=ye.length;le<ae;)ve=ve.then(ye[le++],ye[le++]);return ve}getUri(b){b=ts(this.defaults,b);const I=Tu(b.baseURL,b.url);return mu(I,b.params,b.paramsSerializer)}}fe.forEach(["delete","get","head","options"],function(b){is.prototype[b]=function(I,A){return this.request(ts(A||{},{method:b,url:I,data:(A||{}).data}))}}),fe.forEach(["post","put","patch"],function(b){function I(A){return function(G,T,c){return this.request(ts(c||{},{method:b,headers:A?{"Content-Type":"multipart/form-data"}:{},url:G,data:T}))}}is.prototype[b]=I(),is.prototype[b+"Form"]=I(!0)});class Bc{constructor(b){if(typeof b!="function")throw new TypeError("executor must be a function.");let I;this.promise=new Promise(function(G){I=G});const A=this;this.promise.then(R=>{if(!A._listeners)return;let G=A._listeners.length;for(;G-- >0;)A._listeners[G](R);A._listeners=null}),this.promise.then=R=>{let G;const T=new Promise(c=>{A.subscribe(c),G=c}).then(R);return T.cancel=function(){A.unsubscribe(G)},T},b(function(G,T,c){A.reason||(A.reason=new Ns(G,T,c),I(A.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(b){if(this.reason){b(this.reason);return}this._listeners?this._listeners.push(b):this._listeners=[b]}unsubscribe(b){if(!this._listeners)return;const I=this._listeners.indexOf(b);I!==-1&&this._listeners.splice(I,1)}static source(){let b;return{token:new Bc(function(R){b=R}),cancel:b}}}function hm(m){return function(I){return m.apply(null,I)}}function um(m){return fe.isObject(m)&&m.isAxiosError===!0}const Fc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fc).forEach(([m,b])=>{Fc[b]=m});function Bu(m){const b=new is(m),I=Qh(is.prototype.request,b);return fe.extend(I,is.prototype,b,{allOwnKeys:!0}),fe.extend(I,b,null,{allOwnKeys:!0}),I.create=function(R){return Bu(ts(m,R))},I}const Zt=Bu(No);Zt.Axios=is,Zt.CanceledError=Ns,Zt.CancelToken=Bc,Zt.isCancel=vu,Zt.VERSION=Lu,Zt.toFormData=cl,Zt.AxiosError=ct,Zt.Cancel=Zt.CanceledError,Zt.all=function(b){return Promise.all(b)},Zt.spread=hm,Zt.isAxiosError=um,Zt.mergeConfig=ts,Zt.AxiosHeaders=Gi,Zt.formToJSON=m=>yu(fe.isHTMLForm(m)?new FormData(m):m),Zt.getAdapter=zu.getAdapter,Zt.HttpStatusCode=Fc,Zt.default=Zt;const dm=(m,b=300)=>{let I;return function(...R){clearTimeout(I),I=setTimeout(()=>{m.apply(this,R)},b)}};function fl(m,b,I={}){const A={type:"Feature"};return(I.id===0||I.id)&&(A.id=I.id),I.bbox&&(A.bbox=I.bbox),A.properties=b||{},A.geometry=m,A}function Fu(m,b,I={}){if(!m)throw new Error("coordinates is required");if(!Array.isArray(m))throw new Error("coordinates must be an Array");if(m.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Uu(m[0])||!Uu(m[1]))throw new Error("coordinates must contain numbers");return fl({type:"Point",coordinates:m},b,I)}function Ou(m,b,I={}){for(const R of m){if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(R[R.length-1].length!==R[0].length)throw new Error("First and last Position are not equivalent.");for(let G=0;G<R[R.length-1].length;G++)if(R[R.length-1][G]!==R[0][G])throw new Error("First and last Position are not equivalent.")}return fl({type:"Polygon",coordinates:m},b,I)}function Vu(m,b,I={}){return fl({type:"MultiPoint",coordinates:m},b,I)}function Nu(m,b,I={}){return fl({type:"MultiPolygon",coordinates:m},b,I)}function Uu(m){return!isNaN(m)&&m!==null&&!Array.isArray(m)}function Oc(m,b,I){if(m!==null)for(var A,R,G,T,c,me,ye,ve=0,le=0,ae,ht=m.type,Ue=ht==="FeatureCollection",Ke=ht==="Feature",Oe=Ue?m.features.length:1,ft=0;ft<Oe;ft++){ye=Ue?m.features[ft].geometry:Ke?m.geometry:m,ae=ye?ye.type==="GeometryCollection":!1,c=ae?ye.geometries.length:1;for(var st=0;st<c;st++){var He=0,Ft=0;if(T=ae?ye.geometries[st]:ye,T!==null){me=T.coordinates;var wt=T.type;switch(ve=I&&(wt==="Polygon"||wt==="MultiPolygon")?1:0,wt){case null:break;case"Point":if(b(me,le,ft,He,Ft)===!1)return!1;le++,He++;break;case"LineString":case"MultiPoint":for(A=0;A<me.length;A++){if(b(me[A],le,ft,He,Ft)===!1)return!1;le++,wt==="MultiPoint"&&He++}wt==="LineString"&&He++;break;case"Polygon":case"MultiLineString":for(A=0;A<me.length;A++){for(R=0;R<me[A].length-ve;R++){if(b(me[A][R],le,ft,He,Ft)===!1)return!1;le++}wt==="MultiLineString"&&He++,wt==="Polygon"&&Ft++}wt==="Polygon"&&He++;break;case"MultiPolygon":for(A=0;A<me.length;A++){for(Ft=0,R=0;R<me[A].length;R++){for(G=0;G<me[A][R].length-ve;G++){if(b(me[A][R][G],le,ft,He,Ft)===!1)return!1;le++}Ft++}He++}break;case"GeometryCollection":for(A=0;A<T.geometries.length;A++)if(Oc(T.geometries[A],b,I)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function $o(m,b={}){if(m.bbox!=null&&b.recompute!==!0)return m.bbox;const I=[1/0,1/0,-1/0,-1/0];return Oc(m,A=>{I[0]>A[0]&&(I[0]=A[0]),I[1]>A[1]&&(I[1]=A[1]),I[2]<A[0]&&(I[2]=A[0]),I[3]<A[1]&&(I[3]=A[1])}),I}function pm(m,b={}){const I=$o(m),A=(I[0]+I[2])/2,R=(I[1]+I[3])/2;return Fu([A,R],b.properties,b)}function fm(m,b={}){let I=0,A=0,R=0;return Oc(m,function(G){I+=G[0],A+=G[1],R++},!0),Fu([I/R,A/R],b.properties)}const mm={mixins:[bc],props:{map:{type:Object},baseLayers:{type:Array,default:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",category:"Національна інфраструктура геопросторових даних",scale:1e4,year:2020,bounds:"ua",maxzoom:18,owner:"НДІГК (Інститут геодезії та картографії)",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png",basemap:!0},{id:"graymap",name:"Сіра карта",url:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",attribution:"© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, © <a href='https://carto.com/attributions'>CARTO</a>",bounds1:"ua",image:"https://basemaps.cartocdn.com/light_all/10/601/348.png",position:0,owner:"OSM",basemap:!0},{id:"darkmap_carto",name:"Темна карта України",image:"https://basemaps.cartocdn.com/dark_all/13/4791/2762.png?ver=2023-04-14",url:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",active:!1}]},selectedLayer:{type:String,required:!0}},watch:{map(m){m&&m.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var m;this.baseLayers.forEach(b=>{this.layerList.push(b)}),this.toggleLayerVisibility((m=this.baseLayers[0])==null?void 0:m.id)},toggleLayerVisibility(m){this.$emit("update:selectedLayer",m),this.changeBaseLayer(m)}}},gm={class:"vs-map-slot-layers z-10 select-none"},_m=["onClick"],ym=["src"];function xm(m,b,I,A,R,G){return ee.openBlock(),ee.createElementBlock("div",gm,[(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(I.baseLayers,(T,c)=>(ee.openBlock(),ee.createElementBlock("div",{key:T.id,class:ee.normalizeClass(["vs-map-slot-layers__layer relative",{focused:T.id==I.selectedLayer}]),onClick:me=>G.toggleLayerVisibility(T.id)},[ee.createElementVNode("img",{src:T.image,class:"vs-map-slot-layers__image"},null,8,ym),ee.createElementVNode("div",{class:ee.normalizeClass(["absolute py-2 px-4 text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg top-[-46px] text-nowrap p-2 hidden whitespace-nowrap",[c===0?"left-[-10px]":"left-[50%] translate-x-[-50%]"]])},ee.toDisplayString(T==null?void 0:T.name),3)],10,_m))),128))])}const vm=Or(mm,[["render",xm],["__scopeId","data-v-8959e540"]]),bm={props:["colors","strokes","title"],methods:{capitalizeFirstLetter(m){return m?m.charAt(0).toUpperCase()+m.slice(1):""}}},wm={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border"},Sm={key:0,class:"mb-[10px] text-[1rem]"},Tm={key:1},Im={class:"legend-item flex items-center gap-2 mb-[10px]"},Pm={class:"ml-1 text-[0.875rem]"},km={class:"legend-item"},Em={key:0,class:"flex justify-start items-center gap-2"},Am={class:"ml-1 text-[0.875rem]"};function Cm(m,b,I,A,R,G){var T;return ee.openBlock(),ee.createElementBlock("div",wm,[I.title?(ee.openBlock(),ee.createElementBlock("div",Sm,ee.toDisplayString(I.title),1)):ee.createCommentVNode("",!0),(T=I.strokes)!=null&&T.length?(ee.openBlock(),ee.createElementBlock("div",Tm,[(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(I.strokes,c=>(ee.openBlock(),ee.createElementBlock("div",Im,[ee.createElementVNode("div",{class:"w-[15px] h-[4px]",style:ee.normalizeStyle({background:`repeating-linear-gradient(to right, ${c.color}, ${c.color} 5px, transparent 5px, transparent 8px)`})},null,4),ee.createElementVNode("div",Pm,ee.toDisplayString(G.capitalizeFirstLetter(c.text)),1)]))),256))])):ee.createCommentVNode("",!0),(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(I.colors,c=>(ee.openBlock(),ee.createElementBlock("div",km,[c.id>0?(ee.openBlock(),ee.createElementBlock("div",Em,[ee.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:ee.normalizeStyle({backgroundColor:c.color})},null,4),ee.createElementVNode("div",Am,ee.toDisplayString(G.capitalizeFirstLetter(c.text)),1)])):ee.createCommentVNode("",!0)]))),256))])}const Mm={components:{MapSlotLayers:vm,MapLegend:Or(bm,[["render",Cm]])},props:{isMapCompare:{type:Boolean,default:!0},polygonOpacity:{type:Number,default:()=>null},polygonStrokeWidth:{type:Number,default:()=>4},dashedLine:{type:Boolean,default:()=>!1},colorAttr:null,strokeAttr:null,zoom:{type:Array,default:()=>8},defaultColor:{type:String,default:"blue"},selectedBaseLayer:{type:String,required:!0},legendname:{type:String,default:()=>""},height:{type:String,default:()=>"100vh"},width:{type:String,default:"100vw"},center:{type:Array,default:[32,49]},maxBounds:{type:Array,default:[[22,44],[40,52]]},table:{type:String,default:""},zoom:{type:[String,Number],default:13},minZoom:{type:[String,Number],default:1},basemap:Array,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0}},mixins:[bc],data(){return{map:null,hoverObject:null,popup:null,colors:[],strokes:null}},async mounted(){var m,b,I,A;try{if(await this.createMap(),(m=this.row)!=null&&m.geom){const{type:R,coordinates:G}=this.row.geom;let T;switch(R){case"Polygon":T=Ou(G);break;case"MultiPolygon":T=Nu(G);break;case"MultiPoint":T=Vu(G);break;default:(b=this.map)==null||b.fitBounds([G,G],{maxZoom:this.zoom,padding:30,duration:0}),this.isSelectObj=!0;return}const c=pm(T).geometry.coordinates;(I=this.map)==null||I.fitBounds([c,c],{maxZoom:this.zoom,padding:30,duration:0})}(A=this.map)==null||A.fitBounds(this.center,{duration:0})}catch{}},watch:{filtersParam(m){this.setFilter(this.table,m)},selectedBaseLayer(m){this.$emit("update:selectedBaseLayer",m)},row:{handler(m){m!=null&&m.geom&&this.fitToBounds(m.geom),this.map&&this.map.getStyle()&&this.map.getStyle().layers.filter(A=>A.source===this.table&&A.type==="line").forEach(A=>{var R;this.map.setPaintProperty(A.id,"line-width",((R=this.row)==null?void 0:R.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5)})},immediate:!0}},computed:{basemapIds(){return this.basemap.map(m=>m==null?void 0:m.id)}},methods:{async getColorStyle(){var m=[["#69D2E7","#A7DBD8","#E0E4CC","#F38630","#FA6900"],["#FE4365","#FC9D9A","#F9CDAD","#C8C8A9","#83AF9B"],["#ECD078","#D95B43","#C02942","#542437","#53777A"]];if(!this.colorAttr)return this.defaultColor;try{const{data:{rows:b}}=await Zt.get(`/api/data/${this.table}/${this.colorAttr}`),I=b.reduce((A,R,G)=>R!=null&&R.id?[...A,R.id.toString(),R.color||m[0][G%5]]:A,["match",["get",this.colorAttr]]);return this.colors=[...b],I.push("gray"),I}catch(b){console.log(b)}},async getStrokeStyle(){if(!this.strokeAttr)return"transparent";try{const{data:{rows:m}}=await Zt.get(`/api/data/${this.table}/${this.strokeAttr}`),b=m.reduce((I,A,R)=>A!=null&&A.id?[...I,{id:A.id.toString(),color:A.color||"#000000",dash:A.dash||[2,2],text:A.text||A.id.toString()}]:I,[]);return this.strokes=[...b],["match",["get",this.strokeAttr],...b.flatMap(({id:I,color:A})=>[I,A]),"transparent"]}catch(m){return console.log(m),"transparent"}},async handleMapLoad(){var A,R,G,T,c;(A=this.row)!=null&&A.geom&&this.fitToBounds(this.row.geom),this.$emit("map",this.map);const m=await this.getStrokeStyle(),b=await this.getColorStyle(),I=((G=(R=location.search.split("&").find(me=>me.includes("filter=")))==null?void 0:R.split("filter="))==null?void 0:G[1])||"";await this.addLayer({id:this.table,service:"vector",url:`/api/vtile/${this.table}/ua/{z}/{x}/{y}.vmt?pointZoom=${this.pointZoom}&dt=${new Date().toISOString()}`,layers:[{type:"fill","source-layer":this.table,paint:{"fill-color":b,"fill-opacity":this.polygonOpacity??.5,"fill-outline-color":["case",["==",["feature-state","hover"],!0],"red","#000000"]},filter:["all",["==",["geometry-type"],"Polygon"]]},{type:"circle","source-layer":this.table,filter:["all",["==",["geometry-type"],"Point"]],paint:{"circle-radius":{base:1.75,stops:[[10,5],[12,6],[18,12]]},"circle-stroke-color":["case",["==",["feature-state","hover"],!0],"red","#ccc"],"circle-stroke-width":["case",["==",["feature-state","hover"],!0],2,1],"circle-color":b}},{type:"line",paint:{"line-color":b,"line-width":((T=this.row)==null?void 0:T.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5}},...this.dashedLine?[{type:"line",paint:{"line-color":m,"line-width":((c=this.row)==null?void 0:c.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5,"line-dasharray":[2,2]}}]:[]]}),I&&this.setFilter(this.table,I)},async createMap(){const m={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new Fo.Map({container:"maplibre-map",style:m,zoom:this.zoom,center:this.center,minZoom:this.minZoom}),this.$parent.map=this.map,this.map.addControl(new Fo.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)},fitToBounds(m){if(!this.map)return;const{type:b,coordinates:I}=m;let A,R;switch(b){case"Polygon":A=Ou(I),R=$o(A),this.map.fitBounds(R,{padding:30,maxZoom:15,duration:0});break;case"MultiPolygon":A=Nu(I),R=$o(A),this.map.fitBounds(R,{padding:30,maxZoom:15,duration:0});break;case"MultiPoint":A=Vu(I),R=$o(A),this.map.fitBounds(R,{padding:30,maxZoom:15,duration:0});break;case"Point":this.map.flyTo({center:I,zoom:15,duration:0,essential:!0});break;default:console.warn("Невідомий тип геометрії:",b)}}}},zm={class:"vs-map-portal relative z-1 mt-2",id:"mapwrapper"};function Dm(m,b,I,A,R,G){const T=ee.resolveComponent("MapLegend"),c=ee.resolveComponent("MapSlotLayers");return ee.openBlock(),ee.createElementBlock("div",zm,[ee.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full compare_main_map",style:ee.normalizeStyle({height:I.height})},null,4),ee.withDirectives(ee.createVNode(T,{colors:R.colors,strokes:R.strokes,title:I.legendname},null,8,["colors","strokes","title"]),[[ee.vShow,I.legend]]),ee.createVNode(c,{map:R.map,baseLayers:I.basemap,selectedLayer:I.selectedBaseLayer,"onUpdate:selectedLayer":b[0]||(b[0]=me=>m.$emit("update:selectedBaseLayer",me))},null,8,["map","baseLayers","selectedLayer"])])}const Lm=Or(Mm,[["render",Dm]]),Rm={},Bm={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Fm=[ee.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)];function Om(m,b){return ee.openBlock(),ee.createElementBlock("svg",Bm,Fm)}const Vm=Or(Rm,[["render",Om]]),Nm={},Um={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-collapse"},$m=[ee.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),ee.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),ee.createElementVNode("path",{d:"M15 4v16"},null,-1),ee.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1)];function jm(m,b){return ee.openBlock(),ee.createElementBlock("svg",Um,$m)}const qm=Or(Nm,[["render",jm]]),Zm={},Gm={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-expand"},Hm=[ee.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),ee.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),ee.createElementVNode("path",{d:"M15 4v16"},null,-1),ee.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1)];function Wm(m,b){return ee.openBlock(),ee.createElementBlock("svg",Gm,Hm)}const Xm=Or(Zm,[["render",Wm]]),Jm={},Km={class:"shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ym=[ee.createElementVNode("path",{d:"M18 6 6 18"},null,-1),ee.createElementVNode("path",{d:"m6 6 12 12"},null,-1)];function Qm(m,b){return ee.openBlock(),ee.createElementBlock("svg",Km,Ym)}const eg=Or(Jm,[["render",Qm]]),tg={props:{visible:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""}},emits:["update:visible","onClose"],name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){var m;return!!((m=this.$slots)!=null&&m.footer)},checkSize(){return this.size==="small"?"w-5/12":this.size==="medium"?"w-6/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:m}){m==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")}}},$u=m=>(ee.pushScopeId("data-v-37405773"),m=m(),ee.popScopeId(),m),ig={class:"vsTailwind ui-dialog__wrapper"},rg={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},ng={class:"py-2.5 px-4 flex justify-between items-center border-b"},sg={class:"font-medium text-gray-800"},og=[$u(()=>ee.createElementVNode("span",{class:"sr-only"},"Close",-1)),$u(()=>ee.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[ee.createElementVNode("path",{d:"M18 6 6 18"}),ee.createElementVNode("path",{d:"m6 6 12 12"})],-1))],ag={class:"ui-dialog__content p-4"},lg={key:0,class:"flex justify-end gap-x-2"};function cg(m,b,I,A,R,G){return ee.openBlock(),ee.createBlock(ee.Teleport,{to:"#modal"},[ee.createVNode(ee.Transition,{name:"fade"},{default:ee.withCtx(()=>[ee.withDirectives(ee.createElementVNode("div",ig,[ee.createElementVNode("div",rg,[ee.createVNode(ee.Transition,{name:"content",appear:""},{default:ee.withCtx(()=>[ee.createElementVNode("div",{class:ee.normalizeClass(["ui-dialog__modal opacity-1 transition-all flex flex-col bg-white border pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[G.checkSize]])},[ee.createElementVNode("div",ng,[ee.createElementVNode("h3",sg,ee.toDisplayString(I.title),1),ee.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:b[0]||(b[0]=(...T)=>G.handleClose&&G.handleClose(...T))},og)]),ee.createElementVNode("div",ag,[ee.renderSlot(m.$slots,"default",{},void 0,!0)]),G.hasSlot?(ee.openBlock(),ee.createElementBlock("div",lg,[ee.renderSlot(m.$slots,"footer",{},void 0,!0)])):ee.createCommentVNode("",!0)],2)]),_:3})])],512),[[ee.vShow,I.visible]])]),_:3})])}const hg=Or(tg,[["render",cg],["__scopeId","data-v-37405773"]]),ug=ee.defineComponent({props:{dashedLine:{type:Boolean,default:!1},title:{type:String,default:()=>""},table:{type:String,default:()=>""},rows:{type:Object,default:()=>null},isMapCompare:{type:Boolean,default:!0},initTotal:{type:[Number,String],default:()=>""},colorAttr:{type:String,default:()=>""},strokeAttr:{type:String,default:()=>""},legendname:{type:String,default:()=>""},center:{type:Array},maxBounds:{type:Array,default:()=>[[22,44.4],[40,52.5]]},id:{type:String,default:()=>""},isAutocomplete:{type:Boolean,default:()=>!1},isAddressAutocomplete:{type:Boolean,default:()=>!1},zoom:{type:[Number,String],default:()=>"13"},minZoom:{type:[Number,String],default:()=>"1"},maskForSearch:{type:String,default:()=>null},searchShow:{type:Boolean,default:()=>!0},basemap:{type:Array},pointZoom:{type:String,default:()=>"12"},legend:{type:Boolean,default:()=>!0},defaultColor:{type:String,default:()=>"blue"},polygonOpacity:{type:Number,default:()=>null}},mixins:[bc],components:{MapPortal:Lm,NoData:jp,FilterIcon:Vm,VisibleMapIcon:qm,HiddenMapIcon:Xm,CloseIcon:eg,VsDialog:hg},data(){return{filters:"",search:"",limit:20,polyline:null,filtersParam:"",isSelectObj:!1,selectedId:"",searchRegion:"",searchAddress:"",map:null,selectedBaseLayer:"",marker:null,selectedRow:null,activeFilters:"",isMapVisible:!0,tabsIsVisible:!1,filterUrl:"",currentPage:1,regionOptionGeneral:null,isFilterVisible:!1,tableData:null,hoverData:null,atuData:[],map:null,legendName:null,total:null,filtered:null,filterValues:"",activeFiltersCount:"",visibleTrue:!0,regionSelectValue:null,addressSelectValue:null,currentBbox:null,mountedFilter:{},isCompareOpen:!1,optionRowsCount:[{value:10,label:"10"},{value:20,label:"20"},{value:30,label:"30"}],handleDebouncedUpdateValue:dm(m=>{this.handleSearchValue(m)},300)}},watch:{map(){this.map.on("mousemove",this.handleMapHover),this.map.on("click",this.handleMapClick),this.$emit("update:map",this.map)},activeFiltersCount(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.filteredActiveFiltersLength},activeFilters(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters},isFilterVisible(m){m||this.getData()},async regionSelectValue(m,b){var R,G;if(!this.regionSelectValue){this.map.removeSource("region-search-id");return}m&&this.selectedId&&this.closeObjCard(),this.polyline=this.regionSelectValue.encoded_geom,this.getData();const I=((R=this.regionSelectValue)==null?void 0:R.geom)||Sr.toGeoJSON(this.regionSelectValue.encoded_geom),A=this.map.getSource("region-search-id");if(this.currentBbox=$o(I),A)A.setData({type:"Feature",geometry:I});else{this.map.addSource("region-search-id",{type:"geojson",data:{type:"Feature",geometry:I}});const T={id:"region-search-id",type:"line",source:"region-search-id",paint:{"line-color":"blue","line-opacity":1}};await this.map.addLayer(T)}this.moveLayer("site.prc.parcel_object.table"),(G=this.map)==null||G.fitBounds(this.currentBbox,{zoom:this.setAtuZoom,padding:20,duration:0}),this.getData()},async addressSelectValue(m,b){this.addressSelectValue&&(m&&this.selectedId&&this.closeObjCard(),this.getData())}},created(){this.tableData=this.rows,this.total=this.initTotal,this.id&&(this.selectedRow=this.rows[0],this.selectedId=this.id,this.isSelectObj=!0)},mounted(){this.rows||this.getData();const m=new URLSearchParams(window.location.search),b=m.get("filter");m.get("id");const I=b==null?void 0:b.split("|");I==null||I.forEach(R=>{const[G,T]=R.split("=");T!=null&&T.includes(",")?this.mountedFilter[G]=T==null?void 0:T.split(","):this.mountedFilter[G]=T,this.activeFilters=this.mountedFilter});const A=new URLSearchParams(window.location.search);this.currentPage=A.get("page")||1,this.getFilter()},updated(){this.checkFilterLength()},computed:{setAtuZoom(){var m,b,I;return((m=this.regionSelectValue)==null?void 0:m.id)==="UA80000000000093317"||((b=this.regionSelectValue)==null?void 0:b.id)==="UA85000000000065278"?10:((I=this.regionSelectValue)==null?void 0:I.region)===""?7.5:11}},methods:{async getData(){try{const m={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};m.filter=this.filtersParam;const{data:b}=await Zt.get(`/api/data/${this.table}`,{params:m});this.tableData=b==null?void 0:b.rows,this.total=b.filtered,this.filtered=b.filtered}catch(m){console.error(m.message)}},moveToDefaultPage(){var A;const m=new URLSearchParams(window.location.search);m.delete("id");const I=`${window.location.pathname}?${m.toString()}`;(A=this.map)==null||A.fitBounds(this.maxBounds,{duration:0}),window.history.pushState({},"",I),this.isSelectObj=!1},regionFullName(m){return m.region?`${m.text} / ${m.region}`:m.text},getLabelById(m){const b=this.filters.find(I=>I.id===m);return b?b.label:m},getOptionsLabelById(m,b){if(Array.isArray(b)){const I=this.filters.find(A=>A.id===m);return I!=null&&I.options?I==null?void 0:I.options.filter(A=>b.includes(A.id)).map(A=>A.text).join(", "):b==null?void 0:b.length}else return b},async clearFilter(m){var b,I,A;await((I=(b=this.$refs)==null?void 0:b.filter)==null?void 0:I.clearFilter(m)),this.filterUrl=(A=this.$refs)==null?void 0:A.filter.filterUrl,(m==="region_katottg"||m==="katottg")&&this.$emit("update:filterState",{}),await this.updateTableAndMap(),await this.getData()},handlePageChange(m){this.currentPage=m;const b=new URL(window.location.href),I=new URLSearchParams(window.location.search);I.set("page",m),b.search=decodeURI(I.toString()),window.history.pushState({},"",b),this.getData()},async getFilter(){var m;try{const{data:b}=await Zt.get(`/api/filter/${this.table}`);this.filters=(m=b==null?void 0:b.list)==null?void 0:m.map(I=>({...I,label:(I==null?void 0:I.label)||(I==null?void 0:I.ua),id:(I==null?void 0:I.id)||(I==null?void 0:I.name)}))}catch(b){console.error(b.message)}},async handleSearchValue(m){this.search=m,await this.getData()},closeObjCard(){var A;const m=new URLSearchParams(window.location.search);m.delete("id"),this.deletePulsePoint(),this.deleteHighlighPolygon();const I=`${window.location.pathname}?${m.toString()}`;(this.currentBbox||this.center)&&((A=this.map)==null||A.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom,duration:0})),window.history.pushState({},"",I),this.isSelectObj=!1,this.selectedRow=null,this.getData()},async handleSearchRegionValue(m){var I;const b=this.map.getLayer("region-search-id");this.searchRegion=m,m===""&&b?((I=this.map)==null||I.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("region-search-id"),this.getData()):m===""&&this.getData()},async handleSearchAddressValue(m){var I;const b=this.map.getLayer("address-search-id");this.searchAddress=m,m===""&&b?((I=this.map)==null||I.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("address-search-id"),this.getData()):m===""&&this.getData()},handleFilterChange(m){this.$emit("update:filterState",m),this.currentPage=m.state.page||1,this.filterUrl=m.url==="no-url"?null:m.url.split("|").filter(b=>!b.includes("page=")).join("|")},async updateTableAndMap(){var m,b;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters,this.isFilterVisible=!1,this.getData())},handleFilterSubmit(){var m;this.isSelectObj="",this.selectedId="",this.selectedId=!1,(m=this.map)==null||m.fitBounds(this.maxBounds,{duration:0}),this.isFilterVisible=!1},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(m=!0){const b=new URLSearchParams(window.location.search);b.has("id")?(this.isSelectObj=!0,this.isMapVisible=m,this.selectedId=b.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(m){this.limit=m,this.currentPage=1,this.getData()},filterModalClose(){this.isFilterVisible=!1},resetFilters(){this.$refs.filter&&(this.$refs.filter.clearAll(),this.search="",this.isFilterVisible=!1,this.filtersParam="",this.polyline=null,this.regionSelectValue=null,this.addressSelectValue=null,this.currentBbox=null,this.activeFilters=null,this.tabsIsVisible=!1,this.handleSearchRegionValue(""),this.handleSearchAddressValue(""))},checkFilterLength(){var b,I;const m=(I=(b=this.$refs)==null?void 0:b.filter)==null?void 0:I.filteredActiveFiltersLength;m!==this.previousLength&&(this.previousLength=m,this.activeFiltersCount=m)},async handleMapClick(m){var G,T,c,me,ye,ve,le,ae,ht,Ue;const b=this.map.queryRenderedFeatures(m.point);if((b==null?void 0:b.length)<1||((G=b[0])==null?void 0:G.source)==="region-search-id"||((T=b[0])==null?void 0:T.source)==="route-line")return;const I=window.location.pathname,A=new URLSearchParams(window.location.search);A.set("id",`${(c=b[0])==null?void 0:c.properties.id}`),this.getObjectData((ye=(me=b[0])==null?void 0:me.properties)==null?void 0:ye.id);const R=`${I}?${A.toString()}`;window.history.pushState({},"",R),this.isSelectObj=!0,m.lngLat&&((Ue=this.map)==null||Ue.fitBounds([[(ve=m.lngLat)==null?void 0:ve.lng,(le=m.lngLat)==null?void 0:le.lat],[(ae=m.lngLat)==null?void 0:ae.lng,(ht=m.lngLat)==null?void 0:ht.lat]],{padding:30,duration:0})),this.checkUrl()},async getObjectData(m){var b,I;try{const{data:A}=await Zt.get(`/api/data/${this.table}/${m}`);this.selectRow((b=A==null?void 0:A.rows)==null?void 0:b[0]),((I=A==null?void 0:A.rows)==null?void 0:I.lenght)<1&&this.deletePulsePoint()}catch(A){console.error(A.message)}},async selectRow(m,b=!0){var c;this.isMapVisible=b;const A=await(await fetch(`/api/data/${this.table}/${m.id}`)).json();this.selectedRow=((c=A==null?void 0:A.rows)==null?void 0:c[0])||m;const R=window.location.pathname,G=new URLSearchParams(window.location.search);G.set("id",`${m.id}`);const T=`${R}?${G.toString()}`;window.history.pushState({},"",T),this.checkUrl(b),this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(m){this.deletePulsePoint();const b=document.createElement("div");b.className="gps-marker",b.style.width="10px",b.style.height="10px",b.style.position="relative";const I=document.createElement("div");I.className="gps-wave",b.appendChild(I),this.marker=new Fo.Marker({element:b,anchor:"center"}).setLngLat(m).addTo(this.map)},deleteHighlighPolygon(){var m,b,I;(m=this.map)!=null&&m.getLayer("highlighted-polygon")&&((b=this.map)==null||b.removeLayer("highlighted-polygon"),(I=this.map)==null||I.removeSource("highlighted-polygon"))},highlightPolygon(m){var b,I,A,R,G,T;this.deletePulsePoint(),this.deleteHighlighPolygon(),(R=this.map)==null||R.addSource("highlighted-polygon",{type:"geojson",data:{geometry:{type:(b=m==null?void 0:m.geom)==null?void 0:b.type,coordinates:(I=m==null?void 0:m.geom)==null?void 0:I.coordinates},type:"Feature",properties:{id:m==null?void 0:m.id,name:m==null?void 0:m.name,category:m==null?void 0:m.id},id:m==null?void 0:m.id,layer:{id:"site.rest_zone.table-0",type:"fill",source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",filter:["all",["==",["geometry-type"],(A=m==null?void 0:m.geom)==null?void 0:A.type]],paint:{"fill-color":"orange","fill-opacity":.5},layout:{}},source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",state:{hover:!0},table:"site.rest_zone.table"}}),(G=this.map)==null||G.addLayer({id:"highlighted-polygon",type:"fill",source:"highlighted-polygon",layout:{},minzoom:12,maxzoom:0,paint:{"fill-color":"orange","fill-opacity":.6}}),(T=this.map)==null||T.moveLayer("highlighted-polygon")},async handleMapHover(m){var T,c,me;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new Fo.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const b=this.map.queryRenderedFeatures(m.point);if(this.map.getCanvas().style.cursor="pointer",!(b!=null&&b.length)||((T=b==null?void 0:b[0])==null?void 0:T.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const I=["route-line"];if(!b.filter(ye=>!I.some(ve=>{var le;return(le=ye.layer)==null?void 0:le.source.includes(ve)})).length)return;const R=b[0].geometry.coordinates.slice();b[0].source==="highlighted-polygon"&&b[1]?this.hoverData=(c=b[1])==null?void 0:c.properties:this.hoverData=(me=b[0])==null?void 0:me.properties;const G={source:b[0].source,sourceLayer:b[0].sourceLayer,id:b[0].id};if(G.source!=="region-search-id"){for(this.map.setFeatureState(G,{hover:!0}),this.hoverObject=G;Math.abs(m.lngLat.lng-R[0])>180;)R[0]+=m.lngLat.lng>R[0]?360:-360;this.popup.setLngLat(m.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}},removeSelectedBaseLayer(){this.selectedBaseLayer=""},addGeomMarker(m){if(!this.map||!m)return;this.marker&&this.marker.remove();let b;(m==null?void 0:m.type)==="Point"?b=m.coordinates:b=fm(m).geometry.coordinates,this.marker=new Fo.Marker({color:"green"}).setLngLat(b).addTo(this.map)}}}),dg={class:"ml-3 pt-[20px]"},pg={class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},fg={class:"flex items-center gap-2 max-h-[38px] pt-[4px]"},mg={class:"custom-filter-list"},gg={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},_g=["title"],yg=ee.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),xg={class:"flex"},vg={class:"py-[15px] pb-[24px] pl-2"},bg={class:"font-bold text-2xl mr-[10px]"},wg={class:"text-sm text-stone-500 font-medium"},Sg=ee.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),Tg={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},Ig={key:0,class:"flex gap-x-2 flex-wrap"},Pg={class:"font-medium"},kg=ee.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),Eg={class:"text-gray-500"},Ag=["onClick"],Cg={key:0,class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full"},Mg=ee.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),zg={key:2,class:"text-center py-28"},Dg=ee.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),Lg=ee.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),Rg={key:0},Bg={key:1,class:"my-5 pr-2"},Fg={class:"flex justify-between"},Og={class:"w-2/4"},Vg={class:"map-section relative"},Ng={ref:"popup",style:{display:"none"}};function Ug(m,b,I,A,R,G){var Oe,ft;const T=ee.resolveComponent("VsTextMask"),c=ee.resolveComponent("vs-text"),me=ee.resolveComponent("FilterIcon"),ye=ee.resolveComponent("VsFilterList"),ve=ee.resolveComponent("VisibleMapIcon"),le=ee.resolveComponent("HiddenMapIcon"),ae=ee.resolveComponent("CloseIcon"),ht=ee.resolveComponent("NoData"),Ue=ee.resolveComponent("VsPagination"),Ke=ee.resolveComponent("MapPortal");return ee.openBlock(),ee.createElementBlock("section",dg,[ee.createElementVNode("div",null,[ee.createElementVNode("div",pg,[ee.createElementVNode("div",fg,[m.maskForSearch?(ee.openBlock(),ee.createBlock(T,{key:0,"model-value":m.search,"onUpdate:modelValue":m.handleDebouncedUpdateValue,class:"w-full table-interface-search",placeholder:"Пошук",mask:m.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue","mask"])):m.searchShow?(ee.openBlock(),ee.createBlock(c,{key:1,"model-value":m.search,"onUpdate:modelValue":m.handleDebouncedUpdateValue,class:"[&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:w-[220px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",placeholder:"Пошук",icon:"search","icon-position":"left",clearable:"",style:{height:"38px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue"])):ee.createCommentVNode("",!0),ee.createElementVNode("div",mg,[m.filters?(ee.openBlock(),ee.createBlock(ye,{key:0,ref:"filter",modelValue:m.mountedFilter,"onUpdate:modelValue":b[0]||(b[0]=st=>m.mountedFilter=st),scheme:m.filters,isDialog:(Oe=m.filters)==null?void 0:Oe.some(st=>!(st!=null&&st.inline)),"apply-vue-router":"",history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:b[1]||(b[1]=async st=>{await m.handleFilterChange(st),await m.updateTableAndMap()})},{button:ee.withCtx(({visible:st})=>[ee.createElementVNode("button",{type:"button",class:ee.normalizeClass(["py-2 px-2.5 h-[40px] inline-flex items-center gap-x-1.5 text-sm font-medium rounded-lg bg-white text-gray-800 hover:bg-gray-50 focus:outline-none focus:bg-gray-50",[st?"border border-blue-600 border-2":"border border-gray-200"]])},[ee.createVNode(me),ee.createTextVNode(" Фільтри "),m.activeFiltersCount>=1?(ee.openBlock(),ee.createElementBlock("span",gg,ee.toDisplayString(m.activeFiltersCount),1)):ee.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme","isDialog"])):ee.createCommentVNode("",!0)])]),ee.createElementVNode("button",{type:"button",class:"py-2 px-2 inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100",title:m.isMapVisible?"Приховати карту":"Показати карту",onClick:b[2]||(b[2]=(...st)=>m.toggleMapVisible&&m.toggleMapVisible(...st))},[m.isMapVisible?(ee.openBlock(),ee.createBlock(ve,{key:0})):(ee.openBlock(),ee.createBlock(le,{key:1})),yg],8,_g)]),ee.createElementVNode("div",xg,[ee.createElementVNode("div",{class:ee.normalizeClass(["relative overflow-hidden",m.isMapVisible?"w-2/4 mr-0":"w-full mr-3",m.isSelectObj?"hidden":""])},[ee.createElementVNode("h1",vg,[ee.createElementVNode("span",bg,ee.toDisplayString(m.title),1),ee.createElementVNode("span",wg,ee.toDisplayString(m.total),1),Sg]),ee.createElementVNode("div",Tg,[m.activeFilters?(ee.openBlock(),ee.createElementBlock("div",Ig,[(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(m.activeFilters,(st,He,Ft)=>(ee.openBlock(),ee.createElementBlock("span",{class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full",key:Ft},[ee.createElementVNode("span",Pg,ee.toDisplayString(m.getLabelById(He)),1),kg,ee.createElementVNode("span",Eg,ee.toDisplayString(m.getOptionsLabelById(He,st)),1),ee.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:wt=>m.clearFilter(He)},[ee.createVNode(ae)],8,Ag)]))),128)),((ft=Object.keys(m.activeFilters))==null?void 0:ft.length)>=2?(ee.openBlock(),ee.createElementBlock("span",Cg,[Mg,ee.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:b[3]||(b[3]=st=>m.mountedFilter={})},[ee.createVNode(ae)])])):ee.createCommentVNode("",!0)])):ee.createCommentVNode("",!0),m.total>=1?ee.renderSlot(m.$slots,"table",{key:1,rows:m.tableData,map:m.map,marker:m.marker,selectRow:m.selectRow,getData:m.getData,addGeomMarker:m.addGeomMarker,isMapVisible:m.isMapVisible}):(ee.openBlock(),ee.createElementBlock("div",zg,[ee.createVNode(ht),Dg,Lg,ee.createElementVNode("button",{type:"button",class:"mt-[10px] py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",onClick:b[4]||(b[4]=(...st)=>m.resetFilters&&m.resetFilters(...st))}," Очистити дані пошуку ")]))]),m.total>=1?(ee.openBlock(),ee.createElementBlock("hr",Rg)):ee.createCommentVNode("",!0),m.total>=1?(ee.openBlock(),ee.createElementBlock("div",Bg,[ee.createElementVNode("div",Fg,[ee.createVNode(Ue,{total:m.total,maxPages:7,defaultPage:m.currentPage,pageSize:m.limit,goTo:!1,size:"medium",onPageChange:m.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:m.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):ee.createCommentVNode("",!0)],2),m.isSelectObj?(ee.openBlock(),ee.createElementBlock("div",{key:0,class:ee.normalizeClass(m.isMapVisible?"w-2/4 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[ee.renderSlot(m.$slots,"details",{table:m.table,selectedId:m.selectedId,selectedRow:m.selectedRow,map:m.map,closeObjCard:m.closeObjCard,isMapVisible:m.isMapVisible})],2)):ee.createCommentVNode("",!0),ee.withDirectives(ee.createElementVNode("div",Og,[ee.createElementVNode("section",Vg,[ee.renderSlot(m.$slots,"default",{map:m.map,removeSelectedBaseLayer:m.removeSelectedBaseLayer,selectedBaseLayer:m.selectedBaseLayer,selectedRow:m.selectedRow}),ee.createVNode(Ke,{height:"calc(100vh - 152px)",width:"w-2/4",table:m.table,filtersParam:m.filtersParam,row:m.selectedRow,legendname:m.legendname,legend:m.legend,colorAttr:m.colorAttr,strokeAttr:m.strokeAttr,polygonOpacity:m.polygonOpacity,maxBounds:m.maxBounds,center:m.center,zoom:m.zoom,dashedLine:m.dashedLine,minZoom:m.minZoom,basemap:m.basemap,pointZoom:m.pointZoom,defaultColor:m.defaultColor,onMap:b[5]||(b[5]=st=>m.map=st),selectedBaseLayer:m.selectedBaseLayer,"onUpdate:selectedBaseLayer":b[6]||(b[6]=st=>m.selectedBaseLayer=st),onIsCompareOpen:b[7]||(b[7]=st=>m.isCompareOpen=st)},null,8,["table","filtersParam","row","legendname","legend","colorAttr","strokeAttr","polygonOpacity","maxBounds","center","zoom","dashedLine","minZoom","basemap","pointZoom","defaultColor","selectedBaseLayer"])])],512),[[ee.vShow,m.isMapVisible]])]),ee.createElementVNode("div",Ng,[ee.renderSlot(m.$slots,"popup",{data:m.hoverData})],512)])])}const ju=Or(ug,[["render",Ug]]),qu={install:m=>{m.component("VsPartsMap",ju)},components:{VsPartsMap:ju}};return typeof window<"u"&&(window.PartsMap=qu),qu});
|
585
|
+
`+G):A.stack=G}catch{}}throw A}}_request(b,I){typeof b=="string"?(I=I||{},I.url=b):I=b||{},I=ts(this.defaults,I);const{transitional:A,paramsSerializer:R,headers:G}=I;A!==void 0&&Rc.assertOptions(A,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean)},!1),R!=null&&(fe.isFunction(R)?I.paramsSerializer={serialize:R}:Rc.assertOptions(R,{encode:Pn.function,serialize:Pn.function},!0)),I.method=(I.method||this.defaults.method||"get").toLowerCase();let T=G&&fe.merge(G.common,G[I.method]);G&&fe.forEach(["delete","get","head","post","put","patch","common"],Ue=>{delete G[Ue]}),I.headers=Gi.concat(T,G);const c=[];let me=!0;this.interceptors.request.forEach(function(Ke){typeof Ke.runWhen=="function"&&Ke.runWhen(I)===!1||(me=me&&Ke.synchronous,c.unshift(Ke.fulfilled,Ke.rejected))});const ye=[];this.interceptors.response.forEach(function(Ke){ye.push(Ke.fulfilled,Ke.rejected)});let ve,le=0,ae;if(!me){const Ue=[Du.bind(this),void 0];for(Ue.unshift.apply(Ue,c),Ue.push.apply(Ue,ye),ae=Ue.length,ve=Promise.resolve(I);le<ae;)ve=ve.then(Ue[le++],Ue[le++]);return ve}ae=c.length;let ht=I;for(le=0;le<ae;){const Ue=c[le++],Ke=c[le++];try{ht=Ue(ht)}catch(Oe){Ke.call(this,Oe);break}}try{ve=Du.call(this,ht)}catch(Ue){return Promise.reject(Ue)}for(le=0,ae=ye.length;le<ae;)ve=ve.then(ye[le++],ye[le++]);return ve}getUri(b){b=ts(this.defaults,b);const I=Tu(b.baseURL,b.url);return mu(I,b.params,b.paramsSerializer)}}fe.forEach(["delete","get","head","options"],function(b){is.prototype[b]=function(I,A){return this.request(ts(A||{},{method:b,url:I,data:(A||{}).data}))}}),fe.forEach(["post","put","patch"],function(b){function I(A){return function(G,T,c){return this.request(ts(c||{},{method:b,headers:A?{"Content-Type":"multipart/form-data"}:{},url:G,data:T}))}}is.prototype[b]=I(),is.prototype[b+"Form"]=I(!0)});class Bc{constructor(b){if(typeof b!="function")throw new TypeError("executor must be a function.");let I;this.promise=new Promise(function(G){I=G});const A=this;this.promise.then(R=>{if(!A._listeners)return;let G=A._listeners.length;for(;G-- >0;)A._listeners[G](R);A._listeners=null}),this.promise.then=R=>{let G;const T=new Promise(c=>{A.subscribe(c),G=c}).then(R);return T.cancel=function(){A.unsubscribe(G)},T},b(function(G,T,c){A.reason||(A.reason=new Ns(G,T,c),I(A.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(b){if(this.reason){b(this.reason);return}this._listeners?this._listeners.push(b):this._listeners=[b]}unsubscribe(b){if(!this._listeners)return;const I=this._listeners.indexOf(b);I!==-1&&this._listeners.splice(I,1)}static source(){let b;return{token:new Bc(function(R){b=R}),cancel:b}}}function hm(m){return function(I){return m.apply(null,I)}}function um(m){return fe.isObject(m)&&m.isAxiosError===!0}const Fc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fc).forEach(([m,b])=>{Fc[b]=m});function Bu(m){const b=new is(m),I=Qh(is.prototype.request,b);return fe.extend(I,is.prototype,b,{allOwnKeys:!0}),fe.extend(I,b,null,{allOwnKeys:!0}),I.create=function(R){return Bu(ts(m,R))},I}const Zt=Bu(No);Zt.Axios=is,Zt.CanceledError=Ns,Zt.CancelToken=Bc,Zt.isCancel=vu,Zt.VERSION=Lu,Zt.toFormData=cl,Zt.AxiosError=ct,Zt.Cancel=Zt.CanceledError,Zt.all=function(b){return Promise.all(b)},Zt.spread=hm,Zt.isAxiosError=um,Zt.mergeConfig=ts,Zt.AxiosHeaders=Gi,Zt.formToJSON=m=>yu(fe.isHTMLForm(m)?new FormData(m):m),Zt.getAdapter=zu.getAdapter,Zt.HttpStatusCode=Fc,Zt.default=Zt;const dm=(m,b=300)=>{let I;return function(...R){clearTimeout(I),I=setTimeout(()=>{m.apply(this,R)},b)}};function fl(m,b,I={}){const A={type:"Feature"};return(I.id===0||I.id)&&(A.id=I.id),I.bbox&&(A.bbox=I.bbox),A.properties=b||{},A.geometry=m,A}function Fu(m,b,I={}){if(!m)throw new Error("coordinates is required");if(!Array.isArray(m))throw new Error("coordinates must be an Array");if(m.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Uu(m[0])||!Uu(m[1]))throw new Error("coordinates must contain numbers");return fl({type:"Point",coordinates:m},b,I)}function Ou(m,b,I={}){for(const R of m){if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(R[R.length-1].length!==R[0].length)throw new Error("First and last Position are not equivalent.");for(let G=0;G<R[R.length-1].length;G++)if(R[R.length-1][G]!==R[0][G])throw new Error("First and last Position are not equivalent.")}return fl({type:"Polygon",coordinates:m},b,I)}function Vu(m,b,I={}){return fl({type:"MultiPoint",coordinates:m},b,I)}function Nu(m,b,I={}){return fl({type:"MultiPolygon",coordinates:m},b,I)}function Uu(m){return!isNaN(m)&&m!==null&&!Array.isArray(m)}function Oc(m,b,I){if(m!==null)for(var A,R,G,T,c,me,ye,ve=0,le=0,ae,ht=m.type,Ue=ht==="FeatureCollection",Ke=ht==="Feature",Oe=Ue?m.features.length:1,ft=0;ft<Oe;ft++){ye=Ue?m.features[ft].geometry:Ke?m.geometry:m,ae=ye?ye.type==="GeometryCollection":!1,c=ae?ye.geometries.length:1;for(var st=0;st<c;st++){var He=0,Ft=0;if(T=ae?ye.geometries[st]:ye,T!==null){me=T.coordinates;var wt=T.type;switch(ve=I&&(wt==="Polygon"||wt==="MultiPolygon")?1:0,wt){case null:break;case"Point":if(b(me,le,ft,He,Ft)===!1)return!1;le++,He++;break;case"LineString":case"MultiPoint":for(A=0;A<me.length;A++){if(b(me[A],le,ft,He,Ft)===!1)return!1;le++,wt==="MultiPoint"&&He++}wt==="LineString"&&He++;break;case"Polygon":case"MultiLineString":for(A=0;A<me.length;A++){for(R=0;R<me[A].length-ve;R++){if(b(me[A][R],le,ft,He,Ft)===!1)return!1;le++}wt==="MultiLineString"&&He++,wt==="Polygon"&&Ft++}wt==="Polygon"&&He++;break;case"MultiPolygon":for(A=0;A<me.length;A++){for(Ft=0,R=0;R<me[A].length;R++){for(G=0;G<me[A][R].length-ve;G++){if(b(me[A][R][G],le,ft,He,Ft)===!1)return!1;le++}Ft++}He++}break;case"GeometryCollection":for(A=0;A<T.geometries.length;A++)if(Oc(T.geometries[A],b,I)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function $o(m,b={}){if(m.bbox!=null&&b.recompute!==!0)return m.bbox;const I=[1/0,1/0,-1/0,-1/0];return Oc(m,A=>{I[0]>A[0]&&(I[0]=A[0]),I[1]>A[1]&&(I[1]=A[1]),I[2]<A[0]&&(I[2]=A[0]),I[3]<A[1]&&(I[3]=A[1])}),I}function pm(m,b={}){const I=$o(m),A=(I[0]+I[2])/2,R=(I[1]+I[3])/2;return Fu([A,R],b.properties,b)}function fm(m,b={}){let I=0,A=0,R=0;return Oc(m,function(G){I+=G[0],A+=G[1],R++},!0),Fu([I/R,A/R],b.properties)}const mm={mixins:[bc],props:{map:{type:Object},baseLayers:{type:Array,default:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",category:"Національна інфраструктура геопросторових даних",scale:1e4,year:2020,bounds:"ua",maxzoom:18,owner:"НДІГК (Інститут геодезії та картографії)",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png",basemap:!0},{id:"graymap",name:"Сіра карта",url:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",attribution:"© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, © <a href='https://carto.com/attributions'>CARTO</a>",bounds1:"ua",image:"https://basemaps.cartocdn.com/light_all/10/601/348.png",position:0,owner:"OSM",basemap:!0},{id:"darkmap_carto",name:"Темна карта України",image:"https://basemaps.cartocdn.com/dark_all/13/4791/2762.png?ver=2023-04-14",url:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",active:!1}]},selectedLayer:{type:String,required:!0}},watch:{map(m){m&&m.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var m;this.baseLayers.forEach(b=>{this.layerList.push(b)}),this.toggleLayerVisibility((m=this.baseLayers[0])==null?void 0:m.id)},toggleLayerVisibility(m){this.$emit("update:selectedLayer",m),this.changeBaseLayer(m)}}},gm={class:"vs-map-slot-layers z-10 select-none"},_m=["onClick"],ym=["src"];function xm(m,b,I,A,R,G){return ee.openBlock(),ee.createElementBlock("div",gm,[(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(I.baseLayers,(T,c)=>(ee.openBlock(),ee.createElementBlock("div",{key:T.id,class:ee.normalizeClass(["vs-map-slot-layers__layer relative",{focused:T.id==I.selectedLayer}]),onClick:me=>G.toggleLayerVisibility(T.id)},[ee.createElementVNode("img",{src:T.image,class:"vs-map-slot-layers__image"},null,8,ym),ee.createElementVNode("div",{class:ee.normalizeClass(["absolute py-2 px-4 text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg top-[-46px] text-nowrap p-2 hidden whitespace-nowrap",[c===0?"left-[-10px]":"left-[50%] translate-x-[-50%]"]])},ee.toDisplayString(T==null?void 0:T.name),3)],10,_m))),128))])}const vm=Or(mm,[["render",xm],["__scopeId","data-v-8959e540"]]),bm={props:["colors","strokes","title"],methods:{capitalizeFirstLetter(m){return m?m.charAt(0).toUpperCase()+m.slice(1):""}}},wm={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border"},Sm={key:0,class:"mb-[10px] text-[1rem]"},Tm={key:1},Im={class:"legend-item flex items-center gap-2 mb-[10px]"},Pm={class:"ml-1 text-[0.875rem]"},km={class:"legend-item"},Em={key:0,class:"flex justify-start items-center gap-2"},Am={class:"ml-1 text-[0.875rem]"};function Cm(m,b,I,A,R,G){var T;return ee.openBlock(),ee.createElementBlock("div",wm,[I.title?(ee.openBlock(),ee.createElementBlock("div",Sm,ee.toDisplayString(I.title),1)):ee.createCommentVNode("",!0),(T=I.strokes)!=null&&T.length?(ee.openBlock(),ee.createElementBlock("div",Tm,[(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(I.strokes,c=>(ee.openBlock(),ee.createElementBlock("div",Im,[ee.createElementVNode("div",{class:"w-[15px] h-[4px]",style:ee.normalizeStyle({background:`repeating-linear-gradient(to right, ${c.color}, ${c.color} 5px, transparent 5px, transparent 8px)`})},null,4),ee.createElementVNode("div",Pm,ee.toDisplayString(G.capitalizeFirstLetter(c.text)),1)]))),256))])):ee.createCommentVNode("",!0),(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(I.colors,c=>(ee.openBlock(),ee.createElementBlock("div",km,[c.id>0?(ee.openBlock(),ee.createElementBlock("div",Em,[ee.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:ee.normalizeStyle({backgroundColor:c.color})},null,4),ee.createElementVNode("div",Am,ee.toDisplayString(G.capitalizeFirstLetter(c.text)),1)])):ee.createCommentVNode("",!0)]))),256))])}const Mm={components:{MapSlotLayers:vm,MapLegend:Or(bm,[["render",Cm]])},props:{isMapCompare:{type:Boolean,default:!0},polygonOpacity:{type:Number,default:()=>null},polygonStrokeWidth:{type:Number,default:()=>4},dashedLine:{type:Boolean,default:()=>!1},colorAttr:null,strokeAttr:null,zoom:{type:Array,default:()=>8},defaultColor:{type:String,default:"blue"},selectedBaseLayer:{type:String,required:!0},legendname:{type:String,default:()=>""},height:{type:String,default:()=>"100vh"},width:{type:String,default:"100vw"},center:{type:Array,default:[32,49]},maxBounds:{type:Array,default:[[22,44],[40,52]]},table:{type:String,default:""},zoom:{type:[String,Number],default:13},minZoom:{type:[String,Number],default:1},basemap:Array,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0}},mixins:[bc],inject:["prefix"],data(){return{map:null,hoverObject:null,popup:null,colors:[],strokes:null}},async mounted(){var m,b,I,A;try{if(await this.createMap(),(m=this.row)!=null&&m.geom){const{type:R,coordinates:G}=this.row.geom;let T;switch(R){case"Polygon":T=Ou(G);break;case"MultiPolygon":T=Nu(G);break;case"MultiPoint":T=Vu(G);break;default:(b=this.map)==null||b.fitBounds([G,G],{maxZoom:this.zoom,padding:30,duration:0}),this.isSelectObj=!0;return}const c=pm(T).geometry.coordinates;(I=this.map)==null||I.fitBounds([c,c],{maxZoom:this.zoom,padding:30,duration:0})}(A=this.map)==null||A.fitBounds(this.center,{duration:0})}catch{}},watch:{filtersParam(m){this.setFilter(this.table,m)},selectedBaseLayer(m){this.$emit("update:selectedBaseLayer",m)},row:{handler(m){m!=null&&m.geom&&this.fitToBounds(m.geom),this.map&&this.map.getStyle()&&this.map.getStyle().layers.filter(A=>A.source===this.table&&A.type==="line").forEach(A=>{var R;this.map.setPaintProperty(A.id,"line-width",((R=this.row)==null?void 0:R.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5)})},immediate:!0}},computed:{basemapIds(){return this.basemap.map(m=>m==null?void 0:m.id)}},methods:{async getColorStyle(){var m=[["#69D2E7","#A7DBD8","#E0E4CC","#F38630","#FA6900"],["#FE4365","#FC9D9A","#F9CDAD","#C8C8A9","#83AF9B"],["#ECD078","#D95B43","#C02942","#542437","#53777A"]];if(!this.colorAttr)return this.defaultColor;try{const{data:{rows:b}}=await Zt.get(`${this.prefix}/data/${this.table}/${this.colorAttr}`),I=b.reduce((A,R,G)=>R!=null&&R.id?[...A,R.id.toString(),R.color||m[0][G%5]]:A,["match",["get",this.colorAttr]]);return this.colors=[...b],I.push("gray"),I}catch(b){console.log(b)}},async getStrokeStyle(){if(!this.strokeAttr)return"transparent";try{const{data:{rows:m}}=await Zt.get(`${this.prefix}/data/${this.table}/${this.strokeAttr}`),b=m.reduce((I,A,R)=>A!=null&&A.id?[...I,{id:A.id.toString(),color:A.color||"#000000",dash:A.dash||[2,2],text:A.text||A.id.toString()}]:I,[]);return this.strokes=[...b],["match",["get",this.strokeAttr],...b.flatMap(({id:I,color:A})=>[I,A]),"transparent"]}catch(m){return console.log(m),"transparent"}},async handleMapLoad(){var A,R,G,T,c;(A=this.row)!=null&&A.geom&&this.fitToBounds(this.row.geom),this.$emit("map",this.map);const m=await this.getStrokeStyle(),b=await this.getColorStyle(),I=((G=(R=location.search.split("&").find(me=>me.includes("filter=")))==null?void 0:R.split("filter="))==null?void 0:G[1])||"";await this.addLayer({id:this.table,service:"vector",url:`${this.prefix}/vtile/${this.table}/ua/{z}/{x}/{y}.vmt?pointZoom=${this.pointZoom}&dt=${new Date().toISOString()}`,layers:[{type:"fill","source-layer":this.table,paint:{"fill-color":b,"fill-opacity":this.polygonOpacity??.5,"fill-outline-color":["case",["==",["feature-state","hover"],!0],"red","#000000"]},filter:["all",["==",["geometry-type"],"Polygon"]]},{type:"circle","source-layer":this.table,filter:["all",["==",["geometry-type"],"Point"]],paint:{"circle-radius":{base:1.75,stops:[[10,5],[12,6],[18,12]]},"circle-stroke-color":["case",["==",["feature-state","hover"],!0],"red","#ccc"],"circle-stroke-width":["case",["==",["feature-state","hover"],!0],2,1],"circle-color":b}},{type:"line",paint:{"line-color":b,"line-width":((T=this.row)==null?void 0:T.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5}},...this.dashedLine?[{type:"line",paint:{"line-color":m,"line-width":((c=this.row)==null?void 0:c.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5,"line-dasharray":[2,2]}}]:[]]}),I&&this.setFilter(this.table,I)},async createMap(){const m={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new Fo.Map({container:"maplibre-map",style:m,zoom:this.zoom,center:this.center,minZoom:this.minZoom}),this.$parent.map=this.map,this.map.addControl(new Fo.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)},fitToBounds(m){if(!this.map)return;const{type:b,coordinates:I}=m;let A,R;switch(b){case"Polygon":A=Ou(I),R=$o(A),this.map.fitBounds(R,{padding:30,maxZoom:15,duration:0});break;case"MultiPolygon":A=Nu(I),R=$o(A),this.map.fitBounds(R,{padding:30,maxZoom:15,duration:0});break;case"MultiPoint":A=Vu(I),R=$o(A),this.map.fitBounds(R,{padding:30,maxZoom:15,duration:0});break;case"Point":this.map.flyTo({center:I,zoom:15,duration:0,essential:!0});break;default:console.warn("Невідомий тип геометрії:",b)}}}},zm={class:"vs-map-portal relative z-1 mt-2",id:"mapwrapper"};function Dm(m,b,I,A,R,G){const T=ee.resolveComponent("MapLegend"),c=ee.resolveComponent("MapSlotLayers");return ee.openBlock(),ee.createElementBlock("div",zm,[ee.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full compare_main_map",style:ee.normalizeStyle({height:I.height})},null,4),ee.withDirectives(ee.createVNode(T,{colors:R.colors,strokes:R.strokes,title:I.legendname},null,8,["colors","strokes","title"]),[[ee.vShow,I.legend]]),ee.createVNode(c,{map:R.map,baseLayers:I.basemap,selectedLayer:I.selectedBaseLayer,"onUpdate:selectedLayer":b[0]||(b[0]=me=>m.$emit("update:selectedBaseLayer",me))},null,8,["map","baseLayers","selectedLayer"])])}const Lm=Or(Mm,[["render",Dm]]),Rm={},Bm={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Fm=[ee.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)];function Om(m,b){return ee.openBlock(),ee.createElementBlock("svg",Bm,Fm)}const Vm=Or(Rm,[["render",Om]]),Nm={},Um={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-collapse"},$m=[ee.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),ee.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),ee.createElementVNode("path",{d:"M15 4v16"},null,-1),ee.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1)];function jm(m,b){return ee.openBlock(),ee.createElementBlock("svg",Um,$m)}const qm=Or(Nm,[["render",jm]]),Zm={},Gm={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-expand"},Hm=[ee.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),ee.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),ee.createElementVNode("path",{d:"M15 4v16"},null,-1),ee.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1)];function Wm(m,b){return ee.openBlock(),ee.createElementBlock("svg",Gm,Hm)}const Xm=Or(Zm,[["render",Wm]]),Jm={},Km={class:"shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ym=[ee.createElementVNode("path",{d:"M18 6 6 18"},null,-1),ee.createElementVNode("path",{d:"m6 6 12 12"},null,-1)];function Qm(m,b){return ee.openBlock(),ee.createElementBlock("svg",Km,Ym)}const eg=Or(Jm,[["render",Qm]]),tg={props:{visible:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""}},emits:["update:visible","onClose"],name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){var m;return!!((m=this.$slots)!=null&&m.footer)},checkSize(){return this.size==="small"?"w-5/12":this.size==="medium"?"w-6/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:m}){m==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")}}},$u=m=>(ee.pushScopeId("data-v-37405773"),m=m(),ee.popScopeId(),m),ig={class:"vsTailwind ui-dialog__wrapper"},rg={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},ng={class:"py-2.5 px-4 flex justify-between items-center border-b"},sg={class:"font-medium text-gray-800"},og=[$u(()=>ee.createElementVNode("span",{class:"sr-only"},"Close",-1)),$u(()=>ee.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[ee.createElementVNode("path",{d:"M18 6 6 18"}),ee.createElementVNode("path",{d:"m6 6 12 12"})],-1))],ag={class:"ui-dialog__content p-4"},lg={key:0,class:"flex justify-end gap-x-2"};function cg(m,b,I,A,R,G){return ee.openBlock(),ee.createBlock(ee.Teleport,{to:"#modal"},[ee.createVNode(ee.Transition,{name:"fade"},{default:ee.withCtx(()=>[ee.withDirectives(ee.createElementVNode("div",ig,[ee.createElementVNode("div",rg,[ee.createVNode(ee.Transition,{name:"content",appear:""},{default:ee.withCtx(()=>[ee.createElementVNode("div",{class:ee.normalizeClass(["ui-dialog__modal opacity-1 transition-all flex flex-col bg-white border pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[G.checkSize]])},[ee.createElementVNode("div",ng,[ee.createElementVNode("h3",sg,ee.toDisplayString(I.title),1),ee.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:b[0]||(b[0]=(...T)=>G.handleClose&&G.handleClose(...T))},og)]),ee.createElementVNode("div",ag,[ee.renderSlot(m.$slots,"default",{},void 0,!0)]),G.hasSlot?(ee.openBlock(),ee.createElementBlock("div",lg,[ee.renderSlot(m.$slots,"footer",{},void 0,!0)])):ee.createCommentVNode("",!0)],2)]),_:3})])],512),[[ee.vShow,I.visible]])]),_:3})])}const hg=Or(tg,[["render",cg],["__scopeId","data-v-37405773"]]),ug=ee.defineComponent({props:{prefix:{type:String,default:"/api"},applyVueRouter:{type:Boolean,default:!0},dashedLine:{type:Boolean,default:!1},title:{type:String,default:()=>""},table:{type:String,default:()=>""},rows:{type:Object,default:()=>null},isMapCompare:{type:Boolean,default:!0},initTotal:{type:[Number,String],default:()=>""},colorAttr:{type:String,default:()=>""},strokeAttr:{type:String,default:()=>""},legendname:{type:String,default:()=>""},center:{type:Array},maxBounds:{type:Array,default:()=>[[22,44.4],[40,52.5]]},id:{type:String,default:()=>""},isAutocomplete:{type:Boolean,default:()=>!1},isAddressAutocomplete:{type:Boolean,default:()=>!1},zoom:{type:[Number,String],default:()=>"13"},minZoom:{type:[Number,String],default:()=>"1"},maskForSearch:{type:String,default:()=>null},searchShow:{type:Boolean,default:()=>!0},basemap:{type:Array},pointZoom:{type:String,default:()=>"12"},legend:{type:Boolean,default:()=>!0},defaultColor:{type:String,default:()=>"blue"},polygonOpacity:{type:Number,default:()=>null},history:{type:Boolean,default:!0}},mixins:[bc],components:{MapPortal:Lm,NoData:jp,FilterIcon:Vm,VisibleMapIcon:qm,HiddenMapIcon:Xm,CloseIcon:eg,VsDialog:hg},data(){return{filters:"",search:"",limit:20,polyline:null,filtersParam:"",isSelectObj:!1,selectedId:"",searchRegion:"",searchAddress:"",map:null,selectedBaseLayer:"",marker:null,selectedRow:null,activeFilters:"",isMapVisible:!0,tabsIsVisible:!1,filterUrl:"",currentPage:1,regionOptionGeneral:null,isFilterVisible:!1,tableData:null,hoverData:null,atuData:[],map:null,legendName:null,total:null,filtered:null,filterValues:"",activeFiltersCount:"",visibleTrue:!0,regionSelectValue:null,addressSelectValue:null,currentBbox:null,mountedFilter:{},isCompareOpen:!1,optionRowsCount:[{value:10,label:"10"},{value:20,label:"20"},{value:30,label:"30"}],handleDebouncedUpdateValue:dm(m=>{this.handleSearchValue(m)},300)}},provide(){return{prefix:this.prefix}},watch:{map(){this.map.on("mousemove",this.handleMapHover),this.map.on("click",this.handleMapClick),this.$emit("update:map",this.map)},activeFiltersCount(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.filteredActiveFiltersLength},activeFilters(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters},isFilterVisible(m){m||this.getData()},async regionSelectValue(m,b){var R,G;if(!this.regionSelectValue){this.map.removeSource("region-search-id");return}m&&this.selectedId&&this.closeObjCard(),this.polyline=this.regionSelectValue.encoded_geom,this.getData();const I=((R=this.regionSelectValue)==null?void 0:R.geom)||Sr.toGeoJSON(this.regionSelectValue.encoded_geom),A=this.map.getSource("region-search-id");if(this.currentBbox=$o(I),A)A.setData({type:"Feature",geometry:I});else{this.map.addSource("region-search-id",{type:"geojson",data:{type:"Feature",geometry:I}});const T={id:"region-search-id",type:"line",source:"region-search-id",paint:{"line-color":"blue","line-opacity":1}};await this.map.addLayer(T)}this.moveLayer("site.prc.parcel_object.table"),(G=this.map)==null||G.fitBounds(this.currentBbox,{zoom:this.setAtuZoom,padding:20,duration:0}),this.getData()},async addressSelectValue(m,b){this.addressSelectValue&&(m&&this.selectedId&&this.closeObjCard(),this.getData())}},created(){this.tableData=this.rows,this.total=this.initTotal,this.id&&(this.selectedRow=this.rows[0],this.selectedId=this.id,this.isSelectObj=!0)},mounted(){this.rows||this.getData();const m=new URLSearchParams(window.location.search),b=m.get("filter");m.get("id");const I=b==null?void 0:b.split("|");I==null||I.forEach(R=>{const[G,T]=R.split("=");T!=null&&T.includes(",")?this.mountedFilter[G]=T==null?void 0:T.split(","):this.mountedFilter[G]=T,this.activeFilters=this.mountedFilter});const A=new URLSearchParams(window.location.search);this.currentPage=A.get("page")||1,this.getFilter()},updated(){this.checkFilterLength()},computed:{setAtuZoom(){var m,b,I;return((m=this.regionSelectValue)==null?void 0:m.id)==="UA80000000000093317"||((b=this.regionSelectValue)==null?void 0:b.id)==="UA85000000000065278"?10:((I=this.regionSelectValue)==null?void 0:I.region)===""?7.5:11}},methods:{async getData(){try{const m={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};m.filter=this.filtersParam;const{data:b}=await Zt.get(`${this.prefix}/data/${this.table}`,{params:m});this.tableData=b==null?void 0:b.rows,this.total=b.filtered,this.filtered=b.filtered}catch(m){console.error(m.message)}},moveToDefaultPage(){var I;const m=new URLSearchParams(window.location.search);m.delete("id"),`${window.location.pathname}${m.toString()}`,(I=this.map)==null||I.fitBounds(this.maxBounds,{duration:0}),this.history&&window.history.pushState({},"",newUrl),this.isSelectObj=!1},regionFullName(m){return m.region?`${m.text} / ${m.region}`:m.text},getLabelById(m){const b=this.filters.find(I=>I.id===m);return b?b.label:m},getOptionsLabelById(m,b){if(Array.isArray(b)){const I=this.filters.find(A=>A.id===m);return I!=null&&I.options?I==null?void 0:I.options.filter(A=>b.includes(A.id)).map(A=>A.text).join(", "):b==null?void 0:b.length}else return b},async clearFilter(m){var b,I,A;await((I=(b=this.$refs)==null?void 0:b.filter)==null?void 0:I.clearFilter(m)),this.filterUrl=(A=this.$refs)==null?void 0:A.filter.filterUrl,(m==="region_katottg"||m==="katottg")&&this.$emit("update:filterState",{}),await this.updateTableAndMap(),await this.getData()},handlePageChange(m){this.currentPage=m;const b=new URL(window.location.href),I=new URLSearchParams(window.location.search);I.set("page",m),b.search=decodeURI(I.toString()),window.history.pushState({},"",b),this.getData()},async getFilter(){var m;try{const{data:b}=await Zt.get(`${this.prefix}/filter/${this.table}`);this.filters=(m=b==null?void 0:b.list)==null?void 0:m.map(I=>({...I,label:(I==null?void 0:I.label)||(I==null?void 0:I.ua),id:(I==null?void 0:I.id)||(I==null?void 0:I.name)}))}catch(b){console.error(b.message)}},async handleSearchValue(m){this.search=m,await this.getData()},closeObjCard(){var A;const m=new URLSearchParams(window.location.search);m.delete("id"),this.deletePulsePoint(),this.deleteHighlighPolygon();const I=`${window.location.pathname}?${m.toString()}`;(this.currentBbox||this.center)&&((A=this.map)==null||A.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom,duration:0})),window.history.pushState({},"",I),this.isSelectObj=!1,this.selectedRow=null,this.getData()},async handleSearchRegionValue(m){var I;const b=this.map.getLayer("region-search-id");this.searchRegion=m,m===""&&b?((I=this.map)==null||I.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("region-search-id"),this.getData()):m===""&&this.getData()},async handleSearchAddressValue(m){var I;const b=this.map.getLayer("address-search-id");this.searchAddress=m,m===""&&b?((I=this.map)==null||I.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("address-search-id"),this.getData()):m===""&&this.getData()},handleFilterChange(m){this.$emit("update:filterState",m),this.currentPage=m.state.page||1,this.filterUrl=m.url==="no-url"?null:m.url.split("|").filter(b=>!b.includes("page=")).join("|")},async updateTableAndMap(){var m,b;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters,this.isFilterVisible=!1,this.getData())},handleFilterSubmit(){var m;this.isSelectObj="",this.selectedId="",this.selectedId=!1,(m=this.map)==null||m.fitBounds(this.maxBounds,{duration:0}),this.isFilterVisible=!1},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(m=!0){const b=new URLSearchParams(window.location.search);b.has("id")?(this.isSelectObj=!0,this.isMapVisible=m,this.selectedId=b.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(m){this.limit=m,this.currentPage=1,this.getData()},filterModalClose(){this.isFilterVisible=!1},resetFilters(){this.$refs.filter&&(this.$refs.filter.clearAll(),this.search="",this.isFilterVisible=!1,this.filtersParam="",this.polyline=null,this.regionSelectValue=null,this.addressSelectValue=null,this.currentBbox=null,this.activeFilters=null,this.tabsIsVisible=!1,this.handleSearchRegionValue(""),this.handleSearchAddressValue(""))},checkFilterLength(){var b,I;const m=(I=(b=this.$refs)==null?void 0:b.filter)==null?void 0:I.filteredActiveFiltersLength;m!==this.previousLength&&(this.previousLength=m,this.activeFiltersCount=m)},async handleMapClick(m){var G,T,c,me,ye,ve,le,ae,ht,Ue;const b=this.map.queryRenderedFeatures(m.point);if((b==null?void 0:b.length)<1||((G=b[0])==null?void 0:G.source)==="region-search-id"||((T=b[0])==null?void 0:T.source)==="route-line")return;const I=window.location.pathname,A=new URLSearchParams(window.location.search);A.set("id",`${(c=b[0])==null?void 0:c.properties.id}`),this.getObjectData((ye=(me=b[0])==null?void 0:me.properties)==null?void 0:ye.id);const R=`${I}?${A.toString()}`;this.history&&window.history.pushState({},"",R),this.isSelectObj=!0,m.lngLat&&((Ue=this.map)==null||Ue.fitBounds([[(ve=m.lngLat)==null?void 0:ve.lng,(le=m.lngLat)==null?void 0:le.lat],[(ae=m.lngLat)==null?void 0:ae.lng,(ht=m.lngLat)==null?void 0:ht.lat]],{padding:30,duration:0})),this.checkUrl()},async getObjectData(m){var b,I;try{const{data:A}=await Zt.get(`${this.prefix}/data/${this.table}/${m}`);this.selectRow((b=A==null?void 0:A.rows)==null?void 0:b[0]),((I=A==null?void 0:A.rows)==null?void 0:I.lenght)<1&&this.deletePulsePoint()}catch(A){console.error(A.message)}},async selectRow(m,b=!0){var c;this.isMapVisible=b;const A=await(await fetch(`${this.prefix}/data/${this.table}/${m.id}`)).json();this.selectedRow=((c=A==null?void 0:A.rows)==null?void 0:c[0])||m;const R=window.location.pathname,G=new URLSearchParams(window.location.search);G.set("id",`${m.id}`);const T=`${R}?${G.toString()}`;this.history&&window.history.pushState({},"",T),this.checkUrl(b),this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(m){this.deletePulsePoint();const b=document.createElement("div");b.className="gps-marker",b.style.width="10px",b.style.height="10px",b.style.position="relative";const I=document.createElement("div");I.className="gps-wave",b.appendChild(I),this.marker=new Fo.Marker({element:b,anchor:"center"}).setLngLat(m).addTo(this.map)},deleteHighlighPolygon(){var m,b,I;(m=this.map)!=null&&m.getLayer("highlighted-polygon")&&((b=this.map)==null||b.removeLayer("highlighted-polygon"),(I=this.map)==null||I.removeSource("highlighted-polygon"))},highlightPolygon(m){var b,I,A,R,G,T;this.deletePulsePoint(),this.deleteHighlighPolygon(),(R=this.map)==null||R.addSource("highlighted-polygon",{type:"geojson",data:{geometry:{type:(b=m==null?void 0:m.geom)==null?void 0:b.type,coordinates:(I=m==null?void 0:m.geom)==null?void 0:I.coordinates},type:"Feature",properties:{id:m==null?void 0:m.id,name:m==null?void 0:m.name,category:m==null?void 0:m.id},id:m==null?void 0:m.id,layer:{id:"site.rest_zone.table-0",type:"fill",source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",filter:["all",["==",["geometry-type"],(A=m==null?void 0:m.geom)==null?void 0:A.type]],paint:{"fill-color":"orange","fill-opacity":.5},layout:{}},source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",state:{hover:!0},table:"site.rest_zone.table"}}),(G=this.map)==null||G.addLayer({id:"highlighted-polygon",type:"fill",source:"highlighted-polygon",layout:{},minzoom:12,maxzoom:0,paint:{"fill-color":"orange","fill-opacity":.6}}),(T=this.map)==null||T.moveLayer("highlighted-polygon")},async handleMapHover(m){var T,c,me;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new Fo.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const b=this.map.queryRenderedFeatures(m.point);if(this.map.getCanvas().style.cursor="pointer",!(b!=null&&b.length)||((T=b==null?void 0:b[0])==null?void 0:T.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const I=["route-line"];if(!b.filter(ye=>!I.some(ve=>{var le;return(le=ye.layer)==null?void 0:le.source.includes(ve)})).length)return;const R=b[0].geometry.coordinates.slice();b[0].source==="highlighted-polygon"&&b[1]?this.hoverData=(c=b[1])==null?void 0:c.properties:this.hoverData=(me=b[0])==null?void 0:me.properties;const G={source:b[0].source,sourceLayer:b[0].sourceLayer,id:b[0].id};if(G.source!=="region-search-id"){for(this.map.setFeatureState(G,{hover:!0}),this.hoverObject=G;Math.abs(m.lngLat.lng-R[0])>180;)R[0]+=m.lngLat.lng>R[0]?360:-360;this.popup.setLngLat(m.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}},removeSelectedBaseLayer(){this.selectedBaseLayer=""},addGeomMarker(m){if(!this.map||!m)return;this.marker&&this.marker.remove();let b;(m==null?void 0:m.type)==="Point"?b=m.coordinates:b=fm(m).geometry.coordinates,this.marker=new Fo.Marker({color:"green"}).setLngLat(b).addTo(this.map)}}}),dg={class:"ml-3 pt-[20px]"},pg={class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},fg={class:"flex items-center gap-2 max-h-[38px] pt-[4px]"},mg={class:"custom-filter-list"},gg={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},_g=["title"],yg=ee.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),xg={class:"flex"},vg={class:"py-[15px] pb-[24px] pl-2"},bg={class:"font-bold text-2xl mr-[10px]"},wg={class:"text-sm text-stone-500 font-medium"},Sg=ee.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),Tg={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},Ig={key:0,class:"flex gap-x-2 flex-wrap"},Pg={class:"font-medium"},kg=ee.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),Eg={class:"text-gray-500"},Ag=["onClick"],Cg={key:0,class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full"},Mg=ee.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),zg={key:2,class:"text-center py-28"},Dg=ee.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),Lg=ee.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),Rg={key:0},Bg={key:1,class:"my-5 pr-2"},Fg={class:"flex justify-between"},Og={class:"w-2/4"},Vg={class:"map-section relative"},Ng={ref:"popup",style:{display:"none"}};function Ug(m,b,I,A,R,G){var Oe,ft;const T=ee.resolveComponent("VsTextMask"),c=ee.resolveComponent("vs-text"),me=ee.resolveComponent("FilterIcon"),ye=ee.resolveComponent("VsFilterList"),ve=ee.resolveComponent("VisibleMapIcon"),le=ee.resolveComponent("HiddenMapIcon"),ae=ee.resolveComponent("CloseIcon"),ht=ee.resolveComponent("NoData"),Ue=ee.resolveComponent("VsPagination"),Ke=ee.resolveComponent("MapPortal");return ee.openBlock(),ee.createElementBlock("section",dg,[ee.createElementVNode("div",null,[ee.createElementVNode("div",pg,[ee.createElementVNode("div",fg,[m.maskForSearch?(ee.openBlock(),ee.createBlock(T,{key:0,"model-value":m.search,"onUpdate:modelValue":m.handleDebouncedUpdateValue,class:"w-full table-interface-search",placeholder:"Пошук",mask:m.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue","mask"])):m.searchShow?(ee.openBlock(),ee.createBlock(c,{key:1,"model-value":m.search,"onUpdate:modelValue":m.handleDebouncedUpdateValue,class:"[&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:w-[220px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",placeholder:"Пошук",icon:"search","icon-position":"left",clearable:"",style:{height:"38px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue"])):ee.createCommentVNode("",!0),ee.createElementVNode("div",mg,[m.filters?(ee.openBlock(),ee.createBlock(ye,{key:0,ref:"filter",modelValue:m.mountedFilter,"onUpdate:modelValue":b[0]||(b[0]=st=>m.mountedFilter=st),scheme:m.filters,isDialog:(Oe=m.filters)==null?void 0:Oe.some(st=>!(st!=null&&st.inline)),"apply-vue-router":m.applyVueRouter,history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:b[1]||(b[1]=async st=>{await m.handleFilterChange(st),await m.updateTableAndMap()})},{button:ee.withCtx(({visible:st})=>[ee.createElementVNode("button",{type:"button",class:ee.normalizeClass(["py-2 px-2.5 h-[40px] inline-flex items-center gap-x-1.5 text-sm font-medium rounded-lg bg-white text-gray-800 hover:bg-gray-50 focus:outline-none focus:bg-gray-50",[st?"border border-blue-600 border-2":"border border-gray-200"]])},[ee.createVNode(me),ee.createTextVNode(" Фільтри "),m.activeFiltersCount>=1?(ee.openBlock(),ee.createElementBlock("span",gg,ee.toDisplayString(m.activeFiltersCount),1)):ee.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme","isDialog","apply-vue-router"])):ee.createCommentVNode("",!0)])]),ee.createElementVNode("button",{type:"button",class:"py-2 px-2 inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100",title:m.isMapVisible?"Приховати карту":"Показати карту",onClick:b[2]||(b[2]=(...st)=>m.toggleMapVisible&&m.toggleMapVisible(...st))},[m.isMapVisible?(ee.openBlock(),ee.createBlock(ve,{key:0})):(ee.openBlock(),ee.createBlock(le,{key:1})),yg],8,_g)]),ee.createElementVNode("div",xg,[ee.createElementVNode("div",{class:ee.normalizeClass(["relative overflow-hidden",m.isMapVisible?"w-2/4 mr-0":"w-full mr-3",m.isSelectObj?"hidden":""])},[ee.createElementVNode("h1",vg,[ee.createElementVNode("span",bg,ee.toDisplayString(m.title),1),ee.createElementVNode("span",wg,ee.toDisplayString(m.total),1),Sg]),ee.createElementVNode("div",Tg,[m.activeFilters?(ee.openBlock(),ee.createElementBlock("div",Ig,[(ee.openBlock(!0),ee.createElementBlock(ee.Fragment,null,ee.renderList(m.activeFilters,(st,He,Ft)=>(ee.openBlock(),ee.createElementBlock("span",{class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full",key:Ft},[ee.createElementVNode("span",Pg,ee.toDisplayString(m.getLabelById(He)),1),kg,ee.createElementVNode("span",Eg,ee.toDisplayString(m.getOptionsLabelById(He,st)),1),ee.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:wt=>m.clearFilter(He)},[ee.createVNode(ae)],8,Ag)]))),128)),((ft=Object.keys(m.activeFilters))==null?void 0:ft.length)>=2?(ee.openBlock(),ee.createElementBlock("span",Cg,[Mg,ee.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:b[3]||(b[3]=st=>m.mountedFilter={})},[ee.createVNode(ae)])])):ee.createCommentVNode("",!0)])):ee.createCommentVNode("",!0),m.total>=1?ee.renderSlot(m.$slots,"table",{key:1,rows:m.tableData,map:m.map,marker:m.marker,selectRow:m.selectRow,getData:m.getData,addGeomMarker:m.addGeomMarker,isMapVisible:m.isMapVisible}):(ee.openBlock(),ee.createElementBlock("div",zg,[ee.createVNode(ht),Dg,Lg,ee.createElementVNode("button",{type:"button",class:"mt-[10px] py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",onClick:b[4]||(b[4]=(...st)=>m.resetFilters&&m.resetFilters(...st))}," Очистити дані пошуку ")]))]),m.total>=1?(ee.openBlock(),ee.createElementBlock("hr",Rg)):ee.createCommentVNode("",!0),m.total>=1?(ee.openBlock(),ee.createElementBlock("div",Bg,[ee.createElementVNode("div",Fg,[ee.createVNode(Ue,{total:m.total,maxPages:7,defaultPage:m.currentPage,pageSize:m.limit,goTo:!1,size:"medium",onPageChange:m.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:m.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):ee.createCommentVNode("",!0)],2),m.isSelectObj?(ee.openBlock(),ee.createElementBlock("div",{key:0,class:ee.normalizeClass(m.isMapVisible?"w-2/4 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[ee.renderSlot(m.$slots,"details",{table:m.table,selectedId:m.selectedId,selectedRow:m.selectedRow,map:m.map,closeObjCard:m.closeObjCard,isMapVisible:m.isMapVisible})],2)):ee.createCommentVNode("",!0),ee.withDirectives(ee.createElementVNode("div",Og,[ee.createElementVNode("section",Vg,[ee.renderSlot(m.$slots,"default",{map:m.map,removeSelectedBaseLayer:m.removeSelectedBaseLayer,selectedBaseLayer:m.selectedBaseLayer,selectedRow:m.selectedRow}),ee.createVNode(Ke,{height:"calc(100vh - 152px)",width:"w-2/4",table:m.table,filtersParam:m.filtersParam,row:m.selectedRow,legendname:m.legendname,legend:m.legend,colorAttr:m.colorAttr,strokeAttr:m.strokeAttr,polygonOpacity:m.polygonOpacity,maxBounds:m.maxBounds,center:m.center,zoom:m.zoom,dashedLine:m.dashedLine,minZoom:m.minZoom,basemap:m.basemap,pointZoom:m.pointZoom,defaultColor:m.defaultColor,onMap:b[5]||(b[5]=st=>m.map=st),selectedBaseLayer:m.selectedBaseLayer,"onUpdate:selectedBaseLayer":b[6]||(b[6]=st=>m.selectedBaseLayer=st),onIsCompareOpen:b[7]||(b[7]=st=>m.isCompareOpen=st)},null,8,["table","filtersParam","row","legendname","legend","colorAttr","strokeAttr","polygonOpacity","maxBounds","center","zoom","dashedLine","minZoom","basemap","pointZoom","defaultColor","selectedBaseLayer"])])],512),[[ee.vShow,m.isMapVisible]])]),ee.createElementVNode("div",Ng,[ee.renderSlot(m.$slots,"popup",{data:m.hoverData})],512)])])}const ju=Or(ug,[["render",Ug]]),qu={install:m=>{m.component("VsPartsMap",ju)},components:{VsPartsMap:ju}};return typeof window<"u"&&(window.PartsMap=qu),qu});
|