New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@camptocamp/ogc-client

Package Overview
Dependencies
Maintainers
5
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@camptocamp/ogc-client - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

61

dist/wfs/endpoint.js

@@ -288,12 +288,43 @@ import { EndpointError } from '../shared/errors';

/**
* @param {string} featureType
* @return {string|null}
* @private
*/
_getJsonCompatibleOutputFormat(featureType) {
const featureTypeInfo = this._getFeatureTypeByName(featureType);
if (!featureTypeInfo) return null;
const candidates = featureTypeInfo.outputFormats.filter(
(f) => f.toLowerCase().indexOf('json') > -1
);
if (!candidates.length) return null;
return candidates[0];
}
/**
* Returns true if the given feature type can be downloaded as GeoJSON
* @return {boolean|null}
*/
supportsJson(featureType) {
if (!this._featureTypes) return null;
return !!this._getJsonCompatibleOutputFormat(featureType);
}
/**
* Will build a GetFeature url based on the given parameters
* @param featureType
* @param {number} [maxFeatures] no limit if undefined
* @param {MimeType} [outputFormat] default format if undefined
* @param {string} featureType
* @param {Object} [options]
* @property {number} [options.maxFeatures] no limit if undefined
* @property {boolean} [options.asJson] if true, will ask for GeoJSON; will throw if the service does not support it
* @property {MimeType} [options.outputFormat] a supported output format (overridden by `asJson`)
* @property {CrsCode} [options.outputCrs] if unspecified, this will be the data native projection
* @property {BoundingBox} [options.extent] an extent to restrict returned objects
* @property {CrsCode} [options.extentCrs] if unspecified, `extent` should be in the data native projection
* @returns {string|null} Returns null if endpoint is not ready
*/
getFeatureUrl(featureType, maxFeatures, outputFormat) {
getFeatureUrl(featureType, options) {
if (!this._featureTypes) {
return null;
}
const { maxFeatures, asJson, outputFormat, outputCrs, extent, extentCrs } =
options || {};
const internalFeatureType = this._getFeatureTypeByName(featureType);

@@ -305,3 +336,14 @@ if (!internalFeatureType) {

}
if (internalFeatureType.outputFormats.indexOf(outputFormat) === -1) {
let format = outputFormat;
if (asJson) {
format = this._getJsonCompatibleOutputFormat(featureType) || undefined;
if (!format) {
throw new Error(
`The endpoint does not appear to support GeoJSON for the feature type ${internalFeatureType.name}`
);
}
} else if (
outputFormat &&
internalFeatureType.outputFormats.indexOf(outputFormat) === -1
) {
throw new Error(

@@ -315,6 +357,11 @@ `The following output format type was not found in the feature type ${internalFeatureType.name}: ${outputFormat}`

internalFeatureType.name,
outputFormat,
maxFeatures
format,
maxFeatures,
undefined,
undefined,
outputCrs,
extent,
extentCrs
);
}
}

@@ -11,2 +11,5 @@ /**

* note: this might not work for WFS version < 2
* @param {CrsCode} [outputCrs] if unspecified, this will be the data native projection
* @param {BoundingBox} [extent] an extent to restrict returned objects
* @param {CrsCode} [extentCrs] if unspecified, `extent` should be in the data native projection
* @return {string}

@@ -21,3 +24,6 @@ */

attributes,
hitsOnly
hitsOnly,
outputCrs,
extent,
extentCrs
) {

@@ -40,2 +46,12 @@ const typeParam = version === '2.0.0' ? 'TYPENAMES' : 'TYPENAME';

url.searchParams.set(countParam, maxFeatures.toString(10));
if (outputCrs) {
url.searchParams.set('SRSNAME', outputCrs);
}
if (extent) {
const extentJoined = extent.join(',');
url.searchParams.set(
'BBOX',
extentCrs ? `${extentJoined},${extentCrs}` : extentJoined
);
}
return url.toString();

@@ -42,0 +58,0 @@ }

6

dist/wms/endpoint.js

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

import {
readInfoFromCapabilities,
readLayersFromCapabilities,
readVersionFromCapabilities,
} from './capabilities';
import { EndpointError } from '../shared/errors';
import { queryXmlDocument } from '../shared/http-utils';
import { parseWmsCapabilities } from '../worker';

@@ -9,0 +3,0 @@ import { useCache } from '../shared/cache';

@@ -8,3 +8,3 @@ import { sendTaskRequest } from './utils';

if (!workerInstance) {
workerInstance = new Worker(URL.createObjectURL(new Blob(["function t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e(t,e,r,n,i,o,a){try{var c=t[o](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,i)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=t.apply(r,n);function c(t){e(a,i,o,c,u,\"next\",t)}function u(t){e(a,i,o,c,u,\"throw\",t)}c(void 0)}))}}function n(t){return n=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},n(t)}var i={exports:{}};!function(t){var e=function(t){var e,r=Object.prototype,i=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},a=o.iterator||\"@@iterator\",c=o.asyncIterator||\"@@asyncIterator\",u=o.toStringTag||\"@@toStringTag\";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},\"\")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,o=Object.create(i.prototype),a=new T(n||[]);return o._invoke=function(t,e,r){var n=h;return function(i,o){if(n===v)throw new Error(\"Generator is already running\");if(n===m){if(\"throw\"===i)throw o;return N()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===y)continue;return c}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=v;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?m:p,u.arg===y)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=m,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),o}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=f;var h=\"suspendedStart\",p=\"suspendedYield\",v=\"executing\",m=\"completed\",y={};function d(){}function g(){}function S(){}var b={};b[a]=function(){return this};var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&i.call(P,a)&&(b=P);var O=S.prototype=d.prototype=Object.create(b);function x(t){[\"next\",\"throw\",\"return\"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(o,a,c,u){var s=l(t[o],t,a);if(\"throw\"!==s.type){var f=s.arg,h=f.value;return h&&\"object\"===n(h)&&i.call(h,\"__await\")?e.resolve(h.__await).then((function(t){r(\"next\",t,c,u)}),(function(t){r(\"throw\",t,c,u)})):e.resolve(h).then((function(t){f.value=t,c(f)}),(function(t){return r(\"throw\",t,c,u)}))}u(s.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,k(t,r),\"throw\"===r.method))return y;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return y}var i=l(n,t.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,y):o:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,y)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function G(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(R,this),this.reset(!0)}function j(t){if(t){var r=t[a];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function r(){for(;++n<t.length;)if(i.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}return{next:N}}function N(){return{value:e,done:!0}}return g.prototype=O.constructor=S,S.constructor=g,g.displayName=s(S,u,\"GeneratorFunction\"),t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===g||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,s(t,u,\"GeneratorFunction\")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},x(w.prototype),w.prototype[c]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new w(f(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(O),s(O,u,\"Generator\"),O[a]=function(){return this},O.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(G),!t)for(var r in this)\"t\"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return c.type=\"throw\",c.arg=t,r.next=n,i&&(r.method=\"next\",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if(\"root\"===a.tryLoc)return n(\"end\");if(a.tryLoc<=this.prev){var u=i.call(a,\"catchLoc\"),s=i.call(a,\"finallyLoc\");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,\"finallyLoc\")&&this.prev<n.finallyLoc){var o=n;break}}o&&(\"break\"===t||\"continue\"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method=\"next\",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;G(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(e)}}(i);var o=i.exports;function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(t,e,n){var i=function(){var i=r(o.mark((function r(i){var a,u,s;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((a=i.data).taskName!==t){r.next=12;break}return r.prev=2,r.next=5,n(a.params);case 5:u=r.sent,r.next=11;break;case 8:r.prev=8,r.t0=r.catch(2),s=r.t0;case 11:e.postMessage(c(c({taskName:t,requestId:a.requestId},u&&{response:u}),s&&{error:s}));case 12:case\"end\":return r.stop()}}),r,null,[[2,8]])})));return function(t){return i.apply(this,arguments)}}();e.addEventListener(\"message\",i)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function f(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if(\"string\"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return\"Object\"===r&&t.constructor&&(r=t.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(t):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function l(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function p(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function v(t,e){return!e||\"object\"!==n(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function y(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,e,r){return d=y()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&h(i,r.prototype),i},d.apply(null,arguments)}function g(t){var e=\"function\"==typeof Map?new Map:void 0;return g=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf(\"[native code]\")))return t;var r;if(\"function\"!=typeof t)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return d(t,arguments,m(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)},g(t)}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e,r){return e&&S(t.prototype,e),r&&S(t,r),t}var E=function(){function t(e){l(this,t),this.chars=f(e),this.charCount=this.chars.length,this.charIndex=0,this.charsToBytes=new Array(this.charCount),this.multiByteMode=!1,this.string=e;var r=this.chars,n=this.charCount,i=this.charsToBytes;if(n===e.length)for(var o=0;o<n;++o)i[o]=o;else{for(var a=0,c=0;c<n;++c)i[c]=a,a+=r[c].length;this.multiByteMode=!0}}return b(t,[{key:\"isEnd\",get:function(){return this.charIndex>=this.charCount}},{key:\"_charLength\",value:function(t){var e=t.length;return e<2||!this.multiByteMode?e:t.replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\"_\").length}},{key:\"advance\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.charIndex=Math.min(this.charCount,this.charIndex+t)}},{key:\"consume\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this.peek(t);return this.advance(t),e}},{key:\"consumeMatch\",value:function(t){if(!t.sticky)throw new Error('`regex` must have a sticky flag (\"y\")');t.lastIndex=this.charsToBytes[this.charIndex];var e=t.exec(this.string);if(null===e)return\"\";var r=e[0];return this.advance(this._charLength(r)),r}},{key:\"consumeMatchFn\",value:function(t){for(var e=this.charIndex;!this.isEnd&&t(this.peek());)this.advance();return this.charIndex>e?this.string.slice(this.charsToBytes[e],this.charsToBytes[this.charIndex]):\"\"}},{key:\"consumeString\",value:function(t){if(this.consumeStringFast(t))return t;if(!this.multiByteMode)return\"\";var e=t.length,r=this._charLength(t);return r!==e&&t===this.peek(r)?(this.advance(r),t):\"\"}},{key:\"consumeStringFast\",value:function(t){if(this.peek()===t[0]){var e=t.length;if(1===e)return this.advance(),t;if(this.peek(e)===t)return this.advance(e),t}return\"\"}},{key:\"consumeUntilMatch\",value:function(t){if(!t.global)throw new Error('`regex` must have a global flag (\"g\")');var e=this.charsToBytes[this.charIndex];t.lastIndex=e;var r=t.exec(this.string);if(null===r||r.index===e)return\"\";var n=this.string.slice(e,r.index);return this.advance(this._charLength(n)),n}},{key:\"consumeUntilString\",value:function(t){var e=this.charIndex,r=this.charsToBytes,n=this.string,i=r[e],o=n.indexOf(t,i);if(o<=0)return\"\";var a=n.slice(i,o);return this.advance(this._charLength(a)),a}},{key:\"peek\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(this.charIndex>=this.charCount)return\"\";if(1===t)return this.chars[this.charIndex];var e=this.charsToBytes,r=this.charIndex;return this.string.slice(e[r],e[r+t])}},{key:\"reset\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.charIndex=t>=0?Math.min(this.charCount,t):Math.max(0,this.charIndex+t)}}]),t}(),P=E,O={},x=Object.freeze(Object.assign(Object.create(null),{amp:\"&\",apos:\"'\",gt:\">\",lt:\"<\",quot:'\"'}));function w(t){if(k(t))return!0;var e=G(t);return 45===e||46===e||e>=48&&e<=57||183===e||e>=768&&e<=879||e>=8255&&e<=8256}function k(t){var e=G(t);return 58===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function R(t){var e=G(t);return 9===e||10===e||13===e||e>=32&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}function G(t){return t.codePointAt(0)||-1}O.predefinedEntities=x,O.isNameChar=w,O.isNameStartChar=k,O.isNotXmlChar=function(t){return!R(t)},O.isReferenceChar=function(t){return\"#\"===t||w(t)},O.isWhitespace=function(t){var e=G(t);return 32===e||9===e||10===e||13===e},O.isXmlChar=R;var T=function(){function t(){l(this,t),this.parent=null}return b(t,[{key:\"document\",get:function(){return this.parent?this.parent.document:null}},{key:\"isRootNode\",get:function(){return!!this.parent&&this.parent===this.document}},{key:\"preserveWhitespace\",get:function(){return Boolean(this.parent&&this.parent.preserveWhitespace)}},{key:\"type\",get:function(){return\"\"}},{key:\"toJSON\",value:function(){var t={type:this.type};return this.isRootNode&&(t.isRootNode=!0),this.preserveWhitespace&&(t.preserveWhitespace=!0),t}}]),t}();T.TYPE_CDATA=\"cdata\",T.TYPE_COMMENT=\"comment\",T.TYPE_DOCUMENT=\"document\",T.TYPE_ELEMENT=\"element\",T.TYPE_PROCESSING_INSTRUCTION=\"pi\",T.TYPE_TEXT=\"text\";var j=T;function N(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var C=j,F=function(t){p(r,C);var e=N(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return l(this,r),(t=e.call(this)).text=n,t}return b(r,[{key:\"type\",get:function(){return C.TYPE_TEXT}},{key:\"toJSON\",value:function(){return Object.assign(C.prototype.toJSON.call(this),{text:this.text})}}]),r}(),L=F;function I(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var A=j,M=L,B=function(t){p(r,M);var e=I(r);function r(){return l(this,r),e.apply(this,arguments)}return b(r,[{key:\"type\",get:function(){return A.TYPE_CDATA}}]),r}(),_=B;function U(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var D=j,W=function(t){p(r,D);var e=U(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return l(this,r),(t=e.call(this)).content=n,t}return b(r,[{key:\"type\",get:function(){return D.TYPE_COMMENT}},{key:\"toJSON\",value:function(){return Object.assign(D.prototype.toJSON.call(this),{content:this.content})}}]),r}(),X=W;function Y(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var q=j,J=function(t){p(r,q);var e=Y(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null),o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return l(this,r),(n=e.call(this)).name=t,n.attributes=i,n.children=o,n}return b(r,[{key:\"isEmpty\",get:function(){return 0===this.children.length}},{key:\"preserveWhitespace\",get:function(){for(var t=this;t instanceof r;){if(\"xml:space\"in t.attributes)return\"preserve\"===t.attributes[\"xml:space\"];t=t.parent}return!1}},{key:\"text\",get:function(){return this.children.map((function(t){return\"text\"in t?t.text:\"\"})).join(\"\")}},{key:\"type\",get:function(){return q.TYPE_ELEMENT}},{key:\"toJSON\",value:function(){return Object.assign(q.prototype.toJSON.call(this),{name:this.name,attributes:this.attributes,children:this.children.map((function(t){return t.toJSON()}))})}}]),r}(),V=J;function K(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var $=V,z=j,Q=function(t){p(r,z);var e=K(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l(this,r),(t=e.call(this)).children=n,t}return b(r,[{key:\"document\",get:function(){return this}},{key:\"root\",get:function(){return this.children.find((function(t){return t instanceof $}))||null}},{key:\"text\",get:function(){return this.children.map((function(t){return\"text\"in t?t.text:\"\"})).join(\"\")}},{key:\"type\",get:function(){return z.TYPE_DOCUMENT}},{key:\"toJSON\",value:function(){return Object.assign(z.prototype.toJSON.call(this),{children:this.children.map((function(t){return t.toJSON()}))})}}]),r}(),H=Q;function Z(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var tt=j,et=function(t){p(r,tt);var e=Z(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return l(this,r),(n=e.call(this)).name=t,n.content=i,n}return b(r,[{key:\"type\",get:function(){return tt.TYPE_PROCESSING_INSTRUCTION}},{key:\"toJSON\",value:function(){return Object.assign(tt.prototype.toJSON.call(this),{name:this.name,content:this.content})}}]),r}(),rt=et;function nt(t,e){var r;if(\"undefined\"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if(\"string\"==typeof t)return it(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return it(t,e)}(t))||e&&t&&\"number\"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,a=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw o}}}}function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ot=P,at=O,ct=_,ut=X,st=H,ft=V,lt=rt,ht=L,pt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(l(this,t),this.document=new st,this.currentNode=this.document,this.options=r,this.scanner=new ot(vt(e)),this.consumeProlog(),this.consumeElement()||this.error(\"Root element is missing or invalid\");this.consumeMisc(););this.scanner.isEnd||this.error(\"Extra content at the end of the document\")}return b(t,[{key:\"addNode\",value:function(t){t.parent=this.currentNode,this.currentNode.children.push(t)}},{key:\"addText\",value:function(t){var e=this.currentNode.children;if(e.length>0){var r=e[e.length-1];if(r instanceof ht)return void(r.text+=t)}this.addNode(new ht(t))}},{key:\"consumeAttributeValue\",value:function(){var t,e=this.scanner,r=e.peek();if('\"'!==r&&\"'\"!==r)return!1;e.advance();var n=!1,i=\"\",o='\"'===r?new RegExp('[^\"&<]+',\"y\"):new RegExp(\"[^'&<]+\",\"y\");t:for(;!e.isEnd;){switch((t=e.consumeMatch(o))&&(this.validateChars(t),i+=t.replace(/[\\t\\r\\n]/g,\" \")),e.peek()){case r:n=!0;break t;case\"&\":i+=this.consumeReference();continue;case\"<\":this.error(\"Unescaped `<` is not allowed in an attribute value\");break;case\"\":this.error(\"Unclosed attribute\")}}return n||this.error(\"Unclosed attribute\"),e.advance(),i}},{key:\"consumeCdataSection\",value:function(){var t=this.scanner;if(!t.consumeStringFast(\"<![CDATA[\"))return!1;var e=t.consumeUntilString(\"]]>\");return this.validateChars(e),t.consumeStringFast(\"]]>\")||this.error(\"Unclosed CDATA section\"),this.options.preserveCdata?this.addNode(new ct(e)):this.addText(e),!0}},{key:\"consumeCharData\",value:function(){var t=this.scanner,e=t.consumeUntilMatch(/<|&|]]>/g);return!!e&&(this.validateChars(e),\"]\"===t.peek()&&\"]]>\"===t.peek(3)&&this.error(\"Element content may not contain the CDATA section close delimiter `]]>`\"),this.addText(e),!0)}},{key:\"consumeComment\",value:function(){var t=this.scanner;if(!t.consumeStringFast(\"\\x3c!--\"))return!1;var e=t.consumeUntilString(\"--\");return this.validateChars(e),t.consumeStringFast(\"--\\x3e\")||(\"--\"===t.peek(2)?this.error(\"The string `--` isn't allowed inside a comment\"):this.error(\"Unclosed comment\")),this.options.preserveComments&&this.addNode(new ut(e.trim())),!0}},{key:\"consumeContentReference\",value:function(){var t=this.consumeReference();return!!t&&(this.addText(t),!0)}},{key:\"consumeDoctypeDeclaration\",value:function(){var t=this.scanner;return!(!t.consumeStringFast(\"<!DOCTYPE\")||!this.consumeWhitespace())&&(t.consumeMatch(new RegExp(\"[^[>]+\",\"y\")),t.consumeMatch(new RegExp(\"\\\\[[\\\\s\\\\S]+?\\\\][\\\\x20\\\\t\\\\r\\\\n]*>\",\"y\"))||t.consumeStringFast(\">\")||this.error(\"Unclosed doctype declaration\"),!0)}},{key:\"consumeElement\",value:function(){var t=this.scanner,e=t.charIndex;if(\"<\"!==t.peek())return!1;t.advance();var r=this.consumeName();if(!r)return t.reset(e),!1;for(var n=Object.create(null);this.consumeWhitespace();){var i=this.consumeName();if(i){var o=this.consumeEqual()&&this.consumeAttributeValue();!1===o&&this.error(\"Attribute value expected\"),i in n&&this.error(\"Duplicate attribute: \".concat(i)),\"xml:space\"===i&&\"default\"!==o&&\"preserve\"!==o&&this.error('Value of the `xml:space` attribute must be \"default\" or \"preserve\"'),n[i]=o}}if(this.options.sortAttributes){for(var a=Object.keys(n).sort(),c=Object.create(null),u=0;u<a.length;++u){var s=a[u];c[s]=n[s]}n=c}var f=Boolean(t.consumeStringFast(\"/>\")),l=new ft(r,n);if(l.parent=this.currentNode,!f){for(t.consumeStringFast(\">\")||this.error(\"Unclosed start tag for element `\".concat(r,\"`\")),this.currentNode=l,this.consumeCharData();this.consumeElement()||this.consumeContentReference()||this.consumeCdataSection()||this.consumeProcessingInstruction()||this.consumeComment();)this.consumeCharData();var h,p=t.charIndex;t.consumeStringFast(\"</\")&&(h=this.consumeName())&&h===r||(t.reset(p),this.error(\"Missing end tag for element \".concat(r))),this.consumeWhitespace(),t.consumeStringFast(\">\")||this.error(\"Unclosed end tag for element \".concat(r)),this.currentNode=l.parent}return this.addNode(l),!0}},{key:\"consumeEqual\",value:function(){return this.consumeWhitespace(),!!this.scanner.consumeStringFast(\"=\")&&(this.consumeWhitespace(),!0)}},{key:\"consumeMisc\",value:function(){return this.consumeComment()||this.consumeProcessingInstruction()||this.consumeWhitespace()}},{key:\"consumeName\",value:function(){return at.isNameStartChar(this.scanner.peek())?this.scanner.consumeMatchFn(at.isNameChar):\"\"}},{key:\"consumeProcessingInstruction\",value:function(){var t=this.scanner,e=t.charIndex;if(!t.consumeStringFast(\"<?\"))return!1;var r=this.consumeName();if(r?\"xml\"===r.toLowerCase()&&(t.reset(e),this.error(\"XML declaration isn't allowed here\")):this.error(\"Invalid processing instruction\"),!this.consumeWhitespace()){if(t.consumeStringFast(\"?>\"))return this.addNode(new lt(r)),!0;this.error(\"Whitespace is required after a processing instruction name\")}var n=t.consumeUntilString(\"?>\");return this.validateChars(n),t.consumeStringFast(\"?>\")||this.error(\"Unterminated processing instruction\"),this.addNode(new lt(r,n)),!0}},{key:\"consumeProlog\",value:function(){var t=this.scanner,e=t.charIndex;for(this.consumeXmlDeclaration();this.consumeMisc(););if(this.consumeDoctypeDeclaration())for(;this.consumeMisc(););return e<t.charIndex}},{key:\"consumeReference\",value:function(){var t=this.scanner;if(\"&\"!==t.peek())return!1;t.advance();var e,r=t.consumeMatchFn(at.isReferenceChar);if(\";\"!==t.consume()&&this.error(\"Unterminated reference (a reference must end with `;`)\"),\"#\"===r[0]){var i=\"x\"===r[1]?parseInt(r.slice(2),16):parseInt(r.slice(1),10);isNaN(i)&&this.error(\"Invalid character reference\"),e=String.fromCodePoint(i),at.isXmlChar(e)||this.error(\"Character reference resolves to an invalid character\")}else if(void 0===(e=at.predefinedEntities[r])){var o=this.options,a=o.ignoreUndefinedEntities,c=o.resolveUndefinedEntity,u=\"&\".concat(r,\";\");if(c){var s=c(u);if(null!=s){var f=n(s);if(\"string\"!==f)throw new TypeError(\"`resolveUndefinedEntity()` must return a string, `null`, or `undefined`, but returned a value of type \".concat(f));return s}}if(a)return u;t.reset(-u.length),this.error(\"Named entity isn't defined: \".concat(u))}return e}},{key:\"consumeSystemLiteral\",value:function(){var t=this.scanner,e=t.consumeStringFast('\"')||t.consumeStringFast(\"'\");if(!e)return!1;var r=t.consumeUntilString(e);return this.validateChars(r),t.consumeStringFast(e)||this.error(\"Missing end quote\"),r}},{key:\"consumeWhitespace\",value:function(){return Boolean(this.scanner.consumeMatchFn(at.isWhitespace))}},{key:\"consumeXmlDeclaration\",value:function(){var t=this.scanner;if(!t.consumeStringFast(\"<?xml\"))return!1;this.consumeWhitespace()||this.error(\"Invalid XML declaration\");var e=Boolean(t.consumeStringFast(\"version\"))&&this.consumeEqual()&&this.consumeSystemLiteral();if(!1===e?this.error(\"XML version is missing or invalid\"):/^1\\.[0-9]+$/.test(e)||this.error(\"Invalid character in version number\"),this.consumeWhitespace()){Boolean(t.consumeStringFast(\"encoding\"))&&this.consumeEqual()&&this.consumeSystemLiteral()&&this.consumeWhitespace();var r=Boolean(t.consumeStringFast(\"standalone\"))&&this.consumeEqual()&&this.consumeSystemLiteral();r&&(\"yes\"!==r&&\"no\"!==r&&this.error('Only \"yes\" and \"no\" are permitted as values of `standalone`'),this.consumeWhitespace())}return t.consumeStringFast(\"?>\")||this.error(\"Invalid or unclosed XML declaration\"),!0}},{key:\"error\",value:function(t){for(var e=this.scanner,r=e.charIndex,n=e.string,i=1,o=\"\",a=1,c=0;c<r;++c){var u=n[c];\"\\n\"===u?(i=1,o=\"\",a+=1):(i+=1,o+=u)}var s=n.indexOf(\"\\n\",r),f=0;(o+=-1===s?n.slice(r):n.slice(r,s)).length>50&&(i<40?o=o.slice(0,50):(f=i-20,o=o.slice(f,i+30)));var l=new Error(\"\".concat(t,\" (line \").concat(a,\", column \").concat(i,\")\\n\")+\" \".concat(o,\"\\n\")+\" \".repeat(i-f+1)+\"^\\n\");throw Object.assign(l,{column:i,excerpt:o,line:a,pos:r}),l}},{key:\"validateChars\",value:function(t){var e,r=0,n=nt(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;at.isNotXmlChar(i)&&(this.scanner.reset(-(f(t).length-r)),this.error(\"Invalid character\")),r+=1}}catch(t){n.e(t)}finally{n.f()}}}]),t}();function vt(t){return\"\\ufeff\"===t[0]&&(t=t.slice(1)),t.replace(/\\r\\n?/g,\"\\n\")}var mt=pt,yt=_,dt=X,gt=H,St=V,bt=j,Et=rt,Pt=L;function Ot(t,e){return new mt(t,e).document}Ot.XmlCdata=yt,Ot.XmlComment=dt,Ot.XmlDocument=gt,Ot.XmlElement=St,Ot.XmlNode=bt,Ot.XmlProcessingInstruction=Et,Ot.XmlText=Pt;var xt=Ot;function wt(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var kt=function(t){p(r,g(Error));var e=wt(r);function r(t){return l(this,r),e.call(this,t)}return r}();function Rt(t){return t.children[0]}function Gt(t){var e=t.indexOf(\":\");return e>-1?t.substr(e+1):t}function Tt(t){return t.name||\"\"}function jt(t,e,r){var n=Gt(e);return t&&Array.isArray(t.children)?t.children.reduce((function t(e,i){return Gt(Tt(i))===n&&e.push(i),r&&Array.isArray(i.children)?[].concat(f(e),f(i.children.reduce(t,[]))):e}),[]):[]}function Nt(t,e,r){return jt(t,e,r)[0]||null}function Ct(t){return t&&Array.isArray(t.children)?f(t.children.filter((function(t){return\"XmlElement\"===t.constructor.name}))):[]}function Ft(t){var e=t&&Array.isArray(t.children)?t.children.find((function(t){return\"text\"===t.type})):null;return e?e.text:\"\"}function Lt(t,e){return t&&t.attributes[e]||\"\"}var It=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];l(this,t),this.message=e,this.httpStatus=r,this.isCrossOriginRelated=n};function At(t){return fetch(t).catch((function(t){throw new It(t.message,0,!0)})).then(function(){var t=r(o.mark((function t(e){var r;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.text();case 2:if(r=t.sent,e.ok){t.next=5;break}throw new It(\"Received an error with code \".concat(e.status,\": \").concat(r),e.status,!1);case 5:return t.abrupt(\"return\",r);case 6:case\"end\":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then((function(t){return function(t){var e=null;try{e=xt(t)}catch(t){throw new kt(t.message)}return e}(t)}))}var Mt=[\"EPSG:4046\",\"EPSG:4075\",\"EPSG:4120\",\"EPSG:4122\",\"EPSG:4124\",\"EPSG:4126\",\"EPSG:4149\",\"EPSG:4151\",\"EPSG:4153\",\"EPSG:4155\",\"EPSG:4157\",\"EPSG:4159\",\"EPSG:4161\",\"EPSG:4163\",\"EPSG:4165\",\"EPSG:4167\",\"EPSG:4169\",\"EPSG:4171\",\"EPSG:4173\",\"EPSG:4175\",\"EPSG:4178\",\"EPSG:4180\",\"EPSG:4182\",\"EPSG:4184\",\"EPSG:4188\",\"EPSG:4190\",\"EPSG:4191\",\"EPSG:4196\",\"EPSG:4198\",\"EPSG:4202\",\"EPSG:4210\",\"EPSG:4211\",\"EPSG:4214\",\"EPSG:4226\",\"EPSG:4229\",\"EPSG:4231\",\"EPSG:4233\",\"EPSG:4236\",\"EPSG:4238\",\"EPSG:4240\",\"EPSG:4242\",\"EPSG:4244\",\"EPSG:4246\",\"EPSG:4248\",\"EPSG:4250\",\"EPSG:4252\",\"EPSG:4255\",\"EPSG:4258\",\"EPSG:4261\",\"EPSG:4264\",\"EPSG:4267\",\"EPSG:4270\",\"EPSG:4273\",\"EPSG:4276\",\"EPSG:4279\",\"EPSG:4281\",\"EPSG:4284\",\"EPSG:4286\",\"EPSG:4288\",\"EPSG:4292\",\"EPSG:4295\",\"EPSG:4297\",\"EPSG:4299\",\"EPSG:4302\",\"EPSG:4324\",\"EPSG:4326\"];function Bt(t){return Mt.indexOf(_t(t))>-1}function _t(t){if(/^urn:(?:x-)?ogc:def:crs:epsg:/.test(t.toLowerCase())){var e=/([0-9]+)$/.exec(t)[1];return\"EPSG:\".concat(e)}return t}function Ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ut(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wt(t){return Rt(t).attributes.version}function Xt(t){var e=Wt(t);return jt(Nt(Rt(t),\"Capability\"),\"Layer\").map((function(t){return Yt(t,e)}))}function Yt(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=\"1.3.0\"===r?\"CRS\":\"SRS\",c=jt(e,a).map(Ft),u=c.length>0?c:n,s=jt(e,\"Style\").map(qt),f=s.length>0?s:i;function l(t){return(Bt(Lt(t,a))&&\"1.3.0\"===r?[\"miny\",\"minx\",\"maxy\",\"maxx\"]:[\"minx\",\"miny\",\"maxx\",\"maxy\"]).map((function(e){return Lt(t,e)}))}var h=Nt(e,\"Attribution\"),p=null!==h?Jt(h):o,v=jt(e,\"Layer\").map((function(t){return Yt(t,r,u,f,p)}));return Dt({name:Ft(Nt(e,\"Name\")),title:Ft(Nt(e,\"Title\")),abstract:Ft(Nt(e,\"Abstract\")),availableCrs:u,styles:f,attribution:p,boundingBoxes:jt(e,\"BoundingBox\").reduce((function(e,r){return Dt(Dt({},e),{},t({},Lt(r,a),l(r)))}),{})},v.length&&{children:v})}function qt(t){var e=Lt(Nt(Nt(t,\"LegendURL\"),\"OnlineResource\"),\"xlink:href\");return Dt({name:Ft(Nt(t,\"Name\")),title:Ft(Nt(t,\"Title\"))},e&&{legendUrl:e})}function Jt(t){var e=Lt(Nt(Nt(t,\"LogoURL\"),\"OnlineResource\"),\"xlink:href\"),r=Lt(Nt(t,\"OnlineResource\"),\"xlink:href\"),n=Ft(Nt(t,\"Title\"));return Dt(Dt(Dt({},n&&{title:n}),r&&{url:r}),e&&{logoUrl:e})}function Vt(t){return Rt(t).attributes.version}function Kt(t){var e;if(Vt(t).startsWith(\"1.0\")){var r=Nt(Nt(Nt(Rt(t),\"Capability\"),\"Request\"),\"GetFeature\");e=Ct(Nt(r,\"ResultFormat\")).map(Tt)}else{var n=jt(Nt(Rt(t),\"OperationsMetadata\"),\"Operation\").find((function(t){return\"GetFeature\"===Lt(t,\"name\")})),i=jt(n,\"Parameter\").find((function(t){return\"outputFormat\"===Lt(t,\"name\")}));e=jt(i,\"Value\",!0).map(Ft)}return e}function $t(t){var e=Vt(t),r=Kt(t);return jt(Nt(Rt(t),\"FeatureTypeList\"),\"FeatureType\").map((function(t){return function(t,e,r){var n=e.startsWith(\"2.\")?\"CRS\":\"SRS\",i=e.startsWith(\"1.0\")?\"SRS\":\"Default\".concat(n);function o(){var e=Nt(t,\"LatLongBoundingBox\");return[\"minx\",\"miny\",\"maxx\",\"maxy\"].map((function(t){return Lt(e,t)})).map(parseFloat)}function a(){var e=Nt(t,\"WGS84BoundingBox\");return[\"LowerCorner\",\"UpperCorner\"].map((function(t){return Nt(e,t)})).map((function(t){return Ft(t).split(\" \")})).reduce((function(t,e){return[].concat(f(t),f(e))})).map(parseFloat)}var c=e.startsWith(\"1.0\")?[]:jt(t,\"Other\".concat(n)).map(Ft).map(_t),u=e.startsWith(\"1.0\")?[]:jt(Nt(t,\"OutputFormats\"),\"Format\").map(Ft);return{name:Ft(Nt(t,\"Name\")),title:Ft(Nt(t,\"Title\")),abstract:Ft(Nt(t,\"Abstract\")),defaultCrs:_t(Ft(Nt(t,i))),otherCrs:c,outputFormats:u.length>0?u:r,latLonBoundingBox:e.startsWith(\"1.0\")?o():a()}}(t,e,r)}))}function zt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qt(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?zt(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ht(e,r,n){var i,o=Rt(e);if(n.startsWith(\"2.0\"))i=jt(o,\"member\").map((function(t){return Ct(t)[0]}));else{var a=Nt(o,\"featureMembers\");i=a?Ct(a):jt(o,\"featureMember\").map((function(t){return Ct(t)[0]}))}var c=\"1.0.0\"===n?\"fid\":\"gml:id\";function u(e){return Ct(e).filter((function(t){return Gt(Tt(t))in r.properties})).reduce((function(e,n){var i=Gt(Tt(n));return Qt(Qt({},e),{},t({},i,function(t,e){switch(r.properties[t]){case\"integer\":return parseInt(e);case\"float\":return parseFloat(e);case\"boolean\":return\"true\"===e;default:return e}}(i,Ft(n))))}),{})}return i.map((function(t){return{id:Lt(t,c),properties:u(t)}}))}u(\"parseWmsCapabilities\",self,(function(t){return At(t.url).then((function(t){return{info:(e=t,r=Nt(Rt(e),\"Service\"),n=jt(Nt(r,\"KeywordList\"),\"Keyword\").map(Ft).filter((function(t,e,r){return r.indexOf(t)===e})),{title:Ft(Nt(r,\"Title\")),name:Ft(Nt(r,\"Name\")),abstract:Ft(Nt(r,\"Abstract\")),fees:Ft(Nt(r,\"Fees\")),constraints:Ft(Nt(r,\"AccessConstraints\")),keywords:n}),layers:Xt(t),version:Wt(t)};var e,r,n}))})),u(\"parseWfsCapabilities\",self,(function(t){return At(t.url).then((function(t){return{info:(e=t,n=Vt(e),i=n.startsWith(\"1.0\")?\"Service\":\"ServiceIdentification\",o=n.startsWith(\"1.0\")?\"Name\":\"ServiceType\",a=Nt(Rt(e),i),r=n.startsWith(\"1.0\")?Ft(Nt(a,\"Keywords\")).split(\",\").map((function(t){return t.trim()})):jt(Nt(a,\"Keywords\"),\"Keyword\").map(Ft),{title:Ft(Nt(a,\"Title\")),name:Ft(Nt(a,o)),abstract:Ft(Nt(a,\"Abstract\")),fees:Ft(Nt(a,\"Fees\")),constraints:Ft(Nt(a,\"AccessConstraints\")),keywords:r,outputFormats:Kt(e)}),featureTypes:$t(t),version:Vt(t)};var e,r,n,i,o,a}))})),u(\"queryWfsFeatureTypeDetails\",self,(function(t){var e=t.url,r=t.serviceVersion,n=t.featureTypeFull,i=function(t,e,r,n,i,o,a){var c=\"2.0.0\"===e?\"TYPENAMES\":\"TYPENAME\",u=\"2.0.0\"===e?\"COUNT\":\"MAXFEATURES\",s=new URL(t);return s.searchParams.set(\"SERVICE\",\"WFS\"),s.searchParams.set(\"REQUEST\",\"GetFeature\"),s.searchParams.set(\"VERSION\",e),s.searchParams.set(c,r),void 0!==n&&s.searchParams.set(\"OUTPUTFORMAT\",n),void 0!==o&&s.searchParams.set(\"PROPERTYNAME\",o.join(\",\")),a?(s.searchParams.set(\"RESULTTYPE\",\"hits\"),s.searchParams.set(u,\"1\")):void 0!==i&&s.searchParams.set(u,i.toString(10)),s.toString()}(e,r,n.name,void 0,Object.keys(n.properties));return At(i).then((function(t){return{props:(e=Ht(t,n,r),e.reduce((function(t,e){var r=function(r){var n=e.properties[r];r in t||(t[r]={uniqueValues:[]});var i=t[r].uniqueValues.find((function(t){return t.value===n}));i?i.count++:t[r].uniqueValues.push({value:n,count:1})};for(var n in e.properties)r(n);return t}),{}))};var e}))}));\n"], {type: 'application/javascript'})), {
workerInstance = new Worker(URL.createObjectURL(new Blob(["function t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e(t,e,r,n,i,o,a){try{var c=t[o](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,i)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=t.apply(r,n);function c(t){e(a,i,o,c,u,\"next\",t)}function u(t){e(a,i,o,c,u,\"throw\",t)}c(void 0)}))}}function n(t){return n=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},n(t)}var i={exports:{}};!function(t){var e=function(t){var e,r=Object.prototype,i=r.hasOwnProperty,o=\"function\"==typeof Symbol?Symbol:{},a=o.iterator||\"@@iterator\",c=o.asyncIterator||\"@@asyncIterator\",u=o.toStringTag||\"@@toStringTag\";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},\"\")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,o=Object.create(i.prototype),a=new T(n||[]);return o._invoke=function(t,e,r){var n=h;return function(i,o){if(n===v)throw new Error(\"Generator is already running\");if(n===m){if(\"throw\"===i)throw o;return N()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===y)continue;return c}}if(\"next\"===r.method)r.sent=r._sent=r.arg;else if(\"throw\"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else\"return\"===r.method&&r.abrupt(\"return\",r.arg);n=v;var u=l(t,e,r);if(\"normal\"===u.type){if(n=r.done?m:p,u.arg===y)continue;return{value:u.arg,done:r.done}}\"throw\"===u.type&&(n=m,r.method=\"throw\",r.arg=u.arg)}}}(t,r,a),o}function l(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}t.wrap=f;var h=\"suspendedStart\",p=\"suspendedYield\",v=\"executing\",m=\"completed\",y={};function d(){}function g(){}function S(){}var b={};b[a]=function(){return this};var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&i.call(P,a)&&(b=P);var O=S.prototype=d.prototype=Object.create(b);function x(t){[\"next\",\"throw\",\"return\"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(o,a,c,u){var s=l(t[o],t,a);if(\"throw\"!==s.type){var f=s.arg,h=f.value;return h&&\"object\"===n(h)&&i.call(h,\"__await\")?e.resolve(h.__await).then((function(t){r(\"next\",t,c,u)}),(function(t){r(\"throw\",t,c,u)})):e.resolve(h).then((function(t){f.value=t,c(f)}),(function(t){return r(\"throw\",t,c,u)}))}u(s.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,\"throw\"===r.method){if(t.iterator.return&&(r.method=\"return\",r.arg=e,k(t,r),\"throw\"===r.method))return y;r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return y}var i=l(n,t.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,y):o:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,y)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function G(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(R,this),this.reset(!0)}function j(t){if(t){var r=t[a];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function r(){for(;++n<t.length;)if(i.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}return{next:N}}function N(){return{value:e,done:!0}}return g.prototype=O.constructor=S,S.constructor=g,g.displayName=s(S,u,\"GeneratorFunction\"),t.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===g||\"GeneratorFunction\"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,s(t,u,\"GeneratorFunction\")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},x(w.prototype),w.prototype[c]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new w(f(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(O),s(O,u,\"Generator\"),O[a]=function(){return this},O.toString=function(){return\"[object Generator]\"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(G),!t)for(var r in this)\"t\"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return c.type=\"throw\",c.arg=t,r.next=n,i&&(r.method=\"next\",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if(\"root\"===a.tryLoc)return n(\"end\");if(a.tryLoc<=this.prev){var u=i.call(a,\"catchLoc\"),s=i.call(a,\"finallyLoc\");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error(\"try statement without catch or finally\");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,\"finallyLoc\")&&this.prev<n.finallyLoc){var o=n;break}}o&&(\"break\"===t||\"continue\"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method=\"next\",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;G(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function(\"r\",\"regeneratorRuntime = r\")(e)}}(i);var o=i.exports;function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(t,e,n){var i=function(){var i=r(o.mark((function r(i){var a,u,s;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((a=i.data).taskName!==t){r.next=12;break}return r.prev=2,r.next=5,n(a.params);case 5:u=r.sent,r.next=11;break;case 8:r.prev=8,r.t0=r.catch(2),s=r.t0;case 11:e.postMessage(c(c({taskName:t,requestId:a.requestId},u&&{response:u}),s&&{error:s}));case 12:case\"end\":return r.stop()}}),r,null,[[2,8]])})));return function(t){return i.apply(this,arguments)}}();e.addEventListener(\"message\",i)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function f(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if(\"string\"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return\"Object\"===r&&t.constructor&&(r=t.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(t):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function l(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function p(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function v(t,e){return!e||\"object\"!==n(e)&&\"function\"!=typeof e?function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t):e}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function y(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,e,r){return d=y()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&h(i,r.prototype),i},d.apply(null,arguments)}function g(t){var e=\"function\"==typeof Map?new Map:void 0;return g=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf(\"[native code]\")))return t;var r;if(\"function\"!=typeof t)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return d(t,arguments,m(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)},g(t)}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e,r){return e&&S(t.prototype,e),r&&S(t,r),t}var E=function(){function t(e){l(this,t),this.chars=f(e),this.charCount=this.chars.length,this.charIndex=0,this.charsToBytes=new Array(this.charCount),this.multiByteMode=!1,this.string=e;var r=this.chars,n=this.charCount,i=this.charsToBytes;if(n===e.length)for(var o=0;o<n;++o)i[o]=o;else{for(var a=0,c=0;c<n;++c)i[c]=a,a+=r[c].length;this.multiByteMode=!0}}return b(t,[{key:\"isEnd\",get:function(){return this.charIndex>=this.charCount}},{key:\"_charLength\",value:function(t){var e=t.length;return e<2||!this.multiByteMode?e:t.replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\"_\").length}},{key:\"advance\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.charIndex=Math.min(this.charCount,this.charIndex+t)}},{key:\"consume\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this.peek(t);return this.advance(t),e}},{key:\"consumeMatch\",value:function(t){if(!t.sticky)throw new Error('`regex` must have a sticky flag (\"y\")');t.lastIndex=this.charsToBytes[this.charIndex];var e=t.exec(this.string);if(null===e)return\"\";var r=e[0];return this.advance(this._charLength(r)),r}},{key:\"consumeMatchFn\",value:function(t){for(var e=this.charIndex;!this.isEnd&&t(this.peek());)this.advance();return this.charIndex>e?this.string.slice(this.charsToBytes[e],this.charsToBytes[this.charIndex]):\"\"}},{key:\"consumeString\",value:function(t){if(this.consumeStringFast(t))return t;if(!this.multiByteMode)return\"\";var e=t.length,r=this._charLength(t);return r!==e&&t===this.peek(r)?(this.advance(r),t):\"\"}},{key:\"consumeStringFast\",value:function(t){if(this.peek()===t[0]){var e=t.length;if(1===e)return this.advance(),t;if(this.peek(e)===t)return this.advance(e),t}return\"\"}},{key:\"consumeUntilMatch\",value:function(t){if(!t.global)throw new Error('`regex` must have a global flag (\"g\")');var e=this.charsToBytes[this.charIndex];t.lastIndex=e;var r=t.exec(this.string);if(null===r||r.index===e)return\"\";var n=this.string.slice(e,r.index);return this.advance(this._charLength(n)),n}},{key:\"consumeUntilString\",value:function(t){var e=this.charIndex,r=this.charsToBytes,n=this.string,i=r[e],o=n.indexOf(t,i);if(o<=0)return\"\";var a=n.slice(i,o);return this.advance(this._charLength(a)),a}},{key:\"peek\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(this.charIndex>=this.charCount)return\"\";if(1===t)return this.chars[this.charIndex];var e=this.charsToBytes,r=this.charIndex;return this.string.slice(e[r],e[r+t])}},{key:\"reset\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.charIndex=t>=0?Math.min(this.charCount,t):Math.max(0,this.charIndex+t)}}]),t}(),P=E,O={},x=Object.freeze(Object.assign(Object.create(null),{amp:\"&\",apos:\"'\",gt:\">\",lt:\"<\",quot:'\"'}));function w(t){if(k(t))return!0;var e=G(t);return 45===e||46===e||e>=48&&e<=57||183===e||e>=768&&e<=879||e>=8255&&e<=8256}function k(t){var e=G(t);return 58===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function R(t){var e=G(t);return 9===e||10===e||13===e||e>=32&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}function G(t){return t.codePointAt(0)||-1}O.predefinedEntities=x,O.isNameChar=w,O.isNameStartChar=k,O.isNotXmlChar=function(t){return!R(t)},O.isReferenceChar=function(t){return\"#\"===t||w(t)},O.isWhitespace=function(t){var e=G(t);return 32===e||9===e||10===e||13===e},O.isXmlChar=R;var T=function(){function t(){l(this,t),this.parent=null}return b(t,[{key:\"document\",get:function(){return this.parent?this.parent.document:null}},{key:\"isRootNode\",get:function(){return!!this.parent&&this.parent===this.document}},{key:\"preserveWhitespace\",get:function(){return Boolean(this.parent&&this.parent.preserveWhitespace)}},{key:\"type\",get:function(){return\"\"}},{key:\"toJSON\",value:function(){var t={type:this.type};return this.isRootNode&&(t.isRootNode=!0),this.preserveWhitespace&&(t.preserveWhitespace=!0),t}}]),t}();T.TYPE_CDATA=\"cdata\",T.TYPE_COMMENT=\"comment\",T.TYPE_DOCUMENT=\"document\",T.TYPE_ELEMENT=\"element\",T.TYPE_PROCESSING_INSTRUCTION=\"pi\",T.TYPE_TEXT=\"text\";var j=T;function N(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var C=j,F=function(t){p(r,C);var e=N(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return l(this,r),(t=e.call(this)).text=n,t}return b(r,[{key:\"type\",get:function(){return C.TYPE_TEXT}},{key:\"toJSON\",value:function(){return Object.assign(C.prototype.toJSON.call(this),{text:this.text})}}]),r}(),L=F;function I(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var A=j,M=L,B=function(t){p(r,M);var e=I(r);function r(){return l(this,r),e.apply(this,arguments)}return b(r,[{key:\"type\",get:function(){return A.TYPE_CDATA}}]),r}(),_=B;function U(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var D=j,W=function(t){p(r,D);var e=U(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return l(this,r),(t=e.call(this)).content=n,t}return b(r,[{key:\"type\",get:function(){return D.TYPE_COMMENT}},{key:\"toJSON\",value:function(){return Object.assign(D.prototype.toJSON.call(this),{content:this.content})}}]),r}(),X=W;function Y(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var q=j,J=function(t){p(r,q);var e=Y(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null),o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return l(this,r),(n=e.call(this)).name=t,n.attributes=i,n.children=o,n}return b(r,[{key:\"isEmpty\",get:function(){return 0===this.children.length}},{key:\"preserveWhitespace\",get:function(){for(var t=this;t instanceof r;){if(\"xml:space\"in t.attributes)return\"preserve\"===t.attributes[\"xml:space\"];t=t.parent}return!1}},{key:\"text\",get:function(){return this.children.map((function(t){return\"text\"in t?t.text:\"\"})).join(\"\")}},{key:\"type\",get:function(){return q.TYPE_ELEMENT}},{key:\"toJSON\",value:function(){return Object.assign(q.prototype.toJSON.call(this),{name:this.name,attributes:this.attributes,children:this.children.map((function(t){return t.toJSON()}))})}}]),r}(),V=J;function K(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var $=V,z=j,Q=function(t){p(r,z);var e=K(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l(this,r),(t=e.call(this)).children=n,t}return b(r,[{key:\"document\",get:function(){return this}},{key:\"root\",get:function(){return this.children.find((function(t){return t instanceof $}))||null}},{key:\"text\",get:function(){return this.children.map((function(t){return\"text\"in t?t.text:\"\"})).join(\"\")}},{key:\"type\",get:function(){return z.TYPE_DOCUMENT}},{key:\"toJSON\",value:function(){return Object.assign(z.prototype.toJSON.call(this),{children:this.children.map((function(t){return t.toJSON()}))})}}]),r}(),H=Q;function Z(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var tt=j,et=function(t){p(r,tt);var e=Z(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";return l(this,r),(n=e.call(this)).name=t,n.content=i,n}return b(r,[{key:\"type\",get:function(){return tt.TYPE_PROCESSING_INSTRUCTION}},{key:\"toJSON\",value:function(){return Object.assign(tt.prototype.toJSON.call(this),{name:this.name,content:this.content})}}]),r}(),rt=et;function nt(t,e){var r;if(\"undefined\"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if(\"string\"==typeof t)return it(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return it(t,e)}(t))||e&&t&&\"number\"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,a=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw o}}}}function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ot=P,at=O,ct=_,ut=X,st=H,ft=V,lt=rt,ht=L,pt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(l(this,t),this.document=new st,this.currentNode=this.document,this.options=r,this.scanner=new ot(vt(e)),this.consumeProlog(),this.consumeElement()||this.error(\"Root element is missing or invalid\");this.consumeMisc(););this.scanner.isEnd||this.error(\"Extra content at the end of the document\")}return b(t,[{key:\"addNode\",value:function(t){t.parent=this.currentNode,this.currentNode.children.push(t)}},{key:\"addText\",value:function(t){var e=this.currentNode.children;if(e.length>0){var r=e[e.length-1];if(r instanceof ht)return void(r.text+=t)}this.addNode(new ht(t))}},{key:\"consumeAttributeValue\",value:function(){var t,e=this.scanner,r=e.peek();if('\"'!==r&&\"'\"!==r)return!1;e.advance();var n=!1,i=\"\",o='\"'===r?new RegExp('[^\"&<]+',\"y\"):new RegExp(\"[^'&<]+\",\"y\");t:for(;!e.isEnd;){switch((t=e.consumeMatch(o))&&(this.validateChars(t),i+=t.replace(/[\\t\\r\\n]/g,\" \")),e.peek()){case r:n=!0;break t;case\"&\":i+=this.consumeReference();continue;case\"<\":this.error(\"Unescaped `<` is not allowed in an attribute value\");break;case\"\":this.error(\"Unclosed attribute\")}}return n||this.error(\"Unclosed attribute\"),e.advance(),i}},{key:\"consumeCdataSection\",value:function(){var t=this.scanner;if(!t.consumeStringFast(\"<![CDATA[\"))return!1;var e=t.consumeUntilString(\"]]>\");return this.validateChars(e),t.consumeStringFast(\"]]>\")||this.error(\"Unclosed CDATA section\"),this.options.preserveCdata?this.addNode(new ct(e)):this.addText(e),!0}},{key:\"consumeCharData\",value:function(){var t=this.scanner,e=t.consumeUntilMatch(/<|&|]]>/g);return!!e&&(this.validateChars(e),\"]\"===t.peek()&&\"]]>\"===t.peek(3)&&this.error(\"Element content may not contain the CDATA section close delimiter `]]>`\"),this.addText(e),!0)}},{key:\"consumeComment\",value:function(){var t=this.scanner;if(!t.consumeStringFast(\"\\x3c!--\"))return!1;var e=t.consumeUntilString(\"--\");return this.validateChars(e),t.consumeStringFast(\"--\\x3e\")||(\"--\"===t.peek(2)?this.error(\"The string `--` isn't allowed inside a comment\"):this.error(\"Unclosed comment\")),this.options.preserveComments&&this.addNode(new ut(e.trim())),!0}},{key:\"consumeContentReference\",value:function(){var t=this.consumeReference();return!!t&&(this.addText(t),!0)}},{key:\"consumeDoctypeDeclaration\",value:function(){var t=this.scanner;return!(!t.consumeStringFast(\"<!DOCTYPE\")||!this.consumeWhitespace())&&(t.consumeMatch(new RegExp(\"[^[>]+\",\"y\")),t.consumeMatch(new RegExp(\"\\\\[[\\\\s\\\\S]+?\\\\][\\\\x20\\\\t\\\\r\\\\n]*>\",\"y\"))||t.consumeStringFast(\">\")||this.error(\"Unclosed doctype declaration\"),!0)}},{key:\"consumeElement\",value:function(){var t=this.scanner,e=t.charIndex;if(\"<\"!==t.peek())return!1;t.advance();var r=this.consumeName();if(!r)return t.reset(e),!1;for(var n=Object.create(null);this.consumeWhitespace();){var i=this.consumeName();if(i){var o=this.consumeEqual()&&this.consumeAttributeValue();!1===o&&this.error(\"Attribute value expected\"),i in n&&this.error(\"Duplicate attribute: \".concat(i)),\"xml:space\"===i&&\"default\"!==o&&\"preserve\"!==o&&this.error('Value of the `xml:space` attribute must be \"default\" or \"preserve\"'),n[i]=o}}if(this.options.sortAttributes){for(var a=Object.keys(n).sort(),c=Object.create(null),u=0;u<a.length;++u){var s=a[u];c[s]=n[s]}n=c}var f=Boolean(t.consumeStringFast(\"/>\")),l=new ft(r,n);if(l.parent=this.currentNode,!f){for(t.consumeStringFast(\">\")||this.error(\"Unclosed start tag for element `\".concat(r,\"`\")),this.currentNode=l,this.consumeCharData();this.consumeElement()||this.consumeContentReference()||this.consumeCdataSection()||this.consumeProcessingInstruction()||this.consumeComment();)this.consumeCharData();var h,p=t.charIndex;t.consumeStringFast(\"</\")&&(h=this.consumeName())&&h===r||(t.reset(p),this.error(\"Missing end tag for element \".concat(r))),this.consumeWhitespace(),t.consumeStringFast(\">\")||this.error(\"Unclosed end tag for element \".concat(r)),this.currentNode=l.parent}return this.addNode(l),!0}},{key:\"consumeEqual\",value:function(){return this.consumeWhitespace(),!!this.scanner.consumeStringFast(\"=\")&&(this.consumeWhitespace(),!0)}},{key:\"consumeMisc\",value:function(){return this.consumeComment()||this.consumeProcessingInstruction()||this.consumeWhitespace()}},{key:\"consumeName\",value:function(){return at.isNameStartChar(this.scanner.peek())?this.scanner.consumeMatchFn(at.isNameChar):\"\"}},{key:\"consumeProcessingInstruction\",value:function(){var t=this.scanner,e=t.charIndex;if(!t.consumeStringFast(\"<?\"))return!1;var r=this.consumeName();if(r?\"xml\"===r.toLowerCase()&&(t.reset(e),this.error(\"XML declaration isn't allowed here\")):this.error(\"Invalid processing instruction\"),!this.consumeWhitespace()){if(t.consumeStringFast(\"?>\"))return this.addNode(new lt(r)),!0;this.error(\"Whitespace is required after a processing instruction name\")}var n=t.consumeUntilString(\"?>\");return this.validateChars(n),t.consumeStringFast(\"?>\")||this.error(\"Unterminated processing instruction\"),this.addNode(new lt(r,n)),!0}},{key:\"consumeProlog\",value:function(){var t=this.scanner,e=t.charIndex;for(this.consumeXmlDeclaration();this.consumeMisc(););if(this.consumeDoctypeDeclaration())for(;this.consumeMisc(););return e<t.charIndex}},{key:\"consumeReference\",value:function(){var t=this.scanner;if(\"&\"!==t.peek())return!1;t.advance();var e,r=t.consumeMatchFn(at.isReferenceChar);if(\";\"!==t.consume()&&this.error(\"Unterminated reference (a reference must end with `;`)\"),\"#\"===r[0]){var i=\"x\"===r[1]?parseInt(r.slice(2),16):parseInt(r.slice(1),10);isNaN(i)&&this.error(\"Invalid character reference\"),e=String.fromCodePoint(i),at.isXmlChar(e)||this.error(\"Character reference resolves to an invalid character\")}else if(void 0===(e=at.predefinedEntities[r])){var o=this.options,a=o.ignoreUndefinedEntities,c=o.resolveUndefinedEntity,u=\"&\".concat(r,\";\");if(c){var s=c(u);if(null!=s){var f=n(s);if(\"string\"!==f)throw new TypeError(\"`resolveUndefinedEntity()` must return a string, `null`, or `undefined`, but returned a value of type \".concat(f));return s}}if(a)return u;t.reset(-u.length),this.error(\"Named entity isn't defined: \".concat(u))}return e}},{key:\"consumeSystemLiteral\",value:function(){var t=this.scanner,e=t.consumeStringFast('\"')||t.consumeStringFast(\"'\");if(!e)return!1;var r=t.consumeUntilString(e);return this.validateChars(r),t.consumeStringFast(e)||this.error(\"Missing end quote\"),r}},{key:\"consumeWhitespace\",value:function(){return Boolean(this.scanner.consumeMatchFn(at.isWhitespace))}},{key:\"consumeXmlDeclaration\",value:function(){var t=this.scanner;if(!t.consumeStringFast(\"<?xml\"))return!1;this.consumeWhitespace()||this.error(\"Invalid XML declaration\");var e=Boolean(t.consumeStringFast(\"version\"))&&this.consumeEqual()&&this.consumeSystemLiteral();if(!1===e?this.error(\"XML version is missing or invalid\"):/^1\\.[0-9]+$/.test(e)||this.error(\"Invalid character in version number\"),this.consumeWhitespace()){Boolean(t.consumeStringFast(\"encoding\"))&&this.consumeEqual()&&this.consumeSystemLiteral()&&this.consumeWhitespace();var r=Boolean(t.consumeStringFast(\"standalone\"))&&this.consumeEqual()&&this.consumeSystemLiteral();r&&(\"yes\"!==r&&\"no\"!==r&&this.error('Only \"yes\" and \"no\" are permitted as values of `standalone`'),this.consumeWhitespace())}return t.consumeStringFast(\"?>\")||this.error(\"Invalid or unclosed XML declaration\"),!0}},{key:\"error\",value:function(t){for(var e=this.scanner,r=e.charIndex,n=e.string,i=1,o=\"\",a=1,c=0;c<r;++c){var u=n[c];\"\\n\"===u?(i=1,o=\"\",a+=1):(i+=1,o+=u)}var s=n.indexOf(\"\\n\",r),f=0;(o+=-1===s?n.slice(r):n.slice(r,s)).length>50&&(i<40?o=o.slice(0,50):(f=i-20,o=o.slice(f,i+30)));var l=new Error(\"\".concat(t,\" (line \").concat(a,\", column \").concat(i,\")\\n\")+\" \".concat(o,\"\\n\")+\" \".repeat(i-f+1)+\"^\\n\");throw Object.assign(l,{column:i,excerpt:o,line:a,pos:r}),l}},{key:\"validateChars\",value:function(t){var e,r=0,n=nt(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;at.isNotXmlChar(i)&&(this.scanner.reset(-(f(t).length-r)),this.error(\"Invalid character\")),r+=1}}catch(t){n.e(t)}finally{n.f()}}}]),t}();function vt(t){return\"\\ufeff\"===t[0]&&(t=t.slice(1)),t.replace(/\\r\\n?/g,\"\\n\")}var mt=pt,yt=_,dt=X,gt=H,St=V,bt=j,Et=rt,Pt=L;function Ot(t,e){return new mt(t,e).document}Ot.XmlCdata=yt,Ot.XmlComment=dt,Ot.XmlDocument=gt,Ot.XmlElement=St,Ot.XmlNode=bt,Ot.XmlProcessingInstruction=Et,Ot.XmlText=Pt;var xt=Ot;function wt(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m(t);if(e){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}var kt=function(t){p(r,g(Error));var e=wt(r);function r(t){return l(this,r),e.call(this,t)}return r}();function Rt(t){return t.children[0]}function Gt(t){var e=t.indexOf(\":\");return e>-1?t.substr(e+1):t}function Tt(t){return t.name||\"\"}function jt(t,e,r){var n=Gt(e);return t&&Array.isArray(t.children)?t.children.reduce((function t(e,i){return Gt(Tt(i))===n&&e.push(i),r&&Array.isArray(i.children)?[].concat(f(e),f(i.children.reduce(t,[]))):e}),[]):[]}function Nt(t,e,r){return jt(t,e,r)[0]||null}function Ct(t){return t&&Array.isArray(t.children)?f(t.children.filter((function(t){return\"XmlElement\"===t.constructor.name}))):[]}function Ft(t){var e=t&&Array.isArray(t.children)?t.children.find((function(t){return\"text\"===t.type})):null;return e?e.text:\"\"}function Lt(t,e){return t&&t.attributes[e]||\"\"}var It=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];l(this,t),this.message=e,this.httpStatus=r,this.isCrossOriginRelated=n};function At(t){return fetch(t).catch((function(t){throw new It(t.message,0,!0)})).then(function(){var t=r(o.mark((function t(e){var r;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.text();case 2:if(r=t.sent,e.ok){t.next=5;break}throw new It(\"Received an error with code \".concat(e.status,\": \").concat(r),e.status,!1);case 5:return t.abrupt(\"return\",r);case 6:case\"end\":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then((function(t){return function(t){var e=null;try{e=xt(t)}catch(t){throw new kt(t.message)}return e}(t)}))}var Mt=[\"EPSG:4046\",\"EPSG:4075\",\"EPSG:4120\",\"EPSG:4122\",\"EPSG:4124\",\"EPSG:4126\",\"EPSG:4149\",\"EPSG:4151\",\"EPSG:4153\",\"EPSG:4155\",\"EPSG:4157\",\"EPSG:4159\",\"EPSG:4161\",\"EPSG:4163\",\"EPSG:4165\",\"EPSG:4167\",\"EPSG:4169\",\"EPSG:4171\",\"EPSG:4173\",\"EPSG:4175\",\"EPSG:4178\",\"EPSG:4180\",\"EPSG:4182\",\"EPSG:4184\",\"EPSG:4188\",\"EPSG:4190\",\"EPSG:4191\",\"EPSG:4196\",\"EPSG:4198\",\"EPSG:4202\",\"EPSG:4210\",\"EPSG:4211\",\"EPSG:4214\",\"EPSG:4226\",\"EPSG:4229\",\"EPSG:4231\",\"EPSG:4233\",\"EPSG:4236\",\"EPSG:4238\",\"EPSG:4240\",\"EPSG:4242\",\"EPSG:4244\",\"EPSG:4246\",\"EPSG:4248\",\"EPSG:4250\",\"EPSG:4252\",\"EPSG:4255\",\"EPSG:4258\",\"EPSG:4261\",\"EPSG:4264\",\"EPSG:4267\",\"EPSG:4270\",\"EPSG:4273\",\"EPSG:4276\",\"EPSG:4279\",\"EPSG:4281\",\"EPSG:4284\",\"EPSG:4286\",\"EPSG:4288\",\"EPSG:4292\",\"EPSG:4295\",\"EPSG:4297\",\"EPSG:4299\",\"EPSG:4302\",\"EPSG:4324\",\"EPSG:4326\"];function Bt(t){return Mt.indexOf(_t(t))>-1}function _t(t){if(/^urn:(?:x-)?ogc:def:crs:epsg:/.test(t.toLowerCase())){var e=/([0-9]+)$/.exec(t)[1];return\"EPSG:\".concat(e)}return t}function Ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ut(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wt(t){return Rt(t).attributes.version}function Xt(t){var e=Wt(t);return jt(Nt(Rt(t),\"Capability\"),\"Layer\").map((function(t){return Yt(t,e)}))}function Yt(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=\"1.3.0\"===r?\"CRS\":\"SRS\",c=jt(e,a).map(Ft),u=c.length>0?c:n,s=jt(e,\"Style\").map(qt),f=s.length>0?s:i;function l(t){return(Bt(Lt(t,a))&&\"1.3.0\"===r?[\"miny\",\"minx\",\"maxy\",\"maxx\"]:[\"minx\",\"miny\",\"maxx\",\"maxy\"]).map((function(e){return Lt(t,e)}))}var h=Nt(e,\"Attribution\"),p=null!==h?Jt(h):o,v=jt(e,\"Layer\").map((function(t){return Yt(t,r,u,f,p)}));return Dt({name:Ft(Nt(e,\"Name\")),title:Ft(Nt(e,\"Title\")),abstract:Ft(Nt(e,\"Abstract\")),availableCrs:u,styles:f,attribution:p,boundingBoxes:jt(e,\"BoundingBox\").reduce((function(e,r){return Dt(Dt({},e),{},t({},Lt(r,a),l(r)))}),{})},v.length&&{children:v})}function qt(t){var e=Lt(Nt(Nt(t,\"LegendURL\"),\"OnlineResource\"),\"xlink:href\");return Dt({name:Ft(Nt(t,\"Name\")),title:Ft(Nt(t,\"Title\"))},e&&{legendUrl:e})}function Jt(t){var e=Lt(Nt(Nt(t,\"LogoURL\"),\"OnlineResource\"),\"xlink:href\"),r=Lt(Nt(t,\"OnlineResource\"),\"xlink:href\"),n=Ft(Nt(t,\"Title\"));return Dt(Dt(Dt({},n&&{title:n}),r&&{url:r}),e&&{logoUrl:e})}function Vt(t){return Rt(t).attributes.version}function Kt(t){var e;if(Vt(t).startsWith(\"1.0\")){var r=Nt(Nt(Nt(Rt(t),\"Capability\"),\"Request\"),\"GetFeature\");e=Ct(Nt(r,\"ResultFormat\")).map(Tt)}else{var n=jt(Nt(Rt(t),\"OperationsMetadata\"),\"Operation\").find((function(t){return\"GetFeature\"===Lt(t,\"name\")})),i=jt(n,\"Parameter\").find((function(t){return\"outputFormat\"===Lt(t,\"name\")}));e=jt(i,\"Value\",!0).map(Ft)}return e}function $t(t){var e=Vt(t),r=Kt(t);return jt(Nt(Rt(t),\"FeatureTypeList\"),\"FeatureType\").map((function(t){return function(t,e,r){var n=e.startsWith(\"2.\")?\"CRS\":\"SRS\",i=e.startsWith(\"1.0\")?\"SRS\":\"Default\".concat(n);function o(){var e=Nt(t,\"LatLongBoundingBox\");return[\"minx\",\"miny\",\"maxx\",\"maxy\"].map((function(t){return Lt(e,t)})).map(parseFloat)}function a(){var e=Nt(t,\"WGS84BoundingBox\");return[\"LowerCorner\",\"UpperCorner\"].map((function(t){return Nt(e,t)})).map((function(t){return Ft(t).split(\" \")})).reduce((function(t,e){return[].concat(f(t),f(e))})).map(parseFloat)}var c=e.startsWith(\"1.0\")?[]:jt(t,\"Other\".concat(n)).map(Ft).map(_t),u=e.startsWith(\"1.0\")?[]:jt(Nt(t,\"OutputFormats\"),\"Format\").map(Ft);return{name:Ft(Nt(t,\"Name\")),title:Ft(Nt(t,\"Title\")),abstract:Ft(Nt(t,\"Abstract\")),defaultCrs:_t(Ft(Nt(t,i))),otherCrs:c,outputFormats:u.length>0?u:r,latLonBoundingBox:e.startsWith(\"1.0\")?o():a()}}(t,e,r)}))}function zt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qt(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?zt(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ht(e,r,n){var i,o=Rt(e);if(n.startsWith(\"2.0\"))i=jt(o,\"member\").map((function(t){return Ct(t)[0]}));else{var a=Nt(o,\"featureMembers\");i=a?Ct(a):jt(o,\"featureMember\").map((function(t){return Ct(t)[0]}))}var c=\"1.0.0\"===n?\"fid\":\"gml:id\";function u(e){return Ct(e).filter((function(t){return Gt(Tt(t))in r.properties})).reduce((function(e,n){var i=Gt(Tt(n));return Qt(Qt({},e),{},t({},i,function(t,e){switch(r.properties[t]){case\"integer\":return parseInt(e);case\"float\":return parseFloat(e);case\"boolean\":return\"true\"===e;default:return e}}(i,Ft(n))))}),{})}return i.map((function(t){return{id:Lt(t,c),properties:u(t)}}))}u(\"parseWmsCapabilities\",self,(function(t){return At(t.url).then((function(t){return{info:(e=t,r=Nt(Rt(e),\"Service\"),n=jt(Nt(r,\"KeywordList\"),\"Keyword\").map(Ft).filter((function(t,e,r){return r.indexOf(t)===e})),{title:Ft(Nt(r,\"Title\")),name:Ft(Nt(r,\"Name\")),abstract:Ft(Nt(r,\"Abstract\")),fees:Ft(Nt(r,\"Fees\")),constraints:Ft(Nt(r,\"AccessConstraints\")),keywords:n}),layers:Xt(t),version:Wt(t)};var e,r,n}))})),u(\"parseWfsCapabilities\",self,(function(t){return At(t.url).then((function(t){return{info:(e=t,n=Vt(e),i=n.startsWith(\"1.0\")?\"Service\":\"ServiceIdentification\",o=n.startsWith(\"1.0\")?\"Name\":\"ServiceType\",a=Nt(Rt(e),i),r=n.startsWith(\"1.0\")?Ft(Nt(a,\"Keywords\")).split(\",\").map((function(t){return t.trim()})):jt(Nt(a,\"Keywords\"),\"Keyword\").map(Ft),{title:Ft(Nt(a,\"Title\")),name:Ft(Nt(a,o)),abstract:Ft(Nt(a,\"Abstract\")),fees:Ft(Nt(a,\"Fees\")),constraints:Ft(Nt(a,\"AccessConstraints\")),keywords:r,outputFormats:Kt(e)}),featureTypes:$t(t),version:Vt(t)};var e,r,n,i,o,a}))})),u(\"queryWfsFeatureTypeDetails\",self,(function(t){var e=t.url,r=t.serviceVersion,n=t.featureTypeFull,i=function(t,e,r,n,i,o,a,c,u,s){var f=\"2.0.0\"===e?\"TYPENAMES\":\"TYPENAME\",l=\"2.0.0\"===e?\"COUNT\":\"MAXFEATURES\",h=new URL(t);if(h.searchParams.set(\"SERVICE\",\"WFS\"),h.searchParams.set(\"REQUEST\",\"GetFeature\"),h.searchParams.set(\"VERSION\",e),h.searchParams.set(f,r),void 0!==n&&h.searchParams.set(\"OUTPUTFORMAT\",n),void 0!==o&&h.searchParams.set(\"PROPERTYNAME\",o.join(\",\")),a?(h.searchParams.set(\"RESULTTYPE\",\"hits\"),h.searchParams.set(l,\"1\")):void 0!==i&&h.searchParams.set(l,i.toString(10)),c&&h.searchParams.set(\"SRSNAME\",c),u){var p=u.join(\",\");h.searchParams.set(\"BBOX\",s?\"\".concat(p,\",\").concat(s):p)}return h.toString()}(e,r,n.name,void 0,Object.keys(n.properties));return At(i).then((function(t){return{props:(e=Ht(t,n,r),e.reduce((function(t,e){var r=function(r){var n=e.properties[r];r in t||(t[r]={uniqueValues:[]});var i=t[r].uniqueValues.find((function(t){return t.value===n}));i?i.count++:t[r].uniqueValues.push({value:n,count:1})};for(var n in e.properties)r(n);return t}),{}))};var e}))}));\n"], {type: 'application/javascript'})), {
type: 'module',

@@ -11,0 +11,0 @@ });

{
"name": "@camptocamp/ogc-client",
"version": "0.2.2",
"version": "0.2.3",
"description": "A pure JS library for interacting with geospatial services.",

@@ -5,0 +5,0 @@ "main": "./dist/dist-node.js",

@@ -67,2 +67,3 @@ import { parseXmlString } from '../shared/xml-utils';

'text/xml; subtype=gml/2.1.2',
'application/json',
],

@@ -100,3 +101,5 @@ title: 'CD 16 - Comptages routiers',

...types,
outputFormats: ['text/xml; subtype=gml/3.1.1'],
outputFormats: types.outputFormats.filter(
(f) => f.indexOf('3.2') === -1 && f.indexOf('2.1') === -1
),
}));

@@ -103,0 +106,0 @@ expect(readFeatureTypesFromCapabilities(doc)).toEqual(typesWithGml3);

@@ -288,12 +288,43 @@ import { EndpointError } from '../shared/errors';

/**
* @param {string} featureType
* @return {string|null}
* @private
*/
_getJsonCompatibleOutputFormat(featureType) {
const featureTypeInfo = this._getFeatureTypeByName(featureType);
if (!featureTypeInfo) return null;
const candidates = featureTypeInfo.outputFormats.filter(
(f) => f.toLowerCase().indexOf('json') > -1
);
if (!candidates.length) return null;
return candidates[0];
}
/**
* Returns true if the given feature type can be downloaded as GeoJSON
* @return {boolean|null}
*/
supportsJson(featureType) {
if (!this._featureTypes) return null;
return !!this._getJsonCompatibleOutputFormat(featureType);
}
/**
* Will build a GetFeature url based on the given parameters
* @param featureType
* @param {number} [maxFeatures] no limit if undefined
* @param {MimeType} [outputFormat] default format if undefined
* @param {string} featureType
* @param {Object} [options]
* @property {number} [options.maxFeatures] no limit if undefined
* @property {boolean} [options.asJson] if true, will ask for GeoJSON; will throw if the service does not support it
* @property {MimeType} [options.outputFormat] a supported output format (overridden by `asJson`)
* @property {CrsCode} [options.outputCrs] if unspecified, this will be the data native projection
* @property {BoundingBox} [options.extent] an extent to restrict returned objects
* @property {CrsCode} [options.extentCrs] if unspecified, `extent` should be in the data native projection
* @returns {string|null} Returns null if endpoint is not ready
*/
getFeatureUrl(featureType, maxFeatures, outputFormat) {
getFeatureUrl(featureType, options) {
if (!this._featureTypes) {
return null;
}
const { maxFeatures, asJson, outputFormat, outputCrs, extent, extentCrs } =
options || {};
const internalFeatureType = this._getFeatureTypeByName(featureType);

@@ -305,3 +336,14 @@ if (!internalFeatureType) {

}
if (internalFeatureType.outputFormats.indexOf(outputFormat) === -1) {
let format = outputFormat;
if (asJson) {
format = this._getJsonCompatibleOutputFormat(featureType) || undefined;
if (!format) {
throw new Error(
`The endpoint does not appear to support GeoJSON for the feature type ${internalFeatureType.name}`
);
}
} else if (
outputFormat &&
internalFeatureType.outputFormats.indexOf(outputFormat) === -1
) {
throw new Error(

@@ -315,6 +357,11 @@ `The following output format type was not found in the feature type ${internalFeatureType.name}: ${outputFormat}`

internalFeatureType.name,
outputFormat,
maxFeatures
format,
maxFeatures,
undefined,
undefined,
outputCrs,
extent,
extentCrs
);
}
}

@@ -29,3 +29,3 @@ import capabilities200 from '../../fixtures/wfs/capabilities-pigma-2-0-0.xml';

endpoint = new WfsEndpoint(
'https://my.test.service/ogc/wfs?service=wfs&request=DescribeFeatureType&featureType=myfeatures'
'https://my.test.service/ogc/wfs?service=wfs&request=DescribeFeatureType'
);

@@ -37,3 +37,3 @@ });

expect(window.fetch).toHaveBeenCalledWith(
'https://my.test.service/ogc/wfs?featureType=myfeatures&SERVICE=WFS&REQUEST=GetCapabilities'
'https://my.test.service/ogc/wfs?SERVICE=WFS&REQUEST=GetCapabilities'
);

@@ -407,12 +407,30 @@ });

expect(
endpoint.getFeatureUrl(
'hierarchisation_l',
200,
'application/gml+xml; version=3.2'
)
endpoint.getFeatureUrl('hierarchisation_l', {
maxFeatures: 200,
outputFormat: 'application/gml+xml; version=3.2',
})
).toEqual(
'https://my.test.service/ogc/wfs?featureType=myfeatures&SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Ahierarchisation_l&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&COUNT=200'
'https://my.test.service/ogc/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Ahierarchisation_l&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&COUNT=200'
);
});
it('returns an error if the feature type was not found', () => {
it('returns a GetFeature requesting geojson url for a given feature type', () => {
expect(
endpoint.getFeatureUrl('comptages_routiers_l', {
asJson: true,
})
).toEqual(
'https://my.test.service/ogc/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Acomptages_routiers_l&OUTPUTFORMAT=application%2Fjson'
);
});
it('returns a GetFeature with a bbox and output crs for a given feature type', () => {
expect(
endpoint.getFeatureUrl('hierarchisation_l', {
extent: [1, 2, 3, 4],
outputCrs: 'EPSG:2154',
})
).toEqual(
'https://my.test.service/ogc/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Ahierarchisation_l&SRSNAME=EPSG%3A2154&BBOX=1%2C2%2C3%2C4'
);
});
it('throws an error if the feature type was not found', () => {
expect(() => endpoint.getFeatureUrl('does_not_exist')).toThrow(

@@ -422,12 +440,18 @@ 'feature type'

});
it('returns an error if the required output format is not supported by the feature type', () => {
it('throws an error if the required output format is not supported by the feature type', () => {
expect(() =>
endpoint.getFeatureUrl(
'hierarchisation_l',
200,
'application/invalid+mime+type'
)
endpoint.getFeatureUrl('hierarchisation_l', {
maxFeatures: 200,
outputFormat: 'application/invalid+mime+type',
})
).toThrow('output format');
});
it('throws an error if the the feature type does not support geojson', () => {
expect(() =>
endpoint.getFeatureUrl('hierarchisation_l', {
asJson: true,
})
).toThrow('GeoJSON');
});
});
});

@@ -11,2 +11,5 @@ /**

* note: this might not work for WFS version < 2
* @param {CrsCode} [outputCrs] if unspecified, this will be the data native projection
* @param {BoundingBox} [extent] an extent to restrict returned objects
* @param {CrsCode} [extentCrs] if unspecified, `extent` should be in the data native projection
* @return {string}

@@ -21,3 +24,6 @@ */

attributes,
hitsOnly
hitsOnly,
outputCrs,
extent,
extentCrs
) {

@@ -40,2 +46,12 @@ const typeParam = version === '2.0.0' ? 'TYPENAMES' : 'TYPENAME';

url.searchParams.set(countParam, maxFeatures.toString(10));
if (outputCrs) {
url.searchParams.set('SRSNAME', outputCrs);
}
if (extent) {
const extentJoined = extent.join(',');
url.searchParams.set(
'BBOX',
extentCrs ? `${extentJoined},${extentCrs}` : extentJoined
);
}
return url.toString();

@@ -42,0 +58,0 @@ }

@@ -81,4 +81,23 @@ import { generateDescribeFeatureTypeUrl, generateGetFeatureUrl } from './url';

});
it('generates a correct URL (v2.0.0)', () => {
expect(
generateGetFeatureUrl(
'http://example.com/wfs',
'2.0.0',
'my:type',
undefined,
undefined,
undefined,
undefined,
'EPSG:2154',
[10, 20, 100, 200],
'EPSG:3857'
)
).toBe(
'http://example.com/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my%3Atype&SRSNAME=EPSG%3A2154&BBOX=10%2C20%2C100%2C200%2CEPSG%3A3857'
);
});
});
describe('generateGetFeatureUrl', () => {
describe('generateDescribeFeatureTypeUrl', () => {
it('generates a correct URL (v1.0.0)', () => {

@@ -85,0 +104,0 @@ expect(

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

import {
readInfoFromCapabilities,
readLayersFromCapabilities,
readVersionFromCapabilities,
} from './capabilities';
import { EndpointError } from '../shared/errors';
import { queryXmlDocument } from '../shared/http-utils';
import { parseWmsCapabilities } from '../worker';

@@ -9,0 +3,0 @@ import { useCache } from '../shared/cache';

Sorry, the diff of this file is too big to display

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