5 lines
712 KiB
JavaScript
5 lines
712 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).ol={})}(this,(function(t){"use strict";function e(){return function(){throw new Error("Unimplemented abstract method.")}()}var i=0;function r(t){return t.ol_uid||(t.ol_uid=String(++i))}var n,o=(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),a=function(t){function e(e){var i=this,r="Assertion failed. See https://openlayers.org/en/"+("v"+"6.5.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,r)||this).code=e,i.name="AssertionError",i.message=r,i}return o(e,t),e}(Error),s=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),l="propertychange",u=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function h(t,e){return t>e?1:t<e?-1:0}function c(t,e){return t.indexOf(e)>=0}function p(t,e,i){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var n=void 0;if(i>0){for(n=1;n<r;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<r;++n)if(t[n]<=e)return n}else for(n=1;n<r;++n){if(t[n]==e)return n;if(t[n]<e)return t[n-1]-e<e-t[n]?n-1:n}return r-1}function d(t,e,i){for(;e<i;){var r=t[e];t[e]=t[i],t[i]=r,++e,--i}}function f(t,e){for(var i=Array.isArray(e)?e:[e],r=i.length,n=0;n<r;n++)t[t.length]=i[n]}function g(t,e){var i=t.length;if(i!==e.length)return!1;for(var r=0;r<i;r++)if(t[r]!==e[r])return!1;return!0}function y(){return!0}function m(){return!1}function v(){}var _="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,n=arguments.length;r<n;++r){var o=arguments[r];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(i[a]=o[a])}return i};function x(t){for(var e in t)delete t[e]}var b="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function w(t){var e;for(e in t)return!1;return!e}var S=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),C=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return S(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),r=i[t]||(i[t]=[]);-1===r.indexOf(e)&&r.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new s(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var r,n=this.listeners_&&this.listeners_[i];if(n){var o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];for(var l=0,u=n.length;l<u;++l)if(!1===(r="handleEvent"in n[l]?n[l].handleEvent(e):n[l].call(this,e))||e.propagationStopped){r=!1;break}if(--o[i],0===o[i]){var h=a[i];for(delete a[i];h--;)this.removeEventListener(i,v);delete o[i]}return r}},e.prototype.disposeInternal=function(){this.listeners_&&x(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var r=i.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[r]=v,++this.pendingRemovals_[t]):(i.splice(r,1),0===i.length&&delete this.listeners_[t]))}},e}(u),T="change",E="error",k="clear",R="contextmenu",O="click",P="dblclick",F="dragenter",I="dragover",M="drop",A="keydown",j="keypress",L="load",D="resize",z="touchmove",G="wheel";function N(t,e,i,r,n){if(r&&r!==t&&(i=i.bind(r)),n){var o=i;i=function(){t.removeEventListener(e,i),o.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function B(t,e,i,r){return N(t,e,i,r,!0)}function U(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var V=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),W=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return V(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(T)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=N(this,t[n],e);return r}return N(this,t,e)},e.prototype.once=function(t,e){var i;if(Array.isArray(t)){var r=t.length;i=new Array(r);for(var n=0;n<r;++n)i[n]=B(this,t[n],e)}else i=B(this,t,e);return e.ol_key=i,i},e.prototype.un=function(t,e){var i=e.ol_key;if(i)q(i);else if(Array.isArray(t))for(var r=0,n=t.length;r<n;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}(C);function q(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)U(t[e]);else U(t)}var X=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),K=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.key=i,n.oldValue=r,n}return X(e,t),e}(s),Y=function(t){function e(e){var i=t.call(this)||this;return r(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return X(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&_({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i=H(t),this.dispatchEvent(new K(i,t,e)),i=l,this.dispatchEvent(new K(i,t,e))},e.prototype.set=function(t,e,i){var r=this.values_||(this.values_={});if(i)r[t]=e;else{var n=r[t];r[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&_(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],w(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(W),Z={};function H(t){return Z.hasOwnProperty(t)?Z[t]:Z[t]="change:"+t}var $="add",J="remove",Q=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tt="length",et=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.element=i,n.index=r,n}return Q(e,t),e}(s),it=function(t){function e(e,i){var r=t.call(this)||this,n=i||{};if(r.unique_=!!n.unique,r.array_=e||[],r.unique_)for(var o=0,a=r.array_.length;o<a;++o)r.assertUnique_(r.array_[o],o);return r.updateLength_(),r}return Q(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,r=e.length;i<r;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(tt)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new et($,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,r=e.length;i<r;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new et(J,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new et(J,r,t)),this.dispatchEvent(new et($,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(tt,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,r=this.array_.length;i<r;++i)if(this.array_[i]===t&&i!==e)throw new a(58)},e}(Y);function rt(t,e){if(!t)throw new a(e)}var nt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ot=function(t){function e(e){var i=t.call(this)||this;if(i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addEventListener(H(i.geometryName_),i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var r=e;i.setGeometry(r)}else{var n=e;i.setProperties(n)}return i}return nt(e,t),e.prototype.clone=function(){var t=new e(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},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(U(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=N(t,T,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(rt("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(H(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(H(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Y);var at="XY",st="XYZ",lt="XYM",ut="XYZM",ht="Point",ct="LineString",pt="LinearRing",dt="Polygon",ft="MultiPoint",gt="MultiLineString",yt="MultiPolygon",mt="GeometryCollection",vt="Circle",_t="degrees",xt="ft",bt="m",wt="tile-pixels",St="us-ft",Ct={};Ct[_t]=2*Math.PI*6370997/360,Ct[xt]=.3048,Ct[bt]=1,Ct[St]=1200/3937;var Tt=new Array(6);function Et(t){return Rt(t,1,0,0,1,0,0)}function kt(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],d=e[5];return t[0]=i*l+n*u,t[1]=r*l+o*u,t[2]=i*h+n*c,t[3]=r*h+o*c,t[4]=i*p+n*d+a,t[5]=r*p+o*d+s,t}function Rt(t,e,i,r,n,o,a){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=o,t[5]=a,t}function Ot(t,e){var i=e[0],r=e[1];return e[0]=t[0]*i+t[2]*r+t[4],e[1]=t[1]*i+t[3]*r+t[5],e}function Pt(t,e,i){return kt(t,Rt(Tt,e,0,0,i,0,0))}function Ft(t,e,i,r,n,o,a,s){var l=Math.sin(o),u=Math.cos(o);return t[0]=r*u,t[1]=n*l,t[2]=-r*l,t[3]=n*u,t[4]=a*r*u-s*r*l+e,t[5]=a*n*l+s*n*u+i,t}function It(t,e){var i,r=(i=e)[0]*i[3]-i[1]*i[2];rt(0!==r,32);var n=e[0],o=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/r,t[1]=-o/r,t[2]=-a/r,t[3]=n/r,t[4]=(a*u-s*l)/r,t[5]=-(n*u-o*l)/r,t}function Mt(t){return"matrix("+t.join(", ")+")"}var At="bottom-left",jt="bottom-right",Lt="top-left",Dt="top-right",zt=0,Gt=1,Nt=2,Bt=4,Ut=8,Vt=16;function Wt(t){for(var e=Jt(),i=0,r=t.length;i<r;++i)ae(e,t[i]);return e}function qt(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Xt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Kt(t,e,i){var r,n;return(r=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*r+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function Yt(t,e){return Ht(t,e[0],e[1])}function Zt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Ht(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function $t(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],a=e[0],s=e[1],l=zt;return a<i?l|=Vt:a>n&&(l|=Bt),s<r?l|=Ut:s>o&&(l|=Nt),l===zt&&(l=Gt),l}function Jt(){return[1/0,1/0,-1/0,-1/0]}function Qt(t,e,i,r,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=r,n):[t,e,i,r]}function te(t){return Qt(1/0,1/0,-1/0,-1/0,t)}function ee(t,e){var i=t[0],r=t[1];return Qt(i,r,i,r,e)}function ie(t,e){return function(t,e){for(var i=0,r=e.length;i<r;++i)ae(t,e[i]);return t}(te(e),t)}function re(t,e,i,r,n){return se(te(n),t,e,i,r)}function ne(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function oe(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function ae(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function se(t,e,i,r,n){for(;i<r;i+=n)le(t,e[i],e[i+1]);return t}function le(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function ue(t,e){var i;return(i=e(ce(t)))||(i=e(pe(t)))||(i=e(_e(t)))?i:(i=e(ve(t)))||!1}function he(t){var e=0;return we(t)||(e=xe(t)*ye(t)),e}function ce(t){return[t[0],t[1]]}function pe(t){return[t[2],t[1]]}function de(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function fe(t,e){var i;return e===At?i=ce(t):e===jt?i=pe(t):e===Lt?i=ve(t):e===Dt?i=_e(t):rt(!1,13),i}function ge(t,e,i,r,n){var o=e*r[0]/2,a=e*r[1]/2,s=Math.cos(i),l=Math.sin(i),u=o*s,h=o*l,c=a*s,p=a*l,d=t[0],f=t[1],g=d-u+p,y=d-u-p,m=d+u-p,v=d+u+p,_=f-h-c,x=f-h+c,b=f+h+c,w=f+h-c;return Qt(Math.min(g,y,m,v),Math.min(_,x,b,w),Math.max(g,y,m,v),Math.max(_,x,b,w),n)}function ye(t){return t[3]-t[1]}function me(t,e,i){var r=i||[1/0,1/0,-1/0,-1/0];return be(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):te(r),r}function ve(t){return[t[0],t[3]]}function _e(t){return[t[2],t[3]]}function xe(t){return t[2]-t[0]}function be(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function we(t){return t[2]<t[0]||t[3]<t[1]}function Se(t,e,i,r){var n=[];if(r>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<r;++s)n.push(t[0]+o*s/r,t[1],t[2],t[1]+a*s/r,t[2]-o*s/r,t[3],t[0],t[3]-a*s/r);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],h=(s=0,n.length);s<h;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return Qt(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var Ce=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Ct[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function Te(t,e,i){return Math.min(Math.max(t,e),i)}var Ee="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},ke="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Re(t,e,i,r,n,o){var a=n-i,s=o-r;if(0!==a||0!==s){var l=((t-i)*a+(e-r)*s)/(a*a+s*s);l>1?(i=n,r=o):l>0&&(i+=a*l,r+=s*l)}return Oe(t,e,i,r)}function Oe(t,e,i,r){var n=i-t,o=r-e;return n*n+o*o}function Pe(t){return 180*t/Math.PI}function Fe(t){return t*Math.PI/180}function Ie(t,e){var i=t%e;return i*e<0?i+e:i}function Me(t,e,i){return t+i*(e-t)}var Ae=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),je=6378137*Math.PI,Le=[-je,-je,je,je],De=[-180,-85,180,85],ze=6378137*Math.log(Math.tan(Math.PI/2)),Ge=function(t){function e(e){return t.call(this,{code:e,units:bt,extent:Le,global:!0,worldExtent:De,getPointResolution:function(t,e){return t/Ee(e[1]/6378137)}})||this}return Ae(e,t),e}(Ce),Ne=[new Ge("EPSG:3857"),new Ge("EPSG:102100"),new Ge("EPSG:102113"),new Ge("EPSG:900913"),new Ge("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Be(t,e,i){var r=t.length,n=i>1?i:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(r));for(var a=0;a<r;a+=n){o[a]=je*t[a]/180;var s=6378137*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>ze?s=ze:s<-ze&&(s=-ze),o[a+1]=s}return o}function Ue(t,e,i){var r=t.length,n=i>1?i:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(r));for(var a=0;a<r;a+=n)o[a]=180*t[a]/je,o[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return o}var Ve=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),We=[-180,-90,180,90],qe=6378137*Math.PI/180,Xe=function(t){function e(e,i){return t.call(this,{code:e,units:_t,extent:We,axisOrientation:i,global:!0,metersPerUnit:qe,worldExtent:We})||this}return Ve(e,t),e}(Ce),Ke=[new Xe("CRS:84"),new Xe("EPSG:4326","neu"),new Xe("urn:ogc:def:crs:OGC:1.3:CRS84"),new Xe("urn:ogc:def:crs:OGC:2:84"),new Xe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],Ye={};var Ze={};function He(t,e,i){var r=t.getCode(),n=e.getCode();r in Ze||(Ze[r]={}),Ze[r][n]=i}function $e(t,e,i){var r=i||6371008.8,n=Fe(t[1]),o=Fe(e[1]),a=(o-n)/2,s=Fe(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Je(t,e){for(var i=0,r=0,n=t.length;r<n-1;++r)i+=$e(t[r],t[r+1],e);return i}function Qe(t,e){for(var i=0,r=t.length,n=t[r-1][0],o=t[r-1][1],a=0;a<r;a++){var s=t[a][0],l=t[a][1];i+=Fe(s-n)*(2+Math.sin(Fe(o))+Math.sin(Fe(l))),n=s,o=l}return i*e*e/2}var ti=Object.freeze({__proto__:null,DEFAULT_RADIUS:6371008.8,getDistance:$e,getLength:function t(e,i){var r=i||{},n=r.radius||6371008.8,o=r.projection||"EPSG:3857",a=e.getType();a!==mt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,d=0;switch(a){case ht:case ft:break;case ct:case pt:d=Je(s=e.getCoordinates(),n);break;case gt:case dt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)d+=Je(s[u],n);break;case yt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=s[u]).length;c<p;++c)d+=Je(l[c],n);break;case mt:var f=e.getGeometries();for(u=0,h=f.length;u<h;++u)d+=t(f[u],i);break;default:throw new Error("Unsupported geometry type: "+a)}return d},getArea:function t(e,i){var r=i||{},n=r.radius||6371008.8,o=r.projection||"EPSG:3857",a=e.getType();a!==mt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,d=0;switch(a){case ht:case ft:case ct:case gt:case pt:break;case dt:for(s=e.getCoordinates(),d=Math.abs(Qe(s[0],n)),u=1,h=s.length;u<h;++u)d-=Math.abs(Qe(s[u],n));break;case yt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(l=s[u],d+=Math.abs(Qe(l[0],n)),c=1,p=l.length;c<p;++c)d-=Math.abs(Qe(l[c],n));break;case mt:var f=e.getGeometries();for(u=0,h=f.length;u<h;++u)d+=t(f[u],i);break;default:throw new Error("Unsupported geometry type: "+a)}return d},offset:function(t,e,i,r){var n=r||6371008.8,o=Fe(t[1]),a=Fe(t[0]),s=e/n,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(i));return[Pe(a+Math.atan2(Math.sin(i)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l))),Pe(l)]}});function ei(t,e){for(var i=(""+t).split("."),r=(""+e).split("."),n=0;n<Math.max(i.length,r.length);n++){var o=parseInt(i[n]||"0",10),a=parseInt(r[n]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function ii(t,e){var i,r,n=t[0],o=t[1],a=e[0],s=e[1],l=a[0],u=a[1],h=s[0],c=s[1],p=h-l,d=c-u,f=0===p&&0===d?0:(p*(n-l)+d*(o-u))/(p*p+d*d||0);return f<=0?(i=l,r=u):f>=1?(i=h,r=c):(i=l+f*p,r=u+f*d),[i,r]}function ri(t,e){for(var i=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){i=!1;break}return i}function ni(t,e){var i=Math.cos(e),r=Math.sin(e),n=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=n,t[1]=o,t}function oi(t,e){var i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function ai(t,e){return Math.sqrt(oi(t,e))}function si(t,e){return oi(t,ii(t,e))}function li(t,e){if(e.canWrapX()){var i=xe(e.getExtent()),r=function(t,e,i){var r=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])){var o=i||xe(r);n=Math.floor((t[0]-r[0])/o)}return n}(t,e,i);r&&(t[0]-=r*i)}return t}function ui(t,e,i){var r;if(void 0!==e){for(var n=0,o=t.length;n<o;++n)e[n]=t[n];r=e}else r=t.slice();return r}function hi(t,e,i){if(void 0!==e&&t!==e){for(var r=0,n=t.length;r<n;++r)e[r]=t[r];t=e}return t}function ci(t){!function(t,e){Ye[t]=e}(t.getCode(),t),He(t,t,ui)}function pi(t){return"string"==typeof t?Ye[e=t]||Ye[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function di(t,e,i,r){var n,o=(t=pi(t)).getPointResolutionFunc();if(o){if(n=o(e,i),r&&r!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/Ct[r])}else{var a=t.getUnits();if(a==_t&&!r||r==_t)n=e;else{var s,l=mi(t,pi("EPSG:4326"));if(l===hi&&a!==_t)n=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=($e((u=l(u,u,2)).slice(0,2),u.slice(2,4))+$e(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=r?Ct[r]:t.getMetersPerUnit())&&(n/=s)}}return n}function fi(t){!function(t){t.forEach(ci)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&He(e,t,ui)}))}))}function gi(t,e){return t?"string"==typeof t?pi(t):t:pi(e)}function yi(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||mi(t,e)===ui)&&i}function mi(t,e){var i=function(t,e){var i;return t in Ze&&e in Ze[t]&&(i=Ze[t][e]),i}(t.getCode(),e.getCode());return i||(i=hi),i}function vi(t,e){return mi(pi(t),pi(e))}function _i(t,e,i){return vi(e,i)(t,void 0,t.length)}var xi,bi,wi;function Si(t,e){return t}function Ci(t,e){return t}function Ti(t,e){return t}function Ei(t,e){return t}function ki(t,e,i,r,n,o){for(var a=o||[],s=0,l=e;l<i;l+=r){var u=t[l],h=t[l+1];a[s++]=n[0]*u+n[2]*h+n[4],a[s++]=n[1]*u+n[3]*h+n[5]}return o&&a.length!=s&&(a.length=s),a}function Ri(t,e,i,r,n,o,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),h=o[0],c=o[1],p=0,d=e;d<i;d+=r){var f=t[d]-h,g=t[d+1]-c;s[p++]=h+f*l-g*u,s[p++]=c+f*u+g*l;for(var y=d+2;y<d+r;++y)s[p++]=t[y]}return a&&s.length!=p&&(s.length=p),s}function Oi(t,e,i,r,n,o,a){for(var s=a||[],l=0,u=e;u<i;u+=r){s[l++]=t[u]+n,s[l++]=t[u+1]+o;for(var h=u+2;h<u+r;++h)s[l++]=t[h]}return a&&s.length!=l&&(s.length=l),s}fi(Ne),fi(Ke),xi=Ne,bi=Be,wi=Ue,Ke.forEach((function(t){xi.forEach((function(e){He(t,e,bi),He(e,t,wi)}))}));var Pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fi=[1,0,0,1,0,0],Ii=function(t){function i(){var e,i,r,n,o,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===n&&g(t,r)||(o=!0,n=this,r=t,i=e.apply(this,arguments)),i}),a}return Pi(i,t),i.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},i.prototype.clone=function(){return e()},i.prototype.closestPointXY=function(t,i,r,n){return e()},i.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},i.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},i.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},i.prototype.computeExtent=function(t){return e()},i.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&te(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},i.prototype.rotate=function(t,i){e()},i.prototype.scale=function(t,i,r){e()},i.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},i.prototype.getSimplifiedGeometry=function(t){return e()},i.prototype.getType=function(){return e()},i.prototype.applyTransform=function(t){e()},i.prototype.intersectsExtent=function(t){return e()},i.prototype.translate=function(t,i){e()},i.prototype.transform=function(t,e){var i=pi(t),r=i.getUnits()==wt?function(t,r,n){var o=i.getExtent(),a=i.getWorldExtent(),s=ye(a)/ye(o);return Ft(Fi,a[0],a[3],s,-s,0,0,0),ki(t,0,t.length,n,Fi,r),vi(i,e)(t,r,n)}:vi(i,e);return this.applyTransform(r),this},i}(Y),Mi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ai=function(t){function i(){var e=t.call(this)||this;return e.layout=at,e.stride=2,e.flatCoordinates=null,e}return Mi(i,t),i.prototype.computeExtent=function(t){return re(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},i.prototype.getCoordinates=function(){return e()},i.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},i.prototype.getFlatCoordinates=function(){return this.flatCoordinates},i.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},i.prototype.getLayout=function(){return this.layout},i.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},i.prototype.getSimplifiedGeometryInternal=function(t){return this},i.prototype.getStride=function(){return this.stride},i.prototype.setFlatCoordinates=function(t,e){this.stride=ji(t),this.layout=t,this.flatCoordinates=e},i.prototype.setCoordinates=function(t,i){e()},i.prototype.setLayout=function(t,e,i){var r;if(t)r=ji(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=at,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=at:3==t?e=st:4==t&&(e=ut);return e}(r=e.length)}this.layout=t,this.stride=r},i.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},i.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var r=this.getStride();Ri(i,0,i.length,r,t,e,i),this.changed()}},i.prototype.scale=function(t,e,i){var r=e;void 0===r&&(r=t);var n=i;n||(n=de(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,i,r,n,o,a,s){for(var l=s||[],u=a[0],h=a[1],c=0,p=e;p<i;p+=r){var d=t[p]-u,f=t[p+1]-h;l[c++]=u+n*d,l[c++]=h+o*f;for(var g=p+2;g<p+r;++g)l[c++]=t[g]}s&&l.length!=c&&(l.length=c)}(o,0,o.length,a,t,r,n,o),this.changed()}},i.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var r=this.getStride();Oi(i,0,i.length,r,t,e,i),this.changed()}},i}(Ii);function ji(t){var e;return t==at?e=2:t==st||t==lt?e=3:t==ut&&(e=4),e}function Li(t,e,i,r,n,o,a){var s,l=t[e],u=t[e+1],h=t[i]-l,c=t[i+1]-u;if(0===h&&0===c)s=e;else{var p=((n-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)s=i;else{if(p>0){for(var d=0;d<r;++d)a[d]=Me(t[e+d],t[i+d],p);return void(a.length=r)}s=e}}for(d=0;d<r;++d)a[d]=t[s+d];a.length=r}function Di(t,e,i,r,n){var o=t[e],a=t[e+1];for(e+=r;e<i;e+=r){var s=t[e],l=t[e+1],u=Oe(o,a,s,l);u>n&&(n=u),o=s,a=l}return n}function zi(t,e,i,r,n){for(var o=0,a=i.length;o<a;++o){var s=i[o];n=Di(t,e,s,r,n),e=s}return n}function Gi(t,e,i,r,n,o,a,s,l,u,h){if(e==i)return u;var c,p;if(0===n){if((p=Oe(a,s,t[e],t[e+1]))<u){for(c=0;c<r;++c)l[c]=t[e+c];return l.length=r,p}return u}for(var d=h||[NaN,NaN],f=e+r;f<i;)if(Li(t,f-r,f,r,a,s,d),(p=Oe(a,s,d[0],d[1]))<u){for(u=p,c=0;c<r;++c)l[c]=d[c];l.length=r,f+=r}else f+=r*Math.max((Math.sqrt(p)-Math.sqrt(u))/n|0,1);if(o&&(Li(t,i-r,e,r,a,s,d),(p=Oe(a,s,d[0],d[1]))<u)){for(u=p,c=0;c<r;++c)l[c]=d[c];l.length=r}return u}function Ni(t,e,i,r,n,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];u=Gi(t,e,f,r,n,o,a,s,l,u,c),e=f}return u}function Bi(t,e,i,r){for(var n=0,o=i.length;n<o;++n)t[e++]=i[n];return e}function Ui(t,e,i,r){for(var n=0,o=i.length;n<o;++n)for(var a=i[n],s=0;s<r;++s)t[e++]=a[s];return e}function Vi(t,e,i,r,n){for(var o=n||[],a=0,s=0,l=i.length;s<l;++s){var u=Ui(t,e,i[s],r);o[a++]=u,e=u}return o.length=a,o}function Wi(t,e,i,r,n,o,a){var s=(i-e)/r;if(s<3){for(;e<i;e+=r)o[a++]=t[e],o[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-r],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),d=0,f=t[p],g=t[p+1],y=t[c],m=t[c+1],v=p+r;v<c;v+=r){var _=Re(t[v],t[v+1],f,g,y,m);_>d&&(h=v,d=_)}d>n&&(l[(h-e)/r]=1,p+r<h&&u.push(p,h),h+r<c&&u.push(h,c))}for(v=0;v<s;++v)l[v]&&(o[a++]=t[e+v*r],o[a++]=t[e+v*r+1]);return a}function qi(t,e){return e*Math.round(t/e)}function Xi(t,e,i,r,n,o,a){if(e==i)return a;var s,l,u=qi(t[e],n),h=qi(t[e+1],n);e+=r,o[a++]=u,o[a++]=h;do{if(s=qi(t[e],n),l=qi(t[e+1],n),(e+=r)==i)return o[a++]=s,o[a++]=l,a}while(s==u&&l==h);for(;e<i;){var c=qi(t[e],n),p=qi(t[e+1],n);if(e+=r,c!=s||p!=l){var d=s-u,f=l-h,g=c-u,y=p-h;d*y==f*g&&(d<0&&g<d||d==g||d>0&&g>d)&&(f<0&&y<f||f==y||f>0&&y>f)?(s=c,l=p):(o[a++]=s,o[a++]=l,u=s,h=l,s=c,l=p)}}return o[a++]=s,o[a++]=l,a}function Ki(t,e,i,r,n,o,a,s){for(var l=0,u=i.length;l<u;++l){var h=i[l];a=Xi(t,e,h,r,n,o,a),s.push(a),e=h}return a}function Yi(t,e,i,r,n){for(var o=void 0!==n?n:[],a=0,s=e;s<i;s+=r)o[a++]=t.slice(s,s+r);return o.length=a,o}function Zi(t,e,i,r,n){for(var o=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];o[a++]=Yi(t,e,u,r,o[a]),e=u}return o.length=a,o}function Hi(t,e,i,r,n){for(var o=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];o[a++]=Zi(t,e,u,r,o[a]),e=u[u.length-1]}return o.length=a,o}function $i(t,e,i,r){for(var n=0,o=t[i-r],a=t[i-r+1];e<i;e+=r){var s=t[e],l=t[e+1];n+=a*s-o*l,o=s,a=l}return n/2}function Ji(t,e,i,r){for(var n=0,o=0,a=i.length;o<a;++o){var s=i[o];n+=$i(t,e,s,r),e=s}return n}var Qi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tr=function(t){function e(e,i){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?r.setCoordinates(e,i):r.setFlatCoordinates(i,e),r}return Qi(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,r){return r<Kt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.getArea=function(){return $i(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Yi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,at)},e.prototype.getType=function(){return pt},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ui(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ai),er=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ir=function(t){function e(e,i){var r=t.call(this)||this;return r.setCoordinates(e,i),r}return er(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=Oe(t,e,n[0],n[1]);if(o<r){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,o}return r},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return ee(this.flatCoordinates,t)},e.prototype.getType=function(){return ht},e.prototype.intersectsExtent=function(t){return Ht(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Bi(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ai);function rr(t,e,i,r,n){return!ue(n,(function(n){return!nr(t,e,i,r,n[0],n[1])}))}function nr(t,e,i,r,n,o){for(var a=0,s=t[i-r],l=t[i-r+1];e<i;e+=r){var u=t[e],h=t[e+1];l<=o?h>o&&(u-s)*(o-l)-(n-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(n-s)*(h-l)<0&&a--,s=u,l=h}return 0!==a}function or(t,e,i,r,n,o){if(0===i.length)return!1;if(!nr(t,e,i[0],r,n,o))return!1;for(var a=1,s=i.length;a<s;++a)if(nr(t,i[a-1],i[a],r,n,o))return!1;return!0}function ar(t,e,i,r,n,o,a){for(var s,l,u,c,p,d,f,g=n[o+1],y=[],m=0,v=i.length;m<v;++m){var _=i[m];for(c=t[_-r],d=t[_-r+1],s=e;s<_;s+=r)p=t[s],f=t[s+1],(g<=d&&f<=g||d<=g&&g<=f)&&(u=(g-d)/(f-d)*(p-c)+c,y.push(u)),c=p,d=f}var x=NaN,b=-1/0;for(y.sort(h),c=y[0],s=1,l=y.length;s<l;++s){p=y[s];var w=Math.abs(p-c);w>b&&or(t,e,i,r,u=(c+p)/2,g)&&(x=u,b=w),c=p}return isNaN(x)&&(x=n[o]),a?(a.push(x,g,b),a):[x,g,b]}function sr(t,e,i,r,n){for(var o=[],a=0,s=i.length;a<s;++a){var l=i[a];o=ar(t,e,l,r,n,2*a,o),e=l[l.length-1]}return o}function lr(t,e,i,r,n){for(var o,a=[t[e],t[e+1]],s=[];e+r<i;e+=r){if(s[0]=t[e+r],s[1]=t[e+r+1],o=n(a,s))return o;a[0]=s[0],a[1]=s[1]}return!1}function ur(t,e,i,r,n){var o=se([1/0,1/0,-1/0,-1/0],t,e,i,r);return!!be(n,o)&&(!!Zt(n,o)||(o[0]>=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||lr(t,e,i,r,(function(t,e){return function(t,e,i){var r=!1,n=$t(t,e),o=$t(t,i);if(n===Gt||o===Gt)r=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=i[0],d=i[1],f=(d-c)/(p-h),g=void 0,y=void 0;o&Nt&&!(n&Nt)&&(r=(g=p-(d-u)/f)>=a&&g<=l),r||!(o&Bt)||n&Bt||(r=(y=d-(p-l)*f)>=s&&y<=u),r||!(o&Ut)||n&Ut||(r=(g=p-(d-s)/f)>=a&&g<=l),r||!(o&Vt)||n&Vt||(r=(y=d-(p-a)*f)>=s&&y<=u)}return r}(n,t,e)})))))}function hr(t,e,i,r,n){if(!function(t,e,i,r,n){return!!ur(t,e,i,r,n)||(!!nr(t,e,i,r,n[0],n[1])||(!!nr(t,e,i,r,n[0],n[3])||(!!nr(t,e,i,r,n[2],n[1])||!!nr(t,e,i,r,n[2],n[3]))))}(t,e,i[0],r,n))return!1;if(1===i.length)return!0;for(var o=1,a=i.length;o<a;++o)if(rr(t,i[o-1],i[o],r,n)&&!ur(t,i[o-1],i[o],r,n))return!1;return!0}function cr(t,e,i,r){for(;e<i-r;){for(var n=0;n<r;++n){var o=t[e+n];t[e+n]=t[i-r+n],t[i-r+n]=o}e+=r,i-=r}}function pr(t,e,i,r){for(var n=0,o=t[i-r],a=t[i-r+1];e<i;e+=r){var s=t[e],l=t[e+1];n+=(s-o)*(l+a),o=s,a=l}return 0===n?void 0:n>0}function dr(t,e,i,r,n){for(var o=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=pr(t,e,l,r);if(0===a){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function fr(t,e,i,r,n){for(var o=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=pr(t,e,l,r);(0===a?o&&u||!o&&!u:o&&!u||!o&&u)&&cr(t,e,l,r),e=l}return e}function gr(t,e,i,r,n){for(var o=0,a=i.length;o<a;++o)e=fr(t,e,i[o],r,n);return e}var yr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mr=function(t){function e(e,i,r){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&r?(n.setFlatCoordinates(i,e),n.ends_=r):n.setCoordinates(e,i),n}return yr(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?f(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,r){return r<Kt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(zi(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ni(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.containsXY=function(t,e){return or(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return Ji(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?fr(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Zi(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=de(this.getExtent());this.flatInteriorPoint_=ar(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ir(this.getFlatInteriorPoint(),lt)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new tr(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,r=[],n=0,o=0,a=i.length;o<a;++o){var s=i[o],l=new tr(e.slice(n,s),t);r.push(l),n=s}return r},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;dr(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=fr(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=Ki(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,r),new e(i,at,r)},e.prototype.getType=function(){return dt},e.prototype.intersectsExtent=function(t){return hr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=Vi(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Ai);function vr(t){var e=t[0],i=t[1],r=t[2],n=t[3],o=[e,i,e,n,r,n,r,i,e,i];return new mr(o,at,[o.length])}function _r(t,e,i){for(var r=e||32,n=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=n*(r+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var h=2;h<n;h++)l[u+h]=a[h]}var c=[l.length],p=new mr(l,o,c);return function(t,e,i,r){for(var n=t.getFlatCoordinates(),o=t.getStride(),a=n.length/o-1,s=r||0,l=0;l<=a;++l){var u=l*o,h=s+2*Ie(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(h),n[u+1]=e[1]+i*Math.sin(h)}t.changed()}(p,a,t.getRadius(),i),p}var xr="prerender",br="postrender",wr="precompose",Sr="postcompose",Cr="rendercomplete",Tr=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}();function Er(t,e,i,r,n,o,a){var s,l,u=(i-e)/r;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var c=t[e],p=t[e+1],d=0,f=[0],g=e+r;g<i;g+=r){var y=t[g],m=t[g+1];d+=Math.sqrt((y-c)*(y-c)+(m-p)*(m-p)),f.push(d),c=y,p=m}var v=n*d,_=function(t,e,i){for(var r,n,o=i||h,a=0,s=t.length,l=!1;a<s;)(n=+o(t[r=a+(s-a>>1)],e))<0?a=r+1:(s=r,l=!n);return l?a:~a}(f,v);_<0?(l=(v-f[-_-2])/(f[-_-1]-f[-_-2]),s=e+(-_-2)*r):s=e+_*r}var x=a>1?a:2,b=o||new Array(x);for(g=0;g<x;++g)b[g]=void 0===s?NaN:void 0===l?t[s+g]:Me(t[s+g],t[s+r+g],l);return b}function kr(t,e,i,r,n,o){if(i==e)return null;var a;if(n<t[e+r-1])return o?((a=t.slice(e,e+r))[r-1]=n,a):null;if(t[i-1]<n)return o?((a=t.slice(i-r,i))[r-1]=n,a):null;if(n==t[e+r-1])return t.slice(e,e+r);for(var s=e/r,l=i/r;s<l;){var u=s+l>>1;n<t[(u+1)*r-1]?l=u:s=u+1}var h=t[s*r-1];if(n==h)return t.slice((s-1)*r,(s-1)*r+r);var c=(n-h)/(t[(s+1)*r-1]-h);a=[];for(var p=0;p<r-1;++p)a.push(Me(t[(s-1)*r+p],t[s*r+p],c));return a.push(n),a}function Rr(t,e,i,r){for(var n=t[e],o=t[e+1],a=0,s=e+r;s<i;s+=r){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-o)*(u-o)),n=l,o=u}return a}var Or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pr=function(t){function e(e,i){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?r.setCoordinates(e,i):r.setFlatCoordinates(i,e),r}return Or(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?f(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,r){return r<Kt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))},e.prototype.forEachSegment=function(t){return lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=lt&&this.layout!=ut)return null;var i=void 0!==e&&e;return kr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return Yi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Er(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Rr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,at)},e.prototype.getType=function(){return ct},e.prototype.intersectsExtent=function(t){return ur(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ui(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ai),Fr=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||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.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),Ir=0,Mr=1,Ar=2,jr=3,Lr=4;function Dr(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*e,i[1]=t[1]+2*e,i}function zr(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function Gr(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Nr=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Gr(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return e()},t.prototype.getImage=function(t){return e()},t.prototype.getHitDetectionImage=function(){return e()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return e()},t.prototype.getImageSize=function(){return e()},t.prototype.getHitDetectionImageSize=function(){return e()},t.prototype.getOrigin=function(){return e()},t.prototype.getSize=function(){return e()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Gr(t)},t.prototype.listenImageChange=function(t){e()},t.prototype.load=function(){e()},t.prototype.unlistenImageChange=function(t){e()},t}(),Br=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Ur=/^([a-z]*)$|^hsla?\(.*\)$/i;function Vr(t){return"string"==typeof t?t:Yr(t)}function Wr(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}var qr=function(){var t={},e=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(e>=1024){var n=0;for(var o in t)0==(3&n++)&&(delete t[o],--e)}r=function(t){var e,i,r,n,o;Ur.exec(t)&&(t=Wr(t));if(Br.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),r=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,r=(r<<4)+r,l&&(n=(n<<4)+n)),o=[e,i,r,n/255]}else 0==t.indexOf("rgba(")?Kr(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Kr(o)):rt(!1,14);return o}(i),t[i]=r,++e}return r}}();function Xr(t){return Array.isArray(t)?t:qr(t)}function Kr(t){return t[0]=Te(t[0]+.5|0,0,255),t[1]=Te(t[1]+.5|0,0,255),t[2]=Te(t[2]+.5|0,0,255),t[3]=Te(t[3],0,1),t}function Yr(t){var e=t[0];e!=(0|e)&&(e=e+.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("+e+","+i+","+r+","+(void 0===t[3]?1:t[3])+")"}function Zr(t){return Array.isArray(t)?Yr(t):t}var Hr="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",$r=-1!==Hr.indexOf("firefox"),Jr=(-1!==Hr.indexOf("safari")&&Hr.indexOf("chrom"),-1!==Hr.indexOf("webkit")&&-1==Hr.indexOf("edge")),Qr=-1!==Hr.indexOf("macintosh"),tn="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,en="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,rn="undefined"!=typeof Image&&Image.prototype.decode,nn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}();function on(t,e,i){var r=i&&i.length?i.shift():en?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(r.width=t),e&&(r.height=e),r.getContext("2d")}function an(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function sn(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var ln=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"),un=["style","variant","weight","size","lineHeight","family"],hn=function(t){var e=t.match(ln);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,n=un.length;r<n;++r){var o=e[r+1];void 0!==o&&(i[un[r]]=o)}return i.families=i.family.split(/,\s?/),i},cn=[],pn=[0,0,0,0],dn=new Y,fn=new C;fn.setSize=function(){console.warn("labelCache is deprecated.")};var gn,yn,mn=null,vn={},_n=function(){var t,e,i=["monospace","serif"],r=i.length,n="wmytzilWMYTZIL@#/&?$%10";function o(t,o,a){for(var s=!0,l=0;l<r;++l){var u=i[l];if(e=wn(t+" "+o+" 32px "+u,n),a!=u){var h=wn(t+" "+o+" 32px "+a+","+u,n);s=s&&h!=e}}return!!s}function a(){for(var e=!0,i=dn.getKeys(),r=0,n=i.length;r<n;++r){var a=i[r];dn.get(a)<100&&(o.apply(this,a.split("\n"))?(x(vn),mn=null,gn=void 0,dn.set(a,100)):(dn.set(a,dn.get(a)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=hn(e);if(i)for(var r=i.families,n=0,s=r.length;n<s;++n){var l=r[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===dn.get(u)&&(dn.set(u,100,!0),o(i.style,i.weight,l)||(dn.set(u,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),xn=function(t){var e=vn[t];if(null==e){if(en){var i=hn(t),r=bn(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else yn||((yn=document.createElement("div")).innerHTML="M",yn.style.margin="0 !important",yn.style.padding="0 !important",yn.style.position="absolute !important",yn.style.left="-99999px !important"),yn.style.font=t,document.body.appendChild(yn),e=yn.offsetHeight,document.body.removeChild(yn);vn[t]=e}return e};function bn(t,e){return mn||(mn=on(1,1)),t!=gn&&(mn.font=t,gn=mn.font),mn.measureText(e)}function wn(t,e){return bn(t,e).width}function Sn(t,e,i){if(e in i)return i[e];var r=wn(t,e);return i[e]=r,r}function Cn(t,e,i,r){0!==e&&(t.translate(i,r),t.rotate(e),t.translate(-i,-r))}function Tn(t,e,i,r,n,o,a,s,l,u,h){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var i=t.contextInstructions,r=0,n=i.length;r<n;r+=2)Array.isArray(i[r+1])?e[i[r]].apply(e,i[r+1]):e[i[r]]=i[r+1]}(r,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(r,n,o,a,s,0,0,a,s)):t.drawImage(r,n,o,a,s,l,u,a*h[0],s*h[1]),t.restore()}var En=null;function kn(t){return en?Mt(t):(En||(En=on(1,1).canvas),En.style.transform=Mt(t),En.style.transform)}var Rn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),On=function(t){function e(e){var i=this,r=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.imageSize_=null,i.hitDetectionImageSize_=null,i.render(),i}return Rn(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({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()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionCanvas_){var t=this.createRenderOptions();this.createHitDetectionCanvas_(t)}return this.hitDetectionCanvas_},e.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),i=on(e.size*t||1,e.size*t||1);this.draw_(e,i,0,0,t||1),this.canvas_[t||1]=i.canvas}return this.canvas_[t||1]},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return Ar},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.createRenderOptions=function(){var t,e="round",i="round",r=0,n=null,o=0,a=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Zr(t),void 0===(a=this.stroke_.getWidth())&&(a=1),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(i=this.stroke_.getLineJoin())&&(i="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),void 0===(r=this.stroke_.getMiterLimit())&&(r=10)),{strokeStyle:t,strokeWidth:a,size:2*(this.radius_+a)+1,lineCap:e,lineDash:n,lineDashOffset:o,lineJoin:i,miterLimit:r}},e.prototype.render=function(){var t=this.createRenderOptions(),e=on(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_={},this.canvas_[1]=e.canvas;var i=e.canvas.width,r=i,n=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t),this.anchor_=[i/2-n[0],i/2+n[1]],this.size_=[i,i],this.imageSize_=[r,r]},e.prototype.draw_=function(t,e,i,r,n){var o,a,s;e.setTransform(n,0,0,n,0,0),e.translate(i,r),e.beginPath();var l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var u=void 0!==this.radius2_?this.radius2_:this.radius_;for(u!==this.radius_&&(l*=2),o=0;o<=l;o++)a=2*o*Math.PI/l-Math.PI/2+this.angle_,s=o%2==0?this.radius_:u,e.lineTo(t.size/2+s*Math.cos(a),t.size/2+s*Math.sin(a))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h="#000"),e.fillStyle=Zr(h),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionCanvas_=this.getImage(1),this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=Xr(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var r=on(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,r){e.translate(i,r),e.beginPath();var n=this.points_;if(n===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o=void 0!==this.radius2_?this.radius2_:this.radius_;o!==this.radius_&&(n*=2);var a=void 0,s=void 0,l=void 0;for(a=0;a<=n;a++)l=2*a*Math.PI/n-Math.PI/2+this.angle_,s=a%2==0?this.radius_:o,e.lineTo(t.size/2+s*Math.cos(l),t.size/2+s*Math.sin(l))}e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}(Nr),Pn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fn=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return Pn(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(On),In=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Ln,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,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.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Ln,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Mn=null;function An(t,e){if(!Mn){var i=new Tr({color:"rgba(255,255,255,0.4)"}),r=new Fr({color:"#3399CC",width:1.25});Mn=[new In({image:new Fn({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return Mn}function jn(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[dt]=[new In({fill:new Tr({color:[255,255,255,.5]})})],t[yt]=t[dt],t[ct]=[new In({stroke:new Fr({color:e,width:5})}),new In({stroke:new Fr({color:i,width:3})})],t[gt]=t[ct],t[vt]=t[dt].concat(t[ct]),t[ht]=[new In({image:new Fn({radius:6,fill:new Tr({color:i}),stroke:new Fr({color:e,width:1.5})}),zIndex:1/0})],t[ft]=t[ht],t[mt]=t[dt].concat(t[ct],t[ht]),t}function Ln(t){return t.getGeometry()}var Dn="point",zn="line",Gn=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Gr(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Tr({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Dn,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=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(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),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()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Gr(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),Nn="opacity",Bn="visible",Un="extent",Vn="zIndex",Wn="maxResolution",qn="minResolution",Xn="maxZoom",Kn="minZoom",Yn="source",Zn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hn=function(t){function i(e){var i=t.call(this)||this,r=_({},e);return r[Nn]=void 0!==e.opacity?e.opacity:1,rt("number"==typeof r[Nn],64),r[Bn]=void 0===e.visible||e.visible,r[Vn]=e.zIndex,r[Wn]=void 0!==e.maxResolution?e.maxResolution:1/0,r[qn]=void 0!==e.minResolution?e.minResolution:0,r[Kn]=void 0!==e.minZoom?e.minZoom:-1/0,r[Xn]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==r.className?e.className:"ol-layer",delete r.className,i.setProperties(r),i.state_=null,i}return Zn(i,t),i.prototype.getClassName=function(){return this.className_},i.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=Te(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i?i:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},i.prototype.getLayersArray=function(t){return e()},i.prototype.getLayerStatesArray=function(t){return e()},i.prototype.getExtent=function(){return this.get(Un)},i.prototype.getMaxResolution=function(){return this.get(Wn)},i.prototype.getMinResolution=function(){return this.get(qn)},i.prototype.getMinZoom=function(){return this.get(Kn)},i.prototype.getMaxZoom=function(){return this.get(Xn)},i.prototype.getOpacity=function(){return this.get(Nn)},i.prototype.getSourceState=function(){return e()},i.prototype.getVisible=function(){return this.get(Bn)},i.prototype.getZIndex=function(){return this.get(Vn)},i.prototype.setExtent=function(t){this.set(Un,t)},i.prototype.setMaxResolution=function(t){this.set(Wn,t)},i.prototype.setMinResolution=function(t){this.set(qn,t)},i.prototype.setMaxZoom=function(t){this.set(Xn,t)},i.prototype.setMinZoom=function(t){this.set(Kn,t)},i.prototype.setOpacity=function(t){rt("number"==typeof t,64),this.set(Nn,t)},i.prototype.setVisible=function(t){this.set(Bn,t)},i.prototype.setZIndex=function(t){this.set(Vn,t)},i.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},i}(Y),$n="undefined",Jn="loading",Qn="ready",to="error",eo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),io=function(t){function e(e){var i=this,r=_({},e);delete r.source,(i=t.call(this,r)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(H(Yn),i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return eo(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Yn)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():$n},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(U(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=N(t,T,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(U(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(U(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=N(t,wr,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);rt(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=N(this,T,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Yn,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Hn);function ro(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}function no(t,e,i,r,n){!function t(e,i,r,n,o){for(;n>r;){if(n-r>600){var a=n-r+1,s=i-r+1,l=Math.log(a),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1),c=Math.max(r,Math.floor(i-s*u/a+h)),p=Math.min(n,Math.floor(i+(a-s)*u/a+h));t(e,i,c,p,o)}var d=e[i],f=r,g=n;for(oo(e,r,i),o(e[n],d)>0&&oo(e,r,n);f<g;){for(oo(e,f,g),f++,g--;o(e[f],d)<0;)f++;for(;o(e[g],d)>0;)g--}0===o(e[r],d)?oo(e,r,g):(g++,oo(e,g,n)),g<=i&&(r=g+1),i<=g&&(n=g-1)}}(t,e,i||0,r||t.length-1,n||ao)}function oo(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function ao(t,e){return t<e?-1:t>e?1:0}class so{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!_o(t,e))return i;const r=this.toBBox,n=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],s=e.leaf?r(a):a;_o(t,s)&&(e.leaf?i.push(a):vo(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!_o(t,e))return!1;const i=[];for(;e;){for(let r=0;r<e.children.length;r++){const n=e.children[r],o=e.leaf?this.toBBox(n):n;if(_o(t,o)){if(e.leaf||vo(t,o))return!0;i.push(n)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=xo([]),this}remove(t,e){if(!t)return this;let i=this.data;const r=this.toBBox(t),n=[],o=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=o.pop(),l=!0),i.leaf){const r=lo(t,i.children,e);if(-1!==r)return i.children.splice(r,1),n.push(i),this._condense(n),this}l||i.leaf||!vo(i,r)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),o.push(a),a=0,s=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,r){const n=i-e+1;let o,a=this._maxEntries;if(n<=a)return o=xo(t.slice(e,i+1)),uo(o,this.toBBox),o;r||(r=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,r-1))),o=xo([]),o.leaf=!1,o.height=r;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));bo(t,e,i,l,this.compareMinX);for(let n=e;n<=i;n+=l){const e=Math.min(n+l-1,i);bo(t,n,e,s,this.compareMinY);for(let i=n;i<=e;i+=s){const n=Math.min(i+s-1,e);o.children.push(this._build(t,i,n,r-1))}}return uo(o,this.toBBox),o}_chooseSubtree(t,e,i,r){for(;r.push(e),!e.leaf&&r.length-1!==i;){let i,r=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=go(l),h=(n=t,o=l,(Math.max(o.maxX,n.maxX)-Math.min(o.minX,n.minX))*(Math.max(o.maxY,n.maxY)-Math.min(o.minY,n.minY))-u);h<a?(a=h,r=u<r?u:r,i=l):h===a&&u<r&&(r=u,i=l)}e=i||e.children[0]}var n,o;return e}_insert(t,e,i){const r=i?t:this.toBBox(t),n=[],o=this._chooseSubtree(r,this.data,e,n);for(o.children.push(t),co(o,r);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)}_split(t,e){const i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);const o=this._chooseSplitIndex(i,n,r),a=xo(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,uo(i,this.toBBox),uo(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=xo([t,e]),this.data.height=t.height+1,this.data.leaf=!1,uo(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let r,n=1/0,o=1/0;for(let a=e;a<=i-e;a++){const e=ho(t,0,a,this.toBBox),s=ho(t,a,i,this.toBBox),l=mo(e,s),u=go(e)+go(s);l<n?(n=l,r=a,o=u<o?u:o):l===n&&u<o&&(o=u,r=a)}return r||i-e}_chooseSplitAxis(t,e,i){const r=t.leaf?this.compareMinX:po,n=t.leaf?this.compareMinY:fo;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,n)&&t.children.sort(r)}_allDistMargin(t,e,i,r){t.children.sort(r);const n=this.toBBox,o=ho(t,0,e,n),a=ho(t,i-e,i,n);let s=yo(o)+yo(a);for(let r=e;r<i-e;r++){const e=t.children[r];co(o,t.leaf?n(e):e),s+=yo(o)}for(let r=i-e-1;r>=e;r--){const e=t.children[r];co(a,t.leaf?n(e):e),s+=yo(a)}return s}_adjustParentBBoxes(t,e,i){for(let r=i;r>=0;r--)co(e[r],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():uo(t[i],this.toBBox)}}function lo(t,e,i){if(!i)return e.indexOf(t);for(let r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function uo(t,e){ho(t,0,t.children.length,e,t)}function ho(t,e,i,r,n){n||(n=xo(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];co(n,t.leaf?r(e):e)}return n}function co(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function po(t,e){return t.minX-e.minX}function fo(t,e){return t.minY-e.minY}function go(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function yo(t){return t.maxX-t.minX+(t.maxY-t.minY)}function mo(t,e){const i=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,o-r)}function vo(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function _o(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function xo(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function bo(t,e,i,r,n){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=r)continue;const a=e+Math.ceil((i-e)/r/2)*r;no(t,a,e,i,n),o.push(e,a,a,i)}}var wo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),So="renderOrder",Co=function(t){function e(e){var i=this,r=e||{},n=_({},r);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==r.declutter&&r.declutter,i.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(r.style),i.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,i.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,i}return wo(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(So)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new so(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(So,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:An,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;if(Array.isArray(t))i=t;else rt("function"==typeof t.getZIndex,41),i=[t];e=function(){return i}}return e}(this.style_),this.changed()},e}(io),To=0,Eo=1,ko=2,Ro=3,Oo=4,Po=5,Fo=6,Io=7,Mo=8,Ao=9,jo=10,Lo=11,Do=12,zo=[Mo],Go=[Do],No=[Eo],Bo=[Ro],Uo=function(){function t(){}return t.prototype.drawCustom=function(t,e,i){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),Vo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wo=function(t){function e(e,i,r,n){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=n,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Vo(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,n=this.coordinates,o=n.length,a=0,s=t.length;a<s;a+=e)r[0]=t[a],r[1]=t[a+1],Yt(i,r)&&(n[o++]=r[0],n[o++]=r[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,i,r,n,o){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();o&&(e+=r);var u,h,c,p=t[e],d=t[e+1],f=this.tmpCoordinate_,g=!0;for(u=e+r;u<i;u+=r)f[0]=t[u],f[1]=t[u+1],(c=$t(l,f))!==h?(g&&(a[s++]=p,a[s++]=d,g=!1),a[s++]=f[0],a[s++]=f[1]):c===Gt?(a[s++]=f[0],a[s++]=f[1],g=!1):g=!0,p=f[0],d=f[1],h=c;return(n&&g||u===e+r)&&(a[s++]=p,a[s++]=d),s},e.prototype.drawCustomCoordinates_=function(t,e,i,r,n){for(var o=0,a=i.length;o<a;++o){var s=i[o],l=this.appendFlatLineCoordinates(t,e,s,r,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var r,n,o,a,s,l=t.getType(),u=t.getStride(),h=this.coordinates.length;if(l==yt){r=t.getOrientedFlatCoordinates(),a=[];var c=t.getEndss();s=0;for(var p=0,d=c.length;p<d;++p){var f=[];s=this.drawCustomCoordinates_(r,s,c[p],u,f),a.push(f)}this.instructions.push([Oo,h,a,t,i,Hi])}else l==dt||l==gt?(o=[],r=l==dt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,t.getEnds(),u,o),this.instructions.push([Oo,h,o,t,i,Zi])):l==ct||l==vt?(r=t.getFlatCoordinates(),n=this.appendFlatLineCoordinates(r,0,r.length,u,!1,!1),this.instructions.push([Oo,h,n,t,i,Yi])):l==ft?(r=t.getFlatCoordinates(),(n=this.appendFlatPointCoordinates(r,u))>h&&this.instructions.push([Oo,h,n,t,i,Yi])):l==ht&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([Oo,h,n,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[To,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[To,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,r,n=e.length,o=-1;for(t=0;t<n;++t)(r=(i=e[t])[0])==Io?o=t:r==To&&(i[2]=t,d(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var r=t.getColor();i.fillStyle=Zr(r||"#000")}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=Zr(n||"#000");var o=e.getLineCap();i.lineCap=void 0!==o?o:"round";var a=e.getLineDash();i.lineDash=a?a.slice():cn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();i.miterLimit=void 0!==h?h:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=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},e.prototype.createFill=function(t){var e=t.fillStyle,i=[jo,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Lo,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,r=t.lineCap,n=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||n!=t.currentLineDash&&!g(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Io,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xt(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;qt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Uo),qo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xo=function(t){function e(e,i,r,n){var o=t.call(this,e,i,r,n)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return qo(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([Fo,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([Fo,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([Fo,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([Fo,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),r=t.getSize(),n=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=e},e}(Wo),Ko=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yo=function(t){function e(e,i,r,n){return t.call(this,e,i,r,n)||this}return Ko(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,r){var n=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,r,!1,!1),a=[Ao,n,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Lo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],No);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(Go),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Lo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],No);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(a,l,o[u],s);this.hitDetectionInstructions.push(Go),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Go),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Go),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(No)},e}(Wo),Zo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ho=function(t){function e(e,i,r,n){return t.call(this,e,i,r,n)||this}return Zo(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,r){var n=this.state,o=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(No),this.hitDetectionInstructions.push(No);for(var l=0;l<s;++l){var u=i[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,r,!0,!a),p=[Ao,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(Bo),this.hitDetectionInstructions.push(Bo)),e=u}return o&&(this.instructions.push(zo),this.hitDetectionInstructions.push(zo)),a&&(this.instructions.push(Go),this.hitDetectionInstructions.push(Go)),e},e.prototype.drawCircle=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([jo,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Lo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);var l=[ko,s];this.instructions.push(No,l),this.hitDetectionInstructions.push(No,l),void 0!==i.fillStyle&&(this.instructions.push(zo),this.hitDetectionInstructions.push(zo)),void 0!==i.strokeStyle&&(this.instructions.push(Go),this.hitDetectionInstructions.push(Go)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([jo,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Lo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,o,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([jo,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Lo,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(a,l,o[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,r=0,n=i.length;r<n;++r)i[r]=qi(i[r],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Wo);function $o(t,e,i,r,n){var o,a,s,l,u,h,c,p,d,f=i,g=i,y=0,m=0,v=i;for(o=i;o<r;o+=n){var _=e[o],x=e[o+1];void 0!==l&&(p=_-l,d=x-u,s=Math.sqrt(p*p+d*d),void 0!==h&&(m+=a,Math.acos((h*p+c*d)/(a*s))>t&&(m>y&&(y=m,f=v,g=o),m=0,v=o-n)),a=s,h=p,c=d),l=_,u=x}return(m+=s)>y?[v,o]:[f,g]}var Jo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qo={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ta={Circle:Ho,Default:Wo,Image:Xo,LineString:Yo,Polygon:Ho,Text:function(t){function e(e,i,r,n){var o=t.call(this,e,i,r,n)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return Jo(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var o=this.coordinates,a=o.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==zn||s!=ct&&s!=gt&&s!=dt&&s!=yt){var h=n.overflow?null:[];switch(s){case ht:case ft:l=t.getFlatCoordinates();break;case ct:l=t.getFlatMidpoint();break;case vt:l=t.getCenter();break;case gt:l=t.getFlatMidpoints(),u=2;break;case dt:l=t.getFlatInteriorPoint(),n.overflow||h.push(l[2]/this.resolution),u=3;break;case yt:var c=t.getFlatInteriorPoints();l=[];for(b=0,w=c.length;b<w;b+=3)n.overflow||h.push(c[b+2]/this.resolution),l.push(c[b],c[b+1]);if(0===l.length)return;u=2}if((O=this.appendFlatPointCoordinates(l,u))===a)return;this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var p=n.padding;if(p!=pn&&(n.scale[0]<0||n.scale[1]<0)){var d=n.padding[0],f=n.padding[1],g=n.padding[2],y=n.padding[3];n.scale[0]<0&&(f=-f,y=-y),n.scale[1]<0&&(d=-d,g=-g),p=[d,f,g,y]}var m=this.pixelRatio;this.instructions.push([Fo,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,p==pn?pn:p.map((function(t){return t*m})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var v=1/m;this.hitDetectionInstructions.push([Fo,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[v,v],NaN,this.declutterImageWithText_,p,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!be(this.getBufferedMaxExtent(),t.getExtent()))return;var _=void 0;if(l=t.getFlatCoordinates(),s==ct)_=[l.length];else if(s==gt)_=t.getEnds();else if(s==dt)_=t.getEnds().slice(0,1);else if(s==yt){var x=t.getEndss();_=[];for(var b=0,w=x.length;b<w;++b)_.push(x[b][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,T=void 0,E=0,k=_.length;E<k;++E){if(null==S){var R=$o(n.maxAngle,l,C,_[E],u);C=R[0],T=R[1]}else T=_[E];for(var b=C;b<T;b+=u)o.push(l[b],l[b+1]);var O=o.length;C=_[E],this.drawChars_(a,O),a=O}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,r=this.textState_,n=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Qo[r.textBaseline],u=this.textOffsetY_*s,h=this.text_,c=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([Po,t,e,l,r.overflow,a,r.maxAngle,s,u,n,c*s,h,o,1]),this.hitDetectionInstructions.push([Po,t,e,l,r.overflow,a,r.maxAngle,1,u,n,c,h,o,1/s])},e.prototype.setTextStyle=function(t,e){var i,n,o;if(t){var a=t.getFill();a?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=Zr(a.getColor()||"#000")):(n=null,this.textFillState_=n);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var l=s.getLineDash(),u=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();o.lineCap=s.getLineCap()||"round",o.lineDash=l?l.slice():cn,o.lineDashOffset=void 0===u?0:u,o.lineJoin=s.getLineJoin()||"round",o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=Zr(s.getColor()||"#000")}else o=null,this.textStrokeState_=o;i=this.textState_;var p=t.getFont()||"10px sans-serif";_n(p);var d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=p,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||pn,i.scale=void 0===d?[1,1]:d;var f=t.getOffsetX(),g=t.getOffsetY(),y=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===m?0:m,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:r(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+r(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Wo)},ea=function(){function t(t,e,i,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var r in i){var n=i[r].finish();t[e][r]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",r=this.buildersByZIndex_[i];void 0===r&&(r={},this.buildersByZIndex_[i]=r);var n=r[e];void 0===n&&(n=new(0,ta[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=n);return n},t}(),ia=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ra=function(t){function i(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return ia(i,t),i.prototype.getFeatures=function(t){return e()},i.prototype.prepareFrame=function(t){return e()},i.prototype.renderFrame=function(t,i){return e()},i.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},i.prototype.createLoadedTileFinder=function(t,e,i){return function(r,n){var o=this.loadedTileCallback.bind(this,i,r);return t.forEachLoadedTile(e,r,n,o)}.bind(this)},i.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){},i.prototype.getDataAtPixel=function(t,i,r){return e()},i.prototype.getLayer=function(){return this.layer_},i.prototype.handleFontsChanged=function(){},i.prototype.handleImageChange_=function(t){t.target.getState()===Ar&&this.renderIfReadyAndVisible()},i.prototype.loadImage=function(t){var e=t.getState();return e!=Ar&&e!=jr&&t.addEventListener(T,this.boundHandleImageChange_),e==Ir&&(t.load(),e=t.getState()),e==Ar},i.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Qn&&t.changed()},i}(W),na=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oa=function(t){function e(e,i,r,n){var o=t.call(this,e)||this;return o.inversePixelTransform=i,o.frameState=r,o.context=n,o}return na(e,t),e}(s),aa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sa=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return aa(e,t),e.prototype.useContainer=function(t,e,i){var r,n,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(!n||0!==n.canvas.width&&n.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=n,this.containerReused=!0),!this.container){(r=document.createElement("div")).className=o;var a=r.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=on()).canvas;r.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=r,this.context=n}},e.prototype.clip=function(t,e,i){var r=e.pixelRatio,n=e.size[0]*r/2,o=e.size[1]*r/2,a=e.viewState.rotation,s=ve(i),l=_e(i),u=pe(i),h=ce(i);Ot(e.coordinateToPixelTransform,s),Ot(e.coordinateToPixelTransform,l),Ot(e.coordinateToPixelTransform,u),Ot(e.coordinateToPixelTransform,h),t.save(),Cn(t,-a,n,o),t.beginPath(),t.moveTo(s[0]*r,s[1]*r),t.lineTo(l[0]*r,l[1]*r),t.lineTo(u[0]*r,u[1]*r),t.lineTo(h[0]*r,h[1]*r),t.clip(),Cn(t,a,n,o)},e.prototype.clipUnrotated=function(t,e,i){var r=ve(i),n=_e(i),o=pe(i),a=ce(i);Ot(e.coordinateToPixelTransform,r),Ot(e.coordinateToPixelTransform,n),Ot(e.coordinateToPixelTransform,o),Ot(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;Ot(s,r),Ot(s,n),Ot(s,o),Ot(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var r=this.getLayer();if(r.hasListener(t)){var n=new oa(t,this.inversePixelTransform,i,e);r.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(xr,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(br,t,e)},e.prototype.getRenderTransform=function(t,e,i,r,n,o,a){var s=n/2,l=o/2,u=r/e,h=-u,c=-t[0]+a,p=-t[1];return Ft(this.tempTransform,s,l,u,h,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var r,n=Ot(this.inversePixelTransform,t.slice()),o=this.context,a=this.getLayer().getExtent();if(a&&!Yt(a,Ot(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),h=u.getContext("2d");u.width=1,u.height=1,h.clearRect(0,0,1,1),h.drawImage(o.canvas,s,l,1,1,0,0,1,1),r=h.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:r}return 0===r[3]?null:r},e}(ra),la="Circle",ua="Default",ha="Image",ca="LineString",pa="Polygon",da="Text";function fa(t,e,i,r,n,o,a,s,l,u,h,c){var p=t[e],d=t[e+1],f=0,g=0,y=0,m=0;function v(){f=p,g=d,p=t[e+=r],d=t[e+1],m+=y,y=Math.sqrt((p-f)*(p-f)+(d-g)*(d-g))}do{v()}while(e<i-r&&m+y<o);for(var _=(o-m)/y,x=Me(f,p,_),b=Me(g,d,_),w=e-r,S=m,C=o+s*l(u,n,h);e<i-r&&m+y<C;)v();var T,E=Me(f,p,_=(C-m)/y),k=Me(g,d,_);if(c){var R=[x,b,E,k];Ri(R,0,4,2,c,R,R),T=R[0]>R[2]}else T=x>E;var O,P=Math.PI,F=[],I=w+r===e;if(y=0,m=S,p=t[e=w],d=t[e+1],I){v();var M=Math.atan2(d-g,p-f);T&&(M+=M>0?-P:P);var A=(E+x)/2,j=(k+b)/2;return F[0]=[A,j,(C-o)/2,M,n],F}for(var L=0,D=n.length;L<D;){v();var z=Math.atan2(d-g,p-f);if(T&&(z+=z>0?-P:P),void 0!==O){var G=z-O;if(G+=G>P?-2*P:G<-P?2*P:0,Math.abs(G)>a)return null}O=z;for(var N=L,B=0;L<D;++L){var U=s*l(u,n[T?D-L-1:L],h);if(e+r<i&&m+y<o+B+U/2)break;B+=U}if(L!==N){var V=T?n.substring(D-N,D-L):n.substring(N,L);A=Me(f,p,_=(o+B/2-m)/y),j=Me(g,d,_);F.push([A,j,B/2,z,V]),o+=B}}return F}var ga=[1/0,1/0,-1/0,-1/0],ya=[],ma=[],va=[],_a=[];function xa(t){return t[3].declutterBox}var ba=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function wa(t,e){return"start"!==e&&"end"!==e||ba.test(t)||(e="start"===e?"left":"right"),Qo[e]}var Sa=function(){function t(t,e,i,r,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderBuffer_=n,this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,r){var n=t+e+i+r;if(this.labels_[n])return this.labels_[n];var o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],h=wa(t,s.textAlign||"center"),c=r&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),d=p.length,f=[],g=function(t,e,i){for(var r=e.length,n=0,o=0;o<r;++o){var a=wn(t,e[o]);n=Math.max(n,a),i.push(a)}return n}(s.font,p,f),y=xn(s.font),m=g+c,v=[],_=(m+2)*u[0],x=(y*d+c)*u[1],b={width:_<0?Math.floor(_):Math.ceil(_),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:v};(1==u[0]&&1==u[1]||v.push("scale",u),v.push("font",s.font),r)&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),(en?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)));i&&v.push("fillStyle",a.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var w,S=.5-h,C=h*m+S*c;if(r)for(w=0;w<d;++w)v.push("strokeText",[p[w],C+S*f[w],.5*(c+y)+w*y]);if(i)for(w=0;w<d;++w)v.push("fillText",[p[w],C+S*f[w],.5*(c+y)+w*y]);return this.labels_[n]=b,b},t.prototype.replayTextBackground_=function(t,e,i,r,n,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,r,n,o,a,s,l,u,h,c,p,d,f,g){var y,m=i-(a*=c[0]),v=r-(s*=c[1]),_=n+l>t?t-l:n,x=o+u>e?e-u:o,b=d[3]+_*c[0]+d[1],w=d[0]+x*c[1]+d[2],S=m-d[3],C=v-d[0];return(f||0!==h)&&(ya[0]=S,_a[0]=S,ya[1]=C,ma[1]=C,ma[0]=S+b,va[0]=ma[0],va[1]=C+w,_a[1]=va[1]),0!==h?(Ot(y=Ft([1,0,0,1,0,0],i,r,1,1,h,-i,-r),ya),Ot(y,ma),Ot(y,va),Ot(y,_a),Qt(Math.min(ya[0],ma[0],va[0],_a[0]),Math.min(ya[1],ma[1],va[1],_a[1]),Math.max(ya[0],ma[0],va[0],_a[0]),Math.max(ya[1],ma[1],va[1],_a[1]),ga)):Qt(Math.min(S,S+b),Math.min(C,C+w),Math.max(S,S+b),Math.max(C,C+w),ga),p&&(m=Math.round(m),v=Math.round(v)),{drawImageX:m,drawImageY:v,drawImageW:_,drawImageH:x,originX:l,originY:u,declutterBox:{minX:ga[0],minY:ga[1],maxX:ga[2],maxY:ga[3],value:g},canvasTransform:y,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,r,n,o,a){var s=!(!o&&!a),l=r.declutterBox,u=t.canvas,h=a?a[2]*r.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(s&&this.replayTextBackground_(t,ya,ma,va,_a,o,a),Tn(t,r.canvasTransform,n,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Ot(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,r){var n=this.textStates[e],o=this.createLabel(t,e,r,i),a=this.strokeStates[i],s=this.pixelRatio,l=wa(t,n.textAlign||"center"),u=Qo[n.textBaseline||"middle"],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:l*(o.width/s-2*n.scale[0])+2*(.5-l)*h,anchorY:u*o.height/s+2*(.5-u)*h}},t.prototype.execute_=function(t,e,i,r,n,o,a,s){var l,u,h;this.pixelCoordinates_&&g(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=ki(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),u=this.renderedTransform_,h=i,u[0]=h[0],u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5]);for(var c,p,d,f,y,m,v,_,x,b,w,S,C,T,E,k,R=0,O=r.length,P=0,F=0,I=0,M=null,A=null,j=this.coordinateCache_,L=this.viewRotation_,D=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,z={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:L},G=this.instructions!=r||this.overlaps?0:200;R<O;){var N=r[R];switch(N[0]){case To:C=N[1],k=N[3],C.getGeometry()?void 0===a||be(a,k.getExtent())?++R:R=N[2]+1:R=N[2];break;case Eo:F>G&&(this.fill_(t),F=0),I>G&&(t.stroke(),I=0),F||I||(t.beginPath(),f=NaN,y=NaN),++R;break;case ko:var B=l[P=N[1]],U=l[P+1],V=l[P+2]-B,W=l[P+3]-U,q=Math.sqrt(V*V+W*W);t.moveTo(B+q,U),t.arc(B,U,q,0,2*Math.PI,!0),++R;break;case Ro:t.closePath(),++R;break;case Oo:P=N[1],c=N[2];var X=N[3],K=N[4],Y=6==N.length?N[5]:void 0;z.geometry=X,z.feature=C,R in j||(j[R]=[]);var Z=j[R];Y?Y(l,P,c,2,Z):(Z[0]=l[P],Z[1]=l[P+1],Z.length=2),K(Z,z),++R;break;case Fo:P=N[1],c=N[2],_=N[3],p=N[4],d=N[5];var H=N[6],$=N[7],J=N[8],Q=N[9],tt=N[10],et=N[11],it=N[12],rt=N[13],nt=N[14];if(!_&&N.length>=19){x=N[18],b=N[19],w=N[20],S=N[21];var ot=this.drawLabelWithPointPlacement_(x,b,w,S);_=ot.label,N[3]=_;var at=N[22];p=(ot.anchorX-at)*this.pixelRatio,N[4]=p;var st=N[23];d=(ot.anchorY-st)*this.pixelRatio,N[5]=d,H=_.height,N[6]=H,rt=_.width,N[13]=rt}var lt=void 0;N.length>24&&(lt=N[24]);var ut=void 0,ht=void 0,ct=void 0;N.length>16?(ut=N[15],ht=N[16],ct=N[17]):(ut=pn,ht=!1,ct=!1),tt&&D?et+=L:tt||D||(et-=L);for(var pt=0;P<c;P+=2)if(!(lt&<[pt++]<rt/this.pixelRatio)){var dt=[t,e,_,Gt=this.calculateImageOrLabelDimensions_(_.width,_.height,l[P],l[P+1],rt,H,p,d,J,Q,et,it,n,ut,ht||ct,C),$,ht?M:null,ct?A:null],ft=void 0,gt=void 0;if(s&&nt){if(!nt[P]){nt[P]=dt;continue}if(ft=nt[P],delete nt[P],gt=xa(ft),s.collides(gt))continue}s&&s.collides(Gt.declutterBox)||(ft&&(s&&s.insert(gt),this.replayImageOrLabel_.apply(this,ft)),s&&s.insert(Gt.declutterBox),this.replayImageOrLabel_.apply(this,dt))}++R;break;case Po:var yt=N[1],mt=N[2],vt=N[3],_t=N[4];S=N[5];var xt=N[6],bt=N[7],wt=N[8];w=N[9];var St=N[10];x=N[11],b=N[12];var Ct=[N[13],N[13]],Tt=this.textStates[b],Et=Tt.font,kt=[Tt.scale[0]*bt,Tt.scale[1]*bt],Rt=void 0;Et in this.widths_?Rt=this.widths_[Et]:(Rt={},this.widths_[Et]=Rt);var Ot=Rr(l,yt,mt,2),Pt=Math.abs(kt[0])*Sn(Et,x,Rt);if(_t||Pt<=Ot){var Ft=this.textStates[b].textAlign,It=fa(l,yt,mt,2,x,(Ot-Pt)*Qo[Ft],xt,Math.abs(kt[0]),Sn,Et,Rt,D?0:this.viewRotation_);t:if(It){var Mt=[],At=void 0,jt=void 0,Lt=void 0,Dt=void 0,zt=void 0;if(w)for(At=0,jt=It.length;At<jt;++At){Lt=(zt=It[At])[4],Dt=this.createLabel(Lt,b,"",w),p=zt[2]+(kt[0]<0?-St:St),d=vt*Dt.height+2*(.5-vt)*St*kt[1]/kt[0]-wt;var Gt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,zt[0],zt[1],Dt.width,Dt.height,p,d,0,0,zt[3],Ct,!1,pn,!1,C);if(s&&s.collides(Gt.declutterBox))break t;Mt.push([t,e,Dt,Gt,1,null,null])}if(S)for(At=0,jt=It.length;At<jt;++At){Lt=(zt=It[At])[4],Dt=this.createLabel(Lt,b,S,""),p=zt[2],d=vt*Dt.height-wt;Gt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,zt[0],zt[1],Dt.width,Dt.height,p,d,0,0,zt[3],Ct,!1,pn,!1,C);if(s&&s.collides(Gt.declutterBox))break t;Mt.push([t,e,Dt,Gt,1,null,null])}s&&s.load(Mt.map(xa));for(var Nt=0,Bt=Mt.length;Nt<Bt;++Nt)this.replayImageOrLabel_.apply(this,Mt[Nt])}}++R;break;case Io:if(void 0!==o){var Ut=o(C=N[1],k);if(Ut)return Ut}++R;break;case Mo:G?F++:this.fill_(t),++R;break;case Ao:for(P=N[1],c=N[2],T=l[P],v=(E=l[P+1])+.5|0,(m=T+.5|0)===f&&v===y||(t.moveTo(T,E),f=m,y=v),P+=2;P<c;P+=2)m=(T=l[P])+.5|0,v=(E=l[P+1])+.5|0,P!=c-2&&m===f&&v===y||(t.lineTo(T,E),f=m,y=v);++R;break;case jo:M=N,this.alignFill_=N[2],F&&(this.fill_(t),F=0,I&&(t.stroke(),I=0)),t.fillStyle=N[1],++R;break;case Lo:A=N,I&&(t.stroke(),I=0),this.setStrokeStyle_(t,N),++R;break;case Do:G?I++:t.stroke(),++R;break;default:++R}}F&&this.fill_(t),I&&t.stroke()},t.prototype.execute=function(t,e,i,r,n,o){this.viewRotation_=r,this.execute_(t,e,i,this.instructions,n,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,i,r,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,n)},t}(),Ca=[pa,la,ca,ha,da,ua],Ta=function(){function t(t,e,i,r,n,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var r=t[e],n=[this.renderBuffer_||0,this.renderBuffer_||0];for(var o in r){var a=r[o];i[o]=new Sa(this.resolution_,this.pixelRatio_,this.overlaps_,a,n)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],r=0,n=t.length;r<n;++r)if(t[r]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o){var a=2*(r=Math.round(r))+1,s=Ft(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=on(a,a));var u,c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):l||c.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(ae(u=[1/0,1/0,-1/0,-1/0],t),qt(u,e*(this.renderBuffer_+r),u));var p,d=function(t){if(void 0!==Ea[t])return Ea[t];for(var e=2*t+1,i=t*t,r=new Array(i+1),n=0;n<=t;++n)for(var o=0;o<=t;++o){var a=n*n+o*o;if(a>i)break;var s=r[a];s||(s=[],r[a]=s),s.push(4*((t+n)*e+(t+o))+3),n>0&&s.push(4*((t-n)*e+(t+o))+3),o>0&&(s.push(4*((t+n)*e+(t-o))+3),n>0&&s.push(4*((t-n)*e+(t-o))+3))}for(var l=[],u=(n=0,r.length);n<u;++n)r[n]&&l.push.apply(l,r[n]);return Ea[t]=l,l}(r);function f(t,e){for(var i=c.getImageData(0,0,a,a).data,s=0,l=d.length;s<l;s++)if(i[d[s]]>0){if(!o||p!==ha&&p!==da||-1!==o.indexOf(t)){var u=(d[s]-3)/4,h=r-u%a,f=r-(u/a|0),g=n(t,e,h*h+f*f);if(g)return g}c.clearRect(0,0,a,a);break}}var g,y,m,v,_,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(h),g=x.length-1;g>=0;--g){var b=x[g].toString();for(m=this.executorsByZIndex_[b],y=Ca.length-1;y>=0;--y)if(void 0!==(v=m[p=Ca[y]])&&(_=v.executeHitDetection(c,s,i,f,u)))return _}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],r=e[1],n=e[2],o=e[3],a=[i,r,i,o,n,o,n,r];return ki(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return w(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,r,n,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(h),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,c,p,d,f,g=o||Ca;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var y=s[l].toString();for(d=this.executorsByZIndex_[y],c=0,p=g.length;c<p;++c){void 0!==(f=d[g[c]])&&f.execute(t,e,i,r,n,a)}}this.maxExtent_&&t.restore()},t}(),Ea={};var ka=0,Ra=1,Oa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pa=function(t){function e(e,i,r,n,o,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=r,l.transform_=n,l.viewRotation_=o,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return Oa(e,t),e.prototype.drawImages_=function(t,e,i,r){if(this.image_){var n=ki(t,e,i,2,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=n.length;u<h;u+=2){var c=n[u]-this.imageAnchorX_,p=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;Ft(a,d,f,1,1,l,-d,-f),o.setTransform.apply(o,a),o.translate(d,f),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=ki(t,e,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=r){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Ft(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);o.setTransform.apply(o,u),o.translate(s,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,s,l),this.textFillState_&&o.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,r,n){var o=this.context_,a=ki(t,e,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)o.lineTo(a[l],a[l+1]);return n&&o.closePath(),i},e.prototype.drawRings_=function(t,e,i,r){for(var n=0,o=i.length;n<o;++n)e=this.moveToLineTo_(t,e,i[n],r,!0);return e},e.prototype.drawCircle=function(t){if(be(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var r=t.getFlatCoordinates();if(r){var n=t.getStride();return ki(r,0,r.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],r=e[3]-e[1],n=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case ht:this.drawPoint(t);break;case ct:this.drawLineString(t);break;case dt:this.drawPolygon(t);break;case ft:this.drawMultiPoint(t);break;case gt:this.drawMultiLineString(t);break;case yt:this.drawMultiPolygon(t);break;case mt:this.drawGeometryCollection(t);break;case vt:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&be(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,r=e.length;i<r;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),be(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(be(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,r=t.getFlatCoordinates(),n=0,o=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=o.length;s<l;++s)n=this.moveToLineTo_(r,n,o[s],a,!1);i.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),be(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),be(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),r=0,n=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];r=this.drawRings_(i,r,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(g(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,r=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=r&&(i.textAlign=r,e.textAlign=r),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var i=t.getColor();this.fillState_={fillStyle:Zr(i||"#000")}}else this.fillState_=null;if(e){var r=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),s=e.getLineJoin(),l=e.getWidth(),u=e.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:"round",lineDash:o||cn,lineDashOffset:a||0,lineJoin:void 0!==s?s:"round",lineWidth:this.pixelRatio_*(void 0!==l?l:1),miterLimit:void 0!==u?u:10,strokeStyle:Zr(r||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getSize();if(e){var i=t.getAnchor(),r=t.getImage(1),n=t.getOrigin(),o=t.getScaleArray();this.imageAnchorX_=i[0],this.imageAnchorY_=i[1],this.imageHeight_=e[1],this.image_=r,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=[this.pixelRatio_*o[0],this.pixelRatio_*o[1]],this.imageWidth_=e[0]}else this.image_=null}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:Zr(i||"#000")}}else this.textFillState_=null;var r=t.getStroke();if(r){var n=r.getColor(),o=r.getLineCap(),a=r.getLineDash(),s=r.getLineDashOffset(),l=r.getLineJoin(),u=r.getWidth(),h=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:a||cn,lineDashOffset:s||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Zr(n||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),m=t.getText(),v=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==m?m:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(Uo),Fa="fraction",Ia="pixels",Ma="bottom-left",Aa="bottom-right",ja="top-left",La="top-right";function Da(t,e,i){return e+":"+t+":"+(i?Vr(i):"null")}var za=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var r=Da(t,e,i);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,i,r){var n=Da(t,e,i);this.cache_[n]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),Ga=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Na=function(t){function i(e,i,r,n){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=i,o.state=n,o}return Ga(i,t),i.prototype.changed=function(){this.dispatchEvent(T)},i.prototype.getExtent=function(){return this.extent},i.prototype.getImage=function(){return e()},i.prototype.getPixelRatio=function(){return this.pixelRatio_},i.prototype.getResolution=function(){return this.resolution},i.prototype.getState=function(){return this.state},i.prototype.load=function(){e()},i}(C),Ba=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ua=function(t){function e(e,i,r,n,o,a){var s=t.call(this,e,i,r,Ir)||this;return s.src_=n,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=Ir,s.imageLoadFunction_=a,s}return Ba(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=jr,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=ye(this.extent)/this.image_.height),this.state=Ar,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ir&&this.state!=jr||(this.state=Mr,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Va(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Na);function Va(t,e,i){var r=t;if(r.src&&rn){var n=r.decode(),o=!0;return n.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var a=[B(r,L,e),B(r,E,i)];return function(){a.forEach(U)}}var Wa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qa=null,Xa=function(t){function e(e,i,r,n,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=r,s.src_=i,s.tainted_,s}return Wa(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Ar){qa||(qa=on(1,1)),qa.drawImage(this.image_,0,0);try{qa.getImageData(0,0,1,1),this.tainted_=!1}catch(t){qa=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(T)},e.prototype.handleImageError_=function(){this.imageState_=jr,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Ar,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=on(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Ir){this.imageState_=Mr;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Va(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=Vr(this.color_),i.fillRect(0,0,e.width,e.height),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var r=i.getImageData(0,0,e.width,e.height),n=r.data,o=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,h=n.length;u<h;u+=4)n[u]*=o,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(r,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(C);var Ka=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ya=function(t){function e(e){var i=this,n=e||{},o=void 0!==n.opacity?n.opacity:1,a=void 0!==n.rotation?n.rotation:0,s=void 0!==n.scale?n.scale:1,l=void 0!==n.rotateWithView&&n.rotateWithView;(i=t.call(this,{opacity:o,rotation:a,scale:s,displacement:void 0!==n.displacement?n.displacement:[0,0],rotateWithView:l})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:ja,i.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:Fa,i.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:Fa,i.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null;var u=void 0!==n.img?n.img:null,h=void 0!==n.imgSize?n.imgSize:null,c=n.src;rt(!(void 0!==c&&u),4),rt(!u||u&&h,5),void 0!==c&&0!==c.length||!u||(c=u.src||r(u)),rt(void 0!==c&&c.length>0,6);var p=void 0!==n.src?Ir:Ar;return i.color_=void 0!==n.color?Xr(n.color):null,i.iconImage_=function(t,e,i,r,n,o){var a=za.get(e,r,o);return a||(a=new Xa(t,e,i,r,n,o),za.set(e,r,o,a)),a}(u,c,h,i.crossOrigin_,p,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:ja,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ka(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Fa||this.anchorYUnits_==Fa){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Fa&&(t[0]*=e[0]),this.anchorYUnits_==Fa&&(t[1]*=e[1])}if(this.anchorOrigin_!=ja){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=La&&this.anchorOrigin_!=Aa||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ma&&this.anchorOrigin_!=Aa||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=ja){var i=this.getSize(),r=this.iconImage_.getSize();if(!i||!r)return null;t=t.slice(),this.offsetOrigin_!=La&&this.offsetOrigin_!=Aa||(t[0]=r[0]-i[0]-t[0]),this.offsetOrigin_!=Ma&&this.offsetOrigin_!=Aa||(t[1]=r[1]-i[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(T,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(T,t)},e}(Nr);function Za(t,e,i,r,n,o,a){var s=on(t[0]/2,t[1]/2);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new Pa(s,.5,n,null,a),c=i.length,p=Math.floor(16777215/c),d={},f=1;f<=c;++f){var g=i[f-1],y=g.getStyleFunction()||r;if(r){var m=y(g,o);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(f*p).toString(16)).slice(-6),_=0,x=m.length;_<x;++_){var b=m[_],w=b.clone(),S=w.getFill();S&&S.setColor(v);var C=w.getStroke();C&&C.setColor(v),w.setText(void 0);var T=b.getImage();if(T){var E=T.getImageSize();if(!E)continue;var k=document.createElement("canvas");k.width=E[0],k.height=E[1];var R=k.getContext("2d",{alpha:!1});R.fillStyle=v;var O=R.canvas;R.fillRect(0,0,O.width,O.height),on(E?E[0]:O.width,E?E[1]:O.height).drawImage(O,0,0),w.setImage(new Ya({img:O,imgSize:E,anchor:T.getAnchor(),anchorXUnits:Ia,anchorYUnits:Ia,offset:T.getOrigin(),size:T.getSize(),opacity:T.getOpacity(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var P=Number(w.getZIndex());(A=d[P])||(A={},d[P]=A,A[dt]=[],A[vt]=[],A[ct]=[],A[ht]=[]);var F=w.getGeometryFunction()(g);F&&be(n,F.getExtent())&&A[F.getType().replace("Multi","")].push(F,w)}}}}for(var I=Object.keys(d).map(Number).sort(h),M=(f=0,I.length);f<M;++f){var A=d[I[f]];for(var j in A){var L=A[j];for(_=0,x=L.length;_<x;_+=2){u.setStyle(L[_+1]);for(var D=0,z=e.length;D<z;++D)u.setTransform(e[D]),u.drawGeometry(L[_])}}}return s.getImageData(0,0,l.width,l.height)}function Ha(t,e,i){var r=[];if(i){var n=4*(Math.round(t[0]/2)+Math.round(t[1]/2)*i.width),o=i.data[n],a=i.data[n+1],s=i.data[n+2]+256*(a+256*o),l=Math.floor(16777215/e.length);s&&s%l==0&&r.push(e[s/l-1])}return r}var $a={Point:function(t,e,i,r,n){var o,a=i.getImage(),s=i.getText();n&&(t=n,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Ar)return;var l=t.getBuilder(i.getZIndex(),ha);l.setImageStyle(a,o),l.drawPoint(e,r)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),da);u.setTextStyle(s,o),u.drawText(e,r)}},LineString:function(t,e,i,r,n){var o=i.getStroke();if(o){var a=t.getBuilder(i.getZIndex(),ca);a.setFillStrokeStyle(null,o),a.drawLineString(e,r)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),da);l.setTextStyle(s),l.drawText(e,r)}},Polygon:function(t,e,i,r,n){var o=i.getFill(),a=i.getStroke();if(o||a){var s=t.getBuilder(i.getZIndex(),pa);s.setFillStrokeStyle(o,a),s.drawPolygon(e,r)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),da);u.setTextStyle(l),u.drawText(e,r)}},MultiPoint:function(t,e,i,r,n){var o,a=i.getImage(),s=i.getText();n&&(t=n,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Ar)return;var l=t.getBuilder(i.getZIndex(),ha);l.setImageStyle(a,o),l.drawMultiPoint(e,r)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),da);u.setTextStyle(s,o),u.drawText(e,r)}},MultiLineString:function(t,e,i,r,n){var o=i.getStroke();if(o){var a=t.getBuilder(i.getZIndex(),ca);a.setFillStrokeStyle(null,o),a.drawMultiLineString(e,r)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),da);l.setTextStyle(s),l.drawText(e,r)}},MultiPolygon:function(t,e,i,r,n){var o=i.getFill(),a=i.getStroke();if(a||o){var s=t.getBuilder(i.getZIndex(),pa);s.setFillStrokeStyle(o,a),s.drawMultiPolygon(e,r)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),da);u.setTextStyle(l),u.drawText(e,r)}},GeometryCollection:function(t,e,i,r,n){var o,a,s=e.getGeometriesArray();for(o=0,a=s.length;o<a;++o){(0,$a[s[o].getType()])(t,s[o],i,r,n)}},Circle:function(t,e,i,r,n){var o=i.getFill(),a=i.getStroke();if(o||a){var s=t.getBuilder(i.getZIndex(),la);s.setFillStrokeStyle(o,a),s.drawCircle(e,r)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),da);u.setTextStyle(l),u.drawText(e,r)}}};function Ja(t,e){return parseInt(r(t),10)-parseInt(r(e),10)}function Qa(t,e){var i=ts(t,e);return i*i}function ts(t,e){return.5*t/e}function es(t,e,i,r,n,o,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Ar||u==jr?l.unlistenImageChange(n):(u==Ir&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,r,n,o){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(r,n);if(i.getRenderer())!function t(e,i,r,n){if(i.getType()==mt){for(var o=i.getGeometries(),a=0,s=o.length;a<s;++a)t(e,o[a],r,n);return}e.getBuilder(r.getZIndex(),ua).drawCustom(i,n,r.getRenderer())}(t,s,i,e);else{(0,$a[s.getType()])(t,s,i,e,o)}}(t,e,i,r,o,a),s}var is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rs=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return is(e,t),e.prototype.useContainer=function(e,i,r){r<1&&(e=null),t.prototype.useContainer.call(this,e,i,r)},e.prototype.renderWorlds=function(t,e,i){var r=e.extent,n=e.viewState,o=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,d=!(p[ka]||p[Ra]),f=this.context,g=Math.round(e.size[0]*c),y=Math.round(e.size[1]*c),m=h.getWrapX()&&s.canWrapX(),v=m?xe(u):null,_=m?Math.ceil((r[2]-u[2])/v)+1:1,x=m?Math.floor((r[0]-u[0])/v):0;do{var b=this.getRenderTransform(o,a,l,c,g,y,x*v);t.execute(f,1,b,l,d,void 0,i)}while(++x<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];!function(t,e,i){Rt(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),It(this.inversePixelTransform,this.pixelTransform);var n=Mt(this.pixelTransform);this.useContainer(e,n,r.opacity);var o=this.context,a=o.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return!this.containerReused&&a.width>0&&(a.width=0),this.container;var u=Math.round(t.size[0]*i),h=Math.round(t.size[1]*i);a.width!=u||a.height!=h?(a.width=u,a.height=h,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState,p=(c.projection,!1);if(r.extent&&this.clipping){var d=Ei(r.extent);(p=!Zt(d,t.extent)&&be(d,t.extent))&&this.clipUnrotated(o,t,d)}this.renderWorlds(s,t),p&&o.restore(),this.postRender(o,t);var f=r.opacity,g=this.container;return f!==parseFloat(g.style.opacity)&&(g.style.opacity=1===f?"":String(f)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Ot(this.pixelTransform,i);var r=this.renderedCenter_,n=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,s=this.renderedExtent_,l=this.getLayer(),u=[],h=i[0]/2,c=i[1]/2;u.push(this.getRenderTransform(r,n,o,.5,h,c,0).slice());var p=l.getSource(),d=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!Zt(d,s)){for(var f=s[0],g=xe(d),y=0,m=void 0;f<d[0];)m=g*--y,u.push(this.getRenderTransform(r,n,o,.5,h,c,m).slice()),f+=g;for(y=0,f=s[2];f>d[2];)m=g*++y,u.push(this.getRenderTransform(r,n,o,.5,h,c,m).slice()),f-=g}this.hitDetectionImageData_=Za(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,o)}e(Ha(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){var a=this;if(this.replayGroup_){var s,l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},p=function(t,e,i){var a=r(t),s=c[a];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return c[a]=!0,o.splice(o.lastIndexOf(s),1),n(t,h,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return c[a]=!0,n(t,h,e);o.push(c[a]={feature:t,layer:h,geometry:e,distanceSq:i,callback:n})}},d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some((function(r){return s=r.forEachFeatureAtCoordinate(t,l,u,i,p,r===a.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var r=t.viewHints[ka],n=t.viewHints[Ra],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&r||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=Ja);var g=l.center.slice(),y=qt(s,d*h),m=[y.slice()],v=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Zt(v,t.extent)){var _=xe(v),x=Math.max(xe(y)/2,_);y[0]=v[0]-x,y[2]=v[2]+x,li(g,u);var b=function(t,e){var i=e.getExtent(),r=de(t);if(e.canWrapX()&&(r[0]<i[0]||r[0]>=i[2])){var n=xe(i),o=Math.floor((r[0]-i[0])/n)*n;t[0]-=o,t[2]-=o}return t}(m[0],u);b[0]<v[0]&&b[2]<v[2]?m.push([b[0]+_,b[1],b[2]+_,b[3]]):b[0]>v[0]&&b[2]>v[2]&&m.push([b[0]-_,b[1],b[2]-_,b[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Zt(this.renderedExtent_,y))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new ea(ts(h,c),y,h,c);this.getLayer().getDeclutter()&&(w=new ea(ts(h,c),y,h,c));for(var C=0,T=m.length;C<T;++C)i.loadFeatures(m[C],h,u);var E=Qa(h,c),k=function(t){var i,r=t.getStyleFunction()||e.getStyleFunction();if(r&&(i=r(t,h)),i){var n=this.renderFeature(t,E,i,S,void 0,w);this.dirty_=this.dirty_||n}}.bind(this),R=Ti(y),O=i.getFeaturesInExtent(R);f&&O.sort(f);for(C=0,T=O.length;C<T;++C)k(O[C]);this.renderedFeatures_=O;var P=S.finish(),F=new Ta(y,h,c,i.getOverlaps(),P,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new Ta(y,h,c,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=f,this.renderedExtent_=y,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=F,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,r,n,o){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=es(r,t,i[s],e,this.boundHandleStyleImageChange_,n,o)||a;else a=es(r,t,i,e,this.boundHandleStyleImageChange_,n,o);return a},e}(sa),ns=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),os=function(t){function e(e){return t.call(this,e)||this}return ns(e,t),e.prototype.createRenderer=function(){return new rs(this)},e}(Co),as=function(){function t(t){this.rbush_=new so(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[r(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,o=e.length;n<o;n++){var a=t[n],s=e[n],l={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};i[n]=l,this.items_[r(s)]=l}this.rbush_.load(i)},t.prototype.remove=function(t){var e=r(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[r(e)];ne([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,r=0,n=t.length;r<n;r++)if(i=e(t[r]))return i;return i},t.prototype.isEmpty=function(){return w(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return Qt(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),ss=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ls=function(t){function i(e){var i=t.call(this)||this;return i.projection_=pi(e.projection),i.attributions_=us(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Qn,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return ss(i,t),i.prototype.getAttributions=function(){return this.attributions_},i.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},i.prototype.getProjection=function(){return this.projection_},i.prototype.getResolutions=function(){return e()},i.prototype.getState=function(){return this.state_},i.prototype.getWrapX=function(){return this.wrapX_},i.prototype.getContextOptions=function(){},i.prototype.refresh=function(){this.changed()},i.prototype.setAttributions=function(t){this.attributions_=us(t),this.changed()},i.prototype.setState=function(t){this.state_=t,this.changed()},i}(Y);function us(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var hs="addfeature",cs="changefeature",ps="clear",ds="removefeature",fs="featuresloadstart",gs="featuresloadend",ys="featuresloaderror";function ms(t,e){return[[-1/0,-1/0,1/0,1/0]]}var vs="arraybuffer",_s="json",xs="text",bs="xml";function ws(t,e,i,r,n,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,r,n):t,!0),e.getType()==vs&&(s.responseType="arraybuffer"),s.withCredentials=!1,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var r=e.getType(),l=void 0;r==_s||r==xs?l=s.responseText:r==bs?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):r==vs&&(l=s.response),l?o(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Ss(t,e){return function(i,r,n,o,a){var s=this;ws(t,e,i,r,n,(function(t,e){void 0!==o&&o(t),s.addFeatures(t)}),a||v)}}var Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ts=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.feature=i,n.features=r,n}return Cs(e,t),e}(s),Es=function(t){function e(e){var i=this,r=e||{};(i=t.call(this,{attributions:r.attributions,projection:void 0,state:Qn,wrapX:void 0===r.wrapX||r.wrapX})||this).loader_=v,i.format_=r.format,i.overlaps_=void 0===r.overlaps||r.overlaps,i.url_=r.url,void 0!==r.loader?i.loader_=r.loader:void 0!==i.url_&&(rt(i.format_,7),i.loader_=Ss(i.url_,i.format_)),i.strategy_=void 0!==r.strategy?r.strategy:ms;var n,o,a=void 0===r.useSpatialIndex||r.useSpatialIndex;return i.featuresRtree_=a?new as:null,i.loadedExtentsRtree_=new as,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(n=r.features).getArray()),a||void 0!==n||(n=new it(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==n&&i.bindFeaturesCollection_(n),i}return Cs(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=r(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ts(hs,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[N(e,T,this.handleFeatureChange_,this),N(e,l,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?i=!1:this.idIndex_[r.toString()]=e),i&&(rt(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,a=t.length;o<a;o++){var s=r(u=t[o]);this.addToIndex_(s,u)&&i.push(u)}o=0;for(var l=i.length;o<l;o++){var u;s=r(u=i[o]);this.setupChangeEvents_(s,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),n.push(u)}else this.nullGeometryFeatures_[s]=u}this.featuresRtree_&&this.featuresRtree_.load(e,n);o=0;for(var p=i.length;o<p;o++)this.dispatchEvent(new Ts(hs,i[o]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(hs,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(ds,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener($,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(J,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(U)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var r=new Ts(ps);this.dispatchEvent(r),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var r=e(i);if(r)return r}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),w(this.nullGeometryFeatures_)||f(t,b(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray():[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],r=t[1],n=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||y;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,r,o,a))<u){n=t;var h=Math.sqrt(a);s[0]=i-h,s[1]=r-h,s[2]=i+h,s[3]=r+h}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=r(e),n=e.getGeometry();if(n){var o=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var a=e.getId();if(void 0!==a){var s=a.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Ts(cs,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:r(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&w(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){var r=this.loadedExtentsRtree_,n=this.strategy_(t,e);this.loading=!1;for(var o=function(t,o){var s=n[t];r.forEachInExtent(s,(function(t){return Zt(t.extent,s)}))||(a.dispatchEvent(new Ts(fs)),a.loader_.call(a,s,e,i,function(t){this.dispatchEvent(new Ts(gs,void 0,t))}.bind(a),function(){this.dispatchEvent(new Ts(ys))}.bind(a)),r.insert(s,{extent:s.slice()}),a.loading=a.loader_!==v)},a=this,s=0,l=n.length;s<l;++s)o(s)},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(ne(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=r(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=r(t);this.featureChangeKeys_[e].forEach(U),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ts(ds,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){rt(this.format_,7),this.setLoader(Ss(t,this.format_))},e}(ls),ks=0,Rs=1,Os=2,Ps=3,Fs=4;function Is(t){return Math.pow(t,3)}function Ms(t){return 1-Is(1-t)}function As(t){return 3*t*t-2*t*t*t}function js(t){return t}var Ls=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ds=function(t){function i(e,i,r){var n=t.call(this)||this,o=r||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.hifi=!0,n.key="",n.transition_=void 0===o.transition?250:o.transition,n.transitionStarts_={},n}return Ls(i,t),i.prototype.changed=function(){this.dispatchEvent(T)},i.prototype.release=function(){},i.prototype.getKey=function(){return this.key+"/"+this.tileCoord},i.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Os)return this.transition_=0,t;t=t.interimTile}while(t);return this},i.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Os){t.interimTile=null;break}t.getState()==Rs?e=t:t.getState()==ks?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},i.prototype.getTileCoord=function(){return this.tileCoord},i.prototype.getState=function(){return this.state},i.prototype.setState=function(t){if(this.state!==Ps&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},i.prototype.load=function(){e()},i.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var r=e-i+1e3/60;return r>=this.transition_?1:Is(r/this.transition_)},i.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},i.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},i}(C),zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gs=function(t){function e(e,i,r,n,o,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=r,s.key=r,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=o,s}return zs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){var t;this.state=Ps,this.unlistenImage_(),this.image_=((t=on(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Os:this.state=Fs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Ps&&(this.state=ks,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==ks&&(this.state=Rs,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Va(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ds);var Ns=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var r=this.points_[e+2]-this.points_[i+2];if(r<1e3/60)return!1;var n=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,n),this.initialVelocity_=Math.sqrt(n*n+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Us=function(t){function i(e){var i=t.call(this)||this;return i.map_=e,i}return Bs(i,t),i.prototype.dispatchRenderEvent=function(t,i){e()},i.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;Ft(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),It(r,i)},i.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,a,s){var l,u=e.viewState;function h(t,e,i,r){return n.call(o,e,t?i:null,r)}var c=u.projection,p=li(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&r){var f=xe(c.getExtent());d.push([-f,0],[f,0])}for(var g=e.layerStatesArray,y=g.length,m=[],v=[],_=0;_<d.length;_++)for(var x=y-1;x>=0;--x){var b=g[x],w=b.layer;if(w.hasRenderer()&&ro(b,u)&&a.call(s,w)){var S=w.getRenderer(),C=w.getSource();if(S&&C){var T=C.getWrapX()?p:t,E=h.bind(null,b.managed);v[0]=T[0]+d[_][0],v[1]=T[1]+d[_][1],l=S.forEachFeatureAtCoordinate(v,e,i,E,m)}if(l)return l}}if(0!==m.length){var k=1/m.length;return m.forEach((function(t,e){return t.distanceSq+=e*k})),m.sort((function(t,e){return t.distanceSq-e.distanceSq})),m.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},i.prototype.forEachLayerAtPixel=function(t,i,r,n,o){return e()},i.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,r,y,this,n,o)},i.prototype.getMap=function(){return this.map_},i.prototype.renderFrame=function(t){e()},i.prototype.scheduleExpireIconCache=function(t){za.canExpireCache()&&t.postRenderFunctions.push(Vs)},i}(u);function Vs(t,e){za.expire()}var Ws=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qs=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=N(dn,l,e.redrawText.bind(e)),i.element_=document.createElement("div");var r=i.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return Ws(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var r=new oa(t,void 0,e);i.dispatchEvent(r)}},e.prototype.disposeInternal=function(){U(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(wr,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var r=[],n=null,o=0,a=e.length;o<a;++o){var s=e[o];if(t.layerIndex=o,ro(s,i)&&(s.sourceState==Qn||s.sourceState==$n)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&r.push(l))}}for(o=r.length-1;o>=0;--o)r[o].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,r=0;;++r){var n=i[r],o=e[r];if(!n&&!o)break;n!==o&&(n?o?t.insertBefore(o,n):(t.removeChild(n),--r):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Sr,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,r,n){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&ro(l,o)&&n(u)){var h=u.getRenderer().getDataAtPixel(t,e,i);if(h){var c=r(u,h);if(c)return c}}}},e}(Us),Xs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ks="layers",Ys=function(t){function e(e){var i=this,r=e||{},n=_({},r);delete n.layers;var o=r.layers;return(i=t.call(this,n)||this).layersListenerKeys_=[],i.listenerKeys_={},i.addEventListener(H(Ks),i.handleLayersChanged_),o?Array.isArray(o)?o=new it(o.slice(),{unique:!0}):rt("function"==typeof o.getArray,43):o=new it(void 0,{unique:!0}),i.setLayers(o),i}return Xs(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(U),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(N(t,$,this.handleLayersAdd_,this),N(t,J,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(U);x(this.listenerKeys_);for(var i=t.getArray(),n=0,o=i.length;n<o;n++){var a=i[n];this.listenerKeys_[r(a)]=[N(a,l,this.handleLayerChange_,this),N(a,T,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[r(e)]=[N(e,l,this.handleLayerChange_,this),N(e,T,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=r(t.element);this.listenerKeys_[e].forEach(U),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(Ks)},e.prototype.setLayers=function(t){this.set(Ks,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));for(var r=this.getLayerState(),n=i,o=e.length;n<o;n++){var a=e[n];a.opacity*=r.opacity,a.visible=a.visible&&r.visible,a.maxResolution=Math.min(a.maxResolution,r.maxResolution),a.minResolution=Math.max(a.minResolution,r.minResolution),a.minZoom=Math.max(a.minZoom,r.minZoom),a.maxZoom=Math.min(a.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==a.extent?a.extent=me(a.extent,r.extent):a.extent=r.extent)}return e},e.prototype.getSourceState=function(){return Qn},e}(Hn),Zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hs=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==r?r:null,n}return Zs(e,t),e}(s),$s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Js=function(t){function e(e,i,r,n,o){var a=t.call(this,e,i,o)||this;return a.originalEvent=r,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return $s(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Hs),Qs={SINGLECLICK:"singleclick",CLICK:O,DBLCLICK:P,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},tl="pointermove",el="pointerdown",il=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rl=function(t){function e(e,i){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=i?i*tn:tn,r.down_=null;var n=r.map_.getViewport();return r.activePointers_=0,r.trackedTouches_={},r.element_=n,r.pointerdownListenerKey_=N(n,el,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=N(n,tl,r.relayEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(z,r.boundHandleTouchMove_,!!nn&&{passive:!1}),r}return il(e,t),e.prototype.emulateClick_=function(t){var e=new Js(Qs.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Js(Qs.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Js(Qs.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Qs.POINTERUP||e.type==Qs.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Qs.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Js(Qs.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.propagationStopped&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(U),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new Js(Qs.POINTERDOWN,this.map_,t);if(this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(N(i,Qs.POINTERMOVE,this.handlePointerMove_,this),N(i,Qs.POINTERUP,this.handlePointerUp_,this),N(this.element_,Qs.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),Qs.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Js(Qs.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Js(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){this.originalPointerMoveEvent_&&!this.originalPointerMoveEvent_.defaultPrevented||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(U(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(z,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(U(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(U),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(C),nl="postrender",ol="movestart",al="moveend",sl="layergroup",ll="size",ul="target",hl="view",cl=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,x(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(i);return delete this.queuedElements_[r],i},t.prototype.enqueue=function(t){rt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,r=e.length,n=e[t],o=i[t],a=t;t<r>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<r&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,r=this.priorities_,n=i[e],o=r[e];e>t;){var a=this.getParentIndex_(e);if(!(r[a]>o))break;i[e]=i[a],r[e]=r[a],e=a}i[e]=n,r[e]=o},t.prototype.reprioritize=function(){var t,e,i,r=this.priorityFunction_,n=this.elements_,o=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=r(t=n[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=i,n[a++]=t);n.length=a,o.length=a,this.heapify_()},t}(),pl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dl=function(t){function e(e,i){var r=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=i,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return pl(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(T,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(e.hifi&&i===Os||i===Ps||i===Fs){e.removeEventListener(T,this.boundHandleTileChange_);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,r,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==ks||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,i.load())},e}(cl);var fl="center",gl="resolution",yl="rotation";function ml(t,e,i){return function(r,n,o,a,s){if(r){var l=e?0:o[0]*n,u=e?0:o[1]*n,h=s?s[0]:0,c=s?s[1]:0,p=t[0]+l/2+h,d=t[2]-l/2+h,f=t[1]+u/2+c,g=t[3]-u/2+c;p>d&&(d=p=(d+p)/2),f>g&&(g=f=(g+f)/2);var y=Te(r[0],p,d),m=Te(r[1],f,g),v=30*n;return a&&i&&(y+=-v*Math.log(1+Math.max(0,p-r[0])/v)+v*Math.log(1+Math.max(0,r[0]-d)/v),m+=-v*Math.log(1+Math.max(0,f-r[1])/v)+v*Math.log(1+Math.max(0,r[1]-g)/v)),[y,m]}}}function vl(t){return t}function _l(t,e,i,r){var n=xe(e)/i[0],o=ye(e)/i[1];return r?Math.min(t,Math.max(n,o)):Math.min(t,Math.min(n,o))}function xl(t,e,i){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(r=Math.max(r,i),r/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Te(r,i/2,2*e)}function bl(t,e,i,r,n){return function(o,a,s,l){if(void 0!==o){var u=r?_l(t,r,s,n):t;return(void 0===i||i)&&l?xl(o,u,e):Te(o,e,u)}}}function wl(t){return void 0!==t?0:void 0}function Sl(t){return void 0!==t?t:void 0}var Cl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tl=function(t){function e(e){var i=t.call(this)||this,r=_({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=gi(r.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.cancelAnchor_=void 0,r.center&&(r.center=Ci(r.center,i.projection_)),r.extent&&(r.extent=Ei(r.extent,i.projection_)),i.applyOptions_(r),i}return Cl(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,r,n=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,a=void 0!==t.zoomFactor?t.zoomFactor:2,s=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,u=void 0!==t.showFullExtent&&t.showFullExtent,h=gi(t.projection,"EPSG:3857"),c=h.getExtent(),d=t.constrainOnlyCenter,f=t.extent;s||f||!h.isGlobal()||(d=!1,f=c);if(void 0!==t.resolutions){var g=t.resolutions;i=g[n],r=void 0!==g[o]?g[o]:g[g.length-1],e=t.constrainResolution?function(t,e,i,r){return function(n,o,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],h=i?_l(l,i,a,r):l;if(s)return void 0===e||e?xl(n,h,u):Te(n,u,h);var c=Math.min(h,n),d=Math.floor(p(t,c,o));return t[d]>h&&d<t.length-1?t[d+1]:t[d]}}}(g,l,!d&&f,u):bl(i,r,l,!d&&f,u)}else{var y=(c?Math.max(xe(c),ye(c)):360*Ct[_t]/h.getMetersPerUnit())/256/Math.pow(2,0),m=y/Math.pow(2,28);void 0!==(i=t.maxResolution)?n=0:i=y/Math.pow(a,n),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(a,o):y/Math.pow(a,o):m),o=n+Math.floor(Math.log(i/r)/Math.log(a)),r=i/Math.pow(a,o-n),e=t.constrainResolution?function(t,e,i,r,n,o){return function(a,s,l,u){if(void 0!==a){var h=n?_l(e,n,l,o):e,c=void 0!==i?i:0;if(u)return void 0===r||r?xl(a,h,c):Te(a,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),d=-s*(.5-1e-9)+.5,f=Math.min(h,a),g=Math.floor(Math.log(e/f)/Math.log(t)+d),y=Math.max(p,g);return Te(e/Math.pow(t,y),c,h)}}}(a,i,r,l,!d&&f,u):bl(i,r,l,!d&&f,u)}return{constraint:e,maxResolution:i,minResolution:r,minZoom:n,zoomFactor:a}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding=t.padding,this.minZoom_=e.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return ml(t.extent,t.constrainOnlyCenter,e)}var i=gi(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var r=i.getExtent().slice();return r[0]=-1/0,r[2]=1/0,ml(r,!1,!1)}return vl}(t),r=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=n||Fe(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Sl:"number"==typeof e?(i=e,r=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/r+.5)*r:void 0}):Sl}return wl;var i,r;var n,o}(t);this.constraints_={center:i,resolution:r,rotation:n},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=_({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),_({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var r=arguments[i];r.center&&((r=_({},r)).center=Ci(r.center,this.getProjection())),r.anchor&&((r=_({},r)).anchor=Ci(r.anchor,this.getProjection())),e[i]=r}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;if(i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var r=arguments[i-1];return r.center&&this.setCenterInternal(r.center),void 0!==r.zoom&&this.setZoom(r.zoom),void 0!==r.rotation&&this.setRotation(r.rotation),void(e&&El(e,!0))}for(var n=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,s=this.targetRotation_,l=[],u=0;u<i;++u){var h=arguments[u],c={start:n,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||As,callback:e};if(h.center&&(c.sourceCenter=o,c.targetCenter=h.center.slice(),o=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(h.zoom),a=c.targetResolution):h.resolution&&(c.sourceResolution=a,c.targetResolution=h.resolution,a=c.targetResolution),void 0!==h.rotation){c.sourceRotation=s;var p=Ie(h.rotation-s+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=s+p,s=c.targetRotation}kl(c)?c.complete=!0:n+=c.duration,l.push(c)}this.animations_.push(l),this.setHint(ka,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[ka]>0},e.prototype.getInteracting=function(){return this.hints_[Ra]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(ka,-this.hints_[ka]);for(var e=0,i=this.animations_.length;e<i;++e){var r=this.animations_[e];if(r[0].callback&&El(r[0].callback,!1),!t)for(var n=0,o=r.length;n<o;++n){var a=r[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var r=this.animations_[i],n=!0,o=0,a=r.length;o<a;++o){var s=r[o];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var h=s.easing(u);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],d=c+h*(s.targetCenter[0]-c),f=p+h*(s.targetCenter[1]-p);this.targetCenter_=[d,f]}if(s.sourceResolution&&s.targetResolution){var g=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(g,0,y,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var v=1===h?Ie(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var _=this.constraints_.rotation(v,!0);this.targetCenter_=this.calculateCenterRotate(_,s.anchor)}this.targetRotation_=v}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(ka,-1);var x=r[0].callback;x&&El(x,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,r,n,o=this.getCenterInternal();return void 0!==o&&(ni(i=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),n=e,(r=i)[0]+=+n[0],r[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,r=this.getCenterInternal(),n=this.getResolution();void 0!==r&&void 0!==n&&(i=[e[0]-t*(e[0]-r[0])/n,e[1]-t*(e[1]-r[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],r=e[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 e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Si(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(fl)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Ti(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();rt(i,1);var r=this.getResolution();rt(void 0!==r,2);var n=this.getRotation();return rt(void 0!==n,3),ge(i,r,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(gl)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Ei(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),r=xe(t)/i[0],n=ye(t)/i[1];return Math.max(r,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,n=Math.log(i/r)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(yl)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,n=Math.log(i/r)/e;return function(t){return Math.log(i/t)/e/n}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),n=this.padding;if(n){var o=this.getViewportSizeMinusPadding_();r=Rl(r,this.getViewportSize_(),[o[0]/2+n[3],o[1]/2+n[0]],e,i)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,r=this.minZoom_||0;if(this.resolutions_){var n=p(this.resolutions_,t,1);r=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return r+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Te(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Te(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(rt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))rt(!we(t),25),i=vr(r=Ei(t,this.getProjection()));else if(t.getType()===vt){var r;(i=vr(r=Ei(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),de(r))}else{i=t}this.fitInternal(i,e)},e.prototype.fitInternal=function(t,e){var i=e||{},r=i.size;r||(r=this.getViewportSizeMinusPadding_());var n,o=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var s=t.getFlatCoordinates(),l=this.getRotation(),u=Math.cos(-l),h=Math.sin(-l),c=1/0,p=1/0,d=-1/0,f=-1/0,g=t.getStride(),y=0,m=s.length;y<m;y+=g){var _=s[y]*u-s[y+1]*h,x=s[y]*h+s[y+1]*u;c=Math.min(c,_),p=Math.min(p,x),d=Math.max(d,_),f=Math.max(f,x)}var b=this.getResolutionForExtentInternal([c,p,d,f],[r[0]-o[1]-o[3],r[1]-o[0]-o[2]]);b=isNaN(b)?n:Math.max(b,n),b=this.getConstrainedResolution(b,a?0:1),h=-h;var w=(c+d)/2,S=(p+f)/2,C=(w+=(o[1]-o[3])/2*b)*u-(S+=(o[0]-o[2])/2*b)*h,T=S*u+w*h,E=this.getConstrainedCenter([C,T],b),k=i.callback?i.callback:v;void 0!==i.duration?this.animateInternal({resolution:b,center:E,duration:i.duration,easing:i.easing},k):(this.targetResolution_=b,this.targetCenter_=E,this.applyTargetState_(!1,!0),El(k,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(Ci(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Rl(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,r){var n,o=this.padding;if(o&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Rl(t,r,[a[0]/2+o[3],a[1]/2+o[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Si(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&Ci(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,r,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=Ci(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(r,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(Ci(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var i=this.getAnimating()||this.getInteracting()||e,r=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,o,n,i,this.calculateCenterShift(this.targetCenter_,o,r,n));this.get(yl)!==r&&this.set(yl,r),this.get(gl)!==o&&this.set(gl,o),this.get(fl)&&ri(this.get(fl),a)||this.set(fl,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var r=void 0!==t?t:200,n=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,o,a));if(0===r&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===r?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&ri(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:s,duration:r,easing:Ms,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Ra,1)},e.prototype.endInteraction=function(t,e,i){var r=i&&Ci(i,this.getProjection());this.endInteractionInternal(t,e,r)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Ra,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,r)},e}(Y);function El(t,e){setTimeout((function(){t(e)}),0)}function kl(t){return!(t.sourceCenter&&t.targetCenter&&!ri(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Rl(t,e,i,r,n){var o=Math.cos(-n),a=Math.sin(-n),s=t[0]*o-t[1]*a,l=t[1]*o+t[0]*a;return[(s+=(e[0]/2-i[0])*r)*o-(l+=(i[1]-e[1]/2)*r)*(a=-a),l*o+s*a]}var Ol=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pl=function(t){function e(e){var i=t.call(this)||this,r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,r,n,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Ys({layers:t.layers});o[sl]=a,o[ul]=t.target,o[hl]=void 0!==t.view?t.view:new Tl,void 0!==t.controls&&(Array.isArray(t.controls)?i=new it(t.controls.slice()):(rt("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new it(t.interactions.slice()):(rt("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new it(t.overlays.slice()):(rt("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new it;return{controls:i,interactions:r,keyboardEventTarget:e,overlays:n,values:o}}(e);return i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:tn,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=r.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=r.controls||new it,i.interactions=r.interactions||new it,i.overlays_=r.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new dl(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addEventListener(H(sl),i.handleLayerGroupChanged_),i.addEventListener(H(hl),i.handleViewChanged_),i.addEventListener(H(ll),i.handleSizeChanged_),i.addEventListener(H(ul),i.handleTargetChanged_),i.setProperties(r.values),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.controls.addEventListener($,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(J,function(t){t.element.setMap(null)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.addEventListener($,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(J,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i.overlays_.addEventListener($,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(J,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i}return Ol(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,o=void 0!==i.layerFilter?i.layerFilter:y,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,n,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var r=i||{},n=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||y;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:y,n=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,o,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(ul)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Si(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Ot(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(sl)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var r=t[e].layer.getSource();if(r&&r.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Ci(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?Ot(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ll)},e.prototype.getView=function(){return this.get(hl)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){return this.getTargetElement()?this.getTargetElement().ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,r){return function(t,e,i,r,n){if(!t||!(i in t.wantedTiles))return 1/0;if(!t.wantedTiles[i][e.getKey()])return 1/0;var o=t.viewState.center,a=r[0]-o[0],s=r[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,r)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,r=new Js(i,this,t);this.handleMapBrowserEvent(r)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===el||i===G||i===A){var r=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o="host"in n?n.elementFromPoint(e.clientX,e.clientY):e.target;if(this.overlayContainerStopEvent_.contains(o)||!(n===r?r.documentElement:n).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,r=i;if(t){var n=t.viewHints;if(n[ka]||n[Ra]){var o=!rn&&Date.now()-t.time>8;i=o?0:8,r=o?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,r))}!t||!this.hasListener(Cr)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Cr,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)U(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(R,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(G,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(D,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,sn(this.viewport_)}if(t){for(var r in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new rl(this,this.moveTolerance_),Qs)this.mapBrowserEventHandler_.addEventListener(Qs[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(R,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(G,this.boundHandleBrowserEvent_,!!nn&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[N(n,A,this.handleBrowserEvent,this),N(n,j,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(D,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(U(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(U(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=N(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=N(t,T,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(U),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[N(t,l,this.render,this),N(t,T,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var r=t[e].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),r=this.getView(),n=this.frameState_,o=null;if(void 0!==i&&function(t){return t[0]>0&&t[1]>0}(i)&&r&&r.isDef()){var a=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=r.getState();o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:ge(s.center,s.resolution,s.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),n)(!this.previousExtent_||!we(this.previousExtent_)&&!ne(o.extent,this.previousExtent_))&&(this.dispatchEvent(new Hs(ol,this,n)),this.previousExtent_=te(this.previousExtent_));this.previousExtent_&&!o.viewHints[ka]&&!o.viewHints[Ra]&&!ne(o.extent,this.previousExtent_)&&(this.dispatchEvent(new Hs(al,this,o)),Xt(o.extent,this.previousExtent_))}this.dispatchEvent(new Hs(nl,this,o)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(sl,t)},e.prototype.setSize=function(t){this.set(ll,t)},e.prototype.setTarget=function(t){this.set(ul,t)},e.prototype.setView=function(t){this.set(hl,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Y);var Fl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Il=function(t){function e(e){var i=t.call(this)||this,r=e.element;return!r||e.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),i.element=r||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Fl(e,t),e.prototype.disposeInternal=function(){sn(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&sn(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)U(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==v&&this.listenerKeys.push(N(t,nl,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(Y),Ml=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Al=function(t){function e(e){var i=this,r=e||{};(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===r.collapsed||r.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==r.collapsible,i.collapsible_=void 0===r.collapsible||r.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==r.className?r.className:"ol-attribution",o=void 0!==r.tipLabel?r.tipLabel:"Attributions",a=void 0!==r.expandClassName?r.expandClassName:n+"-expand",s=void 0!==r.collapseLabel?r.collapseLabel:"»",l=void 0!==r.collapseClassName?r.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==r.label?r.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var h=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_,c=document.createElement("button");c.setAttribute("type","button"),c.title=o,c.appendChild(h),c.addEventListener(O,i.handleClick_.bind(i),!1);var p=n+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),d=i.element;return d.className=p,d.appendChild(i.ulElement_),d.appendChild(c),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Ml(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],r=!0,n=t.layerStatesArray,o=0,a=n.length;o<a;++o){var s=n[o];if(ro(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(r=r&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,p=h.length;c<p;++c)h[c]in e||(i.push(h[c]),e[h[c]]=!0);else h in e||(i.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(r),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!g(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var r=0,n=e.length;r<n;++r){var o=document.createElement("li");o.innerHTML=e[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?an(this.collapseLabel_,this.label_):an(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(Il),jl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ll=function(t){function e(e){var i=this,r=e||{};i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var n=void 0!==r.className?r.className:"ol-rotate",o=void 0!==r.label?r.label:"⇧",a=void 0!==r.compassClassName?r.compassClassName:"ol-compass";i.label_=null,"string"==typeof o?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=o):(i.label_=o,i.label_.classList.add(a));var s=r.tipLabel?r.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(O,i.handleClick_.bind(i),!1);var u=n+" ol-unselectable ol-control",h=i.element;return h.className=u,h.appendChild(l),i.callResetNorth_=r.resetNorth?r.resetNorth:void 0,i.duration_=void 0!==r.duration?r.duration:250,i.autoHide_=void 0===r.autoHide||r.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return jl(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Ms}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var r="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains("ol-hidden");n||0!==i?n&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=r}this.rotation_=i}},e}(Il),Dl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zl=function(t){function e(e){var i=this,r=e||{};i=t.call(this,{element:document.createElement("div"),target:r.target})||this;var n=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,a=void 0!==r.zoomInClassName?r.zoomInClassName:n+"-in",s=void 0!==r.zoomOutClassName?r.zoomOutClassName:n+"-out",l=void 0!==r.zoomInLabel?r.zoomInLabel:"+",u=void 0!==r.zoomOutLabel?r.zoomOutLabel:"−",h=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",c=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=a,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(O,i.handleClick_.bind(i,o),!1);var d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof u?document.createTextNode(u):u),d.addEventListener(O,i.handleClick_.bind(i,-o),!1);var f=n+" ol-unselectable ol-control",g=i.element;return g.className=f,g.appendChild(p),g.appendChild(d),i.duration_=void 0!==r.duration?r.duration:250,i}return Dl(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var r=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:Ms})):e.setZoom(r)}}},e}(Il),Gl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nl="degrees",Bl="imperial",Ul="nautical",Vl="metric",Wl="us",ql=[1,2,5],Xl=function(t){function e(e){var i=this,r=e||{},n=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).innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==r.minWidth?r.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addEventListener(H("units"),i.handleUnitsChanged_),i.setUnits(r.units||Vl),i.scaleBar_=r.bar||!1,i.scaleBarSteps_=r.steps||4,i.scaleBarText_=r.text||!1,i.dpi_=r.dpi||void 0,i}return Gl(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,r=this.getUnits(),n=r==Nl?_t:bt,o=di(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),s=a*o,l="";if(r==Nl){var u=Ct[_t];(s*=u)<u/60?(l="″",o*=3600):s<u?(l="′",o*=60):l="°"}else r==Bl?s<.9144?(l="in",o/=.0254):s<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==Ul?(o/=1852,l="nm"):r==Vl?s<.001?(l="μm",o*=1e6):s<1?(l="mm",o*=1e3):s<1e3?l="m":(l="km",o/=1e3):r==Wl?s<.9144?(l="in",o*=39.37):s<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):rt(!1,33);for(var h,c,p,d,f=3*Math.floor(Math.log(a*o)/Math.log(10));;){p=Math.floor(f/3);var g=Math.pow(10,p);if(h=ql[(f%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=a)break;++f}d=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=d&&(this.innerElement_.innerHTML=d,this.renderedHTML_=d),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+r+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,r,n){var o=(0===t?0:Math.round(r/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=di(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(Il);var Kl="active",Yl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zl=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Yl(e,t),e.prototype.getActive=function(){return this.get(Kl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Kl,t)},e.prototype.setMap=function(t){this.map_=t},e}(Y);function Hl(t,e,i,r){var n=t.getZoom();if(void 0!==n){var o=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==r?r:250,easing:Ms})}}var $l=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jl=function(t){function e(e){var i=t.call(this)||this,r=e||{};return i.delta_=r.delta?r.delta:1,i.duration_=void 0!==r.duration?r.duration:250,i}return $l(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Qs.DBLCLICK){var i=t.originalEvent,r=t.map,n=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Hl(r.getView(),o,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(Zl),Ql=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tu=function(t){function e(e){var i=this,r=e||{};return i=t.call(this,r)||this,r.handleDownEvent&&(i.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(i.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(i.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(i.handleUpEvent=r.handleUpEvent),r.stopDown&&(i.stopDown=r.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return Ql(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Qs.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Qs.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Qs.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==Qs.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Qs.POINTERDOWN||e===Qs.POINTERDRAG||e===Qs.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==Qs.POINTERUP?delete this.trackedPointers_[i]:(t.type==Qs.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=b(this.trackedPointers_)}},e}(Zl);function eu(t){for(var e=t.length,i=0,r=0,n=0;n<e;n++)i+=t[n].clientX,r+=t[n].clientY;return[i/e,r/e]}function iu(t){var e=arguments;return function(t){for(var i=!0,r=0,n=e.length;r<n&&(i=i&&e[r](t));++r);return i}}var ru=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},nu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},ou=y,au=function(t){var e=t.originalEvent;return 0==e.button&&!(Jr&&Qr&&e.ctrlKey)},su=m,lu=function(t){return t.type==Qs.SINGLECLICK},uu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},hu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},cu=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},pu=function(t){var e=t.originalEvent;return rt(void 0!==e,56),"mouse"==e.pointerType},du=function(t){var e=t.originalEvent;return rt(void 0!==e,56),e.isPrimary&&0===e.button},fu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gu=function(t){function e(e){var i=t.call(this,{stopDown:m})||this,r=e||{};i.kinetic_=r.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=r.condition?r.condition:iu(uu,du);return i.condition_=r.onFocusOnly?iu(nu,n):n,i.noKinetic_=!1,i}return fu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,i=eu(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var r=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],n=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(r,n.getResolution()),ni(r,n.getRotation()),n.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-r*Math.cos(n),a[1]-r*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:Ms})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(tu),yu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mu=function(t){function e(e){var i=this,r=e||{};return(i=t.call(this,{stopDown:m})||this).condition_=r.condition?r.condition:ru,i.lastAngle_=void 0,i.duration_=void 0!==r.duration?r.duration:250,i}return yu(e,t),e.prototype.handleDragEvent=function(t){if(pu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==wl){var r=e.getSize(),n=t.pixel,o=Math.atan2(r[1]/2-n[1],n[0]-r[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!pu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!pu(t)&&(!(!au(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(tu),vu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_u=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return vu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new mr([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(u),xu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bu="boxstart",wu="boxdrag",Su="boxend",Cu="boxcancel",Tu=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=r,n}return xu(e,t),e}(s),Eu=function(t){function e(e){var i=t.call(this)||this,r=e||{};return i.box_=new _u(r.className||"ol-dragbox"),i.minArea_=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(i.onBoxEnd=r.onBoxEnd),i.startPixel_=null,i.condition_=r.condition?r.condition:au,i.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:i.defaultBoxEndCondition,i}return xu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var r=i[0]-e[0],n=i[1]-e[1];return r*r+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Tu(wu,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Tu(e?Su:Cu,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Tu(bu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(tu),ku=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ru=function(t){function e(e){var i=this,r=e||{},n=r.condition?r.condition:hu;return(i=t.call(this,{condition:n,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,i.out_=void 0!==r.out&&r.out,i}return ku(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),r=e.getSize(),n=this.getGeometry().getExtent();if(this.out_){var o=i.calculateExtentInternal(r),a=ie([e.getPixelFromCoordinateInternal(ce(n)),e.getPixelFromCoordinateInternal(_e(n))]);!function(t,e){var i=(t[2]-t[0])/2*(e-1),r=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=r,t[3]+=r}(o,1/i.getResolutionForExtentInternal(a,r)),n=o}var s=i.getConstrainedResolution(i.getResolutionForExtentInternal(n,r)),l=i.getConstrainedCenter(de(n),s);i.animateInternal({resolution:s,center:l,duration:this.duration_,easing:Ms})},e}(Eu),Ou=37,Pu=38,Fu=39,Iu=40,Mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Au=function(t){function e(e){var i=t.call(this)||this,r=e||{};return i.defaultCondition_=function(t){return uu(t)&&cu(t)},i.condition_=void 0!==r.condition?r.condition:i.defaultCondition_,i.duration_=void 0!==r.duration?r.duration:100,i.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,i}return Mu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==A){var i=t.originalEvent,r=i.keyCode;if(this.condition_(t)&&(r==Iu||r==Ou||r==Fu||r==Pu)){var n=t.map.getView(),o=n.getResolution()*this.pixelDelta_,a=0,s=0;r==Iu?s=-o:r==Ou?a=-o:r==Fu?a=o:s=o;var l=[a,s];ni(l,n.getRotation()),function(t,e,i){var r=t.getCenterInternal();if(r){var n=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:js,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Zl),ju=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lu=function(t){function e(e){var i=t.call(this)||this,r=e||{};return i.condition_=r.condition?r.condition:cu,i.delta_=r.delta?r.delta:1,i.duration_=void 0!==r.duration?r.duration:100,i}return ju(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==A||t.type==j){var i=t.originalEvent,r=i.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var n=t.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_;Hl(n.getView(),o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Zl),Du=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zu="trackpad",Gu="wheel",Nu=function(t){function e(e){var i=this,r=e||{};(i=t.call(this,r)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,i.duration_=void 0!==r.duration?r.duration:250,i.timeout_=void 0!==r.timeout?r.timeout:80,i.useAnchor_=void 0===r.useAnchor||r.useAnchor,i.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var n=r.condition?r.condition:ou;return i.condition_=r.onFocusOnly?iu(nu,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Du(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==G)return!0;var e,i=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==G&&(e=r.deltaY,$r&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=tn),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?zu:Gu);var o=i.getView();if(this.mode_===zu&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Te(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Hl(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Zl),Bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Uu=function(t){function e(e){var i=this,r=e||{},n=r;return n.stopDown||(n.stopDown=m),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==r.threshold?r.threshold:.3,i.duration_=void 0!==r.duration?r.duration:250,i}return Bu(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],r=this.targetPointers[1],n=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=n-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==wl){var l=a.getViewport().getBoundingClientRect(),u=eu(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(tu),Vu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wu=function(t){function e(e){var i=this,r=e||{},n=r;return n.stopDown||(n.stopDown=m),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==r.duration?r.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Vu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],r=this.targetPointers[1],n=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(n*n+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),h=eu(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(tu),qu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xu="addfeatures",Ku=function(t){function e(e,i,r,n){var o=t.call(this,e)||this;return o.features=r,o.file=i,o.projection=n,o}return qu(e,t),e}(s),Yu=function(t){function e(e){var i=this,r=e||{};(i=t.call(this,{handleEvent:y})||this).readAsBuffer_=!1,i.formats_=[];for(var n=r.formatConstructors?r.formatConstructors:[],o=0,a=n.length;o<a;++o){var s=n[o];"function"==typeof s&&(s=new s),i.formats_.push(s),i.readAsBuffer_=i.readAsBuffer_||s.getType()===vs}return i.projection_=r.projection?pi(r.projection):null,i.dropListenKeys_=null,i.source_=r.source||null,i.target=r.target?r.target:null,i}return qu(e,t),e.prototype.handleResult_=function(t,e){var i,r=e.target.result,n=this.getMap(),o=this.projection_;o||(o=n.getView().getProjection());for(var a=this.formats_,s=0,l=a.length;s<l;++s){var u=a[s],h=r;this.readAsBuffer_&&u.getType()!==vs&&(void 0===i&&(i=(new TextDecoder).decode(r)),h=i);var c=this.tryReadFeatures_(u,h,{featureProjection:o});if(c&&c.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(c)),this.dispatchEvent(new Ku(Xu,t,c,o));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[N(e,M,this.handleDrop,this),N(e,F,this.handleStop,this),N(e,I,this.handleStop,this),N(e,M,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,i){try{return t.readFeatures(e,i)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(U),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,i=0,r=e.length;i<r;++i){var n=e.item(i),o=new FileReader;o.addEventListener(L,this.handleResult_.bind(this,n)),this.readAsBuffer_?o.readAsArrayBuffer(n):o.readAsText(n)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(Zl),Zu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hu=function(t){function e(e){var i=this,r=e||{};return(i=t.call(this,r)||this).condition_=r.condition?r.condition:hu,i.lastAngle_=void 0,i.lastMagnitude_=void 0,i.lastScaleDelta_=0,i.duration_=void 0!==r.duration?r.duration:400,i}return Zu(e,t),e.prototype.handleDragEvent=function(t){if(pu(t)){var e=t.map,i=e.getSize(),r=t.pixel,n=r[0]-i[0]/2,o=i[1]/2-r[1],a=Math.atan2(o,n),s=Math.sqrt(n*n+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!pu(t))return!0;var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!pu(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(tu),$u=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ju=function(t){function e(e,i,r){var n=t.call(this)||this;if(void 0!==r&&void 0===i)n.setFlatCoordinates(r,e);else{var o=i||0;n.setCenterAndRadius(e,o,r)}return n}return $u(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=t-n[0],a=e-n[1],s=o*o+a*a;if(s<r){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*o,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return r},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,r=t-i[0],n=e-i[1];return r*r+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return Qt(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return vt},e.prototype.intersectsExtent=function(t){if(be(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ue(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+i;for(var n=1;n<e;++n)r[e+n]=t[n];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,n=Bi(r,0,t,this.stride);r[n++]=r[0]+e;for(var o=1,a=this.stride;o<a;++o)r[n++]=r[o];r.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),r=this.getStride();this.setCenter(Ri(i,0,i.length,r,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),r=this.getStride();this.setCenter(Oi(i,0,i.length,r,t,e,i)),this.changed()},e}(Ai);Ju.prototype.transform;var Qu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),th=function(t){function e(e,i,r){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&r)n.setFlatCoordinates(i,e),n.ends_=r;else{for(var o=n.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout()),f(s,c.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(o,s),n.ends_=l}return n}return Qu(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?f(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,r){return r<Kt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(zi(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ni(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,r))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=lt&&this.layout!=ut||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,r,n,o,a){if(a)return kr(t,e,i[i.length-1],r,n,o);var s;if(n<t[r-1])return o?((s=t.slice(0,r))[r-1]=n,s):null;if(t[t.length-1]<n)return o?((s=t.slice(t.length-r))[r-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var h=i[l];if(e!=h){if(n<t[e+r-1])return null;if(n<=t[h-1])return kr(t,e,h,r,n,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,n)},e.prototype.getCoordinates=function(){return Zi(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Pr(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,r=[],n=0,o=0,a=e.length;o<a;++o){var s=e[o],l=new Pr(t.slice(n,s),i);r.push(l),n=s}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,o=0,a=r.length;o<a;++o){var s=r[o];f(t,Er(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=function(t,e,i,r,n,o,a,s){for(var l=0,u=i.length;l<u;++l){var h=i[l];a=Wi(t,e,h,r,n,o,a),s.push(a),e=h}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,r),new e(i,at,r)},e.prototype.getType=function(){return gt},e.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,a=i.length;o<a;++o){if(ur(t,e,i[o],r,n))return!0;e=i[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=Vi(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Ai),eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ih=function(t){function e(e,i){var r=t.call(this)||this;return i&&!Array.isArray(e[0])?r.setFlatCoordinates(i,e):r.setCoordinates(e,i),r}return eh(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?f(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,r){if(r<Kt(this.getExtent(),t,e))return r;for(var n=this.flatCoordinates,o=this.stride,a=0,s=n.length;a<s;a+=o){var l=Oe(t,e,n[a],n[a+1]);if(l<r){r=l;for(var u=0;u<o;++u)i[u]=n[a+u];i.length=o}}return r},e.prototype.getCoordinates=function(){return Yi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new ir(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,r=[],n=0,o=t.length;n<o;n+=i){var a=new ir(t.slice(n,n+i),e);r.push(a)}return r},e.prototype.getType=function(){return ft},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,r=0,n=e.length;r<n;r+=i){if(Ht(t,e[r],e[r+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ui(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ai);function rh(t,e,i,r){for(var n=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];o=re(t,e,l[0],r),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return n}var nh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oh=function(t){function e(e,i,r){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var o=n.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout());for(var p=s.length,d=c.getEnds(),g=0,y=d.length;g<y;++g)d[g]+=p;f(s,c.getFlatCoordinates()),l.push(d)}i=o,e=s,r=l}return void 0!==i&&r?(n.setFlatCoordinates(i,e),n.endss_=r):n.setCoordinates(e,i),n}return nh(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;f(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,n=(e=t.getEnds().slice()).length;r<n;++r)e[r]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),r=0;r<t;++r)i[r]=this.endss_[r].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,r){return r<Kt(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,r,n){for(var o=0,a=i.length;o<a;++o){var s=i[o];n=zi(t,e,s,r,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,r,n,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];u=Ni(t,e,f,r,n,o,a,s,l,u,c),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))},e.prototype.containsXY=function(t,e){return function(t,e,i,r,n,o){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(or(t,e,l,r,n,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,i,r){for(var n=0,o=0,a=i.length;o<a;++o){var s=i[o];n+=Ji(t,e,s,r),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?gr(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Hi(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=rh(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=sr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new ih(this.getFlatInteriorPoints().slice(),lt)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,r,n){for(var o=0,a=i.length;o<a;++o){var s=i[o];if(!dr(t,e,s,r,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=gr(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=function(t,e,i,r,n,o,a,s){for(var l=0,u=i.length;l<u;++l){var h=i[l],c=[];a=Ki(t,e,h,r,n,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,r),new e(i,at,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var r=this.endss_[t].slice(),n=r[r.length-1];if(0!==e)for(var o=0,a=r.length;o<a;++o)r[o]-=e;return new mr(this.flatCoordinates.slice(e,n),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[],n=0,o=0,a=i.length;o<a;++o){var s=i[o].slice(),l=s[s.length-1];if(0!==n)for(var u=0,h=s.length;u<h;++u)s[u]-=n;var c=new mr(e.slice(n,l),t,s);r.push(c),n=l}return r},e.prototype.getType=function(){return yt},e.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,a=i.length;o<a;++o){var s=i[o];if(hr(t,e,s,r,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,r,n){for(var o=n||[],a=0,s=0,l=i.length;s<l;++s){var u=Vi(t,e,i[s],r,o[a]);o[a++]=u,e=u[u.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(Ai),ah=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sh="Point",lh="LineString",uh="Polygon",hh="Circle",ch="drawstart",ph="drawend",dh="drawabort",fh=function(t){function e(e,i){var r=t.call(this,e)||this;return r.feature=i,r}return ah(e,t),e}(s),gh=function(t){function e(e){var i=this,r=e;r.stopDown||(r.stopDown=m),(i=t.call(this,r)||this).shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){var e;t===ht||t===ft?e=sh:t===ct||t===gt?e=lh:t===dt||t===yt?e=uh:t===vt&&(e=hh);return e}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===uh?3:2,i.maxPoints_=i.mode_===hh?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:y;var n,o=e.geometryFunction;if(!o){var a,s=i.mode_;if(s===hh)o=function(t,e,i){var r=e||new Ju([NaN,NaN]),n=Ci(t[0]),o=oi(n,Ci(t[t.length-1]));return r.setCenterAndRadius(n,Math.sqrt(o)),r};else s===sh?a=ir:s===lh?a=Pr:s===uh&&(a=mr),o=function(t,e,i){return e?s===uh?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new os({source:new Es({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=jn(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:uu,i.freehandCondition_,e.freehand?i.freehandCondition_=ou:i.freehandCondition_=e.freehandCondition?e.freehandCondition:hu,i.addEventListener(H(Kl),i.updateState_),i}return ah(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===R&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==sh&&this.freehandCondition_(e);var i=e.type===Qs.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===Qs.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Qs.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===Qs.POINTERDOWN?r=!1:i&&this.getPointerCount()<2?(r=e.type===Qs.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===Qs.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Qs.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Js(Qs.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){switch(!0){case!this.finishCoordinate_:if(this.startDrawing_(t.coordinate),this.mode_!==sh)break;case this.freehand_||this.atFinish_(t.pixel)&&this.finishCondition_(t):this.finishDrawing();break;case!this.freehand_:this.addToDrawing_(t.coordinate)}e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.originalEvent.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,r=e[0]-i[0],n=e[1]-i[1],o=r*r+n*n;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t)},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,r=[this.finishCoordinate_],n=this.mode_;if(n===sh)e=!0;else if(n===hh)e=2===this.sketchCoords_.length;else if(n===lh)i=this.sketchCoords_.length>this.minPoints_;else if(n===uh){var o=this.sketchCoords_;i=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=r.length;s<l;s++){var u=r[s],h=a.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=d){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new ot(new ir(e)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new ot);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new Pr(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===sh?this.sketchCoords_=t.slice():this.mode_===uh?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new ot(new Pr(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new ot,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new fh(ch,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,r=this.getMap(),n=this.sketchFeature_.getGeometry(),o=r.getView().getProjection();(this.mode_===sh?i=this.sketchCoords_:this.mode_===uh?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===dt&&this.mode_!==uh)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,r=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),o=this.mode_;o===lh||o===hh?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,r,n)):o===uh&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,r,n)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),r=this.mode_;if(r===lh||r===hh){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.sketchPoint_.setGeometry(new ir(n))}this.geometryFunction_(t,e,i),e.getType()===dt&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===uh){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.sketchPoint_.setGeometry(new ir(n))}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===lh?(e.pop(),this.geometryFunction_(e,i,r)):this.mode_===uh&&(e[0].pop(),this.geometryFunction_(e,i,r),e=i.getCoordinates()),this.type_===ft?t.setGeometry(new ih([e])):this.type_===gt?t.setGeometry(new th([e])):this.type_===yt&&t.setGeometry(new oh([e])),this.dispatchEvent(new fh(ph,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new fh(dh,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),i===lh||i===hh)e=this.sketchCoords_;else{if(i!==uh)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new ot(new ir(i)),this.updateSketchFeatures_(),this.dispatchEvent(new fh(ch,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(tu);var yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mh="extentchanged",vh=function(t){function e(e){var i=t.call(this,mh)||this;return i.extent=e,i}return yh(e,t),e}(s),_h=function(t){function e(e){var i=this,r=e||{};return(i=t.call(this,r)||this).condition_=r.condition?r.condition:ou,i.extent_=null,i.pointerHandler_=null,i.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,i.snappedToVertex_=!1,i.extentFeature_=null,i.vertexFeature_=null,e||(e={}),i.extentOverlay_=new os({source:new Es({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:xh(),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.vertexOverlay_=new os({source:new Es({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:bh(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&i.setExtent(e.extent),i}return yh(e,t),e.prototype.snapToVertex_=function(t,e){var i=e.getCoordinateFromPixelInternal(t),r=this.getExtentInternal();if(r){var n=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(r);n.sort((function(t,e){return si(i,t)-si(i,e)}));var o=n[0],a=ii(i,o),s=e.getPixelFromCoordinateInternal(a);if(ai(t,s)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=oi(s,l),c=oi(s,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,i=t.map,r=this.snapToVertex_(e,i);r||(r=i.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(r)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(vr(t)):e.setGeometry(void 0):(e=new ot(t?vr(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new ot(new ir(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Qs.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,i=t.map,r=this.getExtentInternal(),n=this.snapToVertex_(e,i),o=function(t){var e=null,i=null;return t[0]==r[0]?e=r[2]:t[0]==r[2]&&(e=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==e&&null!==i?[e,i]:null};if(n&&r){var a=n[0]==r[0]||n[0]==r[2]?n[0]:null,s=n[1]==r[1]||n[1]==r[3]?n[1]:null;null!==a&&null!==s?this.pointerHandler_=wh(o(n)):null!==a?this.pointerHandler_=Sh(o([a,r[1]]),o([a,r[3]])):null!==s&&(this.pointerHandler_=Sh(o([r[0],s]),o([r[2],s])))}else n=i.getCoordinateFromPixelInternal(e),this.setExtent([n[0],n[1],n[0],n[1]]),this.pointerHandler_=wh(n);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==he(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return Ti(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new vh(this.extent_))},e}(tu);function xh(){var t=jn();return function(e,i){return t[dt]}}function bh(){var t=jn();return function(e,i){return t[ht]}}function wh(t){return function(e){return Wt([t,e])}}function Sh(t,e){return t[0]==e[0]?function(i){return Wt([t,[i[0],e[1]]])}:t[1]==e[1]?function(i){return Wt([t,[e[0],i[1]]])}:null}var Ch=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Th=[0,0,0,0],Eh=[],kh="modifystart",Rh="modifyend",Oh=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=r,n}return Ch(e,t),e}(s),Ph=function(t){function e(e){var i,r=t.call(this,e)||this;if(r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:du,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&lu(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:ou,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new as,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new os({source:new Es({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Ah(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?i=e.features:e.source&&(r.source_=e.source,i=new it(r.source_.getFeatures()),r.source_.addEventListener(hs,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(ds,r.handleSourceRemove_.bind(r))),!i)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=i,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener($,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(J,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r}return Ch(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,r),t.addEventListener(T,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new it;for(var i=this.featuresBeingModified_.getArray(),r=0,n=e.length;r<n;++r){var o=e[r][0].feature;-1===i.indexOf(o)&&this.featuresBeingModified_.push(o)}this.dispatchEvent(new Oh(kh,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(T,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var r=i.length-1;r>=0;--r){for(var n=i[r],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===n&&this.dragSegments_.splice(o,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),r={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],a={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),a={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(Wt(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[r],index:a,segment:l};this.rBush_.insert(Wt(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[r],index:a,segment:l};this.rBush_.insert(Wt(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[a,r],index:u,segment:c};this.rBush_.insert(Wt(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},o=[r,n];r.featureSegments=o,n.featureSegments=o,this.rBush_.insert(ee(i),r);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),r=0;r<i.length;++r){var n=i[r];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var r=this.vertexFeature_;r?r.getGeometry().setCoordinates(t):(r=new ot(new ir(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r));return r.set("features",e),r.set("geometries",i),r},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Qs.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=Qs.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Qs.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],r=[],n=0,o=this.dragSegments_.length;n<o;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===r.indexOf(u)&&r.push(u);for(var h=s.depth,c=void 0,p=s.segment,d=a[1];e.length<u.getStride();)e.push(p[d][e.length]);switch(u.getType()){case ht:c=e,p[0]=e,p[1]=e;break;case ft:(c=u.getCoordinates())[s.index]=e,p[0]=e,p[1]=e;break;case ct:(c=u.getCoordinates())[s.index+d]=e,p[d]=e;break;case gt:case dt:(c=u.getCoordinates())[h[0]][s.index+d]=e,p[d]=e;break;case yt:(c=u.getCoordinates())[h[1]][h[0]][s.index+d]=e,p[d]=e;break;case vt:if(p[0]=e,p[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=ai(Ci(u.getCenter()),Ci(e));u.setRadius(f),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,i,r)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var n=t.map.getView().getProjection(),o=[],a=i.getGeometry().getCoordinates(),s=Wt([a]),l=this.rBush_.getInExtent(s),u={};l.sort(Fh);for(var h=0,c=l.length;h<c;++h){var p=l[h],d=p.segment,f=r(p.geometry),g=p.depth;if(g&&(f+="-"+g.join("-")),u[f]||(u[f]=new Array(2)),p.geometry.getType()!==vt||1!==p.index)if(!ri(d[0],a)||u[f][0])if(!ri(d[1],a)||u[f][1])r(d)in this.vertexSegments_&&!u[f][0]&&!u[f][1]&&this.insertVertexCondition_(t)&&o.push(p);else{if((p.geometry.getType()===ct||p.geometry.getType()===gt)&&u[f][0]&&0===u[f][0].index)continue;this.dragSegments_.push([p,1]),u[f][1]=p}else this.dragSegments_.push([p,0]),u[f][0]=p;else ri(Mh(e,p,n),a)&&!u[f][0]&&(this.dragSegments_.push([p,0]),u[f][0]=p)}o.length&&this.willModifyFeatures_(t,[o]);for(var y=o.length-1;y>=0;--y)this.insertVertex_(o[y],a)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],r=i.geometry;if(r.getType()===vt){var n=r.getCenter(),o=i.featureSegments[0],a=i.featureSegments[1];o.segment[0]=n,o.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(ee(n),o);var s=r;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Wt(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Oh(Rh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var n,o,a=this,s=i||e.getCoordinateFromPixel(t),l=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===a.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===ht){o=i;var r=i.getCoordinates();n=[{feature:t,geometry:i,segment:[r,r]}]}return!0}),{layerFilter:u})}if(!n){var h=Ti(qt(Ei(ee(s,Th)),e.getView().getResolution()*this.pixelTolerance_,Th));n=this.rBush_.getInExtent(h)}if(n&&n.length>0){var c=n.sort((function(t,e){return Ih(s,t,l)-Ih(s,e,l)}))[0],p=c.segment,d=Mh(s,c,l),f=e.getPixelFromCoordinate(d),g=ai(t,f);if(o||g<=this.pixelTolerance_){var y={};if(y[r(p)]=!0,this.delta_[0]=d[0]-s[0],this.delta_[1]=d[1]-s[1],c.geometry.getType()===vt&&1===c.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[c.feature],[c.geometry]);else{var m=e.getPixelFromCoordinate(p[0]),v=e.getPixelFromCoordinate(p[1]),_=oi(f,m),x=oi(f,v);g=Math.sqrt(Math.min(_,x)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(d=_>x?p[1]:p[0]),this.createOrUpdateVertexFeature_(d,[c.feature],[c.geometry]);var b={};b[r(c.geometry)]=!0;for(var w=1,S=n.length;w<S;++w){var C=n[w].segment;if(!(ri(p[0],C[0])&&ri(p[1],C[1])||ri(p[0],C[1])&&ri(p[1],C[0])))break;var T=r(n[w].geometry);T in b||(b[T]=!0,y[r(C)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,r=t.segment,n=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case gt:case dt:(i=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case yt:(i=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case ct:(i=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,s,a,1);var u={segment:[r[0],e],feature:n,geometry:o,depth:a,index:s};l.insert(Wt(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,r[1]],feature:n,geometry:o,depth:a,index:s+1};l.insert(Wt(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Qs.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Oh(Rh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,n,o,a,s,l,u,h,c,p=this.dragSegments_,d={},f=!1;for(o=p.length-1;o>=0;--o)c=r((h=(i=p[o])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in d||(d[c]={}),0===i[1]?(d[c].right=h,d[c].index=h.index):1==i[1]&&(d[c].left=h,d[c].index=h.index+1);for(c in d){switch(u=d[c].right,s=d[c].left,(l=(a=d[c].index)-1)<0&&(l=0),t=e=(n=(h=void 0!==s?s:u).geometry).getCoordinates(),f=!1,n.getType()){case gt:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(a,1),f=!0);break;case ct:e.length>2&&(e.splice(a,1),f=!0);break;case yt:t=t[h.depth[1]];case dt:(t=t[h.depth[0]]).length>4&&(a==t.length-1&&(a=0),t.splice(a,1),f=!0,0===a&&(t.pop(),t.push(t[0]),l=t.length-1))}if(f){this.setGeometryCoordinates_(n,e);var g=[];if(void 0!==s&&(this.rBush_.remove(s),g.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==s&&void 0!==u){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:g};this.rBush_.insert(Wt(y.segment),y)}this.updateSegmentIndices_(n,a,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return f},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,r){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||g(n.depth,i))&&n.index>e&&(n.index+=r)}))},e}(tu);function Fh(t,e){return t.index-e.index}function Ih(t,e,i){var r=e.geometry;if(r.getType()===vt){var n=r;if(1===e.index){null;var o=oi(n.getCenter(),Ci(t)),a=Math.sqrt(o)-n.getRadius();return a*a}}var s=Ci(t);return Eh[0]=Ci(e.segment[0]),Eh[1]=Ci(e.segment[1]),si(s,Eh)}function Mh(t,e,i){var r=e.geometry;if(r.getType()===vt&&1===e.index){var n=r;return Si(n.getClosestPoint(Ci(t)))}var o=Ci(t);return Eh[0]=Ci(e.segment[0]),Eh[1]=Ci(e.segment[1]),Si(ii(o,Eh))}function Ah(){var t=jn();return function(e,i){return t[ht]}}var jh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lh="select",Dh=function(t){function e(e,i,r,n){var o=t.call(this,e)||this;return o.selected=i,o.deselected=r,o.mapBrowserEvent=n,o}return jh(e,t),e}(s),zh={},Gh=function(t){function e(e){var i,r,n=t.call(this)||this,o=e||{};if(n.boundAddFeature_=n.addFeature_.bind(n),n.boundRemoveFeature_=n.removeFeature_.bind(n),n.condition_=o.condition?o.condition:lu,n.addCondition_=o.addCondition?o.addCondition:su,n.removeCondition_=o.removeCondition?o.removeCondition:su,n.toggleCondition_=o.toggleCondition?o.toggleCondition:hu,n.multi_=!!o.multi&&o.multi,n.filter_=o.filter?o.filter:y,n.hitTolerance_=o.hitTolerance?o.hitTolerance:0,n.style_=void 0!==o.style?o.style:(f((i=jn())[dt],i[ct]),f(i[mt],i[ct]),function(t){return t.getGeometry()?i[t.getGeometry().getType()]:null}),n.features_=o.features||new it,o.layers)if("function"==typeof o.layers)r=o.layers;else{var a=o.layers;r=function(t){return c(a,t)}}else r=y;return n.layerFilter_=r,n.featureLayerAssociation_={},n}return jh(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[r(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[r(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener($,this.boundAddFeature_),this.features_.addEventListener(J,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener($,this.boundAddFeature_),this.features_.removeEventListener(J,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.applySelectedStyle_(e)},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=r(t);e in zh||(zh[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var i=this.getMap().getInteractions().getArray(),n=i.length-1;n>=0;--n){var o=i[n];if(o!==this&&o instanceof e&&o.getStyle()&&-1!==o.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(o.getStyle())}var a=r(t);t.setStyle(zh[a]),delete zh[a]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[r(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),i=this.removeCondition_(t),r=this.toggleCondition_(t),n=!e&&!i&&!r,o=t.map,a=this.getFeatures(),s=[],l=[];if(n){x(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var h=a.item(u),p=l.indexOf(h);p>-1?l.splice(p,1):(a.remove(h),s.push(h))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.filter_(t,n))return!e&&!r||c(a.getArray(),t)?(i||r)&&c(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,n)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var d=s.length-1;d>=0;--d)a.remove(s[d]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new Dh(Lh,l,s,t)),!0},e}(Zl);var Nh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Bh(t){return t.feature?t.feature:t.element?t.element:void 0}var Uh=[],Vh=function(t){function e(e){var i=this,r=e||{},n=r;return n.handleDownEvent||(n.handleDownEvent=y),n.stopDown||(n.stopDown=m),(i=t.call(this,n)||this).source_=r.source?r.source:null,i.vertex_=void 0===r.vertex||r.vertex,i.edge_=void 0===r.edge||r.edge,i.features_=r.features?r.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,i.rBush_=new as,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return Nh(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,n=r(t),o=t.getGeometry();if(o){var a=this.SEGMENT_WRITERS_[o.getType()];a&&(this.indexedFeaturesExtents_[n]=o.getExtent([1/0,1/0,-1/0,-1/0]),a(t,o))}i&&(this.featureChangeListenerKeys_[n]=N(t,T,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Bh(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Bh(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=r(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=b(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,n=r(t),o=this.indexedFeaturesExtents_[n];if(o){var a=this.rBush_,s=[];a.forEachInExtent(o,(function(e){t===e.feature&&s.push(e)}));for(var l=s.length-1;l>=0;--l)a.remove(s[l])}i&&(U(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var i=this.getMap(),r=this.featuresListenerKeys_,n=this.getFeatures_();i&&(r.forEach(U),r.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(N(this.features_,$,this.handleFeatureAdd_,this),N(this.features_,J,this.handleFeatureRemove_,this)):this.source_&&r.push(N(this.source_,hs,this.handleFeatureAdd_,this),N(this.source_,ds,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var r=Wt([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(r);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==vt})));var o=!1,a=null,s=null;if(0===n.length)return{snapped:o,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=Ci(e),h=1/0,c=0;c<n.length;++c){var p=n[c];Uh[0]=Ci(p.segment[0]),Uh[1]=Ci(p.segment[1]);var d=si(u,Uh);d<h&&(l=p,h=d)}var f=l.segment;if(this.vertex_&&!this.edge_){var g=i.getPixelFromCoordinate(f[0]),y=i.getPixelFromCoordinate(f[1]),m=oi(t,g),v=oi(t,y);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(o=!0,a=m>v?f[1]:f[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===vt;if(_){var x=l.feature.getGeometry();null,a=Si(function(t,e){var i=e.getRadius(),r=e.getCenter(),n=r[0],o=r[1],a=t[0]-n,s=t[1]-o;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,o+i*s/l]}(u,x))}else Uh[0]=Ci(f[0]),Uh[1]=Ci(f[1]),a=Si(ii(u,Uh));if(ai(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!_)){g=i.getPixelFromCoordinate(f[0]),y=i.getPixelFromCoordinate(f[1]),m=oi(s,g),v=oi(s,y);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(a=m>v?f[1]:f[0],s=i.getPixelFromCoordinate(a))}}return o&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:o,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=_r(e).getCoordinates()[0],r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),a={feature:t,segment:o};this.rBush_.insert(Wt(o),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),r=0;r<i.length;++r){var n=this.SEGMENT_WRITERS_[i[r].getType()];n&&n(t,i[r])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),a={feature:t,segment:o};this.rBush_.insert(Wt(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Wt(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],a={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,segment:c};this.rBush_.insert(Wt(c),p)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),r={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Wt(l),u)}},e}(tu),Wh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qh="translatestart",Xh="translating",Kh="translateend",Yh=function(t){function e(e,i,r,n,o){var a=t.call(this,e)||this;return a.features=i,a.coordinate=r,a.startCoordinate=n,a.mapBrowserEvent=o,a}return Wh(e,t),e}(s),Zh=function(t){function e(e){var i,r=this,n=e||{};if((r=t.call(this,n)||this).lastCoordinate_=null,r.startCoordinate_=null,r.features_=void 0!==n.features?n.features:null,n.layers)if("function"==typeof n.layers)i=n.layers;else{var o=n.layers;i=function(t){return c(o,t)}}else i=y;return r.layerFilter_=i,r.filter_=n.filter?n.filter:y,r.hitTolerance_=n.hitTolerance?n.hitTolerance:0,r.lastFeature_=null,r.addEventListener(H(Kl),r.handleActiveChanged_),r}return Wh(e,t),e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new it([this.lastFeature_]);return this.dispatchEvent(new Yh(qh,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new it([this.lastFeature_]);return this.dispatchEvent(new Yh(Kh,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,i=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],n=this.features_||new it([this.lastFeature_]);n.forEach((function(t){var e=t.getGeometry();e.translate(i,r),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new Yh(Xh,n,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||c(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var i=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(i)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),i=this.getActive();e&&i||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(tu);function Hh(t){var e=t||{},i=new it,r=new Ns(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new mu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Jl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new gu({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Uu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Wu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Au),i.push(new Lu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Nu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Ru({duration:e.zoomDuration})),i}var $h=Object.freeze({__proto__:null,defaults:Hh,DoubleClickZoom:Jl,DragAndDrop:Yu,DragBox:Eu,DragPan:gu,DragRotate:mu,DragRotateAndZoom:Hu,DragZoom:Ru,Draw:gh,Extent:_h,Interaction:Zl,KeyboardPan:Au,KeyboardZoom:Lu,Modify:Ph,MouseWheelZoom:Nu,PinchRotate:Uu,PinchZoom:Wu,Pointer:tu,Select:Gh,Snap:Vh,Translate:Zh}),Jh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qh=function(t){function e(e){return(e=_({},e)).controls||(e.controls=function(t){var e=t||{},i=new it;return(void 0===e.zoom||e.zoom)&&i.push(new zl(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Ll(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Al(e.attributionOptions)),i}()),e.interactions||(e.interactions=Hh({onFocusOnly:!0})),t.call(this,e)||this}return Jh(e,t),e.prototype.createRenderer=function(){return new qs(this)},e}(Pl),tc=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return rt(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return rt(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){rt(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function ec(t,e,i,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=i,r):[t,e,i]}function ic(t,e,i){return t+"/"+e+"/"+i}function rc(t){return ic(t[0],t[1],t[2])}function nc(t){return t.split("/").map(Number)}function oc(t){return(t[1]<<t[0])+t[2]}var ac=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ac(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=nc(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(rc(e.tileCoord)),e.release())}.bind(this))}},e}(tc),lc=function(){function t(t,e,i,r){this.minX=t,this.maxX=e,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,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=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.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.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 uc(t,e,i,r,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=r,n):new lc(t,e,i,r)}var hc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cc=[],pc=function(t){function e(e,i,r,n){var o=t.call(this,e,i,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.errorSourceTileKeys={},o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=null,o.wantedResolution,o.getSourceTiles=n.bind(void 0,o),o.sourceZ=-1,o.hifi=!1,o.wrappedTileCoord=r,o}return hc(e,t),e.prototype.getContext=function(t){var e=r(t);return e in this.context_||(this.context_[e]=on(1,1,cc)),this.context_[e]},e.prototype.hasContext=function(t){return r(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=r(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedZ:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)cc.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(Ds),dc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fc=function(t){function e(e,i,r,n,o,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=r,s.key=r,s}return dc(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==ks&&(this.setState(Rs),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(Ps)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(Os)},e.prototype.setLoader=function(t){this.loader_=t},e}(Ds),gc={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},yc=/(italic|oblique)$/i,mc={},vc=function(t,e,i){var r=mc[t];if(!r){Array.isArray(t)||(t=[t]);for(var n=400,o="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),h=u[u.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,u.pop(),h=u[u.length-1].toLowerCase()):yc.test(h)&&(h=h.replace(yc,""),o=u[u.length-1].replace(h,"")),gc)if(h==c||h==c.replace("-","")||h==c.replace("-"," ")){n=gc[c],u.pop();break}"number"==typeof h&&(n=h);var p=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==p.indexOf(" ")&&(p='"'+p+'"'),a.push(p)}r=mc[t]=[o,n,a]}return r[0]+" "+r[1]+" "+e+"px"+(i?"/"+i:"")+" "+r[2]},_c=[1,0,0,1,0,0],xc=function(){function t(t,e,i,r,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===ht?ee(this.flatCoordinates_):re(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=de(this.getExtent());this.flatInteriorPoints_=ar(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=rh(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=sr(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Er(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,r=0,n=i.length;r<n;++r){var o=i[r],a=Er(t,e,o,2,.5);f(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=pi(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var r=ye(i)/ye(e);Ft(_c,i[0],i[3],r,-r,0,0,0),ki(this.flatCoordinates_,0,this.flatCoordinates_.length,2,_c,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();xc.prototype.getEndss=xc.prototype.getEnds,xc.prototype.getFlatCoordinates=xc.prototype.getOrientedFlatCoordinates;var bc={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.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,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0"}},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,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0"}},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,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0"}},"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,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0"}},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,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},wc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Sc(t){var e={exports:{}};return t(e,e.exports),e.exports}function Cc(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}
|
||
/*! https://mths.be/punycode v1.3.2 by @mathias */var Tc=Sc((function(t,e){!function(i){var r=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,o="object"==typeof wc&&wc;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var a,s,l=2147483647,u=/^xn--/,h=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,f=String.fromCharCode;function g(t){throw RangeError(p[t])}function y(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function m(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+y((t=t.replace(c,".")).split("."),e).join(".")}function v(t){for(var e,i,r=[],n=0,o=t.length;n<o;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<o?56320==(64512&(i=t.charCodeAt(n++)))?r.push(((1023&e)<<10)+(1023&i)+65536):(r.push(e),n--):r.push(e);return r}function _(t){return y(t,(function(t){var e="";return t>65535&&(e+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=f(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,i){var r=0;for(t=i?d(t/700):t>>1,t+=d(t/e);t>455;r+=36)t=d(t/35);return d(r+36*t/(t+38))}function w(t){var e,i,r,n,o,a,s,u,h,c,p,f=[],y=t.length,m=0,v=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),r=0;r<i;++r)t.charCodeAt(r)>=128&&g("not-basic"),f.push(t.charCodeAt(r));for(n=i>0?i+1:0;n<y;){for(o=m,a=1,s=36;n>=y&&g("invalid-input"),((u=(p=t.charCodeAt(n++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||u>d((l-m)/a))&&g("overflow"),m+=u*a,!(u<(h=s<=x?1:s>=x+26?26:s-x));s+=36)a>d(l/(c=36-h))&&g("overflow"),a*=c;x=b(m-o,e=f.length+1,0==o),d(m/e)>l-v&&g("overflow"),v+=d(m/e),m%=e,f.splice(m++,0,v)}return _(f)}function S(t){var e,i,r,n,o,a,s,u,h,c,p,y,m,_,w,S=[];for(y=(t=v(t)).length,e=128,i=0,o=72,a=0;a<y;++a)(p=t[a])<128&&S.push(f(p));for(r=n=S.length,n&&S.push("-");r<y;){for(s=l,a=0;a<y;++a)(p=t[a])>=e&&p<s&&(s=p);for(s-e>d((l-i)/(m=r+1))&&g("overflow"),i+=(s-e)*m,e=s,a=0;a<y;++a)if((p=t[a])<e&&++i>l&&g("overflow"),p==e){for(u=i,h=36;!(u<(c=h<=o?1:h>=o+26?26:h-o));h+=36)w=u-c,_=36-c,S.push(f(x(c+w%_,0))),u=d(w/_);S.push(f(x(u,0))),o=b(i,m,r==n),i=0,++r}++i,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:v,encode:_},decode:w,encode:S,toASCII:function(t){return m(t,(function(t){return h.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return m(t,(function(t){return u.test(t)?w(t.slice(4).toLowerCase()):t}))}},r&&n)if(t.exports==r)n.exports=a;else for(s in a)a.hasOwnProperty(s)&&(r[s]=a[s]);else i.punycode=a}(wc)})),Ec=function(t){return"string"==typeof t},kc=function(t){return"object"==typeof t&&null!==t},Rc=function(t){return null===t},Oc=function(t){return null==t};function Pc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Fc=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,h,c,p,d=t[l].replace(o,"%20"),f=d.indexOf(i);f>=0?(u=d.substr(0,f),h=d.substr(f+1)):(u=d,h=""),c=decodeURIComponent(u),p=decodeURIComponent(h),Pc(n,c)?Array.isArray(n[c])?n[c].push(p):n[c]=[n[c],p]:n[c]=p}return n},Ic=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Mc=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(r){var n=encodeURIComponent(Ic(r))+i;return Array.isArray(t[r])?t[r].map((function(t){return n+encodeURIComponent(Ic(t))})).join(e):n+encodeURIComponent(Ic(t[r]))})).join(e):r?encodeURIComponent(Ic(r))+i+encodeURIComponent(Ic(t)):""},Ac=Sc((function(t,e){e.decode=e.parse=Fc,e.encode=e.stringify=Mc}));function jc(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Lc=/^([a-z0-9.+-]+:)/i,Dc=/:[0-9]*$/,zc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Gc=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Nc=["'"].concat(Gc),Bc=["%","/","?",";","#"].concat(Nc),Uc=["/","?","#"],Vc=/^[+a-z0-9A-Z_-]{0,63}$/,Wc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,qc={javascript:!0,"javascript:":!0},Xc={javascript:!0,"javascript:":!0},Kc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};jc.prototype.parse=function(t,e,i){if(!Ec(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var a=t=o.join(n);if(a=a.trim(),!i&&1===t.split("#").length){var s=zc.exec(a);if(s)return this.path=a,this.href=a,this.pathname=s[1],s[2]?(this.search=s[2],this.query=e?Ac.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=Lc.exec(a);if(l){var u=(l=l[0]).toLowerCase();this.protocol=u,a=a.substr(l.length)}if(i||l||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var h="//"===a.substr(0,2);!h||l&&Xc[l]||(a=a.substr(2),this.slashes=!0)}if(!Xc[l]&&(h||l&&!Kc[l])){for(var c,p,d=-1,f=0;f<Uc.length;f++){-1!==(g=a.indexOf(Uc[f]))&&(-1===d||g<d)&&(d=g)}-1!==(p=-1===d?a.lastIndexOf("@"):a.lastIndexOf("@",d))&&(c=a.slice(0,p),a=a.slice(p+1),this.auth=decodeURIComponent(c)),d=-1;for(f=0;f<Bc.length;f++){var g;-1!==(g=a.indexOf(Bc[f]))&&(-1===d||g<d)&&(d=g)}-1===d&&(d=a.length),this.host=a.slice(0,d),a=a.slice(d),this.parseHost(),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y)for(var m=this.hostname.split(/\./),v=(f=0,m.length);f<v;f++){var _=m[f];if(_&&!_.match(Vc)){for(var x="",b=0,w=_.length;b<w;b++)_.charCodeAt(b)>127?x+="x":x+=_[b];if(!x.match(Vc)){var S=m.slice(0,f),C=m.slice(f+1),T=_.match(Wc);T&&(S.push(T[1]),C.unshift(T[2])),C.length&&(a="/"+C.join(".")+a),this.hostname=S.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=Tc.toASCII(this.hostname));var E=this.port?":"+this.port:"",k=this.hostname||"";this.host=k+E,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!qc[u])for(f=0,v=Nc.length;f<v;f++){var R=Nc[f];if(-1!==a.indexOf(R)){var O=encodeURIComponent(R);O===R&&(O=escape(R)),a=a.split(R).join(O)}}var P=a.indexOf("#");-1!==P&&(this.hash=a.substr(P),a=a.slice(0,P));var F=a.indexOf("?");if(-1!==F?(this.search=a.substr(F),this.query=a.substr(F+1),e&&(this.query=Ac.parse(this.query)),a=a.slice(0,F)):e&&(this.search="",this.query={}),a&&(this.pathname=a),Kc[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){E=this.pathname||"";var I=this.search||"";this.path=E+I}return this.href=this.format(),this},jc.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",r=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&kc(this.query)&&Object.keys(this.query).length&&(o=Ac.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||Kc[e])&&!1!==n?(n="//"+(n||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):n||(n=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),e+n+(i=i.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+r},jc.prototype.resolve=function(t){return this.resolveObject(function(t,e,i){if(t&&kc(t)&&t instanceof jc)return t;var r=new jc;return r.parse(t,e,i),r}(t,!1,!0)).format()},jc.prototype.resolveObject=function(t){if(Ec(t)){var e=new jc;e.parse(t,!1,!0),t=e}for(var i=new jc,r=Object.keys(this),n=0;n<r.length;n++){var o=r[n];i[o]=this[o]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),s=0;s<a.length;s++){var l=a[s];"protocol"!==l&&(i[l]=t[l])}return Kc[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!Kc[t.protocol]){for(var u=Object.keys(t),h=0;h<u.length;h++){var c=u[h];i[c]=t[c]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||Xc[t.protocol])i.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var d=i.pathname||"",f=i.search||"";i.path=d+f}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var g=i.pathname&&"/"===i.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),m=y||g||i.host&&t.pathname,v=m,_=i.pathname&&i.pathname.split("/")||[],x=(p=t.pathname&&t.pathname.split("/")||[],i.protocol&&!Kc[i.protocol]);if(x&&(i.hostname="",i.port=null,i.host&&(""===_[0]?_[0]=i.host:_.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),m=m&&(""===p[0]||""===_[0])),y)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,_=p;else if(p.length)_||(_=[]),_.pop(),_=_.concat(p),i.search=t.search,i.query=t.query;else if(!Oc(t.search)){if(x)i.hostname=i.host=_.shift(),(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.host=i.hostname=T.shift());return i.search=t.search,i.query=t.query,Rc(i.pathname)&&Rc(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],w=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,S=0,C=_.length;C>=0;C--)"."===(b=_[C])?_.splice(C,1):".."===b?(_.splice(C,1),S++):S&&(_.splice(C,1),S--);if(!m&&!v)for(;S--;S)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),w&&"/"!==_.join("/").substr(-1)&&_.push("");var T,E=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=E?"":_.length?_.shift():"",(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.host=i.hostname=T.shift()));return(m=m||i.host&&_.length)&&!E&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),Rc(i.pathname)&&Rc(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},jc.prototype.parseHost=function(){var t=this.host,e=Dc.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};class Yc extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Zc{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new Zc(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Hc={kind:"null"},$c={kind:"number"},Jc={kind:"string"},Qc={kind:"boolean"},tp={kind:"color"},ep={kind:"object"},ip={kind:"value"},rp={kind:"collator"},np={kind:"formatted"},op={kind:"resolvedImage"};function ap(t,e){return{kind:"array",itemType:t,N:e}}function sp(t){if("array"===t.kind){const e=sp(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const lp=[Hc,$c,Jc,Qc,tp,np,ep,ap(ip),op];function up(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!up(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of lp)if(!up(t,e))return null}return`Expected ${sp(t)} but found ${sp(e)} instead.`}function hp(t,e){return e.some(e=>e.kind===t.kind)}function cp(t,e){return e.some(e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t)}var pp=Sc((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var h=n.substr(0,l),c=n.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=a(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=a(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=a(c[1]),g=a(c[2]),y=g<=.5?g*(f+1):g+f-g*f,m=2*g-y;return[r(255*s(m,y,d+1/3)),r(255*s(m,y,d)),r(255*s(m,y,d-1/3)),p];default:return null}}return null}}catch(t){}}));class dp{constructor(t,e,i,r=1){this.r=t,this.g=e,this.b=i,this.a=r}static parse(t){if(!t)return;if(t instanceof dp)return t;if("string"!=typeof t)return;const e=pp.parseCSSColor(t);return e?new dp(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,r]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${r})`}toArray(){const{r:t,g:e,b:i,a:r}=this;return 0===r?[0,0,0,0]:[255*t/r,255*e/r,255*i/r,r]}}dp.black=new dp(0,0,0,1),dp.white=new dp(1,1,1,1),dp.transparent=new dp(0,0,0,0),dp.red=new dp(1,0,0,1),dp.blue=new dp(0,0,1,1);class fp{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class gp{constructor(t,e,i,r,n){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n}}class yp{constructor(t){this.sections=t}static fromString(t){return new yp([new gp(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof yp?t:yp.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class mp{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new mp({name:t,available:!1}):null}serialize(){return["image",this.name]}}function vp(t,e,i,r){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`}function _p(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 dp)return!0;if(t instanceof fp)return!0;if(t instanceof yp)return!0;if(t instanceof mp)return!0;if(Array.isArray(t)){for(const e of t)if(!_p(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!_p(t[e]))return!1;return!0}return!1}function xp(t){if(null===t)return Hc;if("string"==typeof t)return Jc;if("boolean"==typeof t)return Qc;if("number"==typeof t)return $c;if(t instanceof dp)return tp;if(t instanceof fp)return rp;if(t instanceof yp)return np;if(t instanceof mp)return op;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=xp(e);if(i){if(i===t)continue;i=ip;break}i=t}return ap(i||ip,e)}return ep}function bp(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof dp||t instanceof yp||t instanceof mp?t.toString():JSON.stringify(t)}class wp{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!_p(t[1]))return e.error("invalid value");const i=t[1];let r=xp(i);const n=e.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new wp(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof dp?["rgba"].concat(this.value.toArray()):this.value instanceof yp?this.value.serialize():this.value}}class Sp{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Cp={string:Jc,number:$c,boolean:Qc,object:ep};class Tp{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,r=1;const n=t[0];if("array"===n){let n,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in Cp)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=Cp[i],r++}else n=ip;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],r++}i=ap(n,o)}else i=Cp[n];const o=[];for(;r<t.length;r++){const i=e.parse(t[r],r,ip);if(!i)return null;o.push(i)}return new Tp(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!up(this.type,xp(i)))return i;if(e===this.args.length-1)throw new Sp(`Expected value to be of type ${sp(this.type)}, but found ${sp(xp(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map(t=>t.serialize()))}}class Ep{constructor(t){this.type=np,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const r=[];let n=!1;for(let i=1;i<=t.length-1;++i){const o=t[i];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,$c),!t))return null;let i=null;if(o["text-font"]&&(i=e.parse(o["text-font"],1,ap(Jc)),!i))return null;let a=null;if(o["text-color"]&&(a=e.parse(o["text-color"],1,tp),!a))return null;const s=r[r.length-1];s.scale=t,s.font=i,s.textColor=a}else{const o=e.parse(t[i],1,ip);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:o,scale:null,font:null,textColor:null})}}return new Ep(r)}evaluate(t){return new yp(this.sections.map(e=>{const i=e.content.evaluate(t);return xp(i)===op?new gp("",i,null,null,null):new gp(bp(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class kp{constructor(t){this.type=op,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Jc);return i?new kp(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=mp.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Rp={"to-boolean":Qc,"to-color":tp,"to-number":$c,"to-string":Jc};class Op{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const r=Rp[i],n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],i,ip);if(!r)return null;n.push(r)}return new Op(r,n)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const r of this.args){if(e=r.evaluate(t),i=null,e instanceof dp)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:vp(e[0],e[1],e[2],e[3]),!i))return new dp(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Sp(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new Sp(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?yp.fromString(bp(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?mp.fromString(bp(this.args[0].evaluate(t))):bp(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Ep([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new kp(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(e=>{t.push(e.serialize())}),t}}const Pp=["Unknown","Point","LineString","Polygon"];class Fp{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Pp[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=dp.parse(t)),e}}class Ip{constructor(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,e){const i=t[0],r=Ip.definitions[i];if(!r)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let s=null;for(const[r,o]of a){s=new id(e.registry,e.path,null,e.scope);const a=[];let l=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(r)?r[e-1]:r.type,o=s.parse(i,1+a.length,n);if(!o){l=!0;break}a.push(o)}if(!l)if(Array.isArray(r)&&r.length!==a.length)s.error(`Expected ${r.length} arguments, but found ${a.length} instead.`);else{for(let t=0;t<a.length;t++){const e=Array.isArray(r)?r[t]:r.type,i=a[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new Ip(i,n,o,a)}}if(1===a.length)e.errors.push(...s.errors);else{const i=(a.length?a:o).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(sp).join(", ")})`:`(${sp(e.type)}...)`;var e}).join(" | "),r=[];for(let i=1;i<t.length;i++){const n=e.parse(t[i],1+r.length);if(!n)return null;r.push(sp(n.type))}e.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`)}return null}static register(t,e){Ip.definitions=e;for(const i in e)t[i]=Ip}}class Mp{constructor(t,e,i){this.type=rp,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Qc);if(!r)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Qc);if(!n)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Jc),!o)?null:new Mp(r,n,o)}evaluate(t){return new fp(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function Ap(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function jp(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Lp(t,e){const i=(180+t[0])/360;const r=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(r*o*8192)]}function Dp(t,e,i){const r=t[0]-e[0],n=t[1]-e[1],o=t[0]-i[0],a=t[1]-i[1];return r*a-o*n==0&&r*o<=0&&n*a<=0}function zp(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function Gp(t,e){let i=!1;for(let r=0,n=e.length;r<n;r++){const n=e[r];for(let e=0,r=n.length;e<r-1;e++){if(Dp(t,n[e],n[e+1]))return!1;zp(t,n[e],n[e+1])&&(i=!i)}}return i}function Np(t,e){for(let i=0;i<e.length;i++)if(Gp(t,e[i]))return!0;return!1}function Bp(t,e,i,r){const n=t[0]-i[0],o=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=r[0]-i[0],u=r[1]-i[1],h=n*u-l*o,c=a*u-l*s;return h>0&&c<0||h<0&&c>0}function Up(t,e,i,r){const n=[e[0]-t[0],e[1]-t[1]],o=[r[0]-i[0],r[1]-i[1]];return 0!=(a=o)[0]*(s=n)[1]-a[1]*s[0]&&!(!Bp(t,e,i,r)||!Bp(i,r,t,e));var a,s}function Vp(t,e,i){for(const r of i)for(let i=0;i<r.length-1;++i)if(Up(t,e,r[i],r[i+1]))return!0;return!1}function Wp(t,e){for(let i=0;i<t.length;++i)if(!Gp(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(Vp(t[i],t[i+1],e))return!1;return!0}function qp(t,e){for(let i=0;i<e.length;i++)if(Wp(t,e[i]))return!0;return!1}function Xp(t,e,i){const r=[];for(let n=0;n<t.length;n++){const o=[];for(let r=0;r<t[n].length;r++){const a=Lp(t[n][r],i);Ap(e,a),o.push(a)}r.push(o)}return r}function Kp(t,e,i){const r=[];for(let n=0;n<t.length;n++){const o=Xp(t[n],e,i);r.push(o)}return r}function Yp(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const e=.5*r;let n=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===n&&(n=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=n}Ap(e,t)}function Zp(t,e,i,r){const n=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[];for(const r of t)for(const t of r){const r=[t.x+o[0],t.y+o[1]];Yp(r,e,i,n),a.push(r)}return a}function Hp(t,e,i,r){const n=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[];for(const i of t){const t=[];for(const r of i){const i=[r.x+o[0],r.y+o[1]];Ap(e,i),t.push(i)}a.push(t)}if(e[2]-e[0]<=n/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const r of t)Yp(r,e,i,n)}var s;return a}class $p{constructor(t,e){this.type=Qc,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(_p(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new $p(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new $p(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new $p(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const o=Xp(e.coordinates,r,n),a=Zp(t.geometry(),i,r,n);if(!jp(i,r))return!1;for(const t of a)if(!Gp(t,o))return!1}if("MultiPolygon"===e.type){const o=Kp(e.coordinates,r,n),a=Zp(t.geometry(),i,r,n);if(!jp(i,r))return!1;for(const t of a)if(!Np(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const o=Xp(e.coordinates,r,n),a=Hp(t.geometry(),i,r,n);if(!jp(i,r))return!1;for(const t of a)if(!Wp(t,o))return!1}if("MultiPolygon"===e.type){const o=Kp(e.coordinates,r,n),a=Hp(t.geometry(),i,r,n);if(!jp(i,r))return!1;for(const t of a)if(!qp(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Jp(t){if(t instanceof Ip){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof $p)return!1;let e=!0;return t.eachChild(t=>{e&&!Jp(t)&&(e=!1)}),e}function Qp(t){if(t instanceof Ip&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!Qp(t)&&(e=!1)}),e}function td(t,e){if(t instanceof Ip&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!td(t,e)&&(i=!1)}),i}class ed{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new ed(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class id{constructor(t,e=[],i,r=new Zc,n=[]){this.registry=t,this.path=e,this.key=e.map(t=>`[${t}]`).join(""),this.scope=r,this.errors=n,this.expectedType=i}parse(t,e,i,r,n={}){return e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new Tp(e,[t]):"coerce"===i?new Op(e,[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", []].');const 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;const n=this.registry[r];if(n){let r=n.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof wp)&&"resolvedImage"!==r.type.kind&&function t(e){if(e instanceof ed)return t(e.boundExpression);if(e instanceof Ip&&"error"===e.name)return!1;if(e instanceof Mp)return!1;if(e instanceof $p)return!1;const i=e instanceof Op||e instanceof Tp;let r=!0;if(e.eachChild(e=>{r=i?r&&t(e):r&&e instanceof wp}),!r)return!1;return Jp(e)&&td(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"])}(r)){const t=new Fp;try{r=new wp(r.type,r.evaluate(t))}catch(t){return this.error(t.message),null}}return r}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.`)}concat(t,e,i){const r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new id(this.registry,r,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new Yc(i,t))}checkSubtype(t,e){const i=up(t,e);return i&&this.error(i),i}}function rd(t,e){const i=t.length-1;let r,n,o=0,a=i,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),r=t[s],n=t[s+1],r<=e){if(s===i||e<n)return s;o=s+1}else{if(!(r>e))throw new Sp("Input is not a number.");a=s-1}return 0}class nd{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,$c);if(!i)return null;const r=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let i=1;i<t.length;i+=2){const o=1===i?-1/0:t[i],a=t[i+1],s=i,l=i+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(r.length&&r[r.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=e.parse(a,l,n);if(!u)return null;n=n||u.type,r.push([o,u])}return new nd(n,i,r)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);return i[rd(e,r)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var od=ad;function ad(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}function sd(t,e,i){return t*(1-i)+e*i}ad.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},ad.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},ad.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},ad.prototype.solveCurveX=function(t,e){var i,r,n,o,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=o/s}if((n=t)<(i=0))return i;if(n>(r=1))return r;for(;i<r;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;t>o?i=n:r=n,n=.5*(r-i)+i}return n},ad.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var ld=Object.freeze({__proto__:null,number:sd,color:function(t,e,i){return new dp(sd(t.r,e.r,i),sd(t.g,e.g,i),sd(t.b,e.b,i),sd(t.a,e.a,i))},array:function(t,e,i){return t.map((t,r)=>sd(t,e[r],i))}});const ud=6/29,hd=3*ud*ud,cd=Math.PI/180,pd=180/Math.PI;function dd(t){return t>.008856451679035631?Math.pow(t,1/3):t/hd+4/29}function fd(t){return t>ud?t*t*t:hd*(t-4/29)}function gd(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function yd(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function md(t){const e=yd(t.r),i=yd(t.g),r=yd(t.b),n=dd((.4124564*e+.3575761*i+.1804375*r)/.95047),o=dd((.2126729*e+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-dd((.0193339*e+.119192*i+.9503041*r)/1.08883)),alpha:t.a}}function vd(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*fd(e),i=.95047*fd(i),r=1.08883*fd(r),new dp(gd(3.2404542*i-1.5371385*e-.4985314*r),gd(-.969266*i+1.8760108*e+.041556*r),gd(.0556434*i-.2040259*e+1.0572252*r),t.alpha)}function _d(t,e,i){const r=e-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}const xd={forward:md,reverse:vd,interpolate:function(t,e,i){return{l:sd(t.l,e.l,i),a:sd(t.a,e.a,i),b:sd(t.b,e.b,i),alpha:sd(t.alpha,e.alpha,i)}}},bd={forward:function(t){const{l:e,a:i,b:r}=md(t),n=Math.atan2(r,i)*pd;return{h:n<0?n+360:n,c:Math.sqrt(i*i+r*r),l:e,alpha:t.a}},reverse:function(t){const e=t.h*cd,i=t.c;return vd({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:_d(t.h,e.h,i),c:sd(t.c,e.c,i),l:sd(t.l,e.l,i),alpha:sd(t.alpha,e.alpha,i)}}};class wd{constructor(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,r){let n=0;if("exponential"===t.name)n=Sd(e,t.base,i,r);else if("linear"===t.name)n=Sd(e,1,i,r);else if("cubic-bezier"===t.name){const o=t.controlPoints;n=new od(o[0],o[1],o[2],o[3]).solve(Sd(e,1,i,r))}return n}static parse(t,e){let[i,r,n,...o]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);{const t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,$c),!n)return null;const a=[];let s=null;"interpolate-hcl"===i||"interpolate-lab"===i?s=tp:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t<o.length;t+=2){const i=o[t],r=o[t+1],n=t+3,l=t+4;if("number"!=typeof i)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(a.length&&a[a.length-1][0]>=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const u=e.parse(r,l,s);if(!u)return null;s=s||u.type,a.push([i,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new wd(s,i,r,n,a):e.error(`Type ${sp(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);const o=rd(e,r),a=e[o],s=e[o+1],l=wd.interpolationFactor(this.interpolation,r,a,s),u=i[o].evaluate(t),h=i[o+1].evaluate(t);return"interpolate"===this.operator?ld[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?bd.reverse(bd.interpolate(bd.forward(u),bd.forward(h),l)):xd.reverse(xd.interpolate(xd.forward(u),xd.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function Sd(t,e,i,r){const n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}class Cd{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const r=e.expectedType;r&&"value"!==r.kind&&(i=r);const n=[];for(const r of t.slice(1)){const t=e.parse(r,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}const o=r&&n.some(t=>up(r,t.type));return new Cd(o?ip:i,n)}evaluate(t){let e,i=null,r=0;for(const n of this.args)if(r++,i=n.evaluate(t),i&&i instanceof mp&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class Td{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return r?new Td(i,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class Ed{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,$c),r=e.parse(t[2],2,ap(e.expectedType||ip));if(!i||!r)return null;const n=r.type;return new Ed(n.itemType,i,r)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Sp(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new Sp(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new Sp(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class kd{constructor(t,e){this.type=Qc,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ip),r=e.parse(t[2],2,ip);return i&&r?hp(i.type,[Qc,Jc,$c,Hc,ip])?new kd(i,r):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${sp(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!cp(e,["boolean","string","number","null"]))throw new Sp(`Expected first argument to be of type boolean, string, number or null, but found ${sp(xp(e))} instead.`);if(!cp(i,["string","array"]))throw new Sp(`Expected second argument to be of type array or string, but found ${sp(xp(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Rd{constructor(t,e,i){this.type=$c,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ip),r=e.parse(t[2],2,ip);if(!i||!r)return null;if(!hp(i.type,[Qc,Jc,$c,Hc,ip]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${sp(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,$c);return n?new Rd(i,r,n):null}return new Rd(i,r)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!cp(e,["boolean","string","number","null"]))throw new Sp(`Expected first argument to be of type boolean, string, number or null, but found ${sp(xp(e))} instead.`);if(!cp(i,["string","array"]))throw new Sp(`Expected second argument to be of type array or string, but found ${sp(xp(i))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(t);return i.indexOf(e,r)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Od{constructor(t,e,i,r,n,o){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n={},o=[];for(let a=2;a<t.length-1;a+=2){let s=t[a];const l=t[a+1];Array.isArray(s)||(s=[s]);const u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,xp(t)))return null}else i=xp(t);if(void 0!==n[String(t)])return u.error("Branch labels must be unique.");n[String(t)]=o.length}const h=e.parse(l,a,r);if(!h)return null;r=r||h.type,o.push(h)}const a=e.parse(t[1],1,ip);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,r);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new Od(i,r,a,n,o,s):null}evaluate(t){const e=this.input.evaluate(t);return(xp(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],r={};for(const t of e){const e=r[this.cases[t]];void 0===e?(r[this.cases[t]]=i.length,i.push([this.cases[t],[t]])):i[e][1].push(t)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,r]of i)1===r.length?t.push(n(r[0])):t.push(r.map(n)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class Pd{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const r=[];for(let n=1;n<t.length-1;n+=2){const o=e.parse(t[n],n,Qc);if(!o)return null;const a=e.parse(t[n+1],n+1,i);if(!a)return null;r.push([o,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);return n?new Pd(i,r,n):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,e])=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class Fd{constructor(t,e,i,r){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ip),r=e.parse(t[2],2,$c);if(!i||!r)return null;if(!hp(i.type,[ap(ip),Jc,ip]))return e.error(`Expected first argument to be of type array or string, but found ${sp(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,$c);return n?new Fd(i.type,i,r,n):null}return new Fd(i.type,i,r)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!cp(e,["string","array"]))throw new Sp(`Expected first argument to be of type array or string, but found ${sp(xp(e))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(t);return e.slice(i,r)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Id(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Md(t,e,i,r){return 0===r.compare(e,i)}function Ad(t,e,i){const r="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=Qc,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,ip);if(!o)return null;if(!Id(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${sp(o.type)}'.`);let a=e.parse(t[2],2,ip);if(!a)return null;if(!Id(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${sp(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${sp(o.type)}' and '${sp(a.type)}'.`);r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Tp(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Tp(o.type,[a])));let s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,rp),!s)return null}return new n(o,a,s)}evaluate(n){const o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){const e=xp(o),i=xp(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new Sp(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=xp(o),i=xp(a);if("string"!==t.kind||"string"!==i.kind)return e(n,o,a)}return this.collator?i(n,o,a,this.collator.evaluate(n)):e(n,o,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild(t=>{e.push(t.serialize())}),e}}}const jd=Ad("==",(function(t,e,i){return e===i}),Md),Ld=Ad("!=",(function(t,e,i){return e!==i}),(function(t,e,i,r){return!Md(0,e,i,r)})),Dd=Ad("<",(function(t,e,i){return e<i}),(function(t,e,i,r){return r.compare(e,i)<0})),zd=Ad(">",(function(t,e,i){return e>i}),(function(t,e,i,r){return r.compare(e,i)>0})),Gd=Ad("<=",(function(t,e,i){return e<=i}),(function(t,e,i,r){return r.compare(e,i)<=0})),Nd=Ad(">=",(function(t,e,i){return e>=i}),(function(t,e,i,r){return r.compare(e,i)>=0}));class Bd{constructor(t,e,i,r,n){this.type=Jc,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,$c);if(!i)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let n=null;if(r.locale&&(n=e.parse(r.locale,1,Jc),!n))return null;let o=null;if(r.currency&&(o=e.parse(r.currency,1,Jc),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=e.parse(r["min-fraction-digits"],1,$c),!a))return null;let s=null;return r["max-fraction-digits"]&&(s=e.parse(r["max-fraction-digits"],1,$c),!s)?null:new Bd(i,n,o,a,s)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class Ud{constructor(t){this.type=$c,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${sp(i.type)} instead.`):new Ud(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Sp(`Expected value to be of type string or array, but found ${sp(xp(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(e=>{t.push(e.serialize())}),t}}const Vd={"==":jd,"!=":Ld,">":zd,"<":Dd,">=":Nd,"<=":Gd,array:Tp,at:Ed,boolean:Tp,case:Pd,coalesce:Cd,collator:Mp,format:Ep,image:kp,in:kd,"index-of":Rd,interpolate:wd,"interpolate-hcl":wd,"interpolate-lab":wd,length:Ud,let:Td,literal:wp,match:Od,number:Tp,"number-format":Bd,object:Tp,slice:Fd,step:nd,string:Tp,"to-boolean":Op,"to-color":Op,"to-number":Op,"to-string":Op,var:ed,within:$p};function Wd(t,[e,i,r,n]){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);const o=n?n.evaluate(t):1,a=vp(e,i,r,o);if(a)throw new Sp(a);return new dp(e/255*o,i/255*o,r/255*o,o)}function qd(t,e){return t in e}function Xd(t,e){const i=e[t];return void 0===i?null:i}function Kd(t){return{type:t}}function Yd(t){return{result:"success",value:t}}function Zd(t){return{result:"error",value:t}}function Hd(t){return!!t.expression&&t.expression.interpolated}function $d(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Ip.register(Vd,{error:[{kind:"error"},[Jc],(t,[e])=>{throw new Sp(e.evaluate(t))}],typeof:[Jc,[ip],(t,[e])=>sp(xp(e.evaluate(t)))],"to-rgba":[ap($c,4),[tp],(t,[e])=>e.evaluate(t).toArray()],rgb:[tp,[$c,$c,$c],Wd],rgba:[tp,[$c,$c,$c,$c],Wd],has:{type:Qc,overloads:[[[Jc],(t,[e])=>qd(e.evaluate(t),t.properties())],[[Jc,ep],(t,[e,i])=>qd(e.evaluate(t),i.evaluate(t))]]},get:{type:ip,overloads:[[[Jc],(t,[e])=>Xd(e.evaluate(t),t.properties())],[[Jc,ep],(t,[e,i])=>Xd(e.evaluate(t),i.evaluate(t))]]},"feature-state":[ip,[Jc],(t,[e])=>Xd(e.evaluate(t),t.featureState||{})],properties:[ep,[],t=>t.properties()],"geometry-type":[Jc,[],t=>t.geometryType()],id:[ip,[],t=>t.id()],zoom:[$c,[],t=>t.globals.zoom],"heatmap-density":[$c,[],t=>t.globals.heatmapDensity||0],"line-progress":[$c,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[$c,[],t=>t.globals.skyRadialProgress||0],accumulated:[ip,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[$c,Kd($c),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[$c,Kd($c),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:$c,overloads:[[[$c,$c],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[$c],(t,[e])=>-e.evaluate(t)]]},"/":[$c,[$c,$c],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[$c,[$c,$c],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[$c,[],()=>Math.LN2],pi:[$c,[],()=>Math.PI],e:[$c,[],()=>Math.E],"^":[$c,[$c,$c],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[$c,[$c],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[$c,[$c],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[$c,[$c],(t,[e])=>Math.log(e.evaluate(t))],log2:[$c,[$c],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[$c,[$c],(t,[e])=>Math.sin(e.evaluate(t))],cos:[$c,[$c],(t,[e])=>Math.cos(e.evaluate(t))],tan:[$c,[$c],(t,[e])=>Math.tan(e.evaluate(t))],asin:[$c,[$c],(t,[e])=>Math.asin(e.evaluate(t))],acos:[$c,[$c],(t,[e])=>Math.acos(e.evaluate(t))],atan:[$c,[$c],(t,[e])=>Math.atan(e.evaluate(t))],min:[$c,Kd($c),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[$c,Kd($c),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[$c,[$c],(t,[e])=>Math.abs(e.evaluate(t))],round:[$c,[$c],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[$c,[$c],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[$c,[$c],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Qc,[Jc,ip],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Qc,[ip],(t,[e])=>t.id()===e.value],"filter-type-==":[Qc,[Jc],(t,[e])=>t.geometryType()===e.value],"filter-<":[Qc,[Jc,ip],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<n}],"filter-id-<":[Qc,[ip],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[Qc,[Jc,ip],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>n}],"filter-id->":[Qc,[ip],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>r}],"filter-<=":[Qc,[Jc,ip],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<=n}],"filter-id-<=":[Qc,[ip],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[Qc,[Jc,ip],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>=n}],"filter-id->=":[Qc,[ip],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[Qc,[ip],(t,[e])=>e.value in t.properties()],"filter-has-id":[Qc,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Qc,[ap(Jc)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Qc,[ap(ip)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Qc,[Jc,ap(ip)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Qc,[Jc,ap(ip)],(t,[e,i])=>function(t,e,i,r){for(;i<=r;){const n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Qc,overloads:[[[Qc,Qc],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Kd(Qc),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Qc,overloads:[[[Qc,Qc],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Kd(Qc),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Qc,[Qc],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Qc,[Jc],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Jc,[Jc],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Jc,[Jc],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Jc,Kd(ip),(t,e)=>e.map(e=>bp(e.evaluate(t))).join("")],"resolved-locale":[Jc,[rp],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Jd{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new Fp,this._defaultValue=e?"color"===(i=e).type&&$d(i.default)?new dp(0,0,0,0):"color"===i.type?dp.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,r,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Sp(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function Qd(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Vd}function tf(t,e){const i=new id(Vd,[],e?function(t){const e={color:tp,string:Jc,number:$c,enum:Jc,boolean:Qc,formatted:np,resolvedImage:op};if("array"===t.type)return ap(e[t.value]||ip,t.length);return e[t.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?Yd(new Jd(r,e)):Zd(i.errors)}class ef{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Qp(e.expression)}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)}evaluate(t,e,i,r,n,o){return this._styleExpression.evaluate(t,e,i,r,n,o)}}class rf{constructor(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Qp(e.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)}evaluate(t,e,i,r,n,o){return this._styleExpression.evaluate(t,e,i,r,n,o)}interpolationFactor(t,e,i){return this.interpolationType?wd.interpolationFactor(this.interpolationType,t,e,i):0}}function nf(t,e){if("error"===(t=tf(t,e)).result)return t;const i=t.value.expression,r=Jp(i);if(!r&&("data-driven"!==(n=e)["property-type"]&&"cross-faded-data-driven"!==n["property-type"]))return Zd([new Yc("","data expressions not supported")]);var n;const o=td(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Zd([new Yc("","zoom expressions not supported")]);const a=function t(e){let i=null;if(e instanceof Td)i=t(e.result);else if(e instanceof Cd){for(const r of e.args)if(i=t(r),i)break}else(e instanceof nd||e instanceof wd)&&e.input instanceof Ip&&"zoom"===e.input.name&&(i=e);if(i instanceof Yc)return i;return e.eachChild(e=>{const r=t(e);r instanceof Yc?i=r:!i&&r?i=new Yc("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&r&&i!==r&&(i=new Yc("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}(i);if(!a&&!o)return Zd([new Yc("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Yc)return Zd([a]);if(a instanceof wd&&!Hd(e))return Zd([new Yc("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Yd(new ef(r?"constant":"source",t.value));const s=a instanceof wd?a.interpolation:void 0;return Yd(new rf(r?"camera":"composite",t.value,a.labels,s))}function of(t){return"object"==typeof t?["literal",t]:t}function af(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function sf(t,e){const i=of((r=t.default,n=e.default,void 0!==r?r:void 0!==n?n:void 0));var r,n;return void 0===i&&"resolvedImage"===e.type?"":i}function lf(t,e,i){const r=cf(t,e),n=["get",t.property];if("categorical"===r&&"boolean"==typeof i[0][0]){const r=["case"];for(const t of i)r.push(["==",n,t[0]],t[1]);return r.push(sf(t,e)),r}if("categorical"===r){const r=["match",n];for(const t of i)hf(r,t[0],t[1],!1);return r.push(sf(t,e)),r}if("interval"===r){const e=["step",["number",n]];for(const t of i)hf(e,t[0],t[1],!0);return uf(e),void 0===t.default?e:["case",["==",["typeof",n],"number"],e,of(t.default)]}if("exponential"===r){const e=void 0!==t.base?t.base:1,r=[af(t),1===e?["linear"]:["exponential",e],["number",n]];for(const t of i)hf(r,t[0],t[1],!1);return void 0===t.default?r:["case",["==",["typeof",n],"number"],r,of(t.default)]}throw new Error("Unknown property function type "+r)}function uf(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function hf(t,e,i,r){t.length>3&&e===t[t.length-2]||(r&&2===t.length||t.push(e),t.push(i))}function cf(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function pf(t){const e=["concat"],i=/{([^{}]+)}/g;let r=0;for(let n=i.exec(t);null!==n;n=i.exec(t)){const o=t.slice(r,i.lastIndex-n[0].length);r=i.lastIndex,o.length>0&&e.push(o),e.push(["get",n[1]])}if(1===e.length)return t;if(r<t.length)e.push(t.slice(r));else if(2===e.length)return["to-string",e[1]];return e}function df(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(const e of t.slice(1))if(!df(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const ff={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function gf(t){if(null==t)return{filter:()=>!0,needGeometry:!1};df(t)||(t=mf(t));const e=tf(t,ff);if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,i,r)=>e.value.evaluate(t,i,{},r),needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let i=1;i<e.length;i++)if(t(e[i]))return!0;return!1}(t)}}function yf(t,e){return t<e?-1:t>e?1:0}function mf(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?vf(t[1],t[2],"=="):"!="===e?bf(vf(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?vf(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(mf))):"all"===e?["all"].concat(t.slice(1).map(mf)):"none"===e?["all"].concat(t.slice(1).map(mf).map(bf)):"in"===e?_f(t[1],t.slice(2)):"!in"===e?bf(_f(t[1],t.slice(2))):"has"===e?xf(t[1]):"!has"===e?bf(xf(t[1])):"within"!==e||t}function vf(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function _f(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",t,["literal",e.sort(yf)]]:["filter-in-small",t,["literal",e]]}}function xf(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function bf(t){return["!",t]}var wf=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Sf(t,e){const i={};for(const e in t)"ref"!==e&&(i[e]=t[e]);return wf.forEach(t=>{t in e&&(i[t]=e[t])}),i}Sc((function(t,e){var i=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,12],i=[1,13],r=[1,9],n=[1,10],o=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,r,n,o,a){var s=o.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[s-2],o[s]];break;case 16:this.$={},this.$[o[s][0]]=o[s][1];break;case 17:this.$=o[s-2],o[s-2][o[s][0]]=o[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[s]];break;case 21:this.$=o[s-2],o[s-2].push(o[s])}},table:[{3:5,4:e,5:6,6:i,7:3,8:r,9:4,10:n,11:o,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:r,9:4,10:n,11:o,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:r,9:4,10:n,11:o,13:30,15:7,16:8,17:a,23:s},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:r,9:4,10:n,11:o,13:31,15:7,16:8,17:a,23:s},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],r=[null],n=[],o=this.table,a="",s=0,l=0,u=2,h=1,c=n.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc;n.push(g);var y=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,x,b,w,S,C,T,E={};;){if(_=i[i.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==v&&(v=m()),x=o[_]&&o[_][v]),void 0===x||!x.length||!x[0]){var k="";for(w in T=[],o[_])this.terminals_[w]&&w>u&&T.push("'"+this.terminals_[w]+"'");k=p.showPosition?"Parse error on line "+(s+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(s+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:g,expected:T})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:i.push(v),r.push(p.yytext),n.push(p.yylloc),i.push(x[1]),v=null,l=p.yyleng,a=p.yytext,s=p.yylineno,g=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=r[r.length-S],E._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(E._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[a,l,s,d.yy,x[1],r,n].concat(c))))return b;S&&(i=i.slice(0,-1*S*2),r=r.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[x[1]][0]),r.push(E.$),n.push(E._$),C=o[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,r,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in n)this[o]=n[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),o=0;o<n.length;o++)if((i=this._input.match(this.rules[n[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,r=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,r){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();void 0!==Cc&&(e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)})}));const Cf=Qd,Tf=nf,Ef=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const r=["color"===e.type?"to-color":e.type,i,of(t.default)];return"array"===e.type&&r.splice(1,0,e.value,e.length||null),r}}(t,e);const r=i&&"object"==typeof i[0][0],n=r||void 0!==t.property,o=r||!n;return i=i.map(t=>!n&&e.tokens&&"string"==typeof t[1]?[t[0],pf(t[1])]:[t[0],of(t[1])]),r?function(t,e,i){const r={},n={},o=[];for(let e=0;e<i.length;e++){const a=i[e],s=a[0].zoom;void 0===r[s]&&(r[s]={zoom:s,type:t.type,property:t.property,default:t.default},n[s]=[],o.push(s)),n[s].push([a[0].value,a[1]])}if("exponential"===cf({},e)){const i=[af(t),["linear"],["zoom"]];for(const t of o){const o=lf(r[t],e,n[t]);hf(i,t,o,!1)}return i}{const t=["step",["zoom"]];for(const i of o){const o=lf(r[i],e,n[i]);hf(t,i,o,!0)}return uf(t),t}}(t,e,i):o?function(t,e,i,r=["zoom"]){const n=cf(t,e);let o,a=!1;if("interval"===n)o=["step",r],a=!0;else{if("exponential"!==n)throw new Error(`Unknown zoom function type "${n}"`);{const e=void 0!==t.base?t.base:1;o=[af(t),1===e?["linear"]:["exponential",e],r]}}for(const t of i)hf(o,t[0],t[1],a);return uf(o),o}(t,e,i):lf(t,e,i)},kf=$d;function Rf(t){return t*Math.PI/180}var Of=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Pf(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var Ff,If=Array(256).join(" ");function Mf(t,e){if(e>=.05){for(var i="",r=t.split("\n"),n=If.slice(0,Math.round(e/.1)),o=0,a=r.length;o<a;++o)o>0&&(i+="\n"),i+=r[o].split("").join(n);return i}return t}function Af(){return Ff||(Ff=Pf(1,1).getContext("2d")),Ff}function jf(t,e){return Af().measureText(t).width+(t.length-1)*e}var Lf={};fn&&N(fn,k,(function(){Lf={}}));var Df,zf,Gf=kf,Nf=Ef,Bf=Cf,Uf=Tf,Vf={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Wf={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},qf={},Xf={zoom:0},Kf={};function Yf(t,e,i,r,n){var o=t.id;Kf[o]||(Kf[o]={});var a=Kf[o];if(!a[i]){var s=(t[e]||qf)[i],l=bc[e+"_"+t.type][i];void 0===s&&(s=l.default);var u=Bf(s);if(!u&&Gf(s)&&(s=Nf(s,l),u=!0),u){var h=function(t,e){var i=Uf(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(s,l);a[i]=h.evaluate.bind(h)}else"color"==l.type&&(s=dp.parse(s)),a[i]=function(){return s}}return Xf.zoom=r,a[i](Xf,n)}var Zf={};function Hf(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var $f=/^([^]*)\{(.*)\}([^]*)$/;function Jf(t,e){var i;do{if(i=t.match($f)){var r=e[i[2]]||"";t=i[1]+r+i[3]}}while(i);return t}function Qf(t,e,i,r,n,o,a){if(void 0===r&&(r=Of),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(s=t.data.image,l=[s.width,s.height])}))}for(var c,p=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Sf(t[i],e[t[i].ref]));return t}(e.layers),d={},f=[],g=0,y=p.length;g<y;++g){var m=p[g],v=m.id;if("string"==typeof i&&m.source==i||-1!==i.indexOf(v)){var _=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var b=x.type;if("vector"!==b&&"geojson"!==b)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+b+'"')}var w=d[_];w||(w=d[_]=[]),w.push({layer:m,index:g}),f.push(v)}delete Kf[v],delete Zf[v]}var S=new Fr,C=new Tr,T={},E={},k=[],R=function(t,e){var i=t.getProperties(),o=d[i.layer];if(o){var u=r.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,r=e.length;i<r;++i){if(e[i]<t&&i+1<r){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}}return r-1}(e,r));for(var h=Vf[t.getGeometry().getType()],c={properties:i,type:h},p=-1,f=function(r,d){var f=o[r],g=f.layer,y=g.id,m=g.layout||qf,v=g.paint||qf;if("none"===m.visibility||"minzoom"in g&&u<g.minzoom||"maxzoom"in g&&u>=g.maxzoom)return"continue";var _=g.filter;if(!_||function(t,e,i,r){return t in Zf||(Zf[t]=gf(e).filter),Xf.zoom=r,Zf[t](Xf,i)}(y,_,c,u)){var x=void 0,b=void 0,w=void 0,R=void 0,O=void 0,P=void 0,F=f.index;if(3==h&&("fill"==g.type||"fill-extrusion"==g.type))if(b=Yf(g,"paint",g.type+"-opacity",u,c),g.type+"-pattern"in v){var I=Yf(g,"paint",g.type+"-pattern",u,c);if(I){var M="string"==typeof I?Jf(I,i):I.toString();if(s&&n&&n[M]){++p,(P=k[p])&&P.getFill()&&!P.getStroke()&&!P.getText()||(P=k[p]=new In({fill:new Tr})),w=P.getFill(),P.setZIndex(F);var A=E[lt=M+"."+b];if(!A)(ct=(ht=Pf((ut=n[M]).width,ut.height)).getContext("2d")).globalAlpha=b,ct.drawImage(s,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),A=ct.createPattern(ht,"repeat"),E[lt]=A;w.setColor(A)}}}else(x=Hf(Yf(g,"paint",g.type+"-color",u,c),b))&&(g.type+"-outline-color"in v&&(O=Hf(Yf(g,"paint",g.type+"-outline-color",u,c),b)),O||(O=x),++p,(P=k[p])&&P.getFill()&&P.getStroke()&&!P.getText()||(P=k[p]=new In({fill:new Tr,stroke:new Fr})),(w=P.getFill()).setColor(x),(R=P.getStroke()).setColor(O),R.setWidth(1),P.setZIndex(F));if(1!=h&&"line"==g.type){x=!("line-pattern"in v)&&"line-color"in v?Hf(Yf(g,"paint","line-color",u,c),Yf(g,"paint","line-opacity",u,c)):void 0;var j=Yf(g,"paint","line-width",u,c);x&&j>0&&(++p,(P=k[p])&&P.getStroke()&&!P.getFill()&&!P.getText()||(P=k[p]=new In({stroke:new Fr})),(R=P.getStroke()).setLineCap(Yf(g,"layout","line-cap",u,c)),R.setLineJoin(Yf(g,"layout","line-join",u,c)),R.setMiterLimit(Yf(g,"layout","line-miter-limit",u,c)),R.setColor(x),R.setWidth(j),R.setLineDash(v["line-dasharray"]?Yf(g,"paint","line-dasharray",u,c).map((function(t){return t*j})):null),P.setZIndex(F))}var L=!1,D=null,z=0,G=void 0,N=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var U=Yf(g,"layout","icon-image",u,c);if(U){G="string"==typeof U?Jf(U,i):U.toString();var V=void 0;if(s&&n&&n[G]){var W=Yf(g,"layout","icon-rotation-alignment",u,c);if(2==h){var q=t.getGeometry();if(q.getFlatMidpoint||q.getFlatMidpoints){var X=q.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var K="MultiLineString"===q.getType()?q.getFlatMidpoints():q.getFlatMidpoint();if(zf||(zf=new xc("Point",Df=[NaN,NaN],[],{},null)),V=zf,Df[0]=K[0],Df[1]=K[1],"line"===(Ft=Yf(g,"layout","symbol-placement",u,c))&&"map"===W)for(var Y=q.getStride(),Z=q.getFlatCoordinates(),H=0,$=Z.length-Y;H<$;H+=Y){var J=Z[H],Q=Z[H+1],tt=Z[H+Y],et=Z[H+Y+1],it=Math.min(J,tt),rt=Math.min(Q,et),nt=Math.max(J,tt),ot=Math.max(Q,et);if(K[0]>=it&&K[0]<=nt&&K[1]>=rt&&K[1]<=ot){z=Math.atan2(Q-et,tt-J);break}}}}}if(2!==h||V){var at=Yf(g,"layout","icon-size",u,c),st=void 0!==v["icon-color"]?Yf(g,"paint","icon-color",u,c):null;if(!st||0!==st.a){var lt=G+"."+at;if(null!==st&&(lt+="."+st),!(N=T[lt])){var ut=n[G];if(null!==st){var ht,ct;(ct=(ht=Pf(ut.width,ut.height)).getContext("2d")).drawImage(s,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var gt=st.a;0!==gt&&(pt.data[dt]=255*st.r/gt,pt.data[dt+1]=255*st.g/gt,pt.data[dt+2]=255*st.b/gt),pt.data[dt+3]=gt}ct.putImageData(pt,0,0),N=T[lt]=new Ya({img:ht,imgSize:[ht.width,ht.height],scale:at/ut.pixelRatio})}else N=T[lt]=new Ya({img:s,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===W,scale:at/ut.pixelRatio})}}N&&(++p,(P=k[p])&&P.getImage()&&!P.getFill()&&!P.getStroke()||(P=k[p]=new In),P.setGeometry(V),N.setRotation(z+Rf(Yf(g,"layout","icon-rotate",u,c))),N.setOpacity(Yf(g,"paint","icon-opacity",u,c)),N.setAnchor(Wf[Yf(g,"layout","icon-anchor",u,c)]),P.setImage(N),D=P.getText(),P.setText(void 0),P.setZIndex(F),L=!0,B=!1)}else B=!0}}}if(1==h&&"circle-radius"in v){++p,(P=k[p])&&P.getImage()&&!P.getFill()&&!P.getStroke()||(P=k[p]=new In);var yt=Yf(g,"paint","circle-radius",u,c),mt=Hf(Yf(g,"paint","circle-stroke-color",u,c),Yf(g,"paint","circle-stroke-opacity",u,c)),vt=Hf(Yf(g,"paint","circle-color",u,c),Yf(g,"paint","circle-opacity",u,c)),_t=Yf(g,"paint","circle-stroke-width",u,c),xt=yt+"."+mt+"."+vt+"."+_t;(N=T[xt])||(N=T[xt]=new Fn({radius:yt,stroke:mt&&_t>0?new Fr({width:_t,color:mt}):void 0,fill:vt?new Tr({color:vt}):void 0})),P.setImage(N),D=P.getText(),P.setText(void 0),P.setGeometry(void 0),P.setZIndex(F),L=!0}var bt=void 0;if("text-field"in m)bt=Jf(Yf(g,"layout","text-field",u,c).toString(),i).trim(),b=Yf(g,"paint","text-opacity",u,c);if(bt&&b&&!B){L||(++p,(P=k[p])&&P.getText()&&!P.getFill()&&!P.getStroke()||(P=k[p]=new In),P.setImage(void 0),P.setGeometry(void 0)),P.getText()||P.setText(D||new Gn({padding:[2,2,2,2]})),D=P.getText();var wt=Math.round(Yf(g,"layout","text-size",u,c)),St=Yf(g,"layout","text-font",u,c),Ct=Yf(g,"layout","text-line-height",u,c),Tt=vc(a?a(St):St,wt,Ct),Et=m["text-transform"];"uppercase"==Et?bt=bt.toUpperCase():"lowercase"==Et&&(bt=bt.toLowerCase());var kt=Yf(g,"layout","text-max-width",u,c),Rt=Yf(g,"layout","text-letter-spacing",u,c),Ot=2==h?Mf(bt,Rt):function t(e,i,r,n){if(-1!==e.indexOf("\n")){for(var o=e.split("\n"),a=[],s=0,l=o.length;s<l;++s)a.push(t(o[s],i,r,n));return a.join("\n")}var u=r+","+i+","+e+","+n,h=Lf[u];if(!h){var c=e.split(" ");if(c.length>1){var p=Af();p.font=i;var d=p.measureText("M").width*r,f="";for(a=[],s=0,l=c.length;s<l;++s){var g=c[s],y=f+(f?" ":"")+g;jf(y,n)<=d?f=y:(f&&a.push(f),f=g)}f&&a.push(f);for(s=0,l=a.length;s<l&&l>1;++s){var m=a[s];if(jf(m,n)<.35*d){var v=s>0?jf(a[s-1],n):1/0,_=s<l-1?jf(a[s+1],n):1/0;a.splice(s,1),l-=1,v<_?(a[s-1]+=" "+m,s-=1):a[s]=m+" "+a[s]}}for(s=0,l=a.length-1;s<l;++s){var x=a[s],b=a[s+1];if(jf(x,n)>.7*d&&jf(b,n)<.6*d){var w=x.split(" "),S=w.pop();jf(S,n)<.2*d&&(a[s]=w.join(" "),a[s+1]=S+" "+b),l-=1}}h=a.join("\n")}else h=e;h=Mf(h,n),Lf[u]=h}return h}(bt,Tt,kt,Rt);D.setText(Ot),D.setFont(Tt),D.setRotation(Rf(Yf(g,"layout","text-rotate",u,c)));var Pt=Yf(g,"layout","text-anchor",u,c),Ft=L||1==h?"point":Yf(g,"layout","symbol-placement",u,c);D.setPlacement(Ft);var It=Yf(g,"paint","text-halo-width",u,c),Mt=Yf(g,"layout","text-offset",u,c),At=Yf(g,"paint","text-translate",u,c),jt=0,Lt=0;if("point"==Ft){var Dt="center";-1!==Pt.indexOf("left")?(Dt="left",Lt=It):-1!==Pt.indexOf("right")&&(Dt="right",Lt=-It),D.setTextAlign(Dt);var zt=Yf(g,"layout","text-rotation-alignment",u,c);D.setRotateWithView("map"==zt)}else D.setMaxAngle(Rf(Yf(g,"layout","text-max-angle",u,c))*bt.length/Ot.length),D.setTextAlign(),D.setRotateWithView(!1);var Gt="middle";0==Pt.indexOf("bottom")?(Gt="bottom",jt=-It-.5*(Ct-1)*wt):0==Pt.indexOf("top")&&(Gt="top",jt=It+.5*(Ct-1)*wt),D.setTextBaseline(Gt),D.setOffsetX(Mt[0]*wt+Lt+At[0]),D.setOffsetY(Mt[1]*wt+jt+At[1]),C.setColor(Hf(Yf(g,"paint","text-color",u,c),b)),D.setFill(C);var Nt=Hf(Yf(g,"paint","text-halo-color",u,c),b);if(Nt){S.setColor(Nt),It*=2;var Bt=.5*wt;S.setWidth(It<=Bt?It:Bt),D.setStroke(S)}else D.setStroke(void 0);var Ut=Yf(g,"layout","text-padding",u,c),Vt=D.getPadding();Ut!==Vt[0]&&(Vt[0]=Vt[1]=Vt[2]=Vt[3]=Ut),P.setZIndex(F)}}},g=0,y=o.length;g<y;++g)f(g);return p>-1?(k.length=p+1,k):void 0}};return t.setStyle(R),t.set("mapbox-source",c),t.set("mapbox-layers",f),R}var tg="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function eg(t,e){return t(e={exports:{}},e.exports),e.exports}var ig=eg((function(t){(function(){var e;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return e},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},e=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(tg)})),rg=(ig.icon,ig.name,ig.title,ig.link,ig.getNames,ig.getLink,ig.normalizeName,[0,0,0]),ng=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,rt(function(t,e,i){var r=e||h;return t.every((function(e,n){if(0===n)return!0;var o=r(t[n-1],e);return!(o>0||i&&0===o)}))}(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(var i=0,r=this.resolutions_.length-1;i<r;++i)if(e){if(this.resolutions_[i]/this.resolutions_[i+1]!==e){e=void 0;break}}else e=this.resolutions_[i]/this.resolutions_[i+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,rt(this.origins_.length==this.resolutions_.length,20));var n=t.extent;void 0===n||this.origin_||this.origins_||(this.origin_=ve(n)),rt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,rt(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,rt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==n?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new lc(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(n){var r=this.getTileRangeForExtentAndZ(n,e);i.minX=Math.max(r.minX,i.minX),i.maxX=Math.min(r.maxX,i.maxX),i.minY=Math.max(r.minY,i.minY),i.maxY=Math.min(r.maxY,i.maxY)}return i}),this):n&&this.calculateTileRanges_(n)}return t.prototype.forEachTileCoord=function(t,e,i){for(var r=this.getTileRangeForExtentAndZ(t,e),n=r.minX,o=r.maxX;n<=o;++n)for(var a=r.minY,s=r.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,r){var n,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],o=t[2]):a=this.getTileCoordExtent(t,r);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?uc(n=Math.floor(n/2),n,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],n=2*t[2];return uc(r,r+1,n,n+1,e)}var o=this.getTileCoordExtent(t,i);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeExtent=function(t,e,i){var r=this.getOrigin(t),n=this.getResolution(t),o=Gr(this.getTileSize(t),this.tmpSize_),a=r[0]+e.minX*o[0]*n,s=r[0]+(e.maxX+1)*o[0]*n;return Qt(a,r[1]+e.minY*o[1]*n,s,r[1]+(e.maxY+1)*o[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var r=rg;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,r);var n=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,r),uc(n,r[1],o,r[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=Gr(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*i,e[1]-(t[2]+.5)*r[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=Gr(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*n[0]*r,a=i[1]-(t[2]+1)*n[1]*r;return Qt(o,a,o+n[0]*r,a+n[1]*r,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,r,n){var o=this.getZForResolution(i),a=i/this.getResolution(o),s=this.getOrigin(o),l=Gr(this.getTileSize(o),this.tmpSize_),u=r?.5:0,h=r?.5:0,c=Math.floor((t-s[0])/i+u),p=Math.floor((s[1]-e)/i+h),d=a*c/l[0],f=a*p/l[1];return r?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),ec(o,d,f,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,r,n){var o=this.getOrigin(i),a=this.getResolution(i),s=Gr(this.getTileSize(i),this.tmpSize_),l=r?.5:0,u=r?.5:0,h=Math.floor((t-o[0])/a+l),c=Math.floor((o[1]-e)/a+u),p=h/s[0],d=c/s[1];return r?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),ec(i,p,d,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Te(p(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),r=this.minZoom;r<e;++r)i[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=i},t}();function og(t){var e=t.getDefaultTileGrid();return e||(e=lg(t),t.setDefaultTileGrid(e)),e}function ag(t){var e=t||{},i=e.extent||pi("EPSG:3857").getExtent(),r={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:sg(i,e.maxZoom,e.tileSize,e.maxResolution)};return new ng(r)}function sg(t,e,i,r){for(var n=void 0!==e?e:42,o=ye(t),a=xe(t),s=Gr(void 0!==i?i:256),l=r>0?r:Math.max(a/s[0],o/s[1]),u=n+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function lg(t,e,i,r){return function(t,e,i,r){var n=void 0!==r?r:Lt,o=sg(t,e,i);return new ng({extent:t,origin:fe(t,n),resolutions:o,tileSize:i})}(ug(t),e,i,r)}function ug(t){var e=(t=pi(t)).getExtent();if(!e){var i=180*Ct[_t]/t.getMetersPerUnit();e=Qt(-i,-i,i,i)}return e}var hg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cg=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return hg(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(U),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(N(this.geometries_[t],T,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,r){if(r<Kt(this.getExtent(),t,e))return r;for(var n=this.geometries_,o=0,a=n.length;o<a;++o)r=n[o].closestPointXY(t,e,i,r);return r},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)if(i[r].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){te(t);for(var e=this.geometries_,i=0,r=e.length;i<r;++i)oe(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return pg(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,r=e.length;i<r;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var i=[],r=this.geometries_,n=!1,o=0,a=r.length;o<a;++o){var s=r[o],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return mt},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,r=e.length;i<r;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)i[r].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var r=i;r||(r=de(this.getExtent()));for(var n=this.geometries_,o=0,a=n.length;o<a;++o)n[o].scale(t,e,r);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(pg(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,r=e.length;i<r;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)i[r].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Ii);function pg(t){for(var e=[],i=0,r=t.length;i<r;++i)e.push(t[i].clone());return e}var dg=function(){function t(){this.dataProjection=null,this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var r=e.dataProjection?pi(e.dataProjection):this.readProjection(t);e.extent&&r&&r.getUnits()===wt&&(r=pi(r)).setWorldExtent(e.extent),i={dataProjection:r,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return _({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return e()},t.prototype.readFeature=function(t,i){return e()},t.prototype.readFeatures=function(t,i){return e()},t.prototype.readGeometry=function(t,i){return e()},t.prototype.readProjection=function(t){return e()},t.prototype.writeFeature=function(t,i){return e()},t.prototype.writeFeatures=function(t,i){return e()},t.prototype.writeGeometry=function(t,i){return e()},t}();function fg(t,e,i){var r,n=i?pi(i.featureProjection):null,o=i?pi(i.dataProjection):null;if(r=n&&o&&!yi(n,o)?(e?t.clone():t).transform(e?n:o,e?o:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);r===t&&(r=t.clone()),r.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return r}var gg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yg=function(t){function i(){return t.call(this)||this}return gg(i,t),i.prototype.getType=function(){return _s},i.prototype.readFeature=function(t,e){return this.readFeatureFromObject(mg(t),this.getReadOptions(t,e))},i.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(mg(t),this.getReadOptions(t,e))},i.prototype.readFeatureFromObject=function(t,i){return e()},i.prototype.readFeaturesFromObject=function(t,i){return e()},i.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(mg(t),this.getReadOptions(t,e))},i.prototype.readGeometryFromObject=function(t,i){return e()},i.prototype.readProjection=function(t){return this.readProjectionFromObject(mg(t))},i.prototype.readProjectionFromObject=function(t){return e()},i.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},i.prototype.writeFeatureObject=function(t,i){return e()},i.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},i.prototype.writeFeaturesObject=function(t,i){return e()},i.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},i.prototype.writeGeometryObject=function(t,i){return e()},i}(dg);function mg(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var vg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_g=function(t){function e(e){var i=this,r=e||{};return(i=t.call(this)||this).dataProjection=pi(r.dataProjection?r.dataProjection:"EPSG:4326"),r.featureProjection&&(i.defaultFeatureProjection=pi(r.featureProjection)),i.geometryName_=r.geometryName,i.extractGeometryName_=r.extractGeometryName,i}return vg(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,r=xg((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new ot;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(r),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var r=t.features,n=0,o=r.length;n<o;++n)i.push(this.readFeatureFromObject(r[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return xg(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=pi(i.properties.name):"EPSG"===i.type?e=pi("EPSG:"+i.properties.code):rt(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},r=t.getId();if(void 0!==r&&(i.id=r),!t.hasProperties())return i;var n=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=bg(o,e),delete n[t.getGeometryName()]),w(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(this.writeFeatureObject(t[r],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return bg(t,this.adaptOptions(e))},e}(yg);function xg(t,e){if(!t)return null;var i;switch(t.type){case ht:i=function(t){return new ir(t.coordinates)}(t);break;case ct:i=function(t){return new Pr(t.coordinates)}(t);break;case dt:i=function(t){return new mr(t.coordinates)}(t);break;case ft:i=function(t){return new ih(t.coordinates)}(t);break;case gt:i=function(t){return new th(t.coordinates)}(t);break;case yt:i=function(t){return new oh(t.coordinates)}(t);break;case mt:i=function(t,e){var i=t.geometries.map((function(t){return xg(t,e)}));return new cg(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return fg(i,!1,e)}function bg(t,e){var i,r=(t=fg(t,!0,e)).getType();switch(r){case ht:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case ct:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case dt:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */(t,e);break;case ft:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case gt:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case yt:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case mt:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=_({},e);return delete i.featureProjection,bg(t,i)}))}}(t,e);break;case vt:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return i}var wg=function(t,e,i,r,n){var o,a,s=8*n-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=i?n-1:0,p=i?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=p,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=r;h>0;a=256*a+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=u}return(d?-1:1)*a*Math.pow(2,o-r)},Sg=function(t,e,i,r,n,o){var a,s,l,u=8*o-n-1,h=(1<<u)-1,c=h>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*l-1)*Math.pow(2,n),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;t[i+d]=255&s,d+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+d]=255&a,d+=f,a/=256,u-=8);t[i+d-f]|=128*g},Cg=Tg;function Tg(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Tg.Varint=0,Tg.Fixed64=1,Tg.Bytes=2,Tg.Fixed32=5;var Eg="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function kg(t){return t.type===Tg.Bytes?t.readVarint()+t.pos:t.pos+1}function Rg(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Og(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function Pg(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Fg(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Ig(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Mg(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ag(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function jg(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Lg(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Dg(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function zg(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Gg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ng(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Bg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Tg.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,o=this.pos;this.type=7&r,t(n,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Gg(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Bg(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Gg(this.buf,this.pos)+4294967296*Gg(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Gg(this.buf,this.pos)+4294967296*Bg(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=wg(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=wg(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,o=i.buf;if(n=o[i.pos++],r=(112&n)>>4,n<128)return Rg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<3,n<128)return Rg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<10,n<128)return Rg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<17,n<128)return Rg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<24,n<128)return Rg(t,r,e);if(n=o[i.pos++],r|=(1&n)<<31,n<128)return Rg(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(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,e=this.pos;return this.pos=t,t-e>=12&&Eg?function(t,e,i){return Eg.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var r="",n=e;for(;n<i;){var o,a,s,l=t[n],u=null,h=l>239?4:l>223?3:l>191?2:1;if(n+h>i)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[n+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),n+=h}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Tg.Bytes)return t.push(this.readVarint(e));var i=kg(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Tg.Bytes)return t.push(this.readSVarint());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Tg.Bytes)return t.push(this.readBoolean());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Tg.Bytes)return t.push(this.readFloat());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Tg.Bytes)return t.push(this.readDouble());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Tg.Bytes)return t.push(this.readFixed32());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Tg.Bytes)return t.push(this.readSFixed32());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Tg.Bytes)return t.push(this.readFixed64());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Tg.Bytes)return t.push(this.readSFixed64());var e=kg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Tg.Varint)for(;this.buf[this.pos++]>127;);else if(e===Tg.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Tg.Fixed32)this.pos+=4;else{if(e!==Tg.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ng(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ng(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ng(this.buf,-1&t,this.pos),Ng(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ng(this.buf,-1&t,this.pos),Ng(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){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");e.realloc(10),function(t,e,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,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(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 e=this.pos;this.pos=function(t,e,i){for(var r,n,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!n){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=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-e;i>=128&&Og(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Sg(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Sg(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&Og(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Tg.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Pg,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Fg,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ag,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ig,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Mg,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,jg,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Lg,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Dg,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,zg,e)},writeBytesField:function(t,e){this.writeTag(t,Tg.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Tg.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Tg.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Tg.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Tg.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Tg.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Tg.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Tg.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Tg.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Tg.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ug=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vg=function(t){function e(e){var i=t.call(this)||this,r=e||{};return i.dataProjection=new Ce({code:"",units:wt}),i.featureClass_=r.featureClass?r.featureClass:xc,i.geometryName_=r.geometryName,i.layerName_=r.layerName?r.layerName:"layer",i.layers_=r.layers?r.layers:null,i.idProperty_=r.idProperty,i}return Ug(e,t),e.prototype.readRawGeometry_=function(t,e,i,r){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,o=1,a=0,s=0,l=0,u=0,h=0;t.pos<n;){if(!a){var c=t.readVarint();o=7&c,a=c>>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(r.push(u),h=u),i.push(s,l),u+=2):7===o?u>h&&(i.push(i[h],i[h+1]),u+=2):rt(!1,59)}u>h&&(r.push(u),h=u)},e.prototype.createFeature_=function(t,e,i){var r,n=e.type;if(0===n)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?ht:ft:2===t?i=1===e?ct:gt:3===t&&(i=dt);return i}(n,l.length);if(this.featureClass_===xc)(r=new this.featureClass_(u,s,l,a,o)).transform(i.dataProjection);else{var h=void 0;if(u==dt){for(var c=[],p=0,d=0,f=0,g=l.length;f<g;++f){var y=l[f];if(pr(s,p,y,2)){if(0===c.length)continue;c[c.length-1].push(l[d])}else c.push(l.slice(d,f+1));d=f+1,p=y}h=c.length>1?new oh(s,at,c):new mr(s,at,l)}else h=u===ht?new ir(s,at):u===ct?new Pr(s,at):u===dt?new mr(s,at,l):u===ft?new ih(s,at):u===gt?new th(s,at,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var m=fg(h,!1,i);r.setGeometry(m),r.setId(o),r.setProperties(a,!0)}return r},e.prototype.getType=function(){return vs},e.prototype.readFeatures=function(t,e){var i=this.layers_,r=this.adaptOptions(e),n=pi(r.dataProjection);n.setWorldExtent(r.extent),r.dataProjection=n;var o=new Cg(t),a=o.readFields(Wg,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],h=u?[0,0,u.extent,u.extent]:null;n.setExtent(h);for(var c=0,p=u.length;c<p;++c){var d=Kg(o,u,c);s.push(this.createFeature_(o,d,r))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(dg);function Wg(t,e,i){if(3===t){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(qg,r,n),r.length=r.features.length,r.length&&(e[r.name]=r)}}function qg(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var r=null,n=i.readVarint()+i.pos;i.pos<n;)r=1===(t=i.readVarint()>>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;e.values.push(r)}}function Xg(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos<r;){var n=e.layer.keys[i.readVarint()],o=e.layer.values[i.readVarint()];e.properties[n]=o}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Kg(t,e,i){t.pos=e.features[i];var r=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Xg,n,r),n}var Yg="preload",Zg="useInterimTilesOnError",Hg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$g=function(t){function e(e){var i=this,r=e||{},n=_({},r);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).setPreload(void 0!==r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i}return Hg(e,t),e.prototype.getPreload=function(){return this.get(Yg)},e.prototype.setPreload=function(t){this.set(Yg,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Zg)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Zg,t)},e}(io),Jg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qg=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new lc(0,0,0,0),i}return Jg(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),r=e.getUseInterimTilesOnError();return i==Os||i==Fs||i==Ps&&!r},e.prototype.getTile=function(t,e,i,r){var n=r.pixelRatio,o=r.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,o);return s.getState()==Ps&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(Os)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,i,r)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,a=n.resolution,s=n.center,l=n.rotation,u=t.pixelRatio,c=this.getLayer(),p=c.getSource(),d=p.getRevision(),f=p.getTileGridForProjection(o),g=f.getZForResolution(a,p.zDirection),y=f.getResolution(g),m=t.extent,v=i.extent&&Ei(i.extent);v&&(m=me(m,Ei(i.extent)));var x=p.getTilePixelRatio(u),b=Math.round(t.size[0]*x),w=Math.round(t.size[1]*x);if(l){var S=Math.round(Math.sqrt(b*b+w*w));b=S,w=S}var C=y*b/2/x,T=y*w/2/x,E=[s[0]-C,s[1]-T,s[0]+C,s[1]+T],k=f.getTileRangeForExtentAndZ(m,g),R={};R[g]={};var O=this.createLoadedTileFinder(p,o,R),P=this.tmpExtent,F=this.tmpTileRange_;this.newTiles_=!1;for(var I=k.minX;I<=k.maxX;++I)for(var M=k.minY;M<=k.maxY;++M){var A=this.getTile(g,I,M,t);if(this.isDrawableTile(A)){var j=r(this);if(A.getState()==Os){R[g][A.tileCoord.toString()]=A;var L=A.inTransition(j);this.newTiles_||!L&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0)}if(1===A.getAlpha(j,t.time))continue}var D=f.getTileCoordChildTileRange(A.tileCoord,F,P),z=!1;D&&(z=O(g+1,D)),z||f.forEachTileCoordParentTileRange(A.tileCoord,O,F,P)}var G=y/a;Ft(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,l,-b/2,-w/2);var N=kn(this.pixelTransform);this.useContainer(e,N,i.opacity);var B=this.context,U=B.canvas;It(this.inversePixelTransform,this.pixelTransform),Ft(this.tempTransform,b/2,w/2,G,G,0,-b/2,-w/2),U.width!=b||U.height!=w?(U.width=b,U.height=w):this.containerReused||B.clearRect(0,0,b,w),v&&this.clipUnrotated(B,t,v),_(B,p.getContextOptions()),this.preRender(B,t),this.renderedTiles.length=0;var V,W,q,X=Object.keys(R).map(Number);X.sort(h),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(V=[],W=[]):X=X.reverse();for(var K=X.length-1;K>=0;--K){var Y=X[K],Z=p.getTilePixelSize(Y,u,o),H=f.getResolution(Y)/y,$=Z[0]*H*G,J=Z[1]*H*G,Q=f.getTileCoordForCoordAndZ(ve(E),Y),tt=f.getTileCoordExtent(Q),et=Ot(this.tempTransform,[x*(tt[0]-E[0])/y,x*(E[3]-tt[3])/y]),it=x*p.getGutterForProjection(o),rt=R[Y];for(var nt in rt){var ot=(A=rt[nt]).tileCoord,at=et[0]-(Q[1]-ot[1])*$,st=Math.round(at+$),lt=et[1]-(Q[2]-ot[2])*J,ut=Math.round(lt+J),ht=st-(I=Math.round(at)),ct=ut-(M=Math.round(lt)),pt=g===Y;if(!(L=pt&&1!==A.getAlpha(r(this),t.time)))if(V){B.save(),q=[I,M,I+ht,M,I+ht,M+ct,I,M+ct];for(var dt=0,ft=V.length;dt<ft;++dt)if(g!==Y&&Y<W[dt]){var gt=V[dt];B.beginPath(),B.moveTo(q[0],q[1]),B.lineTo(q[2],q[3]),B.lineTo(q[4],q[5]),B.lineTo(q[6],q[7]),B.moveTo(gt[6],gt[7]),B.lineTo(gt[4],gt[5]),B.lineTo(gt[2],gt[3]),B.lineTo(gt[0],gt[1]),B.clip()}V.push(q),W.push(Y)}else B.clearRect(I,M,ht,ct);this.drawTileImage(A,t,I,M,ht,ct,it,pt,i.opacity),V&&!L&&B.restore(),this.renderedTiles.push(A),this.updateUsedTiles(t.usedTiles,p,A)}}return this.renderedRevision=d,this.renderedResolution=y,this.extentChanged=!this.renderedExtent_||!ne(this.renderedExtent_,E),this.renderedExtent_=E,this.renderedPixelRatio=u,this.renderedProjection=o,this.manageTilePyramid(t,p,f,u,o,m,g,c.getPreload()),this.scheduleExpireCache(t,p),this.postRender(B,t),i.extent&&B.restore(),N!==U.style.transform&&(U.style.transform=N),this.container},e.prototype.drawTileImage=function(t,e,i,n,o,a,s,l,u){var h=this.getTileImage(t);if(h){var c=r(this),p=l?t.getAlpha(c,e.time):1,d=u*p,f=d!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(h,s,s,h.width-2*s,h.height-2*s,i,n,o,a),f&&this.context.restore(),1!==p?e.animate=!0:l&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var n=r(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var n=r(e);n in t||(t[n]={}),t[n][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,n,o,a,s,l,u){var h=r(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,d,f,g,y,m=t.wantedTiles[h],v=t.tileQueue,_=0;for(y=i.getMinZoom();y<=s;++y)for(p=i.getTileRangeForExtentAndZ(a,y,p),d=i.getResolution(y),f=p.minX;f<=p.maxX;++f)for(g=p.minY;g<=p.maxY;++g)s-y<=l?(++_,(c=e.getTile(y,f,g,n,o)).getState()==ks&&(m[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,h,i.getTileCoordCenter(c.tileCoord),d])),void 0!==u&&u(c)):e.useTile(y,f,g,o);e.updateCacheSize(_,o)},e}(sa);Qg.prototype.getLayer;var ty,ey=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),iy=function(t){function e(e){return t.call(this,e)||this}return ey(e,t),e.prototype.createRenderer=function(){return new Qg(this)},e}($g),ry="image",ny="hybrid",oy="vector",ay=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sy={image:[pa,la,ca,ha,da],hybrid:[pa,ca],vector:[]},ly={image:[ua],hybrid:[ha,da,ua],vector:[pa,la,ca,ha,da,ua]},uy=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.renderTileImageQueue_={},i.tileListenerKeys_={},i.tmpTransform_=[1,0,0,1,0,0],i}return ay(e,t),e.prototype.prepareTile=function(t,e,i,n){var o,a=r(t),s=t.getState();return(s===Os&&t.hifi||s===Ps)&&a in this.tileListenerKeys_&&(U(this.tileListenerKeys_[a]),delete this.tileListenerKeys_[a]),s!==Os&&s!==Ps||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t,e,i)&&(o=!0,n&&(this.renderTileImageQueue_[a]=t))),o},e.prototype.getTile=function(e,i,n,o){var a=o.pixelRatio,s=o.viewState,l=s.resolution,u=s.projection,h=this.getLayer(),c=h.getSource().getTile(e,i,n,a,u);if(c.getState()<Os){c.wantedResolution=l;var p=r(c);if(!(p in this.tileListenerKeys_)){var d=N(c,T,this.prepareTile.bind(this,c,a,u,!0));this.tileListenerKeys_[p]=d}}else{var f=o.viewHints;!!(f[ka]||f[Ra])&&c.wantedResolution||(c.wantedResolution=l),this.prepareTile(c,a,u,!1)&&h.getRenderMode()!==oy&&this.renderTileImage_(c,o)}return t.prototype.getTile.call(this,e,i,n,o)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===oy?r(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var n=this.getLayer(),o=n.getRevision(),a=n.getRenderOrder()||null,s=t.wantedResolution,l=t.getReplayState(n);if(l.dirty||l.renderedResolution!==s||l.renderedRevision!=o||l.renderedRenderOrder!=a||l.renderedZ!==t.sourceZ){var u=n.getSource(),h=n.getDeclutter(),c=u.getTileGrid(),p=u.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),d=u.getSourceTiles(e,i,t),f=r(n);delete t.hitDetectionImageData[f],t.executorGroups[f]=[],h&&(t.declutterExecutorGroups[f]=[]);for(var g=function(i,r){var o=d[i];if(o.getState()!=Os)return"continue";var g=o.tileCoord,m=c.getTileCoordExtent(g),v=me(p,m),_=ne(m,v)?null:qt(v,n.getRenderBuffer()*s,y.tmpExtent);l.dirty=!1;var x=new ea(0,v,s,e),b=h?new ea(0,v,s,e):void 0,w=Qa(s,e),S=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,s)),e){var r=this.renderFeature(t,w,e,x,b);this.dirty_=this.dirty_||r,l.dirty=l.dirty||r}},C=o.getFeatures();a&&a!==l.renderedRenderOrder&&C.sort(a);for(var T=0,E=C.length;T<E;++T){var k=C[T];_&&!be(_,k.getGeometry().getExtent())||S.call(y,k)}var R=x.finish(),O=n.getRenderMode()!==oy&&h&&1===d.length?null:v,P=new Ta(O,s,e,u.getOverlaps(),R,n.getRenderBuffer());if(t.executorGroups[f].push(P),b){var F=new Ta(O,s,e,u.getOverlaps(),b.finish(),n.getRenderBuffer());t.declutterExecutorGroups[f].push(F)}},y=this,m=0,v=d.length;m<v;++m)g(m);l.renderedRevision=o,l.renderedZ=t.sourceZ,l.renderedRenderOrder=a,l.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){var a=e.viewState.resolution,s=e.viewState.rotation;i=null==i?0:i;var l=this.getLayer(),u=l.getSource().getTileGridForProjection(e.viewState.projection),h=Wt([t]);qt(h,a*i,h);for(var c,p={},d=function(t,e,i){var a=t.getId();void 0===a&&(a=r(t));var s=p[a];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return p[a]=!0,o.splice(o.lastIndexOf(s),1),n(t,l,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return p[a]=!0,n(t,l,e);o.push(p[a]={feature:t,layer:l,geometry:e,distanceSq:i,callback:n})}},f=this.renderedTiles,g=function(n,o){var p=f[n];if(!be(u.getTileCoordExtent(p.wrappedTileCoord),h))return"continue";var g=r(l),y=[p.executorGroups[g]],m=p.declutterExecutorGroups[g];m&&y.push(m),y.some((function(r){for(var n=r===m?e.declutterTree.all().map((function(t){return t.value})):null,o=0,l=r.length;o<l;++o){var u=r[o];if(c=u.forEachFeatureAtCoordinate(t,a,s,i,d,n))return!0}}))},y=0,m=f.length;!c&&y<m;++y)g(y);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var n,o=this.getLayer(),a=r(o),s=o.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=s.getTileGridForProjection(l),p=Ot(this.renderedPixelToCoordinateTransform_,t.slice()),d=c.getTileCoordForCoordAndResolution(p,h),f=0,g=this.renderedTiles.length;f<g;++f)if(d.toString()===this.renderedTiles[f].tileCoord.toString()){if((n=this.renderedTiles[f]).getState()===Os&&n.hifi){var y=c.getTileCoordExtent(n.tileCoord);s.getWrapX()&&l.canWrapX()&&!Zt(u,y)&&li(p,l);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var m=ve(c.getTileCoordExtent(n.wrappedTileCoord)),v=[(p[0]-m[0])/h,(m[1]-p[1])/h],_=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=n.hitDetectionImageData[a];if(!x&&!this.animatingOrInteracting_){var b=Gr(c.getTileSize(c.getZForResolution(h))),w=[b[0]/2,b[1]/2],S=this.renderedRotation_;x=Za(b,[this.getRenderTransform(c.getTileCoordCenter(n.wrappedTileCoord),h,0,.5,w[0],w[1],0)],_,o.getStyleFunction(),c.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(o).renderedResolution,S),n.hitDetectionImageData[a]=x}e(Ha(v,_,x))}}.bind(this))},e.prototype.handleFontsChanged=function(){x(this.renderTileImageQueue_);var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){for(var e=t.viewHints,i=!(e[ka]||e[Ra]),n=this.renderedTiles,o=0,a=n.length;o<a;++o){var s=n[o],l=s.declutterExecutorGroups[r(this.getLayer())];if(l)for(var u=l.length-1;u>=0;--u)l[u].execute(this.context,1,this.getTileRenderTransform(s,t),t.viewState.rotation,i,void 0,t.declutterTree)}},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,r=e.viewState,n=r.center,o=r.resolution,a=r.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),d=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return kt(Pt(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,o,a,i,l,u,d))},e.prototype.renderFrame=function(e,i){var n=e.viewHints,o=!(n[ka]||n[Ra]);this.renderQueuedTileImages_(o,e),t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var a=this.getLayer(),s=a.getRenderMode();if(s===ry)return this.container;var l=a.getSource(),u=e.usedTiles[r(l)];for(var h in this.renderTileImageQueue_)u&&h in u||delete this.renderTileImageQueue_[h];for(var c=this.context,p=ly[s],d=e.viewState.rotation,f=this.renderedTiles,g=[],y=[],m=f.length-1;m>=0;--m)for(var v=f[m],_=this.getTileRenderTransform(v,e),x=v.executorGroups[r(a)],b=!1,w=0,S=x.length;w<S;++w){var C=x[w];if(C.hasExecutors(p)){var T=v.tileCoord[0],E=void 0;if(!b&&(E=C.getClipCoords(_))){c.save();for(var k=0,R=g.length;k<R;++k){var O=g[k];T<y[k]&&(c.beginPath(),c.moveTo(E[0],E[1]),c.lineTo(E[2],E[3]),c.lineTo(E[4],E[5]),c.lineTo(E[6],E[7]),c.moveTo(O[6],O[7]),c.lineTo(O[4],O[5]),c.lineTo(O[2],O[3]),c.lineTo(O[0],O[1]),c.clip())}}C.execute(c,1,_,d,o,p),!b&&E&&(c.restore(),g.push(E),y.push(T),b=!0)}}return this.container},e.prototype.renderQueuedTileImages_=function(t,e){for(var i in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}var r=this.renderTileImageQueue_[i];delete this.renderTileImageQueue_[i],this.renderTileImage_(r,e)}},e.prototype.renderFeature=function(t,e,i,r,n){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)o=es(r,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||o;else o=es(r,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return o},e.prototype.tileImageNeedsRender_=function(t,e,i){var r=this.getLayer(),n=t.getReplayState(r),o=r.getRevision(),a=t.sourceZ,s=t.wantedResolution;return n.renderedTileResolution!==s||n.renderedTileRevision!==o||n.renderedTileZ!==a},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),n=t.getReplayState(i),o=i.getRevision(),a=t.executorGroups[r(i)];n.renderedTileRevision=o,n.renderedTileZ=t.sourceZ;var s=t.wrappedTileCoord,l=s[0],u=i.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=u.getTileGridForProjection(c),d=p.getResolution(t.tileCoord[0]),f=e.pixelRatio/t.wantedResolution*d,g=p.getResolution(l),y=t.getContext(i);h=Math.round(Math.max(h,f/h));var m=u.getTilePixelSize(l,h,c);y.canvas.width=m[0],y.canvas.height=m[1];var v=h/f;if(1!==v){var _=Et(this.tmpTransform_);Pt(_,v,v),y.setTransform.apply(y,_)}var x=p.getTileCoordExtent(s,this.tmpExtent),b=f/g,w=Et(this.tmpTransform_);Pt(w,b,-b),function(t,e,i){kt(t,Rt(Tt,1,0,0,1,e,i))}(w,-x[0],-x[3]);for(var S=0,C=a.length;S<C;++S){a[S].execute(y,v,w,0,!0,sy[i.getRenderMode()])}n.renderedTileResolution=t.wantedResolution},e}(Qg),hy=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cy=function(t){function e(e){var i=this,r=e||{},n=_({},r);delete n.preload,delete n.useInterimTilesOnError,i=t.call(this,n)||this;var o=r.renderMode||ny;return rt(null==o||o==ry||o==ny||o==oy,28),i.renderMode_=o,i.setPreload(r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i}return hy(e,t),e.prototype.createRenderer=function(){return new uy(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(Yg)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Zg)},e.prototype.setPreload=function(t){this.set(Yg,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Zg,t)},e}(Co),py=function(){function t(t,e,i,r,n,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=vi(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&xe(r)==xe(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?xe(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?xe(this.targetProj_.getExtent()):null;var l=ve(i),u=_e(i),h=pe(i),c=ce(i),p=this.transformInv_(l),d=this.transformInv_(u),f=this.transformInv_(h),g=this.transformInv_(c),y=10+(o?Math.max(0,Math.ceil(ke(he(i)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,d,f,g,y),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t,e,i){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-m>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-m>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-m>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,r,n,o){this.triangles_.push({source:[r,n,o],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,r,n,o,a,s,l){var u=Wt([n,o,a,s]),h=this.sourceWorldWidth_?xe(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,d=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=xe(Wt([t,e,i,r]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&h&&(d=h>.25||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||be(u,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var g=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.transformInv_(g),m=void 0;if(p)m=(Ie(n[0],c)+Ie(a[0],c))/2-Ie(y[0],c);else m=(n[0]+a[0])/2-y[0];var v=(n[1]+a[1])/2-y[1];d=m*m+v*v>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(_),b=[(r[0]+t[0])/2,(r[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,_,b,n,o,x,w,l-1),this.addQuad_(b,_,i,r,w,x,a,s,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(S),T=[(i[0]+r[0])/2,(i[1]+r[1])/2],E=this.transformInv_(T);this.addQuad_(t,S,T,r,n,C,E,s,l-1),this.addQuad_(S,e,i,T,C,o,a,E,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,r,n,a,s),0==(14&f)&&this.addTriangle_(t,i,e,n,a,o),f&&(0==(13&f)&&this.addTriangle_(e,r,t,o,s,n),0==(7&f)&&this.addTriangle_(e,r,i,o,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,r){var n=e.source;ae(t,n[0]),ae(t,n[1]),ae(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),dy={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function fy(t,e,i,r,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(r,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(i,n)),t.restore()}function gy(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function yy(t,e,i,r){var n=_i(i,e,t),o=di(e,r,i),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var l=t.getExtent();if(!l||Yt(l,n)){var u=di(t,o,n)/o;isFinite(u)&&u>0&&(o/=u)}return o}function my(t,e,i,r,n,o,a,s,l,u,h,c){var p=on(Math.round(i*t),Math.round(i*e));if(_(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){oe(f,t.extent)}));var g=xe(f),y=ye(f),m=on(Math.round(i*g/r),Math.round(i*y/r));_(m,c);var v=i/r;l.forEach((function(t,e,i){var r=t.extent[0]-f[0],n=-(t.extent[3]-f[3]),o=xe(t.extent),a=ye(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,r*v,n*v,o*v,a*v)}));var x=ve(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],h=a[1][0],g=a[1][1],y=a[2][0],v=a[2][1],_=d((s[0][0]-x[0])/o),b=d(-(s[0][1]-x[1])/o),w=d((s[1][0]-x[0])/o),S=d(-(s[1][1]-x[1])/o),C=d((s[2][0]-x[0])/o),T=d(-(s[2][1]-x[1])/o),E=l,k=u;l=0,u=0;var R=function(t){for(var e=t.length,i=0;i<e;i++){for(var r=i,n=Math.abs(t[i][i]),o=i+1;o<e;o++){var a=Math.abs(t[o][i]);a>n&&(n=a,r=o)}if(0===n)return null;var s=t[r];t[r]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],h=i;h<e+1;h++)i==h?t[l][h]=0:t[l][h]+=u*t[i][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[h-=E,g-=k,0,0,w-_],[y-=E,v-=k,0,0,C-_],[0,0,h,g,S-b],[0,0,y,v,T-b]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===ty){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",fy(t,4,5,4,0),fy(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;ty=gy(e,0)||gy(e,4)||gy(e,8)}return ty}()||c===dy){p.moveTo(w,S);for(var O=_-w,P=b-S,F=0;F<4;F++)p.lineTo(w+d((F+1)*O/4),S+d(F*P/3)),3!=F&&p.lineTo(w+d((F+1)*O/4),S+d((F+1)*P/3));p.lineTo(C,T)}else p.moveTo(w,S),p.lineTo(_,b),p.lineTo(C,T);p.clip(),p.transform(R[0],R[2],R[1],R[3],_,b),p.translate(f[0]-E,f[3]-k),p.scale(r/i,-r/i),p.drawImage(m.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var r=t.target,n=(r[0][0]-x[0])/o,a=-(r[0][1]-x[1])/o,s=(r[1][0]-x[0])/o,l=-(r[1][1]-x[1])/o,u=(r[2][0]-x[0])/o,h=-(r[2][1]-x[1])/o;p.beginPath(),p.moveTo(s,l),p.lineTo(n,a),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var vy=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_y=function(t){function e(e,i,r,n,o,a,s,l,u,h,c,p){var d=t.call(this,o,ks)||this;d.renderEdges_=void 0!==c&&c,d.contextOptions_=p,d.pixelRatio_=s,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=n,d.wrappedTileCoord_=a||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var f=n.getTileCoordExtent(d.wrappedTileCoord_),g=d.targetTileGrid_.getExtent(),y=d.sourceTileGrid_.getExtent(),m=g?me(f,g):f;if(0===he(m))return d.state=Fs,d;var v=e.getExtent();v&&(y=y?me(y,v):v);var _=n.getResolution(d.wrappedTileCoord_[0]),x=function(t,e,i,r){var n=de(i),o=yy(t,e,n,r);return(!isFinite(o)||o<=0)&&ue(i,(function(i){return o=yy(t,e,i,r),isFinite(o)&&o>0})),o}(e,r,m,_);if(!isFinite(x)||x<=0)return d.state=Fs,d;var b=void 0!==h?h:.5;if(d.triangulation_=new py(e,r,m,y,x*b,_),0===d.triangulation_.getTriangles().length)return d.state=Fs,d;d.sourceZ_=i.getZForResolution(x);var w=d.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(w[1]=Te(w[1],y[1],y[3]),w[3]=Te(w[3],y[1],y[3])):w=me(w,y)),he(w)){for(var S=i.getTileRangeForExtentAndZ(w,d.sourceZ_),C=S.minX;C<=S.maxX;C++)for(var T=S.minY;T<=S.maxY;T++){var E=u(d.sourceZ_,C,T,s);E&&d.sourceTiles_.push(E)}0===d.sourceTiles_.length&&(d.state=Fs)}else d.state=Fs;return d}return vy(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,r){e&&e.getState()==Os&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Ps;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),r="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=my(r,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=Os}this.changed()},e.prototype.load=function(){if(this.state==ks){this.state=Rs,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,r){var n=e.getState();if(n==ks||n==Rs){t++;var o=N(e,T,(function(i){var r=e.getState();r!=Os&&r!=Ps&&r!=Fs||(U(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){t.getState()==ks&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(U),this.sourcesListenerKeys_=null},e}(Ds),xy="tileloadstart",by="tileloadend",wy="tileloaderror",Sy=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cy=function(t){function i(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var r=e.tileGrid;return r&&Gr(r.getTileSize(r.getMinZoom()),[256,256]),i.tileCache=new sc(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Sy(i,t),i.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},i.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},i.prototype.forEachLoadedTile=function(t,e,i,r){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var o,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var h=i.minY;h<=i.maxY;++h)a=ic(e,u,h),s=!1,n.containsKey(a)&&(s=(o=n.get(a)).getState()===Os)&&(s=!1!==r(o)),s||(l=!1);return l},i.prototype.getGutterForProjection=function(t){return 0},i.prototype.getKey=function(){return this.key_},i.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},i.prototype.getOpaque=function(t){return this.opaque_},i.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},i.prototype.getTile=function(t,i,r,n,o){return e()},i.prototype.getTileGrid=function(){return this.tileGrid},i.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:og(t)},i.prototype.getTileCacheForProjection=function(t){return rt(yi(this.getProjection(),t),68),this.tileCache},i.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},i.prototype.getTilePixelSize=function(t,e,i){var r=this.getTileGridForProjection(i),n=this.getTilePixelRatio(e),o=Gr(r.getTileSize(t),this.tmpSize);return 1==n?o:zr(o,n,this.tmpSize)},i.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var r=e[0],n=t.getTileCoordCenter(e),o=ug(i);if(Yt(o,n))return e;var a=xe(o),s=Math.ceil((o[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,r)}(r,t,i)),function(t,e){var i=t[0],r=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var o=e.getFullTileRange(i);return!o||o.containsXY(r,n)}(t,r)?t:null},i.prototype.clear=function(){this.tileCache.clear()},i.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},i.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},i.prototype.useTile=function(t,e,i,r){},i}(ls),Ty=function(t){function e(e,i){var r=t.call(this,e)||this;return r.tile=i,r}return Sy(e,t),e}(s);function Ey(t,e){var i=/\{z\}/g,r=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(r,a[1].toString()).replace(n,a[2].toString()).replace(o,(function(){var t=a[0],i=e.getFullTileRange(t);return rt(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function ky(t){return 1===t.length?t[0]:function(e,i,r){if(e){var n=Ie(oc(e),t.length);return t[n](e,i,r)}}}var Ry=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Oy=function(t){function e(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,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.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.tileLoadingKeys_={},r}return Ry(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=r(i),o=i.getState();o==Rs?(this.tileLoadingKeys_[n]=!0,e=xy):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=o==Ps?wy:o==Os?by:void 0),null!=e&&this.dispatchEvent(new Ty(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var r=i[1].charCodeAt(0),n=i[2].charCodeAt(0),o=void 0;for(o=r;o<=n;++o)e.push(t.replace(i[0],String.fromCharCode(o)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=Ey(t[n],e);return ky(r)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var r=ic(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(Cy),Py=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fy=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Iy,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Gs,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?dy:void 0,i.renderReprojectionEdges_=!1,i}return Py(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[r];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!yi(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!yi(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!yi(e,t)){var i=r(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=og(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||yi(e,t))return this.tileCache;var i=r(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new sc(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,r,n,o){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,r,n):void 0,u=new this.tileClass(a,void 0!==l?ks:Fs,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(T,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,r,n){var o=this.getProjection();if(o&&n&&!yi(o,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=rc(s);a.containsKey(u)&&(l=a.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(n),d=this.getTileCoordForTileUrlFunction(s,n),f=new _y(o,c,n,p,s,d,this.getTilePixelRatio(r),this.getGutter(),function(t,e,i,r){return this.getTileInternal(t,e,i,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=h,l?(f.interimTile=l,f.refreshInterimChain(),a.replace(u,f)):a.set(u,f),f}return this.getTileInternal(t,e,i,r,o||n)},e.prototype.getTileInternal=function(t,e,i,r,n){var o=null,a=ic(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var l=o;o=this.createTile_(t,e,i,r,n,s),l.getState()==ks?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,i,r,n,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=pi(t);if(i){var n=r(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Oy);function Iy(t,e){t.getImage().src=e}var My=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ay=function(t){function e(e){var i=this,r=e.projection||"EPSG:3857",n=e.extent||ug(r),o=e.tileGrid||ag({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:r,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:jy,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.loadingTiles_={},i.sourceTileCache=new sc(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:fc,i.tileGrids_={},i}return My(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var r=nc(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===r&&i.getState()===Os)for(var o=i.getSourceTiles(),a=0,s=o.length;a<s;++a){var l=o[a],u=l.tileCoord;if(be(t,n.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var d=h[c],f=d.getGeometry();be(t,f.getExtent())&&e.push(d)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache({})},e.prototype.getSourceTiles=function(t,e,i){var r=i.wrappedTileCoord,n=this.getTileGridForProjection(e),o=n.getTileCoordExtent(r),a=r[0],s=n.getResolution(a);qt(o,-s,o);var l=this.tileGrid,u=l.getExtent();u&&me(o,u,o);var h,c,p,d=l.getZForResolution(s,1),f=l.getMinZoom(),y=i.sourceTiles;if(y&&y.length>0&&y[0].tileCoord[0]===d)h=y,c=!0,p=d;else{h=[],p=d+1;do{--p,c=!0,l.forEachTileCoord(o,p,function(r){var n,o=this.tileUrlFunction(r,t,e);if(void 0!==o)if(this.sourceTileCache.containsKey(o)){var a=(n=this.sourceTileCache.get(o)).getState();if(a===Os||a===Ps||a===Fs)return void h.push(n)}else p===d&&((n=new this.tileClass(r,ks,o,this.format_,this.tileLoadFunction)).extent=l.getTileCoordExtent(r),n.projection=e,n.resolution=l.getResolution(r[0]),this.sourceTileCache.set(o,n),n.addEventListener(T,this.handleTileChange.bind(this)),n.load());c=c&&n&&n.getState()===Os,n&&n.getState()!==Fs&&i.getState()===ks&&(i.loadingSourceTiles++,n.addEventListener(T,(function t(){var e=n.getState(),r=n.getKey();if(e===Os||e===Ps){e===Os?(n.removeEventListener(T,t),i.loadingSourceTiles--,delete i.errorSourceTileKeys[r]):e===Ps&&(i.errorSourceTileKeys[r]=!0);var o=Object.keys(i.errorSourceTileKeys).length;i.loadingSourceTiles-o==0&&(i.hifi=0===o,i.sourceZ=d,i.setState(Os))}})))}.bind(this)),c||(h.length=0)}while(!c&&p>f)}return i.getState()===ks&&i.setState(Rs),c&&(i.hifi=d===p,i.sourceZ=p,i.getState()<Os?i.setState(Os):y&&g(h,y)||(i.sourceTiles=h)),h},e.prototype.getTile=function(t,e,i,r,n){var o,a=ic(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(o=this.tileCache.get(a)).key===s)return o;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(n);if(u&&h){var p=c.getTileCoordExtent(u);qt(p,-c.getResolution(t),p),be(h,p)||(u=null)}var d=!0;if(null!==u){var f=this.tileGrid,g=c.getResolution(t),y=f.getZForResolution(g,1),m=c.getTileCoordExtent(u);qt(m,-g,m),f.forEachTileCoord(m,y,function(t){d=d&&!this.tileUrlFunction(t,r,n)}.bind(this))}var v=new pc(l,d?Fs:ks,u,this.getSourceTiles.bind(this,r,n));return v.key=s,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(a,v)):this.tileCache.set(a,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var r=this.tileGrid;i=lg(t,void 0,r?r.getTileSize(r.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var r=Gr(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(r[0]*e),Math.round(r[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i)},e}(Oy);function jy(t,e){t.setLoader((function(i,r,n){ws(e,t.getFormat(),i,r,n,t.onLoad.bind(t),t.onError.bind(t))}))}var Ly,Dy=/font-family: ?([^;]*);/,zy=/("|')/g;function Gy(t){if(!Ly){Ly={};for(var e=document.styleSheets,i=0,r=e.length;i<r;++i){var n=e[i];try{var o=n.rules||n.cssRules;if(o)for(var a=0,s=o.length;a<s;++a){var l=o[a];if(5==l.type){var u=l.cssText.match(Dy);Ly[u[1].replace(zy,"")]=!0}}}catch(t){}}}return t in Ly}var Ny={},By=ig.getNames();function Uy(t){var e=t.toString();if(e in Ny)return t;for(var i=t.map((function(t){var e=vc(t,1).split(" ");return[e.slice(3).join(" ").replace(/"/g,""),e[1]+e[0]]})),r=0,n=i.length;r<n;++r){var o=i[r],a=o[0];if(!Gy(a)&&-1!==By.indexOf(a)){var s="https://fonts.googleapis.com/css?family="+a.replace(/ /g,"+")+":"+o[1];if(!document.querySelector('link[href="'+s+'"]')){var l=document.createElement("link");l.href=s,l.rel="stylesheet",document.head.appendChild(l)}}}return Ny[e]=!0,t}var Vy=/^(.*)(\?.*)$/;function Wy(t,e,i){var r=(t=function(t,e){return e&&0===t.indexOf(".")&&(t=e+t),t}(t,e)).match(Vy);return r?r[1]+i+(r.length>2?r[2]:""):t+i}new _g;var qy=eg((function(t,e){t.exports=function(t,e,i){t="default"in t?t.default:t,i="default"in i?i.default:i;var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),n="layer-switcher-",o=function(t){function o(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var e=Object.assign({},t),i=e.tipLabel?e.tipLabel:"Legend",r=e.collapseTipLabel?e.collapseTipLabel:"Collapse legend",a=document.createElement("div"),s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,{element:a,target:e.target}));s.activationMode=e.activationMode||"mouseover",s.startActive=!0===e.startActive;var l=void 0!==e.label?e.label:"",u=void 0!==e.collapseLabel?e.collapseLabel:"»";s.groupSelectStyle=o.getGroupSelectStyle(e.groupSelectStyle),s.reverse=!1!==e.reverse,s.mapListeners=[],s.hiddenClassName="ol-unselectable ol-control layer-switcher",o.isTouchDevice_()&&(s.hiddenClassName+=" touch"),s.shownClassName="shown",a.className=s.hiddenClassName;var h=document.createElement("button");return h.setAttribute("title",i),h.setAttribute("aria-label",i),a.appendChild(h),s.panel=document.createElement("div"),s.panel.className="panel",a.appendChild(s.panel),o.enableTouchScroll_(s.panel),h.textContent=l,a.classList.add(n+"group-select-style-"+s.groupSelectStyle),a.classList.add(n+"activation-mode-"+s.activationMode),"click"===s.activationMode?(a.classList.add("activationModeClick"),s.startActive&&(h.textContent=u,h.setAttribute("title",r),h.setAttribute("aria-label",r)),h.onclick=function(t){var e=t||window.event;s.element.classList.contains(s.shownClassName)?(s.hidePanel(),h.textContent=l,h.setAttribute("title",i),h.setAttribute("aria-label",i)):(s.showPanel(),h.textContent=u,h.setAttribute("title",r),h.setAttribute("aria-label",r)),e.preventDefault()}):(h.onmouseover=function(){s.showPanel()},h.onclick=function(t){var e=t||window.event;s.showPanel(),e.preventDefault()},s.panel.onmouseout=function(t){s.panel.contains(t.relatedTarget)||s.hidePanel()}),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),r(o,[{key:"setMap",value:function(t){for(var i=this,r=0;r<this.mapListeners.length;r++)e.unByKey(this.mapListeners[r]);this.mapListeners.length=0,function t(e,i,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,i);if(void 0===n){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,i,r)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(r):void 0}(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"setMap",this).call(this,t),t&&(this.startActive?this.showPanel():this.renderPanel(),"click"!==this.activationMode&&this.mapListeners.push(t.on("pointerdown",(function(){i.hidePanel()}))))}},{key:"showPanel",value:function(){this.element.classList.contains(this.shownClassName)||(this.element.classList.add(this.shownClassName),this.renderPanel())}},{key:"hidePanel",value:function(){this.element.classList.contains(this.shownClassName)&&this.element.classList.remove(this.shownClassName)}},{key:"renderPanel",value:function(){this.dispatchEvent("render"),o.renderPanel(this.getMap(),this.panel,{groupSelectStyle:this.groupSelectStyle,reverse:this.reverse}),this.dispatchEvent("rendercomplete")}}],[{key:"renderPanel",value:function(t,e,i){var r=new Event("render");for(e.dispatchEvent(r),(i=i||{}).groupSelectStyle=o.getGroupSelectStyle(i.groupSelectStyle),o.ensureTopVisibleBaseLayerShown(t,i.groupSelectStyle);e.firstChild;)e.removeChild(e.firstChild);o.forEachRecursive(t,(function(t,e,i){t.set("indeterminate",!1)})),"children"===i.groupSelectStyle||"none"===i.groupSelectStyle?o.setGroupVisibility(t):"group"===i.groupSelectStyle&&o.setChildVisibility(t);var n=document.createElement("ul");e.appendChild(n),o.renderLayers_(t,t,n,i,(function(r){o.renderPanel(t,e,i)}));var a=new Event("rendercomplete");e.dispatchEvent(a)}},{key:"isBaseGroup",value:function(t){if(t instanceof i){var e=t.getLayers().getArray();return e.length&&"base"===e[0].get("type")}return!1}},{key:"setGroupVisibility",value:function(t){o.getGroupsAndLayers(t,(function(t){return t instanceof i&&!t.get("combine")&&!o.isBaseGroup(t)})).reverse().forEach((function(t){var e=t.getLayersArray().map((function(t){return t.getVisible()}));e.every((function(t){return!0===t}))?(t.setVisible(!0),t.set("indeterminate",!1)):e.every((function(t){return!1===t}))?(t.setVisible(!1),t.set("indeterminate",!1)):(t.setVisible(!0),t.set("indeterminate",!0))}))}},{key:"setChildVisibility",value:function(t){o.getGroupsAndLayers(t,(function(t){return t instanceof i&&!t.get("combine")&&!o.isBaseGroup(t)})).forEach((function(t){var e=t,i=e.getVisible(),r=e.get("indeterminate");e.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),i&&!r||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown",value:function(t,e){var i=void 0;o.forEachRecursive(t,(function(t,e,r){"base"===t.get("type")&&t.getVisible()&&(i=t)})),i&&o.setVisible_(t,i,!0,e)}},{key:"getGroupsAndLayers",value:function(t,e){var i=[];return e=e||function(t,e,i){return!0},o.forEachRecursive(t,(function(t,r,n){t.get("title")&&e(t,r,n)&&i.push(t)})),i}},{key:"setVisible_",value:function(t,e,r,n){e.setVisible(r),r&&"base"===e.get("type")&&o.forEachRecursive(t,(function(t,i,r){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e instanceof i&&!e.get("combine")&&"children"===n&&e.getLayers().forEach((function(i){o.setVisible_(t,i,e.getVisible(),n)}))}},{key:"renderLayer_",value:function(t,e,r,a,s){var l=document.createElement("li"),u=e.get("title"),h=o.uuid(),c=document.createElement("label");if(e instanceof i&&!e.get("combine")){var p=o.isBaseGroup(e);if(l.classList.add("group"),p&&l.classList.add(n+"base-group"),e.get("fold")){l.classList.add(n+"fold"),l.classList.add(n+e.get("fold"));var d=document.createElement("button");d.onclick=function(t){var i=t||window.event;o.toggleFold_(e,l),i.preventDefault()},l.appendChild(d)}if(!p&&"none"!=a.groupSelectStyle){var f=document.createElement("input");f.type="checkbox",f.id=h,f.checked=e.getVisible(),f.indeterminate=e.get("indeterminate"),f.onchange=function(i){var r=i.target;o.setVisible_(t,e,r.checked,a.groupSelectStyle),s(e)},l.appendChild(f),c.htmlFor=h}c.innerHTML=u,l.appendChild(c);var g=document.createElement("ul");l.appendChild(g),o.renderLayers_(t,e,g,a,s)}else{l.className="layer";var y=document.createElement("input");"base"===e.get("type")?(y.type="radio",y.name="base"):y.type="checkbox",y.id=h,y.checked=e.get("visible"),y.indeterminate=e.get("indeterminate"),y.onchange=function(i){var r=i.target;o.setVisible_(t,e,r.checked,a.groupSelectStyle),s(e)},l.appendChild(y),c.htmlFor=h,c.innerHTML=u;var m=t.getView().getResolution();(m>e.getMaxResolution()||m<e.getMinResolution())&&(c.className+=" disabled"),l.appendChild(c)}return l}},{key:"renderLayers_",value:function(t,e,i,r,n){var a=e.getLayers().getArray().slice();r.reverse&&(a=a.reverse());for(var s,l=0;l<a.length;l++)(s=a[l]).get("title")&&i.appendChild(o.renderLayer_(t,s,l,r,n))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,r,n){e(t,r,n),t instanceof i&&o.forEachRecursive(t,e)}))}},{key:"uuid",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}},{key:"enableTouchScroll_",value:function(t){if(o.isTouchDevice_()){var e=0;t.addEventListener("touchstart",(function(t){e=this.scrollTop+t.touches[0].pageY}),!1),t.addEventListener("touchmove",(function(t){this.scrollTop=e-t.touches[0].pageY}),!1)}}},{key:"isTouchDevice_",value:function(){try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}}},{key:"toggleFold_",value:function(t,e){e.classList.remove(n+t.get("fold")),t.set("fold","open"===t.get("fold")?"close":"open"),e.classList.add(n+t.get("fold"))}},{key:"getGroupSelectStyle",value:function(t){return["none","children","group"].indexOf(t)>=0?t:"children"}}]),o}(t);return window.ol&&window.ol.control&&(window.ol.control.LayerSwitcher=o),o}(Il,W,Ys)}));function Xy(t,e){return hm().createElementNS(t,e)}function Ky(t,e){return function t(e,i,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)i?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var n=void 0;for(n=e.firstChild;n;n=n.nextSibling)t(n,i,r)}return r}(t,e,[]).join("")}function Yy(t){return"documentElement"in t}function Zy(t){return(new DOMParser).parseFromString(t,"application/xml")}function Hy(t,e){return function(i,r){var n=t.call(void 0!==e?e:this,i,r);void 0!==n&&f(r[r.length-1],n)}}function $y(t,e){return function(i,r){var n=t.call(void 0!==e?e:this,i,r);void 0!==n&&r[r.length-1].push(n)}}function Jy(t,e){return function(i,r){var n=t.call(void 0!==e?e:this,i,r);void 0!==n&&(r[r.length-1]=n)}}function Qy(t,e,i){return function(r,n){var o=t.call(void 0!==i?i:this,r,n);void 0!==o&&(n[n.length-1][void 0!==e?e:r.localName]=o)}}function tm(t,e){return function(i,r,n){t.call(void 0!==e?e:this,i,r,n),n[n.length-1].node.appendChild(i)}}function em(t,e){var i=t;return function(t,r,n){var o=r[r.length-1].node,a=i;return void 0===a&&(a=n),Xy(void 0!==e?e:o.namespaceURI,a)}}var im=em();function rm(t,e){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=t[e[n]];return r}function nm(t,e,i){var r,n,o=void 0!==i?i:{};for(r=0,n=t.length;r<n;++r)o[t[r]]=e;return o}function om(t,e,i,r){var n;for(n=e.firstElementChild;n;n=n.nextElementSibling){var o=t[n.namespaceURI];if(void 0!==o){var a=o[n.localName];void 0!==a&&a.call(r,n,i)}}}function am(t,e,i,r,n){return r.push(t),om(e,i,r,n),r.pop()}function sm(t,e,i,r,n,o,a){return n.push(t),function(t,e,i,r,n,o){for(var a,s,l=(void 0!==n?n:i).length,u=0;u<l;++u)void 0!==(a=i[u])&&void 0!==(s=e.call(void 0!==o?o:this,a,r,void 0!==n?n[u]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,r)}(e,i,r,n,o,a),n.pop()}var lm=void 0;var um=void 0;function hm(){return void 0===um&&"undefined"!=typeof document&&(um=document.implementation.createDocument("","",null)),um}var cm=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pm=function(t){function i(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===lm&&"undefined"!=typeof XMLSerializer&&(lm=new XMLSerializer),lm),e}return cm(i,t),i.prototype.getType=function(){return bs},i.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var i=Zy(t);return this.readFeatureFromDocument(i,e)}return Yy(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},i.prototype.readFeatureFromDocument=function(t,e){var i=this.readFeaturesFromDocument(t,e);return i.length>0?i[0]:null},i.prototype.readFeatureFromNode=function(t,e){return null},i.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var i=Zy(t);return this.readFeaturesFromDocument(i,e)}return Yy(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},i.prototype.readFeaturesFromDocument=function(t,e){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&f(i,this.readFeaturesFromNode(r,e));return i},i.prototype.readFeaturesFromNode=function(t,i){return e()},i.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var i=Zy(t);return this.readGeometryFromDocument(i,e)}return Yy(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},i.prototype.readGeometryFromDocument=function(t,e){return null},i.prototype.readGeometryFromNode=function(t,e){return null},i.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Zy(t);return this.readProjectionFromDocument(e)}return Yy(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},i.prototype.readProjectionFromDocument=function(t){return this.dataProjection},i.prototype.readProjectionFromNode=function(t){return this.dataProjection},i.prototype.writeFeature=function(t,e){var i=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(i)},i.prototype.writeFeatureNode=function(t,e){return null},i.prototype.writeFeatures=function(t,e){var i=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(i)},i.prototype.writeFeaturesNode=function(t,e){return null},i.prototype.writeGeometry=function(t,e){var i=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(i)},i.prototype.writeGeometryNode=function(t,e){return null},i}(dg);function dm(t){var e,i=Ky(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(i))?void 0!==e[1]||!1:void 0}function fm(t){var e,i=Ky(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(i))?parseFloat(e[1]):void 0}function gm(t){return Ky(t,!1).trim()}function ym(t,e){vm(t,e?"1":"0")}function mm(t,e){var i=e.toPrecision();t.appendChild(hm().createTextNode(i))}function vm(t,e){t.appendChild(hm().createTextNode(e))}var _m,xm,bm,wm,Sm,Cm,Tm,Em,km,Rm,Om=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pm=["http://www.google.com/kml/ext/2.2"],Fm=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],Im={fraction:Fa,pixels:Ia,insetPixels:Ia},Mm=nm(Fm,{ExtendedData:Tv,Region:Ev,MultiGeometry:Qy(yv,"geometry"),LineString:Qy(dv,"geometry"),LinearRing:Qy(fv,"geometry"),Point:Qy(mv,"geometry"),Polygon:Qy(_v,"geometry"),Style:Qy(bv),StyleMap:function(t,e){var i=Qm.call(this,t,e);if(!i)return;var r=e[e.length-1];Array.isArray(i)?r.Style=i:"string"==typeof i?r.styleUrl=i:rt(!1,38)},address:Qy(gm),description:Qy(gm),name:Qy(gm),open:Qy(dm),phoneNumber:Qy(gm),styleUrl:Qy(Hm),visibility:Qy(dm)},nm(Pm,{MultiTrack:Qy((function(t,e){var i=am([],av,t,e);if(!i)return;return new th(i)}),"geometry"),Track:Qy(lv,"geometry")})),Am=nm(Fm,{ExtendedData:Tv,Region:Ev,Link:function(t,e){om(jm,t,e)},address:Qy(gm),description:Qy(gm),name:Qy(gm),open:Qy(dm),phoneNumber:Qy(gm),visibility:Qy(dm)}),jm=nm(Fm,{href:Qy(Zm)}),Lm=nm(Fm,{LatLonAltBox:function(t,e){var i=am({},Ov,t,e);if(!i)return;var r=e[e.length-1],n=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];r.extent=n,r.altitudeMode=i.altitudeMode,r.minAltitude=parseFloat(i.minAltitude),r.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,e){var i=am({},Pv,t,e);if(!i)return;var r=e[e.length-1];r.minLodPixels=parseFloat(i.minLodPixels),r.maxLodPixels=parseFloat(i.maxLodPixels),r.minFadeExtent=parseFloat(i.minFadeExtent),r.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),Dm=nm(Fm,["Document","Placemark"]),zm=nm(Fm,{Document:tm((function(t,e,i){sm({node:t},jv,Lv,e,i,void 0,this)})),Placemark:tm(a_)}),Gm=null,Nm=null,Bm=null,Um=null,Vm=null,Wm=null;function qm(t){return t}var Xm=function(t){function e(e){var i=t.call(this)||this,r=e||{};return Wm||(Gm=new Tr({color:_m=[255,255,255,1]}),Nm=new Ya({anchor:xm=[20,2],anchorOrigin:Ma,anchorXUnits:bm=Ia,anchorYUnits:wm=Ia,crossOrigin:"anonymous",rotation:0,scale:Tm=.5,size:Sm=[64,64],src:Cm="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),Em="NO_IMAGE",Bm=new Fr({color:_m,width:1}),km=new Fr({color:[51,51,51,1],width:2}),Um=new Gn({font:"bold 16px Helvetica",fill:Gm,stroke:km,scale:.8}),Vm=new In({fill:Gm,image:Nm,text:Um,stroke:Bm,zIndex:0}),Wm=[Vm]),i.dataProjection=pi("EPSG:4326"),i.defaultStyle_=r.defaultStyle?r.defaultStyle:Wm,i.extractStyles_=void 0===r.extractStyles||r.extractStyles,i.writeStyles_=void 0===r.writeStyles||r.writeStyles,i.sharedStyles_={},i.showPointNames_=void 0===r.showPointNames||r.showPointNames,i.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",i.iconUrlFunction_=r.iconUrlFunction?r.iconUrlFunction:qm,i}return Om(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var i=am([],nm(Fm,{Document:Hy(this.readDocumentOrFolder_,this),Folder:Hy(this.readDocumentOrFolder_,this),Placemark:$y(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return i||void 0},e.prototype.readPlacemark_=function(t,e){var i=am({geometry:null},Mm,t,e,this);if(i){var r=new ot,n=t.getAttribute("id");null!==n&&r.setId(n);var o=e[0],a=i.geometry;if(a&&fg(a,!1,o),r.setGeometry(a),delete i.geometry,this.extractStyles_){var s=function(t,e,i,r,n){return function(o,a){var s=n,l="",u=[];if(s){var h=o.getGeometry();if(h){var c=h.getType();s=c===mt?(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ht||e===ft}))).length>0:c===ht||c===ft}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(Rm||(Rm=document.createElement("textarea")),Rm.innerHTML=l,l=Rm.value));var p=i;if(t?p=t:e&&(p=function t(e,i,r){return Array.isArray(e)?e:"string"==typeof e?t(r[e],i,r):i}(e,i,r)),s){var d=function(t,e){var i=[0,0],r="start",n=t.getImage();if(n){var o=n.getImageSize();if(null===o&&(o=Sm),2==o.length){var a=n.getScaleArray();i[0]=a[0]*o[0]/2,i[1]=-a[1]*o[1]/2,r="left"}}var s=t.getText();s?((s=s.clone()).setFont(s.getFont()||Um.getFont()),s.setScale(s.getScale()||Um.getScale()),s.setFill(s.getFill()||Um.getFill()),s.setStroke(s.getStroke()||km)):s=Um.clone();return s.setText(e),s.setOffsetX(i[0]),s.setOffsetY(i[1]),s.setTextAlign(r),new In({image:n,text:s})}(p[0],l);return u.length>0?(d.setGeometry(new cg(u)),[d,new In({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):d}return p}}(i.Style,i.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);r.setStyle(s)}return delete i.Style,r.setProperties(i,!0),r}},e.prototype.readSharedStyle_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=bv.call(this,t,e);if(r){var n=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+i,o).href;else n="#"+i;this.sharedStyles_[n]=r}}},e.prototype.readSharedStyleMap_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=Qm.call(this,t,e);if(r){var n,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+i,o).href;else n="#"+i;this.sharedStyles_[n]=r}}},e.prototype.readFeatureFromNode=function(t,e){if(!c(Fm,t.namespaceURI))return null;var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i||null},e.prototype.readFeaturesFromNode=function(t,e){if(!c(Fm,t.namespaceURI))return[];var i,r=t.localName;if("Document"==r||"Folder"==r)return(i=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==r){var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n?[n]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&f(i,a)}return i}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Zy(t);return this.readNameFromDocument(e)}return Yy(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(e);if(i)return i}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(c(Fm,e.namespaceURI)&&"name"==e.localName)return gm(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var i=e.localName;if(c(Fm,e.namespaceURI)&&("Document"==i||"Folder"==i||"Placemark"==i||"kml"==i)){var r=this.readNameFromNode(e);if(r)return r}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var i=Zy(t);f(e,this.readNetworkLinksFromDocument(i))}else Yy(t)?f(e,this.readNetworkLinksFromDocument(t)):f(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&f(e,this.readNetworkLinksFromNode(i));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(c(Fm,i.namespaceURI)&&"NetworkLink"==i.localName){var r=am({},Am,i,[]);e.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var n=i.localName;!c(Fm,i.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||f(e,this.readNetworkLinksFromNode(i))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var i=Zy(t);f(e,this.readRegionFromDocument(i))}else Yy(t)?f(e,this.readRegionFromDocument(t)):f(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&f(e,this.readRegionFromNode(i));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(c(Fm,i.namespaceURI)&&"Region"==i.localName){var r=am({},Lm,i,[]);e.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var n=i.localName;!c(Fm,i.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||f(e,this.readRegionFromNode(i))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=Xy(Fm[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",Pm[0]),i.setAttributeNS(r,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),i.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var n={node:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=Dm[i.namespaceURI],s=rm(o,a);return sm(n,zm,im,s,[e],a,this),i},e}(pm);function Km(t){var e=Ky(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);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 Ym(t){var e=Ky(t,!1),i=[];e=e.replace(/\s*,\s*/g,",");for(var r,n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=n.exec(e);){var o=parseFloat(r[1]),a=parseFloat(r[2]),s=r[3]?parseFloat(r[3]):0;i.push(o,a,s),e=e.substr(r[0].length)}if(""===e)return i}function Zm(t){var e=Ky(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function Hm(t){var e=Ky(t,!1).trim().replace(/^(?!.*#)/,"#"),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function $m(t){return fm(t)}var Jm=nm(Fm,{Pair:function(t,e){var i=am({},kv,t,e,this);if(!i)return;var r=i.key;if(r&&"normal"==r){var n=i.styleUrl;n&&(e[e.length-1]=n);var o=i.Style;o&&(e[e.length-1]=o)}}});function Qm(t,e){return am(void 0,Jm,t,e,this)}var tv=nm(Fm,{Icon:Qy((function(t,e){var i=am({},uv,t,e);return i||null})),color:Qy(Km),heading:Qy(fm),hotSpot:Qy((function(t){var e,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return e="insetPixels"!==i?"insetPixels"!==r?Ma:ja:"insetPixels"!==r?Aa:La,{x:parseFloat(t.getAttribute("x")),xunits:Im[i],y:parseFloat(t.getAttribute("y")),yunits:Im[r],origin:e}})),scale:Qy($m)});var ev=nm(Fm,{color:Qy(Km),scale:Qy($m)});var iv=nm(Fm,{color:Qy(Km),width:Qy(fm)});var rv=nm(Fm,{color:Qy(Km),fill:Qy(dm),outline:Qy(dm)});var nv=nm(Fm,{coordinates:Jy(Ym)});function ov(t,e){return am(null,nv,t,e)}var av=nm(Pm,{Track:$y(lv)});var sv=nm(Fm,{when:function(t,e){var i=e[e.length-1].whens,r=Ky(t,!1),n=Date.parse(r);i.push(isNaN(n)?0:n)}},nm(Pm,{coord:function(t,e){var i=e[e.length-1].flatCoordinates,r=Ky(t,!1),n=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(n){var o=parseFloat(n[1]),a=parseFloat(n[2]),s=parseFloat(n[3]);i.push(o,a,s,0)}else i.push(0,0,0,0)}}));function lv(t,e){var i=am({flatCoordinates:[],whens:[]},sv,t,e);if(i){for(var r=i.flatCoordinates,n=i.whens,o=0,a=Math.min(r.length,n.length);o<a;++o)r[4*o+3]=n[o];return new Pr(r,ut)}}var uv=nm(Fm,{href:Qy(Zm)},nm(Pm,{x:Qy(fm),y:Qy(fm),w:Qy(fm),h:Qy(fm)}));var hv=nm(Fm,{coordinates:Jy(Ym)});function cv(t,e){return am(null,hv,t,e)}var pv=nm(Fm,{extrude:Qy(dm),tessellate:Qy(dm),altitudeMode:Qy(gm)});function dv(t,e){var i=am({},pv,t,e),r=cv(t,e);if(r){var n=new Pr(r,st);return n.setProperties(i,!0),n}}function fv(t,e){var i=am({},pv,t,e),r=cv(t,e);if(r){var n=new mr(r,st,[r.length]);return n.setProperties(i,!0),n}}var gv=nm(Fm,{LineString:$y(dv),LinearRing:$y(fv),MultiGeometry:$y(yv),Point:$y(mv),Polygon:$y(_v)});function yv(t,e){var i,r=am([],gv,t,e);if(!r)return null;if(0===r.length)return new cg(r);for(var n=!0,o=r[0].getType(),a=1,s=r.length;a<s;++a)if(r[a].getType()!=o){n=!1;break}if(n){var l=void 0,u=void 0;if(o==ht){var h=r[0];l=h.getLayout(),u=h.getFlatCoordinates();for(a=1,s=r.length;a<s;++a)f(u,r[a].getFlatCoordinates());wv(i=new ih(u,l),r)}else o==ct?wv(i=new th(r),r):o==dt?wv(i=new oh(r),r):o==mt?i=new cg(r):rt(!1,37)}else i=new cg(r);return i}function mv(t,e){var i=am({},pv,t,e),r=cv(t,e);if(r){var n=new ir(r,st);return n.setProperties(i,!0),n}}var vv=nm(Fm,{innerBoundaryIs:function(t,e){var i=am(void 0,Fv,t,e);if(i){e[e.length-1].push(i)}},outerBoundaryIs:function(t,e){var i=am(void 0,Iv,t,e);if(i){e[e.length-1][0]=i}}});function _v(t,e){var i=am({},pv,t,e),r=am([null],vv,t,e);if(r&&r[0]){for(var n=r[0],o=[n.length],a=1,s=r.length;a<s;++a)f(n,r[a]),o.push(n.length);var l=new mr(n,st,o);return l.setProperties(i,!0),l}}var xv=nm(Fm,{IconStyle:function(t,e){var i=am({},tv,t,e);if(i){var r,n,o,a,s=e[e.length-1],l="Icon"in i?i.Icon:{},u=!("Icon"in i)||Object.keys(l).length>0,h=l.href;h?r=h:u&&(r=Cm);var c,p=Ma,d=i.hotSpot;d?(n=[d.x,d.y],o=d.xunits,a=d.yunits,p=d.origin):r===Cm?(n=xm,o=bm,a=wm):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(n=[.5,0],o=Fa,a=Fa);var f,g=l.x,y=l.y;void 0!==g&&void 0!==y&&(c=[g,y]);var m,v=l.w,_=l.h;void 0!==v&&void 0!==_&&(f=[v,_]);var x=i.heading;void 0!==x&&(m=Fe(x));var b=i.scale,w=i.color;if(u){r==Cm&&(f=Sm,void 0===b&&(b=Tm));var S=new Ya({anchor:n,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Ma,rotation:m,scale:b,size:f,src:this.iconUrlFunction_(r),color:w});s.imageStyle=S}else s.imageStyle=Em}},LabelStyle:function(t,e){var i=am({},ev,t,e);if(i){var r=e[e.length-1],n=new Gn({fill:new Tr({color:"color"in i?i.color:_m}),scale:i.scale});r.textStyle=n}},LineStyle:function(t,e){var i=am({},iv,t,e);if(i){var r=e[e.length-1],n=new Fr({color:"color"in i?i.color:_m,width:"width"in i?i.width:1});r.strokeStyle=n}},PolyStyle:function(t,e){var i=am({},rv,t,e);if(i){var r=e[e.length-1],n=new Tr({color:"color"in i?i.color:_m});r.fillStyle=n;var o=i.fill;void 0!==o&&(r.fill=o);var a=i.outline;void 0!==a&&(r.outline=a)}}});function bv(t,e){var i=am({},xv,t,e,this);if(!i)return null;var r,n="fillStyle"in i?i.fillStyle:Gm,o=i.fill;void 0===o||o||(n=null),"imageStyle"in i?i.imageStyle!=Em&&(r=i.imageStyle):r=Nm;var a="textStyle"in i?i.textStyle:Um,s="strokeStyle"in i?i.strokeStyle:Bm,l=i.outline;return void 0===l||l?[new In({fill:n,image:r,stroke:s,text:a,zIndex:void 0})]:[new In({geometry:function(t){var e=t.getGeometry(),i=e.getType();return i===mt?new cg(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==dt&&e!==yt}))):i!==dt&&i!==yt?e:void 0},fill:n,image:r,stroke:s,text:a,zIndex:void 0}),new In({geometry:function(t){var e=t.getGeometry(),i=e.getType();return i===mt?new cg(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt}))):i===dt||i===yt?e:void 0},fill:n,stroke:null,zIndex:void 0})]}function wv(t,e){var i,r,n,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);i=!1,r=!1,n=!1;for(var u=0;u<o;++u){var h=e[u];a[u]=h.get("extrude"),s[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),i=i||void 0!==a[u],r=r||void 0!==s[u],n=n||l[u]}i&&t.set("extrude",a),r&&t.set("tessellate",s),n&&t.set("altitudeMode",l)}var Sv=nm(Fm,{displayName:Qy(gm),value:Qy(gm)});var Cv=nm(Fm,{Data:function(t,e){var i=t.getAttribute("name");om(Sv,t,e);var r=e[e.length-1];i&&r.displayName?r[i]={value:r.value,displayName:r.displayName,toString:function(){return r.value}}:null!==i?r[i]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,e){om(Rv,t,e)}});function Tv(t,e){om(Cv,t,e)}function Ev(t,e){om(Lm,t,e)}var kv=nm(Fm,{Style:Qy(bv),key:Qy(gm),styleUrl:Qy(Hm)});var Rv=nm(Fm,{SimpleData:function(t,e){var i=t.getAttribute("name");if(null!==i){var r=gm(t);e[e.length-1][i]=r}}});var Ov=nm(Fm,{altitudeMode:Qy(gm),minAltitude:Qy(fm),maxAltitude:Qy(fm),north:Qy(fm),south:Qy(fm),east:Qy(fm),west:Qy(fm)});var Pv=nm(Fm,{minLodPixels:Qy(fm),maxLodPixels:Qy(fm),minFadeExtent:Qy(fm),maxFadeExtent:Qy(fm)});var Fv=nm(Fm,{LinearRing:Jy(ov)});var Iv=nm(Fm,{LinearRing:Jy(ov)});function Mv(t,e){for(var i=Xr(e),r=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],n=0;n<4;++n){var o=Math.floor(r[n]).toString(16);r[n]=1==o.length?"0"+o:o}vm(t,r.join(""))}var Av=nm(Fm,{Data:tm((function(t,e,i){t.setAttribute("name",e.name);var r={node:t},n=e.value;"object"==typeof n?(null!==n&&n.displayName&&sm(r,Av,im,[n.displayName],i,["displayName"]),null!==n&&n.value&&sm(r,Av,im,[n.value],i,["value"])):sm(r,Av,im,[n],i,["value"])})),value:tm((function(t,e){vm(t,e)})),displayName:tm((function(t,e){!function(t,e){t.appendChild(hm().createCDATASection(e))}(t,e)}))});var jv=nm(Fm,{Placemark:tm(a_)}),Lv=function(t,e,i){return Xy(e[e.length-1].node.namespaceURI,"Placemark")};var Dv=em("Data");var zv=nm(Fm,["href"],nm(Pm,["x","y","w","h"])),Gv=nm(Fm,{href:tm(vm)},nm(Pm,{x:tm(mm),y:tm(mm),w:tm(mm),h:tm(mm)})),Nv=function(t,e,i){return Xy(Pm[0],"gx:"+i)};var Bv=nm(Fm,["scale","heading","Icon","color","hotSpot"]),Uv=nm(Fm,{Icon:tm((function(t,e,i){var r={node:t},n=i[i.length-1].node,o=zv[n.namespaceURI],a=rm(e,o);sm(r,Gv,im,a,i,o),a=rm(e,o=zv[Pm[0]]),sm(r,Gv,Nv,a,i,o)})),color:tm(Mv),heading:tm(mm),hotSpot:tm((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:tm(y_)});var Vv=nm(Fm,["color","scale"]),Wv=nm(Fm,{color:tm(Mv),scale:tm(y_)});var qv=nm(Fm,["color","width"]),Xv=nm(Fm,{color:tm(Mv),width:tm(mm)});var Kv={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Yv=function(t,e,i){if(t)return Xy(e[e.length-1].node.namespaceURI,Kv[t.getType()])},Zv=em("Point"),Hv=em("LineString"),$v=em("LinearRing"),Jv=em("Polygon"),Qv=nm(Fm,{LineString:tm(u_),Point:tm(u_),Polygon:tm(f_),GeometryCollection:tm(t_)});function t_(t,e,i){var r,n={node:t},o=e.getType(),a=[];o===mt?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===ft?a=a.concat(t.getPoints()):e===gt?a=a.concat(t.getLineStrings()):e===yt?a=a.concat(t.getPolygons()):e===ht||e===ct||e===dt?a.push(t):rt(!1,39)})),r=Yv):o===ft?(a=e.getPoints(),r=Zv):o===gt?(a=e.getLineStrings(),r=Hv):o===yt?(a=e.getPolygons(),r=Jv):rt(!1,39),sm(n,Qv,r,a,i)}var e_=nm(Fm,{LinearRing:tm(u_)});function i_(t,e,i){sm({node:t},e_,$v,[e],i)}var r_=nm(Fm,{ExtendedData:tm((function(t,e,i){for(var r={node:t},n=e.names,o=e.values,a=n.length,s=0;s<a;s++)sm(r,Av,Dv,[{name:n[s],value:o[s]}],i)})),MultiGeometry:tm(t_),LineString:tm(u_),LinearRing:tm(u_),Point:tm(u_),Polygon:tm(f_),Style:tm((function(t,e,i){var r={node:t},n={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(n.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(n.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(n.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!n.LineStyle&&(n.LineStyle=s),n.PolyStyle=e.polyStyles[0]}var l=i[i.length-1].node,u=m_[l.namespaceURI],h=rm(n,u);sm(r,v_,im,h,i,u)})),address:tm(vm),description:tm(vm),name:tm(vm),open:tm(ym),phoneNumber:tm(vm),styleUrl:tm(vm),visibility:tm(ym)}),n_=nm(Fm,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),o_=em("ExtendedData");function a_(t,e,i){var r={node:t};e.getId()&&t.setAttribute("id",e.getId());var n=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var a=Object.keys(n||{}).sort().filter((function(t){return!o[t]})),s=e.getStyleFunction();if(s){var l=s(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var i=t.getGeometryFunction()(e);if(i){var r=i.getType();return r===mt?i.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ht||e===ft})).length:r===ht||r===ft}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var i=t.getGeometryFunction()(e);if(i){var r=i.getType();return r===mt?i.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ct||e===gt})).length:r===ct||r===gt}})),p=u.filter((function(t){var i=t.getGeometryFunction()(e);if(i){var r=i.getType();return r===mt?i.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt})).length:r===dt||r===yt}}))),n.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===n.name){var d=h[0].getText();d&&(n.name=d.getText())}}}var f=i[i.length-1].node,g=n_[f.namespaceURI],y=rm(n,g);if(sm(r,r_,im,y,i,g),a.length>0){var m=rm(n,a);sm(r,r_,o_,[{names:a,values:m}],i)}var v=i[0],_=e.getGeometry();_&&(_=fg(_,!0,v)),sm(r,r_,Yv,[_],i)}var s_=nm(Fm,["extrude","tessellate","altitudeMode","coordinates"]),l_=nm(Fm,{extrude:tm(ym),tessellate:tm(ym),altitudeMode:tm(vm),coordinates:tm((function(t,e,i){var r,n=i[i.length-1],o=n.layout,a=n.stride;o==at||o==lt?r=2:o==st||o==ut?r=3:rt(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u<r;++u)l+=","+e[u];for(var h=a;h<s;h+=a){l+=" "+e[h];for(u=1;u<r;++u)l+=","+e[h+u]}}vm(t,l)}))});function u_(t,e,i){var r=e.getFlatCoordinates(),n={node:t};n.layout=e.getLayout(),n.stride=e.getStride();var o=e.getProperties();o.coordinates=r;var a=i[i.length-1].node,s=s_[a.namespaceURI],l=rm(o,s);sm(n,l_,im,l,i,s)}var h_=nm(Fm,["color","fill","outline"]),c_=nm(Fm,{outerBoundaryIs:tm(i_),innerBoundaryIs:tm(i_)}),p_=em("innerBoundaryIs"),d_=em("outerBoundaryIs");function f_(t,e,i){var r=e.getLinearRings(),n=r.shift(),o={node:t};sm(o,c_,p_,r,i),sm(o,c_,d_,[n],i)}var g_=nm(Fm,{color:tm(Mv),fill:tm(ym),outline:tm(ym)});function y_(t,e){mm(t,Math.round(1e6*e)/1e6)}var m_=nm(Fm,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),v_=nm(Fm,{IconStyle:tm((function(t,e,i){var r={node:t},n={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),l={href:o};if(a){l.w=a[0],l.h=a[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(l.x=h[0],l.y=s[1]-(h[1]+a[1])),u&&(u[0]!==a[0]/2||u[1]!==a[1]/2)){var c={x:u[0],xunits:Ia,y:a[1]-u[1],yunits:Ia};n.hotSpot=c}}n.Icon=l;var p=e.getScale();1!==p&&(n.scale=p);var d=e.getRotation();0!==d&&(n.heading=d);var f=e.getColor();f&&(n.color=f);var g=i[i.length-1].node,y=Bv[g.namespaceURI],m=rm(n,y);sm(r,Uv,im,m,i,y)})),LabelStyle:tm((function(t,e,i){var r={node:t},n={},o=e.getFill();o&&(n.color=o.getColor());var a=e.getScale();a&&1!==a&&(n.scale=a);var s=i[i.length-1].node,l=Vv[s.namespaceURI],u=rm(n,l);sm(r,Wv,im,u,i,l)})),LineStyle:tm((function(t,e,i){var r={node:t},n={color:e.getColor(),width:Number(e.getWidth())||1},o=i[i.length-1].node,a=qv[o.namespaceURI],s=rm(n,a);sm(r,Xv,im,s,i,a)})),PolyStyle:tm((function(t,e,i){var r={node:t},n=e.getFill(),o=e.getStroke(),a={color:n?n.getColor():void 0,fill:!!n&&void 0,outline:!!o&&void 0},s=i[i.length-1].node,l=h_[s.namespaceURI],u=rm(a,l);sm(r,g_,im,u,i,l)}))});var __,x_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function b_(t,e){for(var i=x_.length,r=0;r<i;++r)try{var n=t.getContext(x_[r],e);if(n)return n}catch(t){}return null}var w_=35044,S_=function(){function t(t,e){this.array=null,this.type=t,rt(34962===t||34963===t,62),this.usage=void 0!==e?e:w_}return t.prototype.ofSize=function(t){this.array=new(C_(this.type))(t)},t.prototype.fromArray=function(t){this.array=C_(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(C_(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function C_(t){switch(t){case 34962:return Float32Array;case 34963:return Uint32Array;default:return Float32Array}}var T_="webglcontextlost",E_="webglcontextrestored",k_=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(i);var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n"),e.compileShader(r),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,r),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(i){this.uniforms_.push({value:t.uniforms[i],location:e.getUniformLocation(this.renderTargetProgram_,i)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;var r=e.RGBA,n=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,r,i[0],i[1],0,n,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e){var i=this.getGL(),r=t.size;i.bindFramebuffer(i.FRAMEBUFFER,e?e.getFrameBuffer():null),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,this.renderTargetTexture_),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),i.bindBuffer(i.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),i.useProgram(this.renderTargetProgram_),i.enableVertexAttribArray(this.renderTargetAttribLocation_),i.vertexAttribPointer(this.renderTargetAttribLocation_,2,i.FLOAT,!1,0,0),i.uniform2f(this.renderTargetUniformLocation_,r[0],r[1]),i.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),i.drawArrays(i.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,i=this.getGL(),r=1;this.uniforms_.forEach((function(n){if((e="function"==typeof n.value?n.value(t):n.value)instanceof HTMLCanvasElement||e instanceof ImageData)n.texture||(n.texture=i.createTexture()),i.activeTexture(i["TEXTURE"+r]),i.bindTexture(i.TEXTURE_2D,n.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),e instanceof ImageData?i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,e.width,e.height,0,i.UNSIGNED_BYTE,new Uint8Array(e.data)):i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),i.uniform1i(n.location,r++);else if(Array.isArray(e))switch(e.length){case 2:return void i.uniform2f(n.location,e[0],e[1]);case 3:return void i.uniform3f(n.location,e[0],e[1],e[2]);case 4:return void i.uniform4f(n.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&i.uniform1f(n.location,e)}))},t}();function R_(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var O_=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),P_="u_projectionMatrix",F_="u_offsetScaleMatrix",I_="u_offsetRotateMatrix",M_="u_time",A_="u_zoom",j_="u_resolution",L_={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},D_=function(t){function e(e){var i=t.call(this)||this,r=e||{};i.boundHandleWebGLContextLost_=i.handleWebGLContextLost.bind(i),i.boundHandleWebGLContextRestored_=i.handleWebGLContextRestored.bind(i),i.canvas_=document.createElement("canvas"),i.canvas_.style.position="absolute",i.canvas_.style.left="0",i.gl_=b_(i.canvas_);var n=i.getGL();if(i.bufferCache_={},i.currentProgram_=null,rt(c(function(){if(!__){var t=b_(document.createElement("canvas"));t&&(__=t.getSupportedExtensions())}return __}(),"OES_element_index_uint"),63),n.getExtension("OES_element_index_uint"),i.canvas_.addEventListener(T_,i.boundHandleWebGLContextLost_),i.canvas_.addEventListener(E_,i.boundHandleWebGLContextRestored_),i.offsetRotateMatrix_=[1,0,0,1,0,0],i.offsetScaleMatrix_=[1,0,0,1,0,0],i.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i.uniformLocations_={},i.attribLocations_={},i.uniforms_=[],r.uniforms)for(var o in r.uniforms)i.uniforms_.push({name:o,value:r.uniforms[o]});return i.postProcessPasses_=r.postProcesses?r.postProcesses.map((function(t){return new k_({webGlContext:n,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new k_({webGlContext:n})],i.shaderCompileErrors_=null,i.startTime_=Date.now(),i}return O_(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),i=r(t),n=this.bufferCache_[i];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[i]=n);e.bindBuffer(t.getType(),n.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),i=r(t),n=this.bufferCache_[i];e.isContextLost()||e.deleteBuffer(n.buffer),delete this.bufferCache_[i]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(T_,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(E_,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t){var e=this.getGL(),i=this.getCanvas(),r=t.size,n=t.pixelRatio;i.width=r[0]*n,i.height=r[1]*n,i.style.width=r[0]+"px",i.style.height=r[1]+"px",e.useProgram(this.currentProgram_);for(var o=this.postProcessPasses_.length-1;o>=0;o--)this.postProcessPasses_[o].init(t);e.bindTexture(e.TEXTURE_2D,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,i){var r=this.getGL(),n=e.getSize();r.bindFramebuffer(r.FRAMEBUFFER,e.getFramebuffer()),r.viewport(0,0,n[0],n[1]),r.bindTexture(r.TEXTURE_2D,e.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.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var i=this.getGL(),r=i.UNSIGNED_INT,n=e-t,o=4*t;i.drawElements(i.TRIANGLES,n,r,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,i=t.viewState.rotation,r=Et(this.offsetScaleMatrix_);Pt(r,2/e[0],2/e[1]);var n=Et(this.offsetRotateMatrix_);0!==i&&function(t,e){var i=Math.cos(e),r=Math.sin(e);kt(t,Rt(Tt,i,r,-r,i,0,0))}(n,-i),this.setUniformMatrixValue(F_,R_(this.tmpMat4_,r)),this.setUniformMatrixValue(I_,R_(this.tmpMat4_,n)),this.setUniformFloatValue(M_,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(A_,t.viewState.zoom),this.setUniformFloatValue(j_,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,i=this.getGL(),r=0;this.uniforms_.forEach(function(n){if((e="function"==typeof n.value?n.value(t):n.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)n.texture||(n.prevValue=void 0,n.texture=i.createTexture()),i.activeTexture(i["TEXTURE"+r]),i.bindTexture(i.TEXTURE_2D,n.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&n.prevValue!==e&&(n.prevValue=e,i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e)),i.uniform1i(this.getUniformLocation(n.name),r++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(n.name,R_(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void i.uniform2f(this.getUniformLocation(n.name),e[0],e[1]);case 3:return void i.uniform3f(this.getUniformLocation(n.name),e[0],e[1],e[2]);case 4:return void i.uniform4f(this.getUniformLocation(n.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&i.uniform1f(this.getUniformLocation(n.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var i=this.getGL(),r=i.createShader(e);return i.shaderSource(r,t),i.compileShader(r),r},e.prototype.getProgram=function(t,e){var i=this.getGL(),r=this.compileShader(t,i.FRAGMENT_SHADER),n=this.compileShader(e,i.VERTEX_SHADER);this.shaderCompileErrors_=null,i.getShaderInfoLog(r)&&(this.shaderCompileErrors_="Fragment shader compilation failed:\n"+i.getShaderInfoLog(r)),i.getShaderInfoLog(n)&&(this.shaderCompileErrors_=(this.shaderCompileErrors_||"")+"Vertex shader compilation failed:\n"+i.getShaderInfoLog(n));var o=i.createProgram();return i.attachShader(o,r),i.attachShader(o,n),i.linkProgram(o),o},e.prototype.getShaderCompileErrors=function(){return this.shaderCompileErrors_},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var i=t.size,r=t.viewState.rotation,n=t.viewState.resolution,o=t.viewState.center;return Et(e),Ft(e,0,0,2/(n*i[0]),2/(n*i[1]),-r,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,i,r,n){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,i,!1,r,n))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,i=0;i<t.length;i++){var r=t[i];e+=r.size*z_(r.type)}return e}(t),i=0,r=0;r<t.length;r++){var n=t[r];this.enableAttributeArray_(n.name,n.size,n.type||5126,e,i),i+=n.size*z_(n.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,i){var r=this.getGL(),n=i||r.createTexture(),o=r.RGBA,a=r.RGBA,s=r.UNSIGNED_BYTE;return r.bindTexture(r.TEXTURE_2D,n),e?r.texImage2D(r.TEXTURE_2D,0,o,a,s,e):r.texImage2D(r.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),n},e}(u);function z_(t){switch(t){case L_.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case L_.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case L_.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case L_.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var G_=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),N_="GENERATE_BUFFERS",B_=function(t){function e(e,i){var r=t.call(this,e)||this,n=i||{};return r.helper=new D_({postProcesses:n.postProcesses,uniforms:n.uniforms}),void 0!==n.className&&(r.helper.getCanvas().className=n.className),r}return G_(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},e.prototype.dispatchRenderEvent_=function(t,e){var i=this.getLayer();if(i.hasListener(t)){var r=new oa(t,null,e,null);i.dispatchEvent(r)}},e.prototype.preRender=function(t){this.dispatchRenderEvent_(xr,t)},e.prototype.postRender=function(t){this.dispatchRenderEvent_(br,t)},e}(ra);function U_(t,e){var i=e||[];return i[0]=Math.floor(t/256/256/256)/255,i[1]=Math.floor(t/256/256)%256/255,i[2]=Math.floor(t/256)%256/255,i[3]=t%256/255,i}var V_=new Uint8Array(4),W_=function(){function t(t,e){this.helper_=t;var i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){g(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return V_[0]=0,V_[1]=0,V_[2]=0,V_[3]=0,V_;this.readAll();var i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return V_[0]=this.data_[4*i],V_[1]=this.data_[4*i+1],V_[2]=this.data_[4*i+2],V_[3]=this.data_[4*i+3],V_},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),q_=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),X_=URL.createObjectURL(q_);var K_=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Y_=function(t){function e(e,i){var n=this,o=i.uniforms||{},a=[1,0,0,1,0,0];o[P_]=a,(n=t.call(this,e,{className:i.className,uniforms:o,postProcesses:i.postProcesses})||this).sourceRevision_=-1,n.verticesBuffer_=new S_(34962,35048),n.hitVerticesBuffer_=new S_(34962,35048),n.indicesBuffer_=new S_(34963,35048),n.program_=n.helper.getProgram(i.fragmentShader,i.vertexShader),n.hitDetectionEnabled_=!(!i.hitFragmentShader||!i.hitVertexShader),n.hitProgram_=n.hitDetectionEnabled_&&n.helper.getProgram(i.hitFragmentShader,i.hitVertexShader);var s=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:L_.FLOAT}})):[];n.attributes=[{name:"a_position",size:2,type:L_.FLOAT},{name:"a_index",size:1,type:L_.FLOAT}].concat(s),n.hitDetectionAttributes=[{name:"a_position",size:2,type:L_.FLOAT},{name:"a_index",size:1,type:L_.FLOAT},{name:"a_hitColor",size:4,type:L_.FLOAT},{name:"a_featureUid",size:1,type:L_.FLOAT}].concat(s),n.customAttributes=i.attributes?i.attributes:[],n.previousExtent_=[1/0,1/0,-1/0,-1/0],n.currentTransform_=a,n.renderTransform_=[1,0,0,1,0,0],n.invertRenderTransform_=[1,0,0,1,0,0],n.renderInstructions_=new Float32Array(0),n.hitRenderInstructions_=new Float32Array(0),n.hitRenderTarget_=n.hitDetectionEnabled_&&new W_(n.helper),n.worker_=new Worker(X_),n.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===N_){var i=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=i,It(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions),this.getLayer().changed()}}.bind(n)),n.featureCache_={},n.featureCount_=0;var l=n.getLayer().getSource();return n.sourceListenKeys_=[N(l,hs,n.handleSourceFeatureAdded_,n),N(l,cs,n.handleSourceFeatureChanged_,n),N(l,ds,n.handleSourceFeatureDelete_,n),N(l,ps,n.handleSourceFeatureClear_,n)],l.forEachFeature(function(t){this.featureCache_[r(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(n)),n}return K_(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[r(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[r(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[r(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){this.preRender(t);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e),this.helper.finalizeDraw(t);var i=this.helper.getCanvas(),r=t.layerStatesArray[t.layerIndex].opacity;return r!==parseFloat(i.style.opacity)&&(i.style.opacity=String(r)),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(t),i},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource(),r=t.viewState,n=!t.viewHints[ka]&&!t.viewHints[Ra],o=!ne(this.previousExtent_,t.extent),a=this.sourceRevision_<i.getRevision();if(a&&(this.sourceRevision_=i.getRevision()),n&&(o||a)){var s=r.projection,l=r.resolution,u=e instanceof Co?e.getRenderBuffer():0,h=qt(t.extent,u*l);i.loadFeatures(h,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),kt(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var i,r,n=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===n||(this.renderInstructions_=new Float32Array(n)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s=[],l=[],u=0,h=0;for(var c in this.featureCache_)if((r=(i=this.featureCache_[c]).geometry)&&r.getType()===ht){s[0]=r.getFlatCoordinates()[0],s[1]=r.getFlatCoordinates()[1],Ot(e,s),a=U_(h+6,l),this.renderInstructions_[u++]=s[0],this.renderInstructions_[u++]=s[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=s[0],this.hitRenderInstructions_[h++]=s[1],this.hitRenderInstructions_[h++]=a[0],this.hitRenderInstructions_[h++]=a[1],this.hitRenderInstructions_[h++]=a[2],this.hitRenderInstructions_[h++]=a[3],this.hitRenderInstructions_[h++]=Number(c));for(var p=void 0,d=0;d<this.customAttributes.length;d++)p=this.customAttributes[d].callback(i.feature,i.properties),this.renderInstructions_[u++]=p,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=p)}var f={type:N_,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(f.projectionTransform=e,this.worker_.postMessage(f,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var g={type:N_,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};g.projectionTransform=e,g.hitDetection=!0,this.worker_.postMessage(g,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){if(rt(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=Ot(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0;return e+=Math.round(256*t[0]*256*256*255),e+=Math.round(256*t[1]*256*255),e+=Math.round(256*t[2]*255),e+=Math.round(255*t[3])}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?r(h,this.getLayer(),null):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){U(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(B_),Z_=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),H_="blur",$_="gradient",J_="radius",Q_=["#00f","#0ff","#0f0","#ff0","#f00"],tx=function(t){function e(e){var i=this,r=e||{},n=_({},r);delete n.gradient,delete n.radius,delete n.blur,delete n.weight,(i=t.call(this,n)||this).gradient_=null,i.addEventListener(H($_),i.handleGradientChanged_),i.setGradient(r.gradient?r.gradient:Q_),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.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,i.setRenderOrder(null),i}return Z_(e,t),e.prototype.getBlur=function(){return this.get(H_)},e.prototype.getGradient=function(){return this.get($_)},e.prototype.getRadius=function(){return this.get(J_)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=on(1,256),i=e.createLinearGradient(0,0,1,256),r=1/(t.length-1),n=0,o=t.length;n<o;++n)i.addColorStop(n*r,t[n]);return e.fillStyle=i,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(H_,t)},e.prototype.setGradient=function(t){this.set($_,t)},e.prototype.setRadius=function(t){this.set(J_,t)},e.prototype.createRenderer=function(){return new Y_(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?Te(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\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 float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\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 float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(J_)+this.get(H_))}.bind(this),u_blurSlope:function(){return this.get(J_)/Math.max(1,this.get(H_))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(os);var ex=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ix=function(t){function e(e){var i=e||{};return t.call(this,i)||this}return ex(e,t),e}(io),rx=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nx=function(t){function e(e){var i=t.call(this,e)||this;return i.image_=null,i}return rx(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,r=t.viewState,n=r.resolution,o=this.getLayer().getSource(),a=t.viewHints,s=t.extent;if(void 0!==e.extent&&(s=me(s,Ei(e.extent,r.projection))),!a[ka]&&!a[Ra]&&!we(s))if(o){var l=r.projection,u=o.getImage(s,n,i,l);u&&this.loadImage(u)&&(this.image_=u)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var i=this.image_,r=i.getExtent(),n=i.getResolution(),o=i.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,l=t.viewState,u=l.center,h=l.resolution,c=t.size,p=s*n/(h*o),d=Math.round(c[0]*s),f=Math.round(c[1]*s),g=l.rotation;if(g){var y=Math.round(Math.sqrt(d*d+f*f));d=y,f=y}Ft(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,g,-d/2,-f/2),It(this.inversePixelTransform,this.pixelTransform);var m=kn(this.pixelTransform);this.useContainer(e,m,a.opacity);var v=this.context,x=v.canvas;x.width!=d||x.height!=f?(x.width=d,x.height=f):this.containerReused||v.clearRect(0,0,d,f);var b=!1;if(a.extent){var w=Ei(a.extent,l.projection);(b=!Zt(w,t.extent)&&be(w,t.extent))&&this.clipUnrotated(v,t,w)}var S=i.getImage(),C=Ft(this.tempTransform,d/2,f/2,p,p,0,o*(r[0]-u[0])/n,o*(u[1]-r[3])/n);this.renderedResolution=n*s/o;var T=C[4],E=C[5],k=S.width*C[0],R=S.height*C[3];if(_(v,this.getLayer().getSource().getContextOptions()),this.preRender(v,t),k>=.5&&R>=.5){var O=a.opacity,P=void 0;1!==O&&(P=this.context.globalAlpha,this.context.globalAlpha=O),this.context.drawImage(S,0,0,+S.width,+S.height,Math.round(T),Math.round(E),Math.round(k),Math.round(R)),1!==O&&(this.context.globalAlpha=P)}return this.postRender(v,t),b&&v.restore(),m!==x.style.transform&&(x.style.transform=m),this.container},e}(sa),ox=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ax=function(t){function e(e){return t.call(this,e)||this}return ox(e,t),e.prototype.createRenderer=function(){return new nx(this)},e}(ix),sx=1,lx=2,ux=4,hx=8,cx=16,px=31,dx={};function fx(t){if("number"==typeof t)return sx;if("boolean"==typeof t)return hx;if("string"==typeof t)return e=t,Ur.test(e)&&(e=Wr(e)),Br.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?ux|lx:lx;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: "+JSON.stringify(t));var i=t;if(i.every((function(t){return"number"==typeof t})))return 3===i.length||4===i.length?ux|cx:cx;if("string"!=typeof i[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(i));var r=dx[i[0]];if(void 0===r)throw new Error("Unrecognized expression operator: "+JSON.stringify(i));return r.getReturnType(i.slice(1))}function gx(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function yx(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec"+t.length+"("+t.map(gx).join(", ")+")"}function mx(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function vx(t,e,i){if(Array.isArray(e)&&"string"==typeof e[0]){var r=dx[e[0]];if(void 0===r)throw new Error("Unrecognized expression operator: "+JSON.stringify(e));return r.toGlsl(t,e.slice(1),i)}var n=fx(e);return(n&sx)>0?gx(e):(n&hx)>0?e.toString():(n&lx)>0&&(void 0===i||i==lx)?function(t,e){return gx(mx(t,e))}(t,e.toString()):(n&ux)>0&&(void 0===i||i==ux)?function(t){var e=Xr(t).slice();return e.length<4&&e.push(1),yx(e.map((function(t,e){return e<3?t/255:t})))}(e):(n&cx)>0?yx(e):void 0}function _x(t){if(!(fx(t)&sx))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function xx(t){for(var e=0;e<t.length;e++)_x(t[e])}function bx(t){if(!(fx(t)&lx))throw new Error("A string value was expected, got "+JSON.stringify(t)+" instead")}function wx(t){if(!(fx(t)&hx))throw new Error("A boolean value was expected, got "+JSON.stringify(t)+" instead")}function Sx(t,e){if(t.length!==e)throw new Error("Exactly "+e+" arguments were expected, got "+t.length+" instead")}function Cx(t,e){if(t.length<e)throw new Error("At least "+e+" arguments were expected, got "+t.length+" instead")}function Tx(t,e){if(t.length>e)throw new Error("At most "+e+" arguments were expected, got "+t.length+" instead")}function Ex(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function kx(t,e){if(i=e,Math.log2(i)%1!=0)throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t));var i}function Rx(t){return{getReturnType:function(t){return hx},toGlsl:function(e,i){Sx(i,2);for(var r=px,n=0;n<i.length;n++)r&=fx(i[n]);if(0===r)throw new Error("All arguments should be of compatible type, got "+JSON.stringify(i)+" instead");return"("+vx(e,i[0],r)+" "+t+" "+vx(e,i[1],r)+")"}}}function Ox(t){return{getReturnType:function(t){return hx},toGlsl:function(e,i){Cx(i,2);for(var r=0;r<i.length;r++)wx(i[r]);return"("+i.map((function(t){return vx(e,t)})).join(" "+t+" ")+")"}}}dx.get={getReturnType:function(t){return px},toGlsl:function(t,e){Sx(e,1),bx(e[0]);var i=e[0].toString();return-1===t.attributes.indexOf(i)&&t.attributes.push(i),(t.inFragmentShader?"v_":"a_")+i}},dx.var={getReturnType:function(t){return px},toGlsl:function(t,e){Sx(e,1),bx(e[0]);var i=e[0].toString();return-1===t.variables.indexOf(i)&&t.variables.push(i),"u_"+i}},dx.time={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,0),"u_time"}},dx.zoom={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,0),"u_zoom"}},dx.resolution={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,0),"u_resolution"}},dx["*"]={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" * "+vx(t,e[1])+")"}},dx["/"]={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" / "+vx(t,e[1])+")"}},dx["+"]={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" + "+vx(t,e[1])+")"}},dx["-"]={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" - "+vx(t,e[1])+")"}},dx.clamp={getReturnType:function(t){return sx},toGlsl:function(t,e){Sx(e,3),xx(e);var i=vx(t,e[1]),r=vx(t,e[2]);return"clamp("+vx(t,e[0])+", "+i+", "+r+")"}},dx["%"]={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,2),xx(e),"mod("+vx(t,e[0])+", "+vx(t,e[1])+")"}},dx["^"]={getReturnType:function(t){return sx},toGlsl:function(t,e){return Sx(e,2),xx(e),"pow("+vx(t,e[0])+", "+vx(t,e[1])+")"}},dx[">"]={getReturnType:function(t){return hx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" > "+vx(t,e[1])+")"}},dx[">="]={getReturnType:function(t){return hx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" >= "+vx(t,e[1])+")"}},dx["<"]={getReturnType:function(t){return hx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" < "+vx(t,e[1])+")"}},dx["<="]={getReturnType:function(t){return hx},toGlsl:function(t,e){return Sx(e,2),xx(e),"("+vx(t,e[0])+" <= "+vx(t,e[1])+")"}},dx["=="]=Rx("=="),dx["!="]=Rx("!="),dx["!"]={getReturnType:function(t){return hx},toGlsl:function(t,e){return Sx(e,1),wx(e[0]),"(!"+vx(t,e[0])+")"}},dx.all=Ox("&&"),dx.any=Ox("||"),dx.between={getReturnType:function(t){return hx},toGlsl:function(t,e){Sx(e,3),xx(e);var i=vx(t,e[1]),r=vx(t,e[2]),n=vx(t,e[0]);return"("+n+" >= "+i+" && "+n+" <= "+r+")"}},dx.array={getReturnType:function(t){return cx},toGlsl:function(t,e){Cx(e,2),Tx(e,4),xx(e);var i=e.map((function(e){return vx(t,e,sx)}));return"vec"+e.length+"("+i.join(", ")+")"}},dx.color={getReturnType:function(t){return ux},toGlsl:function(t,e){Cx(e,3),Tx(e,4),xx(e);var i=e;3===e.length&&i.push(1);var r=e.map((function(e,i){return vx(t,e,sx)+(i<3?" / 255.0":"")}));return"vec"+e.length+"("+r.join(", ")+")"}},dx.interpolate={getReturnType:function(t){for(var e=ux|sx,i=3;i<t.length;i+=2)e&=fx(t[i]);return e},toGlsl:function(t,e,i){Ex(e),Cx(e,6);var r,n=e[0];switch(n[0]){case"linear":r=1;break;case"exponential":r=n[1];break;default:r=null}if(!r)throw new Error('Invalid interpolation type for "interpolate" operator, received: '+JSON.stringify(n));var o=void 0!==i?i:px,a=dx.interpolate.getReturnType(e)&o;kx(e,a);for(var s=vx(t,e[1]),l=null,u=2;u<e.length-2;u+=2){var h=vx(t,e[u]),c=vx(t,e[u+1],a),p=vx(t,e[u+2]);l="mix("+(l||c)+", "+vx(t,e[u+3],a)+", pow(clamp(("+s+" - "+h+") / ("+p+" - "+h+"), 0.0, 1.0), "+gx(r)+"))"}return l}},dx.match={getReturnType:function(t){for(var e=px,i=2;i<t.length;i+=2)e&=fx(t[i]);return e&=fx(t[t.length-1])},toGlsl:function(t,e,i){Ex(e),Cx(e,4);var r=void 0!==i?i:px,n=dx.match.getReturnType(e)&r;kx(e,n);for(var o=vx(t,e[0]),a=vx(t,e[e.length-1],n),s=null,l=e.length-3;l>=1;l-=2){s="("+o+" == "+vx(t,e[l])+" ? "+vx(t,e[l+1],n)+" : "+(s||a)+")"}return s}},dx.case={getReturnType:function(t){for(var e=px,i=1;i<t.length;i+=2)e&=fx(t[i]);return e&=fx(t[t.length-1])},toGlsl:function(t,e,i){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got "+t+" instead")}(e),Cx(e,3);var r=void 0!==i?i:px,n=dx.case.getReturnType(e)&r;kx(e,n);for(var o=0;o<e.length-1;o+=2)wx(e[o]);var a=vx(t,e[e.length-1],n),s=null;for(o=e.length-3;o>=0;o-=2){s="("+vx(t,e[o])+" ? "+vx(t,e[o+1],n)+" : "+(s||a)+")"}return s}};var Px=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,e,i){return this.varyings.push({name:t,type:e,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 e=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"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nattribute vec2 a_position;\nattribute float a_index;\n"+i.map((function(t){return"attribute "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n mat4 offsetMatrix = "+e+";\n vec2 halfSize = "+this.sizeExpression+" * 0.5;\n vec2 offset = "+this.offsetExpression+";\n float angle = "+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 = "+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"+r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")+"\n}"},t.prototype.getSymbolFragmentShader=function(t){var e=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"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+e+"\n}"},t}();var Fx=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ix=function(t){function e(e){var i=this,r=_({},e);return(i=t.call(this,r)||this).parseResult_=function(t){var e=t.symbol,i=void 0!==e.size?e.size:1,r=e.color||"white",n=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],a=void 0!==e.opacity?e.opacity:1,s=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{}},u=vx(l,i,cx|sx),h=vx(l,o,cx),c=vx(l,n,cx),p=vx(l,s,sx),d={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap},f=vx(d,r,ux),g=vx(d,a,sx),y="1.0",m="vec2("+vx(d,i,cx|sx)+").x";switch(e.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./"+m+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var v="(v_quadCoord*2.-1.)",_="(atan("+v+".x,"+v+".y))";y="(1.0-smoothstep(.5-3./"+m+",.5,cos(floor(.5+"+_+"/2.094395102)*2.094395102-"+_+")*length("+v+")))";break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var x=(new Px).setSizeExpression("vec2("+u+")").setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4("+f+".rgb, "+f+".a * "+g+" * "+y+")");if(t.filter){var b=vx(d,t.filter,hx);x.setFragmentDiscardExpression("!"+b)}var w={};if(d.variables.forEach((function(e){x.addUniform("float u_"+e),w["u_"+e]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: "+e);var i=t.variables[e];return"string"==typeof i&&(i=mx(l,i)),void 0!==i?i:-9999999}})),"image"===e.symbolType&&e.src){var S=new Image;S.src=e.src,x.addUniform("sampler2D u_texture").setColorExpression(x.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),w.u_texture=S}return d.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),x.addVarying("v_"+t,"float","a_"+t)})),l.attributes.forEach((function(t){x.addAttribute("float a_"+t)})),{builder:x,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,i){var r=i[t];return"string"==typeof r&&(r=mx(l,r)),void 0!==r?r:-9999999}}})),uniforms:w}}(e.style),i.hitDetectionDisabled_=!!e.disableHitDetection,i}return Fx(e,t),e.prototype.createRenderer=function(){return new Y_(this,{className:this.getClassName(),vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e.prototype.disposeInternal=function(){this.getRenderer().disposeInternal(),t.prototype.disposeInternal.call(this)},e}(io),Mx=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var Ax=function(t){function e(e){var i=this,n=void 0!==e.hidpi&&e.hidpi;return(i=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,opaque:!0,projection:pi("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Jn,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:n?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this).hidpi_=n,i.culture_=void 0!==e.culture?e.culture:"en-us",i.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,i.apiKey_=e.key,i.imagerySet_=e.imagerySet,function(t,e,i,n){var o=document.createElement("script"),a="olc_"+r(e);function s(){delete window[a],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(n||"callback")+"="+a;var l=setTimeout((function(){s(),i&&i()}),1e4);window[a]=function(t){clearTimeout(l),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+i.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+i.apiKey_+"&c="+i.culture_,i.handleImageryMetadataResponse.bind(i),void 0,"jsonp"),i}return Mx(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.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 e=t.resourceSets[0].resources[0],i=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,r=ug(this.getProjection()),n=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/n:[e.imageWidth/n,e.imageHeight/n],a=ag({extent:r,minZoom:e.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=a;var s=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=ky(e.imageUrlSubdomains.map((function(t){var i=[0,0,0],r=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,n){if(t){ec(t[0],t[1],t[2],i);var o=r;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,i,r=t[0],n=new Array(r),o=1<<r-1;for(e=0;e<r;++e)i=48,t[1]&o&&(i+=1),t[2]&o&&(i+=2),n[e]=String.fromCharCode(i),o>>=1;return n.join("")}(i))}}}))),e.imageryProviders){var u=mi(pi("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],r=t.viewState,n=this.getTileGrid(),o=n.getZForResolution(r.resolution,this.zDirection),a=n.getTileCoordForCoordAndZ(r.center,o)[0];return e.imageryProviders.map((function(e){for(var r=!1,n=e.coverageAreas,o=0,s=n.length;o<s;++o){var l=n[o];if(a>=l.zoomMin&&a<=l.zoomMax){var h=l.bbox;if(be(Se([h[1],h[0],h[3],h[2]],u),t.extent)){r=!0;break}}}r&&i.push(e.attribution)})),i.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),i}.bind(this))}this.setState(Qn)}else this.setState(to)},e}(Fy),jx=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lx=function(t){function e(e){var i=e||{},r=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:ag({extent:ug(r),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:r,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return jx(e,t),e}(Fy),Dx=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zx=function(t){function e(e,i,r,n,o,a,s){var l=this,u=e.getExtent(),h=i.getExtent(),c=h?me(r,h):r,p=yy(e,i,de(c),n),d=new py(e,i,c,u,.5*p,n),f=a(d.calculateSourceExtent(),p,o),g=f?Ir:Lr,y=f?f.getPixelRatio():1;return(l=t.call(this,r,n,y,g)||this).targetProj_=i,l.maxSourceExtent_=u,l.triangulation_=d,l.targetResolution_=n,l.targetExtent_=r,l.sourceImage_=f,l.sourcePixelRatio_=y,l.contextOptions_=s,l.canvas_=null,l.sourceListenerKey_=null,l}return Dx(e,t),e.prototype.disposeInternal=function(){this.state==Mr&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Ar){var e=xe(this.targetExtent_)/this.targetResolution_,i=ye(this.targetExtent_)/this.targetResolution_;this.canvas_=my(e,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Ir){this.state=Mr,this.changed();var t=this.sourceImage_.getState();t==Ar||t==jr?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,T,(function(t){var e=this.sourceImage_.getState();e!=Ar&&e!=jr||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){U(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(Na),Gx=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nx="imageloadstart",Bx="imageloadend",Ux="imageloaderror",Vx=function(t){function e(e,i){var r=t.call(this,e)||this;return r.image=i,r}return Gx(e,t),e}(s),Wx=function(t){function i(e){var i=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return i.resolutions_=void 0!==e.resolutions?e.resolutions:null,i.reprojectedImage_=null,i.reprojectedRevision_=0,i.contextOptions_=!1===e.imageSmoothing?dy:void 0,i}return Gx(i,t),i.prototype.getResolutions=function(){return this.resolutions_},i.prototype.getContextOptions=function(){return this.contextOptions_},i.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=p(this.resolutions_,t,0);t=this.resolutions_[e]}return t},i.prototype.getImage=function(t,e,i,r){var n=this.getProjection();if(n&&r&&!yi(n,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&yi(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&ne(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new zx(n,r,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,n)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return n&&(r=n),this.getImageInternal(t,e,i,r)},i.prototype.getImageInternal=function(t,i,r,n){return e()},i.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Mr:this.loading=!0,this.dispatchEvent(new Vx(Nx,e));break;case Ar:this.loading=!1,this.dispatchEvent(new Vx(Bx,e));break;case jr:this.loading=!1,this.dispatchEvent(new Vx(Ux,e))}},i}(ls);function qx(t,e){t.getImage().src=e}function Xx(t,e){var i=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))}));var r=i.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var Kx="carmentaserver",Yx="geoserver",Zx="mapserver",Hx="qgis",$x=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jx=[101,101],Qx=function(t){function e(e){var i=this,r=e||{};return(i=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions})||this).crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null,i.url_=r.url,i.imageLoadFunction_=void 0!==r.imageLoadFunction?r.imageLoadFunction:qx,i.params_=r.params||{},i.v13_=!0,i.updateV13_(),i.serverType_=r.serverType,i.hidpi_=void 0===r.hidpi||r.hidpi,i.image_=null,i.imageSize_=[0,0],i.renderedRevision_=0,i.ratio_=void 0!==r.ratio?r.ratio:1.5,i}return $x(e,t),e.prototype.getFeatureInfoUrl=function(t,e,i,r){if(void 0!==this.url_){var n=pi(i),o=this.getProjection();o&&o!==n&&(e=yy(o,n,t,e),t=_i(t,n,o));var a=ge(t,e,0,Jx),s={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};_(s,this.params_,r);var l=Math.floor((t[0]-a[0])/e),u=Math.floor((a[3]-t[1])/e);return s[this.v13_?"I":"X"]=l,s[this.v13_?"J":"Y"]=u,this.getRequestUrl_(a,Jx,1,o||n,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var i={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var n=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*n/28e-5}return _(i,e),Xx(this.url_,i)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,i,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==i||this.hidpi_&&void 0!==this.serverType_||(i=1);var n=e/i,o=de(t),a=ge(o,n,0,[Math.ceil(xe(t)/n),Math.ceil(ye(t)/n)]),s=ge(o,n,0,[Math.ceil(this.ratio_*xe(t)/n),Math.ceil(this.ratio_*ye(t)/n)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==i&&Zt(l.getExtent(),a))return l;var u={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};_(u,this.params_),this.imageSize_[0]=Math.round(xe(s)/n),this.imageSize_[1]=Math.round(ye(s)/n);var h=this.getRequestUrl_(s,this.imageSize_,i,r,u);return this.image_=new Ua(s,e,i,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(T,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,i,r,n){if(rt(void 0!==this.url_,9),n[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(n.STYLES=""),1!=i)switch(this.serverType_){case Yx:var o=90*i+.5|0;"FORMAT_OPTIONS"in n?n.FORMAT_OPTIONS+=";dpi:"+o:n.FORMAT_OPTIONS="dpi:"+o;break;case Zx:n.MAP_RESOLUTION=90*i;break;case Kx:case Hx:n.DPI=90*i;break;default:rt(!1,8)}n.WIDTH=e[0],n.HEIGHT=e[1];var a,s=r.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,n.BBOX=a.join(","),Xx(this.url_,n)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){_(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=ei(t,"1.3")>=0},e}(Wx),tb=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),eb=function(t){function e(e){var i,r=e||{};i=void 0!==r.attributions?r.attributions:['© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var n=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",o=void 0!==r.url?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:n,imageSmoothing:r.imageSmoothing,maxZoom:void 0!==r.maxZoom?r.maxZoom:19,opaque:void 0===r.opaque||r.opaque,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:o,wrapX:r.wrapX})||this}return tb(e,t),e}(Lx),ib=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rb=function(t){function e(e){var i=this,r=e||{},n=r.params||{},o=!("TRANSPARENT"in n)||n.TRANSPARENT;return(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,opaque:!o,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})||this).gutter_=void 0!==r.gutter?r.gutter:0,i.params_=n,i.v13_=!0,i.serverType_=r.serverType,i.hidpi_=void 0===r.hidpi||r.hidpi,i.tmpExtent_=[1/0,1/0,-1/0,-1/0],i.updateV13_(),i.setKey(i.getKeyForParams_()),i}return ib(e,t),e.prototype.getFeatureInfoUrl=function(t,e,i,r){var n=pi(i),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(n));var s=a.getZForResolution(e,this.zDirection),l=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=l[0])){var u=a.getResolution(l[0]),h=a.getTileCoordExtent(l,this.tmpExtent_),c=Gr(a.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=Dr(c,p,this.tmpSize),h=qt(h,u*p,h)),o&&o!==n&&(u=yy(o,n,t,u),h=function(t,e,i,r){return Se(t,vi(e,i),void 0,r)}(h,n,o),t=_i(t,n,o));var d={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};_(d,this.params_,r);var f=Math.floor((t[0]-h[0])/u),g=Math.floor((h[3]-t[1])/u);return d[this.v13_?"I":"X"]=f,d[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,c,h,1,o||n,d)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var i={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var n=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*n/28e-5}return _(i,e),Xx(this.urls[0],i)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,i,r,n,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=r)switch(this.serverType_){case Yx:var s=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case Zx:o.MAP_RESOLUTION=90*r;break;case Kx:case Hx:o.DPI=90*r;break;default:rt(!1,52)}var l,u=n.getAxisOrientation(),h=i;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=i[0],h[0]=i[1],h[1]=c,c=i[2],h[2]=i[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)l=a[0];else l=a[Ie(oc(t),a.length)];return Xx(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},e.prototype.updateParams=function(t){_(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=ei(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var n=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.tmpExtent_),a=Gr(r.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=Dr(a,s,this.tmpSize),o=qt(o,n*s,o)),1!=e&&(a=zr(a,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return _(l,this.params_),this.getRequestUrl_(t,a,o,e,i,l)}},e}(Fy);W.unByKey=q;let nb={Control:Il,Zoom:zl,Attribution:Al,ScaleLine:Xl,LayerSwitcher:qy},ob={GeoJSON:_g,KML:Xm,MVT:Vg},ab={Group:Ys,Tile:iy,Vector:os,VectorTile:cy,WebGLPoints:Ix,Heatmap:tx,Image:ax},sb={toLonLat:function(t,e){var i=_i(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),r=i[0];return(r<-180||r>180)&&(i[0]=Ie(r+180,360)-180),i},fromLonLat:function(t,e){return _i(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}},lb={LineString:Pr,Point:ir,MultiPoint:ih},ub={Icon:Ya,Style:In,Text:Gn,Stroke:Fr,Fill:Tr,Circle:Fn},hb={OSM:eb,XYZ:Lx,TileWMS:rb,BingMaps:Ax,Vector:Es,VectorTile:Ay,ImageWMS:Qx};t.Collection=it,t.Feature=ot,t.Map=Qh,t.Observable=W,t.View=Tl,t.control=nb,t.format=ob,t.geom=lb,t.interaction=$h,t.layer=ab,t.mbApplyStyle=function(t,e,i,r,n){return new Promise((function(o,a){if("object"!=typeof e&&(e=JSON.parse(e)),8!=e.version)return a(new Error("glStyle version 8 required."));if(!(t instanceof os||t instanceof cy))return a(new Error("Can only apply to VectorLayer or VectorTileLayer"));var s,l,u;function h(){u||e.sprite&&!s?u?(t.setStyle(u),o()):a(new Error("Something went wrong trying to apply style.")):(u=Qf(t,e,i,n,s,l,Uy),t.getStyle()?o():a(new Error("Nothing to show for source ["+i+"]")))}if(e.sprite){var c=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",p=Wy(e.sprite,r,c+".json");fetch(p,{credentials:"same-origin"}).then((function(t){return t.ok||""===c?t:(p=Wy(e.sprite,r,".json"),fetch(p,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();a(new Error("Problem fetching sprite from "+p+": "+t.statusText))})).then((function(t){if(void 0===t)return a(new Error("No sprites found."));s=t,l=Wy(e.sprite,r,c+".png"),h()})).catch((function(t){a(new Error("Sprites cannot be loaded: "+p+": "+t.message))}))}else h()}))},t.proj=sb,t.source=hb,t.sphere=ti,t.style=ub,Object.defineProperty(t,"__esModule",{value:!0})}));
|
||
//# sourceMappingURL=ol-custom.js.map
|