Socket
Socket
Sign inDemoInstall

@nextgis/utils

Package Overview
Dependencies
Maintainers
3
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextgis/utils - npm Package Compare versions

Comparing version 1.16.8 to 1.17.0

330

lib/utils.cjs.js

@@ -1,2 +0,2 @@

/** Bundle of @nextgis/utils; version: 1.16.8; author: NextGIS */
/** Bundle of @nextgis/utils; version: 1.17.0; author: NextGIS */
'use strict';

@@ -6,4 +6,4 @@

var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
var type = isBrowser ? 'browser' : 'node';
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
const type = isBrowser ? 'browser' : 'node';
function getGlobalVariable() {

@@ -19,11 +19,10 @@ if (isBrowser) {

function applyMixins(derivedCtor, baseCtors, opt) {
if (opt === void 0) { opt = {}; }
var derivedProperties = allProperties(derivedCtor.prototype);
var replace = opt.replace !== undefined ? opt.replace : true;
baseCtors.forEach(function (baseCtor) {
Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {
var isSomeProp = derivedProperties.indexOf(name) !== -1;
function applyMixins(derivedCtor, baseCtors, opt = {}) {
const derivedProperties = allProperties(derivedCtor.prototype);
const replace = opt.replace !== undefined ? opt.replace : true;
baseCtors.forEach((baseCtor) => {
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
const isSomeProp = derivedProperties.indexOf(name) !== -1;
if ((!replace && !isSomeProp) || replace) {
var descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
if (descriptor) {

@@ -39,7 +38,6 @@ Object.defineProperty(derivedCtor.prototype, name, descriptor);

}
function _allProperties(obj, _props) {
if (_props === void 0) { _props = []; }
function _allProperties(obj, _props = []) {
for (; obj !== null; obj = Object.getPrototypeOf(obj)) {
var op = Object.getOwnPropertyNames(obj);
for (var i = 0; i < op.length; i++) {
const op = Object.getOwnPropertyNames(obj);
for (let i = 0; i < op.length; i++) {
if (_props.indexOf(op[i]) == -1) {

@@ -53,4 +51,4 @@ _props.push(op[i]);

function mixinProperties(derivedCtor, baseCtor, properties) {
properties.forEach(function (name) {
var descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
properties.forEach((name) => {
const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
if (descriptor) {

@@ -99,3 +97,3 @@ Object.defineProperty(derivedCtor.prototype, name, descriptor);

function arrayUnique(arr) {
return arr.filter(function (elem, pos, arr) {
return arr.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;

@@ -106,5 +104,3 @@ });

function arrayChunk(arr, size) {
return Array.from({ length: Math.ceil(arr.length / size) }, function (v, i) {
return arr.slice(i * size, i * size + size);
});
return Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));
}

@@ -148,8 +144,7 @@

function deepmerge(target, src, mergeArray) {
if (mergeArray === void 0) { mergeArray = false; }
var target_ = target;
var src_ = src;
var array = Array.isArray(src_);
var dst = (array && []) || {};
function deepmerge(target, src, mergeArray = false) {
let target_ = target;
const src_ = src;
const array = Array.isArray(src_);
let dst = (array && []) || {};
if (array && Array.isArray(src_)) {

@@ -159,3 +154,3 @@ if (mergeArray) {

dst = dst.concat(target_);
src_.forEach(function (e, i) {
src_.forEach((e, i) => {
if (typeof dst[i] === 'undefined') {

@@ -216,4 +211,4 @@ dst[i] = e;

debugLog('deprecated use of latLng in MapClickEvent, use lngLat instead');
var lat = ev.latLng.lat;
var lng = ev.latLng.lng;
const lat = ev.latLng.lat;
const lng = ev.latLng.lng;
ev.lngLat = [lng, lat];

@@ -226,19 +221,13 @@ }

function deprecatedWarn(message) {
console.warn("DEPRECATED WARN: ".concat(message));
console.warn(`DEPRECATED WARN: ${message}`);
}
// based on https://github.com/bvaughn/debounce-decorator
function debounce(cb, wait) {
if (wait === void 0) { wait = 10; }
var timeoutId;
function wrapper() {
var _this = this;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
function debounce(cb, wait = 10) {
let timeoutId;
function wrapper(...args) {
wrapper.clear();
timeoutId = setTimeout(function () {
timeoutId = setTimeout(() => {
timeoutId = null;
cb.apply(_this, args);
cb.apply(this, args);
}, wait);

@@ -254,4 +243,3 @@ }

}
function DebounceDecorator(wait) {
if (wait === void 0) { wait = 10; }
function DebounceDecorator(wait = 10) {
return function (target, key, descriptor) {

@@ -275,37 +263,33 @@ return {

var Events = /** @class */ (function () {
function Events(emitter) {
class Events {
constructor(emitter) {
this.emitter = emitter;
this._eventsStatus = {};
}
Events.prototype.setEventStatus = function (event, status) {
setEventStatus(event, status) {
this._eventsStatus[event] = status;
};
Events.prototype.onLoad = function (event) {
var _this = this;
var events = Array.isArray(event) ? event : [event];
var promises = events.map(function (x) {
return new Promise(function (res) {
if (_this.getEventStatus(x)) {
res(_this);
}
else {
var e = x;
_this.emitter.once(e, function () {
_this.setEventStatus(x, true);
res(_this);
});
}
});
});
return Promise.all(promises).then(function () { return _this; });
};
Events.prototype.getEventStatus = function (event) {
}
onLoad(event) {
const events = Array.isArray(event) ? event : [event];
const promises = events.map((x) => new Promise((res) => {
if (this.getEventStatus(x)) {
res(this);
}
else {
const e = x;
this.emitter.once(e, () => {
this.setEventStatus(x, true);
res(this);
});
}
}));
return Promise.all(promises).then(() => this);
}
getEventStatus(event) {
// ugly hack to disable type checking error
var _eventName = event;
var status = this._eventsStatus[_eventName];
const _eventName = event;
const status = this._eventsStatus[_eventName];
return status !== undefined ? !!status : false;
};
return Events;
}());
}
}

@@ -322,6 +306,6 @@ function latLngToLngLatArray(latLng) {

*/
var EARTHS_RADIUS = 6371;
const EARTHS_RADIUS = 6371;
function getBoundsPolygon(b) {
var polygon = {
const polygon = {
type: 'Polygon',

@@ -333,10 +317,10 @@ coordinates: [getBoundsCoordinates(b)],

function getBoundsCoordinates(b) {
var westNorth = [b[0], b[1]];
var eastNorth = [b[2], b[1]];
var eastSouth = [b[2], b[3]];
var westSouth = [b[0], b[3]];
const westNorth = [b[0], b[1]];
const eastNorth = [b[2], b[1]];
const eastSouth = [b[2], b[3]];
const westSouth = [b[0], b[3]];
return [westNorth, eastNorth, eastSouth, westSouth, westNorth];
}
function getBoundsFeature(b) {
var feature = {
const feature = {
type: 'Feature',

@@ -349,18 +333,16 @@ properties: {},

var d2r = Math.PI / 180; // degrees to radians
var r2d = 180 / Math.PI; // radians to degrees
const d2r = Math.PI / 180; // degrees to radians
const r2d = 180 / Math.PI; // radians to degrees
function getCirclePolygonCoordinates(lng, lat,
/** In kilometers */
radius, points) {
if (radius === void 0) { radius = 10; }
if (points === void 0) { points = 6; }
radius = 10, points = 6) {
// find the radius in lat/lon
var rlat = (radius / EARTHS_RADIUS) * r2d;
var rlng = rlat / Math.cos(lat * d2r);
var extp = [];
for (var i = 0; i < points + 1; i++) {
const rlat = (radius / EARTHS_RADIUS) * r2d;
const rlng = rlat / Math.cos(lat * d2r);
const extp = [];
for (let i = 0; i < points + 1; i++) {
// one extra here makes sure we connect the
var theta = Math.PI * (i / (points / 2));
var ex = lng + rlng * Math.cos(theta); // center a + radius x * cos(theta)
var ey = lat + rlat * Math.sin(theta); // center b + radius y * sin(theta)
const theta = Math.PI * (i / (points / 2));
const ex = lng + rlng * Math.cos(theta); // center a + radius x * cos(theta)
const ey = lat + rlat * Math.sin(theta); // center b + radius y * sin(theta)
extp.push([ex, ey]);

@@ -370,7 +352,5 @@ }

}
function getCircleFeature(lng, lat, radius, points) {
if (radius === void 0) { radius = 10; }
if (points === void 0) { points = 6; }
var polygon = getCirclePolygonCoordinates(lng, lat, radius, points);
var feature = {
function getCircleFeature(lng, lat, radius = 10, points = 6) {
const polygon = getCirclePolygonCoordinates(lng, lat, radius, points);
const feature = {
type: 'Feature',

@@ -388,4 +368,4 @@ properties: {},

lat = lat > 85.06 ? 85.06 : lat < -85.06 ? -85.06 : lat;
var x = (lng * 20037508.34) / 180;
var y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360)) / (Math.PI / 180);
const x = (lng * 20037508.34) / 180;
let y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360)) / (Math.PI / 180);
y = (y * 20037508.34) / 180;

@@ -395,4 +375,4 @@ return [x, y];

function meters2degrees(x, y) {
var lon = (x * 180) / 20037508.34;
var lat = (Math.atan(Math.exp((y * Math.PI) / 20037508.34)) * 360) / Math.PI - 90;
const lon = (x * 180) / 20037508.34;
const lat = (Math.atan(Math.exp((y * Math.PI) / 20037508.34)) * 360) / Math.PI - 90;
return [lon, lat];

@@ -424,24 +404,22 @@ }

function coordinatesCount(geojson) {
var count = 0;
eachCoordinates(geojson, function () { return count++; });
let count = 0;
eachCoordinates(geojson, () => count++);
return count;
}
function getCoordinates(geojson) {
var coordinates = [];
eachCoordinates(geojson, function (pos) { return coordinates.push(pos); });
const coordinates = [];
eachCoordinates(geojson, (pos) => coordinates.push(pos));
return coordinates;
}
function eachCoordinates(geojson, cb) {
eachGeometry(geojson, function (geom) {
eachGeometry(geojson, (geom) => {
if ('coordinates' in geom) {
if (geom.type === 'Polygon' || geom.type === 'MultiLineString') {
for (var _i = 0, _a = geom.coordinates; _i < _a.length; _i++) {
var x = _a[_i];
x.forEach(function (y) { return cb(y); });
for (const x of geom.coordinates) {
x.forEach((y) => cb(y));
}
}
else if (geom.type === 'MultiPolygon') {
for (var _b = 0, _c = geom.coordinates; _b < _c.length; _b++) {
var x = _c[_b];
x.forEach(function (y) { return y.forEach(function (z) { return cb(z); }); });
for (const x of geom.coordinates) {
x.forEach((y) => y.forEach((z) => cb(z)));
}

@@ -453,4 +431,3 @@ }

else if (geom.type === 'MultiPoint' || geom.type === 'LineString') {
for (var _d = 0, _e = geom.coordinates; _d < _e.length; _d++) {
var x = _e[_d];
for (const x of geom.coordinates) {
cb(x);

@@ -464,13 +441,11 @@ }

function getPolygons(geojson) {
var polygons = [];
eachGeometry(geojson, function (geom) {
const polygons = [];
eachGeometry(geojson, (geom) => {
if ('coordinates' in geom) {
if (geom.type === 'Polygon') {
geom.coordinates.forEach(function (x) { return polygons.push(x); });
geom.coordinates.forEach((x) => polygons.push(x));
}
else if (geom.type === 'MultiPolygon') {
for (var _i = 0, _a = geom.coordinates; _i < _a.length; _i++) {
var x = _a[_i];
for (var _b = 0, x_1 = x; _b < x_1.length; _b++) {
var y = x_1[_b];
for (const x of geom.coordinates) {
for (const y of x) {
polygons.push(y);

@@ -487,4 +462,3 @@ }

if (geojson.type === 'FeatureCollection') {
for (var _i = 0, _a = geojson.features; _i < _a.length; _i++) {
var f = _a[_i];
for (const f of geojson.features) {
cb(f.geometry);

@@ -504,3 +478,3 @@ }

array.length === 4 &&
array.every(function (x) { return typeof x === 'number'; }));
array.every((x) => typeof x === 'number'));
}

@@ -510,5 +484,5 @@

pixelRadius = pixelRadius !== null && pixelRadius !== void 0 ? pixelRadius : 10;
var metresPerPixel = (40075016.686 * Math.abs(Math.cos((center[1] * 180) / Math.PI))) /
const metresPerPixel = (40075016.686 * Math.abs(Math.cos((center[1] * 180) / Math.PI))) /
Math.pow(2, zoom + 8);
var radius = pixelRadius * metresPerPixel * 0.0005;
const radius = pixelRadius * metresPerPixel * 0.0005;
return radius;

@@ -523,11 +497,5 @@ }

*/
function objectAssign(target) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
var source = sources_1[_a];
for (var _b = 0, _c = Object.getOwnPropertyNames(source); _b < _c.length; _b++) {
var prop = _c[_b];
function objectAssign(target, ...sources) {
for (const source of sources) {
for (const prop of Object.getOwnPropertyNames(source)) {
target[prop] = source[prop];

@@ -570,4 +538,4 @@ }

function objectDeepEqual(o, p) {
var keysO = Object.keys(o).sort();
var keysP = Object.keys(p).sort();
const keysO = Object.keys(o).sort();
const keysP = Object.keys(p).sort();
if (keysO.length !== keysP.length)

@@ -577,5 +545,5 @@ return false;

return false;
for (var i = 0; i < keysO.length; i++) {
var oVal = o[keysO[i]];
var pVal = p[keysP[i]];
for (let i = 0; i < keysO.length; i++) {
const oVal = o[keysO[i]];
const pVal = p[keysP[i]];
if (!isEqual(oVal, pVal, o, p)) {

@@ -589,4 +557,4 @@ return false;

function objectRemoveEmpty(obj) {
var newObj = {};
Object.keys(obj).forEach(function (key) {
const newObj = {};
Object.keys(obj).forEach((key) => {
if (!(obj[key] instanceof Array) && obj[key] === Object(obj[key])) {

@@ -602,7 +570,6 @@ newObj[key] = objectRemoveEmpty(obj[key]);

function flatten(data, opt) {
function flatten(data, opt = {}) {
var _a;
if (opt === void 0) { opt = {}; }
var flatArray = (_a = opt.flatArray) !== null && _a !== void 0 ? _a : true;
var result = {};
const flatArray = (_a = opt.flatArray) !== null && _a !== void 0 ? _a : true;
const result = {};
function recurse(cur, prop) {

@@ -613,4 +580,4 @@ if (Object(cur) !== cur) {

else if (Array.isArray(cur) && flatArray) {
var l = cur.length;
for (var i = 0; i < l; i++) {
const l = cur.length;
for (let i = 0; i < l; i++) {
recurse(cur[i], prop + '[' + i + ']');

@@ -622,4 +589,4 @@ }

else {
var isEmpty = true;
for (var p in cur) {
let isEmpty = true;
for (const p in cur) {
isEmpty = false;

@@ -639,8 +606,8 @@ recurse(cur[p], prop ? prop + '.' + p : p);

return data;
var regex = /\.?([^.[\]]+)|\[(\d+)\]/g;
var flat = {};
for (var p in data) {
var cur = flat;
var prop = '';
var m = void 0;
const regex = /\.?([^.[\]]+)|\[(\d+)\]/g;
const flat = {};
for (const p in data) {
let cur = flat;
let prop = '';
let m;
while ((m = regex.exec(p))) {

@@ -659,5 +626,4 @@ cur = cur[prop] || (cur[prop] = m[2] ? [] : {});

function sleep(delay) {
if (delay === void 0) { delay = 0; }
return new Promise(function (resolve) { return setTimeout(resolve, delay); });
function sleep(delay = 0) {
return new Promise((resolve) => setTimeout(resolve, delay));
}

@@ -676,11 +642,10 @@

*/
function camelize(text, separator) {
if (separator === void 0) { separator = /[_.\- ]/; }
function camelize(text, separator = /[_.\- ]/) {
// Cut the string into words
var words = text.split(separator);
const words = text.split(separator);
// Concatenate all capitalized words to get camelized string
var result = "";
for (var i = 0; i < words.length; i++) {
var word = words[i];
var capitalizedWord = word.charAt(0).toUpperCase() + word.slice(1);
let result = "";
for (let i = 0; i < words.length; i++) {
const word = words[i];
const capitalizedWord = word.charAt(0).toUpperCase() + word.slice(1);
result += capitalizedWord;

@@ -692,3 +657,3 @@ }

function numberWithSpaces(x) {
var parts = x.toString().split('.');
const parts = x.toString().split('.');
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ' ');

@@ -699,3 +664,3 @@ return parts.join('.');

function round(val, toFixed) {
var n = toFixed ? Number('1e+' + toFixed) : 1;
const n = toFixed ? Number('1e+' + toFixed) : 1;
return Math.round((val + Number.EPSILON) * n) / n;

@@ -727,3 +692,3 @@ }

if (isObject(val)) {
for (var i in val) {
for (const i in val) {
if (!isAnyJson(i)) {

@@ -763,4 +728,4 @@ return false;

var Clipboard = /** @class */ (function () {
function Clipboard(text) {
class Clipboard {
constructor(text) {
this.silent = true;

@@ -771,7 +736,7 @@ if (text) {

}
Clipboard.copy = function (text) {
var clipboard = new Clipboard();
static copy(text) {
const clipboard = new Clipboard();
return clipboard.copy(text);
};
Clipboard.prototype.copy = function (text) {
}
copy(text) {
try {

@@ -794,5 +759,5 @@ if (navigator.clipboard) {

return false;
};
Clipboard.prototype.copyToClipboard = function (text) {
var input = document.createElement('input');
}
copyToClipboard(text) {
const input = document.createElement('input');
input.value = text;

@@ -806,10 +771,9 @@ try {

}
};
Clipboard.prototype.copyNodeContentsToClipboard = function (input) {
}
copyNodeContentsToClipboard(input) {
input.select();
input.setSelectionRange(0, 99999); /*For mobile devices*/
document.execCommand('copy');
};
return Clipboard;
}());
}
}

@@ -816,0 +780,0 @@ exports.Clipboard = Clipboard;

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof window&&void 0!==window.document,e=t?"browser":"node";function r(t){return function(t,e){void 0===e&&(e=[]);for(;null!==t;t=Object.getPrototypeOf(t))for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++)-1==e.indexOf(r[n])&&e.push(r[n]);return e}(t)}function n(t,e){return t.length===e.length&&t.every((function(t,r){return t===e[r]}))}function o(t){return null!=t}function i(t,e){var r;function n(){for(var o=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];n.clear(),r=setTimeout((function(){r=null,t.apply(o,i)}),e)}return void 0===e&&(e=10),n.clear=function(){r&&(clearTimeout(r),r=null)},n}var a=function(){function t(t){this.emitter=t,this._eventsStatus={}}return t.prototype.setEventStatus=function(t,e){this._eventsStatus[t]=e},t.prototype.onLoad=function(t){var e=this,r=(Array.isArray(t)?t:[t]).map((function(t){return new Promise((function(r){e.getEventStatus(t)?r(e):e.emitter.once(t,(function(){e.setEventStatus(t,!0),r(e)}))}))}));return Promise.all(r).then((function(){return e}))},t.prototype.getEventStatus=function(t){var e=this._eventsStatus[t];return void 0!==e&&!!e},t}();function u(t){return{type:"Polygon",coordinates:[c(t)]}}function c(t){var e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}var s=Math.PI/180,f=180/Math.PI;function p(t,e,r,n){void 0===r&&(r=10),void 0===n&&(n=6);for(var o=r/6371*f,i=o/Math.cos(e*s),a=[],u=0;u<n+1;u++){var c=Math.PI*(u/(n/2)),p=t+i*Math.cos(c),l=e+o*Math.sin(c);a.push([p,l])}return a}function l(t,e){y(t,(function(t){if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(var r=0,n=t.coordinates;r<n.length;r++){n[r].forEach((function(t){return e(t)}))}else if("MultiPolygon"===t.type)for(var o=0,i=t.coordinates;o<i.length;o++){i[o].forEach((function(t){return t.forEach((function(t){return e(t)}))}))}else if("Point"===t.type)e(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(var a=0,u=t.coordinates;a<u.length;a++){e(u[a])}return t}))}function y(t,e){if("FeatureCollection"===t.type)for(var r=0,n=t.features;r<n.length;r++){e(n[r].geometry)}else"Feature"===t.type?e(t.geometry):"coordinates"in t&&e(t)}function d(t,e,r,n){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===r?e===n:g(t,e));return t===e}function g(t,e){var r=Object.keys(t).sort(),n=Object.keys(e).sort();if(r.length!==n.length)return!1;if(r.join("")!==n.join(""))return!1;for(var o=0;o<r.length;o++){if(!d(t[r[o]],e[n[o]],t,e))return!1}return!0}function v(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(m(t)?x(t):!!j(t)&&h(t))}function h(t){return!!j(t)&&t.every(v)}function x(t){if(m(t))for(var e in t)if(!v(e))return!1;return!1}function b(t,e){return("string"==typeof e||"number"==typeof e)&&e in t}function m(t){return"[object Object]"===Object.prototype.toString.call(t)}function j(t){return"[object Array]"===Object.prototype.toString.call(t)}var P=function(){function t(t){this.silent=!0,t&&this.copy(t)}return t.copy=function(e){return(new t).copy(e)},t.prototype.copy=function(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(e){!this.silent&&console.log("Please copy manually")}return!1},t.prototype.copyToClipboard=function(t){var e=document.createElement("input");e.value=t;try{document.body.appendChild(e),this.copyNodeContentsToClipboard(e)}finally{document.body.removeChild(e)}},t.prototype.copyNodeContentsToClipboard=function(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")},t}();exports.Clipboard=P,exports.DebounceDecorator=function(t){return void 0===t&&(t=10),function(e,r,n){return{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,r,{configurable:!0,enumerable:n.enumerable,value:i(n.value,t)}),this[r]}}}},exports.EARTHS_RADIUS=6371,exports.Events=a,exports.allProperties=r,exports.applyMixins=function(t,e,n){void 0===n&&(n={});var o=r(t.prototype),i=void 0===n.replace||n.replace;e.forEach((function(e){Object.getOwnPropertyNames(e.prototype).forEach((function(r){var n=-1!==o.indexOf(r);if(!i&&!n||i){var a=Object.getOwnPropertyDescriptor(e.prototype,r);a&&Object.defineProperty(t.prototype,r,a)}}))}))},exports.arrayChunk=function(t,e){return Array.from({length:Math.ceil(t.length/e)},(function(r,n){return t.slice(n*e,n*e+e)}))},exports.arrayCompare=function(t,e){return n(t=Array.from(t).sort(),e=Array.from(e).sort())},exports.arrayCompareStrict=function(t,e){return n(t=Array.from(t),e=Array.from(e))},exports.arrayUnique=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},exports.camelize=function(t,e){void 0===e&&(e=/[_.\- ]/);for(var r=t.split(e),n="",o=0;o<r.length;o++){var i=r[o];n+=i.charAt(0).toUpperCase()+i.slice(1)}return n},exports.capitalize=function(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)},exports.coordinatesCount=function(t){var e=0;return l(t,(function(){return e++})),e},exports.debounce=i,exports.debugLog=function(t){return!1},exports.deepmerge=function t(e,r,n){void 0===n&&(n=!1);var o=e,i=r,a=Array.isArray(i),u=a&&[]||{};return a&&Array.isArray(i)?n?(u=u.concat(o=o||[]),i.forEach((function(e,r){void 0===u[r]?u[r]=e:"object"==typeof e?u[r]=t(o[r],e,n):-1===o.indexOf(e)&&u.push(e)}))):u=i:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){u[t]=o[t]})),Object.keys(i).forEach((function(e){u[e]="object"==typeof i[e]&&i[e]&&"object"==typeof o[e]&&"object"==typeof i[e]?t(o[e],i[e],n):i[e]}))),u},exports.defined=o,exports.degrees2Radian=function(t){return t*Math.PI/180},exports.degrees2meters=function(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;var r=20037508.34*t/180,n=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return[r,n=20037508.34*n/180]},exports.deprecatedMapClick=function(t){return!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat]),t},exports.deprecatedWarn=function(t){console.warn("DEPRECATED WARN: ".concat(t))},exports.eachCoordinates=l,exports.eachGeometry=y,exports.fixUrlStr=function(t){return t.replace(/([^:]\/)\/+/g,"$1")},exports.flatten=function(t,e){var r;void 0===e&&(e={});var n=null===(r=e.flatArray)||void 0===r||r,o={};return function t(e,r){if(Object(e)!==e)o[r]=e;else if(Array.isArray(e)&&n){for(var i=e.length,a=0;a<i;a++)t(e[a],r+"["+a+"]");0===i&&(o[r]=[])}else{var u=!0;for(var c in e)u=!1,t(e[c],r?r+"."+c:c);u&&r&&(o[r]={})}}(t,""),o},exports.full=function(t){return"string"==typeof t?!!t:o(t)},exports.getBoundsCoordinates=c,exports.getBoundsFeature=function(t){return{type:"Feature",properties:{},geometry:u(t)}},exports.getBoundsPolygon=u,exports.getCircleFeature=function(t,e,r,n){return void 0===r&&(r=10),void 0===n&&(n=6),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[p(t,e,r,n)]}}},exports.getCirclePolygonCoordinates=p,exports.getCoordinates=function(t){var e=[];return l(t,(function(t){return e.push(t)})),e},exports.getGlobalVariable=function(){return t?window:global},exports.getIdentifyRadius=function(t,e,r){return(r=null!=r?r:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4},exports.getPolygons=function(t){var e=[];return y(t,(function(t){if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((function(t){return e.push(t)}));else if("MultiPolygon"===t.type)for(var r=0,n=t.coordinates;r<n.length;r++)for(var o=0,i=n[r];o<i.length;o++){e.push(i[o])}return t})),e},exports.isAnyJson=v,exports.isArray=j,exports.isBrowser=t,exports.isJsonArray=h,exports.isJsonMap=x,exports.isLngLatBoundsArray=function(t){return Array.isArray(t)&&4===t.length&&t.every((function(t){return"number"==typeof t}))},exports.isObjKey=b,exports.isObject=m,exports.keyInObj=function(t,e){return b(t,e)},exports.latLngToLngLatArray=function(t){return[t.lng,t.lat]},exports.lngLatArrayToLatLng=function(t){return{lat:t[1],lng:t[0]}},exports.meters2degrees=function(t,e){return[180*t/20037508.34,360*Math.atan(Math.exp(e*Math.PI/20037508.34))/Math.PI-90]},exports.mixinProperties=function(t,e,r){r.forEach((function(r){var n=Object.getOwnPropertyDescriptor(e.prototype,r);n&&Object.defineProperty(t.prototype,r,n)}))},exports.numberWithSpaces=function(t){var e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),e.join(".")},exports.objectAssign=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0,o=e;n<o.length;n++)for(var i=o[n],a=0,u=Object.getOwnPropertyNames(i);a<u.length;a++){var c=u[a];t[c]=i[c]}},exports.objectDeepEqual=g,exports.objectRemoveEmpty=function t(e){var r={};return Object.keys(e).forEach((function(n){e[n]instanceof Array||e[n]!==Object(e[n])?void 0!==e[n]&&(r[n]=e[n]):r[n]=t(e[n])})),r},exports.reEscape=function(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},exports.round=function(t,e){var r=e?Number("1e+"+e):1;return Math.round((t+Number.EPSILON)*r)/r},exports.sleep=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))},exports.type=e,exports.unflatten=function(t){if(Object(t)!==t||Array.isArray(t))return t;var e=/\.?([^.[\]]+)|\[(\d+)\]/g,r={};for(var n in t){for(var o=r,i="",a=void 0;a=e.exec(n);)o=o[i]||(o[i]=a[2]?[]:{}),i=a[2]||a[1];o[i]=t[n]}return r[""]||r};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t="undefined"!=typeof window&&void 0!==window.document,e=t?"browser":"node";function o(t){return function(t,e=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const o=Object.getOwnPropertyNames(t);for(let t=0;t<o.length;t++)-1==e.indexOf(o[t])&&e.push(o[t])}return e}(t)}function r(t,e){return t.length===e.length&&t.every((function(t,o){return t===e[o]}))}function n(t){return null!=t}function s(t,e=10){let o;function r(...n){r.clear(),o=setTimeout((()=>{o=null,t.apply(this,n)}),e)}return r.clear=function(){o&&(clearTimeout(o),o=null)},r}const i=6371;function c(t){return{type:"Polygon",coordinates:[a(t)]}}function a(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}const u=Math.PI/180,p=180/Math.PI;function f(t,e,o=10,r=6){const n=o/i*p,s=n/Math.cos(e*u),c=[];for(let i=0;i<r+1;i++){const o=Math.PI*(i/(r/2)),a=t+s*Math.cos(o),u=e+n*Math.sin(o);c.push([a,u])}return c}function l(t,e){y(t,(t=>{if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(const o of t.coordinates)o.forEach((t=>e(t)));else if("MultiPolygon"===t.type)for(const o of t.coordinates)o.forEach((t=>t.forEach((t=>e(t)))));else if("Point"===t.type)e(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(const o of t.coordinates)e(o);return t}))}function y(t,e){if("FeatureCollection"===t.type)for(const o of t.features)e(o.geometry);else"Feature"===t.type?e(t.geometry):"coordinates"in t&&e(t)}function d(t,e,o,r){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===o?e===r:g(t,e));return t===e}function g(t,e){const o=Object.keys(t).sort(),r=Object.keys(e).sort();if(o.length!==r.length)return!1;if(o.join("")!==r.join(""))return!1;for(let n=0;n<o.length;n++){if(!d(t[o[n]],e[r[n]],t,e))return!1}return!0}function h(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(j(t)?b(t):!!P(t)&&x(t))}function x(t){return!!P(t)&&t.every(h)}function b(t){if(j(t))for(const e in t)if(!h(e))return!1;return!1}function m(t,e){return("string"==typeof e||"number"==typeof e)&&e in t}function j(t){return"[object Object]"===Object.prototype.toString.call(t)}function P(t){return"[object Array]"===Object.prototype.toString.call(t)}class O{constructor(t){this.silent=!0,t&&this.copy(t)}static copy(t){return(new O).copy(t)}copy(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(e){!this.silent&&console.log("Please copy manually")}return!1}copyToClipboard(t){const e=document.createElement("input");e.value=t;try{document.body.appendChild(e),this.copyNodeContentsToClipboard(e)}finally{document.body.removeChild(e)}}copyNodeContentsToClipboard(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}}exports.Clipboard=O,exports.DebounceDecorator=function(t=10){return function(e,o,r){return{configurable:!0,enumerable:r.enumerable,get:function(){return Object.defineProperty(this,o,{configurable:!0,enumerable:r.enumerable,value:s(r.value,t)}),this[o]}}}},exports.EARTHS_RADIUS=i,exports.Events=class{constructor(t){this.emitter=t,this._eventsStatus={}}setEventStatus(t,e){this._eventsStatus[t]=e}onLoad(t){const e=(Array.isArray(t)?t:[t]).map((t=>new Promise((e=>{if(this.getEventStatus(t))e(this);else{this.emitter.once(t,(()=>{this.setEventStatus(t,!0),e(this)}))}}))));return Promise.all(e).then((()=>this))}getEventStatus(t){const e=this._eventsStatus[t];return void 0!==e&&!!e}},exports.allProperties=o,exports.applyMixins=function(t,e,r={}){const n=o(t.prototype),s=void 0===r.replace||r.replace;e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((o=>{const r=-1!==n.indexOf(o);if(!s&&!r||s){const r=Object.getOwnPropertyDescriptor(e.prototype,o);r&&Object.defineProperty(t.prototype,o,r)}}))}))},exports.arrayChunk=function(t,e){return Array.from({length:Math.ceil(t.length/e)},((o,r)=>t.slice(r*e,r*e+e)))},exports.arrayCompare=function(t,e){return r(t=Array.from(t).sort(),e=Array.from(e).sort())},exports.arrayCompareStrict=function(t,e){return r(t=Array.from(t),e=Array.from(e))},exports.arrayUnique=function(t){return t.filter(((t,e,o)=>o.indexOf(t)==e))},exports.camelize=function(t,e=/[_.\- ]/){const o=t.split(e);let r="";for(let n=0;n<o.length;n++){const t=o[n];r+=t.charAt(0).toUpperCase()+t.slice(1)}return r},exports.capitalize=function(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)},exports.coordinatesCount=function(t){let e=0;return l(t,(()=>e++)),e},exports.debounce=s,exports.debugLog=function(t){return!1},exports.deepmerge=function t(e,o,r=!1){let n=e;const s=o,i=Array.isArray(s);let c=i&&[]||{};return i&&Array.isArray(s)?r?(n=n||[],c=c.concat(n),s.forEach(((e,o)=>{void 0===c[o]?c[o]=e:"object"==typeof e?c[o]=t(n[o],e,r):-1===n.indexOf(e)&&c.push(e)}))):c=s:(n&&"object"==typeof n&&Object.keys(n).forEach((function(t){c[t]=n[t]})),Object.keys(s).forEach((function(e){c[e]="object"==typeof s[e]&&s[e]&&"object"==typeof n[e]&&"object"==typeof s[e]?t(n[e],s[e],r):s[e]}))),c},exports.defined=n,exports.degrees2Radian=function(t){return t*Math.PI/180},exports.degrees2meters=function(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;const o=20037508.34*t/180;let r=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return r=20037508.34*r/180,[o,r]},exports.deprecatedMapClick=function(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t},exports.deprecatedWarn=function(t){console.warn(`DEPRECATED WARN: ${t}`)},exports.eachCoordinates=l,exports.eachGeometry=y,exports.fixUrlStr=function(t){return t.replace(/([^:]\/)\/+/g,"$1")},exports.flatten=function(t,e={}){var o;const r=null===(o=e.flatArray)||void 0===o||o,n={};return function t(e,o){if(Object(e)!==e)n[o]=e;else if(Array.isArray(e)&&r){const r=e.length;for(let n=0;n<r;n++)t(e[n],o+"["+n+"]");0===r&&(n[o]=[])}else{let r=!0;for(const n in e)r=!1,t(e[n],o?o+"."+n:n);r&&o&&(n[o]={})}}(t,""),n},exports.full=function(t){return"string"==typeof t?!!t:n(t)},exports.getBoundsCoordinates=a,exports.getBoundsFeature=function(t){return{type:"Feature",properties:{},geometry:c(t)}},exports.getBoundsPolygon=c,exports.getCircleFeature=function(t,e,o=10,r=6){return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[f(t,e,o,r)]}}},exports.getCirclePolygonCoordinates=f,exports.getCoordinates=function(t){const e=[];return l(t,(t=>e.push(t))),e},exports.getGlobalVariable=function(){return t?window:global},exports.getIdentifyRadius=function(t,e,o){return(o=null!=o?o:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4},exports.getPolygons=function(t){const e=[];return y(t,(t=>{if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((t=>e.push(t)));else if("MultiPolygon"===t.type)for(const o of t.coordinates)for(const t of o)e.push(t);return t})),e},exports.isAnyJson=h,exports.isArray=P,exports.isBrowser=t,exports.isJsonArray=x,exports.isJsonMap=b,exports.isLngLatBoundsArray=function(t){return Array.isArray(t)&&4===t.length&&t.every((t=>"number"==typeof t))},exports.isObjKey=m,exports.isObject=j,exports.keyInObj=function(t,e){return m(t,e)},exports.latLngToLngLatArray=function(t){return[t.lng,t.lat]},exports.lngLatArrayToLatLng=function(t){return{lat:t[1],lng:t[0]}},exports.meters2degrees=function(t,e){return[180*t/20037508.34,360*Math.atan(Math.exp(e*Math.PI/20037508.34))/Math.PI-90]},exports.mixinProperties=function(t,e,o){o.forEach((o=>{const r=Object.getOwnPropertyDescriptor(e.prototype,o);r&&Object.defineProperty(t.prototype,o,r)}))},exports.numberWithSpaces=function(t){const e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),e.join(".")},exports.objectAssign=function(t,...e){for(const o of e)for(const e of Object.getOwnPropertyNames(o))t[e]=o[e]},exports.objectDeepEqual=g,exports.objectRemoveEmpty=function t(e){const o={};return Object.keys(e).forEach((r=>{e[r]instanceof Array||e[r]!==Object(e[r])?void 0!==e[r]&&(o[r]=e[r]):o[r]=t(e[r])})),o},exports.reEscape=function(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},exports.round=function(t,e){const o=e?Number("1e+"+e):1;return Math.round((t+Number.EPSILON)*o)/o},exports.sleep=function(t=0){return new Promise((e=>setTimeout(e,t)))},exports.type=e,exports.unflatten=function(t){if(Object(t)!==t||Array.isArray(t))return t;const e=/\.?([^.[\]]+)|\[(\d+)\]/g,o={};for(const r in t){let n,s=o,i="";for(;n=e.exec(r);)s=s[i]||(s[i]=n[2]?[]:{}),i=n[2]||n[1];s[i]=t[r]}return o[""]||o};
//# sourceMappingURL=utils.cjs.prod.js.map

@@ -1,4 +0,4 @@

/** Bundle of @nextgis/utils; version: 1.16.8; author: NextGIS */
var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
var type = isBrowser ? 'browser' : 'node';
/** Bundle of @nextgis/utils; version: 1.17.0; author: NextGIS */
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
const type = isBrowser ? 'browser' : 'node';
function getGlobalVariable() {

@@ -14,11 +14,10 @@ if (isBrowser) {

function applyMixins(derivedCtor, baseCtors, opt) {
if (opt === void 0) { opt = {}; }
var derivedProperties = allProperties(derivedCtor.prototype);
var replace = opt.replace !== undefined ? opt.replace : true;
baseCtors.forEach(function (baseCtor) {
Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {
var isSomeProp = derivedProperties.indexOf(name) !== -1;
function applyMixins(derivedCtor, baseCtors, opt = {}) {
const derivedProperties = allProperties(derivedCtor.prototype);
const replace = opt.replace !== undefined ? opt.replace : true;
baseCtors.forEach((baseCtor) => {
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
const isSomeProp = derivedProperties.indexOf(name) !== -1;
if ((!replace && !isSomeProp) || replace) {
var descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
if (descriptor) {

@@ -34,7 +33,6 @@ Object.defineProperty(derivedCtor.prototype, name, descriptor);

}
function _allProperties(obj, _props) {
if (_props === void 0) { _props = []; }
function _allProperties(obj, _props = []) {
for (; obj !== null; obj = Object.getPrototypeOf(obj)) {
var op = Object.getOwnPropertyNames(obj);
for (var i = 0; i < op.length; i++) {
const op = Object.getOwnPropertyNames(obj);
for (let i = 0; i < op.length; i++) {
if (_props.indexOf(op[i]) == -1) {

@@ -48,4 +46,4 @@ _props.push(op[i]);

function mixinProperties(derivedCtor, baseCtor, properties) {
properties.forEach(function (name) {
var descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
properties.forEach((name) => {
const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
if (descriptor) {

@@ -94,3 +92,3 @@ Object.defineProperty(derivedCtor.prototype, name, descriptor);

function arrayUnique(arr) {
return arr.filter(function (elem, pos, arr) {
return arr.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;

@@ -101,5 +99,3 @@ });

function arrayChunk(arr, size) {
return Array.from({ length: Math.ceil(arr.length / size) }, function (v, i) {
return arr.slice(i * size, i * size + size);
});
return Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));
}

@@ -143,8 +139,7 @@

function deepmerge(target, src, mergeArray) {
if (mergeArray === void 0) { mergeArray = false; }
var target_ = target;
var src_ = src;
var array = Array.isArray(src_);
var dst = (array && []) || {};
function deepmerge(target, src, mergeArray = false) {
let target_ = target;
const src_ = src;
const array = Array.isArray(src_);
let dst = (array && []) || {};
if (array && Array.isArray(src_)) {

@@ -154,3 +149,3 @@ if (mergeArray) {

dst = dst.concat(target_);
src_.forEach(function (e, i) {
src_.forEach((e, i) => {
if (typeof dst[i] === 'undefined') {

@@ -211,4 +206,4 @@ dst[i] = e;

debugLog('deprecated use of latLng in MapClickEvent, use lngLat instead');
var lat = ev.latLng.lat;
var lng = ev.latLng.lng;
const lat = ev.latLng.lat;
const lng = ev.latLng.lng;
ev.lngLat = [lng, lat];

@@ -221,19 +216,13 @@ }

function deprecatedWarn(message) {
console.warn("DEPRECATED WARN: ".concat(message));
console.warn(`DEPRECATED WARN: ${message}`);
}
// based on https://github.com/bvaughn/debounce-decorator
function debounce(cb, wait) {
if (wait === void 0) { wait = 10; }
var timeoutId;
function wrapper() {
var _this = this;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
function debounce(cb, wait = 10) {
let timeoutId;
function wrapper(...args) {
wrapper.clear();
timeoutId = setTimeout(function () {
timeoutId = setTimeout(() => {
timeoutId = null;
cb.apply(_this, args);
cb.apply(this, args);
}, wait);

@@ -249,4 +238,3 @@ }

}
function DebounceDecorator(wait) {
if (wait === void 0) { wait = 10; }
function DebounceDecorator(wait = 10) {
return function (target, key, descriptor) {

@@ -270,37 +258,33 @@ return {

var Events = /** @class */ (function () {
function Events(emitter) {
class Events {
constructor(emitter) {
this.emitter = emitter;
this._eventsStatus = {};
}
Events.prototype.setEventStatus = function (event, status) {
setEventStatus(event, status) {
this._eventsStatus[event] = status;
};
Events.prototype.onLoad = function (event) {
var _this = this;
var events = Array.isArray(event) ? event : [event];
var promises = events.map(function (x) {
return new Promise(function (res) {
if (_this.getEventStatus(x)) {
res(_this);
}
else {
var e = x;
_this.emitter.once(e, function () {
_this.setEventStatus(x, true);
res(_this);
});
}
});
});
return Promise.all(promises).then(function () { return _this; });
};
Events.prototype.getEventStatus = function (event) {
}
onLoad(event) {
const events = Array.isArray(event) ? event : [event];
const promises = events.map((x) => new Promise((res) => {
if (this.getEventStatus(x)) {
res(this);
}
else {
const e = x;
this.emitter.once(e, () => {
this.setEventStatus(x, true);
res(this);
});
}
}));
return Promise.all(promises).then(() => this);
}
getEventStatus(event) {
// ugly hack to disable type checking error
var _eventName = event;
var status = this._eventsStatus[_eventName];
const _eventName = event;
const status = this._eventsStatus[_eventName];
return status !== undefined ? !!status : false;
};
return Events;
}());
}
}

@@ -317,6 +301,6 @@ function latLngToLngLatArray(latLng) {

*/
var EARTHS_RADIUS = 6371;
const EARTHS_RADIUS = 6371;
function getBoundsPolygon(b) {
var polygon = {
const polygon = {
type: 'Polygon',

@@ -328,10 +312,10 @@ coordinates: [getBoundsCoordinates(b)],

function getBoundsCoordinates(b) {
var westNorth = [b[0], b[1]];
var eastNorth = [b[2], b[1]];
var eastSouth = [b[2], b[3]];
var westSouth = [b[0], b[3]];
const westNorth = [b[0], b[1]];
const eastNorth = [b[2], b[1]];
const eastSouth = [b[2], b[3]];
const westSouth = [b[0], b[3]];
return [westNorth, eastNorth, eastSouth, westSouth, westNorth];
}
function getBoundsFeature(b) {
var feature = {
const feature = {
type: 'Feature',

@@ -344,18 +328,16 @@ properties: {},

var d2r = Math.PI / 180; // degrees to radians
var r2d = 180 / Math.PI; // radians to degrees
const d2r = Math.PI / 180; // degrees to radians
const r2d = 180 / Math.PI; // radians to degrees
function getCirclePolygonCoordinates(lng, lat,
/** In kilometers */
radius, points) {
if (radius === void 0) { radius = 10; }
if (points === void 0) { points = 6; }
radius = 10, points = 6) {
// find the radius in lat/lon
var rlat = (radius / EARTHS_RADIUS) * r2d;
var rlng = rlat / Math.cos(lat * d2r);
var extp = [];
for (var i = 0; i < points + 1; i++) {
const rlat = (radius / EARTHS_RADIUS) * r2d;
const rlng = rlat / Math.cos(lat * d2r);
const extp = [];
for (let i = 0; i < points + 1; i++) {
// one extra here makes sure we connect the
var theta = Math.PI * (i / (points / 2));
var ex = lng + rlng * Math.cos(theta); // center a + radius x * cos(theta)
var ey = lat + rlat * Math.sin(theta); // center b + radius y * sin(theta)
const theta = Math.PI * (i / (points / 2));
const ex = lng + rlng * Math.cos(theta); // center a + radius x * cos(theta)
const ey = lat + rlat * Math.sin(theta); // center b + radius y * sin(theta)
extp.push([ex, ey]);

@@ -365,7 +347,5 @@ }

}
function getCircleFeature(lng, lat, radius, points) {
if (radius === void 0) { radius = 10; }
if (points === void 0) { points = 6; }
var polygon = getCirclePolygonCoordinates(lng, lat, radius, points);
var feature = {
function getCircleFeature(lng, lat, radius = 10, points = 6) {
const polygon = getCirclePolygonCoordinates(lng, lat, radius, points);
const feature = {
type: 'Feature',

@@ -383,4 +363,4 @@ properties: {},

lat = lat > 85.06 ? 85.06 : lat < -85.06 ? -85.06 : lat;
var x = (lng * 20037508.34) / 180;
var y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360)) / (Math.PI / 180);
const x = (lng * 20037508.34) / 180;
let y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360)) / (Math.PI / 180);
y = (y * 20037508.34) / 180;

@@ -390,4 +370,4 @@ return [x, y];

function meters2degrees(x, y) {
var lon = (x * 180) / 20037508.34;
var lat = (Math.atan(Math.exp((y * Math.PI) / 20037508.34)) * 360) / Math.PI - 90;
const lon = (x * 180) / 20037508.34;
const lat = (Math.atan(Math.exp((y * Math.PI) / 20037508.34)) * 360) / Math.PI - 90;
return [lon, lat];

@@ -419,24 +399,22 @@ }

function coordinatesCount(geojson) {
var count = 0;
eachCoordinates(geojson, function () { return count++; });
let count = 0;
eachCoordinates(geojson, () => count++);
return count;
}
function getCoordinates(geojson) {
var coordinates = [];
eachCoordinates(geojson, function (pos) { return coordinates.push(pos); });
const coordinates = [];
eachCoordinates(geojson, (pos) => coordinates.push(pos));
return coordinates;
}
function eachCoordinates(geojson, cb) {
eachGeometry(geojson, function (geom) {
eachGeometry(geojson, (geom) => {
if ('coordinates' in geom) {
if (geom.type === 'Polygon' || geom.type === 'MultiLineString') {
for (var _i = 0, _a = geom.coordinates; _i < _a.length; _i++) {
var x = _a[_i];
x.forEach(function (y) { return cb(y); });
for (const x of geom.coordinates) {
x.forEach((y) => cb(y));
}
}
else if (geom.type === 'MultiPolygon') {
for (var _b = 0, _c = geom.coordinates; _b < _c.length; _b++) {
var x = _c[_b];
x.forEach(function (y) { return y.forEach(function (z) { return cb(z); }); });
for (const x of geom.coordinates) {
x.forEach((y) => y.forEach((z) => cb(z)));
}

@@ -448,4 +426,3 @@ }

else if (geom.type === 'MultiPoint' || geom.type === 'LineString') {
for (var _d = 0, _e = geom.coordinates; _d < _e.length; _d++) {
var x = _e[_d];
for (const x of geom.coordinates) {
cb(x);

@@ -459,13 +436,11 @@ }

function getPolygons(geojson) {
var polygons = [];
eachGeometry(geojson, function (geom) {
const polygons = [];
eachGeometry(geojson, (geom) => {
if ('coordinates' in geom) {
if (geom.type === 'Polygon') {
geom.coordinates.forEach(function (x) { return polygons.push(x); });
geom.coordinates.forEach((x) => polygons.push(x));
}
else if (geom.type === 'MultiPolygon') {
for (var _i = 0, _a = geom.coordinates; _i < _a.length; _i++) {
var x = _a[_i];
for (var _b = 0, x_1 = x; _b < x_1.length; _b++) {
var y = x_1[_b];
for (const x of geom.coordinates) {
for (const y of x) {
polygons.push(y);

@@ -482,4 +457,3 @@ }

if (geojson.type === 'FeatureCollection') {
for (var _i = 0, _a = geojson.features; _i < _a.length; _i++) {
var f = _a[_i];
for (const f of geojson.features) {
cb(f.geometry);

@@ -499,3 +473,3 @@ }

array.length === 4 &&
array.every(function (x) { return typeof x === 'number'; }));
array.every((x) => typeof x === 'number'));
}

@@ -505,5 +479,5 @@

pixelRadius = pixelRadius !== null && pixelRadius !== void 0 ? pixelRadius : 10;
var metresPerPixel = (40075016.686 * Math.abs(Math.cos((center[1] * 180) / Math.PI))) /
const metresPerPixel = (40075016.686 * Math.abs(Math.cos((center[1] * 180) / Math.PI))) /
Math.pow(2, zoom + 8);
var radius = pixelRadius * metresPerPixel * 0.0005;
const radius = pixelRadius * metresPerPixel * 0.0005;
return radius;

@@ -518,11 +492,5 @@ }

*/
function objectAssign(target) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
var source = sources_1[_a];
for (var _b = 0, _c = Object.getOwnPropertyNames(source); _b < _c.length; _b++) {
var prop = _c[_b];
function objectAssign(target, ...sources) {
for (const source of sources) {
for (const prop of Object.getOwnPropertyNames(source)) {
target[prop] = source[prop];

@@ -565,4 +533,4 @@ }

function objectDeepEqual(o, p) {
var keysO = Object.keys(o).sort();
var keysP = Object.keys(p).sort();
const keysO = Object.keys(o).sort();
const keysP = Object.keys(p).sort();
if (keysO.length !== keysP.length)

@@ -572,5 +540,5 @@ return false;

return false;
for (var i = 0; i < keysO.length; i++) {
var oVal = o[keysO[i]];
var pVal = p[keysP[i]];
for (let i = 0; i < keysO.length; i++) {
const oVal = o[keysO[i]];
const pVal = p[keysP[i]];
if (!isEqual(oVal, pVal, o, p)) {

@@ -584,4 +552,4 @@ return false;

function objectRemoveEmpty(obj) {
var newObj = {};
Object.keys(obj).forEach(function (key) {
const newObj = {};
Object.keys(obj).forEach((key) => {
if (!(obj[key] instanceof Array) && obj[key] === Object(obj[key])) {

@@ -597,7 +565,6 @@ newObj[key] = objectRemoveEmpty(obj[key]);

function flatten(data, opt) {
function flatten(data, opt = {}) {
var _a;
if (opt === void 0) { opt = {}; }
var flatArray = (_a = opt.flatArray) !== null && _a !== void 0 ? _a : true;
var result = {};
const flatArray = (_a = opt.flatArray) !== null && _a !== void 0 ? _a : true;
const result = {};
function recurse(cur, prop) {

@@ -608,4 +575,4 @@ if (Object(cur) !== cur) {

else if (Array.isArray(cur) && flatArray) {
var l = cur.length;
for (var i = 0; i < l; i++) {
const l = cur.length;
for (let i = 0; i < l; i++) {
recurse(cur[i], prop + '[' + i + ']');

@@ -617,4 +584,4 @@ }

else {
var isEmpty = true;
for (var p in cur) {
let isEmpty = true;
for (const p in cur) {
isEmpty = false;

@@ -634,8 +601,8 @@ recurse(cur[p], prop ? prop + '.' + p : p);

return data;
var regex = /\.?([^.[\]]+)|\[(\d+)\]/g;
var flat = {};
for (var p in data) {
var cur = flat;
var prop = '';
var m = void 0;
const regex = /\.?([^.[\]]+)|\[(\d+)\]/g;
const flat = {};
for (const p in data) {
let cur = flat;
let prop = '';
let m;
while ((m = regex.exec(p))) {

@@ -654,5 +621,4 @@ cur = cur[prop] || (cur[prop] = m[2] ? [] : {});

function sleep(delay) {
if (delay === void 0) { delay = 0; }
return new Promise(function (resolve) { return setTimeout(resolve, delay); });
function sleep(delay = 0) {
return new Promise((resolve) => setTimeout(resolve, delay));
}

@@ -671,11 +637,10 @@

*/
function camelize(text, separator) {
if (separator === void 0) { separator = /[_.\- ]/; }
function camelize(text, separator = /[_.\- ]/) {
// Cut the string into words
var words = text.split(separator);
const words = text.split(separator);
// Concatenate all capitalized words to get camelized string
var result = "";
for (var i = 0; i < words.length; i++) {
var word = words[i];
var capitalizedWord = word.charAt(0).toUpperCase() + word.slice(1);
let result = "";
for (let i = 0; i < words.length; i++) {
const word = words[i];
const capitalizedWord = word.charAt(0).toUpperCase() + word.slice(1);
result += capitalizedWord;

@@ -687,3 +652,3 @@ }

function numberWithSpaces(x) {
var parts = x.toString().split('.');
const parts = x.toString().split('.');
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ' ');

@@ -694,3 +659,3 @@ return parts.join('.');

function round(val, toFixed) {
var n = toFixed ? Number('1e+' + toFixed) : 1;
const n = toFixed ? Number('1e+' + toFixed) : 1;
return Math.round((val + Number.EPSILON) * n) / n;

@@ -722,3 +687,3 @@ }

if (isObject(val)) {
for (var i in val) {
for (const i in val) {
if (!isAnyJson(i)) {

@@ -758,4 +723,4 @@ return false;

var Clipboard = /** @class */ (function () {
function Clipboard(text) {
class Clipboard {
constructor(text) {
this.silent = true;

@@ -766,7 +731,7 @@ if (text) {

}
Clipboard.copy = function (text) {
var clipboard = new Clipboard();
static copy(text) {
const clipboard = new Clipboard();
return clipboard.copy(text);
};
Clipboard.prototype.copy = function (text) {
}
copy(text) {
try {

@@ -789,5 +754,5 @@ if (navigator.clipboard) {

return false;
};
Clipboard.prototype.copyToClipboard = function (text) {
var input = document.createElement('input');
}
copyToClipboard(text) {
const input = document.createElement('input');
input.value = text;

@@ -801,12 +766,11 @@ try {

}
};
Clipboard.prototype.copyNodeContentsToClipboard = function (input) {
}
copyNodeContentsToClipboard(input) {
input.select();
input.setSelectionRange(0, 99999); /*For mobile devices*/
document.execCommand('copy');
};
return Clipboard;
}());
}
}
export { Clipboard, DebounceDecorator, EARTHS_RADIUS, Events, allProperties, applyMixins, arrayChunk, arrayCompare, arrayCompareStrict, arrayUnique, camelize, capitalize, coordinatesCount, debounce, debugLog, deepmerge, defined, degrees2Radian, degrees2meters, deprecatedMapClick, deprecatedWarn, eachCoordinates, eachGeometry, fixUrlStr, flatten, full, getBoundsCoordinates, getBoundsFeature, getBoundsPolygon, getCircleFeature, getCirclePolygonCoordinates, getCoordinates, getGlobalVariable, getIdentifyRadius, getPolygons, isAnyJson, isArray, isBrowser, isJsonArray, isJsonMap, isLngLatBoundsArray, isObjKey, isObject, keyInObj, latLngToLngLatArray, lngLatArrayToLatLng, meters2degrees, mixinProperties, numberWithSpaces, objectAssign, objectDeepEqual, objectRemoveEmpty, reEscape, round, sleep, type, unflatten };
//# sourceMappingURL=utils.esm-browser.js.map

@@ -1,2 +0,2 @@

var t="undefined"!=typeof window&&void 0!==window.document,n=t?"browser":"node";function r(){return t?window:global}function e(t,n,r){void 0===r&&(r={});var e=o(t.prototype),i=void 0===r.replace||r.replace;n.forEach((function(n){Object.getOwnPropertyNames(n.prototype).forEach((function(r){var o=-1!==e.indexOf(r);if(!i&&!o||i){var u=Object.getOwnPropertyDescriptor(n.prototype,r);u&&Object.defineProperty(t.prototype,r,u)}}))}))}function o(t){return function(t,n){void 0===n&&(n=[]);for(;null!==t;t=Object.getPrototypeOf(t))for(var r=Object.getOwnPropertyNames(t),e=0;e<r.length;e++)-1==n.indexOf(r[e])&&n.push(r[e]);return n}(t)}function i(t,n,r){r.forEach((function(r){var e=Object.getOwnPropertyDescriptor(n.prototype,r);e&&Object.defineProperty(t.prototype,r,e)}))}function u(t,n){return a(t=Array.from(t).sort(),n=Array.from(n).sort())}function c(t,n){return a(t=Array.from(t),n=Array.from(n))}function a(t,n){return t.length===n.length&&t.every((function(t,r){return t===n[r]}))}function f(t){return t.filter((function(t,n,r){return r.indexOf(t)==n}))}function l(t,n){return Array.from({length:Math.ceil(t.length/n)},(function(r,e){return t.slice(e*n,e*n+n)}))}function s(t){return null!=t}function p(t){return"string"==typeof t?!!t:s(t)}function y(t,n,r){void 0===r&&(r=!1);var e=t,o=n,i=Array.isArray(o),u=i&&[]||{};return i&&Array.isArray(o)?r?(u=u.concat(e=e||[]),o.forEach((function(t,n){void 0===u[n]?u[n]=t:"object"==typeof t?u[n]=y(e[n],t,r):-1===e.indexOf(t)&&u.push(t)}))):u=o:(e&&"object"==typeof e&&Object.keys(e).forEach((function(t){u[t]=e[t]})),Object.keys(o).forEach((function(t){u[t]="object"==typeof o[t]&&o[t]&&"object"==typeof e[t]&&"object"==typeof o[t]?y(e[t],o[t],r):o[t]}))),u}function v(t){return!1}function h(t){!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat]);return t}function d(t){console.warn("DEPRECATED WARN: ".concat(t))}function g(t,n){var r;function e(){for(var o=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];e.clear(),r=setTimeout((function(){r=null,t.apply(o,i)}),n)}return void 0===n&&(n=10),e.clear=function(){r&&(clearTimeout(r),r=null)},e}function b(t){return void 0===t&&(t=10),function(n,r,e){return{configurable:!0,enumerable:e.enumerable,get:function(){return Object.defineProperty(this,r,{configurable:!0,enumerable:e.enumerable,value:g(e.value,t)}),this[r]}}}}var m=function(){function t(t){this.emitter=t,this._eventsStatus={}}return t.prototype.setEventStatus=function(t,n){this._eventsStatus[t]=n},t.prototype.onLoad=function(t){var n=this,r=(Array.isArray(t)?t:[t]).map((function(t){return new Promise((function(r){n.getEventStatus(t)?r(n):n.emitter.once(t,(function(){n.setEventStatus(t,!0),r(n)}))}))}));return Promise.all(r).then((function(){return n}))},t.prototype.getEventStatus=function(t){var n=this._eventsStatus[t];return void 0!==n&&!!n},t}();function j(t){return[t.lng,t.lat]}function O(t){return{lat:t[1],lng:t[0]}}var P=6371;function A(t){return{type:"Polygon",coordinates:[M(t)]}}function M(t){var n=[t[0],t[1]];return[n,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],n]}function w(t){return{type:"Feature",properties:{},geometry:A(t)}}var E=Math.PI/180,C=180/Math.PI;function S(t,n,r,e){void 0===r&&(r=10),void 0===e&&(e=6);for(var o=r/6371*C,i=o/Math.cos(n*E),u=[],c=0;c<e+1;c++){var a=Math.PI*(c/(e/2)),f=t+i*Math.cos(a),l=n+o*Math.sin(a);u.push([f,l])}return u}function x(t,n,r,e){return void 0===r&&(r=10),void 0===e&&(e=6),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[S(t,n,r,e)]}}}function I(t,n){n=n>85.06?85.06:n<-85.06?-85.06:n;var r=20037508.34*t/180,e=Math.log(Math.tan((90+n)*Math.PI/360))/(Math.PI/180);return[r,e=20037508.34*e/180]}function L(t,n){return[180*t/20037508.34,360*Math.atan(Math.exp(n*Math.PI/20037508.34))/Math.PI-90]}function D(t){return t*Math.PI/180}function N(t){var n=0;return F(t,(function(){return n++})),n}function T(t){var n=[];return F(t,(function(t){return n.push(t)})),n}function F(t,n){_(t,(function(t){if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(var r=0,e=t.coordinates;r<e.length;r++){e[r].forEach((function(t){return n(t)}))}else if("MultiPolygon"===t.type)for(var o=0,i=t.coordinates;o<i.length;o++){i[o].forEach((function(t){return t.forEach((function(t){return n(t)}))}))}else if("Point"===t.type)n(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(var u=0,c=t.coordinates;u<c.length;u++){n(c[u])}return t}))}function k(t){var n=[];return _(t,(function(t){if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((function(t){return n.push(t)}));else if("MultiPolygon"===t.type)for(var r=0,e=t.coordinates;r<e.length;r++)for(var o=0,i=e[r];o<i.length;o++){n.push(i[o])}return t})),n}function _(t,n){if("FeatureCollection"===t.type)for(var r=0,e=t.features;r<e.length;r++){n(e[r].geometry)}else"Feature"===t.type?n(t.geometry):"coordinates"in t&&n(t)}function R(t){return Array.isArray(t)&&4===t.length&&t.every((function(t){return"number"==typeof t}))}function $(t,n,r){return(r=null!=r?r:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,n+8))*5e-4}function U(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var e=0,o=n;e<o.length;e++)for(var i=o[e],u=0,c=Object.getOwnPropertyNames(i);u<c.length;u++){var a=c[u];t[a]=i[a]}}function B(t,n,r,e){if(t instanceof Array)return n instanceof Array&&n.sort().join("")===t.sort().join("");if(t instanceof Date)return n instanceof Date&&""+t==""+n;if(t instanceof Function){if(!(n instanceof Function))return!1}else if(t instanceof Object)return n instanceof Object&&(t===r?n===e:W(t,n));return t===n}function W(t,n){var r=Object.keys(t).sort(),e=Object.keys(n).sort();if(r.length!==e.length)return!1;if(r.join("")!==e.join(""))return!1;for(var o=0;o<r.length;o++){if(!B(t[r[o]],n[e[o]],t,n))return!1}return!0}function q(t){var n={};return Object.keys(t).forEach((function(r){t[r]instanceof Array||t[r]!==Object(t[r])?void 0!==t[r]&&(n[r]=t[r]):n[r]=q(t[r])})),n}function z(t,n){var r;void 0===n&&(n={});var e=null===(r=n.flatArray)||void 0===r||r,o={};return function t(n,r){if(Object(n)!==n)o[r]=n;else if(Array.isArray(n)&&e){for(var i=n.length,u=0;u<i;u++)t(n[u],r+"["+u+"]");0===i&&(o[r]=[])}else{var c=!0;for(var a in n)c=!1,t(n[a],r?r+"."+a:a);c&&r&&(o[r]={})}}(t,""),o}function G(t){if(Object(t)!==t||Array.isArray(t))return t;var n=/\.?([^.[\]]+)|\[(\d+)\]/g,r={};for(var e in t){for(var o=r,i="",u=void 0;u=n.exec(e);)o=o[i]||(o[i]=u[2]?[]:{}),i=u[2]||u[1];o[i]=t[e]}return r[""]||r}function H(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function J(t){return void 0===t&&(t=0),new Promise((function(n){return setTimeout(n,t)}))}function K(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)}function Q(t,n){void 0===n&&(n=/[_.\- ]/);for(var r=t.split(n),e="",o=0;o<r.length;o++){var i=r[o];e+=i.charAt(0).toUpperCase()+i.slice(1)}return e}function V(t){var n=t.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),n.join(".")}function X(t,n){var r=n?Number("1e+"+n):1;return Math.round((t+Number.EPSILON)*r)/r}function Y(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(et(t)?tt(t):!!ot(t)&&Z(t))}function Z(t){return!!ot(t)&&t.every(Y)}function tt(t){if(et(t))for(var n in t)if(!Y(n))return!1;return!1}function nt(t,n){return("string"==typeof n||"number"==typeof n)&&n in t}function rt(t,n){return nt(t,n)}function et(t){return"[object Object]"===Object.prototype.toString.call(t)}function ot(t){return"[object Array]"===Object.prototype.toString.call(t)}function it(t){return t.replace(/([^:]\/)\/+/g,"$1")}var ut=function(){function t(t){this.silent=!0,t&&this.copy(t)}return t.copy=function(n){return(new t).copy(n)},t.prototype.copy=function(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(n){!this.silent&&console.log("Please copy manually")}return!1},t.prototype.copyToClipboard=function(t){var n=document.createElement("input");n.value=t;try{document.body.appendChild(n),this.copyNodeContentsToClipboard(n)}finally{document.body.removeChild(n)}},t.prototype.copyNodeContentsToClipboard=function(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")},t}();export{ut as Clipboard,b as DebounceDecorator,P as EARTHS_RADIUS,m as Events,o as allProperties,e as applyMixins,l as arrayChunk,u as arrayCompare,c as arrayCompareStrict,f as arrayUnique,Q as camelize,K as capitalize,N as coordinatesCount,g as debounce,v as debugLog,y as deepmerge,s as defined,D as degrees2Radian,I as degrees2meters,h as deprecatedMapClick,d as deprecatedWarn,F as eachCoordinates,_ as eachGeometry,it as fixUrlStr,z as flatten,p as full,M as getBoundsCoordinates,w as getBoundsFeature,A as getBoundsPolygon,x as getCircleFeature,S as getCirclePolygonCoordinates,T as getCoordinates,r as getGlobalVariable,$ as getIdentifyRadius,k as getPolygons,Y as isAnyJson,ot as isArray,t as isBrowser,Z as isJsonArray,tt as isJsonMap,R as isLngLatBoundsArray,nt as isObjKey,et as isObject,rt as keyInObj,j as latLngToLngLatArray,O as lngLatArrayToLatLng,L as meters2degrees,i as mixinProperties,V as numberWithSpaces,U as objectAssign,W as objectDeepEqual,q as objectRemoveEmpty,H as reEscape,X as round,J as sleep,n as type,G as unflatten};
const t="undefined"!=typeof window&&void 0!==window.document,n=t?"browser":"node";function e(){return t?window:global}function o(t,n,e={}){const o=r(t.prototype),i=void 0===e.replace||e.replace;n.forEach((n=>{Object.getOwnPropertyNames(n.prototype).forEach((e=>{const r=-1!==o.indexOf(e);if(!i&&!r||i){const o=Object.getOwnPropertyDescriptor(n.prototype,e);o&&Object.defineProperty(t.prototype,e,o)}}))}))}function r(t){return function(t,n=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyNames(t);for(let t=0;t<e.length;t++)-1==n.indexOf(e[t])&&n.push(e[t])}return n}(t)}function i(t,n,e){e.forEach((e=>{const o=Object.getOwnPropertyDescriptor(n.prototype,e);o&&Object.defineProperty(t.prototype,e,o)}))}function c(t,n){return s(t=Array.from(t).sort(),n=Array.from(n).sort())}function u(t,n){return s(t=Array.from(t),n=Array.from(n))}function s(t,n){return t.length===n.length&&t.every((function(t,e){return t===n[e]}))}function a(t){return t.filter(((t,n,e)=>e.indexOf(t)==n))}function f(t,n){return Array.from({length:Math.ceil(t.length/n)},((e,o)=>t.slice(o*n,o*n+n)))}function l(t){return null!=t}function p(t){return"string"==typeof t?!!t:l(t)}function y(t,n,e=!1){let o=t;const r=n,i=Array.isArray(r);let c=i&&[]||{};return i&&Array.isArray(r)?e?(o=o||[],c=c.concat(o),r.forEach(((t,n)=>{void 0===c[n]?c[n]=t:"object"==typeof t?c[n]=y(o[n],t,e):-1===o.indexOf(t)&&c.push(t)}))):c=r:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){c[t]=o[t]})),Object.keys(r).forEach((function(t){c[t]="object"==typeof r[t]&&r[t]&&"object"==typeof o[t]&&"object"==typeof r[t]?y(o[t],r[t],e):r[t]}))),c}function h(t){return!1}function d(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function g(t){console.warn(`DEPRECATED WARN: ${t}`)}function b(t,n=10){let e;function o(...r){o.clear(),e=setTimeout((()=>{e=null,t.apply(this,r)}),n)}return o.clear=function(){e&&(clearTimeout(e),e=null)},o}function m(t=10){return function(n,e,o){return{configurable:!0,enumerable:o.enumerable,get:function(){return Object.defineProperty(this,e,{configurable:!0,enumerable:o.enumerable,value:b(o.value,t)}),this[e]}}}}class j{constructor(t){this.emitter=t,this._eventsStatus={}}setEventStatus(t,n){this._eventsStatus[t]=n}onLoad(t){const n=(Array.isArray(t)?t:[t]).map((t=>new Promise((n=>{if(this.getEventStatus(t))n(this);else{this.emitter.once(t,(()=>{this.setEventStatus(t,!0),n(this)}))}}))));return Promise.all(n).then((()=>this))}getEventStatus(t){const n=this._eventsStatus[t];return void 0!==n&&!!n}}function O(t){return[t.lng,t.lat]}function P(t){return{lat:t[1],lng:t[0]}}const A=6371;function M(t){return{type:"Polygon",coordinates:[v(t)]}}function v(t){const n=[t[0],t[1]];return[n,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],n]}function w(t){return{type:"Feature",properties:{},geometry:M(t)}}const E=Math.PI/180,C=180/Math.PI;function S(t,n,e=10,o=6){const r=e/A*C,i=r/Math.cos(n*E),c=[];for(let u=0;u<o+1;u++){const e=Math.PI*(u/(o/2)),s=t+i*Math.cos(e),a=n+r*Math.sin(e);c.push([s,a])}return c}function x(t,n,e=10,o=6){return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[S(t,n,e,o)]}}}function I(t,n){n=n>85.06?85.06:n<-85.06?-85.06:n;const e=20037508.34*t/180;let o=Math.log(Math.tan((90+n)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[e,o]}function L(t,n){return[180*t/20037508.34,360*Math.atan(Math.exp(n*Math.PI/20037508.34))/Math.PI-90]}function D(t){return t*Math.PI/180}function N(t){let n=0;return F(t,(()=>n++)),n}function T(t){const n=[];return F(t,(t=>n.push(t))),n}function F(t,n){$(t,(t=>{if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(const e of t.coordinates)e.forEach((t=>n(t)));else if("MultiPolygon"===t.type)for(const e of t.coordinates)e.forEach((t=>t.forEach((t=>n(t)))));else if("Point"===t.type)n(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(const e of t.coordinates)n(e);return t}))}function k(t){const n=[];return $(t,(t=>{if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((t=>n.push(t)));else if("MultiPolygon"===t.type)for(const e of t.coordinates)for(const t of e)n.push(t);return t})),n}function $(t,n){if("FeatureCollection"===t.type)for(const e of t.features)n(e.geometry);else"Feature"===t.type?n(t.geometry):"coordinates"in t&&n(t)}function _(t){return Array.isArray(t)&&4===t.length&&t.every((t=>"number"==typeof t))}function R(t,n,e){return(e=null!=e?e:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,n+8))*5e-4}function U(t,...n){for(const e of n)for(const n of Object.getOwnPropertyNames(e))t[n]=e[n]}function B(t,n,e,o){if(t instanceof Array)return n instanceof Array&&n.sort().join("")===t.sort().join("");if(t instanceof Date)return n instanceof Date&&""+t==""+n;if(t instanceof Function){if(!(n instanceof Function))return!1}else if(t instanceof Object)return n instanceof Object&&(t===e?n===o:W(t,n));return t===n}function W(t,n){const e=Object.keys(t).sort(),o=Object.keys(n).sort();if(e.length!==o.length)return!1;if(e.join("")!==o.join(""))return!1;for(let r=0;r<e.length;r++){if(!B(t[e[r]],n[o[r]],t,n))return!1}return!0}function q(t){const n={};return Object.keys(t).forEach((e=>{t[e]instanceof Array||t[e]!==Object(t[e])?void 0!==t[e]&&(n[e]=t[e]):n[e]=q(t[e])})),n}function z(t,n={}){var e;const o=null===(e=n.flatArray)||void 0===e||e,r={};return function t(n,e){if(Object(n)!==n)r[e]=n;else if(Array.isArray(n)&&o){const o=n.length;for(let r=0;r<o;r++)t(n[r],e+"["+r+"]");0===o&&(r[e]=[])}else{let o=!0;for(const r in n)o=!1,t(n[r],e?e+"."+r:r);o&&e&&(r[e]={})}}(t,""),r}function G(t){if(Object(t)!==t||Array.isArray(t))return t;const n=/\.?([^.[\]]+)|\[(\d+)\]/g,e={};for(const o in t){let r,i=e,c="";for(;r=n.exec(o);)i=i[c]||(i[c]=r[2]?[]:{}),c=r[2]||r[1];i[c]=t[o]}return e[""]||e}function H(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function J(t=0){return new Promise((n=>setTimeout(n,t)))}function K(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)}function Q(t,n=/[_.\- ]/){const e=t.split(n);let o="";for(let r=0;r<e.length;r++){const t=e[r];o+=t.charAt(0).toUpperCase()+t.slice(1)}return o}function V(t){const n=t.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),n.join(".")}function X(t,n){const e=n?Number("1e+"+n):1;return Math.round((t+Number.EPSILON)*e)/e}function Y(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(ot(t)?tt(t):!!rt(t)&&Z(t))}function Z(t){return!!rt(t)&&t.every(Y)}function tt(t){if(ot(t))for(const n in t)if(!Y(n))return!1;return!1}function nt(t,n){return("string"==typeof n||"number"==typeof n)&&n in t}function et(t,n){return nt(t,n)}function ot(t){return"[object Object]"===Object.prototype.toString.call(t)}function rt(t){return"[object Array]"===Object.prototype.toString.call(t)}function it(t){return t.replace(/([^:]\/)\/+/g,"$1")}class ct{constructor(t){this.silent=!0,t&&this.copy(t)}static copy(t){return(new ct).copy(t)}copy(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(n){!this.silent&&console.log("Please copy manually")}return!1}copyToClipboard(t){const n=document.createElement("input");n.value=t;try{document.body.appendChild(n),this.copyNodeContentsToClipboard(n)}finally{document.body.removeChild(n)}}copyNodeContentsToClipboard(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}}export{ct as Clipboard,m as DebounceDecorator,A as EARTHS_RADIUS,j as Events,r as allProperties,o as applyMixins,f as arrayChunk,c as arrayCompare,u as arrayCompareStrict,a as arrayUnique,Q as camelize,K as capitalize,N as coordinatesCount,b as debounce,h as debugLog,y as deepmerge,l as defined,D as degrees2Radian,I as degrees2meters,d as deprecatedMapClick,g as deprecatedWarn,F as eachCoordinates,$ as eachGeometry,it as fixUrlStr,z as flatten,p as full,v as getBoundsCoordinates,w as getBoundsFeature,M as getBoundsPolygon,x as getCircleFeature,S as getCirclePolygonCoordinates,T as getCoordinates,e as getGlobalVariable,R as getIdentifyRadius,k as getPolygons,Y as isAnyJson,rt as isArray,t as isBrowser,Z as isJsonArray,tt as isJsonMap,_ as isLngLatBoundsArray,nt as isObjKey,ot as isObject,et as keyInObj,O as latLngToLngLatArray,P as lngLatArrayToLatLng,L as meters2degrees,i as mixinProperties,V as numberWithSpaces,U as objectAssign,W as objectDeepEqual,q as objectRemoveEmpty,H as reEscape,X as round,J as sleep,n as type,G as unflatten};
//# sourceMappingURL=utils.esm-browser.prod.js.map

@@ -1,4 +0,4 @@

/** Bundle of @nextgis/utils; version: 1.16.8; author: NextGIS */
var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
var type = isBrowser ? 'browser' : 'node';
/** Bundle of @nextgis/utils; version: 1.17.0; author: NextGIS */
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
const type = isBrowser ? 'browser' : 'node';
function getGlobalVariable() {

@@ -14,11 +14,10 @@ if (isBrowser) {

function applyMixins(derivedCtor, baseCtors, opt) {
if (opt === void 0) { opt = {}; }
var derivedProperties = allProperties(derivedCtor.prototype);
var replace = opt.replace !== undefined ? opt.replace : true;
baseCtors.forEach(function (baseCtor) {
Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {
var isSomeProp = derivedProperties.indexOf(name) !== -1;
function applyMixins(derivedCtor, baseCtors, opt = {}) {
const derivedProperties = allProperties(derivedCtor.prototype);
const replace = opt.replace !== undefined ? opt.replace : true;
baseCtors.forEach((baseCtor) => {
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
const isSomeProp = derivedProperties.indexOf(name) !== -1;
if ((!replace && !isSomeProp) || replace) {
var descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
if (descriptor) {

@@ -34,7 +33,6 @@ Object.defineProperty(derivedCtor.prototype, name, descriptor);

}
function _allProperties(obj, _props) {
if (_props === void 0) { _props = []; }
function _allProperties(obj, _props = []) {
for (; obj !== null; obj = Object.getPrototypeOf(obj)) {
var op = Object.getOwnPropertyNames(obj);
for (var i = 0; i < op.length; i++) {
const op = Object.getOwnPropertyNames(obj);
for (let i = 0; i < op.length; i++) {
if (_props.indexOf(op[i]) == -1) {

@@ -48,4 +46,4 @@ _props.push(op[i]);

function mixinProperties(derivedCtor, baseCtor, properties) {
properties.forEach(function (name) {
var descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
properties.forEach((name) => {
const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
if (descriptor) {

@@ -94,3 +92,3 @@ Object.defineProperty(derivedCtor.prototype, name, descriptor);

function arrayUnique(arr) {
return arr.filter(function (elem, pos, arr) {
return arr.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;

@@ -101,5 +99,3 @@ });

function arrayChunk(arr, size) {
return Array.from({ length: Math.ceil(arr.length / size) }, function (v, i) {
return arr.slice(i * size, i * size + size);
});
return Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));
}

@@ -143,8 +139,7 @@

function deepmerge(target, src, mergeArray) {
if (mergeArray === void 0) { mergeArray = false; }
var target_ = target;
var src_ = src;
var array = Array.isArray(src_);
var dst = (array && []) || {};
function deepmerge(target, src, mergeArray = false) {
let target_ = target;
const src_ = src;
const array = Array.isArray(src_);
let dst = (array && []) || {};
if (array && Array.isArray(src_)) {

@@ -154,3 +149,3 @@ if (mergeArray) {

dst = dst.concat(target_);
src_.forEach(function (e, i) {
src_.forEach((e, i) => {
if (typeof dst[i] === 'undefined') {

@@ -212,4 +207,4 @@ dst[i] = e;

debugLog('deprecated use of latLng in MapClickEvent, use lngLat instead');
var lat = ev.latLng.lat;
var lng = ev.latLng.lng;
const lat = ev.latLng.lat;
const lng = ev.latLng.lng;
ev.lngLat = [lng, lat];

@@ -222,19 +217,13 @@ }

function deprecatedWarn(message) {
console.warn("DEPRECATED WARN: ".concat(message));
console.warn(`DEPRECATED WARN: ${message}`);
}
// based on https://github.com/bvaughn/debounce-decorator
function debounce(cb, wait) {
if (wait === void 0) { wait = 10; }
var timeoutId;
function wrapper() {
var _this = this;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
function debounce(cb, wait = 10) {
let timeoutId;
function wrapper(...args) {
wrapper.clear();
timeoutId = setTimeout(function () {
timeoutId = setTimeout(() => {
timeoutId = null;
cb.apply(_this, args);
cb.apply(this, args);
}, wait);

@@ -250,4 +239,3 @@ }

}
function DebounceDecorator(wait) {
if (wait === void 0) { wait = 10; }
function DebounceDecorator(wait = 10) {
return function (target, key, descriptor) {

@@ -271,37 +259,33 @@ return {

var Events = /** @class */ (function () {
function Events(emitter) {
class Events {
constructor(emitter) {
this.emitter = emitter;
this._eventsStatus = {};
}
Events.prototype.setEventStatus = function (event, status) {
setEventStatus(event, status) {
this._eventsStatus[event] = status;
};
Events.prototype.onLoad = function (event) {
var _this = this;
var events = Array.isArray(event) ? event : [event];
var promises = events.map(function (x) {
return new Promise(function (res) {
if (_this.getEventStatus(x)) {
res(_this);
}
else {
var e = x;
_this.emitter.once(e, function () {
_this.setEventStatus(x, true);
res(_this);
});
}
});
});
return Promise.all(promises).then(function () { return _this; });
};
Events.prototype.getEventStatus = function (event) {
}
onLoad(event) {
const events = Array.isArray(event) ? event : [event];
const promises = events.map((x) => new Promise((res) => {
if (this.getEventStatus(x)) {
res(this);
}
else {
const e = x;
this.emitter.once(e, () => {
this.setEventStatus(x, true);
res(this);
});
}
}));
return Promise.all(promises).then(() => this);
}
getEventStatus(event) {
// ugly hack to disable type checking error
var _eventName = event;
var status = this._eventsStatus[_eventName];
const _eventName = event;
const status = this._eventsStatus[_eventName];
return status !== undefined ? !!status : false;
};
return Events;
}());
}
}

@@ -318,6 +302,6 @@ function latLngToLngLatArray(latLng) {

*/
var EARTHS_RADIUS = 6371;
const EARTHS_RADIUS = 6371;
function getBoundsPolygon(b) {
var polygon = {
const polygon = {
type: 'Polygon',

@@ -329,10 +313,10 @@ coordinates: [getBoundsCoordinates(b)],

function getBoundsCoordinates(b) {
var westNorth = [b[0], b[1]];
var eastNorth = [b[2], b[1]];
var eastSouth = [b[2], b[3]];
var westSouth = [b[0], b[3]];
const westNorth = [b[0], b[1]];
const eastNorth = [b[2], b[1]];
const eastSouth = [b[2], b[3]];
const westSouth = [b[0], b[3]];
return [westNorth, eastNorth, eastSouth, westSouth, westNorth];
}
function getBoundsFeature(b) {
var feature = {
const feature = {
type: 'Feature',

@@ -345,18 +329,16 @@ properties: {},

var d2r = Math.PI / 180; // degrees to radians
var r2d = 180 / Math.PI; // radians to degrees
const d2r = Math.PI / 180; // degrees to radians
const r2d = 180 / Math.PI; // radians to degrees
function getCirclePolygonCoordinates(lng, lat,
/** In kilometers */
radius, points) {
if (radius === void 0) { radius = 10; }
if (points === void 0) { points = 6; }
radius = 10, points = 6) {
// find the radius in lat/lon
var rlat = (radius / EARTHS_RADIUS) * r2d;
var rlng = rlat / Math.cos(lat * d2r);
var extp = [];
for (var i = 0; i < points + 1; i++) {
const rlat = (radius / EARTHS_RADIUS) * r2d;
const rlng = rlat / Math.cos(lat * d2r);
const extp = [];
for (let i = 0; i < points + 1; i++) {
// one extra here makes sure we connect the
var theta = Math.PI * (i / (points / 2));
var ex = lng + rlng * Math.cos(theta); // center a + radius x * cos(theta)
var ey = lat + rlat * Math.sin(theta); // center b + radius y * sin(theta)
const theta = Math.PI * (i / (points / 2));
const ex = lng + rlng * Math.cos(theta); // center a + radius x * cos(theta)
const ey = lat + rlat * Math.sin(theta); // center b + radius y * sin(theta)
extp.push([ex, ey]);

@@ -366,7 +348,5 @@ }

}
function getCircleFeature(lng, lat, radius, points) {
if (radius === void 0) { radius = 10; }
if (points === void 0) { points = 6; }
var polygon = getCirclePolygonCoordinates(lng, lat, radius, points);
var feature = {
function getCircleFeature(lng, lat, radius = 10, points = 6) {
const polygon = getCirclePolygonCoordinates(lng, lat, radius, points);
const feature = {
type: 'Feature',

@@ -384,4 +364,4 @@ properties: {},

lat = lat > 85.06 ? 85.06 : lat < -85.06 ? -85.06 : lat;
var x = (lng * 20037508.34) / 180;
var y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360)) / (Math.PI / 180);
const x = (lng * 20037508.34) / 180;
let y = Math.log(Math.tan(((90 + lat) * Math.PI) / 360)) / (Math.PI / 180);
y = (y * 20037508.34) / 180;

@@ -391,4 +371,4 @@ return [x, y];

function meters2degrees(x, y) {
var lon = (x * 180) / 20037508.34;
var lat = (Math.atan(Math.exp((y * Math.PI) / 20037508.34)) * 360) / Math.PI - 90;
const lon = (x * 180) / 20037508.34;
const lat = (Math.atan(Math.exp((y * Math.PI) / 20037508.34)) * 360) / Math.PI - 90;
return [lon, lat];

@@ -420,24 +400,22 @@ }

function coordinatesCount(geojson) {
var count = 0;
eachCoordinates(geojson, function () { return count++; });
let count = 0;
eachCoordinates(geojson, () => count++);
return count;
}
function getCoordinates(geojson) {
var coordinates = [];
eachCoordinates(geojson, function (pos) { return coordinates.push(pos); });
const coordinates = [];
eachCoordinates(geojson, (pos) => coordinates.push(pos));
return coordinates;
}
function eachCoordinates(geojson, cb) {
eachGeometry(geojson, function (geom) {
eachGeometry(geojson, (geom) => {
if ('coordinates' in geom) {
if (geom.type === 'Polygon' || geom.type === 'MultiLineString') {
for (var _i = 0, _a = geom.coordinates; _i < _a.length; _i++) {
var x = _a[_i];
x.forEach(function (y) { return cb(y); });
for (const x of geom.coordinates) {
x.forEach((y) => cb(y));
}
}
else if (geom.type === 'MultiPolygon') {
for (var _b = 0, _c = geom.coordinates; _b < _c.length; _b++) {
var x = _c[_b];
x.forEach(function (y) { return y.forEach(function (z) { return cb(z); }); });
for (const x of geom.coordinates) {
x.forEach((y) => y.forEach((z) => cb(z)));
}

@@ -449,4 +427,3 @@ }

else if (geom.type === 'MultiPoint' || geom.type === 'LineString') {
for (var _d = 0, _e = geom.coordinates; _d < _e.length; _d++) {
var x = _e[_d];
for (const x of geom.coordinates) {
cb(x);

@@ -460,13 +437,11 @@ }

function getPolygons(geojson) {
var polygons = [];
eachGeometry(geojson, function (geom) {
const polygons = [];
eachGeometry(geojson, (geom) => {
if ('coordinates' in geom) {
if (geom.type === 'Polygon') {
geom.coordinates.forEach(function (x) { return polygons.push(x); });
geom.coordinates.forEach((x) => polygons.push(x));
}
else if (geom.type === 'MultiPolygon') {
for (var _i = 0, _a = geom.coordinates; _i < _a.length; _i++) {
var x = _a[_i];
for (var _b = 0, x_1 = x; _b < x_1.length; _b++) {
var y = x_1[_b];
for (const x of geom.coordinates) {
for (const y of x) {
polygons.push(y);

@@ -483,4 +458,3 @@ }

if (geojson.type === 'FeatureCollection') {
for (var _i = 0, _a = geojson.features; _i < _a.length; _i++) {
var f = _a[_i];
for (const f of geojson.features) {
cb(f.geometry);

@@ -500,3 +474,3 @@ }

array.length === 4 &&
array.every(function (x) { return typeof x === 'number'; }));
array.every((x) => typeof x === 'number'));
}

@@ -506,5 +480,5 @@

pixelRadius = pixelRadius !== null && pixelRadius !== void 0 ? pixelRadius : 10;
var metresPerPixel = (40075016.686 * Math.abs(Math.cos((center[1] * 180) / Math.PI))) /
const metresPerPixel = (40075016.686 * Math.abs(Math.cos((center[1] * 180) / Math.PI))) /
Math.pow(2, zoom + 8);
var radius = pixelRadius * metresPerPixel * 0.0005;
const radius = pixelRadius * metresPerPixel * 0.0005;
return radius;

@@ -519,11 +493,5 @@ }

*/
function objectAssign(target) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
var source = sources_1[_a];
for (var _b = 0, _c = Object.getOwnPropertyNames(source); _b < _c.length; _b++) {
var prop = _c[_b];
function objectAssign(target, ...sources) {
for (const source of sources) {
for (const prop of Object.getOwnPropertyNames(source)) {
target[prop] = source[prop];

@@ -566,4 +534,4 @@ }

function objectDeepEqual(o, p) {
var keysO = Object.keys(o).sort();
var keysP = Object.keys(p).sort();
const keysO = Object.keys(o).sort();
const keysP = Object.keys(p).sort();
if (keysO.length !== keysP.length)

@@ -573,5 +541,5 @@ return false;

return false;
for (var i = 0; i < keysO.length; i++) {
var oVal = o[keysO[i]];
var pVal = p[keysP[i]];
for (let i = 0; i < keysO.length; i++) {
const oVal = o[keysO[i]];
const pVal = p[keysP[i]];
if (!isEqual(oVal, pVal, o, p)) {

@@ -585,4 +553,4 @@ return false;

function objectRemoveEmpty(obj) {
var newObj = {};
Object.keys(obj).forEach(function (key) {
const newObj = {};
Object.keys(obj).forEach((key) => {
if (!(obj[key] instanceof Array) && obj[key] === Object(obj[key])) {

@@ -598,7 +566,6 @@ newObj[key] = objectRemoveEmpty(obj[key]);

function flatten(data, opt) {
function flatten(data, opt = {}) {
var _a;
if (opt === void 0) { opt = {}; }
var flatArray = (_a = opt.flatArray) !== null && _a !== void 0 ? _a : true;
var result = {};
const flatArray = (_a = opt.flatArray) !== null && _a !== void 0 ? _a : true;
const result = {};
function recurse(cur, prop) {

@@ -609,4 +576,4 @@ if (Object(cur) !== cur) {

else if (Array.isArray(cur) && flatArray) {
var l = cur.length;
for (var i = 0; i < l; i++) {
const l = cur.length;
for (let i = 0; i < l; i++) {
recurse(cur[i], prop + '[' + i + ']');

@@ -618,4 +585,4 @@ }

else {
var isEmpty = true;
for (var p in cur) {
let isEmpty = true;
for (const p in cur) {
isEmpty = false;

@@ -635,8 +602,8 @@ recurse(cur[p], prop ? prop + '.' + p : p);

return data;
var regex = /\.?([^.[\]]+)|\[(\d+)\]/g;
var flat = {};
for (var p in data) {
var cur = flat;
var prop = '';
var m = void 0;
const regex = /\.?([^.[\]]+)|\[(\d+)\]/g;
const flat = {};
for (const p in data) {
let cur = flat;
let prop = '';
let m;
while ((m = regex.exec(p))) {

@@ -655,5 +622,4 @@ cur = cur[prop] || (cur[prop] = m[2] ? [] : {});

function sleep(delay) {
if (delay === void 0) { delay = 0; }
return new Promise(function (resolve) { return setTimeout(resolve, delay); });
function sleep(delay = 0) {
return new Promise((resolve) => setTimeout(resolve, delay));
}

@@ -672,11 +638,10 @@

*/
function camelize(text, separator) {
if (separator === void 0) { separator = /[_.\- ]/; }
function camelize(text, separator = /[_.\- ]/) {
// Cut the string into words
var words = text.split(separator);
const words = text.split(separator);
// Concatenate all capitalized words to get camelized string
var result = "";
for (var i = 0; i < words.length; i++) {
var word = words[i];
var capitalizedWord = word.charAt(0).toUpperCase() + word.slice(1);
let result = "";
for (let i = 0; i < words.length; i++) {
const word = words[i];
const capitalizedWord = word.charAt(0).toUpperCase() + word.slice(1);
result += capitalizedWord;

@@ -688,3 +653,3 @@ }

function numberWithSpaces(x) {
var parts = x.toString().split('.');
const parts = x.toString().split('.');
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ' ');

@@ -695,3 +660,3 @@ return parts.join('.');

function round(val, toFixed) {
var n = toFixed ? Number('1e+' + toFixed) : 1;
const n = toFixed ? Number('1e+' + toFixed) : 1;
return Math.round((val + Number.EPSILON) * n) / n;

@@ -723,3 +688,3 @@ }

if (isObject(val)) {
for (var i in val) {
for (const i in val) {
if (!isAnyJson(i)) {

@@ -759,4 +724,4 @@ return false;

var Clipboard = /** @class */ (function () {
function Clipboard(text) {
class Clipboard {
constructor(text) {
this.silent = true;

@@ -767,7 +732,7 @@ if (text) {

}
Clipboard.copy = function (text) {
var clipboard = new Clipboard();
static copy(text) {
const clipboard = new Clipboard();
return clipboard.copy(text);
};
Clipboard.prototype.copy = function (text) {
}
copy(text) {
try {

@@ -790,5 +755,5 @@ if (navigator.clipboard) {

return false;
};
Clipboard.prototype.copyToClipboard = function (text) {
var input = document.createElement('input');
}
copyToClipboard(text) {
const input = document.createElement('input');
input.value = text;

@@ -802,12 +767,11 @@ try {

}
};
Clipboard.prototype.copyNodeContentsToClipboard = function (input) {
}
copyNodeContentsToClipboard(input) {
input.select();
input.setSelectionRange(0, 99999); /*For mobile devices*/
document.execCommand('copy');
};
return Clipboard;
}());
}
}
export { Clipboard, DebounceDecorator, EARTHS_RADIUS, Events, allProperties, applyMixins, arrayChunk, arrayCompare, arrayCompareStrict, arrayUnique, camelize, capitalize, coordinatesCount, debounce, debugLog, deepmerge, defined, degrees2Radian, degrees2meters, deprecatedMapClick, deprecatedWarn, eachCoordinates, eachGeometry, fixUrlStr, flatten, full, getBoundsCoordinates, getBoundsFeature, getBoundsPolygon, getCircleFeature, getCirclePolygonCoordinates, getCoordinates, getGlobalVariable, getIdentifyRadius, getPolygons, isAnyJson, isArray, isBrowser, isJsonArray, isJsonMap, isLngLatBoundsArray, isObjKey, isObject, keyInObj, latLngToLngLatArray, lngLatArrayToLatLng, meters2degrees, mixinProperties, numberWithSpaces, objectAssign, objectDeepEqual, objectRemoveEmpty, reEscape, round, sleep, type, unflatten };
//# sourceMappingURL=utils.esm-bundler.js.map

@@ -1,2 +0,2 @@

var t="undefined"!=typeof window&&void 0!==window.document,n=t?"browser":"node";function r(){return t?window:global}function e(t,n,r){void 0===r&&(r={});var e=o(t.prototype),i=void 0===r.replace||r.replace;n.forEach((function(n){Object.getOwnPropertyNames(n.prototype).forEach((function(r){var o=-1!==e.indexOf(r);if(!i&&!o||i){var u=Object.getOwnPropertyDescriptor(n.prototype,r);u&&Object.defineProperty(t.prototype,r,u)}}))}))}function o(t){return function(t,n){void 0===n&&(n=[]);for(;null!==t;t=Object.getPrototypeOf(t))for(var r=Object.getOwnPropertyNames(t),e=0;e<r.length;e++)-1==n.indexOf(r[e])&&n.push(r[e]);return n}(t)}function i(t,n,r){r.forEach((function(r){var e=Object.getOwnPropertyDescriptor(n.prototype,r);e&&Object.defineProperty(t.prototype,r,e)}))}function u(t,n){return a(t=Array.from(t).sort(),n=Array.from(n).sort())}function c(t,n){return a(t=Array.from(t),n=Array.from(n))}function a(t,n){return t.length===n.length&&t.every((function(t,r){return t===n[r]}))}function f(t){return t.filter((function(t,n,r){return r.indexOf(t)==n}))}function l(t,n){return Array.from({length:Math.ceil(t.length/n)},(function(r,e){return t.slice(e*n,e*n+n)}))}function s(t){return null!=t}function p(t){return"string"==typeof t?!!t:s(t)}function y(t,n,r){void 0===r&&(r=!1);var e=t,o=n,i=Array.isArray(o),u=i&&[]||{};return i&&Array.isArray(o)?r?(u=u.concat(e=e||[]),o.forEach((function(t,n){void 0===u[n]?u[n]=t:"object"==typeof t?u[n]=y(e[n],t,r):-1===e.indexOf(t)&&u.push(t)}))):u=o:(e&&"object"==typeof e&&Object.keys(e).forEach((function(t){u[t]=e[t]})),Object.keys(o).forEach((function(t){u[t]="object"==typeof o[t]&&o[t]&&"object"==typeof e[t]&&"object"==typeof o[t]?y(e[t],o[t],r):o[t]}))),u}function v(t){return"production"!==process.env.NODE_ENV&&(console.trace("DEBUG: "+t),!0)}function h(t){!t.lngLat&&t.latLng&&(v("deprecated use of latLng in MapClickEvent, use lngLat instead"),t.lngLat=[t.latLng.lng,t.latLng.lat]);return t}function d(t){console.warn("DEPRECATED WARN: ".concat(t))}function g(t,n){var r;function e(){for(var o=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];e.clear(),r=setTimeout((function(){r=null,t.apply(o,i)}),n)}return void 0===n&&(n=10),e.clear=function(){r&&(clearTimeout(r),r=null)},e}function b(t){return void 0===t&&(t=10),function(n,r,e){return{configurable:!0,enumerable:e.enumerable,get:function(){return Object.defineProperty(this,r,{configurable:!0,enumerable:e.enumerable,value:g(e.value,t)}),this[r]}}}}var m=function(){function t(t){this.emitter=t,this._eventsStatus={}}return t.prototype.setEventStatus=function(t,n){this._eventsStatus[t]=n},t.prototype.onLoad=function(t){var n=this,r=(Array.isArray(t)?t:[t]).map((function(t){return new Promise((function(r){n.getEventStatus(t)?r(n):n.emitter.once(t,(function(){n.setEventStatus(t,!0),r(n)}))}))}));return Promise.all(r).then((function(){return n}))},t.prototype.getEventStatus=function(t){var n=this._eventsStatus[t];return void 0!==n&&!!n},t}();function j(t){return[t.lng,t.lat]}function O(t){return{lat:t[1],lng:t[0]}}var P=6371;function M(t){return{type:"Polygon",coordinates:[A(t)]}}function A(t){var n=[t[0],t[1]];return[n,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],n]}function E(t){return{type:"Feature",properties:{},geometry:M(t)}}var w=Math.PI/180,C=180/Math.PI;function S(t,n,r,e){void 0===r&&(r=10),void 0===e&&(e=6);for(var o=r/6371*C,i=o/Math.cos(n*w),u=[],c=0;c<e+1;c++){var a=Math.PI*(c/(e/2)),f=t+i*Math.cos(a),l=n+o*Math.sin(a);u.push([f,l])}return u}function L(t,n,r,e){return void 0===r&&(r=10),void 0===e&&(e=6),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[S(t,n,r,e)]}}}function D(t,n){n=n>85.06?85.06:n<-85.06?-85.06:n;var r=20037508.34*t/180,e=Math.log(Math.tan((90+n)*Math.PI/360))/(Math.PI/180);return[r,e=20037508.34*e/180]}function N(t,n){return[180*t/20037508.34,360*Math.atan(Math.exp(n*Math.PI/20037508.34))/Math.PI-90]}function x(t){return t*Math.PI/180}function I(t){var n=0;return k(t,(function(){return n++})),n}function T(t){var n=[];return k(t,(function(t){return n.push(t)})),n}function k(t,n){_(t,(function(t){if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(var r=0,e=t.coordinates;r<e.length;r++){e[r].forEach((function(t){return n(t)}))}else if("MultiPolygon"===t.type)for(var o=0,i=t.coordinates;o<i.length;o++){i[o].forEach((function(t){return t.forEach((function(t){return n(t)}))}))}else if("Point"===t.type)n(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(var u=0,c=t.coordinates;u<c.length;u++){n(c[u])}return t}))}function F(t){var n=[];return _(t,(function(t){if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((function(t){return n.push(t)}));else if("MultiPolygon"===t.type)for(var r=0,e=t.coordinates;r<e.length;r++)for(var o=0,i=e[r];o<i.length;o++){n.push(i[o])}return t})),n}function _(t,n){if("FeatureCollection"===t.type)for(var r=0,e=t.features;r<e.length;r++){n(e[r].geometry)}else"Feature"===t.type?n(t.geometry):"coordinates"in t&&n(t)}function R(t){return Array.isArray(t)&&4===t.length&&t.every((function(t){return"number"==typeof t}))}function U(t,n,r){return(r=null!=r?r:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,n+8))*5e-4}function $(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var e=0,o=n;e<o.length;e++)for(var i=o[e],u=0,c=Object.getOwnPropertyNames(i);u<c.length;u++){var a=c[u];t[a]=i[a]}}function B(t,n,r,e){if(t instanceof Array)return n instanceof Array&&n.sort().join("")===t.sort().join("");if(t instanceof Date)return n instanceof Date&&""+t==""+n;if(t instanceof Function){if(!(n instanceof Function))return!1}else if(t instanceof Object)return n instanceof Object&&(t===r?n===e:G(t,n));return t===n}function G(t,n){var r=Object.keys(t).sort(),e=Object.keys(n).sort();if(r.length!==e.length)return!1;if(r.join("")!==e.join(""))return!1;for(var o=0;o<r.length;o++){if(!B(t[r[o]],n[e[o]],t,n))return!1}return!0}function V(t){var n={};return Object.keys(t).forEach((function(r){t[r]instanceof Array||t[r]!==Object(t[r])?void 0!==t[r]&&(n[r]=t[r]):n[r]=V(t[r])})),n}function W(t,n){var r;void 0===n&&(n={});var e=null===(r=n.flatArray)||void 0===r||r,o={};return function t(n,r){if(Object(n)!==n)o[r]=n;else if(Array.isArray(n)&&e){for(var i=n.length,u=0;u<i;u++)t(n[u],r+"["+u+"]");0===i&&(o[r]=[])}else{var c=!0;for(var a in n)c=!1,t(n[a],r?r+"."+a:a);c&&r&&(o[r]={})}}(t,""),o}function q(t){if(Object(t)!==t||Array.isArray(t))return t;var n=/\.?([^.[\]]+)|\[(\d+)\]/g,r={};for(var e in t){for(var o=r,i="",u=void 0;u=n.exec(e);)o=o[i]||(o[i]=u[2]?[]:{}),i=u[2]||u[1];o[i]=t[e]}return r[""]||r}function z(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function H(t){return void 0===t&&(t=0),new Promise((function(n){return setTimeout(n,t)}))}function J(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)}function K(t,n){void 0===n&&(n=/[_.\- ]/);for(var r=t.split(n),e="",o=0;o<r.length;o++){var i=r[o];e+=i.charAt(0).toUpperCase()+i.slice(1)}return e}function Q(t){var n=t.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),n.join(".")}function X(t,n){var r=n?Number("1e+"+n):1;return Math.round((t+Number.EPSILON)*r)/r}function Y(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(et(t)?tt(t):!!ot(t)&&Z(t))}function Z(t){return!!ot(t)&&t.every(Y)}function tt(t){if(et(t))for(var n in t)if(!Y(n))return!1;return!1}function nt(t,n){return("string"==typeof n||"number"==typeof n)&&n in t}function rt(t,n){return nt(t,n)}function et(t){return"[object Object]"===Object.prototype.toString.call(t)}function ot(t){return"[object Array]"===Object.prototype.toString.call(t)}function it(t){return t.replace(/([^:]\/)\/+/g,"$1")}var ut=function(){function t(t){this.silent=!0,t&&this.copy(t)}return t.copy=function(n){return(new t).copy(n)},t.prototype.copy=function(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(n){!this.silent&&console.log("Please copy manually")}return!1},t.prototype.copyToClipboard=function(t){var n=document.createElement("input");n.value=t;try{document.body.appendChild(n),this.copyNodeContentsToClipboard(n)}finally{document.body.removeChild(n)}},t.prototype.copyNodeContentsToClipboard=function(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")},t}();export{ut as Clipboard,b as DebounceDecorator,P as EARTHS_RADIUS,m as Events,o as allProperties,e as applyMixins,l as arrayChunk,u as arrayCompare,c as arrayCompareStrict,f as arrayUnique,K as camelize,J as capitalize,I as coordinatesCount,g as debounce,v as debugLog,y as deepmerge,s as defined,x as degrees2Radian,D as degrees2meters,h as deprecatedMapClick,d as deprecatedWarn,k as eachCoordinates,_ as eachGeometry,it as fixUrlStr,W as flatten,p as full,A as getBoundsCoordinates,E as getBoundsFeature,M as getBoundsPolygon,L as getCircleFeature,S as getCirclePolygonCoordinates,T as getCoordinates,r as getGlobalVariable,U as getIdentifyRadius,F as getPolygons,Y as isAnyJson,ot as isArray,t as isBrowser,Z as isJsonArray,tt as isJsonMap,R as isLngLatBoundsArray,nt as isObjKey,et as isObject,rt as keyInObj,j as latLngToLngLatArray,O as lngLatArrayToLatLng,N as meters2degrees,i as mixinProperties,Q as numberWithSpaces,$ as objectAssign,G as objectDeepEqual,V as objectRemoveEmpty,z as reEscape,X as round,H as sleep,n as type,q as unflatten};
const t="undefined"!=typeof window&&void 0!==window.document,n=t?"browser":"node";function e(){return t?window:global}function o(t,n,e={}){const o=r(t.prototype),i=void 0===e.replace||e.replace;n.forEach((n=>{Object.getOwnPropertyNames(n.prototype).forEach((e=>{const r=-1!==o.indexOf(e);if(!i&&!r||i){const o=Object.getOwnPropertyDescriptor(n.prototype,e);o&&Object.defineProperty(t.prototype,e,o)}}))}))}function r(t){return function(t,n=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyNames(t);for(let t=0;t<e.length;t++)-1==n.indexOf(e[t])&&n.push(e[t])}return n}(t)}function i(t,n,e){e.forEach((e=>{const o=Object.getOwnPropertyDescriptor(n.prototype,e);o&&Object.defineProperty(t.prototype,e,o)}))}function c(t,n){return s(t=Array.from(t).sort(),n=Array.from(n).sort())}function u(t,n){return s(t=Array.from(t),n=Array.from(n))}function s(t,n){return t.length===n.length&&t.every((function(t,e){return t===n[e]}))}function a(t){return t.filter(((t,n,e)=>e.indexOf(t)==n))}function f(t,n){return Array.from({length:Math.ceil(t.length/n)},((e,o)=>t.slice(o*n,o*n+n)))}function l(t){return null!=t}function p(t){return"string"==typeof t?!!t:l(t)}function y(t,n,e=!1){let o=t;const r=n,i=Array.isArray(r);let c=i&&[]||{};return i&&Array.isArray(r)?e?(o=o||[],c=c.concat(o),r.forEach(((t,n)=>{void 0===c[n]?c[n]=t:"object"==typeof t?c[n]=y(o[n],t,e):-1===o.indexOf(t)&&c.push(t)}))):c=r:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){c[t]=o[t]})),Object.keys(r).forEach((function(t){c[t]="object"==typeof r[t]&&r[t]&&"object"==typeof o[t]&&"object"==typeof r[t]?y(o[t],r[t],e):r[t]}))),c}function h(t){return"production"!==process.env.NODE_ENV&&(console.trace("DEBUG: "+t),!0)}function d(t){if(!t.lngLat&&t.latLng){h("deprecated use of latLng in MapClickEvent, use lngLat instead");t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function g(t){console.warn(`DEPRECATED WARN: ${t}`)}function b(t,n=10){let e;function o(...r){o.clear(),e=setTimeout((()=>{e=null,t.apply(this,r)}),n)}return o.clear=function(){e&&(clearTimeout(e),e=null)},o}function m(t=10){return function(n,e,o){return{configurable:!0,enumerable:o.enumerable,get:function(){return Object.defineProperty(this,e,{configurable:!0,enumerable:o.enumerable,value:b(o.value,t)}),this[e]}}}}class j{constructor(t){this.emitter=t,this._eventsStatus={}}setEventStatus(t,n){this._eventsStatus[t]=n}onLoad(t){const n=(Array.isArray(t)?t:[t]).map((t=>new Promise((n=>{if(this.getEventStatus(t))n(this);else{this.emitter.once(t,(()=>{this.setEventStatus(t,!0),n(this)}))}}))));return Promise.all(n).then((()=>this))}getEventStatus(t){const n=this._eventsStatus[t];return void 0!==n&&!!n}}function O(t){return[t.lng,t.lat]}function P(t){return{lat:t[1],lng:t[0]}}const M=6371;function v(t){return{type:"Polygon",coordinates:[A(t)]}}function A(t){const n=[t[0],t[1]];return[n,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],n]}function E(t){return{type:"Feature",properties:{},geometry:v(t)}}const w=Math.PI/180,C=180/Math.PI;function S(t,n,e=10,o=6){const r=e/M*C,i=r/Math.cos(n*w),c=[];for(let u=0;u<o+1;u++){const e=Math.PI*(u/(o/2)),s=t+i*Math.cos(e),a=n+r*Math.sin(e);c.push([s,a])}return c}function L(t,n,e=10,o=6){return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[S(t,n,e,o)]}}}function D(t,n){n=n>85.06?85.06:n<-85.06?-85.06:n;const e=20037508.34*t/180;let o=Math.log(Math.tan((90+n)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[e,o]}function N(t,n){return[180*t/20037508.34,360*Math.atan(Math.exp(n*Math.PI/20037508.34))/Math.PI-90]}function x(t){return t*Math.PI/180}function I(t){let n=0;return k(t,(()=>n++)),n}function T(t){const n=[];return k(t,(t=>n.push(t))),n}function k(t,n){_(t,(t=>{if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(const e of t.coordinates)e.forEach((t=>n(t)));else if("MultiPolygon"===t.type)for(const e of t.coordinates)e.forEach((t=>t.forEach((t=>n(t)))));else if("Point"===t.type)n(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(const e of t.coordinates)n(e);return t}))}function F(t){const n=[];return _(t,(t=>{if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((t=>n.push(t)));else if("MultiPolygon"===t.type)for(const e of t.coordinates)for(const t of e)n.push(t);return t})),n}function _(t,n){if("FeatureCollection"===t.type)for(const e of t.features)n(e.geometry);else"Feature"===t.type?n(t.geometry):"coordinates"in t&&n(t)}function $(t){return Array.isArray(t)&&4===t.length&&t.every((t=>"number"==typeof t))}function R(t,n,e){return(e=null!=e?e:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,n+8))*5e-4}function U(t,...n){for(const e of n)for(const n of Object.getOwnPropertyNames(e))t[n]=e[n]}function B(t,n,e,o){if(t instanceof Array)return n instanceof Array&&n.sort().join("")===t.sort().join("");if(t instanceof Date)return n instanceof Date&&""+t==""+n;if(t instanceof Function){if(!(n instanceof Function))return!1}else if(t instanceof Object)return n instanceof Object&&(t===e?n===o:G(t,n));return t===n}function G(t,n){const e=Object.keys(t).sort(),o=Object.keys(n).sort();if(e.length!==o.length)return!1;if(e.join("")!==o.join(""))return!1;for(let r=0;r<e.length;r++){if(!B(t[e[r]],n[o[r]],t,n))return!1}return!0}function V(t){const n={};return Object.keys(t).forEach((e=>{t[e]instanceof Array||t[e]!==Object(t[e])?void 0!==t[e]&&(n[e]=t[e]):n[e]=V(t[e])})),n}function W(t,n={}){var e;const o=null===(e=n.flatArray)||void 0===e||e,r={};return function t(n,e){if(Object(n)!==n)r[e]=n;else if(Array.isArray(n)&&o){const o=n.length;for(let r=0;r<o;r++)t(n[r],e+"["+r+"]");0===o&&(r[e]=[])}else{let o=!0;for(const r in n)o=!1,t(n[r],e?e+"."+r:r);o&&e&&(r[e]={})}}(t,""),r}function q(t){if(Object(t)!==t||Array.isArray(t))return t;const n=/\.?([^.[\]]+)|\[(\d+)\]/g,e={};for(const o in t){let r,i=e,c="";for(;r=n.exec(o);)i=i[c]||(i[c]=r[2]?[]:{}),c=r[2]||r[1];i[c]=t[o]}return e[""]||e}function z(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function H(t=0){return new Promise((n=>setTimeout(n,t)))}function J(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)}function K(t,n=/[_.\- ]/){const e=t.split(n);let o="";for(let r=0;r<e.length;r++){const t=e[r];o+=t.charAt(0).toUpperCase()+t.slice(1)}return o}function Q(t){const n=t.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),n.join(".")}function X(t,n){const e=n?Number("1e+"+n):1;return Math.round((t+Number.EPSILON)*e)/e}function Y(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(ot(t)?tt(t):!!rt(t)&&Z(t))}function Z(t){return!!rt(t)&&t.every(Y)}function tt(t){if(ot(t))for(const n in t)if(!Y(n))return!1;return!1}function nt(t,n){return("string"==typeof n||"number"==typeof n)&&n in t}function et(t,n){return nt(t,n)}function ot(t){return"[object Object]"===Object.prototype.toString.call(t)}function rt(t){return"[object Array]"===Object.prototype.toString.call(t)}function it(t){return t.replace(/([^:]\/)\/+/g,"$1")}class ct{constructor(t){this.silent=!0,t&&this.copy(t)}static copy(t){return(new ct).copy(t)}copy(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(n){!this.silent&&console.log("Please copy manually")}return!1}copyToClipboard(t){const n=document.createElement("input");n.value=t;try{document.body.appendChild(n),this.copyNodeContentsToClipboard(n)}finally{document.body.removeChild(n)}}copyNodeContentsToClipboard(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}}export{ct as Clipboard,m as DebounceDecorator,M as EARTHS_RADIUS,j as Events,r as allProperties,o as applyMixins,f as arrayChunk,c as arrayCompare,u as arrayCompareStrict,a as arrayUnique,K as camelize,J as capitalize,I as coordinatesCount,b as debounce,h as debugLog,y as deepmerge,l as defined,x as degrees2Radian,D as degrees2meters,d as deprecatedMapClick,g as deprecatedWarn,k as eachCoordinates,_ as eachGeometry,it as fixUrlStr,W as flatten,p as full,A as getBoundsCoordinates,E as getBoundsFeature,v as getBoundsPolygon,L as getCircleFeature,S as getCirclePolygonCoordinates,T as getCoordinates,e as getGlobalVariable,R as getIdentifyRadius,F as getPolygons,Y as isAnyJson,rt as isArray,t as isBrowser,Z as isJsonArray,tt as isJsonMap,$ as isLngLatBoundsArray,nt as isObjKey,ot as isObject,et as keyInObj,O as latLngToLngLatArray,P as lngLatArrayToLatLng,N as meters2degrees,i as mixinProperties,Q as numberWithSpaces,U as objectAssign,G as objectDeepEqual,V as objectRemoveEmpty,z as reEscape,X as round,H as sleep,n as type,q as unflatten};
//# sourceMappingURL=utils.esm-bundler.prod.js.map

@@ -1,2 +0,2 @@

/** Bundle of @nextgis/utils; version: 1.16.8; author: NextGIS */
/** Bundle of @nextgis/utils; version: 1.17.0; author: NextGIS */
var Utils = (function (exports) {

@@ -3,0 +3,0 @@ 'use strict';

@@ -1,2 +0,2 @@

var Utils=function(t){"use strict";var e="undefined"!=typeof window&&void 0!==window.document,n=e?"browser":"node";function r(t){return function(t,e){void 0===e&&(e=[]);for(;null!==t;t=Object.getPrototypeOf(t))for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++)-1==e.indexOf(n[r])&&e.push(n[r]);return e}(t)}function o(t,e){return t.length===e.length&&t.every((function(t,n){return t===e[n]}))}function i(t){return null!=t}function a(t,e){var n;function r(){for(var o=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];r.clear(),n=setTimeout((function(){n=null,t.apply(o,i)}),e)}return void 0===e&&(e=10),r.clear=function(){n&&(clearTimeout(n),n=null)},r}var u=function(){function t(t){this.emitter=t,this._eventsStatus={}}return t.prototype.setEventStatus=function(t,e){this._eventsStatus[t]=e},t.prototype.onLoad=function(t){var e=this,n=(Array.isArray(t)?t:[t]).map((function(t){return new Promise((function(n){e.getEventStatus(t)?n(e):e.emitter.once(t,(function(){e.setEventStatus(t,!0),n(e)}))}))}));return Promise.all(n).then((function(){return e}))},t.prototype.getEventStatus=function(t){var e=this._eventsStatus[t];return void 0!==e&&!!e},t}();function c(t){return{type:"Polygon",coordinates:[f(t)]}}function f(t){var e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}var s=Math.PI/180,l=180/Math.PI;function p(t,e,n,r){void 0===n&&(n=10),void 0===r&&(r=6);for(var o=n/6371*l,i=o/Math.cos(e*s),a=[],u=0;u<r+1;u++){var c=Math.PI*(u/(r/2)),f=t+i*Math.cos(c),p=e+o*Math.sin(c);a.push([f,p])}return a}function y(t,e){d(t,(function(t){if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(var n=0,r=t.coordinates;n<r.length;n++){r[n].forEach((function(t){return e(t)}))}else if("MultiPolygon"===t.type)for(var o=0,i=t.coordinates;o<i.length;o++){i[o].forEach((function(t){return t.forEach((function(t){return e(t)}))}))}else if("Point"===t.type)e(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(var a=0,u=t.coordinates;a<u.length;a++){e(u[a])}return t}))}function d(t,e){if("FeatureCollection"===t.type)for(var n=0,r=t.features;n<r.length;n++){e(r[n].geometry)}else"Feature"===t.type?e(t.geometry):"coordinates"in t&&e(t)}function g(t,e,n,r){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===n?e===r:v(t,e));return t===e}function v(t,e){var n=Object.keys(t).sort(),r=Object.keys(e).sort();if(n.length!==r.length)return!1;if(n.join("")!==r.join(""))return!1;for(var o=0;o<n.length;o++){if(!g(t[n[o]],e[r[o]],t,e))return!1}return!0}function h(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(P(t)?m(t):!!O(t)&&b(t))}function b(t){return!!O(t)&&t.every(h)}function m(t){if(P(t))for(var e in t)if(!h(e))return!1;return!1}function j(t,e){return("string"==typeof e||"number"==typeof e)&&e in t}function P(t){return"[object Object]"===Object.prototype.toString.call(t)}function O(t){return"[object Array]"===Object.prototype.toString.call(t)}var A=function(){function t(t){this.silent=!0,t&&this.copy(t)}return t.copy=function(e){return(new t).copy(e)},t.prototype.copy=function(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(e){!this.silent&&console.log("Please copy manually")}return!1},t.prototype.copyToClipboard=function(t){var e=document.createElement("input");e.value=t;try{document.body.appendChild(e),this.copyNodeContentsToClipboard(e)}finally{document.body.removeChild(e)}},t.prototype.copyNodeContentsToClipboard=function(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")},t}();return t.Clipboard=A,t.DebounceDecorator=function(t){return void 0===t&&(t=10),function(e,n,r){return{configurable:!0,enumerable:r.enumerable,get:function(){return Object.defineProperty(this,n,{configurable:!0,enumerable:r.enumerable,value:a(r.value,t)}),this[n]}}}},t.EARTHS_RADIUS=6371,t.Events=u,t.allProperties=r,t.applyMixins=function(t,e,n){void 0===n&&(n={});var o=r(t.prototype),i=void 0===n.replace||n.replace;e.forEach((function(e){Object.getOwnPropertyNames(e.prototype).forEach((function(n){var r=-1!==o.indexOf(n);if(!i&&!r||i){var a=Object.getOwnPropertyDescriptor(e.prototype,n);a&&Object.defineProperty(t.prototype,n,a)}}))}))},t.arrayChunk=function(t,e){return Array.from({length:Math.ceil(t.length/e)},(function(n,r){return t.slice(r*e,r*e+e)}))},t.arrayCompare=function(t,e){return o(t=Array.from(t).sort(),e=Array.from(e).sort())},t.arrayCompareStrict=function(t,e){return o(t=Array.from(t),e=Array.from(e))},t.arrayUnique=function(t){return t.filter((function(t,e,n){return n.indexOf(t)==e}))},t.camelize=function(t,e){void 0===e&&(e=/[_.\- ]/);for(var n=t.split(e),r="",o=0;o<n.length;o++){var i=n[o];r+=i.charAt(0).toUpperCase()+i.slice(1)}return r},t.capitalize=function(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)},t.coordinatesCount=function(t){var e=0;return y(t,(function(){return e++})),e},t.debounce=a,t.debugLog=function(t){return!1},t.deepmerge=function t(e,n,r){void 0===r&&(r=!1);var o=e,i=n,a=Array.isArray(i),u=a&&[]||{};return a&&Array.isArray(i)?r?(u=u.concat(o=o||[]),i.forEach((function(e,n){void 0===u[n]?u[n]=e:"object"==typeof e?u[n]=t(o[n],e,r):-1===o.indexOf(e)&&u.push(e)}))):u=i:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){u[t]=o[t]})),Object.keys(i).forEach((function(e){u[e]="object"==typeof i[e]&&i[e]&&"object"==typeof o[e]&&"object"==typeof i[e]?t(o[e],i[e],r):i[e]}))),u},t.defined=i,t.degrees2Radian=function(t){return t*Math.PI/180},t.degrees2meters=function(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;var n=20037508.34*t/180,r=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return[n,r=20037508.34*r/180]},t.deprecatedMapClick=function(t){return!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat]),t},t.deprecatedWarn=function(t){console.warn("DEPRECATED WARN: ".concat(t))},t.eachCoordinates=y,t.eachGeometry=d,t.fixUrlStr=function(t){return t.replace(/([^:]\/)\/+/g,"$1")},t.flatten=function(t,e){var n;void 0===e&&(e={});var r=null===(n=e.flatArray)||void 0===n||n,o={};return function t(e,n){if(Object(e)!==e)o[n]=e;else if(Array.isArray(e)&&r){for(var i=e.length,a=0;a<i;a++)t(e[a],n+"["+a+"]");0===i&&(o[n]=[])}else{var u=!0;for(var c in e)u=!1,t(e[c],n?n+"."+c:c);u&&n&&(o[n]={})}}(t,""),o},t.full=function(t){return"string"==typeof t?!!t:i(t)},t.getBoundsCoordinates=f,t.getBoundsFeature=function(t){return{type:"Feature",properties:{},geometry:c(t)}},t.getBoundsPolygon=c,t.getCircleFeature=function(t,e,n,r){return void 0===n&&(n=10),void 0===r&&(r=6),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[p(t,e,n,r)]}}},t.getCirclePolygonCoordinates=p,t.getCoordinates=function(t){var e=[];return y(t,(function(t){return e.push(t)})),e},t.getGlobalVariable=function(){return e?window:global},t.getIdentifyRadius=function(t,e,n){return(n=null!=n?n:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4},t.getPolygons=function(t){var e=[];return d(t,(function(t){if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((function(t){return e.push(t)}));else if("MultiPolygon"===t.type)for(var n=0,r=t.coordinates;n<r.length;n++)for(var o=0,i=r[n];o<i.length;o++){e.push(i[o])}return t})),e},t.isAnyJson=h,t.isArray=O,t.isBrowser=e,t.isJsonArray=b,t.isJsonMap=m,t.isLngLatBoundsArray=function(t){return Array.isArray(t)&&4===t.length&&t.every((function(t){return"number"==typeof t}))},t.isObjKey=j,t.isObject=P,t.keyInObj=function(t,e){return j(t,e)},t.latLngToLngLatArray=function(t){return[t.lng,t.lat]},t.lngLatArrayToLatLng=function(t){return{lat:t[1],lng:t[0]}},t.meters2degrees=function(t,e){return[180*t/20037508.34,360*Math.atan(Math.exp(e*Math.PI/20037508.34))/Math.PI-90]},t.mixinProperties=function(t,e,n){n.forEach((function(n){var r=Object.getOwnPropertyDescriptor(e.prototype,n);r&&Object.defineProperty(t.prototype,n,r)}))},t.numberWithSpaces=function(t){var e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),e.join(".")},t.objectAssign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,o=e;r<o.length;r++)for(var i=o[r],a=0,u=Object.getOwnPropertyNames(i);a<u.length;a++){var c=u[a];t[c]=i[c]}},t.objectDeepEqual=v,t.objectRemoveEmpty=function t(e){var n={};return Object.keys(e).forEach((function(r){e[r]instanceof Array||e[r]!==Object(e[r])?void 0!==e[r]&&(n[r]=e[r]):n[r]=t(e[r])})),n},t.reEscape=function(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},t.round=function(t,e){var n=e?Number("1e+"+e):1;return Math.round((t+Number.EPSILON)*n)/n},t.sleep=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))},t.type=n,t.unflatten=function(t){if(Object(t)!==t||Array.isArray(t))return t;var e=/\.?([^.[\]]+)|\[(\d+)\]/g,n={};for(var r in t){for(var o=n,i="",a=void 0;a=e.exec(r);)o=o[i]||(o[i]=a[2]?[]:{}),i=a[2]||a[1];o[i]=t[r]}return n[""]||n},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
var Utils=function(t){"use strict";var e="undefined"!=typeof window&&void 0!==window.document,n=e?"browser":"node";function r(t){return function(t,e){void 0===e&&(e=[]);for(;null!==t;t=Object.getPrototypeOf(t))for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++)-1==e.indexOf(n[r])&&e.push(n[r]);return e}(t)}function o(t,e){return t.length===e.length&&t.every((function(t,n){return t===e[n]}))}function i(t){return null!=t}function a(t,e){var n;function r(){for(var o=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];r.clear(),n=setTimeout((function(){n=null,t.apply(o,i)}),e)}return void 0===e&&(e=10),r.clear=function(){n&&(clearTimeout(n),n=null)},r}var u=function(){function t(t){this.emitter=t,this._eventsStatus={}}return t.prototype.setEventStatus=function(t,e){this._eventsStatus[t]=e},t.prototype.onLoad=function(t){var e=this,n=(Array.isArray(t)?t:[t]).map((function(t){return new Promise((function(n){e.getEventStatus(t)?n(e):e.emitter.once(t,(function(){e.setEventStatus(t,!0),n(e)}))}))}));return Promise.all(n).then((function(){return e}))},t.prototype.getEventStatus=function(t){var e=this._eventsStatus[t];return void 0!==e&&!!e},t}();var c=6371;function f(t){return{type:"Polygon",coordinates:[s(t)]}}function s(t){var e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}var l=Math.PI/180,p=180/Math.PI;function y(t,e,n,r){void 0===n&&(n=10),void 0===r&&(r=6);for(var o=n/c*p,i=o/Math.cos(e*l),a=[],u=0;u<r+1;u++){var f=Math.PI*(u/(r/2)),s=t+i*Math.cos(f),y=e+o*Math.sin(f);a.push([s,y])}return a}function d(t,e){g(t,(function(t){if("coordinates"in t)if("Polygon"===t.type||"MultiLineString"===t.type)for(var n=0,r=t.coordinates;n<r.length;n++){r[n].forEach((function(t){return e(t)}))}else if("MultiPolygon"===t.type)for(var o=0,i=t.coordinates;o<i.length;o++){i[o].forEach((function(t){return t.forEach((function(t){return e(t)}))}))}else if("Point"===t.type)e(t.coordinates);else if("MultiPoint"===t.type||"LineString"===t.type)for(var a=0,u=t.coordinates;a<u.length;a++){e(u[a])}return t}))}function g(t,e){if("FeatureCollection"===t.type)for(var n=0,r=t.features;n<r.length;n++){e(r[n].geometry)}else"Feature"===t.type?e(t.geometry):"coordinates"in t&&e(t)}function v(t,e,n,r){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===n?e===r:h(t,e));return t===e}function h(t,e){var n=Object.keys(t).sort(),r=Object.keys(e).sort();if(n.length!==r.length)return!1;if(n.join("")!==r.join(""))return!1;for(var o=0;o<n.length;o++){if(!v(t[n[o]],e[r[o]],t,e))return!1}return!0}function b(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t||null===t||(O(t)?j(t):!!A(t)&&m(t))}function m(t){return!!A(t)&&t.every(b)}function j(t){if(O(t))for(var e in t)if(!b(e))return!1;return!1}function P(t,e){return("string"==typeof e||"number"==typeof e)&&e in t}function O(t){return"[object Object]"===Object.prototype.toString.call(t)}function A(t){return"[object Array]"===Object.prototype.toString.call(t)}var M=function(){function t(t){this.silent=!0,t&&this.copy(t)}return t.copy=function(e){return(new t).copy(e)},t.prototype.copy=function(t){try{return navigator.clipboard?navigator.clipboard.writeText(t):window.clipboardData?window.clipboardData.setData("text",t):this.copyToClipboard(t),!this.silent&&console.log("Copied to Clipboard"),!0}catch(e){!this.silent&&console.log("Please copy manually")}return!1},t.prototype.copyToClipboard=function(t){var e=document.createElement("input");e.value=t;try{document.body.appendChild(e),this.copyNodeContentsToClipboard(e)}finally{document.body.removeChild(e)}},t.prototype.copyNodeContentsToClipboard=function(t){t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")},t}();return t.Clipboard=M,t.DebounceDecorator=function(t){return void 0===t&&(t=10),function(e,n,r){return{configurable:!0,enumerable:r.enumerable,get:function(){return Object.defineProperty(this,n,{configurable:!0,enumerable:r.enumerable,value:a(r.value,t)}),this[n]}}}},t.EARTHS_RADIUS=c,t.Events=u,t.allProperties=r,t.applyMixins=function(t,e,n){void 0===n&&(n={});var o=r(t.prototype),i=void 0===n.replace||n.replace;e.forEach((function(e){Object.getOwnPropertyNames(e.prototype).forEach((function(n){var r=-1!==o.indexOf(n);if(!i&&!r||i){var a=Object.getOwnPropertyDescriptor(e.prototype,n);a&&Object.defineProperty(t.prototype,n,a)}}))}))},t.arrayChunk=function(t,e){return Array.from({length:Math.ceil(t.length/e)},(function(n,r){return t.slice(r*e,r*e+e)}))},t.arrayCompare=function(t,e){return o(t=Array.from(t).sort(),e=Array.from(e).sort())},t.arrayCompareStrict=function(t,e){return o(t=Array.from(t),e=Array.from(e))},t.arrayUnique=function(t){return t.filter((function(t,e,n){return n.indexOf(t)==e}))},t.camelize=function(t,e){void 0===e&&(e=/[_.\- ]/);for(var n=t.split(e),r="",o=0;o<n.length;o++){var i=n[o];r+=i.charAt(0).toUpperCase()+i.slice(1)}return r},t.capitalize=function(t){return(t=String(t).toLowerCase())[0].toUpperCase()+t.slice(1)},t.coordinatesCount=function(t){var e=0;return d(t,(function(){return e++})),e},t.debounce=a,t.debugLog=function(t){return!1},t.deepmerge=function t(e,n,r){void 0===r&&(r=!1);var o=e,i=n,a=Array.isArray(i),u=a&&[]||{};return a&&Array.isArray(i)?r?(u=u.concat(o=o||[]),i.forEach((function(e,n){void 0===u[n]?u[n]=e:"object"==typeof e?u[n]=t(o[n],e,r):-1===o.indexOf(e)&&u.push(e)}))):u=i:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){u[t]=o[t]})),Object.keys(i).forEach((function(e){u[e]="object"==typeof i[e]&&i[e]&&"object"==typeof o[e]&&"object"==typeof i[e]?t(o[e],i[e],r):i[e]}))),u},t.defined=i,t.degrees2Radian=function(t){return t*Math.PI/180},t.degrees2meters=function(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;var n=20037508.34*t/180,r=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return[n,r=20037508.34*r/180]},t.deprecatedMapClick=function(t){return!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat]),t},t.deprecatedWarn=function(t){console.warn("DEPRECATED WARN: ".concat(t))},t.eachCoordinates=d,t.eachGeometry=g,t.fixUrlStr=function(t){return t.replace(/([^:]\/)\/+/g,"$1")},t.flatten=function(t,e){var n;void 0===e&&(e={});var r=null===(n=e.flatArray)||void 0===n||n,o={};return function t(e,n){if(Object(e)!==e)o[n]=e;else if(Array.isArray(e)&&r){for(var i=e.length,a=0;a<i;a++)t(e[a],n+"["+a+"]");0===i&&(o[n]=[])}else{var u=!0;for(var c in e)u=!1,t(e[c],n?n+"."+c:c);u&&n&&(o[n]={})}}(t,""),o},t.full=function(t){return"string"==typeof t?!!t:i(t)},t.getBoundsCoordinates=s,t.getBoundsFeature=function(t){return{type:"Feature",properties:{},geometry:f(t)}},t.getBoundsPolygon=f,t.getCircleFeature=function(t,e,n,r){return void 0===n&&(n=10),void 0===r&&(r=6),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[y(t,e,n,r)]}}},t.getCirclePolygonCoordinates=y,t.getCoordinates=function(t){var e=[];return d(t,(function(t){return e.push(t)})),e},t.getGlobalVariable=function(){return e?window:global},t.getIdentifyRadius=function(t,e,n){return(n=null!=n?n:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4},t.getPolygons=function(t){var e=[];return g(t,(function(t){if("coordinates"in t)if("Polygon"===t.type)t.coordinates.forEach((function(t){return e.push(t)}));else if("MultiPolygon"===t.type)for(var n=0,r=t.coordinates;n<r.length;n++)for(var o=0,i=r[n];o<i.length;o++){e.push(i[o])}return t})),e},t.isAnyJson=b,t.isArray=A,t.isBrowser=e,t.isJsonArray=m,t.isJsonMap=j,t.isLngLatBoundsArray=function(t){return Array.isArray(t)&&4===t.length&&t.every((function(t){return"number"==typeof t}))},t.isObjKey=P,t.isObject=O,t.keyInObj=function(t,e){return P(t,e)},t.latLngToLngLatArray=function(t){return[t.lng,t.lat]},t.lngLatArrayToLatLng=function(t){return{lat:t[1],lng:t[0]}},t.meters2degrees=function(t,e){return[180*t/20037508.34,360*Math.atan(Math.exp(e*Math.PI/20037508.34))/Math.PI-90]},t.mixinProperties=function(t,e,n){n.forEach((function(n){var r=Object.getOwnPropertyDescriptor(e.prototype,n);r&&Object.defineProperty(t.prototype,n,r)}))},t.numberWithSpaces=function(t){var e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),e.join(".")},t.objectAssign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,o=e;r<o.length;r++)for(var i=o[r],a=0,u=Object.getOwnPropertyNames(i);a<u.length;a++){var c=u[a];t[c]=i[c]}},t.objectDeepEqual=h,t.objectRemoveEmpty=function t(e){var n={};return Object.keys(e).forEach((function(r){e[r]instanceof Array||e[r]!==Object(e[r])?void 0!==e[r]&&(n[r]=e[r]):n[r]=t(e[r])})),n},t.reEscape=function(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},t.round=function(t,e){var n=e?Number("1e+"+e):1;return Math.round((t+Number.EPSILON)*n)/n},t.sleep=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))},t.type=n,t.unflatten=function(t){if(Object(t)!==t||Array.isArray(t))return t;var e=/\.?([^.[\]]+)|\[(\d+)\]/g,n={};for(var r in t){for(var o=n,i="",a=void 0;a=e.exec(r);)o=o[i]||(o[i]=a[2]?[]:{}),i=a[2]||a[1];o[i]=t[r]}return n[""]||n},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
//# sourceMappingURL=utils.global.prod.js.map
{
"name": "@nextgis/utils",
"version": "1.16.8",
"version": "1.17.0",
"description": "Common development tools",

@@ -12,3 +12,3 @@ "main": "index.js",

"devDependencies": {
"@nextgis/build-tools": "^1.16.8",
"@nextgis/build-tools": "^1.17.0",
"@types/geojson": "^7946.0.8"

@@ -50,3 +50,3 @@ },

},
"gitHead": "e156aa6d884f1987e3f84649284d5f0c70d713a5"
"gitHead": "c3162aae53c381cd6a581a2a67173fb1bf6de87e"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc