@opengis/partsmap 0.0.58 → 0.0.59
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 +1 -2
- package/dist/PartsMap.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/PartsMap.js
CHANGED
@@ -20130,7 +20130,6 @@ const N_ = /* @__PURE__ */ hn(D_, [["render", V_]]), U_ = {
|
|
20130
20130
|
try {
|
20131
20131
|
if (await this.createMap(), (g = this.row) != null && g.geom) {
|
20132
20132
|
const { type: N, coordinates: X } = this.row.geom;
|
20133
|
-
console.log(this.row);
|
20134
20133
|
let T;
|
20135
20134
|
switch (N) {
|
20136
20135
|
case "Polygon":
|
@@ -20255,7 +20254,7 @@ const N_ = /* @__PURE__ */ hn(D_, [["render", V_]]), U_ = {
|
|
20255
20254
|
this.map = await new bc.Map({
|
20256
20255
|
container: "maplibre-map",
|
20257
20256
|
style: g,
|
20258
|
-
zoom:
|
20257
|
+
zoom: this.zoom,
|
20259
20258
|
center: this.center
|
20260
20259
|
// maxBounds: this.maxBounds,
|
20261
20260
|
// extend: this.maxBounds,
|
package/dist/PartsMap.umd.cjs
CHANGED
@@ -582,4 +582,4 @@ uniform ${P} ${A} u_${L};
|
|
582
582
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(w){return w instanceof this?w:new this(w)}static concat(w,...k){const E=new this(w);return k.forEach(N=>E.set(N)),E}static accessor(w){const E=(this[fu]=this[fu]={accessors:{}}).accessors,N=this.prototype;function W(T){const c=Vo(T);E[c]||(Uf(N,T),E[c]=!0)}return fe.isArray(w)?w.forEach(W):W(w),this}}Gi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),fe.reduceDescriptors(Gi.prototype,({value:g},w)=>{let k=w[0].toUpperCase()+w.slice(1);return{get:()=>g,set(E){this[k]=E}}}),fe.freezeMethods(Gi);function Pc(g,w){const k=this||Oo,E=w||k,N=Gi.from(E.headers);let W=E.data;return fe.forEach(g,function(c){W=c.call(k,W,N.normalize(),w?w.status:void 0)}),N.normalize(),W}function mu(g){return!!(g&&g.__CANCEL__)}function Vs(g,w,k){lt.call(this,g??"canceled",lt.ERR_CANCELED,w,k),this.name="CanceledError"}fe.inherits(Vs,lt,{__CANCEL__:!0});function gu(g,w,k){const E=k.config.validateStatus;!k.status||!E||E(k.status)?g(k):w(new lt("Request failed with status code "+k.status,[lt.ERR_BAD_REQUEST,lt.ERR_BAD_RESPONSE][Math.floor(k.status/100)-4],k.config,k.request,k))}function jf(g){const w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(g);return w&&w[1]||""}function $f(g,w){g=g||10;const k=new Array(g),E=new Array(g);let N=0,W=0,T;return w=w!==void 0?w:1e3,function(ye){const xe=Date.now(),be=E[W];T||(T=xe),k[N]=ye,E[N]=xe;let le=W,ae=0;for(;le!==N;)ae+=k[le++],le=le%g;if(N=(N+1)%g,N===W&&(W=(W+1)%g),xe-T<w)return;const ut=be&&xe-be;return ut?Math.round(ae*1e3/ut):void 0}}function qf(g,w){let k=0,E=1e3/w,N,W;const T=(xe,be=Date.now())=>{k=be,N=null,W&&(clearTimeout(W),W=null),g.apply(null,xe)};return[(...xe)=>{const be=Date.now(),le=be-k;le>=E?T(xe,be):(N=xe,W||(W=setTimeout(()=>{W=null,T(N)},E-le)))},()=>N&&T(N)]}const cl=(g,w,k=3)=>{let E=0;const N=$f(50,250);return qf(W=>{const T=W.loaded,c=W.lengthComputable?W.total:void 0,ye=T-E,xe=N(ye),be=T<=c;E=T;const le={loaded:T,total:c,progress:c?T/c:void 0,bytes:ye,rate:xe||void 0,estimated:xe&&c&&be?(c-T)/xe:void 0,event:W,lengthComputable:c!=null,[w?"download":"upload"]:!0};g(le)},k)},_u=(g,w)=>{const k=g!=null;return[E=>w[0]({lengthComputable:k,total:g,loaded:E}),w[1]]},yu=g=>(...w)=>fe.asap(()=>g(...w)),Zf=Ir.hasStandardBrowserEnv?function(){const w=/(msie|trident)/i.test(navigator.userAgent),k=document.createElement("a");let E;function N(W){let T=W;return w&&(k.setAttribute("href",T),T=k.href),k.setAttribute("href",T),{href:k.href,protocol:k.protocol?k.protocol.replace(/:$/,""):"",host:k.host,search:k.search?k.search.replace(/^\?/,""):"",hash:k.hash?k.hash.replace(/^#/,""):"",hostname:k.hostname,port:k.port,pathname:k.pathname.charAt(0)==="/"?k.pathname:"/"+k.pathname}}return E=N(window.location.href),function(T){const c=fe.isString(T)?N(T):T;return c.protocol===E.protocol&&c.host===E.host}}():function(){return function(){return!0}}(),Gf=Ir.hasStandardBrowserEnv?{write(g,w,k,E,N,W){const T=[g+"="+encodeURIComponent(w)];fe.isNumber(k)&&T.push("expires="+new Date(k).toGMTString()),fe.isString(E)&&T.push("path="+E),fe.isString(N)&&T.push("domain="+N),W===!0&&T.push("secure"),document.cookie=T.join("; ")},read(g){const w=document.cookie.match(new RegExp("(^|;\\s*)("+g+")=([^;]*)"));return w?decodeURIComponent(w[3]):null},remove(g){this.write(g,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Hf(g){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(g)}function Xf(g,w){return w?g.replace(/\/?\/$/,"")+"/"+w.replace(/^\/+/,""):g}function xu(g,w){return g&&!Hf(w)?Xf(g,w):w}const vu=g=>g instanceof Gi?{...g}:g;function ts(g,w){w=w||{};const k={};function E(xe,be,le){return fe.isPlainObject(xe)&&fe.isPlainObject(be)?fe.merge.call({caseless:le},xe,be):fe.isPlainObject(be)?fe.merge({},be):fe.isArray(be)?be.slice():be}function N(xe,be,le){if(fe.isUndefined(be)){if(!fe.isUndefined(xe))return E(void 0,xe,le)}else return E(xe,be,le)}function W(xe,be){if(!fe.isUndefined(be))return E(void 0,be)}function T(xe,be){if(fe.isUndefined(be)){if(!fe.isUndefined(xe))return E(void 0,xe)}else return E(void 0,be)}function c(xe,be,le){if(le in w)return E(xe,be);if(le in g)return E(void 0,xe)}const ye={url:W,method:W,data:W,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:(xe,be)=>N(vu(xe),vu(be),!0)};return fe.forEach(Object.keys(Object.assign({},g,w)),function(be){const le=ye[be]||N,ae=le(g[be],w[be],be);fe.isUndefined(ae)&&le!==c||(k[be]=ae)}),k}const bu=g=>{const w=ts({},g);let{data:k,withXSRFToken:E,xsrfHeaderName:N,xsrfCookieName:W,headers:T,auth:c}=w;w.headers=T=Gi.from(T),w.url=hu(xu(w.baseURL,w.url),g.params,g.paramsSerializer),c&&T.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let ye;if(fe.isFormData(k)){if(Ir.hasStandardBrowserEnv||Ir.hasStandardBrowserWebWorkerEnv)T.setContentType(void 0);else if((ye=T.getContentType())!==!1){const[xe,...be]=ye?ye.split(";").map(le=>le.trim()).filter(Boolean):[];T.setContentType([xe||"multipart/form-data",...be].join("; "))}}if(Ir.hasStandardBrowserEnv&&(E&&fe.isFunction(E)&&(E=E(w)),E||E!==!1&&Zf(w.url))){const xe=N&&W&&Gf.read(W);xe&&T.set(N,xe)}return w},Wf=typeof XMLHttpRequest<"u"&&function(g){return new Promise(function(k,E){const N=bu(g);let W=N.data;const T=Gi.from(N.headers).normalize();let{responseType:c,onUploadProgress:ye,onDownloadProgress:xe}=N,be,le,ae,ut,Ze;function tt(){ut&&ut(),Ze&&Ze(),N.cancelToken&&N.cancelToken.unsubscribe(be),N.signal&&N.signal.removeEventListener("abort",be)}let Ue=new XMLHttpRequest;Ue.open(N.method.toUpperCase(),N.url,!0),Ue.timeout=N.timeout;function pt(){if(!Ue)return;const Ae=Gi.from("getAllResponseHeaders"in Ue&&Ue.getAllResponseHeaders()),Tt={data:!c||c==="text"||c==="json"?Ue.responseText:Ue.response,status:Ue.status,statusText:Ue.statusText,headers:Ae,config:g,request:Ue};gu(function(jt){k(jt),tt()},function(jt){E(jt),tt()},Tt),Ue=null}"onloadend"in Ue?Ue.onloadend=pt:Ue.onreadystatechange=function(){!Ue||Ue.readyState!==4||Ue.status===0&&!(Ue.responseURL&&Ue.responseURL.indexOf("file:")===0)||setTimeout(pt)},Ue.onabort=function(){Ue&&(E(new lt("Request aborted",lt.ECONNABORTED,g,Ue)),Ue=null)},Ue.onerror=function(){E(new lt("Network Error",lt.ERR_NETWORK,g,Ue)),Ue=null},Ue.ontimeout=function(){let Pt=N.timeout?"timeout of "+N.timeout+"ms exceeded":"timeout exceeded";const Tt=N.transitional||du;N.timeoutErrorMessage&&(Pt=N.timeoutErrorMessage),E(new lt(Pt,Tt.clarifyTimeoutError?lt.ETIMEDOUT:lt.ECONNABORTED,g,Ue)),Ue=null},W===void 0&&T.setContentType(null),"setRequestHeader"in Ue&&fe.forEach(T.toJSON(),function(Pt,Tt){Ue.setRequestHeader(Tt,Pt)}),fe.isUndefined(N.withCredentials)||(Ue.withCredentials=!!N.withCredentials),c&&c!=="json"&&(Ue.responseType=N.responseType),xe&&([ae,Ze]=cl(xe,!0),Ue.addEventListener("progress",ae)),ye&&Ue.upload&&([le,ut]=cl(ye),Ue.upload.addEventListener("progress",le),Ue.upload.addEventListener("loadend",ut)),(N.cancelToken||N.signal)&&(be=Ae=>{Ue&&(E(!Ae||Ae.type?new Vs(null,g,Ue):Ae),Ue.abort(),Ue=null)},N.cancelToken&&N.cancelToken.subscribe(be),N.signal&&(N.signal.aborted?be():N.signal.addEventListener("abort",be)));const Mt=jf(N.url);if(Mt&&Ir.protocols.indexOf(Mt)===-1){E(new lt("Unsupported protocol "+Mt+":",lt.ERR_BAD_REQUEST,g));return}Ue.send(W||null)})},Jf=(g,w)=>{let k=new AbortController,E;const N=function(ye){if(!E){E=!0,T();const xe=ye instanceof Error?ye:this.reason;k.abort(xe instanceof lt?xe:new Vs(xe instanceof Error?xe.message:xe))}};let W=w&&setTimeout(()=>{N(new lt(`timeout ${w} of ms exceeded`,lt.ETIMEDOUT))},w);const T=()=>{g&&(W&&clearTimeout(W),W=null,g.forEach(ye=>{ye&&(ye.removeEventListener?ye.removeEventListener("abort",N):ye.unsubscribe(N))}),g=null)};g.forEach(ye=>ye&&ye.addEventListener&&ye.addEventListener("abort",N));const{signal:c}=k;return c.unsubscribe=T,[c,()=>{W&&clearTimeout(W),W=null}]},Kf=function*(g,w){let k=g.byteLength;if(!w||k<w){yield g;return}let E=0,N;for(;E<k;)N=E+w,yield g.slice(E,N),E=N},Yf=async function*(g,w,k){for await(const E of g)yield*Kf(ArrayBuffer.isView(E)?E:await k(String(E)),w)},wu=(g,w,k,E,N)=>{const W=Yf(g,w,N);let T=0,c,ye=xe=>{c||(c=!0,E&&E(xe))};return new ReadableStream({async pull(xe){try{const{done:be,value:le}=await W.next();if(be){ye(),xe.close();return}let ae=le.byteLength;if(k){let ut=T+=ae;k(ut)}xe.enqueue(new Uint8Array(le))}catch(be){throw ye(be),be}},cancel(xe){return ye(xe),W.return()}},{highWaterMark:2})},hl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Su=hl&&typeof ReadableStream=="function",kc=hl&&(typeof TextEncoder=="function"?(g=>w=>g.encode(w))(new TextEncoder):async g=>new Uint8Array(await new Response(g).arrayBuffer())),Tu=(g,...w)=>{try{return!!g(...w)}catch{return!1}},Qf=Su&&Tu(()=>{let g=!1;const w=new Request(Ir.origin,{body:new ReadableStream,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!w}),Iu=64*1024,Ac=Su&&Tu(()=>fe.isReadableStream(new Response("").body)),ul={stream:Ac&&(g=>g.body)};hl&&(g=>{["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!ul[w]&&(ul[w]=fe.isFunction(g[w])?k=>k[w]():(k,E)=>{throw new lt(`Response type '${w}' is not supported`,lt.ERR_NOT_SUPPORT,E)})})})(new Response);const em=async g=>{if(g==null)return 0;if(fe.isBlob(g))return g.size;if(fe.isSpecCompliantForm(g))return(await new Request(g).arrayBuffer()).byteLength;if(fe.isArrayBufferView(g)||fe.isArrayBuffer(g))return g.byteLength;if(fe.isURLSearchParams(g)&&(g=g+""),fe.isString(g))return(await kc(g)).byteLength},tm=async(g,w)=>{const k=fe.toFiniteNumber(g.getContentLength());return k??em(w)},Cc={http:Tf,xhr:Wf,fetch:hl&&(async g=>{let{url:w,method:k,data:E,signal:N,cancelToken:W,timeout:T,onDownloadProgress:c,onUploadProgress:ye,responseType:xe,headers:be,withCredentials:le="same-origin",fetchOptions:ae}=bu(g);xe=xe?(xe+"").toLowerCase():"text";let[ut,Ze]=N||W||T?Jf([N,W],T):[],tt,Ue;const pt=()=>{!tt&&setTimeout(()=>{ut&&ut.unsubscribe()}),tt=!0};let Mt;try{if(ye&&Qf&&k!=="get"&&k!=="head"&&(Mt=await tm(be,E))!==0){let Gt=new Request(w,{method:"POST",body:E,duplex:"half"}),jt;if(fe.isFormData(E)&&(jt=Gt.headers.get("content-type"))&&be.setContentType(jt),Gt.body){const[Vr,bi]=_u(Mt,cl(yu(ye)));E=wu(Gt.body,Iu,Vr,bi,kc)}}fe.isString(le)||(le=le?"include":"omit"),Ue=new Request(w,{...ae,signal:ut,method:k.toUpperCase(),headers:be.normalize().toJSON(),body:E,duplex:"half",credentials:le});let Ae=await fetch(Ue);const Pt=Ac&&(xe==="stream"||xe==="response");if(Ac&&(c||Pt)){const Gt={};["status","statusText","headers"].forEach(Nr=>{Gt[Nr]=Ae[Nr]});const jt=fe.toFiniteNumber(Ae.headers.get("content-length")),[Vr,bi]=c&&_u(jt,cl(yu(c),!0))||[];Ae=new Response(wu(Ae.body,Iu,Vr,()=>{bi&&bi(),Pt&&pt()},kc),Gt)}xe=xe||"text";let Tt=await ul[fe.findKey(ul,xe)||"text"](Ae,g);return!Pt&&pt(),Ze&&Ze(),await new Promise((Gt,jt)=>{gu(Gt,jt,{data:Tt,headers:Gi.from(Ae.headers),status:Ae.status,statusText:Ae.statusText,config:g,request:Ue})})}catch(Ae){throw pt(),Ae&&Ae.name==="TypeError"&&/fetch/i.test(Ae.message)?Object.assign(new lt("Network Error",lt.ERR_NETWORK,g,Ue),{cause:Ae.cause||Ae}):lt.from(Ae,Ae&&Ae.code,g,Ue)}})};fe.forEach(Cc,(g,w)=>{if(g){try{Object.defineProperty(g,"name",{value:w})}catch{}Object.defineProperty(g,"adapterName",{value:w})}});const Pu=g=>`- ${g}`,im=g=>fe.isFunction(g)||g===null||g===!1,ku={getAdapter:g=>{g=fe.isArray(g)?g:[g];const{length:w}=g;let k,E;const N={};for(let W=0;W<w;W++){k=g[W];let T;if(E=k,!im(k)&&(E=Cc[(T=String(k)).toLowerCase()],E===void 0))throw new lt(`Unknown adapter '${T}'`);if(E)break;N[T||"#"+W]=E}if(!E){const W=Object.entries(N).map(([c,ye])=>`adapter ${c} `+(ye===!1?"is not supported by the environment":"is not available in the build"));let T=w?W.length>1?`since :
|
583
583
|
`+W.map(Pu).join(`
|
584
584
|
`):" "+Pu(W[0]):"as no adapter specified";throw new lt("There is no suitable adapter to dispatch the request "+T,"ERR_NOT_SUPPORT")}return E},adapters:Cc};function Ec(g){if(g.cancelToken&&g.cancelToken.throwIfRequested(),g.signal&&g.signal.aborted)throw new Vs(null,g)}function Au(g){return Ec(g),g.headers=Gi.from(g.headers),g.data=Pc.call(g,g.transformRequest),["post","put","patch"].indexOf(g.method)!==-1&&g.headers.setContentType("application/x-www-form-urlencoded",!1),ku.getAdapter(g.adapter||Oo.adapter)(g).then(function(E){return Ec(g),E.data=Pc.call(g,g.transformResponse,E),E.headers=Gi.from(E.headers),E},function(E){return mu(E)||(Ec(g),E&&E.response&&(E.response.data=Pc.call(g,g.transformResponse,E.response),E.response.headers=Gi.from(E.response.headers))),Promise.reject(E)})}const Cu="1.7.4",Mc={};["object","boolean","number","function","string","symbol"].forEach((g,w)=>{Mc[g]=function(E){return typeof E===g||"a"+(w<1?"n ":" ")+g}});const Eu={};Mc.transitional=function(w,k,E){function N(W,T){return"[Axios v"+Cu+"] Transitional option '"+W+"'"+T+(E?". "+E:"")}return(W,T,c)=>{if(w===!1)throw new lt(N(T," has been removed"+(k?" in "+k:"")),lt.ERR_DEPRECATED);return k&&!Eu[T]&&(Eu[T]=!0,console.warn(N(T," has been deprecated since v"+k+" and will be removed in the near future"))),w?w(W,T,c):!0}};function rm(g,w,k){if(typeof g!="object")throw new lt("options must be an object",lt.ERR_BAD_OPTION_VALUE);const E=Object.keys(g);let N=E.length;for(;N-- >0;){const W=E[N],T=w[W];if(T){const c=g[W],ye=c===void 0||T(c,W,g);if(ye!==!0)throw new lt("option "+W+" must be "+ye,lt.ERR_BAD_OPTION_VALUE);continue}if(k!==!0)throw new lt("Unknown option "+W,lt.ERR_BAD_OPTION)}}const zc={assertOptions:rm,validators:Mc},Pn=zc.validators;class is{constructor(w){this.defaults=w,this.interceptors={request:new uu,response:new uu}}async request(w,k){try{return await this._request(w,k)}catch(E){if(E instanceof Error){let N;Error.captureStackTrace?Error.captureStackTrace(N={}):N=new Error;const W=N.stack?N.stack.replace(/^.+\n/,""):"";try{E.stack?W&&!String(E.stack).endsWith(W.replace(/^.+\n.+\n/,""))&&(E.stack+=`
|
585
|
-
`+W):E.stack=W}catch{}}throw E}}_request(w,k){typeof w=="string"?(k=k||{},k.url=w):k=w||{},k=ts(this.defaults,k);const{transitional:E,paramsSerializer:N,headers:W}=k;E!==void 0&&zc.assertOptions(E,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean)},!1),N!=null&&(fe.isFunction(N)?k.paramsSerializer={serialize:N}:zc.assertOptions(N,{encode:Pn.function,serialize:Pn.function},!0)),k.method=(k.method||this.defaults.method||"get").toLowerCase();let T=W&&fe.merge(W.common,W[k.method]);W&&fe.forEach(["delete","get","head","post","put","patch","common"],Ze=>{delete W[Ze]}),k.headers=Gi.concat(T,W);const c=[];let ye=!0;this.interceptors.request.forEach(function(tt){typeof tt.runWhen=="function"&&tt.runWhen(k)===!1||(ye=ye&&tt.synchronous,c.unshift(tt.fulfilled,tt.rejected))});const xe=[];this.interceptors.response.forEach(function(tt){xe.push(tt.fulfilled,tt.rejected)});let be,le=0,ae;if(!ye){const Ze=[Au.bind(this),void 0];for(Ze.unshift.apply(Ze,c),Ze.push.apply(Ze,xe),ae=Ze.length,be=Promise.resolve(k);le<ae;)be=be.then(Ze[le++],Ze[le++]);return be}ae=c.length;let ut=k;for(le=0;le<ae;){const Ze=c[le++],tt=c[le++];try{ut=Ze(ut)}catch(Ue){tt.call(this,Ue);break}}try{be=Au.call(this,ut)}catch(Ze){return Promise.reject(Ze)}for(le=0,ae=xe.length;le<ae;)be=be.then(xe[le++],xe[le++]);return be}getUri(w){w=ts(this.defaults,w);const k=xu(w.baseURL,w.url);return hu(k,w.params,w.paramsSerializer)}}fe.forEach(["delete","get","head","options"],function(w){is.prototype[w]=function(k,E){return this.request(ts(E||{},{method:w,url:k,data:(E||{}).data}))}}),fe.forEach(["post","put","patch"],function(w){function k(E){return function(W,T,c){return this.request(ts(c||{},{method:w,headers:E?{"Content-Type":"multipart/form-data"}:{},url:W,data:T}))}}is.prototype[w]=k(),is.prototype[w+"Form"]=k(!0)});class Dc{constructor(w){if(typeof w!="function")throw new TypeError("executor must be a function.");let k;this.promise=new Promise(function(W){k=W});const E=this;this.promise.then(N=>{if(!E._listeners)return;let W=E._listeners.length;for(;W-- >0;)E._listeners[W](N);E._listeners=null}),this.promise.then=N=>{let W;const T=new Promise(c=>{E.subscribe(c),W=c}).then(N);return T.cancel=function(){E.unsubscribe(W)},T},w(function(W,T,c){E.reason||(E.reason=new Vs(W,T,c),k(E.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(w){if(this.reason){w(this.reason);return}this._listeners?this._listeners.push(w):this._listeners=[w]}unsubscribe(w){if(!this._listeners)return;const k=this._listeners.indexOf(w);k!==-1&&this._listeners.splice(k,1)}static source(){let w;return{token:new Dc(function(N){w=N}),cancel:w}}}function nm(g){return function(k){return g.apply(null,k)}}function sm(g){return fe.isObject(g)&&g.isAxiosError===!0}const Lc={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(Lc).forEach(([g,w])=>{Lc[w]=g});function Mu(g){const w=new is(g),k=Xh(is.prototype.request,w);return fe.extend(k,is.prototype,w,{allOwnKeys:!0}),fe.extend(k,w,null,{allOwnKeys:!0}),k.create=function(N){return Mu(ts(g,N))},k}const Ut=Mu(Oo);Ut.Axios=is,Ut.CanceledError=Vs,Ut.CancelToken=Dc,Ut.isCancel=mu,Ut.VERSION=Cu,Ut.toFormData=al,Ut.AxiosError=lt,Ut.Cancel=Ut.CanceledError,Ut.all=function(w){return Promise.all(w)},Ut.spread=nm,Ut.isAxiosError=sm,Ut.mergeConfig=ts,Ut.AxiosHeaders=Gi,Ut.formToJSON=g=>pu(fe.isHTMLForm(g)?new FormData(g):g),Ut.getAdapter=ku.getAdapter,Ut.HttpStatusCode=Lc,Ut.default=Ut;const Rc=(g,w=300)=>{let k;return function(...N){clearTimeout(k),k=setTimeout(()=>{g.apply(this,N)},w)}};function dl(g,w,k={}){const E={type:"Feature"};return(k.id===0||k.id)&&(E.id=k.id),k.bbox&&(E.bbox=k.bbox),E.properties=w||{},E.geometry=g,E}function om(g,w,k={}){if(!g)throw new Error("coordinates is required");if(!Array.isArray(g))throw new Error("coordinates must be an Array");if(g.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ru(g[0])||!Ru(g[1]))throw new Error("coordinates must contain numbers");return dl({type:"Point",coordinates:g},w,k)}function zu(g,w,k={}){for(const N of g){if(N.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(N[N.length-1].length!==N[0].length)throw new Error("First and last Position are not equivalent.");for(let W=0;W<N[N.length-1].length;W++)if(N[N.length-1][W]!==N[0][W])throw new Error("First and last Position are not equivalent.")}return dl({type:"Polygon",coordinates:g},w,k)}function Du(g,w,k={}){return dl({type:"MultiPoint",coordinates:g},w,k)}function Lu(g,w,k={}){return dl({type:"MultiPolygon",coordinates:g},w,k)}function Ru(g){return!isNaN(g)&&g!==null&&!Array.isArray(g)}function Bu(g,w,k){if(g!==null)for(var E,N,W,T,c,ye,xe,be=0,le=0,ae,ut=g.type,Ze=ut==="FeatureCollection",tt=ut==="Feature",Ue=Ze?g.features.length:1,pt=0;pt<Ue;pt++){xe=Ze?g.features[pt].geometry:tt?g.geometry:g,ae=xe?xe.type==="GeometryCollection":!1,c=ae?xe.geometries.length:1;for(var Mt=0;Mt<c;Mt++){var Ae=0,Pt=0;if(T=ae?xe.geometries[Mt]:xe,T!==null){ye=T.coordinates;var Tt=T.type;switch(be=0,Tt){case null:break;case"Point":if(w(ye,le,pt,Ae,Pt)===!1)return!1;le++,Ae++;break;case"LineString":case"MultiPoint":for(E=0;E<ye.length;E++){if(w(ye[E],le,pt,Ae,Pt)===!1)return!1;le++,Tt==="MultiPoint"&&Ae++}Tt==="LineString"&&Ae++;break;case"Polygon":case"MultiLineString":for(E=0;E<ye.length;E++){for(N=0;N<ye[E].length-be;N++){if(w(ye[E][N],le,pt,Ae,Pt)===!1)return!1;le++}Tt==="MultiLineString"&&Ae++,Tt==="Polygon"&&Pt++}Tt==="Polygon"&&Ae++;break;case"MultiPolygon":for(E=0;E<ye.length;E++){for(Pt=0,N=0;N<ye[E].length;N++){for(W=0;W<ye[E][N].length-be;W++){if(w(ye[E][N][W],le,pt,Ae,Pt)===!1)return!1;le++}Pt++}Ae++}break;case"GeometryCollection":for(E=0;E<T.geometries.length;E++)if(Bu(T.geometries[E],w)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Fu(g,w={}){if(g.bbox!=null&&w.recompute!==!0)return g.bbox;const k=[1/0,1/0,-1/0,-1/0];return Bu(g,E=>{k[0]>E[0]&&(k[0]=E[0]),k[1]>E[1]&&(k[1]=E[1]),k[2]<E[0]&&(k[2]=E[0]),k[3]<E[1]&&(k[3]=E[1])}),k}function Ou(g,w={}){const k=Fu(g),E=(k[0]+k[2])/2,N=(k[1]+k[3])/2;return om([E,N],w.properties,w)}const am={mixins:[yc],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}]}},data(){return{selectedLayer:null}},watch:{map(g){g&&g.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var g;this.baseLayers.forEach(w=>{this.layerList.push(w)}),this.toggleLayerVisibility((g=this.baseLayers[0])==null?void 0:g.id)},toggleLayerVisibility(g){this.selectedLayer=g,this.changeBaseLayer(this.selectedLayer)}}},lm={class:"vs-map-slot-layers"},cm=["onClick"],hm=["src"];function um(g,w,k,E,N,W){return K.openBlock(),K.createElementBlock("div",lm,[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(k.baseLayers,(T,c)=>(K.openBlock(),K.createElementBlock("div",{key:T.id,class:K.normalizeClass(["vs-map-slot-layers__layer relative",{focused:T.id==N.selectedLayer}]),onClick:ye=>W.toggleLayerVisibility(T.id)},[K.createElementVNode("img",{src:T.image,class:"vs-map-slot-layers__image"},null,8,hm),K.createElementVNode("div",{class:K.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%] "]])},K.toDisplayString(T==null?void 0:T.name),3)],10,cm))),128))])}const dm=Or(am,[["render",um],["__scopeId","data-v-d4fbd7d5"]]),pm={props:["colors","title"],methods:{capitalizeFirstLetter(g){return g?g.charAt(0).toUpperCase()+g.slice(1):""}}},fm={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg"},mm={key:0,class:"mb-[10px] text-[1rem]"},gm={class:"legend-item"},_m={key:0,class:"flex justify-start items-center gap-2"},ym={class:"ml-1 text-[0.875rem]"};function xm(g,w,k,E,N,W){return K.openBlock(),K.createElementBlock("div",fm,[k.title?(K.openBlock(),K.createElementBlock("div",mm,K.toDisplayString(k.title),1)):K.createCommentVNode("",!0),(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(k.colors,T=>(K.openBlock(),K.createElementBlock("div",gm,[T.id>0?(K.openBlock(),K.createElementBlock("div",_m,[K.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:K.normalizeStyle({backgroundColor:T.color})},null,4),K.createElementVNode("div",ym,K.toDisplayString(W.capitalizeFirstLetter(T.text)),1)])):K.createCommentVNode("",!0)]))),256))])}const vm={components:{MapSlotLayers:dm,MapLegend:Or(pm,[["render",xm]])},props:{colorAttr:null,zoom:{type:Array,default:()=>8},defaultColor:{type:String,default:"blue"},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},basemap:Array,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0}},mixins:[yc],data(){return{map:null,hoverObject:null,popup:null,colors:[]}},async mounted(){var g,w,k,E;try{if(await this.createMap(),(g=this.row)!=null&&g.geom){const{type:N,coordinates:W}=this.row.geom;console.log(this.row);let T;switch(N){case"Polygon":T=zu(W);break;case"MultiPolygon":T=Lu(W);break;case"MultiPoint":T=Du(W);break;default:(w=this.map)==null||w.fitBounds([W,W],{maxZoom:this.zoom,padding:30}),this.isSelectObj=!0;return}const c=Ou(T).geometry.coordinates;(k=this.map)==null||k.fitBounds([c,c],{maxZoom:this.zoom,padding:30})}(E=this.map)==null||E.fitBounds(this.center)}catch{}},watch:{filtersParam(g){this.setFilter(this.table,g)}},methods:{async getColorStyle(){var g=[["#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:w}}=await Ut.get(`/api/data/${this.table}/${this.colorAttr}`),k=w.reduce((E,N,W)=>N!=null&&N.id?[...E,N.id.toString(),N.color||g[0][W%5]]:E,["match",["get",this.colorAttr]]);return this.colors=[...w],k.push("gray"),k}catch(w){console.log(w)}},async handleMapLoad(){var k,E;const g=await this.getColorStyle(),w=((E=(k=location.search.split("&").find(N=>N.includes("filter=")))==null?void 0:k.split("filter="))==null?void 0:E[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()}&filter=${w}`,layers:[{type:"fill","source-layer":this.table,paint:{"fill-color":g,"fill-opacity":.3,"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":g}}]})},async createMap(){const g={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new il.Map({container:"maplibre-map",style:g,zoom:10,center:this.center}),this.$parent.map=this.map,this.map.addControl(new il.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)}}},bm={class:"vs-map-portal relative"};function wm(g,w,k,E,N,W){const T=K.resolveComponent("MapLegend"),c=K.resolveComponent("MapSlotLayers");return K.openBlock(),K.createElementBlock("div",bm,[K.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full",style:K.normalizeStyle({height:k.height})},null,4),K.withDirectives(K.createVNode(T,{colors:N.colors,title:k.legendname},null,8,["colors","title"]),[[K.vShow,k.legend]]),K.createVNode(c,{map:N.map,baseLayers:k.basemap},null,8,["map","baseLayers"])])}const Sm=Or(vm,[["render",wm]]),Tm={},Im={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"},Pm=[K.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 km(g,w){return K.openBlock(),K.createElementBlock("svg",Im,Pm)}const Am=Or(Tm,[["render",km]]),Cm={},Em={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"},Mm=[K.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),K.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),K.createElementVNode("path",{d:"M15 4v16"},null,-1),K.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1)];function zm(g,w){return K.openBlock(),K.createElementBlock("svg",Em,Mm)}const Dm=Or(Cm,[["render",zm]]),Lm={},Rm={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"},Bm=[K.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),K.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),K.createElementVNode("path",{d:"M15 4v16"},null,-1),K.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1)];function Fm(g,w){return K.openBlock(),K.createElementBlock("svg",Rm,Bm)}const Om=Or(Lm,[["render",Fm]]),Vm={},Nm={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"},Um=[K.createElementVNode("path",{d:"M18 6 6 18"},null,-1),K.createElementVNode("path",{d:"m6 6 12 12"},null,-1)];function jm(g,w){return K.openBlock(),K.createElementBlock("svg",Nm,Um)}const $m=Or(Vm,[["render",jm]]),qm={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 g;return!!((g=this.$slots)!=null&&g.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:g}){g==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")}}},Vu=g=>(K.pushScopeId("data-v-37405773"),g=g(),K.popScopeId(),g),Zm={class:"vsTailwind ui-dialog__wrapper"},Gm={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},Hm={class:"py-2.5 px-4 flex justify-between items-center border-b"},Xm={class:"font-medium text-gray-800"},Wm=[Vu(()=>K.createElementVNode("span",{class:"sr-only"},"Close",-1)),Vu(()=>K.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"},[K.createElementVNode("path",{d:"M18 6 6 18"}),K.createElementVNode("path",{d:"m6 6 12 12"})],-1))],Jm={class:"ui-dialog__content p-4"},Km={key:0,class:"flex justify-end gap-x-2"};function Ym(g,w,k,E,N,W){return K.openBlock(),K.createBlock(K.Teleport,{to:"#modal"},[K.createVNode(K.Transition,{name:"fade"},{default:K.withCtx(()=>[K.withDirectives(K.createElementVNode("div",Zm,[K.createElementVNode("div",Gm,[K.createVNode(K.Transition,{name:"content",appear:""},{default:K.withCtx(()=>[K.createElementVNode("div",{class:K.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",[W.checkSize]])},[K.createElementVNode("div",Hm,[K.createElementVNode("h3",Xm,K.toDisplayString(k.title),1),K.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:w[0]||(w[0]=(...T)=>W.handleClose&&W.handleClose(...T))},Wm)]),K.createElementVNode("div",Jm,[K.renderSlot(g.$slots,"default",{},void 0,!0)]),W.hasSlot?(K.openBlock(),K.createElementBlock("div",Km,[K.renderSlot(g.$slots,"footer",{},void 0,!0)])):K.createCommentVNode("",!0)],2)]),_:3})])],512),[[K.vShow,k.visible]])]),_:3})])}const Qm=Or(qm,[["render",Ym],["__scopeId","data-v-37405773"]]),eg=K.defineComponent({props:{title:{type:String,default:()=>""},table:{type:String,default:()=>""},rows:{type:Object,default:()=>null},initTotal:{type:[Number,String],default:()=>""},colorAttr:{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"},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"}},mixins:[yc],components:{MapPortal:Sm,NoData:Fp,FilterIcon:Am,VisibleMapIcon:Dm,HiddenMapIcon:Om,CloseIcon:$m,VsDialog:Qm},data(){return{filters:"",search:"",limit:20,polyline:null,filtersParam:"",isSelectObj:!1,selectedId:"",searchRegion:"",searchAddress:"",marker:null,handleSearchRegionDebounced:Rc(g=>this.updateSearchRegionValue(g),500),handleSearchAddressDebounced:Rc(g=>this.updateSearchAddressValue(g),500),searchRegionResult:[],searchAddressResult:[],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:{},optionRowsCount:[{value:10,label:"10"},{value:20,label:"20"},{value:30,label:"30"}],handleDebouncedUpdateValue:Rc(g=>{this.handleSearchValue(g)},10)}},watch:{map(){this.map.on("mousemove",this.handleMapHover),this.map.on("click",this.handleMapClick)},activeFiltersCount(){var g,w;return(w=(g=this.$refs)==null?void 0:g.filter)==null?void 0:w.filteredActiveFiltersLength},activeFilters(){var g,w;return this.isSelectObj&&this.moveToDefaultPage(),(w=(g=this.$refs)==null?void 0:g.filter)==null?void 0:w.activeFilters},isFilterVisible(g){g||this.getData()},async regionSelectValue(g,w){var N,W;if(!this.regionSelectValue){this.map.removeSource("region-search-id");return}g&&this.selectedId&&this.closeObjCard(),this.polyline=this.regionSelectValue.encoded_geom,this.getData();const k=((N=this.regionSelectValue)==null?void 0:N.geom)||Sr.toGeoJSON(this.regionSelectValue.encoded_geom),E=this.map.getSource("region-search-id");if(this.currentBbox=Fu(k),E)E.setData({type:"Feature",geometry:k});else{this.map.addSource("region-search-id",{type:"geojson",data:{type:"Feature",geometry:k}});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"),(W=this.map)==null||W.fitBounds(this.currentBbox,{zoom:this.setAtuZoom,padding:20}),this.getData()},async addressSelectValue(g,w){this.addressSelectValue&&(g&&this.selectedId&&this.closeObjCard(),this.getData())}},created(){this.legendName,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 w=new URLSearchParams(window.location.search).get("filter"),k=w==null?void 0:w.split("|");k==null||k.forEach(N=>{const[W,T]=N.split("=");T!=null&&T.includes(",")?this.mountedFilter[W]=T==null?void 0:T.split(","):this.mountedFilter[W]=T});const E=new URLSearchParams(window.location.search);this.currentPage=E.get("page")||1,this.getFilter()},updated(){this.checkFilterLength()},computed:{setAtuZoom(){var g,w,k;return((g=this.regionSelectValue)==null?void 0:g.id)==="UA80000000000093317"||((w=this.regionSelectValue)==null?void 0:w.id)==="UA85000000000065278"?10:((k=this.regionSelectValue)==null?void 0:k.region)===""?7.5:11}},methods:{async updateSearchRegionValue(g){this.searchRegion=g,await this.getReginOptions()},async updateSearchAddressValue(g){this.searchAddress=g,await this.getAddressOptions()},async getData(){var g,w;try{const k={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};this.filtersParam!==""&&this.filtersParam!=="no-url"?k.filter=this.filtersParam:k.filter=decodeURIComponent(((w=(g=location.search.split("&").find(N=>N.includes("filter=")))==null?void 0:g.split("filter="))==null?void 0:w[1])||""),this.addressSelectValue&&(k.filter+=k.filter?`&address_id=${this.addressSelectValue.id}`:`address_id=${this.addressSelectValue.id}`);const{data:E}=await Ut.get(`/api/data/${this.table}`,{params:k});this.tableData=E==null?void 0:E.rows,this.total=E.filtered,this.filtered=E.filtered}catch(k){console.error(k.message)}},moveToDefaultPage(){var E;const g=new URLSearchParams(window.location.search);g.delete("id");const k=`${window.location.pathname}?${g.toString()}`;debugger;(E=this.map)==null||E.fitBounds(this.maxBounds,{}),window.history.pushState({},"",k),this.isSelectObj=!1},regionFullName(g){return g.region?`${g.text} / ${g.region}`:g.text},getLabelById(g){const w=this.filters.find(k=>k.id===g);return w?w.label:g},getOptionsLabelById(g,w){if(Array.isArray(w)){const k=this.filters.find(E=>E.id===g);return k!=null&&k.options?k==null?void 0:k.options.filter(E=>w.includes(E.id)).map(E=>E.text).join(", "):w==null?void 0:w.length}else return w},async clearFilter(g){var w,k;(k=(w=this.$refs)==null?void 0:w.filter)==null||k.clearFilter(g),await this.updateTableAndMap(),await this.getData()},async getReginOptions(){if(this.searchRegion===""&&this.regionOptionGeneral)this.searchRegionResult=this.regionOptionGeneral;else try{const{data:g}=await Ut.get(`https://data.softpro.ua/api-user/suggest/atu.codifier.type.polyline.select.region?key=${this.searchRegion}`);this.searchRegionResult=g,this.regionOptionGeneral||(this.regionOptionGeneral=g)}catch(g){console.error(g.message)}},async getAddressOptions(){if(this.searchAddress===""&&this.addressOptionGeneral)this.searchAddressResult=this.addressOptionGeneral;else try{const{data:g}=await Ut.get(`/api/suggest/itree.address_id?key=${this.searchAddress}`);this.searchAddressResult=g,this.addressOptionGeneral||(this.addressOptionGeneral=g)}catch(g){console.error(g.message)}},handlePageChange(g){this.currentPage=g;const w=new URL(window.location.href),k=new URLSearchParams(window.location.search);k.set("page",g),w.search=decodeURI(k.toString()),window.history.pushState({},"",w),this.getData()},async getFilter(){var g;try{const{data:w}=await Ut.get(`/api/filter/${this.table}`);this.filters=(g=w==null?void 0:w.list)==null?void 0:g.map(k=>({...k,label:(k==null?void 0:k.label)||(k==null?void 0:k.ua),id:(k==null?void 0:k.id)||(k==null?void 0:k.name)}))}catch(w){console.error(w.message)}},async handleSearchValue(g){this.search=g,await this.getData()},closeObjCard(){var E;const g=new URLSearchParams(window.location.search);g.delete("id"),this.deletePulsePoint(),this.deleteHighlighPolygon();const k=`${window.location.pathname}?${g.toString()}`;(this.currentBbox||this.center)&&((E=this.map)==null||E.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom})),window.history.pushState({},"",k),this.isSelectObj=!1,this.selectedRow=null,this.getData()},async handleSearchRegionValue(g){var k;const w=this.map.getLayer("region-search-id");this.searchRegion=g,g===""&&w?((k=this.map)==null||k.fitBounds(this.maxBounds,{}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("region-search-id"),this.getData()):g===""&&this.getData()},async handleSearchAddressValue(g){var k;const w=this.map.getLayer("address-search-id");this.searchAddress=g,g===""&&w?((k=this.map)==null||k.fitBounds(this.maxBounds,{}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("address-search-id"),this.getData()):g===""&&this.getData()},handleFilterChange(g){this.currentPage=g.state.page||1,this.filterUrl=g.url.split("|").filter(w=>!w.includes("page=")).join("|")},async updateTableAndMap(){var g,w;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(w=(g=this.$refs)==null?void 0:g.filter)==null?void 0:w.activeFilters,this.isFilterVisible=!1,this.getData())},handleFilterSubmit(){var g;this.isSelectObj="",this.selectedId="",this.selectedId=!1,(g=this.map)==null||g.fitBounds(this.maxBounds,{}),this.isFilterVisible=!1},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(g=!0){const w=new URLSearchParams(window.location.search);w.has("id")?(this.isSelectObj=!0,this.isMapVisible=g,this.selectedId=w.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(g){this.limit=g,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 w,k;const g=(k=(w=this.$refs)==null?void 0:w.filter)==null?void 0:k.filteredActiveFiltersLength;g!==this.previousLength&&(this.previousLength=g,this.activeFiltersCount=g)},async handleMapClick(g){var W,T,c,ye,xe,be,le,ae;const w=this.map.queryRenderedFeatures(g.point);if((w==null?void 0:w.length)<1)return;const k=window.location.pathname,E=new URLSearchParams(window.location.search);E.set("id",`${(W=w[0])==null?void 0:W.properties.id}`),this.getObjectData((c=(T=w[0])==null?void 0:T.properties)==null?void 0:c.id);const N=`${k}?${E.toString()}`;window.history.pushState({},"",N),this.isSelectObj=!0,g.lngLat&&((ae=this.map)==null||ae.fitBounds([[(ye=g.lngLat)==null?void 0:ye.lng,(xe=g.lngLat)==null?void 0:xe.lat],[(be=g.lngLat)==null?void 0:be.lng,(le=g.lngLat)==null?void 0:le.lat]],{maxZoom:this.zoom,padding:30})),this.checkUrl()},async getObjectData(g){var w,k;try{const{data:E}=await Ut.get(`/api/data/${this.table}/${g}`);this.selectRow((w=E==null?void 0:E.rows)==null?void 0:w[0]),((k=E==null?void 0:E.rows)==null?void 0:k.lenght)<1&&this.deletePulsePoint()}catch(E){console.error(E.message)}},async selectRow(g,w=!0){var c,ye,xe;this.isMapVisible=w;const E=await(await fetch(`/api/data/${this.table}/${g.id}`)).json();this.selectedRow=((c=E==null?void 0:E.rows)==null?void 0:c[0])||g;const N=window.location.pathname,W=new URLSearchParams(window.location.search);W.set("id",`${g.id}`);const T=`${N}?${W.toString()}`;if(window.history.pushState({},"",T),this.checkUrl(w),g!=null&&g.geom){const{type:be,coordinates:le}=g.geom;let ae;switch(be){case"Polygon":ae=zu(le);break;case"MultiPolygon":ae=Lu(le);break;case"MultiPoint":ae=Du(le);break;default:(ye=this.map)==null||ye.fitBounds([le,le],{maxZoom:15,padding:30}),this.isSelectObj=!0;return}const ut=Ou(ae).geometry.coordinates;(xe=this.map)==null||xe.fitBounds([ut,ut],{maxZoom:this.zoom,padding:30})}this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(g){this.deletePulsePoint();const w=document.createElement("div");w.className="gps-marker",w.style.width="10px",w.style.height="10px",w.style.position="relative";const k=document.createElement("div");k.className="gps-wave",w.appendChild(k),this.marker=new il.Marker({element:w,anchor:"center"}).setLngLat(g).addTo(this.map)},deleteHighlighPolygon(){var g,w,k;(g=this.map)!=null&&g.getLayer("highlighted-polygon")&&((w=this.map)==null||w.removeLayer("highlighted-polygon"),(k=this.map)==null||k.removeSource("highlighted-polygon"))},highlightPolygon(g){var w,k,E,N,W,T;this.deletePulsePoint(),this.deleteHighlighPolygon(),(N=this.map)==null||N.addSource("highlighted-polygon",{type:"geojson",data:{geometry:{type:(w=g==null?void 0:g.geom)==null?void 0:w.type,coordinates:(k=g==null?void 0:g.geom)==null?void 0:k.coordinates},type:"Feature",properties:{id:g==null?void 0:g.id,name:g==null?void 0:g.name,category:g==null?void 0:g.id},id:g==null?void 0:g.id,layer:{id:"site.rest_zone.table-0",type:"fill",source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",filter:["all",["==",["geometry-type"],(E=g==null?void 0:g.geom)==null?void 0:E.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"}}),(W=this.map)==null||W.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(g){var N,W,T;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new il.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const w=this.map.queryRenderedFeatures(g.point);if(this.map.getCanvas().style.cursor="pointer",!(w!=null&&w.length)||((N=w==null?void 0:w[0])==null?void 0:N.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const k=w[0].geometry.coordinates.slice();w[0].source==="highlighted-polygon"&&w[1]?this.hoverData=(W=w[1])==null?void 0:W.properties:this.hoverData=(T=w[0])==null?void 0:T.properties;const E={source:w[0].source,sourceLayer:w[0].sourceLayer,id:w[0].id};if(E.source!=="region-search-id"){for(this.map.setFeatureState(E,{hover:!0}),this.hoverObject=E;Math.abs(g.lngLat.lng-k[0])>180;)k[0]+=g.lngLat.lng>k[0]?360:-360;this.popup.setLngLat(g.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}}}}),tg={class:"ml-3 pt-[20px]"},ig={class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},rg={class:"flex gap-2 pt-[4px]"},ng={class:"inline max-h-[38px] w-[1100px]"},sg={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},og=["title"],ag=K.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),lg={class:"flex"},cg={class:"py-[15px] pb-[24px] pl-2"},hg={class:"font-bold text-2xl mr-[10px]"},ug={class:"text-sm text-stone-500 font-medium"},dg=K.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),pg={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},fg={key:0,class:"flex gap-x-2 flex-wrap"},mg={class:"font-medium"},gg=K.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),_g={class:"text-gray-500"},yg=["onClick"],xg={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"},vg=K.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),bg={key:2,class:"text-center py-28"},wg=K.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),Sg=K.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),Tg={key:0},Ig={key:1,class:"my-5 pr-2"},Pg={class:"flex justify-between"},kg={class:"w-2/4"},Ag={class:"map-section"},Cg={ref:"popup",style:{display:"none"}};function Eg(g,w,k,E,N,W){var Mt;const T=K.resolveComponent("VsAutocompleteOption"),c=K.resolveComponent("vs-autocomplete"),ye=K.resolveComponent("VsTextMask"),xe=K.resolveComponent("vs-text"),be=K.resolveComponent("FilterIcon"),le=K.resolveComponent("VsFilterList"),ae=K.resolveComponent("VisibleMapIcon"),ut=K.resolveComponent("HiddenMapIcon"),Ze=K.resolveComponent("CloseIcon"),tt=K.resolveComponent("NoData"),Ue=K.resolveComponent("VsPagination"),pt=K.resolveComponent("MapPortal");return K.openBlock(),K.createElementBlock("section",tg,[K.createElementVNode("div",null,[K.createElementVNode("div",ig,[K.createElementVNode("div",rg,[g.isAutocomplete?(K.openBlock(),K.createBlock(c,{key:0,modelValue:g.regionSelectValue,"onUpdate:modelValue":[w[0]||(w[0]=Ae=>g.regionSelectValue=Ae),g.handleSearchRegionValue],searchable:"",clearable:"",searchPlaceholder:"Введіть назву громади",placeholder:"Обрати область чи громаду",onOnSearch:g.handleSearchRegionDebounced,onClick:g.getReginOptions,class:"w-[500px]"},{default:K.withCtx(()=>[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(g.searchRegionResult,Ae=>(K.openBlock(),K.createBlock(T,{class:"cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",key:Ae==null?void 0:Ae.id,value:Ae,label:g.regionFullName(Ae)},null,8,["value","label"]))),128))]),_:1},8,["modelValue","onOnSearch","onUpdate:modelValue","onClick"])):K.createCommentVNode("",!0),g.isAddressAutocomplete?(K.openBlock(),K.createBlock(c,{key:1,modelValue:g.addressSelectValue,"onUpdate:modelValue":[w[1]||(w[1]=Ae=>g.addressSelectValue=Ae),g.handleSearchAddressValue],searchable:"",clearable:"",searchPlaceholder:"Введіть адресу",placeholder:"Обрати адресу",onOnSearch:g.handleSearchAddressDebounced,onClick:g.getAddressOptions,class:"w-[350px]"},{default:K.withCtx(()=>[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(g.searchAddressResult,Ae=>(K.openBlock(),K.createBlock(T,{class:"cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",key:Ae==null?void 0:Ae.id,value:Ae,label:Ae.text},null,8,["value","label"]))),128))]),_:1},8,["modelValue","onOnSearch","onUpdate:modelValue","onClick"])):K.createCommentVNode("",!0),g.maskForSearch?(K.openBlock(),K.createBlock(ye,{key:2,"model-value":g.search,"onUpdate:modelValue":g.handleDebouncedUpdateValue,class:"w-full table-interface-search",placeholder:"Пошук",mask:g.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue","mask"])):g.searchShow?(K.openBlock(),K.createBlock(xe,{key:3,"model-value":g.search,"onUpdate:modelValue":g.handleDebouncedUpdateValue,class:"w-full table-interface-search max-w-[300px] h-[38px]",placeholder:"Пошук",icon:"search","icon-position":"left",clearable:"",style:{height:"38px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue"])):K.createCommentVNode("",!0),K.createElementVNode("div",ng,[g.filters?(K.openBlock(),K.createBlock(le,{key:0,ref:"filter",modelValue:g.mountedFilter,"onUpdate:modelValue":w[2]||(w[2]=Ae=>g.mountedFilter=Ae),scheme:g.filters,"apply-vue-router":"",history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:w[3]||(w[3]=Ae=>{g.handleFilterChange(Ae),g.updateTableAndMap()})},{button:K.withCtx(({visible:Ae})=>[K.createElementVNode("button",{type:"button",class:K.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",[Ae?"border border-blue-600 border-2":"border border-gray-200"]])},[K.createVNode(be),K.createTextVNode(" Фільтри "),g.activeFiltersCount>=1?(K.openBlock(),K.createElementBlock("span",sg,K.toDisplayString(g.activeFiltersCount),1)):K.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme"])):K.createCommentVNode("",!0)])]),K.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:g.isMapVisible?"Приховати карту":"Показати карту",onClick:w[4]||(w[4]=(...Ae)=>g.toggleMapVisible&&g.toggleMapVisible(...Ae))},[g.isMapVisible?(K.openBlock(),K.createBlock(ae,{key:0})):(K.openBlock(),K.createBlock(ut,{key:1})),ag],8,og)]),K.createElementVNode("div",lg,[K.createElementVNode("div",{class:K.normalizeClass(["relative overflow-hidden",g.isMapVisible?"w-2/4 mr-0":"w-full mr-3",g.isSelectObj?"hidden":""])},[K.createElementVNode("h1",cg,[K.createElementVNode("span",hg,K.toDisplayString(g.title),1),K.createElementVNode("span",ug,K.toDisplayString(g.total),1),dg]),K.createElementVNode("div",pg,[g.activeFilters?(K.openBlock(),K.createElementBlock("div",fg,[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(g.activeFilters,(Ae,Pt,Tt)=>(K.openBlock(),K.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:Tt},[K.createElementVNode("span",mg,K.toDisplayString(g.getLabelById(Pt)),1),gg,K.createElementVNode("span",_g,K.toDisplayString(g.getOptionsLabelById(Pt,Ae)),1),K.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:Gt=>g.clearFilter(Pt)},[K.createVNode(Ze)],8,yg)]))),128)),((Mt=Object.keys(g.activeFilters))==null?void 0:Mt.length)>=2?(K.openBlock(),K.createElementBlock("span",xg,[vg,K.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:w[5]||(w[5]=Ae=>g.mountedFilter={})},[K.createVNode(Ze)])])):K.createCommentVNode("",!0)])):K.createCommentVNode("",!0),g.total>=1?K.renderSlot(g.$slots,"table",{key:1,rows:g.tableData,map:g.map,selectRow:g.selectRow,getData:g.getData,isMapVisible:g.isMapVisible}):(K.openBlock(),K.createElementBlock("div",bg,[K.createVNode(tt),wg,Sg,K.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:w[6]||(w[6]=(...Ae)=>g.resetFilters&&g.resetFilters(...Ae))}," Очистити дані пошуку ")]))]),g.total>=1?(K.openBlock(),K.createElementBlock("hr",Tg)):K.createCommentVNode("",!0),g.total>=1?(K.openBlock(),K.createElementBlock("div",Ig,[K.createElementVNode("div",Pg,[K.createVNode(Ue,{total:g.total,maxPages:7,defaultPage:g.currentPage,pageSize:g.limit,goTo:!1,size:"medium",onPageChange:g.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:g.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):K.createCommentVNode("",!0)],2),g.isSelectObj?(K.openBlock(),K.createElementBlock("div",{key:0,class:K.normalizeClass(g.isMapVisible?"w-2/4 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[K.renderSlot(g.$slots,"details",{table:g.table,selectedId:g.selectedId,selectedRow:g.selectedRow,map:g.map,closeObjCard:g.closeObjCard,isMapVisible:g.isMapVisible})],2)):K.createCommentVNode("",!0),K.withDirectives(K.createElementVNode("div",kg,[K.createElementVNode("section",Ag,[K.createVNode(pt,{height:"calc(100vh - 152px)",width:"w-2/4",table:g.table,filtersParam:g.filtersParam,row:g.selectedRow,legendname:g.legendname,legend:g.legend,colorAttr:g.colorAttr,maxBounds:g.maxBounds,center:g.center,zoom:g.zoom,basemap:g.basemap,pointZoom:g.pointZoom,defaultColor:g.defaultColor},null,8,["table","filtersParam","row","legendname","legend","colorAttr","maxBounds","center","zoom","basemap","pointZoom","defaultColor"])])],512),[[K.vShow,g.isMapVisible]])]),K.createElementVNode("div",Cg,[K.renderSlot(g.$slots,"popup",{data:g.hoverData})],512)])])}const Nu=Or(eg,[["render",Eg]]),Uu={install:g=>{g.component("VsPartsMap",Nu)},components:{VsPartsMap:Nu}};return typeof window<"u"&&(window.PartsMap=Uu),Uu});
|
585
|
+
`+W):E.stack=W}catch{}}throw E}}_request(w,k){typeof w=="string"?(k=k||{},k.url=w):k=w||{},k=ts(this.defaults,k);const{transitional:E,paramsSerializer:N,headers:W}=k;E!==void 0&&zc.assertOptions(E,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean)},!1),N!=null&&(fe.isFunction(N)?k.paramsSerializer={serialize:N}:zc.assertOptions(N,{encode:Pn.function,serialize:Pn.function},!0)),k.method=(k.method||this.defaults.method||"get").toLowerCase();let T=W&&fe.merge(W.common,W[k.method]);W&&fe.forEach(["delete","get","head","post","put","patch","common"],Ze=>{delete W[Ze]}),k.headers=Gi.concat(T,W);const c=[];let ye=!0;this.interceptors.request.forEach(function(tt){typeof tt.runWhen=="function"&&tt.runWhen(k)===!1||(ye=ye&&tt.synchronous,c.unshift(tt.fulfilled,tt.rejected))});const xe=[];this.interceptors.response.forEach(function(tt){xe.push(tt.fulfilled,tt.rejected)});let be,le=0,ae;if(!ye){const Ze=[Au.bind(this),void 0];for(Ze.unshift.apply(Ze,c),Ze.push.apply(Ze,xe),ae=Ze.length,be=Promise.resolve(k);le<ae;)be=be.then(Ze[le++],Ze[le++]);return be}ae=c.length;let ut=k;for(le=0;le<ae;){const Ze=c[le++],tt=c[le++];try{ut=Ze(ut)}catch(Ue){tt.call(this,Ue);break}}try{be=Au.call(this,ut)}catch(Ze){return Promise.reject(Ze)}for(le=0,ae=xe.length;le<ae;)be=be.then(xe[le++],xe[le++]);return be}getUri(w){w=ts(this.defaults,w);const k=xu(w.baseURL,w.url);return hu(k,w.params,w.paramsSerializer)}}fe.forEach(["delete","get","head","options"],function(w){is.prototype[w]=function(k,E){return this.request(ts(E||{},{method:w,url:k,data:(E||{}).data}))}}),fe.forEach(["post","put","patch"],function(w){function k(E){return function(W,T,c){return this.request(ts(c||{},{method:w,headers:E?{"Content-Type":"multipart/form-data"}:{},url:W,data:T}))}}is.prototype[w]=k(),is.prototype[w+"Form"]=k(!0)});class Dc{constructor(w){if(typeof w!="function")throw new TypeError("executor must be a function.");let k;this.promise=new Promise(function(W){k=W});const E=this;this.promise.then(N=>{if(!E._listeners)return;let W=E._listeners.length;for(;W-- >0;)E._listeners[W](N);E._listeners=null}),this.promise.then=N=>{let W;const T=new Promise(c=>{E.subscribe(c),W=c}).then(N);return T.cancel=function(){E.unsubscribe(W)},T},w(function(W,T,c){E.reason||(E.reason=new Vs(W,T,c),k(E.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(w){if(this.reason){w(this.reason);return}this._listeners?this._listeners.push(w):this._listeners=[w]}unsubscribe(w){if(!this._listeners)return;const k=this._listeners.indexOf(w);k!==-1&&this._listeners.splice(k,1)}static source(){let w;return{token:new Dc(function(N){w=N}),cancel:w}}}function nm(g){return function(k){return g.apply(null,k)}}function sm(g){return fe.isObject(g)&&g.isAxiosError===!0}const Lc={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(Lc).forEach(([g,w])=>{Lc[w]=g});function Mu(g){const w=new is(g),k=Xh(is.prototype.request,w);return fe.extend(k,is.prototype,w,{allOwnKeys:!0}),fe.extend(k,w,null,{allOwnKeys:!0}),k.create=function(N){return Mu(ts(g,N))},k}const Ut=Mu(Oo);Ut.Axios=is,Ut.CanceledError=Vs,Ut.CancelToken=Dc,Ut.isCancel=mu,Ut.VERSION=Cu,Ut.toFormData=al,Ut.AxiosError=lt,Ut.Cancel=Ut.CanceledError,Ut.all=function(w){return Promise.all(w)},Ut.spread=nm,Ut.isAxiosError=sm,Ut.mergeConfig=ts,Ut.AxiosHeaders=Gi,Ut.formToJSON=g=>pu(fe.isHTMLForm(g)?new FormData(g):g),Ut.getAdapter=ku.getAdapter,Ut.HttpStatusCode=Lc,Ut.default=Ut;const Rc=(g,w=300)=>{let k;return function(...N){clearTimeout(k),k=setTimeout(()=>{g.apply(this,N)},w)}};function dl(g,w,k={}){const E={type:"Feature"};return(k.id===0||k.id)&&(E.id=k.id),k.bbox&&(E.bbox=k.bbox),E.properties=w||{},E.geometry=g,E}function om(g,w,k={}){if(!g)throw new Error("coordinates is required");if(!Array.isArray(g))throw new Error("coordinates must be an Array");if(g.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ru(g[0])||!Ru(g[1]))throw new Error("coordinates must contain numbers");return dl({type:"Point",coordinates:g},w,k)}function zu(g,w,k={}){for(const N of g){if(N.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(N[N.length-1].length!==N[0].length)throw new Error("First and last Position are not equivalent.");for(let W=0;W<N[N.length-1].length;W++)if(N[N.length-1][W]!==N[0][W])throw new Error("First and last Position are not equivalent.")}return dl({type:"Polygon",coordinates:g},w,k)}function Du(g,w,k={}){return dl({type:"MultiPoint",coordinates:g},w,k)}function Lu(g,w,k={}){return dl({type:"MultiPolygon",coordinates:g},w,k)}function Ru(g){return!isNaN(g)&&g!==null&&!Array.isArray(g)}function Bu(g,w,k){if(g!==null)for(var E,N,W,T,c,ye,xe,be=0,le=0,ae,ut=g.type,Ze=ut==="FeatureCollection",tt=ut==="Feature",Ue=Ze?g.features.length:1,pt=0;pt<Ue;pt++){xe=Ze?g.features[pt].geometry:tt?g.geometry:g,ae=xe?xe.type==="GeometryCollection":!1,c=ae?xe.geometries.length:1;for(var Mt=0;Mt<c;Mt++){var Ae=0,Pt=0;if(T=ae?xe.geometries[Mt]:xe,T!==null){ye=T.coordinates;var Tt=T.type;switch(be=0,Tt){case null:break;case"Point":if(w(ye,le,pt,Ae,Pt)===!1)return!1;le++,Ae++;break;case"LineString":case"MultiPoint":for(E=0;E<ye.length;E++){if(w(ye[E],le,pt,Ae,Pt)===!1)return!1;le++,Tt==="MultiPoint"&&Ae++}Tt==="LineString"&&Ae++;break;case"Polygon":case"MultiLineString":for(E=0;E<ye.length;E++){for(N=0;N<ye[E].length-be;N++){if(w(ye[E][N],le,pt,Ae,Pt)===!1)return!1;le++}Tt==="MultiLineString"&&Ae++,Tt==="Polygon"&&Pt++}Tt==="Polygon"&&Ae++;break;case"MultiPolygon":for(E=0;E<ye.length;E++){for(Pt=0,N=0;N<ye[E].length;N++){for(W=0;W<ye[E][N].length-be;W++){if(w(ye[E][N][W],le,pt,Ae,Pt)===!1)return!1;le++}Pt++}Ae++}break;case"GeometryCollection":for(E=0;E<T.geometries.length;E++)if(Bu(T.geometries[E],w)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Fu(g,w={}){if(g.bbox!=null&&w.recompute!==!0)return g.bbox;const k=[1/0,1/0,-1/0,-1/0];return Bu(g,E=>{k[0]>E[0]&&(k[0]=E[0]),k[1]>E[1]&&(k[1]=E[1]),k[2]<E[0]&&(k[2]=E[0]),k[3]<E[1]&&(k[3]=E[1])}),k}function Ou(g,w={}){const k=Fu(g),E=(k[0]+k[2])/2,N=(k[1]+k[3])/2;return om([E,N],w.properties,w)}const am={mixins:[yc],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}]}},data(){return{selectedLayer:null}},watch:{map(g){g&&g.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var g;this.baseLayers.forEach(w=>{this.layerList.push(w)}),this.toggleLayerVisibility((g=this.baseLayers[0])==null?void 0:g.id)},toggleLayerVisibility(g){this.selectedLayer=g,this.changeBaseLayer(this.selectedLayer)}}},lm={class:"vs-map-slot-layers"},cm=["onClick"],hm=["src"];function um(g,w,k,E,N,W){return K.openBlock(),K.createElementBlock("div",lm,[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(k.baseLayers,(T,c)=>(K.openBlock(),K.createElementBlock("div",{key:T.id,class:K.normalizeClass(["vs-map-slot-layers__layer relative",{focused:T.id==N.selectedLayer}]),onClick:ye=>W.toggleLayerVisibility(T.id)},[K.createElementVNode("img",{src:T.image,class:"vs-map-slot-layers__image"},null,8,hm),K.createElementVNode("div",{class:K.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%] "]])},K.toDisplayString(T==null?void 0:T.name),3)],10,cm))),128))])}const dm=Or(am,[["render",um],["__scopeId","data-v-d4fbd7d5"]]),pm={props:["colors","title"],methods:{capitalizeFirstLetter(g){return g?g.charAt(0).toUpperCase()+g.slice(1):""}}},fm={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg"},mm={key:0,class:"mb-[10px] text-[1rem]"},gm={class:"legend-item"},_m={key:0,class:"flex justify-start items-center gap-2"},ym={class:"ml-1 text-[0.875rem]"};function xm(g,w,k,E,N,W){return K.openBlock(),K.createElementBlock("div",fm,[k.title?(K.openBlock(),K.createElementBlock("div",mm,K.toDisplayString(k.title),1)):K.createCommentVNode("",!0),(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(k.colors,T=>(K.openBlock(),K.createElementBlock("div",gm,[T.id>0?(K.openBlock(),K.createElementBlock("div",_m,[K.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:K.normalizeStyle({backgroundColor:T.color})},null,4),K.createElementVNode("div",ym,K.toDisplayString(W.capitalizeFirstLetter(T.text)),1)])):K.createCommentVNode("",!0)]))),256))])}const vm={components:{MapSlotLayers:dm,MapLegend:Or(pm,[["render",xm]])},props:{colorAttr:null,zoom:{type:Array,default:()=>8},defaultColor:{type:String,default:"blue"},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},basemap:Array,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0}},mixins:[yc],data(){return{map:null,hoverObject:null,popup:null,colors:[]}},async mounted(){var g,w,k,E;try{if(await this.createMap(),(g=this.row)!=null&&g.geom){const{type:N,coordinates:W}=this.row.geom;let T;switch(N){case"Polygon":T=zu(W);break;case"MultiPolygon":T=Lu(W);break;case"MultiPoint":T=Du(W);break;default:(w=this.map)==null||w.fitBounds([W,W],{maxZoom:this.zoom,padding:30}),this.isSelectObj=!0;return}const c=Ou(T).geometry.coordinates;(k=this.map)==null||k.fitBounds([c,c],{maxZoom:this.zoom,padding:30})}(E=this.map)==null||E.fitBounds(this.center)}catch{}},watch:{filtersParam(g){this.setFilter(this.table,g)}},methods:{async getColorStyle(){var g=[["#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:w}}=await Ut.get(`/api/data/${this.table}/${this.colorAttr}`),k=w.reduce((E,N,W)=>N!=null&&N.id?[...E,N.id.toString(),N.color||g[0][W%5]]:E,["match",["get",this.colorAttr]]);return this.colors=[...w],k.push("gray"),k}catch(w){console.log(w)}},async handleMapLoad(){var k,E;const g=await this.getColorStyle(),w=((E=(k=location.search.split("&").find(N=>N.includes("filter=")))==null?void 0:k.split("filter="))==null?void 0:E[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()}&filter=${w}`,layers:[{type:"fill","source-layer":this.table,paint:{"fill-color":g,"fill-opacity":.3,"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":g}}]})},async createMap(){const g={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new il.Map({container:"maplibre-map",style:g,zoom:this.zoom,center:this.center}),this.$parent.map=this.map,this.map.addControl(new il.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)}}},bm={class:"vs-map-portal relative"};function wm(g,w,k,E,N,W){const T=K.resolveComponent("MapLegend"),c=K.resolveComponent("MapSlotLayers");return K.openBlock(),K.createElementBlock("div",bm,[K.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full",style:K.normalizeStyle({height:k.height})},null,4),K.withDirectives(K.createVNode(T,{colors:N.colors,title:k.legendname},null,8,["colors","title"]),[[K.vShow,k.legend]]),K.createVNode(c,{map:N.map,baseLayers:k.basemap},null,8,["map","baseLayers"])])}const Sm=Or(vm,[["render",wm]]),Tm={},Im={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"},Pm=[K.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 km(g,w){return K.openBlock(),K.createElementBlock("svg",Im,Pm)}const Am=Or(Tm,[["render",km]]),Cm={},Em={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"},Mm=[K.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),K.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),K.createElementVNode("path",{d:"M15 4v16"},null,-1),K.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1)];function zm(g,w){return K.openBlock(),K.createElementBlock("svg",Em,Mm)}const Dm=Or(Cm,[["render",zm]]),Lm={},Rm={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"},Bm=[K.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),K.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),K.createElementVNode("path",{d:"M15 4v16"},null,-1),K.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1)];function Fm(g,w){return K.openBlock(),K.createElementBlock("svg",Rm,Bm)}const Om=Or(Lm,[["render",Fm]]),Vm={},Nm={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"},Um=[K.createElementVNode("path",{d:"M18 6 6 18"},null,-1),K.createElementVNode("path",{d:"m6 6 12 12"},null,-1)];function jm(g,w){return K.openBlock(),K.createElementBlock("svg",Nm,Um)}const $m=Or(Vm,[["render",jm]]),qm={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 g;return!!((g=this.$slots)!=null&&g.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:g}){g==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")}}},Vu=g=>(K.pushScopeId("data-v-37405773"),g=g(),K.popScopeId(),g),Zm={class:"vsTailwind ui-dialog__wrapper"},Gm={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},Hm={class:"py-2.5 px-4 flex justify-between items-center border-b"},Xm={class:"font-medium text-gray-800"},Wm=[Vu(()=>K.createElementVNode("span",{class:"sr-only"},"Close",-1)),Vu(()=>K.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"},[K.createElementVNode("path",{d:"M18 6 6 18"}),K.createElementVNode("path",{d:"m6 6 12 12"})],-1))],Jm={class:"ui-dialog__content p-4"},Km={key:0,class:"flex justify-end gap-x-2"};function Ym(g,w,k,E,N,W){return K.openBlock(),K.createBlock(K.Teleport,{to:"#modal"},[K.createVNode(K.Transition,{name:"fade"},{default:K.withCtx(()=>[K.withDirectives(K.createElementVNode("div",Zm,[K.createElementVNode("div",Gm,[K.createVNode(K.Transition,{name:"content",appear:""},{default:K.withCtx(()=>[K.createElementVNode("div",{class:K.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",[W.checkSize]])},[K.createElementVNode("div",Hm,[K.createElementVNode("h3",Xm,K.toDisplayString(k.title),1),K.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:w[0]||(w[0]=(...T)=>W.handleClose&&W.handleClose(...T))},Wm)]),K.createElementVNode("div",Jm,[K.renderSlot(g.$slots,"default",{},void 0,!0)]),W.hasSlot?(K.openBlock(),K.createElementBlock("div",Km,[K.renderSlot(g.$slots,"footer",{},void 0,!0)])):K.createCommentVNode("",!0)],2)]),_:3})])],512),[[K.vShow,k.visible]])]),_:3})])}const Qm=Or(qm,[["render",Ym],["__scopeId","data-v-37405773"]]),eg=K.defineComponent({props:{title:{type:String,default:()=>""},table:{type:String,default:()=>""},rows:{type:Object,default:()=>null},initTotal:{type:[Number,String],default:()=>""},colorAttr:{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"},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"}},mixins:[yc],components:{MapPortal:Sm,NoData:Fp,FilterIcon:Am,VisibleMapIcon:Dm,HiddenMapIcon:Om,CloseIcon:$m,VsDialog:Qm},data(){return{filters:"",search:"",limit:20,polyline:null,filtersParam:"",isSelectObj:!1,selectedId:"",searchRegion:"",searchAddress:"",marker:null,handleSearchRegionDebounced:Rc(g=>this.updateSearchRegionValue(g),500),handleSearchAddressDebounced:Rc(g=>this.updateSearchAddressValue(g),500),searchRegionResult:[],searchAddressResult:[],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:{},optionRowsCount:[{value:10,label:"10"},{value:20,label:"20"},{value:30,label:"30"}],handleDebouncedUpdateValue:Rc(g=>{this.handleSearchValue(g)},10)}},watch:{map(){this.map.on("mousemove",this.handleMapHover),this.map.on("click",this.handleMapClick)},activeFiltersCount(){var g,w;return(w=(g=this.$refs)==null?void 0:g.filter)==null?void 0:w.filteredActiveFiltersLength},activeFilters(){var g,w;return this.isSelectObj&&this.moveToDefaultPage(),(w=(g=this.$refs)==null?void 0:g.filter)==null?void 0:w.activeFilters},isFilterVisible(g){g||this.getData()},async regionSelectValue(g,w){var N,W;if(!this.regionSelectValue){this.map.removeSource("region-search-id");return}g&&this.selectedId&&this.closeObjCard(),this.polyline=this.regionSelectValue.encoded_geom,this.getData();const k=((N=this.regionSelectValue)==null?void 0:N.geom)||Sr.toGeoJSON(this.regionSelectValue.encoded_geom),E=this.map.getSource("region-search-id");if(this.currentBbox=Fu(k),E)E.setData({type:"Feature",geometry:k});else{this.map.addSource("region-search-id",{type:"geojson",data:{type:"Feature",geometry:k}});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"),(W=this.map)==null||W.fitBounds(this.currentBbox,{zoom:this.setAtuZoom,padding:20}),this.getData()},async addressSelectValue(g,w){this.addressSelectValue&&(g&&this.selectedId&&this.closeObjCard(),this.getData())}},created(){this.legendName,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 w=new URLSearchParams(window.location.search).get("filter"),k=w==null?void 0:w.split("|");k==null||k.forEach(N=>{const[W,T]=N.split("=");T!=null&&T.includes(",")?this.mountedFilter[W]=T==null?void 0:T.split(","):this.mountedFilter[W]=T});const E=new URLSearchParams(window.location.search);this.currentPage=E.get("page")||1,this.getFilter()},updated(){this.checkFilterLength()},computed:{setAtuZoom(){var g,w,k;return((g=this.regionSelectValue)==null?void 0:g.id)==="UA80000000000093317"||((w=this.regionSelectValue)==null?void 0:w.id)==="UA85000000000065278"?10:((k=this.regionSelectValue)==null?void 0:k.region)===""?7.5:11}},methods:{async updateSearchRegionValue(g){this.searchRegion=g,await this.getReginOptions()},async updateSearchAddressValue(g){this.searchAddress=g,await this.getAddressOptions()},async getData(){var g,w;try{const k={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};this.filtersParam!==""&&this.filtersParam!=="no-url"?k.filter=this.filtersParam:k.filter=decodeURIComponent(((w=(g=location.search.split("&").find(N=>N.includes("filter=")))==null?void 0:g.split("filter="))==null?void 0:w[1])||""),this.addressSelectValue&&(k.filter+=k.filter?`&address_id=${this.addressSelectValue.id}`:`address_id=${this.addressSelectValue.id}`);const{data:E}=await Ut.get(`/api/data/${this.table}`,{params:k});this.tableData=E==null?void 0:E.rows,this.total=E.filtered,this.filtered=E.filtered}catch(k){console.error(k.message)}},moveToDefaultPage(){var E;const g=new URLSearchParams(window.location.search);g.delete("id");const k=`${window.location.pathname}?${g.toString()}`;debugger;(E=this.map)==null||E.fitBounds(this.maxBounds,{}),window.history.pushState({},"",k),this.isSelectObj=!1},regionFullName(g){return g.region?`${g.text} / ${g.region}`:g.text},getLabelById(g){const w=this.filters.find(k=>k.id===g);return w?w.label:g},getOptionsLabelById(g,w){if(Array.isArray(w)){const k=this.filters.find(E=>E.id===g);return k!=null&&k.options?k==null?void 0:k.options.filter(E=>w.includes(E.id)).map(E=>E.text).join(", "):w==null?void 0:w.length}else return w},async clearFilter(g){var w,k;(k=(w=this.$refs)==null?void 0:w.filter)==null||k.clearFilter(g),await this.updateTableAndMap(),await this.getData()},async getReginOptions(){if(this.searchRegion===""&&this.regionOptionGeneral)this.searchRegionResult=this.regionOptionGeneral;else try{const{data:g}=await Ut.get(`https://data.softpro.ua/api-user/suggest/atu.codifier.type.polyline.select.region?key=${this.searchRegion}`);this.searchRegionResult=g,this.regionOptionGeneral||(this.regionOptionGeneral=g)}catch(g){console.error(g.message)}},async getAddressOptions(){if(this.searchAddress===""&&this.addressOptionGeneral)this.searchAddressResult=this.addressOptionGeneral;else try{const{data:g}=await Ut.get(`/api/suggest/itree.address_id?key=${this.searchAddress}`);this.searchAddressResult=g,this.addressOptionGeneral||(this.addressOptionGeneral=g)}catch(g){console.error(g.message)}},handlePageChange(g){this.currentPage=g;const w=new URL(window.location.href),k=new URLSearchParams(window.location.search);k.set("page",g),w.search=decodeURI(k.toString()),window.history.pushState({},"",w),this.getData()},async getFilter(){var g;try{const{data:w}=await Ut.get(`/api/filter/${this.table}`);this.filters=(g=w==null?void 0:w.list)==null?void 0:g.map(k=>({...k,label:(k==null?void 0:k.label)||(k==null?void 0:k.ua),id:(k==null?void 0:k.id)||(k==null?void 0:k.name)}))}catch(w){console.error(w.message)}},async handleSearchValue(g){this.search=g,await this.getData()},closeObjCard(){var E;const g=new URLSearchParams(window.location.search);g.delete("id"),this.deletePulsePoint(),this.deleteHighlighPolygon();const k=`${window.location.pathname}?${g.toString()}`;(this.currentBbox||this.center)&&((E=this.map)==null||E.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom})),window.history.pushState({},"",k),this.isSelectObj=!1,this.selectedRow=null,this.getData()},async handleSearchRegionValue(g){var k;const w=this.map.getLayer("region-search-id");this.searchRegion=g,g===""&&w?((k=this.map)==null||k.fitBounds(this.maxBounds,{}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("region-search-id"),this.getData()):g===""&&this.getData()},async handleSearchAddressValue(g){var k;const w=this.map.getLayer("address-search-id");this.searchAddress=g,g===""&&w?((k=this.map)==null||k.fitBounds(this.maxBounds,{}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("address-search-id"),this.getData()):g===""&&this.getData()},handleFilterChange(g){this.currentPage=g.state.page||1,this.filterUrl=g.url.split("|").filter(w=>!w.includes("page=")).join("|")},async updateTableAndMap(){var g,w;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(w=(g=this.$refs)==null?void 0:g.filter)==null?void 0:w.activeFilters,this.isFilterVisible=!1,this.getData())},handleFilterSubmit(){var g;this.isSelectObj="",this.selectedId="",this.selectedId=!1,(g=this.map)==null||g.fitBounds(this.maxBounds,{}),this.isFilterVisible=!1},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(g=!0){const w=new URLSearchParams(window.location.search);w.has("id")?(this.isSelectObj=!0,this.isMapVisible=g,this.selectedId=w.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(g){this.limit=g,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 w,k;const g=(k=(w=this.$refs)==null?void 0:w.filter)==null?void 0:k.filteredActiveFiltersLength;g!==this.previousLength&&(this.previousLength=g,this.activeFiltersCount=g)},async handleMapClick(g){var W,T,c,ye,xe,be,le,ae;const w=this.map.queryRenderedFeatures(g.point);if((w==null?void 0:w.length)<1)return;const k=window.location.pathname,E=new URLSearchParams(window.location.search);E.set("id",`${(W=w[0])==null?void 0:W.properties.id}`),this.getObjectData((c=(T=w[0])==null?void 0:T.properties)==null?void 0:c.id);const N=`${k}?${E.toString()}`;window.history.pushState({},"",N),this.isSelectObj=!0,g.lngLat&&((ae=this.map)==null||ae.fitBounds([[(ye=g.lngLat)==null?void 0:ye.lng,(xe=g.lngLat)==null?void 0:xe.lat],[(be=g.lngLat)==null?void 0:be.lng,(le=g.lngLat)==null?void 0:le.lat]],{maxZoom:this.zoom,padding:30})),this.checkUrl()},async getObjectData(g){var w,k;try{const{data:E}=await Ut.get(`/api/data/${this.table}/${g}`);this.selectRow((w=E==null?void 0:E.rows)==null?void 0:w[0]),((k=E==null?void 0:E.rows)==null?void 0:k.lenght)<1&&this.deletePulsePoint()}catch(E){console.error(E.message)}},async selectRow(g,w=!0){var c,ye,xe;this.isMapVisible=w;const E=await(await fetch(`/api/data/${this.table}/${g.id}`)).json();this.selectedRow=((c=E==null?void 0:E.rows)==null?void 0:c[0])||g;const N=window.location.pathname,W=new URLSearchParams(window.location.search);W.set("id",`${g.id}`);const T=`${N}?${W.toString()}`;if(window.history.pushState({},"",T),this.checkUrl(w),g!=null&&g.geom){const{type:be,coordinates:le}=g.geom;let ae;switch(be){case"Polygon":ae=zu(le);break;case"MultiPolygon":ae=Lu(le);break;case"MultiPoint":ae=Du(le);break;default:(ye=this.map)==null||ye.fitBounds([le,le],{maxZoom:15,padding:30}),this.isSelectObj=!0;return}const ut=Ou(ae).geometry.coordinates;(xe=this.map)==null||xe.fitBounds([ut,ut],{maxZoom:this.zoom,padding:30})}this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(g){this.deletePulsePoint();const w=document.createElement("div");w.className="gps-marker",w.style.width="10px",w.style.height="10px",w.style.position="relative";const k=document.createElement("div");k.className="gps-wave",w.appendChild(k),this.marker=new il.Marker({element:w,anchor:"center"}).setLngLat(g).addTo(this.map)},deleteHighlighPolygon(){var g,w,k;(g=this.map)!=null&&g.getLayer("highlighted-polygon")&&((w=this.map)==null||w.removeLayer("highlighted-polygon"),(k=this.map)==null||k.removeSource("highlighted-polygon"))},highlightPolygon(g){var w,k,E,N,W,T;this.deletePulsePoint(),this.deleteHighlighPolygon(),(N=this.map)==null||N.addSource("highlighted-polygon",{type:"geojson",data:{geometry:{type:(w=g==null?void 0:g.geom)==null?void 0:w.type,coordinates:(k=g==null?void 0:g.geom)==null?void 0:k.coordinates},type:"Feature",properties:{id:g==null?void 0:g.id,name:g==null?void 0:g.name,category:g==null?void 0:g.id},id:g==null?void 0:g.id,layer:{id:"site.rest_zone.table-0",type:"fill",source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",filter:["all",["==",["geometry-type"],(E=g==null?void 0:g.geom)==null?void 0:E.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"}}),(W=this.map)==null||W.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(g){var N,W,T;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new il.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const w=this.map.queryRenderedFeatures(g.point);if(this.map.getCanvas().style.cursor="pointer",!(w!=null&&w.length)||((N=w==null?void 0:w[0])==null?void 0:N.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const k=w[0].geometry.coordinates.slice();w[0].source==="highlighted-polygon"&&w[1]?this.hoverData=(W=w[1])==null?void 0:W.properties:this.hoverData=(T=w[0])==null?void 0:T.properties;const E={source:w[0].source,sourceLayer:w[0].sourceLayer,id:w[0].id};if(E.source!=="region-search-id"){for(this.map.setFeatureState(E,{hover:!0}),this.hoverObject=E;Math.abs(g.lngLat.lng-k[0])>180;)k[0]+=g.lngLat.lng>k[0]?360:-360;this.popup.setLngLat(g.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}}}}),tg={class:"ml-3 pt-[20px]"},ig={class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},rg={class:"flex gap-2 pt-[4px]"},ng={class:"inline max-h-[38px] w-[1100px]"},sg={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},og=["title"],ag=K.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),lg={class:"flex"},cg={class:"py-[15px] pb-[24px] pl-2"},hg={class:"font-bold text-2xl mr-[10px]"},ug={class:"text-sm text-stone-500 font-medium"},dg=K.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),pg={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},fg={key:0,class:"flex gap-x-2 flex-wrap"},mg={class:"font-medium"},gg=K.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),_g={class:"text-gray-500"},yg=["onClick"],xg={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"},vg=K.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),bg={key:2,class:"text-center py-28"},wg=K.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),Sg=K.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),Tg={key:0},Ig={key:1,class:"my-5 pr-2"},Pg={class:"flex justify-between"},kg={class:"w-2/4"},Ag={class:"map-section"},Cg={ref:"popup",style:{display:"none"}};function Eg(g,w,k,E,N,W){var Mt;const T=K.resolveComponent("VsAutocompleteOption"),c=K.resolveComponent("vs-autocomplete"),ye=K.resolveComponent("VsTextMask"),xe=K.resolveComponent("vs-text"),be=K.resolveComponent("FilterIcon"),le=K.resolveComponent("VsFilterList"),ae=K.resolveComponent("VisibleMapIcon"),ut=K.resolveComponent("HiddenMapIcon"),Ze=K.resolveComponent("CloseIcon"),tt=K.resolveComponent("NoData"),Ue=K.resolveComponent("VsPagination"),pt=K.resolveComponent("MapPortal");return K.openBlock(),K.createElementBlock("section",tg,[K.createElementVNode("div",null,[K.createElementVNode("div",ig,[K.createElementVNode("div",rg,[g.isAutocomplete?(K.openBlock(),K.createBlock(c,{key:0,modelValue:g.regionSelectValue,"onUpdate:modelValue":[w[0]||(w[0]=Ae=>g.regionSelectValue=Ae),g.handleSearchRegionValue],searchable:"",clearable:"",searchPlaceholder:"Введіть назву громади",placeholder:"Обрати область чи громаду",onOnSearch:g.handleSearchRegionDebounced,onClick:g.getReginOptions,class:"w-[500px]"},{default:K.withCtx(()=>[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(g.searchRegionResult,Ae=>(K.openBlock(),K.createBlock(T,{class:"cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",key:Ae==null?void 0:Ae.id,value:Ae,label:g.regionFullName(Ae)},null,8,["value","label"]))),128))]),_:1},8,["modelValue","onOnSearch","onUpdate:modelValue","onClick"])):K.createCommentVNode("",!0),g.isAddressAutocomplete?(K.openBlock(),K.createBlock(c,{key:1,modelValue:g.addressSelectValue,"onUpdate:modelValue":[w[1]||(w[1]=Ae=>g.addressSelectValue=Ae),g.handleSearchAddressValue],searchable:"",clearable:"",searchPlaceholder:"Введіть адресу",placeholder:"Обрати адресу",onOnSearch:g.handleSearchAddressDebounced,onClick:g.getAddressOptions,class:"w-[350px]"},{default:K.withCtx(()=>[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(g.searchAddressResult,Ae=>(K.openBlock(),K.createBlock(T,{class:"cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",key:Ae==null?void 0:Ae.id,value:Ae,label:Ae.text},null,8,["value","label"]))),128))]),_:1},8,["modelValue","onOnSearch","onUpdate:modelValue","onClick"])):K.createCommentVNode("",!0),g.maskForSearch?(K.openBlock(),K.createBlock(ye,{key:2,"model-value":g.search,"onUpdate:modelValue":g.handleDebouncedUpdateValue,class:"w-full table-interface-search",placeholder:"Пошук",mask:g.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue","mask"])):g.searchShow?(K.openBlock(),K.createBlock(xe,{key:3,"model-value":g.search,"onUpdate:modelValue":g.handleDebouncedUpdateValue,class:"w-full table-interface-search max-w-[300px] h-[38px]",placeholder:"Пошук",icon:"search","icon-position":"left",clearable:"",style:{height:"38px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue"])):K.createCommentVNode("",!0),K.createElementVNode("div",ng,[g.filters?(K.openBlock(),K.createBlock(le,{key:0,ref:"filter",modelValue:g.mountedFilter,"onUpdate:modelValue":w[2]||(w[2]=Ae=>g.mountedFilter=Ae),scheme:g.filters,"apply-vue-router":"",history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:w[3]||(w[3]=Ae=>{g.handleFilterChange(Ae),g.updateTableAndMap()})},{button:K.withCtx(({visible:Ae})=>[K.createElementVNode("button",{type:"button",class:K.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",[Ae?"border border-blue-600 border-2":"border border-gray-200"]])},[K.createVNode(be),K.createTextVNode(" Фільтри "),g.activeFiltersCount>=1?(K.openBlock(),K.createElementBlock("span",sg,K.toDisplayString(g.activeFiltersCount),1)):K.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme"])):K.createCommentVNode("",!0)])]),K.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:g.isMapVisible?"Приховати карту":"Показати карту",onClick:w[4]||(w[4]=(...Ae)=>g.toggleMapVisible&&g.toggleMapVisible(...Ae))},[g.isMapVisible?(K.openBlock(),K.createBlock(ae,{key:0})):(K.openBlock(),K.createBlock(ut,{key:1})),ag],8,og)]),K.createElementVNode("div",lg,[K.createElementVNode("div",{class:K.normalizeClass(["relative overflow-hidden",g.isMapVisible?"w-2/4 mr-0":"w-full mr-3",g.isSelectObj?"hidden":""])},[K.createElementVNode("h1",cg,[K.createElementVNode("span",hg,K.toDisplayString(g.title),1),K.createElementVNode("span",ug,K.toDisplayString(g.total),1),dg]),K.createElementVNode("div",pg,[g.activeFilters?(K.openBlock(),K.createElementBlock("div",fg,[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(g.activeFilters,(Ae,Pt,Tt)=>(K.openBlock(),K.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:Tt},[K.createElementVNode("span",mg,K.toDisplayString(g.getLabelById(Pt)),1),gg,K.createElementVNode("span",_g,K.toDisplayString(g.getOptionsLabelById(Pt,Ae)),1),K.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:Gt=>g.clearFilter(Pt)},[K.createVNode(Ze)],8,yg)]))),128)),((Mt=Object.keys(g.activeFilters))==null?void 0:Mt.length)>=2?(K.openBlock(),K.createElementBlock("span",xg,[vg,K.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:w[5]||(w[5]=Ae=>g.mountedFilter={})},[K.createVNode(Ze)])])):K.createCommentVNode("",!0)])):K.createCommentVNode("",!0),g.total>=1?K.renderSlot(g.$slots,"table",{key:1,rows:g.tableData,map:g.map,selectRow:g.selectRow,getData:g.getData,isMapVisible:g.isMapVisible}):(K.openBlock(),K.createElementBlock("div",bg,[K.createVNode(tt),wg,Sg,K.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:w[6]||(w[6]=(...Ae)=>g.resetFilters&&g.resetFilters(...Ae))}," Очистити дані пошуку ")]))]),g.total>=1?(K.openBlock(),K.createElementBlock("hr",Tg)):K.createCommentVNode("",!0),g.total>=1?(K.openBlock(),K.createElementBlock("div",Ig,[K.createElementVNode("div",Pg,[K.createVNode(Ue,{total:g.total,maxPages:7,defaultPage:g.currentPage,pageSize:g.limit,goTo:!1,size:"medium",onPageChange:g.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:g.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):K.createCommentVNode("",!0)],2),g.isSelectObj?(K.openBlock(),K.createElementBlock("div",{key:0,class:K.normalizeClass(g.isMapVisible?"w-2/4 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[K.renderSlot(g.$slots,"details",{table:g.table,selectedId:g.selectedId,selectedRow:g.selectedRow,map:g.map,closeObjCard:g.closeObjCard,isMapVisible:g.isMapVisible})],2)):K.createCommentVNode("",!0),K.withDirectives(K.createElementVNode("div",kg,[K.createElementVNode("section",Ag,[K.createVNode(pt,{height:"calc(100vh - 152px)",width:"w-2/4",table:g.table,filtersParam:g.filtersParam,row:g.selectedRow,legendname:g.legendname,legend:g.legend,colorAttr:g.colorAttr,maxBounds:g.maxBounds,center:g.center,zoom:g.zoom,basemap:g.basemap,pointZoom:g.pointZoom,defaultColor:g.defaultColor},null,8,["table","filtersParam","row","legendname","legend","colorAttr","maxBounds","center","zoom","basemap","pointZoom","defaultColor"])])],512),[[K.vShow,g.isMapVisible]])]),K.createElementVNode("div",Cg,[K.renderSlot(g.$slots,"popup",{data:g.hoverData})],512)])])}const Nu=Or(eg,[["render",Eg]]),Uu={install:g=>{g.component("VsPartsMap",Nu)},components:{VsPartsMap:Nu}};return typeof window<"u"&&(window.PartsMap=Uu),Uu});
|