/* eslint-disable */ /*! For license information please see ol.js.LICENSE.txt */ !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ol=n():t.ol=n()}(self,(function(){return function(){var t,n={226:function(t,n){n.read=function(t,n,i,r,e){var o,s,u=8*e-r-1,a=(1<>1,f=-7,c=i?e-1:0,l=i?-1:1,v=t[n+c];for(c+=l,o=v&(1<<-f)-1,v>>=-f,f+=u;f>0;o=256*o+t[n+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[n+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===a)return s?NaN:1/0*(v?-1:1);s+=Math.pow(2,r),o-=h}return(v?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,n,i,r,e,o){var s,u,a,h=8*o-e-1,f=(1<>1,l=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:o-1,d=r?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(u=isNaN(n)?1:0,s=f):(s=Math.floor(Math.log(n)/Math.LN2),n*(a=Math.pow(2,-s))<1&&(s--,a*=2),(n+=s+c>=1?l/a:l*Math.pow(2,1-c))*a>=2&&(s++,a/=2),s+c>=f?(u=0,s=f):s+c>=1?(u=(n*a-1)*Math.pow(2,e),s+=c):(u=n*Math.pow(2,c-1)*Math.pow(2,e),s=0));e>=8;t[i+v]=255&u,v+=d,u/=256,e-=8);for(s=s<0;t[i+v]=255&s,v+=d,s/=256,h-=8);t[i+v-d]|=128*p}},875:function(t,n,i){"use strict";const r=i(692),e=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),u=Symbol("allowStale"),a=Symbol("maxAge"),h=Symbol("dispose"),f=Symbol("noDisposeOnSet"),c=Symbol("lruList"),l=Symbol("cache"),v=Symbol("updateAgeOnGet"),d=()=>1;const p=(t,n,i)=>{const r=t[l].get(n);if(r){const n=r.value;if(y(t,n)){if(w(t,r),!t[u])return}else i&&(t[v]&&(r.value.now=Date.now()),t[c].unshiftNode(r));return n.value}},y=(t,n)=>{if(!n||!n.maxAge&&!t[a])return!1;const i=Date.now()-n.now;return n.maxAge?i>n.maxAge:t[a]&&i>t[a]},m=t=>{if(t[o]>t[e])for(let n=t[c].tail;t[o]>t[e]&&null!==n;){const i=n.prev;w(t,n),n=i}},w=(t,n)=>{if(n){const i=n.value;t[h]&&t[h](i.key,i.value),t[o]-=i.length,t[l].delete(i.key),t[c].removeNode(n)}};class g{constructor(t,n,i,r,e){this.key=t,this.value=n,this.length=i,this.now=r,this.maxAge=e||0}}const b=(t,n,i,r)=>{let e=i.value;y(t,e)&&(w(t,i),t[u]||(e=void 0)),e&&n.call(r,e.value,e.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[e]=t.max||1/0;const n=t.length||d;if(this[s]="function"!=typeof n?d:n,this[u]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[a]=t.maxAge||0,this[h]=t.dispose,this[f]=t.noDisposeOnSet||!1,this[v]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[e]=t||1/0,m(this)}get max(){return this[e]}set allowStale(t){this[u]=!!t}get allowStale(){return this[u]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[a]=t,m(this)}get maxAge(){return this[a]}set lengthCalculator(t){"function"!=typeof t&&(t=d),t!==this[s]&&(this[s]=t,this[o]=0,this[c].forEach((t=>{t.length=this[s](t.value,t.key),this[o]+=t.length}))),m(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[c].length}rforEach(t,n){n=n||this;for(let i=this[c].tail;null!==i;){const r=i.prev;b(this,t,i,n),i=r}}forEach(t,n){n=n||this;for(let i=this[c].head;null!==i;){const r=i.next;b(this,t,i,n),i=r}}keys(){return this[c].toArray().map((t=>t.key))}values(){return this[c].toArray().map((t=>t.value))}reset(){this[h]&&this[c]&&this[c].length&&this[c].forEach((t=>this[h](t.key,t.value))),this[l]=new Map,this[c]=new r,this[o]=0}dump(){return this[c].map((t=>!y(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[c]}set(t,n,i){if((i=i||this[a])&&"number"!=typeof i)throw new TypeError("maxAge must be a number");const r=i?Date.now():0,u=this[s](n,t);if(this[l].has(t)){if(u>this[e])return w(this,this[l].get(t)),!1;const s=this[l].get(t).value;return this[h]&&(this[f]||this[h](t,s.value)),s.now=r,s.maxAge=i,s.value=n,this[o]+=u-s.length,s.length=u,this.get(t),m(this),!0}const v=new g(t,n,u,r,i);return v.length>this[e]?(this[h]&&this[h](t,n),!1):(this[o]+=v.length,this[c].unshift(v),this[l].set(t,this[c].head),m(this),!0)}has(t){if(!this[l].has(t))return!1;const n=this[l].get(t).value;return!y(this,n)}get(t){return p(this,t,!0)}peek(t){return p(this,t,!1)}pop(){const t=this[c].tail;return t?(w(this,t),t.value):null}del(t){w(this,this[l].get(t))}load(t){this.reset();const n=Date.now();for(let i=t.length-1;i>=0;i--){const r=t[i],e=r.e||0;if(0===e)this.set(r.k,r.v);else{const t=e-n;t>0&&this.set(r.k,r.v,t)}}}prune(){this[l].forEach(((t,n)=>p(this,n,!1)))}}},98:function(t,n,i){"use strict";t.exports=e;var r=i(226);function e(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var o=4294967296,s=1/o,u="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===e.Bytes?t.readVarint()+t.pos:t.pos+1}function h(t,n,i){return i?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function f(t,n,i){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(r);for(var e=i.pos-1;e>=t;e--)i.buf[e+r]=i.buf[e]}function c(t,n){for(var i=0;i>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function M(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}e.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos>3,o=this.pos;this.type=7&r,t(e,n,this),this.pos===o&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=M(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=b(this.buf,this.pos)+b(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=b(this.buf,this.pos)+M(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,r=this.buf;return n=127&(i=r[this.pos++]),i<128?n:(n|=(127&(i=r[this.pos++]))<<7,i<128?n:(n|=(127&(i=r[this.pos++]))<<14,i<128?n:(n|=(127&(i=r[this.pos++]))<<21,i<128?n:function(t,n,i){var r,e,o=i.buf;if(e=o[i.pos++],r=(112&e)>>4,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<3,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<10,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<17,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<24,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(1&e)<<31,e<128)return h(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=12&&u?function(t,n,i){return u.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var r="",e=n;for(;e239?4:a>223?3:a>191?2:1;if(e+f>i)break;1===f?a<128&&(h=a):2===f?128==(192&(o=t[e+1]))&&(h=(31&a)<<6|63&o)<=127&&(h=null):3===f?(o=t[e+1],s=t[e+2],128==(192&o)&&128==(192&s)&&((h=(15&a)<<12|(63&o)<<6|63&s)<=2047||h>=55296&&h<=57343)&&(h=null)):4===f&&(o=t[e+1],s=t[e+2],u=t[e+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&((h=(15&a)<<18|(63&o)<<12|(63&s)<<6|63&u)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,f=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),e+=f}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==e.Bytes)return t.push(this.readVarint(n));var i=a(this);for(t=t||[];this.pos127;);else if(n===e.Bytes)this.pos=this.readVarint()+this.pos;else if(n===e.Fixed32)this.pos+=4;else{if(n!==e.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n268435455||t<0?function(t,n){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var n=this.pos;this.pos=function(t,n,i){for(var r,e,o=0;o55295&&r<57344){if(!e){r>56319||o+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):e=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(t[i++]=239,t[i++]=191,t[i++]=189,e=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&f(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var i=0;i=128&&f(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,i){this.writeTag(t,e.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,c,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,l,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,p,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,v,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,d,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,y,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,m,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,w,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,g,n)},writeBytesField:function(t,n){this.writeTag(t,e.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,e.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,e.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,e.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}}},72:function(t){t.exports=function(){"use strict";function t(t,r,e,o,s){!function t(i,r,e,o,s){for(;o>e;){if(o-e>600){var u=o-e+1,a=r-e+1,h=Math.log(u),f=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*f*(u-f)/u)*(a-u/2<0?-1:1);t(i,r,Math.max(e,Math.floor(r-a*f/u+c)),Math.min(o,Math.floor(r+(u-a)*f/u+c)),s)}var l=i[r],v=e,d=o;for(n(i,e,r),s(i[o],l)>0&&n(i,e,o);v0;)d--}0===s(i[e],l)?n(i,e,d):n(i,++d,o),d<=r&&(e=d+1),r<=d&&(o=d-1)}}(t,r,e||0,o||t.length-1,s||i)}function n(t,n,i){var r=t[n];t[n]=t[i],t[i]=r}function i(t,n){return tn?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,n,i){if(!i)return n.indexOf(t);for(var r=0;r=t.minX&&n.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(n,i,r,e,o){for(var s=[i,r];s.length;)if(!((r=s.pop())-(i=s.pop())<=e)){var u=i+Math.ceil((r-i)/e/2)*e;t(n,u,i,r,o),s.push(i,u,u,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,i=[];if(!v(t,n))return i;for(var r=this.toBBox,e=[];n;){for(var o=0;o=0&&e[n].children.length>this._maxEntries;)this._split(e,n),n--;this._adjustParentBBoxes(r,e,n)},r.prototype._split=function(t,n){var i=t[n],r=i.children.length,e=this._minEntries;this._chooseSplitAxis(i,e,r);var s=this._chooseSplitIndex(i,e,r),u=d(i.children.splice(s,i.children.length-s));u.height=i.height,u.leaf=i.leaf,o(i,this.toBBox),o(u,this.toBBox),n?t[n-1].children.push(u):this._splitRoot(i,u)},r.prototype._splitRoot=function(t,n){this.data=d([t,n]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,i){for(var r,e,o,u,a,h,c,l=1/0,v=1/0,d=n;d<=i-n;d++){var p=s(t,0,d,this.toBBox),y=s(t,d,i,this.toBBox),m=(e=p,o=y,u=void 0,a=void 0,h=void 0,c=void 0,u=Math.max(e.minX,o.minX),a=Math.max(e.minY,o.minY),h=Math.min(e.maxX,o.maxX),c=Math.min(e.maxY,o.maxY),Math.max(0,h-u)*Math.max(0,c-a)),w=f(p)+f(y);m=n;v--){var d=t.children[v];u(a,t.leaf?e(d):d),h+=c(a)}return h},r.prototype._adjustParentBBoxes=function(t,n,i){for(var r=i;r>=0;r--)u(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,i=void 0;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children).splice(i.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},r}()},760:function(t){var n=function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",s=e.asyncIterator||"@@asyncIterator",u=e.toStringTag||"@@toStringTag";function a(t,n,i){return Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{a({},"")}catch(t){a=function(t,n,i){return t[n]=i}}function h(t,n,i,r){var e=n&&n.prototype instanceof y?n:y,o=Object.create(e.prototype),s=new T(r||[]);return o._invoke=function(t,n,i){var r=c;return function(e,o){if(r===v)throw new Error("Generator is already running");if(r===d){if("throw"===e)throw o;return P()}for(i.method=e,i.arg=o;;){var s=i.delegate;if(s){var u=O(s,i);if(u){if(u===p)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===c)throw r=d,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=v;var a=f(t,n,i);if("normal"===a.type){if(r=i.done?d:l,a.arg===p)continue;return{value:a.arg,done:i.done}}"throw"===a.type&&(r=d,i.method="throw",i.arg=a.arg)}}}(t,i,s),o}function f(t,n,i){try{return{type:"normal",arg:t.call(n,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var c="suspendedStart",l="suspendedYield",v="executing",d="completed",p={};function y(){}function m(){}function w(){}var g={};a(g,o,(function(){return this}));var b=Object.getPrototypeOf,x=b&&b(b(A([])));x&&x!==i&&r.call(x,o)&&(g=x);var M=w.prototype=y.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(n){a(t,n,(function(t){return this._invoke(n,t)}))}))}function S(t,n){function i(e,o,s,u){var a=f(t[e],t,o);if("throw"!==a.type){var h=a.arg,c=h.value;return c&&"object"==typeof c&&r.call(c,"__await")?n.resolve(c.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):n.resolve(c).then((function(t){h.value=t,s(h)}),(function(t){return i("throw",t,s,u)}))}u(a.arg)}var e;this._invoke=function(t,r){function o(){return new n((function(n,e){i(t,r,n,e)}))}return e=e?e.then(o,o):o()}}function O(t,i){var r=t.iterator[i.method];if(r===n){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=n,O(t,i),"throw"===i.method))return p;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var e=f(r,t.iterator,i.arg);if("throw"===e.type)return i.method="throw",i.arg=e.arg,i.delegate=null,p;var o=e.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=n),i.delegate=null,p):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,p)}function j(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function E(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function A(t){if(t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,s=function i(){for(;++e=0;--o){var s=this.tryEntries[o],u=s.completion;if("root"===s.tryLoc)return e("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),h=r.call(s,"finallyLoc");if(a&&h){if(this.prev=0;--i){var e=this.tryEntries[i];if(e.tryLoc<=this.prev&&r.call(e,"finallyLoc")&&this.prev=0;--n){var i=this.tryEntries[n];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),E(i),p}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var e=r.arg;E(i)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,r){return this.delegate={iterator:A(t),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=n),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},617:function(t,n,i){const r=i(279);t.exports=function(t,n,i){const e=i&&i.debug||!1,o=i&&i.startIndex||0;e&&console.log("starting findTagByName with",n," and ",i);const s=r(t,`<${n}[ >]`,o);if(e&&console.log("start:",s),-1===s)return;const u=t.slice(s+n.length);let a=r(u,"[ /]"+n+">",0);const h=-1===a;h&&(a=r(u,"[ /]>",0));const f=s+n.length+a+1+(h?0:n.length)+1;if(e&&console.log("end:",f),-1===f)return;const c=t.slice(s,f);let l;return l=h?null:c.slice(c.indexOf(">")+1,c.lastIndexOf("<")),{inner:l,outer:c,start:s,end:f}}},51:function(t,n,i){const r=i(617);t.exports=function(t,n,i){const e=[],o=i&&i.debug||!1;let s,u=i&&i.startIndex||0;for(;s=r(t,n,{debug:o,startIndex:u});)u=s.end,e.push(s);return o&&console.log("findTagsByName found",e.length,"tags"),e}},802:function(t){t.exports=function(t,n,i){const r=i&&i.debug||!1;r&&console.log("getting "+n+" in "+t);const e="object"==typeof t?t.outer:t,o=`${n}\\="([^"]*)"`;r&&console.log("pattern:",o);const s=new RegExp(o).exec(e);if(r&&console.log("match:",s),s)return s[1]}},279:function(t){t.exports=function(t,n,i){const r=new RegExp(n).exec(t.slice(i));return r?i+r.index:-1}},518:function(t){"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},692:function(t,n,i){"use strict";function r(t){var n=this;if(n instanceof r||(n=new r),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){n.push(t)}));else if(arguments.length>0)for(var i=0,e=arguments.length;i1)i=n;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,i=this.head.value}for(var e=0;null!==r;e++)i=t(i,r.value,e),r=r.next;return i},r.prototype.reduceReverse=function(t,n){var i,r=this.tail;if(arguments.length>1)i=n;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,i=this.tail.value}for(var e=this.length-1;null!==r;e--)i=t(i,r.value,e),r=r.prev;return i},r.prototype.toArray=function(){for(var t=new Array(this.length),n=0,i=this.head;null!==i;n++)t[n]=i.value,i=i.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),n=0,i=this.tail;null!==i;n++)t[n]=i.value,i=i.prev;return t},r.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var i=new r;if(nthis.length&&(n=this.length);for(var e=0,o=this.head;null!==o&&ethis.length&&(n=this.length);for(var e=this.length,o=this.tail;null!==o&&e>n;e--)o=o.prev;for(;null!==o&&e>t;e--,o=o.prev)i.push(o.value);return i},r.prototype.splice=function(t,n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,r=this.head;null!==r&&i>1)],n))<0?s=r+1:(u=r,a=!e);return a?s:~s}function p(t,n){return t>n?1:t=0}function m(t,n,i){var r=t.length;if(t[0]<=n)return 0;if(n<=t[r-1])return r-1;var e=void 0;if(i>0){for(e=1;e0?e-1:e:t[e-1]-n>>0,e=0;e0||i&&0===o)}))}function S(){return!0}function O(){return!1}function j(){}function E(t){var n,i,r,e=!1;return function(){var o=Array.prototype.slice.call(arguments);return e&&this===r&&x(o,i)||(e=!0,r=this,i=o,n=t.apply(this,arguments)),n}}function T(t){return function(){var n;try{n=t()}catch(t){return Promise.reject(t)}return n instanceof Promise?n:Promise.resolve(n)}()}var A="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r0)},n.prototype.removeEventListener=function(t,n){var i=this.O&&this.O[t];if(i){var r=i.indexOf(n);-1!==r&&(this._&&t in this._?(i[r]=j,++this._[t]):(i.splice(r,1),0===i.length&&delete this.O[t]))}},n}(v),L="change",z="error",R="contextmenu",F="click",G="dblclick",D="dragenter",q="dragover",U="drop",B="keydown",X="keypress",V="load",W="resize",Y="touchmove",Z="wheel";function $(t,n,i,r,e){if(r&&r!==t&&(i=i.bind(r)),e){var o=i;i=function(){t.removeEventListener(n,i),o.apply(this,arguments)}}var s={target:t,type:n,listener:i};return t.addEventListener(n,i),s}function K(t,n,i,r){return $(t,n,i,r,!0)}function H(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),P(t))}var J=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Q=function(t){function n(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.T=0,n}return J(n,t),n.prototype.changed=function(){++this.T,this.dispatchEvent(L)},n.prototype.getRevision=function(){return this.T},n.prototype.onInternal=function(t,n){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),e=0;e0;)this.pop()},n.prototype.extend=function(t){for(var n=0,i=t.length;nt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){r()},n.prototype.getAlpha=function(t,n){if(!this.D)return 1;var i=this.q[t];if(i){if(-1===i)return 1}else i=n,this.q[t]=i;var r=n-i+1e3/60;return r>=this.D?1:yt(r/this.D)},n.prototype.inTransition=function(t){return!!this.D&&-1!==this.q[t]},n.prototype.endTransition=function(t){this.D&&(this.q[t]=-1)},n}(N),Mt=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_t=function(t){function n(n){var i=this,r=ct;return(i=t.call(this,n.tileCoord,r,{transition:n.transition,interpolate:n.interpolate})||this).U=n.loader,i.B=null,i.V=null,i.W=n.size||[256,256],i}return Mt(n,t),n.prototype.getSize=function(){return this.W},n.prototype.getData=function(){return this.B},n.prototype.getError=function(){return this.V},n.prototype.load=function(){if(this.state===ct||this.state===dt){this.state=lt,this.changed();var t=this;this.U().then((function(n){t.B=n,t.state=vt,t.changed()})).catch((function(n){t.V=n,t.state=dt,t.changed()}))}},n}(xt);function St(t,n){if(!t)throw new h(n)}var Ot=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function jt(t){return"function"==typeof t?t:(Array.isArray(t)?n=t:(St("function"==typeof t.getZIndex,41),n=[t]),function(){return n});var n}var Et=function(t){function n(n){var i=t.call(this)||this;if(i.on,i.once,i.un,i.$=void 0,i.K="geometry",i.H=null,i.tt=void 0,i.nt=null,i.addChangeListener(i.K,i.it),n)if("function"==typeof n.getSimplifiedGeometry){var r=n;i.setGeometry(r)}else{var e=n;i.setProperties(e)}return i}return Ot(n,t),n.prototype.clone=function(){var t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var r=this.getStyle();return r&&t.setStyle(r),t},n.prototype.getGeometry=function(){return this.get(this.K)},n.prototype.getId=function(){return this.$},n.prototype.getGeometryName=function(){return this.K},n.prototype.getStyle=function(){return this.H},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.rt=function(){this.changed()},n.prototype.it=function(){this.nt&&(H(this.nt),this.nt=null);var t=this.getGeometry();t&&(this.nt=$(t,L,this.rt,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.K,t)},n.prototype.setStyle=function(t){this.H=t,this.tt=t?jt(t):void 0,this.changed()},n.prototype.setId=function(t){this.$=t,this.changed()},n.prototype.setGeometryName=function(t){this.removeChangeListener(this.K,this.it),this.K=t,this.addChangeListener(this.K,this.it),this.it()},n}(et),Tt="XY",At="XYZ",Pt="XYM",Ct="XYZM",kt={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},It={9001:kt.METERS,9002:kt.FEET,9003:kt.USFEET,9101:kt.RADIANS,9102:kt.DEGREES};function Nt(t){return It[t]}var Lt={};Lt[kt.RADIANS]=6370997/(2*Math.PI),Lt[kt.DEGREES]=2*Math.PI*6370997/360,Lt[kt.FEET]=.3048,Lt[kt.METERS]=1,Lt[kt.USFEET]=1200/3937;var zt,Rt=kt,Ft="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Gt=-1!==Ft.indexOf("firefox"),Dt=-1!==Ft.indexOf("safari")&&-1==Ft.indexOf("chrom"),qt=Dt&&!!(Ft.indexOf("version/15.4")>=0||Ft.match(/cpu (os|iphone os) 15_4 like mac os x/)),Ut=-1!==Ft.indexOf("webkit")&&-1==Ft.indexOf("edge"),Bt=-1!==Ft.indexOf("macintosh"),Xt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Vt="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Wt="undefined"!=typeof Image&&Image.prototype.decode,Yt=function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(t){}return t}(),Zt=new Array(6);function $t(){return[1,0,0,1,0,0]}function Kt(t){return Jt(t,1,0,0,1,0,0)}function Ht(t,n){var i=t[0],r=t[1],e=t[2],o=t[3],s=t[4],u=t[5],a=n[0],h=n[1],f=n[2],c=n[3],l=n[4],v=n[5];return t[0]=i*a+e*h,t[1]=r*a+o*h,t[2]=i*f+e*c,t[3]=r*f+o*c,t[4]=i*l+e*v+s,t[5]=r*l+o*v+u,t}function Jt(t,n,i,r,e,o,s){return t[0]=n,t[1]=i,t[2]=r,t[3]=e,t[4]=o,t[5]=s,t}function Qt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t}function tn(t,n){var i=n[0],r=n[1];return n[0]=t[0]*i+t[2]*r+t[4],n[1]=t[1]*i+t[3]*r+t[5],n}function nn(t,n){var i=Math.cos(n),r=Math.sin(n);return Ht(t,Jt(Zt,i,r,-r,i,0,0))}function rn(t,n,i){return Ht(t,Jt(Zt,n,0,0,i,0,0))}function en(t,n,i){return Jt(t,n,0,0,i,0,0)}function on(t,n,i){return Ht(t,Jt(Zt,1,0,0,1,n,i))}function sn(t,n,i,r,e,o,s,u){var a=Math.sin(o),h=Math.cos(o);return t[0]=r*h,t[1]=e*a,t[2]=-r*a,t[3]=e*h,t[4]=s*r*h-u*r*a+n,t[5]=s*e*a+u*e*h+i,t}function un(t,n){var i=an(n);St(0!==i,32);var r=n[0],e=n[1],o=n[2],s=n[3],u=n[4],a=n[5];return t[0]=s/i,t[1]=-e/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*a-s*u)/i,t[5]=-(r*a-e*u)/i,t}function an(t){return t[0]*t[3]-t[1]*t[2]}function hn(t){var n="matrix("+t.join(", ")+")";if(Vt)return n;var i=zt||(zt=document.createElement("div"));return i.style.transform=n,i.style.transform}var fn=0,cn=1,ln=2,vn=4,dn=8,pn=16;function yn(t){for(var n=Sn(),i=0,r=t.length;ie&&(a|=vn),uo&&(a|=ln),a===fn&&(a=cn),a}function Sn(){return[1/0,1/0,-1/0,-1/0]}function On(t,n,i,r,e){return e?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]}function jn(t){return On(1/0,1/0,-1/0,-1/0,t)}function En(t,n){var i=t[0],r=t[1];return On(i,r,i,r,n)}function Tn(t,n,i,r,e){return Nn(jn(e),t,n,i,r)}function An(t,n){return t[0]==n[0]&&t[2]==n[2]&&t[1]==n[1]&&t[3]==n[3]}function Pn(t,n,i){return Math.abs(t[0]-n[0])t[2]&&(t[2]=n[2]),n[1]t[3]&&(t[3]=n[3]),t}function kn(t,n){n[0]t[2]&&(t[2]=n[0]),n[1]t[3]&&(t[3]=n[1])}function In(t,n){for(var i=0,r=n.length;in[0]?r[0]=t[0]:r[0]=n[0],t[1]>n[1]?r[1]=t[1]:r[1]=n[1],t[2]=n[0]&&t[1]<=n[3]&&t[3]>=n[1]}function Hn(t){return t[2]=s&&p<=a),r||!(o&vn)||e&vn||(r=(y=v-(l-a)*d)>=u&&y<=h),r||!(o&dn)||e&dn||(r=(p=l-(v-u)/d)>=s&&p<=a),r||!(o&pn)||e&pn||(r=(y=v-(l-s)*d)>=u&&y<=h)}return r}function ni(t,n,i,r){var e=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],u=0;u=i[2])){var e=$n(i),o=Math.floor((r[0]-i[0])/e)*e;t[0]-=o,t[2]-=o}return t}function ri(t,n){if(n.canWrapX()){var i=n.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];ii(t,n);var r=$n(i);if($n(t)>r)return[[i[0],t[1],i[2],t[3]]];if(t[0]i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-r,t[3]]]}return[t]}var ei=function(){function t(t){this.et=t.code,this.ot=t.units,this.st=void 0!==t.extent?t.extent:null,this.ut=void 0!==t.worldExtent?t.worldExtent:null,this.ht=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.ft=void 0!==t.global&&t.global,this.ct=!(!this.ft||!this.st),this.lt=t.getPointResolution,this.vt=null,this.dt=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.ct},t.prototype.getCode=function(){return this.et},t.prototype.getExtent=function(){return this.st},t.prototype.getUnits=function(){return this.ot},t.prototype.getMetersPerUnit=function(){return this.dt||Lt[this.ot]},t.prototype.getWorldExtent=function(){return this.ut},t.prototype.getAxisOrientation=function(){return this.ht},t.prototype.isGlobal=function(){return this.ft},t.prototype.setGlobal=function(t){this.ft=t,this.ct=!(!t||!this.st)},t.prototype.getDefaultTileGrid=function(){return this.vt},t.prototype.setDefaultTileGrid=function(t){this.vt=t},t.prototype.setExtent=function(t){this.st=t,this.ct=!(!this.ft||!t)},t.prototype.setWorldExtent=function(t){this.ut=t},t.prototype.setGetPointResolution=function(t){this.lt=t},t.prototype.getPointResolutionFunc=function(){return this.lt},t}();function oi(t,n,i){return Math.min(Math.max(t,n),i)}var si="cosh"in Math?Math.cosh:function(t){var n=Math.exp(t);return(n+1/n)/2},ui="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function ai(t,n,i,r,e,o){var s=e-i,u=o-r;if(0!==s||0!==u){var a=((t-i)*s+(n-r)*u)/(s*s+u*u);a>1?(i=e,r=o):a>0&&(i+=s*a,r+=u*a)}return hi(t,n,i,r)}function hi(t,n,i,r){var e=i-t,o=r-n;return e*e+o*o}function fi(t){for(var n=t.length,i=0;ie&&(e=s,r=o)}if(0===e)return null;var u=t[r];t[r]=t[i],t[i]=u;for(var a=i+1;a=0;l--){c[l]=t[l][n]/t[l][l];for(var v=l-1;v>=0;v--)t[v][n]-=t[v][l]*c[l]}return c}function ci(t){return 180*t/Math.PI}function li(t){return t*Math.PI/180}function vi(t,n){var i=t%n;return i*n<0?i+n:i}function di(t,n,i){return t+i*(n-t)}function pi(t,n){var i=Math.pow(10,n);return Math.round(t*i)/i}function yi(t,n){return Math.round(pi(t,n))}function mi(t,n){return Math.floor(pi(t,n))}function wi(t,n){return Math.ceil(pi(t,n))}var gi=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bi=6378137,xi=Math.PI*bi,Mi=[-xi,-xi,xi,xi],_i=[-180,-85,180,85],Si=bi*Math.log(Math.tan(Math.PI/2)),Oi=function(t){function n(n){return t.call(this,{code:n,units:Rt.METERS,extent:Mi,global:!0,worldExtent:_i,getPointResolution:function(t,n){return t/si(n[1]/bi)}})||this}return gi(n,t),n}(ei),ji=[new Oi("EPSG:3857"),new Oi("EPSG:102100"),new Oi("EPSG:102113"),new Oi("EPSG:900913"),new Oi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Oi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ei(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;sSi?u=Si:u<-Si&&(u=-Si),o[s+1]=u}return o}function Ti(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;sn?r:new Array(1+n-e).join("0")+r}function Xi(t,n){for(var i=(""+t).split("."),r=(""+n).split("."),e=0;es)return 1;if(s>o)return-1}return 0}function Vi(t,n){return t[0]+=+n[0],t[1]+=+n[1],t}function Wi(t,n){var i=n.getRadius(),r=n.getCenter(),e=r[0],o=r[1],s=t[0]-e,u=t[1]-o;0===s&&0===u&&(s=1);var a=Math.sqrt(s*s+u*u);return[e+i*s/a,o+i*u/a]}function Yi(t,n){var i,r,e=t[0],o=t[1],s=n[0],u=n[1],a=s[0],h=s[1],f=u[0],c=u[1],l=f-a,v=c-h,d=0===l&&0===v?0:(l*(e-a)+v*(o-h))/(l*l+v*v||0);return d<=0?(i=a,r=h):d>=1?(i=f,r=c):(i=a+d*l,r=h+d*v),[i,r]}function Zi(t,n,i){var r=vi(n+180,360)-180,e=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),u=Math.floor(e/3600),a=Math.floor((e-3600*u)/60),h=e-3600*u-60*a;return(h=Math.ceil(h*s)/s)>=60&&(h=0,a+=1),a>=60&&(a=0,u+=1),u+"° "+Bi(a,2)+"′ "+Bi(h,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function $i(t,n,i){return t?n.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function Ki(t,n){for(var i=!0,r=t.length-1;r>=0;--r)if(t[r]!=n[r]){i=!1;break}return i}function Hi(t,n){var i=Math.cos(n),r=Math.sin(n),e=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=e,t[1]=o,t}function Ji(t,n){return t[0]*=n,t[1]*=n,t}function Qi(t,n){var i=t[0]-n[0],r=t[1]-n[1];return i*i+r*r}function tr(t,n){return Math.sqrt(Qi(t,n))}function nr(t,n){return Qi(t,Yi(t,n))}function ir(t,n){return $i(t,"{x}, {y}",n)}function rr(t,n){if(n.canWrapX()){var i=$n(n.getExtent()),r=er(t,n,i);r&&(t[0]-=r*i)}return t}function er(t,n,i){var r=n.getExtent(),e=0;if(n.canWrapX()&&(t[0]r[2])){var o=i||$n(r);e=Math.floor((t[0]-r[0])/o)}return e}var or=6371008.8;function sr(t,n,i){var r=i||or,e=li(t[1]),o=li(n[1]),s=(o-e)/2,u=li(n[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(u)*Math.sin(u)*Math.cos(e)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function ur(t,n){for(var i=0,r=0,e=t.length;r=h?n[u+f]:a[f];return s}}function Mr(t,n,i,r){var e=yr(t),o=yr(n);qi(e,o,xr(i)),qi(o,e,xr(r))}function _r(t,n){return cr(),Er(t,"EPSG:4326",void 0!==n?n:"EPSG:3857")}function Sr(t,n){if(t===n)return!0;var i=t.getUnits()===n.getUnits();return(t.getCode()===n.getCode()||Or(t,n)===lr)&&i}function Or(t,n){var i=Ui(t.getCode(),n.getCode());return i||(i=vr),i}function jr(t,n){return Or(yr(t),yr(n))}function Er(t,n,i){return jr(n,i)(t,void 0,t.length)}function Tr(t,n,i,r){return ni(t,jr(n,i),void 0,r)}var Ar=null;function Pr(t){Ar=yr(t)}function Cr(){return Ar}function kr(t,n){return Ar?Er(t,n,Ar):t}function Ir(t,n){return Ar?Er(t,Ar,n):(fr&&!Ki(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(fr=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Nr(t,n){return Ar?Tr(t,n,Ar):t}function Lr(t,n){return Ar?Tr(t,Ar,n):t}function zr(t,n){if(!Ar)return t;var i=yr(n).getUnits(),r=Ar.getUnits();return i&&r?t*Lt[i]/Lt[r]:t}function Rr(t,n){if(!Ar)return t;var i=yr(n).getUnits(),r=Ar.getUnits();return i&&r?t*Lt[r]/Lt[i]:t}function Fr(t,n,i){return function(r){var e,o;if(t.canWrapX()){var s=t.getExtent(),u=$n(s);(o=er(r=r.slice(0),t,u))&&(r[0]=r[0]-o*u),r[0]=oi(r[0],s[0],s[2]),r[1]=oi(r[1],s[1],s[3]),e=i(r)}else e=i(r);return o&&n.canWrapX()&&(e[0]+=o*$n(n.getExtent())),e}}function Gr(){wr(ji),wr(Ni),gr(Ni,ji,Ei,Ti)}function Dr(t,n,i,r,e,o){for(var s=o||[],u=0,a=n;a1)u=i;else{if(l>0){for(var v=0;ve&&(e=h),o=u,s=a}return e}function Qr(t,n,i,r,e){for(var o=0,s=i.length;o0;){for(var c=h.pop(),l=h.pop(),v=0,d=t[l],p=t[l+1],y=t[c],m=t[c+1],w=l+r;wv&&(f=w,v=g)}v>e&&(a[(f-n)/r]=1,l+re&&(o[s++]=h,o[s++]=f,u=h,a=f);return h==u&&f==a||(o[s++]=h,o[s++]=f),s}function ce(t,n){return n*Math.round(t/n)}function le(t,n,i,r,e,o,s){if(n==i)return s;var u,a,h=ce(t[n],e),f=ce(t[n+1],e);n+=r,o[s++]=h,o[s++]=f;do{if(u=ce(t[n],e),a=ce(t[n+1],e),(n+=r)==i)return o[s++]=u,o[s++]=a,s}while(u==h&&a==f);for(;n0&&p>v)&&(d<0&&y0&&y>d)?(u=c,a=l):(o[s++]=u,o[s++]=a,h=u,f=a,u=c,a=l)}}return o[s++]=u,o[s++]=a,s}function ve(t,n,i,r,e,o,s,u){for(var a=0,h=i.length;ao&&(h-u)*(o-a)-(e-u)*(f-a)>0&&s++:f<=o&&(h-u)*(o-a)-(e-u)*(f-a)<0&&s--,u=h,a=f}return 0!==s}function Ee(t,n,i,r,e,o){if(0===i.length)return!1;if(!je(t,n,i[0],r,e,o))return!1;for(var s=1,u=i.length;sx&&Ee(t,n,i,r,h=(f+c)/2,d)&&(b=h,x=M),f=c}return isNaN(b)&&(b=e[o]),s?(s.push(b,d,x),s):[b,d,x]}function Pe(t,n,i,r,e){for(var o=[],s=0,u=i.length;s=e[0]&&o[2]<=e[2]||(o[1]>=e[1]&&o[3]<=e[3]||Ce(t,n,i,r,(function(t,n){return ti(e,t,n)})))))}function Ie(t,n,i,r,e){for(var o=0,s=i.length;o0}function Ge(t,n,i,r,e){for(var o=void 0!==e&&e,s=0,u=i.length;s0&&this.Zt[i+2]>t;)i-=3;var r=this.Zt[n+2]-this.Zt[i+2];if(r<1e3/60)return!1;var e=this.Zt[n]-this.Zt[i],o=this.Zt[n+1]-this.Zt[i+1];return this.$t=Math.atan2(o,e),this.Kt=Math.sqrt(e*e+o*o)/r,this.Kt>this.Wt},t.prototype.getDistance=function(){return(this.Wt-this.Kt)/this.Vt},t.prototype.getAngle=function(){return this.$t},t}(),No=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Lo=/^([a-z]*)$|^hsla?\(.*\)$/i;function zo(t){return"string"==typeof t?t:qo(t)}function Ro(t){var n=document.createElement("div");if(n.style.color=t,""!==n.style.color){document.body.appendChild(n);var i=getComputedStyle(n).color;return document.body.removeChild(n),i}return""}var Fo=function(){var t={},n=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(n>=1024){var e=0;for(var o in t)0==(3&e++)&&(delete t[o],--n)}r=function(t){var n,i,r,e,o;Lo.exec(t)&&(t=Ro(t));if(No.exec(t)){var s=t.length-1,u=void 0;u=s<=4?1:2;var a=4===s||8===s;n=parseInt(t.substr(1+0*u,u),16),i=parseInt(t.substr(1+1*u,u),16),r=parseInt(t.substr(1+2*u,u),16),e=a?parseInt(t.substr(1+3*u,u),16):255,1==u&&(n=(n<<4)+n,i=(i<<4)+i,r=(r<<4)+r,a&&(e=(e<<4)+e)),o=[n,i,r,e/255]}else 0==t.indexOf("rgba(")?Do(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Do(o)):St(!1,14);return o}(i),t[i]=r,++n}return r}}();function Go(t){return Array.isArray(t)?t:Fo(t)}function Do(t){return t[0]=oi(t[0]+.5|0,0,255),t[1]=oi(t[1]+.5|0,0,255),t[2]=oi(t[2]+.5|0,0,255),t[3]=oi(t[3],0,1),t}function qo(t){var n=t[0];n!=(0|n)&&(n=n+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+n+","+i+","+r+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function Uo(t){return Lo.test(t)&&(t=Ro(t)),No.test(t)||0===t.indexOf("rgba(")||0===t.indexOf("rgb(")}var Bo=function(){function t(){this.Ht={},this.Jt=0,this.Qt=32}return t.prototype.clear=function(){this.Ht={},this.Jt=0},t.prototype.canExpireCache=function(){return this.Jt>this.Qt},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.Ht){var i=this.Ht[n];0!=(3&t++)||i.hasListener()||(delete this.Ht[n],--this.Jt)}}},t.prototype.get=function(t,n,i){var r=Xo(t,n,i);return r in this.Ht?this.Ht[r]:null},t.prototype.set=function(t,n,i,r){var e=Xo(t,n,i);this.Ht[e]=r,++this.Jt},t.prototype.setSize=function(t){this.Qt=t,this.expire()},t}();function Xo(t,n,i){return n+":"+t+":"+(i?zo(i):"null")}var Vo=Bo,Wo=new Bo,Yo="opacity",Zo="visible",$o="extent",Ko="zIndex",Ho="maxResolution",Jo="minResolution",Qo="maxZoom",ts="minZoom",ns="source",is="map",rs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),es=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.tn=n.background;var r=A({},n);return"object"==typeof n.properties&&(delete r.properties,A(r,n.properties)),r[Yo]=void 0!==n.opacity?n.opacity:1,St("number"==typeof r[Yo],64),r[Zo]=void 0===n.visible||n.visible,r[Ko]=n.zIndex,r[Ho]=void 0!==n.maxResolution?n.maxResolution:1/0,r[Jo]=void 0!==n.minResolution?n.minResolution:0,r[ts]=void 0!==n.minZoom?n.minZoom:-1/0,r[Qo]=void 0!==n.maxZoom?n.maxZoom:1/0,i.nn=void 0!==r.className?r.className:"ol-layer",delete r.className,i.setProperties(r),i.rn=null,i}return rs(n,t),n.prototype.getBackground=function(){return this.tn},n.prototype.getClassName=function(){return this.nn},n.prototype.getLayerState=function(t){var n=this.rn||{layer:this,managed:void 0===t||t},i=this.getZIndex();return n.opacity=oi(Math.round(100*this.getOpacity())/100,0,1),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=void 0!==i||n.managed?i:1/0,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.rn=n,n},n.prototype.getLayersArray=function(t){return r()},n.prototype.getLayerStatesArray=function(t){return r()},n.prototype.getExtent=function(){return this.get($o)},n.prototype.getMaxResolution=function(){return this.get(Ho)},n.prototype.getMinResolution=function(){return this.get(Jo)},n.prototype.getMinZoom=function(){return this.get(ts)},n.prototype.getMaxZoom=function(){return this.get(Qo)},n.prototype.getOpacity=function(){return this.get(Yo)},n.prototype.getSourceState=function(){return r()},n.prototype.getVisible=function(){return this.get(Zo)},n.prototype.getZIndex=function(){return this.get(Ko)},n.prototype.setBackground=function(t){this.tn=t,this.changed()},n.prototype.setExtent=function(t){this.set($o,t)},n.prototype.setMaxResolution=function(t){this.set(Ho,t)},n.prototype.setMinResolution=function(t){this.set(Jo,t)},n.prototype.setMaxZoom=function(t){this.set(Qo,t)},n.prototype.setMinZoom=function(t){this.set(ts,t)},n.prototype.setOpacity=function(t){St("number"==typeof t,64),this.set(Yo,t)},n.prototype.setVisible=function(t){this.set(Zo,t)},n.prototype.setZIndex=function(t){this.set(Ko,t)},n.prototype.disposeInternal=function(){this.rn&&(this.rn.layer=null,this.rn=null),t.prototype.disposeInternal.call(this)},n}(et),os="prerender",ss="postrender",us="precompose",as="postcompose",hs="rendercomplete",fs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function cs(t,n){if(!t.visible)return!1;var i=n.resolution;if(i=t.maxResolution)return!1;var r=n.zoom;return r>t.minZoom&&r<=t.maxZoom}var ls=function(t){function n(n){var i=this,r=A({},n);delete r.source,(i=t.call(this,r)||this).on,i.once,i.un,i.en=null,i.sn=null,i.an=null,i.hn=null,i.rendered=!1,n.render&&(i.render=n.render),n.map&&i.setMap(n.map),i.addChangeListener(ns,i.fn);var e=n.source?n.source:null;return i.setSource(e),i}return fs(n,t),n.prototype.getLayersArray=function(t){var n=t||[];return n.push(this),n},n.prototype.getLayerStatesArray=function(t){var n=t||[];return n.push(this.getLayerState()),n},n.prototype.getSource=function(){return this.get(ns)||null},n.prototype.getRenderSource=function(){return this.getSource()},n.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},n.prototype.cn=function(){this.changed()},n.prototype.fn=function(){this.an&&(H(this.an),this.an=null);var t=this.getSource();t&&(this.an=$(t,L,this.cn,this)),this.changed()},n.prototype.getFeatures=function(t){return this.hn?this.hn.getFeatures(t):new Promise((function(t){return t([])}))},n.prototype.getData=function(t){return this.hn&&this.rendered?this.hn.getData(t):null},n.prototype.render=function(t,n){var i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,n)},n.prototype.unrender=function(){this.rendered=!1},n.prototype.setMapInternal=function(t){t||this.unrender(),this.set(is,t)},n.prototype.getMapInternal=function(){return this.get(is)},n.prototype.setMap=function(t){this.en&&(H(this.en),this.en=null),t||this.changed(),this.sn&&(H(this.sn),this.sn=null),t&&(this.en=$(t,us,(function(t){var n=t.frameState.layerStatesArray,i=this.getLayerState(!1);St(!n.some((function(t){return t.layer===i.layer})),67),n.push(i)}),this),this.sn=$(this,L,t.render,t),this.changed())},n.prototype.setSource=function(t){this.set(ns,t)},n.prototype.getRenderer=function(){return this.hn||(this.hn=this.createRenderer()),this.hn},n.prototype.hasRenderer=function(){return!!this.hn},n.prototype.createRenderer=function(){return null},n.prototype.disposeInternal=function(){this.hn&&(this.hn.dispose(),delete this.hn),this.setSource(null),t.prototype.disposeInternal.call(this)},n}(es),vs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function ds(t,n){Wo.expire()}var ps=function(t){function n(n){var i=t.call(this)||this;return i.vn=n,i}return vs(n,t),n.prototype.dispatchRenderEvent=function(t,n){r()},n.prototype.calculateMatrices2D=function(t){var n=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;sn(i,t.size[0]/2,t.size[1]/2,1/n.resolution,-1/n.resolution,-n.rotation,-n.center[0],-n.center[1]),un(r,i)},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e,o,s,u){var a,h=n.viewState;function f(t,n,i,r){return e.call(o,n,t?i:null,r)}var c=h.projection,l=rr(t.slice(),c),v=[[0,0]];if(c.canWrapX()&&r){var d=$n(c.getExtent());v.push([-d,0],[d,0])}for(var p=n.layerStatesArray,y=p.length,m=[],w=[],g=0;g=0;--b){var x=p[b],M=x.layer;if(M.hasRenderer()&&cs(x,h)&&s.call(u,M)){var _=M.getRenderer(),S=M.getSource();if(_&&S){var O=S.getWrapX()?l:t,j=f.bind(null,x.managed);w[0]=O[0]+v[g][0],w[1]=O[1]+v[g][1],a=_.forEachFeatureAtCoordinate(w,n,i,j,m)}if(a)return a}}if(0!==m.length){var E=1/m.length;return m.forEach((function(t,n){return t.distanceSq+=n*E})),m.sort((function(t,n){return t.distanceSq-n.distanceSq})),m.some((function(t){return a=t.callback(t.feature,t.layer,t.geometry)})),a}},n.prototype.forEachLayerAtPixel=function(t,n,i,e,o){return r()},n.prototype.hasFeatureAtCoordinate=function(t,n,i,r,e,o){return void 0!==this.forEachFeatureAtCoordinate(t,n,i,r,S,this,e,o)},n.prototype.getMap=function(){return this.vn},n.prototype.renderFrame=function(t){r()},n.prototype.scheduleExpireIconCache=function(t){Wo.canExpireCache()&&t.postRenderFunctions.push(ds)},n}(v),ys=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ms=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.inversePixelTransform=i,o.frameState=r,o.context=e,o}return ys(n,t),n}(c),ws="ol-hidden",gs="ol-selectable",bs="ol-unselectable",xs="ol-unsupported",Ms="ol-control",_s="ol-collapsed",Ss=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Os=["style","variant","weight","size","lineHeight","family"],js=function(t){var n=t.match(Ss);if(!n)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,e=Os.length;r=0;--o)r[o].renderDeclutter(t);Po(this.pn,this.yn),this.dispatchRenderEvent(as,t),this.mn||(this.pn.style.display="",this.mn=!0),this.scheduleExpireIconCache(t)}else this.mn&&(this.pn.style.display="none",this.mn=!1)},n.prototype.forEachLayerAtPixel=function(t,n,i,r,e){for(var o=n.viewState,s=n.layerStatesArray,u=s.length-1;u>=0;--u){var a=s[u],h=a.layer;if(h.hasRenderer()&&cs(a,o)&&e(h)){var f=h.getRenderer().getDataAtPixel(t,n,i);if(f){var c=r(h,f);if(c)return c}}}},n}(ps),Js=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qs=function(t){function n(n,i){var r=t.call(this,n)||this;return r.layer=i,r}return Js(n,t),n}(c),tu="layers",nu=function(t){function n(n){var i=this,r=n||{},e=A({},r);delete e.layers;var o=r.layers;return(i=t.call(this,e)||this).on,i.once,i.un,i.wn=[],i.gn={},i.addChangeListener(tu,i.bn),o?Array.isArray(o)?o=new ft(o.slice(),{unique:!0}):St("function"==typeof o.getArray,43):o=new ft(void 0,{unique:!0}),i.setLayers(o),i}return Js(n,t),n.prototype.xn=function(){this.changed()},n.prototype.bn=function(){this.wn.forEach(H),this.wn.length=0;var t=this.getLayers();for(var n in this.wn.push($(t,ot,this.Mn,this),$(t,st,this._n,this)),this.gn)this.gn[n].forEach(H);P(this.gn);for(var i=t.getArray(),r=0,e=i.length;rthis.In||Math.abs(t.clientY-this.Nn.clientY)>this.In},n.prototype.disposeInternal=function(){this.Dn&&(H(this.Dn),this.Dn=null),this.pn.removeEventListener(Y,this.Un),this.Rn&&(H(this.Rn),this.Rn=null),this.kn.forEach(H),this.kn.length=0,this.pn=null,t.prototype.disposeInternal.call(this)},n}(N),vu="postrender",du="movestart",pu="moveend",yu="loadstart",mu="loadend",wu="layergroup",gu="size",bu="target",xu="view",Mu=1/0,_u=function(){function t(t,n){this.Kn=t,this.Hn=n,this.Jn=[],this.Qn=[],this.ti={}}return t.prototype.clear=function(){this.Jn.length=0,this.Qn.length=0,P(this.ti)},t.prototype.dequeue=function(){var t=this.Jn,n=this.Qn,i=t[0];1==t.length?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.ni(0));var r=this.Hn(i);return delete this.ti[r],i},t.prototype.enqueue=function(t){St(!(this.Hn(t)in this.ti),31);var n=this.Kn(t);return n!=Mu&&(this.Jn.push(t),this.Qn.push(n),this.ti[this.Hn(t)]=!0,this.ii(0,this.Jn.length-1),!0)},t.prototype.getCount=function(){return this.Jn.length},t.prototype.ri=function(t){return 2*t+1},t.prototype.ei=function(t){return 2*t+2},t.prototype.oi=function(t){return t-1>>1},t.prototype.si=function(){var t;for(t=(this.Jn.length>>1)-1;t>=0;t--)this.ni(t)},t.prototype.isEmpty=function(){return 0===this.Jn.length},t.prototype.isKeyQueued=function(t){return t in this.ti},t.prototype.isQueued=function(t){return this.isKeyQueued(this.Hn(t))},t.prototype.ni=function(t){for(var n=this.Jn,i=this.Qn,r=n.length,e=n[t],o=i[t],s=t;t>1;){var u=this.ri(t),a=this.ei(t),h=at;){var s=this.oi(n);if(!(r[s]>o))break;i[n]=i[s],r[n]=r[s],n=s}i[n]=e,r[n]=o},t.prototype.reprioritize=function(){var t,n,i,r=this.Kn,e=this.Jn,o=this.Qn,s=0,u=e.length;for(n=0;n0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==ct||r in this.fi||(this.fi[r]=!0,++this.hi,++e,i.load())},n}(_u);function ju(t,n,i,r,e){if(!t||!(i in t.wantedTiles))return Mu;if(!t.wantedTiles[i][n.getKey()])return Mu;var o=t.viewState.center,s=r[0]-o[0],u=r[1]-o[1];return 65536*Math.log(e)+Math.sqrt(s*s+u*u)/e}var Eu=0,Tu=1,Au={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Pu=256;function Cu(t,n,i){return function(r,e,o,s,u){if(r){if(!e&&!n)return r;var a=n?0:o[0]*e,h=n?0:o[1]*e,f=u?u[0]:0,c=u?u[1]:0,l=t[0]+a/2+f,v=t[2]-a/2+f,d=t[1]+h/2+c,p=t[3]-h/2+c;l>v&&(v=l=(v+l)/2),d>p&&(p=d=(p+d)/2);var y=oi(r[0],l,v),m=oi(r[1],d,p);if(s&&i&&e){var w=30*e;y+=-w*Math.log(1+Math.max(0,l-r[0])/w)+w*Math.log(1+Math.max(0,r[0]-v)/w),m+=-w*Math.log(1+Math.max(0,d-r[1])/w)+w*Math.log(1+Math.max(0,r[1]-p)/w)}return[y,m]}}}function ku(t){return t}function Iu(t,n,i,r){var e=$n(n)/i[0],o=Vn(n)/i[1];return r?Math.min(t,Math.max(e,o)):Math.min(t,Math.min(e,o))}function Nu(t,n,i){var r=Math.min(t,n);return r*=Math.log(1+50*Math.max(0,t/n-1))/50+1,i&&(r=Math.max(r,i),r/=Math.log(1+50*Math.max(0,i/t-1))/50+1),oi(r,i/2,2*n)}function Lu(t,n,i,r){return function(e,o,s,u){if(void 0!==e){var a=t[0],h=t[t.length-1],f=i?Iu(a,i,s,r):a;if(u)return void 0===n||n?Nu(e,f,h):oi(e,h,f);var c=Math.min(f,e),l=Math.floor(m(t,c,o));return t[l]>f&&l1&&"function"==typeof arguments[i-1]&&(n=arguments[i-1],--i);for(var r=0;r0},n.prototype.getInteracting=function(){return this.ci[Tu]>0},n.prototype.cancelAnimations=function(){var t;this.setHint(Eu,-this.ci[Eu]);for(var n=0,i=this.li.length;n=0;--i){for(var r=this.li[i],e=!0,o=0,s=r.length;o0?a/u.duration:1;h>=1?(u.complete=!0,h=1):e=!1;var f=u.easing(h);if(u.sourceCenter){var c=u.sourceCenter[0],l=u.sourceCenter[1],v=u.targetCenter[0],d=u.targetCenter[1];this.bi=u.targetCenter;var p=c+f*(v-c),y=l+f*(d-l);this.mi=[p,y]}if(u.sourceResolution&&u.targetResolution){var m=1===f?u.targetResolution:u.sourceResolution+f*(u.targetResolution-u.sourceResolution);if(u.anchor){var w=this.Ni(this.getRotation()),g=this.Ci.resolution(m,0,w,!0);this.mi=this.calculateCenterZoom(g,u.anchor)}this.xi=u.targetResolution,this.wi=m,this.Li(!0)}if(void 0!==u.sourceRotation&&void 0!==u.targetRotation){var b=1===f?vi(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+f*(u.targetRotation-u.sourceRotation);if(u.anchor){var x=this.Ci.rotation(b,!0);this.mi=this.calculateCenterRotate(x,u.anchor)}this.Mi=u.targetRotation,this.gi=b}if(this.Li(!0),n=!0,!u.complete)break}}if(e){this.li[i]=null,this.setHint(Eu,-1),this.bi=null,this.xi=NaN,this.Mi=NaN;var M=r[0].callback;M&&Bu(M,!0)}}this.li=this.li.filter(Boolean),n&&void 0===this.vi&&(this.vi=requestAnimationFrame(this.Ii.bind(this)))}},n.prototype.calculateCenterRotate=function(t,n){var i,r=this.getCenterInternal();return void 0!==r&&(Hi(i=[r[0]-n[0],r[1]-n[1]],t-this.getRotation()),Vi(i,n)),i},n.prototype.calculateCenterZoom=function(t,n){var i,r=this.getCenterInternal(),e=this.getResolution();void 0!==r&&void 0!==e&&(i=[n[0]-t*(n[0]-r[0])/e,n[1]-t*(n[1]-r[1])/e]);return i},n.prototype.Ni=function(t){var n=this.yi;if(t){var i=n[0],r=n[1];return[Math.abs(i*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(r*Math.cos(t))]}return n},n.prototype.setViewportSize=function(t){this.yi=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},n.prototype.getCenter=function(){var t=this.getCenterInternal();return t?kr(t,this.getProjection()):t},n.prototype.getCenterInternal=function(){return this.get(Au.CENTER)},n.prototype.getConstraints=function(){return this.Ci},n.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},n.prototype.getHints=function(t){return void 0!==t?(t[0]=this.ci[0],t[1]=this.ci[1],t):this.ci.slice()},n.prototype.calculateExtent=function(t){return Nr(this.calculateExtentInternal(t),this.getProjection())},n.prototype.calculateExtentInternal=function(t){var n=t||this.zi(),i=this.getCenterInternal();St(i,1);var r=this.getResolution();St(void 0!==r,2);var e=this.getRotation();return St(void 0!==e,3),Bn(i,r,e,n)},n.prototype.getMaxResolution=function(){return this.Oi},n.prototype.getMinResolution=function(){return this.ji},n.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.ji)},n.prototype.setMaxZoom=function(t){this.Si(this.ki({maxZoom:t}))},n.prototype.getMinZoom=function(){return this.getZoomForResolution(this.Oi)},n.prototype.setMinZoom=function(t){this.Si(this.ki({minZoom:t}))},n.prototype.setConstrainResolution=function(t){this.Si(this.ki({constrainResolution:t}))},n.prototype.getProjection=function(){return this.di},n.prototype.getResolution=function(){return this.get(Au.RESOLUTION)},n.prototype.getResolutions=function(){return this.Ti},n.prototype.getResolutionForExtent=function(t,n){return this.getResolutionForExtentInternal(Lr(t,this.getProjection()),n)},n.prototype.getResolutionForExtentInternal=function(t,n){var i=n||this.zi(),r=$n(t)/i[0],e=Vn(t)/i[1];return Math.max(r,e)},n.prototype.getResolutionForValueFunction=function(t){var n=t||2,i=this.getConstrainedResolution(this.Oi),r=this.ji,e=Math.log(i/r)/Math.log(n);return function(t){return i/Math.pow(n,t*e)}},n.prototype.getRotation=function(){return this.get(Au.ROTATION)},n.prototype.getValueForResolutionFunction=function(t){var n=Math.log(t||2),i=this.getConstrainedResolution(this.Oi),r=this.ji,e=Math.log(i/r)/n;return function(t){return Math.log(i/t)/n/e}},n.prototype.zi=function(t){var n=this.Ni(t),i=this.Ai;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n},n.prototype.getState=function(){var t=this.getProjection(),n=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),e=this.Ai;if(e){var o=this.zi();r=Zu(r,this.Ni(),[o[0]/2+e[3],o[1]/2+e[0]],n,i)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:n,nextCenter:this.bi,nextResolution:this.xi,nextRotation:this.Mi,rotation:i,zoom:this.getZoom()}},n.prototype.getZoom=function(){var t,n=this.getResolution();return void 0!==n&&(t=this.getZoomForResolution(n)),t},n.prototype.getZoomForResolution=function(t){var n,i,r=this.Pi||0;if(this.Ti){var e=m(this.Ti,t,1);r=e,n=this.Ti[e],i=e==this.Ti.length-1?2:n/this.Ti[e+1]}else n=this.Oi,i=this.Ei;return r+Math.log(n/t)/Math.log(i)},n.prototype.getResolutionForZoom=function(t){if(this.Ti){if(this.Ti.length<=1)return 0;var n=oi(Math.floor(t),0,this.Ti.length-2),i=this.Ti[n]/this.Ti[n+1];return this.Ti[n]/Math.pow(i,oi(t-n,0,1))}return this.Oi/Math.pow(this.Ei,t-this.Pi)},n.prototype.fit=function(t,n){var i;if(St(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))St(!Hn(t),25),i=Ze(r=Lr(t,this.getProjection()));else if("Circle"===t.getType()){var r;(i=Ze(r=Lr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),qn(r))}else{var e=Cr();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,n)},n.prototype.rotatedExtentForGeometry=function(t){for(var n=this.getRotation(),i=Math.cos(n),r=Math.sin(-n),e=t.getFlatCoordinates(),o=t.getStride(),s=1/0,u=1/0,a=-1/0,h=-1/0,f=0,c=e.length;f0&&t[1]>0}function Ju(t,n,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*n+.5|0,i[1]=t[1]*n+.5|0,i}function Qu(t,n){return Array.isArray(t)?t:(void 0===n?n=[t,t]:(n[0]=t,n[1]=t),n)}var ta=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function na(t){t instanceof ls?t.setMapInternal(null):t instanceof nu&&t.getLayers().forEach(na)}function ia(t,n){if(t instanceof ls)t.setMapInternal(n);else if(t instanceof nu)for(var i=t.getLayers().getArray(),r=0,e=i.length;r=0;u--){var a=s[u];if(a.getMap()===this&&a.getActive()&&this.getTargetElement())if(!a.handleEvent(t)||t.propagationStopped)break}}},n.prototype.handlePostRender=function(){var t=this.Zi,n=this.hr;if(!n.isEmpty()){var i=this.Di,r=i;if(t){var e=t.viewHints;if(e[Eu]||e[Tu]){var o=Date.now()-t.time>8;i=o?0:8,r=o?0:2}}n.getTilesLoading()0;if(this.mn!=i&&(this.element.style.display=i?"":"none",this.mn=i),!x(n,this.Ir)){Ao(this._r);for(var r=0,e=n.length;r0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.Fr,easing:mt}):t.setRotation(0))}},n.prototype.render=function(t){var n=t.frameState;if(n){var i=n.viewState.rotation;if(i!=this.Dr){var r="rotate("+i+"rad)";if(this.Gr){var e=this.element.classList.contains(ws);e||0!==i?e&&0!==i&&this.element.classList.remove(ws):this.element.classList.add(ws)}this.Pr.style.transform=r}this.Dr=i}},n}(oa),fa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ca=function(t){function n(n){var i=this,r=n||{};i=t.call(this,{element:document.createElement("div"),target:r.target})||this;var e=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:e+"-in",u=void 0!==r.zoomOutClassName?r.zoomOutClassName:e+"-out",a=void 0!==r.zoomInLabel?r.zoomInLabel:"+",h=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",f=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",c=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=s,l.setAttribute("type","button"),l.title=f,l.appendChild("string"==typeof a?document.createTextNode(a):a),l.addEventListener(F,i.kr.bind(i,o),!1);var v=document.createElement("button");v.className=u,v.setAttribute("type","button"),v.title=c,v.appendChild("string"==typeof h?document.createTextNode(h):h),v.addEventListener(F,i.kr.bind(i,-o),!1);var d=e+" "+"ol-unselectable "+Ms,p=i.element;return p.className=d,p.appendChild(l),p.appendChild(v),i.Fr=void 0!==r.duration?r.duration:250,i}return fa(n,t),n.prototype.kr=function(t,n){n.preventDefault(),this.Ur(t)},n.prototype.Ur=function(t){var n=this.getMap().getView();if(n){var i=n.getZoom();if(void 0!==i){var r=n.getConstrainedZoom(i+t);this.Fr>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.Fr,easing:mt})):n.setZoom(r)}}},n}(oa);function la(t){var n=t||{},i=new ft;return(void 0===n.zoom||n.zoom)&&i.push(new ca(n.zoomOptions)),(void 0===n.rotate||n.rotate)&&i.push(new ha(n.rotateOptions)),(void 0===n.attribution||n.attribution)&&i.push(new ua(n.attributionOptions)),i}var va="active",da=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function pa(t,n,i){var r=t.getCenterInternal();if(r){var e=[r[0]+n[0],r[1]+n[1]];t.animateInternal({duration:void 0!==i?i:250,easing:gt,center:t.getConstrainedCenter(e)})}}function ya(t,n,i,r){var e=t.getZoom();if(void 0!==e){var o=t.getConstrainedZoom(e+n),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==r?r:250,easing:mt})}}var ma=function(t){function n(n){var i=t.call(this)||this;return i.on,i.once,i.un,n&&n.handleEvent&&(i.handleEvent=n.handleEvent),i.vn=null,i.setActive(!0),i}return da(n,t),n.prototype.getActive=function(){return this.get(va)},n.prototype.getMap=function(){return this.vn},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(va,t)},n.prototype.setMap=function(t){this.vn=t},n}(et),wa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ga=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Br=r.delta?r.delta:1,i.Fr=void 0!==r.duration?r.duration:250,i}return wa(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==su.DBLCLICK){var i=t.originalEvent,r=t.map,e=t.coordinate,o=i.shiftKey?-this.Br:this.Br;ya(r.getView(),o,e,this.Fr),i.preventDefault(),n=!0}return!n},n}(ma),ba=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function xa(t){for(var n=t.length,i=0,r=0,e=0;e0}}else if(t.type==su.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,n=this.stopDown(r)}else t.type==su.POINTERMOVE&&this.handleMoveEvent(t);return!n},n.prototype.handleMoveEvent=function(t){},n.prototype.handleUpEvent=function(t){return!1},n.prototype.stopDown=function(t){return t},n.prototype.Xr=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},n}(ma);function _a(t){var n=arguments;return function(t){for(var i=!0,r=0,e=n.length;r0&&this.Zr(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.Vr&&this.Vr.begin(),this.$r=this.targetPointers.length>1,!0}return!1},n}(Ma),Ga=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Da=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{stopDown:O})||this).Zr=r.condition?r.condition:Oa,i.Kr=void 0,i.Fr=void 0!==r.duration?r.duration:250,i}return Ga(n,t),n.prototype.handleDragEvent=function(t){if(La(t)){var n=t.map,i=n.getView();if(i.getConstraints().rotation!==Fu){var r=n.getSize(),e=t.pixel,o=Math.atan2(r[1]/2-e[1],e[0]-r[0]/2);if(void 0!==this.Kr){var s=o-this.Kr;i.adjustRotationInternal(-s)}this.Kr=o}}},n.prototype.handleUpEvent=function(t){return!La(t)||(t.map.getView().endInteraction(this.Fr),!1)},n.prototype.handleDownEvent=function(t){return!!La(t)&&(!(!Aa(t)||!this.Zr(t))&&(t.map.getView().beginInteraction(),this.Kr=void 0,!0))},n}(Ma),qa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ua=function(t){function n(n){var i=t.call(this)||this;return i.Hr=null,i.pn=document.createElement("div"),i.pn.style.position="absolute",i.pn.style.pointerEvents="auto",i.pn.className="ol-box "+n,i.vn=null,i.Jr=null,i.Qr=null,i}return qa(n,t),n.prototype.disposeInternal=function(){this.setMap(null)},n.prototype.te=function(){var t=this.Jr,n=this.Qr,i="px",r=this.pn.style;r.left=Math.min(t[0],n[0])+i,r.top=Math.min(t[1],n[1])+i,r.width=Math.abs(n[0]-t[0])+i,r.height=Math.abs(n[1]-t[1])+i},n.prototype.setMap=function(t){if(this.vn){this.vn.getOverlayContainer().removeChild(this.pn);var n=this.pn.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.vn=t,this.vn&&this.vn.getOverlayContainer().appendChild(this.pn)},n.prototype.setPixels=function(t,n){this.Jr=t,this.Qr=n,this.createOrUpdateGeometry(),this.te()},n.prototype.createOrUpdateGeometry=function(){var t=this.Jr,n=this.Qr,i=[t,[t[0],n[1]],n,[n[0],t[1]]].map(this.vn.getCoordinateFromPixelInternal,this.vn);i[4]=i[0].slice(),this.Hr?this.Hr.setCoordinates([i]):this.Hr=new We([i])},n.prototype.getGeometry=function(){return this.Hr},n}(v),Ba=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xa="boxstart",Va="boxdrag",Wa="boxend",Ya="boxcancel",Za=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.coordinate=i,e.mapBrowserEvent=r,e}return Ba(n,t),n}(c),$a=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};return i.ne=new Ua(r.className||"ol-dragbox"),i.ie=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(i.onBoxEnd=r.onBoxEnd),i.Jr=null,i.Zr=r.condition?r.condition:Aa,i.re=r.boxEndCondition?r.boxEndCondition:i.defaultBoxEndCondition,i}return Ba(n,t),n.prototype.defaultBoxEndCondition=function(t,n,i){var r=i[0]-n[0],e=i[1]-n[1];return r*r+e*e>=this.ie},n.prototype.getGeometry=function(){return this.ne.getGeometry()},n.prototype.handleDragEvent=function(t){this.ne.setPixels(this.Jr,t.pixel),this.dispatchEvent(new Za(Va,t.coordinate,t))},n.prototype.handleUpEvent=function(t){this.ne.setMap(null);var n=this.re(t,this.Jr,t.pixel);return n&&this.onBoxEnd(t),this.dispatchEvent(new Za(n?Wa:Ya,t.coordinate,t)),!1},n.prototype.handleDownEvent=function(t){return!!this.Zr(t)&&(this.Jr=t.pixel,this.ne.setMap(t.map),this.ne.setPixels(this.Jr,this.Jr),this.dispatchEvent(new Za(Xa,t.coordinate,t)),!0)},n.prototype.onBoxEnd=function(t){},n}(Ma),Ka=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ha=function(t){function n(n){var i=this,r=n||{},e=r.condition?r.condition:Ia;return(i=t.call(this,{condition:e,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).Fr=void 0!==r.duration?r.duration:200,i.ee=void 0!==r.out&&r.out,i}return Ka(n,t),n.prototype.onBoxEnd=function(t){var n=this.getMap().getView(),i=this.getGeometry();if(this.ee){var r=n.rotatedExtentForGeometry(i),e=n.getResolutionForExtentInternal(r),o=n.getResolution()/e;(i=i.clone()).scale(o*o)}n.fitInternal(i,{duration:this.Fr,easing:mt})},n}($a),Ja=37,Qa=38,th=39,nh=40,ih=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rh=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.oe=function(t){return ka(t)&&Na(t)},i.Zr=void 0!==r.condition?r.condition:i.oe,i.Fr=void 0!==r.duration?r.duration:100,i.se=void 0!==r.pixelDelta?r.pixelDelta:128,i}return ih(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==B){var i=t.originalEvent,r=i.keyCode;if(this.Zr(t)&&(r==nh||r==Ja||r==th||r==Qa)){var e=t.map.getView(),o=e.getResolution()*this.se,s=0,u=0;r==nh?u=-o:r==Ja?s=-o:r==th?s=o:u=o;var a=[s,u];Hi(a,e.getRotation()),pa(e,a,this.Fr),i.preventDefault(),n=!0}}return!n},n}(ma),eh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oh=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Zr=r.condition?r.condition:Na,i.Br=r.delta?r.delta:1,i.Fr=void 0!==r.duration?r.duration:100,i}return eh(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==B||t.type==X){var i=t.originalEvent,r=i.charCode;if(this.Zr(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var e=t.map,o=r=="+".charCodeAt(0)?this.Br:-this.Br;ya(e.getView(),o,void 0,this.Fr),i.preventDefault(),n=!0}}return!n},n}(ma),sh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uh="trackpad",ah="wheel",hh=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,r)||this).ue=0,i.ae=0,i.wt=void 0!==r.maxDelta?r.maxDelta:1,i.Fr=void 0!==r.duration?r.duration:250,i.he=void 0!==r.timeout?r.timeout:80,i.fe=void 0===r.useAnchor||r.useAnchor,i.ce=void 0!==r.constrainResolution&&r.constrainResolution;var e=r.condition?r.condition:Ta;return i.Zr=r.onFocusOnly?_a(Ea,e):e,i.le=null,i.ve=void 0,i.de,i.pe=void 0,i.ye=400,i.me,i.we=300,i}return sh(n,t),n.prototype.ge=function(){this.me=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.ae?this.ae>0?1:-1:0,this.le)},n.prototype.handleEvent=function(t){if(!this.Zr(t))return!0;if(t.type!==Z)return!0;var n,i=t.map,r=t.originalEvent;if(r.preventDefault(),this.fe&&(this.le=t.coordinate),t.type==Z&&(n=r.deltaY,Gt&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=Xt),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=40)),0===n)return!1;this.ae=n;var e=Date.now();void 0===this.ve&&(this.ve=e),(!this.pe||e-this.ve>this.ye)&&(this.pe=Math.abs(n)<4?uh:ah);var o=i.getView();if(this.pe===uh&&!o.getConstrainResolution()&&!this.ce)return this.me?clearTimeout(this.me):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.me=setTimeout(this.ge.bind(this),this.he),o.adjustZoom(-n/this.we,this.le),this.ve=e,!1;this.ue+=n;var s=Math.max(this.he-(e-this.ve),0);return clearTimeout(this.de),this.de=setTimeout(this.be.bind(this,i),s),!1},n.prototype.be=function(t){var n=t.getView();n.getAnimating()&&n.cancelAnimations();var i=-oi(this.ue,-this.wt*this.we,this.wt*this.we)/this.we;(n.getConstrainResolution()||this.ce)&&(i=i?i>0?1:-1:0),ya(n,i,this.le,this.Fr),this.pe=void 0,this.ue=0,this.le=null,this.ve=void 0,this.de=void 0},n.prototype.setMouseAnchor=function(t){this.fe=t,t||(this.le=null)},n}(ma),fh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ch=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=O),(i=t.call(this,e)||this).xe=null,i.Kr=void 0,i.Me=!1,i._e=0,i.Se=void 0!==r.threshold?r.threshold:.3,i.Fr=void 0!==r.duration?r.duration:250,i}return fh(n,t),n.prototype.handleDragEvent=function(t){var n=0,i=this.targetPointers[0],r=this.targetPointers[1],e=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.Kr){var o=e-this.Kr;this._e+=o,!this.Me&&Math.abs(this._e)>this.Se&&(this.Me=!0),n=o}this.Kr=e;var s=t.map,u=s.getView();if(u.getConstraints().rotation!==Fu){var a=s.getViewport().getBoundingClientRect(),h=xa(this.targetPointers);h[0]-=a.left,h[1]-=a.top,this.xe=s.getCoordinateFromPixelInternal(h),this.Me&&(s.render(),u.adjustRotationInternal(n,this.xe))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.Fr),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.xe=null,this.Kr=void 0,this.Me=!1,this._e=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Ma),lh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vh=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=O),(i=t.call(this,e)||this).xe=null,i.Fr=void 0!==r.duration?r.duration:400,i.Oe=void 0,i.je=1,i}return lh(n,t),n.prototype.handleDragEvent=function(t){var n=1,i=this.targetPointers[0],r=this.targetPointers[1],e=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(e*e+o*o);void 0!==this.Oe&&(n=this.Oe/s),this.Oe=s;var u=t.map,a=u.getView();1!=n&&(this.je=n);var h=u.getViewport().getBoundingClientRect(),f=xa(this.targetPointers);f[0]-=h.left,f[1]-=h.top,this.xe=u.getCoordinateFromPixelInternal(f),u.render(),a.adjustResolutionInternal(n,this.xe)},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var n=t.map.getView(),i=this.je>1?1:-1;return n.endInteraction(this.Fr,i),!1}return!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.xe=null,this.Oe=void 0,this.je=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Ma);function dh(t){var n=t||{},i=new ft,r=new Io(-.005,.05,100);return(void 0===n.altShiftDragRotate||n.altShiftDragRotate)&&i.push(new Da),(void 0===n.doubleClickZoom||n.doubleClickZoom)&&i.push(new ga({delta:n.zoomDelta,duration:n.zoomDuration})),(void 0===n.dragPan||n.dragPan)&&i.push(new Fa({onFocusOnly:n.onFocusOnly,kinetic:r})),(void 0===n.pinchRotate||n.pinchRotate)&&i.push(new ch),(void 0===n.pinchZoom||n.pinchZoom)&&i.push(new vh({duration:n.zoomDuration})),(void 0===n.keyboard||n.keyboard)&&(i.push(new rh),i.push(new oh({delta:n.zoomDelta,duration:n.zoomDuration}))),(void 0===n.mouseWheelZoom||n.mouseWheelZoom)&&i.push(new hh({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(void 0===n.shiftDragZoom||n.shiftDragZoom)&&i.push(new Ha({duration:n.zoomDuration})),i}var ph=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yh=function(t){function n(n){return(n=A({},n)).controls||(n.controls=la()),n.interactions||(n.interactions=dh({onFocusOnly:!0})),t.call(this,n)||this}return ph(n,t),n.prototype.createRenderer=function(){return new Hs(this)},n}(ra),mh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wh="element",gh="map",bh="offset",xh="position",Mh="positioning",_h=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.options=n,i.id=n.id,i.insertFirst=void 0===n.insertFirst||n.insertFirst,i.stopEvent=void 0===n.stopEvent||n.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==n.className?n.className:"ol-overlay-container ol-selectable",i.element.style.position="absolute",i.element.style.pointerEvents="auto";var r=n.autoPan;return r&&"object"!=typeof r&&(r={animation:n.autoPanAnimation,margin:n.autoPanMargin}),i.autoPan=r||!1,i.rendered={jt:"",visible:!0},i.mapPostrenderListenerKey=null,i.addChangeListener(wh,i.handleElementChanged),i.addChangeListener(gh,i.handleMapChanged),i.addChangeListener(bh,i.handleOffsetChanged),i.addChangeListener(xh,i.handlePositionChanged),i.addChangeListener(Mh,i.handlePositioningChanged),void 0!==n.element&&i.setElement(n.element),i.setOffset(void 0!==n.offset?n.offset:[0,0]),i.setPositioning(n.positioning||"top-left"),void 0!==n.position&&i.setPosition(n.position),i}return mh(n,t),n.prototype.getElement=function(){return this.get(wh)},n.prototype.getId=function(){return this.id},n.prototype.getMap=function(){return this.get(gh)||null},n.prototype.getOffset=function(){return this.get(bh)},n.prototype.getPosition=function(){return this.get(xh)},n.prototype.getPositioning=function(){return this.get(Mh)},n.prototype.handleElementChanged=function(){Ao(this.element);var t=this.getElement();t&&this.element.appendChild(t)},n.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(To(this.element),H(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=$(t,vu,this.render,this),this.updatePixelPosition();var n=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?n.insertBefore(this.element,n.childNodes[0]||null):n.appendChild(this.element),this.performAutoPan()}},n.prototype.render=function(){this.updatePixelPosition()},n.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},n.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},n.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},n.prototype.setElement=function(t){this.set(wh,t)},n.prototype.setMap=function(t){this.set(gh,t)},n.prototype.setOffset=function(t){this.set(bh,t)},n.prototype.setPosition=function(t){this.set(xh,t)},n.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},n.prototype.panIntoView=function(t){var n=this.getMap();if(n&&n.getTargetElement()&&this.get(xh)){var i=this.getRect(n.getTargetElement(),n.getSize()),r=this.getElement(),e=this.getRect(r,[Oo(r),jo(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!xn(i,e)){var u=e[0]-i[0],a=i[2]-e[2],h=e[1]-i[1],f=i[3]-e[3],c=[0,0];if(u<0?c[0]=u-s:a<0&&(c[0]=Math.abs(a)+s),h<0?c[1]=h-s:f<0&&(c[1]=Math.abs(f)+s),0!==c[0]||0!==c[1]){var l=n.getView().getCenterInternal(),v=n.getPixelFromCoordinateInternal(l);if(!v)return;var d=[v[0]+c[0],v[1]+c[1]],p=o.animation||{};n.getView().animateInternal({center:n.getCoordinateFromPixelInternal(d),duration:p.duration,easing:p.easing})}}}},n.prototype.getRect=function(t,n){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,e=i.top+window.pageYOffset;return[r,e,r+n[0],e+n[1]]},n.prototype.setPositioning=function(t){this.set(Mh,t)},n.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},n.prototype.updatePixelPosition=function(){var t=this.getMap(),n=this.getPosition();if(t&&t.isRendered()&&n){var i=t.getPixelFromCoordinate(n),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},n.prototype.updateRenderedPosition=function(t,n){var i=this.element.style,r=this.getOffset(),e=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",u="0%",a="0%";"bottom-right"==e||"center-right"==e||"top-right"==e?u="-100%":"bottom-center"!=e&&"center-center"!=e&&"top-center"!=e||(u="-50%"),"bottom-left"==e||"bottom-center"==e||"bottom-right"==e?a="-100%":"center-left"!=e&&"center-center"!=e&&"center-right"!=e||(a="-50%");var h="translate(".concat(u,", ").concat(a,") translate(").concat(o,", ").concat(s,")");this.rendered.jt!=h&&(this.rendered.jt=h,i.transform=h,i.msTransform=h)},n.prototype.getOptions=function(){return this.options},n}(et),Sh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.Ee=0,this.Te={},this.Ae=null,this.Pe=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.Ee=0,this.Te={},this.Ae=null,this.Pe=null},t.prototype.containsKey=function(t){return this.Te.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var n=this.Ae;n;)t(n.Ce,n.ke,this),n=n.newer},t.prototype.get=function(t,n){var i=this.Te[t];return St(void 0!==i,15),i===this.Pe||(i===this.Ae?(this.Ae=this.Ae.newer,this.Ae.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.Pe,this.Pe.newer=i,this.Pe=i),i.Ce},t.prototype.remove=function(t){var n=this.Te[t];return St(void 0!==n,15),n===this.Pe?(this.Pe=n.older,this.Pe&&(this.Pe.newer=null)):n===this.Ae?(this.Ae=n.newer,this.Ae&&(this.Ae.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.Te[t],--this.Ee,n.Ce},t.prototype.getCount=function(){return this.Ee},t.prototype.getKeys=function(){var t,n=new Array(this.Ee),i=0;for(t=this.Pe;t;t=t.older)n[i++]=t.ke;return n},t.prototype.getValues=function(){var t,n=new Array(this.Ee),i=0;for(t=this.Pe;t;t=t.older)n[i++]=t.Ce;return n},t.prototype.peekLast=function(){return this.Ae.Ce},t.prototype.peekLastKey=function(){return this.Ae.ke},t.prototype.peekFirstKey=function(){return this.Pe.ke},t.prototype.peek=function(t){if(this.containsKey(t))return this.Te[t].Ce},t.prototype.pop=function(){var t=this.Ae;return delete this.Te[t.ke],t.newer&&(t.newer.older=null),this.Ae=t.newer,this.Ae||(this.Pe=null),--this.Ee,t.Ce},t.prototype.replace=function(t,n){this.get(t),this.Te[t].Ce=n},t.prototype.set=function(t,n){St(!(t in this.Te),16);var i={ke:t,newer:null,older:this.Pe,Ce:n};this.Pe?this.Pe.newer=i:this.Ae=i,this.Pe=i,this.Te[t]=i,++this.Ee},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Oh(t,n,i,r){return void 0!==r?(r[0]=t,r[1]=n,r[2]=i,r):[t,n,i]}function jh(t,n,i){return t+"/"+n+"/"+i}function Eh(t){return jh(t[0],t[1],t[2])}function Th(t){var n=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return jh(n[0],n[1],n[2])}function Ah(t){return t.split("/").map(Number)}function Ph(t){return(t[1]<i||i>n.getMaxZoom())return!1;var o=n.getFullTileRange(i);return!o||o.containsXY(r,e)}var kh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ih=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return kh(n,t),n.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},n.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Ah(this.peekFirstKey())[0];this.forEach(function(n){n.tileCoord[0]!==t&&(this.remove(Eh(n.tileCoord)),n.release())}.bind(this))}},n}(Sh),Nh=function(){function t(t,n,i,r){this.minX=t,this.maxX=n,this.minY=i,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,n){return this.minX<=t&&t<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Lh(t,n,i,r,e){return void 0!==e?(e.minX=t,e.maxX=n,e.minY=i,e.maxY=r,e):new Nh(t,n,i,r)}var zh=Nh,Rh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fh=[],Gh=function(t){function n(n,i,r,e){var o=t.call(this,n,i,{transition:0})||this;return o.Ne={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.Le={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=e.bind(void 0,o),o.wrappedTileCoord=r,o}return Rh(n,t),n.prototype.getContext=function(t){var n=o(t);return n in this.Ne||(this.Ne[n]=_o(1,1,Fh)),this.Ne[n]},n.prototype.hasContext=function(t){return o(t)in this.Ne},n.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},n.prototype.getReplayState=function(t){var n=o(t);return n in this.Le||(this.Le[n]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.Le[n]},n.prototype.load=function(){this.getSourceTiles()},n.prototype.release=function(){for(var n in this.Ne){var i=this.Ne[n];So(i),Fh.push(i.canvas),delete this.Ne[n]}t.prototype.release.call(this)},n}(xt),Dh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qh=function(t){function n(n,i,r,e,o,s){var u=t.call(this,n,i,s)||this;return u.extent=null,u.ze=e,u.Re=null,u.U,u.projection=null,u.resolution,u.Xt=o,u.Fe=r,u.key=r,u}return Dh(n,t),n.prototype.getFormat=function(){return this.ze},n.prototype.getFeatures=function(){return this.Re},n.prototype.load=function(){this.state==ct&&(this.setState(lt),this.Xt(this,this.Fe),this.U&&this.U(this.extent,this.resolution,this.projection))},n.prototype.onLoad=function(t,n){this.setFeatures(t)},n.prototype.onError=function(){this.setState(dt)},n.prototype.setFeatures=function(t){this.Re=t,this.setState(vt)},n.prototype.setLoader=function(t){this.U=t},n}(xt);function Uh(t){return Array.isArray(t)?qo(t):t}var Bh=!1;function Xh(t,n,i,r,e,o,s){var u=new XMLHttpRequest;u.open("GET","function"==typeof t?t(i,r,e):t,!0),"arraybuffer"==n.getType()&&(u.responseType="arraybuffer"),u.withCredentials=Bh,u.onload=function(t){if(!u.status||u.status>=200&&u.status<300){var r=n.getType(),a=void 0;"json"==r||"text"==r?a=u.responseText:"xml"==r?(a=u.responseXML)||(a=(new DOMParser).parseFromString(u.responseText,"application/xml")):"arraybuffer"==r&&(a=u.response),a?o(n.readFeatures(a,{extent:i,featureProjection:e}),n.readProjection(a)):s()}else s()},u.onerror=s,u.send()}function Vh(t,n){return function(i,r,e,o,s){var u=this;Xh(t,n,i,r,e,(function(t,n){u.addFeatures(t),void 0!==o&&o(t)}),s||j)}}function Wh(t,n){return[[-1/0,-1/0,1/0,1/0]]}var Yh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Zh(t,n,i,r){var e=document.createElement("script"),s="olc_"+o(n);function u(){delete window[s],e.parentNode.removeChild(e)}e.async=!0,e.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+s;var a=setTimeout((function(){u(),i&&i()}),1e4);window[s]=function(t){clearTimeout(a),u(),n(t)},document.head.appendChild(e)}var $h,Kh=function(t){function n(n){var i=this,r="Unexpected response status: "+n.status;return(i=t.call(this,r)||this).name="ResponseError",i.response=n,i}return Yh(n,t),n}(Error),Hh=function(t){function n(n){var i=t.call(this,"Failed to issue request")||this;return i.name="ClientError",i.client=n,i}return Yh(n,t),n}(Error);function Jh(t){return new Promise((function(n,i){var r=new XMLHttpRequest;r.addEventListener("load",(function(t){var r=t.target;if(!r.status||r.status>=200&&r.status<300){var e=void 0;try{e=JSON.parse(r.responseText)}catch(t){var o="Error parsing response text as JSON: "+t.message;return void i(new Error(o))}n(e)}else i(new Kh(r))})),r.addEventListener("error",(function(t){i(new Hh(t.target))})),r.open("GET",t),r.setRequestHeader("Accept","application/json"),r.send()}))}function Qh(t,n){return n.indexOf("://")>=0?n:new URL(n,t).href}var tf=function(){function t(){}return t.prototype.drawCustom=function(t,n,i,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,n){},t.prototype.drawFeature=function(t,n){},t.prototype.drawGeometryCollection=function(t,n){},t.prototype.drawLineString=function(t,n){},t.prototype.drawMultiLineString=function(t,n){},t.prototype.drawMultiPoint=function(t,n){},t.prototype.drawMultiPolygon=function(t,n){},t.prototype.drawPoint=function(t,n){},t.prototype.drawPolygon=function(t,n){},t.prototype.drawText=function(t,n){},t.prototype.setFillStrokeStyle=function(t,n){},t.prototype.setImageStyle=function(t,n){},t.prototype.setTextStyle=function(t,n){},t}(),nf=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rf=function(t){function n(n,i,r,e,o,s,u){var a=t.call(this)||this;return a.Ne=n,a.kt=i,a.st=r,a.jt=e,a.Ge=o,a.De=s,a.qe=u,a.Ue=null,a.Be=null,a.Xe=null,a.Ve=null,a.We=null,a.Lt=null,a.Ye=0,a.Ze=0,a.$e=0,a.Ke=0,a.He=0,a.Je=0,a.Qe=!1,a.no=0,a.io=[0,0],a.ro=0,a.eo="",a.oo=0,a.so=0,a.uo=!1,a.ao=0,a.ho=[0,0],a.fo=null,a.co=null,a.lo=null,a.vo=[],a.do=[1,0,0,1,0,0],a}return nf(n,t),n.prototype.po=function(t,n,i,r){if(this.Lt){var e=Dr(t,n,i,r,this.jt,this.vo),o=this.Ne,s=this.do,u=o.globalAlpha;1!=this.Ke&&(o.globalAlpha=u*this.Ke);var a=this.no;this.Qe&&(a+=this.Ge);for(var h=0,f=e.length;h2||Math.abs(t[4*n+3]-191.25)>2}function mf(t,n,i,r){var e=Er(i,n,t),o=mr(n,r,i),s=n.getMetersPerUnit();void 0!==s&&(o*=s);var u=t.getMetersPerUnit();void 0!==u&&(o/=u);var a=t.getExtent();if(!a||bn(a,e)){var h=mr(t,o,e)/o;isFinite(h)&&h>0&&(o/=h)}return o}function wf(t,n,i,r){var e=qn(i),o=mf(t,n,e,r);return(!isFinite(o)||o<=0)&&Rn(i,(function(i){return o=mf(t,n,i,r),isFinite(o)&&o>0})),o}function gf(t,n,i,r,e,o,s,u,a,h,f,c){var l=_o(Math.round(i*t),Math.round(i*n),df);if(c||A(l,lf),0===a.length)return l.canvas;function v(t){return Math.round(t*i)/i}l.scale(i,i),l.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];a.forEach((function(t,n,i){Cn(d,t.extent)}));var p=$n(d),y=Vn(d),m=_o(Math.round(i*p/r),Math.round(i*y/r));c||A(m,lf);var w=i/r;a.forEach((function(t,n,i){var r=t.extent[0]-d[0],e=-(t.extent[3]-d[3]),o=$n(t.extent),s=Vn(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,r*w,e*w,o*w,s*w)}));var g=Yn(s);return u.getTriangles().forEach((function(t,n,e){var s=t.source,u=t.target,a=s[0][0],h=s[0][1],f=s[1][0],p=s[1][1],y=s[2][0],w=s[2][1],b=v((u[0][0]-g[0])/o),x=v(-(u[0][1]-g[1])/o),M=v((u[1][0]-g[0])/o),_=v(-(u[1][1]-g[1])/o),S=v((u[2][0]-g[0])/o),O=v(-(u[2][1]-g[1])/o),j=a,E=h;a=0,h=0;var T=fi([[f-=j,p-=E,0,0,M-b],[y-=j,w-=E,0,0,S-b],[0,0,f,p,_-x],[0,0,y,w,O-x]]);if(T){if(l.save(),l.beginPath(),function(){if(void 0===cf){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",pf(t,4,5,4,0),pf(t,4,5,0,5);var n=t.getImageData(0,0,3,3).data;cf=yf(n,0)||yf(n,4)||yf(n,8)}return cf}()||!c){l.moveTo(M,_);for(var A=b-M,P=x-_,C=0;C<4;C++)l.lineTo(M+v((C+1)*A/4),_+v(C*P/3)),3!=C&&l.lineTo(M+v((C+1)*A/4),_+v((C+1)*P/3));l.lineTo(S,O)}else l.moveTo(M,_),l.lineTo(b,x),l.lineTo(S,O);l.clip(),l.transform(T[0],T[2],T[1],T[3],b,x),l.translate(d[0]-j,d[3]-E),l.scale(r/i,-r/i),l.drawImage(m.canvas,0,0),l.restore()}})),f&&(l.save(),l.globalCompositeOperation="source-over",l.strokeStyle="black",l.lineWidth=1,u.getTriangles().forEach((function(t,n,i){var r=t.target,e=(r[0][0]-g[0])/o,s=-(r[0][1]-g[1])/o,u=(r[1][0]-g[0])/o,a=-(r[1][1]-g[1])/o,h=(r[2][0]-g[0])/o,f=-(r[2][1]-g[1])/o;l.beginPath(),l.moveTo(u,a),l.lineTo(e,s),l.lineTo(h,f),l.closePath(),l.stroke()})),l.restore()),l.canvas}var bf=[0,0,0],xf=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.Ti=t.resolutions,St(_(this.Ti,(function(t,n){return n-t}),!0),17),!t.origins)for(var i=0,r=this.Ti.length-1;i=this.minZoom;){if(n(u,2===this.Ei?Lh(e=Math.floor(e/2),e,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,u,i)))return!0;--u}return!1},t.prototype.getExtent=function(){return this.st},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this._o?this._o:this.So[t]},t.prototype.getResolution=function(t){return this.Ti[t]},t.prototype.getResolutions=function(){return this.Ti},t.prototype.getTileCoordChildTileRange=function(t,n,i){if(t[0]this.maxZoom||n0?r:Math.max(s/u[0],o/u[1]),h=e+1,f=new Array(h),c=0;c0))){var i=Uf(n.canvas).getExtension("WEBGL_lose_context");i&&i.loseContext(),delete Cc[t]}}(this.Yo),delete this.Io,delete this.qt},n.prototype.prepareDraw=function(t,n){var i=this.getGL(),r=this.getCanvas(),e=t.size,o=t.pixelRatio;r.width=e[0]*o,r.height=e[1]*o,r.style.width=e[0]+"px",r.style.height=e[1]+"px",i.useProgram(this.Ko);for(var s=this.rs.length-1;s>=0;s--)this.rs[s].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,n?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.Ko),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.prepareDrawToRenderTarget=function(t,n,i){var r=this.getGL(),e=n.getSize();r.bindFramebuffer(r.FRAMEBUFFER,n.getFramebuffer()),r.viewport(0,0,e[0],e[1]),r.bindTexture(r.TEXTURE_2D,n.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.Ko),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.drawElements=function(t,n){var i=this.getGL();this.getExtension("OES_element_index_uint");var r=i.UNSIGNED_INT,e=n-t,o=4*t;i.drawElements(i.TRIANGLES,e,r,o)},n.prototype.finalizeDraw=function(t,n,i){for(var r=0,e=this.rs.length;rthis.W[0]||n>=this.W[1])return Fc[0]=0,Fc[1]=0,Fc[2]=0,Fc[3]=0,Fc;this.readAll();var i=Math.floor(t)+(this.W[1]-Math.floor(n)-1)*this.W[0];return Fc[0]=this.B[4*i],Fc[1]=this.B[4*i+1],Fc[2]=this.B[4*i+2],Fc[3]=this.B[4*i+3],Fc},t.prototype.getTexture=function(){return this.ss},t.prototype.getFramebuffer=function(){return this.hs},t.prototype.cs=function(){var t=this.W,n=this.us.getGL();this.ss=this.us.createTexture(t,null,this.ss),n.bindFramebuffer(n.FRAMEBUFFER,this.hs),n.viewport(0,0,t[0],t[1]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.ss,0),this.B=new Uint8Array(t[0]*t[1]*4)},t}(),Dc=!0,qc=function(){function t(t,n,i,r,e,o){this.ls=t,this.vs=n;var s={},u=jr(this.vs,this.ls);this.ds=function(t){var n=t[0]+"/"+t[1];return s[n]||(s[n]=u(t)),s[n]},this.ps=r,this.ys=e*e,this.ws=[],this.gs=!1,this.bs=this.ls.canWrapX()&&!!r&&!!this.ls.getExtent()&&$n(r)==$n(this.ls.getExtent()),this.xs=this.ls.getExtent()?$n(this.ls.getExtent()):null,this.Ms=this.vs.getExtent()?$n(this.vs.getExtent()):null;var a=Yn(i),h=Zn(i),f=Dn(i),c=Gn(i),l=this.ds(a),v=this.ds(h),d=this.ds(f),p=this.ds(c),y=10+(o?Math.max(0,Math.ceil(ui(Fn(i)/(o*o*256*256)))):0);if(this._s(a,h,f,c,l,v,d,p,y),this.gs){var m=1/0;this.ws.forEach((function(t,n,i){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.ws.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.xs/2){var n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-m>this.xs/2&&(n[0][0]-=this.xs),n[1][0]-m>this.xs/2&&(n[1][0]-=this.xs),n[2][0]-m>this.xs/2&&(n[2][0]-=this.xs);var i=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-i.5&&f<1,v=!1;if(a>0){if(this.vs.isGlobal()&&this.Ms)v=$n(yn([t,n,i,r]))/this.Ms>.25||v;!l&&this.ls.isGlobal()&&f&&(v=f>.25||v)}if(!(!v&&this.ps&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Kn(h,this.ps)){var d=0;if(!(v||isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(u[0])&&isFinite(u[1])))if(a>0)v=!0;else if(1!=(d=(isFinite(e[0])&&isFinite(e[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(u[0])&&isFinite(u[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(a>0){if(!v){var p=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.ds(p),m=void 0;if(l)m=(vi(e[0],c)+vi(s[0],c))/2-vi(y[0],c);else m=(e[0]+s[0])/2-y[0];var w=(e[1]+s[1])/2-y[1];v=m*m+w*w>this.ys}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var g=[(n[0]+i[0])/2,(n[1]+i[1])/2],b=this.ds(g),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],M=this.ds(x);this._s(t,n,g,x,e,o,b,M,a-1),this._s(x,g,i,r,M,b,s,u,a-1)}else{var _=[(t[0]+n[0])/2,(t[1]+n[1])/2],S=this.ds(_),O=[(i[0]+r[0])/2,(i[1]+r[1])/2],j=this.ds(O);this._s(t,_,O,r,e,S,j,u,a-1),this._s(_,n,i,O,S,o,s,j,a-1)}return}}if(l){if(!this.bs)return;this.gs=!0}0==(11&d)&&this.Ss(t,i,r,e,s,u),0==(14&d)&&this.Ss(t,i,n,e,s,o),d&&(0==(13&d)&&this.Ss(n,r,t,o,u,e),0==(7&d)&&this.Ss(n,r,i,o,u,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.ws.forEach((function(n,i,r){var e=n.source;kn(t,e[0]),kn(t,e[1]),kn(t,e[2])})),t},t.prototype.getTriangles=function(){return this.ws},t}(),Uc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bc=function(t){function n(n,i,r,e,o,s,u,a,h,f,c,l){var v=t.call(this,o,ct,{interpolate:!!l})||this;v.Os=void 0!==c&&c,v.kt=u,v.js=a,v.qt=null,v.Es=i,v.Ts=e,v.As=s||o,v.Ps=[],v.Cs=null,v.ks=0;var d=e.getTileCoordExtent(v.As),p=v.Ts.getExtent(),y=v.Es.getExtent(),m=p?Wn(d,p):d;if(0===Fn(m))return v.state=pt,v;var w=n.getExtent();w&&(y=y?Wn(y,w):w);var g=e.getResolution(v.As[0]),b=wf(n,r,m,g);if(!isFinite(b)||b<=0)return v.state=pt,v;var x=void 0!==f?f:.5;if(v.Is=new qc(n,r,m,y,b*x,g),0===v.Is.getTriangles().length)return v.state=pt,v;v.ks=i.getZForResolution(b);var M=v.Is.calculateSourceExtent();if(y&&(n.canWrapX()?(M[1]=oi(M[1],y[1],y[3]),M[3]=oi(M[3],y[1],y[3])):M=Wn(M,y)),Fn(M)){for(var _=i.getTileRangeForExtentAndZ(M,v.ks),S=_.minX;S<=_.maxX;S++)for(var O=_.minY;O<=_.maxY;O++){var j=h(v.ks,S,O,u);j&&v.Ps.push(j)}0===v.Ps.length&&(v.state=pt)}else v.state=pt;return v}return Uc(n,t),n.prototype.getImage=function(){return this.qt},n.prototype.Ns=function(){var t=[];if(this.Ps.forEach(function(n,i,r){n&&n.getState()==vt&&t.push({extent:this.Es.getTileCoordExtent(n.tileCoord),image:n.getImage()})}.bind(this)),this.Ps.length=0,0===t.length)this.state=dt;else{var n=this.As[0],i=this.Ts.getTileSize(n),r="number"==typeof i?i:i[0],e="number"==typeof i?i:i[1],o=this.Ts.getResolution(n),s=this.Es.getResolution(this.ks),u=this.Ts.getTileCoordExtent(this.As);this.qt=gf(r,e,this.kt,s,this.Es.getExtent(),o,u,this.Is,t,this.js,this.Os,this.interpolate),this.state=vt}this.changed()},n.prototype.load=function(){if(this.state==ct){this.state=lt,this.changed();var t=0;this.Cs=[],this.Ps.forEach(function(n,i,r){var e=n.getState();if(e==ct||e==lt){t++;var o=$(n,L,(function(i){var r=n.getState();r!=vt&&r!=dt&&r!=pt||(H(o),0===--t&&(this.Ls(),this.Ns()))}),this);this.Cs.push(o)}}.bind(this)),0===t?setTimeout(this.Ns.bind(this),0):this.Ps.forEach((function(t,n,i){t.getState()==ct&&t.load()}))}},n.prototype.Ls=function(){this.Cs.forEach(H),this.Cs=null},n.prototype.release=function(){this.qt&&(So(this.qt.getContext("2d")),df.push(this.qt),this.qt=null),t.prototype.release.call(this)},n}(xt),Xc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Vc(t,n,i){var r=i?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}function Wc(t,n,i,r,e,o){var s,u,a=t.getGL();i instanceof Float32Array?(s=a.FLOAT,t.getExtension("OES_texture_float"),u=null!==t.getExtension("OES_texture_float_linear")):(s=a.UNSIGNED_BYTE,u=!0);Vc(a,n,o&&u);var h,f=i.byteLength/r[1],c=1;switch(f%8==0?c=8:f%4==0?c=4:f%2==0&&(c=2),e){case 1:h=a.LUMINANCE;break;case 2:h=a.LUMINANCE_ALPHA;break;case 3:h=a.RGB;break;case 4:h=a.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(e))}var l=a.getParameter(a.UNPACK_ALIGNMENT);a.pixelStorei(a.UNPACK_ALIGNMENT,c),a.texImage2D(a.TEXTURE_2D,0,h,r[0],r[1],0,h,s,i),a.pixelStorei(a.UNPACK_ALIGNMENT,l)}var Yc=null;var Zc=function(t){function n(n){var i=t.call(this)||this;i.tile,i.textures=[],i.cr=i.cr.bind(i),i.zs=Qu(n.grid.getTileSize(n.tile.tileCoord[0])),i.js=n.gutter||0,i.bandCount=NaN,i.us=n.helper;var r=new mc(zf,Ff);return r.fromArray([0,1,1,1,1,0,0,0]),i.us.flushBufferData(r),i.coords=r,i.setTile(n.tile),i}return Xc(n,t),n.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(L,this.cr),this.tile=t,this.textures.length=0,this.loaded=t.getState()===vt,this.loaded)this.Rs();else{if(t instanceof ko){var n=t.getImage();n instanceof Image&&!n.crossOrigin&&(n.crossOrigin="anonymous")}t.addEventListener(L,this.cr)}},n.prototype.Rs=function(){var t=this.us,n=t.getGL(),i=this.tile;if(i instanceof ko||i instanceof Bc){var r=n.createTexture();return this.textures.push(r),this.bandCount=4,void function(t,n,i,r){Vc(t,n,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)}(n,r,i.getImage(),i.interpolate)}var e=i.getSize(),o=[e[0]+2*this.js,e[1]+2*this.js],s=i.getData(),u=s instanceof Float32Array,a=o[0]*o[1],h=u?Float32Array:Uint8Array,f=h.BYTES_PER_ELEMENT,c=s.byteLength/o[1];this.bandCount=Math.floor(c/f/o[0]);var l=Math.ceil(this.bandCount/4);if(1===l){r=n.createTexture();return this.textures.push(r),void Wc(t,r,s,o,this.bandCount,i.interpolate)}for(var v=new Array(l),d=0;d=v;--d)for(var p=a.getTileRangeForExtentAndZ(n,d,this.Ys),y=a.getResolution(d),m=p.minX;m<=p.maxX;++m)for(var w=p.minY;w<=p.maxY;++w){var g=Oh(d,m,w,this.Zs),b=dl(u,g),x=void 0,M=void 0;if(l.containsKey(b)&&(M=(x=l.get(b)).tile),!x||x.tile.key!==u.getKey())if(M=u.getTile(d,m,w,t.pixelRatio,e.projection),x)if(this.iu(M))x.setTile(M);else{var _=M.getInterimTile();x.setTile(_)}else x=new Zc({tile:M,grid:a,helper:this.helper,gutter:h}),l.set(b,x);ll(r,x,d);var S=M.getKey();c[S]=!0,M.getState()===ct&&(t.tileQueue.isKeyQueued(S)||t.tileQueue.enqueue([M,f,a.getTileCoordCenter(g),y]))}},n.prototype.renderFrame=function(t){this.Zi=t,this.renderComplete=!0;var n=this.helper.getGL();this.preRender(n,t);var i=t.viewState,r=this.getLayer().getRenderSource(),e=r.getTileGridForProjection(i.projection),s=r.getGutterForProjection(i.projection),u=vl(t,t.extent),a=e.getZForResolution(i.resolution,r.zDirection),h={};if(t.nextExtent){var f=e.getZForResolution(i.nextResolution,r.zDirection),c=vl(t,t.nextExtent);this.enqueueTiles(t,c,f,h)}this.enqueueTiles(t,u,a,h);for(var l={},v=o(this),d=t.time,y=!1,m=h[a],w=0,g=m.length;w=x;--M){if(this.ru(e,b,M,h))break}}this.helper.useProgram(this.Ks),this.helper.prepareDraw(t,!y);for(var _=Object.keys(h).map(Number).sort(p),S=i.center[0],O=i.center[1],j=0,E=_.length;j0&&Wn(H=e.getTileCoordExtent(b),u,H),this.helper.setUniformFloatVec4(ul.RENDER_EXTENT,H),this.helper.setUniformFloatValue(ul.RESOLUTION,i.resolution),this.helper.setUniformFloatValue(ul.ZOOM,i.zoom),this.helper.drawElements(0,this.Qs.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var J=this.helper.getCanvas(),Q=this.tu;Q.canExpireCache();){var tt;(tt=Q.pop()).dispose()}return t.postRenderFunctions.push((function(t,n){r.expireCache(n.viewState.projection,fl)})),this.postRender(n,t),J},n.prototype.getData=function(t){if(!this.helper.getGL())return null;var n=this.Zi;if(!n)return null;var i=this.getLayer(),r=tn(n.pixelToCoordinateTransform,t.slice()),e=n.viewState,o=i.getExtent();if(o&&!bn(Lr(o,e.projection),r))return null;var s,u,a,h=i.getSources(yn([r]),e.resolution);for(s=h.length-1;s>=0;--s)if("ready"===(u=h[s]).getState()){if(a=u.getTileGridForProjection(e.projection),u.getWrapX())break;var f=a.getExtent();if(!f||bn(f,r))break}if(s<0)return null;for(var c=this.tu,l=a.getZForResolution(e.resolution);l>=a.getMinZoom();--l){var v=a.getTileCoordForCoordAndZ(r,l),d=dl(u,v);if(c.containsKey(d)){var p=c.get(d);if(p.loaded){var y=a.getOrigin(l),m=Qu(a.getTileSize(l)),w=a.getResolution(l),g=(r[0]-y[0])/w-v[1]*m[0],b=(y[1]-r[1])/w-v[2]*m[1];return p.getPixelData(g,b)}}}return null},n.prototype.ru=function(t,n,i,r){var e=t.getTileRangeForTileCoordAndZ(n,i,this.Ys);if(!e)return!1;for(var o=!0,s=this.tu,u=this.getLayer().getRenderSource(),a=e.minX;a<=e.maxX;++a)for(var h=e.minY;h<=e.maxY;++h){var f=dl(u,[i,a,h]),c=!1;if(s.containsKey(f)){var l=s.get(f);l.loaded&&(ll(r,l,i),c=!0)}c||(o=!1)}return o},n.prototype.removeHelper=function(){if(this.helper){var n=this.tu;n.forEach((function(t){return t.dispose()})),n.clear()}t.prototype.removeHelper.call(this)},n.prototype.disposeInternal=function(){var n=this.helper;n&&(n.getGL().deleteProgram(this.Ks),delete this.Ks,n.deleteBuffer(this.Qs));t.prototype.disposeInternal.call(this),delete this.Qs,delete this.tu,delete this.Zi},n}(ol),yl=1,ml=2,wl=4,gl=8,bl=16,xl=31,Ml=0,_l={};function Sl(t){if("number"==typeof t)return yl;if("boolean"==typeof t)return gl;if("string"==typeof t)return Uo(t)?wl|ml:ml;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var n=t;if(n.every((function(t){return"number"==typeof t})))return 3===n.length||4===n.length?wl|bl:bl;if("string"!=typeof n[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(n)));var i=_l[n[0]];if(void 0===i)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return i.getReturnType(n.slice(1))}function Ol(t){return ui(t)%1==0}function jl(t){var n=t.toString();return-1===n.indexOf(".")?n+".0":n}function El(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(jl).join(", "),")")}function Tl(t){var n=Go(t).slice();return n.length<4&&n.push(1),El(n.map((function(t,n){return n<3?t/255:t})))}function Al(t,n){return void 0===t.stringLiteralsMap[n]&&(t.stringLiteralsMap[n]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[n]}function Pl(t,n){return jl(Al(t,n))}function Cl(t,n,i){if(Array.isArray(n)&&"string"==typeof n[0]){var r=_l[n[0]];if(void 0===r)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return r.toGlsl(t,n.slice(1),i)}var e=Sl(n);if((e&yl)>0)return jl(n);if((e&gl)>0)return n.toString();if((e&ml)>0&&(void 0===i||i==ml))return Pl(t,n.toString());if((e&wl)>0&&(void 0===i||i==wl))return Tl(n);if((e&bl)>0)return El(n);throw new Error("Unexpected expression ".concat(n," (expected type ").concat(i,")"))}function kl(t){if(!(Sl(t)&yl))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Il(t){for(var n=0;nn)throw new Error("At most ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function Gl(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function Dl(t,n){if(!Ol(n))throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function ql(t){return"u_var_"+t}_l.get={getReturnType:function(t){return xl},toGlsl:function(t,n){zl(n,1),Nl(n[0]);var i=n[0].toString();return-1===t.attributes.indexOf(i)&&t.attributes.push(i),(t.inFragmentShader?"v_":"a_")+i}},_l.var={getReturnType:function(t){return xl},toGlsl:function(t,n){zl(n,1),Nl(n[0]);var i=n[0].toString();return-1===t.variables.indexOf(i)&&t.variables.push(i),ql(i)}};var Ul="u_paletteTextures";_l.palette={getReturnType:function(t){return wl},toGlsl:function(t,n){zl(n,2),kl(n[0]);var i=Cl(t,n[0]),r=n[1];if(!Array.isArray(r))throw new Error("The second argument of palette must be an array");for(var e=r.length,o=new Uint8Array(4*e),s=0;s"]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," > ").concat(Cl(t,n[1]),")")}},_l[">="]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," >= ").concat(Cl(t,n[1]),")")}},_l["<"]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," < ").concat(Cl(t,n[1]),")")}},_l["<="]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," <= ").concat(Cl(t,n[1]),")")}},_l["=="]=Xl("=="),_l["!="]=Xl("!="),_l["!"]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,1),Ll(n[0]),"(!".concat(Cl(t,n[0]),")")}},_l.all=Vl("&&"),_l.any=Vl("||"),_l.between={getReturnType:function(t){return gl},toGlsl:function(t,n){zl(n,3),Il(n);var i=Cl(t,n[1]),r=Cl(t,n[2]),e=Cl(t,n[0]);return"(".concat(e," >= ").concat(i," && ").concat(e," <= ").concat(r,")")}},_l.array={getReturnType:function(t){return bl},toGlsl:function(t,n){Rl(n,2),Fl(n,4),Il(n);var i=n.map((function(n){return Cl(t,n,yl)}));return"vec".concat(n.length,"(").concat(i.join(", "),")")}},_l.color={getReturnType:function(t){return wl},toGlsl:function(t,n){Rl(n,3),Fl(n,4),Il(n);var i=n;3===n.length&&i.push(1);var r=n.map((function(n,i){return Cl(t,n,yl)+(i<3?" / 255.0":"")}));return"vec".concat(n.length,"(").concat(r.join(", "),")")}},_l.interpolate={getReturnType:function(t){for(var n=wl|yl,i=3;i=1;a-=2){var h=Cl(t,n[a]),f=Cl(t,n[a+1],e);u="(".concat(o," == ").concat(h," ? ").concat(f," : ").concat(u||s,")")}return u}},_l.case={getReturnType:function(t){for(var n=xl,i=1;i=0;o-=2){var a=Cl(t,n[o]),h=Cl(t,n[o+1],e);u="(".concat(a," ? ").concat(h," : ").concat(u||s,")")}return u}};var Wl=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,n,i){return this.varyings.push({name:t,type:n,expression:i}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var n=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",i=this.attributes,r=this.varyings;return t&&(i=i.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(i.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(n,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var n=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",i=this.varyings;return t&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(n,"\n}")},t}();function Yl(t){var n=t.symbol,i=void 0!==n.size?n.size:1,r=n.color||"white",e=n.textureCoord||[0,0,1,1],o=n.offset||[0,0],s=void 0!==n.opacity?n.opacity:1,u=void 0!==n.rotation?n.rotation:0,a={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},h=Cl(a,i,bl|yl),f=Cl(a,o,bl),c=Cl(a,e,bl),l=Cl(a,u,yl),v={inFragmentShader:!0,variables:a.variables,attributes:[],stringLiteralsMap:a.stringLiteralsMap,functions:{}},d=Cl(v,r,wl),p=Cl(v,s,yl),y="1.0",m="vec2(".concat(Cl(v,i,bl|yl),").x");switch(n.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./".concat(m,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var w="(v_quadCoord*2.-1.)",g="(atan(".concat(w,".x,").concat(w,".y))");y="(1.0-smoothstep(.5-3./".concat(m,",.5,cos(floor(.5+").concat(g,"/2.094395102)*2.094395102-").concat(g,")*length(").concat(w,")))");break;default:throw new Error("Unexpected symbol type: "+n.symbolType)}var b=(new Wl).setSizeExpression("vec2(".concat(h,")")).setRotationExpression(l).setSymbolOffsetExpression(f).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!n.rotateWithView).setColorExpression("vec4(".concat(d,".rgb, ").concat(d,".a * ").concat(p," * ").concat(y,")"));if(t.filter){var x=Cl(v,t.filter,gl);b.setFragmentDiscardExpression("!".concat(x))}var M={};if(v.variables.forEach((function(n){var i=ql(n);b.addUniform("float ".concat(i)),M[i]=function(){if(!t.variables||void 0===t.variables[n])throw new Error("The following variable is missing from the style: ".concat(n));var i=t.variables[n];return"string"==typeof i&&(i=Al(a,i)),void 0!==i?i:-9999999}})),"image"===n.symbolType&&n.src){var _=new Image;_.crossOrigin=void 0===n.crossOrigin?"anonymous":n.crossOrigin,_.src=n.src,b.addUniform("sampler2D u_texture").setColorExpression(b.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),M.u_texture=_}return v.attributes.forEach((function(t){-1===a.attributes.indexOf(t)&&a.attributes.push(t),b.addVarying("v_".concat(t),"float","a_".concat(t))})),a.attributes.forEach((function(t){b.addAttribute("float a_".concat(t))})),{builder:b,attributes:a.attributes.map((function(t){return{name:t,callback:function(n,i){var r=i[t];return"string"==typeof r&&(r=Al(a,r)),void 0!==r?r:-9999999}}})),uniforms:M}}var Zl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$l=function(t){function n(n){var i=t.call(this,{extent:n.extent,origin:n.origin,origins:n.origins,resolutions:n.resolutions,tileSize:n.tileSize,tileSizes:n.tileSizes,sizes:n.sizes})||this;return i.eu=n.matrixIds,i}return Zl(n,t),n.prototype.getMatrixId=function(t){return this.eu[t]},n.prototype.getMatrixIds=function(){return this.eu},n}(xf),Kl=$l;function Hl(t,n,i){var r=[],e=[],o=[],s=[],u=[],a=void 0!==i?i:[],h=yr(t.SupportedCRS),f=h.getMetersPerUnit(),c="ne"==h.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,n){return n.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(n){if(!(a.length>0)||b(a,(function(i){return n.Identifier==i.TileMatrix||-1===n.Identifier.indexOf(":")&&t.Identifier+":"+n.Identifier===i.TileMatrix}))){e.push(n.Identifier);var i=28e-5*n.ScaleDenominator/f,h=n.TileWidth,l=n.TileHeight;c?o.push([n.TopLeftCorner[1],n.TopLeftCorner[0]]):o.push(n.TopLeftCorner),r.push(i),s.push(h==l?h:[h,l]),u.push([n.MatrixWidth,n.MatrixHeight])}})),new $l({extent:n,origins:o,resolutions:r,matrixIds:e,tileSizes:s,sizes:u})}var Jl=function(){function t(t){this.ou=t.opacity,this.su=t.rotateWithView,this.Dr=t.rotation,this.uu=t.scale,this.au=Qu(t.scale),this.hu=t.displacement,this.fu=t.declutterMode}return t.prototype.clone=function(){var n=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(n)?n.slice():n,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.ou},t.prototype.getRotateWithView=function(){return this.su},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.uu},t.prototype.getScaleArray=function(){return this.au},t.prototype.getDisplacement=function(){return this.hu},t.prototype.getDeclutterMode=function(){return this.fu},t.prototype.getAnchor=function(){return r()},t.prototype.getImage=function(t){return r()},t.prototype.getHitDetectionImage=function(){return r()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return r()},t.prototype.getImageSize=function(){return r()},t.prototype.getOrigin=function(){return r()},t.prototype.getSize=function(){return r()},t.prototype.setDisplacement=function(t){this.hu=t},t.prototype.setOpacity=function(t){this.ou=t},t.prototype.setRotateWithView=function(t){this.su=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.uu=t,this.au=Qu(t)},t.prototype.listenImageChange=function(t){r()},t.prototype.load=function(){r()},t.prototype.unlistenImageChange=function(t){r()},t}(),Ql=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tv=function(t){function n(n){var i=this,r=void 0!==n.rotateWithView&&n.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==n.rotation?n.rotation:0,scale:void 0!==n.scale?n.scale:1,displacement:void 0!==n.displacement?n.displacement:[0,0],declutterMode:n.declutterMode})||this).qt=void 0,i.cu=null,i.lu=void 0!==n.fill?n.fill:null,i._o=[0,0],i.Zt=n.points,i.vu=void 0!==n.radius?n.radius:n.radius1,i.du=n.radius2,i.$t=void 0!==n.angle?n.angle:0,i.pu=void 0!==n.stroke?n.stroke:null,i.W=null,i.yu=null,i.render(),i}return Ql(n,t),n.prototype.clone=function(){var t=this.getScale(),i=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i},n.prototype.getAnchor=function(){var t=this.W;if(!t)return null;var n=this.getDisplacement();return[t[0]/2-n[0],t[1]/2+n[1]]},n.prototype.getAngle=function(){return this.$t},n.prototype.getFill=function(){return this.lu},n.prototype.setFill=function(t){this.lu=t,this.render()},n.prototype.getHitDetectionImage=function(){return this.cu||this.mu(this.yu),this.cu},n.prototype.getImage=function(t){var n=this.qt[t];if(!n){var i=this.yu,r=_o(i.size*t,i.size*t);this.wu(i,r,t),n=r.canvas,this.qt[t]=n}return n},n.prototype.getPixelRatio=function(t){return t},n.prototype.getImageSize=function(){return this.W},n.prototype.getImageState=function(){return po},n.prototype.getOrigin=function(){return this._o},n.prototype.getPoints=function(){return this.Zt},n.prototype.getRadius=function(){return this.vu},n.prototype.getRadius2=function(){return this.du},n.prototype.getSize=function(){return this.W},n.prototype.getStroke=function(){return this.pu},n.prototype.setStroke=function(t){this.pu=t,this.render()},n.prototype.listenImageChange=function(t){},n.prototype.load=function(){},n.prototype.unlistenImageChange=function(t){},n.prototype.gu=function(t,n,i){if(0===n||this.Zt===1/0||"bevel"!==t&&"miter"!==t)return n;var r=this.vu,e=void 0===this.du?r:this.du;if(r0,6);var c=void 0!==r.src?lo:po;return i.Mu=void 0!==r.color?Go(r.color):null,i.Nu=vv(h,f,void 0!==i.Iu?i.Iu:null,i.Bt,c,i.Mu),i.Lu=void 0!==r.offset?r.offset:[0,0],i.zu=void 0!==r.offsetOrigin?r.offsetOrigin:av,i._o=null,i.W=void 0!==r.size?r.size:null,i}return pv(n,t),n.prototype.clone=function(){var t=this.getScale();return new n({anchor:this.xe.slice(),anchorOrigin:this.Pu,anchorXUnits:this.Cu,anchorYUnits:this.ku,color:this.Mu&&this.Mu.slice?this.Mu.slice():this.Mu||void 0,crossOrigin:this.Bt,imgSize:this.Iu,offset:this.Lu.slice(),offsetOrigin:this.zu,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.W?this.W.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},n.prototype.getAnchor=function(){var t=this.Au;if(!t){t=this.xe;var n=this.getSize();if(this.Cu==ev||this.ku==ev){if(!n)return null;t=this.xe.slice(),this.Cu==ev&&(t[0]*=n[0]),this.ku==ev&&(t[1]*=n[1])}if(this.Pu!=av){if(!n)return null;t===this.xe&&(t=this.xe.slice()),this.Pu!=hv&&this.Pu!=uv||(t[0]=-t[0]+n[0]),this.Pu!=sv&&this.Pu!=uv||(t[1]=-t[1]+n[1])}this.Au=t}var i=this.getDisplacement();return[t[0]-i[0],t[1]+i[1]]},n.prototype.setAnchor=function(t){this.xe=t,this.Au=null},n.prototype.getColor=function(){return this.Mu},n.prototype.getImage=function(t){return this.Nu.getImage(t)},n.prototype.getPixelRatio=function(t){return this.Nu.getPixelRatio(t)},n.prototype.getImageSize=function(){return this.Nu.getSize()},n.prototype.getImageState=function(){return this.Nu.getImageState()},n.prototype.getHitDetectionImage=function(){return this.Nu.getHitDetectionImage()},n.prototype.getOrigin=function(){if(this._o)return this._o;var t=this.Lu;if(this.zu!=av){var n=this.getSize(),i=this.Nu.getSize();if(!n||!i)return null;t=t.slice(),this.zu!=hv&&this.zu!=uv||(t[0]=i[0]-n[0]-t[0]),this.zu!=sv&&this.zu!=uv||(t[1]=i[1]-n[1]-t[1])}return this._o=t,this._o},n.prototype.getSrc=function(){return this.Nu.getSrc()},n.prototype.getSize=function(){return this.W?this.W:this.Nu.getSize()},n.prototype.listenImageChange=function(t){this.Nu.addEventListener(L,t)},n.prototype.load=function(){this.Nu.load()},n.prototype.unlistenImageChange=function(t){this.Nu.removeEventListener(L,t)},n}(Jl),mv=function(){function t(t){var n=t||{};this.Mu=void 0!==n.color?n.color:null,this.Ru=n.lineCap,this.Fu=void 0!==n.lineDash?n.lineDash:null,this.Gu=n.lineDashOffset,this.Du=n.lineJoin,this.qu=n.miterLimit,this.Uu=n.width}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.Mu},t.prototype.getLineCap=function(){return this.Ru},t.prototype.getLineDash=function(){return this.Fu},t.prototype.getLineDashOffset=function(){return this.Gu},t.prototype.getLineJoin=function(){return this.Du},t.prototype.getMiterLimit=function(){return this.qu},t.prototype.getWidth=function(){return this.Uu},t.prototype.setColor=function(t){this.Mu=t},t.prototype.setLineCap=function(t){this.Ru=t},t.prototype.setLineDash=function(t){this.Fu=t},t.prototype.setLineDashOffset=function(t){this.Gu=t},t.prototype.setLineJoin=function(t){this.Du=t},t.prototype.setMiterLimit=function(t){this.qu=t},t.prototype.setWidth=function(t){this.Uu=t},t}(),wv=function(){function t(t){var n=t||{};this.Hr=null,this.Bu=_v,void 0!==n.geometry&&this.setGeometry(n.geometry),this.lu=void 0!==n.fill?n.fill:null,this.Lt=void 0!==n.image?n.image:null,this.hn=void 0!==n.renderer?n.renderer:null,this.Xu=void 0!==n.hitDetectionRenderer?n.hitDetectionRenderer:null,this.pu=void 0!==n.stroke?n.stroke:null,this.eo=void 0!==n.text?n.text:null,this.Vu=n.zIndex}return t.prototype.clone=function(){var n=this.getGeometry();return n&&"object"==typeof n&&(n=n.clone()),new t({geometry:n,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.hn},t.prototype.setRenderer=function(t){this.hn=t},t.prototype.setHitDetectionRenderer=function(t){this.Xu=t},t.prototype.getHitDetectionRenderer=function(){return this.Xu},t.prototype.getGeometry=function(){return this.Hr},t.prototype.getGeometryFunction=function(){return this.Bu},t.prototype.getFill=function(){return this.lu},t.prototype.setFill=function(t){this.lu=t},t.prototype.getImage=function(){return this.Lt},t.prototype.setImage=function(t){this.Lt=t},t.prototype.getStroke=function(){return this.pu},t.prototype.setStroke=function(t){this.pu=t},t.prototype.getText=function(){return this.eo},t.prototype.setText=function(t){this.eo=t},t.prototype.getZIndex=function(){return this.Vu},t.prototype.setGeometry=function(t){"function"==typeof t?this.Bu=t:"string"==typeof t?this.Bu=function(n){return n.get(t)}:t?void 0!==t&&(this.Bu=function(){return t}):this.Bu=_v,this.Hr=t},t.prototype.setZIndex=function(t){this.Vu=t},t}();function gv(t){var n;if("function"==typeof t)n=t;else{var i;if(Array.isArray(t))i=t;else St("function"==typeof t.getZIndex,41),i=[t];n=function(){return i}}return n}var bv=null;function xv(t,n){if(!bv){var i=new rv({color:"rgba(255,255,255,0.4)"}),r=new mv({color:"#3399CC",width:1.25});bv=[new wv({image:new iv({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return bv}function Mv(){var t={},n=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new wv({fill:new rv({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new wv({stroke:new mv({color:n,width:5})}),new wv({stroke:new mv({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new wv({image:new iv({radius:6,fill:new rv({color:i}),stroke:new mv({color:n,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function _v(t){return t.getGeometry()}var Sv=wv,Ov="point",jv="line",Ev=function(){function t(t){var n=t||{};this.Wu=n.font,this.Dr=n.rotation,this.su=n.rotateWithView,this.uu=n.scale,this.au=Qu(void 0!==n.scale?n.scale:1),this.eo=n.text,this.Yu=n.textAlign,this.Zu=n.justify,this.$u=n.textBaseline,this.lu=void 0!==n.fill?n.fill:new rv({color:"#333"}),this.Ku=void 0!==n.maxAngle?n.maxAngle:Math.PI/4,this.Hu=void 0!==n.placement?n.placement:Ov,this.Ju=!!n.overflow,this.pu=void 0!==n.stroke?n.stroke:null,this.Qu=void 0!==n.offsetX?n.offsetX:0,this.ta=void 0!==n.offsetY?n.offsetY:0,this.na=n.backgroundFill?n.backgroundFill:null,this.ia=n.backgroundStroke?n.backgroundStroke:null,this.Ai=void 0===n.padding?null:n.padding}return t.prototype.clone=function(){var n=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.Ju},t.prototype.getFont=function(){return this.Wu},t.prototype.getMaxAngle=function(){return this.Ku},t.prototype.getPlacement=function(){return this.Hu},t.prototype.getOffsetX=function(){return this.Qu},t.prototype.getOffsetY=function(){return this.ta},t.prototype.getFill=function(){return this.lu},t.prototype.getRotateWithView=function(){return this.su},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.uu},t.prototype.getScaleArray=function(){return this.au},t.prototype.getStroke=function(){return this.pu},t.prototype.getText=function(){return this.eo},t.prototype.getTextAlign=function(){return this.Yu},t.prototype.getJustify=function(){return this.Zu},t.prototype.getTextBaseline=function(){return this.$u},t.prototype.getBackgroundFill=function(){return this.na},t.prototype.getBackgroundStroke=function(){return this.ia},t.prototype.getPadding=function(){return this.Ai},t.prototype.setOverflow=function(t){this.Ju=t},t.prototype.setFont=function(t){this.Wu=t},t.prototype.setMaxAngle=function(t){this.Ku=t},t.prototype.setOffsetX=function(t){this.Qu=t},t.prototype.setOffsetY=function(t){this.ta=t},t.prototype.setPlacement=function(t){this.Hu=t},t.prototype.setRotateWithView=function(t){this.su=t},t.prototype.setFill=function(t){this.lu=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.uu=t,this.au=Qu(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.pu=t},t.prototype.setText=function(t){this.eo=t},t.prototype.setTextAlign=function(t){this.Yu=t},t.prototype.setJustify=function(t){this.Zu=t},t.prototype.setTextBaseline=function(t){this.$u=t},t.prototype.setBackgroundFill=function(t){this.na=t},t.prototype.setBackgroundStroke=function(t){this.ia=t},t.prototype.setPadding=function(t){this.Ai=t},t}(),Tv=function(){function t(t){this.ra,this.ea,this.oa,this.sa=void 0===t||t,this.ua=0}return t.prototype.insertItem=function(t){var n={prev:void 0,next:void 0,data:t},i=this.oa;if(i){var r=i.next;n.prev=i,n.next=r,i.next=n,r&&(r.prev=n),i===this.ea&&(this.ea=n)}else this.ra=n,this.ea=n,this.sa&&(n.next=n,n.prev=n);this.oa=n,this.ua++},t.prototype.removeItem=function(){var t=this.oa;if(t){var n=t.next,i=t.prev;n&&(n.prev=i),i&&(i.next=n),this.oa=n||i,this.ra===this.ea?(this.oa=void 0,this.ra=void 0,this.ea=void 0):this.ra===t?this.ra=this.oa:this.ea===t&&(this.ea=i?this.oa.prev:this.oa),this.ua--}},t.prototype.firstItem=function(){if(this.oa=this.ra,this.oa)return this.oa.data},t.prototype.lastItem=function(){if(this.oa=this.ea,this.oa)return this.oa.data},t.prototype.nextItem=function(){if(this.oa&&this.oa.next)return this.oa=this.oa.next,this.oa.data},t.prototype.getNextItem=function(){if(this.oa&&this.oa.next)return this.oa.next.data},t.prototype.prevItem=function(){if(this.oa&&this.oa.prev)return this.oa=this.oa.prev,this.oa.data},t.prototype.getPrevItem=function(){if(this.oa&&this.oa.prev)return this.oa.prev.data},t.prototype.getCurrItem=function(){if(this.oa)return this.oa.data},t.prototype.setFirstItem=function(){this.sa&&this.oa&&(this.ra=this.oa,this.ea=this.oa.prev)},t.prototype.concat=function(t){if(t.oa){if(this.oa){var n=this.oa.next;this.oa.next=t.ra,t.ra.prev=this.oa,n.prev=t.ea,t.ea.next=n,this.ua+=t.ua}else this.oa=t.oa,this.ra=t.ra,this.ea=t.ea,this.ua=t.ua;t.oa=void 0,t.ra=void 0,t.ea=void 0,t.ua=0}},t.prototype.getLength=function(){return this.ua},t}(),Av=i(72),Pv=function(){function t(t){this.aa=new Av(t),this.ha={}}return t.prototype.insert=function(t,n){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:n};this.aa.insert(i),this.ha[o(n)]=i},t.prototype.load=function(t,n){for(var i=new Array(n.length),r=0,e=n.length;ri.highWaterMark&&(i.highWaterMark=t)},n.prototype.useTile=function(t,n,i,r){},n}(zv),Gv=function(t){function n(n,i){var r=t.call(this,n)||this;return r.tile=i,r}return Rv(n,t),n}(c),Dv=Fv,qv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Uv=function(t){function n(i){var r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,interpolate:i.interpolate,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return r.wa=r.tileUrlFunction===n.prototype.tileUrlFunction,r.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(r.tileUrlFunction=i.tileUrlFunction),r.urls=null,i.urls?r.setUrls(i.urls):i.url&&r.setUrl(i.url),r.ga={},r}return qv(n,t),n.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},n.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},n.prototype.getUrls=function(){return this.urls},n.prototype.handleTileChange=function(t){var n,i=t.target,r=o(i),e=i.getState();e==lt?(this.ga[r]=!0,n=Cv):r in this.ga&&(delete this.ga[r],n=e==dt?Iv:e==vt?kv:void 0),null!=n&&this.dispatchEvent(new Gv(n,i))},n.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},n.prototype.setTileUrlFunction=function(t,n){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==n?this.setKey(n):this.changed()},n.prototype.setUrl=function(t){var n=If(t);this.urls=n,this.setUrls(n)},n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.wa?this.setTileUrlFunction(Pf(t,this.tileGrid),n):this.setKey(n)},n.prototype.tileUrlFunction=function(t,n,i){},n.prototype.useTile=function(t,n,i){var r=jh(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(Dv),Bv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Xv(t,n){t.getImage().src=n}var Vv=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:Xv,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:n.wrapX,transition:n.transition,interpolate:r,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).crossOrigin=void 0!==n.crossOrigin?n.crossOrigin:null,i.tileClass=void 0!==n.tileClass?n.tileClass:ko,i.tileCacheForProjection={},i.tileGridForProjection={},i.ba=n.reprojectionErrorThreshold,i.xa=!1,i}return Bv(n,t),n.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},n.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==i?n:{}),this.tileCacheForProjection){var e=this.tileCacheForProjection[r];e.expireCache(e==i?n:{})}},n.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Sr(this.getProjection(),t)?0:this.getGutter()},n.prototype.getGutter=function(){return 0},n.prototype.getKey=function(){var n=t.prototype.getKey.call(this);return this.getInterpolate()||(n+=":disable-interpolation"),n},n.prototype.getOpaque=function(n){return!(this.getProjection()&&n&&!Sr(this.getProjection(),n))&&t.prototype.getOpaque.call(this,n)},n.prototype.getTileGridForProjection=function(t){var n=this.getProjection();if(!this.tileGrid||n&&!Sr(n,t)){var i=o(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Mf(t)),this.tileGridForProjection[i]}return this.tileGrid},n.prototype.getTileCacheForProjection=function(t){var n=this.getProjection();if(!n||Sr(n,t))return this.tileCache;var i=o(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Ih(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},n.prototype.Ma=function(t,n,i,r,e,o){var s=[t,n,i],u=this.getTileCoordForTileUrlFunction(s,e),a=u?this.tileUrlFunction(u,r,e):void 0,h=new this.tileClass(s,void 0!==a?ct:pt,void 0!==a?a:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(L,this.handleTileChange.bind(this)),h},n.prototype.getTile=function(t,n,i,r,e){var o=this.getProjection();if(o&&e&&!Sr(o,e)){var s=this.getTileCacheForProjection(e),u=[t,n,i],a=void 0,h=Eh(u);s.containsKey(h)&&(a=s.get(h));var f=this.getKey();if(a&&a.key==f)return a;var c=this.getTileGridForProjection(o),l=this.getTileGridForProjection(e),v=this.getTileCoordForTileUrlFunction(u,e),d=new Bc(o,c,e,l,u,v,this.getTilePixelRatio(r),this.getGutter(),function(t,n,i,r){return this.getTileInternal(t,n,i,r,o)}.bind(this),this.ba,this.xa,this.getInterpolate());return d.key=f,a?(d.interimTile=a,d.refreshInterimChain(),s.replace(h,d)):s.set(h,d),d}return this.getTileInternal(t,n,i,r,o||e)},n.prototype.getTileInternal=function(t,n,i,r,e){var o=null,s=jh(t,n,i),u=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=u){var a=o;o=this.Ma(t,n,i,r,e,u),a.getState()==ct?o.interimTile=a.interimTile:o.interimTile=a,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.Ma(t,n,i,r,e,u),this.tileCache.set(s,o);return o},n.prototype.setRenderReprojectionEdges=function(t){if(this.xa!=t){for(var n in this.xa=t,this.tileCacheForProjection)this.tileCacheForProjection[n].clear();this.changed()}},n.prototype.setTileGridForProjection=function(t,n){var i=yr(t);if(i){var r=o(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=n)}},n}(Uv),Wv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Yv(t){var n,i,r=t[0],e=new Array(r),o=1<>=1;return e.join("")}var Zv=function(t){function n(n){var i=this,r=void 0!==n.hidpi&&n.hidpi,e=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(e=n.interpolate),(i=t.call(this,{cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:e,opaque:!0,projection:yr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:"loading",tileLoadFunction:n.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this)._a=r,i.Sa=void 0!==n.culture?n.culture:"en-us",i.Oa=void 0!==n.maxZoom?n.maxZoom:-1,i.ja=n.key,i.Ea=n.imagerySet,Zh("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+i.Ea+"?uriScheme=https&include=ImageryProviders&key="+i.ja+"&c="+i.Sa,i.handleImageryMetadataResponse.bind(i),void 0,"jsonp"),i}return Wv(n,t),n.prototype.getApiKey=function(){return this.ja},n.prototype.getImagerySet=function(){return this.Ea},n.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var n=t.resourceSets[0].resources[0],i=-1==this.Oa?n.zoomMax:this.Oa,r=Tf(this.getProjection()),e=this._a?2:1,o=n.imageWidth==n.imageHeight?n.imageWidth/e:[n.imageWidth/e,n.imageHeight/e],s=Of({extent:r,minZoom:n.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=s;var u=this.Sa,a=this._a;if(this.tileUrlFunction=Cf(n.imageUrlSubdomains.map((function(t){var i=[0,0,0],r=n.imageUrl.replace("{subdomain}",t).replace("{culture}",u);return function(t,n,e){if(t){Oh(t[0],t[1],t[2],i);var o=r;return a&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",Yv(i))}}}))),n.imageryProviders){var h=Or(yr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],r=t.viewState,e=this.getTileGrid(),o=e.getZForResolution(r.resolution,this.zDirection),s=e.getTileCoordForCoordAndZ(r.center,o)[0];return n.imageryProviders.map((function(n){for(var r=!1,e=n.coverageAreas,o=0,u=e.length;o=a.zoomMin&&s<=a.zoomMax){var f=a.bbox;if(Kn(ni([f[1],f[0],f[3],f[2]],h),t.extent)){r=!0;break}}}r&&i.push(n.attribution)})),i.push('Terms of Use'),i}.bind(this))}this.setState("ready")}else this.setState("error")},n}(Vv),$v=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Kv=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=void 0!==r.projection?r.projection:"EPSG:3857",s=void 0!==r.tileGrid?r.tileGrid:Of({extent:Tf(o),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,opaque:r.opaque,projection:o,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this).js=void 0!==r.gutter?r.gutter:0,i}return $v(n,t),n.prototype.getGutter=function(){return this.js},n}(Vv),Hv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jv=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,maxZoom:void 0!==n.maxZoom?n.maxZoom:18,minZoom:n.minZoom,projection:n.projection,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection})||this;return i.Ta=n.account,i.Aa=n.map||"",i.Pa=n.config||{},i.Ca={},i.ka(),i}return Hv(n,t),n.prototype.getConfig=function(){return this.Pa},n.prototype.updateConfig=function(t){A(this.Pa,t),this.ka()},n.prototype.setConfig=function(t){this.Pa=t||{},this.ka()},n.prototype.ka=function(){var t=JSON.stringify(this.Pa);if(this.Ca[t])this.Ia(this.Ca[t]);else{var n="https://"+this.Ta+".carto.com/api/v1/map";this.Aa&&(n+="/named/"+this.Aa);var i=new XMLHttpRequest;i.addEventListener("load",this.Na.bind(this,t)),i.addEventListener("error",this.La.bind(this)),i.open("POST",n),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.Pa))}},n.prototype.Na=function(t,n){var i=n.target;if(!i.status||i.status>=200&&i.status<300){var r=void 0;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState("error")}this.Ia(r),this.Ca[t]=r,this.setState("ready")}else this.setState("error")},n.prototype.La=function(t){this.setState("error")},n.prototype.Ia=function(t){var n="https://"+t.cdn_url.https+"/"+this.Ta+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(n)},n}(Kv),Qv="addfeature",td="changefeature",nd="clear",id="removefeature",rd="featuresloadstart",ed="featuresloadend",od="featuresloaderror",sd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ud=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.feature=i,e.features=r,e}return sd(n,t),n}(c),ad=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===r.wrapX||r.wrapX})||this).on,i.once,i.un,i.U=j,i.ze=r.format,i.za=void 0===r.overlaps||r.overlaps,i.Fe=r.url,void 0!==r.loader?i.U=r.loader:void 0!==i.Fe&&(St(i.ze,7),i.U=Vh(i.Fe,i.ze)),i.Ra=void 0!==r.strategy?r.strategy:Wh;var e,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return i.Fa=s?new Pv:null,i.Ga=new Pv,i.Da=0,i.qa={},i.Ua={},i.Ba={},i.Xa={},i.Va=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(e=r.features).getArray()),s||void 0!==e||(e=new ft(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==e&&i.Wa(e),i}return sd(n,t),n.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},n.prototype.addFeatureInternal=function(t){var n=o(t);if(this.Ya(n,t)){this.Za(n,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.Fa&&this.Fa.insert(r,t)}else this.qa[n]=t;this.dispatchEvent(new ud(Qv,t))}else this.Va&&this.Va.remove(t)},n.prototype.Za=function(t,n){this.Xa[t]=[$(n,L,this.$a,this),$(n,l,this.$a,this)]},n.prototype.Ya=function(t,n){var i=!0,r=n.getId();return void 0!==r&&(r.toString()in this.Ua?i=!1:this.Ua[r.toString()]=n),i&&(St(!(t in this.Ba),30),this.Ba[t]=n),i},n.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},n.prototype.addFeaturesInternal=function(t){for(var n=[],i=[],r=[],e=0,s=t.length;e0},n.prototype.refresh=function(){this.clear(!0),this.Ga.clear(),t.prototype.refresh.call(this)},n.prototype.removeLoadedExtent=function(t){var n,i=this.Ga;i.forEachInExtent(t,(function(i){if(An(i.extent,t))return n=i,!0})),n&&i.remove(n)},n.prototype.removeFeature=function(t){if(t){var n=o(t);n in this.qa?delete this.qa[n]:this.Fa&&this.Fa.remove(t),this.removeFeatureInternal(t)&&this.changed()}},n.prototype.removeFeatureInternal=function(t){var n=o(t),i=this.Xa[n];if(i){i.forEach(H),delete this.Xa[n];var r=t.getId();return void 0!==r&&delete this.Ua[r.toString()],delete this.Ba[n],this.dispatchEvent(new ud(id,t)),t}},n.prototype.Ka=function(t){var n=!1;for(var i in this.Ua)if(this.Ua[i]===t){delete this.Ua[i],n=!0;break}return n},n.prototype.setLoader=function(t){this.U=t},n.prototype.setUrl=function(t){St(this.ze,7),this.Fe=t,this.setLoader(Vh(t,this.ze))},n}(zv),hd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fd=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,wrapX:n.wrapX})||this;return i.resolution=void 0,i.distance=void 0!==n.distance?n.distance:20,i.minDistance=n.minDistance||0,i.interpolationRatio=0,i.features=[],i.geometryFunction=n.geometryFunction||function(t){var n=t.getGeometry();return St("Point"==n.getType(),10),n},i.Ha=n.createCluster,i.source=null,i.Ja=i.refresh.bind(i),i.updateDistance(i.distance,i.minDistance),i.setSource(n.source||null),i}return hd(n,t),n.prototype.clear=function(n){this.features.length=0,t.prototype.clear.call(this,n)},n.prototype.getDistance=function(){return this.distance},n.prototype.getSource=function(){return this.source},n.prototype.loadFeatures=function(t,n,i){this.source.loadFeatures(t,n,i),n!==this.resolution&&(this.resolution=n,this.refresh())},n.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},n.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},n.prototype.getMinDistance=function(){return this.minDistance},n.prototype.setSource=function(t){this.source&&this.source.removeEventListener(L,this.Ja),this.source=t,t&&t.addEventListener(L,this.Ja),this.refresh()},n.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},n.prototype.updateDistance=function(t,n){var i=0===t?0:Math.min(n,t)/t,r=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=n,this.interpolationRatio=i,r&&this.refresh()},n.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],n=this.distance*this.resolution,i=this.source.getFeatures(),r={},e=0,s=i.length;e=0;--r){var e=this.geometryFunction(t[r]);e?Vi(i,e.getCoordinates()):t.splice(r,1)}Ji(i,1/t.length);var o=qn(n),s=this.interpolationRatio,u=new Se([i[0]*(1-s)+o[0]*s,i[1]*(1-s)+o[1]*s]);return this.Ha?this.Ha(u,t):new Et({geometry:u,features:t})},n}(ad),cd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ld=function(t){function n(n){var i=this,r=void 0===n.projection?"EPSG:3857":n.projection,e=n.tileGrid;if(void 0===e&&r&&(e=Of({extent:Tf(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize})),(i=t.call(this,{cacheSize:.1,attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:r,tileGrid:e,opaque:n.opaque,state:n.state,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate})||this).js=void 0!==n.gutter?n.gutter:0,i.jo=n.tileSize?Qu(n.tileSize):null,!i.jo&&n.tilePixelRatio&&e){var o=Qu(e.getTileSize(0));i.jo=[o[0]*n.tilePixelRatio,o[1]*n.tilePixelRatio]}return i.Oo=null,i.ga={},i.U=n.loader,i.cr=i.cr.bind(i),i.bandCount=void 0===n.bandCount?4:n.bandCount,i}return cd(n,t),n.prototype.setTileSizes=function(t){this.Oo=t},n.prototype.getTileSize=function(t){if(this.Oo)return this.Oo[t];if(this.jo)return this.jo;var n=this.getTileGrid();return n?Qu(n.getTileSize(t)):[256,256]},n.prototype.getGutterForProjection=function(t){return this.js},n.prototype.setLoader=function(t){this.U=t},n.prototype.getTile=function(t,n,i,r,e){var o=this.getTileSize(t),s=jh(t,n,i);if(this.tileCache.containsKey(s))return this.tileCache.get(s);var u=this.U;var a=A({tileCoord:[t,n,i],loader:function(){return T((function(){return u(t,n,i)}))},size:o},this.tileOptions),h=new _t(a);return h.key=this.getKey(),h.addEventListener(L,this.cr),this.tileCache.set(s,h),h},n.prototype.cr=function(t){var n,i=t.target,r=o(i),e=i.getState();e==lt?(this.ga[r]=!0,n=Cv):r in this.ga&&(delete this.ga[r],n=e==dt?Iv:e==vt?kv:void 0),n&&this.dispatchEvent(new Gv(n,i))},n}(Dv);const vd=new ArrayBuffer(4),dd=new Float32Array(vd),pd=new Uint32Array(vd),yd=new Uint32Array(512),md=new Uint32Array(512);for(let t=0;t<256;++t){const n=t-127;n<-27?(yd[t]=0,yd[256|t]=32768,md[t]=24,md[256|t]=24):n<-14?(yd[t]=1024>>-n-14,yd[256|t]=1024>>-n-14|32768,md[t]=-n-1,md[256|t]=-n-1):n<=15?(yd[t]=n+15<<10,yd[256|t]=n+15<<10|32768,md[t]=13,md[256|t]=13):n<128?(yd[t]=31744,yd[256|t]=64512,md[t]=24,md[256|t]=24):(yd[t]=31744,yd[256|t]=64512,md[t]=13,md[256|t]=13)}const wd=new Uint32Array(2048),gd=new Uint32Array(64),bd=new Uint32Array(64);wd[0]=0;for(let t=1;t<1024;++t){let n=t<<13,i=0;for(;0==(8388608&n);)i-=8388608,n<<=1;n&=-8388609,i+=947912704,wd[t]=n|i}for(let t=1024;t<2048;++t)wd[t]=939524096+(t-1024<<13);gd[0]=0;for(let t=1;t<31;++t)gd[t]=t<<23;gd[31]=1199570944,gd[32]=2147483648;for(let t=33;t<63;++t)gd[t]=2147483648+(t-32<<23);gd[63]=3347054592,bd[0]=0;for(let t=1;t<64;++t)bd[t]=32===t?0:1024;function xd(t){const n=t>>10;return pd[0]=wd[bd[n]+(1023&t)]+gd[n],dd[0]}const Md=Reflect.getPrototypeOf(Uint8Array).prototype,_d=Reflect.getOwnPropertyDescriptor(Md,Symbol.toStringTag).get;function Sd(t){return void 0!==_d.call(t)}const Od=Object.prototype.toString;function jd(t){return!!ArrayBuffer.isView(t)&&(!Sd(t)&&"[object DataView]"===Od.call(t))}function Ed(t,n){if(!jd(t))throw new TypeError("First argument to getFloat16 function must be a DataView");for(var i=arguments.length,r=new Array(i>2?i-2:0),e=2;eCd.set(t,n)))}async function Id(t){const n=Cd.get(t.Compression);if(!n)throw new Error(`Unknown compression method identifier: ${t.Compression}`);return new(await n())(t)}function Nd(t,n,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(t).constructor)(n*i*r)}function Ld(t,n,i,r,e){const o=n/r,s=i/e;return t.map((t=>{const u=Nd(t,r,e);for(let a=0;a{const u=Nd(t,r,e);for(let a=0;ai.e(226).then(i.bind(i,966)).then((t=>t.default)))),kd(5,(()=>i.e(611).then(i.bind(i,611)).then((t=>t.default)))),kd(6,(()=>{throw new Error("old style JPEG compression is not supported.")})),kd(7,(()=>i.e(382).then(i.bind(i,382)).then((t=>t.default)))),kd([8,32946],(()=>Promise.all([i.e(247),i.e(356)]).then(i.bind(i,356)).then((t=>t.default)))),kd(32773,(()=>i.e(395).then(i.bind(i,395)).then((t=>t.default)))),kd(34887,(()=>Promise.all([i.e(247),i.e(54)]).then(i.bind(i,54)).then((t=>t.default)))),kd(50001,(()=>i.e(629).then(i.bind(i,629)).then((t=>t.default))));var Ud=class{constructor(t,n,i,r,e,o){this.fileDirectory=t,this.geoKeys=n,this.dataView=i,this.littleEndian=r,this.tiles=e?{}:null,this.isTiled=!t.StripOffsets;const s=t.PlanarConfiguration;if(this.planarConfiguration=void 0===s?1:s,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let n=0;n=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(n){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(t,n){return Ed(this,t,n)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,n){return qd(this.getSampleFormat(t),this.getBitsPerSample(t),n)}async getTileOrStrip(t,n,i,r,e){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let u;const{tiles:a}=this;let h,f;1===this.planarConfiguration?u=n*o+t:2===this.planarConfiguration&&(u=i*o*s+n*o+t),this.isTiled?(h=this.fileDirectory.TileOffsets[u],f=this.fileDirectory.TileByteCounts[u]):(h=this.fileDirectory.StripOffsets[u],f=this.fileDirectory.StripByteCounts[u]);const c=(await this.source.fetch([{offset:h,length:f}],e))[0];let l;return null!==a&&a[u]?l=a[u]:(l=(async()=>{let t=await r.decode(this.fileDirectory,c);const i=this.getSampleFormat(),e=this.getBitsPerSample();return function(t,n){return(1!==t&&2!==t||!(n<=32)||n%8!=0)&&(3!==t||16!==n&&32!==n&&64!==n)}(i,e)&&(t=function(t,n,i,r,e,o,s){const u=new DataView(t),a=2===i?1:r,h=qd(n,e,2===i?s*o:s*o*r),f=parseInt("1".repeat(e),2);if(1===n){let t;t=1===i?r*e:e;let n=o*t;0!=(7&n)&&(n=n+7&-8);for(let t=0;t>8-e-v&f;else if(v+e<=16)h[c]=u.getUint16(l)>>16-e-v&f;else if(v+e<=24){const t=u.getUint16(l)<<8|u.getUint8(l+2);h[c]=t>>24-e-v&f}else h[c]=u.getUint32(l)>>32-e-v&f}}}}return h.buffer}(t,i,this.planarConfiguration,this.getSamplesPerPixel(),e,this.getTileWidth(),this.getBlockHeight(n))),t})(),null!==a&&(a[u]=l)),{x:t,y:n,sample:i,data:await l}}async _readRaster(t,n,i,r,e,o,s,u,a){const h=this.getTileWidth(),f=this.getTileHeight(),c=this.getWidth(),l=this.getHeight(),v=Math.max(Math.floor(t[0]/h),0),d=Math.min(Math.ceil(t[2]/h),Math.ceil(c/h)),p=Math.max(Math.floor(t[1]/f),0),y=Math.min(Math.ceil(t[3]/f),Math.ceil(l/f)),m=t[2]-t[0];let w=this.getBytesPerPixel();const g=[],b=[];for(let t=0;t{const o=e.data,s=new DataView(o),u=this.getBlockHeight(e.y),a=e.y*f,d=e.x*h,p=a+u,y=(e.x+1)*h,x=b[v],_=Math.min(u,u-(p-t[3]),l-a),S=Math.min(h,h-(y-t[2]),c-d);for(let e=Math.max(0,t[1]-a);e<_;++e)for(let o=Math.max(0,t[0]-d);o6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(s.toLowerCase()){case"nearest":return Fd(t,n,i,r,e,o);case"bilinear":case"linear":return Gd(t,n,i,r,e,o);default:throw new Error(`Unsupported resampling method: '${s}'`)}}(i,t[2]-t[0],t[3]-t[1],o,s,n.length,u):function(t,n,i,r,e){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(o.toLowerCase()){case"nearest":return Ld(t,n,i,r,e);case"bilinear":case"linear":return Rd(t,n,i,r,e);default:throw new Error(`Unsupported resampling method: '${o}'`)}}(i,t[2]-t[0],t[3]-t[1],o,s,u),e.width=o,e.height=s,e}return i.width=o||t[2]-t[0],i.height=s||t[3]-t[1],i}async readRasters(){let{window:t,samples:n=[],interleave:i,pool:r=null,width:e,height:o,resampleMethod:s,fillValue:u,signal:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const h=t||[0,0,this.getWidth(),this.getHeight()];if(h[0]>h[2]||h[1]>h[3])throw new Error("Invalid subsets");const f=(h[2]-h[0])*(h[3]-h[1]),c=this.getSamplesPerPixel();if(n&&n.length){for(let t=0;t=c)return Promise.reject(new RangeError(`Invalid sample index '${n[t]}'.`))}else for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};const a=t||[0,0,this.getWidth(),this.getHeight()];if(a[0]>a[2]||a[1]>a[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===Pd.Ie.RGB){let a=[0,1,2];if(this.fileDirectory.ExtraSamples!==Pd.pd.Unspecified&&s){a=[];for(let t=0;t>24)/500+u,h=u-(t[n+2]<<24>>24)/200;a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),u=1*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),h=1.08883*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),e=3.2406*a+-1.5372*u+-.4986*h,o=-.9689*a+1.8758*u+.0415*h,s=.0557*a+-.204*u+1.057*h,e=e>.0031308?1.055*e**(1/2.4)-.055:12.92*e,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,r[i]=255*Math.max(0,Math.min(1,e)),r[i+1]=255*Math.max(0,Math.min(1,o)),r[i+2]=255*Math.max(0,Math.min(1,s))}return r}(v);break;default:throw new Error("Unsupported photometric interpretation.")}if(!n){const t=new Uint8Array(p.length/3),n=new Uint8Array(p.length/3),i=new Uint8Array(p.length/3);for(let r=0,e=0;r0&&void 0!==arguments[0]?arguments[0]:null;const n={};if(!this.fileDirectory.GDAL_METADATA)return null;const i=this.fileDirectory.GDAL_METADATA;let r=Ad(i,"Item");r=null===t?r.filter((t=>void 0===Td(t,"sample"))):r.filter((n=>Number(Td(n,"sample"))===t));for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:null;const n=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(i)return[i[0],i[5],i[10]];if(t){const[n,i,r]=t.getResolution();return[n*t.getWidth()/this.getWidth(),i*t.getHeight()/this.getHeight(),r*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(){const t=this.getOrigin(),n=this.getResolution(),i=t[0],r=t[1],e=i+n[0]*this.getWidth(),o=r+n[1]*this.getHeight();return[Math.min(i,e),Math.min(r,o),Math.max(i,e),Math.max(r,o)]}};class Bd{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,n){const i=this.getUint32(t,n),r=this.getUint32(t+4,n);let e;if(n){if(e=i+2**32*r,!Number.isSafeInteger(e))throw new Error(`${e} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return e}if(e=2**32*i+r,!Number.isSafeInteger(e))throw new Error(`${e} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return e}getInt64(t,n){let i=0;const r=(128&this._dataView.getUint8(t+(n?7:0)))>0;let e=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(t+(n?o:7-o));r&&(e?0!==s&&(s=255&~(s-1),e=!1):s=255&~s),i+=s*256**o}return r&&(i=-i),i}getUint8(t,n){return this._dataView.getUint8(t,n)}getInt8(t,n){return this._dataView.getInt8(t,n)}getUint16(t,n){return this._dataView.getUint16(t,n)}getInt16(t,n){return this._dataView.getInt16(t,n)}getUint32(t,n){return this._dataView.getUint32(t,n)}getInt32(t,n){return this._dataView.getInt32(t,n)}getFloat16(t,n){return Ed(this._dataView,t,n)}getFloat32(t,n){return this._dataView.getFloat32(t,n)}getFloat64(t,n){return this._dataView.getFloat64(t,n)}}class Xd{constructor(t,n,i,r){this._dataView=new DataView(t),this._sliceOffset=n,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,n){return this.sliceOffset<=t&&this.sliceTop>=t+n}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const n=this.readUint32(t),i=this.readUint32(t+4);let r;if(this._littleEndian){if(r=n+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*n+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(t){let n=0;const i=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0;let r=!0;for(let e=0;e<8;e++){let o=this._dataView.getUint8(t+(this._littleEndian?e:7-e));i&&(r?0!==o&&(o=255&~(o-1),r=!1):o=255&~o),n+=o*256**e}return i&&(n=-n),n}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const Vd="\r\n\r\n";function Wd(t){if(void 0!==Object.fromEntries)return Object.fromEntries(t);const n={};for(const[i,r]of t)n[i.toLowerCase()]=r;return n}function Yd(t){return Wd(t.split("\r\n").map((t=>{const n=t.split(":").map((t=>t.trim()));return n[0]=n[0].toLowerCase(),n})))}function Zd(t){let n,i,r;return t&&([,n,i,r]=t.match(/bytes (\d+)-(\d+)\/(\d+)/),n=parseInt(n,10),i=parseInt(i,10),r=parseInt(r,10)),{start:n,end:i,total:r}}class $d{async fetch(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return Promise.all(t.map((t=>this.fetchSlice(t,n))))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}var Kd=i(875);function Hd(t,n){const i=Array.isArray(t)?t:Array.from(t),r=Array.isArray(n)?n:Array.from(n);return i.map(((t,n)=>[t,r[n]]))}class Jd extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Jd),this.name="AbortError"}}class Qd extends Error{constructor(t,n){super(n),this.errors=t,this.message=n,this.name="AggregateError"}}const tp=Qd;class np{constructor(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.offset=t,this.length=n,this.data=i}get top(){return this.offset+this.length}}class ip{constructor(t,n,i){this.offset=t,this.length=n,this.blockIds=i}}class rp extends $d{constructor(t){let{blockSize:n=65536,cacheSize:i=100}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.source=t,this.blockSize=n,this.blockCache=new Kd({max:i}),this.blockRequests=new Map,this.blockIdsToFetch=new Set}get fileSize(){return this.source.fileSize}async fetch(t,n){const i=new Map,r=new Map,e=new Set;for(const{offset:n,length:o}of t){let t=n+o;const{fileSize:s}=this;null!==s&&(t=Math.min(t,s));for(let o=Math.floor(n/this.blockSize)*this.blockSize;osetTimeout(n,t)))}(),this.fetchBlocks(n);for(const t of e){const n=this.blockRequests.get(t),e=this.blockCache.get(t);if(n)r.set(t,n);else{if(!e)throw new Error(`Block ${t} is not in the block requests`);i.set(t,e)}}let o=await Promise.allSettled(Array.from(r.values()));if(o.some((t=>"rejected"===t.status))){const t=new Set;for(const[i,e]of Hd(r.keys(),o)){const{rejected:r,reason:o}=e;r&&"AbortError"===o.name&&o.signal!==n&&(this.blockIdsToFetch.add(i),t.add(i))}if(this.blockIdsToFetch.length>0){this.fetchBlocks(n);for(const n of t){const t=this.blockRequests.get(n);if(!t)throw new Error(`Block ${n} is not in the block requests`);r.set(n,t)}o=await Promise.allSettled(Array.from(r.values()))}}if(o.some((t=>"rejected"===t.status))){if(n&&n.aborted)throw new Jd("Request was aborted");throw new tp(o.filter((t=>"rejected"===t.status)).map((t=>t.reason)),"Request failed")}const s=o.map((t=>t.value)),u=new Map(Hd(Array.from(r.keys()),s));for(const[t,n]of i)u.set(t,n);return this.readSliceData(t,u)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const n=this.groupBlocks(this.blockIdsToFetch),i=this.source.fetch(n,t);for(let r=0;r{try{const t=(await i)[r],e=n*this.blockSize,o=e-t.offset,s=Math.min(o+this.blockSize,t.data.byteLength),u=t.data.slice(o,s),a=new np(e,u.byteLength,u);return this.blockCache.set(n,a),a}catch(n){throw"AbortError"===n.name&&(n.signal=t),n}finally{this.blockRequests.delete(n)}})();this.blockRequests.set(n,e)}}this.blockIdsToFetch.clear()}}groupBlocks(t){const n=Array.from(t).sort(((t,n)=>t-n));if(0===n.length)return[];let i=[],r=null;const e=[];for(const t of n)null===r||r+1===t?(i.push(t),r=t):(e.push(new ip(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[t],r=t);return e.push(new ip(i[0]*this.blockSize,i.length*this.blockSize,i)),e}readSliceData(t,n){return t.map((t=>{const i=t.offset+t.length,r=Math.floor(t.offset/this.blockSize),e=Math.floor((t.offset+t.length)/this.blockSize),o=new ArrayBuffer(t.length),s=new Uint8Array(o);for(let o=r;o<=e;++o){const r=n.get(o),e=r.offset-t.offset,u=r.top-i;let a,h=0,f=0;e<0?h=-e:e>0&&(f=e),a=u<0?r.length-h:i-r.offset-h;const c=new Uint8Array(r.data,h,a);s.set(c,f)}return o}))}}class ep{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class op{constructor(t){this.url=t}async request(){let{headers:t,credentials:n,signal:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};throw new Error("request is not implemented")}}class sp extends ep{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class up extends op{constructor(t,n){super(t),this.credentials=n}async request(){let{headers:t,credentials:n,signal:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=await fetch(this.url,{headers:t,credentials:n,signal:i});return new sp(r)}}class ap extends ep{constructor(t,n){super(),this.xhr=t,this.data=n}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class hp extends op{constructRequest(t,n){return new Promise(((i,r)=>{const e=new XMLHttpRequest;e.open("GET",this.url),e.responseType="arraybuffer";for(const[n,i]of Object.entries(t))e.setRequestHeader(n,i);e.onload=()=>{const t=e.response;i(new ap(e,t))},e.onerror=r,e.onabort=()=>r(new Jd("Request aborted")),e.send(),n&&(n.aborted&&e.abort(),n.addEventListener("abort",(()=>e.abort())))}))}async request(){let{headers:t,signal:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await this.constructRequest(t,n)}}var fp=i(752),cp=i(640),lp=i(630);class vp extends ep{constructor(t,n){super(),this.response=t,this.dataPromise=n}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class dp extends op{constructor(t){super(t),this.parsedUrl=lp.parse(this.url),this.httpApi="http:"===this.parsedUrl.protocol?fp:cp}constructRequest(t,n){return new Promise(((i,r)=>{const e=this.httpApi.get({...this.parsedUrl,headers:t},(t=>{const n=new Promise((n=>{const i=[];t.on("data",(t=>{i.push(t)})),t.on("end",(()=>{const t=Buffer.concat(i).buffer;n(t)})),t.on("error",r)}));i(new vp(t,n))}));e.on("error",r),n&&(n.aborted&&e.destroy(new Jd("Request aborted")),n.addEventListener("abort",(()=>e.destroy(new Jd("Request aborted")))))}))}async request(){let{headers:t,signal:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await this.constructRequest(t,n)}}class pp extends $d{constructor(t,n,i,r){super(),this.client=t,this.headers=n,this.maxRanges=i,this.allowFullFile=r,this._fileSize=null}async fetch(t,n){return this.maxRanges>=t.length?this.fetchSlices(t,n):(this.maxRanges>0&&t.length,Promise.all(t.map((t=>this.fetchSlice(t,n)))))}async fetchSlices(t,n){const i=await this.client.request({headers:{...this.headers,Range:`bytes=${t.map((t=>{let{offset:n,length:i}=t;return`${n}-${n+i}`})).join(",")}`},signal:n});if(i.ok){if(206===i.status){const{type:r,params:e}=function(t){const[n,...i]=t.split(";").map((t=>t.trim()));return{type:n,params:Wd(i.map((t=>t.split("="))))}}(i.getHeader("content-type"));if("multipart/byteranges"===r){const t=function(t,n){let i=null;const r=new TextDecoder("ascii"),e=[],o=`--${n}`,s=`${o}--`;for(let n=0;n<10;++n)r.decode(new Uint8Array(t,n,o.length))===o&&(i=n);if(null===i)throw new Error("Could not find initial boundary");for(;i1){const i=await Promise.all(t.slice(1).map((t=>this.fetchSlice(t,n))));return h.concat(i)}return h}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await i.getData();return this._fileSize=t.byteLength,[{data:t,offset:0,length:t.byteLength}]}}throw new Error("Error fetching data.")}async fetchSlice(t,n){const{offset:i,length:r}=t,e=await this.client.request({headers:{...this.headers,Range:`bytes=${i}-${i+r}`},signal:n});if(e.ok){if(206===e.status){const t=await e.getData(),{total:n}=Zd(e.getHeader("content-range"));return this._fileSize=n||null,{data:t,offset:i,length:r}}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await e.getData();return this._fileSize=t.byteLength,{data:t,offset:0,length:t.byteLength}}}throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function yp(t,n){let{blockSize:i,cacheSize:r}=n;return null===i?t:new rp(t,i,r)}function mp(t){let{headers:n={},credentials:i,maxRanges:r=0,allowFullFile:e=!1,...o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=new up(t,i),u=new pp(s,n,r,e);return yp(u,o)}function wp(t){let{headers:n={},maxRanges:i=0,allowFullFile:r=!1,...e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=new hp(t),s=new pp(o,n,i,r);return yp(s,e)}function gp(t){let{headers:n={},maxRanges:i=0,allowFullFile:r=!1,...e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=new dp(t),s=new pp(o,n,i,r);return yp(s,e)}function bp(t){let{forceXHR:n=!1,...i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"function"!=typeof fetch||n?"undefined"!=typeof XMLHttpRequest?wp(t,i):gp(t,i):mp(t,i)}class xp extends $d{constructor(t){super(),this.file=t}async fetchSlice(t,n){return new Promise(((i,r)=>{const e=this.file.slice(t.offset,t.offset+t.length),o=new FileReader;o.onload=t=>i(t.target.result),o.onerror=r,o.onabort=r,o.readAsArrayBuffer(e),n&&n.addEventListener("abort",(()=>o.abort()))}))}}function Mp(t){switch(t){case Pd.sf.BYTE:case Pd.sf.ASCII:case Pd.sf.SBYTE:case Pd.sf.UNDEFINED:return 1;case Pd.sf.SHORT:case Pd.sf.SSHORT:return 2;case Pd.sf.LONG:case Pd.sf.SLONG:case Pd.sf.FLOAT:case Pd.sf.IFD:return 4;case Pd.sf.RATIONAL:case Pd.sf.SRATIONAL:case Pd.sf.DOUBLE:case Pd.sf.LONG8:case Pd.sf.SLONG8:case Pd.sf.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${t}`)}}function _p(t,n,i,r){let e=null,o=null;const s=Mp(n);switch(n){case Pd.sf.BYTE:case Pd.sf.ASCII:case Pd.sf.UNDEFINED:e=new Uint8Array(i),o=t.readUint8;break;case Pd.sf.SBYTE:e=new Int8Array(i),o=t.readInt8;break;case Pd.sf.SHORT:e=new Uint16Array(i),o=t.readUint16;break;case Pd.sf.SSHORT:e=new Int16Array(i),o=t.readInt16;break;case Pd.sf.LONG:case Pd.sf.IFD:e=new Uint32Array(i),o=t.readUint32;break;case Pd.sf.SLONG:e=new Int32Array(i),o=t.readInt32;break;case Pd.sf.LONG8:case Pd.sf.IFD8:e=new Array(i),o=t.readUint64;break;case Pd.sf.SLONG8:e=new Array(i),o=t.readInt64;break;case Pd.sf.RATIONAL:e=new Uint32Array(2*i),o=t.readUint32;break;case Pd.sf.SRATIONAL:e=new Int32Array(2*i),o=t.readInt32;break;case Pd.sf.FLOAT:e=new Float32Array(i),o=t.readFloat32;break;case Pd.sf.DOUBLE:e=new Float64Array(i),o=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${n}`)}if(n!==Pd.sf.RATIONAL&&n!==Pd.sf.SRATIONAL)for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:{};const{window:n,width:i,height:r}=t;let{resX:e,resY:o,bbox:s}=t;const u=await this.getImage();let a=u;const h=await this.getImageCount(),f=u.getBoundingBox();if(n&&s)throw new Error('Both "bbox" and "window" passed.');if(i||r){if(n){const[t,i]=u.getOrigin(),[r,e]=u.getResolution();s=[t+n[0]*r,i+n[1]*e,t+n[2]*r,i+n[3]*e]}const t=s||f;if(i){if(e)throw new Error("Both width and resX passed");e=(t[2]-t[0])/i}if(r){if(o)throw new Error("Both width and resY passed");o=(t[3]-t[1])/r}}if(e||o){const t=[];for(let n=0;nt.getWidth()-n.getWidth()));for(let n=0;nr||o&&o>s)break}}let c=n;if(s){const[t,n]=u.getOrigin(),[i,r]=a.getResolution(u);c=[Math.round((s[0]-t)/i),Math.round((s[1]-n)/r),Math.round((s[2]-t)/i),Math.round((s[3]-n)/r)],c=[Math.min(c[0],c[2]),Math.min(c[1],c[3]),Math.max(c[0],c[2]),Math.max(c[1],c[3])]}return a.readRasters({...t,window:c})}}class Ep extends jp{constructor(t,n,i,r){let e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(),this.source=t,this.littleEndian=n,this.bigTiff=i,this.firstIFDOffset=r,this.cache=e.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,n){const i=this.bigTiff?4048:1024;return new Xd((await this.source.fetch([{offset:t,length:void 0!==n?n:i}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const n=this.bigTiff?20:12,i=this.bigTiff?8:2;let r=await this.getSlice(t);const e=this.bigTiff?r.readUint64(t):r.readUint16(t),o=e*n+(this.bigTiff?16:6);r.covers(t,o)||(r=await this.getSlice(t,o));const s={};let u=t+(this.bigTiff?8:2);for(let t=0;t{const n=await this.ifdRequests[t-1];if(0===n.nextIFDByteOffset)throw new Op(t);return this.parseFileDirectoryAt(n.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const n=await this.requestIFD(t);return new Ud(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,n=!0;for(;n;)try{await this.requestIFD(t),++t}catch(t){if(!(t instanceof Op))throw t;n=!1}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const n="GDAL_STRUCTURAL_METADATA_SIZE=",i=n.length+100;let r=await this.getSlice(t,i);if(n===_p(r,Pd.sf.ASCII,n.length,t)){const n=_p(r,Pd.sf.ASCII,i,t).split("\n")[0],e=Number(n.split("=")[1].split(" ")[0])+n.length;e>i&&(r=await this.getSlice(t,e));const o=_p(r,Pd.sf.ASCII,e,t);this.ghostValues={},o.split("\n").filter((t=>t.length>0)).map((t=>t.split("="))).forEach((t=>{let[n,i]=t;this.ghostValues[n]=i}))}return this.ghostValues}static async fromSource(t,n,i){const r=(await t.fetch([{offset:0,length:1024}],i))[0],e=new Bd(r),o=e.getUint16(0,0);let s;if(18761===o)s=!0;else{if(19789!==o)throw new TypeError("Invalid byte order value.");s=!1}const u=e.getUint16(2,s);let a;if(42===u)a=!1;else{if(43!==u)throw new TypeError("Invalid magic number.");a=!0;if(8!==e.getUint16(4,s))throw new Error("Unsupported offset byte-size.")}const h=a?e.getUint64(8,s):e.getUint32(4,s);return new Ep(t,s,a,h,n)}close(){return"function"==typeof this.source.close&&this.source.close()}}class Tp extends jp{constructor(t,n){super(),this.mainFile=t,this.overviewFiles=n,this.imageFiles=[t].concat(n),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((t=>t.parseFileDirectoryAt(t.firstIFDOffset))));return this.fileDirectoriesPerFile=await Promise.all(t),this.fileDirectoriesPerFile}async getImage(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;await this.getImageCount(),await this.parseFileDirectoriesPerFile();let n=0,i=0;for(let r=0;rt.getImageCount())));return this.imageCounts=await Promise.all(t),this.imageCount=this.imageCounts.reduce(((t,n)=>t+n),0),this.imageCount}}async function Ap(t,n){return Ep.fromSource(new xp(t),n)}const Pp="undefined"!=typeof navigator&&navigator.hardwareConcurrency||2;var Cp,kp=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pp,n=arguments.length>1?arguments[1]:void 0;this.workers=null,this._awaitingDecoder=null,this.size=t,this.messageId=0,t&&(this._awaitingDecoder=n?Promise.resolve(n):new Promise((t=>{i.e(231).then(i.bind(i,231)).then((n=>{t(n.create)}))})),this._awaitingDecoder.then((n=>{this._awaitingDecoder=null,this.workers=[];for(let i=0;ii.decode(t,n))):new Promise((i=>{const r=this.workers.find((t=>t.idle))||this.workers[Math.floor(Math.random()*this.size)];r.idle=!1;const e=this.messageId++,o=t=>{t.data.id===e&&(r.idle=!0,i(t.data.decoded),r.worker.removeEventListener("message",o))};r.worker.addEventListener("message",o),r.worker.postMessage({fileDirectory:t,buffer:n,id:e},[n])}))}destroy(){this.workers&&(this.workers.forEach((t=>{t.worker.terminate()})),this.workers=null)}},Ip=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Np="STATISTICS_MAXIMUM",Lp="STATISTICS_MINIMUM";function zp(t){try{return t.getBoundingBox()}catch(i){var n=t.fileDirectory;return[0,0,n.ImageWidth,n.ImageLength]}}function Rp(t){try{return t.getOrigin().slice(0,2)}catch(n){return[0,t.fileDirectory.ImageLength]}}function Fp(t,n){try{return t.getResolution(n)}catch(i){return[n.fileDirectory.ImageWidth/t.fileDirectory.ImageWidth,n.fileDirectory.ImageHeight/t.fileDirectory.ImageHeight]}}function Gp(t){var n=t.geoKeys;if(!n)return null;if(n.ProjectedCSTypeGeoKey){if(!(r=yr(i="EPSG:"+n.ProjectedCSTypeGeoKey)))(e=Nt(n.ProjLinearUnitsGeoKey))&&(r=new ei({code:i,units:e}));return r}if(n.GeographicTypeGeoKey){var i,r,e;if(!(r=yr(i="EPSG:"+n.GeographicTypeGeoKey)))(e=Nt(n.GeogAngularUnitsGeoKey))&&(r=new ei({code:i,units:e}));return r}return null}function Dp(t){return t.getImageCount().then((function(n){for(var i=new Array(n),r=0;r1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const e=await Ep.fromSource(bp(t,i),r),o=await Promise.all(n.map((t=>Ep.fromSource(bp(t,i)))));return new Tp(e,o)}(t.url,t.overviews,n):async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return Ep.fromSource(bp(t,n),i)}(t.url,n)).then(Dp)}function Up(t,n,i,r,e){if(Array.isArray(t)){var o=t.length;if(!Array.isArray(n)||o!=n.length){var s=new Error(r);throw e(s),s}for(var u=0;ui*t)throw new Error(r)}function Bp(t){return t instanceof Int8Array?-128:t instanceof Int16Array?-32768:t instanceof Int32Array?-2147483648:t instanceof Float32Array?12e-39:0}function Xp(t){return t instanceof Int8Array?127:t instanceof Uint8Array||t instanceof Uint8ClampedArray?255:t instanceof Int16Array?32767:t instanceof Uint16Array?65535:t instanceof Int32Array?2147483647:t instanceof Uint32Array?4294967295:t instanceof Float32Array?34e37:255}var Vp=function(t){function n(n){var i=t.call(this,{state:"loading",tileGrid:null,projection:null,opaque:n.opaque,transition:n.transition,interpolate:!1!==n.interpolate,wrapX:n.wrapX})||this;i.Qa=n.sources;var r=i.Qa.length;i.th=n.sourceOptions,i.nh=new Array(r),i.ih=new Array(r),i.rh,i.eh,i.oh,i.sh=!1!==n.normalize,i.uh=!1,i.V=null,i.ah=n.convertToRGB?"readRGB":"readRasters",i.setKey(i.Qa.map((function(t){return t.url})).join(","));for(var e=i,o=new Array(r),s=0;sw.length&&(h=o.length-w.length);var T=o[o.length-1]/w[w.length-1];l.ih[f]=T;var A=w.map((function(t){return t*T}));E="Resolution mismatch for source ".concat(f,", got [").concat(A,"] but expected [").concat(o,"]");Up(o.slice(h,o.length),A,.02,E,l.viewRejector)}else o=w,l.ih[f]=1;r?Up(r.slice(h,r.length),m,.01,"Tile size mismatch for source ".concat(f),l.viewRejector):r=m,e?Up(e.slice(h,e.length),y,0,"Tile size mismatch for source ".concat(f),l.viewRejector):e=y,l.nh[f]=c.reverse()},l=this,v=0;v=0;--d){var w=Gp(m[d]);if(w){this.projection=w;break}}}this.rh=s,this.eh=u,this.oh=a;t:for(v=0;vl||h>l;)f.push([Math.ceil(a/l),Math.ceil(h/l)]),l+=l;break;case $p:for(var v=a,d=h;v>l||d>l;)f.push([Math.ceil(v/l),Math.ceil(d/l)]),v>>=1,d>>=1;break;default:St(!1,53)}f.push([1,1]),f.reverse();for(var p=[u],y=[0],m=1,w=f.length;m1,r=i&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],e=i&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=i&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:Jp(Jp([],n.supports,!0),r,!0),formats:Jp(Jp([],n.formats,!0),e,!0),qualities:Jp(Jp([],n.qualities,!0),o,!0)}},sy[ny]=function(t){var n=t.getComplianceLevelSupportedFeatures(),i=void 0===t.imageInfo.extraFormats?n.formats:Jp(Jp([],n.formats,!0),t.imageInfo.extraFormats,!0),r=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return y(["jpg","png","gif"],t)})).reduce((function(t,n){return void 0===t&&y(i,n)?n:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?n.supports:Jp(Jp([],n.supports,!0),t.imageInfo.extraFeatures,!0),formats:i,qualities:void 0===t.imageInfo.extraQualities?n.qualities:Jp(Jp([],n.qualities,!0),t.imageInfo.extraQualities,!0),preferredFormat:r}};var uy=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var n=0;n0&&"string"==typeof this.imageInfo.profile[0]&&ey.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var n=this.getComplianceLevelEntryFromProfile(t);if(void 0!==n){var i=n.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),n=this.getComplianceLevelFromProfile(t);return void 0===n?iy.none.none:iy[t][n]}},t.prototype.getTileSourceOptions=function(t){var n=t||{},i=this.getImageApiVersion();if(void 0!==i){var r=void 0===i?void 0:sy[i](this);if(void 0!==r)return{url:r.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:void 0!==n.format&&y(r.formats,n.format)?n.format:void 0!==r.preferredFormat?r.preferredFormat:"jpg",supports:r.supports,quality:n.quality&&y(r.qualities,n.quality)?n.quality:y(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort((function(t,n){return n-t})):void 0,tileSize:r.tileSize}}},t}(),ay=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function hy(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var fy=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.url||"";o+=o.lastIndexOf("/")===o.length-1||""===o?"":"/";var s=r.version||ty,u=r.sizes||[],a=r.size;St(null!=a&&Array.isArray(a)&&2==a.length&&!isNaN(a[0])&&a[0]>0&&!isNaN(a[1])&&a[1]>0,60);var h,f,c,l=a[0],v=a[1],d=r.tileSize,p=r.tilePixelRatio||1,m=r.format||"jpg",w=r.quality||(r.version==Qp?"native":"default"),g=r.resolutions||[],b=r.supports||[],x=r.extent||[0,-v,l,0],M=null!=u&&Array.isArray(u)&&u.length>0,_=void 0!==d&&("number"==typeof d&&Number.isInteger(d)&&d>0||Array.isArray(d)&&d.length>0),S=null!=b&&Array.isArray(b)&&(y(b,"regionByPx")||y(b,"regionByPct"))&&(y(b,"sizeByWh")||y(b,"sizeByH")||y(b,"sizeByW")||y(b,"sizeByPct"));if(g.sort((function(t,n){return n-t})),_||S)if(null!=d&&("number"==typeof d&&Number.isInteger(d)&&d>0?(h=d,f=d):Array.isArray(d)&&d.length>0&&((1==d.length||null==d[1]&&Number.isInteger(d[0]))&&(h=d[0],f=d[0]),2==d.length&&(Number.isInteger(d[0])&&Number.isInteger(d[1])?(h=d[0],f=d[1]):null==d[0]&&Number.isInteger(d[1])&&(h=d[1],f=d[1])))),void 0!==h&&void 0!==f||(h=Pu,f=Pu),0==g.length)for(var O=c=Math.max(Math.ceil(Math.log(l/h)/Math.LN2),Math.ceil(Math.log(v/f)/Math.LN2));O>=0;O--)g.push(Math.pow(2,O));else{var j=Math.max.apply(Math,g);c=Math.round(Math.log(j)/Math.LN2)}else if(h=l,f=v,g=[],M){u.sort((function(t,n){return t[0]-n[0]})),c=-1;var E=[];for(O=0;O0&&g[g.length-1]==T?E.push(O):(g.push(T),c++)}if(E.length>0)for(O=0;Oc)){var d=t[1],p=t[2],x=g[a];if(!(void 0===d||void 0===p||void 0===x||d<0||Math.ceil(l/x/h)<=d||p<0||Math.ceil(v/x/f)<=p)){if(S||_){var O=d*h*x,j=p*f*x,E=h*x,T=f*x,A=h,P=f;if(O+E>l&&(E=l-O),j+T>v&&(T=v-j),O+h*x>l&&(A=Math.floor((l-O+x-1)/x)),j+f*x>v&&(P=Math.floor((v-j+x-1)/x)),0==O&&E==l&&0==j&&T==v)r="full";else if(!S||y(b,"regionByPx"))r=O+","+j+","+E+","+T;else if(y(b,"regionByPct")){r="pct:"+hy(O/l*100)+","+hy(j/v*100)+","+hy(E/l*100)+","+hy(T/v*100)}s!=ny||S&&!y(b,"sizeByWh")?!S||y(b,"sizeByW")?e=A+",":y(b,"sizeByH")?e=","+P:y(b,"sizeByWh")?e=A+","+P:y(b,"sizeByPct")&&(e="pct:"+hy(100/x)):e=A+","+P}else if(r="full",M){var C=u[a][0],k=u[a][1];e=s==ny?C==l&&k==v?"max":C+","+k:C==l?"full":C+","}else e=s==ny?"max":"full";return o+r+"/"+e+"/0/"+w+"."+m}}},transition:r.transition})||this).zDirection=r.zDirection,i}return ay(n,t),n}(Vv),cy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ly=function(t){function n(n,i,r,e,o,s,u){var a=this,h=n.getExtent(),f=i.getExtent(),c=f?Wn(r,f):r,l=mf(n,i,qn(c),e),v=new qc(n,i,c,h,.5*l,e),d=s(v.calculateSourceExtent(),l,o),p=d?lo:mo,y=d?d.getPixelRatio():1;return(a=t.call(this,r,e,y,p)||this).vs=i,a.ps=h,a.Is=v,a.wi=e,a.dh=r,a.ph=d,a.yh=y,a.da=u,a.qt=null,a.mh=null,a}return cy(n,t),n.prototype.disposeInternal=function(){this.state==vo&&this.wh(),t.prototype.disposeInternal.call(this)},n.prototype.getImage=function(){return this.qt},n.prototype.getProjection=function(){return this.vs},n.prototype.Ns=function(){var t=this.ph.getState();if(t==po){var n=$n(this.dh)/this.wi,i=Vn(this.dh)/this.wi;this.qt=gf(n,i,this.yh,this.ph.getResolution(),this.ps,this.wi,this.dh,this.Is,[{extent:this.ph.getExtent(),image:this.ph.getImage()}],0,void 0,this.da)}this.state=t,this.changed()},n.prototype.load=function(){if(this.state==lo){this.state=vo,this.changed();var t=this.ph.getState();t==po||t==yo?this.Ns():(this.mh=$(this.ph,L,(function(t){var n=this.ph.getState();n!=po&&n!=yo||(this.wh(),this.Ns())}),this),this.ph.load())}},n.prototype.wh=function(){H(this.mh),this.mh=null},n}(co),vy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dy="imageloadstart",py="imageloadend",yy="imageloaderror",my=function(t){function n(n,i){var r=t.call(this,n)||this;return r.image=i,r}return vy(n,t),n}(c);function wy(t,n){t.getImage().src=n}var gy=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,projection:n.projection,state:n.state,interpolate:r})||this).on,i.once,i.un,i.Ti=void 0!==n.resolutions?n.resolutions:null,i.gh=null,i.bh=0,i}return vy(n,t),n.prototype.getResolutions=function(){return this.Ti},n.prototype.findNearestResolution=function(t){if(this.Ti){var n=m(this.Ti,t,0);t=this.Ti[n]}return t},n.prototype.getImage=function(t,n,i,r){var e=this.getProjection();if(e&&r&&!Sr(e,r)){if(this.gh){if(this.bh==this.getRevision()&&Sr(this.gh.getProjection(),r)&&this.gh.getResolution()==n&&An(this.gh.getExtent(),t))return this.gh;this.gh.dispose(),this.gh=null}return this.gh=new ly(e,r,t,n,i,function(t,n,i){return this.getImageInternal(t,n,i,e)}.bind(this),this.getInterpolate()),this.bh=this.getRevision(),this.gh}return e&&(r=e),this.getImageInternal(t,n,i,r)},n.prototype.getImageInternal=function(t,n,i,e){return r()},n.prototype.handleImageChange=function(t){var n,i=t.target;switch(i.getState()){case vo:this.loading=!0,n=dy;break;case po:this.loading=!1,n=py;break;case yo:this.loading=!1,n=yy;break;default:return}this.hasListener(n)&&this.dispatchEvent(new my(n,i))},n}(zv),by=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xy=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i._a=void 0===r.hidpi||r.hidpi,i.Fe=r.url,i.Rt=void 0!==r.imageLoadFunction?r.imageLoadFunction:wy,i.xh=r.params||{},i.Lt=null,i.Mh=[0,0],i._h=0,i.Sh=void 0!==r.ratio?r.ratio:1.5,i}return by(n,t),n.prototype.getParams=function(){return this.xh},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Fe)return null;n=this.findNearestResolution(n),i=this._a?i:1;var e=this.Lt;if(e&&this._h==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&xn(e.getExtent(),t))return e;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};A(o,this.xh);var s=((t=t.slice())[0]+t[2])/2,u=(t[1]+t[3])/2;if(1!=this.Sh){var a=this.Sh*$n(t)/2,h=this.Sh*Vn(t)/2;t[0]=s-a,t[1]=u-h,t[2]=s+a,t[3]=u+h}var f=n/i,c=Math.ceil($n(t)/f),l=Math.ceil(Vn(t)/f);t[0]=s-f*c/2,t[2]=s+f*c/2,t[1]=u-f*l/2,t[3]=u+f*l/2,this.Mh[0]=c,this.Mh[1]=l;var v=this.Oh(t,this.Mh,i,r,o);return this.Lt=new bo(t,n,i,v,this.Bt,this.Rt),this._h=this.getRevision(),this.Lt.addEventListener(L,this.handleImageChange.bind(this)),this.Lt},n.prototype.getImageLoadFunction=function(){return this.Rt},n.prototype.Oh=function(t,n,i,r,e){var o=r.getCode().split(/:(?=\d+$)/).pop();e.SIZE=n[0]+","+n[1],e.BBOX=t.join(","),e.BBOXSR=o,e.IMAGESR=o,e.DPI=Math.round(90*i);var s=this.Fe,u=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return u==s&&St(!1,50),Nf(u,e)},n.prototype.getUrl=function(){return this.Fe},n.prototype.setImageLoadFunction=function(t){this.Lt=null,this.Rt=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Fe&&(this.Fe=t,this.Lt=null,this.changed())},n.prototype.updateParams=function(t){A(this.xh,t),this.Lt=null,this.changed()},n}(gy),My=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_y=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).jh=r.canvasFunction,i.qt=null,i._h=0,i.Sh=void 0!==r.ratio?r.ratio:1.5,i}return My(n,t),n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n);var e=this.qt;if(e&&this._h==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&xn(e.getExtent(),t))return e;Qn(t=t.slice(),this.Sh);var o=[$n(t)/n*i,Vn(t)/n*i],s=this.jh.call(this,t,n,i,o,r);return s&&(e=new Mo(t,n,i,s)),this.qt=e,this._h=this.getRevision(),e},n}(gy),Sy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var Oy=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{interpolate:r,projection:n.projection,resolutions:n.resolutions})||this).Bt=void 0!==n.crossOrigin?n.crossOrigin:null,i.Eh=void 0!==n.displayDpi?n.displayDpi:96,i.xh=n.params||{},i.Fe=n.url,i.Rt=void 0!==n.imageLoadFunction?n.imageLoadFunction:wy,i._a=void 0===n.hidpi||n.hidpi,i.dt=void 0!==n.metersPerUnit?n.metersPerUnit:1,i.Sh=void 0!==n.ratio?n.ratio:1,i.Th=void 0!==n.useOverlay&&n.useOverlay,i.Lt=null,i._h=0,i}return Sy(n,t),n.prototype.getParams=function(){return this.xh},n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n),i=this._a?i:1;var e=this.Lt;if(e&&this._h==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&xn(e.getExtent(),t))return e;1!=this.Sh&&Qn(t=t.slice(),this.Sh);var o=[$n(t)/n*i,Vn(t)/n*i];if(void 0!==this.Fe){var s=this.getUrl(this.Fe,this.xh,t,o,r);(e=new bo(t,n,i,s,this.Bt,this.Rt)).addEventListener(L,this.handleImageChange.bind(this))}else e=null;return this.Lt=e,this._h=this.getRevision(),e},n.prototype.getImageLoadFunction=function(){return this.Rt},n.prototype.updateParams=function(t){A(this.xh,t),this.changed()},n.prototype.getUrl=function(t,n,i,r,e){var o=function(t,n,i,r){var e=$n(t),o=Vn(t),s=n[0],u=n[1],a=.0254/r;return u*e>s*o?e*i/(s*a):o*i/(u*a)}(i,r,this.dt,this.Eh),s=qn(i),u={OPERATION:this.Th?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.Eh,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return A(u,n),Nf(t,u)},n.prototype.setImageLoadFunction=function(t){this.Lt=null,this.Rt=t,this.changed()},n}(gy),jy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ey=function(t){function n(n){var i=this,r=void 0!==n.crossOrigin?n.crossOrigin:null,e=void 0!==n.imageLoadFunction?n.imageLoadFunction:wy,o=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(o=n.interpolate),(i=t.call(this,{attributions:n.attributions,interpolate:o,projection:yr(n.projection)})||this).Fe=n.url,i.Ah=n.imageExtent,i.Lt=new bo(i.Ah,void 0,1,i.Fe,r,e),i.Mh=n.imageSize?n.imageSize:null,i.Lt.addEventListener(L,i.handleImageChange.bind(i)),i}return jy(n,t),n.prototype.getImageExtent=function(){return this.Ah},n.prototype.getImageInternal=function(t,n,i,r){return Kn(t,this.Lt.getExtent())?this.Lt:null},n.prototype.getUrl=function(){return this.Fe},n.prototype.handleImageChange=function(n){if(this.Lt.getState()==po){var i=this.Lt.getExtent(),r=this.Lt.getImage(),e=void 0,o=void 0;this.Mh?(e=this.Mh[0],o=this.Mh[1]):(e=r.width,o=r.height);var s=$n(i),u=Vn(i),a=s/e,h=u/o,f=e,c=o;if(a>h?f=Math.round(s/h):c=Math.round(u/a),f!==e||c!==o){var l=_o(f,c);this.getInterpolate()||A(l,lf);var v=l.canvas;l.drawImage(r,0,0,e,o,0,0,v.width,v.height),this.Lt.setImage(v)}}t.prototype.handleImageChange.call(this,n)},n}(gy),Ty="1.3.0",Ay=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Py=[101,101],Cy=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i.Fe=r.url,i.Rt=void 0!==r.imageLoadFunction?r.imageLoadFunction:wy,i.xh=r.params||{},i.Ph=!0,i.Ch(),i.kh=r.serverType,i._a=void 0===r.hidpi||r.hidpi,i.Lt=null,i.Mh=[0,0],i._h=0,i.Sh=void 0!==r.ratio?r.ratio:1.5,i}return Ay(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){if(void 0!==this.Fe){var e=yr(i),o=this.getProjection();o&&o!==e&&(n=mf(o,e,t,n),t=Er(t,e,o));var s=Bn(t,n,0,Py),u={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xh.LAYERS};A(u,this.xh,r);var a=mi((t[0]-s[0])/n,4),h=mi((s[3]-t[1])/n,4);return u[this.Ph?"I":"X"]=a,u[this.Ph?"J":"Y"]=h,this.Oh(s,Py,1,o||e,u)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.Fe){var i={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xh.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return A(i,n),Nf(this.Fe,i)}},n.prototype.getParams=function(){return this.xh},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Fe)return null;n=this.findNearestResolution(n),1==i||this._a&&void 0!==this.kh||(i=1);var e=n/i,o=qn(t),s=Bn(o,e,0,[wi($n(t)/e,4),wi(Vn(t)/e,4)]),u=Bn(o,e,0,[wi(this.Sh*$n(t)/e,4),wi(this.Sh*Vn(t)/e,4)]),a=this.Lt;if(a&&this._h==this.getRevision()&&a.getResolution()==n&&a.getPixelRatio()==i&&xn(a.getExtent(),s))return a;var h={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};A(h,this.xh),this.Mh[0]=yi($n(u)/e,4),this.Mh[1]=yi(Vn(u)/e,4);var f=this.Oh(u,this.Mh,i,r,h);return this.Lt=new bo(u,n,i,f,this.Bt,this.Rt),this._h=this.getRevision(),this.Lt.addEventListener(L,this.handleImageChange.bind(this)),this.Lt},n.prototype.getImageLoadFunction=function(){return this.Rt},n.prototype.Oh=function(t,n,i,r,e){if(St(void 0!==this.Fe,9),e[this.Ph?"CRS":"SRS"]=r.getCode(),"STYLES"in this.xh||(e.STYLES=""),1!=i)switch(this.kh){case"geoserver":var o=90*i+.5|0;"FORMAT_OPTIONS"in e?e.FORMAT_OPTIONS+=";dpi:"+o:e.FORMAT_OPTIONS="dpi:"+o;break;case"mapserver":e.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":e.DPI=90*i;break;default:St(!1,8)}e.WIDTH=n[0],e.HEIGHT=n[1];var s,u=r.getAxisOrientation();return s=this.Ph&&"ne"==u.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,e.BBOX=s.join(","),Nf(this.Fe,e)},n.prototype.getUrl=function(){return this.Fe},n.prototype.setImageLoadFunction=function(t){this.Lt=null,this.Rt=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Fe&&(this.Fe=t,this.Lt=null,this.changed())},n.prototype.updateParams=function(t){A(this.xh,t),this.Ch(),this.Lt=null,this.changed()},n.prototype.Ch=function(){var t=this.xh.VERSION||Ty;this.Ph=Xi(t,"1.3")>=0},n}(gy),ky={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},Iy={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function Ny(t,n){for(var i,r,e=0;el.maxTileCol||h.tileRowl.maxTileRow)return}A(h,T);var v=i.replace(/\{(\w+?)\}/g,(function(t,n){return h[n]}));return Qh(P,v)}}}}function Ry(t){return Jh(t.url).then((function(n){return function(t,n){var i,r=n.tileMatrixSetLimits;if("map"===n.dataType)i=Ny(n.links,t.mediaType);else{if("vector"!==n.dataType)throw new Error('Expected tileset data type to be "map" or "vector"');i=Ly(n.links,t.mediaType,t.supportedMediaTypes)}if(n.tileMatrixSet)return zy(t,n.tileMatrixSet,i,r);var e=n.links.find((function(t){return"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===t.rel}));if(!e)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");var o=e.href;return Jh(Qh(t.url,o)).then((function(n){return zy(t,n,i,r)}))}(t,n)}))}var Fy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gy=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:"loading",tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this,Ry({url:n.url,projection:i.getProjection(),mediaType:n.mediaType,context:n.context||null}).then(i.Ih.bind(i)).catch(i.Nh.bind(i)),i}return Fy(n,t),n.prototype.Ih=function(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")},n.prototype.Nh=function(t){console.error(t),this.setState("error")},n}(Vv),Dy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qy=function(t){function n(n){var i=this,r=n.projection||"EPSG:3857",e=n.extent||Tf(r),o=n.tileGrid||Of({extent:e,maxResolution:n.maxResolution,maxZoom:void 0!==n.maxZoom?n.maxZoom:22,minZoom:n.minZoom,tileSize:n.tileSize||512});return(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,interpolate:!0,opaque:!1,projection:r,state:n.state,tileGrid:o,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:Uy,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:void 0===n.zDirection?1:n.zDirection})||this).ze=n.format?n.format:null,i.sourceTileCache=new Ih(i.tileCache.highWaterMark),i.za=null==n.overlaps||n.overlaps,i.tileClass=n.tileClass?n.tileClass:qh,i.Lh={},i}return Dy(n,t),n.prototype.getFeaturesInExtent=function(t){var n=[],i=this.tileCache;if(0===i.getCount())return n;var r=Ah(i.peekFirstKey())[0],e=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===r&&i.getState()===vt)for(var o=i.getSourceTiles(),s=0,u=o.length;s=s.width)return null;var h=Vn(o),f=Math.floor(s.height*((o[3]-r[1])/h));return f<0||f>=s.height?null:this.getImageData(s,a,f)},n.prototype.renderFrame=function(t,n){var i=this.Lt,r=i.getExtent(),e=i.getResolution(),o=i.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],u=t.pixelRatio,a=t.viewState,h=a.center,f=u*e/(a.resolution*o),c=t.extent,l=a.resolution,v=a.rotation,d=Math.round($n(c)/l*u),p=Math.round(Vn(c)/l*u);sn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,v,-d/2,-p/2),un(this.inversePixelTransform,this.pixelTransform);var y=hn(this.pixelTransform);this.useContainer(n,y,this.getBackground(t));var m=this.context,w=m.canvas;w.width!=d||w.height!=p?(w.width=d,w.height=p):this.containerReused||m.clearRect(0,0,d,p);var g=!1,b=!0;if(s.extent){var x=Lr(s.extent,a.projection);(g=(b=Kn(x,t.extent))&&!xn(x,t.extent))&&this.clipUnrotated(m,t,x)}var M=i.getImage(),_=sn(this.tempTransform,d/2,p/2,f,f,0,o*(r[0]-h[0])/e,o*(h[1]-r[3])/e);this.renderedResolution=e*u/o;var S=M.width*_[0],O=M.height*_[3];if(this.getLayer().getSource().getInterpolate()||A(m,lf),this.preRender(m,t),b&&S>=.5&&O>=.5){var j=_[4],E=_[5],T=s.opacity,P=void 0;1!==T&&(P=m.globalAlpha,m.globalAlpha=T),m.drawImage(M,0,0,+M.width,+M.height,j,E,S,O),1!==T&&(m.globalAlpha=P)}return this.postRender(m,t),g&&m.restore(),A(m,vf),y!==w.style.transform&&(w.style.transform=y),this.container},n}(tm),rm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),em=function(t){function n(n){return t.call(this,n)||this}return rm(n,t),n.prototype.createRenderer=function(){return new im(this)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}($y),om="preload",sm="useInterimTilesOnError",um=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),am=function(t){function n(n){var i=this,r=n||{},e=A({},r);return delete e.preload,delete e.useInterimTilesOnError,(i=t.call(this,e)||this).on,i.once,i.un,i.setPreload(void 0!==r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i}return um(n,t),n.prototype.getPreload=function(){return this.get(om)},n.prototype.setPreload=function(t){this.set(om,t)},n.prototype.getUseInterimTilesOnError=function(){return this.get(sm)},n.prototype.setUseInterimTilesOnError=function(t){this.set(sm,t)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}(ls),hm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fm=function(t){function n(n){var i=t.call(this,n)||this;return i.extentChanged=!0,i.zh=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.Rh=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.Fh=new zh(0,0,0,0),i}return hm(n,t),n.prototype.isDrawableTile=function(t){var n=this.getLayer(),i=t.getState(),r=n.getUseInterimTilesOnError();return i==vt||i==pt||i==dt&&!r},n.prototype.getTile=function(t,n,i,r){var e=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),u=s.getSource().getTile(t,n,i,e,o);return u.getState()==dt&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.Rh=!0):u.setState(vt)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},n.prototype.getData=function(t){var n=this.frameState;if(!n)return null;var i=this.getLayer(),r=tn(n.pixelToCoordinateTransform,t.slice()),e=i.getExtent();if(e&&!bn(e,r))return null;for(var o=n.pixelRatio,s=n.viewState.projection,u=n.viewState,a=i.getRenderSource(),h=a.getTileGridForProjection(u.projection),f=a.getTilePixelRatio(n.pixelRatio),c=h.getZForResolution(u.resolution);c>=h.getMinZoom();--c){var l=h.getTileCoordForCoordAndZ(r,c),v=a.getTile(c,l[1],l[2],o,s);if(!(v instanceof ko||v instanceof Bc))return null;if(v.getState()===vt){var d=h.getOrigin(c),p=Qu(h.getTileSize(c)),y=h.getResolution(c),m=Math.floor(f*((r[0]-d[0])/y-l[1]*p[0])),w=Math.floor(f*((d[1]-r[1])/y-l[2]*p[1])),g=Math.round(f*a.getGutterForProjection(u.projection));return this.getImageData(v.getImage(),m+g,w+g)}}return null},n.prototype.loadedTileCallback=function(n,i,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,n,i,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var i=t.layerStatesArray[t.layerIndex],r=t.viewState,e=r.projection,s=r.resolution,u=r.center,a=r.rotation,h=t.pixelRatio,f=this.getLayer(),c=f.getSource(),l=c.getRevision(),v=c.getTileGridForProjection(e),d=v.getZForResolution(s,c.zDirection),y=v.getResolution(d),m=t.extent,w=t.viewState.resolution,g=c.getTilePixelRatio(h),b=Math.round($n(m)/w*h),x=Math.round(Vn(m)/w*h),M=i.extent&&Lr(i.extent,e);M&&(m=Wn(m,Lr(i.extent,e)));var _=y*b/2/g,S=y*x/2/g,O=[u[0]-_,u[1]-S,u[0]+_,u[1]+S],j=v.getTileRangeForExtentAndZ(m,d),E={};E[d]={};var T=this.createLoadedTileFinder(c,e,E),P=this.tmpExtent,C=this.Fh;this.Rh=!1;for(var k=a?Xn(r.center,w,a,t.size):void 0,I=j.minX;I<=j.maxX;++I)for(var N=j.minY;N<=j.maxY;++N)if(!a||v.tileCoordIntersectsViewport([d,I,N],k)){var L=this.getTile(d,I,N,t);if(this.isDrawableTile(L)){var z=o(this);if(L.getState()==vt)E[d][L.tileCoord.toString()]=L,(ot=L.inTransition(z))&&1!==i.opacity&&(L.endTransition(z),ot=!1),this.Rh||!ot&&-1!==this.renderedTiles.indexOf(L)||(this.Rh=!0);if(1===L.getAlpha(z,t.time))continue}var R=v.getTileCoordChildTileRange(L.tileCoord,C,P),F=!1;R&&(F=T(d+1,R)),F||v.forEachTileCoordParentTileRange(L.tileCoord,T,C,P)}var G=y/s*h/g;sn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,a,-b/2,-x/2);var D=hn(this.pixelTransform);this.useContainer(n,D,this.getBackground(t));var q=this.context,U=q.canvas;un(this.inversePixelTransform,this.pixelTransform),sn(this.tempTransform,b/2,x/2,G,G,0,-b/2,-x/2),U.width!=b||U.height!=x?(U.width=b,U.height=x):this.containerReused||q.clearRect(0,0,b,x),M&&this.clipUnrotated(q,t,M),c.getInterpolate()||A(q,lf),this.preRender(q,t),this.renderedTiles.length=0;var B,X,V,W=Object.keys(E).map(Number);W.sort(p),1!==i.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(B=[],X=[]):W=W.reverse();for(var Y=W.length-1;Y>=0;--Y){var Z=W[Y],$=c.getTilePixelSize(Z,h,e),K=v.getResolution(Z)/y,H=$[0]*K*G,J=$[1]*K*G,Q=v.getTileCoordForCoordAndZ(Yn(O),Z),tt=v.getTileCoordExtent(Q),nt=tn(this.tempTransform,[g*(tt[0]-O[0])/y,g*(O[3]-tt[3])/y]),it=g*c.getGutterForProjection(e),rt=E[Z];for(var et in rt){var ot,st=(L=rt[et]).tileCoord,ut=Q[1]-st[1],at=Math.round(nt[0]-(ut-1)*H),ht=Q[2]-st[2],ft=Math.round(nt[1]-(ht-1)*J),ct=at-(I=Math.round(nt[0]-ut*H)),lt=ft-(N=Math.round(nt[1]-ht*J)),dt=d===Z,pt=!1;if(!(ot=dt&&1!==L.getAlpha(o(this),t.time)))if(B){V=[I,N,I+ct,N,I+ct,N+lt,I,N+lt];for(var yt=0,mt=B.length;ytthis._maxQueueLength;)this._queue.shift().callback(null,null)},n.prototype._dispatch=function(){if(!this._running&&0!==this._queue.length){var t=this._queue.shift();this._job=t;var n=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map((function(t){return t.data.buffer})),e=this._workers.length;if(this._running=e,1!==e)for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/e),u=0;uStamen Design, under CC BY 3.0.',Wy],Cm={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},km={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},Im=function(t){function n(n){var i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var r=n.layer.indexOf("-"),e=-1==r?n.layer:n.layer.slice(0,r),o=km[e],s=Cm[n.layer],u=void 0!==n.url?n.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+n.layer+"/{z}/{x}/{y}."+s.extension;return t.call(this,{attributions:Pm,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:i,maxZoom:null!=n.maxZoom?n.maxZoom:o.maxZoom,minZoom:null!=n.minZoom?n.minZoom:o.minZoom,opaque:s.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:u,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Am(n,t),n}(Kv),Nm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lm=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).xh=r.params||{},i._a=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.setKey(i.$h()),i}return Nm(n,t),n.prototype.$h=function(){var t=0,n=[];for(var i in this.xh)n[t++]=i+"-"+this.xh[i];return n.join("/")},n.prototype.getParams=function(){return this.xh},n.prototype.Oh=function(t,n,i,r,e,o){var s=this.urls;if(s){var u,a=e.getCode().split(/:(?=\d+$)/).pop();if(o.SIZE=n[0]+","+n[1],o.BBOX=i.join(","),o.BBOXSR=a,o.IMAGESR=a,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)u=s[0];else u=s[vi(Ph(t),s.length)];return Nf(u.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},n.prototype.getTilePixelRatio=function(t){return this._a?t:1},n.prototype.updateParams=function(t){A(this.xh,t),this.setKey(this.$h())},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this._a||(n=1);var e=r.getTileCoordExtent(t,this.Ao),o=Qu(r.getTileSize(t[0]),this.tmpSize);1!=n&&(o=Ju(o,n,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return A(s,this.xh),this.Oh(t,o,e,n,i,s)}},n}(Vv),zm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rm=function(t){function n(n){var i=this,r=n||{};return i=t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection,url:r.template||"z:{z} x:{x} y:{y}",tileLoadFunction:function(t,n){var r=t.getTileCoord()[0],e=Qu(i.tileGrid.getTileSize(r)),o=_o(e[0],e[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,e[0]+.5,e[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,e[0]/2,e[1]/2,e[0]),o.fillText(n,e[0]/2,e[1]/2,e[0]),t.setImage(o.canvas)}})||this}return zm(n,t),n}(Kv),Fm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gm=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;if(void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:yr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:"loading",tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Kh=null,i.jo=n.tileSize,n.url)if(n.jsonp)Zh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var e=new XMLHttpRequest;e.addEventListener("load",i.Hh.bind(i)),e.addEventListener("error",i.Jh.bind(i)),e.open("GET",n.url),e.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):St(!1,51);return i}return Fm(n,t),n.prototype.Hh=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.Jh=function(t){this.handleTileJSONError()},n.prototype.getTileJSON=function(){return this.Kh},n.prototype.handleTileJSONResponse=function(t){var n,i=yr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Or(i,r);n=ni(t.bounds,e)}var o=Tf(r),s=t.minzoom||0,u=Of({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.jo});if(this.tileGrid=u,this.tileUrlFunction=Pf(t.tiles,u),void 0!==t.attribution&&!this.getAttributions()){var a=void 0!==n?n:o;this.setAttributions((function(n){return Kn(a,n.extent)?[t.attribution]:null}))}this.Kh=t,this.setState("ready")},n.prototype.handleTileJSONError=function(){this.setState("error")},n}(Vv),Dm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qm=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.params||{},s=!("TRANSPARENT"in o)||o.TRANSPARENT;return(i=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,opaque:!s,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).js=void 0!==r.gutter?r.gutter:0,i.xh=o,i.Ph=!0,i.kh=r.serverType,i._a=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.Ch(),i.setKey(i.$h()),i}return Dm(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){var e=yr(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(e));var u=s.getZForResolution(n,this.zDirection),a=s.getTileCoordForCoordAndZ(t,u);if(!(s.getResolutions().length<=a[0])){var h=s.getResolution(a[0]),f=s.getTileCoordExtent(a,this.Ao),c=Qu(s.getTileSize(a[0]),this.tmpSize),l=this.js;0!==l&&(c=Ku(c,l,this.tmpSize),f=mn(f,h*l,f)),o&&o!==e&&(h=mf(o,e,t,h),f=Tr(f,e,o),t=Er(t,e,o));var v={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xh.LAYERS};A(v,this.xh,r);var d=Math.floor((t[0]-f[0])/h),p=Math.floor((f[3]-t[1])/h);return v[this.Ph?"I":"X"]=d,v[this.Ph?"J":"Y"]=p,this.Oh(a,c,f,1,o||e,v)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.urls[0]){var i={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xh.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return A(i,n),Nf(this.urls[0],i)}},n.prototype.getGutter=function(){return this.js},n.prototype.getParams=function(){return this.xh},n.prototype.Oh=function(t,n,i,r,e,o){var s=this.urls;if(s){if(o.WIDTH=n[0],o.HEIGHT=n[1],o[this.Ph?"CRS":"SRS"]=e.getCode(),"STYLES"in this.xh||(o.STYLES=""),1!=r)switch(this.kh){case"geoserver":var u=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+u:o.FORMAT_OPTIONS="dpi:"+u;break;case"mapserver":o.MAP_RESOLUTION=90*r;break;case"carmentaserver":case"qgis":o.DPI=90*r;break;default:St(!1,52)}var a,h=e.getAxisOrientation(),f=i;if(this.Ph&&"ne"==h.substr(0,2)){var c=void 0;c=i[0],f[0]=i[1],f[1]=c,c=i[2],f[2]=i[3],f[3]=c}if(o.BBOX=f.join(","),1==s.length)a=s[0];else a=s[vi(Ph(t),s.length)];return Nf(a,o)}},n.prototype.getTilePixelRatio=function(t){return this._a&&void 0!==this.kh?t:1},n.prototype.$h=function(){var t=0,n=[];for(var i in this.xh)n[t++]=i+"-"+this.xh[i];return n.join("/")},n.prototype.updateParams=function(t){A(this.xh,t),this.Ch(),this.setKey(this.$h())},n.prototype.Ch=function(){var t=this.xh.VERSION||Ty;this.Ph=Xi(t,"1.3")>=0},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this._a&&void 0!==this.kh||(n=1);var e=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.Ao),s=Qu(r.getTileSize(t[0]),this.tmpSize),u=this.js;0!==u&&(s=Ku(s,u,this.tmpSize),o=mn(o,e*u,o)),1!=n&&(s=Ju(s,n,this.tmpSize));var a={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return A(a,this.xh),this.Oh(t,s,o,n,i,a)}},n}(Vv),Um=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bm=function(t){function n(n,i,r,e,o,s){var u=t.call(this,n,i)||this;return u.Nt=r,u.st=e,u.Qh=o,u.tf=null,u.nf=null,u.B=null,u.if=s,u}return Um(n,t),n.prototype.getImage=function(){return null},n.prototype.getData=function(t){if(!this.tf||!this.nf)return null;var n=(t[0]-this.st[0])/(this.st[2]-this.st[0]),i=(t[1]-this.st[1])/(this.st[3]-this.st[1]),r=this.tf[Math.floor((1-i)*this.tf.length)];if("string"!=typeof r)return null;var e=r.charCodeAt(Math.floor(n*r.length));e>=93&&e--,e>=35&&e--;var o=null;if((e-=32)in this.nf){var s=this.nf[e];o=this.B&&s in this.B?this.B[s]:s}return o},n.prototype.forDataAtCoordinate=function(t,n,i){this.state==pt&&!0===i?(this.state=ct,K(this,L,(function(i){n(this.getData(t))}),this),this.rf()):!0===i?setTimeout(function(){n(this.getData(t))}.bind(this),0):n(this.getData(t))},n.prototype.getKey=function(){return this.Nt},n.prototype.Nh=function(){this.state=dt,this.changed()},n.prototype.Ut=function(t){this.tf=t.grid,this.nf=t.keys,this.B=t.data,this.state=vt,this.changed()},n.prototype.rf=function(){if(this.state==ct)if(this.state=lt,this.if)Zh(this.Nt,this.Ut.bind(this),this.Nh.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.Hh.bind(this)),t.addEventListener("error",this.Jh.bind(this)),t.open("GET",this.Nt),t.send()}},n.prototype.Hh=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.Nh()}this.Ut(i)}else this.Nh()},n.prototype.Jh=function(t){this.Nh()},n.prototype.load=function(){this.Qh?this.rf():this.setState(pt)},n}(xt),Xm=function(t){function n(n){var i=t.call(this,{projection:yr("EPSG:3857"),state:"loading",zDirection:n.zDirection})||this;if(i.Qh=void 0===n.preemptive||n.preemptive,i.ef=kf,i.uf=void 0,i.if=n.jsonp||!1,n.url)if(i.if)Zh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var r=new XMLHttpRequest;r.addEventListener("load",i.Hh.bind(i)),r.addEventListener("error",i.Jh.bind(i)),r.open("GET",n.url),r.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):St(!1,51);return i}return Um(n,t),n.prototype.Hh=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.Jh=function(t){this.handleTileJSONError()},n.prototype.getTemplate=function(){return this.uf},n.prototype.forDataAtCoordinateAndResolution=function(t,n,i,r){if(this.tileGrid){var e=this.tileGrid.getZForResolution(n,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,e);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,i,r)}else!0===r?setTimeout((function(){i(null)}),0):i(null)},n.prototype.handleTileJSONError=function(){this.setState("error")},n.prototype.handleTileJSONResponse=function(t){var n,i=yr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Or(i,r);n=ni(t.bounds,e)}var o=Tf(r),s=t.minzoom||0,u=Of({extent:o,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=u,this.uf=t.template;var a=t.grids;if(a){if(this.ef=Pf(a,u),void 0!==t.attribution){var h=void 0!==n?n:o;this.setAttributions((function(n){return Kn(h,n.extent)?[t.attribution]:null}))}this.setState("ready")}else this.setState("error")},n.prototype.getTile=function(t,n,i,r,e){var o=jh(t,n,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,n,i],u=this.getTileCoordForTileUrlFunction(s,e),a=this.ef(u,r,e),h=new Bm(s,void 0!==a?ct:pt,void 0!==a?a:"",this.tileGrid.getTileCoordExtent(s),this.Qh,this.if);return this.tileCache.set(o,h),h},n.prototype.useTile=function(t,n,i){var r=jh(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(Dv),Vm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wm=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(r=n.interpolate);var e=void 0!==n.requestEncoding?n.requestEncoding:"KVP",o=n.tileGrid,s=n.urls;return void 0===s&&void 0!==n.url&&(s=If(n.url)),(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:o,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,urls:s,wrapX:void 0!==n.wrapX&&n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).af=void 0!==n.version?n.version:"1.0.0",i.ze=void 0!==n.format?n.format:"image/jpeg",i.hf=void 0!==n.dimensions?n.dimensions:{},i.Ds=n.layer,i.ff=n.matrixSet,i.H=n.style,i.cf=e,i.setKey(i.lf()),s&&s.length>0&&(i.tileUrlFunction=Cf(s.map(i.createFromWMTSTemplate.bind(i)))),i}return Vm(n,t),n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.setTileUrlFunction(Cf(t.map(this.createFromWMTSTemplate.bind(this))),n)},n.prototype.getDimensions=function(){return this.hf},n.prototype.getFormat=function(){return this.ze},n.prototype.getLayer=function(){return this.Ds},n.prototype.getMatrixSet=function(){return this.ff},n.prototype.getRequestEncoding=function(){return this.cf},n.prototype.getStyle=function(){return this.H},n.prototype.getVersion=function(){return this.af},n.prototype.lf=function(){var t=0,n=[];for(var i in this.hf)n[t++]=i+"-"+this.hf[i];return n.join("/")},n.prototype.updateDimensions=function(t){A(this.hf,t),this.setKey(this.lf())},n.prototype.createFromWMTSTemplate=function(t){var n=this.cf,i={layer:this.Ds,style:this.H,tilematrixset:this.ff};"KVP"==n&&A(i,{Service:"WMTS",Request:"GetTile",Version:this.af,Format:this.ze}),t="KVP"==n?Nf(t,i):t.replace(/\{(\w+?)\}/g,(function(t,n){return n.toLowerCase()in i?i[n.toLowerCase()]:t}));var r=this.tileGrid,e=this.hf;return function(i,o,s){if(i){var u={TileMatrix:r.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};A(u,e);var a=t;return a="KVP"==n?Nf(a,u):a.replace(/\{(\w+?)\}/g,(function(t,n){return u[n]}))}}},n}(Vv);var Ym=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zm="renderOrder",$m=function(t){function n(n){var i=this,r=n||{},e=A({},r);return delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,(i=t.call(this,e)||this).vf=void 0!==r.declutter&&r.declutter,i.df=void 0!==r.renderBuffer?r.renderBuffer:100,i.H=null,i.tt=void 0,i.setStyle(r.style),i.pf=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,i.yf=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,i}return Ym(n,t),n.prototype.getDeclutter=function(){return this.vf},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderBuffer=function(){return this.df},n.prototype.getRenderOrder=function(){return this.get(Zm)},n.prototype.getStyle=function(){return this.H},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.getUpdateWhileAnimating=function(){return this.pf},n.prototype.getUpdateWhileInteracting=function(){return this.yf},n.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Av(9)),this.getRenderer().renderDeclutter(t)},n.prototype.setRenderOrder=function(t){this.set(Zm,t)},n.prototype.setStyle=function(t){this.H=void 0!==t?t:xv,this.tt=null===t?void 0:gv(this.H),this.changed()},n}(ls);var Km=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hm=function(t){function n(n,i){var r=this,e=i.uniforms||{},s=[1,0,0,1,0,0];e[Sc]=s,(r=t.call(this,n,{uniforms:e,postProcesses:i.postProcesses})||this).ready=!1,r.mf=-1,r.wf=new mc(zf,Gf),r.gf=new mc(zf,Gf),r.bf=new mc(Rf,Gf),r.Hs=i.vertexShader,r.Js=i.fragmentShader,r.Ks,r.xf=!(!i.hitFragmentShader||!i.hitVertexShader),r.Mf=i.hitVertexShader,r._f=i.hitFragmentShader,r.Sf;var u=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Pc.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:Pc.FLOAT},{name:"a_index",size:1,type:Pc.FLOAT}].concat(u),r.hitDetectionAttributes=[{name:"a_position",size:2,type:Pc.FLOAT},{name:"a_index",size:1,type:Pc.FLOAT},{name:"a_hitColor",size:4,type:Pc.FLOAT},{name:"a_featureUid",size:1,type:Pc.FLOAT}].concat(u),r.customAttributes=i.attributes?i.attributes:[],r.$i=[1/0,1/0,-1/0,-1/0],r.Of=s,r.jf=[1,0,0,1,0,0],r.Ef=[1,0,0,1,0,0],r.Tf=new Float32Array(0),r.Af=new Float32Array(0),r.Pf,r.Cf=0,r.kf=function(){var t='const e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1,n=arguments.length;e=0||n.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==n.indexOf("webkit")&&n.indexOf("edge"),n.indexOf("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(e){}}(),new Array(6);const t="GENERATE_BUFFERS",o=[],r={vertexPosition:0,indexPosition:0};function i(e,n,t,o,r){e[n+0]=t,e[n+1]=o,e[n+2]=r}function s(e,n,t,s,f,c){const l=3+f,a=e[n+0],u=e[n+1],d=o;d.length=f;for(let t=0;t{const o=n.data;if(o.type===t){const n=3,t=2,r=o.customAttributesCount,i=t+r,c=new Float32Array(o.renderInstructions),l=c.length/i,a=4*l*(r+n),u=new Uint32Array(6*l),d=new Float32Array(a);let g;for(let e=0;ec&&(this.instructions.push([rw.CUSTOM,c,o,t,i,pe]),this.hitDetectionInstructions.push([rw.CUSTOM,c,o,t,r||i,pe]));break;case"Point":e=t.getFlatCoordinates(),this.coordinates.push(e[0],e[1]),o=this.coordinates.length,this.instructions.push([rw.CUSTOM,c,o,t,i]),this.hitDetectionInstructions.push([rw.CUSTOM,c,o,t,r||i])}this.endGeometry(n)},n.prototype.beginGeometry=function(t,n){this.qf=[rw.BEGIN_GEOMETRY,n,0,t],this.instructions.push(this.qf),this.Uf=[rw.BEGIN_GEOMETRY,n,0,t],this.hitDetectionInstructions.push(this.Uf)},n.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},n.prototype.reverseHitDetectionInstructions=function(){var t,n=this.hitDetectionInstructions;n.reverse();var i,r,e=n.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.Bf=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},n.prototype.createFill=function(t){var n=t.fillStyle,i=[rw.SET_FILL_STYLE,n];return"string"!=typeof n&&i.push(!0),i},n.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},n.prototype.createStroke=function(t){return[rw.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},n.prototype.updateFillStyle=function(t,n){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(n.call(this,t)),t.currentFillStyle=i)},n.prototype.updateStrokeStyle=function(t,n){var i=t.strokeStyle,r=t.lineCap,e=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,u=t.lineWidth,a=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||e!=t.currentLineDash&&!x(t.currentLineDash,e)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=u||t.currentMiterLimit!=a)&&(void 0!==i&&n.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=e,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=u,t.currentMiterLimit=a)},n.prototype.endGeometry=function(t){this.qf[2]=this.instructions.length,this.qf=null,this.Uf[2]=this.hitDetectionInstructions.length,this.Uf=null;var n=[rw.END_GEOMETRY,t];this.instructions.push(n),this.hitDetectionInstructions.push(n)},n.prototype.getBufferedMaxExtent=function(){if(!this.Bf&&(this.Bf=wn(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;mn(this.Bf,t,this.Bf)}return this.Bf},n}(tf),sw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uw=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o._u=null,o.Lt=null,o.Wf=void 0,o.Yf=void 0,o.Zf=void 0,o.$f=void 0,o.ou=void 0,o.Kf=void 0,o.Hf=void 0,o.su=void 0,o.Dr=void 0,o.uu=void 0,o.Uu=void 0,o.fu=void 0,o.Jf=void 0,o}return sw(n,t),n.prototype.drawPoint=function(t,n){if(this.Lt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([rw.DRAW_IMAGE,e,o,this.Lt,this.Yf*this.Wf,this.Zf*this.Wf,Math.ceil(this.$f*this.Wf),this.ou,this.Kf*this.Wf,this.Hf*this.Wf,this.su,this.Dr,[this.uu[0]*this.pixelRatio/this.Wf,this.uu[1]*this.pixelRatio/this.Wf],Math.ceil(this.Uu*this.Wf),this.fu,this.Jf]),this.hitDetectionInstructions.push([rw.DRAW_IMAGE,e,o,this._u,this.Yf,this.Zf,this.$f,this.ou,this.Kf,this.Hf,this.su,this.Dr,this.uu,this.Uu,this.fu,this.Jf]),this.endGeometry(n)}},n.prototype.drawMultiPoint=function(t,n){if(this.Lt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([rw.DRAW_IMAGE,e,o,this.Lt,this.Yf*this.Wf,this.Zf*this.Wf,Math.ceil(this.$f*this.Wf),this.ou,this.Kf*this.Wf,this.Hf*this.Wf,this.su,this.Dr,[this.uu[0]*this.pixelRatio/this.Wf,this.uu[1]*this.pixelRatio/this.Wf],Math.ceil(this.Uu*this.Wf),this.fu,this.Jf]),this.hitDetectionInstructions.push([rw.DRAW_IMAGE,e,o,this._u,this.Yf,this.Zf,this.$f,this.ou,this.Kf,this.Hf,this.su,this.Dr,this.uu,this.Uu,this.fu,this.Jf]),this.endGeometry(n)}},n.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.Yf=void 0,this.Zf=void 0,this._u=null,this.Lt=null,this.Wf=void 0,this.$f=void 0,this.uu=void 0,this.ou=void 0,this.Kf=void 0,this.Hf=void 0,this.su=void 0,this.Dr=void 0,this.Uu=void 0,t.prototype.finish.call(this)},n.prototype.setImageStyle=function(t,n){var i=t.getAnchor(),r=t.getSize(),e=t.getOrigin();this.Wf=t.getPixelRatio(this.pixelRatio),this.Yf=i[0],this.Zf=i[1],this._u=t.getHitDetectionImage(),this.Lt=t.getImage(this.pixelRatio),this.$f=r[1],this.ou=t.getOpacity(),this.Kf=e[0],this.Hf=e[1],this.su=t.getRotateWithView(),this.Dr=t.getRotation(),this.uu=t.getScaleArray(),this.Uu=r[0],this.fu=t.getDeclutterMode(),this.Jf=n},n}(ow),aw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hw=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e)||this}return aw(n,t),n.prototype.Qf=function(t,n,i,r){var e=this.coordinates.length,o=this.appendFlatLineCoordinates(t,n,i,r,!1,!1),s=[rw.MOVE_TO_LINE_TO,e,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},n.prototype.drawLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([rw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Ps,0],nw);var o=t.getFlatCoordinates(),s=t.getStride();this.Qf(o,0,o.length,s),this.hitDetectionInstructions.push(tw),this.endGeometry(n)}},n.prototype.drawMultiLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([rw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],nw);for(var o=t.getEnds(),s=t.getFlatCoordinates(),u=t.getStride(),a=0,h=0,f=o.length;ht&&(m>y&&(y=m,d=w,p=o),m=0,w=o-e)),s=u,f=l,c=v),a=g,h=b}return(m+=u)>y?[w,o]:[d,p]}var vw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dw={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},pw=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.rc=null,o.eo="",o.oo=0,o.so=0,o.uo=void 0,o.ao=0,o.fo=null,o.fillStates={},o.co=null,o.strokeStates={},o.lo={},o.textStates={},o.ec="",o.oc="",o.sc="",o.Jf=void 0,o}return vw(n,t),n.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},n.prototype.drawText=function(t,n){var i=this.fo,r=this.co,e=this.lo;if(""!==this.eo&&e&&(i||r)){var o=this.coordinates,s=o.length,u=t.getType(),a=null,h=t.getStride();if(e.placement!==jv||"LineString"!=u&&"MultiLineString"!=u&&"Polygon"!=u&&"MultiPolygon"!=u){var f=e.overflow?null:[];switch(u){case"Point":case"MultiPoint":a=t.getFlatCoordinates();break;case"LineString":a=t.getFlatMidpoint();break;case"Circle":a=t.getCenter();break;case"MultiLineString":a=t.getFlatMidpoints(),h=2;break;case"Polygon":a=t.getFlatInteriorPoint(),e.overflow||f.push(a[2]/this.resolution),h=3;break;case"MultiPolygon":var c=t.getFlatInteriorPoints();a=[];for(M=0,_=c.length;M<_;M+=3)e.overflow||f.push(c[M+2]/this.resolution),a.push(c[M],c[M+1]);if(0===a.length)return;h=2}if((P=this.appendFlatPointCoordinates(a,h))===s)return;if(f&&(P-s)/2!=a.length/h){var l=s/2;f=f.filter((function(t,n){var i=o[2*(l+n)]===a[n*h]&&o[2*(l+n)+1]===a[n*h+1];return i||--l,i}))}this.uc(),(e.backgroundFill||e.backgroundStroke)&&(this.setFillStrokeStyle(e.backgroundFill,e.backgroundStroke),e.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),e.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,n);var v=e.padding;if(v!=zs&&(e.scale[0]<0||e.scale[1]<0)){var d=e.padding[0],p=e.padding[1],y=e.padding[2],m=e.padding[3];e.scale[0]<0&&(p=-p,m=-m),e.scale[1]<0&&(d=-d,y=-y),v=[d,p,y,m]}var w=this.pixelRatio;this.instructions.push([rw.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.uo,this.ao,[1,1],NaN,void 0,this.Jf,v==zs?zs:v.map((function(t){return t*w})),!!e.backgroundFill,!!e.backgroundStroke,this.eo,this.ec,this.sc,this.oc,this.oo,this.so,f]);var g=1/w;this.hitDetectionInstructions.push([rw.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.uo,this.ao,[g,g],NaN,void 0,this.Jf,v,!!e.backgroundFill,!!e.backgroundStroke,this.eo,this.ec,this.sc,this.oc,this.oo,this.so,f]),this.endGeometry(n)}else{if(!Kn(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(a=t.getFlatCoordinates(),"LineString"==u)b=[a.length];else if("MultiLineString"==u)b=t.getEnds();else if("Polygon"==u)b=t.getEnds().slice(0,1);else if("MultiPolygon"==u){var x=t.getEndss();b=[];for(var M=0,_=x.length;M<_;++M)b.push(x[M][0])}this.beginGeometry(t,n);for(var S=e.textAlign,O=0,j=void 0,E=0,T=b.length;ET[2]}else O=b>j;var A,P=Math.PI,C=[],k=M+r===n;if(y=0,m=_,l=t[n=M],v=t[n+1],k){w(),A=Math.atan2(v-p,l-d),O&&(A+=A>0?-P:P);var I=(j+b)/2,N=(E+x)/2;return C[0]=[I,N,(S-o)/2,A,e],C}for(var L=0,z=(e=e.replace(/\n/g," ")).length;L0?-P:P),void 0!==A){var F=R-A;if(F+=F>P?-2*P:F<-P?2*P:0,Math.abs(F)>s)return null}A=R;for(var G=L,D=0;L0&&t.push("\n",""),t.push(n,""),t}var Aw=function(){function t(t,n,i,r){this.overlaps=i,this.pixelRatio=n,this.resolution=t,this.vc,this.instructions=r.instructions,this.coordinates=r.coordinates,this.dc={},this.yc=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.vo=null,this.Ge=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.mc={},this.rc={}}return t.prototype.createLabel=function(t,n,i,r){var e=t+n+i+r;if(this.rc[e])return this.rc[e];var o=r?this.strokeStates[r]:null,s=i?this.fillStates[i]:null,u=this.textStates[n],a=this.pixelRatio,h=[u.scale[0]*a,u.scale[1]*a],f=Array.isArray(t),c=u.justify?dw[u.justify]:Ew(Array.isArray(t)?t[0]:t,u.textAlign||Ns),l=r&&o.lineWidth?o.lineWidth:0,v=f?t:t.split("\n").reduce(Tw,[]),d=Zs(u,v),p=d.width,y=d.height,m=d.widths,w=d.heights,g=d.lineWidths,b=p+l,x=[],M=(b+2)*h[0],_=(y+l)*h[1],S={width:M<0?Math.floor(M):Math.ceil(M),height:_<0?Math.floor(_):Math.ceil(_),contextInstructions:x};(1==h[0]&&1==h[1]||x.push("scale",h),r)&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",l),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),(Vt?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)));i&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var O,j=.5-c,E=c*b+j*l,T=[],A=[],P=0,C=0,k=0,I=0,N=0,L=v.length;Nt?t-a:e,b=o+h>n?n-h:o,x=v[3]+g*c[0]+v[1],M=v[0]+b*c[1]+v[2],_=m-v[3],S=w-v[0];return(d||0!==f)&&(xw[0]=_,Sw[0]=_,xw[1]=S,Mw[1]=S,Mw[0]=_+x,_w[0]=Mw[0],_w[1]=S+M,Sw[1]=_w[1]),0!==f?(tn(y=sn([1,0,0,1,0,0],i,r,1,1,f,-i,-r),xw),tn(y,Mw),tn(y,_w),tn(y,Sw),On(Math.min(xw[0],Mw[0],_w[0],Sw[0]),Math.min(xw[1],Mw[1],_w[1],Sw[1]),Math.max(xw[0],Mw[0],_w[0],Sw[0]),Math.max(xw[1],Mw[1],_w[1],Sw[1]),bw)):On(Math.min(_,_+x),Math.min(S,S+M),Math.max(_,_+x),Math.max(S,S+M),bw),l&&(m=Math.round(m),w=Math.round(w)),{drawImageX:m,drawImageY:w,drawImageW:g,drawImageH:b,originX:a,originY:h,declutterBox:{minX:bw[0],minY:bw[1],maxX:bw[2],maxY:bw[3],value:p},canvasTransform:y,scale:c}},t.prototype.xc=function(t,n,i,r,e,o,s){var u=!(!o&&!s),a=r.declutterBox,h=t.canvas,f=s?s[2]*r.scale[0]/2:0;return a.minX-f<=h.width/n&&a.maxX+f>=0&&a.minY-f<=h.height/n&&a.maxY+f>=0&&(u&&this.wc(t,xw,Mw,_w,Sw,o,s),$s(t,r.canvasTransform,e,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.lu=function(t){if(this.vc){var n=tn(this.yc,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),t.rotate(this.Ge)}t.fill(),this.vc&&t.restore()},t.prototype.gc=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},t.prototype.Mc=function(t,n,i,r){var e=this.textStates[n],o=this.createLabel(t,n,r,i),s=this.strokeStates[i],u=this.pixelRatio,a=Ew(Array.isArray(t)?t[0]:t,e.textAlign||Ns),h=dw[e.textBaseline||Ls],f=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:a*(o.width/u-2*e.scale[0])+2*(.5-a)*f,anchorY:h*o.height/u+2*(.5-h)*f}},t.prototype._c=function(t,n,i,r,e,o,s,u){var a;this.vo&&x(i,this.yc)?a=this.vo:(this.vo||(this.vo=[]),a=Dr(this.coordinates,0,this.coordinates.length,2,i,this.vo),Qt(this.yc,i));for(var h,f,c,l,v,d,p,y,m,w,g,b,M,_,S,O,j=0,E=r.length,T=0,A=0,P=0,C=null,k=null,I=this.dc,N=this.Ge,L=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,z={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:N},R=this.instructions!=r||this.overlaps?0:200;jR&&(this.lu(t),A=0),P>R&&(t.stroke(),P=0),A||P||(t.beginPath(),l=NaN,v=NaN),++j;break;case rw.CIRCLE:var G=a[T=F[1]],D=a[T+1],q=a[T+2]-G,U=a[T+3]-D,B=Math.sqrt(q*q+U*U);t.moveTo(G+B,D),t.arc(G,D,B,0,2*Math.PI,!0),++j;break;case rw.CLOSE_PATH:t.closePath(),++j;break;case rw.CUSTOM:T=F[1],h=F[2];var X=F[3],V=F[4],W=6==F.length?F[5]:void 0;z.geometry=X,z.feature=M,j in I||(I[j]=[]);var Y=I[j];W?W(a,T,h,2,Y):(Y[0]=a[T],Y[1]=a[T+1],Y.length=2),V(Y,z),++j;break;case rw.DRAW_IMAGE:T=F[1],h=F[2],y=F[3],f=F[4],c=F[5];var Z=F[6],$=F[7],K=F[8],H=F[9],J=F[10],Q=F[11],tt=F[12],nt=F[13],it=F[14],rt=F[15];if(!y&&F.length>=20){m=F[19],w=F[20],g=F[21],b=F[22];var et=this.Mc(m,w,g,b);y=et.label,F[3]=y;var ot=F[23];f=(et.anchorX-ot)*this.pixelRatio,F[4]=f;var st=F[24];c=(et.anchorY-st)*this.pixelRatio,F[5]=c,Z=y.height,F[6]=Z,nt=y.width,F[13]=nt}var ut=void 0;F.length>25&&(ut=F[25]);var at=void 0,ht=void 0,ft=void 0;F.length>17?(at=F[16],ht=F[17],ft=F[18]):(at=zs,ht=!1,ft=!1),J&&L?Q+=N:J||L||(Q-=N);for(var ct=0;T0){if(!o||"Image"!==c&&"Text"!==c||-1!==o.indexOf(t)){var h=(l[u]-3)/4,v=r-h%s,d=r-(h/s|0),p=e(t,n,v*v+d*d);if(p)return p}f.clearRect(0,0,s,s);break}}var d,y,m,w,g,b=Object.keys(this.Sc).map(Number);for(b.sort(p),d=b.length-1;d>=0;--d){var x=b[d].toString();for(m=this.Sc[x],y=Pw.length-1;y>=0;--y)if(void 0!==(w=m[c=Pw[y]])&&(g=w.executeHitDetection(f,u,i,v,h)))return g}},t.prototype.getClipCoords=function(t){var n=this.fc;if(!n)return null;var i=n[0],r=n[1],e=n[2],o=n[3],s=[i,r,i,o,e,o,e,r];return Dr(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return k(this.Sc)},t.prototype.execute=function(t,n,i,r,e,o,s){var u=Object.keys(this.Sc).map(Number);u.sort(p),this.fc&&(t.save(),this.clip(t,i));var a,h,f,c,l,v,d=o||Pw;for(s&&u.reverse(),a=0,h=u.length;ai)break;var u=r[s];u||(u=[],r[s]=u),u.push(4*((t+e)*n+(t+o))+3),e>0&&u.push(4*((t-e)*n+(t+o))+3),o>0&&(u.push(4*((t+e)*n+(t-o))+3),e>0&&u.push(4*((t-e)*n+(t-o))+3))}for(var a=[],h=(e=0,r.length);ev[2];)m=p*++y,h.push(this.getRenderTransform(r,e,o,Lw,f,c,m).slice()),d-=p}this.Cc=zw(i,h,this.kc,a.getStyleFunction(),u,e,o)}n(Rw(t,this.kc,this.Cc))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){var s=this;if(this.Gc){var u,a=n.viewState.resolution,h=n.viewState.rotation,f=this.getLayer(),c={},l=function(t,n,i){var s=o(t),u=c[s];if(u){if(!0!==u&&ig[0]&&_[2]>g[2]&&w.push([_[0]-b,_[1],_[2]-b,_[3]])}if(this.ready&&this.Ic==f&&this._h==l&&this.Fc==d&&xn(this.Nc,y))return x(this.zh,m)||(this.Cc=null,this.zh=m),this.zc=p,this.replayGroupChanged=!1,!0;this.Gc=null;var S,O=new mw(uf(f,c),y,f,c);this.getLayer().getDeclutter()&&(S=new mw(uf(f,c),y,f,c));var j,E=Cr();if(E){for(var T=0,A=w.length;T0)n([]);else{var m=Yn(c.getTileCoordExtent(r.wrappedTileCoord)),w=[(l[0]-m[0])/f,(m[1]-l[1])/f],g=r.getSourceTiles().reduce((function(t,n){return t.concat(n.getFeatures())}),[]),b=r.hitDetectionImageData[s];if(!b&&!this.Pc){var x=Qu(c.getTileSize(c.getZForResolution(f,u.zDirection))),M=this.Lc;b=zw(x,[this.getRenderTransform(c.getTileCoordCenter(r.wrappedTileCoord),f,0,Lw,x[0]*Lw,x[1]*Lw,0)],g,e.getStyleFunction(),c.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(e).renderedResolution,M),r.hitDetectionImageData[s]=b}n(Rw(w,g,b))}}.bind(this))},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.Yc&&t.changed()},n.prototype.Ac=function(t){this.renderIfReadyAndVisible()},n.prototype.renderDeclutter=function(t){var n=this.context,i=n.globalAlpha;n.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,e=!(r[Eu]||r[Tu]),s=this.renderedTiles,u=0,a=s.length;u=0;--c)f[c].execute(this.context,1,this.getTileRenderTransform(h,t),t.viewState.rotation,e,void 0,t.declutterTree)}n.globalAlpha=i},n.prototype.getTileRenderTransform=function(t,n){var i=n.pixelRatio,r=n.viewState,e=r.center,o=r.resolution,s=r.rotation,u=n.size,a=Math.round(u[0]*i),h=Math.round(u[1]*i),f=this.getLayer().getSource().getTileGridForProjection(n.viewState.projection),c=t.tileCoord,l=f.getTileCoordExtent(t.wrappedTileCoord),v=f.getTileCoordExtent(c,this.tmpExtent)[0]-l[0];return Ht(rn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(e,o,s,i,a,h,v))},n.prototype.renderFrame=function(n,i){var r=n.viewHints,e=!(r[Eu]||r[Tu]);t.prototype.renderFrame.call(this,n,i),this.Wc=n.pixelToCoordinateTransform.slice(),this.Lc=n.viewState.rotation;var s=this.getLayer(),u=s.getRenderMode(),a=this.context,h=a.globalAlpha;a.globalAlpha=s.getOpacity();for(var f=Yw[u],c=n.viewState,l=c.rotation,v=s.getSource(),d=v.getTileGridForProjection(c.projection).getZForResolution(c.resolution,v.zDirection),p=this.renderedTiles,y=[],m=[],w=!0,g=p.length-1;g>=0;--g){var b=p[g];w=w&&!b.getReplayState(s).dirty;var x=b.executorGroups[o(s)].filter((function(t){return t.hasExecutors(f)}));if(0!==x.length){var M=this.getTileRenderTransform(b,n),_=b.tileCoord[0],S=!1,O=x[0].getClipCoords(M);if(O){for(var j=0,E=y.length;j1?s:2,x=o||new Array(b);for(p=0;p>1;e1?new sg(i,Tt,e):new We(i,Tt,r);default:throw new Error("Invalid geometry type:"+n)}}ag.prototype.getEndss=ag.prototype.getEnds,ag.prototype.getFlatCoordinates=ag.prototype.getOrientedFlatCoordinates;var fg=ag;var cg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lg=function(t){function n(n){return t.call(this,n)||this}return cg(n,t),n.prototype.createRenderer=function(){return new Gw(this)},n}($m);function vg(t,n,i){for(var r,e,o,s,u,a,h=[],f=t(0),c=t(1),l=n(f),v=n(c),d=[c,f],p=[v,l],y=[1,0],m={},w=1e5;--w>0&&y.length>0;)o=y.pop(),f=d.pop(),l=p.pop(),(a=o.toString())in m||(h.push(l[0],l[1]),m[a]=!0),s=y.pop(),c=d.pop(),v=p.pop(),ai((e=n(r=t(u=(o+s)/2)))[0],e[1],l[0],l[1],v[0],v[1])this.Dl.length;)u=new Et,this.Dl.push(u);var h=r.getFeaturesCollection();h.clear();var f,c,l=0;for(f=0,c=this.wl.length;fMath.PI/2);for(var d=ff(t),p=h;p<=f;++p){var y=this.wl.length+this.gl.length,m=void 0,w=void 0,g=void 0,b=void 0;if(this.Tl)for(w=0,g=this.Tl.length;w=u?(t[0]=s[0],t[2]=s[2]):o=!0);var a=[oi(n[0],this.dl,this.ll),oi(n[1],this.pl,this.vl)],h=this.Ml(a);isNaN(h[1])&&(h[1]=Math.abs(this.al)>=Math.abs(this.fl)?this.al:this.fl);var f,c,l,v,d=oi(h[0],this.cl,this.hl),p=oi(h[1],this.fl,this.al),y=this.ml,m=t;o||(m=[oi(t[0],this.dl,this.ll),oi(t[1],this.pl,this.vl),oi(t[2],this.dl,this.ll),oi(t[3],this.pl,this.vl)]);var w=ni(m,this.Ml,void 0,8),g=w[3],b=w[2],x=w[1],M=w[0];if(o||(bn(m,this.Sl)&&(M=this.cl,x=this.fl),bn(m,this.Ol)&&(b=this.hl,x=this.fl),bn(m,this.jl)&&(M=this.cl,g=this.al),bn(m,this.El)&&(b=this.hl,g=this.al),g=oi(g,p,this.al),b=oi(b,d,this.hl),x=oi(x,this.fl,p),M=oi(M,this.cl,d)),v=oi(d=Math.floor(d/e)*e,this.cl,this.hl),c=this.Vl(v,x,g,r,t,0),f=0,o)for(;(v-=e)>=M&&f++r[o]&&(e=o,o=1);var s=Math.max(n[1],r[e]),u=Math.min(n[3],r[o]),a=oi(n[1]+Math.abs(n[1]-n[3])*this.kl,s,u),h=[r[e-1]+(r[o-1]-r[e-1])*(a-r[e])/(r[o]-r[e]),a],f=this.Tl[i].geom;return f.setCoordinates(h),f},n.prototype.getMeridians=function(){return this.wl},n.prototype.Zl=function(t,n,i,r,e){var o=pg(t,n,i,this.di,r),s=this.gl[e];return s?(s.setFlatCoordinates(Tt,o),s.changed()):s=new ng(o,Tt),s},n.prototype.Kl=function(t,n,i){var r=t.getFlatCoordinates(),e=0,o=r.length-2;r[e]>r[o]&&(e=o,o=0);var s=Math.max(n[0],r[e]),u=Math.min(n[2],r[o]),a=oi(n[0]+Math.abs(n[0]-n[2])*this.Il,s,u),h=[a,r[e+1]+(r[o+1]-r[e+1])*(a-r[e])/(r[o]-r[e])],f=this.Al[i].geom;return f.setCoordinates(h),f},n.prototype.getParallels=function(){return this.gl},n.prototype.Bl=function(t){var n=yr("EPSG:4326"),i=t.getWorldExtent();this.al=i[3],this.hl=i[2],this.fl=i[1],this.cl=i[0];var r=jr(t,n);if(this.cl=Math.abs(this.fl)?this.al:this.fl),this.di=t},n}(lg),bg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xg="blur",Mg="gradient",_g="radius",Sg=["#00f","#0ff","#0f0","#ff0","#f00"];var Og=function(t){function n(n){var i=this,r=n||{},e=A({},r);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,(i=t.call(this,e)||this).Jl=null,i.addChangeListener(Mg,i.Ql),i.setGradient(r.gradient?r.gradient:Sg),i.setBlur(void 0!==r.blur?r.blur:15),i.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return i.tv="string"==typeof o?function(t){return t.get(o)}:o,i.setRenderOrder(null),i}return bg(n,t),n.prototype.getBlur=function(){return this.get(xg)},n.prototype.getGradient=function(){return this.get(Mg)},n.prototype.getRadius=function(){return this.get(_g)},n.prototype.Ql=function(){this.Jl=function(t){for(var n=1,i=256,r=_o(n,i),e=r.createLinearGradient(0,0,n,i),o=1/(t.length-1),s=0,u=t.length;s>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;n.values.push(r)}}function Ig(t,n,i){if(1==t)n.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos>3}s--,1===o||2===o?(u+=t.readSVarint(),a+=t.readSVarint(),1===o&&h>f&&(r.push(h),f=h),i.push(u,a),h+=2):7===o?h>f&&(i.push(i[f],i[f+1]),h+=2):St(!1,59)}h>f&&(r.push(h),f=h)},n.prototype.ov=function(t,n,i){var r,e=n.type;if(0===e)return null;var o,s=n.properties;this.rv?(o=s[this.rv],delete s[this.rv]):o=n.id,s[this.iv]=n.layer.name;var u=[],a=[];this.ev(t,n,u,a);var h=function(t,n){var i;1===t?i=1===n?"Point":"MultiPoint":2===t?i=1===n?"LineString":"MultiLineString":3===t&&(i="Polygon");return i}(e,a.length);if(this.nv===fg)(r=new this.nv(h,u,a,s,o)).transform(i.dataProjection);else{var f=void 0;if("Polygon"==h){var c=Be(u,a);f=c.length>1?new sg(u,Tt,c):new We(u,Tt,a)}else f="Point"===h?new Se(u,Tt):"LineString"===h?new ng(u,Tt):"MultiPoint"===h?new Kw(u,Tt):"MultiLineString"===h?new rg(u,Tt,a):null;r=new(0,this.nv),this.K&&r.setGeometryName(this.K);var l=Eg(f,!1,i);r.setGeometry(l),void 0!==o&&r.setId(o),r.setProperties(s,!0)}return r},n.prototype.getType=function(){return"arraybuffer"},n.prototype.readFeatures=function(t,n){var i=this.Uh,r=this.adaptOptions(n),e=yr(r.dataProjection);e.setWorldExtent(r.extent),r.dataProjection=e;var o=new Ag(t),s=o.readFields(Cg,{}),u=[];for(var a in s)if(!i||-1!=i.indexOf(a)){var h=s[a],f=h?[0,0,h.extent,h.extent]:null;e.setExtent(f);for(var c=0,l=h.length;c255?255:t}function Hg(t){return t<0?0:t>1?1:t}function Jg(t){return"%"===t[t.length-1]?Kg(parseFloat(t)/100*255):Kg(parseInt(t))}function Qg(t){return"%"===t[t.length-1]?Hg(parseFloat(t)/100):Hg(parseFloat(t))}function tb(t,n,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(n-t)*i*6:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t}try{Yg={}.parseCSSColor=function(t){var n,i=t.replace(/ /g,"").toLowerCase();if(i in $g)return $g[i].slice();if("#"===i[0])return 4===i.length?(n=parseInt(i.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===i.length&&(n=parseInt(i.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var r=i.indexOf("("),e=i.indexOf(")");if(-1!==r&&e+1===i.length){var o=i.substr(0,r),s=i.substr(r+1,e-(r+1)).split(","),u=1;switch(o){case"rgba":if(4!==s.length)return null;u=Qg(s.pop());case"rgb":return 3!==s.length?null:[Jg(s[0]),Jg(s[1]),Jg(s[2]),u];case"hsla":if(4!==s.length)return null;u=Qg(s.pop());case"hsl":if(3!==s.length)return null;var a=(parseFloat(s[0])%360+360)%360/360,h=Qg(s[1]),f=Qg(s[2]),c=f<=.5?f*(h+1):f+h-f*h,l=2*f-c;return[Kg(255*tb(l,c,a+1/3)),Kg(255*tb(l,c,a)),Kg(255*tb(l,c,a-1/3)),u];default:return null}}return null}}catch(t){}var nb=function(t,n,i,r){void 0===r&&(r=1),this.r=t,this.g=n,this.b=i,this.a=r};function ib(t){return"object"==typeof t?["literal",t]:t}function rb(t,n){var i=t.stops;if(!i)return function(t,n){var i=["get",t.property];if(void 0===t.default)return"string"===n.type?["string",i]:i;if("enum"===n.type)return["match",i,Object.keys(n.values),i,t.default];var r=["color"===n.type?"to-color":n.type,i,ib(t.default)];return"array"===n.type&&r.splice(1,0,n.value,n.length||null),r}(t,n);var r=i&&"object"==typeof i[0][0],e=r||void 0!==t.property,o=r||!e;return i=i.map((function(t){return!e&&n.tokens&&"string"==typeof t[1]?[t[0],fb(t[1])]:[t[0],ib(t[1])]})),r?function(t,n,i){for(var r={},e={},o=[],s=0;s3&&n===t[t.length-2]||(r&&2===t.length||t.push(n),t.push(i))}function hb(t,n){return t.type?t.type:n.expression.interpolated?"exponential":"interval"}function fb(t){for(var n=["concat"],i=/{([^{}]+)}/g,r=0,e=i.exec(t);null!==e;e=i.exec(t)){var o=t.slice(r,i.lastIndex-e[0].length);r=i.lastIndex,o.length>0&&n.push(o),n.push(["get",e[1]])}if(1===n.length)return t;if(r":"value"===t.itemType.kind?"array":"array<"+n+">"}return t.kind}var Ob=[vb,db,pb,yb,mb,xb,wb,_b(gb),Mb];function jb(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!jb(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind)for(var i=0,r=Ob;i=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,n,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,n,i,r]:[t,n,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Nb(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof nb)return!0;if(t instanceof Ab)return!0;if(t instanceof Cb)return!0;if(t instanceof kb)return!0;if(Array.isArray(t)){for(var n=0,i=t;n2){var u=t[1];if("string"!=typeof u||!(u in Gb)||"object"===u)return n.error('The item type argument of "array" must be one of string, number, boolean',1);o=Gb[u],r++}else o=gb;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);s=t[2],r++}i=_b(o,s)}else i=Gb[e];for(var a=[];r1)&&n.push(r)}}return n.concat(this.args.map((function(t){return t.serialize()})))};var qb=function(t){this.type=xb,this.sections=t};qb.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return n.error("First argument must be an image or text section.");for(var r=[],e=!1,o=1;o<=t.length-1;++o){var s=t[o];if(e&&"object"==typeof s&&!Array.isArray(s)){e=!1;var u=null;if(s["font-scale"]&&!(u=n.parse(s["font-scale"],1,db)))return null;var a=null;if(s["text-font"]&&!(a=n.parse(s["text-font"],1,_b(pb))))return null;var h=null;if(s["text-color"]&&!(h=n.parse(s["text-color"],1,mb)))return null;var f=r[r.length-1];f.scale=u,f.font=a,f.textColor=h}else{var c=n.parse(t[o],1,gb);if(!c)return null;var l=c.type.kind;if("string"!==l&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");e=!0,r.push({content:c,scale:null,font:null,textColor:null})}}return new qb(r)},qb.prototype.evaluate=function(t){return new Cb(this.sections.map((function(n){var i=n.content.evaluate(t);return Lb(i)===Mb?new Pb("",i,null,null,null):new Pb(zb(i),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)})))},qb.prototype.eachChild=function(t){for(var n=0,i=this.sections;n-1),i},Ub.prototype.eachChild=function(t){t(this.input)},Ub.prototype.outputDefined=function(){return!1},Ub.prototype.serialize=function(){return["image",this.input.serialize()]};var Bb={"to-boolean":yb,"to-color":mb,"to-number":db,"to-string":pb},Xb=function(t,n){this.type=t,this.args=n};Xb.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return n.error("Expected one argument.");for(var r=Bb[i],e=[],o=1;o4?"Invalid rbga value "+JSON.stringify(n)+": expected an array containing either three or four numeric values.":Ib(n[0],n[1],n[2],n[3])))return new nb(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new Fb(i||"Could not parse color from value '"+("string"==typeof n?n:String(JSON.stringify(n)))+"'")}if("number"===this.type.kind){for(var s=null,u=0,a=this.args;u=n[2])&&(!(t[1]<=n[1])&&!(t[3]>=n[3])))}function Jb(t,n){var i,r=(180+t[0])/360,e=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),o=Math.pow(2,n.z);return[Math.round(r*o*$b),Math.round(e*o*$b)]}function Qb(t,n,i){var r=t[0]-n[0],e=t[1]-n[1],o=t[0]-i[0],s=t[1]-i[1];return r*s-o*e==0&&r*o<=0&&e*s<=0}function tx(t,n,i){return n[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-n[0])*(t[1]-n[1])/(i[1]-n[1])+n[0]}function nx(t,n){for(var i=!1,r=0,e=n.length;r0&&c<0||f<0&&c>0}function ex(t,n,i){for(var r=0,e=i;ri[2]){var e=.5*r,o=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===o&&(o=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=o}Kb(n,t)}function fx(t,n,i,r){var e=Math.pow(2,r.z)*$b,o=[r.x*$b,r.y*$b],s=[];if(!t)return s;for(var u=0,a=t;u=0)return!1;var i=!0;return t.eachChild((function(t){i&&!px(t,n)&&(i=!1)})),i}lx.parse=function(t,n){if(2!==t.length)return n.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Nb(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var r=0;rn))throw new Fb("Input is not a number.");s=u-1}return 0}mx.prototype.parse=function(t,n,i,r,e){return void 0===e&&(e={}),n?this.concat(n,i,r)._parse(t,e):this._parse(t,e)},mx.prototype._parse=function(t,n){function i(t,n,i){return"assert"===i?new Db(n,[t]):"coerce"===i?new Xb(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var e=this.registry[r];if(e){var o=e.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,u=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==u.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==u.kind&&"string"!==u.kind){if(this.checkSubtype(s,u))return null}else o=i(o,s,n.typeAnnotation||"coerce");else o=i(o,s,n.typeAnnotation||"assert")}if(!(o instanceof Rb)&&"resolvedImage"!==o.type.kind&&wx(o)){var a=new Wb;try{o=new Rb(o.type,o.evaluate(a))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},mx.prototype.concat=function(t,n,i){var r="number"==typeof t?this.path.concat(t):this.path,e=i?this.scope.concat(i):this.scope;return new mx(this.registry,r,n||null,e,this.errors)},mx.prototype.error=function(t){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var r=""+this.key+n.map((function(t){return"["+t+"]"})).join("");this.errors.push(new cb(r,t))},mx.prototype.checkSubtype=function(t,n){var i=jb(t,n);return i&&this.error(i),i};var bx=function(t,n,i){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(var r=0,e=i;r=s)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);var f=n.parse(u,h,e);if(!f)return null;e=e||f.type,r.push([s,f])}return new bx(e,i,r)},bx.prototype.evaluate=function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;return r>=n[e-1]?i[e-1].evaluate(t):i[gx(n,r)].evaluate(t)},bx.prototype.eachChild=function(t){t(this.input);for(var n=0,i=this.outputs;n0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t};var xx=Mx;function Mx(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}function _x(t,n,i){return t*(1-i)+n*i}Mx.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Mx.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Mx.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Mx.prototype.solveCurveX=function(t,n){var i,r,e,o,s;for(void 0===n&&(n=1e-6),e=t,s=0;s<8;s++){if(o=this.sampleCurveX(e)-t,Math.abs(o)(r=1))return r;for(;io?i=e:r=e,e=.5*(r-i)+i}return e},Mx.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var Sx=Object.freeze({__proto__:null,number:_x,color:function(t,n,i){return new nb(_x(t.r,n.r,i),_x(t.g,n.g,i),_x(t.b,n.b,i),_x(t.a,n.a,i))},array:function(t,n,i){return t.map((function(t,r){return _x(t,n[r],i)}))}}),Ox=.95047,jx=1.08883,Ex=4/29,Tx=6/29,Ax=3*Tx*Tx,Px=Math.PI/180,Cx=180/Math.PI;function kx(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ax+Ex}function Ix(t){return t>Tx?t*t*t:Ax*(t-Ex)}function Nx(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Lx(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function zx(t){var n=Lx(t.r),i=Lx(t.g),r=Lx(t.b),e=kx((.4124564*n+.3575761*i+.1804375*r)/Ox),o=kx((.2126729*n+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(e-o),b:200*(o-kx((.0193339*n+.119192*i+.9503041*r)/jx)),alpha:t.a}}function Rx(t){var n=(t.l+16)/116,i=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*Ix(n),i=Ox*Ix(i),r=jx*Ix(r),new nb(Nx(3.2404542*i-1.5371385*n-.4985314*r),Nx(-.969266*i+1.8760108*n+.041556*r),Nx(.0556434*i-.2040259*n+1.0572252*r),t.alpha)}function Fx(t,n,i){var r=n-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}var Gx={forward:zx,reverse:Rx,interpolate:function(t,n,i){return{l:_x(t.l,n.l,i),a:_x(t.a,n.a,i),b:_x(t.b,n.b,i),alpha:_x(t.alpha,n.alpha,i)}}},Dx={forward:function(t){var n=zx(t),i=n.l,r=n.a,e=n.b,o=Math.atan2(e,r)*Cx;return{h:o<0?o+360:o,c:Math.sqrt(r*r+e*e),l:i,alpha:t.a}},reverse:function(t){var n=t.h*Px,i=t.c;return Rx({l:t.l,a:Math.cos(n)*i,b:Math.sin(n)*i,alpha:t.alpha})},interpolate:function(t,n,i){return{h:Fx(t.h,n.h,i),c:_x(t.c,n.c,i),l:_x(t.l,n.l,i),alpha:_x(t.alpha,n.alpha,i)}}},qx=function(t,n,i,r,e){this.type=t,this.operator=n,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var o=0,s=e;o1})))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:u}}if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(e=n.parse(e,2,db)))return null;var a=[],h=null;"interpolate-hcl"===i||"interpolate-lab"===i?h=mb:n.expectedType&&"value"!==n.expectedType.kind&&(h=n.expectedType);for(var f=0;f=c)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',v);var p=n.parse(l,d,h);if(!p)return null;h=h||p.type,a.push([c,p])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new qx(h,i,r,e,a):n.error("Type "+Sb(h)+" is not interpolatable.")},qx.prototype.evaluate=function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;if(r>=n[e-1])return i[e-1].evaluate(t);var o=gx(n,r),s=n[o],u=n[o+1],a=qx.interpolationFactor(this.interpolation,r,s,u),h=i[o].evaluate(t),f=i[o+1].evaluate(t);return"interpolate"===this.operator?Sx[this.type.kind.toLowerCase()](h,f,a):"interpolate-hcl"===this.operator?Dx.reverse(Dx.interpolate(Dx.forward(h),Dx.forward(f),a)):Gx.reverse(Gx.interpolate(Gx.forward(h),Gx.forward(f),a))},qx.prototype.eachChild=function(t){t(this.input);for(var n=0,i=this.outputs;n=i.length)throw new Fb("Array index out of bounds: "+n+" > "+(i.length-1)+".");if(n!==Math.floor(n))throw new Fb("Array index must be an integer, but found "+n+" instead.");return i[n]},Vx.prototype.eachChild=function(t){t(this.index),t(this.input)},Vx.prototype.outputDefined=function(){return!1},Vx.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Wx=function(t,n){this.type=yb,this.needle=t,this.haystack=n};Wx.parse=function(t,n){if(3!==t.length)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,gb),r=n.parse(t[2],2,gb);return i&&r?Eb(i.type,[yb,pb,db,vb,gb])?new Wx(i,r):n.error("Expected first argument to be of type boolean, string, number or null, but found "+Sb(i.type)+" instead"):null},Wx.prototype.evaluate=function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!Tb(n,["boolean","string","number","null"]))throw new Fb("Expected first argument to be of type boolean, string, number or null, but found "+Sb(Lb(n))+" instead.");if(!Tb(i,["string","array"]))throw new Fb("Expected second argument to be of type array or string, but found "+Sb(Lb(i))+" instead.");return i.indexOf(n)>=0},Wx.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Wx.prototype.outputDefined=function(){return!0},Wx.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Yx=function(t,n,i){this.type=db,this.needle=t,this.haystack=n,this.fromIndex=i};Yx.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,gb),r=n.parse(t[2],2,gb);if(!i||!r)return null;if(!Eb(i.type,[yb,pb,db,vb,gb]))return n.error("Expected first argument to be of type boolean, string, number or null, but found "+Sb(i.type)+" instead");if(4===t.length){var e=n.parse(t[3],3,db);return e?new Yx(i,r,e):null}return new Yx(i,r)},Yx.prototype.evaluate=function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Tb(n,["boolean","string","number","null"]))throw new Fb("Expected first argument to be of type boolean, string, number or null, but found "+Sb(Lb(n))+" instead.");if(!Tb(i,["string","array"]))throw new Fb("Expected second argument to be of type array or string, but found "+Sb(Lb(i))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return i.indexOf(n,r)}return i.indexOf(n)},Yx.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Yx.prototype.outputDefined=function(){return!1},Yx.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Zx=function(t,n,i,r,e,o){this.inputType=t,this.type=n,this.input=i,this.cases=r,this.outputs=e,this.otherwise=o};Zx.parse=function(t,n){if(t.length<5)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return n.error("Expected an even number of arguments.");var i,r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);for(var e={},o=[],s=2;sNumber.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof l&&Math.floor(l)!==l)return h.error("Numeric branch labels must be integer values.");if(i){if(h.checkSubtype(i,Lb(l)))return null}else i=Lb(l);if(void 0!==e[String(l)])return h.error("Branch labels must be unique.");e[String(l)]=o.length}var v=n.parse(a,s,r);if(!v)return null;r=r||v.type,o.push(v)}var d=n.parse(t[1],1,gb);if(!d)return null;var p=n.parse(t[t.length-1],t.length-1,r);return p?"value"!==d.type.kind&&n.concat(1).checkSubtype(i,d.type)?null:new Zx(i,r,d,e,o,p):null},Zx.prototype.evaluate=function(t){var n=this.input.evaluate(t);return(Lb(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)},Zx.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Zx.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Zx.prototype.serialize=function(){for(var t=this,n=["match",this.input.serialize()],i=[],r={},e=0,o=Object.keys(this.cases).sort();e=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,gb),r=n.parse(t[2],2,db);if(!i||!r)return null;if(!Eb(i.type,[_b(gb),pb,gb]))return n.error("Expected first argument to be of type array or string, but found "+Sb(i.type)+" instead");if(4===t.length){var e=n.parse(t[3],3,db);return e?new Kx(i.type,i,r,e):null}return new Kx(i.type,i,r)},Kx.prototype.evaluate=function(t){var n=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Tb(n,["string","array"]))throw new Fb("Expected first argument to be of type array or string, but found "+Sb(Lb(n))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return n.slice(i,r)}return n.slice(i)},Kx.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Kx.prototype.outputDefined=function(){return!1},Kx.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var tM=Qx("==",(function(t,n,i){return n===i}),Jx),nM=Qx("!=",(function(t,n,i){return n!==i}),(function(t,n,i,r){return!Jx(0,n,i,r)})),iM=Qx("<",(function(t,n,i){return n",(function(t,n,i){return n>i}),(function(t,n,i,r){return r.compare(n,i)>0})),eM=Qx("<=",(function(t,n,i){return n<=i}),(function(t,n,i,r){return r.compare(n,i)<=0})),oM=Qx(">=",(function(t,n,i){return n>=i}),(function(t,n,i,r){return r.compare(n,i)>=0})),sM=function(t,n,i,r,e){this.type=pb,this.number=t,this.locale=n,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=e};sM.parse=function(t,n){if(3!==t.length)return n.error("Expected two arguments.");var i=n.parse(t[1],1,db);if(!i)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return n.error("NumberFormat options argument must be an object.");var e=null;if(r.locale&&!(e=n.parse(r.locale,1,pb)))return null;var o=null;if(r.currency&&!(o=n.parse(r.currency,1,pb)))return null;var s=null;if(r["min-fraction-digits"]&&!(s=n.parse(r["min-fraction-digits"],1,db)))return null;var u=null;return r["max-fraction-digits"]&&!(u=n.parse(r["max-fraction-digits"],1,db))?null:new sM(i,e,o,s,u)},sM.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},sM.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},sM.prototype.outputDefined=function(){return!1},sM.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var uM=function(t){this.type=db,this.input=t};uM.parse=function(t,n){if(2!==t.length)return n.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?n.error("Expected argument of type string or array, but found "+Sb(i.type)+" instead."):new uM(i):null},uM.prototype.evaluate=function(t){var n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new Fb("Expected value to be of type string or array, but found "+Sb(Lb(n))+" instead.")},uM.prototype.eachChild=function(t){t(this.input)},uM.prototype.outputDefined=function(){return!1},uM.prototype.serialize=function(){var t=["length"];return this.eachChild((function(n){t.push(n.serialize())})),t};var aM={"==":tM,"!=":nM,">":rM,"<":iM,">=":oM,"<=":eM,array:Db,at:Vx,boolean:Db,case:$x,coalesce:Bx,collator:Zb,format:qb,image:Ub,in:Wx,"index-of":Yx,interpolate:qx,"interpolate-hcl":qx,"interpolate-lab":qx,length:uM,let:Xx,literal:Rb,match:Zx,number:Db,"number-format":sM,object:Db,slice:Kx,step:bx,string:Db,"to-boolean":Xb,"to-color":Xb,"to-number":Xb,"to-string":Xb,var:yx,within:lx};function hM(t,n){var i=n[0],r=n[1],e=n[2],o=n[3];i=i.evaluate(t),r=r.evaluate(t),e=e.evaluate(t);var s=o?o.evaluate(t):1,u=Ib(i,r,e,s);if(u)throw new Fb(u);return new nb(i/255*s,r/255*s,e/255*s,s)}function fM(t,n){return t in n}function cM(t,n){var i=n[t];return void 0===i?null:i}function lM(t){return{type:t}}function vM(t){return{result:"success",value:t}}function dM(t){return{result:"error",value:t}}function pM(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Yb.register(aM,{error:[{kind:"error"},[pb],function(t,n){var i=n[0];throw new Fb(i.evaluate(t))}],typeof:[pb,[gb],function(t,n){return Sb(Lb(n[0].evaluate(t)))}],"to-rgba":[_b(db,4),[mb],function(t,n){return n[0].evaluate(t).toArray()}],rgb:[mb,[db,db,db],hM],rgba:[mb,[db,db,db,db],hM],has:{type:yb,overloads:[[[pb],function(t,n){return fM(n[0].evaluate(t),t.properties())}],[[pb,wb],function(t,n){var i=n[0],r=n[1];return fM(i.evaluate(t),r.evaluate(t))}]]},get:{type:gb,overloads:[[[pb],function(t,n){return cM(n[0].evaluate(t),t.properties())}],[[pb,wb],function(t,n){var i=n[0],r=n[1];return cM(i.evaluate(t),r.evaluate(t))}]]},"feature-state":[gb,[pb],function(t,n){return cM(n[0].evaluate(t),t.featureState||{})}],properties:[wb,[],function(t){return t.properties()}],"geometry-type":[pb,[],function(t){return t.geometryType()}],id:[gb,[],function(t){return t.id()}],zoom:[db,[],function(t){return t.globals.zoom}],pitch:[db,[],function(t){return t.globals.pitch||0}],"distance-from-center":[db,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[db,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[db,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[db,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[gb,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[db,lM(db),function(t,n){for(var i=0,r=0,e=n;r":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e>o}],"filter-id->":[yb,[gb],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r>e}],"filter-<=":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e<=o}],"filter-id-<=":[yb,[gb],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r<=e}],"filter->=":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e>=o}],"filter-id->=":[yb,[gb],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r>=e}],"filter-has":[yb,[gb],function(t,n){return n[0].value in t.properties()}],"filter-has-id":[yb,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[yb,[_b(pb)],function(t,n){return n[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[yb,[_b(gb)],function(t,n){return n[0].value.indexOf(t.id())>=0}],"filter-in-small":[yb,[pb,_b(gb)],function(t,n){var i=n[0];return n[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[yb,[pb,_b(gb)],function(t,n){var i=n[0],r=n[1];return function(t,n,i,r){for(;i<=r;){var e=i+r>>1;if(n[e]===t)return!0;n[e]>t?r=e-1:i=e+1}return!1}(t.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:yb,overloads:[[[yb,yb],function(t,n){var i=n[0],r=n[1];return i.evaluate(t)&&r.evaluate(t)}],[lM(yb),function(t,n){for(var i=0,r=n;i-1}(n))return dM([new cb("","zoom expressions not supported")]);var o=xM(i);if(!o&&!e)return dM([new cb("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof cb)return dM([o]);if(o instanceof qx&&!function(t){return!!t.expression&&t.expression.interpolated}(n))return dM([new cb("",'"interpolate" expressions cannot be used with this property')]);if(!o)return vM(new wM(r?"constant":"source",t.value));var s=o instanceof qx?o.interpolation:void 0;return vM(new gM(r?"camera":"composite",t.value,o.labels,s))}function xM(t){var n=null;if(t instanceof Xx)n=xM(t.result);else if(t instanceof Bx)for(var i=0,r=t.args;i":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function SM(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var n=0,i=t.slice(1);n",">=","<","<=","to-boolean"]);function PM(t,n){return tn?1:0}function CM(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var n=1;n"===i||"<="===i||">="===i?IM(t[1],t[2],i):"any"===i?(n=t.slice(1),["any"].concat(n.map(kM))):"all"===i?["all"].concat(t.slice(1).map(kM)):"none"===i?["all"].concat(t.slice(1).map(kM).map(zM)):"in"===i?NM(t[1],t.slice(2)):"!in"===i?zM(NM(t[1],t.slice(2))):"has"===i?LM(t[1]):"!has"===i?zM(LM(t[1])):"within"!==i||t}function IM(t,n,i){switch(t){case"$type":return["filter-type-"+i,n];case"$id":return["filter-id-"+i,n];default:return["filter-"+i,t,n]}}function NM(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some((function(t){return typeof t!=typeof n[0]}))?["filter-in-large",t,["literal",n.sort(PM)]]:["filter-in-small",t,["literal",n]]}}function LM(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function zM(t){return["!",t]}var RM=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function FM(t,n){var i={};for(var r in t)"ref"!==r&&(i[r]=t[r]);return RM.forEach((function(t){t in n&&(i[t]=n[t])})),i}var GM={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},DM=" ",qM=/(italic|oblique)$/i,UM={},BM=function(t,n,i){var r=UM[t];if(!r){Array.isArray(t)||(t=[t]);for(var e=400,o="normal",s=[],u=0,a=t.length;u1?h[h.length-2].toLowerCase():"";if(f==c||f==c.replace("-","")||l+"-"+f==c){e=GM[c],h.pop(),l&&c.startsWith(l)&&h.pop();break}}"number"==typeof f&&(e=f);var v=h.join(DM).replace("Klokantech Noto Sans","Noto Sans");-1!==v.indexOf(DM)&&(v='"'+v+'"'),s.push(v)}r=UM[t]=[o,e,s]}return r[0]+DM+r[1]+DM+n+"px"+(i?"/"+i:"")+DM+r[2]},XM="https://api.mapbox.com";function VM(t){var n="mapbox://";return 0!==t.indexOf(n)?"":t.slice(n.length)}function WM(t,n){var i=VM(t);if(!i)return decodeURI(new URL(t,location.href).href);var r="styles/";if(0!==i.indexOf(r))throw new Error("unexpected style url: "+t);var e=i.slice(r.length);return XM+"/styles/v1/"+e+"?&access_token="+n}function YM(t,n,i,r){var e=new URL(t,r),o=VM(t);return o?"https://{a-d}.tiles.mapbox.com/v4/"+o+"/{z}/{x}/{y}.vector.pbf?access_token="+n:n?(e.searchParams.set(i,n),decodeURI(e.href)):decodeURI(e.href)}function ZM(t){return t*Math.PI/180}var $M=function(){for(var t=[],n=78271.51696402048;t.length<=24;n/=2)t.push(n);return t}();function KM(t,n){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,n);var i=document.createElement("canvas");return i.width=t,i.height=n,i}var HM={};function JM(t,n,i){if(void 0===i&&(i={}),n in HM)return HM[n];var r=i.transformRequest&&i.transformRequest(n,t)||new Request(n);r.headers.get("Accept")||r.headers.set("Accept","application/json");var e=fetch(r).then((function(t){return delete HM[n],t.ok?t.json():Promise.reject(new Error("Error fetching source "+n))})).catch((function(t){return delete HM[n],Promise.reject(new Error("Error fetching source "+n))}));return HM[n]=e,e}function QM(t,n){if("string"!=typeof t)return Promise.resolve(t);if(!t.trim().startsWith("{"))return JM("Style",t=WM(t,n.accessToken),n);try{var i=JSON.parse(t);return Promise.resolve(i)}catch(t){return Promise.reject(t)}}var t_={};function n_(t,n,i){void 0===i&&(i={});var r=[n,JSON.stringify(t)].toString(),e=t_[r];if(!e||i.transformRequest){var o=t.url;if(o){var s=YM(o,i.accessToken,i.accessTokenParam||"access_token",n||location.href);e=o.startsWith("mapbox://")?Promise.resolve(A({},t,{url:void 0,tiles:s})):JM("Source",s,i).then((function(t){for(var n=0,r=t.tiles.length;n=.05){for(var i="",r=t.split("\n"),e=r_.slice(0,Math.round(n/.1)),o=0,s=r.length;o0&&(i+="\n"),i+=r[o].split("").join(e);return i}return t}function o_(){return i_||(i_=KM(1,1).getContext("2d")),i_}function s_(t,n){return o_().measureText(t).width+(t.length-1)*n}var u_={};function a_(t,n,i,r){if(-1!==t.indexOf("\n")){for(var e=t.split("\n"),o=[],s=0,u=e.length;s1){var c=o_();c.font=n;for(var l=c.measureText("M").width*i,v="",d=[],p=0,y=f.length;p1;++g){var x=d[g];if(s_(x,r)<.35*l){var M=g>0?s_(d[g-1],r):1/0,_=g.7*l&&s_(E,r)<.6*l){var T=j.split(" "),A=T.pop();s_(A,r)<.2*l&&(d[S]=T.join(" "),d[S+1]=A+" "+E),O-=1}}h=d.join("\n")}else h=t;h=e_(h,r),u_[a]=h}return h}var h_,f_=/font-family: ?([^;]*);/,c_=/("|')/g;function l_(t){if(!h_){h_={};for(var n=document.styleSheets,i=0,r=n.length;i0&&"string"==typeof a[0]&&a[0]in aM);if(!l&&pM(f)&&(f=rb(f,c),l=!0),l){var v=function(t,n){var i=bM(t,n);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(f,c);h[i]=v.evaluate.bind(v)}else"color"==c.type&&(f=nb.parse(f)),h[i]=function(){return f}}return b_.zoom=r,h[i](b_,e,s)}function M_(t,n,i,r){return x_(t,"layout","icon-allow-overlap",n,i,r)?x_(t,"layout","icon-ignore-placement",n,i,r)?"none":"obstacle":"declutter"}function __(t,n,i,r,e){return e||console.warn("No filterCache provided to evaluateFilter()"),t in e||(e[t]=OM(n).filter),b_.zoom=r,e[t](b_,i)}var S_=!1;function O_(t,n){if(t){if(!S_&&(0===t.a||0===n))return;var i=t.a;return n=void 0===n?1:n,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*n+")"}return t}var j_=/^([^]*)\{(.*)\}([^]*)$/;function E_(t,n){var i;do{if(i=t.match(j_)){var r=n[i[2]]||"";t=i[1]+r+i[3]}}while(i);return t}var T_=!1;function A_(t,n,i,r,e,o,s){if(void 0===r&&(r=$M),void 0===e&&(e=void 0),void 0===o&&(o=void 0),void 0===s&&(s=void 0),"string"==typeof n&&(n=JSON.parse(n)),8!=n.version)throw new Error("glStyle version 8 required.");var u,a;if(o)if("undefined"!=typeof Image){var h=new Image;h.crossOrigin="anonymous",h.onload=function(){u=h,a=[h.width,h.height],t.changed(),h.onload=null},h.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var f=self;f.postMessage({action:"loadImage",src:o}),f.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(u=t.data.image,a=[u.width,u.height])}))}for(var c,l=function(t){t=t.slice();for(var n=Object.create(null),i=0;i=S.maxzoom)){var C=S.filter;if(!C||__(O,C,d,f,w)){c=S;var k=void 0,I=void 0,N=void 0,L=void 0,z=void 0,R=void 0,F=_.index;if(3==l&&("fill"==S.type||"fill-extrusion"==S.type))if(I=x_(S,"paint",S.type+"-opacity",f,d,m,g),S.type+"-pattern"in P){var G=x_(S,"paint",S.type+"-pattern",f,d,m,g);if(G){var D="string"==typeof G?E_(G,o):G.toString();if(u&&e&&e[D]){++b,(R=A[b])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new Sv({fill:new rv}),A[b]=R),N=R.getFill(),R.setZIndex(F);var q=D+"."+I,U=y[q];if(!U){var B=e[D],X=KM(B.width,B.height),V=X.getContext("2d");V.globalAlpha=I,V.drawImage(u,B.x,B.y,B.width,B.height,0,0,B.width,B.height),U=V.createPattern(X,"repeat"),y[q]=U}N.setColor(U)}}}else k=O_(x_(S,"paint",S.type+"-color",f,d,m,g),I),S.type+"-outline-color"in P&&(z=O_(x_(S,"paint",S.type+"-outline-color",f,d,m,g),I)),z||(z=k),(k||z)&&(++b,(!(R=A[b])||k&&!R.getFill()||!k&&R.getFill()||z&&!R.getStroke()||!z&&R.getStroke()||R.getText())&&(R=new Sv({fill:k?new rv:void 0,stroke:z?new mv:void 0}),A[b]=R),k&&(N=R.getFill()).setColor(k),z&&((L=R.getStroke()).setColor(z),L.setWidth(.5)),R.setZIndex(F));if(1!=l&&"line"==S.type){k=!("line-pattern"in P)&&"line-color"in P?O_(x_(S,"paint","line-color",f,d,m,g),x_(S,"paint","line-opacity",f,d,m,g)):void 0;var W=x_(S,"paint","line-width",f,d,m,g);k&&W>0&&(++b,(R=A[b])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new Sv({stroke:new mv}),A[b]=R),(L=R.getStroke()).setLineCap(x_(S,"layout","line-cap",f,d,m,g)),L.setLineJoin(x_(S,"layout","line-join",f,d,m,g)),L.setMiterLimit(x_(S,"layout","line-miter-limit",f,d,m,g)),L.setColor(k),L.setWidth(W),L.setLineDash(P["line-dasharray"]?x_(S,"paint","line-dasharray",f,d,m,g).map((function(t){return t*W})):null),R.setZIndex(F))}var Y=!1,Z=null,$=0,K=void 0,H=void 0,J=void 0;if((1==l||2==l)&&"icon-image"in j){var Q=x_(S,"layout","icon-image",f,d,m,g);if(Q){K="string"==typeof Q?E_(Q,o):Q.toString();var tt=void 0;if(u&&e&&e[K]){var nt=x_(S,"layout","icon-rotation-alignment",f,d,m,g);if(2==l){var it=n.getGeometry();if(it.getFlatMidpoint||it.getFlatMidpoints){var rt=it.getExtent();if(Math.sqrt(Math.max(Math.pow((rt[2]-rt[0])/i,2),Math.pow((rt[3]-rt[1])/i,2)))>150){var et="MultiLineString"===it.getType()?it.getFlatMidpoints():it.getFlatMidpoint();if(y_||(y_=new fg("Point",p_=[NaN,NaN],[],{},null)),tt=y_,p_[0]=et[0],p_[1]=et[1],"line"===x_(S,"layout","symbol-placement",f,d,m,g)&&"map"===nt)for(var ot=it.getStride(),st=it.getFlatCoordinates(),ut=0,at=st.length-ot;ut=vt&&et[0]<=pt&&et[1]>=dt&&et[1]<=yt){$=Math.atan2(ft-lt,ct-ht);break}}}}}if(2!==l||tt){var mt=x_(S,"layout","icon-size",f,d,m,g),wt=void 0!==P["icon-color"]?x_(S,"paint","icon-color",f,d,m,g):null;if(!wt||0!==wt.a){var gt=K+"."+mt;if(null!==wt&&(gt+="."+wt),!(H=p[gt])){var bt=e[K],xt=M_(S,f,d,m);H=new yv({color:wt?[255*wt.r,255*wt.g,255*wt.b,wt.a]:void 0,img:u,imgSize:a,size:[bt.width,bt.height],offset:[bt.x,bt.y],rotateWithView:"map"===nt,scale:mt/bt.pixelRatio,displacement:"icon-offset"in j?x_(S,"layout","icon-offset",f,d,m,g).map((function(t){return-t*bt.pixelRatio})):void 0,declutterMode:xt}),p[gt]=H}}H&&(++b,(R=A[b])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new Sv,A[b]=R),R.setGeometry(tt),H.setRotation($+ZM(x_(S,"layout","icon-rotate",f,d,m,g))),H.setOpacity(x_(S,"paint","icon-opacity",f,d,m,g)),H.setAnchor(w_[x_(S,"layout","icon-anchor",f,d,m,g)]),R.setImage(H),Z=R.getText(),R.setText(void 0),R.setZIndex(F),Y=!0,J=!1)}else J=!0}}}if(1==l&&"circle"===S.type){++b,(R=A[b])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new Sv,A[b]=R);var Mt="circle-radius"in P?x_(S,"paint","circle-radius",f,d,m,g):5,_t=O_(x_(S,"paint","circle-stroke-color",f,d,m,g),x_(S,"paint","circle-stroke-opacity",f,d,m,g)),St=O_(x_(S,"paint","circle-color",f,d,m,g),x_(S,"paint","circle-opacity",f,d,m,g)),Ot=x_(S,"paint","circle-stroke-width",f,d,m,g),jt=Mt+"."+_t+"."+St+"."+Ot;(H=p[jt])||(H=new iv({radius:Mt,stroke:_t&&Ot>0?new mv({width:Ot,color:_t}):void 0,fill:St?new rv({color:St}):void 0,declutterMode:"none"}),p[jt]=H),R.setImage(H),Z=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(F),Y=!0}var Et=void 0,Tt=void 0,At=void 0,Pt=void 0,Ct=void 0,kt=void 0;if("text-field"in j){Pt=Math.round(x_(S,"layout","text-size",f,d,m,g));var It=x_(S,"layout","text-font",f,d,m,g);At=x_(S,"layout","text-line-height",f,d,m,g),(Tt=BM(s?s(It):It,Pt,At)).includes("sans-serif")||(Tt+=",sans-serif"),Ct=x_(S,"layout","text-letter-spacing",f,d,m,g),kt=x_(S,"layout","text-max-width",f,d,m,g);var Nt=x_(S,"layout","text-field",f,d,m,g);Et="object"==typeof Nt&&Nt.sections?1===Nt.sections.length?Nt.toString():Nt.sections.reduce((function(t,n,i){var r=n.fontStack?n.fontStack.split(","):It,e=BM(s?s(r):r,Pt*(n.scale||1),At),o=n.text;if("\n"===o)return t.push("\n",""),t;if(2!=l){for(var u=0,a=(o=a_(o,e,kt,Ct).split("\n")).length;u0&&t.push("\n",""),t.push(o[u],e);return t}t.push(e_(o,Ct),e)}),[]):E_(Nt,o).trim(),I=x_(S,"paint","text-opacity",f,d,m,g)}if(Et&&I&&!J){Y||(++b,(R=A[b])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new Sv,A[b]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(Z||new Ev({padding:[2,2,2,2]})),Z=R.getText();var Lt=j["text-transform"];"uppercase"==Lt?Et=Array.isArray(Et)?Et.map((function(t,n){return n%2?t:t.toUpperCase()})):Et.toUpperCase():"lowercase"==Lt&&(Et=Array.isArray(Et)?Et.map((function(t,n){return n%2?t:t.toLowerCase()})):Et.toLowerCase());var zt=Array.isArray(Et)?Et:2==l?e_(Et,Ct):a_(Et,Tt,kt,Ct);Z.setText(zt),Z.setFont(Tt),Z.setRotation(ZM(x_(S,"layout","text-rotate",f,d,m,g)));var Rt=x_(S,"layout","text-anchor",f,d,m,g),Ft=Y||1==l?"point":x_(S,"layout","symbol-placement",f,d,m,g);Z.setPlacement(Ft),Z.setOverflow("point"===Ft);var Gt=x_(S,"paint","text-halo-width",f,d,m,g),Dt=x_(S,"layout","text-offset",f,d,m,g),qt=x_(S,"paint","text-translate",f,d,m,g),Ut=0,Bt=0;if("point"==Ft){var Xt="center";-1!==Rt.indexOf("left")?(Xt="left",Bt=Gt):-1!==Rt.indexOf("right")&&(Xt="right",Bt=-Gt),Z.setTextAlign(Xt);var Vt=x_(S,"layout","text-rotation-alignment",f,d,m,g);Z.setRotateWithView("map"==Vt)}else Z.setMaxAngle(ZM(x_(S,"layout","text-max-angle",f,d,m,g))*Et.length/zt.length),Z.setTextAlign(),Z.setRotateWithView(!1);var Wt="middle";0==Rt.indexOf("bottom")?(Wt="bottom",Ut=-Gt-.5*(At-1)*Pt):0==Rt.indexOf("top")&&(Wt="top",Ut=Gt+.5*(At-1)*Pt),Z.setTextBaseline(Wt),Z.setOffsetX(Dt[0]*Pt+Bt+qt[0]),Z.setOffsetY(Dt[1]*Pt+Ut+qt[1]),T.setColor(O_(x_(S,"paint","text-color",f,d,m,g),I)),Z.setFill(T);var Yt=O_(x_(S,"paint","text-halo-color",f,d,m,g),I);if(Yt){E.setColor(Yt),Gt*=2;var Zt=.5*Pt;E.setWidth(Gt<=Zt?Gt:Zt),Z.setStroke(E)}else Z.setStroke(void 0);var $t=x_(S,"layout","text-padding",f,d,m,g),Kt=Z.getPadding();$t!==Kt[0]&&(Kt[0]=$t,Kt[1]=$t,Kt[2]=$t,Kt[3]=$t),R.setZIndex(F)}}}}return b>-1?(A.length=b+1,T_&&("function"==typeof n.set?n.set("mapbox-layer",c):n.getProperties()["mapbox-layer"]=c),A):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",d),t.set("mapbox-featurestate",{}),P}function P_(t,n){n.accessToken||(n=A({},n),new URL(t).searchParams.forEach((function(t,i){n.accessToken=t,n.accessTokenParam=i})));return n}function C_(t,n,i,r,e){var o,s,u;return void 0===i&&(i=""),void 0===r&&(r={}),void 0===e&&(e=void 0),"string"==typeof r?(o=r,u={}):(o=r.styleUrl,u=r),e||(e=u.resolutions),o||"string"!=typeof n||n.trim().startsWith("{")||(o=n),o&&(o=o.startsWith("data:")?location.href:WM(o,u.accessToken),u=P_(o,u)),new Promise((function(r,a){QM(n,u).then((function(n){if(8!=n.version)return a(new Error("glStyle version 8 required."));if(!(t instanceof lg||t instanceof Rg))return a(new Error("Can only apply to VectorLayer or VectorTileLayer"));var h,f,c,l=t instanceof Rg?"vector":"geojson";if(i?s=Array.isArray(i)?n.layers.find((function(t){return t.id===i[0]})).source:i:(s=Object.keys(n.sources).find((function(t){return n.sources[t].type===l})),i=s),!s)return a(new Error("No "+l+" source found in the glStyle."));function v(){if(t instanceof Rg)return z_(n.sources[s],o,u).then((function(n){var i=t.getSource();if(i?n!==i&&(i.setTileUrlFunction(n.getTileUrlFunction()),i.ze||(i.ze=n.ze),i.getAttributions()||i.setAttributions(n.getAttributions()),i.getTileLoadFunction()===Uy&&i.setTileLoadFunction(n.getTileLoadFunction()),Sr(i.getProjection(),n.getProjection())&&(i.tileGrid=n.getTileGrid())):t.setSource(n),!isFinite(t.getMaxResolution())&&!isFinite(t.getMinZoom())){var r=t.getSource().getTileGrid();t.setMaxResolution(r.getResolution(r.getMinZoom()))}}));var i=n.sources[s],r=t.getSource();r&&r.get("mapbox-source")===i||(r=F_(i,o,u));var e=t.getSource();return e?r!==e&&(e.getAttributions()||e.setAttributions(r.getAttributions()),e.ze||(e.ze=r.getFormat()),e.Fe=r.getUrl()):t.setSource(r),Promise.resolve()}function d(){c||n.sprite&&!h?c?(t.setStyle(c),v().then(r).catch(a)):a(new Error("Something went wrong trying to apply style.")):(c=A_(t,n,i,e,h,f,d_),t.getStyle()?v().then(r).catch(a):a(new Error("Nothing to show for source ["+s+"]")))}if(n.sprite){var p=new URL(function(t,n,i){var r=VM(t);if(!r)return decodeURI(new URL(t,i).href);var e="sprites/";if(0!==r.indexOf(e))throw new Error("unexpected sprites url: "+t);var o=r.slice(e.length);return XM+"/styles/v1/"+o+"/sprite?access_token="+n}(n.sprite,u.accessToken,o||location.href)),y=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",m=p.origin+p.pathname+y+".json"+p.search;new Promise((function(t,n){JM("Sprite",m,u).then(t).catch((function(i){JM("Sprite",m=p.origin+p.pathname+".json"+p.search,u).then(t).catch(n)}))})).then((function(t){void 0===t&&a(new Error("No sprites found.")),h=t,f=p.origin+p.pathname+y+".png"+p.search,d()})).catch((function(t){a(new Error("Sprites cannot be loaded: "+m+": "+t.message))}))}else d()})).catch(a)}))}var k_={};function I_(t,n){var i={id:n.id,type:n.type},r={};function e(e){var o=n.layout||{},s=n.paint||{};i.paint=s;var u,a,h="function"==typeof t.getSource?t.getSource().getTileGrid().getZForResolution(e):t.getView().getZoom(),f="function"==typeof t.getTargetElement?t.getTargetElement():void 0;if(void 0!==s["background-color"]&&(u=x_(i,"paint","background-color",h,k_,r),f&&(f.style.background=nb.parse(u).toString())),void 0!==s["background-opacity"]&&(a=x_(i,"paint","background-opacity",h,k_,r),f&&(f.style.opacity=a)),"none"!=o.visibility)return O_(u,a);f&&(f.style.backgroundColor="",f.style.opacity="")}if("function"==typeof t.getTargetElement)t.getTargetElement()&&e(),t.on(["change:resolution","change:target"],e);else{if("function"!=typeof t.setBackground)throw new Error("Unable to apply background.");t.setBackground(e)}}function N_(t,n){n.layers.some((function(n){if("background"===n.type)return I_(t,n),!0}))}function L_(t){var n=t.bounds;if(n){var i=_r([n[0],n[1]]),r=_r([n[2],n[3]]);return[i[0],i[1],r[0],r[1]]}}function z_(t,n,i){return new Promise((function(r,e){n_(t,n,i).then((function(t){var n=new Gm({tileJSON:t}),i=n.getTileJSON(),e=n.getTileGrid(),o=L_(i),s=i.minzoom||0,u=i.maxzoom||22,a={attributions:n.getAttributions(),format:new Lg,tileGrid:new xf({origin:e.getOrigin(0),extent:o||e.getExtent(),minZoom:s,resolutions:$M.slice(0,u+1),tileSize:512})};Array.isArray(i.tiles)?a.urls=i.tiles:a.url=i.tiles,t.olSourceOptions&&Object.assign(a,t.olSourceOptions),r(new qy(a))})).catch(e)}))}var R_=new Zg;function F_(t,n,i){var r=t.data,e={};if("string"==typeof r){var o=YM(r,i.accessToken,i.accessTokenParam||"access_token",n||location.href);if(i.transformRequest){var s=i.transformRequest(o,"GeoJSON");s instanceof Request&&(o=encodeURI(s.url))}e.url=o}else e.features=R_.readFeatures(r,{featureProjection:Cr()||"EPSG:3857"});var u=new ad(A({attributions:t.attribution,format:R_},e));return u.set("mapbox-source",t),u}var G_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),D_=function(t){function n(n){var i=t.call(this,z)||this;return i.error=n,i}return G_(n,t),n}(c),q_=function(t){function n(n){var i=this,r=!("declutter"in n)||n.declutter,e=new qy({state:"loading",format:new Lg});i=t.call(this,{source:e,background:n.background,declutter:r,className:n.className,opacity:n.opacity,visible:n.visible,zIndex:n.zIndex,minResolution:n.minResolution,maxResolution:n.maxResolution,minZoom:n.minZoom,maxZoom:n.maxZoom,renderOrder:n.renderOrder,renderBuffer:n.renderBuffer,renderMode:n.renderMode,map:n.map,updateWhileAnimating:n.updateWhileAnimating,updateWhileInteracting:n.updateWhileInteracting,preload:n.preload,useInterimTilesOnError:n.useInterimTilesOnError,properties:n.properties})||this,n.accessToken&&(i.accessToken=n.accessToken);var o=n.styleUrl;return C_(i,o,n.layers||n.source,{accessToken:i.accessToken}).then((function(){e.setState("ready")})).catch((function(t){i.dispatchEvent(new D_(t)),i.getSource().setState("error")})),void 0===i.getBackground()&&function(t,n,i){void 0===i&&(i={}),"object"==typeof n?(N_(t,n),Promise.resolve()):QM(n,i).then((function(n){N_(t,n)}))}(i,n.styleUrl,{accessToken:i.accessToken}),i}return G_(n,t),n}(Rg),U_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),B_=function(t){function n(n){var i=this,r=n||{},e=A({},r);return delete e.imageRatio,(i=t.call(this,e)||this).lv=void 0!==r.imageRatio?r.imageRatio:1,i}return U_(n,t),n.prototype.getImageRatio=function(){return this.lv},n.prototype.createRenderer=function(){return new qw(this)},n}($m),X_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),V_=function(t){function n(n){var i=this,r=A({},n);return(i=t.call(this,r)||this).vv=Yl(n.style),i.dv=n.style.variables||{},i.pv=!!n.disableHitDetection,i}return X_(n,t),n.prototype.createRenderer=function(){return new Hm(this,{vertexShader:this.vv.builder.getSymbolVertexShader(),fragmentShader:this.vv.builder.getSymbolFragmentShader(),hitVertexShader:!this.pv&&this.vv.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.pv&&this.vv.builder.getSymbolFragmentShader(!0),uniforms:this.vv.uniforms,attributes:this.vv.attributes})},n.prototype.updateStyleVariables=function(t){A(this.dv,t),this.changed()},n}(ls),W_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Y_(t,n){var i="\n attribute vec2 ".concat(al.TEXTURE_COORD,";\n uniform mat4 ").concat(ul.TILE_TRANSFORM,";\n uniform float ").concat(ul.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(ul.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(ul.TEXTURE_RESOLUTION,";\n uniform float ").concat(ul.TEXTURE_ORIGIN_X,";\n uniform float ").concat(ul.TEXTURE_ORIGIN_Y,";\n uniform float ").concat(ul.DEPTH,";\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ").concat(al.TEXTURE_COORD,";\n v_mapCoord = vec2(\n ").concat(ul.TEXTURE_ORIGIN_X," + ").concat(ul.TEXTURE_RESOLUTION," * ").concat(ul.TEXTURE_PIXEL_WIDTH," * v_textureCoord[0],\n ").concat(ul.TEXTURE_ORIGIN_Y," - ").concat(ul.TEXTURE_RESOLUTION," * ").concat(ul.TEXTURE_PIXEL_HEIGHT," * v_textureCoord[1]\n );\n gl_Position = ").concat(ul.TILE_TRANSFORM," * vec4(").concat(al.TEXTURE_COORD,", ").concat(ul.DEPTH,", 1.0);\n }\n "),r={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:n},e=[];if(void 0!==t.color){var o=Cl(r,t.color,wl);e.push("color = ".concat(o,";"))}if(void 0!==t.contrast){var s=Cl(r,t.contrast,yl);e.push("color.rgb = clamp((".concat(s," + 1.0) * color.rgb - (").concat(s," / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.exposure){var u=Cl(r,t.exposure,yl);e.push("color.rgb = clamp((".concat(u," + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.saturation){var a=Cl(r,t.saturation,yl);e.push("\n float saturation = ".concat(a," + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n "))}if(void 0!==t.gamma){var h=Cl(r,t.gamma,yl);e.push("color.rgb = pow(color.rgb, vec3(1.0 / ".concat(h,"));"))}if(void 0!==t.brightness){var f=Cl(r,t.brightness,yl);e.push("color.rgb = clamp(color.rgb + ".concat(f,", vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}var c={},l=r.variables.length;if(l>1&&!t.variables)throw new Error("Missing variables in style (expected ".concat(r.variables,")"));for(var v=function(n){var i=r.variables[n];if(!(i in t.variables))throw new Error("Missing '".concat(i,"' in style variables"));var e=ql(i);c[e]=function(){var n=t.variables[i];return"string"==typeof n&&(n=Al(r,n)),void 0!==n?n:-9999999}},d=0;d ").concat(ul.RENDER_EXTENT,"[2] ||\n v_mapCoord[1] > ").concat(ul.RENDER_EXTENT,"[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(").concat(ul.TILE_TEXTURE_ARRAY,"[0], v_textureCoord);\n\n ").concat(e.join("\n"),"\n\n if (color.a == 0.0) {\n discard;\n }\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ").concat(ul.TRANSITION_ALPHA,";\n }"),uniforms:c,paletteTextures:r.paletteTextures}}var Z_=function(t){function n(n){var i=this,r=n?A({},n):{},e=r.style||{};delete r.style;var o=r.cacheSize;return delete r.cacheSize,(i=t.call(this,r)||this).yv=r.sources,i.mv=null,i.Ic=NaN,i.H=e,i.Jt=o,i.dv=i.H.variables||{},i.addChangeListener(ns,i.wv),i}return W_(n,t),n.prototype.getSources=function(t,n){var i=this.getSource();return this.yv?"function"==typeof this.yv?this.yv(t,n):this.yv:i?[i]:[]},n.prototype.getRenderSource=function(){return this.mv||this.getSource()},n.prototype.getSourceState=function(){var t=this.getRenderSource();return t?t.getState():"undefined"},n.prototype.wv=function(){this.getSource()&&this.setStyle(this.H)},n.prototype.gv=function(){var t=Number.MAX_SAFE_INTEGER,n=this.getSources([-t,-t,t,t],t);return n&&n.length&&"bandCount"in n[0]?n[0].bandCount:4},n.prototype.createRenderer=function(){var t=Y_(this.H,this.gv());return new pl(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.Jt,paletteTextures:t.paletteTextures})},n.prototype.renderSources=function(t,n){for(var i,r=this.getRenderer(),e=0,o=n.length;e.5*r.resolution){var f=this.getSources(t.extent,this.Ic).filter((function(t){return!e.includes(t)}));if(f.length>0)return this.renderSources(t,f)}return h},n.prototype.setStyle=function(t){this.dv=t.variables||{},this.H=t;var n=Y_(this.H,this.gv());this.getRenderer().reset({vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms,paletteTextures:n.paletteTextures}),this.changed()},n.prototype.updateStyleVariables=function(t){A(this.dv,t),this.changed()},n}(am);Z_.prototype.dispose;var $_=Z_,K_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),H_="addfeatures",J_=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.features=r,o.file=i,o.projection=e,o}return K_(n,t),n}(c),Q_=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{handleEvent:S})||this).on,i.once,i.un,i.bv=!1,i.xv=[];for(var e=r.formatConstructors?r.formatConstructors:[],o=0,s=e.length;o0){this._v&&(this._v.clear(),this._v.addFeatures(c)),this.dispatchEvent(new J_(H_,t,c,o));break}}},n.prototype.jv=function(){var t=this.getMap();if(t){var n=this.target?this.target:t.getViewport();this.Mv=[$(n,U,this.handleDrop,this),$(n,D,this.handleStop,this),$(n,q,this.handleStop,this),$(n,U,this.handleStop,this)]}},n.prototype.setActive=function(n){!this.getActive()&&n&&this.jv(),this.getActive()&&!n&&this.Ev(),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Ev(),t.prototype.setMap.call(this,n),this.getActive()&&this.jv()},n.prototype.Ov=function(t,n,i){try{return t.readFeatures(n,i)}catch(t){return null}},n.prototype.Ev=function(){this.Mv&&(this.Mv.forEach(H),this.Mv=null)},n.prototype.handleDrop=function(t){for(var n=t.dataTransfer.files,i=0,r=n.length;i1?1:-1;return n.endInteraction(this.Fr,i),this.je=0,!1},n.prototype.handleDownEvent=function(t){return!!La(t)&&(!!this.Zr(t)&&(t.map.getView().beginInteraction(),this.Kr=void 0,this.Tv=void 0,!0))},n}(Ma),iS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rS=function(t){function n(n,i,r){var e=t.call(this)||this;if(void 0!==r&&void 0===i)e.setFlatCoordinates(r,n);else{var o=i||0;e.setCenterAndRadius(n,o,r)}return e}return iS(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){var e=this.flatCoordinates,o=t-e[0],s=n-e[1],u=o*o+s*s;if(u=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Rn(t,this.intersectsCoordinate.bind(this)))}return!1},n.prototype.setCenter=function(t){var n=this.stride,i=this.flatCoordinates[n]-this.flatCoordinates[0],r=t.slice();r[n]=r[0]+i;for(var e=1;e=this.Uv?(this.Cv=n.pixel,this.Pv=!this.Lv,i=!0):this.Iv=void 0,this.Pv&&void 0!==this.kv&&(clearTimeout(this.kv),this.kv=void 0));return this.Lv&&n.type===su.POINTERDRAG&&null!==this.Xv?(this.Qv(n.coordinate),r=!1):this.Lv&&n.type===su.POINTERDOWN?r=!1:i&&this.getPointerCount()<2?(r=n.type===su.POINTERMOVE)&&this.Lv?(this.Zn(n),this.Pv&&n.originalEvent.preventDefault()):("mouse"===n.originalEvent.pointerType||n.type===su.POINTERDRAG&&void 0===this.kv)&&this.Zn(n):n.type===su.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,n)&&r},n.prototype.handleDownEvent=function(t){return this.Pv=!this.Lv,this.Lv?(this.Cv=t.pixel,this.Bv||this.td(t.coordinate),!0):this.Zr(t)?(this.Iv=Date.now(),this.kv=setTimeout(function(){this.Zn(new ou(su.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.Uv),this.Cv=t.pixel,!0):(this.Iv=void 0,!1)},n.prototype.handleUpEvent=function(t){var n=!0;if(0===this.getPointerCount())if(this.kv&&(clearTimeout(this.kv),this.kv=void 0),this.Zn(t),this.Pv){var i=!this.Bv;i&&this.td(t.coordinate),!i&&this.Lv?this.finishDrawing():this.Lv||i&&this.pe!==sS||(this.rd(t.pixel)?this.Dv(t)&&this.finishDrawing():this.Qv(t.coordinate)),n=!1}else this.Lv&&this.abortDrawing();return!n&&this.Rv&&t.preventDefault(),n},n.prototype.Zn=function(t){if(this.Nv=t.originalEvent.pointerType,this.Cv&&(!this.Lv&&this.Pv||this.Lv&&!this.Pv)){var n=this.Cv,i=t.pixel,r=n[0]-i[0],e=n[1]-i[1],o=r*r+e*e;if(this.Pv=this.Lv?o>this.$v:o<=this.$v,!this.Pv)return}this.Bv?this.ed(t.coordinate):this.od(t.coordinate.slice())},n.prototype.rd=function(t){var n=!1;if(this.Xv){var i=!1,r=[this.Bv],e=this.pe;if(e===sS)n=!0;else if(e===hS)n=2===this.Wv.length;else if(e===uS)i=this.Wv.length>this.Fv;else if(e===aS){var o=this.Wv;i=o[0].length>this.Fv,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),u=0,a=r.length;u=this.Gv&&(this.Lv?i.pop():n=!0),i.push(t.slice()),this.Bu(i,r,e)):o===aS&&((i=this.Wv[0]).length>=this.Gv&&(this.Lv?i.pop():n=!0),i.push(t.slice()),n&&(this.Bv=i[0]),this.Bu(this.Wv,r,e)),this.od(t.slice()),this.sd(),n&&this.finishDrawing()},n.prototype.removeLastPoint=function(){if(this.Xv){var t,n=this.Xv.getGeometry(),i=this.getMap().getView().getProjection(),r=this.pe;if(r===uS||r===hS){if((t=this.Wv).splice(-2,1),t.length>=2){this.Bv=t[t.length-2].slice();var e=this.Bv.slice();t[t.length-1]=e,this.od(e)}this.Bu(t,n,i),"Polygon"===n.getType()&&this.Yv&&this.ud(n)}else if(r===aS){(t=this.Wv[0]).splice(-2,1);var o=this.Yv.getGeometry();if(t.length>=2){e=t[t.length-2].slice();t[t.length-1]=e,this.od(e)}o.setCoordinates(t),this.Bu(this.Wv,n,i)}1===t.length&&this.abortDrawing(),this.sd()}},n.prototype.finishDrawing=function(){var t=this.ad();if(t){var n=this.Wv,i=t.getGeometry(),r=this.getMap().getView().getProjection();this.pe===uS?(n.pop(),this.Bu(n,i,r)):this.pe===aS&&(n[0].pop(),this.Bu(n,i,r),n=i.getCoordinates()),"MultiPoint"===this.rl?t.setGeometry(new Kw([n])):"MultiLineString"===this.rl?t.setGeometry(new rg([n])):"MultiPolygon"===this.rl&&t.setGeometry(new sg([n])),this.dispatchEvent(new vS(cS,t)),this.Re&&this.Re.push(t),this._v&&this._v.addFeature(t)}},n.prototype.ad=function(){this.Bv=null;var t=this.Xv;return this.Xv=null,this.Vv=null,this.Yv=null,this.Kv.getSource().clear(!0),t},n.prototype.abortDrawing=function(){var t=this.ad();t&&this.dispatchEvent(new vS(lS,t))},n.prototype.appendCoordinates=function(t){var n,i=this.pe,r=!this.Xv;if(r&&this.td(t[0]),i===uS||i===hS)n=this.Wv;else{if(i!==aS)return;n=this.Wv&&this.Wv.length?this.Wv[0]:[]}r&&n.shift(),n.pop();for(var e=0;ec?o[1]:o[0]),s}}return null},n.prototype.Zn=function(t){var n=t.pixel,i=t.map,r=this.wd(n,i);r||(r=i.getCoordinateFromPixelInternal(n)),this.gd(r)},n.prototype.bd=function(t){var n=this.vd;return n?t?n.setGeometry(Ze(t)):n.setGeometry(void 0):(n=new Et(t?Ze(t):{}),this.vd=n,this.yd.getSource().addFeature(n)),n},n.prototype.gd=function(t){var n=this.dd;n?n.getGeometry().setCoordinates(t):(n=new Et(new Se(t)),this.dd=n,this.md.getSource().addFeature(n));return n},n.prototype.handleEvent=function(n){return!n.originalEvent||!this.Zr(n)||(n.type!=su.POINTERMOVE||this.handlingDownUpSequence||this.Zn(n),t.prototype.handleEvent.call(this,n),!1)},n.prototype.handleDownEvent=function(t){var n=t.pixel,i=t.map,r=this.getExtentInternal(),e=this.wd(n,i),o=function(t){var n=null,i=null;return t[0]==r[0]?n=r[2]:t[0]==r[2]&&(n=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==n&&null!==i?[n,i]:null};if(e&&r){var s=e[0]==r[0]||e[0]==r[2]?e[0]:null,u=e[1]==r[1]||e[1]==r[3]?e[1]:null;null!==s&&null!==u?this.hd=gS(o(e)):null!==s?this.hd=bS(o([s,r[1]]),o([s,r[3]])):null!==u&&(this.hd=bS(o([r[0],u]),o([r[2],u])))}else e=i.getCoordinateFromPixelInternal(n),this.setExtent([e[0],e[1],e[0],e[1]]),this.hd=gS(e);return!0},n.prototype.handleDragEvent=function(t){if(this.hd){var n=t.coordinate;this.setExtent(this.hd(n)),this.gd(n)}},n.prototype.handleUpEvent=function(t){this.hd=null;var n=this.getExtentInternal();return n&&0!==Fn(n)||this.setExtent(null),!1},n.prototype.setMap=function(n){this.yd.setMap(n),this.md.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getExtent=function(){return Nr(this.getExtentInternal(),this.getMap().getView().getProjection())},n.prototype.getExtentInternal=function(){return this.st},n.prototype.setExtent=function(t){this.st=t||null,this.bd(t),this.dispatchEvent(new mS(this.st))},n}(Ma),MS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function _S(t){return parseFloat(t)}function SS(t){return function(t){return pi(t,5)}(t).toString()}function OS(t,n){return!isNaN(t)&&t!==_S(SS(n))}var jS=function(t){function n(n){var i,r=t.call(this)||this,e=A({animate:!0,replace:!1,prefix:""},n||{});return i=!0===e.animate?{duration:250}:e.animate?e.animate:null,r.xd=i,r.Md=e.replace,r._d=e.prefix,r.gn=[],r.Sd=!0,r.Jv=r.Jv.bind(r),r}return MS(n,t),n.prototype.Od=function(t){return this._d?this._d+t:t},n.prototype.jd=function(t,n){return t.get(this.Od(n))},n.prototype.Ed=function(t,n,i){t.set(this.Od(n),i)},n.prototype.Td=function(t,n){t.delete(this.Od(n))},n.prototype.setMap=function(n){var i=this.getMap();t.prototype.setMap.call(this,n),n!==i&&(i&&this.Ev(i),n&&(this.Sd=!0,this.Jv(),this.jv(n)))},n.prototype.jv=function(t){this.gn.push($(t,pu,this.Ad,this),$(t.getLayerGroup(),L,this.Ad,this),$(t,"change:layergroup",this.Pd,this)),this.Md||addEventListener("popstate",this.Jv)},n.prototype.Ev=function(t){for(var n=0,i=this.gn.length;n=0;--r){for(var e=i[r],o=this.qd.length-1;o>=0;--o)this.qd[o][0]===e&&this.qd.splice(o,1);n.remove(e)}},n.prototype.setActive=function(n){this.dd&&!n&&(this.Kv.getSource().removeFeature(this.dd),this.dd=null),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Kv.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getOverlay=function(){return this.Kv},n.prototype.Jd=function(t){t.feature&&this.Re.push(t.feature)},n.prototype.Qd=function(t){t.feature&&this.Re.remove(t.feature)},n.prototype.np=function(t){this.tp(t.element)},n.prototype.$a=function(t){if(!this.Dd){var n=t.target;this.up(n),this.tp(n)}},n.prototype.ip=function(t){var n=t.element;this.up(n)},n.prototype.Bd=function(t,n){var i=n.getCoordinates(),r={feature:t,geometry:n,segment:[i,i]};this.Gd.insert(n.getExtent(),r)},n.prototype.Wd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r=0;--m)this.cp(e[m],s)}return!!this.dd},n.prototype.handleUpEvent=function(t){for(var n=this.qd.length-1;n>=0;--n){var i=this.qd[n][0],r=i.geometry;if("Circle"===r.getType()){var e=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=e,o.segment[1]=e,s.segment[0]=e,s.segment[1]=e,this.Gd.update(En(e),o);var u=r,a=Cr();if(a){var h=t.map.getView().getProjection();u=$e(u=u.clone().transform(a,h)).transform(h,a)}this.Gd.update(u.getExtent(),s)}else this.Gd.update(yn(i.segment),i)}return this.Fd&&(this.dispatchEvent(new kS(CS,this.Fd,t)),this.Fd=null),!1},n.prototype.Zn=function(t){this.zd=t.pixel,this.op(t.pixel,t.map,t.coordinate)},n.prototype.op=function(t,n,i){var r,e,s=this,u=i||n.getCoordinateFromPixel(t),a=n.getView().getProjection();if(this.Hd){var h="object"==typeof this.Hd?function(t){return t===s.Hd}:void 0;n.forEachFeatureAtPixel(t,(function(t,n,i){if("Point"===(i=i||t.getGeometry()).getType()&&y(s.Re.getArray(),t)){e=i;var o=i.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:i,segment:[o,o]}]}return!0}),{layerFilter:h})}if(!r){var f=Nr(mn(Lr(En(u,TS),a),n.getView().getResolution()*this.fd,TS),a);r=this.Gd.getInExtent(f)}if(r&&r.length>0){var c=r.sort((function(t,n){return NS(u,t,a)-NS(u,n,a)}))[0],l=c.segment,v=LS(u,c,a),d=n.getPixelFromCoordinate(v),p=tr(t,d);if(e||p<=this.fd){var m={};if(m[o(l)]=!0,this.ep||(this.Br[0]=v[0]-u[0],this.Br[1]=v[1]-u[1]),"Circle"===c.geometry.getType()&&1===c.index)this.ld=!0,this.hp(v,[c.feature],[c.geometry]);else{var w=n.getPixelFromCoordinate(l[0]),g=n.getPixelFromCoordinate(l[1]),b=Qi(d,w),x=Qi(d,g);p=Math.sqrt(Math.min(b,x)),this.ld=p<=this.fd,this.ld&&(v=b>x?l[1]:l[0]),this.hp(v,[c.feature],[c.geometry]);var M={};M[o(c.geometry)]=!0;for(var _=1,S=r.length;_=0;--e)c=o((f=(i=l[e])[0]).feature),f.depth&&(c+="-"+f.depth.join("-")),c in v||(v[c]={}),0===i[1]?(v[c].right=f,v[c].index=f.index):1==i[1]&&(v[c].left=f,v[c].index=f.index+1);for(c in v){switch(h=v[c].right,u=v[c].left,(a=(s=v[c].index)-1)<0&&(a=0),t=n=(r=(f=void 0!==u?u:h).geometry).getCoordinates(),d=!1,r.getType()){case"MultiLineString":n[f.depth[0]].length>2&&(n[f.depth[0]].splice(s,1),d=!0);break;case"LineString":n.length>2&&(n.splice(s,1),d=!0);break;case"MultiPolygon":t=t[f.depth[1]];case"Polygon":(t=t[f.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),d=!0,0===s&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.fp(r,n);var p=[];if(void 0!==u&&(this.Gd.remove(u),p.push(u.segment[0])),void 0!==h&&(this.Gd.remove(h),p.push(h.segment[1])),void 0!==u&&void 0!==h){var y={depth:f.depth,feature:f.feature,geometry:f.geometry,index:a,segment:p};this.Gd.insert(yn(y.segment),y)}this.lp(r,s,f.depth,-1),this.dd&&(this.Kv.getSource().removeFeature(this.dd),this.dd=null),l.length=0}}return d},n.prototype.fp=function(t,n){this.Dd=!0,t.setCoordinates(n),this.Dd=!1},n.prototype.lp=function(t,n,i,r){this.Gd.forEachInExtent(t.getExtent(),(function(e){e.geometry===t&&(void 0===i||void 0===e.depth||x(e.depth,i))&&e.index>n&&(e.index+=r)}))},n}(Ma),RS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),FS="select",GS=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.selected=i,o.deselected=r,o.mapBrowserEvent=e,o}return RS(n,t),n}(c),DS={};var qS=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r,e,o=n||{};if(i.dp=i.tp.bind(i),i.pp=i.up.bind(i),i.Zr=o.condition?o.condition:Ca,i.yp=o.addCondition?o.addCondition:Pa,i.mp=o.removeCondition?o.removeCondition:Pa,i.wp=o.toggleCondition?o.toggleCondition:Ia,i.gp=!!o.multi&&o.multi,i.bp=o.filter?o.filter:S,i.xp=o.hitTolerance?o.hitTolerance:0,i.H=void 0!==o.style?o.style:(g((r=Mv()).Polygon,r.LineString),g(r.GeometryCollection,r.LineString),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.Re=o.features||new ft,o.layers)if("function"==typeof o.layers)e=o.layers;else{var s=o.layers;e=function(t){return y(s,t)}}else e=S;return i.Mp=e,i._p={},i}return RS(n,t),n.prototype.Sp=function(t,n){this._p[o(t)]=n},n.prototype.getFeatures=function(){return this.Re},n.prototype.getHitTolerance=function(){return this.xp},n.prototype.getLayer=function(t){return this._p[o(t)]},n.prototype.setHitTolerance=function(t){this.xp=t},n.prototype.setMap=function(n){this.getMap()&&this.H&&this.Re.forEach(this.Op.bind(this)),t.prototype.setMap.call(this,n),n?(this.Re.addEventListener(ot,this.dp),this.Re.addEventListener(st,this.pp),this.H&&this.Re.forEach(this.jp.bind(this))):(this.Re.removeEventListener(ot,this.dp),this.Re.removeEventListener(st,this.pp))},n.prototype.tp=function(t){var n=t.element;if(this.H&&this.jp(n),!this.getLayer(n)){var i=this.getMap().getAllLayers().find((function(t){if(t instanceof lg&&t.getSource()&&t.getSource().hasFeature(n))return t}));i&&this.Sp(n,i)}},n.prototype.up=function(t){var n=t.element;this.H&&this.Op(n)},n.prototype.getStyle=function(){return this.H},n.prototype.jp=function(t){var n=o(t);n in DS||(DS[n]=t.getStyle()),t.setStyle(this.H)},n.prototype.Op=function(t){for(var i=this.getMap().getInteractions().getArray(),r=i.length-1;r>=0;--r){var e=i[r];if(e!==this&&e instanceof n&&e.getStyle()&&-1!==e.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(e.getStyle())}var s=o(t);t.setStyle(DS[s]),delete DS[s]},n.prototype.Ep=function(t){delete this._p[o(t)]},n.prototype.handleEvent=function(t){if(!this.Zr(t))return!0;var n=this.yp(t),i=this.mp(t),r=this.wp(t),e=!n&&!i&&!r,o=t.map,s=this.getFeatures(),u=[],a=[];if(e){P(this._p),o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.bp(t,n))return this.Sp(t,n),a.push(t),!this.gp}.bind(this),{layerFilter:this.Mp,hitTolerance:this.xp});for(var h=s.getLength()-1;h>=0;--h){var f=s.item(h),c=a.indexOf(f);c>-1?a.splice(c,1):(s.remove(f),u.push(f))}0!==a.length&&s.extend(a)}else{o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.bp(t,e))return!n&&!r||y(s.getArray(),t)?(i||r)&&y(s.getArray(),t)&&(u.push(t),this.Ep(t)):(this.Sp(t,e),a.push(t)),!this.gp}.bind(this),{layerFilter:this.Mp,hitTolerance:this.xp});for(var l=u.length-1;l>=0;--l)s.remove(u[l]);s.extend(a)}return(a.length>0||u.length>0)&&this.dispatchEvent(new GS(FS,a,u,t)),!0},n}(ma),US=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function BS(t){return t.feature?t.feature:t.element?t.element:void 0}var XS=[],VS=function(t){function n(n){var i=this,r=n||{},e=r;return e.handleDownEvent||(e.handleDownEvent=S),e.stopDown||(e.stopDown=O),(i=t.call(this,e)||this)._v=r.source?r.source:null,i.Tp=void 0===r.vertex||r.vertex,i.Ap=void 0===r.edge||r.edge,i.Re=r.features?r.features:null,i.Pp=[],i.Cp={},i.kp={},i.Ip={},i.fd=void 0!==r.pixelTolerance?r.pixelTolerance:10,i.Gd=new Pv,i.Np={Point:i.Lp.bind(i),LineString:i.zp.bind(i),LinearRing:i.zp.bind(i),Polygon:i.Rp.bind(i),MultiPoint:i.Fp.bind(i),MultiLineString:i.Gp.bind(i),MultiPolygon:i.Dp.bind(i),GeometryCollection:i.qp.bind(i),Circle:i.Up.bind(i)},i}return US(n,t),n.prototype.addFeature=function(t,n){var i=void 0===n||n,r=o(t),e=t.getGeometry();if(e){var s=this.Np[e.getType()];if(s){this.kp[r]=e.getExtent([1/0,1/0,-1/0,-1/0]);var u=[];if(s(u,e),1===u.length)this.Gd.insert(yn(u[0]),{feature:t,segment:u[0]});else if(u.length>1){var a=u.map((function(t){return yn(t)})),h=u.map((function(n){return{feature:t,segment:n}}));this.Gd.load(a,h)}}}i&&(this.Cp[r]=$(t,L,this.$a,this))},n.prototype.Bp=function(t){this.addFeature(t)},n.prototype.Xp=function(t){this.removeFeature(t)},n.prototype.Vp=function(){var t;return this.Re?t=this.Re:this._v&&(t=this._v.getFeatures()),t},n.prototype.handleEvent=function(n){var i=this.snapTo(n.pixel,n.coordinate,n.map);return i&&(n.coordinate=i.vertex.slice(0,2),n.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,n)},n.prototype.np=function(t){var n=BS(t);this.addFeature(n)},n.prototype.ip=function(t){var n=BS(t);this.removeFeature(n)},n.prototype.$a=function(t){var n=t.target;if(this.handlingDownUpSequence){var i=o(n);i in this.Ip||(this.Ip[i]=n)}else this.Wp(n)},n.prototype.handleUpEvent=function(t){var n=C(this.Ip);return n.length&&(n.forEach(this.Wp.bind(this)),this.Ip={}),!1},n.prototype.removeFeature=function(t,n){var i=void 0===n||n,r=o(t),e=this.kp[r];if(e){var s=this.Gd,u=[];s.forEachInExtent(e,(function(n){t===n.feature&&u.push(n)}));for(var a=u.length-1;a>=0;--a)s.remove(u[a])}i&&(H(this.Cp[r]),delete this.Cp[r])},n.prototype.setMap=function(n){var i=this.getMap(),r=this.Pp,e=this.Vp();i&&(r.forEach(H),r.length=0,e.forEach(this.Xp.bind(this))),t.prototype.setMap.call(this,n),n&&(this.Re?r.push($(this.Re,ot,this.np,this),$(this.Re,st,this.ip,this)):this._v&&r.push($(this._v,Qv,this.np,this),$(this._v,id,this.ip,this)),e.forEach(this.Bp.bind(this)))},n.prototype.snapTo=function(t,n,i){var r=yn([i.getCoordinateFromPixel([t[0]-this.fd,t[1]+this.fd]),i.getCoordinateFromPixel([t[0]+this.fd,t[1]-this.fd])]),e=this.Gd.getInExtent(r),o=e.length;if(0===o)return null;var s,u=i.getView().getProjection(),a=Ir(n,u),h=1/0,f=this.fd*this.fd,c=function(){if(s){var n=i.getPixelFromCoordinate(s);if(Qi(t,n)<=f)return{vertex:s,vertexPixel:[Math.round(n[0]),Math.round(n[1])]}}return null};if(this.Tp){for(var l=0;l=0;s--)e.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:e}}};function iO(t,n){var i,r,e;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)e="Point";else if(t.points)e="MultiPoint";else if(t.paths){e=1===t.paths.length?"LineString":"MultiLineString"}else if(t.rings){var o=t,s=rO(o),u=function(t,n){var i,r,e=[],o=[],s=[];for(i=0,r=t.length;i=0;i--){var h=o[i][0];if(xn(new Me(h).getExtent(),new Me(u).getExtent())){o[i].push(u),a=!0;break}}a||o.push([u.reverse()])}return o}(o.rings,s);1===u.length?(e="Polygon",t=A({},t,((i={}).rings=u[0],i))):(e="MultiPolygon",t=A({},t,((r={}).rings=u,r)))}return Eg((0,tO[e])(t),!1,n)}function rO(t){var n=Tt;return!0===t.hasZ&&!0===t.hasM?n=Ct:!0===t.hasZ?n=At:!0===t.hasM&&(n=Pt),n}function eO(t){var n=t.getLayout();return{hasZ:n===At||n===Ct,hasM:n===Pt||n===Ct}}function oO(t,n){return(0,nO[t.getType()])(Eg(t,!0,n),n)}var sO=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this)||this).K=r.geometryName,i}return QS(n,t),n.prototype.readFeatureFromObject=function(t,n,i){var r=t,e=iO(r.geometry,n),o=new Et;if(this.K&&o.setGeometryName(this.K),o.setGeometry(e),r.attributes){o.setProperties(r.attributes,!0);var s=r.attributes[i];void 0!==s&&o.setId(s)}return o},n.prototype.readFeaturesFromObject=function(t,n){var i=n||{};if(t.features){for(var r=[],e=t.features,o=0,s=e.length;o0?i[0]:null},n.prototype.readFeatureFromNode=function(t,n){return null},n.prototype.readFeatures=function(t,n){if(t){if("string"==typeof t){var i=$f(t);return this.readFeaturesFromDocument(i,n)}return Yf(t)?this.readFeaturesFromDocument(t,n):this.readFeaturesFromNode(t,n)}return[]},n.prototype.readFeaturesFromDocument=function(t,n){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&g(i,this.readFeaturesFromNode(r,n));return i},n.prototype.readFeaturesFromNode=function(t,n){return r()},n.prototype.readGeometry=function(t,n){if(t){if("string"==typeof t){var i=$f(t);return this.readGeometryFromDocument(i,n)}return Yf(t)?this.readGeometryFromDocument(t,n):this.readGeometryFromNode(t,n)}return null},n.prototype.readGeometryFromDocument=function(t,n){return null},n.prototype.readGeometryFromNode=function(t,n){return null},n.prototype.readProjection=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readProjectionFromDocument(n)}return Yf(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,n){var i=this.writeFeatureNode(t,n);return this.Jp.serializeToString(i)},n.prototype.writeFeatureNode=function(t,n){return null},n.prototype.writeFeatures=function(t,n){var i=this.writeFeaturesNode(t,n);return this.Jp.serializeToString(i)},n.prototype.writeFeaturesNode=function(t,n){return null},n.prototype.writeGeometry=function(t,n){var i=this.writeGeometryNode(t,n);return this.Jp.serializeToString(i)},n.prototype.writeGeometryNode=function(t,n){return null},n}(jg),hO=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fO="http://www.opengis.net/gml",cO=/^[\s\xa0]*$/,lO=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.featureType=r.featureType,i.featureNS=r.featureNS,i.srsName=r.srsName,i.schemaLocation="",i.FEATURE_COLLECTION_PARSERS={},i.FEATURE_COLLECTION_PARSERS[i.namespace]={featureMember:Hf(i.readFeaturesInternal),featureMembers:Jf(i.readFeaturesInternal)},i.supportedMediaTypes=["application/gml+xml"],i}return hO(n,t),n.prototype.readFeaturesInternal=function(t,n){var i=t.localName,r=null;if("FeatureCollection"==i)r=ac([],this.FEATURE_COLLECTION_PARSERS,t,n,this);else if("featureMembers"==i||"featureMember"==i||"member"==i){var e=n[0],o=e.featureType,s=e.featureNS;if(!o&&t.childNodes){o=[],s={};for(var u=0,a=t.childNodes.length;u0){s={Qp:s};for(var h=0;h0;else{var c=f.getType();u="Point"===c||"MultiPoint"===c}}u&&(a=o.get("name"),(u=u&&!!a)&&a.search(/&[^&]+;/)>-1&&(eE||(eE=document.createElement("textarea")),eE.innerHTML=a,a=eE.value));var l=i;if(t?l=t:n&&(l=hE(n,i,r)),u){var v=function(t,n){var i=[0,0],r="start",e=t.getImage();if(e){var o=e.getSize();if(o&&2==o.length){var s=e.getScaleArray(),u=e.getAnchor();i[0]=s[0]*(o[0]-u[0]),i[1]=s[1]*(o[1]/2-u[1]),r="left"}}var a=t.getText();a?((a=a.clone()).setFont(a.getFont()||iE.getFont()),a.setScale(a.getScale()||iE.getScale()),a.setFill(a.getFill()||iE.getFill()),a.setStroke(a.getStroke()||tE)):a=iE.clone();return a.setText(n),a.setOffsetX(i[0]),a.setOffsetY(i[1]),a.setTextAlign(r),new Sv({image:e,text:a})}(l[0],a);return h.length>0?(v.setGeometry(new Dg(h)),[v,new Sv({geometry:l[0].getGeometry(),image:null,fill:l[0].getFill(),stroke:l[0].getStroke(),text:null})].concat(l.slice(1))):v}return l}}(i.Style,i.styleUrl,this.jy,this.Ay,this.Py);r.setStyle(u)}return delete i.Style,r.setProperties(i,!0),r}},n.prototype.Ny=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=FE.call(this,t,n);if(r){var e=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Ay[e]=r}}},n.prototype.Ly=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=yE.call(this,t,n);if(r){var e,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Ay[e]=r}}},n.prototype.readFeatureFromNode=function(t,n){if(!y(Bj,t.namespaceURI))return null;var i=this.Iy(t,[this.getReadOptions(t,n)]);return i||null},n.prototype.readFeaturesFromNode=function(t,n){if(!y(Bj,t.namespaceURI))return[];var i,r=t.localName;if("Document"==r||"Folder"==r)return(i=this.ky(t,[this.getReadOptions(t,n)]))||[];if("Placemark"==r){var e=this.Iy(t,[this.getReadOptions(t,n)]);return e?[e]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,n);s&&g(i,s)}return i}return[]},n.prototype.readName=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readNameFromDocument(n)}return Yf(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},n.prototype.readNameFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(n);if(i)return i}},n.prototype.readNameFromNode=function(t){for(var n=t.firstElementChild;n;n=n.nextElementSibling)if(y(Bj,n.namespaceURI)&&"name"==n.localName)return xO(n);for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;if(y(Bj,n.namespaceURI)&&("Document"==i||"Folder"==i||"Placemark"==i||"kml"==i)){var r=this.readNameFromNode(n);if(r)return r}}},n.prototype.readNetworkLinks=function(t){var n=[];if("string"==typeof t){var i=$f(t);g(n,this.readNetworkLinksFromDocument(i))}else Yf(t)?g(n,this.readNetworkLinksFromDocument(t)):g(n,this.readNetworkLinksFromNode(t));return n},n.prototype.readNetworkLinksFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&g(n,this.readNetworkLinksFromNode(i));return n},n.prototype.readNetworkLinksFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(Bj,i.namespaceURI)&&"NetworkLink"==i.localName){var r=ac({},Wj,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(Bj,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||g(n,this.readNetworkLinksFromNode(i))}return n},n.prototype.readRegion=function(t){var n=[];if("string"==typeof t){var i=$f(t);g(n,this.readRegionFromDocument(i))}else Yf(t)?g(n,this.readRegionFromDocument(t)):g(n,this.readRegionFromNode(t));return n},n.prototype.readRegionFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&g(n,this.readRegionFromNode(i));return n},n.prototype.readRegionFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(Bj,i.namespaceURI)&&"Region"==i.localName){var r=ac({},Zj,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(Bj,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||g(n,this.readRegionFromNode(i))}return n},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=Xf(Bj[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",Uj[0]),i.setAttributeNS(r,"xmlns:xsi",Bf),i.setAttributeNS(Bf,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var e={node:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=$j[i.namespaceURI],u=oc(o,s);return fc(e,Kj,ec,u,[n],s,this),i},n}(aO);function hE(t,n,i){return Array.isArray(t)?t:"string"==typeof t?hE(i[t],n,i):n}function fE(t){var n=Vf(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(n);if(i){var r=i[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function cE(t){var n=Vf(t,!1),i=[];n=n.replace(/\s*,\s*/g,",");for(var r,e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=e.exec(n);){var o=parseFloat(r[1]),s=parseFloat(r[2]),u=r[3]?parseFloat(r[3]):0;i.push(o,s,u),n=n.substr(r[0].length)}if(""===n)return i}function lE(t){var n=Vf(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function vE(t){var n=Vf(t,!1).trim().replace(/^(?!.*#)/,"#"),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function dE(t){return mO(t)}var pE=sc(Bj,{Pair:function(t,n){var i=ac({},XE,t,n,this);if(!i)return;var r=i.key;if(r&&"normal"==r){var e=i.styleUrl;e&&(n[n.length-1]=e);var o=i.Style;o&&(n[n.length-1]=o)}}});function yE(t,n){return ac(void 0,pE,t,n,this)}var mE=sc(Bj,{Icon:tc((function(t,n){var i=ac({},jE,t,n);return i||null})),color:tc(fE),heading:tc(mO),hotSpot:tc((function(t){var n,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return n="insetPixels"!==i?"insetPixels"!==r?sv:av:"insetPixels"!==r?uv:hv,{x:parseFloat(t.getAttribute("x")),xunits:Xj[i],y:parseFloat(t.getAttribute("y")),yunits:Xj[r],origin:n}})),scale:tc(dE)});var wE=sc(Bj,{color:tc(fE),scale:tc(dE)});var gE=sc(Bj,{color:tc(fE),width:tc(mO)});var bE=sc(Bj,{color:tc(fE),fill:tc(dO),outline:tc(dO)});var xE=sc(Bj,{coordinates:Jf(cE)});function ME(t,n){return ac(null,xE,t,n)}var _E=sc(Uj,{Track:Hf(OE)});var SE=sc(Bj,{when:function(t,n){var i=n[n.length-1].whens,r=Vf(t,!1),e=Date.parse(r);i.push(isNaN(e)?0:e)}},sc(Uj,{coord:function(t,n){var i=n[n.length-1].coordinates,r=Vf(t,!1),e=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(e){var o=parseFloat(e[1]),s=parseFloat(e[2]),u=parseFloat(e[3]);i.push([o,s,u])}else i.push([])}}));function OE(t,n){var i=ac({coordinates:[],whens:[]},SE,t,n);if(i){for(var r=[],e=i.coordinates,o=i.whens,s=0,u=Math.min(e.length,o.length);s0){var r=n[n.length-1];r.push.apply(r,i)}},outerBoundaryIs:function(t,n){var i=ac(void 0,$E,t,n);if(i){n[n.length-1][0]=i}}});function zE(t,n){var i=ac({},AE,t,n),r=ac([null],LE,t,n);if(r&&r[0]){for(var e=r[0],o=[e.length],s=1,u=r.length;s0,f=a.href;f?r=f:h&&(r=Pj);var c,l=sv,v=i.hotSpot;v?(e=[v.x,v.y],o=v.xunits,s=v.yunits,l=v.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(/pushpin/.test(r)?(e=jj,o=Ej,s=Tj):/arrow-reverse/.test(r)?(e=[54,42],o=Ej,s=Tj):/paddle/.test(r)&&(e=[32,1],o=Ej,s=Tj));var d,p=a.x,y=a.y;void 0!==p&&void 0!==y&&(c=[p,y]);var m,w=a.w,g=a.h;void 0!==w&&void 0!==g&&(d=[w,g]);var b=i.heading;void 0!==b&&(m=li(b));var x=i.scale,M=i.color;if(h){r==Pj&&(d=Aj);var _=new yv({anchor:e,anchorOrigin:l,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.Bt,offset:c,offsetOrigin:sv,rotation:m,scale:x,size:d,src:this.Cy(r),color:M}),S=_.getScaleArray()[0],O=_.getSize();if(null===O){var j=_.getImageState();if(j===lo||j===vo){var E=function(){var t=_.getImageState();if(t!==lo&&t!==vo){var n=_.getSize();if(n&&2==n.length){var i=sE(n);_.setScale(S*i)}_.unlistenImageChange(E)}};_.listenImageChange(E),j===lo&&_.load()}}else if(2==O.length){var T=sE(O);_.setScale(S*T)}u.imageStyle=_}else u.imageStyle=Jj}},LabelStyle:function(t,n){var i=ac({},wE,t,n);if(i){var r=n[n.length-1],e=new Ev({fill:new rv({color:"color"in i?i.color:Oj}),scale:i.scale});r.textStyle=e}},LineStyle:function(t,n){var i=ac({},gE,t,n);if(i){var r=n[n.length-1],e=new mv({color:"color"in i?i.color:Oj,width:"width"in i?i.width:1});r.strokeStyle=e}},PolyStyle:function(t,n){var i=ac({},bE,t,n);if(i){var r=n[n.length-1],e=new rv({color:"color"in i?i.color:Oj});r.fillStyle=e;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function FE(t,n){var i=ac({},RE,t,n,this);if(!i)return null;var r,e="fillStyle"in i?i.fillStyle:Hj,o=i.fill;void 0===o||o||(e=null),"imageStyle"in i?i.imageStyle!=Jj&&(r=i.imageStyle):r=Qj;var s="textStyle"in i?i.textStyle:iE,u="strokeStyle"in i?i.strokeStyle:nE,a=i.outline;return void 0===a||a?[new Sv({fill:e,image:r,stroke:u,text:s,zIndex:void 0})]:[new Sv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return"GeometryCollection"===i?new Dg(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"Polygon"!==n&&"MultiPolygon"!==n}))):"Polygon"!==i&&"MultiPolygon"!==i?n:void 0},fill:e,image:r,stroke:u,text:s,zIndex:void 0}),new Sv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return"GeometryCollection"===i?new Dg(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"Polygon"===n||"MultiPolygon"===n}))):"Polygon"===i||"MultiPolygon"===i?n:void 0},fill:e,stroke:null,zIndex:void 0})]}function GE(t,n){var i,r,e,o=n.length,s=new Array(n.length),u=new Array(n.length),a=new Array(n.length);i=!1,r=!1,e=!1;for(var h=0;h0){var m=oc(e,s);fc(r,bT,MT,[{names:s,values:m}],i)}var w=i[0],g=n.getGeometry();g&&(g=Eg(g,!0,w)),fc(r,bT,cT,[g],i)}var ST=sc(Bj,["extrude","tessellate","altitudeMode","coordinates"]),OT=sc(Bj,{extrude:nc(MO),tessellate:nc(MO),altitudeMode:nc(EO),coordinates:nc((function(t,n,i){var r,e=i[i.length-1],o=e.layout,s=e.stride;o==Tt||o==Pt?r=2:o==At||o==Ct?r=3:St(!1,34);var u=n.length,a="";if(u>0){a+=n[0];for(var h=1;h>1):e>>1}return n}function wA(t){for(var n="",i=0,r=t.length;i=32;)n=63+(32|31&t),i+=String.fromCharCode(n),t>>=5;return n=t+63,i+=String.fromCharCode(n)}var xA=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=yr("EPSG:4326"),i.zy=r.factor?r.factor:1e5,i.qv=r.geometryLayout?r.geometryLayout:Tt,i}return cA(n,t),n.prototype.readFeatureFromText=function(t,n){var i=this.readGeometryFromText(t,n);return new Et(i)},n.prototype.readFeaturesFromText=function(t,n){return[this.readFeatureFromText(t,n)]},n.prototype.readGeometryFromText=function(t,n){var i=Zr(this.qv),r=vA(t,i,this.zy);JS(r,0,r.length,i,r);var e=pe(r,0,r.length,i);return Eg(new ng(e,this.qv),!1,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){var i=t.getGeometry();return i?this.writeGeometryText(i,n):(St(!1,40),"")},n.prototype.writeFeaturesText=function(t,n){return this.writeFeatureText(t[0],n)},n.prototype.writeGeometryText=function(t,n){var i=(t=Eg(t,!0,this.adaptOptions(n))).getFlatCoordinates(),r=t.getStride();return JS(i,0,i.length,r,i),lA(i,r,this.zy)},n}(Cj),MA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_A=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.iv=r.layerName,i.Uh=r.layers?r.layers:null,i.dataProjection=yr(r.dataProjection?r.dataProjection:"EPSG:4326"),i}return MA(n,t),n.prototype.readFeaturesFromObject=function(t,n){if("Topology"==t.type){var i=t,r=void 0,e=null,o=null;i.transform&&(e=(r=i.transform).scale,o=r.translate);var s=i.arcs;r&&function(t,n,i){for(var r=0,e=t.length;r0&&r.pop(),i>=0)for(var s=0,u=(a=n[i]).length;s=0;--s)r.push(a[s].slice(0))}return r}function jA(t,n,i,r,e,o,s){for(var u=t.geometries,a=[],h=0,f=u.length;h=2,57),r}return kA(n,t),n}(CA),NA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),LA=function(t){function n(n){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return NA(n,t),n}(IA),zA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),RA=function(t){function n(n,i,r){var e=t.call(this,"BBOX")||this;if(e.geometryName=n,e.extent=i,4!==i.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return e.srsName=r,e}return zA(n,t),n}(CA),FA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),GA=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.geometryName=i||"the_geom",o.geometry=r,o.srsName=e,o}return FA(n,t),n}(CA),DA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qA=function(t){function n(n,i,r){return t.call(this,"Contains",n,i,r)||this}return DA(n,t),n}(GA),UA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),BA=function(t){function n(n,i,r,e,o){var s=t.call(this,"DWithin",n,i,o)||this;return s.distance=r,s.unit=e,s}return UA(n,t),n}(GA),XA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),VA=function(t){function n(n,i,r){return t.call(this,"Disjoint",n,i,r)||this}return XA(n,t),n}(GA),WA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),YA=function(t){function n(n,i){var r=t.call(this,n)||this;return r.propertyName=i,r}return WA(n,t),n}(CA),ZA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$A=function(t){function n(n,i,r){var e=t.call(this,"During",n)||this;return e.begin=i,e.end=r,e}return ZA(n,t),n}(YA),KA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),HA=function(t){function n(n,i,r,e){var o=t.call(this,n,i)||this;return o.expression=r,o.matchCase=e,o}return KA(n,t),n}(YA),JA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),QA=function(t){function n(n,i,r){return t.call(this,"PropertyIsEqualTo",n,i,r)||this}return JA(n,t),n}(HA),tP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nP=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThan",n,i)||this}return tP(n,t),n}(HA),iP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rP=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThanOrEqualTo",n,i)||this}return iP(n,t),n}(HA),eP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oP=function(t){function n(n,i,r){return t.call(this,"Intersects",n,i,r)||this}return eP(n,t),n}(GA),sP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uP=function(t){function n(n,i,r){var e=t.call(this,"PropertyIsBetween",n)||this;return e.lowerBoundary=i,e.upperBoundary=r,e}return sP(n,t),n}(YA),aP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hP=function(t){function n(n,i,r,e,o,s){var u=t.call(this,"PropertyIsLike",n)||this;return u.pattern=i,u.wildCard=void 0!==r?r:"*",u.singleChar=void 0!==e?e:".",u.escapeChar=void 0!==o?o:"!",u.matchCase=s,u}return aP(n,t),n}(YA),fP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cP=function(t){function n(n){return t.call(this,"PropertyIsNull",n)||this}return fP(n,t),n}(YA),lP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vP=function(t){function n(n,i){return t.call(this,"PropertyIsLessThan",n,i)||this}return lP(n,t),n}(HA),dP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pP=function(t){function n(n,i){return t.call(this,"PropertyIsLessThanOrEqualTo",n,i)||this}return dP(n,t),n}(HA),yP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mP=function(t){function n(n){var i=t.call(this,"Not")||this;return i.condition=n,i}return yP(n,t),n}(CA),wP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gP=function(t){function n(n,i,r){return t.call(this,"PropertyIsNotEqualTo",n,i,r)||this}return wP(n,t),n}(HA),bP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xP=function(t){function n(n){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return bP(n,t),n}(IA),MP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_P=function(t){function n(n){var i=t.call(this,"ResourceId")||this;return i.rid=n,i}return MP(n,t),n}(CA),SP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),OP=function(t){function n(n,i,r){return t.call(this,"Within",n,i,r)||this}return SP(n,t),n}(GA);function jP(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(LA,n))}function EP(t,n,i){return new RA(t,n,i)}var TP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),AP={"http://www.opengis.net/gml":{boundedBy:tc(vO.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Hf(vO.prototype.readFeaturesInternal)}},PP={"http://www.opengis.net/wfs":{totalInserted:tc(gO),totalUpdated:tc(gO),totalDeleted:tc(gO)},"http://www.opengis.net/wfs/2.0":{totalInserted:tc(gO),totalUpdated:tc(gO),totalDeleted:tc(gO)}},CP={"http://www.opengis.net/wfs":{TransactionSummary:tc(BP,"transactionSummary"),InsertResults:tc(YP,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:tc(BP,"transactionSummary"),InsertResults:tc(YP,"insertIds")}},kP={"http://www.opengis.net/wfs":{PropertyName:nc(EO)},"http://www.opengis.net/wfs/2.0":{PropertyName:nc(EO)}},IP={"http://www.opengis.net/wfs":{Insert:nc(ZP),Update:nc(JP),Delete:nc(HP),Property:nc(QP),Native:nc(tC)},"http://www.opengis.net/wfs/2.0":{Insert:nc(ZP),Update:nc(JP),Delete:nc(HP),Property:nc(QP),Native:nc(tC)}},NP="feature",LP="http://www.w3.org/2000/xmlns/",zP={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},RP={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},FP={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},GP={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},DP={"2.0.0":DO,"1.1.0":LO,"1.0.0":CO},qP=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.af=r.version?r.version:"1.1.0",i.Fy=r.featureType,i.Gy=r.featureNS,i.Dy=r.gmlFormat?r.gmlFormat:new DP[i.af],i.qy=r.schemaLocation?r.schemaLocation:GP[i.af],i}return TP(n,t),n.prototype.getFeatureType=function(){return this.Fy},n.prototype.setFeatureType=function(t){this.Fy=t},n.prototype.readFeaturesFromNode=function(t,n){var i={node:t};A(i,{featureType:this.Fy,featureNS:this.Gy}),A(i,this.getReadOptions(t,n||{}));var r=[i],e=ac([],"2.0.0"===this.af?AP:this.Dy.FEATURE_COLLECTION_PARSERS,t,r,this.Dy);return e||(e=[]),e},n.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readTransactionResponseFromDocument(n)}return Yf(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},n.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readFeatureCollectionMetadataFromDocument(n)}return Yf(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},n.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)},n.prototype.readFeatureCollectionMetadataFromNode=function(t){var n={},i=bO(t.getAttribute("numberOfFeatures"));return n.numberOfFeatures=i,ac(n,AP,t,[],this.Dy)},n.prototype.readTransactionResponseFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)},n.prototype.readTransactionResponseFromNode=function(t){return ac({},CP,t,[])},n.prototype.writeGetFeature=function(t){var n=this,i=Xf(RP[this.af],"GetFeature");i.setAttribute("service","WFS"),i.setAttribute("version",this.af),t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&i.setAttribute("count",String(t.count)),void 0!==t.viewParams&&i.setAttribute("viewParams",t.viewParams),i.setAttributeNS(Bf,"xsi:schemaLocation",this.qy);var r={node:i};if(A(r,{version:this.af,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.Gy,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),St(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var e=t.filter;t.bbox&&(St(t.geometryName,12),e=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,e)),A(r,{geometryName:t.geometryName,filter:e}),wC(i,t.featureTypes,[r])}else t.featureTypes.forEach((function(e){var o=n.combineBboxAndFilter(e.geometryName,e.bbox,t.srsName,t.filter);A(r,{geometryName:e.geometryName,filter:o}),wC(i,[e.name],[r])}));return i},n.prototype.combineBboxAndFilter=function(t,n,i,r){var e=EP(t,n,i);return r?jP(r,e):e},n.prototype.writeTransaction=function(t,n,i,r){var e,o=[],s=r.version?r.version:this.af,u=Xf(RP[s],"Transaction");u.setAttribute("service","WFS"),u.setAttribute("version",s),r&&(e=r.gmlOptions?r.gmlOptions:{},r.handle&&u.setAttribute("handle",r.handle)),u.setAttributeNS(Bf,"xsi:schemaLocation",GP[s]);var a=function(t,n,i,r){var e,o=r.featurePrefix?r.featurePrefix:NP;"1.0.0"===i?e=2:"1.1.0"===i?e=3:"2.0.0"===i&&(e=3.2);return A({node:t},{version:i,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:e,hasZ:r.hasZ,srsName:r.srsName},n)}(u,e,s,r);return t&&UP("Insert",t,o,a),n&&UP("Update",n,o,a),i&&UP("Delete",i,o,a),r.nativeElements&&UP("Native",r.nativeElements,o,a),u},n.prototype.readProjectionFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null},n.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var n=(t=t.firstElementChild.firstElementChild).firstElementChild;n;n=n.nextElementSibling)if(0!==n.childNodes.length&&(1!==n.childNodes.length||3!==n.firstChild.nodeType)){var i=[{}];return this.Dy.readGeometryElement(n,i),yr(i.pop().srsName)}return null},n}(aO);function UP(t,n,i,r){fc(r,IP,rc(t),n,i)}function BP(t,n){return ac({},PP,t,n)}var XP={"http://www.opengis.net/ogc":{FeatureId:Hf((function(t,n){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Hf((function(t,n){return t.getAttribute("fid")}))}};function VP(t,n){uc(XP,t,n)}var WP={"http://www.opengis.net/wfs":{Feature:VP},"http://www.opengis.net/wfs/2.0":{Feature:VP}};function YP(t,n){return ac([],WP,t,n)}function ZP(t,n,i){var r=i[i.length-1],e=r.featureType,o=r.featureNS,s=r.gmlVersion,u=Xf(o,e);t.appendChild(u),2===s?CO.prototype.writeFeatureElement(u,n,i):3===s?LO.prototype.writeFeatureElement(u,n,i):DO.prototype.writeFeatureElement(u,n,i)}function $P(t,n,i){var r=i[i.length-1].version,e=zP[r],o=Xf(e,"Filter"),s=Xf(e,"FeatureId");o.appendChild(s),s.setAttribute("fid",n),t.appendChild(o)}function KP(t,n){var i=(t=t||NP)+":";return 0===n.indexOf(i)?n:i+n}function HP(t,n,i){var r=i[i.length-1];St(void 0!==n.getId(),26);var e=r.featureType,o=r.featurePrefix,s=r.featureNS,u=KP(o,e);t.setAttribute("typeName",u),t.setAttributeNS(LP,"xmlns:"+o,s);var a=n.getId();void 0!==a&&$P(t,a,i)}function JP(t,n,i){var r=i[i.length-1];St(void 0!==n.getId(),27);var e=r.version,o=r.featureType,s=r.featurePrefix,u=r.featureNS,a=KP(s,o),h=n.getGeometryName();t.setAttribute("typeName",a),t.setAttributeNS(LP,"xmlns:"+s,u);var f=n.getId();if(void 0!==f){for(var c=n.getKeys(),l=[],v=0,d=c.length;v0,i=this.readUint32(n),r=Math.floor((268435455&i)/1e3),e=Boolean(2147483648&i)||1===r||3===r,o=Boolean(1073741824&i)||2===r||3===r,s=Boolean(536870912&i),u=(268435455&i)%1e3,a=["XY",e?"Z":"",o?"M":""].join(""),h=s?this.readUint32(n):null;if(void 0!==t&&t!==u)throw new Error("Unexpected WKB geometry type "+u);if(this.Xy){if(this.Vy!==n)throw new Error("Inconsistent endian");if(this.$y!==a)throw new Error("Inconsistent geometry layout");if(h&&this.Zy!==h)throw new Error("Inconsistent coordinate system (SRID)")}else this.Vy=n,this.Wy=e,this.Yy=o,this.$y=a,this.Zy=h,this.Xy=!0;return u},t.prototype.readWkbPayload=function(t){switch(t){case MC:return this.readPoint();case _C:return this.readLineString();case SC:case CC:return this.readPolygon();case OC:return this.readMultiPoint();case jC:return this.readMultiLineString();case EC:case AC:case PC:return this.readMultiPolygon();case TC:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}},t.prototype.readWkbBlock=function(t){return this.readWkbPayload(this.readWkbHeader(t))},t.prototype.readWkbCollection=function(t,n){for(var i=this.readUint32(),r=[],e=0;e=0&&(t+=this.Ky?2147483648:1e3),this.$y.indexOf("M")>=0&&(t+=this.Ky?1073741824:2e3),this.Ky&&Number.isInteger(n)&&(t|=536870912),this.writeUint8(this.Vy?1:0),this.writeUint32(t),this.Ky&&Number.isInteger(n)&&this.writeUint32(n)},t.prototype.writeMultiPoint=function(t,n){this.writeUint32(t.length);for(var i=0;i="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.am=function(t,n){return t>="0"&&t<="9"||"."==t&&!(void 0!==n&&n)},t.prototype.hm=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.fm=function(){return this.wkt.charAt(++this.sm)},t.prototype.nextToken=function(){var t,n=this.fm(),i=this.sm,r=n;if("("==n)t=qC;else if(","==n)t=XC;else if(")"==n)t=UC;else if(this.am(n)||"-"==n)t=BC,r=this.lm();else if(this.um(n))t=DC,r=this.vm();else{if(this.hm(n))return this.nextToken();if(""!==n)throw new Error("Unexpected character: "+n);t=VC}return{position:i,value:r,type:t}},t.prototype.lm=function(){var t,n=this.sm,i=!1,r=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.fm()}while(this.am(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(n,this.sm--))},t.prototype.vm=function(){var t,n=this.sm;do{t=this.fm()}while(this.um(t));return this.wkt.substring(n,this.sm--).toUpperCase()},t}(),ZC=function(){function t(t){this.dm=t,this.pm={position:0,type:GC},this.$y=Tt}return t.prototype.ym=function(){this.pm=this.dm.nextToken()},t.prototype.isTokenType=function(t){return this.pm.type==t},t.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.ym(),n},t.prototype.parse=function(){return this.ym(),this.wm()},t.prototype.gm=function(){var t=Tt,n=this.pm;if(this.isTokenType(DC)){var i=n.value;"Z"===i?t=At:"M"===i?t=Pt:"ZM"===i&&(t=Ct),t!==Tt&&this.ym()}return t},t.prototype.bm=function(){if(this.match(qC)){var t=[];do{t.push(this.wm())}while(this.match(XC));if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Mm=function(){if(this.match(qC)){var t=this._m();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Sm=function(){if(this.match(qC)){var t=this.Om();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.jm=function(){if(this.match(qC)){var t=this.Em();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Tm=function(){if(this.match(qC)){var t=void 0;if(t=this.pm.type==qC?this.Am():this.Om(),this.match(UC))return t}throw new Error(this.xm())},t.prototype.Pm=function(){if(this.match(qC)){var t=this.Em();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Cm=function(){if(this.match(qC)){var t=this.km();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype._m=function(){for(var t=[],n=this.$y.length,i=0;i0&&(r+=" "+e)}return 0===i.length?r+" "+FC:r+"("+i+")"}var nk=$C,ik=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rk=[null,"http://www.opengis.net/wms"],ek=sc(rk,{Service:tc((function(t,n){return ac({},uk,t,n)})),Capability:tc((function(t,n){return ac({},ok,t,n)}))}),ok=sc(rk,{Request:tc((function(t,n){return ac({},pk,t,n)})),Exception:tc((function(t,n){return ac([],ck,t,n)})),Layer:tc((function(t,n){var i=ac({},lk,t,n);if(void 0===i.Layer)return Object.assign(i,Mk(t,n));return i}))}),sk=function(t){function n(){var n=t.call(this)||this;return n.version=void 0,n}return ik(n,t),n.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var n=ac({version:this.version},ek,t,[]);return n||null},n}(VT),uk=sc(rk,{Name:tc(xO),Title:tc(xO),Abstract:tc(xO),KeywordList:tc(jk),OnlineResource:tc(WT),ContactInformation:tc((function(t,n){return ac({},ak,t,n)})),Fees:tc(xO),AccessConstraints:tc(xO),LayerLimit:tc(gO),MaxWidth:tc(gO),MaxHeight:tc(gO)}),ak=sc(rk,{ContactPersonPrimary:tc((function(t,n){return ac({},hk,t,n)})),ContactPosition:tc(xO),ContactAddress:tc((function(t,n){return ac({},fk,t,n)})),ContactVoiceTelephone:tc(xO),ContactFacsimileTelephone:tc(xO),ContactElectronicMailAddress:tc(xO)}),hk=sc(rk,{ContactPerson:tc(xO),ContactOrganization:tc(xO)}),fk=sc(rk,{AddressType:tc(xO),Address:tc(xO),City:tc(xO),StateOrProvince:tc(xO),PostCode:tc(xO),Country:tc(xO)}),ck=sc(rk,{Format:Hf(xO)}),lk=sc(rk,{Name:tc(xO),Title:tc(xO),Abstract:tc(xO),KeywordList:tc(jk),CRS:Qf(xO),EX_GeographicBoundingBox:tc((function(t,n){var i=ac({},dk,t,n);if(!i)return;var r=i.westBoundLongitude,e=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===e||void 0===o||void 0===s)return;return[r,e,o,s]})),BoundingBox:Qf((function(t,n){var i=[wO(t.getAttribute("minx")),wO(t.getAttribute("miny")),wO(t.getAttribute("maxx")),wO(t.getAttribute("maxy"))],r=[wO(t.getAttribute("resx")),wO(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}})),Dimension:Qf((function(t,n){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:pO(t.getAttribute("multipleValues")),nearestValue:pO(t.getAttribute("nearestValue")),current:pO(t.getAttribute("current")),values:xO(t)}})),Attribution:tc((function(t,n){return ac({},vk,t,n)})),AuthorityURL:Qf((function(t,n){var i=_k(t,n);if(i)return i.name=t.getAttribute("name"),i;return})),Identifier:Qf(xO),MetadataURL:Qf((function(t,n){var i=_k(t,n);if(i)return i.type=t.getAttribute("type"),i;return})),DataURL:Qf(_k),FeatureListURL:Qf(_k),Style:Qf((function(t,n){return ac({},gk,t,n)})),MinScaleDenominator:tc(mO),MaxScaleDenominator:tc(mO),Layer:Qf(Mk)}),vk=sc(rk,{Title:tc(xO),OnlineResource:tc(WT),LogoURL:tc(Ok)}),dk=sc(rk,{westBoundLongitude:tc(mO),eastBoundLongitude:tc(mO),southBoundLatitude:tc(mO),northBoundLatitude:tc(mO)}),pk=sc(rk,{GetCapabilities:tc(Sk),GetMap:tc(Sk),GetFeatureInfo:tc(Sk)}),yk=sc(rk,{Format:Qf(xO),DCPType:Qf((function(t,n){return ac({},mk,t,n)}))}),mk=sc(rk,{HTTP:tc((function(t,n){return ac({},wk,t,n)}))}),wk=sc(rk,{Get:tc(_k),Post:tc(_k)}),gk=sc(rk,{Name:tc(xO),Title:tc(xO),Abstract:tc(xO),LegendURL:Qf(Ok),StyleSheetURL:tc(_k),StyleURL:tc(_k)}),bk=sc(rk,{Format:tc(xO),OnlineResource:tc(WT)}),xk=sc(rk,{Keyword:Hf(xO)});function Mk(t,n){var i=n[n.length-1],r=ac({},lk,t,n);if(r){var e=pO(t.getAttribute("queryable"));void 0===e&&(e=i.queryable),r.queryable=void 0!==e&&e;var o=bO(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded),r.cascaded=o;var s=pO(t.getAttribute("opaque"));void 0===s&&(s=i.opaque),r.opaque=void 0!==s&&s;var u=pO(t.getAttribute("noSubsets"));void 0===u&&(u=i.noSubsets),r.noSubsets=void 0!==u&&u;var a=wO(t.getAttribute("fixedWidth"));a||(a=i.fixedWidth),r.fixedWidth=a;var h=wO(t.getAttribute("fixedHeight"));h||(h=i.fixedHeight),r.fixedHeight=h;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in i){var n=r[t]||[];r[t]=n.concat(i[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in r)){var n=i[t];r[t]=n}})),r}}function _k(t,n){return ac({},bk,t,n)}function Sk(t,n){return ac({},yk,t,n)}function Ok(t,n){var i=_k(t,n);if(i){var r=[bO(t.getAttribute("width")),bO(t.getAttribute("height"))];return i.size=r,i}}function jk(t,n){return ac([],xk,t,n)}var Ek=sk,Tk=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ak=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Gy="http://mapserver.gis.umn.edu/mapserver",i.Dy=new CO,i.Uh=r.layers?r.layers:null,i}return Tk(n,t),n.prototype.getLayers=function(){return this.Uh},n.prototype.setLayers=function(t){this.Uh=t},n.prototype.zm=function(t,n){t.setAttribute("namespaceURI",this.Gy);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var e=0,o=t.childNodes.length;ef*uI||h>c*uI?this.cw():xn(o,r)||this.pw()}}},n.prototype.cw=function(){var t=this.getMap(),n=this.sw,i=t.getSize(),r=t.getView().calculateExtentInternal(i),e=n.getView(),o=Math.log(7.5)/Math.LN2;Qn(r,1/(Math.pow(2,o/2)*aI)),e.fitInternal(Ze(r))},n.prototype.pw=function(){var t=this.getMap(),n=this.sw,i=t.getView();n.getView().setCenterInternal(i.getCenterInternal())},n.prototype.yw=function(){var t=this.getMap(),n=this.sw;if(t.isRendered()&&n.isRendered()){var i=t.getSize(),r=t.getView(),e=n.getView(),o=this.su?0:-r.getRotation(),s=this.uw,u=this.uw.getElement(),a=r.getCenterInternal(),h=r.getResolution(),f=e.getResolution(),c=i[0]*h/f,l=i[1]*h/f;if(s.setPosition(a),u){u.style.width=c+"px",u.style.height=l+"px";var v="rotate("+o+"rad)";u.style.transform=v}}},n.prototype.lw=function(){this.mw||(this.mw=K(this.sw,vu,(function(t){delete this.mw,this.yw()}),this))},n.prototype.kr=function(t){t.preventDefault(),this.zr()},n.prototype.zr=function(){this.element.classList.toggle(_s),this.Sr?Eo(this.Ar,this.Pr):Eo(this.Pr,this.Ar),this.Sr=!this.Sr;var t=this.sw;if(!this.Sr){if(t.isRendered())return this.ew=void 0,void t.render();t.updateSize(),this.cw(),this.lw()}},n.prototype.getCollapsible=function(){return this.Tr},n.prototype.setCollapsible=function(t){this.Tr!==t&&(this.Tr=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.Sr&&this.zr())},n.prototype.setCollapsed=function(t){this.Tr&&this.Sr!==t&&this.zr()},n.prototype.getCollapsed=function(){return this.Sr},n.prototype.getRotateWithView=function(){return this.su},n.prototype.setRotateWithView=function(t){this.su!==t&&(this.su=t,0!==this.getMap().getView().getRotation()&&(this.su?this.rw():this.sw.getView().setRotation(0),this.ew=void 0,this.dw(),this.yw()))},n.prototype.getOverviewMap=function(){return this.sw},n.prototype.render=function(t){this.dw(),this.yw()},n}(oa),cI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lI="units",vI="degrees",dI="imperial",pI="nautical",yI="metric",mI="us",wI=[1,2,5],gI=25.4/.28,bI=function(t){function n(n){var i=this,r=n||{},e=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,i.once,i.un,i.ww=document.createElement("div"),i.ww.className=e+"-inner",i.element.className=e+" "+bs,i.element.appendChild(i.ww),i.gw=null,i.bw=void 0!==r.minWidth?r.minWidth:64,i.xw=r.maxWidth,i.mn=!1,i.Mw=void 0,i.Qm="",i.addChangeListener(lI,i._w),i.setUnits(r.units||yI),i.Sw=r.bar||!1,i.Ow=r.steps||4,i.jw=r.text||!1,i.Ew=r.dpi||void 0,i}return cI(n,t),n.prototype.getUnits=function(){return this.get(lI)},n.prototype._w=function(){this.Lr()},n.prototype.setUnits=function(t){this.set(lI,t)},n.prototype.setDpi=function(t){this.Ew=t},n.prototype.Lr=function(){var t=this.gw;if(t){var n=t.center,i=t.projection,r=this.getUnits(),e=r==vI?Rt.DEGREES:Rt.METERS,o=mr(i,t.resolution,n,e),s=this.bw*(this.Ew||gI)/gI,u=void 0!==this.xw?this.xw*(this.Ew||gI)/gI:void 0,a=s*o,h="";if(r==vI){var f=Lt[Rt.DEGREES];(a*=f)=u){c=d,l=p,v=y;break}if(l>=s)break;d=c,p=l,y=v,++w}m=this.Sw?this.createScaleBar(l,c,h):c.toFixed(v<0?-v:0)+" "+h,this.Qm!=m&&(this.ww.innerHTML=m,this.Qm=m),this.Mw!=l&&(this.ww.style.width=l+"px",this.Mw=l),this.mn||(this.element.style.display="",this.mn=!0)}else this.mn&&(this.element.style.display="none",this.mn=!1)},n.prototype.createScaleBar=function(t,n,i){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),e=[],o=t/this.Ow,s="ol-scale-singlebar-odd",u=0;u
'+this.createMarker("relative",u)+(u%2==0||2===this.Ow?this.createStepText(u,t,!1,n,i):"")+""),u===this.Ow-1&&e.push(this.createStepText(u+1,t,!0,n,i)),s="ol-scale-singlebar-odd"===s?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'
'+(this.jw?'
'+r+"
":"")+e.join("")+"
"},n.prototype.createMarker=function(t,n){return'
'},n.prototype.createStepText=function(t,n,i,r,e){var o=(0===t?0:Math.round(r/this.Ow*t*100)/100)+(0===t?"":" "+e);return'
'+o+"
"},n.prototype.getScaleForResolution=function(){var t=mr(this.gw.projection,this.gw.resolution,this.gw.center,Rt.METERS),n=this.Ew||gI;return parseFloat(t.toString())*(1e3/25.4)*n},n.prototype.render=function(t){var n=t.frameState;this.gw=n?n.viewState:null,this.Lr()},n}(oa),xI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),MI=0,_I=1,SI=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render})||this).kn=[],i.Tw=void 0,i.Aw=MI,i.Cn,i.Pw=0,i.Cw=0,i.kw,i.Iw,i.Nw=null,i.Lw=!1,i.Fr=void 0!==r.duration?r.duration:200;var e=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=e+"-thumb "+bs;var s=i.element;return s.className=e+" "+"ol-unselectable "+Ms,s.appendChild(o),s.addEventListener(au,i.zw.bind(i),!1),s.addEventListener(uu,i.Rw.bind(i),!1),s.addEventListener(hu,i.Fw.bind(i),!1),s.addEventListener(F,i.Gw.bind(i),!1),o.addEventListener(F,f,!1),i}return xI(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),n&&n.render()},n.prototype.Dw=function(){var t=this.element,n=t.offsetWidth,i=t.offsetHeight;if(0===n&&0===i)return this.Lw=!1;var r=getComputedStyle(t);n-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),i-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var e=t.firstElementChild,o=getComputedStyle(e),s=e.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),u=e.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.Nw=[s,u],n>i?(this.Aw=_I,this.Cw=n-s):(this.Aw=MI,this.Pw=i-u),this.Lw=!0},n.prototype.Gw=function(t){var n=this.getMap().getView(),i=this.qw(t.offsetX-this.Nw[0]/2,t.offsetY-this.Nw[1]/2),r=this.Uw(i),e=n.getConstrainedZoom(n.getZoomForResolution(r));n.animateInternal({zoom:e,duration:this.Fr,easing:mt})},n.prototype.zw=function(t){if(!this.Cn&&t.target===this.element.firstElementChild){var n=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.kw=t.clientX-parseFloat(n.style.left),this.Iw=t.clientY-parseFloat(n.style.top),this.Cn=!0,0===this.kn.length){var i=this.Rw,r=this.Fw,e=this.getMap().getOwnerDocument();this.kn.push($(e,uu,i,this),$(e,hu,r,this))}}},n.prototype.Rw=function(t){if(this.Cn){var n=t.clientX-this.kw,i=t.clientY-this.Iw,r=this.qw(n,i);this.Tw=this.Uw(r),this.getMap().getView().setResolution(this.Tw)}},n.prototype.Fw=function(t){this.Cn&&(this.getMap().getView().endInteraction(),this.Cn=!1,this.kw=void 0,this.Iw=void 0,this.kn.forEach(H),this.kn.length=0)},n.prototype.Bw=function(t){var n=this.Xw(t),i=this.element.firstElementChild;this.Aw==_I?i.style.left=this.Cw*n+"px":i.style.top=this.Pw*n+"px"},n.prototype.qw=function(t,n){return oi(this.Aw===_I?t/this.Cw:n/this.Pw,0,1)},n.prototype.Uw=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},n.prototype.Xw=function(t){return oi(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},n.prototype.render=function(t){if(t.frameState&&(this.Lw||this.Dw())){var n=t.frameState.viewState.resolution;this.Tw=n,this.Bw(n)}},n}(oa),OI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jI=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),target:r.target})||this).extent=r.extent?r.extent:null;var e=void 0!==r.className?r.className:"ol-zoom-extent",o=void 0!==r.label?r.label:"E",s=void 0!==r.tipLabel?r.tipLabel:"Fit to extent",u=document.createElement("button");u.setAttribute("type","button"),u.title=s,u.appendChild("string"==typeof o?document.createTextNode(o):o),u.addEventListener(F,i.kr.bind(i),!1);var a=e+" "+"ol-unselectable "+Ms,h=i.element;return h.className=a,h.appendChild(u),i}return OI(n,t),n.prototype.kr=function(t){t.preventDefault(),this.handleZoomToExtent()},n.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),n=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Ze(n))},n}(oa),EI={};EI.AssertionError=h,EI.Collection=ft,EI.Collection.CollectionEvent=ht,EI.DataTile=_t,EI.Disposable=v,EI.Feature=Et,EI.Feature.createStyleFunction=jt,EI.Geolocation=ho,EI.Image=bo,EI.Image.listenImage=go,EI.ImageBase=co,EI.ImageCanvas=Mo,EI.ImageTile=ko,EI.Kinetic=Io,EI.Map=yh,EI.MapBrowserEvent=ou,EI.MapBrowserEventHandler=lu,EI.MapEvent=ru,EI.Object=et,EI.Object.ObjectEvent=rt,EI.Observable=nt,EI.Observable.unByKey=tt,EI.Overlay=_h,EI.PluggableMap=ra,EI.Tile=xt,EI.TileCache=Ih,EI.TileQueue=Ou,EI.TileQueue.getTilePriority=ju,EI.TileRange=zh,EI.TileRange.createOrUpdate=Lh,EI.VectorRenderTile=Gh,EI.VectorTile=qh,EI.View=$u,EI.View.createCenterConstraint=Xu,EI.View.createResolutionConstraint=Vu,EI.View.createRotationConstraint=Wu,EI.View.isNoopAnimation=Yu,EI.array={},EI.array.binarySearch=d,EI.array.equals=x,EI.array.extend=g,EI.array.find=b,EI.array.findIndex=M,EI.array.includes=y,EI.array.isSorted=_,EI.array.linearFindNearest=m,EI.array.numberSafeCompareFunction=p,EI.array.remove=function(t,n){var i=t.indexOf(n),r=i>-1;return r&&t.splice(i,1),r},EI.array.reverseSubArray=w,EI.array.stableSort=function(t,n){var i,r=t.length,e=Array(t.length);for(i=0;i3&&!!we(t,n,i,r)},EI.geom.flat.transform={},EI.geom.flat.transform.rotate=qr,EI.geom.flat.transform.scale=Ur,EI.geom.flat.transform.transform2D=Dr,EI.geom.flat.transform.translate=Br,EI.has={},EI.has.DEVICE_PIXEL_RATIO=Xt,EI.has.FIREFOX=Gt,EI.has.IMAGE_DECODE=Wt,EI.has.MAC=Bt,EI.has.PASSIVE_EVENT_LISTENERS=Yt,EI.has.SAFARI=Dt,EI.has.SAFARI_BUG_237906=qt,EI.has.WEBKIT=Ut,EI.has.WORKER_OFFSCREEN_CANVAS=Vt,EI.interaction={},EI.interaction.DoubleClickZoom=ga,EI.interaction.DragAndDrop=Q_,EI.interaction.DragAndDrop.DragAndDropEvent=J_,EI.interaction.DragBox=$a,EI.interaction.DragBox.DragBoxEvent=Za,EI.interaction.DragPan=Fa,EI.interaction.DragRotate=Da,EI.interaction.DragRotateAndZoom=nS,EI.interaction.DragZoom=Ha,EI.interaction.Draw=dS,EI.interaction.Draw.DrawEvent=vS,EI.interaction.Draw.createBox=function(){return function(t,n,i){var r=yn([t[0],t[t.length-1]].map((function(t){return Ir(t,i)}))),e=[[Gn(r),Dn(r),Zn(r),Yn(r),Gn(r)]],o=n;o?o.setCoordinates(e):o=new We(e);var s=Cr();return s&&o.transform(i,s),o}},EI.interaction.Draw.createRegularPolygon=function(t,n){return function(i,r,e){var o=Ir(i[0],e),s=Ir(i[i.length-1],e),u=Math.sqrt(Qi(o,s)),a=r||$e(new eS(o),t),h=n;if(!n&&0!==n){var f=s[0]-o[0],c=s[1]-o[1];h=Math.atan2(c,f)}Ke(a,o,u,h);var l=Cr();return l&&a.transform(e,l),a}},EI.interaction.Extent=xS,EI.interaction.Extent.ExtentEvent=mS,EI.interaction.Interaction=ma,EI.interaction.Interaction.pan=pa,EI.interaction.Interaction.zoomByDelta=ya,EI.interaction.KeyboardPan=rh,EI.interaction.KeyboardZoom=oh,EI.interaction.Link=jS,EI.interaction.Modify=zS,EI.interaction.Modify.ModifyEvent=kS,EI.interaction.MouseWheelZoom=hh,EI.interaction.PinchRotate=ch,EI.interaction.PinchZoom=vh,EI.interaction.Pointer=Ma,EI.interaction.Pointer.centroid=xa,EI.interaction.Select=qS,EI.interaction.Select.SelectEvent=GS,EI.interaction.Snap=VS,EI.interaction.Translate=HS,EI.interaction.Translate.TranslateEvent=KS,EI.interaction.defaults=dh,EI.layer={},EI.layer.Base=es,EI.layer.BaseImage=$y,EI.layer.BaseTile=am,EI.layer.BaseVector=$m,EI.layer.Graticule=gg,EI.layer.Group=nu,EI.layer.Group.GroupEvent=Qs,EI.layer.Heatmap=Og,EI.layer.Image=em,EI.layer.Layer=ls,EI.layer.Layer.inView=cs,EI.layer.MapboxVector=q_,EI.layer.Tile=lm,EI.layer.Vector=lg,EI.layer.VectorImage=B_,EI.layer.VectorTile=Rg,EI.layer.WebGLPoints=V_,EI.layer.WebGLTile=$_,EI.loadingstrategy={},EI.loadingstrategy.all=Wh,EI.loadingstrategy.bbox=function(t,n){return[t]},EI.loadingstrategy.tile=function(t){return function(n,i,r){var e=t.getZForResolution(Rr(i,r)),o=t.getTileRangeForExtentAndZ(Lr(n,r),e),s=[],u=[e,0,0];for(u[1]=o.minX;u[1]<=o.maxX;++u[1])for(u[2]=o.minY;u[2]<=o.maxY;++u[2])s.push(Nr(t.getTileCoordExtent(u),r));return s}},EI.math={},EI.math.ceil=wi,EI.math.clamp=oi,EI.math.cosh=si,EI.math.floor=mi,EI.math.lerp=di,EI.math.log2=ui,EI.math.modulo=vi,EI.math.round=yi,EI.math.solveLinearSystem=fi,EI.math.squaredDistance=hi,EI.math.squaredSegmentDistance=ai,EI.math.toDegrees=ci,EI.math.toFixed=pi,EI.math.toRadians=li,EI.net={},EI.net.ClientError=Hh,EI.net.ResponseError=Kh,EI.net.getJSON=Jh,EI.net.jsonp=Zh,EI.net.overrideXHR=function(t){"undefined"!=typeof XMLHttpRequest&&($h=XMLHttpRequest),global.XMLHttpRequest=t},EI.net.resolveUrl=Qh,EI.net.restoreXHR=function(){global.XMLHttpRequest=$h},EI.obj={},EI.obj.assign=A,EI.obj.clear=P,EI.obj.getValues=C,EI.obj.isEmpty=k,EI.proj={},EI.proj.Projection=ei,EI.proj.Units={},EI.proj.Units.METERS_PER_UNIT=Lt,EI.proj.Units.fromCode=Nt,EI.proj.addCommon=Gr,EI.proj.addCoordinateTransforms=Mr,EI.proj.addEquivalentProjections=wr,EI.proj.addEquivalentTransforms=gr,EI.proj.addProjection=dr,EI.proj.addProjections=pr,EI.proj.clearAllProjections=function(){zi(),Di()},EI.proj.clearUserProjection=function(){Ar=null},EI.proj.cloneTransform=lr,EI.proj.createProjection=br,EI.proj.createSafeCoordinateTransform=Fr,EI.proj.createTransformFromCoordinateTransform=xr,EI.proj.disableCoordinateWarning=cr,EI.proj.epsg3857={},EI.proj.epsg3857.EXTENT=Mi,EI.proj.epsg3857.HALF_SIZE=xi,EI.proj.epsg3857.MAX_SAFE_Y=Si,EI.proj.epsg3857.PROJECTIONS=ji,EI.proj.epsg3857.RADIUS=bi,EI.proj.epsg3857.WORLD_EXTENT=_i,EI.proj.epsg3857.fromEPSG4326=Ei,EI.proj.epsg3857.toEPSG4326=Ti,EI.proj.epsg4326={},EI.proj.epsg4326.EXTENT=Ci,EI.proj.epsg4326.METERS_PER_UNIT=ki,EI.proj.epsg4326.PROJECTIONS=Ni,EI.proj.epsg4326.RADIUS=Pi,EI.proj.equivalent=Sr,EI.proj.fromLonLat=_r,EI.proj.fromUserCoordinate=Ir,EI.proj.fromUserExtent=Lr,EI.proj.fromUserResolution=Rr,EI.proj.get=yr,EI.proj.getPointResolution=mr,EI.proj.getTransform=jr,EI.proj.getTransformFromProjections=Or,EI.proj.getUserProjection=Cr,EI.proj.identityTransform=vr,EI.proj.proj4={},EI.proj.proj4.register=function(t){var n,i,r=Object.keys(t.defs),e=r.length;for(n=0;n180)&&(i[0]=vi(r+180,360)-180),i},EI.proj.toUserCoordinate=kr,EI.proj.toUserExtent=Nr,EI.proj.toUserResolution=zr,EI.proj.transform=Er,EI.proj.transformExtent=Tr,EI.proj.transformWithProjections=function(t,n,i){return Or(n,i)(t)},EI.proj.transforms={},EI.proj.transforms.add=qi,EI.proj.transforms.clear=Di,EI.proj.transforms.get=Ui,EI.proj.transforms.remove=function(t,n){var i=t.getCode(),r=n.getCode(),e=Gi[i][r];return delete Gi[i][r],k(Gi[i])&&delete Gi[i],e},EI.proj.useGeographic=function(){Pr("EPSG:4326")},EI.render={},EI.render.Box=Ua,EI.render.Event=ms,EI.render.Feature=fg,EI.render.Feature.toFeature=function(t,n){var i=t.getId(),r=hg(t),e=t.getProperties(),o=new Et;return void 0!==n&&o.setGeometryName(n),o.setGeometry(r),void 0!==i&&o.setId(i),o.setProperties(e,!0),o},EI.render.Feature.toGeometry=hg,EI.render.VectorContext=tf,EI.render.canvas={},EI.render.canvas.Builder=ow,EI.render.canvas.BuilderGroup=mw,EI.render.canvas.Executor=Aw,EI.render.canvas.ExecutorGroup=Nw,EI.render.canvas.ExecutorGroup.getPixelIndexArray=Iw,EI.render.canvas.ImageBuilder=uw,EI.render.canvas.Immediate=rf,EI.render.canvas.Instruction={},EI.render.canvas.Instruction.beginPathInstruction=nw,EI.render.canvas.Instruction.closePathInstruction=iw,EI.render.canvas.Instruction.fillInstruction=Qm,EI.render.canvas.Instruction.strokeInstruction=tw,EI.render.canvas.LineStringBuilder=hw,EI.render.canvas.PolygonBuilder=cw,EI.render.canvas.TextBuilder=pw,EI.render.canvas.checkedFonts=Rs,EI.render.canvas.defaultFillStyle=Ts,EI.render.canvas.defaultFont=Es,EI.render.canvas.defaultLineCap=As,EI.render.canvas.defaultLineDash=Ps,EI.render.canvas.defaultLineDashOffset=0,EI.render.canvas.defaultLineJoin=Cs,EI.render.canvas.defaultLineWidth=1,EI.render.canvas.defaultMiterLimit=ks,EI.render.canvas.defaultPadding=zs,EI.render.canvas.defaultStrokeStyle=Is,EI.render.canvas.defaultTextAlign=Ns,EI.render.canvas.defaultTextBaseline=Ls,EI.render.canvas.drawImageOrLabel=$s,EI.render.canvas.getTextDimensions=Zs,EI.render.canvas.hitdetect={},EI.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=Lw,EI.render.canvas.hitdetect.createHitDetectionImageData=zw,EI.render.canvas.hitdetect.hitDetect=Rw,EI.render.canvas.labelCache=Fs,EI.render.canvas.measureAndCacheTextWidth=Ys,EI.render.canvas.measureTextHeight=Xs,EI.render.canvas.measureTextWidth=Ws,EI.render.canvas.registerFont=Bs,EI.render.canvas.rotateAtOffset=function(t,n,i,r){0!==n&&(t.translate(i,r),t.rotate(n),t.translate(-i,-r))},EI.render.canvas.textHeights=Us,EI.render.getRenderPixel=function(t,n){return tn(t.inversePixelTransform,n.slice(0))},EI.render.getVectorContext=ff,EI.render.toContext=function(t,n){var i=t.canvas,r=n||{},e=r.pixelRatio||Xt,o=r.size;o&&(i.width=o[0]*e,i.height=o[1]*e,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],u=rn([1,0,0,1,0,0],e,e);return new rf(t,e,s,u,0)},EI.renderer={},EI.renderer.Composite=Hs,EI.renderer.Layer=Kc,EI.renderer.Map=ps,EI.renderer.canvas={},EI.renderer.canvas.ImageLayer=im,EI.renderer.canvas.Layer=tm,EI.renderer.canvas.Layer.canvasPool=Hy,EI.renderer.canvas.TileLayer=fm,EI.renderer.canvas.VectorImageLayer=qw,EI.renderer.canvas.VectorLayer=Gw,EI.renderer.canvas.VectorTileLayer=Zw,EI.renderer.canvas.common={},EI.renderer.canvas.common.IMAGE_SMOOTHING_DISABLED=lf,EI.renderer.canvas.common.IMAGE_SMOOTHING_ENABLED=vf,EI.renderer.vector={},EI.renderer.vector.defaultOrder=of,EI.renderer.vector.getSquaredTolerance=sf,EI.renderer.vector.getTolerance=uf,EI.renderer.vector.renderFeature=af,EI.renderer.webgl={},EI.renderer.webgl.Layer=ol,EI.renderer.webgl.Layer.colorDecodeId=el,EI.renderer.webgl.Layer.colorEncodeId=rl,EI.renderer.webgl.Layer.getBlankImageData=function(){var t=document.createElement("canvas").getContext("2d").createImageData(1,1);return t.data[0]=255,t.data[1]=255,t.data[2]=255,t.data[3]=255,t},EI.renderer.webgl.Layer.writePointFeatureToBuffers=function(t,n,i,r,e,o){var s=3+e,u=t[n+0],a=t[n+1],h=tl;h.length=e;for(var f=0;f1?M(i.TileMatrixSetLink,"projection"in n?function(t,i,r){var o=b(e,(function(n){return n.Identifier==t.TileMatrixSet})).SupportedCRS,s=yr(o),u=yr(n.projection);return s&&u?Sr(s,u):o==n.projection}:function(t,i,r){return t.TileMatrixSet==n.matrixSet}):0)<0&&(r=0);var o=i.TileMatrixSetLink[r].TileMatrixSet,s=i.TileMatrixSetLink[r].TileMatrixSetLimits,u=i.Format[0];"format"in n&&(u=n.format),(r=M(i.Style,(function(t,i,r){return"style"in n?t.Title==n.style:t.isDefault})))<0&&(r=0);var a=i.Style[r].Identifier,h={};"Dimension"in i&&i.Dimension.forEach((function(t,n,i){var r=t.Identifier,e=t.Default;void 0===e&&(e=t.Value[0]),h[r]=e}));var f,c=b(t.Contents.TileMatrixSet,(function(t,n,i){return t.Identifier==o})),l=c.SupportedCRS;if(l&&(f=yr(l)),"projection"in n){var v=yr(n.projection);v&&(f&&!Sr(v,f)||(f=v))}var d=!1,p="ne"==f.getAxisOrientation().substr(0,2),m=c.TileMatrix[0],w={MinTileCol:0,MinTileRow:0,MaxTileCol:m.MatrixWidth-1,MaxTileRow:m.MatrixHeight-1};if(s){w=s[s.length-1];var g=b(c.TileMatrix,(function(t){return t.Identifier===w.TileMatrix||c.Identifier+":"+t.Identifier===w.TileMatrix}));g&&(m=g)}var x=28e-5*m.ScaleDenominator/f.getMetersPerUnit(),_=p?[m.TopLeftCorner[1],m.TopLeftCorner[0]]:m.TopLeftCorner,S=m.TileWidth*x,O=m.TileHeight*x,j=c.BoundingBox;j&&p&&(j=[j[1],j[0],j[3],j[2]]);var E=[_[0]+S*w.MinTileCol,_[1]-O*(1+w.MaxTileRow),_[0]+S*(1+w.MaxTileCol),_[1]-O*w.MinTileRow];if(void 0!==j&&!xn(j,E)){var T=i.WGS84BoundingBox,A=yr("EPSG:4326").getExtent();if(E=j,T)d=T[0]===A[0]&&T[2]===A[2];else{var P=Tr(j,c.SupportedCRS,"EPSG:4326");d=P[0]-1e-10<=A[0]&&P[2]+1e-10>=A[2]}}var C=Hl(c,E,s),k=[],I=n.requestEncoding;if(I=void 0!==I?I:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var N=t.OperationsMetadata.GetTile.DCP.HTTP.Get,L=0,z=N.length;L