@evergis/api 4.0.19 → 4.0.21

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("ky"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("@microsoft/signalr"),s=require("query-string"),i=require("nanoid");function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function k(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}function g(){return(g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=k(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(this,arguments)}let m=function(){function e(t){var n;void 0===t&&(t={}),u(this,e),this.ky=r.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return l(e,[{key:"extend",value:function(e){var t;this.ky=r.extend(e),this.prefixUrl=(null==(t=e.prefixUrl)?void 0:t.toString())||""}},{key:"get",value:function(e,t){return this.ky.get(this.stripSlashes(e),{searchParams:x(t)})}},{key:"post",value:function(e,t,n){const r=b(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=b(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=b(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=b(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+x(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function b(e,t){const n={searchParams:x(e)};var r;return void 0!==(r=t)&&"object"==typeof r&&null!==r&&r.constructor===Object||Array.isArray(t)?n.json=t:n.body=t,n}function x(e){return void 0===e&&(e={}),s.stringify(e,{arrayFormat:"comma"})}function S(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let T=l((function e(t){u(this,e),this.http=t})),j=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"createArcGisDataSource",value:function(e){return this.http.post("/ds/arcgis",e).then(()=>{})}},{key:"updateArcGisDataSource",value:function(e){return this.http.patch("/ds/arcgis",e).then(()=>{})}},{key:"getDataSourcesList",value:function(e){return this.http.get("/ds",e).json()}},{key:"createDataSource",value:function(e){return this.http.post("/ds",e).then(()=>{})}},{key:"updateDataSource",value:function(e){return this.http.patch("/ds",e).then(()=>{})}},{key:"getDataSource",value:function(e){return this.http.get("/ds/"+e).json()}},{key:"removeDataSource",value:function(e){return this.http.delete("/ds/"+e,null).then(()=>{})}},{key:"testConnection",value:function(e){return this.http.post("/ds/testConnection",e).json()}},{key:"createMosRuDataSource",value:function(e){return this.http.post("/ds/dataMosRu",e).then(()=>{})}},{key:"updateMosRuDataSource",value:function(e){return this.http.patch("/ds/dataMosRu",e).then(()=>{})}},{key:"createS3DataSource",value:function(e){return this.http.post("/ds/s3",e).then(()=>{})}},{key:"updateS3DataSource",value:function(e){return this.http.patch("/ds/s3",e).then(()=>{})}},{key:"createArcGisDataSource1",value:function(e){return this.http.post("/ds/wms",e).then(()=>{})}},{key:"updateArcGisDataSource1",value:function(e){return this.http.patch("/ds/wms",e).then(()=>{})}}]),n}();const w=["username"];let P=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getTokensList",value:function(e){let{username:t}=e,n=y(e,w);return this.http.get("/accessToken/list/"+t,n).json()}},{key:"createToken",value:function(e){return this.http.put("/accessToken/"+e,null).text()}},{key:"disableToken",value:function(e){return this.http.post("/accessToken/"+e+"/disable",null).then(()=>{})}},{key:"enableToken",value:function(e){return this.http.post("/accessToken/"+e+"/enable",null).then(()=>{})}},{key:"revokeToken",value:function(e){return this.http.delete("/accessToken/"+e,null).then(()=>{})}}]),n}(),R=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getAvailiableCs",value:function(){return this.http.get("/srs/list").json()}},{key:"getProj4Representation",value:function(e){return this.http.get("/srs/"+e+"/proj4").text()}},{key:"getWktRepresentation",value:function(e){return this.http.get("/srs/"+e+"/wkt").text()}}]),n}(),I=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getParents",value:function(e){return this.http.get("/resources/"+e+"/parents").json()}},{key:"getTags",value:function(e){return this.http.get("/resources/tags",e).json()}},{key:"putTags",value:function(e,t){return this.http.put("/resources/"+e+"/tags",t).json()}},{key:"postGetAll",value:function(e,t){return this.http.post("/resources",t,e).json()}},{key:"getResource",value:function(e){return this.http.get("/resources/"+e).json()}},{key:"patchResource",value:function(e,t){return this.http.patch("/resources/"+e,t).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/resources/"+e,null).then(()=>{})}},{key:"moveResource",value:function(e,t){return this.http.post("/resources/"+e+"/move",t).json()}},{key:"createDirectory",value:function(e){return this.http.post("/resources/directory",e).json()}},{key:"createFile",value:function(e){return this.http.patch("/resources/file",S(e)).json()}},{key:"createFile1",value:function(e){return this.http.post("/resources/file",S(e)).json()}},{key:"getPermissions",value:function(e){return this.http.get("/resources/"+e+"/permissions").json()}},{key:"setPermissions1",value:function(e,t){return this.http.put("/resources/"+e+"/permissions",t).then(()=>{})}},{key:"setPermissions",value:function(e){return this.http.put("/resources/permissions",e).then(()=>{})}},{key:"getFile",value:function(e){return this.http.get("/resources/file/"+e).blob()}},{key:"cleanResources",value:function(){return this.http.post("/resources/clean",null).then(()=>{})}},{key:"copyResources",value:function(e){return this.http.post("/resources/copy",e).json()}}]),n}();var C;(C=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",C.Unauthorized="Unauthorized",C.SessionClosed="SessionClosed";let E=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getUsers",value:function(e){return this.http.get("/account/user/list",e).json()}},{key:"getExtendedUsers",value:function(e){return this.http.get("/account/user/extendedlist",e).json()}},{key:"getUserInfo",value:function(){return this.http.get("/account").json()}},{key:"getUserInfo1",value:function(e){return this.http.get("/account/"+e).json()}},{key:"getExtendedUserInfo",value:function(){return this.http.get("/account/extended").json()}},{key:"getExtendedUserInfo1",value:function(e){return this.http.get("/account/extended/"+e).json()}},{key:"isUsernameExists",value:function(e){return this.http.get("/account/user/exists",e).json()}},{key:"isEmailExists",value:function(e){return this.http.get("/account/user/email/exists",e).json()}},{key:"registerUser",value:function(e){return this.http.post("/account/register",e).text()}},{key:"createUser",value:function(e,t){return this.http.post("/account/user",t,e).then(()=>{})}},{key:"updateUser",value:function(e){return this.http.patch("/account/user",e).then(()=>{})}},{key:"confirmEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/confirm",null).then(()=>{})}},{key:"verifyEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/verify",null).then(()=>{})}},{key:"setEmail",value:function(e){return this.http.post("/account/setEmail",S(e)).then(()=>{})}},{key:"confirmEmail1",value:function(e){return this.http.post("/account/user/email/confirm",null,e).then(()=>{})}},{key:"changeEmail",value:function(e){return this.http.post("/account/user/email/change",null,e).then(()=>{})}},{key:"confirmChangeEmail",value:function(e){return this.http.post("/account/user/email/change/confirm",null,e).then(()=>{})}},{key:"setUserPassword",value:function(e){return this.http.patch("/account/password/set",e).then(()=>{})}},{key:"changePassword",value:function(e){return this.http.patch("/account/password/change",S(e)).then(()=>{})}},{key:"resetPassword",value:function(e){return this.http.post("/account/password/reset",null,e).then(()=>{})}},{key:"resetPasswordCallback",value:function(e){return this.http.post("/account/password/reset/confirm",S(e)).then(()=>{})}},{key:"removeUser",value:function(e){return this.http.delete("/account/user/"+e,null).then(()=>{})}},{key:"activateUser",value:function(e){return this.http.post("/account/user/"+e+"/activate",null).then(()=>{})}},{key:"deactivateUser",value:function(e){return this.http.post("/account/user/"+e+"/deactivate",null).then(()=>{})}},{key:"authenticate",value:function(e,t){return this.http.post("/account/login",t,e).json()}},{key:"refreshToken",value:function(e){return this.http.post("/account/refresh-token",e).json()}},{key:"revokeToken",value:function(){return this.http.delete("/account/revoke-token",null).then(()=>{})}},{key:"ldapLogin",value:function(e){return this.http.post("/account/external/login/ldap",e).json()}},{key:"registerClient",value:function(e){return this.http.post("/account/oauth2/client",e).json()}},{key:"unbindClient",value:function(e){return this.http.delete("/account/oauth2/client/"+e,null).then(()=>{})}},{key:"token",value:function(e){return this.http.post("/account/oauth2/token",e).json()}},{key:"getRoles",value:function(e){return this.http.get("/account/role/list",e).json()}},{key:"createRole",value:function(e){return this.http.post("/account/role",e).then(()=>{})}},{key:"updateRole",value:function(e){return this.http.patch("/account/role",e).then(()=>{})}},{key:"removeRole",value:function(e){return this.http.delete("/account/role/"+e,null).then(()=>{})}},{key:"addToRole",value:function(e,t){return this.http.post("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"removeFromRole",value:function(e,t){return this.http.delete("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"postUsedProjects",value:function(e){return this.http.post("/account/latest_projects",e).json()}},{key:"getUsedProjects",value:function(){return this.http.get("/account/latest_projects").json()}},{key:"truncateUsedProjects",value:function(){return this.http.delete("/account/latest_projects",null).then(()=>{})}}]),n}();const L=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,F=e=>{if(e){const t=L();localStorage.setItem("@evergis/user-info",JSON.stringify(c({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let U=function(e){p(n,E);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"login",value:async function(e,t,r){if(void 0===t&&(t={}),void 0===r&&(r=!1),e){const o=await g(h(n.prototype),"authenticate",this).call(this,t,e);o&&r&&(window.localStorage.setItem("evergis-jwt-token",o.token),window.localStorage.setItem("evergis-refresh-token",o.refreshToken))}}},{key:"fetchCurrentUser",value:async function(){return this.userInfo=await this.getUserInfo(),this.userInfo}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"logout",value:async function(){window.localStorage.getItem("evergis-jwt-token")&&(window.localStorage.removeItem("evergis-jwt-token"),window.localStorage.removeItem("evergis-refresh-token")),await this.revokeToken(),F(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await g(h(n.prototype),"updateUser",this).call(this,c({username:this.username},e)),F(e)}},{key:"setPassword",value:function(e){return this.setUserPassword({username:this.username,password:e})}},{key:"isAuth",get:function(){var e;return!(null==(e=this.userInfo)||!e.username)&&"public"!==this.userInfo.username}},{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=L();return e&&(this.userInfo=e),e}}]),n}(),A=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getPreview",value:function(){return this.http.createUrl("/account/user/preview")}},{key:"uploadPreview",value:function(e){return this.http.post("/account/user/preview",S(e)).json()}},{key:"deletePreview",value:function(){return this.http.delete("/account/user/preview",null).then(()=>{})}},{key:"getPreview1",value:function(e){return this.http.createUrl("/account/user/preview/"+e)}},{key:"uploadPreview1",value:function(e,t){return this.http.post("/account/user/preview/"+e,S(t)).json()}},{key:"deletePreview1",value:function(e){return this.http.delete("/account/user/preview/"+e,null).then(()=>{})}}]),n}(),D=function(e){p(n,A);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),N=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),O=function(e){p(n,N);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const M=["cameraId"],B=["cameraId"],q=["cameraId"],W=["cameraId"],H=["cameraId"],_=["cameraId"];let G=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getCameras",value:function(e){return this.http.get("/cameras",e).json()}},{key:"getArchiveFeed",value:function(e){let{cameraId:t}=e,n=y(e,M);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=y(e,B);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=y(e,q);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=y(e,W);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=y(e,H);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}},{key:"getLivePreviewStream",value:function(e){let{cameraId:t}=e,n=y(e,_);return this.http.get("/cameras/"+t+"/getLivePreviewsStream",n).json()}}]),n}(),z=function(e){p(n,G);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),V=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getConfigurationsList",value:function(e){return this.http.get("/settings/config",e).json()}},{key:"getConfiguration",value:function(e){return this.http.get("/settings",e).text()}},{key:"setConfiguration",value:function(e,t){return this.http.post("/settings",t,e).then(()=>{})}},{key:"removeConfiguration",value:function(e){return this.http.delete("/settings",null,e).then(()=>{})}}]),n}(),Q=function(e){p(n,V);var t=d(n);function n(){var e;return u(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return l(n,[{key:"fetchClientSettings",value:async function(e){const t=JSON.parse(await this.getConfiguration(e));return this.updateClientSettings(t),t}},{key:"updateClientSettings",value:function(e){Object.assign(this.settings,e)}}]),n}(),J=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getFunctionsList",value:function(){return this.http.get("/eql/functions").json()}},{key:"getPagedQueryResult",value:function(e){return this.http.post("/eql/query",e).json()}},{key:"getQueryDescription",value:function(e){return this.http.post("/eql/description",e).json()}},{key:"setLayerParameterValue",value:function(e){return this.http.post("/eql/setParam",null,e).then(()=>{})}},{key:"setLayerParameters",value:function(e,t){return this.http.post("/eql/setParams",t,e).then(()=>{})}},{key:"getLayerParameters",value:function(e){return this.http.get("/eql/getParam",e).text()}},{key:"getLayerParameters1",value:function(e){return this.http.get("/eql/getParams",e).json()}},{key:"removeLayerParameterValue",value:function(e){return this.http.delete("/eql/removeParam",null,e).then(()=>{})}},{key:"getAvailiableLayerParameters",value:function(e){return this.http.get("/eql/getAvailiableParams",e).json()}}]),n}(),K=function(e){p(n,J);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),X=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"vkLogin",value:function(){return this.http.createUrl("/account/external/login/vk")}},{key:"googleLogin",value:function(){return this.http.createUrl("/account/external/login/google")}},{key:"facebookLogin",value:function(){return this.http.createUrl("/account/external/login/facebook")}},{key:"loginCallback",value:function(){return this.http.get("/account/external/login/callback").then(()=>{})}},{key:"unbindVk",value:function(){return this.http.delete("/account/external/unbind/vk",null).then(()=>{})}},{key:"unbindGoogle",value:function(){return this.http.delete("/account/external/unbind/google",null).then(()=>{})}},{key:"unbindFacebook",value:function(){return this.http.delete("/account/external/unbind/facebook",null).then(()=>{})}},{key:"bindVk",value:function(){return this.http.createUrl("/account/external/bind/vk")}},{key:"bindGoogle",value:function(){return this.http.createUrl("/account/external/bind/google")}},{key:"bindFacebook",value:function(){return this.http.createUrl("/account/external/bind/facebook")}},{key:"bindCallback",value:function(){return this.http.get("/account/external/bind/callback").then(()=>{})}}]),n}(),Y=function(e){p(n,X);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"login",value:function(e){switch(e){case"vk":return this.vkLogin();case"google":return this.googleLogin();case"facebook":return this.facebookLogin();default:return""}}},{key:"bind",value:function(e){switch(e){case"vk":return this.bindVk();case"google":return this.bindGoogle();case"facebook":return this.bindFacebook();default:return""}}},{key:"unbind",value:function(e){switch(e){case"vk":return this.unbindVk();case"google":return this.unbindGoogle();case"facebook":return this.unbindFacebook();default:return""}}}]),n}(),Z=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"increaseResourcesLimit",value:function(e){return this.http.post("/feedback/limits",null,e).json()}},{key:"moreSymbols",value:function(e){return this.http.post("/feedback/symbol",null,e).json()}},{key:"feedback",value:function(e,t){return this.http.post("/feedback",S(t),e).json()}}]),n}(),$=function(e){p(n,Z);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}(),ee=function(e){p(n,I);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"upload",value:function(e,t){return this.createFile1({file:e,rewrite:!!t})}},{key:"replaceFile",value:function(e){return this.createFile(e)}}]),n}(),te=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"get",value:function(e){return this.http.get("/filters/"+e).json()}},{key:"update",value:function(e,t){return this.http.post("/filters/"+e,t).json()}},{key:"create",value:function(e){return this.http.post("/filters",e).json()}}]),n}(),ne=function(e){p(n,te);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const re=["providerName"],oe=["providerName"],se=["providerName"];let ie=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=y(e,re);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=y(e,oe);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=y(e,se);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),ue=function(e){p(n,ie);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"geocode2Gis",value:function(e){return this.geocode(c({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(c({providerName:"geocode2gis"},e))}}]),n}(),ae=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"startTask",value:function(e){return this.http.post("/ice-router/tasks",e).text()}},{key:"getResult",value:function(e){return this.http.get("/ice-router/tasks/"+e).json()}}]),n}(),le=function(e){p(n,ae);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),ce=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getDataSchema",value:function(e){return this.http.get("/import/dataSchema",e).json()}},{key:"getFeaturesCount",value:function(e){return this.http.post("/import/count",e).json()}},{key:"readPart",value:function(e){return this.http.get("/import/read",e).then(()=>{})}},{key:"getExternalWmsLayers",value:function(e){return this.http.get("/import/wms",e).json()}},{key:"getExternalPbfLayers",value:function(e){return this.http.get("/import/pbf",e).json()}},{key:"getExternalPbfFeatures",value:function(e){return this.http.get("/import/pbf/features",e).json()}},{key:"getExternalArcgisFsLayers",value:function(e){return this.http.get("/import/arcgisfeatureservice",e).json()}},{key:"getExternalArcGisLayers",value:function(e){return this.http.get("/import/arcgismapservice",e).json()}},{key:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}},{key:"getRasterMeta",value:function(e){return this.http.get("/import/rasterMeta",e).json()}}]),n}(),pe=function(e){p(n,ce);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const he=["name"],ye=["name"],fe=["name","id"],ve=["name","id"],de=["name","id"],ke=["name","x","y","z"],ge=["name","x","y","z","format"],me=["name","x","y","z","dpi","format"],be=["name"],xe=["name"],Se=["name"],Te=["name"],je=["name"],we=["name"],Pe=["name"],Re=["name"],Ie=["layerName"],Ce=["name","id"];let Ee=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getBulkFeatures",value:function(e){return this.http.post("/bulk/layers/features/query",e).json()}},{key:"getBulkExtents",value:function(e,t){return this.http.post("/bulk/layers/extent",t,e).json()}},{key:"getFilteredFeaturesCount",value:function(e){return this.http.post("/bulk/layers/features/count",e).json()}},{key:"getLayersList",value:function(e){return this.http.get("/layers",e).json()}},{key:"deleteResources",value:function(e){return this.http.delete("/layers",null,e).json()}},{key:"getLayerInfo",value:function(e){return this.http.get("/layers/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/layers/"+e,null).then(()=>{})}},{key:"getLayersInfo",value:function(e){return this.http.get("/layers/batchInfo",e).json()}},{key:"publishMapboxService",value:function(e){return this.http.post("/layers",e,{type:"Mapbox"}).json()}},{key:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{key:"publishRouteService",value:function(e){return this.http.post("/layers",e,{type:"RouteService"}).then(()=>{})}},{key:"publishLinearService",value:function(e){return this.http.post("/layers",e,{type:"LinearService"}).then(()=>{})}},{key:"publishRemoteTileService",value:function(e){return this.http.post("/layers",e,{type:"RemoteTileService"}).json()}},{key:"publishQueryLayerService",value:function(e){return this.http.post("/layers",e,{type:"QueryLayerService"}).json()}},{key:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).json()}},{key:"publishPythonService",value:function(e){return this.http.post("/layers",e,{type:"Python"}).json()}},{key:"updateMapboxService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Mapbox"}).json()}},{key:"updatePythonService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Python"}).json()}},{key:"updateProxyService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"ProxyService"}).json()}},{key:"updateTileCatalogService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresTileLayerService"}).json()}},{key:"updateRemoteTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"RemoteTileService"}).json()}},{key:"updateQueryLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"QueryLayerService"}).json()}},{key:"reloadService",value:function(e){return this.http.get("/layers/"+e+"/reload").json()}},{key:"getFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures1",value:function(e){let{name:t}=e,n=y(e,he);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=y(e,ye);return this.http.delete("/layers/"+t+"/features",null,n).json()}},{key:"createFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features",t).json()}},{key:"updateFeature",value:function(e,t){return this.http.patch("/layers/"+e+"/features",t).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=y(e,fe);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,o=y(e,ve);return this.http.post("/layers/"+n+"/features/"+r+"/unite",t,o).json()}},{key:"subtract",value:function(e,t){let{name:n,id:r}=e,o=y(e,de);return this.http.post("/layers/"+n+"/features/"+r+"/subtract",t,o).json()}},{key:"getTilesLayerImage",value:function(e){let{name:t,x:n,y:r,z:o}=e,s=y(e,ke);return this.http.createUrl("/layers/"+t+"/tile/"+o+"/"+n+"/"+r,s)}},{key:"getTilesLayerImage1",value:function(e){let{name:t,x:n,y:r,z:o,format:s}=e,i=y(e,ge);return this.http.createUrl("/layers/"+t+"/tile/"+o+"/"+n+"/"+r+"."+s,i)}},{key:"getTilesLayerImageWithFormatAndDpi",value:function(e){let{name:t,x:n,y:r,z:o,dpi:s,format:i}=e,u=y(e,me);return this.http.createUrl("/layers/"+t+"/tile/"+o+"/"+n+"/"+r+"@"+s+"x."+i,u)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=y(e,be);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=y(e,xe);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=y(e,Se);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=y(e,Te);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=y(e,je);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=y(e,we);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=y(e,Pe);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount1",value:function(e){let{name:t}=e,n=y(e,Re);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"getFilteredFeaturesCount2",value:function(e,t){return this.http.post("/layers/"+e+"/features/count",t).json()}},{key:"editAttributes",value:function(e,t){return this.http.post("/layers/"+e+"/features/edit-attributes",t).json()}},{key:"validateExpression",value:function(e){let{layerName:t}=e,n=y(e,Ie);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=y(e,Ce);return this.http.get("/layers/"+t+"/"+n+"/metadata",r).json()}},{key:"createRoute",value:function(e,t){return this.http.post("/layers/"+e+"/createRoute",t).json()}},{key:"applyStyle",value:function(e,t){return this.http.put("/layers/"+e+"/style",t).then(()=>{})}},{key:"getStyle",value:function(e){return this.http.get("/layers/"+e+"/style").json()}},{key:"getImageLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.png").blob()}},{key:"getDataLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.json").then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/layers/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/layers/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/layers/"+e+"/references").json()}}]),n}();async function Le(e){return(await Promise.all(e.map(e=>e.catch(e=>Fe(e)?e:new Error(e))))).filter(Ue)}function Fe(e){return e instanceof Error}function Ue(e){return!Fe(e)}let Ae=function(e){p(n,Ee);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getLayerInfos",value:function(e){return Le(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return Le(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(c({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findMany",value:function(e,t){return this.getLayersInfo({layerNames:e,projectNames:t})}},{key:"findAll",value:function(e){return this.getLayersList(e)}},{key:"createQueryLayer",value:function(e){return this.publishQueryLayerService(e)}},{key:"updateQueryLayer",value:function(e){return this.updateQueryLayerService(e.name,e)}},{key:"createProxyLayer",value:function(e){return this.publishProxyService(e)}},{key:"updateProxyLayer",value:function(e){return this.updateProxyService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();var De;(De=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",De.HTTP_CLIENT="client",De.HTTP_SERVER="server",De.UNKNOWN="unknown";const Ne=e=>e instanceof n.HTTPError?(e=>{const t=e.response.status;let n=exports.ErrorReason.HTTP_OTHER;return t>=400&&t<500&&(n=exports.ErrorReason.HTTP_CLIENT),t>=500&&(n=exports.ErrorReason.HTTP_SERVER),{type:"http",reason:n,status:t,origin:e}})(e):(e=>({type:"base",reason:exports.ErrorReason.UNKNOWN,origin:e}))(e),Oe=e=>e&&e.type&&e.reason;function Me(e){return"string"==typeof e}const Be=e=>e===exports.UrlPath.Presentation?exports.UrlPath.Base:e;function qe(e,t,n){return n.indexOf(e)===t}const We=i.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let He=function(){function e(t){let{account:n}=t;u(this,e),this.account=n}return l(e,[{key:"createId",value:function(){return We()}},{key:"createResourceName",value:function(e){void 0===e&&(e={});const t=e.workspace||this.account.user&&this.account.user.namespace||"",n=e.name||this.createId(),r=e.separator||exports.ResourceSeparator.Server;return t||console.warn("Resource should have workspace. Check account api"),""+t+r+n}},{key:"createTempResourceName",value:function(e){return void 0===e&&(e={}),this.createResourceName(c({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const t=e.split(exports.ResourceSeparator.Server),n=t.pop();return{workspace:t.join(exports.ResourceSeparator.Server),name:n}}return{name:"",workspace:""}}},{key:"extractResourceName",value:function(e){return this.extractResource(e).name||e||""}},{key:"extractResourceWorkspace",value:function(e){return this.extractResource(e).workspace||""}}]),e}(),_e=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getSubscriptionList",value:function(){return this.http.get("/notifications/subscribes").json()}},{key:"subscribeOperation",value:function(e){return this.http.post("/notifications/subscribes",null,e).then(()=>{})}},{key:"unsubscribeOperation",value:function(e){return this.http.delete("/notifications/subscribes",null,e).then(()=>{})}},{key:"subscribeListOperation",value:function(e){return this.http.post("/notifications/subscribe-list",e).then(()=>{})}},{key:"unsubscribeListOperation",value:function(e){return this.http.post("/notifications/unsubscribe-list",e).then(()=>{})}}]),n}();var Ge;(Ge=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",Ge.Connected="Connected",Ge.Break="Break",Ge.Lost="Lost",Ge.SessionClosed="SessionClosed";let ze=function(e){p(r,_e);var n=d(r);function r(e,o,s){var i;return void 0===s&&(s=!1),u(this,r),(i=n.call(this,e)).api=o,i.MAX_WS_RECONNECT_TRIES=10,i.keepAlive=!1,i.reconnectTries=0,i.subscriptions=[],i._connectStatus=exports.ConnectionStatus.Initialized,i.onWsConnected=()=>{i.connectStatus=exports.ConnectionStatus.Connected,i.keepAlive&&(i.keepAliveTimeout=setInterval(()=>{i.ws&&i.ws.send(JSON.stringify({keepAlive:!0}))},5e3))},i.onWsClosed=e=>{4001===e.code||4002===e.code?i.connectStatus=exports.ConnectionStatus.SessionClosed:i.reconnectTries<i.MAX_WS_RECONNECT_TRIES?(i.connectStatus=exports.ConnectionStatus.Break,i.reconnectTries++,i.ws&&(i.ws.onopen=null,i.ws.onclose=null,i.ws.onmessage=null,i.ws=void 0),i.keepAliveTimeout&&clearInterval(i.keepAliveTimeout),setTimeout(()=>{i.connect()},0)):i.connectStatus=exports.ConnectionStatus.Lost},i.onWsMessage=e=>{let t={};try{t=JSON.parse(e.data)}catch(e){console.debug("Failed to parse ws message from sp.")}if("notification"===t.type&&t.data){const{tag:e,data:n}=t.data;e&&i.emitter.emit(e,new Ve(n))}},i.emitter=new t.EventEmitter,i.keepAlive=s,i}return l(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new Ve(e)),this._connectStatus=e}},{key:"currentWs",get:function(){return this.ws}},{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"subscribe",value:async function(e){this.subscriptions.push(e),setTimeout(()=>{this.api.isShared||this.api.isPresentation||!this.subscriptions.length||this.subscribeListOperation(this.subscriptions),this.subscriptions=[]},500)}},{key:"unsubscribe",value:async function(e){if((await this.getSubscriptionList()).includes(e))return this.unsubscribeOperation({tag:e})}},{key:"connectWs",value:function(e){const t=e.replace("http://","ws://").replace("https://","wss://");this.wsUrl=t,this.connect()}},{key:"connect",value:function(){this.wsUrl?(this.ws=new WebSocket(this.wsUrl),this.ws.onopen=this.onWsConnected,this.ws.onclose=this.onWsClosed,this.ws.onmessage=this.onWsMessage):console.warn("Connection to WebSocket not allowed. wsUrl not provided")}}]),r}(),Ve=l((function e(t){u(this,e),this.data=t})),Qe=function(e){p(n,V);var t=d(n);function n(){var e;return u(this,n),(e=t.apply(this,arguments)).config=null,e}return l(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}(),Je=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"print",value:function(e){return this.http.post("/print/print",e).then(()=>{})}},{key:"printToHtml",value:function(e){return this.http.post("/print/printHtml",e).text()}},{key:"uploadTemplate",value:function(e,t){return this.http.post("/print/templates",S(t),e).then(()=>{})}},{key:"getTemplates",value:function(){return this.http.get("/print/templates").json()}},{key:"deleteTemplate",value:function(e){return this.http.delete("/print/templates/"+e,null).then(()=>{})}},{key:"getTemplate",value:function(e){return this.http.get("/print/templates/"+e).text()}}]),n}(),Ke=function(e){p(n,Je);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const Xe=["name"];let Ye=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getProjectsList",value:function(e){return this.http.get("/projects",e).json()}},{key:"createProject",value:function(e){return this.http.post("/projects",e).json()}},{key:"deleteResources",value:function(e){return this.http.delete("/projects",null,e).json()}},{key:"updateProject",value:function(e,t){return this.http.patch("/projects/"+e,t).json()}},{key:"getProjectInfo",value:function(e){return this.http.get("/projects/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/projects/"+e,null).then(()=>{})}},{key:"getProjectsInfo",value:function(e){return this.http.get("/projects/batchInfo",e).json()}},{key:"getProjectEnvelope",value:function(e){let{name:t}=e,n=y(e,Xe);return this.http.get("/projects/"+t+"/extent",n).json()}},{key:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{key:"getTilesLayerImage",value:function(e,t,n,r){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n)}},{key:"getTilesLayerImageWithFormat",value:function(e,t,n,r,o){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n+"."+o)}},{key:"getTilesLayerImageWithFormatAndDpi",value:function(e,t,n,r,o,s){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n+"@"+o+"x."+s)}},{key:"isExists",value:function(e){return this.http.get("/projects/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/projects/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/projects/"+e+"/references").json()}}]),n}(),Ze=function(e){p(n,Ye);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getProjectInfos",value:function(e){return Le(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return Le(e.map(e=>this.getResourceDependencies(e)))}},{key:"findOne",value:function(e){return this.getProjectInfo(e)}},{key:"findAll",value:function(e){return this.getProjectsList(e)}},{key:"create",value:function(e){return this.createProject(e)}},{key:"update",value:function(e){return this.updateProject(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();const $e=["id"],et=["id"];let tt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"get",value:function(e){return this.http.get("/scheduler/task/"+e+"/subtasks").json()}},{key:"stop",value:function(e){return this.http.post("/scheduler/task/"+e+"/stop",null).text()}},{key:"createTaskPrototype",value:function(e){return this.http.post("/scheduler",e).text()}},{key:"getTaskPrototypes",value:function(e){return this.http.get("/scheduler",e).json()}},{key:"updateTaskPrototype",value:function(e,t){return this.http.put("/scheduler/"+e,t).text()}},{key:"delete",value:function(e){return this.http.delete("/scheduler/"+e,null).text()}},{key:"setEnable",value:function(e,t){return this.http.post("/scheduler/"+e+"/enable/"+t,null).text()}},{key:"getTasksForPrototype",value:function(e){let{id:t}=e,n=y(e,$e);return this.http.get("/scheduler/"+t+"/tasks",n).json()}},{key:"startTask",value:function(e,t){return this.http.post("/scheduler/"+e+"/start/"+t,null).json()}},{key:"startTask1",value:function(e){return this.http.post("/scheduler/"+e+"/start",null).json()}},{key:"getTaskResource",value:function(e){let{id:t}=e,n=y(e,et);return this.http.get("/scheduler/taskresource/"+t,n).json()}},{key:"createTaskResource",value:function(e){return this.http.post("/scheduler/taskresource",e).text()}},{key:"updatePythonTaskResource",value:function(e,t){return this.http.patch("/scheduler/taskresource/"+e,t,{type:"PythonTask"}).then(()=>{})}},{key:"updateSpTaskResource",value:function(e,t){return this.http.patch("/scheduler/taskresource/"+e,t,{type:"SpTask"}).then(()=>{})}},{key:"get1",value:function(){return this.http.get("/scheduler/worker").json()}},{key:"post",value:function(e){return this.http.post("/scheduler/worker",e).json()}},{key:"getWorker",value:function(e){return this.http.get("/scheduler/worker/"+e).json()}}]),n}(),nt=function(e){p(n,tt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();var rt;(rt=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",rt.Table="Table",rt.Project="Project";let ot=function(){function e(t,n,r){u(this,e),this.projects=t,this.layers=n,this.tables=r}return l(e,[{key:"getProjectInfosWithDeps",value:async function(e){const t=await this.projects.getProjectInfos(e),n=await this.projects.getProjectsDeps(e),{layers:r,tables:o}=await this.getDependencies(n,!0,!0);return{projects:t,deps:{layers:r,tables:o}}}},{key:"getLayerInfosWithDeps",value:async function(e){const t=await this.layers.getLayerInfos(e),n=await this.layers.getLayersDeps(e),{tables:r}=await this.getDependencies(n,!1,!0);return{layers:t,deps:{tables:r}}}},{key:"getDependencies",value:async function(e,t,n){const{tables:r,layers:o}=e.reduce((e,r)=>{const o=r.dependencies||[];if(t){const t=this.getDependentNames(o,exports.DependencyType.Layer);e.layers.push(...t)}if(n){const t=this.getDependentNames(o,exports.DependencyType.Table);e.tables.push(...t)}return e},{tables:[],layers:[]});return{tables:await this.tables.getTableInfos(r.filter(qe)),layers:await this.layers.getLayerInfos(o.filter(qe))}}},{key:"getDependentNames",value:function(e,t){return e.filter(e=>{let{type:n}=e;return n===t}).map(e=>{let{name:t}=e;return t}).filter(Me)}}]),e}(),st=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"setPolicies",value:function(e){return this.http.post("/bulk/security/policies",e).then(()=>{})}},{key:"findUserByNameByRoles",value:function(e){return this.http.get("/security/findUsersWithRoles",e).json()}},{key:"getUsersAndRoles",value:function(e){return this.http.get("/security/usersandroles",e).json()}},{key:"findUserByName",value:function(e){return this.http.get("/security/users",e).json()}},{key:"getPolicyList",value:function(e){return this.http.get("/security/policies",e).json()}},{key:"removePolicy",value:function(e){return this.http.delete("/security/policies",null,e).then(()=>{})}},{key:"setPolicy",value:function(e){return this.http.post("/security/policies",e).then(()=>{})}},{key:"oldCheckLimits",value:function(){return this.http.get("/resources/checkLimits").json()}},{key:"oldCheckLimits1",value:function(e){return this.http.get("/resources/checkLimits/"+e).json()}},{key:"checkLimitsForUser",value:function(){return this.http.get("/security/limits/user").json()}},{key:"checkLimitsForUser1",value:function(e){return this.http.get("/security/limits/user/"+e).json()}},{key:"checkLimitsForRole",value:function(e){return this.http.get("/security/limits/role/"+e).json()}},{key:"getDefaultLimits",value:function(){return this.http.get("/security/limits/default").json()}}]),n}(),it=function(e){p(n,st);var t=d(n);function n(e,r){var o;let{username:s,roles:i}=r;return u(this,n),(o=t.call(this,e)).ownerName="",o.ownerRoles=[],o.ownerName=s,o.ownerRoles=i,o}return l(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),ut=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"statisticsDb1",value:function(e){return this.http.post("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"classify1",value:function(e){return this.http.post("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}},{key:"sumOfProduct1",value:function(e){return this.http.post("/statistics/sumOfProduct",e).json()}}]),n}(),at=function(e){p(n,ut);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"postStatistic",value:function(e){return this.statisticsDb1(e)}},{key:"getClassify",value:function(e){return this.classify(e)}},{key:"postClassify",value:function(e){return this.classify1(e)}}]),n}(),lt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getStyle",value:function(e){return this.http.get("/styles/"+e).json()}},{key:"updateStyle",value:function(e,t){return this.http.post("/styles/"+e,t).json()}},{key:"createStyle",value:function(e){return this.http.post("/styles",e).json()}},{key:"getAllFonts",value:function(){return this.http.get("/styles/fonts").json()}},{key:"addFont",value:function(e){return this.http.post("/styles/fonts",S(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),ct=function(e){p(n,lt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const pt=["name"],ht=["name"],yt=["name"];let ft=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getTableList",value:function(e){return this.http.get("/tables",e).json()}},{key:"createTable",value:function(e){return this.http.post("/tables",e).json()}},{key:"deleteResources",value:function(e){return this.http.delete("/tables",null,e).json()}},{key:"updateTable",value:function(e,t){return this.http.patch("/tables/"+e,t).json()}},{key:"putTable",value:function(e,t){return this.http.put("/tables/"+e,t).json()}},{key:"getTableInfo",value:function(e){return this.http.get("/tables/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/tables/"+e,null).then(()=>{})}},{key:"getTablesInfo",value:function(e){return this.http.get("/tables/batchInfo",e).json()}},{key:"getTableData",value:function(e){let{name:t}=e,n=y(e,pt);return this.http.get("/tables/"+t+"/data",n).json()}},{key:"writeTableData",value:function(e,t){return this.http.post("/tables/"+e+"/data",t).then(()=>{})}},{key:"updateTableData",value:function(e,t){let{name:n}=e,r=y(e,ht);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=y(e,yt);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"mapTable",value:function(e,t){return this.http.post("/tables/map-table",t,e).json()}},{key:"unmapTable",value:function(e){return this.http.delete("/tables/map-table/"+e,null).then(()=>{})}},{key:"createViewFromQueryLayer",value:function(e){return this.http.post("/tables/fromLayer",e).json()}},{key:"createViewFromQuery",value:function(e){return this.http.post("/tables/fromQuery",e).json()}},{key:"isExists",value:function(e){return this.http.get("/tables/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/tables/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/tables/"+e+"/references").json()}}]),n}(),vt=function(e){p(n,ft);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getTableInfos",value:function(e){return Le(e.map(e=>this.getTableInfo(e)))}},{key:"findOne",value:function(e){return this.getTableInfo(e)}},{key:"findAll",value:function(e){return this.getTableList(e)}},{key:"create",value:function(e){return this.createTable(e)}},{key:"update",value:function(e){return this.updateTable(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),dt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),kt=function(e){p(n,dt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const gt=["name","z","x","y"];let mt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getVectorTile",value:function(e){let{name:t,z:n,x:r,y:o}=e,s=y(e,gt);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+o+".pbf",s).then(()=>{})}}]),n}(),bt=function(e){p(n,mt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getVt",value:function(e,t,n,r){return this.getVectorTile({name:e,z:t,x:n,y:r})}}]),n}();var xt;(xt=exports.UrlPath||(exports.UrlPath={})).Base="/map",xt.Shared="/shared",xt.Presentation="/presentation",xt.Portal="/portal";const St={401:exports.ApiEvent.Unauthorized},Tt=Object.values(exports.UrlPath),jt=Tt[0];let wt=function(e){p(s,t.EventEmitter);var r=d(s);function s(e){var t,i;let{url:a,wsUrl:l,wsKeepAlive:p,snappingHubUrl:h,http:y,urlPath:v,httpOptions:d}=e;u(this,s),i=r.call(this);const{hooks:k}=d||{};return i.http=y||new m(c({prefixUrl:a,timeout:!1,retry:{methods:["get","post","delete"],limit:5,statusCodes:[401]}},d||{},{hooks:c({},k||{},{beforeRequest:[e=>{const t=window.localStorage.getItem("evergis-jwt-token");var n;t&&(null==(n=e.headers)||n.set("Authorization","Bearer "+(t||"")))},...null!=(t=null==k?void 0:k.beforeRequest)?t:[]],beforeRetry:[async e=>{let{request:t,error:r,retryCount:o}=e;if(r instanceof n.HTTPError&&401===r.response.status&&1===o)try{const e=window.localStorage.getItem("evergis-refresh-token");if(e){var s;const n=await i.account.refreshToken({refreshToken:e});n&&(window.localStorage.setItem("evergis-jwt-token",n.token),window.localStorage.setItem("evergis-refresh-token",n.refreshToken)),null==(s=t.headers)||s.set("Authorization","Bearer "+(n.token||""))}}catch(r){throw new Error("Failed to refresh token")}}],afterResponse:[(e,t,r)=>{const o=St[null==r?void 0:r.status];return o&&i.emit(o,Ne(new n.HTTPError(r,e,t))),r},...(null==k?void 0:k.afterResponse)||[]]})})),i.url=a,i.wsUrl=l||a,i.urlPath=v||i.defineUrlPath(),i.layers=new Ae(i.http),i.tables=new vt(i.http),i.projects=new Ze(i.http),i.resources=new ot(i.projects,i.layers,i.tables),i.styles=new ct(i.http),i.account=new U(i.http),i.accountPreview=new D(i.http),i.bulk=new O(i.http),i.security=new it(i.http,i.account),i.notification=new ze(i.http,f(i),p),i.file=new ee(i.http),i.filters=new ne(i.http),i.import=new pe(i.http),i.geocode=new ue(i.http),i.cameras=new z(i.http),i.print=new Ke(i.http),i.tools=new kt(i.http),i.external=new Y(i.http),i.clientSettings=new Q(i.http),i.portalSettings=new Qe(i.http),i.iceRouter=new le(i.http),i.statistic=new at(i.http),i.feedback=new $(i.http),i.vectorTiles=new bt(i.http),i.spatialReference=new R(i.http),i.eql=new K(i.http),i.catalog=new I(i.http),i.queryToken=new P(i.http),i.dataSource=new j(i.http),i.remoteTaskManager=new nt(i.http),i.names=new He({account:i.account}),i.snappingHub=h?(new o.HubConnectionBuilder).withUrl(h,{withCredentials:!0,skipNegotiation:!0,transport:o.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,i}return l(s,[{key:"init",value:async function(e){let{authParams:t,authQueryParams:n,connectWs:r,fetchSettings:o,fetchUser:s,useJwt:i}=e;try{await this.account.login(t,n,i),s&&await this.account.fetchCurrentUser(),r&&await this.connectWs(),o&&await this.clientSettings.fetchClientSettings({urlPath:Be(this.urlPath)}),await this.notification.subscribe("service_update")}catch(e){throw Ne(e)}}},{key:"isAcceptedNetwork",value:function(e){return["vk","google","facebook"].includes(e)}},{key:"socAuthLogin",value:async function(e){if(this.isAcceptedNetwork(e))try{await this.clientSettings.fetchClientSettings({urlPath:exports.UrlPath.Base})}catch(e){throw Ne(e)}}},{key:"connectWs",value:async function(){this.account.isAuth&&(this.notification.connectWs(this.wsUrl),this.notification.on("ConnectionStatus",e=>{e.data===exports.ConnectionStatus.Lost?this.emit(exports.ApiEvent.ConnectionLost,e.data):e.data===exports.ConnectionStatus.SessionClosed&&this.emit(exports.ApiEvent.SessionClosed,e.data)}))}},{key:"connectSignalR",value:async function(){this.account.isAuth&&this.snappingHub&&this.snappingHub.state!==o.HubConnectionState.Connected&&await this.snappingHub.start()}},{key:"logout",value:async function(){await this.account.logout(),await this.security.reset(),this.emit(exports.ApiEvent.Unauthorized,null)}},{key:"defineUrlPath",value:function(){const e=(window.location.href.split(window.location.hostname)[1]||"").split("/").filter(Boolean)[0],t=e?"/"+e:void 0;return t&&Tt.includes(t)?t:jt}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}},{key:"isPresentation",get:function(){return this.urlPath===exports.UrlPath.Presentation||"8082"===window.location.port}}]),s}();var Pt,Rt,It,Ct,Et,Lt,Ft,Ut,At,Dt,Nt,Ot,Mt,Bt,qt,Wt,Ht,_t,Gt,zt,Vt,Qt,Jt,Kt,Xt,Yt,Zt,$t,en,tn,nn,rn,on,sn,un,an,ln;(Pt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",Pt.Array="Array",Pt.Min="Min",Pt.Max="Max",Pt.Avg="Avg",Pt.Sum="Sum",Pt.Extent="Extent",Pt.H3="H3",Pt.Count="Count",Pt.TotalCount="TotalCount",Pt.DistinctCount="DistinctCount",Pt.First="First",Pt.Last="Last",Pt.Median="Median",Pt.Mod="Mod",Pt.StdDeviation="StdDeviation",Pt.SumOfProduct="SumOfProduct",Pt.OnlyValue="OnlyValue",Pt.WeightedAvg="WeightedAvg",Pt.DensityIndicators="DensityIndicators",Pt.DividedSum="DividedSum",(Rt=exports.AttributeIconType||(exports.AttributeIconType={})).Unknown="Unknown",Rt.Icon="Icon",Rt.PNG="PNG",Rt.SVG="SVG",(It=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",It.SelectFromHandBook="SelectFromHandBook",It.SelectFromRange="SelectFromRange",It.ViewHandBook="ViewHandBook",(Ct=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",Ct.String="String",Ct.Int32="Int32",Ct.Int64="Int64",Ct.Double="Double",Ct.DateTime="DateTime",Ct.Boolean="Boolean",Ct.Point="Point",Ct.Polyline="Polyline",Ct.MultiPolygon="MultiPolygon",Ct.Multipoint="Multipoint",Ct.H3Index="H3Index",Ct.Json="Json",(Et=exports.AuthorizationGrant||(exports.AuthorizationGrant={})).AuthorizationCode="authorization_code",Et.RefreshToken="refresh_token",(Lt=exports.CatalogResourceType||(exports.CatalogResourceType={})).Directory="Directory",Lt.Map="Map",Lt.Layer="Layer",Lt.Table="Table",Lt.File="File",Lt.TaskPrototype="TaskPrototype",Lt.DataSource="DataSource",(Ft=exports.ClassificationType||(exports.ClassificationType={})).None="none",Ft.NaturalBreaks="naturalBreaks",Ft.EqualInterval="equalInterval",Ft.Quantile="quantile",Ft.Unique="unique",(Ut=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",Ut.DateTime="dateTime",Ut.Text="text",(At=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",At.SerializeError="SerializeError",At.InvalidDataService="InvalidDataService",At.InvalidConfiguration="InvalidConfiguration",At.InvalidDataServiceName="InvalidDataServiceName",At.InvalidTableName="InvalidTableName",At.InvalidLayerName="InvalidLayerName",At.ResourceNotFound="ResourceNotFound",At.InvalidCondition="InvalidCondition",At.InvalidAttributes="InvalidAttributes",At.InvalidIdAttribute="InvalidIdAttribute",At.InvalidGeometryAttribute="InvalidGeometryAttribute",At.InvalidGeometryAttributeType="InvalidGeometryAttributeType",At.InvalidColumnName="InvalidColumnName",At.InvalidIdColumnSettings="InvalidIdColumnSettings",At.ColumnNotExistsInTable="ColumnNotExistsInTable",At.InvalidStyle="InvalidStyle",At.InvalidLayerType="InvalidLayerType",At.ColumnLoadingError="ColumnLoadingError",At.InvalidAttributeFormat="InvalidAttributeFormat",At.DataSourceNotFound="DataSourceNotFound",At.DuplicateColumns="DuplicateColumns",At.DuplicateAttributes="DuplicateAttributes",At.TableWithoutColumns="TableWithoutColumns",At.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(Dt=exports.DataSourceType||(exports.DataSourceType={})).Postgres="Postgres",Dt.Trino="Trino",Dt.S3="S3",Dt.GisServer="GisServer",(Nt=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",Nt.ResourceNotFound="ResourceNotFound",Nt.InternalError="InternalError",Nt.BadRequest="BadRequest",Nt.DuplicateContent="DuplicateContent",(Ot=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",Ot.LimitError="LimitError",Ot.ValidationError="ValidationError",Ot.JwtExpired="JwtExpired",Ot.TokenInvalid="TokenInvalid",Ot.RefreshTokenExpired="RefreshTokenExpired",Ot.RefreshTokenInvalid="RefreshTokenInvalid",Ot.CreateUserFailed="CreateUserFailed",Ot.SetUserPasswordFailed="SetUserPasswordFailed",Ot.SetUserRoleFailed="SetUserRoleFailed",Ot.UpdateUserFailed="UpdateUserFailed",Ot.RemoveUserFailed="RemoveUserFailed",Ot.CreateRoleFailed="CreateRoleFailed",Ot.UpdateRoleFailed="UpdateRoleFailed",Ot.RemoveUserRoleFailed="RemoveUserRoleFailed",Ot.ChangeActiveStateFailed="ChangeActiveStateFailed",Ot.RemoveRoleFailed="RemoveRoleFailed",Ot.UserNotFound="UserNotFound",Ot.RoleNotFound="RoleNotFound",Ot.EmailNotConfirmed="EmailNotConfirmed",Ot.DuplicateEmailError="DuplicateEmailError",Ot.InvalidPassword="InvalidPassword",Ot.RoleExists="RoleExists",Ot.UserExists="UserExists",Ot.UserLockedError="UserLockedError",Ot.InvalidEmail="InvalidEmail",Ot.InvalidUsername="InvalidUsername",Ot.Unauthorized="Unauthorized",Ot.EmailNotChanged="EmailNotChanged",Ot.EmailNotSet="EmailNotSet",(Mt=exports.FontStyle||(exports.FontStyle={})).Normal="normal",Mt.Oblique="oblique",Mt.Italic="italic",(Bt=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",Bt.ExtraLight="ExtraLight",Bt.Light="Light",Bt.SemiLight="SemiLight",Bt.Normal="Normal",Bt.Medium="Medium",Bt.DemiBold="DemiBold",Bt.Bold="Bold",Bt.ExtraBold="ExtraBold",Bt.Black="Black",Bt.ExtraBlack="ExtraBlack",(qt=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",qt.Point="point",qt.Polyline="polyline",qt.Polygon="multipolygon",qt.Envelope="envelope",qt.Multipoint="multipoint",(Wt=exports.Group||(exports.Group={})).My="my",Wt.Role="role",Wt.Public="public",Wt.All="all",(Ht=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",Ht.Square="Square",Ht.Round="Round",Ht.Triangle="Triangle",(_t=exports.LineEndingType||(exports.LineEndingType={})).None="none",_t.Arrow="arrow",_t.FilledArrow="filledArrow",_t.Square="square",_t.FilledSquare="filledSquare",_t.Circle="circle",_t.FilledCircle="filledCircle",_t.Diamond="diamond",_t.FilledDiamond="filledDiamond",_t.RoundSquare="roundSquare",_t.FilledRoundSquare="filledRoundSquare",_t.Svg="svg",(Gt=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",Gt.Bevel="Bevel",Gt.Round="Round",(zt=exports.OwnerFilter||(exports.OwnerFilter={})).My="My",zt.Shared="Shared",zt.Public="Public",(Vt=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",Vt.TMS="tms",(Qt=exports.Permissions||(exports.Permissions={})).None="none",Qt.Configure="configure",Qt.Write="write",Qt.Read="read",Qt.ReadConfigure="read,configure",Qt.ReadWrite="read,write",Qt.All="read,write,configure",(Jt=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",Jt.CreateTable="CreateTable",Jt.CreateLayer="CreateLayer",Jt.CreateProject="CreateProject",Jt.MaxFeaturesInOneTable="MaxFeaturesInOneTable",Jt.MaxObjectsToExport="MaxObjectsToExport",Jt.MaxUploadContentSize="MaxUploadContentSize",Jt.MaxEqlQueryParametersValues="MaxEqlQueryParametersValues",(Kt=exports.Quality||(exports.Quality={})).Low="Low",Kt.Medium="Medium",Kt.High="High",(Xt=exports.RemoteTaskStatus||(exports.RemoteTaskStatus={})).Init="Init",Xt.Process="Process",Xt.Completed="Completed",Xt.Interrupted="Interrupted",Xt.Error="Error",Xt.Timeout="Timeout",Xt.Waiting="Waiting",Xt.InQueue="InQueue",Xt.Unknown="Unknown",(Yt=exports.ResourceSubTypeFilter||(exports.ResourceSubTypeFilter={})).RemoteTileService="RemoteTileService",Yt.ProxyService="ProxyService",Yt.PostgresLayerService="PostgresLayerService",Yt.QueryLayerService="QueryLayerService",Yt.TileCatalogTable="TileCatalogTable",(Zt=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",Zt.Table="table",Zt.Layer="layer",Zt.Project="project",Zt.File="file",Zt.Feature="feature",Zt.Tag="tag",Zt.DataSource="datasource",($t=exports.ResourceTypeFilter||(exports.ResourceTypeFilter={})).Map="Map",$t.Layer="Layer",$t.Table="Table",$t.RasterCatalog="RasterCatalog",$t.ProxyService="ProxyService",$t.RemoteTileService="RemoteTileService",$t.File="File",$t.DataSource="DataSource",$t.TaskPrototype="TaskPrototype",(en=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",en.Layer="layers",en.Project="projects",(tn=exports.ResponseType||(exports.ResponseType={})).Code="code",tn.Token="token",(nn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",nn.PreserveTopology="PreserveTopology",nn.VW="VW",(rn=exports.StringSubType||(exports.StringSubType={})).None="None",rn.Image="Image",rn.PkkCode="PkkCode",rn.Attachments="Attachments",(on=exports.TaskResourceSubType||(exports.TaskResourceSubType={})).SpTask="SpTask",on.PythonTask="PythonTask",(sn=exports.TextAlignment||(exports.TextAlignment={})).Right="right",sn.Left="left",sn.Center="center",sn.Justified="justified",(un=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",un.Bottom="bottom",un.Middle="middle",(an=exports.WorkerMethodType||(exports.WorkerMethodType={})).Task="Task",an.Rest="Rest",an.Both="Both",(ln=exports.WorkerSettingsFieldType||(exports.WorkerSettingsFieldType={})).Int32="Int32",ln.Int64="Int64",ln.Double="Double",ln.String="String",ln.Boolean="Boolean",ln.DateTime="DateTime",ln.Point="Point",ln.Geometry="Geometry",ln.Polyline="Polyline",ln.MultiPolygon="MultiPolygon",ln.Polygon="Polygon",ln.Multipoint="Multipoint",ln.IntergerArray="IntergerArray",ln.DoubleArray="DoubleArray",ln.StringArray="StringArray",ln.SourceEql="SourceEql",ln.Layer="Layer",ln.Table="Table",ln.Folder="Folder",ln.Json="Json",ln.Attribute="Attribute",ln.AttributeArray="AttributeArray",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return n.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return n.TimeoutError}}),exports.Account=U,exports.AccountPreview=D,exports.Api=wt,exports.BulkOperations=O,exports.Cameras=z,exports.ClientSettings=Q,exports.Eql=K,exports.External=Y,exports.Feedback=$,exports.FileUpload=ee,exports.Filters=ne,exports.GEOCODE_PROVIDER="geocode2gis",exports.Geocode=ue,exports.HttpClient=m,exports.IceRouter=le,exports.Import=pe,exports.Layers=Ae,exports.Names=He,exports.Notification=ze,exports.NotificationEvent=Ve,exports.PortalSettings=Qe,exports.Print=Ke,exports.Projects=Ze,exports.RemoteTaskManager=nt,exports.Resources=ot,exports.STORAGE_REFRESH_TOKEN_KEY="evergis-refresh-token",exports.STORAGE_TOKEN_KEY="evergis-jwt-token",exports.Security=it,exports.Statistic=at,exports.Styles=ct,exports.Tables=vt,exports.Tools=kt,exports.VectorTiles=bt,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=Ne,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=We,exports.getFetchingUrlPath=Be,exports.isHTTPError=e=>Oe(e)&&"http"===e.type,exports.isHandledError=Oe,exports.isProjectContentItems=function(e){return null!=e},exports.isString=Me,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.parseJwt=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(e=>"%"+"00".concat(e.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(n)},exports.promiseAllIgnoreErrors=Le,exports.stripUselessSlashes=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("/").split("/").filter(Boolean).join("/")},exports.toFormData=S,exports.unique=qe;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("ky"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("@microsoft/signalr"),s=require("query-string"),i=require("nanoid");function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function k(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}function g(){return(g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=k(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(this,arguments)}let m=function(){function e(t){var n;void 0===t&&(t={}),u(this,e),this.ky=r.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return l(e,[{key:"extend",value:function(e){var t;this.ky=r.extend(e),this.prefixUrl=(null==(t=e.prefixUrl)?void 0:t.toString())||""}},{key:"get",value:function(e,t){return this.ky.get(this.stripSlashes(e),{searchParams:x(t)})}},{key:"post",value:function(e,t,n){const r=b(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=b(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=b(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=b(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+x(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function b(e,t){const n={searchParams:x(e)};var r;return void 0!==(r=t)&&"object"==typeof r&&null!==r&&r.constructor===Object||Array.isArray(t)?n.json=t:n.body=t,n}function x(e){return void 0===e&&(e={}),s.stringify(e,{arrayFormat:"comma"})}function S(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let T=l((function e(t){u(this,e),this.http=t})),j=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"createArcGisDataSource",value:function(e){return this.http.post("/ds/arcgis",e).then(()=>{})}},{key:"updateArcGisDataSource",value:function(e){return this.http.patch("/ds/arcgis",e).then(()=>{})}},{key:"getDataSourcesList",value:function(e){return this.http.get("/ds",e).json()}},{key:"createDataSource",value:function(e){return this.http.post("/ds",e).then(()=>{})}},{key:"updateDataSource",value:function(e){return this.http.patch("/ds",e).then(()=>{})}},{key:"getDataSource",value:function(e){return this.http.get("/ds/"+e).json()}},{key:"removeDataSource",value:function(e){return this.http.delete("/ds/"+e,null).then(()=>{})}},{key:"testConnection",value:function(e){return this.http.post("/ds/testConnection",e).json()}},{key:"createMosRuDataSource",value:function(e){return this.http.post("/ds/dataMosRu",e).then(()=>{})}},{key:"updateMosRuDataSource",value:function(e){return this.http.patch("/ds/dataMosRu",e).then(()=>{})}},{key:"createS3DataSource",value:function(e){return this.http.post("/ds/s3",e).then(()=>{})}},{key:"updateS3DataSource",value:function(e){return this.http.patch("/ds/s3",e).then(()=>{})}},{key:"createArcGisDataSource1",value:function(e){return this.http.post("/ds/wms",e).then(()=>{})}},{key:"updateArcGisDataSource1",value:function(e){return this.http.patch("/ds/wms",e).then(()=>{})}}]),n}();const w=["username"];let P=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getTokensList",value:function(e){let{username:t}=e,n=y(e,w);return this.http.get("/accessToken/list/"+t,n).json()}},{key:"createToken",value:function(e){return this.http.put("/accessToken/"+e,null).text()}},{key:"disableToken",value:function(e){return this.http.post("/accessToken/"+e+"/disable",null).then(()=>{})}},{key:"enableToken",value:function(e){return this.http.post("/accessToken/"+e+"/enable",null).then(()=>{})}},{key:"revokeToken",value:function(e){return this.http.delete("/accessToken/"+e,null).then(()=>{})}}]),n}(),R=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getAvailiableCs",value:function(){return this.http.get("/srs/list").json()}},{key:"getProj4Representation",value:function(e){return this.http.get("/srs/"+e+"/proj4").text()}},{key:"getWktRepresentation",value:function(e){return this.http.get("/srs/"+e+"/wkt").text()}}]),n}(),I=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getParents",value:function(e){return this.http.get("/resources/"+e+"/parents").json()}},{key:"getTags",value:function(e){return this.http.get("/resources/tags",e).json()}},{key:"putTags",value:function(e,t){return this.http.put("/resources/"+e+"/tags",t).json()}},{key:"postGetAll",value:function(e,t){return this.http.post("/resources",t,e).json()}},{key:"getResource",value:function(e){return this.http.get("/resources/"+e).json()}},{key:"patchResource",value:function(e,t){return this.http.patch("/resources/"+e,t).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/resources/"+e,null).then(()=>{})}},{key:"moveResource",value:function(e,t){return this.http.post("/resources/"+e+"/move",t).json()}},{key:"createDirectory",value:function(e){return this.http.post("/resources/directory",e).json()}},{key:"createFile",value:function(e){return this.http.patch("/resources/file",S(e)).json()}},{key:"createFile1",value:function(e){return this.http.post("/resources/file",S(e)).json()}},{key:"getPermissions",value:function(e){return this.http.get("/resources/"+e+"/permissions").json()}},{key:"setPermissions1",value:function(e,t){return this.http.put("/resources/"+e+"/permissions",t).then(()=>{})}},{key:"setPermissions",value:function(e){return this.http.put("/resources/permissions",e).then(()=>{})}},{key:"getFile",value:function(e){return this.http.get("/resources/file/"+e).blob()}},{key:"cleanResources",value:function(){return this.http.post("/resources/clean",null).then(()=>{})}},{key:"copyResources",value:function(e){return this.http.post("/resources/copy",e).json()}}]),n}();var C;(C=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",C.Unauthorized="Unauthorized",C.SessionClosed="SessionClosed";let E=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getUsers",value:function(e){return this.http.get("/account/user/list",e).json()}},{key:"getExtendedUsers",value:function(e){return this.http.get("/account/user/extendedlist",e).json()}},{key:"getUserInfo",value:function(){return this.http.get("/account").json()}},{key:"getUserInfo1",value:function(e){return this.http.get("/account/"+e).json()}},{key:"getExtendedUserInfo",value:function(){return this.http.get("/account/extended").json()}},{key:"getExtendedUserInfo1",value:function(e){return this.http.get("/account/extended/"+e).json()}},{key:"isUsernameExists",value:function(e){return this.http.get("/account/user/exists",e).json()}},{key:"isEmailExists",value:function(e){return this.http.get("/account/user/email/exists",e).json()}},{key:"registerUser",value:function(e){return this.http.post("/account/register",e).text()}},{key:"createUser",value:function(e,t){return this.http.post("/account/user",t,e).then(()=>{})}},{key:"updateUser",value:function(e){return this.http.patch("/account/user",e).then(()=>{})}},{key:"confirmEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/confirm",null).then(()=>{})}},{key:"verifyEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/verify",null).then(()=>{})}},{key:"setEmail",value:function(e){return this.http.post("/account/setEmail",S(e)).then(()=>{})}},{key:"confirmEmail1",value:function(e){return this.http.post("/account/user/email/confirm",null,e).then(()=>{})}},{key:"changeEmail",value:function(e){return this.http.post("/account/user/email/change",null,e).then(()=>{})}},{key:"confirmChangeEmail",value:function(e){return this.http.post("/account/user/email/change/confirm",null,e).then(()=>{})}},{key:"setUserPassword",value:function(e){return this.http.patch("/account/password/set",e).then(()=>{})}},{key:"changePassword",value:function(e){return this.http.patch("/account/password/change",S(e)).then(()=>{})}},{key:"resetPassword",value:function(e){return this.http.post("/account/password/reset",null,e).then(()=>{})}},{key:"resetPasswordCallback",value:function(e){return this.http.post("/account/password/reset/confirm",S(e)).then(()=>{})}},{key:"removeUser",value:function(e){return this.http.delete("/account/user/"+e,null).then(()=>{})}},{key:"activateUser",value:function(e){return this.http.post("/account/user/"+e+"/activate",null).then(()=>{})}},{key:"deactivateUser",value:function(e){return this.http.post("/account/user/"+e+"/deactivate",null).then(()=>{})}},{key:"authenticate",value:function(e,t){return this.http.post("/account/login",t,e).json()}},{key:"refreshToken",value:function(e){return this.http.post("/account/refresh-token",e).json()}},{key:"revokeToken",value:function(){return this.http.delete("/account/revoke-token",null).then(()=>{})}},{key:"ldapLogin",value:function(e){return this.http.post("/account/external/login/ldap",e).json()}},{key:"registerClient",value:function(e){return this.http.post("/account/oauth2/client",e).json()}},{key:"unbindClient",value:function(e){return this.http.delete("/account/oauth2/client/"+e,null).then(()=>{})}},{key:"token",value:function(e){return this.http.post("/account/oauth2/token",e).json()}},{key:"getRoles",value:function(e){return this.http.get("/account/role/list",e).json()}},{key:"createRole",value:function(e){return this.http.post("/account/role",e).then(()=>{})}},{key:"updateRole",value:function(e){return this.http.patch("/account/role",e).then(()=>{})}},{key:"removeRole",value:function(e){return this.http.delete("/account/role/"+e,null).then(()=>{})}},{key:"addToRole",value:function(e,t){return this.http.post("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"removeFromRole",value:function(e,t){return this.http.delete("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"postUsedProjects",value:function(e){return this.http.post("/account/latest_projects",e).json()}},{key:"getUsedProjects",value:function(){return this.http.get("/account/latest_projects").json()}},{key:"truncateUsedProjects",value:function(){return this.http.delete("/account/latest_projects",null).then(()=>{})}}]),n}();const L=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,F=e=>{if(e){const t=L();localStorage.setItem("@evergis/user-info",JSON.stringify(c({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let U=function(e){p(n,E);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"login",value:async function(e,t,r){if(void 0===t&&(t={}),void 0===r&&(r=!1),e){const o=await g(h(n.prototype),"authenticate",this).call(this,t,e);o&&r&&(window.localStorage.setItem("evergis-jwt-token",o.token),window.localStorage.setItem("evergis-refresh-token",o.refreshToken))}}},{key:"fetchCurrentUser",value:async function(){return this.userInfo=await this.getUserInfo(),this.userInfo}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"logout",value:async function(){window.localStorage.getItem("evergis-jwt-token")&&(window.localStorage.removeItem("evergis-jwt-token"),window.localStorage.removeItem("evergis-refresh-token")),await this.revokeToken(),F(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await g(h(n.prototype),"updateUser",this).call(this,c({username:this.username},e)),F(e)}},{key:"setPassword",value:function(e){return this.setUserPassword({username:this.username,password:e})}},{key:"isAuth",get:function(){var e;return!(null==(e=this.userInfo)||!e.username)&&"public"!==this.userInfo.username}},{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=L();return e&&(this.userInfo=e),e}}]),n}(),A=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getPreview",value:function(){return this.http.createUrl("/account/user/preview")}},{key:"uploadPreview",value:function(e){return this.http.post("/account/user/preview",S(e)).json()}},{key:"deletePreview",value:function(){return this.http.delete("/account/user/preview",null).then(()=>{})}},{key:"getPreview1",value:function(e){return this.http.createUrl("/account/user/preview/"+e)}},{key:"uploadPreview1",value:function(e,t){return this.http.post("/account/user/preview/"+e,S(t)).json()}},{key:"deletePreview1",value:function(e){return this.http.delete("/account/user/preview/"+e,null).then(()=>{})}}]),n}(),D=function(e){p(n,A);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),N=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),O=function(e){p(n,N);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const M=["cameraId"],B=["cameraId"],q=["cameraId"],W=["cameraId"],H=["cameraId"],_=["cameraId"];let G=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getCameras",value:function(e){return this.http.get("/cameras",e).json()}},{key:"getArchiveFeed",value:function(e){let{cameraId:t}=e,n=y(e,M);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=y(e,B);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=y(e,q);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=y(e,W);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=y(e,H);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}},{key:"getLivePreviewStream",value:function(e){let{cameraId:t}=e,n=y(e,_);return this.http.get("/cameras/"+t+"/getLivePreviewsStream",n).json()}}]),n}(),z=function(e){p(n,G);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),V=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getConfigurationsList",value:function(e){return this.http.get("/settings/config",e).json()}},{key:"getConfiguration",value:function(e){return this.http.get("/settings",e).text()}},{key:"setConfiguration",value:function(e,t){return this.http.post("/settings",t,e).then(()=>{})}},{key:"removeConfiguration",value:function(e){return this.http.delete("/settings",null,e).then(()=>{})}}]),n}(),Q=function(e){p(n,V);var t=d(n);function n(){var e;return u(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return l(n,[{key:"fetchClientSettings",value:async function(e){const t=JSON.parse(await this.getConfiguration(e));return this.updateClientSettings(t),t}},{key:"updateClientSettings",value:function(e){Object.assign(this.settings,e)}}]),n}(),J=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getFunctionsList",value:function(){return this.http.get("/eql/functions").json()}},{key:"getPagedQueryResult",value:function(e){return this.http.post("/eql/query",e).json()}},{key:"getQueryDescription",value:function(e){return this.http.post("/eql/description",e).json()}},{key:"setLayerParameterValue",value:function(e){return this.http.post("/eql/setParam",null,e).then(()=>{})}},{key:"setLayerParameters",value:function(e,t){return this.http.post("/eql/setParams",t,e).then(()=>{})}},{key:"getLayerParameters",value:function(e){return this.http.get("/eql/getParam",e).text()}},{key:"getLayerParameters1",value:function(e){return this.http.get("/eql/getParams",e).json()}},{key:"removeLayerParameterValue",value:function(e){return this.http.delete("/eql/removeParam",null,e).then(()=>{})}},{key:"getAvailiableLayerParameters",value:function(e){return this.http.get("/eql/getAvailiableParams",e).json()}}]),n}(),K=function(e){p(n,J);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),X=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"vkLogin",value:function(){return this.http.createUrl("/account/external/login/vk")}},{key:"googleLogin",value:function(){return this.http.createUrl("/account/external/login/google")}},{key:"facebookLogin",value:function(){return this.http.createUrl("/account/external/login/facebook")}},{key:"loginCallback",value:function(){return this.http.get("/account/external/login/callback").then(()=>{})}},{key:"unbindVk",value:function(){return this.http.delete("/account/external/unbind/vk",null).then(()=>{})}},{key:"unbindGoogle",value:function(){return this.http.delete("/account/external/unbind/google",null).then(()=>{})}},{key:"unbindFacebook",value:function(){return this.http.delete("/account/external/unbind/facebook",null).then(()=>{})}},{key:"bindVk",value:function(){return this.http.createUrl("/account/external/bind/vk")}},{key:"bindGoogle",value:function(){return this.http.createUrl("/account/external/bind/google")}},{key:"bindFacebook",value:function(){return this.http.createUrl("/account/external/bind/facebook")}},{key:"bindCallback",value:function(){return this.http.get("/account/external/bind/callback").then(()=>{})}}]),n}(),Y=function(e){p(n,X);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"login",value:function(e){switch(e){case"vk":return this.vkLogin();case"google":return this.googleLogin();case"facebook":return this.facebookLogin();default:return""}}},{key:"bind",value:function(e){switch(e){case"vk":return this.bindVk();case"google":return this.bindGoogle();case"facebook":return this.bindFacebook();default:return""}}},{key:"unbind",value:function(e){switch(e){case"vk":return this.unbindVk();case"google":return this.unbindGoogle();case"facebook":return this.unbindFacebook();default:return""}}}]),n}(),Z=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"increaseResourcesLimit",value:function(e){return this.http.post("/feedback/limits",null,e).json()}},{key:"moreSymbols",value:function(e){return this.http.post("/feedback/symbol",null,e).json()}},{key:"feedback",value:function(e,t){return this.http.post("/feedback",S(t),e).json()}}]),n}(),$=function(e){p(n,Z);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}(),ee=function(e){p(n,I);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"upload",value:function(e,t){return this.createFile1({file:e,rewrite:!!t})}},{key:"replaceFile",value:function(e){return this.createFile(e)}}]),n}(),te=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"get",value:function(e){return this.http.get("/filters/"+e).json()}},{key:"update",value:function(e,t){return this.http.post("/filters/"+e,t).json()}},{key:"create",value:function(e){return this.http.post("/filters",e).json()}}]),n}(),ne=function(e){p(n,te);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const re=["providerName"],oe=["providerName"],se=["providerName"];let ie=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=y(e,re);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=y(e,oe);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=y(e,se);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),ue=function(e){p(n,ie);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"geocode2Gis",value:function(e){return this.geocode(c({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(c({providerName:"geocode2gis"},e))}}]),n}(),ae=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"startTask",value:function(e){return this.http.post("/ice-router/tasks",e).text()}},{key:"getResult",value:function(e){return this.http.get("/ice-router/tasks/"+e).json()}}]),n}(),le=function(e){p(n,ae);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),ce=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getDataSchema",value:function(e){return this.http.get("/import/dataSchema",e).json()}},{key:"getFeaturesCount",value:function(e){return this.http.post("/import/count",e).json()}},{key:"readPart",value:function(e){return this.http.get("/import/read",e).then(()=>{})}},{key:"getExternalWmsLayers",value:function(e){return this.http.get("/import/wms",e).json()}},{key:"getExternalPbfLayers",value:function(e){return this.http.get("/import/pbf",e).json()}},{key:"getExternalPbfFeatures",value:function(e){return this.http.get("/import/pbf/features",e).json()}},{key:"getExternalArcgisFsLayers",value:function(e){return this.http.get("/import/arcgisfeatureservice",e).json()}},{key:"getExternalArcGisLayers",value:function(e){return this.http.get("/import/arcgismapservice",e).json()}},{key:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}},{key:"getRasterMeta",value:function(e){return this.http.get("/import/rasterMeta",e).json()}}]),n}(),pe=function(e){p(n,ce);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const he=["name"],ye=["name"],fe=["name","id"],ve=["name","id"],de=["name","id"],ke=["name","x","y","z"],ge=["name","x","y","z","format"],me=["name","x","y","z","dpi","format"],be=["name"],xe=["name"],Se=["name"],Te=["name"],je=["name"],we=["name"],Pe=["name"],Re=["name"],Ie=["layerName"],Ce=["name","id"];let Ee=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getBulkFeatures",value:function(e){return this.http.post("/bulk/layers/features/query",e).json()}},{key:"getBulkExtents",value:function(e,t){return this.http.post("/bulk/layers/extent",t,e).json()}},{key:"getFilteredFeaturesCount",value:function(e){return this.http.post("/bulk/layers/features/count",e).json()}},{key:"getLayersList",value:function(e){return this.http.get("/layers",e).json()}},{key:"deleteResources",value:function(e){return this.http.delete("/layers",null,e).json()}},{key:"getLayerInfo",value:function(e){return this.http.get("/layers/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/layers/"+e,null).then(()=>{})}},{key:"getLayersInfo",value:function(e){return this.http.get("/layers/batchInfo",e).json()}},{key:"publishMapboxService",value:function(e){return this.http.post("/layers",e,{type:"Mapbox"}).json()}},{key:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{key:"publishRouteService",value:function(e){return this.http.post("/layers",e,{type:"RouteService"}).then(()=>{})}},{key:"publishLinearService",value:function(e){return this.http.post("/layers",e,{type:"LinearService"}).then(()=>{})}},{key:"publishRemoteTileService",value:function(e){return this.http.post("/layers",e,{type:"RemoteTileService"}).json()}},{key:"publishQueryLayerService",value:function(e){return this.http.post("/layers",e,{type:"QueryLayerService"}).json()}},{key:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).json()}},{key:"publishPythonService",value:function(e){return this.http.post("/layers",e,{type:"Python"}).json()}},{key:"updateMapboxService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Mapbox"}).json()}},{key:"updatePythonService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Python"}).json()}},{key:"updateProxyService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"ProxyService"}).json()}},{key:"updateTileCatalogService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresTileLayerService"}).json()}},{key:"updateRemoteTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"RemoteTileService"}).json()}},{key:"updateQueryLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"QueryLayerService"}).json()}},{key:"reloadService",value:function(e){return this.http.get("/layers/"+e+"/reload").json()}},{key:"getFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures1",value:function(e){let{name:t}=e,n=y(e,he);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=y(e,ye);return this.http.delete("/layers/"+t+"/features",null,n).json()}},{key:"createFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features",t).json()}},{key:"updateFeature",value:function(e,t){return this.http.patch("/layers/"+e+"/features",t).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=y(e,fe);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,o=y(e,ve);return this.http.post("/layers/"+n+"/features/"+r+"/unite",t,o).json()}},{key:"subtract",value:function(e,t){let{name:n,id:r}=e,o=y(e,de);return this.http.post("/layers/"+n+"/features/"+r+"/subtract",t,o).json()}},{key:"getTilesLayerImage",value:function(e){let{name:t,x:n,y:r,z:o}=e,s=y(e,ke);return this.http.createUrl("/layers/"+t+"/tile/"+o+"/"+n+"/"+r,s)}},{key:"getTilesLayerImage1",value:function(e){let{name:t,x:n,y:r,z:o,format:s}=e,i=y(e,ge);return this.http.createUrl("/layers/"+t+"/tile/"+o+"/"+n+"/"+r+"."+s,i)}},{key:"getTilesLayerImageWithFormatAndDpi",value:function(e){let{name:t,x:n,y:r,z:o,dpi:s,format:i}=e,u=y(e,me);return this.http.createUrl("/layers/"+t+"/tile/"+o+"/"+n+"/"+r+"@"+s+"x."+i,u)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=y(e,be);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=y(e,xe);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=y(e,Se);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=y(e,Te);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=y(e,je);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=y(e,we);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=y(e,Pe);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount1",value:function(e){let{name:t}=e,n=y(e,Re);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"getFilteredFeaturesCount2",value:function(e,t){return this.http.post("/layers/"+e+"/features/count",t).json()}},{key:"editAttributes",value:function(e,t){return this.http.post("/layers/"+e+"/features/edit-attributes",t).json()}},{key:"validateExpression",value:function(e){let{layerName:t}=e,n=y(e,Ie);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"flipCoordinates",value:function(e){return this.http.post("/layers/"+e+"/flip-coordinates",null).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=y(e,Ce);return this.http.get("/layers/"+t+"/"+n+"/metadata",r).json()}},{key:"createRoute",value:function(e,t){return this.http.post("/layers/"+e+"/createRoute",t).json()}},{key:"applyStyle",value:function(e,t){return this.http.put("/layers/"+e+"/style",t).then(()=>{})}},{key:"getStyle",value:function(e){return this.http.get("/layers/"+e+"/style").json()}},{key:"getImageLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.png").blob()}},{key:"getDataLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.json").then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/layers/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/layers/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/layers/"+e+"/references").json()}}]),n}();async function Le(e){return(await Promise.all(e.map(e=>e.catch(e=>Fe(e)?e:new Error(e))))).filter(Ue)}function Fe(e){return e instanceof Error}function Ue(e){return!Fe(e)}let Ae=function(e){p(n,Ee);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getLayerInfos",value:function(e){return Le(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return Le(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(c({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findMany",value:function(e,t){return this.getLayersInfo({layerNames:e,projectNames:t})}},{key:"findAll",value:function(e){return this.getLayersList(e)}},{key:"createQueryLayer",value:function(e){return this.publishQueryLayerService(e)}},{key:"updateQueryLayer",value:function(e){return this.updateQueryLayerService(e.name,e)}},{key:"createProxyLayer",value:function(e){return this.publishProxyService(e)}},{key:"updateProxyLayer",value:function(e){return this.updateProxyService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();var De;(De=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",De.HTTP_CLIENT="client",De.HTTP_SERVER="server",De.UNKNOWN="unknown";const Ne=e=>e instanceof n.HTTPError?(e=>{const t=e.response.status;let n=exports.ErrorReason.HTTP_OTHER;return t>=400&&t<500&&(n=exports.ErrorReason.HTTP_CLIENT),t>=500&&(n=exports.ErrorReason.HTTP_SERVER),{type:"http",reason:n,status:t,origin:e}})(e):(e=>({type:"base",reason:exports.ErrorReason.UNKNOWN,origin:e}))(e),Oe=e=>e&&e.type&&e.reason;function Me(e){return"string"==typeof e}const Be=e=>e===exports.UrlPath.Presentation?exports.UrlPath.Base:e;function qe(e,t,n){return n.indexOf(e)===t}const We=i.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let He=function(){function e(t){let{account:n}=t;u(this,e),this.account=n}return l(e,[{key:"createId",value:function(){return We()}},{key:"createResourceName",value:function(e){void 0===e&&(e={});const t=e.workspace||this.account.user&&this.account.user.namespace||"",n=e.name||this.createId(),r=e.separator||exports.ResourceSeparator.Server;return t||console.warn("Resource should have workspace. Check account api"),""+t+r+n}},{key:"createTempResourceName",value:function(e){return void 0===e&&(e={}),this.createResourceName(c({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const t=e.split(exports.ResourceSeparator.Server),n=t.pop();return{workspace:t.join(exports.ResourceSeparator.Server),name:n}}return{name:"",workspace:""}}},{key:"extractResourceName",value:function(e){return this.extractResource(e).name||e||""}},{key:"extractResourceWorkspace",value:function(e){return this.extractResource(e).workspace||""}}]),e}(),_e=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getSubscriptionList",value:function(){return this.http.get("/notifications/subscribes").json()}},{key:"subscribeOperation",value:function(e){return this.http.post("/notifications/subscribes",null,e).then(()=>{})}},{key:"unsubscribeOperation",value:function(e){return this.http.delete("/notifications/subscribes",null,e).then(()=>{})}},{key:"subscribeListOperation",value:function(e){return this.http.post("/notifications/subscribe-list",e).then(()=>{})}},{key:"unsubscribeListOperation",value:function(e){return this.http.post("/notifications/unsubscribe-list",e).then(()=>{})}}]),n}();var Ge;(Ge=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",Ge.Connected="Connected",Ge.Break="Break",Ge.Lost="Lost",Ge.SessionClosed="SessionClosed";let ze=function(e){p(r,_e);var n=d(r);function r(e,o,s){var i;return void 0===s&&(s=!1),u(this,r),(i=n.call(this,e)).api=o,i.MAX_WS_RECONNECT_TRIES=10,i.keepAlive=!1,i.reconnectTries=0,i.subscriptions=[],i._connectStatus=exports.ConnectionStatus.Initialized,i.onWsConnected=()=>{i.connectStatus=exports.ConnectionStatus.Connected,i.keepAlive&&(i.keepAliveTimeout=setInterval(()=>{i.ws&&i.ws.send(JSON.stringify({keepAlive:!0}))},5e3))},i.onWsClosed=e=>{4001===e.code||4002===e.code?i.connectStatus=exports.ConnectionStatus.SessionClosed:i.reconnectTries<i.MAX_WS_RECONNECT_TRIES?(i.connectStatus=exports.ConnectionStatus.Break,i.reconnectTries++,i.ws&&(i.ws.onopen=null,i.ws.onclose=null,i.ws.onmessage=null,i.ws=void 0),i.keepAliveTimeout&&clearInterval(i.keepAliveTimeout),setTimeout(()=>{i.connect()},0)):i.connectStatus=exports.ConnectionStatus.Lost},i.onWsMessage=e=>{let t={};try{t=JSON.parse(e.data)}catch(e){console.debug("Failed to parse ws message from sp.")}if("notification"===t.type&&t.data){const{tag:e,data:n}=t.data;e&&i.emitter.emit(e,new Ve(n))}},i.emitter=new t.EventEmitter,i.keepAlive=s,i}return l(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new Ve(e)),this._connectStatus=e}},{key:"currentWs",get:function(){return this.ws}},{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"subscribe",value:async function(e){this.subscriptions.push(e),setTimeout(()=>{this.api.isShared||this.api.isPresentation||!this.subscriptions.length||this.subscribeListOperation(this.subscriptions),this.subscriptions=[]},500)}},{key:"unsubscribe",value:async function(e){if((await this.getSubscriptionList()).includes(e))return this.unsubscribeOperation({tag:e})}},{key:"connectWs",value:function(e){const t=e.replace("http://","ws://").replace("https://","wss://");this.wsUrl=t,this.connect()}},{key:"connect",value:function(){this.wsUrl?(this.ws=new WebSocket(this.wsUrl),this.ws.onopen=this.onWsConnected,this.ws.onclose=this.onWsClosed,this.ws.onmessage=this.onWsMessage):console.warn("Connection to WebSocket not allowed. wsUrl not provided")}}]),r}(),Ve=l((function e(t){u(this,e),this.data=t})),Qe=function(e){p(n,V);var t=d(n);function n(){var e;return u(this,n),(e=t.apply(this,arguments)).config=null,e}return l(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}(),Je=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"print",value:function(e){return this.http.post("/print/print",e).then(()=>{})}},{key:"printToHtml",value:function(e){return this.http.post("/print/printHtml",e).text()}},{key:"uploadTemplate",value:function(e,t){return this.http.post("/print/templates",S(t),e).then(()=>{})}},{key:"getTemplates",value:function(){return this.http.get("/print/templates").json()}},{key:"deleteTemplate",value:function(e){return this.http.delete("/print/templates/"+e,null).then(()=>{})}},{key:"getTemplate",value:function(e){return this.http.get("/print/templates/"+e).text()}}]),n}(),Ke=function(e){p(n,Je);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const Xe=["name"];let Ye=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getProjectsList",value:function(e){return this.http.get("/projects",e).json()}},{key:"createProject",value:function(e){return this.http.post("/projects",e).json()}},{key:"deleteResources",value:function(e){return this.http.delete("/projects",null,e).json()}},{key:"updateProject",value:function(e,t){return this.http.patch("/projects/"+e,t).json()}},{key:"getProjectInfo",value:function(e){return this.http.get("/projects/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/projects/"+e,null).then(()=>{})}},{key:"updateProjectV2",value:function(e,t){return this.http.patch("/projects/"+e+"/v2",t).json()}},{key:"getProjectsInfo",value:function(e){return this.http.get("/projects/batchInfo",e).json()}},{key:"getProjectEnvelope",value:function(e){let{name:t}=e,n=y(e,Xe);return this.http.get("/projects/"+t+"/extent",n).json()}},{key:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{key:"getTilesLayerImage",value:function(e,t,n,r){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n)}},{key:"getTilesLayerImageWithFormat",value:function(e,t,n,r,o){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n+"."+o)}},{key:"getTilesLayerImageWithFormatAndDpi",value:function(e,t,n,r,o,s){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n+"@"+o+"x."+s)}},{key:"isExists",value:function(e){return this.http.get("/projects/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/projects/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/projects/"+e+"/references").json()}}]),n}(),Ze=function(e){p(n,Ye);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getProjectInfos",value:function(e){return Le(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return Le(e.map(e=>this.getResourceDependencies(e)))}},{key:"findOne",value:function(e){return this.getProjectInfo(e)}},{key:"findAll",value:function(e){return this.getProjectsList(e)}},{key:"create",value:function(e){return this.createProject(e)}},{key:"update",value:function(e){return this.updateProject(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();const $e=["id"],et=["id"];let tt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"get",value:function(e){return this.http.get("/scheduler/task/"+e+"/subtasks").json()}},{key:"stop",value:function(e){return this.http.post("/scheduler/task/"+e+"/stop",null).text()}},{key:"createTaskPrototype",value:function(e){return this.http.post("/scheduler",e).text()}},{key:"getTaskPrototypes",value:function(e){return this.http.get("/scheduler",e).json()}},{key:"updateTaskPrototype",value:function(e,t){return this.http.put("/scheduler/"+e,t).text()}},{key:"delete",value:function(e){return this.http.delete("/scheduler/"+e,null).text()}},{key:"setEnable",value:function(e,t){return this.http.post("/scheduler/"+e+"/enable/"+t,null).text()}},{key:"getTasksForPrototype",value:function(e){let{id:t}=e,n=y(e,$e);return this.http.get("/scheduler/"+t+"/tasks",n).json()}},{key:"startTask",value:function(e,t){return this.http.post("/scheduler/"+e+"/start/"+t,null).json()}},{key:"startTask1",value:function(e){return this.http.post("/scheduler/"+e+"/start",null).json()}},{key:"getTaskResource",value:function(e){let{id:t}=e,n=y(e,et);return this.http.get("/scheduler/taskresource/"+t,n).json()}},{key:"createTaskResource",value:function(e){return this.http.post("/scheduler/taskresource",e).text()}},{key:"updatePythonTaskResource",value:function(e,t){return this.http.patch("/scheduler/taskresource/"+e,t,{type:"PythonTask"}).then(()=>{})}},{key:"updateSpTaskResource",value:function(e,t){return this.http.patch("/scheduler/taskresource/"+e,t,{type:"SpTask"}).then(()=>{})}},{key:"get1",value:function(){return this.http.get("/scheduler/worker").json()}},{key:"post",value:function(e){return this.http.post("/scheduler/worker",e).json()}},{key:"getWorker",value:function(e){return this.http.get("/scheduler/worker/"+e).json()}}]),n}(),nt=function(e){p(n,tt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();var rt;(rt=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",rt.Table="Table",rt.Project="Project";let ot=function(){function e(t,n,r){u(this,e),this.projects=t,this.layers=n,this.tables=r}return l(e,[{key:"getProjectInfosWithDeps",value:async function(e){const t=await this.projects.getProjectInfos(e),n=await this.projects.getProjectsDeps(e),{layers:r,tables:o}=await this.getDependencies(n,!0,!0);return{projects:t,deps:{layers:r,tables:o}}}},{key:"getLayerInfosWithDeps",value:async function(e){const t=await this.layers.getLayerInfos(e),n=await this.layers.getLayersDeps(e),{tables:r}=await this.getDependencies(n,!1,!0);return{layers:t,deps:{tables:r}}}},{key:"getDependencies",value:async function(e,t,n){const{tables:r,layers:o}=e.reduce((e,r)=>{const o=r.dependencies||[];if(t){const t=this.getDependentNames(o,exports.DependencyType.Layer);e.layers.push(...t)}if(n){const t=this.getDependentNames(o,exports.DependencyType.Table);e.tables.push(...t)}return e},{tables:[],layers:[]});return{tables:await this.tables.getTableInfos(r.filter(qe)),layers:await this.layers.getLayerInfos(o.filter(qe))}}},{key:"getDependentNames",value:function(e,t){return e.filter(e=>{let{type:n}=e;return n===t}).map(e=>{let{name:t}=e;return t}).filter(Me)}}]),e}(),st=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"setPolicies",value:function(e){return this.http.post("/bulk/security/policies",e).then(()=>{})}},{key:"findUserByNameByRoles",value:function(e){return this.http.get("/security/findUsersWithRoles",e).json()}},{key:"getUsersAndRoles",value:function(e){return this.http.get("/security/usersandroles",e).json()}},{key:"findUserByName",value:function(e){return this.http.get("/security/users",e).json()}},{key:"getPolicyList",value:function(e){return this.http.get("/security/policies",e).json()}},{key:"removePolicy",value:function(e){return this.http.delete("/security/policies",null,e).then(()=>{})}},{key:"setPolicy",value:function(e){return this.http.post("/security/policies",e).then(()=>{})}},{key:"oldCheckLimits",value:function(){return this.http.get("/resources/checkLimits").json()}},{key:"oldCheckLimits1",value:function(e){return this.http.get("/resources/checkLimits/"+e).json()}},{key:"checkLimitsForUser",value:function(){return this.http.get("/security/limits/user").json()}},{key:"checkLimitsForUser1",value:function(e){return this.http.get("/security/limits/user/"+e).json()}},{key:"checkLimitsForRole",value:function(e){return this.http.get("/security/limits/role/"+e).json()}},{key:"getDefaultLimits",value:function(){return this.http.get("/security/limits/default").json()}}]),n}(),it=function(e){p(n,st);var t=d(n);function n(e,r){var o;let{username:s,roles:i}=r;return u(this,n),(o=t.call(this,e)).ownerName="",o.ownerRoles=[],o.ownerName=s,o.ownerRoles=i,o}return l(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),ut=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"statisticsDb1",value:function(e){return this.http.post("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"classify1",value:function(e){return this.http.post("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}},{key:"sumOfProduct1",value:function(e){return this.http.post("/statistics/sumOfProduct",e).json()}}]),n}(),at=function(e){p(n,ut);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"postStatistic",value:function(e){return this.statisticsDb1(e)}},{key:"getClassify",value:function(e){return this.classify(e)}},{key:"postClassify",value:function(e){return this.classify1(e)}}]),n}(),lt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getStyle",value:function(e){return this.http.get("/styles/"+e).json()}},{key:"updateStyle",value:function(e,t){return this.http.post("/styles/"+e,t).json()}},{key:"createStyle",value:function(e){return this.http.post("/styles",e).json()}},{key:"getAllFonts",value:function(){return this.http.get("/styles/fonts").json()}},{key:"addFont",value:function(e){return this.http.post("/styles/fonts",S(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),ct=function(e){p(n,lt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const pt=["name"],ht=["name"],yt=["name"];let ft=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getTableList",value:function(e){return this.http.get("/tables",e).json()}},{key:"createTable",value:function(e){return this.http.post("/tables",e).json()}},{key:"deleteResources",value:function(e){return this.http.delete("/tables",null,e).json()}},{key:"updateTable",value:function(e,t){return this.http.patch("/tables/"+e,t).json()}},{key:"putTable",value:function(e,t){return this.http.put("/tables/"+e,t).json()}},{key:"getTableInfo",value:function(e){return this.http.get("/tables/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/tables/"+e,null).then(()=>{})}},{key:"getTablesInfo",value:function(e){return this.http.get("/tables/batchInfo",e).json()}},{key:"getTableData",value:function(e){let{name:t}=e,n=y(e,pt);return this.http.get("/tables/"+t+"/data",n).json()}},{key:"writeTableData",value:function(e,t){return this.http.post("/tables/"+e+"/data",t).then(()=>{})}},{key:"updateTableData",value:function(e,t){let{name:n}=e,r=y(e,ht);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=y(e,yt);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"mapTable",value:function(e,t){return this.http.post("/tables/map-table",t,e).json()}},{key:"unmapTable",value:function(e){return this.http.delete("/tables/map-table/"+e,null).then(()=>{})}},{key:"createViewFromQueryLayer",value:function(e){return this.http.post("/tables/fromLayer",e).json()}},{key:"createViewFromQuery",value:function(e){return this.http.post("/tables/fromQuery",e).json()}},{key:"isExists",value:function(e){return this.http.get("/tables/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/tables/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/tables/"+e+"/references").json()}}]),n}(),vt=function(e){p(n,ft);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getTableInfos",value:function(e){return Le(e.map(e=>this.getTableInfo(e)))}},{key:"findOne",value:function(e){return this.getTableInfo(e)}},{key:"findAll",value:function(e){return this.getTableList(e)}},{key:"create",value:function(e){return this.createTable(e)}},{key:"update",value:function(e){return this.updateTable(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),dt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),kt=function(e){p(n,dt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const gt=["name","z","x","y"];let mt=function(e){p(n,T);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getVectorTile",value:function(e){let{name:t,z:n,x:r,y:o}=e,s=y(e,gt);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+o+".pbf",s).then(()=>{})}}]),n}(),bt=function(e){p(n,mt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getVt",value:function(e,t,n,r){return this.getVectorTile({name:e,z:t,x:n,y:r})}}]),n}();var xt;(xt=exports.UrlPath||(exports.UrlPath={})).Base="/map",xt.Shared="/shared",xt.Presentation="/presentation",xt.Portal="/portal";const St={401:exports.ApiEvent.Unauthorized},Tt=Object.values(exports.UrlPath),jt=Tt[0];let wt=function(e){p(s,t.EventEmitter);var r=d(s);function s(e){var t,i;let{url:a,wsUrl:l,wsKeepAlive:p,snappingHubUrl:h,http:y,urlPath:v,httpOptions:d}=e;u(this,s),i=r.call(this);const{hooks:k}=d||{};return i.http=y||new m(c({prefixUrl:a,timeout:!1,retry:{methods:["get","post","delete"],limit:5,statusCodes:[401]}},d||{},{hooks:c({},k||{},{beforeRequest:[e=>{const t=window.localStorage.getItem("evergis-jwt-token");var n;t&&(null==(n=e.headers)||n.set("Authorization","Bearer "+(t||"")))},...null!=(t=null==k?void 0:k.beforeRequest)?t:[]],beforeRetry:[async e=>{let{request:t,error:r,retryCount:o}=e;if(r instanceof n.HTTPError&&401===r.response.status&&1===o)try{const e=window.localStorage.getItem("evergis-refresh-token");if(e){var s;const n=await i.account.refreshToken({refreshToken:e});n&&(window.localStorage.setItem("evergis-jwt-token",n.token),window.localStorage.setItem("evergis-refresh-token",n.refreshToken)),null==(s=t.headers)||s.set("Authorization","Bearer "+(n.token||""))}}catch(r){throw new Error("Failed to refresh token")}}],afterResponse:[(e,t,r)=>{const o=St[null==r?void 0:r.status];return o&&i.emit(o,Ne(new n.HTTPError(r,e,t))),r},...(null==k?void 0:k.afterResponse)||[]]})})),i.url=a,i.wsUrl=l||a,i.urlPath=v||i.defineUrlPath(),i.layers=new Ae(i.http),i.tables=new vt(i.http),i.projects=new Ze(i.http),i.resources=new ot(i.projects,i.layers,i.tables),i.styles=new ct(i.http),i.account=new U(i.http),i.accountPreview=new D(i.http),i.bulk=new O(i.http),i.security=new it(i.http,i.account),i.notification=new ze(i.http,f(i),p),i.file=new ee(i.http),i.filters=new ne(i.http),i.import=new pe(i.http),i.geocode=new ue(i.http),i.cameras=new z(i.http),i.print=new Ke(i.http),i.tools=new kt(i.http),i.external=new Y(i.http),i.clientSettings=new Q(i.http),i.portalSettings=new Qe(i.http),i.iceRouter=new le(i.http),i.statistic=new at(i.http),i.feedback=new $(i.http),i.vectorTiles=new bt(i.http),i.spatialReference=new R(i.http),i.eql=new K(i.http),i.catalog=new I(i.http),i.queryToken=new P(i.http),i.dataSource=new j(i.http),i.remoteTaskManager=new nt(i.http),i.names=new He({account:i.account}),i.snappingHub=h?(new o.HubConnectionBuilder).withUrl(h,{withCredentials:!0,skipNegotiation:!0,transport:o.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,i}return l(s,[{key:"init",value:async function(e){let{authParams:t,authQueryParams:n,connectWs:r,fetchSettings:o,fetchUser:s,useJwt:i}=e;try{await this.account.login(t,n,i),s&&await this.account.fetchCurrentUser(),r&&await this.connectWs(),o&&await this.clientSettings.fetchClientSettings({urlPath:Be(this.urlPath)}),await this.notification.subscribe("service_update")}catch(e){throw Ne(e)}}},{key:"isAcceptedNetwork",value:function(e){return["vk","google","facebook"].includes(e)}},{key:"socAuthLogin",value:async function(e){if(this.isAcceptedNetwork(e))try{await this.clientSettings.fetchClientSettings({urlPath:exports.UrlPath.Base})}catch(e){throw Ne(e)}}},{key:"connectWs",value:async function(){this.account.isAuth&&(this.notification.connectWs(this.wsUrl),this.notification.on("ConnectionStatus",e=>{e.data===exports.ConnectionStatus.Lost?this.emit(exports.ApiEvent.ConnectionLost,e.data):e.data===exports.ConnectionStatus.SessionClosed&&this.emit(exports.ApiEvent.SessionClosed,e.data)}))}},{key:"connectSignalR",value:async function(){this.account.isAuth&&this.snappingHub&&this.snappingHub.state!==o.HubConnectionState.Connected&&await this.snappingHub.start()}},{key:"logout",value:async function(){await this.account.logout(),await this.security.reset(),this.emit(exports.ApiEvent.Unauthorized,null)}},{key:"defineUrlPath",value:function(){const e=(window.location.href.split(window.location.hostname)[1]||"").split("/").filter(Boolean)[0],t=e?"/"+e:void 0;return t&&Tt.includes(t)?t:jt}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}},{key:"isPresentation",get:function(){return this.urlPath===exports.UrlPath.Presentation||"8082"===window.location.port}}]),s}();var Pt,Rt,It,Ct,Et,Lt,Ft,Ut,At,Dt,Nt,Ot,Mt,Bt,qt,Wt,Ht,_t,Gt,zt,Vt,Qt,Jt,Kt,Xt,Yt,Zt,$t,en,tn,nn,rn,on,sn,un,an,ln;(Pt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",Pt.Array="Array",Pt.Min="Min",Pt.Max="Max",Pt.Avg="Avg",Pt.Sum="Sum",Pt.Extent="Extent",Pt.H3="H3",Pt.Count="Count",Pt.TotalCount="TotalCount",Pt.DistinctCount="DistinctCount",Pt.First="First",Pt.Last="Last",Pt.Median="Median",Pt.Mod="Mod",Pt.StdDeviation="StdDeviation",Pt.SumOfProduct="SumOfProduct",Pt.OnlyValue="OnlyValue",Pt.WeightedAvg="WeightedAvg",Pt.DensityIndicators="DensityIndicators",Pt.DividedSum="DividedSum",(Rt=exports.AttributeIconType||(exports.AttributeIconType={})).Unknown="Unknown",Rt.Icon="Icon",Rt.PNG="PNG",Rt.SVG="SVG",(It=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",It.SelectFromHandBook="SelectFromHandBook",It.SelectFromRange="SelectFromRange",It.ViewHandBook="ViewHandBook",(Ct=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",Ct.String="String",Ct.Int32="Int32",Ct.Int64="Int64",Ct.Double="Double",Ct.DateTime="DateTime",Ct.Boolean="Boolean",Ct.Point="Point",Ct.Polyline="Polyline",Ct.MultiPolygon="MultiPolygon",Ct.Multipoint="Multipoint",Ct.H3Index="H3Index",Ct.Json="Json",(Et=exports.AuthorizationGrant||(exports.AuthorizationGrant={})).AuthorizationCode="authorization_code",Et.RefreshToken="refresh_token",(Lt=exports.CatalogResourceType||(exports.CatalogResourceType={})).Directory="Directory",Lt.Map="Map",Lt.Layer="Layer",Lt.Table="Table",Lt.File="File",Lt.TaskPrototype="TaskPrototype",Lt.DataSource="DataSource",(Ft=exports.ClassificationType||(exports.ClassificationType={})).None="none",Ft.NaturalBreaks="naturalBreaks",Ft.EqualInterval="equalInterval",Ft.Quantile="quantile",Ft.Distinct="distinct",Ft.Step="step",Ft.Unique="unique",(Ut=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",Ut.DateTime="dateTime",Ut.Text="text",(At=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",At.SerializeError="SerializeError",At.InvalidDataService="InvalidDataService",At.InvalidConfiguration="InvalidConfiguration",At.InvalidDataServiceName="InvalidDataServiceName",At.InvalidTableName="InvalidTableName",At.InvalidLayerName="InvalidLayerName",At.ResourceNotFound="ResourceNotFound",At.InvalidCondition="InvalidCondition",At.InvalidAttributes="InvalidAttributes",At.InvalidIdAttribute="InvalidIdAttribute",At.InvalidGeometryAttribute="InvalidGeometryAttribute",At.InvalidGeometryAttributeType="InvalidGeometryAttributeType",At.InvalidColumnName="InvalidColumnName",At.InvalidIdColumnSettings="InvalidIdColumnSettings",At.ColumnNotExistsInTable="ColumnNotExistsInTable",At.InvalidStyle="InvalidStyle",At.InvalidLayerType="InvalidLayerType",At.ColumnLoadingError="ColumnLoadingError",At.InvalidAttributeFormat="InvalidAttributeFormat",At.DataSourceNotFound="DataSourceNotFound",At.DuplicateColumns="DuplicateColumns",At.DuplicateAttributes="DuplicateAttributes",At.TableWithoutColumns="TableWithoutColumns",At.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(Dt=exports.DataSourceType||(exports.DataSourceType={})).Postgres="Postgres",Dt.Trino="Trino",Dt.S3="S3",Dt.GisServer="GisServer",(Nt=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",Nt.ResourceNotFound="ResourceNotFound",Nt.InternalError="InternalError",Nt.BadRequest="BadRequest",Nt.DuplicateContent="DuplicateContent",(Ot=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",Ot.LimitError="LimitError",Ot.ValidationError="ValidationError",Ot.JwtExpired="JwtExpired",Ot.TokenInvalid="TokenInvalid",Ot.RefreshTokenExpired="RefreshTokenExpired",Ot.RefreshTokenInvalid="RefreshTokenInvalid",Ot.CreateUserFailed="CreateUserFailed",Ot.SetUserPasswordFailed="SetUserPasswordFailed",Ot.SetUserRoleFailed="SetUserRoleFailed",Ot.UpdateUserFailed="UpdateUserFailed",Ot.RemoveUserFailed="RemoveUserFailed",Ot.CreateRoleFailed="CreateRoleFailed",Ot.UpdateRoleFailed="UpdateRoleFailed",Ot.RemoveUserRoleFailed="RemoveUserRoleFailed",Ot.ChangeActiveStateFailed="ChangeActiveStateFailed",Ot.RemoveRoleFailed="RemoveRoleFailed",Ot.UserNotFound="UserNotFound",Ot.RoleNotFound="RoleNotFound",Ot.EmailNotConfirmed="EmailNotConfirmed",Ot.DuplicateEmailError="DuplicateEmailError",Ot.InvalidPassword="InvalidPassword",Ot.RoleExists="RoleExists",Ot.UserExists="UserExists",Ot.UserLockedError="UserLockedError",Ot.InvalidEmail="InvalidEmail",Ot.InvalidUsername="InvalidUsername",Ot.Unauthorized="Unauthorized",Ot.EmailNotChanged="EmailNotChanged",Ot.EmailNotSet="EmailNotSet",(Mt=exports.FontStyle||(exports.FontStyle={})).Normal="normal",Mt.Oblique="oblique",Mt.Italic="italic",(Bt=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",Bt.ExtraLight="ExtraLight",Bt.Light="Light",Bt.SemiLight="SemiLight",Bt.Normal="Normal",Bt.Medium="Medium",Bt.DemiBold="DemiBold",Bt.Bold="Bold",Bt.ExtraBold="ExtraBold",Bt.Black="Black",Bt.ExtraBlack="ExtraBlack",(qt=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",qt.Point="point",qt.Polyline="polyline",qt.Polygon="multipolygon",qt.Envelope="envelope",qt.Multipoint="multipoint",(Wt=exports.Group||(exports.Group={})).My="my",Wt.Role="role",Wt.Public="public",Wt.All="all",(Ht=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",Ht.Square="Square",Ht.Round="Round",Ht.Triangle="Triangle",(_t=exports.LineEndingType||(exports.LineEndingType={})).None="none",_t.Arrow="arrow",_t.FilledArrow="filledArrow",_t.Square="square",_t.FilledSquare="filledSquare",_t.Circle="circle",_t.FilledCircle="filledCircle",_t.Diamond="diamond",_t.FilledDiamond="filledDiamond",_t.RoundSquare="roundSquare",_t.FilledRoundSquare="filledRoundSquare",_t.Svg="svg",(Gt=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",Gt.Bevel="Bevel",Gt.Round="Round",(zt=exports.OwnerFilter||(exports.OwnerFilter={})).My="My",zt.Shared="Shared",zt.Public="Public",(Vt=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",Vt.TMS="tms",(Qt=exports.Permissions||(exports.Permissions={})).None="none",Qt.Configure="configure",Qt.Write="write",Qt.Read="read",Qt.ReadConfigure="read,configure",Qt.ReadWrite="read,write",Qt.All="read,write,configure",(Jt=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",Jt.CreateTable="CreateTable",Jt.CreateLayer="CreateLayer",Jt.CreateProject="CreateProject",Jt.MaxFeaturesInOneTable="MaxFeaturesInOneTable",Jt.MaxObjectsToExport="MaxObjectsToExport",Jt.MaxUploadContentSize="MaxUploadContentSize",Jt.MaxEqlQueryParametersValues="MaxEqlQueryParametersValues",(Kt=exports.Quality||(exports.Quality={})).Low="Low",Kt.Medium="Medium",Kt.High="High",(Xt=exports.RemoteTaskStatus||(exports.RemoteTaskStatus={})).Init="Init",Xt.Process="Process",Xt.Completed="Completed",Xt.Interrupted="Interrupted",Xt.Error="Error",Xt.Timeout="Timeout",Xt.Waiting="Waiting",Xt.InQueue="InQueue",Xt.Unknown="Unknown",(Yt=exports.ResourceSubTypeFilter||(exports.ResourceSubTypeFilter={})).RemoteTileService="RemoteTileService",Yt.ProxyService="ProxyService",Yt.PostgresLayerService="PostgresLayerService",Yt.QueryLayerService="QueryLayerService",Yt.TileCatalogTable="TileCatalogTable",(Zt=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",Zt.Table="table",Zt.Layer="layer",Zt.Project="project",Zt.File="file",Zt.Feature="feature",Zt.Tag="tag",Zt.DataSource="datasource",($t=exports.ResourceTypeFilter||(exports.ResourceTypeFilter={})).Map="Map",$t.Layer="Layer",$t.Table="Table",$t.RasterCatalog="RasterCatalog",$t.ProxyService="ProxyService",$t.RemoteTileService="RemoteTileService",$t.File="File",$t.DataSource="DataSource",$t.TaskPrototype="TaskPrototype",(en=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",en.Layer="layers",en.Project="projects",(tn=exports.ResponseType||(exports.ResponseType={})).Code="code",tn.Token="token",(nn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",nn.PreserveTopology="PreserveTopology",nn.VW="VW",(rn=exports.StringSubType||(exports.StringSubType={})).None="None",rn.Image="Image",rn.PkkCode="PkkCode",rn.Attachments="Attachments",(on=exports.TaskResourceSubType||(exports.TaskResourceSubType={})).SpTask="SpTask",on.PythonTask="PythonTask",(sn=exports.TextAlignment||(exports.TextAlignment={})).Right="right",sn.Left="left",sn.Center="center",sn.Justified="justified",(un=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",un.Bottom="bottom",un.Middle="middle",(an=exports.WorkerMethodType||(exports.WorkerMethodType={})).Task="Task",an.Rest="Rest",an.Both="Both",(ln=exports.WorkerSettingsFieldType||(exports.WorkerSettingsFieldType={})).Int32="Int32",ln.Int64="Int64",ln.Double="Double",ln.String="String",ln.Boolean="Boolean",ln.DateTime="DateTime",ln.Point="Point",ln.Geometry="Geometry",ln.Polyline="Polyline",ln.MultiPolygon="MultiPolygon",ln.Polygon="Polygon",ln.Multipoint="Multipoint",ln.IntergerArray="IntergerArray",ln.DoubleArray="DoubleArray",ln.StringArray="StringArray",ln.SourceEql="SourceEql",ln.Layer="Layer",ln.Table="Table",ln.Folder="Folder",ln.Json="Json",ln.Attribute="Attribute",ln.AttributeArray="AttributeArray",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return n.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return n.TimeoutError}}),exports.Account=U,exports.AccountPreview=D,exports.Api=wt,exports.BulkOperations=O,exports.Cameras=z,exports.ClientSettings=Q,exports.Eql=K,exports.External=Y,exports.Feedback=$,exports.FileUpload=ee,exports.Filters=ne,exports.GEOCODE_PROVIDER="geocode2gis",exports.Geocode=ue,exports.HttpClient=m,exports.IceRouter=le,exports.Import=pe,exports.Layers=Ae,exports.Names=He,exports.Notification=ze,exports.NotificationEvent=Ve,exports.PortalSettings=Qe,exports.Print=Ke,exports.Projects=Ze,exports.RemoteTaskManager=nt,exports.Resources=ot,exports.STORAGE_REFRESH_TOKEN_KEY="evergis-refresh-token",exports.STORAGE_TOKEN_KEY="evergis-jwt-token",exports.Security=it,exports.Statistic=at,exports.Styles=ct,exports.Tables=vt,exports.Tools=kt,exports.VectorTiles=bt,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=Ne,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=We,exports.getFetchingUrlPath=Be,exports.isHTTPError=e=>Oe(e)&&"http"===e.type,exports.isHandledError=Oe,exports.isProjectContentItems=function(e){return null!=e},exports.isString=Me,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.parseJwt=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(e=>"%"+"00".concat(e.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(n)},exports.promiseAllIgnoreErrors=Le,exports.stripUselessSlashes=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("/").split("/").filter(Boolean).join("/")},exports.toFormData=S,exports.unique=qe;
2
2
  //# sourceMappingURL=api.cjs.production.min.js.map