1!function(){"use strict";function t(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}var e=0;function wt(t){return t.ol_uid||(t.ol_uid=++e)}var n=function(t){var e="5.0.2".split("-")[0];this.message="Assertion failed. See https://openlayers.org/en/"+e+"/doc/errors/#"+t+" for details.",this.code=t,this.name="AssertionError"};t(n,Error);var a="add",h="remove",l="propertychange",C="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,o=arguments.length;n<o;++n){var s=i[n];if(null!=s)for(var a in s)s.hasOwnProperty(a)&&(r[a]=s[a])}return r};function g(t){for(var e in t)delete t[e]}function o(t){var e=[];for(var i in t)e.push(t[i]);return e}function Et(t){var e;for(e in t)return!1;return!e}function u(t,e,i,r){for(var n,o=0,s=t.length;o<s;++o)if((n=t[o]).listener===e&&n.bindTo===i)return r&&(n.deleteIndex=o),n}function s(t,e){var i=t.ol_lm;return i?i[e]:void 0}function c(t){var e=t.ol_lm;return e||(e=t.ol_lm={}),e}function r(t,e){var i=s(t,e);if(i){for(var r=0,n=i.length;r<n;++r)t.removeEventListener(e,i[r].boundListener),g(i[r]);i.length=0;var o=t.ol_lm;o&&(delete o[e],0===Object.keys(o).length&&delete t.ol_lm)}}function S(t,e,i,r,n){var o=c(t),s=o[e];s||(s=o[e]=[]);var a,h,l=u(s,i,r,!1);return l?n||(l.callOnce=!1):(l={bindTo:r,callOnce:!!n,listener:i,target:t,type:e},t.addEventListener(e,(h=function(t){var e=a.listener,i=a.bindTo||a.target;return a.callOnce&&f(a),e.call(i,t)},(a=l).boundListener=h)),s.push(l)),l}function p(t,e,i,r){return S(t,e,i,r,!0)}function d(t,e,i,r){var n=s(t,e);if(n){var o=u(n,i,r,!0);o&&f(o)}}function f(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var e=s(t.target,t.type);if(e){var i="deleteIndex"in t?t.deleteIndex:e.indexOf(t);-1!==i&&e.splice(i,1),0===e.length&&r(t.target,t.type)}g(t)}}function _(t){var e=c(t);for(var i in e)r(t,i)}function v(){return!0}function i(){return!1}function F(){}var y=function(){};y.prototype.disposed_=!1,y.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},y.prototype.disposeInternal=F;var m=function(t){this.propagationStopped,this.type=t,this.target=null};function x(t){t.stopPropagation()}m.prototype.preventDefault=m.prototype.stopPropagation=function(){this.propagationStopped=!0};var w=function(){y.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}};t(w,y),w.prototype.addEventListener=function(t,e){var i=this.listeners_[t];i||(i=this.listeners_[t]=[]),-1===i.indexOf(e)&&i.push(e)},w.prototype.dispatchEvent=function(t){var e,i="string"==typeof t?new m(t):t,r=i.type,n=(i.target=this).listeners_[r];if(n){r in this.dispatching_||(this.dispatching_[r]=0,this.pendingRemovals_[r]=0),++this.dispatching_[r];for(var o=0,s=n.length;o<s;++o)if(!1===n[o].call(this,i)||i.propagationStopped){e=!1;break}if(--this.dispatching_[r],0===this.dispatching_[r]){var a=this.pendingRemovals_[r];for(delete this.pendingRemovals_[r];a--;)this.removeEventListener(r,F);delete this.dispatching_[r]}return e}},w.prototype.disposeInternal=function(){_(this)},w.prototype.getListeners=function(t){return this.listeners_[t]},w.prototype.hasListener=function(t){return t?t in this.listeners_:0<Object.keys(this.listeners_).length},w.prototype.removeEventListener=function(t,e){var i=this.listeners_[t];if(i){var r=i.indexOf(e);t in this.pendingRemovals_?(i[r]=F,++this.pendingRemovals_[t]):(i.splice(r,1),0===i.length&&delete this.listeners_[t])}};var E="change",T="clear",R="contextmenu",I="click",L="dblclick",P="dragenter",M="dragover",b="drop",O="error",N="keydown",A="keypress",k="load",G="mousedown",D="mousemove",U="mouseout",j="mousewheel",z="MSPointerDown",B="resize",Y="touchstart",X="wheel",V=function(){w.call(this),this.revision_=0};t(V,w),V.prototype.changed=function(){++this.revision_,this.dispatchEvent(E)},V.prototype.getRevision=function(){return this.revision_},V.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]=S(this,t[n],e);return r}return S(this,t,e)},V.prototype.once=function(t,e){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=p(this,t[n],e);return r}return p(this,t,e)},V.prototype.un=function(t,e){if(Array.isArray(t))for(var i=0,r=t.length;i<r;++i)d(this,t[i],e);else d(this,t,e)};
1var W=function(t,e,i){m.call(this,t),this.key=e,this.oldValue=i};t(W,m);var K=function(t){V.call(this),wt(this),this.values_={},void 0!==t&&this.setProperties(t)};t(K,V);var Z={};function H(t){return Z.hasOwnProperty(t)?Z[t]:Z[t]="change:"+t}K.prototype.get=function(t){var e;return this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},K.prototype.getKeys=function(){return Object.keys(this.values_)},K.prototype.getProperties=function(){return C({},this.values_)},K.prototype.notify=function(t,e){var i;i=H(t),this.dispatchEvent(new W(i,t,e)),i=l,this.dispatchEvent(new W(i,t,e))},K.prototype.set=function(t,e,i){if(i)this.values_[t]=e;else{var r=this.values_[t];r!==(this.values_[t]=e)&&this.notify(t,r)}},K.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},K.prototype.unset=function(t,e){if(t in this.values_){var i=this.values_[t];delete this.values_[t],e||this.notify(t,i)}};var q="length",J=function(t,e){m.call(this,t),this.element=e};t(J,m);var Q=function(t,e){K.call(this);var i=e||{};if(this.unique_=!!i.unique,this.array_=t||[],this.unique_)for(var r=0,n=this.array_.length;r<n;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()};function $(t,e){if(!t)throw new n(e)}t(Q,K),Q.prototype.clear=function(){for(;0<this.getLength();)this.pop()},Q.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},Q.prototype.forEach=function(t){for(var e=this.array_,i=0,r=e.length;i<r;++i)t(e[i],i,e)},Q.prototype.getArray=function(){return this.array_},Q.prototype.item=function(t){return this.array_[t]},Q.prototype.getLength=function(){return this.get(q)},Q.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new J(a,e))},Q.prototype.pop=function(){return this.removeAt(this.getLength()-1)},Q.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},Q.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)},Q.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new J(h,e)),e},Q.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 J(h,r)),this.dispatchEvent(new J(a,e))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},Q.prototype.updateLength_=function(){this.set(q,this.array_.length)},Q.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 n(58)};var tt={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},et={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function it(t){for(var e=ut(),i=0,r=t.length;i<r;++i)yt(e,t[i]);return e}function rt(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 nt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function ot(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 st(t,e){return ht(t,e[0],e[1])}function at(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 lt(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],s=e[0],a=e[1],h=et.UNKNOWN;return s<i?h|=et.LEFT:n<s&&(h|=et.RIGHT),a<r?h|=et.BELOW:o<a&&(h|=et.ABOVE),h===et.UNKNOWN&&(h=et.INTERSECTING),h}function ut(){return[1/0,1/0,-1/0,-1/0]}function ct(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 pt(t){return ct(1/0,1/0,-1/0,-1/0,t)}function dt(t,e){var i=t[0],r=t[1];return ct(i,r,i,r,e)}function ft(t,e){return function(t,e){for(var i=0,r=e.length;i<r;++i)yt(t,e[i]);return t}(pt(e),t)}function gt(t,e,i,r,n){return mt(pt(n),t,e,i,r)}function _t(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function vt(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 yt(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 mt(t,e,i,r,n){for(;i<r;i+=n)xt(t,e[i],e[i+1]);return t}function xt(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 St(t,e,i){var r;return(r=e.call(i,Tt(t)))?r:(r=e.call(i,Rt(t)))?r:(r=e.call(i,bt(t)))?r:(r=e.call(i,Mt(t)))||!1}function Ct(t){var e=0;return At(t)||(e=Ot(t)*Lt(t)),e}function Tt(t){return[t[0],t[1]]}function Rt(t){return[t[2],t[1]]}function It(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Ft(t,e,i,r,n){var o=e*r[0]/2,s=e*r[1]/2,a=Math.cos(i),h=Math.sin(i),l=o*a,u=o*h,c=s*a,p=s*h,d=t[0],f=t[1],g=d-l+p,_=d-l-p,v=d+l-p,y=d+l+p,m=f-u-c,x=f-u+c,S=f+u+c,C=f+u-c;
1return ct(Math.min(g,_,v,y),Math.min(m,x,S,C),Math.max(g,_,v,y),Math.max(m,x,S,C),n)}function Lt(t){return t[3]-t[1]}function Pt(t,e,i){var r=i||[1/0,1/0,-1/0,-1/0];return Nt(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]):pt(r),r}function Mt(t){return[t[0],t[3]]}function bt(t){return[t[2],t[3]]}function Ot(t){return t[2]-t[0]}function Nt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function At(t){return t[2]<t[0]||t[3]<t[1]}function kt(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}function Gt(t,e,i){var r,n,o,s=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return e(s,s,2),r=[s[0],s[2],s[4],s[6]],n=[s[1],s[3],s[5],s[7]],o=i,ct(Math.min.apply(null,r),Math.min.apply(null,n),Math.max.apply(null,r),Math.max.apply(null,n),o)}function Dt(t,e,i,r,n,o){for(var s=o||[],a=0,h=e;h<i;h+=r){var l=t[h],u=t[h+1];s[a++]=n[0]*l+n[2]*u+n[4],s[a++]=n[1]*l+n[3]*u+n[5]}return o&&s.length!=a&&(s.length=a),s}function Ut(t,e,i,r,n,o,s){for(var a=s||[],h=0,l=e;l<i;l+=r){a[h++]=t[l]+n,a[h++]=t[l+1]+o;for(var u=l+2;u<l+r;++u)a[h++]=t[u]}return s&&a.length!=h&&(a.length=h),a}function jt(t,e,i){return Math.min(Math.max(t,e),i)}var zt="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function Bt(t,e,i,r,n,o){var s=n-i,a=o-r;if(0!==s||0!==a){var h=((t-i)*s+(e-r)*a)/(s*s+a*a);1<h?(i=n,r=o):0<h&&(i+=s*h,r+=a*h)}return Yt(t,e,i,r)}function Yt(t,e,i,r){var n=i-t,o=r-e;return n*n+o*o}function Xt(t){return 180*t/Math.PI}function Vt(t){return t*Math.PI/180}function Wt(t,e){var i=t%e;return i*e<0?i+e:i}function Kt(t,e,i){return t+i*(e-t)}var Zt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},Ht=6371008.8;function qt(t,e,i){var r=i||Ht,n=Vt(t[1]),o=Vt(e[1]),s=(o-n)/2,a=Vt(e[0]-t[0])/2,h=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}function Jt(t,e){for(var i=0,r=0,n=t.length;r<n-1;++r)i+=qt(t[r],t[r+1],e);return i}function Qt(t,e){for(var i=0,r=t.length,n=t[r-1][0],o=t[r-1][1],s=0;s<r;s++){var a=t[s][0],h=t[s][1];i+=Vt(a-n)*(2+Math.sin(Vt(o))+Math.sin(Vt(h))),n=a,o=h}return i*e*e/2}var $t={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},te={};te[$t.DEGREES]=2*Math.PI*6370997/360,te[$t.FEET]=.3048,te[$t.METERS]=1,te[$t.USFEET]=1200/3937;var ee=function(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};ee.prototype.canWrapX=function(){return this.canWrapX_},ee.prototype.getCode=function(){return this.code_},ee.prototype.getExtent=function(){return this.extent_},ee.prototype.getUnits=function(){return this.units_},ee.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||te[this.units_]},ee.prototype.getWorldExtent=function(){return this.worldExtent_},ee.prototype.getAxisOrientation=function(){return this.axisOrientation_},ee.prototype.isGlobal=function(){return this.global_},ee.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},ee.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},ee.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},ee.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},ee.prototype.setWorldExtent=function(t){this.worldExtent_=t},ee.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},ee.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var ie=6378137,re=Math.PI*ie,ne=[-re,-re,re,re],oe=[-180,-85,180,85];function se(t){ee.call(this,{code:t,units:$t.METERS,extent:ne,global:!0,worldExtent:oe,getPointResolution:function(t,e){return t/zt(e[1]/ie)}})}t(se,ee);var ae=[new se("EPSG:3857"),new se("EPSG:102100"),new se("EPSG:102113"),new se("EPSG:900913"),new se("urn:ogc:def:crs:EPSG:6.18:3:3857"),new se("urn:ogc:def:crs:EPSG::3857"),new se("http://www.opengis.net/gml/srs/epsg.xml#3857")];function he(t,e,i){var r=t.length,n=1<i?i:2,o=e;void 0===o&&(o=2<n?t.slice():new Array(r));for(var s=re,a=0;a<r;a+=n){o[a]=s*t[a]/180;var h=ie*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));
1s<h?h=s:h<-s&&(h=-s),o[a+1]=h}return o}function le(t,e,i){var r=t.length,n=1<i?i:2,o=e;void 0===o&&(o=2<n?t.slice():new Array(r));for(var s=0;s<r;s+=n)o[s]=180*t[s]/re,o[s+1]=360*Math.atan(Math.exp(t[s+1]/ie))/Math.PI-90;return o}var ue=[-180,-90,180,90],ce=6378137*Math.PI/180;function pe(t,e){ee.call(this,{code:t,units:$t.DEGREES,extent:ue,axisOrientation:e,global:!0,metersPerUnit:ce,worldExtent:ue})}t(pe,ee);var de=[new pe("CRS:84"),new pe("EPSG:4326","neu"),new pe("urn:ogc:def:crs:EPSG::4326","neu"),new pe("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new pe("urn:ogc:def:crs:OGC:1.3:CRS84"),new pe("urn:ogc:def:crs:OGC:2:84"),new pe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new pe("urn:x-ogc:def:crs:EPSG:4326","neu")],fe={};var ge,_e,ve,ye={};function me(t,e,i){var r=t.getCode(),n=e.getCode();r in ye||(ye[r]={}),ye[r][n]=i}function xe(t,e){var i;return t in ye&&e in ye[t]&&(i=ye[t][e]),i}function Se(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 Ce(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 we(t){var e,i;e=t.getCode(),i=t,fe[e]=i,me(t,t,Se)}function Ee(t){var e=null;if(t instanceof ee)e=t;else if("string"==typeof t){e=fe[t]||null}return e}function Te(t,e,i,r){var n,o=(t=Ee(t)).getPointResolutionFunc();if(o)n=o(e,i);else if(t.getUnits()==$t.DEGREES&&!r||r==$t.DEGREES)n=e;else{var s=Me(t,Ee("EPSG:4326")),a=[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=(qt((a=s(a,a,2)).slice(0,2),a.slice(2,4))+qt(a.slice(4,6),a.slice(6,8)))/2;var h=r?te[r]:t.getMetersPerUnit();void 0!==h&&(n/=h)}return n}function Re(t){t.forEach(we),t.forEach(function(e){t.forEach(function(t){e!==t&&me(e,t,Se)})})}function Ie(t,e){return t?"string"==typeof t?Ee(t):t:Ee(e)}function Fe(l){return function(t,e,i){for(var r=t.length,n=void 0!==i?i:2,o=void 0!==e?e:new Array(r),s=0;s<r;s+=n){var a=l([t[s],t[s+1]]);o[s]=a[0],o[s+1]=a[1];for(var h=n-1;2<=h;--h)o[s+h]=t[s+h]}return o}}function Le(t,e,i,r){var n=Ee(t),o=Ee(e);me(n,o,Fe(i)),me(o,n,Fe(r))}function Pe(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return t.getCode()===e.getCode()?i:Me(t,e)===Se&&i}function Me(t,e){var i=xe(t.getCode(),e.getCode());return i||(i=Ce),i}function be(t,e){return Me(Ee(t),Ee(e))}function Oe(t,e,i){return be(e,i)(t,void 0,t.length)}function Ne(t,e,i){return Gt(t,be(e,i))}Re(ae),Re(de),ge=ae,_e=he,ve=le,de.forEach(function(e){ge.forEach(function(t){me(e,t,_e),me(t,e,ve)})});var Ae=new Array(6);function ke(t){return De(t,1,0,0,1,0,0)}function Ge(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],h=e[0],l=e[1],u=e[2],c=e[3],p=e[4],d=e[5];return t[0]=i*h+n*l,t[1]=r*h+o*l,t[2]=i*u+n*c,t[3]=r*u+o*c,t[4]=i*p+n*d+s,t[5]=r*p+o*d+a,t}function De(t,e,i,r,n,o,s){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=o,t[5]=s,t}function Ue(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function je(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 ze(t,e){var i=Math.cos(e),r=Math.sin(e);return Ge(t,De(Ae,i,r,-r,i,0,0))}function Be(t,e,i){return Ge(t,De(Ae,e,0,0,i,0,0))}function Ye(t,e,i){return Ge(t,De(Ae,1,0,0,1,e,i))}function Xe(t,e,i,r,n,o,s,a){var h=Math.sin(o),l=Math.cos(o);return t[0]=r*l,t[1]=n*h,t[2]=-r*h,t[3]=n*l,t[4]=s*r*l-a*r*h+e,t[5]=s*n*h+a*n*l+i,t}function Ve(t){var e,i=(e=t)[0]*e[3]-e[1]*e[2];$(0!==i,32);var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5];return t[0]=s/i,t[1]=-n/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*h-s*a)/i,t[5]=-(r*h-n*a)/i,t}var We=function(){K.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0};t(We,K);var Ke=[1,0,0,1,0,0];We.prototype.clone=function(){},We.prototype.closestPointXY=function(t,e,i,r){},We.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},We.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},We.prototype.computeExtent=function(t){},We.prototype.containsXY=i,We.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),e=this.extent_,(i=t)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i):e;var e,i},We.prototype.rotate=function(t,e){}
1,We.prototype.scale=function(t,e,i){},We.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},We.prototype.getSimplifiedGeometry=function(t){},We.prototype.getType=function(){},We.prototype.applyTransform=function(t){},We.prototype.intersectsExtent=function(t){},We.prototype.translate=function(t,e){},We.prototype.transform=function(s,a){var t=(s=Ee(s)).getUnits()==$t.TILE_PIXELS?function(t,e,i){var r=s.getExtent(),n=s.getWorldExtent(),o=Lt(n)/Lt(r);return Xe(Ke,n[0],n[3],o,-o,0,0,0),Dt(t,0,t.length,i,Ke,e),be(s,a)(t,e,i)}:be(s,a);return this.applyTransform(t),this};var Ze=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,He=/^([a-z]*)$/i;function qe(t){return"string"==typeof t?t:ii(t)}var Je,Qe,$e=(Je={},Qe=0,function(t){var e;if(Je.hasOwnProperty(t))e=Je[t];else{if(1024<=Qe){var i=0;for(var r in Je)0==(3&i++)&&(delete Je[r],--Qe)}e=function(t){var e,i,r,n,o;if(He.exec(t)&&(t=function(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""}(t)),Ze.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var h=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=h?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,r=(r<<4)+r,h&&(n=(n<<4)+n)),o=[e,i,r,n/255]}else 0==t.indexOf("rgba(")?ei(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),ei(o)):$(!1,14);return o}(t),Je[t]=e,++Qe}return e});function ti(t){return Array.isArray(t)?t:$e(t)}function ei(t){return t[0]=jt(t[0]+.5|0,0,255),t[1]=jt(t[1]+.5|0,0,255),t[2]=jt(t[2]+.5|0,0,255),t[3]=jt(t[3],0,1),t}function ii(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 ri(t){return"string"==typeof(e=t)||e instanceof CanvasPattern||e instanceof CanvasGradient?t:ii(t);var e}function ni(t,e){var i=document.createElement("CANVAS");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function oi(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function si(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function ai(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var hi,li,ui=34962,ci=5126,pi=10242,di=10243,fi=3553,gi=33071,_i=36160,vi=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function yi(t,e){for(var i=vi.length,r=0;r<i;++r)try{var n=t.getContext(vi[r],e);if(n)return n}catch(t){}return null}var mi=!1;if("undefined"!=typeof window&&"WebGLRenderingContext"in window)try{var xi=yi(document.createElement("CANVAS"),{failIfMajorPerformanceCaveat:!0});xi&&(mi=!0,hi=xi.getParameter(xi.MAX_TEXTURE_SIZE),li=xi.getSupportedExtensions())}catch(t){}var Si,Ci,wi="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Ei=-1!==wi.indexOf("firefox"),Ti=-1!==wi.indexOf("safari")&&-1==wi.indexOf("chrom"),Ri=-1!==wi.indexOf("webkit")&&-1==wi.indexOf("edge"),Ii=-1!==wi.indexOf("macintosh"),Fi=window.devicePixelRatio||1,Li=function(){var t=!1;try{t=!!document.createElement("CANVAS").getContext("2d").setLineDash}catch(t){}return t}(),Pi="geolocation"in navigator,Mi="ontouchstart"in window,bi="PointerEvent"in window,Oi=!!navigator.msPointerEnabled,Ni={IDLE:0,LOADING:1,LOADED:2,ERROR:3},Ai="ol-hidden",ki="ol-unselectable",Gi="ol-control",Di="ol-collapsed",Ui=(Ci={},function(t){if(Si||(Si=document.createElement("div").style),!(t in Ci)){Si.font=t;var e=Si.fontFamily;if(Si.font="",!e)return null;Ci[t]=e.split(/,\s?/)}return Ci[t]}),ji=function(t){w.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null};t(ji,w),ji.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},ji.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(T)},ji.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},ji.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},ji.prototype.get=function(t){var e=this.entries_[t];return $(void 0!==e,15),e===this.newest_?e.value_:(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,(this.newest_=e).value_)},ji.prototype.remove=function(t){var e=this.entries_[t];return $(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_},ji.prototype.getCount=function(){return this.count_},ji.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},ji.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},ji.prototype.peekLast=function(){return this.oldest_.value_},ji.prototype.peekLastKey=function(){return this.oldest_.key_},ji.prototype.peekFirstKey=function(){return this.newest_.key_},ji.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_},ji.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},ji.prototype.set=function(t,e){$(!(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_},ji.prototype.setSize=function(t){this.highWaterMark=t},ji.prototype.prune=function(){for(;this.canExpireCache();)this.pop()};
1var zi="10px sans-serif",Bi=[0,0,0,1],Yi="round",Xi=[],Vi="round",Wi=[0,0,0,1],Ki="center",Zi=[0,0,0,0],Hi=new ji,qi={},Ji=null,Qi={},$i=function(){var o,s,a=60,h=qi,l="32px ",u=["monospace","serif"],c=u.length,p="wmytzilWMYTZIL@#/&?$%10ï";function d(t){for(var e=tr(),i=!0,r=0;r<c;++r){var n=u[r];if(e.font=l+n,s=e.measureText(p).width,t!=n){e.font=l+t+","+n;var o=e.measureText(p).width;i=i&&o!=s}}return i}function f(){var t=!0;for(var e in h)h[e]<a&&(d(e)?(h[e]=a,g(Qi),Ji=null,Hi.clear()):(++h[e],t=!1));t&&(clearInterval(o),o=void 0)}return function(t){var e=Ui(t);if(e)for(var i=0,r=e.length;i<r;++i){var n=e[i];n in h||(h[n]=a,d(n)||void(h[n]=0)===o&&(o=setInterval(f,32)))}}}();function tr(){return Ji||(Ji=ni(1,1)),Ji}var er,ir,rr=(ir=Qi,function(t){var e=ir[t];return null==e&&(er||((er=document.createElement("span")).textContent="M",er.style.margin=er.style.padding="0 !important",er.style.position="absolute !important",er.style.left="-99999px !important"),er.style.font=t,document.body.appendChild(er),e=ir[t]=er.offsetHeight,document.body.removeChild(er)),e});function nr(t,e){var i=tr();return t!=i.font&&(i.font=t),i.measureText(e).width}function or(t,e,i,r){0!==e&&(t.translate(i,r),t.rotate(e),t.translate(-i,-r))}var sr=[1,0,0,1,0,0];function ar(t,e,i,r,n,o,s,a,h,l,u){var c;1!=i&&(c=t.globalAlpha,t.globalAlpha=c*i),e&&t.setTransform.apply(t,e),t.drawImage(r,n,o,s,a,h,l,s*u,a*u),c&&(t.globalAlpha=c),e&&t.setTransform.apply(t,sr)}var hr=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.snapToPixel_=t.snapToPixel};hr.prototype.getOpacity=function(){return this.opacity_},hr.prototype.getRotateWithView=function(){return this.rotateWithView_},hr.prototype.getRotation=function(){return this.rotation_},hr.prototype.getScale=function(){return this.scale_},hr.prototype.getSnapToPixel=function(){return this.snapToPixel_},hr.prototype.getAnchor=function(){},hr.prototype.getImage=function(t){},hr.prototype.getHitDetectionImage=function(t){},hr.prototype.getImageState=function(){},hr.prototype.getImageSize=function(){},hr.prototype.getHitDetectionImageSize=function(){},hr.prototype.getOrigin=function(){},hr.prototype.getSize=function(){},hr.prototype.setOpacity=function(t){this.opacity_=t},hr.prototype.setRotateWithView=function(t){this.rotateWithView_=t},hr.prototype.setRotation=function(t){this.rotation_=t},hr.prototype.setScale=function(t){this.scale_=t},hr.prototype.setSnapToPixel=function(t){this.snapToPixel_=t},hr.prototype.listenImageChange=function(t,e){},hr.prototype.load=function(){},hr.prototype.unlistenImageChange=function(t,e){};var lr=function(t){this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_);var e=void 0===t.snapToPixel||t.snapToPixel,i=void 0!==t.rotateWithView&&t.rotateWithView;hr.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:e})};t(lr,hr),lr.prototype.clone=function(){var t=new lr({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},lr.prototype.getAnchor=function(){return this.anchor_},lr.prototype.getAngle=function(){return this.angle_},lr.prototype.getFill=function(){return this.fill_},lr.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_},lr.prototype.getImage=function(t){return this.canvas_},lr.prototype.getImageSize=function(){return this.imageSize_},lr.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},lr.prototype.getImageState=function(){return Ni.LOADED},lr.prototype.getOrigin=function(){return this.origin_},lr.prototype.getPoints=function(){return this.points_},lr.prototype.getRadius=function(){return this.radius_},lr.prototype.getRadius2=function(){return this.radius2_},lr.prototype.getSize=function(){return this.size_},lr.prototype.getStroke=function(){return this.stroke_},lr.prototype.listenImageChange=function(t,e){},lr.prototype.load=function(){},lr.prototype.unlistenImageChange=function(t,e){},lr.prototype.render_=function(t){var e,i,r="",n="",o=0,s=null,a=0,h=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=Wi),i=ri(i),void 0===(h=this.stroke_.getWidth())&&(h=1),s=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),Li||(s=null,a=0),void 0===(n=this.stroke_.getLineJoin())&&(n=Vi),void 0===(r=this.stroke_.getLineCap())&&(r=Yi),void 0===(o=this.stroke_.getMiterLimit())&&(o=10));var l=2*(this.radius_+h)+1,u={strokeStyle:i,strokeWidth:h,size:l,lineCap:r,lineDash:s,lineDashOffset:a,lineJoin:n,miterLimit:o};if(void 0===t){var c=ni(l,l);this.canvas_=c.canvas,e=l=this.canvas_.width,this.draw_(u,c,0,0),this.createHitDetectionCanvas_(u)}else{l=Math.round(l);var p,d=!this.fill_;d&&(p=this.drawHitDetectionCanvas_.bind(this,u));var f=this.getChecksum(),g=t.add(f,l,l,this.draw_.bind(this,u),p);this.canvas_=g.image,this.origin_=[g.offsetX,g.offsetY],e=g.image.width,d?(this.hitDetectionCanvas_=g.hitImage,this.hitDetectionImageSize_=[g.hitImage.width,g.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[e,e])}this.anchor_=[l/2,l/2],this.size_=[l,l],this.imageSize_=[e,e]}
1,lr.prototype.draw_=function(t,e,i,r){var n,o,s;e.setTransform(1,0,0,1,0,0),e.translate(i,r),e.beginPath();var a=this.points_;if(a===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(a*=2),n=0;n<=a;n++)o=2*n*Math.PI/a-Math.PI/2+this.angle_,s=n%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(o),t.size/2+s*Math.sin(o))}if(this.fill_){var l=this.fill_.getColor();null===l&&(l=Bi),e.fillStyle=ri(l),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,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()},lr.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var e=ni(t.size,t.size);this.hitDetectionCanvas_=e.canvas,this.drawHitDetectionCanvas_(t,e,0,0)}},lr.prototype.drawHitDetectionCanvas_=function(t,e,i,r){e.setTransform(1,0,0,1,0,0),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,s,a,h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(n*=2),o=0;o<=n;o++)a=2*o*Math.PI/n-Math.PI/2+this.angle_,s=o%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(a),t.size/2+s*Math.sin(a))}e.fillStyle=Bi,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()},lr.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",e=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||e!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+t+e+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,t,e,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var ur=function(t){var e=t||{};lr.call(this,{points:1/0,fill:e.fill,radius:e.radius,snapToPixel:e.snapToPixel,stroke:e.stroke,atlasManager:e.atlasManager})};t(ur,lr),ur.prototype.clone=function(){var t=new ur({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},ur.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)};var cr=function(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.checksum_=void 0};cr.prototype.clone=function(){var t=this.getColor();return new cr({color:t&&t.slice?t.slice():t||void 0})},cr.prototype.getColor=function(){return this.color_},cr.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},cr.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?this.checksum_=wt(this.color_).toString():this.checksum_="f"+(this.color_?qe(this.color_):"-")),this.checksum_};var pr=function(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,this.checksum_=void 0};pr.prototype.clone=function(){var t=this.getColor();return new pr({color:t&&t.slice?t.slice():t||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()})},pr.prototype.getColor=function(){return this.color_},pr.prototype.getLineCap=function(){return this.lineCap_},pr.prototype.getLineDash=function(){return this.lineDash_},pr.prototype.getLineDashOffset=function(){return this.lineDashOffset_},pr.prototype.getLineJoin=function(){return this.lineJoin_},pr.prototype.getMiterLimit=function(){return this.miterLimit_},pr.prototype.getWidth=function(){return this.width_},pr.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},pr.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},pr.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},pr.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},pr.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},pr.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},pr.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},pr.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=wt(this.color_).toString():this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var dr=function(t){var e=t||{};this.geometry_=null,this.geometryFunction_=vr,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};dr.prototype.clone=function(){var t=this.getGeometry();return t&&t.clone&&(t=t.clone()),new dr({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.get
1Stroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},dr.prototype.getRenderer=function(){return this.renderer_},dr.prototype.setRenderer=function(t){this.renderer_=t},dr.prototype.getGeometry=function(){return this.geometry_},dr.prototype.getGeometryFunction=function(){return this.geometryFunction_},dr.prototype.getFill=function(){return this.fill_},dr.prototype.setFill=function(t){this.fill_=t},dr.prototype.getImage=function(){return this.image_},dr.prototype.setImage=function(t){this.image_=t},dr.prototype.getStroke=function(){return this.stroke_},dr.prototype.setStroke=function(t){this.stroke_=t},dr.prototype.getText=function(){return this.text_},dr.prototype.setText=function(t){this.text_=t},dr.prototype.getZIndex=function(){return this.zIndex_},dr.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=vr,this.geometry_=e},dr.prototype.setZIndex=function(t){this.zIndex_=t};var fr=null;function gr(t,e){if(!fr){var i=new cr({color:"rgba(255,255,255,0.4)"}),r=new pr({color:"#3399CC",width:1.25});fr=[new dr({image:new ur({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return fr}function _r(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Zt.POLYGON]=[new dr({fill:new cr({color:[255,255,255,.5]})})],t[Zt.MULTI_POLYGON]=t[Zt.POLYGON],t[Zt.LINE_STRING]=[new dr({stroke:new pr({color:e,width:5})}),new dr({stroke:new pr({color:i,width:3})})],t[Zt.MULTI_LINE_STRING]=t[Zt.LINE_STRING],t[Zt.CIRCLE]=t[Zt.POLYGON].concat(t[Zt.LINE_STRING]),t[Zt.POINT]=[new dr({image:new ur({radius:6,fill:new cr({color:i}),stroke:new pr({color:e,width:1.5})}),zIndex:1/0})],t[Zt.MULTI_POINT]=t[Zt.POINT],t[Zt.GEOMETRY_COLLECTION]=t[Zt.POLYGON].concat(t[Zt.LINE_STRING],t[Zt.POINT]),t}function vr(t){return t.getGeometry()}var yr=function(t){if(K.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,S(this,H(this.geometryName_),this.handleGeometryChanged_,this),void 0!==t)if(t instanceof We||!t){var e=t;this.setGeometry(e)}else{var i=t;this.setProperties(i)}};t(yr,K),yr.prototype.clone=function(){var t=new yr(this.getProperties());t.setGeometryName(this.getGeometryName());var e=this.getGeometry();e&&t.setGeometry(e.clone());var i=this.getStyle();return i&&t.setStyle(i),t},yr.prototype.getGeometry=function(){return this.get(this.geometryName_)},yr.prototype.getId=function(){return this.id_},yr.prototype.getGeometryName=function(){return this.geometryName_},yr.prototype.getStyle=function(){return this.style_},yr.prototype.getStyleFunction=function(){return this.styleFunction_},yr.prototype.handleGeometryChange_=function(){this.changed()},yr.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(f(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=S(t,E,this.handleGeometryChange_,this)),this.changed()},yr.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},yr.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){{return"function"==typeof t?t:(Array.isArray(t)?e=t:($(t instanceof dr,41),e=[t]),function(){return e});var e}}(t):void 0,this.changed()},yr.prototype.setId=function(t){this.id_=t,this.changed()},yr.prototype.setGeometryName=function(t){d(this,H(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,S(this,H(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()};var mr="accuracy",xr="accuracyGeometry",Sr="altitude",Cr="altitudeAccuracy",wr="heading",Er="position",Tr="projection",Rr="speed",Ir="tracking",Fr="trackingOptions";function Lr(t,e){return e<t?1:t<e?-1:0}function Pr(t,e){return 0<=t.indexOf(e)}function Mr(t,e,i){var r,n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;if(0<i){for(r=1;r<n;++r)if(t[r]<e)return r-1}else if(i<0){for(r=1;r<n;++r)if(t[r]<=e)return r}else for(r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return n-1}function br(t,e,i){for(;e<i;){var r=t[e];t[e]=t[i],t[i]=r,++e,--i}}function Or(t,e){for(var i=Array.isArray(e)?e:[e],r=i.length,n=0;n<r;n++)t[t.length]=i[n]}function Nr(t,e){for(var i,r=t.length>>>0,n=0;n<r;n++)if(e(i=t[n],n,t))return i;return null}function Ar(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 kr(t,i){var e,r=t.length,n=Array(t.length);for(e=0;e<r;e++)n[e]={index:e,value:t[e]};for(n.sort(function(t,e){return i(t.value,e.value)||t.index-e.index}),e=0;e<t.length;e++)t[e]=n[e].value}function Gr(i,r){var n;return!i.every(function(t,e){return!r(t,n=e,i)})?n:-1}var Dr={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},Ur=function(){We.call(this),this.layout=Dr.XY,this.stride=2,this.flatCoordinates=null};function jr(t){var e;return t==Dr.XY?e=2:t==Dr.XYZ||t==Dr.XYM?e=3:t==Dr.XYZM&&(e=4),e}function zr(t,e,i,r){for(var n=0,o=t[i-r],s=t[i-r+1];e<i;e+=r){var a=t[e],h=t[e+1];n+=s*a-o*h,o=a,s=h}return n/2}function Br(t,e,i,r){for(var n=0,o=0,s=i.length;o<s;++o){var a=i[o];n+=zr(t,e,a,r),e=a}return n}function Yr(t,e,i,r,n,o,s){var a,h=t[e],l=t[e+1],u=t[i]-h,c=t[i+1]-l;if(0===u&&0===c)a=e;else{var p=((n-h)*u+(o-l)*c)/(u*u+c*c);if(1<p)a=i;else{if(0<p){for(var d=0;d<r;++d)s[d]=Kt(t[e+d],t[i+d],p);return void(s.length=r)}a=e}}for(var f=0;f<r;++f)s[f]=t[a+f];s.length=r}function Xr(t,e,i,r,n){var o=t[e],s=t[e+1];for(e+=r;e<i;e+=r){var a=t[e],h=t[e+1],l=Yt(o,s,a,h);n<l&&(n=l),o=a,s=h}return n}function Vr(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];n=Xr(t,e,a,r,n),e=a}return n}function Wr(t,e,i,r,n,o,s,a,h,l,u){if(e==i)return l;var c,p;if(0===n){if((p=Yt(s,a,t[e],t[e+1]))<l){for(c=0;c<r;++c)h[c]=t[e+c];return h.length=r,p}return l}for(var d=u||[NaN,NaN],f=e+r;f<i;)if(Yr(t,f-r,f,r,s,a,d),(p=Yt(s,a,d[0],d[1]))<l){for(l=p,c=0;c<r;++c)h[c]=d[c];f+=h.length=r}else f+=r*Math.max((Math.sqrt(p)-Math.sqrt(l))/n|0,1);if(o&&(Yr(t,i-r,e,r,s,a,d),(p=Yt(s,a,d[0],d[1]))<l)){for(l=p,c=0;c<r;++c)h[c]=d[c];h.length=r}return l}function Kr(t,e,i,r,n,o,s,a,h,l,u){for(var c=u||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];l=Wr(t,e,f,r,n,o,s,a,h,l,c),e=f}return l}function Zr(t,e,i,r){for(var n=0,o=i.length;n<o;++n)t[e++]=i[n];return e}function Hr(t,e,i,r){for(var n=0,o=i.length;n<o;++n)for(var s=i[n],a=0;a<r;++a)t[e++]=s[a];return e}function qr(t,e,i,r,n){for(var o=n||[],s=0,a=0,h=i.length;a<h;++a){var l=Hr(t,e,i[a],r);e=o[s++]=l}return o.length=s,o}function Jr(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=e;a<i;a+=r)o[s++]=t.slice(a,a+r);return o.length=s,o}function Qr(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];o[s++]=Jr(t,e,l,r,o[s]),e=l}return o.length=s,o}function $r(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];o[s++]=Qr(t,e,l,r,o[s]),e=l[l.length-1]}return o.length=s,o}function tn(t,e,i,r,n,o,s){var a=(i-e)/r;if(a<3){for(;e<i;e+=r)o[s++]=t[e],o[s++]=t[e+1];return s}var h=new Array(a);h[0]=1,h[a-1]=1;for(var l=[e,i-r],u=0;0<l.length;){for(var c=l.pop(),p=l.pop(),d=0,f=t[p],g=t[p+1],_=t[c],v=t[c+1],y=p+r;y<c;y+=r){var m=Bt(t[y],t[y+1],f,g,_,v);d<m&&(u=y,d=m)}n<d&&(h[(u-e)/r]=1,p+r<u&&l.push(p,u),u+r<c&&l.push(u,c))}for(var x=0;x<a;++x)h[x]&&(o[s++]=t[e+x*r],o[s++]=t[e+x*r+1]);return s}function en(t,e){return e*Math.round(t/e)}
1function rn(t,e,i,r,n,o,s){if(e==i)return s;var a,h,l=en(t[e],n),u=en(t[e+1],n);e+=r,o[s++]=l,o[s++]=u;do{if(a=en(t[e],n),h=en(t[e+1],n),(e+=r)==i)return o[s++]=a,o[s++]=h,s}while(a==l&&h==u);for(;e<i;){var c=en(t[e],n),p=en(t[e+1],n);if(e+=r,c!=a||p!=h){var d=a-l,f=h-u,g=c-l,_=p-u;d*_==f*g&&(d<0&&g<d||d==g||0<d&&d<g)&&(f<0&&_<f||f==_||0<f&&f<_)||(l=o[s++]=a,u=o[s++]=h),a=c,h=p}}return o[s++]=a,o[s++]=h,s}function nn(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=rn(t,e,u,r,n,o,s),a.push(s),e=u}return s}t(Ur,We),Ur.prototype.containsXY=i,Ur.prototype.computeExtent=function(t){return gt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},Ur.prototype.getCoordinates=function(){},Ur.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},Ur.prototype.getFlatCoordinates=function(){return this.flatCoordinates},Ur.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},Ur.prototype.getLayout=function(){return this.layout},Ur.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(g(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(e))return this.simplifiedGeometryCache[e];var i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?this.simplifiedGeometryCache[e]=i:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},Ur.prototype.getSimplifiedGeometryInternal=function(t){return this},Ur.prototype.getStride=function(){return this.stride},Ur.prototype.setFlatCoordinatesInternal=function(t,e){this.stride=jr(t),this.layout=t,this.flatCoordinates=e},Ur.prototype.setCoordinates=function(t,e){},Ur.prototype.setLayout=function(t,e,i){var r,n,o;if(t)r=jr(t);else{for(var s=0;s<i;++s){if(0===e.length)return this.layout=Dr.XY,void(this.stride=2);e=e[0]}r=e.length,2==(n=r)?o=Dr.XY:3==n?o=Dr.XYZ:4==n&&(o=Dr.XYZM),t=o}this.layout=t,this.stride=r},Ur.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},Ur.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(t,e,i,r,n,o,s){for(var a=s||[],h=Math.cos(n),l=Math.sin(n),u=o[0],c=o[1],p=0,d=e;d<i;d+=r){var f=t[d]-u,g=t[d+1]-c;a[p++]=u+f*h-g*l,a[p++]=c+f*l+g*h;for(var _=d+2;_<d+r;++_)a[p++]=t[_]}s&&a.length!=p&&(a.length=p)}(i,0,i.length,r,t,e,i),this.changed()}},Ur.prototype.scale=function(t,e,i){var r=e;void 0===r&&(r=t);var n=i;n||(n=It(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,i,r,n,o,s,a){for(var h=a||[],l=s[0],u=s[1],c=0,p=e;p<i;p+=r){var d=t[p]-l,f=t[p+1]-u;h[c++]=l+n*d,h[c++]=u+o*f;for(var g=p+2;g<p+r;++g)h[c++]=t[g]}a&&h.length!=c&&(h.length=c)}(o,0,o.length,s,t,r,n,o),this.changed()}},Ur.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var r=this.getStride();Ut(i,0,i.length,r,t,e,i),this.changed()}};var on=function(t,e){Ur.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,e)};t(on,Ur),on.prototype.clone=function(){var t=new on(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},on.prototype.closestPointXY=function(t,e,i,r){return r<ot(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))},on.prototype.getArea=function(){return zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},on.prototype.getCoordinates=function(){return Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},on.prototype.getSimplifiedGeometryInternal=function(t){var e=[];e.length=tn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0);var i=new on(null);return i.setFlatCoordinates(Dr.XY,e),i},on.prototype.getType=function(){return Zt.LINEAR_RING},on.prototype.intersectsExtent=function(t){},on.prototype.setCoordinates=function(t,e){t?(this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Hr(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Dr.XY,null)},on.prototype.setFlatCoordinates=function(t,e){this.setFlatCoordinatesInternal(t,e),this.changed()};var sn=function(t,e){Ur.call(this),this.setCoordinates(t,e)};function an(e,i,r,n,t){return!St(t,function(t){return!hn(e,i,r,n,t[0],t[1])})}function hn(t,e,i,r,n,o){for(var s=0,a=t[i-r],h=t[i-r+1];e<i;e+=r){var l=t[e],u=t[e+1];h<=o?o<u&&0<(l-a)*(o-h)-(n-a)*(u-h)&&s++:u<=o&&(l-a)*(o-h)-(n-a)*(u-h)<0&&s--,a=l,h=u}return 0!==s}function ln(t,e,i,r,n,o){if(0===i.length)return!1;
1if(!hn(t,e,i[0],r,n,o))return!1;for(var s=1,a=i.length;s<a;++s)if(hn(t,i[s-1],i[s],r,n,o))return!1;return!0}function un(t,e,i,r,n,o,s){for(var a,h,l,u,c,p,d,f=n[o+1],g=[],_=0,v=i.length;_<v;++_){var y=i[_];for(u=t[y-r],p=t[y-r+1],a=e;a<y;a+=r)c=t[a],d=t[a+1],(f<=p&&d<=f||p<=f&&f<=d)&&(l=(f-p)/(d-p)*(c-u)+u,g.push(l)),u=c,p=d}var m=NaN,x=-1/0;for(g.sort(Lr),u=g[0],a=1,h=g.length;a<h;++a){c=g[a];var S=Math.abs(c-u);x<S&&ln(t,e,i,r,l=(u+c)/2,f)&&(m=l,x=S),u=c}return isNaN(m)&&(m=n[o]),s?(s.push(m,f,x),s):[m,f,x]}function cn(t,e,i,r,n){for(var o=[],s=0,a=i.length;s<a;++s){var h=i[s];o=un(t,e,h,r,n,2*s,o),e=h[h.length-1]}return o}function pn(t,e,i,r,n,o){for(var s,a=[t[e],t[e+1]],h=[];e+r<i;e+=r){if(h[0]=t[e+r],h[1]=t[e+r+1],s=n.call(o,a,h))return s;a[0]=h[0],a[1]=h[1]}return!1}function dn(t,e,i,r,n){var o=mt([1/0,1/0,-1/0,-1/0],t,e,i,r);return!!Nt(n,o)&&(!!at(n,o)||(o[0]>=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||pn(t,e,i,r,function(t,e){return function(t,e,i){var r=!1,n=lt(t,e),o=lt(t,i);if(n===et.INTERSECTING||o===et.INTERSECTING)r=!0;else{var s,a,h=t[0],l=t[1],u=t[2],c=t[3],p=e[0],d=e[1],f=i[0],g=i[1],_=(g-d)/(f-p);o&et.ABOVE&&!(n&et.ABOVE)&&(r=h<=(s=f-(g-c)/_)&&s<=u),r||!(o&et.RIGHT)||n&et.RIGHT||(r=l<=(a=g-(f-u)*_)&&a<=c),r||!(o&et.BELOW)||n&et.BELOW||(r=h<=(s=f-(g-l)/_)&&s<=u),r||!(o&et.LEFT)||n&et.LEFT||(r=l<=(a=g-(f-h)*_)&&a<=c)}return r}(n,t,e)}))))}function fn(t,e,i,r,n){if(o=t,s=e,a=i[0],!(dn(o,s,a,h=r,l=n)||hn(o,s,a,h,l[0],l[1])||hn(o,s,a,h,l[0],l[3])||hn(o,s,a,h,l[2],l[1])||hn(o,s,a,h,l[2],l[3])))return!1;var o,s,a,h,l;if(1===i.length)return!0;for(var u=1,c=i.length;u<c;++u)if(an(t,i[u-1],i[u],r,n))return!1;return!0}function gn(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 _n(t,e,i,r){for(var n=0,o=t[i-r],s=t[i-r+1];e<i;e+=r){var a=t[e],h=t[e+1];n+=(a-o)*(h+s),o=a,s=h}return 0<n}function vn(t,e,i,r,n){for(var o=void 0!==n&&n,s=0,a=i.length;s<a;++s){var h=i[s],l=_n(t,e,h,r);if(0===s){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=h}return!0}function yn(t,e,i,r,n){for(var o=void 0!==n&&n,s=0,a=i.length;s<a;++s){var h=i[s],l=_n(t,e,h,r);(0===s?o&&l||!o&&!l:o&&!l||!o&&l)&&gn(t,e,h,r),e=h}return e}function mn(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o)e=yn(t,e,i[o],r,n);return e}t(sn,Ur),sn.prototype.clone=function(){var t=new sn(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},sn.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=Yt(t,e,n[0],n[1]);if(o<r){for(var s=this.stride,a=0;a<s;++a)i[a]=n[a];return i.length=s,o}return r},sn.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},sn.prototype.computeExtent=function(t){return dt(this.flatCoordinates,t)},sn.prototype.getType=function(){return Zt.POINT},sn.prototype.intersectsExtent=function(t){return ht(t,this.flatCoordinates[0],this.flatCoordinates[1])},sn.prototype.setCoordinates=function(t,e){t?(this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zr(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Dr.XY,null)},sn.prototype.setFlatCoordinates=function(t,e){this.setFlatCoordinatesInternal(t,e),this.changed()};var xn=function(t,e){Ur.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(t,e)};function Sn(t,e,i,r){for(var n,o,s,a,h,l,u,c,p=i||32,d=[],f=0;f<p;++f)Or(d,(n=t,o=e,s=2*Math.PI*f/p,void 0,a=r||Ht,h=Vt(n[1]),l=Vt(n[0]),u=o/a,c=Math.asin(Math.sin(h)*Math.cos(u)+Math.cos(h)*Math.sin(u)*Math.cos(s)),[Xt(l+Math.atan2(Math.sin(s)*Math.sin(u)*Math.cos(h),Math.cos(u)-Math.sin(h)*Math.sin(c))),Xt(c)]));d.push(d[0],d[1]);var g=new xn(null);return g.setFlatCoordinates(Dr.XY,d,[d.length]),g}function Cn(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],s=new xn(null);return s.setFlatCoordinates(Dr.XY,o,[o.length]),s}function wn(t,e,i){for(var r=e||32,n=t.getStride(),o=t.getLayout(),s=new xn(null,o),a=n*(r+1),h=new Array(a),l=0;l<a;l++)h[l]=0;var u=[h.length];return s.setFlatCoordinates(o,h,u),En(s,t.getCenter(),t.getRadius(),i),s}
1function En(t,e,i,r){for(var n=t.getFlatCoordinates(),o=t.getLayout(),s=t.getStride(),a=t.getEnds(),h=n.length/s-1,l=r||0,u=0;u<=h;++u){var c=u*s,p=l+2*Wt(u,h)*Math.PI/h;n[c]=e[0]+i*Math.cos(p),n[c+1]=e[1]+i*Math.sin(p)}t.setFlatCoordinates(o,n,a)}t(xn,Ur),xn.prototype.appendLinearRing=function(t){this.flatCoordinates?Or(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},xn.prototype.clone=function(){var t=new xn(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),t},xn.prototype.closestPointXY=function(t,e,i,r){return r<ot(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Vr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Kr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))},xn.prototype.containsXY=function(t,e){return ln(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},xn.prototype.getArea=function(){return Br(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},xn.prototype.getCoordinates=function(t){var e;return void 0!==t?yn(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Qr(e,0,this.ends_,this.stride)},xn.prototype.getEnds=function(){return this.ends_},xn.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=It(this.getExtent());this.flatInteriorPoint_=un(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},xn.prototype.getInteriorPoint=function(){return new sn(this.getFlatInteriorPoint(),Dr.XYM)},xn.prototype.getLinearRingCount=function(){return this.ends_.length},xn.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t)return null;var e=new on(null);return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t])),e},xn.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,r=[],n=0,o=0,s=i.length;o<s;++o){var a=i[o],h=new on(null);h.setFlatCoordinates(t,e.slice(n,a)),r.push(h),n=a}return r},xn.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;vn(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=yn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},xn.prototype.getSimplifiedGeometryInternal=function(t){var e=[],i=[];e.length=nn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i);var r=new xn(null);return r.setFlatCoordinates(Dr.XY,e,i),r},xn.prototype.getType=function(){return Zt.POLYGON},xn.prototype.intersectsExtent=function(t){return fn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},xn.prototype.setCoordinates=function(t,e){if(t){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=qr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}else this.setFlatCoordinates(Dr.XY,null,this.ends_)},xn.prototype.setFlatCoordinates=function(t,e,i){this.setFlatCoordinatesInternal(t,e),this.ends_=i,this.changed()};var Tn=function(t){K.call(this);var e=t||{};this.position_=null,this.transform_=Ce,this.watchId_=void 0,S(this,H(Tr),this.handleProjectionChanged_,this),S(this,H(Ir),this.handleTrackingChanged_,this),void 0!==e.projection&&this.setProjection(e.projection),void 0!==e.trackingOptions&&this.setTrackingOptions(e.trackingOptions),this.setTracking(void 0!==e.tracking&&e.tracking)};function Rn(t,e,i){var r=void 0!==i?t.toFixed(i):""+t,n=r.indexOf(".");return e<(n=-1===n?r.length:n)?r:new Array(1+e-n).join("0")+r}function In(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),s=parseInt(r[n]||"0",10);if(s<o)return 1;if(o<s)return-1}return 0}function Fn(t,e){return t[0]+=e[0],t[1]+=e[1],t}function Ln(t,e){var i,r,n=t[0],o=t[1],s=e[0],a=e[1],h=s[0],l=s[1],u=a[0],c=a[1],p=u-h,d=c-l,f=0===p&&0===d?0:(p*(n-h)+d*(o-l))/(p*p+d*d||0);return f<=0?(i=h,r=l):1<=f?(i=u,r=c):(i=h+f*p,r=l+f*d),[i,r]}function Pn(t,e,i){var r=Wt(e+180,360)-180,n=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),a=Math.floor(n/3600),h=Math.floor((n-3600*a)
1/60),l=n-3600*a-60*h;return 60<=(l=Math.ceil(l*s)/s)&&(l=0,h+=1),60<=h&&(h=0,a+=1),a+"° "+Rn(h,2)+"â² "+Rn(l,2,o)+"â³"+(0==r?"":" "+t.charAt(r<0?1:0))}function Mn(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function bn(t,e){for(var i=!0,r=t.length-1;0<=r;--r)if(t[r]!=e[r]){i=!1;break}return i}function On(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 Nn(t,e){return t[0]*=e,t[1]*=e,t}function An(t,e){var i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function kn(t,e){return Math.sqrt(An(t,e))}function Gn(t,e){return An(t,Ln(t,e))}function Dn(t,e){return Mn(t,"{x}, {y}",e)}function Un(t,e,i,r,n,o){var s=NaN,a=NaN,h=(i-e)/r;if(1===h)s=t[e],a=t[e+1];else if(2==h)s=(1-n)*t[e]+n*t[e+r],a=(1-n)*t[e+1]+n*t[e+r+1];else if(0!==h){for(var l=t[e],u=t[e+1],c=0,p=[0],d=e+r;d<i;d+=r){var f=t[d],g=t[d+1];c+=Math.sqrt((f-l)*(f-l)+(g-u)*(g-u)),p.push(c),l=f,u=g}var _=n*c,v=function(t,e,i){for(var r,n,o=i||Lr,s=0,a=t.length,h=!1;s<a;)(n=+o(t[r=s+(a-s>>1)],e))<0?s=r+1:(a=r,h=!n);return h?s:~s}(p,_);if(v<0){var y=(_-p[-v-2])/(p[-v-1]-p[-v-2]),m=e+(-v-2)*r;s=Kt(t[m],t[m+r],y),a=Kt(t[m+1],t[m+r+1],y)}else s=t[e+v*r],a=t[e+v*r+1]}return o?(o[0]=s,o[1]=a,o):[s,a]}function jn(t,e,i,r,n,o){if(i==e)return null;var s;if(n<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=n,s):null;if(t[i-1]<n)return o?((s=t.slice(i-r,i))[r-1]=n,s):null;if(n==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,h=i/r;a<h;){var l=a+h>>1;n<t[(l+1)*r-1]?h=l:a=l+1}var u=t[a*r-1];if(n==u)return t.slice((a-1)*r,(a-1)*r+r);var c=(n-u)/(t[(a+1)*r-1]-u);s=[];for(var p=0;p<r-1;++p)s.push(Kt(t[(a-1)*r+p],t[a*r+p],c));return s.push(n),s}function zn(t,e,i,r){for(var n=t[e],o=t[e+1],s=0,a=e+r;a<i;a+=r){var h=t[a],l=t[a+1];s+=Math.sqrt((h-n)*(h-n)+(l-o)*(l-o)),n=h,o=l}return s}t(Tn,K),Tn.prototype.disposeInternal=function(){this.setTracking(!1),K.prototype.disposeInternal.call(this)},Tn.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=Me(Ee("EPSG:4326"),t),this.position_&&this.set(Er,this.transform_(this.position_)))},Tn.prototype.handleTrackingChanged_=function(){if(Pi){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},Tn.prototype.positionChange_=function(t){var e=t.coords;this.set(mr,e.accuracy),this.set(Sr,null===e.altitude?void 0:e.altitude),this.set(Cr,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(wr,null===e.heading?void 0:Vt(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var i=this.transform_(this.position_);this.set(Er,i),this.set(Rr,null===e.speed?void 0:e.speed);var r=Sn(this.position_,e.accuracy);r.applyTransform(this.transform_),this.set(xr,r),this.changed()},Tn.prototype.positionError_=function(t){t.type=O,this.setTracking(!1),this.dispatchEvent(t)},Tn.prototype.getAccuracy=function(){return this.get(mr)},Tn.prototype.getAccuracyGeometry=function(){return this.get(xr)||null},Tn.prototype.getAltitude=function(){return this.get(Sr)},Tn.prototype.getAltitudeAccuracy=function(){return this.get(Cr)},Tn.prototype.getHeading=function(){return this.get(wr)},Tn.prototype.getPosition=function(){return this.get(Er)},Tn.prototype.getProjection=function(){return this.get(Tr)},Tn.prototype.getSpeed=function(){return this.get(Rr)},Tn.prototype.getTracking=function(){return this.get(Ir)},Tn.prototype.getTrackingOptions=function(){return this.get(Fr)},Tn.prototype.setProjection=function(t){this.set(Tr,Ee(t))},Tn.prototype.setTracking=function(t){this.set(Ir,t)},Tn.prototype.setTrackingOptions=function(t){this.set(Fr,t)};var Bn=function(t,e){Ur.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,e)};function Yn(t,e,i){for(var r,n,o,s,a,h,l=[],u=t(0),c=t(1),p=e(u),d=e(c),f=[
1c,u],g=[d,p],_=[1,0],v={},y=1e5;0<--y&&0<_.length;)o=_.pop(),u=f.pop(),p=g.pop(),(h=o.toString())in v||(l.push(p[0],p[1]),v[h]=!0),s=_.pop(),c=f.pop(),d=g.pop(),Bt((n=e(r=t(a=(o+s)/2)))[0],n[1],p[0],p[1],d[0],d[1])<i?(l.push(d[0],d[1]),v[h=s.toString()]=!0):(_.push(s,a,a,o),g.push(d,n,n,p),f.push(c,r,r,u));return l}t(Bn,Ur),Bn.prototype.appendCoordinate=function(t){this.flatCoordinates?Or(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},Bn.prototype.clone=function(){var t=new Bn(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},Bn.prototype.closestPointXY=function(t,e,i,r){return r<ot(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))},Bn.prototype.forEachSegment=function(t){return pn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},Bn.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Dr.XYM&&this.layout!=Dr.XYZM)return null;var i=void 0!==e&&e;return jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},Bn.prototype.getCoordinates=function(){return Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},Bn.prototype.getCoordinateAt=function(t,e){return Un(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e)},Bn.prototype.getLength=function(){return zn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},Bn.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},Bn.prototype.getSimplifiedGeometryInternal=function(t){var e=[];e.length=tn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0);var i=new Bn(null);return i.setFlatCoordinates(Dr.XY,e),i},Bn.prototype.getType=function(){return Zt.LINE_STRING},Bn.prototype.intersectsExtent=function(t){return dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},Bn.prototype.setCoordinates=function(t,e){t?(this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Hr(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Dr.XY,null)},Bn.prototype.setFlatCoordinates=function(t,e){this.setFlatCoordinatesInternal(t,e),this.changed()};var Xn="postcompose",Vn="precompose",Wn="render",Kn="point",Zn="line",Hn=function(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new cr({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Kn,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};Hn.prototype.clone=function(){return new Hn({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),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})},Hn.prototype.getOverflow=function(){return this.overflow_},Hn.prototype.getFont=function(){return this.font_},Hn.prototype.getMaxAngle=function(){return this.maxAngle_},Hn.prototype.getPlacement=function(){return this.placement_},Hn.prototype.getOffsetX=function(){return this.offsetX_},Hn.prototype.getOffsetY=function(){return this.offsetY_},Hn.prototype.getFill=function(){return this.fill_},Hn.prototype.getRotateWithView=function(){return this.rotateWithView_},Hn.prototype.getRotation=function(){return this.rotation_},Hn.prototype.getScale=function(){return this.scale_},Hn.prototype.getStroke=function(){return this.stroke_},Hn.prototype.getText=function(){return this.text_},Hn.prototype.getTextAlign=function(){return this.textAlign_},Hn.prototype.getTextBaseline=function(){return this.textBaseline_}
1,Hn.prototype.getBackgroundFill=function(){return this.backgroundFill_},Hn.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},Hn.prototype.getPadding=function(){return this.padding_},Hn.prototype.setOverflow=function(t){this.overflow_=t},Hn.prototype.setFont=function(t){this.font_=t},Hn.prototype.setMaxAngle=function(t){this.maxAngle_=t},Hn.prototype.setOffsetX=function(t){this.offsetX_=t},Hn.prototype.setOffsetY=function(t){this.offsetY_=t},Hn.prototype.setPlacement=function(t){this.placement_=t},Hn.prototype.setFill=function(t){this.fill_=t},Hn.prototype.setRotation=function(t){this.rotation_=t},Hn.prototype.setScale=function(t){this.scale_=t},Hn.prototype.setStroke=function(t){this.stroke_=t},Hn.prototype.setText=function(t){this.text_=t},Hn.prototype.setTextAlign=function(t){this.textAlign_=t},Hn.prototype.setTextBaseline=function(t){this.textBaseline_=t},Hn.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},Hn.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},Hn.prototype.setPadding=function(t){this.padding_=t};var qn=new pr({color:"rgba(0,0,0,0.2)"}),Jn=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],Qn=function(t){var e=t||{};this.map_=null,this.postcomposeListenerKey_=null,this.projection_=null,this.maxLat_=1/0,this.maxLon_=1/0,this.minLat_=-1/0,this.minLon_=-1/0,this.maxLatP_=1/0,this.maxLonP_=1/0,this.minLatP_=-1/0,this.minLonP_=-1/0,this.targetSize_=void 0!==e.targetSize?e.targetSize:100,this.maxLines_=void 0!==e.maxLines?e.maxLines:100,this.meridians_=[],this.parallels_=[],this.strokeStyle_=void 0!==e.strokeStyle?e.strokeStyle:qn,this.fromLonLatTransform_=void 0,this.toLonLatTransform_=void 0,this.projectionCenterLonLat_=null,this.meridiansLabels_=null,this.parallelsLabels_=null,1==e.showLabels&&(this.lonLabelFormatter_=null==e.lonLabelFormatter?Pn.bind(this,"EW"):e.lonLabelFormatter,this.latLabelFormatter_=null==e.latLabelFormatter?Pn.bind(this,"NS"):e.latLabelFormatter,this.lonLabelPosition_=null==e.lonLabelPosition?0:e.lonLabelPosition,this.latLabelPosition_=null==e.latLabelPosition?1:e.latLabelPosition,this.lonLabelStyle_=void 0!==e.lonLabelStyle?e.lonLabelStyle:new Hn({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new cr({color:"rgba(0,0,0,1)"}),stroke:new pr({color:"rgba(255,255,255,1)",width:3})}),this.latLabelStyle_=void 0!==e.latLabelStyle?e.latLabelStyle:new Hn({font:"12px Calibri,sans-serif",textAlign:"end",fill:new cr({color:"rgba(0,0,0,1)"}),stroke:new pr({color:"rgba(255,255,255,1)",width:3})}),this.meridiansLabels_=[],this.parallelsLabels_=[]),this.setMap(void 0!==e.map?e.map:null)};Qn.prototype.addMeridian_=function(t,e,i,r,n,o){var s=this.getMeridian_(t,e,i,r,o);if(Nt(s.getExtent(),n)){if(this.meridiansLabels_){var a=this.getMeridianPoint_(s,n,o);this.meridiansLabels_[o]={geom:a,text:this.lonLabelFormatter_(t)}}this.meridians_[o++]=s}return o},Qn.prototype.getMeridianPoint_=function(t,e,i){var r=t.getFlatCoordinates(),n=Math.max(e[1],r[1]),o=Math.min(e[3],r[r.length-1]),s=jt(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,n,o),a=[r[0],s],h=void 0!==this.meridiansLabels_[i]?this.meridiansLabels_[i].geom:new sn(null);return h.setCoordinates(a),h},Qn.prototype.addParallel_=function(t,e,i,r,n,o){var s=this.getParallel_(t,e,i,r,o);if(Nt(s.getExtent(),n)){if(this.parallelsLabels_){var a=this.getParallelPoint_(s,n,o);this.parallelsLabels_[o]={geom:a,text:this.latLabelFormatter_(t)}}this.parallels_[o++]=s}return o},Qn.prototype.getParallelPoint_=function(t,e,i){var r=t.getFlatCoordinates(),n=Math.max(e[0],r[0]),o=Math.min(e[2],r[r.length-2]),s=[jt
1(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,n,o),r[1]],a=void 0!==this.parallelsLabels_[i]?this.parallelsLabels_[i].geom:new sn(null);return a.setCoordinates(s),a},Qn.prototype.createGraticule_=function(t,e,i,r){var n=this,o=this.getInterval_(i);if(-1==o)return this.meridians_.length=this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var s,a,h,l,u=this.toLonLatTransform_(e),c=u[0],p=u[1],d=this.maxLines_,f=[Math.max(t[0],this.minLonP_),Math.max(t[1],this.minLatP_),Math.min(t[2],this.maxLonP_),Math.min(t[3],this.maxLatP_)],g=(f=Ne(f,this.projection_,"EPSG:4326"))[3],_=f[2],v=f[1],y=f[0];for(l=jt(c=Math.floor(c/o)*o,this.minLon_,this.maxLon_),a=this.addMeridian_(l,v,g,r,t,0),s=0;l!=this.minLon_&&s++<d;)l=Math.max(l-o,n.minLon_),a=n.addMeridian_(l,v,g,r,t,a);for(l=jt(c,this.minLon_,this.maxLon_),s=0;l!=this.maxLon_&&s++<d;)l=Math.min(l+o,n.maxLon_),a=n.addMeridian_(l,v,g,r,t,a);for(this.meridians_.length=a,this.meridiansLabels_&&(this.meridiansLabels_.length=a),h=jt(p=Math.floor(p/o)*o,this.minLat_,this.maxLat_),a=this.addParallel_(h,y,_,r,t,0),s=0;h!=this.minLat_&&s++<d;)h=Math.max(h-o,n.minLat_),a=n.addParallel_(h,y,_,r,t,a);for(h=jt(p,this.minLat_,this.maxLat_),s=0;h!=this.maxLat_&&s++<d;)h=Math.min(h+o,n.maxLat_),a=n.addParallel_(h,y,_,r,t,a);this.parallels_.length=a,this.parallelsLabels_&&(this.parallelsLabels_.length=a)},Qn.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],i=this.projectionCenterLonLat_[1],r=-1,n=Math.pow(this.targetSize_*t,2),o=[],s=[],a=0,h=Jn.length;a<h;++a){var l=Jn[a]/2;if(o[0]=e-l,o[1]=i-l,s[0]=e+l,s[1]=i+l,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(s,s),Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)<=n)break;r=Jn[a]}return r},Qn.prototype.getMap=function(){return this.map_},Qn.prototype.getMeridian_=function(t,e,i,r,n){var o,s,a,h,l,u=(o=t,s=e,a=i,h=this.projection_,l=r,Yn(function(t){return[o,s+(a-s)*t]},be(Ee("EPSG:4326"),h),l)),c=void 0!==this.meridians_[n]?this.meridians_[n]:new Bn(null);return c.setFlatCoordinates(Dr.XY,u),c},Qn.prototype.getMeridians=function(){return this.meridians_},Qn.prototype.getParallel_=function(t,e,i,r,n){var o,s,a,h,l,u=(o=t,s=e,a=i,h=this.projection_,l=r,Yn(function(t){return[s+(a-s)*t,o]},be(Ee("EPSG:4326"),h),l)),c=void 0!==this.parallels_[n]?this.parallels_[n]:new Bn(null);return c.setFlatCoordinates(Dr.XY,u),c},Qn.prototype.getParallels=function(){return this.parallels_},Qn.prototype.handlePostCompose_=function(t){var e,i,r,n,o=this,s=t.vectorContext,a=t.frameState,h=a.extent,l=a.viewState,u=l.center,c=l.projection,p=l.resolution,d=a.pixelRatio,f=p*p/(4*d*d);for((!this.projection_||!Pe(this.projection_,c))&&this.updateProjectionInfo_(c),this.createGraticule_(h,u,p,f),s.setFillStrokeStyle(null,this.strokeStyle_),e=0,i=this.meridians_.length;e<i;++e)r=o.meridians_[e],s.drawGeometry(r);for(e=0,i=this.parallels_.length;e<i;++e)r=o.parallels_[e],s.drawGeometry(r);if(this.meridiansLabels_)for(e=0,i=this.meridiansLabels_.length;e<i;++e)n=o.meridiansLabels_[e],o.lonLabelStyle_.setText(n.text),s.setTextStyle(o.lonLabelStyle_),s.drawGeometry(n.geom);if(this.parallelsLabels_)for(e=0,i=this.parallelsLabels_.length;e<i;++e)n=o.parallelsLabels_[e],o.latLabelStyle_.setText(n.text),s.setTextStyle(o.latLabelStyle_),s.drawGeometry(n.geom)},Qn.prototype.updateProjectionInfo_=function(t){var e=Ee("EPSG:4326"),i=t.getWorldExtent(),r=Ne(i,e,t);this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0],this.maxLatP_=r[3],this.maxLonP_=r[2],this.minLatP_=r[1],this.minLonP_=r[0],this.fromLonLatTransform_=be(e,t),this.toLonLatTransform_=be(t,e),this.projectionCenterLonLat_=this.toLonLatTransform_(It(t.getExtent())),this.projection_=t},Qn.prototype.setMap=function(t){this.map_&&(f(this.postcomposeListenerKey_),this.postcomposeListenerKey_=null,this.map_.render()),t&&(this.postcomposeListenerKey_=S(t,Xn,this.handlePostCompose_,this),t.render()),this.map_=t};var $n=function(t,e,i,r){w.call(this),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state=r};t($n,w),$n.prototype.changed=function(){this.dispatchEvent(E)},$n.prototype.getExtent=function(){return this.extent},$n.prototype.getImage=function(){},$n.prototype.getPixelRatio=function(){return this.pixelRatio_},$n.prototype.getResolution=function(){return this.resolution},$n.prototype.getState=function(){return this.state},$n.prototype.load=function(){};
1var to=function(t,e,i,r,n,o){$n.call(this,t,e,i,Ni.IDLE),this.src_=r,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.imageListenerKeys_=null,this.state=Ni.IDLE,this.imageLoadFunction_=o};t(to,$n),to.prototype.getImage=function(){return this.image_},to.prototype.handleImageError_=function(){this.state=Ni.ERROR,this.unlistenImage_(),this.changed()},to.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Lt(this.extent)/this.image_.height),this.state=Ni.LOADED,this.unlistenImage_(),this.changed()},to.prototype.load=function(){this.state!=Ni.IDLE&&this.state!=Ni.ERROR||(this.state=Ni.LOADING,this.changed(),this.imageListenerKeys_=[p(this.image_,O,this.handleImageError_,this),p(this.image_,k,this.handleImageLoad_,this)],this.imageLoadFunction_(this,this.src_))},to.prototype.setImage=function(t){this.image_=t},to.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(f),this.imageListenerKeys_=null};var eo=0,io=1,ro=2,no=3,oo=4,so=5;function ao(t){return Math.pow(t,3)}function ho(t){return 1-ao(1-t)}function lo(t){return 3*t*t-2*t*t*t}function uo(t){return t}var co=function(t,e,i){w.call(this);var r=i||{};this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=void 0===r.transition?250:r.transition,this.transitionStarts_={}};t(co,w),co.prototype.changed=function(){this.dispatchEvent(E)},co.prototype.getKey=function(){return this.key+"/"+this.tileCoord},co.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==ro)return t;t=t.interimTile}while(t);return this},co.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==ro){t.interimTile=null;break}t.getState()==io?e=t:t.getState()==eo?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},co.prototype.getTileCoord=function(){return this.tileCoord},co.prototype.getState=function(){return this.state},co.prototype.setState=function(t){this.state=t,this.changed()},co.prototype.load=function(){},co.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:ao(r/this.transition_)},co.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},co.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)};var po=function(t,e,i,r,n,o){co.call(this,t,e,o),this.crossOrigin_=r,this.src_=i,this.image_=new Image,null!==r&&(this.image_.crossOrigin=r),this.imageListenerKeys_=null,this.tileLoadFunction_=n};function fo(){var t=ni(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}t(po,co),po.prototype.disposeInternal=function(){this.state==io&&(this.unlistenImage_(),this.image_=fo()),this.interimTile&&this.interimTile.dispose(),this.state=so,this.changed(),co.prototype.disposeInternal.call(this)},po.prototype.getImage=function(){return this.image_},po.prototype.getKey=function(){return this.src_},po.prototype.handleImageError_=function(){this.state=no,this.unlistenImage_(),this.image_=fo(),this.changed()},po.prototype.handleImageLoad_=function(){this.image_.naturalWidth&&this.image_.naturalHeight?this.state=ro:this.state=oo,this.unlistenImage_(),this.changed()},po.prototype.load=function(){this.state==no&&(this.state=eo,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==eo&&(this.state=io,this.changed(),this.imageListenerKeys_=[p(this.image_,O,this.handleImageError_,this),p(this.image_,k,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},po.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(f),this.imageListenerKeys_=null};var go=function(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0};go.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},go.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},go.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;0<i&&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_},go.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},go.prototype.getAngle=function(){return this.angle_};
1var _o=function(t,e,i){m.call(this,t),this.map=e,this.frameState=void 0!==i?i:null};t(_o,m);var vo=function(t,e,i,r,n){_o.call(this,t,e,n),this.originalEvent=i,this.pixel=e.getEventPixel(i),this.coordinate=e.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==r&&r};t(vo,_o),vo.prototype.preventDefault=function(){_o.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},vo.prototype.stopPropagation=function(){_o.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()};var yo={SINGLECLICK:"singleclick",CLICK:I,DBLCLICK:L,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},mo=function(t,e,i,r,n){vo.call(this,t,e,i.originalEvent,r,n),this.pointerEvent=i};t(mo,vo);var xo="pointermove",So="pointerdown",Co="pointerup",wo="pointerover",Eo="pointerout",To="pointerenter",Ro="pointerleave",Io="pointercancel",Fo=function(t,e){this.dispatcher=t,this.mapping_=e};Fo.prototype.getEvents=function(){return Object.keys(this.mapping_)},Fo.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var Lo=function(t){var e={mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout};Fo.call(this,t,e),this.pointerMap=t.pointerMap,this.lastTouches=[]};t(Lo,Fo);function Po(t,e){var i=e.cloneEvent(t,t),r=i.preventDefault;return i.preventDefault=function(){t.preventDefault(),r()},i.pointerId=1,i.isPrimary=!0,i.pointerType="mouse",i}Lo.prototype.isEventSimulatedFromTouch_=function(t){for(var e=this.lastTouches,i=t.clientX,r=t.clientY,n=0,o=e.length,s=void 0;n<o&&(s=e[n]);n++){var a=Math.abs(i-s[0]),h=Math.abs(r-s[1]);if(a<=25&&h<=25)return!0}return!1},Lo.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){1..toString()in this.pointerMap&&this.cancel(t);var e=Po(t,this.dispatcher);this.pointerMap[1..toString()]=t,this.dispatcher.down(e,t)}},Lo.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Po(t,this.dispatcher);this.dispatcher.move(e,t)}},Lo.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var e=this.pointerMap[1..toString()];if(e&&e.button===t.button){var i=Po(t,this.dispatcher);this.dispatcher.up(i,t),this.cleanupMouse()}}},Lo.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Po(t,this.dispatcher);this.dispatcher.enterOver(e,t)}},Lo.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Po(t,this.dispatcher);this.dispatcher.leaveOut(e,t)}},Lo.prototype.cancel=function(t){var e=Po(t,this.dispatcher);this.dispatcher.cancel(e,t),this.cleanupMouse()},Lo.prototype.cleanupMouse=function(){delete this.pointerMap[1..toString()]};var Mo=function(t){var e={MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture};Fo.call(this,t,e),this.pointerMap=t.pointerMap};t(Mo,Fo);var bo=["","unavailable","touch","pen","mouse"];Mo.prototype.prepareEvent_=function(t){var e=t;return"number"==typeof t.pointerType&&((e=this.dispatcher.cloneEvent(t,t)).pointerType=bo[t.pointerType]),e},Mo.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},Mo.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var e=this.prepareEvent_(t);this.dispatcher.down(e,t)},Mo.prototype.msPointerMove=function(t){var e=this.prepareEvent_(t);this.dispatcher.move(e,t)},Mo.prototype.msPointerUp=function(t){var e=this.prepareEvent_(t);this.dispatcher.up(e,t),this.cleanup(t.pointerId)},Mo.prototype.msPointerOut=function(t){var e=this.prepareEvent_(t);this.dispatcher.leaveOut(e,t)},Mo.prototype.msPointerOver=function(t){var e=this.prepareEvent_(t);this.dispatcher.enterOver(e,t)},Mo.prototype.msPointerCancel=function(t){var e=this.prepareEvent_(t);this.dispatcher.cancel(e,t),this.cleanup(t.pointerId)},Mo.prototype.msLostPointerCapture=function(t){var e=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(e)},Mo.prototype.msGotPointerCapture=function(t){var e=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(e)};var Oo=function(t){var e={pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture};Fo.call(this,t,e)};t(Oo,Fo),Oo.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)},Oo.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)},Oo.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)},Oo.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)},Oo.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)},Oo.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)},Oo.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)},Oo.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};
1var No=function(t,e,i){m.call(this,t),this.originalEvent=e;var r=i||{};this.buttons=this.getButtons_(r),this.pressure=this.getPressure_(r,this.buttons),this.bubbles="bubbles"in r&&r.bubbles,this.cancelable="cancelable"in r&&r.cancelable,this.view="view"in r?r.view:null,this.detail="detail"in r?r.detail:null,this.screenX="screenX"in r?r.screenX:0,this.screenY="screenY"in r?r.screenY:0,this.clientX="clientX"in r?r.clientX:0,this.clientY="clientY"in r?r.clientY:0,this.ctrlKey="ctrlKey"in r&&r.ctrlKey,this.altKey="altKey"in r&&r.altKey,this.shiftKey="shiftKey"in r&&r.shiftKey,this.metaKey="metaKey"in r&&r.metaKey,this.button="button"in r?r.button:0,this.relatedTarget="relatedTarget"in r?r.relatedTarget:null,this.pointerId="pointerId"in r?r.pointerId:0,this.width="width"in r?r.width:0,this.height="height"in r?r.height:0,this.tiltX="tiltX"in r?r.tiltX:0,this.tiltY="tiltY"in r?r.tiltY:0,this.pointerType="pointerType"in r?r.pointerType:"",this.hwTimestamp="hwTimestamp"in r?r.hwTimestamp:0,this.isPrimary="isPrimary"in r&&r.isPrimary,e.preventDefault&&(this.preventDefault=function(){e.preventDefault()})};t(No,m);var Ao=!1;No.prototype.getButtons_=function(t){var e;if(t.buttons||Ao)e=t.buttons;else switch(t.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}return e},No.prototype.getPressure_=function(t,e){return t.pressure?t.pressure:e?.5:0},function(){try{var t=new MouseEvent("click",{buttons:1});Ao=1===t.buttons}catch(t){}}();var ko=function(t,e){var i={touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel};Fo.call(this,t,i),this.pointerMap=t.pointerMap,this.mouseSource=e,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_=void 0,this.dedupTimeout_=2500};t(ko,Fo);ko.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},ko.prototype.setPrimaryTouch_=function(t){var e=Object.keys(this.pointerMap).length;(0===e||1===e&&1..toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},ko.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},ko.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},ko.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},ko.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},ko.prototype.touchToPointer_=function(t,e){var i=this.dispatcher.cloneEvent(t,e);return i.pointerId=e.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=e.webkitRadiusX||e.radiusX||0,i.height=e.webkitRadiusY||e.radiusY||0,i.pressure=e.webkitForce||e.force||.5,i.isPrimary=this.isPrimaryTouch_(e),i.pointerType="touch",i.clientX=e.clientX,i.clientY=e.clientY,i.screenX=e.screenX,i.screenY=e.screenY,i},ko.prototype.processTouches_=function(t,e){var i=Array.prototype.slice.call(t.changedTouches),r=i.length;function n(){t.preventDefault()}for(var o=0;o<r;++o){var s=this.touchToPointer_(t,i[o]);s.preventDefault=n,e.call(this,t,s)}},ko.prototype.findTouch_=function(t,e){for(var i=t.length,r=0;r<i;r++){if(t[r].identifier===e)return!0}return!1},ko.prototype.vacuumTouches_=function(t){var e=t.touches,i=Object.keys(this.pointerMap),r=i.length;if(r>=e.length){for(var n=[],o=0;o<r;++o){var s=i[o],a=this.pointerMap[s];1==s||this.findTouch_(e,s-2)||n.push(a.out)}for(var h=0;h<n.length;++h)this.cancelOut_(t,n[h])}},ko.prototype.touchstart=function(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)},ko.prototype.overDown_=function(t,e){this.pointerMap[e.pointerId]={target:e.target,out:e,outTarget:e.target},this.dispatcher.over(e,t),this.dispatcher.enter(e,t),this.dispatcher.down(e,t)},ko.prototype.touchmove=function(t){t.preventDefault(),this.processTouches_(t,this.moveOverOut_)},ko.prototype.moveOverOut_=function(t,e){var i=e,r=this.pointerMap[i.pointerId];if(r){var n=r.out,o=r.outTarget;this.dispatcher.move(i,t),n&&o!==i.target&&(n.relatedTarget=i.target,i.relatedTarget=
1o,n.target=o,i.target?(this.dispatcher.leaveOut(n,t),this.dispatcher.enterOver(i,t)):(i.target=o,i.relatedTarget=null,this.cancelOut_(t,i))),r.out=i,r.outTarget=i.target}},ko.prototype.touchend=function(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)},ko.prototype.upOut_=function(t,e){this.dispatcher.up(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},ko.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)},ko.prototype.cancelOut_=function(t,e){this.dispatcher.cancel(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},ko.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},ko.prototype.dedupSynthMouse_=function(t){var r=this.mouseSource.lastTouches,e=t.changedTouches[0];if(this.isPrimaryTouch_(e)){var n=[e.clientX,e.clientY];r.push(n),setTimeout(function(){var t,e,i;e=n,i=(t=r).indexOf(e),-1<i&&t.splice(i,1)},this.dedupTimeout_)}};var Go=function(t){w.call(this),this.element_=t,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()};t(Go,w);var Do=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];Go.prototype.registerSources=function(){if(bi)this.registerSource("native",new Oo(this));else if(Oi)this.registerSource("ms",new Mo(this));else{var t=new Lo(this);this.registerSource("mouse",t),Mi&&this.registerSource("touch",new ko(this,t))}this.register_()},Go.prototype.registerSource=function(t,e){var i=e,r=i.getEvents();r&&(r.forEach(function(t){var e=i.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(i))}.bind(this)),this.eventSourceList_.push(i))},Go.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.addEvents_(i.getEvents())}},Go.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.removeEvents_(i.getEvents())}},Go.prototype.eventHandler_=function(t){var e=t.type,i=this.eventMap_[e];i&&i(t)},Go.prototype.addEvents_=function(t){t.forEach(function(t){S(this.element_,t,this.eventHandler_,this)}.bind(this))},Go.prototype.removeEvents_=function(t){t.forEach(function(t){d(this.element_,t,this.eventHandler_,this)}.bind(this))},Go.prototype.cloneEvent=function(t,e){for(var i={},r=0,n=Do.length;r<n;r++){var o=Do[r][0];i[o]=t[o]||e[o]||Do[r][1]}return i},Go.prototype.down=function(t,e){this.fireEvent(So,t,e)},Go.prototype.move=function(t,e){this.fireEvent(xo,t,e)},Go.prototype.up=function(t,e){this.fireEvent(Co,t,e)},Go.prototype.enter=function(t,e){t.bubbles=!1,this.fireEvent(To,t,e)},Go.prototype.leave=function(t,e){t.bubbles=!1,this.fireEvent(Ro,t,e)},Go.prototype.over=function(t,e){t.bubbles=!0,this.fireEvent(wo,t,e)},Go.prototype.out=function(t,e){t.bubbles=!0,this.fireEvent(Eo,t,e)},Go.prototype.cancel=function(t,e){this.fireEvent(Io,t,e)},Go.prototype.leaveOut=function(t,e){this.out(t,e),this.contains_(t.target,t.relatedTarget)||this.leave(t,e)},Go.prototype.enterOver=function(t,e){this.over(t,e),this.contains_(t.target,t.relatedTarget)||this.enter(t,e)},Go.prototype.contains_=function(t,e){return!(!t||!e)&&t.contains(e)},Go.prototype.makeEvent=function(t,e,i){return new No(t,i,e)},Go.prototype.fireEvent=function(t,e,i){var r=this.makeEvent(t,e,i);this.dispatchEvent(r)},Go.prototype.fireNativeEvent=function(t){var e=this.makeEvent(t.type,t,t);this.dispatchEvent(e)},Go.prototype.wrapMouseEvent=function(t,e){return this.makeEvent(t,Lo.prepareEvent(e,this),e)},Go.prototype.disposeInternal=function(){this.unregister_(),w.prototype.disposeInternal.call(this)};var Uo=function(t,e){w.call(this),this.map_=t,this.clickTimeoutId_=0,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e?e*Fi:Fi,this.down_=null;var i=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new Go(i),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=S(this.pointerEventHandler_,So,this.handlePointerDown_,this),this.relayedListenerKey_=S(this.pointerEventHandler_,xo,this.relayEvent_,this)};t(Uo,w),Uo.prototype.emulateClick_=function(e){var t=new mo(yo.CLICK,this.map_,e);this.dispatchEvent(t),0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=0,t=new mo(yo.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var t=new mo(yo.SINGLECLICK,this.map_,e);this.dispatchEvent(t)}.bind(this),250)},Uo.prototype.updateActivePointers_=function(t){var e=t;e.type==yo.POINTERUP||e.type==yo.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==yo.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},Uo.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new mo(yo.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(f),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},Uo.prototype.isMouseActionButton_=function(t){return 0===t.button},Uo.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new mo(yo.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new Go(document),this.dragListenerKeys_.push(S(this.documentPointerEventHandler_,yo.POINTERMOVE,this.handlePointerMove_,this),S(this.documentPointerEventHandler_,yo.POINTERUP,this.handlePointerUp_,this),S(this.pointerEventHandler_,yo.POINTERCANCEL,this.handlePointerUp_,this)))},Uo.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new mo(yo.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}t.preventDefault()},Uo.prototype.relayEvent_=function(t){var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new mo(t.type,this.map_,t,e))},Uo.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_},Uo.prototype.disposeInternal=function(){this.relayedListenerKey_&&(f(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(f(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(f),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),w.prototype.disposeInternal.call(this)};var jo="postrender",zo="movestart",Bo="moveend",Yo="layergroup",Xo="size",Vo="target",Wo="view",Ko=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Ko.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,g(this.queuedElements_)},Ko.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},Ko.prototype.enqueue=function(t){$(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);
1return 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)},Ko.prototype.getCount=function(){return this.elements_.length},Ko.prototype.getLeftChildIndex_=function(t){return 2*t+1},Ko.prototype.getRightChildIndex_=function(t){return 2*t+2},Ko.prototype.getParentIndex_=function(t){return t-1>>1},Ko.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;0<=t;t--)this.siftUp_(t)},Ko.prototype.isEmpty=function(){return 0===this.elements_.length},Ko.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Ko.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Ko.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,r=e.length,n=e[t],o=i[t],s=t;t<r>>1;){var a=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),l=h<r&&i[h]<i[a]?h:a;e[t]=e[l],i[t]=i[l],t=l}e[t]=n,i[t]=o,this.siftDown_(s,t)},Ko.prototype.siftDown_=function(t,e){for(var i=this.elements_,r=this.priorities_,n=i[e],o=r[e];t<e;){var s=this.getParentIndex_(e);if(!(r[s]>o))break;i[e]=i[s],r[e]=r[s],e=s}i[e]=n,r[e]=o},Ko.prototype.reprioritize=function(){var t,e,i,r=this.priorityFunction_,n=this.elements_,o=this.priorities_,s=0,a=n.length;for(e=0;e<a;++e)(i=r(t=n[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=i,n[s++]=t);n.length=s,o.length=s,this.heapify_()};var Zo=function(e,t){Ko.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()}),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}};t(Zo,Ko),Zo.prototype.enqueue=function(t){var e=Ko.prototype.enqueue.call(this,t);e&&S(t[0],E,this.handleTileChange,this);return e},Zo.prototype.getTilesLoading=function(){return this.tilesLoading_},Zo.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===ro||i===no||i===oo||i===so){d(e,E,this.handleTileChange,this);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},Zo.prototype.loadMoreTiles=function(t,e){for(var i,r,n,o=0,s=!1;this.tilesLoading_<t&&o<e&&0<this.getCount();)n=(r=this.dequeue()[0]).getKey(),(i=r.getState())===so?s=!0:i!==eo||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,r.load());0===o&&s&&this.tileChangeCallback_()};var Ho=42,qo=256;function Jo(t){return t}function Qo(t,e){return void 0!==t?0:void 0}function $o(t,e){return void 0!==t?t+e:void 0}var ts=0,es=1,is="center",rs="resolution",ns="rotation",os=function(t){K.call(this);var e=C({},t);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=Ie(e.projection,"EPSG:3857"),this.applyOptions_(e)};function ss(t){return!(t.sourceCenter&&t.targetCenter&&!bn(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}t(os,K),os.prototype.applyOptions_=function(t){var e={};e[is]=void 0!==t.center?t.center:null;var i=function(t){var e,i,r,n=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var a=t.resolutions;i=a[n],r=void 0!==a[o]?a[o]:a[a.length-1],_=a,e=function(t,e,i){if(void 0!==t){var r=Mr(_,t,i);r=jt(r+e,0,_.length-1);var n=Math.floor(r);
1if(r!=n&&n<_.length-1){var o=_[n]/_[n+1];return _[n]/Math.pow(o,r-n)}return _[n]}}}else{var h=Ie(t.projection,"EPSG:3857"),l=h.getExtent(),u=l?Math.max(Ot(l),Lt(l)):360*te[$t.DEGREES]/h.getMetersPerUnit(),c=u/qo/Math.pow(2,0),p=c/Math.pow(2,28);void 0!==(i=t.maxResolution)?n=0:i=c/Math.pow(s,n),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(s,o):c/Math.pow(s,o):p),o=n+Math.floor(Math.log(i/r)/Math.log(s)),r=i/Math.pow(s,o-n),d=s,f=i,g=o-n,e=function(t,e,i){if(void 0!==t){var r=-i/2+.5,n=Math.floor(Math.log(f/t)/Math.log(d)+r),o=Math.max(n+e,0);return void 0!==g&&(o=Math.min(o,g)),f/Math.pow(d,o)}}}var d,f,g;var _;return{constraint:e,maxResolution:i,minResolution:r,minZoom:n,zoomFactor:s}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=i.minZoom;var r,n,o=void 0!==(r=t).extent?(n=r.extent,function(t){return t?[jt(t[0],n[0],n[2]),jt(t[1],n[1],n[3])]:void 0}):Jo,s=i.constraint,a=function(t){{if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=n||Vt(5),function(t,e){return void 0!==t?Math.abs(t+e)<=o?0:t+e:void 0}):!1===e?$o:"number"==typeof e?(i=e,r=2*Math.PI/i,function(t,e){return void 0!==t?t=Math.floor((t+e)/r+.5)*r:void 0}):$o}return Qo}var i,r;var n,o}(t);this.constraints_={center:o,resolution:s,rotation:a},void 0!==t.resolution?e[rs]=t.resolution:void 0!==t.zoom&&(e[rs]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(e[rs]=jt(Number(this.getResolution()||e[rs]),this.minResolution_,this.maxResolution_))),e[ns]=void 0!==t.rotation?t.rotation:0,this.setProperties(e),this.options_=t},os.prototype.getUpdatedOptions_=function(t){var e=C({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenter(),e.rotation=this.getRotation(),C({},e,t)},os.prototype.animate=function(t){var e,i=arguments,r=arguments.length;if(1<r&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r),!this.isDef()){var n=arguments[r-1];return n.center&&this.setCenter(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&setTimeout(function(){e(!0)},0))}for(var o=Date.now(),s=this.getCenter().slice(),a=this.getResolution(),h=this.getRotation(),l=[],u=0;u<r;++u){var c=i[u],p={start:o,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||lo};if(c.center&&(p.sourceCenter=s,p.targetCenter=c.center,s=p.targetCenter),void 0!==c.zoom?(p.sourceResolution=a,p.targetResolution=this.constrainResolution(this.maxResolution_,c.zoom-this.minZoom_,0),a=p.targetResolution):c.resolution&&(p.sourceResolution=a,p.targetResolution=c.resolution,a=p.targetResolution),void 0!==c.rotation){p.sourceRotation=h;var d=Wt(c.rotation-h+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=h+d,h=p.targetRotation}p.callback=e,ss(p)?p.complete=!0:o+=p.duration,l.push(p)}this.animations_.push(l),this.setHint(ts,1),this.updateAnimations_()},os.prototype.getAnimating=function(){return 0<this.hints_[ts]},os.prototype.getInteracting=function(){return 0<this.hints_[es]},os.prototype.cancelAnimations=function(){this.setHint(ts,-this.hints_[ts]);for(var t=0,e=this.animations_.length;t<e;++t){var i=this.animations_[t];i[0].callback&&i[0].callback(!1)}this.animations_.length=0},os.prototype.updateAnimations_=function(){var t=this;if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var e=Date.now(),i=!1,r=this.animations_.length-1;0<=r;--r){for(var n=t.animations_[r],o=!0,s=0,a=n.length;s<a;++s){var h=n[s];if(!h.complete){var l=e-h.start,u=0<h.duration?l/h.duration:1;1<=u?(h.complete=!0,u=1):o=!1;var c=h.easing(u);if(h.sourceCenter){var p=h.sourceCenter[0],d=h.sourceCenter[1],f=p+c*(h.targetCenter[0]-p),g=d+c*(h.targetCenter[1]-d);t.set(is,[f,g])}if(h.sourceResolution&&h.targetResolution){var _=1===c?h.targetResolution:h.sourceResolution+c*(h.targetResolution-
1h.sourceResolution);h.anchor&&t.set(is,t.calculateCenterZoom(_,h.anchor)),t.set(rs,_)}if(void 0!==h.sourceRotation&&void 0!==h.targetRotation){var v=1===c?Wt(h.targetRotation+Math.PI,2*Math.PI)-Math.PI:h.sourceRotation+c*(h.targetRotation-h.sourceRotation);h.anchor&&t.set(is,t.calculateCenterRotate(v,h.anchor)),t.set(ns,v)}if(i=!0,!h.complete)break}}if(o){t.animations_[r]=null,t.setHint(ts,-1);var y=n[0].callback;y&&setTimeout(function(){y(!0)},0)}}this.animations_=this.animations_.filter(Boolean),i&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},os.prototype.calculateCenterRotate=function(t,e){var i,r=this.getCenter();return void 0!==r&&(On(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),Fn(i,e)),i},os.prototype.calculateCenterZoom=function(t,e){var i,r=this.getCenter(),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},os.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+wt(this)+'"]',i=document.querySelector(e);if(i){var r=getComputedStyle(i);t[0]=parseInt(r.width,10),t[1]=parseInt(r.height,10)}return t},os.prototype.constrainCenter=function(t){return this.constraints_.center(t)},os.prototype.constrainResolution=function(t,e,i){var r=e||0,n=i||0;return this.constraints_.resolution(t,r,n)},os.prototype.constrainRotation=function(t,e){var i=e||0;return this.constraints_.rotation(t,i)},os.prototype.getCenter=function(){return this.get(is)},os.prototype.getConstraints=function(){return this.constraints_},os.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},os.prototype.calculateExtent=function(t){var e=t||this.getSizeFromViewport_(),i=this.getCenter();$(i,1);var r=this.getResolution();$(void 0!==r,2);var n=this.getRotation();return $(void 0!==n,3),Ft(i,r,n,e)},os.prototype.getMaxResolution=function(){return this.maxResolution_},os.prototype.getMinResolution=function(){return this.minResolution_},os.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},os.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},os.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},os.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},os.prototype.getProjection=function(){return this.projection_},os.prototype.getResolution=function(){return this.get(rs)},os.prototype.getResolutions=function(){return this.resolutions_},os.prototype.getResolutionForExtent=function(t,e){var i=e||this.get
1SizeFromViewport_(),r=Ot(t)/i[0],n=Lt(t)/i[1];return Math.max(r,n)},os.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.maxResolution_,r=this.minResolution_,n=Math.log(i/r)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},os.prototype.getRotation=function(){return this.get(ns)},os.prototype.getValueForResolutionFunction=function(t){var e=t||2,i=this.maxResolution_,r=this.minResolution_,n=Math.log(i/r)/Math.log(e);return function(t){return Math.log(i/t)/Math.log(e)/n}},os.prototype.getState=function(){var t=this.getCenter(),e=this.getProjection(),i=this.getResolution(),r=this.getRotation();return{center:t.slice(),projection:void 0!==e?e:null,resolution:i,rotation:r,zoom:this.getZoom()}},os.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},os.prototype.getZoomForResolution=function(t){var e,i,r=this.minZoom_||0;if(this.resolutions_){var n=Mr(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)},os.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},os.prototype.fit=function(t,e){var i,r=e||{},n=r.size;n||(n=this.getSizeFromViewport_()),t instanceof Ur?t.getType()===Zt.CIRCLE?(i=Cn(t=t.getExtent())).rotate(this.getRotation(),It(t)):i=t:($(Array.isArray(t),24),$(!At(t),25),i=Cn(t));var o,s=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0===r.constrainResolution||r.constrainResolution,h=void 0!==r.nearest&&r.nearest;o=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.constrainResolution(this.maxResolution_,r.maxZoom-this.minZoom_,0):0;for(var l=i.getFlatCoordinates(),u=this.getRotation(),c=Math.cos(-u),p=Math.sin(-u),d=1/0,f=1/0,g=-1/0,_=-1/0,v=i.getStride(),y=0,m=l.length;y<m;y+=v){var x=l[y]*c-l[y+1]*p,S=l[y]*p+l[y+1]*c;d=Math.min(d,x),f=Math.min(f,S),g=Math.max(g,x),_=Math.max(_,S)}var C=this.getResolutionForExtent([d,f,g,_],[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);if(C=isNaN(C)?o:Math.max(C,o),a){var w=this.constrainResolution(C,0,0);!h&&w<C&&(w=this.constrainResolution(w,-1,0)),C=w}p=-p;var E=(d+g)/2,T=(f+_)/2,R=[(E+=(s[1]-s[3])/2*C)*c-(T+=(s[0]-s[2])/2*C)*p,T*c+E*p],I=r.callback?r.callback:F;void 0!==r.duration?this.animate({resolution:C,center:R,duration:r.duration,easing:r.easing},I):(this.setResolution(C),this.setCenter(R),setTimeout(I.bind(void 0,!0),0))},os.prototype.centerOn=function(t,e,i){var r=this.getRotation(),n=Math.cos(-r),o=Math.sin(-r),s=t[0]*n-t[1]*o,a=t[1]*n+t[0]*o,h=this.getResolution(),l=(s+=(e[0]/2-i[0])*h)*n-(a+=(i[1]-e[1]/2)*h)*(o=-o),u=a*n+s*o;this.setCenter([l,u])},os.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},os.prototype.rotate=function(t,e){if(void 0!==e){var i=this.calculateCenterRotate(t,e);this.setCenter(i)}this.setRotation(t)},os.prototype.setCenter=function(t){this.set(is,t),this.getAnimating()&&this.cancelAnimations()},os.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},os.prototype.setResolution=function(t){this.set(rs,t),this.getAnimating()&&this.cancelAnimations()},os.prototype.setRotation=function(t){this.set(ns,t),this.getAnimating()&&this.cancelAnimations()},os.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))};var as="opacity",hs="visible",ls="extent",us="zIndex",cs="maxResolution",ps="minResolution",ds="source",fs=function(t){K.call(this);var e=C({},t);e[as]=void 0!==t.opacity?t.opacity:1,e[hs]=void 0===t.visible||t.visible,e[us]=void 0!==t.zIndex?t.zIndex:0,e[cs]=void 0!==t.maxResolution?t.maxResolution:1/0,e[ps]=void 0!==t.minResolution?t.minResolution:0,this.setProperties(e),this.state_={layer:this,managed:!0},this.type};t(fs,K),fs.prototype.getType=function(){return this.type},fs.prototype.getLayerState=function(){return this.state_.opacity=jt(this.getOpacity(),0,1),this.state_.sourceState=this.getSourceState(),this.state_.visible=this.getVisible(),this.state_.extent=this.getExtent(),this.state_.zIndex=this.getZIndex(),this.state_.maxResolution=this.getMaxResolution(),this.state_.minResolution=Math.max(this.getMinResolution(),0),this.state_},fs.prototype.getLayersArray=function(t){},fs.prototype.getLayerStatesArray=function(t){},fs.prototype.getExtent=function(){return this.get(ls)},fs.prototype.getMaxResolution=function(){return this.get(cs)},fs.prototype.getMinResolution=function(){return this.get(ps)},fs.prototype.getOpacity=function(){return this.get(as)},fs.prototype.getSourceState=function(){},fs.prototype.getVisible=function(){return this.get(hs)},fs.prototype.getZIndex=function(){return this.get(us)},fs.prototype.setExtent=function(t){this.set(ls,t)},fs.prototype.setMaxResolution=function(t){this.set(cs,t)},fs.prototype.setMinResolution=function(t){this.set(ps,t)},fs.prototype.setOpacity=function(t){this.set(as,t)},fs.prototype.setVisible=function(t){this.set(hs,t)},fs.prototype.setZIndex=function(t){this.set(us,t)};var gs="undefined",_s="loading",vs="ready",ys="error",ms="layers",xs=function(t){var e=t||{},i=C({},e);delete i.layers;var r=e.layers;
1fs.call(this,i),this.layersListenerKeys_=[],this.listenerKeys_={},S(this,H(ms),this.handleLayersChanged_,this),r?Array.isArray(r)?r=new Q(r.slice(),{unique:!0}):($(r instanceof Q,43),r=r):r=new Q(void 0,{unique:!0}),this.setLayers(r)};function Ss(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*e,i[1]=t[1]+2*e,i}function Cs(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 ws(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}t(xs,fs),xs.prototype.handleLayerChange_=function(){this.changed()},xs.prototype.handleLayersChanged_=function(t){this.layersListenerKeys_.forEach(f),this.layersListenerKeys_.length=0;var e=this.getLayers();for(var i in this.layersListenerKeys_.push(S(e,a,this.handleLayersAdd_,this),S(e,h,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[i].forEach(f);g(this.listenerKeys_);for(var r=e.getArray(),n=0,o=r.length;n<o;n++){var s=r[n];this.listenerKeys_[wt(s).toString()]=[S(s,l,this.handleLayerChange_,this),S(s,E,this.handleLayerChange_,this)]}this.changed()},xs.prototype.handleLayersAdd_=function(t){var e=t.element,i=wt(e).toString();this.listenerKeys_[i]=[S(e,l,this.handleLayerChange_,this),S(e,E,this.handleLayerChange_,this)],this.changed()},xs.prototype.handleLayersRemove_=function(t){var e=wt(t.element).toString();this.listenerKeys_[e].forEach(f),delete this.listenerKeys_[e],this.changed()},xs.prototype.getLayers=function(){return this.get(ms)},xs.prototype.setLayers=function(t){this.set(ms,t)},xs.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach(function(t){t.getLayersArray(e)}),e},xs.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 s=e[n];s.opacity*=r.opacity,s.visible=s.visible&&r.visible,s.maxResolution=Math.min(s.maxResolution,r.maxResolution),s.minResolution=Math.max(s.minResolution,r.minResolution),void 0!==r.extent&&(void 0!==s.extent?s.extent=Pt(s.extent,r.extent):s.extent=r.extent)}return e},xs.prototype.getSourceState=function(){return vs};var Es=function(t){K.call(this);var e=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={},s=t.layers instanceof xs?t.layers:new xs({layers:t.layers});o[Yo]=s,o[Vo]=t.target,o[Wo]=void 0!==t.view?t.view:new os,void 0!==t.controls&&(Array.isArray(t.controls)?i=new Q(t.controls.slice()):($(t.controls instanceof Q,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new Q(t.interactions.slice()):($(t.interactions instanceof Q,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new Q(t.overlays.slice()):($(t.overlays instanceof Q,49),n=t.overlays):n=new Q;return{controls:i,interactions:r,keyboardEventTarget:e,overlays:n,values:o}}(t);this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,this.loadTilesWhileAnimating_=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:Fi,this.animationDelayKey_,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("DIV"),this.viewport_.className="ol-viewport"+(Mi?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("DIV"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("DIV"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var i=[I,L,G,Y,z,yo.POINTERDOWN,j,X],r=0,n=i.length;r<n;++r)S(this.overlayContainerStopEvent_,i[r],x);for(var o in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new Uo(this,t.moveTolerance),yo)S(this.mapBrowserEventHandler_,yo[o],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=e.keyboardEventTarget,this.keyHandlerKeys_=null,S(this.viewport_,R,this.handleBrowserEvent,this),S(this.viewport_,X,this.handleBrowserEvent,this),S(this.viewport_,j,this.handleBrowserEvent,this),this.controls=e.controls||new Q,this.interactions=e.interactions||new Q,this.overlays_=e.overlays,this.overlayIdIndex_
1={},this.renderer_=this.createRenderer(),this.handleResize_,this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new Zo(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},S(this,H(Yo),this.handleLayerGroupChanged_,this),S(this,H(Wo),this.handleViewChanged_,this),S(this,H(Xo),this.handleSizeChanged_,this),S(this,H(Vo),this.handleTargetChanged_,this),this.setProperties(e.values),this.controls.forEach(function(t){t.setMap(this)}.bind(this)),S(this.controls,a,function(t){t.element.setMap(this)},this),S(this.controls,h,function(t){t.element.setMap(null)},this),this.interactions.forEach(function(t){t.setMap(this)}.bind(this)),S(this.interactions,a,function(t){t.element.setMap(this)},this),S(this.interactions,h,function(t){t.element.setMap(null)},this),this.overlays_.forEach(this.addOverlayInternal_.bind(this)),S(this.overlays_,a,function(t){this.addOverlayInternal_(t.element)},this),S(this.overlays_,h,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)},this)};t(Es,K),Es.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},Es.prototype.addControl=function(t){this.getControls().push(t)},Es.prototype.addInteraction=function(t){this.getInteractions().push(t)},Es.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},Es.prototype.addOverlay=function(t){this.getOverlays().push(t)},Es.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},Es.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),d(this.viewport_,R,this.handleBrowserEvent,this),d(this.viewport_,X,this.handleBrowserEvent,this),d(this.viewport_,j,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(removeEventListener(B,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),K.prototype.disposeInternal.call(this)},Es.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var r=this.getCoordinateFromPixel(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==i.layerFilter?i.layerFilter:v;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,n,e,null,o,null)}},Es.prototype.getFeaturesAtPixel=function(t,e){var i=null;return this.forEachFeatureAtPixel(t,function(t){i||(i=[]),i.push(t)},e),i},Es.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var r=i||{},n=void 0!==r.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=r.layerFilter||v;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,null,o,null)}},Es.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixel(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:v,n=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,null)},Es.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},Es.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i=t.changedTouches?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},Es.prototype.getTarget=function(){return this.get(Vo)},Es.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},Es.prototype.getCoordinateFromPixel=function(t){var e=this.frameState_;return e?je(e.pixelToCoordinateTransform,t.slice()):null},Es.prototype.getControls=function(){return this.controls},Es.prototype.getOverlays=function(){return this.overlays_},Es.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},Es.prototype.getInteractions=function(){return this.interactions},Es.prototype.getLayerGroup=function(){return this.get(Yo)},Es.prototype.getLayers=function(){return this.getLayerGroup().getLayers()}
1,Es.prototype.getPixelFromCoordinate=function(t){var e=this.frameState_;return e?je(e.coordinateToPixelTransform,t.slice(0,2)):null},Es.prototype.getRenderer=function(){return this.renderer_},Es.prototype.getSize=function(){return this.get(Xo)},Es.prototype.getView=function(){return this.get(Wo)},Es.prototype.getViewport=function(){return this.viewport_},Es.prototype.getOverlayContainer=function(){return this.overlayContainer_},Es.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},Es.prototype.getTilePriority=function(t,e,i,r){var n=this.frameState_;if(!(n&&e in n.wantedTiles))return 1/0;if(!n.wantedTiles[e][t.getKey()])return 1/0;var o=i[0]-n.focus[0],s=i[1]-n.focus[1];return 65536*Math.log(r)+Math.sqrt(o*o+s*s)/r},Es.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,r=new vo(i,this,t);this.handleMapBrowserEvent(r)},Es.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var e=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var i=e.length-1;0<=i;i--){var r=e[i];if(r.getActive())if(!r.handleEvent(t))break}}},Es.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;n[ts]&&(i=this.loadTilesWhileAnimating_?8:0,r=2),n[es]&&(i=this.loadTilesWhileInteracting_?8:0,r=2)}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,r))}for(var o=this.postRenderFunctions_,s=0,a=o.length;s<a;++s)o[s](this,t);o.length=0},Es.prototype.handleSizeChanged_=function(){this.render()},Es.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)f(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var r=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[S(r,N,this.handleBrowserEvent,this),S(r,A,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),addEventListener(B,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),si(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(B,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},Es.prototype.handleTileChange_=function(){this.render()},Es.prototype.handleViewPropertyChanged_=function(){this.render()},Es.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(f(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(f(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",wt(t)),this.viewPropertyListenerKey_=S(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=S(t,E,this.handleViewPropertyChanged_,this)),this.render()},Es.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(f),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[S(t,l,this.render,this),S(t,E,this.render,this)]),this.render()},Es.prototype.isRendered=function(){return!!this.frameState_},Es.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},Es.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},Es.prototype.removeControl=function(t){return this.getControls().remove(t)},Es.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},Es.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},Es.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},Es.prototype.renderFrame_=function(t){var e,i,r=this.getSize(),n=this.getView(),o=[1/0,1/0,-1/0,-1/0],s=this.frameState_,a=null;if(void 0!==r&&(0<(i=r)[0]&&0<i[1])&&n&&n.isDef()){for(var h=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=this.getLayerGroup().getLayerStatesArray(),u={},c=0,p=l.length;c<p;++c)u[wt(l[c].layer)]=l[c];e=n.getState();var d=this.focus_;if(!d){d=e.center;var f=e.resolution/this.pixelRatio_;d[0]=Math.round(d[0]/f)*f,d[1]=Math.round(d[1]/f)*f}a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:o,focus:d,index:this.frameIndex_++,layerStates:u,layerStatesArray:l,pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:h,wantedTiles:{}}}if(a&&(a.extent=Ft(e.center,e.resolution,e.rotation,a.size,o)),this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),s)(!this.previousExtent_||!At(this.previousExtent_)&&!_t(a.extent,this.previousExtent_))&&(this.dispatchEvent(new _o(zo,this,s)),this.previousExtent_=pt
1(this.previousExtent_));this.previousExtent_&&!a.viewHints[ts]&&!a.viewHints[es]&&!_t(a.extent,this.previousExtent_)&&(this.dispatchEvent(new _o(Bo,this,a)),nt(a.extent,this.previousExtent_))}this.dispatchEvent(new _o(jo,this,a)),setTimeout(this.handlePostRender.bind(this),0)},Es.prototype.setLayerGroup=function(t){this.set(Yo,t)},Es.prototype.setSize=function(t){this.set(Xo,t)},Es.prototype.setTarget=function(t){this.set(Vo,t)},Es.prototype.setView=function(t){this.set(Wo,t)},Es.prototype.skipFeature=function(t){var e=wt(t).toString();this.skippedFeatureUids_[e]=!0,this.render()},Es.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)},Es.prototype.unskipFeature=function(t){var e=wt(t).toString();delete this.skippedFeatureUids_[e],this.render()};var Ts=function(t){K.call(this),this.element=t.element?t.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=t.render?t.render:F,t.target&&this.setTarget(t.target)};t(Ts,K),Ts.prototype.disposeInternal=function(){si(this.element),K.prototype.disposeInternal.call(this)},Ts.prototype.getMap=function(){return this.map_},Ts.prototype.setMap=function(t){this.map_&&si(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)f(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==F&&this.listenerKeys.push(S(t,jo,this.render,this)),t.render())},Ts.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t};var Rs=function(t){var e=C({},t);delete e.source,fs.call(this,e),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,t.map&&this.setMap(t.map),S(this,H(ds),this.handleSourcePropertyChange_,this);var i=t.source?t.source:null;this.setSource(i)};function Is(t,e){return t.visible&&e>=t.minResolution&&e<t.maxResolution}t(Rs,fs),Rs.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},Rs.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},Rs.prototype.getSource=function(){return this.get(ds)||null},Rs.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():gs},Rs.prototype.handleSourceChange_=function(){this.changed()},Rs.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(f(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=S(t,E,this.handleSourceChange_,this)),this.changed()},Rs.prototype.setMap=function(t){this.mapPrecomposeKey_&&(f(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(f(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=S(t,Vn,function(t){var e=this.getLayerState();e.managed=!1,e.zIndex=1/0,t.frameState.layerStatesArray.push(e),t.frameState.layerStates[wt(this)]=e},this),this.mapRenderKey_=S(this,E,t.render,t),this.changed())},Rs.prototype.setSource=function(t){this.set(ds,t)};var Fs=function(t){var e=t||{};this.ulElement_=document.createElement("UL"),this.collapsed_=void 0===e.collapsed||e.collapsed,this.collapsible_=void 0===e.collapsible||e.collapsible,this.collapsible_||(this.collapsed_=!1);var i=void 0!==e.className?e.className:"ol-attribution",r=void 0!==e.tipLabel?e.tipLabel:"Attributions",n=void 0!==e.collapseLabel?e.collapseLabel:"»";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var o=void 0!==e.label?e.label:"i";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o):this.label_=o;var s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,a=document.createElement("button");a.setAttribute("type","button"),a.title=r,a.appendChild(s),S(a,I,this.handleClick_,this);var h=i+" "+ki+" "+Gi+(this.collapsed_&&this.collapsible_?" "+Di:"")+(this.collapsible_?"":" ol-uncollapsible"),l=document.createElement("div");
1l.className=h,l.appendChild(this.ulElement_),l.appendChild(a),Ts.call(this,{element:l,render:e.render||Ls,target:e.target}),this.renderedAttributions_=[],this.renderedVisible_=!0};function Ls(t){this.updateElement_(t.frameState)}t(Fs,Ts),Fs.prototype.getSourceAttributions_=function(t){for(var e={},i=[],r=t.layerStatesArray,n=t.viewState.resolution,o=0,s=r.length;o<s;++o){var a=r[o];if(Is(a,n)){var h=a.layer.getSource();if(h){var l=h.getAttributions();if(l){var u=l(t);if(u)if(Array.isArray(u))for(var c=0,p=u.length;c<p;++c)u[c]in e||(i.push(u[c]),e[u[c]]=!0);else u in e||(i.push(u),e[u]=!0)}}}}return i},Fs.prototype.updateElement_=function(t){if(t){var e=this.getSourceAttributions_(t),i=0<e.length;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Ar(e,this.renderedAttributions_)){ai(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)},Fs.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},Fs.prototype.handleToggle_=function(){this.element.classList.toggle(Di),this.collapsed_?oi(this.collapseLabel_,this.label_):oi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},Fs.prototype.getCollapsible=function(){return this.collapsible_},Fs.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},Fs.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},Fs.prototype.getCollapsed=function(){return this.collapsed_};var Ps=function(t){var e=t||{},i=void 0!==e.className?e.className:"ol-rotate",r=void 0!==e.label?e.label:"â§";this.label_=null,"string"==typeof r?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=r):(this.label_=r,this.label_.classList.add("ol-compass"));var n=e.tipLabel?e.tipLabel:"Reset rotation",o=document.createElement("button");o.className=i+"-reset",o.setAttribute("type","button"),o.title=n,o.appendChild(this.label_),S(o,I,Ps.prototype.handleClick_,this);var s=i+" "+ki+" "+Gi,a=document.createElement("div");a.className=s,a.appendChild(o),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,Ts.call(this,{element:a,render:e.render||Ms,target:e.target}),this.duration_=void 0!==e.duration?e.duration:250,this.autoHide_=void 0===e.autoHide||e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Ai)};function Ms(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(Ai);n||0!==i?n&&0!==i&&this.element.classList.remove(Ai):this.element.classList.add(Ai)}this.label_.style.msTransform=r,this.label_.style.webkitTransform=r,this.label_.style.transform=r}this.rotation_=i}}t(Ps,Ts),Ps.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},Ps.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(0<this.duration_?t.animate({rotation:0,duration:this.duration_,easing:ho}):t.setRotation(0))};var bs=function(t){var e=t||{},i=void 0!==e.className?e.className:"ol-zoom",r=void 0!==e.delta?e.delta:1,n=void 0!==e.zoomInLabel?e.zoomInLabel:"+",o=void 0!==e.zoomOutLabel?e.zoomOutLabel:"â",s=void 0!==e.zoomInTipLabel?e.zoomInTipLabel:"Zoom in",a=void 0!==e.zoomOutTipLabel?e.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=i+"-in",h.setAttribute("type","button"),h.title=s,h.appendChild("string"==typeof n?document.createTextNode(n):n),S(h,I,bs.prototype.handleClick_.bind(this,r));var l=document.createElement("button");l.className=i+"-out",l.setAttribute("type","button"),l.title=a,l.appendChild("string"==typeof o?document.createTextNode(o):o),S(l,I,bs.prototype.handleClick_.bind(this,-r));var u=i+" "+ki+" "+Gi,c=document.createElement("div");c.className=u,c.appendChild(h),c.appendChild(l),Ts.call(this,{element:c,target:e.target}),this.duration_=void 0!==e.duration?e.duration:250};function Os(t){var e=t||{},i=new Q;return(void 0===e.zoom||e.zoom)&&i.push(new bs(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Ps(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Fs(e.attributionOptions)),i}t(bs,Ts),bs.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},bs.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getResolution();if(i){var r=e.constrainResolution(i,t);0<this.duration_?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:r,duration:this.duration_,easing:ho})):e.setResolution(r)}}};var Ns="active",As=function(t){K.call(this),this.map_=null,this.setActive(!0),this.handleEvent=t.handleEvent};function ks(t,e,i,r){Gs(t,e=t.constrainRotation(e,0),i,r)}function Gs(t,e,i,r){if(void 0!==e){var n=t.getRotation(),o=t.getCenter();void 0!==n&&o&&0<r?t.animate({rotation:e,anchor:i,duration:r,easing:ho}):t.rotate(e,i)}}function Ds(t,e,i,r,n){js(t,e=t.constrainResolution(e,0,n),i,r)}
1function Us(t,e,i,r){var n=t.getResolution(),o=t.constrainResolution(n,e,0);if(void 0!==o){var s=t.getResolutions();o=jt(o,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==o&&o!==n){var a=t.getCenter(),h=t.calculateCenterZoom(o,i);h=t.constrainCenter(h),i=[(o*a[0]-n*h[0])/(o-n),(o*a[1]-n*h[1])/(o-n)]}js(t,o,i,r)}function js(t,e,i,r){if(e){var n=t.getResolution(),o=t.getCenter();if(void 0!==n&&o&&e!==n&&r)t.animate({resolution:e,anchor:i,duration:r,easing:ho});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}t(As,K),As.prototype.getActive=function(){return this.get(Ns)},As.prototype.getMap=function(){return this.map_},As.prototype.setActive=function(t){this.set(Ns,t)},As.prototype.setMap=function(t){this.map_=t};var zs=function(t){var e=t||{};this.delta_=e.delta?e.delta:1,As.call(this,{handleEvent:Bs}),this.duration_=void 0!==e.duration?e.duration:250};function Bs(t){var e=!1,i=t.originalEvent;if(t.type==yo.DBLCLICK){var r=t.map,n=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Us(r.getView(),o,n,this.duration_),t.preventDefault(),e=!0}return!e}t(zs,As);var Ys=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Xs=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Vs=v,Ws=function(t){var e=t.originalEvent;return 0==e.button&&!(Ri&&Ii&&e.ctrlKey)},Ks=i,Zs=function(t){return"pointermove"==t.type},Hs=function(t){return t.type==yo.SINGLECLICK},qs=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Js=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Qs=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},$s=function(t){return $(t.pointerEvent,56),"mouse"==t.pointerEvent.pointerType},ta=function(t){var e=t.pointerEvent;return e.isPrimary&&0===e.button},ea=F,ia=i,ra=i,na=F,oa=function(t){var e=t||{};As.call(this,{handleEvent:e.handleEvent||aa}),this.handleDownEvent_=e.handleDownEvent?e.handleDownEvent:ra,this.handleDragEvent_=e.handleDragEvent?e.handleDragEvent:ea,this.handleMoveEvent_=e.handleMoveEvent?e.handleMoveEvent:na,this.handleUpEvent_=e.handleUpEvent?e.handleUpEvent:ia,this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]};function sa(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 aa(t){if(!(t instanceof mo))return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==yo.POINTERDRAG)this.handleDragEvent_(t);else if(t.type==yo.POINTERUP){var i=this.handleUpEvent_(t);this.handlingDownUpSequence=i&&0<this.targetPointers.length}}else if(t.type==yo.POINTERDOWN){var r=this.handleDownEvent_(t);this.handlingDownUpSequence=r,e=this.shouldStopEvent(r)}else t.type==yo.POINTERMOVE&&this.handleMoveEvent_(t);return!e}t(oa,As),oa.prototype.updateTrackedPointers_=function(t){if((r=t.type)===yo.POINTERDOWN||r===yo.POINTERDRAG||r===yo.POINTERUP){var e=t.pointerEvent,i=e.pointerId.toString();t.type==yo.POINTERUP?delete this.trackedPointers_[i]:t.type==yo.POINTERDOWN?this.trackedPointers_[i]=e:i in this.trackedPointers_&&(this.trackedPointers_[i]=e),this.targetPointers=o(this.trackedPointers_)}var r},oa.prototype.shouldStopEvent=function(t){return t};var ha=function(t){oa.call(this,{handleDownEvent:ca,handleDragEvent:la,handleUpEvent:ua});var e=t||{};this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.condition_=e.condition?e.condition:qs,this.noKinetic_=!1};function la(t){var e=this.targetPointers,i=sa(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],n=i[1]-this.lastCentroid[1],o=t.map.getView(),s=[r,n];Nn(s,o.getResolution()),On(s,o.getRotation()),Fn(s,o.getCenter()),s=o.constrainCenter(s),o.setCenter(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length}function ua(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.getCenter(),s=e.getPixelFromCo
1ordinate(o),a=e.getCoordinateFromPixel([s[0]-r*Math.cos(n),s[1]-r*Math.sin(n)]);i.animate({center:i.constrainCenter(a),duration:500,easing:ho})}return i.setHint(es,-1),!1}return this.kinetic_&&this.kinetic_.begin(),!(this.lastCentroid=null)}function ca(t){if(0<this.targetPointers.length&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,this.handlingDownUpSequence||e.setHint(es,1),e.getAnimating()&&e.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=1<this.targetPointers.length,!0}return!1}t(ha,oa),ha.prototype.shouldStopEvent=i;var pa=function(t){var e=t||{};oa.call(this,{handleDownEvent:ga,handleDragEvent:da,handleUpEvent:fa}),this.condition_=e.condition?e.condition:Xs,this.lastAngle_=void 0,this.duration_=void 0!==e.duration?e.duration:250};function da(t){if($s(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Qo){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 s=o-this.lastAngle_;Gs(i,i.getRotation()-s)}this.lastAngle_=o}}}function fa(t){if(!$s(t))return!0;var e=t.map.getView();return e.setHint(es,-1),ks(e,e.getRotation(),void 0,this.duration_),!1}function ga(t){return!!$s(t)&&(!(!Ws(t)||!this.condition_(t))&&(t.map.getView().setHint(es,1),!(this.lastAngle_=void 0)))}t(pa,oa),pa.prototype.shouldStopEvent=i;var _a=function(t){this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null};t(_a,y),_a.prototype.disposeInternal=function(){this.setMap(null)},_a.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"},_a.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},_a.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},_a.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new xn([i])},_a.prototype.getGeometry=function(){return this.geometry_};var va="boxstart",ya="boxdrag",ma="boxend",xa=function(t,e,i){m.call(this,t),this.coordinate=e,this.mapBrowserEvent=i};t(xa,m);var Sa=function(t){oa.call(this,{handleDownEvent:Ta,handleDragEvent:wa,handleUpEvent:Ea});var e=t||{};this.box_=new _a(e.className||"ol-dragbox"),this.minArea_=void 0!==e.minArea?e.minArea:64,this.startPixel_=null,this.condition_=e.condition?e.condition:Vs,this.boxEndCondition_=e.boxEndCondition?e.boxEndCondition:Ca};function Ca(t,e,i){var r=i[0]-e[0],n=i[1]-e[1];return r*r+n*n>=this.minArea_}function wa(t){$s(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new xa(ya,t.coordinate,t)))}function Ea(t){return!$s(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new xa(ma,t.coordinate,t))),!1)}function Ta(t){return!!$s(t)&&(!(!Ws(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new xa(va,t.coordinate,t)),!0))}t(Sa,oa),Sa.prototype.getGeometry=function(){return this.box_.getGeometry()},Sa.prototype.onBoxEnd=F;var Ra=function(t){var e=t||{},i=e.condition?e.condition:Js;this.duration_=void 0!==e.duration?e.duration:200,this.out_=void 0!==e.out&&e.out,Sa.call(this,{condition:i,className:e.className||"ol-dragzoom"})};t(Ra,Sa),Ra.prototype.onBoxEnd=function(){var t=this.getMap(),e=t.getView(),i=t.getSize(),r=this.getGeometry().getExtent();if(this.out_){var n=e.calculateExtent(i),o=ft([t.getPixelFromCoordinate(Tt(r)),t.getPixelFromCo
1ordinate(bt(r))]);kt(n,1/e.getResolutionForExtent(o,i)),r=n}var s=e.constrainResolution(e.getResolutionForExtent(r,i)),a=It(r);a=e.constrainCenter(a),e.animate({resolution:s,center:a,duration:this.duration_,easing:ho})};var Ia=37,Fa=38,La=39,Pa=40,Ma=function(t){As.call(this,{handleEvent:ba});var e=t||{};this.defaultCondition_=function(t){return qs(t)&&Qs(t)},this.condition_=void 0!==e.condition?e.condition:this.defaultCondition_,this.duration_=void 0!==e.duration?e.duration:100,this.pixelDelta_=void 0!==e.pixelDelta?e.pixelDelta:128};function ba(t){var e=!1;if(t.type==N){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==Pa||i==Ia||i==La||i==Fa)){var r=t.map.getView(),n=r.getResolution()*this.pixelDelta_,o=0,s=0;i==Pa?s=-n:i==Ia?o=-n:i==La?o=n:s=n;var a=[o,s];On(a,r.getRotation()),function(t,e,i){var r=t.getCenter();if(r){var n=t.constrainCenter([r[0]+e[0],r[1]+e[1]]);i?t.animate({duration:i,easing:uo,center:n}):t.setCenter(n)}}(r,a,this.duration_),t.preventDefault(),e=!0}}return!e}t(Ma,As);var Oa=function(t){As.call(this,{handleEvent:Na});var e=t||{};this.condition_=e.condition?e.condition:Qs,this.delta_=e.delta?e.delta:1,this.duration_=void 0!==e.duration?e.duration:100};function Na(t){var e=!1;if(t.type==N||t.type==A){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var r=t.map,n=i=="+".charCodeAt(0)?this.delta_:-this.delta_;Us(r.getView(),n,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}t(Oa,As);var Aa="trackpad",ka="wheel",Ga=function(t){As.call(this,{handleEvent:Da});var e=t||{};this.delta_=0,this.duration_=void 0!==e.duration?e.duration:250,this.timeout_=void 0!==e.timeout?e.timeout:80,this.useAnchor_=void 0===e.useAnchor||e.useAnchor,this.constrainResolution_=e.constrainResolution||!1,this.condition_=e.condition?e.condition:Vs,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_=void 0,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5};function Da(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==X&&e!==j)return!0;t.preventDefault();var i,r=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==X?(i=n.deltaY,Ei&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=Fi),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):t.type==j&&(i=-n.wheelDeltaY,Ti&&(i/=3)),0===i)return!1;var o=Date.now();if(void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?Aa:ka),this.mode_===Aa){var s=r.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):s.setHint(es,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=s.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),h=s.getMinResolution(),l=s.getMaxResolution(),u=0;if(a<h?(a=Math.max(a,h/this.trackpadZoomBuffer_),u=1):l<a&&(a=Math.min(a,l*this.trackpadZoomBuffer_),u=-1),this.lastAnchor_){var c=s.calculateCenterZoom(a,this.lastAnchor_);s.setCenter(s.constrainCenter(c))}return s.setResolution(a),0===u&&this.constrainResolution_&&s.animate({resolution:s.constrainResolution(a,0<i?-1:1),easing:ho,anchor:this.lastAnchor_,duration:this.duration_}),0<u?s.animate({resolution:h,easing:ho,anchor:this.lastAnchor_,duration:500}):u<0&&s.animate({resolution:l,easing:ho,anchor:this.lastAnchor_,duration:500}),this.startTime_=o,!1}this.delta_+=i;var p=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),p),!1}t(Ga,As),Ga.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(es,-1)},Ga.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();Us(e,-jt(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},Ga.prototype.setMouseAnchor=function(t){(this.useAnchor_=t)||(this.lastAnchor_=null)};var Ua=function(t){oa.call(this,{handleDownEvent:Ba,handleDragEvent:ja,handleUpEvent:za});var e=t||{};this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==e.threshold?e.threshold:.3,this.duration_=void 0!==e.duration?e.duration:250};function ja(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 s=t.map,a=s.getView();if(a.getConstraints().rotation!==Qo){var h=s.getViewport().getBoundingClientRect(),l=sa(this.targetPointers);if(l[0]-=h.left,l[1]-=h.top,this.anchor_=s.getCoordinateFromPixel(l),this.rotating_){var u=a.getRotation();s.render(),Gs(a,u+e,this.anchor_)}}}function za(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint(es,-1),this.rotating_)ks(e,e.getRotation(),this.anchor_,this.duration_);return!1}return!0}function Ba(t){if(2<=this.targetPointers.length){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().setHint(es,1),!0}return!1}t(Ua,oa),Ua.prototype.shouldStopEvent=i;var Ya=function(t){oa.call(this,{handleDownEvent:Wa,handleDragEvent:Xa,handleUpEvent:Va});var e=t||{};this.constrainResolution_=e.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==e.duration?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1};function Xa(t){var e=1,i=this.targetPointers[0],r=this.targetPointers[1],n=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(n*n+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,h=a.getView(),l=h.getResolution(),u=h.getMaxResolution(),c=h.getMinResolution(),p=l*e;u<p?(e=u/l,p=u):p<c&&(e=c/l,p=c),1!=e&&(this.lastScaleDelta_=e);var d=a.getViewport().getBoundingClientRect(),f=sa(this.targetPointers);f[0]-=d.left,f[1]-=d.top,this.anchor_=a.getCoordinateFromPixel(f),a.render(),js(h,p,this.anchor_)}function Va(t){if(this.targetPointers.length<2){var e=t.map.getView();e.setHint(es,-1);var i=e.getResolution();if(this.constrainResolution_||i<e.getMinResolution()||i>e.getMaxResolution()){var r=this.lastScaleDelta_-1;Ds(e,i,this.anchor_,this.duration_,r)}return!1}return!0}function Wa(t){if(2<=this.targetPointers.length){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().setHint(es,1),!0}return!1}t(Ya,oa),Ya.prototype.shouldStopEvent=i;
1var Ka="addfeatures",Za=function(t,e,i,r){m.call(this,t),this.features=i,this.file=e,this.projection=r};t(Za,m);var Ha=function(t){var e=t||{};As.call(this,{handleEvent:v}),this.formatConstructors_=e.formatConstructors?e.formatConstructors:[],this.projection_=e.projection?Ee(e.projection):null,this.dropListenKeys_=null,this.source_=e.source||null,this.target=e.target?e.target:null};function qa(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(k,this.handleResult_.bind(this,n)),o.readAsText(n)}}function Ja(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}t(Ha,As),Ha.prototype.handleResult_=function(t,e){var i=e.target.result,r=this.getMap(),n=this.projection_;n||(n=r.getView().getProjection());for(var o=this.formatConstructors_,s=[],a=0,h=o.length;a<h;++a){var l=new o[a];if((s=this.tryReadFeatures_(l,i,{featureProjection:n}))&&0<s.length)break}this.source_&&(this.source_.clear(),this.source_.addFeatures(s)),this.dispatchEvent(new Za(Ka,t,s,n))},Ha.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[S(e,b,qa,this),S(e,P,Ja,this),S(e,M,Ja,this),S(e,b,Ja,this)]}},Ha.prototype.setActive=function(t){As.prototype.setActive.call(this,t),t?this.registerListeners_():this.unregisterListeners_()},Ha.prototype.setMap=function(t){this.unregisterListeners_(),As.prototype.setMap.call(this,t),this.getActive()&&this.registerListeners_()},Ha.prototype.tryReadFeatures_=function(t,e,i){try{return t.readFeatures(e,i)}catch(t){return null}},Ha.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(f),this.dropListenKeys_=null)};var Qa=function(t){var e=t||{};oa.call(this,{handleDownEvent:eh,handleDragEvent:$a,handleUpEvent:th}),this.condition_=e.condition?e.condition:Js,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=void 0!==e.duration?e.duration:400};function $a(t){if($s(t)){var e=t.map,i=e.getSize(),r=t.pixel,n=r[0]-i[0]/2,o=i[1]/2-r[1],s=Math.atan2(o,n),a=Math.sqrt(n*n+o*o),h=e.getView();if(h.getConstraints().rotation!==Qo&&void 0!==this.lastAngle_){var l=s-this.lastAngle_;Gs(h,h.getRotation()-l)}if(this.lastAngle_=s,void 0!==this.lastMagnitude_)js(h,this.lastMagnitude_*(h.getResolution()/a));void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/a),this.lastMagnitude_=a}}function th(t){if(!$s(t))return!0;var e=t.map.getView();e.setHint(es,-1);var i=this.lastScaleDelta_-1;return ks(e,e.getRotation()),Ds(e,e.getResolution(),void 0,this.duration_,i),this.lastScaleDelta_=0,!1}function eh(t){return!!$s(t)&&(!!this.condition_(t)&&(t.map.getView().setHint(es,1),this.lastAngle_=void 0,!(this.lastMagnitude_=void 0)))}t(Qa,oa);var ih=function(t,e,i){Ur.call(this);var r=e||0;this.setCenterAndRadius(t,r,i)};t(ih,Ur),ih.prototype.clone=function(){var t=new ih(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},ih.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=t-n[0],s=e-n[1],a=o*o+s*s;if(a<r){if(0===a)for(var h=0;h<this.stride;++h)i[h]=n[h];else{var l=this.getRadius()/Math.sqrt(a);i[0]=n[0]+l*o,i[1]=n[1]+l*s;for(var u=2;u<this.stride;++u)i[u]=n[u]}return i.length=this.stride,a}return r},ih.prototype.containsXY=function(t,e){var i=this.flatCoordinates,r=t-i[0],n=e-i[1];return r*r+n*n<=this.getRadiusSquared_()},ih.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},ih.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return ct(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},ih.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},ih.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},ih.prototype.getType=function(){return Zt.CIRCLE},ih.prototype.intersectsExtent=function(t){if(Nt(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||St(t,this.intersectsCoordinate,this))}return!1},ih.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)}
1,ih.prototype.setCenterAndRadius=function(t,e,i){if(t){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,n=Zr(r,0,t,this.stride);r[n++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[n++]=r[o];r.length=n,this.changed()}else this.setFlatCoordinates(Dr.XY,null)},ih.prototype.getCoordinates=function(){},ih.prototype.setCoordinates=function(t,e){},ih.prototype.setFlatCoordinates=function(t,e){this.setFlatCoordinatesInternal(t,e),this.changed()},ih.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()};var rh=function(t,e){Ur.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,e)};t(rh,Ur),rh.prototype.appendLineString=function(t){this.flatCoordinates?Or(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},rh.prototype.clone=function(){var t=new rh(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),t},rh.prototype.closestPointXY=function(t,e,i,r){return r<ot(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Vr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Kr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,r))},rh.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=Dr.XYM&&this.layout!=Dr.XYZM||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,s){if(s)return jn(t,e,i[i.length-1],r,n,o);var a;if(n<t[r-1])return o?((a=t.slice(0,r))[r-1]=n,a):null;if(t[t.length-1]<n)return o?((a=t.slice(t.length-r))[r-1]=n,a):null;for(var h=0,l=i.length;h<l;++h){var u=i[h];if(e!=u){if(n<t[e+r-1])return null;if(n<=t[u-1])return jn(t,e,u,r,n,!1);e=u}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,n)},rh.prototype.getCoordinates=function(){return Qr(this.flatCoordinates,0,this.ends_,this.stride)},rh.prototype.getEnds=function(){return this.ends_},rh.prototype.getLineString=function(t){if(t<0||this.ends_.length<=t)return null;var e=new Bn(null);return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t])),e},rh.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,r=[],n=0,o=0,s=e.length;o<s;++o){var a=e[o],h=new Bn(null);h.setFlatCoordinates(i,t.slice(n,a)),r.push(h),n=a}return r},rh.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,o=0,s=r.length;o<s;++o){var a=r[o];Or(t,Un(e,i,a,n,.5)),i=a}return t},rh.prototype.getSimplifiedGeometryInternal=function(t){var e=[],i=[];e.length=function(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=tn(t,e,u,r,n,o,s),a.push(s),e=u}return s}(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i);var r=new rh(null);return r.setFlatCoordinates(Dr.XY,e,i),r},rh.prototype.getType=function(){return Zt.MULTI_LINE_STRING},rh.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){if(dn(t,e,i[o],r,n))return!0;e=i[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},rh.prototype.setCoordinates=function(t,e){if(t){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=qr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}else this.setFlatCoordinates(Dr.XY,null,this.ends_)},rh.prototype.setFlatCoordinates=function(t,e,i){this.setFlatCoordinatesInternal(t,e),this.ends_=i,this.changed()},rh.prototype.setLineStrings=function(t){for(var e=this.getLayout(),i=[],r=[],n=0,o=t.length;n<o;++n){var s=t[n];0===n&&(e=s.getLayout()),Or(i,s.getFlatCoordinates()),r.push(i.length)}this.setFlatCoordinates(e,i,r)};var nh=function(t,e){Ur.call(this),this.setCoordinates(t,e)};function oh(t,e,i,r){for(var n=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=i.length;s<a;++s){var h=i[s];o=gt(t,e,h[0],r),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=h[h.length-1]}return n}t(nh,Ur),nh.prototype.appendPoint=function(t){this.flatCoordinates?Or(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},nh.prototype.clone=function(){var t=new nh(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t}
1,nh.prototype.closestPointXY=function(t,e,i,r){if(r<ot(this.getExtent(),t,e))return r;for(var n=this.flatCoordinates,o=this.stride,s=0,a=n.length;s<a;s+=o){var h=Yt(t,e,n[s],n[s+1]);if(h<r){r=h;for(var l=0;l<o;++l)i[l]=n[s+l];i.length=o}}return r},nh.prototype.getCoordinates=function(){return Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},nh.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;if(t<0||e<=t)return null;var i=new sn(null);return i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride)),i},nh.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 s=new sn(null);s.setFlatCoordinates(e,t.slice(n,n+i)),r.push(s)}return r},nh.prototype.getType=function(){return Zt.MULTI_POINT},nh.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},nh.prototype.setCoordinates=function(t,e){t?(this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Hr(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Dr.XY,null)},nh.prototype.setFlatCoordinates=function(t,e){this.setFlatCoordinatesInternal(t,e),this.changed()};var sh=function(t,e){Ur.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(t,e)};t(sh,Ur),sh.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;Or(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()},sh.prototype.clone=function(){for(var t=new sh(null),e=this.endss_.length,i=new Array(e),r=0;r<e;++r)i[r]=this.endss_[r].slice();return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),i),t},sh.prototype.closestPointXY=function(t,e,i,r){return r<ot(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];n=Vr(t,e,a,r,n),e=a[a.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,r,n,o,s,a,h,l,u){for(var c=u||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];l=Kr(t,e,f,r,n,o,s,a,h,l,c),e=f[f.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))},sh.prototype.containsXY=function(t,e){return function(t,e,i,r,n,o){if(0===i.length)return!1;for(var s=0,a=i.length;s<a;++s){var h=i[s];if(ln(t,e,h,r,n,o))return!0;e=h[h.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},sh.prototype.getArea=function(){return function(t,e,i,r){for(var n=0,o=0,s=i.length;o<s;++o){var a=i[o];n+=Br(t,e,a,r),e=a[a.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},sh.prototype.getCoordinates=function(t){var e;return void 0!==t?mn(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,$r(e,0,this.endss_,this.stride)},sh.prototype.getEndss=function(){return this.endss_},sh.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=oh(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=cn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},sh.prototype.getInteriorPoints=function(){var t=new nh(null);return t.setFlatCoordinates(Dr.XYM,this.getFlatInteriorPoints().slice()),t},sh.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o)if(!vn(t,e,i[o],r,n))return!1;return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=mn(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},sh.prototype.getSimplifiedGeometryInternal=function(t){var e=[],i=[];
1e.length=function(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h],c=[];s=nn(t,e,u,r,n,o,s,c),a.push(c),e=u[u.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i);var r=new sh(null);return r.setFlatCoordinates(Dr.XY,e,i),r},sh.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,s=r.length;o<s;++o)r[o]-=e;var a=new xn(null);return a.setFlatCoordinates(this.layout,this.flatCoordinates.slice(e,n),r),a},sh.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[],n=0,o=0,s=i.length;o<s;++o){var a=i[o].slice(),h=a[a.length-1];if(0!==n)for(var l=0,u=a.length;l<u;++l)a[l]-=n;var c=new xn(null);c.setFlatCoordinates(t,e.slice(n,h),a),r.push(c),n=h}return r},sh.prototype.getType=function(){return Zt.MULTI_POLYGON},sh.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(fn(t,e,a,r,n))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},sh.prototype.setCoordinates=function(t,e){if(t){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,r,n){for(var o=n||[],s=0,a=0,h=i.length;a<h;++a){var l=qr(t,e,i[a],r,o[s]);e=(o[s++]=l)[l.length-1]}return o.length=s,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()}else this.setFlatCoordinates(Dr.XY,null,this.endss_)},sh.prototype.setFlatCoordinates=function(t,e,i){this.setFlatCoordinatesInternal(t,e),this.endss_=i,this.changed()},sh.prototype.setPolygons=function(t){for(var e=this.getLayout(),i=[],r=[],n=0,o=t.length;n<o;++n){var s=t[n];0===n&&(e=s.getLayout());for(var a=i.length,h=s.getEnds(),l=0,u=h.length;l<u;++l)h[l]+=a;Or(i,s.getFlatCoordinates()),r.push(h)}this.setFlatCoordinates(e,i,r)};var ah={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"},hh="image",lh="vector",uh="renderOrder",ch=function(t){var e=t||{},i=C({},e);delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,Rs.call(this,i),this.declutter_=void 0!==e.declutter&&e.declutter,this.renderBuffer_=void 0!==e.renderBuffer?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=void 0!==e.updateWhileAnimating&&e.updateWhileAnimating,this.updateWhileInteracting_=void 0!==e.updateWhileInteracting&&e.updateWhileInteracting,this.renderMode_=e.renderMode||lh,this.type=ah.VECTOR};t(ch,Rs),ch.prototype.getDeclutter=function(){return this.declutter_},ch.prototype.setDeclutter=function(t){this.declutter_=t},ch.prototype.getRenderBuffer=function(){return this.renderBuffer_},ch.prototype.getRenderOrder=function(){return this.get(uh)},ch.prototype.getStyle=function(){return this.style_},ch.prototype.getStyleFunction=function(){return this.styleFunction_},ch.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},ch.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},ch.prototype.setRenderOrder=function(t){this.set(uh,t)},ch.prototype.setStyle=function(t){var e,i,r;this.style_=void 0!==t?t:gr,this.styleFunction_=null===t?void 0:("function"==typeof(e=this.style_)?i=e:(Array.isArray(e)?r=e:($(e instanceof dr,41),r=[e]),i=function(){return r}),i),this.changed()},ch.prototype.getRenderMode=function(){return this.renderMode_};var ph={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};function dh(i,o,s,a){return function(t,e,r){var n=new XMLHttpRequest;n.open("GET","function"==typeof i?i(t,e,r):i,!0),o.getType()==ph.ARRAY_BUFFER&&(n.responseType="arraybuffer"),n.onload=function(t){if(!n.status||200<=n.status&&n.status<300){var e,i=o.getType();i==ph.JSON||i==ph.TEXT?e=n.responseText:i==ph.XML?(e=n.responseXML)||(e=(new DOMParser).parseFromString(n.responseText,"application/xml")):i==ph.ARRAY_BUFFER&&(e=n.response),e?s.call(this,o.readFeatures(e,{featureProjection:r}),o.readProjection(e),o.getLastExtent()):a.call(this)}else a.call(this)}.bind(this),n.onerror=function(){a.call(this)}.bind(this),n.send()}}function fh(t,e){return dh(t,e,function(t,e){this.addFeatures(t)},F)}function gh(t,e){return[[-1/0,-1/0,1/0,1/0]]}var _h=function(t){K.call(this),this.projection_=Ee(t.projection),this.attributions_=this.adaptAttributions_(t.attributions),this.state_=void 0!==t.state?t.state:vs,this.wrapX_=void 0!==t.wrapX&&t.wrapX};t(_h,K),_h.prototype.adaptAttributions_=function(e){return e?Array.isArray(e)?function(t){return e}:"function"==typeof e?e:function(t){return[e]}:null},_h.prototype.forEachFeatureAtCoordinate=F,_h.prototype.getAttributions=function(){return this.attributions_},_h.prototype.getProjection=function(){return this.projection_},_h.prototype.getResolutions=function(){},_h.prototype.getState=function(){return this.state_},_h.prototype.getWrapX=function(){return this.wrapX_},_h.prototype.refresh=function(){this.changed()},_h.prototype.setAttributions=function(t){this.attributions_=this.adaptAttributions_(t),this.changed()},_h.prototype.setState=function(t){this.state_=t,this.changed()};var vh="addfeature",yh="changefeature",mh="clear",xh="removefeature";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Sh,Ch=(function(t,e){t.exports=function(){function _(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function o(t,e){return t<e?-1:e<t?1:0}
vendor: 4,276 bytes, line 1
1return function(t,e,i,r,n){!function t(e,i,r,n,o){for(;r<n;){if(600<n-r){var s=n-r+1,a=i-r+1,h=Math.log(s),l=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*l*(s-l)/s)*(a-s/2<0?-1:1),c=Math.max(r,Math.floor(i-a*l/s+u)),p=Math.min(n,Math.floor(i+(s-a)*l/s+u));t(e,i,c,p,o)}var d=e[i],f=r,g=n;for(_(e,r,i),0<o(e[n],d)&&_(e,r,n);f<g;){for(_(e,f,g),f++,g--;o(e[f],d)<0;)f++;for(;0<o(e[g],d);)g--}0===o(e[r],d)?_(e,r,g):_(e,++g,n),g<=i&&(r=g+1),i<=g&&(n=g-1)}}(t,e,i||0,r||t.length-1,n||o)}}()}(Sh={exports:{}},Sh.exports),Sh.exports),wh=Th,Eh=Th;function Th(t,e){if(!(this instanceof Th))return new Th(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function Rh(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function Ih(t,e){Fh(t,0,t.children.length,e,t)}function Fh(t,e,i,r,n){n||(n=kh(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var o,s=e;s<i;s++)o=t.children[s],Lh(n,t.leaf?r(o):o);return n}function Lh(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 Ph(t,e){return t.minX-e.minX}function Mh(t,e){return t.minY-e.minY}function bh(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Oh(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Nh(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Ah(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function kh(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Gh(t,e,i,r,n){for(var o,s=[e,i];s.length;)(i=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((i-e)/r/2)*r,Ch(t,o,e,i,n),s.push(e,o,o,i))}Th.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!Ah(t,e))return i;for(var n,o,s,a,h=[];e;){for(n=0,o=e.children.length;n<o;n++)s=e.children[n],Ah(t,a=e.leaf?r(s):s)&&(e.leaf?i.push(s):Nh(t,a)?this._all(s,i):h.push(s));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!Ah(t,e))return!1;for(var r,n,o,s,a=[];e;){for(r=0,n=e.children.length;r<n;r++)if(o=e.children[r],Ah(t,s=e.leaf?i(o):o)){if(e.leaf||Nh(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=kh([]),this},remove:function(t,e){if(!t)return this;for(var i,r,n,o,s=this.data,a=this.toBBox(t),h=[],l=[];s||h.length;){if(s||(s=h.pop(),r=h[h.length-1],i=l.pop(),o=!0),s.leaf&&-1!==(n=Rh(t,s.children,e)))return s.children.splice(n,1),h.push(s),this._condense(h),this;o||s.leaf||!Nh(s,a)?r?(i++,s=r.children[i],o=!1):s=null:(h.push(s),l.push(i),i=0,s=(r=s).children[0])}return this},toBBox:function(t){return t},compareMinX:Ph,compareMinY:Mh,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,r){var n,o=i-e+1,s=this._maxEntries;if(o<=s)return Ih(n=kh(t.slice(e,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(n=kh([])).leaf=!1,n.height=r;var a,h,l,u,c=Math.ceil(o/s),p=c*Math.ceil(Math.sqrt(s));for(Gh(t,e,i,p,this.compareMinX),a=e;a<=i;a+=p)for(Gh(t,a,l=Math.min(a+p-1,i),c,this.compareMinY),h=a;h<=l;h+=c)u=Math.min(h+c-1,l),n.children.push(this._build(t,h,u,r-1));return Ih(n,this.toBBox),n},_chooseSubtree:function(t,e,i,r){for(var n,o,s,a,h,l,u,c,p,d;r.push(e),!e.leaf&&r.length-1!==i;){for(u=c=1/0,n=0,o=e.children.length;n<o;n++)h=bh(s=e.children[n]),p=t,d=s,(l=(Math.max(d.maxX,p.maxX)-Math.min(d.minX,p.minX))*(Math.max(d.maxY,p.maxY)-Math.min(d.minY,p.minY))-h)<c?(c=l,u=h<u?h:u,a=s):l===c&&h<u&&(u=h,a=s);e=a||e.children[0]}return e}
1,_insert:function(t,e,i){var r=this.toBBox,n=i?t:r(t),o=[],s=this._chooseSubtree(n,this.data,e,o);for(s.children.push(t),Lh(s,n);0<=e&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},_split:function(t,e){var i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var o=this._chooseSplitIndex(i,n,r),s=kh(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,Ih(i,this.toBBox),Ih(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},_splitRoot:function(t,e){this.data=kh([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ih(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,n,o,s,a,h,l,u,c,p,d,f,g,_;for(h=l=1/0,r=e;r<=i-e;r++)n=Fh(t,0,r,this.toBBox),o=Fh(t,r,i,this.toBBox),c=n,p=o,void 0,d=Math.max(c.minX,p.minX),f=Math.max(c.minY,p.minY),g=Math.min(c.maxX,p.maxX),_=Math.min(c.maxY,p.maxY),s=Math.max(0,g-d)*Math.max(0,_-f),a=bh(n)+bh(o),s<h?(h=s,u=r,l=a<l?a:l):s===h&&a<l&&(l=a,u=r);return u},_chooseSplitAxis:function(t,e,i){var r=t.leaf?this.compareMinX:Ph,n=t.leaf?this.compareMinY:Mh;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,n)&&t.children.sort(r)},_allDistMargin:function(t,e,i,r){t.children.sort(r);var n,o,s=this.toBBox,a=Fh(t,0,e,s),h=Fh(t,i-e,i,s),l=Oh(a)+Oh(h);for(n=e;n<i-e;n++)o=t.children[n],Lh(a,t.leaf?s(o):o),l+=Oh(a);for(n=i-e-1;e<=n;n--)o=t.children[n],Lh(h,t.leaf?s(o):o),l+=Oh(h);return l},_adjustParentBBoxes:function(t,e,i){for(var r=i;0<=r;r--)Lh(e[r],t)},_condense:function(t){for(var e,i=t.length-1;0<=i;i--)0===t[i].children.length?0<i?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Ih(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},wh.default=Eh;var Dh=function(t){this.rbush_=wh(t,void 0),this.items_={}};Dh.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_[wt(e)]=i},Dh.prototype.load=function(t,e){for(var i=new Array(e.length),r=0,n=e.length;r<n;r++){var o=t[r],s=e[r],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};i[r]=a,this.items_[wt(s)]=a}this.rbush_.load(i)},Dh.prototype.remove=function(t){var e=wt(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},Dh.prototype.update=function(t,e){var i=this.items_[wt(e)];_t([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},Dh.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},Dh.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})},Dh.prototype.forEach=function(t,e){return this.forEach_(this.getAll(),t,e)},Dh.prototype.forEachInExtent=function(t,e,i){return this.forEach_(this.getInExtent(t),e,i)},Dh.prototype.forEach_=function(t,e,i){for(var r,n=0,o=t.length;n<o;n++)if(r=e.call(i,t[n]))return r;return r},Dh.prototype.isEmpty=function(){return Et(this.items_)},Dh.prototype.clear=function(){this.rbush_.clear(),this.items_={}},Dh.prototype.getExtent=function(t){var e=this.rbush_.data;return ct(e.minX,e.minY,e.maxX,e.maxY,t)},Dh.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[0|e]=t.items_[0|e]};var Uh=function(t,e){m.call(this,t),this.feature=e};t(Uh,m);var jh=function(t){var e=t||{};_h.call(this,{attributions:e.attributions,projection:void 0,state:vs,wrapX:void 0===e.wrapX||e.wrapX}),this.loader_=F,this.format_=e.format,this.overlaps_=null==e.overlaps||e.overlaps,this.url_=e.url,void 0!==e.loader?this.loader_=e.loader:void 0!==this.url_&&($(this.format_,7),this.loader_=fh(this.url_,this.format_)),this.strategy_=void 0!==e.strategy?e.strategy:gh;var i,r,n=void 0===e.useSpatialIndex||e.useSpatialIndex;this.featuresRtree_=n?new Dh:null,this.loadedExtentsRtree_=new Dh,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,e.features instanceof Q?r=(i=e.features).getArray():Array.isArray(e.features)&&(r=e.features),n||void 0!==i||(i=new Q(r)),void 0!==r&&this.addFeaturesInternal(r),void 0!==i&&this.bindFeaturesCollection_(i)};t(jh,_h),jh.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},jh.prototype.addFeatureInternal=function(t){var e=wt(t).toString();if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;
1this.dispatchEvent(new Uh(vh,t))}},jh.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[S(e,E,this.handleFeatureChange_,this),S(e,l,this.handleFeatureChange_,this)]},jh.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:($(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=e),i},jh.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},jh.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],r=[],n=0,o=t.length;n<o;n++){var s=t[n],a=wt(s).toString();this.addToIndex_(a,s)&&i.push(s)}for(var h=0,l=i.length;h<l;h++){var u=i[h],c=wt(u).toString();this.setupChangeEvents_(c,u);var p=u.getGeometry();if(p){var d=p.getExtent();e.push(d),r.push(u)}else this.nullGeometryFeatures_[c]=u}this.featuresRtree_&&this.featuresRtree_.load(e,r);for(var f=0,g=i.length;f<g;f++)this.dispatchEvent(new Uh(vh,i[f]))},jh.prototype.bindFeaturesCollection_=function(e){var i=!1;S(this,vh,function(t){i||(i=!0,e.push(t.feature),i=!1)}),S(this,xh,function(t){i||(i=!0,e.remove(t.feature),i=!1)}),S(e,a,function(t){i||(i=!0,this.addFeature(t.element),i=!1)},this),S(e,h,function(t){i||(i=!0,this.removeFeature(t.element),i=!1)},this),this.featuresCollection_=e},jh.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(f)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var r=new Uh(mh);this.dispatchEvent(r),this.changed()},jh.prototype.forEachFeature=function(t){return this.featuresRtree_?this.featuresRtree_.forEach(t):this.featuresCollection_?this.featuresCollection_.forEach(t):void 0},jh.prototype.forEachFeatureAtCoordinateDirect=function(e,i){var t=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(t,function(t){return t.getGeometry().intersectsCoordinate(e)?i(t):void 0})},jh.prototype.forEachFeatureInExtent=function(t,e){return this.featuresRtree_?this.featuresRtree_.forEachInExtent(t,e):this.featuresCollection_?this.featuresCollection_.forEach(e):void 0},jh.prototype.forEachFeatureIntersectingExtent=function(i,r){return this.forEachFeatureInExtent(i,function(t){if(t.getGeometry().intersectsExtent(i)){var e=r(t);if(e)return e}})},jh.prototype.getFeaturesCollection=function(){return this.featuresCollection_},jh.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Et(this.nullGeometryFeatures_)||Or(t,o(this.nullGeometryFeatures_))),t},jh.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e},jh.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)},jh.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],o=t[1],s=null,a=[NaN,NaN],h=1/0,l=[-1/0,-1/0,1/0,1/0],u=e||v;return this.featuresRtree_.forEachInExtent(l,function(t){if(u(t)){var e=t.getGeometry(),i=h;if((h=e.closestPointXY(n,o,a,h))<i){s=t;var r=Math.sqrt(h);l[0]=n-r,l[1]=o-r,l[2]=n+r,l[3]=o+r}}}),s},jh.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},jh.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},jh.prototype.getFormat=function(){return this.format_},jh.prototype.getOverlaps=function(){return this.overlaps_},jh.prototype.getResolutions=function(){},jh.prototype.getUrl=function(){return this.url_},jh.prototype.handleFeatureChange_=function(t){var e=t.target,i=wt(e).toString(),r=e.getGeometry();if(r){var n=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var o=e.getId();if(void 0!==o){var s=o.toString();
1i in this.undefIdIndex_?(delete this.undefIdIndex_[i],this.idIndex_[s]=e):this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else i in this.undefIdIndex_||(this.removeFromIdIndex_(e),this.undefIdIndex_[i]=e);this.changed(),this.dispatchEvent(new Uh(yh,e))},jh.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:wt(t).toString()in this.undefIdIndex_},jh.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Et(this.nullGeometryFeatures_)},jh.prototype.loadFeatures=function(t,r,n){for(var o=this,s=this.loadedExtentsRtree_,a=this.strategy_(t,r),e=function(t,e){var i=a[t];s.forEachInExtent(i,function(t){return at(t.extent,i)})||(o.loader_.call(o,i,r,n),s.insert(i,{extent:i.slice()}))},i=0,h=a.length;i<h;++i)e(i)},jh.prototype.removeLoadedExtent=function(e){var i,t=this.loadedExtentsRtree_;t.forEachInExtent(e,function(t){if(_t(t.extent,e))return i=t,!0}),i&&t.remove(i)},jh.prototype.removeFeature=function(t){var e=wt(t).toString();e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},jh.prototype.removeFeatureInternal=function(t){var e=wt(t).toString();this.featureChangeKeys_[e].forEach(f),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i?delete this.idIndex_[i.toString()]:delete this.undefIdIndex_[e],this.dispatchEvent(new Uh(xh,t))},jh.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},jh.prototype.setLoader=function(t){this.loader_=t};var zh="Point",Bh="LineString",Yh="Polygon",Xh="Circle",Vh="drawstart",Wh="drawend",Kh=function(t,e){m.call(this,t),this.feature=e};t(Kh,m);var Zh=function(t){oa.call(this,{handleDownEvent:qh,handleEvent:Hh,handleUpEvent:Jh}),this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=function(t){var e;t===Zt.POINT||t===Zt.MULTI_POINT?e=zh:t===Zt.LINE_STRING||t===Zt.MULTI_LINE_STRING?e=Bh:t===Zt.POLYGON||t===Zt.MULTI_POLYGON?e=Yh:t===Zt.CIRCLE&&(e=Xh);return e}(this.type_),this.stopClick_=!!t.stopClick,this.minPoints_=t.minPoints?t.minPoints:this.mode_===Yh?3:2,this.maxPoints_=t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:v;var i,e=t.geometryFunction;if(!e)if(this.type_===Zt.CIRCLE)e=function(t,e){var i=e||new ih([NaN,NaN]),r=An(t[0],t[1]);return i.setCenterAndRadius(t[0],Math.sqrt(r)),i};else{var r,n=this.mode_;n===zh?r=sn:n===Bh?r=Bn:n===Yh&&(r=xn),e=function(t,e){var i=e;return i?n===Yh?t[0].length?i.setCoordinates([t[0].concat([t[0][0]])]):i.setCoordinates([]):i.setCoordinates(t):i=new r(t),i}}this.geometryFunction_=e,this.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new ch({source:new jh({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:(i=_r(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:qs,this.freehandCondition_,t.freehand?this.freehandCondition_=Vs:this.freehandCondition_=t.freehandCondition?t.freehandCondition:Js,S(this,H(Ns),this.updateState_,this)};function Hh(t){t.originalEvent.type===R&&t.preventDefault(),this.freehand_=this.mode_!==zh&&this.freehandCondition_(t);var e=t.type===yo.POINTERMOVE,i=!0;this.lastDragTime_&&t.type===yo.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&t.type===yo.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t),i=!1):this.freehand_&&t.type===yo.POINTERDOWN?i=!1:e?(i=t.type===yo.POINTERMOVE)&&this.freehand_?i=this.handlePointerMove_(t):("mouse"==t.pointerEvent.pointerType||t.type===yo.POINTERDRAG&&!this.downTimeout_)&&this.handlePointerMove_(t):t.type===yo.DBLCLICK&&(i=!1),aa.call(this,t)&&i}function qh(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):!!this.condition_(t)&&(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new mo(yo.POINTERMOVE,t.map,t.pointerEvent,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0)}function Jh(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var i=this.mode_===Xh;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t):(this.startDrawing_(t),this.mode_===zh&&this.finishDrawing()),e=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!e&&this.stopClick_&&t.stopPropagation(),e}t(Zh,oa),Zh.prototype.setMap=function(t){oa.prototype.setMap.call(this,t),this.updateState_()},Zh.prototype.handlePointerMove_=function(t){if(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!0}return this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t),!0},Zh.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,r=[this.finishCoordinate_];if(this.mode_===Bh?i=this.sketchCoords_.length>this.minPoints_:this.mode_===Yh&&(i=this.sketchCoords_[0].length>this.minPoints_,r=[this.sketchCoords_[0][0],this.sketchCoords_[0][this.sketchCoords_[0].length-2]]),i)for(var n=t.map,o=0,s=r.length;o<s;
1o++){var a=r[o],h=n.getPixelFromCoordinate(a),l=t.pixel,u=l[0]-h[0],c=l[1]-h[1],p=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(u*u+c*c)<=p){this.finishCoordinate_=a;break}}}return e},Zh.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new yr(new sn(e)),this.updateSketchFeatures_())},Zh.prototype.startDrawing_=function(t){var e=t.coordinate;this.finishCoordinate_=e,this.mode_===zh?this.sketchCoords_=e.slice():this.mode_===Yh?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new yr(new Bn(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_);this.sketchFeature_=new yr,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Kh(Vh,this.sketchFeature_))},Zh.prototype.modifyDrawing_=function(t){var e,i,r=t.coordinate,n=this.sketchFeature_.getGeometry();(this.mode_===zh?i=this.sketchCoords_:this.mode_===Yh?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(r=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=r[0],i[1]=r[1],this.geometryFunction_(this.sketchCoords_,n),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(r);if(n instanceof xn&&this.mode_!==Yh){this.sketchLine_||(this.sketchLine_=new yr(new Bn(null)));var o=n.getLinearRing(0);this.sketchLine_.getGeometry().setFlatCoordinates(o.getLayout(),o.getFlatCoordinates())}else this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},Zh.prototype.addToDrawing_=function(t){var e,i,r=t.coordinate,n=this.sketchFeature_.getGeometry();this.mode_===Bh?(this.finishCoordinate_=r.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(r.slice()),this.geometryFunction_(i,n)):this.mode_===Yh&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(r.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n)),this.updateSketchFeatures_(),e&&this.finishDrawing()},Zh.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry();this.mode_===Bh?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e),2<=t.length&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Yh&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e)),0===t.length&&(this.finishCoordinate_=null),this.updateSketchFeatures_()}},Zh.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry();this.mode_===Bh?(e.pop(),this.geometryFunction_(e,i)):this.mode_===Yh&&(e[0].pop(),this.geometryFunction_(e,i),e=i.getCoordinates()),this.type_===Zt.MULTI_POINT?t.setGeometry(new nh([e])):this.type_===Zt.MULTI_LINE_STRING?t.setGeometry(new rh([e])):this.type_===Zt.MULTI_POLYGON&&t.setGeometry(new sh([e])),this.dispatchEvent(new Kh(Wh,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},Zh.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return t&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),t},Zh.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.updateSketchFeatures_(),this.dispatchEvent(new Kh(Vh,this.sketchFeature_))},Zh.prototype.shouldStopEvent=i,Zh.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)},Zh.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing_(),this.overlay_.setMap(e?t:null)};var Qh="extentchanged",$h=function(t){m.call(this,Qh),this.extent=t};t($h,m);var tl=function(t){var i,r,e=t||{};this.extent_=null,this.pointerHandler_=null,this.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,this.snappedToVertex_=!1,this.extentFeature_=null,this.vertexFeature_=null,t||(t={}),oa.call(this,{handleDownEvent:il,handleDragEvent:rl,handleEvent:el,handleUpEvent:nl}),this.extentOverlay_=new ch({source:new jh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:(i=_r(),function(t,e){return i[Zt.POLYGON]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.vertexOverlay_=new ch({source:new jh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:(r=_r(),function(t,e){return r[Zt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),t.extent&&this.setExtent(t.extent)};function el(t){return!(t instanceof mo)||(t.type!=yo.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),aa.call(this,t),!1)}function il(t){var e=t.pixel,i=t.map,r=this.getExtent(),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};
1if(n&&r){var s=n[0]==r[0]||n[0]==r[2]?n[0]:null,a=n[1]==r[1]||n[1]==r[3]?n[1]:null;null!==s&&null!==a?this.pointerHandler_=ol(o(n)):null!==s?this.pointerHandler_=sl(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.pointerHandler_=sl(o([r[0],a]),o([r[2],a])))}else n=i.getCoordinateFromPixel(e),this.setExtent([n[0],n[1],n[0],n[1]]),this.pointerHandler_=ol(n);return!0}function rl(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}return!0}function nl(t){this.pointerHandler_=null;var e=this.getExtent();return e&&0!==Ct(e)||this.setExtent(null),!1}function ol(e){return function(t){return it([e,t])}}function sl(e,i){return e[0]==i[0]?function(t){return it([e,[t[0],i[1]]])}:e[1]==i[1]?function(t){return it([e,[i[0],t[1]]])}:null}t(tl,oa),tl.prototype.snapToVertex_=function(t,e){var i,r=e.getCoordinateFromPixel(t),n=this.getExtent();if(n){var o=[[[(i=n)[0],i[1]],[i[0],i[3]]],[[i[0],i[3]],[i[2],i[3]]],[[i[2],i[3]],[i[2],i[1]]],[[i[2],i[1]],[i[0],i[1]]]];o.sort(function(t,e){return Gn(r,t)-Gn(r,e)});var s=o[0],a=Ln(r,s),h=e.getPixelFromCoordinate(a);if(kn(t,h)<=this.pixelTolerance_){var l=e.getPixelFromCoordinate(s[0]),u=e.getPixelFromCoordinate(s[1]),c=An(h,l),p=An(h,u),d=Math.sqrt(Math.min(c,p));return this.snappedToVertex_=d<=this.pixelTolerance_,this.snappedToVertex_&&(a=p<c?s[1]:s[0]),a}}return null},tl.prototype.handlePointerMove_=function(t){var e=t.pixel,i=t.map,r=this.snapToVertex_(e,i);r||(r=i.getCoordinateFromPixel(e)),this.createOrUpdatePointerFeature_(r)},tl.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Cn(t)):e.setGeometry(void 0):(e=new yr(t?Cn(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},tl.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new yr(new sn(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},tl.prototype.setMap=function(t){this.extentOverlay_.setMap(t),this.vertexOverlay_.setMap(t),oa.prototype.setMap.call(this,t)},tl.prototype.getExtent=function(){return this.extent_},tl.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new $h(this.extent_))};var al="modifystart",hl="modifyend",ll=function(t,e,i){m.call(this,t),this.features=e,this.mapBrowserEvent=i};t(ll,m);var ul=function(t){var i,e;if(oa.call(this,{handleDownEvent:fl,handleDragEvent:gl,handleEvent:vl,handleUpEvent:_l}),this.condition_=t.condition?t.condition:ta,this.defaultDeleteCondition_=function(t){return Ys(t)&&Hs(t)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:Vs,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.modified_=!1,this.rBush_=new Dh,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new ch({source:new jh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:(i=_r(),function(t,e){return i[Zt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,Circle:this.writeCircleGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_},this.source_=null,t.source?(this.source_=t.source,e=new Q(this.source_.getFeatures()),S(this.source_,vh,this.handleSourceAdd_,this),S(this.source_,xh,this.handleSourceRemove_,this)):e=t.features,!e)throw new Error("The modify interaction requires features or a source");this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),S(this.features_,a,this.handleFeatureAdd_,this),S(this.features_,h,this.handleFeatureRemove_,this),this.lastPointerEvent_=null};t(ul,oa);var cl=0,pl=1;function dl(t,e){return t.index-e.index}function fl(t){if(!this.condition_(t))return!1;this.handlePointerAtPixel_(t.pixel,t.map);var e=t.map.getCoordinateFromPixel(t.pixel);this.dragSegments_.length=0,this.modified_=!1;var i=this.vertexFeature_;if(i){var r=[],n=i.getGeometry().getCoordinates(),o=it([n]),s=this.rBush_.getInExtent(o),a={};s.sort(dl);for(var h=0,l=s.length;h<l;++h){var u=s[h],c=u.segment,p=wt(u.feature),d=u.depth;if(d&&(p+="-"+d.join("-")),a[p]||(a[p]=new Array(2)),u.geometry.getType()===Zt.CIRCLE&&u.index===pl)bn(ml(e,u),n)&&!a[p
1][0]&&(this.dragSegments_.push([u,0]),a[p][0]=u);else if(bn(c[0],n)&&!a[p][0])this.dragSegments_.push([u,0]),a[p][0]=u;else if(bn(c[1],n)&&!a[p][1]){if((u.geometry.getType()===Zt.LINE_STRING||u.geometry.getType()===Zt.MULTI_LINE_STRING)&&a[p][0]&&0===a[p][0].index)continue;this.dragSegments_.push([u,1]),a[p][1]=u}else this.insertVertexCondition_(t)&&wt(c)in this.vertexSegments_&&!a[p][0]&&!a[p][1]&&r.push([u,n])}r.length&&this.willModifyFeatures_(t);for(var f=r.length-1;0<=f;--f)this.insertVertex_.apply(this,r[f])}return!!this.vertexFeature_}function gl(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t);for(var e=t.coordinate,i=0,r=this.dragSegments_.length;i<r;++i){for(var n=this.dragSegments_[i],o=n[0],s=o.depth,a=o.geometry,h=void 0,l=o.segment,u=n[1];e.length<a.getStride();)e.push(l[u][e.length]);switch(a.getType()){case Zt.POINT:h=e,l[0]=l[1]=e;break;case Zt.MULTI_POINT:(h=a.getCoordinates())[o.index]=e,l[0]=l[1]=e;break;case Zt.LINE_STRING:(h=a.getCoordinates())[o.index+u]=e,l[u]=e;break;case Zt.MULTI_LINE_STRING:case Zt.POLYGON:(h=a.getCoordinates())[s[0]][o.index+u]=e,l[u]=e;break;case Zt.MULTI_POLYGON:(h=a.getCoordinates())[s[1]][s[0]][o.index+u]=e,l[u]=e;break;case Zt.CIRCLE:l[0]=l[1]=e,o.index===cl?(this.changingFeature_=!0,a.setCenter(e)):(this.changingFeature_=!0,a.setRadius(kn(a.getCenter(),e))),this.changingFeature_=!1}h&&this.setGeometryCoordinates_(a,h)}this.createOrUpdateVertexFeature_(e)}function _l(t){for(var e=this.dragSegments_.length-1;0<=e;--e){var i=this.dragSegments_[e][0],r=i.geometry;if(r.getType()===Zt.CIRCLE){var n=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=o.segment[1]=n,s.segment[0]=s.segment[1]=n,this.rBush_.update(dt(n),o),this.rBush_.update(r.getExtent(),s)}else this.rBush_.update(it(i.segment),i)}return this.modified_&&(this.dispatchEvent(new ll(hl,this.features_,t)),this.modified_=!1),!1}function vl(t){return!(t instanceof mo)||((this.lastPointerEvent_=t).map.getView().getInteracting()||t.type!=yo.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(e=!(t.type!=yo.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),t.type==yo.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),aa.call(this,t)&&!e);var e}function yl(t,e){var i=e.geometry;if(i.getType()===Zt.CIRCLE){var r=i;if(e.index===pl){var n=An(r.getCenter(),t),o=Math.sqrt(n)-r.getRadius();return o*o}}return Gn(t,e.segment)}function ml(t,e){var i=e.geometry;return i.getType()===Zt.CIRCLE&&e.index===pl?i.getClosestPoint(t):Ln(t,e.segment)}ul.prototype.addFeature_=function(t){var e=t.getGeometry();e&&e.getType()in this.SEGMENT_WRITERS_&&this.SEGMENT_WRITERS_[e.getType()].call(this,t,e);var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),S(t,E,this.handleFeatureChange_,this)},ul.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new ll(al,this.features_,t)))},ul.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),d(t,E,this.handleFeatureChange_,this)},ul.prototype.removeFeatureSegmentData_=function(e){var t=this.rBush_,i=[];t.forEach(function(t){e===t.feature&&i.push(t)});for(var r=i.length-1;0<=r;--r)t.remove(i[r])},ul.prototype.setActive=function(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),oa.prototype.setActive.call(this,t)},ul.prototype.setMap=function(t){this.overlay_.setMap(t),oa.prototype.setMap.call(this,t)},ul.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},ul.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},ul.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},ul.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},ul.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},ul.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),r={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},ul.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},ul.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),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(it(o),s)}},ul.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:h};this.rBush_.insert(it(h),l)}},ul.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:h};this.rBush_.insert(it(h),l)}},ul.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var h=o[s],l=0,u=h.length-1;l<u;++l){var c=h.slice(l,l+2),p={feature:t,geometry:e,depth:[s,r],index:l,segment:c};this.rBush_.insert(it(c),p)}},ul.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),r={feature:t,geometry:e,index:cl,segment:[i,i]},n={feature:t,geometry:e,index:pl,segment:[i,i]},o=[r,n];r.featureSegments=n.featureSegments=o,this.rBush_.insert(dt(i),r),this.rBush_.insert(e.getExtent(),n)},ul.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),r=0;r<i.length;++r)this.SEGMENT_WRITERS_[i[r].getType()].call(this,t,i[r])},ul.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new yr(new sn(t)),this.vertexFeature_=e,this.overlay_.getSource().addFeature(e));return e},ul.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map)},ul.prototype.handlePointerAtPixel_=function(t,e){var i=e.getCoordinateFromPixel(t),r=rt(dt(i),e.getView().getResolution()*this.pixelTolerance_),n=this.rBush_.getInExtent(r);if(0<n.length){n.sort(function(t,e){return yl(i,t)-yl(i,e)});
1var o=n[0],s=o.segment,a=ml(i,o),h=e.getPixelFromCoordinate(a),l=kn(t,h);if(l<=this.pixelTolerance_){var u={};if(o.geometry.getType()===Zt.CIRCLE&&o.index===pl)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(a);else{var c=e.getPixelFromCoordinate(s[0]),p=e.getPixelFromCoordinate(s[1]),d=An(h,c),f=An(h,p);l=Math.sqrt(Math.min(d,f)),this.snappedToVertex_=l<=this.pixelTolerance_,this.snappedToVertex_&&(a=f<d?s[1]:s[0]),this.createOrUpdateVertexFeature_(a);for(var g=1,_=n.length;g<_;++g){var v=n[g].segment;if(!(bn(s[0],v[0])&&bn(s[1],v[1])||bn(s[0],v[1])&&bn(s[1],v[0])))break;u[wt(v)]=!0}}return u[wt(s)]=!0,void(this.vertexSegments_=u)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},ul.prototype.insertVertex_=function(t,e){for(var i,r=t.segment,n=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case Zt.MULTI_LINE_STRING:case Zt.POLYGON:(i=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case Zt.MULTI_POLYGON:(i=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case Zt.LINE_STRING:(i=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var h=this.rBush_;h.remove(t),this.updateSegmentIndices_(o,a,s,1);var l={segment:[r[0],e],feature:n,geometry:o,depth:s,index:a};h.insert(it(l.segment),l),this.dragSegments_.push([l,1]);var u={segment:[e,r[1]],feature:n,geometry:o,depth:s,index:a+1};h.insert(it(u.segment),u),this.dragSegments_.push([u,0]),this.ignoreNextSingleClick_=!0},ul.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=yo.POINTERDRAG){var t=this.lastPointerEvent_;return this.willModifyFeatures_(t),this.removeVertex_(),this.dispatchEvent(new ll(hl,this.features_,t)),!(this.modified_=!1)}return!1},ul.prototype.removeVertex_=function(){var t,e,i,r,n,o,s,a,h,l,u,c=this.dragSegments_,p={},d=!1;for(n=c.length-1;0<=n;--n)u=wt((l=(i=c[n])[0]).feature),l.depth&&(u+="-"+l.depth.join("-")),u in p||(p[u]={}),0===i[1]?(p[u].right=l,p[u].index=l.index):1==i[1]&&(p[u].left=l,p[u].index=l.index+1);for(u in p){switch(h=p[u].right,s=p[u].left,(a=(o=p[u].index)-1)<0&&(a=0),t=e=(r=(l=void 0!==s?s:h).geometry).getCoordinates(),d=!1,r.getType()){case Zt.MULTI_LINE_STRING:2<e[l.depth[0]].length&&(e[l.depth[0]].splice(o,1),d=!0);break;case Zt.LINE_STRING:2<e.length&&(e.splice(o,1),d=!0);break;case Zt.MULTI_POLYGON:t=t[l.depth[1]];case Zt.POLYGON:4<(t=t[l.depth[0]]).length&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(r,e);var f=[];if(void 0!==s&&(this.rBush_.remove(s),f.push(s.segment[0])),void 0!==h&&(this.rBush_.remove(h),f.push(h.segment[1])),void 0!==s&&void 0!==h){var g={depth:l.depth,feature:l.feature,geometry:l.geometry,index:a,segment:f};this.rBush_.insert(it(g.segment),g)}this.updateSegmentIndices_(r,o,l.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.length=0}}return d},ul.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},ul.prototype.updateSegmentIndices_=function(e,i,r,n){this.rBush_.forEachInExtent(e.getExtent(),function(t){t.geometry===e&&(void 0===r||void 0===t.depth||Ar(t.depth,r))&&t.index>i&&(t.index+=n)})};var xl="select",Sl=function(t,e,i,r){m.call(this,t),this.selected=e,this.deselected=i,this.mapBrowserEvent=r};t(Sl,m);var Cl=function(t){As.call(this,{handleEvent:wl});var e=t||{};this.condition_=e.condition?e.condition:Hs,this.addCondition_=e.addCondition?e.addCondition:Ks,this.removeCondition_=e.removeCondition?e.removeCondition:Ks,this.toggleCondition_=e.toggleCondition?e.toggleCondition:Js,this.multi_=!!e.multi&&e.multi,this.filter_=e.filter?e.filter:v,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0;var i,r,n=new ch({source:new jh({useSpatialIndex:!1,features:e.features,wrapX:e.wrapX}),style:e.style?e.style:(i=_r(),Or(i[Zt.POLYGON],i[Zt.LINE_STRING]),Or(i[Zt.GEOMETRY_COLLECTION],i[Zt.LINE_STRING]),function(t,e){return t.getGeometry()?i[t.getGeometry().getType()]:null}),updateWhileAnimating:!0,updateWhileInteracting:!0});if(this.featureOverlay_=n,e.layers)if("function"==typeof e.layers)r=e.layers;else{var o=e.layers;r=function(t){return Pr(o,t)}}else r=v;this.layerFilter_=r,this.featureLayerAssociation_={};var s=this.featureOverlay_.getSource().getFeaturesCollection();S(s,a,this.addFeature_,this),S(s,h,this.removeFeature_,this)};function wl(t){if(!this.condition_(t))return!0;var i=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),e=!i&&!r&&!n,o=t.map,s=this.featureOverlay_.getSource().getFeaturesCollection(),a=[],h=[];if(e){g(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return h.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=s.getLength()-1;0<=l;--l){var u=s.item(l),c=h.indexOf(u);-1<c?h.splice(c,1):(s.remove(u),a.push(u))}0!==h.length&&s.extend(h)}else{o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return!i&&!n||Pr(s.getArray(),t)?(r||n)&&Pr(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(h.push(t),this.addFeatureLayerAssociation_(t,e)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=a.length-1;0<=p;
1--p)s.remove(a[p]);s.extend(h)}return(0<h.length||0<a.length)&&this.dispatchEvent(new Sl(xl,h,a,t)),Zs(t)}t(Cl,As),Cl.prototype.addFeatureLayerAssociation_=function(t,e){var i=wt(t);this.featureLayerAssociation_[i]=e},Cl.prototype.getFeatures=function(){return this.featureOverlay_.getSource().getFeaturesCollection()},Cl.prototype.getHitTolerance=function(){return this.hitTolerance_},Cl.prototype.getLayer=function(t){var e=wt(t);return this.featureLayerAssociation_[e]},Cl.prototype.setHitTolerance=function(t){this.hitTolerance_=t},Cl.prototype.setMap=function(t){var e=this.getMap(),i=this.featureOverlay_.getSource().getFeaturesCollection();e&&i.forEach(e.unskipFeature.bind(e)),As.prototype.setMap.call(this,t),this.featureOverlay_.setMap(t),t&&i.forEach(t.skipFeature.bind(t))},Cl.prototype.addFeature_=function(t){var e=this.getMap();e&&e.skipFeature(t.element)},Cl.prototype.removeFeature_=function(t){var e=this.getMap();e&&e.unskipFeature(t.element)},Cl.prototype.removeFeatureLayerAssociation_=function(t){var e=wt(t);delete this.featureLayerAssociation_[e]};var El=function(t){oa.call(this,{handleEvent:Tl,handleDownEvent:v,handleUpEvent:Rl});var e=t||{};this.source_=e.source?e.source:null,this.vertex_=void 0===e.vertex||e.vertex,this.edge_=void 0===e.edge||e.edge,this.features_=e.features?e.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelCoordinate_=null,this.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,this.sortByDistance_=function(t,e){var i=Gn(this.pixelCoordinate_,t.segment),r=Gn(this.pixelCoordinate_,e.segment);return i-r}.bind(this),this.rBush_=new Dh,this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_,Circle:this.writeCircleGeometry_}};function Tl(t){var e=this.snapTo(t.pixel,t.coordinate,t.map);return e.snapped&&(t.coordinate=e.vertex.slice(0,2),t.pixel=e.vertexPixel),aa.call(this,t)}function Rl(t){var e=o(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1}t(El,oa),El.prototype.addFeature=function(t,e){var i=void 0===e||e,r=wt(t),n=t.getGeometry();if(n){var o=this.SEGMENT_WRITERS_[n.getType()];o&&(this.indexedFeaturesExtents_[r]=n.getExtent([1/0,1/0,-1/0,-1/0]),o.call(this,t,n))}i&&(this.featureChangeListenerKeys_[r]=S(t,E,this.handleFeatureChange_,this))},El.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},El.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},El.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},El.prototype.handleFeatureAdd_=function(t){var e;t instanceof Uh?e=t.feature:t instanceof J&&(e=t.element),this.addFeature(e)},El.prototype.handleFeatureRemove_=function(t){var e;t instanceof Uh?e=t.feature:t instanceof J&&(e=t.element),this.removeFeature(e)},El.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=wt(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},El.prototype.removeFeature=function(e,t){var i=void 0===t||t,r=wt(e),n=this.indexedFeaturesExtents_[r];if(n){var o=this.rBush_,s=[];o.forEachInExtent(n,function(t){e===t.feature&&s.push(t)});for(var a=s.length-1;0<=a;--a)o.remove(s[a])}i&&(f(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},El.prototype.setMap=function(t){var e=this.getMap(),i=this.featuresListenerKeys_,r=this.getFeatures_();e&&(i.forEach(f),i.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),oa.prototype.setMap.call(this,t),t&&(this.features_?i.push(S(this.features_,a,this.handleFeatureAdd_,this),S(this.features_,h,this.handleFeatureRemove_,this)):this.source_&&i.push(S(this.source_,vh,this.handleFeatureAdd_,this),S(this.source_,xh,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},El.prototype.shouldStopEvent=i,El.prototype.snapTo=function(t,e,
1i){var r=it([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()!==Zt.CIRCLE}));var o,s,a,h,l=!1,u=null,c=null;if(0<n.length){this.pixelCoordinate_=e,n.sort(this.sortByDistance_);var p=n[0].segment,d=n[0].feature.getGeometry().getType()===Zt.CIRCLE;this.vertex_&&!this.edge_?(o=i.getPixelFromCoordinate(p[0]),s=i.getPixelFromCoordinate(p[1]),a=An(t,o),h=An(t,s),Math.sqrt(Math.min(a,h))<=this.pixelTolerance_&&(l=!0,u=h<a?p[1]:p[0],c=i.getPixelFromCoordinate(u))):this.edge_&&(u=d?function(t,e){var i=e.getRadius(),r=e.getCenter(),n=r[0],o=r[1],s=t[0]-n,a=t[1]-o;0===s&&0===a&&(s=1);var h=Math.sqrt(s*s+a*a);return[n+i*s/h,o+i*a/h]}(e,n[0].feature.getGeometry()):Ln(e,p),kn(t,c=i.getPixelFromCoordinate(u))<=this.pixelTolerance_&&(l=!0,this.vertex_&&!d&&(o=i.getPixelFromCoordinate(p[0]),s=i.getPixelFromCoordinate(p[1]),a=An(c,o),h=An(c,s),Math.sqrt(Math.min(a,h))<=this.pixelTolerance_&&(u=h<a?p[1]:p[0],c=i.getPixelFromCoordinate(u))))),l&&(c=[Math.round(c[0]),Math.round(c[1])])}return{snapped:l,vertex:u,vertexPixel:c}},El.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},El.prototype.writeCircleGeometry_=function(t,e){for(var i=wn(e).getCoordinates()[0],r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),s={feature:t,segment:o};this.rBush_.insert(it(o),s)}},El.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.call(this,t,i[r])}},El.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),s={feature:t,segment:o};this.rBush_.insert(it(o),s)}},El.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,segment:h};this.rBush_.insert(it(h),l)}},El.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},El.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var h=o[s],l=0,u=h.length-1;l<u;++l){var c=h.slice(l,l+2),p={feature:t,segment:c};this.rBush_.insert(it(c),p)}},El.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),r={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},El.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,segment:h};this.rBush_.insert(it(h),l)}};var Il="translatestart",Fl="translating",Ll="translateend",Pl=function(t,e,i){m.call(this,t),this.features=e,this.coordinate=i};t(Pl,m);var Ml=function(t){oa.call(this,{handleDownEvent:bl,handleDragEvent:Nl,handleMoveEvent:Al,handleUpEvent:Ol});var e,i=t||{};if(this.lastCoordinate_=null,this.features_=void 0!==i.features?i.features:null,i.layers)if("function"==typeof i.layers)e=i.layers;else{var r=i.layers;e=function(t){return Pr(r,t)}}else e=v;this.layerFilter_=e,this.hitTolerance_=i.hitTolerance?i.hitTolerance:0,this.lastFeature_=null,S(this,H(Ns),this.handleActiveChanged_,this)};function bl(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.lastCoordinate_=t.coordinate,Al.call(this,t);var e=this.features_||new Q([this.lastFeature_]);return this.dispatchEvent(new Pl(Il,e,t.coordinate)),!0}return!1}function Ol(t){if(this.lastCoordinate_){this.lastCoordinate_=null,Al.call(this,t);var e=this.features_||new Q([this.lastFeature_]);return this.dispatchEvent(new Pl(Ll,e,t.coordinate)),!0}return!1}function Nl(t){if(this.lastCoordinate_){var e=t.coordinate,i=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],n=this.features_||new Q([this.lastFeature_]);
1n.forEach(function(t){var e=t.getGeometry();e.translate(i,r),t.setGeometry(e)}),this.lastCoordinate_=e,this.dispatchEvent(new Pl(Fl,n,e))}}function Al(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")}function kl(t){var e=t||{},i=new Q,r=new go(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new pa),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new zs({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new ha({kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Ua),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Ya({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Ma),i.push(new Oa({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Ga({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Ra({duration:e.zoomDuration})),i}t(Ml,oa),Ml.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t){if(!this.features_||Pr(this.features_.getArray(),t))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},Ml.prototype.getHitTolerance=function(){return this.hitTolerance_},Ml.prototype.setHitTolerance=function(t){this.hitTolerance_=t},Ml.prototype.setMap=function(t){var e=this.getMap();oa.prototype.setMap.call(this,t),this.updateState_(e)},Ml.prototype.handleActiveChanged_=function(){this.updateState_(null)},Ml.prototype.updateState_=function(t){var e=this.getMap(),i=this.getActive();e&&i||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")};var Gl=function(t,e,i,r,n){this.loader_=void 0!==n?n:null;var o=void 0!==n?Ni.IDLE:Ni.LOADED;$n.call(this,t,e,i,o),this.canvas_=r,this.error_=null};t(Gl,$n),Gl.prototype.getError=function(){return this.error_},Gl.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Ni.ERROR):this.state=Ni.LOADED,this.changed()},Gl.prototype.load=function(){this.state==Ni.IDLE&&(this.state=Ni.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},Gl.prototype.getImage=function(){return this.canvas_};var Dl=function(t,e,i,r,n){m.call(this,t),this.vectorContext=e,this.frameState=i,this.context=r,this.glContext=n};t(Dl,m);var Ul=function(){};Ul.prototype.drawCustom=function(t,e,i){},Ul.prototype.drawGeometry=function(t){},Ul.prototype.setStyle=function(t){},Ul.prototype.drawCircle=function(t,e){},Ul.prototype.drawFeature=function(t,e){},Ul.prototype.drawGeometryCollection=function(t,e){},Ul.prototype.drawLineString=function(t,e){},Ul.prototype.drawMultiLineString=function(t,e){},Ul.prototype.drawMultiPoint=function(t,e){},Ul.prototype.drawMultiPolygon=function(t,e){},Ul.prototype.drawPoint=function(t,e){},Ul.prototype.drawPolygon=function(t,e){},Ul.prototype.drawText=function(t,e){},Ul.prototype.setFillStrokeStyle=function(t,e){},Ul.prototype.setImageStyle=function(t,e){},Ul.prototype.setTextStyle=function(t,e){};var jl=function(t,e,i,r,n){Ul.call(this),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=r,this.viewRotation_=n,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageSnapToPixel_=!1,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]};t(jl,Ul),jl.prototype.drawImages_=function(t,e,i,r){var n=this;if(this.image_){var o=Dt(t,e,i,2,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.tmpLocalTransform_,h=s.globalAlpha;1!=this.imageOpacity_&&(s.globalAlpha=h*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,c=o.length;u<c;u+=2){var p=o[u]-n.imageAnchorX_,d=o[u+1]-n.imageAnchorY_;if(n.imageSnapToPixel_&&(p=Math.round(p),d=Math.round(d)),0!==l||1!=n.imageScale_){var f=p+n.imageAnchorX_,g=d+n.imageAnchorY_;Xe(a,f,g,n.imageScale_,n.imageScale_,l,-f,-g),s.setTransform.apply(s,a)}s.drawImage(n.image_,n.imageOriginX_,n.imageOriginY_,n.imageWidth_,n.imageHeight_,p,d,n.imageWidth_,n.imageHeight_)}0===l&&1==this.imageScale_||s.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(s.globalAlpha=h)}}
1,jl.prototype.drawText_=function(t,e,i,r){var n=this;if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=Dt(t,e,i,r,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=r){var h=o[e]+n.textOffsetX_,l=o[e+1]+n.textOffsetY_;if(0!==a||1!=n.textScale_){var u=Xe(n.tmpLocalTransform_,h,l,n.textScale_,n.textScale_,a,-h,-l);s.setTransform.apply(s,u)}n.textStrokeState_&&s.strokeText(n.text_,h,l),n.textFillState_&&s.fillText(n.text_,h,l)}0===a&&1==this.textScale_||s.setTransform(1,0,0,1,0,0)}},jl.prototype.moveToLineTo_=function(t,e,i,r,n){var o=this.context_,s=Dt(t,e,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;n&&(a-=2);for(var h=2;h<a;h+=2)o.lineTo(s[h],s[h+1]);return n&&o.closePath(),i},jl.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},jl.prototype.drawCircle=function(t){if(Nt(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 Dt(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)}},jl.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},jl.prototype.drawGeometry=function(t){switch(t.getType()){case Zt.POINT:this.drawPoint(t);break;case Zt.LINE_STRING:this.drawLineString(t);break;case Zt.POLYGON:this.drawPolygon(t);break;case Zt.MULTI_POINT:this.drawMultiPoint(t);break;case Zt.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Zt.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Zt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Zt.CIRCLE:this.drawCircle(t)}},jl.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Nt(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},jl.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,r=e.length;i<r;++i)this.drawGeometry(e[i])},jl.prototype.drawPoint=function(t){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)},jl.prototype.drawMultiPoint=function(t){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)},jl.prototype.drawLineString=function(t){if(Nt(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)}}},jl.prototype.drawMultiLineString=function(t){var e=t.getExtent();if(Nt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,r=t.getFlatCoordinates(),n=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,h=o.length;a<h;++a)n=this.moveToLineTo_(r,n,o[a],s,!1);i.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},jl.prototype.drawPolygon=function(t){if(Nt(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)}}},jl.prototype.drawMultiPolygon=function(t){if(Nt(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 s=0,a=n.length;s<a;++s){var h=n[s];r=this.drawRings_(i,r,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},jl.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},jl.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=e.lineCap=t.lineCap),Li&&(Ar(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,Li&&(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})},jl.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,r=t.textAlign?t.textAlign:Ki;i?(i.font!=t.font&&(i.font=e.font=t.font),i.textAlign!=r&&(i.textAlign=e.textAlign=r),i.textBaseline!=t.textBaseline&&(i.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})},jl.prototype.setFillStrokeStyle=function(t,e){if(t){var i=t.getColor();this.fillState_={fillStyle:ri(i||Bi)}}else this.fillState_=null;if(e){var r=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),s=e.getLineDashOffset(),a=e.getLineJoin(),h=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:Yi,lineDash:o||Xi,lineDashOffset:s||0,lineJoin:void 0!==a?a:Vi,lineWidth:this.pixelRatio_*(void 0!==h?h:1),miterLimit:void 0!==l?l:10,strokeStyle:ri(r||Wi)}}else this.strokeState_=null},jl.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),i=t.getImage(1),r=t.getOrigin(),n=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=n[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageSnapToPixel_=t.getSnapToPixel(),this.imageWidth_=n[0]}else this.image_=null}
1,jl.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:ri(i||Bi)}}else this.textFillState_=null;var r=t.getStroke();if(r){var n=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),h=r.getLineJoin(),l=r.getWidth(),u=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:Yi,lineDash:s||Xi,lineDashOffset:a||0,lineJoin:void 0!==h?h:Vi,lineWidth:void 0!==l?l:1,miterLimit:void 0!==u?u:10,strokeStyle:ri(n||Wi)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),_=t.getScale(),v=t.getText(),y=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:zi,textAlign:void 0!==y?y:Ki,textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==v?v:"",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_*(void 0!==_?_:1)}else this.text_=""};var zl=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function Bl(t,e,i){return e+":"+t+":"+(i?qe(i):"null")}zl.prototype.clear=function(){this.cache_={},this.cacheSize_=0},zl.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){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_)}}},zl.prototype.get=function(t,e,i){var r=Bl(t,e,i);return r in this.cache_?this.cache_[r]:null},zl.prototype.set=function(t,e,i,r){var n=Bl(t,e,i);this.cache_[n]=r,++this.cacheSize_},zl.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var Yl=new zl,Xl=function(t){y.call(this),this.map_=t,this.layerRenderers_={},this.layerRendererListeners_={},this.layerRendererConstructors_=[]};function Vl(t,e){Yl.expire()}function Wl(t,e){return t.zIndex-e.zIndex}t(Xl,y),Xl.prototype.registerLayerRenderers=function(t){this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_,t)},Xl.prototype.getLayerRendererConstructors=function(){return this.layerRendererConstructors_},Xl.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;Xe(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ve(Ue(r,i))},Xl.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},Xl.prototype.forEachFeatureAtCoordinate=function(t,n,e,o,s,i,r){var a,h=n.viewState,l=h.resolution;function u(t,e){var i=wt(t).toString(),r=n.layerStates[wt(e)].managed;if(!(i in n.skippedFeatureUids)||r)return o.call(s,t,r?e:null)}var c=h.projection,p=t;if(c.canWrapX()){var d=c.getExtent(),f=Ot(d),g=t[0];if(g<d[0]||g>d[2])p=[g+f*Math.ceil((d[0]-g)/f),t[1]]}var _,v=n.layerStatesArray;for(_=v.length-1;0<=_;--_){var y=v[_],m=y.layer;if(Is(y,l)&&i.call(r,m)){var x=this.getLayerRenderer(m);if(m.getSource()&&(a=x.forEachFeatureAtCoordinate(m.getSource().getWrapX()?p:t,n,e,u,s)),a)return a}}},Xl.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){},Xl.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,v,this,r,n)},Xl.prototype.getLayerRenderer=function(t){var e=wt(t).toString();if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var i,r=0,n=this.layerRendererConstructors_.length;r<n;++r){var o=this.layerRendererConstructors_[r];if(o.handles(t)){i=o.create(this,t);break}}if(!i)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[e]=i,this.layerRendererListeners_[e]=S(i,E,this.handleLayerRendererChange_,this),i},Xl.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},Xl.prototype.getLayerRenderers=function(){return this.layerRenderers_},Xl.prototype.getMap=function(){return this.map_},Xl.prototype.handleLayerRendererChange_=function(){this.map_.render()},Xl.prototype.removeLayerRendererByKey_=function(t){var e=this.layerRenderers_[t];return delete this.layerRenderers_[t],f(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],e},Xl.prototype.renderFrame=F,Xl.prototype.removeUnusedLayerRenderers_=function(t,e){for(var i in this.layerRenderers_)e&&i in e.layerStates||this.removeLayerRendererByKey_(i).dispose()},Xl.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Vl)},Xl.prototype.scheduleRemoveUnusedLayerRenderers=function(t){for(var e in this.layerRenderers_)if(!(e in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))};var Kl=[],Zl=function(t){Xl.call(this,t);var e=t.getViewport();this.context_=ni(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=ki,e.insertBefore(this.canvas_,e.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=[1,0,0,1,0,0]};t(Zl,Xl),Zl.prototype.dispatchComposeEvent_=function(t,e){var i=this.getMap(),r=this.context_;if(i.hasListener(t)){var n=e.extent,o=e.pixelRatio,s=e.viewState.rotation,a=this.getTransform(e),h=new jl(r,o,n,a,s),l=new Dl(t,h,e,r,null);i.dispatchEvent(l)}},Zl.prototype.getTransform=function(t){var e=t.viewState,i=this.canvas_.width/2,r=this.canvas_.height/2,n=t.pixelRatio/e.resolution,o=-n,s=-e.rotation,a=-e.center[0],h=-e.center[1];return Xe(this.transform_,i,r,n,o,s,a,h)},Zl.prototype.renderFrame=function(t){if(t){var e=this.context_,i=t.pixelRatio,r=Math.round(t.size[0]*i),n=Math.round(t.size[1]*i);this.canvas_.width!=r||this.canvas_.height!=n?(this.canvas_.width=r,this.canvas_.height=n):e.clearRect(0,0,r,n);var o=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchComposeEvent_(Vn,t);var s=t.layerStatesArray;
1kr(s,Wl),o&&(e.save(),or(e,o,r/2,n/2));var a,h,l,u,c,p=t.viewState.resolution;for(a=0,h=s.length;a<h;++a)l=(c=s[a]).layer,u=this.getLayerRenderer(l),Is(c,p)&&c.sourceState==vs&&u.prepareFrame(t,c)&&u.composeFrame(t,c,e);o&&e.restore(),this.dispatchComposeEvent_(Xn,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},Zl.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){var a,h,l=e.viewState.resolution,u=e.layerStatesArray,c=u.length,p=je(e.pixelToCoordinateTransform,t.slice());for(h=c-1;0<=h;--h){var d=u[h],f=d.layer;if(Is(d,l)&&o.call(s,f))if(a=this.getLayerRenderer(f).forEachLayerAtCoordinate(p,e,i,r,n))return a}},Zl.prototype.registerLayerRenderers=function(t){Xl.prototype.registerLayerRenderers.call(this,t);for(var e=0,i=t.length;e<i;++e){var r=t[e];Pr(Kl,r)||Kl.push(r)}};var Hl=function(t){V.call(this),this.layer_=t};t(Hl,V),Hl.prototype.forEachFeatureAtCoordinate=F,Hl.prototype.hasFeatureAtCoordinate=i,Hl.prototype.createLoadedTileFinder=function(i,r,n){return function(e,t){return i.forEachLoadedTile(r,e,t,function(t){n[e]||(n[e]={}),n[e][t.tileCoord.toString()]=t})}},Hl.prototype.getLayer=function(){return this.layer_},Hl.prototype.handleImageChange_=function(t){t.target.getState()===Ni.LOADED&&this.renderIfReadyAndVisible()},Hl.prototype.loadImage=function(t){var e=t.getState();return e!=Ni.LOADED&&e!=Ni.ERROR&&S(t,E,this.handleImageChange_,this),e==Ni.IDLE&&(t.load(),e=t.getState()),e==Ni.LOADED},Hl.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==vs&&this.changed()},Hl.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var r=wt(t).toString();r in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(i)}},Hl.prototype.updateUsedTiles=function(t,e,i,r){var n=wt(e).toString(),o=i.toString();n in t?o in t[n]?t[n][o].extend(r):t[n][o]=r:(t[n]={},t[n][o]=r)},Hl.prototype.manageTilePyramid=function(t,e,i,r,n,o,s,a,h,l){var u=wt(e).toString();u in t.wantedTiles||(t.wantedTiles[u]={});var c,p,d,f,g,_,v=t.wantedTiles[u],y=t.tileQueue;for(_=i.getMinZoom();_<=s;++_)for(p=i.getTileRangeForExtentAndZ(o,_,p),d=i.getResolution(_),f=p.minX;f<=p.maxX;++f)for(g=p.minY;g<=p.maxY;++g)s-_<=a?((c=e.getTile(_,f,g,r,n)).getState()==eo&&(v[c.getKey()]=!0,y.isKeyQueued(c.getKey())||y.enqueue([c,u,i.getTileCoordCenter(c.tileCoord),d])),void 0!==h&&h.call(l,c)):e.useTile(_,f,g,n)};var ql=function(t){Hl.call(this,t),this.renderedResolution,this.transform_=[1,0,0,1,0,0]};t(ql,Hl),ql.prototype.clip=function(t,e,i){var r=e.pixelRatio,n=e.size[0]*r,o=e.size[1]*r,s=e.viewState.rotation,a=Mt(i),h=bt(i),l=Rt(i),u=Tt(i);je(e.coordinateToPixelTransform,a),je(e.coordinateToPixelTransform,h),je(e.coordinateToPixelTransform,l),je(e.coordinateToPixelTransform,u),t.save(),or(t,-s,n/2,o/2),t.beginPath(),t.moveTo(a[0]*r,a[1]*r),t.lineTo(h[0]*r,h[1]*r),t.lineTo(l[0]*r,l[1]*r),t.lineTo(u[0]*r,u[1]*r),t.clip(),or(t,s,n/2,o/2)},ql.prototype.dispatchComposeEvent_=function(t,e,i,r){var n=this.getLayer();if(n.hasListener(t)){var o=i.size[0]*i.pixelRatio,s=i.size[1]*i.pixelRatio,a=i.viewState.rotation;or(e,-a,o/2,s/2);var h=void 0!==r?r:this.getTransform(i,0),l=new jl(e,i.pixelRatio,i.extent,h,i.viewState.rotation),u=new Dl(t,l,i,e,null);n.dispatchEvent(u),or(e,a,o/2,s/2)}},ql.prototype.forEachLayerAtCoordinate=function(t,e,i,r,n){return this.forEachFeatureAtCoordinate(t,e,i,v,this)?r.call(n,this.getLayer(),null):void 0},ql.prototype.postCompose=function(t,e,i,r){this.dispatchComposeEvent_(Xn,t,e,r)},ql.prototype.preCompose=function(t,e,i){this.dispatchComposeEvent_(Vn,t,e,i)},ql.prototype.dispatchRenderEvent=function(t,e,i){this.dispatchComposeEvent_(Wn,t,e,i)},ql.prototype.getTransform=function(t,e){var i=t.viewState,r=t.pixelRatio,n=r*t.size[0]/2,o=r*t.size[1]/2,s=r/i.resolution,a=-s,h=-i.rotation,l=-i.center[0]+e,u=-i.center[1];return Xe(this.transform_,n,o,s,a,h,l,u)}
1,ql.prototype.composeFrame=function(t,e,i){},ql.prototype.prepareFrame=function(t,e){};var Jl=function(t){ql.call(this,t),this.coordinateToCanvasPixelTransform=[1,0,0,1,0,0],this.hitCanvasContext_=null};t(Jl,ql),Jl.prototype.composeFrame=function(t,e,i){this.preCompose(i,t);var r=this.getImage();if(r){var n=e.extent,o=void 0!==n&&!at(n,t.extent)&&Nt(n,t.extent);o&&this.clip(i,t,n);var s=this.getImageTransform(),a=i.globalAlpha;i.globalAlpha=e.opacity;var h=s[4],l=s[5],u=r.width*s[0],c=r.height*s[3];i.drawImage(r,0,0,+r.width,+r.height,Math.round(h),Math.round(l),Math.round(u),Math.round(c)),i.globalAlpha=a,o&&i.restore()}this.postCompose(i,t,e)},Jl.prototype.getImage=function(){},Jl.prototype.getImageTransform=function(){},Jl.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var o=this.getLayer(),s=o.getSource(),a=e.viewState.resolution,h=e.viewState.rotation,l=e.skippedFeatureUids;return s.forEachFeatureAtCoordinate(t,a,h,i,l,function(t){return r.call(n,t,o)})},Jl.prototype.forEachLayerAtCoordinate=function(t,e,i,r,n){if(this.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==F)return ql.prototype.forEachLayerAtCoordinate.apply(this,arguments);var o=je(this.coordinateToCanvasPixelTransform,t.slice());Nn(o,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=ni(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),o[0],o[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return 0<s[3]?r.call(n,this.getLayer(),s):void 0}};var Ql=function(t){if(Jl.call(this,t),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,t.getType()===ah.VECTOR)for(var e=0,i=Kl.length;e<i;++e){var r=Kl[e];if(r!==Ql&&r.handles(t)){this.vectorRenderer_=new r(t);break}}};t(Ql,Jl),Ql.handles=function(t){return t.getType()===ah.IMAGE||t.getType()===ah.VECTOR&&t.getRenderMode()===hh},Ql.create=function(t,e){return new Ql(e)},Ql.prototype.disposeInternal=function(){this.vectorRenderer_&&this.vectorRenderer_.dispose(),Jl.prototype.disposeInternal.call(this)},Ql.prototype.getImage=function(){return this.image_?this.image_.getImage():null},Ql.prototype.getImageTransform=function(){return this.imageTransform_},Ql.prototype.prepareFrame=function(t,e){var i,r=t.pixelRatio,n=t.size,o=t.viewState,s=o.center,a=o.resolution,h=this.getLayer().getSource(),l=t.viewHints,u=this.vectorRenderer_,c=t.extent;if(u||void 0===e.extent||(c=Pt(c,e.extent)),!l[ts]&&!l[es]&&!At(c)){var p=o.projection,d=this.skippedFeatures_;if(u){var f=u.context,g=C({},t,{size:[Ot(c)/a,Lt(c)/a],viewState:C({},t.viewState,{rotation:0})}),_=Object.keys(g.skippedFeatureUids).sort();i=new Gl(c,a,r,f.canvas,function(t){!u.prepareFrame(g,e)||!u.replayGroupChanged&&Ar(d,_)||(f.canvas.width=g.size[0]*r,f.canvas.height=g.size[1]*r,u.compose(f,g,e),d=_,t())})}else i=h.getImage(c,a,r,p);i&&this.loadImage(i)&&(this.image_=i,this.skippedFeatures_=d)}if(this.image_){var v=(i=this.image_).getExtent(),y=i.getResolution(),m=i.getPixelRatio(),x=r*y/(a*m),S=Xe(this.imageTransform_,r*n[0]/2,r*n[1]/2,x,x,0,m*(v[0]-s[0])/y,m*(s[1]-v[3])/y);Xe(this.coordinateToCanvasPixelTransform,r*n[0]/2-S[4],r*n[1]/2-S[5],r/a,-r/a,0,-s[0],-s[1]),this.renderedResolution=y*r/m}return!!this.image_},Ql.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,e,i,r,n):Jl.prototype.forEachFeatureAtCoordinate.call(this,t,e,i,r,n)};var $l=function(t,e,i,r){this.minX=t,this.maxX=e,this.minY=i,this.maxY=r};function tu(t,e,i,r,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=r,n):new $l(t,e,i,r)}$l.prototype.contains=function(t){return this.containsXY(t[1],t[2])},$l.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},$l.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},$l.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},$l.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)},$l.prototype.getHeight=function(){return this.maxY-this.minY+1},$l.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},$l.prototype.getWidth=function(){return this.maxX-this.minX+1},$l.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var eu=function(t){Jl.call(this,t),this.context=null===this.context?null:ni(),this.oversampling_,this.renderedExtent_=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new $l(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0};t(eu,Jl),eu.handles=function(t){return t.getType()===ah.TILE},eu.create=function(t,e){return new eu(e)},eu.prototype.isDrawableTile_=function(t){var e=t.getState(),i=this.getLayer().getUseInterimTilesOnError();return e==ro||e==oo||e==no&&!i}
1,eu.prototype.getTile=function(t,e,i,r,n){var o=this.getLayer(),s=o.getSource().getTile(t,e,i,r,n);return s.getState()==no&&(o.getUseInterimTilesOnError()?0<o.getPreload()&&(this.newTiles_=!0):s.setState(ro)),this.isDrawableTile_(s)||(s=s.getInterimTile()),s},eu.prototype.prepareFrame=function(t,e){var i=t.pixelRatio,r=t.size,n=t.viewState,o=n.projection,s=n.resolution,a=n.center,h=this.getLayer(),l=h.getSource(),u=l.getRevision(),c=l.getTileGridForProjection(o),p=c.getZForResolution(s,this.zDirection),d=c.getResolution(p),f=Math.round(s/d)||1,g=t.extent;if(void 0!==e.extent&&(g=Pt(g,e.extent)),At(g))return!1;var _=c.getTileRangeForExtentAndZ(g,p),v=c.getTileRangeExtent(p,_),y=l.getTilePixelRatio(i),m={};m[p]={};var x,S,C,w=this.createLoadedTileFinder(l,o,m),E=t.viewHints,T=E[ts]||E[es],R=this.tmpExtent,I=this.tmpTileRange_;for(this.newTiles_=!1,S=_.minX;S<=_.maxX;++S)for(C=_.minY;C<=_.maxY;++C)if(!(16<Date.now()-t.time&&T)){if(x=this.getTile(p,S,C,i,o),this.isDrawableTile_(x)){var F=wt(this);if(x.getState()==ro){var L=(m[p][x.tileCoord.toString()]=x).inTransition(F);this.newTiles_||!L&&-1!==this.renderedTiles.indexOf(x)||(this.newTiles_=!0)}if(1===x.getAlpha(F,t.time))continue}var P=c.getTileCoordChildTileRange(x.tileCoord,I,R),M=!1;P&&(M=w(p+1,P)),M||c.forEachTileCoordParentTileRange(x.tileCoord,w,null,I,R)}var b=d*i/y*f;if(!(this.renderedResolution&&16<Date.now()-t.time&&T)&&(this.newTiles_||!this.renderedExtent_||!at(this.renderedExtent_,g)||this.renderedRevision!=u||f!=this.oversampling_||!T&&b!=this.renderedResolution)){var O=this.context;
1if(O){var N=l.getTilePixelSize(p,i,o),A=Math.round(_.getWidth()*N[0]/f),k=Math.round(_.getHeight()*N[1]/f),G=O.canvas;G.width!=A||G.height!=k?(this.oversampling_=f,G.width=A,G.height=k):(this.renderedExtent_&&!_t(v,this.renderedExtent_)&&O.clearRect(0,0,A,k),f=this.oversampling_)}this.renderedTiles.length=0;var D,U,j,z,B,Y,X,V,W,K,Z=Object.keys(m).map(Number);for(Z.sort(function(t,e){return t===p?1:e===p?-1:e<t?1:t<e?-1:0}),z=0,B=Z.length;z<B;++z)for(var H in j=Z[z],U=l.getTilePixelSize(j,i,o),D=c.getResolution(j)/d,X=y*l.getGutter(o),V=m[j])x=V[H],S=((Y=c.getTileCoordExtent(x.getTileCoord(),R))[0]-v[0])/d*y/f,C=(v[3]-Y[3])/d*y/f,W=U[0]*D/f,K=U[1]*D/f,this.drawTileImage(x,t,e,S,C,W,K,X,p===j),this.renderedTiles.push(x);this.renderedRevision=u,this.renderedResolution=d*i/y*f,this.renderedExtent_=v}var q=this.renderedResolution/s,J=Xe(this.imageTransform_,i*r[0]/2,i*r[1]/2,q,q,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*i,(a[1]-this.renderedExtent_[3])/this.renderedResolution*i);return Xe(this.coordinateToCanvasPixelTransform,i*r[0]/2-J[4],i*r[1]/2-J[5],i/s,-i/s,0,-a[0],-a[1]),this.updateUsedTiles(t.usedTiles,l,p,_),this.manageTilePyramid(t,l,c,i,o,g,p,h.getPreload()),this.scheduleExpireCache(t,l),0<this.renderedTiles.length},eu.prototype.drawTileImage=function(t,e,i,r,n,o,s,a,h){var l=t.getImage(this.getLayer());if(l){var u=wt(this),c=h?t.getAlpha(u,e.time):1;1!==c||this.getLayer().getSource().getOpaque(e.viewState.projection)||this.context.clearRect(r,n,o,s);var p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,r,n,o,s),p&&this.context.restore(),1!==c?e.animate=!0:h&&t.endTransition(u)}},eu.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},eu.prototype.getImageTransform=function(){return this.imageTransform_};var iu=function(){};iu.prototype.getReplay=function(t,e){},iu.prototype.isEmpty=function(){};var ru={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function nu(t,e,i,r,n,o,s,a){for(var h,l,u,c=[],p=t[e]>t[i-r],d=n.length,f=t[e],g=t[e+1],_=t[e+=r],v=t[e+1],y=0,m=Math.sqrt(Math.pow(_-f,2)+Math.pow(v-g,2)),x="",S=0,C=0;C<d;++C){l=p?d-C-1:C;var w=n.charAt(l),E=o(x=p?w+x:x+w)-S;S+=E;for(var T=s+E/2;e<i-r&&y+m<T;)f=_,g=v,_=t[e+=r],v=t[e+1],y+=m,m=Math.sqrt(Math.pow(_-f,2)+Math.pow(v-g,2));var R=T-y,I=Math.atan2(v-g,_-f);if(p&&(I+=0<I?-Math.PI:Math.PI),void 0!==u){var F=I-u;if(F+=F>Math.PI?-2*Math.PI:F<-Math.PI?2*Math.PI:0,Math.abs(F)>a)return null}var L=R/m,P=Kt(f,_,L),M=Kt(g,v,L);u==I?(p&&(h[0]=P,h[1]=M,h[2]=E/2),h[4]=x):(h=[P,M,(S=E)/2,I,x=w],p?c.unshift(h):c.push(h),u=I),s+=E}return c}var ou=0,su=1,au=2,hu=3,lu=4,uu=5,cu=6,pu=7,du=8,fu=9,gu=10,_u=11,vu=12,yu=[du],mu=[vu],xu=[su],Su=[hu],Cu=[ru.POLYGON,ru.CIRCLE,ru.LINE_STRING,ru.IMAGE,ru.TEXT,ru.DEFAULT],wu={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Eu=function(t,e,i,r,n,o){Ul.call(this),this.declutterTree=o,this.tolerance=t,this.maxExtent=e,this.overlaps=n,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0};t(Eu,Ul);var Tu=[1/0,1/0,-1/0,-1/0],Ru=[1,0,0,1,0,0];Eu.prototype.replayTextBackground_=function(t,e,i,r,n,o,s){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)),s&&(this.setStrokeStyle_(t,s),t.stroke())},Eu.prototype.replayImage_=function(t,e,i,r,n,o,s,a,h,l,u,c,p,d,f,g,_,v){var y=_||v;e-=n*=p,i-=o*=p;var m,x,S,C,w=f+l>r.width?r.width-l:f,E=a+u>r.height?r.height-u:a,T=g[3]+w*p+g[1],R=g[0]+E*p+g[2],I=e-g[3],F=i-g[0];(y||0!==c)&&(m=[I,F],x=[I+T,F],S=[I+T,F+R],C=[I,F+R]);var L=null;if(0!==c){var P=e+n,M=i+o;L=Xe(Ru,P,M,1,1,c,-P,-M),pt(Tu),yt(Tu,je(Ru,m)),yt(Tu,je(Ru,x)),yt(Tu,je(Ru,S)),yt(Tu,je(Ru,C))}else ct(I,F,I+T,F+R,Tu);var b=t.canvas,O=v?v[2]*p/2:0,N=Tu[0]-O<=b.width&&0<=Tu[2]+O&&Tu[1]-O<=b.height&&0<=Tu[3]+O;if(d&&(e=Math.round(e),i=Math.round(i)),s){if(!N&&1==s[4])return;vt(s,Tu);var A=N?[t,L?L.slice(0):null,h,r,l,u,w,E,e,i,p]:null;A&&y&&A.push(_,v,m,x,S,C),s.push(A)}
1else N&&(y&&this.replayTextBackground_(t,m,x,S,C,_,v),ar(t,L,h,r,l,u,w,E,e,i,p))},Eu.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},Eu.prototype.appendFlatCoordinates=function(t,e,i,r,n,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=r);var h,l,u,c=[t[e],t[e+1]],p=[NaN,NaN],d=!0;for(h=e+r;h<i;h+=r)p[0]=t[h],p[1]=t[h+1],(u=lt(a,p))!==l?(d&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):u===et.INTERSECTING?(this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):d=!0,c[0]=p[0],c[1]=p[1],l=u;return(n&&d||h===e+r)&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),s},Eu.prototype.drawCustomCoordinates_=function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o],h=this.appendFlatCoordinates(t,e,a,r,!1,!1);n.push(h),e=a}return e},Eu.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var r,n,o,s,a,h=t.getType(),l=t.getStride(),u=this.coordinates.length;if(h==Zt.MULTI_POLYGON){r=(t=t).getOrientedFlatCoordinates(),s=[];for(var c=t.getEndss(),p=a=0,d=c.length;p<d;++p){var f=[];a=this.drawCustomCoordinates_(r,a,c[p],l,f),s.push(f)}this.instructions.push([lu,u,s,t,i,$r])}else h==Zt.POLYGON||h==Zt.MULTI_LINE_STRING?(o=[],r=h==Zt.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(r,0,t.getEnds(),l,o),this.instructions.push([lu,u,o,t,i,Qr])):h==Zt.LINE_STRING||h==Zt.MULTI_POINT?(r=t.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,l,!1,!1),this.instructions.push([lu,u,n,t,i,Jr])):h==Zt.POINT&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([lu,u,n,t,i]));this.endGeometry(t,e)},Eu.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ou,e,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ou,e,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},Eu.prototype.fill_=function(t){if(this.alignFill_){var e=je(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.setTransform.apply(t,sr)},Eu.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],Li&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},Eu.prototype.renderDeclutter_=function(t,e){if(t&&5<t.length){var i=t[4];if(1==i||i==t.length-5){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var n=5,o=t.length;n<o;++n){var s=t[n];s&&(11<s.length&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),ar.apply(void 0,s))}}t.length=5,pt(t)}}},Eu.prototype.replay_=function(t,e,i,r,n,o){var s,a=this;this.pixelCoordinates_&&Ar(e,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=Dt(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Ue(this.renderedTransform_,e));for(var h,l,u,c,p,d,f,g,_,v,y,m,x=!Et(i),S=0,C=r.length,w=0,E=0,T=0,R=null,I=null,F=this.coordinateCache_,L=this.viewRotation_,P={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:L},M=this.instructions!=r||this.overlaps?0:200;S<C;){var b=r[S];switch(b[0]){case ou:v=b[1],x&&i[wt(v).toString()]||!v.getGeometry()?S=b[2]:void 0===o||Nt(o,v.getGeometry().getExtent())?++S:S=b[2]+1;break;case su:M<E&&(a.fill_(t),E=0),M<T&&(t.stroke(),T=0),E||T||(t.beginPath(),c=p=NaN),++S;break;case au:var O=s[w=b[1]],N=s[w+1],A=s[w+2]-O,k=s[w+3]-N,G=Math.sqrt(A*A+k*k);t.moveTo(O+G,N),t.arc(O,N,G,0,2*Math.PI,!0),++S;break;case hu:t.closePath(),++S;break;case lu:w=b[1],h=b[2];var D=b[3],U=b[4],j=6==b.length?b[5]:void 0;P.geometry=D,P.feature=v,S in F||(F[S]=[]);var z=F[S];j?j(s,w,h,2,z):(z[0]=s[w],z[1]=s[w+1],z.length=2),U(z,P),++S;break;case cu:w=b[1],h=b[2],_=b[3],l=b[4],u=b[5],g=n?null:b[6];var B=b[7],Y=b[8],X=b[9],V=b[10],W=b[11],K=b[12],Z=b[13],H=b[14],q=b[15],J=void 0,Q=void 0,$=void 0;for(16<b.length?(J=b[16],Q=b[17],$=b[18]):(J=Zi,Q=$=!1),W&&(K+=L);w<h;w+=2)a.replayImage_(t,s[w],s[w+1],_,l,u,g,B,Y,X,V,K,Z,H,q,J,Q?R:null,$?I:null);a.renderDeclutter_(g,v),++S;break;case uu:var tt=b[1],et=b[2],it=b[3];g=n?null:b[4];var rt=b[5],nt=b[6],ot=b[7],st=b[8],at=b[9],ht=b[10],lt=b[11],ut=b[12],ct=b[13],pt=b[14],dt=zn(s,tt,et,2),ft=st(ut);if(rt||ft<=dt){var gt=a.textStates[ct].textAlign,_t=nu(s,tt,et,2,ut,st,(dt-ft)*wu[gt],ot);if(_t){var vt=void 0,yt=void 0,mt=void 0,xt=void 0,St=void 0;if(ht)for(vt=0,yt=_t.length;vt<yt;++vt)mt=(St=_t[vt])[4],xt=a.getImage(mt,ct,"",ht),l=St[2]+lt,u=it*xt.height+2*(.5-it)*lt-at,a.replayImage_(t,St[0],St[1],xt,l,u,g,xt.height,1,0,0,St[3],pt,!1,xt.width,Zi,null,null);if(nt)for(vt=0,yt=_t.length;vt<yt;++vt)mt=(St=_t[vt])[4],xt=a.getImage(mt,ct,nt,""),l=St[2],u=it*xt.height-at,a.replayImage_(t,St[0],St[1],xt,l,u,g,xt.height,1,0,0,St[3],pt,!1,xt.width,Zi,null,null)}}a.renderDeclutter_(g,v),++S;break;case pu:if(void 0!==n){var Ct=n(v=b[1]);if(Ct)return Ct}++S;break;case du:M?E++:a.fill_(t),++S;break;
1case fu:for(w=b[1],h=b[2],y=s[w],f=(m=s[w+1])+.5|0,(d=y+.5|0)===c&&f===p||(t.moveTo(y,m),c=d,p=f),w+=2;w<h;w+=2)d=(y=s[w])+.5|0,f=(m=s[w+1])+.5|0,w!=h-2&&d===c&&f===p||(t.lineTo(y,m),c=d,p=f);++S;break;case gu:R=b,a.alignFill_=b[2],E&&(a.fill_(t),E=0,T&&(t.stroke(),T=0)),t.fillStyle=b[1],++S;break;case _u:I=b,T&&(t.stroke(),T=0),a.setStrokeStyle_(t,b),++S;break;case vu:M?T++:t.stroke(),++S;break;default:++S}}E&&this.fill_(t),T&&t.stroke()},Eu.prototype.replay=function(t,e,i,r){this.viewRotation_=i,this.replay_(t,e,r,this.instructions,void 0,void 0)},Eu.prototype.replayHitDetection=function(t,e,i,r,n,o){return this.viewRotation_=i,this.replay_(t,e,r,this.hitDetectionInstructions,n,o)},Eu.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])==pu?o=t:r==ou&&(i[2]=t,br(this.hitDetectionInstructions,o,t),o=-1)},Eu.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var r=t.getColor();i.fillStyle=ri(r||Bi)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=ri(n||Wi);var o=e.getLineCap();i.lineCap=void 0!==o?o:Yi;var s=e.getLineDash();i.lineDash=s?s.slice():Xi;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var h=e.getLineJoin();i.lineJoin=void 0!==h?h:Vi;var l=e.getWidth();i.lineWidth=void 0!==l?l:1;var u=e.getMiterLimit();i.miterLimit=void 0!==u?u: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},Eu.prototype.createFill=function(t,e){var i=t.fillStyle,r=[gu,i];return"string"!=typeof i&&r.push(!0),r},Eu.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},Eu.prototype.createStroke=function(t){return[_u,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},Eu.prototype.updateFillStyle=function(t,e,i){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t,i)),t.currentFillStyle=r)},Eu.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,r=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||n!=t.currentLineDash&&!Ar(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=h)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=h)},Eu.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[pu,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},Eu.prototype.finish=F,Eu.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=nt(this.maxExtent),0<this.maxLineWidth)){var t=this.resolution*(this.maxLineWidth+1)/2;rt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_};var Iu=function(t,e,i,r,n,o){Eu.call(this,t,e,i,r,n,o),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.snapToPixel_=void 0,this.width_=void 0};t(Iu,Eu),Iu.prototype.drawCoordinates_=function(t,e,i,r){return this.appendFlatCoordinates(t,e,i,r,!1,!1)},Iu.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.drawCoordinates_(i,0,i.length,r);this.instructions.push([cu,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([cu,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,e)}},Iu.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.drawCoordinates_(i,0,i.length,r);this.instructions.push([cu,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([cu,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,e)}},Iu.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,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.snapToPixel_=void 0,this.width_=void 0},Iu.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),r=t.getSize(),n=t.getHitDetectionImage(1),o=t.getImage(1),s=t.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=e,this.hitDetectionImage_=n,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.snapToPixel_=t.getSnapToPixel(),this.width_=r[0]};
1var Fu=function(t,e,i,r,n,o){Eu.call(this,t,e,i,r,n,o)};t(Fu,Eu),Fu.prototype.drawFlatCoordinates_=function(t,e,i,r){var n=this.coordinates.length,o=this.appendFlatCoordinates(t,e,i,r,!1,!1),s=[fu,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},Fu.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([_u,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],xu);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(mu),this.endGeometry(t,e)}},Fu.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([_u,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],xu);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),h=0,l=0,u=o.length;l<u;++l)h=this.drawFlatCoordinates_(s,h,o[l],a);this.hitDetectionInstructions.push(mu),this.endGeometry(t,e)}},Fu.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(mu),this.reverseHitDetectionInstructions(),this.state=null},Fu.prototype.applyStroke=function(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(mu),t.lastStroke=this.coordinates.length),t.lastStroke=0,Eu.prototype.applyStroke.call(this,t),this.instructions.push(xu)};var Lu=function(t,e,i,r,n,o){Eu.call(this,t,e,i,r,n,o)};function Pu(t,e,i,r,n){var o,s,a,h,l,u,c,p,d,f=i,g=i,_=0,v=0,y=i;for(o=i;o<r;o+=n){var m=e[o],x=e[o+1];void 0!==h&&(p=m-h,d=x-l,a=Math.sqrt(p*p+d*d),void 0!==u&&(v+=s,t<Math.acos((u*p+c*d)/(s*a))&&(_<v&&(_=v,f=y,g=o),v=0,y=o-n)),s=a,u=p,c=d),h=m,l=x}return _<(v+=a)?[y,o]:[f,g]}t(Lu,Eu),Lu.prototype.drawFlatCoordinatess_=function(t,e,i,r){var n=this.state,o=void 0!==n.fillStyle,s=null!=n.strokeStyle,a=i.length;this.instructions.push(xu),this.hitDetectionInstructions.push(xu);for(var h=0;h<a;++h){var l=i[h],u=this.coordinates.length,c=this.appendFlatCoordinates(t,e,l,r,!0,!s),p=[fu,u,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(Su),this.hitDetectionInstructions.push(Su)),e=l}return o&&(this.instructions.push(yu),this.hitDetectionInstructions.push(yu)),s&&(this.instructions.push(mu),this.hitDetectionInstructions.push(mu)),e},Lu.prototype.drawCircle=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([gu,qe(Bi)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_u,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,s,!1,!1);var h=[au,a];this.instructions.push(xu,h),this.hitDetectionInstructions.push(xu,h),this.hitDetectionInstructions.push(yu),void 0!==i.fillStyle&&this.instructions.push(yu),void 0!==i.strokeStyle&&(this.instructions.push(mu),this.hitDetectionInstructions.push(mu)),this.endGeometry(t,e)}},Lu.prototype.drawPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([gu,qe(Bi)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_u,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(t,e)}},Lu.prototype.drawMultiPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([gu,qe(Bi)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_u,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),h=0,l=0,u=o.length;l<u;++l)h=this.drawFlatCoordinatess_(s,h,o[l],a);this.endGeometry(t,e)}},Lu.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t)for(var e=this.coordinates,i=0,r=e.length;i<r;++i)e[i]=en(e[i],t)},Lu.prototype.setFillStrokeStyles_=function(t){var e=this.state;void 0!==e.fillStyle&&this.updateFillStyle(e,this.createFill,t),void 0!==e.strokeStyle&&this.updateStrokeStyle(e,this.applyStroke)};
1var Mu=function(t,e,i,r,n,o){Eu.call(this,t,e,i,r,n,o),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Hi.prune()};t(Mu,Eu),Mu.prototype.drawText=function(t,e){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var o,s,a=this.coordinates.length,h=t.getType(),l=null,u=2,c=2;if(n.placement===Zn){if(!Nt(this.getBufferedMaxExtent(),t.getExtent()))return;var p;if(l=t.getFlatCoordinates(),c=t.getStride(),h==Zt.LINE_STRING)p=[l.length];else if(h==Zt.MULTI_LINE_STRING)p=t.getEnds();else if(h==Zt.POLYGON)p=t.getEnds().slice(0,1);else if(h==Zt.MULTI_POLYGON){var d=t.getEndss();for(p=[],o=0,s=d.length;o<s;++o)p.push(d[o][0])}this.beginGeometry(t,e);for(var f,g=n.textAlign,_=0,v=0,y=p.length;v<y;++v){if(null==g){var m=Pu(n.maxAngle,l,_,p[v],c);_=m[0],f=m[1]}else f=p[v];for(o=_;o<f;o+=c)this.coordinates.push(l[o],l[o+1]);u=this.coordinates.length,_=p[v],this.drawChars_(a,u,this.declutterGroup_),a=u}this.endGeometry(t,e)}else{var x=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),S=x.width/this.pixelRatio;switch(h){case Zt.POINT:case Zt.MULTI_POINT:u=(l=t.getFlatCoordinates()).length;break;case Zt.LINE_STRING:l=t.getFlatMidpoint();break;case Zt.CIRCLE:l=t.getCenter();break;case Zt.MULTI_LINE_STRING:u=(l=t.getFlatMidpoints()).length;break;case Zt.POLYGON:if(l=t.getFlatInteriorPoint(),!n.overflow&&l[2]/this.resolution<S)return;c=3;break;case Zt.MULTI_POLYGON:var C=t.getFlatInteriorPoints();for(l=[],o=0,s=C.length;o<s;o+=3)(n.overflow||C[o+2]/this.resolution>=S)&&l.push(C[o],C[o+1]);if(0==(u=l.length))return}u=this.appendFlatCoordinates(l,0,u,c,!1,!1),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(x,a,u),this.endGeometry(t,e)}}},Mu.prototype.getImage=function(t,e,i,r){var n,o=r+e+t+i+this.pixelRatio;if(!Hi.containsKey(o)){var s=r?this.strokeStates[r]||this.textStrokeState_:null,a=i?this.fillStates[i]||this.textFillState_:null,h=this.textStates[e]||this.textState_,l=this.pixelRatio,u=h.scale*l,c=wu[h.textAlign||Ki],p=r&&s.lineWidth?s.lineWidth:0,d=t.split("\n"),f=d.length,g=[],_=function(t,e,i){for(var r=e.length,n=0,o=0;o<r;++o){var s=nr(t,e[o]);n=Math.max(n,s),i.push(s)}return n}(h.font,d,g),v=rr(h.font),y=v*f,m=_+p,x=ni(Math.ceil(m*u),Math.ceil((y+p)*u));n=x.canvas,Hi.set(o,n),1!=u&&x.scale(u,u),x.font=h.font,r&&(x.strokeStyle=s.strokeStyle,x.lineWidth=p,x.lineCap=s.lineCap,x.lineJoin=s.lineJoin,x.miterLimit=s.miterLimit,Li&&s.lineDash.length&&(x.setLineDash(s.lineDash),x.lineDashOffset=s.lineDashOffset)),i&&(x.fillStyle=a.fillStyle),x.textBaseline="middle",x.textAlign="center";var S,C=.5-c,w=c*n.width/u+C*p;if(r)for(S=0;S<f;++S)x.strokeText(d[S],w+C*g[S],.5*(p+v)+S*v);if(i)for(S=0;S<f;++S)x.fillText(d[S],w+C*g[S],.5*(p+v)+S*v)}return Hi.get(o)},Mu.prototype.drawTextImage_=function(t,e,i){var r=this.textState_,n=this.textStrokeState_,o=this.pixelRatio,s=wu[r.textAlign||Ki],a=wu[r.textBaseline],h=n&&n.lineWidth?n.lineWidth:0,l=s*t.width/o+2*(.5-s)*h,u=a*t.height/o+2*(.5-a)*h;this.instructions.push([cu,e,i,t,(l-this.textOffsetX_)*o,(u-this.textOffsetY_)*o,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,!0,t.width,r.padding==Zi?Zi:r.padding.map(function(t){return t*o}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([cu,e,i,t,(l-this.textOffsetX_)*o,(u-this.textOffsetY_)*o,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/o,!0,t.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])}
1,Mu.prototype.drawChars_=function(t,e,i){var r=this.textStrokeState_,n=this.textState_,o=this.textFillState_,s=this.strokeKey_;r&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var a=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||Ki,scale:n.scale});var h=this.fillKey_;o&&(h in this.fillStates||(this.fillStates[h]={fillStyle:o.fillStyle}));var l=this.pixelRatio,u=wu[n.textBaseline],c=this.textOffsetY_*l,p=this.text_,d=n.font,f=n.scale,g=r?r.lineWidth*f/2:0,_=this.widths_[d];_||(this.widths_[d]=_={}),this.instructions.push([uu,t,e,u,i,n.overflow,h,n.maxAngle,function(t){var e=_[t];return e||(e=_[t]=nr(d,t)),e*f*l},c,s,g*l,p,a,1]),this.hitDetectionInstructions.push([uu,t,e,u,i,n.overflow,h,n.maxAngle,function(t){var e=_[t];return e||(e=_[t]=nr(d,t)),e*f},c,s,g,p,a,1/l])},Mu.prototype.setTextStyle=function(t,e){var i,r,n;if(t){this.declutterGroup_=e;var o=t.getFill();o?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=ri(o.getColor()||Bi)):r=this.textFillState_=null;var s=t.getStroke();if(s){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var a=s.getLineDash(),h=s.getLineDashOffset(),l=s.getWidth(),u=s.getMiterLimit();n.lineCap=s.getLineCap()||Yi,n.lineDash=a?a.slice():Xi,n.lineDashOffset=void 0===h?0:h,n.lineJoin=s.getLineJoin()||Vi,n.lineWidth=void 0===l?1:l,n.miterLimit=void 0===u?10:u,n.strokeStyle=ri(s.getColor()||Wi)}else n=this.textStrokeState_=null;i=this.textState_;var c=t.getFont()||zi;$i(c);var p=t.getScale();i.overflow=t.getOverflow(),i.font=c,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()||Zi,i.scale=void 0===p?1:p;var d=t.getOffsetX(),f=t.getOffsetY(),g=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===_?0:_,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:wt(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+wt(r.fillStyle):""}else this.text_=""};var bu={Circle:Lu,Default:Eu,Image:Iu,LineString:Fu,Polygon:Lu,Text:Mu},Ou=function(t,e,i,r,n,o,s){iu.call(this),this.declutterTree_=o,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=e,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=i,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=ni(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]};t(Ou,iu);var Nu={0:[[!0]]};function Au(t,e,i){var r,n=Math.floor(t.length/2);if(n<=e)for(r=n;r<e;r++)t[r][i]=!0;else if(e<n)for(r=e+1;r<n;r++)t[r][i]=!0}Ou.prototype.addDeclutter=function(t){var e=null;return this.declutterTree_&&(t?(e=this.declutterGroup_)[4]++:(e=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),e},Ou.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()},Ou.prototype.hasReplays=function(t){for(var e in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[e],r=0,n=t.length;r<n;++r)if(t[r]in i)return!0;return!1},Ou.prototype.finish=function(){for(var t in this.replaysByZIndex_){var e=this.replaysByZIndex_[t];for(var i in e)e[i].finish()}},Ou.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s){var a,h=2*(r=Math.round(r))+1,l=Xe(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-i,-t[0],-t[1]),u=this.hitDetectionContext_;u.canvas.width!==h||u.canvas.height!==h?(u.canvas.width=h,u.canvas.height=h):u.clearRect(0,0,h,h),void 0!==this.renderBuffer_&&(yt(a=[1/0,1/0,-1/0,-1/0],t),rt(a,e*(this.renderBuffer_+r),a));var c,p,d=function(t){if(void 0!==Nu[t])return Nu[t];for(var e=2*t+1,i=new Array(e),r=0;r<e;r++)i[r]=new Array(e);for(var n=t,o=0,s=0;o<=n;)Au(i,t+n,t+o),Au(i,t+o,t+n),Au(i,t-o,t+n),Au(i,t-n,t+o),Au(i,t-n,t-o),Au(i,t-o,t-n),Au(i,t+o,t-n),Au(i,t+n,t-o),0<2*((s+=1+2*++o)-n)+1&&(s+=1-2*(n-=1));return Nu[t]=i}(r);function f(t){for(var e=u.getImageData(0,0,h,h).data,i=0;i<h;i++)for(var r=0;r<h;r++)if(d[i][r]&&0<e[4*(r*h+i)+3]){var n=void 0;return(!c||p!=ru.IMAGE&&p!=ru.TEXT||-1!==c.indexOf(t))&&(n=o(t)),n||void u.clearRect(0,0,h,h)}}this.declutterTree_&&(c=this.declutterTree_.all().map(function(t){return t.value}));var g,_,v,y,m,x=Object.keys(this.replaysByZIndex_).map(Number);for(x.sort(Lr),g=x.length-1;0<=g;--g){var S=x[g].toString();for(v=this.replaysByZIndex_[S],_=Cu.length-1;0<=_;--_)if(void 0!==(y=v[p=Cu[_]]))if(!s||p!=ru.IMAGE&&p!=ru.TEXT){if(m=y.replayHitDetection(u,l,i,n,f,a))return m}else{var C=s[S];C?C.push(y,l.slice(0)):s[S]=[y,l.slice(0)]}}},Ou.prototype.getClipCoords=function(t){var e=this.maxExtent_,i=e[0],r=e[1],n=e[2],o=e[3],s=[i,r,i,o,n,o,n,r];return Dt(s,0,8,2,t,s),s},Ou.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",r=this.replaysByZIndex_[
1i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[e];void 0===n&&(n=new bu[e](this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[e]=n);return n},Ou.prototype.getReplays=function(){return this.replaysByZIndex_},Ou.prototype.isEmpty=function(){return Et(this.replaysByZIndex_)},Ou.prototype.replay=function(t,e,i,r,n,o){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(Lr),t.save(),this.clip(t,e);var a,h,l,u,c,p,d=n||Cu;for(a=0,h=s.length;a<h;++a){var f=s[a].toString();for(c=this.replaysByZIndex_[f],l=0,u=d.length;l<u;++l){var g=d[l];if(void 0!==(p=c[g]))if(!o||g!=ru.IMAGE&&g!=ru.TEXT)p.replay(t,e,i,r);else{var _=o[f];_?_.push(p,e.slice(0)):o[f]=[p,e.slice(0)]}}}t.restore()};var ku=.5,Gu={Point:function(t,e,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Ni.LOADED)return;var o=t.getReplay(i.getZIndex(),ru.IMAGE);o.setImageStyle(n,t.addDeclutter(!1)),o.drawPoint(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),ru.TEXT);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,r)}},LineString:function(t,e,i,r){var n=i.getStroke();if(n){var o=t.getReplay(i.getZIndex(),ru.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawLineString(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),ru.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,r)}},Polygon:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var s=t.getReplay(i.getZIndex(),ru.POLYGON);s.setFillStrokeStyle(n,o),s.drawPolygon(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),ru.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}},MultiPoint:function(t,e,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Ni.LOADED)return;var o=t.getReplay(i.getZIndex(),ru.IMAGE);o.setImageStyle(n,t.addDeclutter(!1)),o.drawMultiPoint(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),ru.TEXT);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,r)}},MultiLineString:function(t,e,i,r){var n=i.getStroke();if(n){var o=t.getReplay(i.getZIndex(),ru.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawMultiLineString(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),ru.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,r)}},MultiPolygon:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(o||n){var s=t.getReplay(i.getZIndex(),ru.POLYGON);s.setFillStrokeStyle(n,o),s.drawMultiPolygon(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),ru.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}},GeometryCollection:function(t,e,i,r){var n,o,s=e.getGeometriesArray();for(n=0,o=s.length;n<o;++n){var a=Gu[s[n].getType()];a(t,s[n],i,r)}},Circle:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var s=t.getReplay(i.getZIndex(),ru.CIRCLE);s.setFillStrokeStyle(n,o),s.drawCircle(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),ru.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}}};function Du(t,e){return wt(t)-wt(e)}function Uu(t,e){var i=ju(t,e);return i*i}function ju(t,e){return ku*t/e}function zu(t,e,i,r,n,o){var s=!1,a=i.getImage();if(a){var h=a.getImageState();h==Ni.LOADED||h==Ni.ERROR?a.unlistenImageChange(n,o):(h==Ni.IDLE&&a.load(),h=a.getImageState(),a.listenImageChange(n,o),s=!0)}return function(t,e,i,r){var n=i.getGeometryFunction()(e);if(!n)return;var o=n.getSimplifiedGeometry(r);if(i.getRenderer())!function t(e,i,r,n){if(i.getType()==Zt.GEOMETRY_COLLECTION){for(var o=i.getGeometries(),s=0,a=o.length;s<a;++s)t(e,o[s],r,n);return}var h=e.getReplay(r.getZIndex(),ru.DEFAULT);h.drawCustom(i,n,r.getRenderer())}(t,o,i,e);else{var s=Gu[o.getType()];s(t,o,i,e)}}(t,e,i,r),s}var Bu=function(t){ql.call(this,t),this.declutterTree_=t.getDeclutter()?wh(9,void 0):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=ni(),S(Hi,T,this.handleFontsChanged_,this)};t(Bu,ql),Bu.handles=function(t){return t.getType()===ah.VECTOR},Bu.create=function(t,e){return new Bu(e)},Bu.prototype.disposeInternal=function(){d(Hi,T,this.handleFontsChanged_,this),ql.prototype.disposeInternal.call(this)}
1,Bu.prototype.compose=function(t,e,i){var r=e.extent,n=e.pixelRatio,o=i.managed?e.skippedFeatureUids:{},s=e.viewState,a=s.projection,h=s.rotation,l=a.getExtent(),u=this.getLayer().getSource(),c=this.getTransform(e,0),p=i.extent,d=void 0!==p;d&&this.clip(t,e,p);var f=this.replayGroup_;if(f&&!f.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var g,_=this.getLayer(),v=0,y=0,m=1!==i.opacity,x=_.hasListener(Wn);if(m||x){var S=t.canvas.width,C=t.canvas.height;if(h){var w=Math.round(Math.sqrt(S*S+C*C));v=(w-S)/2,y=(w-C)/2,S=C=w}this.context.canvas.width=S,this.context.canvas.height=C,g=this.context}else g=t;var E=g.globalAlpha;m||(g.globalAlpha=i.opacity),g!=t&&g.translate(v,y);var T=e.size[0]*n,R=e.size[1]*n;if(or(g,-h,T/2,R/2),f.replay(g,c,h,o),u.getWrapX()&&a.canWrapX()&&!at(l,r)){for(var I,F=r[0],L=Ot(l),P=0;F<l[0];)I=L*--P,c=this.getTransform(e,I),f.replay(g,c,h,o),F+=L;for(P=0,F=r[2];F>l[2];)I=L*++P,c=this.getTransform(e,I),f.replay(g,c,h,o),F-=L}if(or(g,h,T/2,R/2),g!=t){if(x&&this.dispatchRenderEvent(g,e,c),m){var M=t.globalAlpha;t.globalAlpha=i.opacity,t.drawImage(g.canvas,-v,-y),t.globalAlpha=M}else t.drawImage(g.canvas,-v,-y);g.translate(-v,-y)}m||(g.globalAlpha=E)}d&&t.restore()},Bu.prototype.composeFrame=function(t,e,i){var r=this.getTransform(t,0);this.preCompose(i,t,r),this.compose(i,t,e),this.postCompose(i,t,e,r)},Bu.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){if(this.replayGroup_){var o=e.viewState.resolution,s=e.viewState.rotation,a=this.getLayer(),h={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s,i,{},function(t){var e=wt(t).toString();if(!(e in h))return h[e]=!0,r.call(n,t,a)},null)}},Bu.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},Bu.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},Bu.prototype.prepareFrame=function(t,e){var n=this.getLayer(),i=n.getSource(),r=t.viewHints[ts],o=t.viewHints[es],s=n.getUpdateWhileAnimating(),a=n.getUpdateWhileInteracting();if(!this.dirty_&&!s&&r||!a&&o)return!0;var h=t.extent,l=t.viewState,u=l.projection,c=l.resolution,p=t.pixelRatio,d=n.getRevision(),f=n.getRenderBuffer(),g=n.getRenderOrder();void 0===g&&(g=Du);var _=rt(h,f*c),v=l.projection.getExtent();if(i.getWrapX()&&l.projection.canWrapX()&&!at(v,t.extent)){var y=Ot(v),m=Math.max(Ot(_)/2,y);_[0]=v[0]-m,_[2]=v[2]+m}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&at(this.renderedExtent_,_))return!(this.replayGroupChanged=!1);this.replayGroup_=null,this.dirty_=!1;var x=new Ou(ju(c,p),_,c,p,i.getOverlaps(),this.declutterTree_,n.getRenderBuffer());i.loadFeatures(_,c,u);var S=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,c)),e){var r=this.renderFeature(t,c,p,e,x);this.dirty_=this.dirty_||r}}.bind(this);if(g){var C=[];i.forEachFeatureInExtent(_,function(t){C.push(t)},this),C.sort(g);for(var w=0,E=C.length;w<E;++w)S(C[w])}else i.forEachFeatureInExtent(_,S,this);return x.finish(),this.renderedResolution_=c,this.renderedRevision_=d,this.renderedRenderOrder_=g,this.renderedExtent_=_,this.replayGroup_=x,this.replayGroupChanged=!0},Bu.prototype.renderFeature=function(t,e,i,r,n){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=0,a=r.length;s<a;++s)o=zu(n,t,r[s],Uu(e,i),this.handleStyleImageChange_,this)||o;else o=zu(n,t,r,Uu(e,i),this.handleStyleImageChange_,this);return o};var Yu="image",Xu="hybrid",Vu="vector",Wu={image:[ru.POLYGON,ru.CIRCLE,ru.LINE_STRING,ru.IMAGE,ru.TEXT],hybrid:[ru.POLYGON,ru.LINE_STRING]},Ku={image:[ru.DEFAULT],hybrid:[ru.IMAGE,ru.TEXT,ru.DEFAULT],vector:Cu},Zu=function(t){this.context=null,eu.call(this,t),this.declutterTree_=t.getDeclutter()?wh(9,void 0):null,this.dirty_=!1,this.renderedLayerRevision_,this.tmpTransform_=[1,0,0,1,0,0],this.zDirection=t.getRenderMode()==Vu?1:0,S(Hi,T,this.handleFontsChanged_,this)};t(Zu,eu),Zu.handles=function(t){return t.getType()===ah.VECTOR_TILE},Zu.create=function(t,e){return new Zu(e)},Zu.prototype.disposeInternal=function(){d(Hi,T,this.handleFontsChanged_,this),eu.prototype.disposeInternal.call(this)}
1,Zu.prototype.getTile=function(t,e,i,r,n){var o=eu.prototype.getTile.call(this,t,e,i,r,n);return o.getState()===ro&&(this.createReplayGroup_(o,r,n),this.context&&this.renderTileImage_(o,r,n)),o},Zu.prototype.prepareFrame=function(t,e){var i=this.getLayer(),r=i.getRevision();if(this.renderedLayerRevision_!=r){this.renderedTiles.length=0;var n=i.getRenderMode();this.context||n==Vu||(this.context=ni()),this.context&&n==Vu&&(this.context=null)}return this.renderedLayerRevision_=r,eu.prototype.prepareFrame.apply(this,arguments)},Zu.prototype.createReplayGroup_=function(v,y,m){var x=this,S=this.getLayer(),t=S.getRevision(),C=S.getRenderOrder()||null,w=v.getReplayState(S);if(w.dirty||w.renderedRevision!=t||w.renderedRenderOrder!=C){for(var E=S.getSource(),T=E.getTileGrid(),R=E.getTileGridForProjection(m).getResolution(v.tileCoord[0]),I=v.extent,e=function(t,e){var i=v.getTile(v.tileKeys[t]);if(i.getState()==ro){var r=i.tileCoord,n=T.getTileCoordExtent(r),o=Pt(I,n),s=_t(n,o)?null:rt(o,S.getRenderBuffer()*R,x.tmpExtent),a=i.getProjection(),h=!1;Pe(m,a)||(h=!0,i.setProjection(m)),w.dirty=!1;var l=new Ou(0,o,R,y,E.getOverlaps(),x.declutterTree_,S.getRenderBuffer()),u=Uu(R,y),c=function(t){var e,i=t.getStyleFunction()||S.getStyleFunction();if(i&&(e=i(t,R)),e){var r=this.renderFeature(t,u,e,l);this.dirty_=this.dirty_||r,w.dirty=w.dirty||r}},p=i.getFeatures();C&&C!==w.renderedRenderOrder&&p.sort(C);for(var d=0,f=p.length;d<f;++d){var g=p[d];h&&(a.getUnits()==$t.TILE_PIXELS&&(a.setWorldExtent(n),a.setExtent(i.getExtent())),g.getGeometry().transform(a,m)),s&&!Nt(s,g.getGeometry().getExtent())||c.call(x,g)}for(var _ in l.finish(),l.getReplays());i.setReplayGroup(S,v.tileCoord.toString(),l)}},i=0,r=v.tileKeys.length;i<r;++i)e(i);w.renderedRevision=t,w.renderedRenderOrder=C}},Zu.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var o=e.viewState.resolution,s=e.viewState.rotation;i=null==i?0:i;var a,h,l,u,c,p=this.getLayer(),d={},f=this.renderedTiles;for(l=0,u=f.length;l<u;++l){var g=f[l];if(st(a=rt(g.extent,i*o,a),t))for(var _=0,v=g.tileKeys.length;_<v;++_){var y=g.getTile(g.tileKeys[_]);y.getState()==ro&&(c=y.getReplayGroup(p,g.tileCoord.toString()),h=h||c.forEachFeatureAtCoordinate(t,o,s,i,{},function(t){var e=wt(t).toString();if(!(e in d))return d[e]=!0,r.call(n,t,p)},null))}}return h},Zu.prototype.getReplayTransform_=function(t,e){var i=this.getLayer().getSource().getTileGrid(),r=t.tileCoord,n=i.getResolution(r[0]),o=e.viewState,s=e.pixelRatio,a=o.resolution/s,h=i.getTileCoordExtent(r,this.tmpExtent),l=o.center,u=Mt(h),c=e.size,p=Math.round(s*c[0]/2),d=Math.round(s*c[1]/2);return Xe(this.tmpTransform_,p,d,n/a,n/a,o.rotation,(u[0]-l[0])/n,(l[1]-u[1])/n)},Zu.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&void 0!==this.renderedLayerRevision_&&e.changed()},Zu.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},Zu.prototype.postCompose=function(t,e,i){var r=this.getLayer(),n=r.getRenderMode();if(n!=Yu){var o,s,a=r.getDeclutter()?{}:null,h=r.getSource(),l=Ku[n],u=e.pixelRatio,c=e.viewState.rotation,p=e.size;c&&or(t,-c,o=Math.round(u*p[0]/2),s=Math.round(u*p[1]/2)),a&&this.declutterTree_.clear();for(var d=this.renderedTiles,f=h.getTileGridForProjection(e.viewState.projection),g=[],_=[],v=d.length-1;0<=v;--v){var y=d[v];if(y.getState()!=so)for(var m=y.tileCoord,x=f.getTileCoordExtent(m,this.tmpExtent)[0]-y.extent[0],S=void 0,C=0,w=y.tileKeys.length;C<w;++C){var E=y.getTile(y.tileKeys[C]);if(E.getState()==ro){var T=E.getReplayGroup(r,m.toString());if(n==Vu||T.hasReplays(l)){S||(S=this.getTransform(e,x));var R=E.tileCoord[0],I=T.getClipCoords(S);t.save(),t.globalAlpha=i.opacity;for(var F=0,L=g.length;F<L;++F){var P=g[F];R<_[F]&&(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.moveTo(P[6],P[7]),t.lineTo(P[4],P[5]),t.lineTo(P[2],P[3]),t.lineTo(P[0],P[1]),t.clip())}T.replay(t,S,c,{},l,a),t.restore(),g.push(I),_.push(R)}}}}a&&function(t,e,i){for(var r=Object.keys(t).map(Number).sort(Lr),n={},o=0,s=r.length;o<s;++o)for(var a=t[r[o].toString()],h=0,l=a.length;h<l;){var u=a[h++],c=a[h++];u.replay(e,c,i,n)}}(a,t,c),c&&or(t,c,o,s)}eu.prototype.postCompose.apply(this,arguments)}
1,Zu.prototype.renderFeature=function(t,e,i,r){if(!i)return!1;var n=!1;if(Array.isArray(i))for(var o=0,s=i.length;o<s;++o)n=zu(r,t,i[o],e,this.handleStyleImageChange_,this)||n;else n=zu(r,t,i,e,this.handleStyleImageChange_,this);return n},Zu.prototype.renderTileImage_=function(t,e,i){var r=this.getLayer(),n=t.getReplayState(r),o=r.getRevision(),s=Wu[r.getRenderMode()];if(s&&n.renderedTileRevision!==o){n.renderedTileRevision=o;var a=t.wrappedTileCoord,h=a[0],l=r.getSource(),u=l.getTileGridForProjection(i),c=u.getResolution(h),p=t.getContext(r),d=l.getTilePixelSize(h,e,i);p.canvas.width=d[0],p.canvas.height=d[1];for(var f=u.getTileCoordExtent(a,this.tmpExtent),g=0,_=t.tileKeys.length;g<_;++g){var v=t.getTile(t.tileKeys[g]);if(v.getState()==ro){var y=e/c,m=ke(this.tmpTransform_);Be(m,y,-y),Ye(m,-f[0],-f[3]),v.getReplayGroup(r,t.tileCoord.toString()).replay(p,m,0,{},s)}}}};var Hu=function(t){(t=C({},t)).controls||(t.controls=Os()),t.interactions||(t.interactions=kl()),Es.call(this,t)};t(Hu,Es),Hu.prototype.createRenderer=function(){var t=new Zl(this);return t.registerLayerRenderers([Ql,eu,Bu,Zu]),t};var qu="bottom-left",Ju="bottom-center",Qu="bottom-right",$u="center-left",tc="center-center",ec="center-right",ic="top-left",rc="top-center",nc="top-right",oc="element",sc="map",ac="offset",hc="position",lc="positioning",uc=function(t){K.call(this),this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("DIV"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container ol-selectable",this.element.style.position="absolute",this.autoPan=void 0!==t.autoPan&&t.autoPan,this.autoPanAnimation=t.autoPanAnimation||{},this.autoPanMargin=void 0!==t.autoPanMargin?t.autoPanMargin:20,this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0},this.mapPostrenderListenerKey=null,S(this,H(oc),this.handleElementChanged,this),S(this,H(sc),this.handleMapChanged,this),S(this,H(ac),this.handleOffsetChanged,this),S(this,H(hc),this.handlePositionChanged,this),S(this,H(lc),this.handlePositioningChanged,this),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(void 0!==t.positioning?t.positioning:ic),void 0!==t.position&&this.setPosition(t.position)};t(uc,K),uc.prototype.getElement=function(){return this.get(oc)},uc.prototype.getId=function(){return this.id},uc.prototype.getMap=function(){return this.get(sc)},uc.prototype.getOffset=function(){return this.get(ac)},uc.prototype.getPosition=function(){return this.get(hc)},uc.prototype.getPositioning=function(){return this.get(lc)},uc.prototype.handleElementChanged=function(){ai(this.element);var t=this.getElement();t&&this.element.appendChild(t)},uc.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(si(this.element),f(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=S(t,jo,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element)}},uc.prototype.render=function(){this.updatePixelPosition()},uc.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},uc.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.get(hc)&&this.autoPan&&this.panIntoView()},uc.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},uc.prototype.setElement=function(t){this.set(oc,t)},uc.prototype.setMap=function(t){this.set(sc,t)},uc.prototype.setOffset=function(t){this.set(ac,t)},uc.prototype.setPosition=function(t){this.set(hc,t)},uc.prototype.panIntoView=function(){var t=this.getMap();if(t&&t.getTargetElement()){var e,i,r,n,o,s,a=this.getRect(t.getTargetElement(),t.getSize()),h=this.getElement(),l=this.getRect(h,[(n=h,o=n.offsetWidth,s=getComputedStyle(n),o+=parseInt(s.marginLeft,10)+parseInt(s.marginRight,10)),(e=h,i=e.offsetHeight,r=getComputedStyle(e),i+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10))]),u=this.autoPanMargin;if(!at(a,l)){var c=l[0]-a[0],p=a[2]-l[2],d=l[1]-a[1],f=a[3]-l[3],g=[0,0];if(c<0?g[0]=c-u:p<0&&(g[0]=Math.abs(p)+u),d<0?g[1]=d-u:f<0&&(g[1]=Math.abs(f)+u),0!==g[0]||0!==g[1]){var _=t.getView().getCenter(),v=t.getPixelFromCo
1ordinate(_),y=[v[0]+g[0],v[1]+g[1]];t.getView().animate({center:t.getCoordinateFromPixel(y),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},uc.prototype.getRect=function(t,e){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,n=i.top+window.pageYOffset;return[r,n,r+e[0],n+e[1]]},uc.prototype.setPositioning=function(t){this.set(lc,t)},uc.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},uc.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var i=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},uc.prototype.updateRenderedPosition=function(t,e){var i=this.element.style,r=this.getOffset(),n=this.getPositioning();this.setVisible(!0);var o=r[0],s=r[1];if(n==Qu||n==ec||n==nc){""!==this.rendered.left_&&(this.rendered.left_=i.left="");var a=Math.round(e[0]-t[0]-o)+"px";this.rendered.right_!=a&&(this.rendered.right_=i.right=a)}else{""!==this.rendered.right_&&(this.rendered.right_=i.right=""),n!=Ju&&n!=tc&&n!=rc||(o-=this.element.offsetWidth/2);var h=Math.round(t[0]+o)+"px";this.rendered.left_!=h&&(this.rendered.left_=i.left=h)}if(n==qu||n==Ju||n==Qu){""!==this.rendered.top_&&(this.rendered.top_=i.top="");var l=Math.round(e[1]-t[1]-s)+"px";this.rendered.bottom_!=l&&(this.rendered.bottom_=i.bottom=l)}else{""!==this.rendered.bottom_&&(this.rendered.bottom_=i.bottom=""),n!=$u&&n!=tc&&n!=ec||(s-=this.element.offsetHeight/2);var u=Math.round(t[1]+s)+"px";this.rendered.top_!=u&&(this.rendered.top_=i.top=u)}},uc.prototype.getOptions=function(){return this.options};var cc=function(t,e,i,r,n,o){co.call(this,t,e,o),this.consumers=0,this.extent_=null,this.format_=r,this.features_=null,this.loader_,this.projection_=null,this.replayGroups_={},this.tileLoadFunction_=n,this.url_=i};t(cc,co);var pc=[0,0,4096,4096];cc.prototype.disposeInternal=function(){this.features_=null,this.replayGroups_={},this.state=so,this.changed(),co.prototype.disposeInternal.call(this)},cc.prototype.getExtent=function(){return this.extent_||pc},cc.prototype.getFormat=function(){return this.format_},cc.prototype.getFeatures=function(){return this.features_},cc.prototype.getKey=function(){return this.url_},cc.prototype.getProjection=function(){return this.projection_},cc.prototype.getReplayGroup=function(t,e){return this.replayGroups_[wt(t)+","+e]},cc.prototype.load=function(){this.state==eo&&(this.setState(io),this.tileLoadFunction_(this,this.url_),this.loader_(null,NaN,null))},cc.prototype.onLoad=function(t,e,i){this.setProjection(e),this.setFeatures(t),this.setExtent(i)},cc.prototype.onError=function(){this.setState(no)},cc.prototype.setExtent=function(t){this.extent_=t},cc.prototype.setFeatures=function(t){this.features_=t,this.setState(ro)},cc.prototype.setProjection=function(t){this.projection_=t},cc.prototype.setReplayGroup=function(t,e,i){this.replayGroups_[wt(t)+","+e]=i},cc.prototype.setLoader=function(t){this.loader_=t};var dc,fc=function(){if(!dc){var t=document.body;t.webkitRequestFullscreen?dc="webkitfullscreenchange":t.mozRequestFullScreen?dc="mozfullscreenchange":t.msRequestFullscreen?dc="MSFullscreenChange":t.requestFullscreen&&(dc="fullscreenchange")}return dc},gc=function(t){var e=t||{};this.cssClassName_=void 0!==e.className?e.className:"ol-full-screen";var i=void 0!==e.label?e.label:"⤢";this.labelNode_="string"==typeof i?document.createTextNode(i):i;var r=void 0!==e.labelActive?e.labelActive:"Ã";this.labelActiveNode_="string"==typeof r?document.createTextNode(r):r;var n=e.tipLabel?e.tipLabel:"Toggle full-screen",o=document.createElement("button");o.className=this.cssClassName_+"-"+vc(),o.setAttribute("type","button"),o.title=n,o.appendChild(this.labelNode_),S(o,I,this.handleClick_,this);var s=this.cssClassName_+" "+ki+" "+Gi+" "+(_c()?"":"ol-unsupported"),a=document.createElement("div");a.className=s,a.appendChild(o),Ts.call(this,{element:a,target:e.target}
1),this.keys_=void 0!==e.keys&&e.keys,this.source_=e.source};function _c(){var t=document.body;return!!(t.webkitRequestFullscreen||t.mozRequestFullScreen&&document.mozFullScreenEnabled||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function vc(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)}function yc(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}t(gc,Ts),gc.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},gc.prototype.handleFullScreen_=function(){if(_c()){var t,e,i=this.getMap();if(i)if(vc())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else t=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:i.getTargetElement(),this.keys_?(e=t).mozRequestFullScreenWithKeys?e.mozRequestFullScreenWithKeys():e.webkitRequestFullscreen?e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):yc(e):yc(t)}},gc.prototype.handleFullScreenChange_=function(){var t=this.element.firstElementChild,e=this.getMap();vc()?(t.className=this.cssClassName_+"-true",oi(this.labelActiveNode_,this.labelNode_)):(t.className=this.cssClassName_+"-false",oi(this.labelNode_,this.labelActiveNode_)),e&&e.updateSize()},gc.prototype.setMap=function(t){Ts.prototype.setMap.call(this,t),t&&this.listenerKeys.push(S(document,fc(),this.handleFullScreenChange_,this))};var mc=function(t){var e=t||{};this.collapsed_=void 0===e.collapsed||e.collapsed,this.collapsible_=void 0===e.collapsible||e.collapsible,this.collapsible_||(this.collapsed_=!1);var i=void 0!==e.className?e.className:"ol-overviewmap",r=void 0!==e.tipLabel?e.tipLabel:"Overview map",n=void 0!==e.collapseLabel?e.collapseLabel:"«";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var o=void 0!==e.label?e.label:"»";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o):this.label_=o;var s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,a=document.createElement("button");a.setAttribute("type","button"),a.title=r,a.appendChild(s),S(a,I,this.handleClick_,this),this.ovmapDiv_=document.createElement("DIV"),this.ovmapDiv_.className="ol-overviewmap-map",this.ovmap_=new Hu({controls:new Q,interactions:new Q,view:e.view});var h=this.ovmap_;e.layers&&e.layers.forEach(function(t){h.addLayer(t)}.bind(this));var l=document.createElement("DIV");l.className="ol-overviewmap-box",l.style.boxSizing="border-box",this.boxOverlay_=new uc({position:[0,0],positioning:qu,element:l}),this.ovmap_.addOverlay(this.boxOverlay_);var u=i+" "+ki+" "+Gi+(this.collapsed_&&this.collapsible_?" "+Di:"")+(this.collapsible_?"":" ol-uncollapsible"),c=document.createElement("div");c.className=u,c.appendChild(this.ovmapDiv_),c.appendChild(a),Ts.call(this,{element:c,render:e.render||xc,target:e.target});var p=this,d=this.boxOverlay_,f=this.boxOverlay_.getElement(),g=function(t){var e,i=h.getEventCoordinate({clientX:(e=t).clientX-f.offsetWidth/2,clientY:e.clientY+f.offsetHeight/2});d.setPosition(i)},_=function(t){var e=h.getEventCoordinate(t);p.getMap().getView().setCenter(e),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)};f.addEventListener("mousedown",function(){window.addEventListener("mousemove",g),window.addEventListener("mouseup",_)})};function xc(t){this.validateExtent_(),this.updateBox_()}t(mc,Ts),mc.prototype.setMap=function(t){var e=this.getMap();if(t!==e){if(e){var i=e.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(Ts.prototype.setMap.call(this,t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(S(t,l,this.handleMapPropertyChange_,this)),0===this.ovmap_.getLayers().getLength()&&this.ovmap_.setLayerGroup(t.getLayerGroup());var r=t.getView();r&&(this.bindView_(r),r.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},mc.prototype.handleMapPropertyChange_=function(t){if(t.key===Wo){var e=t.oldValue;e&&this.unbindView_(e);var i=this.getMap().getView();this.bindView_(i)}},mc.prototype.bindView_=function(t){S(t,H(ns),this.handleRotationChanged_,this)},mc.prototype.unbindView_=function(t){d(t,H(ns),this.handleRotationChanged_,this)},mc.prototype.handleRotationChanged_=function(){this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},mc.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),r=t.getView().calculateExtent(i),n=e.getSize(),o=e.getView().calculateExtent(n),s=e.getPixelFromCo
1ordinate(Mt(r)),a=e.getPixelFromCoordinate(Rt(r)),h=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),u=n[0],c=n[1];h<.1*u||l<.1*c||.75*u<h||.75*c<l?this.resetExtent_():at(o,r)||this.recenter_()}},mc.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getSize(),r=t.getView().calculateExtent(i),n=e.getView(),o=Math.log(7.5)/Math.LN2;kt(r,1/(.1*Math.pow(2,o/2))),n.fit(r)},mc.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getView();e.getView().setCenter(i.getCenter())},mc.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),r=t.getView(),n=e.getView(),o=r.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),h=r.calculateExtent(i),l=n.getResolution(),u=Tt(h),c=bt(h),p=this.calculateCoordinateRotate_(o,u);s.setPosition(p),a&&(a.style.width=Math.abs((u[0]-c[0])/l)+"px",a.style.height=Math.abs((c[1]-u[1])/l)+"px")}},mc.prototype.calculateCoordinateRotate_=function(t,e){var i,r=this.getMap().getView().getCenter();return r&&(On(i=[e[0]-r[0],e[1]-r[1]],t),Fn(i,r)),i},mc.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},mc.prototype.handleToggle_=function(){this.element.classList.toggle(Di),this.collapsed_?oi(this.collapseLabel_,this.label_):oi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;this.collapsed_||t.isRendered()||(t.updateSize(),this.resetExtent_(),p(t,jo,function(t){this.updateBox_()},this))},mc.prototype.getCollapsible=function(){return this.collapsible_},mc.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},mc.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},mc.prototype.getCollapsed=function(){return this.collapsed_},mc.prototype.getOverviewMap=function(){return this.ovmap_};var Sc="units",Cc="degrees",wc="imperial",Ec="nautical",Tc="metric",Rc="us",Ic=[1,2,5],Fc=function(t){var e=t||{},i=void 0!==e.className?e.className:"ol-scale-line";this.innerElement_=document.createElement("DIV"),this.innerElement_.className=i+"-inner",this.element_=document.createElement("DIV"),this.element_.className=i+" "+ki,this.element_.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==e.minWidth?e.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",Ts.call(this,{element:this.element_,render:e.render||Lc,target:e.target}),S(this,H(Sc),this.handleUnitsChanged_,this),this.setUnits(e.units||Tc)};function Lc(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}t(Fc,Ts),Fc.prototype.getUnits=function(){return this.get(Sc)},Fc.prototype.handleUnitsChanged_=function(){this.updateElement_()},Fc.prototype.setUnits=function(t){this.set(Sc,t)},Fc.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,r=this.getUnits(),n=r==Cc?$t.DEGREES:$t.METERS,o=Te(i,t.resolution,e,n);i.getUnits()!=$t.DEGREES&&i.getMetersPerUnit()&&n==$t.METERS&&(o*=i.getMetersPerUnit());var s=this.minWidth_*o,a="";if(r==Cc){var h=te[$t.DEGREES];i.getUnits()==$t.DEGREES?s*=h:o/=h,s<h/60?(a="â³",o*=3600):s<h?(a="â²",o*=60):a="°"}else r==wc?s<.9144?(a="in",o/=.0254):s<1609.344?(a="ft",o/=.3048):(a="mi",o/=1609.344):r==Ec?(o/=1852,a="nm"):r==Tc?s<.001?(a="μm",o*=1e6):s<1?(a="mm",o*=1e3):s<1e3?a="m":(a="km",o/=1e3):r==Rc?s<.9144?(a="in",o*=39.37):s<1609.344?(a="ft",o/=.30480061):(a="mi",o/=1609.3472):$(!1,33);for(var l,u,c=3*Math.floor(Math.log(this.minWidth_*o)/Math.log(10));;){if(l=Ic[(c%3+3)%3]*Math.pow(10,Math.floor(c/3)),u=Math.round(l/o),isNaN(u))return this.element_.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++c}var p=l+" "+a;this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)};var Pc=0,Mc=1,bc=function(t){var e=t||{};this.currentResolution_=void 0,this.direction_=Pc,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.previousX_,this.previousY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=void 0!==e.duration?e.duration:200;var i=void 0!==e.className?e.className:"ol-zoomslider",r=document.createElement("button");r.setAttribute("type","button"),r.className=i+"-thumb "+ki;var n=document.createElement("div");n.className=i+" "+ki+" "+Gi,n.appendChild(r),this.dragger_=new Go(n),S(this.dragger_,So,this.handleDraggerStart_,this),S(this.dragger_,xo,this.handleDraggerDrag_,this),S(this.dragger_,Co,this.handleDraggerEnd_,this),S(n,I,this.handleContainerClick_,this),S(r,I,x),Ts.call(this,{element:n,render:e.render||Oc})};function Oc(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;
1e!==this.currentResolution_&&(this.currentResolution_=e,this.setThumbPosition_(e))}}t(bc,Ts),bc.prototype.disposeInternal=function(){this.dragger_.dispose(),Ts.prototype.disposeInternal.call(this)},bc.prototype.setMap=function(t){Ts.prototype.setMap.call(this,t),t&&t.render()},bc.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,i=t.offsetHeight,r=t.firstElementChild,n=getComputedStyle(r),o=r.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),s=r.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);this.thumbSize_=[o,s],i<e?(this.direction_=Mc,this.widthLimit_=e-o):(this.direction_=Pc,this.heightLimit_=i-s),this.sliderInitialized_=!0},bc.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i);e.animate({resolution:e.constrainResolution(r),duration:this.duration_,easing:ho})},bc.prototype.handleDraggerStart_=function(t){this.dragging_||t.originalEvent.target!==this.element.firstElementChild||(this.getMap().getView().setHint(es,1),this.previousX_=t.clientX,this.previousY_=t.clientY,this.dragging_=!0)},bc.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=this.element.firstElementChild,i=t.clientX-this.previousX_+parseInt(e.style.left,10),r=t.clientY-this.previousY_+parseInt(e.style.top,10),n=this.getRelativePosition_(i,r);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_),this.setThumbPosition_(this.currentResolution_),this.previousX_=t.clientX,this.previousY_=t.clientY}},bc.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.setHint(es,-1),e.animate({resolution:e.constrainResolution(this.currentResolution_),duration:this.duration_,easing:ho}),this.dragging_=!1,this.previousX_=void 0,this.previousY_=void 0}},bc.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==Mc?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"},bc.prototype.getRelativePosition_=function(t,e){return jt(this.direction_===Mc?t/this.widthLimit_:e/this.heightLimit_,0,1)},bc.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},bc.prototype.getPositionForResolution_=function(t){return 1-this.getMap().getView().getValueForResolutionFunction()(t)};var Nc=function(t){var e=t||{};this.extent=e.extent?e.extent:null;var i=void 0!==e.className?e.className:"ol-zoom-extent",r=void 0!==e.label?e.label:"E",n=void 0!==e.tipLabel?e.tipLabel:"Fit to extent",o=document.createElement("button");o.setAttribute("type","button"),o.title=n,o.appendChild("string"==typeof r?document.createTextNode(r):r),S(o,I,this.handleClick_,this);var s=i+" "+ki+" "+Gi,a=document.createElement("div");a.className=s,a.appendChild(o),Ts.call(this,{element:a,target:e.target})};t(Nc,Ts),Nc.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},Nc.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fit(e)};var Ac=function(t){this.source_=t};Ac.prototype.getType=function(){},Ac.prototype.getSource=function(){return this.source_},Ac.prototype.isAnimated=i;var kc=function(t){Ac.call(this,t)};t(kc,Ac),kc.prototype.getType=function(){return 35632};var Gc=function(t){Ac.call(this,t)};t(Gc,Ac),Gc.prototype.getType=function(){return 35633};var Dc=new kc("precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;
1\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n"),Uc=new Gc("varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n"),jc=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_lineWidth=t.getUniformLocation(e,"u_lineWidth"),this.u_pixelRatio=t.getUniformLocation(e,"u_pixelRatio"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_fillColor=t.getUniformLocation(e,"u_fillColor"),this.u_strokeColor=t.getUniformLocation(e,"u_strokeColor"),this.u_size=t.getUniformLocation(e,"u_size"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_instruction=t.getAttribLocation(e,"a_instruction"),this.a_radius=t.getAttribLocation(e,"a_radius")};function zc(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 Bc=function(t,e){Ul.call(this),this.tolerance=t,this.maxExtent=e,this.origin=It(e),this.projectionMatrix_=[1,0,0,1,0,0],this.offsetRotateMatrix_=[1,0,0,1,0,0],this.offsetScaleMatrix_=[1,0,0,1,0,0],this.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.indices=[],this.indicesBuffer=null,this.startIndices=[],this.startIndicesFeature=[],this.vertices=[],this.verticesBuffer=null,this.lineStringReplay=void 0};t(Bc,Ul),Bc.prototype.getDeleteResourcesFunction=function(t){},Bc.prototype.finish=function(t){},Bc.prototype.setUpProgram=function(t,e,i,r){},Bc.prototype.shutDownProgram=function(t,e){},Bc.prototype.drawReplay=function(t,e,i,r){},Bc.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){},Bc.prototype.drawHitDetectionReplay=function(t,e,i,r,n,o){return n?this.drawHitDetectionReplayOneByOne(t,e,i,r,o):this.drawHitDetectionReplayAll(t,e,i,r)},Bc.prototype.drawHitDetectionReplayAll=function(t,e,i,r){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawReplay(t,e,i,!0);var n=r(null);return n||void 0}
1,Bc.prototype.replay=function(t,e,i,r,n,o,s,a,h,l,u){var c,p,d,f,g,_,v,y,m=t.getGL();this.lineStringReplay&&(c=m.isEnabled(m.STENCIL_TEST),p=m.getParameter(m.STENCIL_FUNC),d=m.getParameter(m.STENCIL_VALUE_MASK),f=m.getParameter(m.STENCIL_REF),g=m.getParameter(m.STENCIL_WRITEMASK),_=m.getParameter(m.STENCIL_FAIL),v=m.getParameter(m.STENCIL_PASS_DEPTH_PASS),y=m.getParameter(m.STENCIL_PASS_DEPTH_FAIL),m.enable(m.STENCIL_TEST),m.clear(m.STENCIL_BUFFER_BIT),m.stencilMask(255),m.stencilFunc(m.ALWAYS,1,255),m.stencilOp(m.KEEP,m.KEEP,m.REPLACE),this.lineStringReplay.replay(t,e,i,r,n,o,s,a,h,l,u),m.stencilMask(0),m.stencilFunc(m.NOTEQUAL,1,255)),t.bindBuffer(ui,this.verticesBuffer),t.bindBuffer(34963,this.indicesBuffer);var x=this.setUpProgram(m,t,n,o),S=ke(this.projectionMatrix_);Be(S,2/(i*n[0]),2/(i*n[1])),ze(S,-r),Ye(S,-(e[0]-this.origin[0]),-(e[1]-this.origin[1]));var C=ke(this.offsetScaleMatrix_);Be(C,2/n[0],2/n[1]);var w,E=ke(this.offsetRotateMatrix_);return 0!==r&&ze(E,-r),m.uniformMatrix4fv(x.u_projectionMatrix,!1,zc(this.tmpMat4_,S)),m.uniformMatrix4fv(x.u_offsetScaleMatrix,!1,zc(this.tmpMat4_,C)),m.uniformMatrix4fv(x.u_offsetRotateMatrix,!1,zc(this.tmpMat4_,E)),m.uniform1f(x.u_opacity,s),void 0===h?this.drawReplay(m,t,a,!1):w=this.drawHitDetectionReplay(m,t,a,h,l,u),this.shutDownProgram(m,x),this.lineStringReplay&&(c||m.disable(m.STENCIL_TEST),m.clear(m.STENCIL_BUFFER_BIT),m.stencilFunc(p,f,d),m.stencilMask(g),m.stencilOp(_,y,v)),w},Bc.prototype.drawElements=function(t,e,i,r){var n=e.hasOESElementIndexUint?5125:5123,o=r-i,s=i*(e.hasOESElementIndexUint?4:2);t.drawElements(4,o,n,s)};var Yc=[0,0,0,1],Xc=[],Vc=[0,0,0,1],Wc=Number.EPSILON||2220446049250313e-31,Kc=function(t,e,i,r,n,o){var s=(i-t)*(o-e)-(n-t)*(r-e);return s<=Wc&&-Wc<=s?void 0:0<s},Zc=35044,Hc=function(t,e){this.arr_=void 0!==t?t:[],this.usage_=void 0!==e?e:Zc};Hc.prototype.getArray=function(){return this.arr_},Hc.prototype.getUsage=function(){return this.usage_};var qc=function(t,e){Bc.call(this,t,e),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.radius_=0,this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,changed:!1}};t(qc,Bc),qc.prototype.drawCoordinates_=function(t,e,i,r){var n,o,s=this,a=this.vertices.length,h=this.indices.length,l=a/4;for(n=e,o=i;n<o;n+=r)s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=0,s.vertices[a++]=s.radius_,s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=1,s.vertices[a++]=s.radius_,s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=2,s.vertices[a++]=s.radius_,s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=3,s.vertices[a++]=s.radius_,s.indices[h++]=l,s.indices[h++]=l+1,s.indices[h++]=l+2,s.indices[h++]=l+2,s.indices[h++]=l+3,s.indices[h++]=l,l+=4},qc.prototype.drawCircle=function(t,e){var i=t.getRadius(),r=t.getStride();if(i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=i;var n=t.getFlatCoordinates();n=Ut(n,0,2,r,-this.origin[0],-this.origin[1]),this.drawCoordinates_(n,0,2,r)}else if(this.state_.changed&&(this.styles_.pop(),this.styles_.length)){var o=this.styles_[this.styles_.length-1];this.state_.fillColor=o[0],this.state_.strokeColor=o[1],this.state_.lineWidth=o[2],this.state_.changed=!1}},qc.prototype.finish=function(t){this.verticesBuffer=new Hc(this.vertices),this.indicesBuffer=new Hc(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&0<this.styles_.length&&(this.styles_=[]),this.vertices=null,this.indices=null},qc.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer;return function(){t.deleteBuffer(e),t.deleteBuffer(i)}},qc.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(Dc,Uc);return this.defaultLocations_?n=this.defaultLocations_:(n=new jc(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,ci,!1,16,0),t.enableVertexAttribArray(n.a_instruction),t.vertexAttribPointer(n.a_instruction,1,ci,!1,16,8),t.enableVertexAttribArray(n.a_radius),t.vertexAttribPointer(n.a_radius,1,ci,!1,16,12),t.uniform2fv(n.u_size,i),t.uniform1f(n.u_pixelRatio,r),n},qc.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_instruction),t.disableVertexAttribArray(e.a_radius)}
1,qc.prototype.drawReplay=function(t,e,i,r){var n,o,s,a;if(Et(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;0<=n;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setFillStyle_(t,a[0]),this.setStrokeStyle_(t,a[1],a[2]),this.drawElements(t,e,o,s),s=o;else this.drawReplaySkipping_(t,e,i)},qc.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u,c;for(c=this.startIndices.length-2,a=this.startIndices[c+1],o=this.styleIndices_.length-1;0<=o;--o)for(h=this.styles_[o],this.setFillStyle_(t,h[0]),this.setStrokeStyle_(t,h[1],h[2]),l=this.styleIndices_[o];0<=c&&this.startIndices[c]>=l;){if(s=this.startIndices[c],void 0===i[wt(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||Nt(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,s,a);var p=r(u);if(p)return p}c--,a=s}},qc.prototype.drawReplaySkipping_=function(t,e,i){var r,n,o,s,a,h,l;for(h=this.startIndices.length-2,o=n=this.startIndices[h+1],r=this.styleIndices_.length-1;0<=r;--r){for(s=this.styles_[r],this.setFillStyle_(t,s[0]),this.setStrokeStyle_(t,s[1],s[2]),a=this.styleIndices_[r];0<=h&&this.startIndices[h]>=a;)l=this.startIndices[h],i[wt(this.startIndicesFeature[h]).toString()]&&(n!==o&&this.drawElements(t,e,n,o),o=l),h--,n=l;n!==o&&this.drawElements(t,e,n,o),n=o=a}},qc.prototype.setFillStyle_=function(t,e){t.uniform4fv(this.defaultLocations_.u_fillColor,e)},qc.prototype.setStrokeStyle_=function(t,e,i){t.uniform4fv(this.defaultLocations_.u_strokeColor,e),t.uniform1f(this.defaultLocations_.u_lineWidth,i)},qc.prototype.setFillStrokeStyle=function(t,e){var i,r;if(e){var n=e.getLineDash();this.state_.lineDash=n||Xc;var o=e.getLineDashOffset();this.state_.lineDashOffset=o||0,i=(i=e.getColor())instanceof CanvasGradient||i instanceof CanvasPattern?Vc:ti(i).map(function(t,e){return 3!=e?t/255:t})||Vc,r=void 0!==(r=e.getWidth())?r:1}else i=[0,0,0,0],r=0;var s=t?t.getColor():[0,0,0,0];s=s instanceof CanvasGradient||s instanceof CanvasPattern?Yc:ti(s).map(function(t,e){return 3!=e?t/255:t})||Yc,this.state_.strokeColor&&Ar(this.state_.strokeColor,i)&&this.state_.fillColor&&Ar(this.state_.fillColor,s)&&this.state_.lineWidth===r||(this.state_.changed=!0,this.state_.fillColor=s,this.state_.strokeColor=i,this.state_.lineWidth=r,this.styles_.push([s,i,r]))};var Jc=new kc("precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),Qc=new Gc("varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n"),$c=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_image=t.getUniformLocation(e,"u_image"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord"),this.a_offsets=t.getAttribLocation(e,"a_offsets"),this.a_opacity=t.getAttribLocation(e,"a_opacity"),this.a_rotateWithView=t.getAttribLocation(e,"a_rotateWithView")},tp="webglcontextlost",ep="webglcontextrestored",ip=function(t,e){this.canvas_=t,this.gl_=e,this.bufferCache_={},this.shaderCache_={},this.programCache_={},this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null,this.hasOESElementIndexUint=Pr(li,"OES_element_index_uint"),this.hasOESElementIndexUint&&e.getExtension("OES_element_index_uint"),S(this.canvas_,tp,this.handleWebGLContextLost,this),S(this.canvas_,ep,this.handleWebGLContextRestored,this)};function rp(t,e,i){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==e&&t.texParameteri(fi,pi,e),void 0!==i&&t.texParameteri(fi,di,i),r}function np(t,e,i,r,n){var o=rp(t,r,n);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),o}function op(t,e,i,r){var n=rp(t,i,r);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),n}t(ip,y),ip.prototype.bindBuffer=function(t,e){var i=this.getGL(),r=e.getArray(),n=String(wt(e));if(n in this.bufferCache_){var o=this.bufferCache_[n];i.bindBuffer(t,o.buffer)}else{var s,a=i.createBuffer();i.bindBuffer(t,a),t==ui?s=new Float32Array(r):34963==t&&(s=this.hasOESElementIndexUint?new Uint32Array(r):new Uint16Array(r)),i.bufferData(t,s,e.getUsage()),this.bufferCache_[n]={buf:e,buffer:a}}},ip.prototype.deleteBuffer=function(t){var e=this.getGL(),i=String(wt(t)),r=this.bufferCache_[i];e.isContextLost()||e.deleteBuffer(r.buffer),delete this.bufferCache_[i]},ip.prototype.disposeInternal=function(){_(this.canvas_);var t=this.getGL();if(!t.isContextLost()){for(var e in this.bufferCache_)t.deleteBuffer(this.bufferCache_[e].buffer);for(var i in this.programCache_)t.deleteProgram(this.programCache_[i]);for(var r in this.shaderCache_)t.deleteShader(this.shaderCache_[r]);t.deleteFramebuffer(this.hitDetectionFramebuffer_),t.deleteRenderbuffer(this.hitDetectionRenderbuffer_),t.deleteTexture(this.hitDetectionTexture_)}},ip.prototype.getCanvas=function(){return this.canvas_},ip.prototype.getGL=function(){return this.gl_},ip.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},ip.prototype.getShader=function(t){var e=String(wt(t));if(e in this.shaderCache_)return this.shaderCache_[e];var i=this.getGL(),r=i.createShader(t.getType());return i.shaderSource(r,t.getSource()),i.compileShader(r),this.shaderCache_[e]=r},ip.prototype.getProgram=function(t,e){var i=wt(t)+"/"+wt(e);if(i in this.programCache_)return this.programCache_[i];var r=this.getGL(),n=r.createProgram();
1return r.attachShader(n,this.getShader(t)),r.attachShader(n,this.getShader(e)),r.linkProgram(n),this.programCache_[i]=n},ip.prototype.handleWebGLContextLost=function(){g(this.bufferCache_),g(this.shaderCache_),g(this.programCache_),this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null},ip.prototype.handleWebGLContextRestored=function(){},ip.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_,e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var i=np(t,1,1),r=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,r),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,r),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.hitDetectionFramebuffer_=e,this.hitDetectionTexture_=i,this.hitDetectionRenderbuffer_=r},ip.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,!0)};var sp=function(t,e){Bc.call(this,t,e),this.anchorX=void 0,this.anchorY=void 0,this.groupIndices=[],this.hitDetectionGroupIndices=[],this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.defaultLocations=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.width=void 0};t(sp,Bc),sp.prototype.getDeleteResourcesFunction=function(i){var r=this.verticesBuffer,n=this.indicesBuffer,o=this.getTextures(!0),s=i.getGL();return function(){var t,e;if(!s.isContextLost())for(t=0,e=o.length;t<e;++t)s.deleteTexture(o[t]);i.deleteBuffer(r),i.deleteBuffer(n)}},sp.prototype.drawCoordinates=function(t,e,i,r){var n,o,s,a,h,l,u=this,c=this.anchorX,p=this.anchorY,d=this.height,f=this.imageHeight,g=this.imageWidth,_=this.opacity,v=this.originX,y=this.originY,m=this.rotateWithView?1:0,x=-this.rotation,S=this.scale,C=this.width,w=Math.cos(x),E=Math.sin(x),T=this.indices.length,R=this.vertices.length;for(n=e;n<i;n+=r)h=t[n]-u.origin[0],l=t[n+1]-u.origin[1],o=R/8,s=-S*c,a=-S*(d-p),u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*w-a*E,u.vertices[R++]=s*E+a*w,u.vertices[R++]=v/g,u.vertices[R++]=(y+d)/f,u.vertices[R++]=_,u.vertices[R++]=m,s=S*(C-c),a=-S*(d-p),u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*w-a*E,u.vertices[R++]=s*E+a*w,u.vertices[R++]=(v+C)/g,u.vertices[R++]=(y+d)/f,u.vertices[R++]=_,u.vertices[R++]=m,s=S*(C-c),a=S*p,u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*w-a*E,u.vertices[R++]=s*E+a*w,u.vertices[R++]=(v+C)/g,u.vertices[R++]=y/f,u.vertices[R++]=_,u.vertices[R++]=m,s=-S*c,a=S*p,u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*w-a*E,u.vertices[R++]=s*E+a*w,u.vertices[R++]=v/g,u.vertices[R++]=y/f,u.vertices[R++]=_,u.vertices[R++]=m,u.indices[T++]=o,u.indices[T++]=o+1,u.indices[T++]=o+2,u.indices[T++]=o,u.indices[T++]=o+2,u.indices[T++]=o+3;return R},sp.prototype.createTextures=function(t,e,i,r){var n,o,s,a,h=e.length;for(a=0;a<h;++a)(s=wt(o=e[a]).toString())in i?n=i[s]:(n=op(r,o,gi,gi),i[s]=n),t[a]=n},sp.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(Jc,Qc);return this.defaultLocations?n=this.defaultLocations:(n=new $c(t,o),this.defaultLocations=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,ci,!1,32,0),t.enableVertexAttribArray(n.a_offsets),t.vertexAttribPointer(n.a_offsets,2,ci,!1,32,8),t.enableVertexAttribArray(n.a_texCoord),t.vertexAttribPointer(n.a_texCoord,2,ci,!1,32,16),t.enableVertexAttribArray(n.a_opacity),t.vertexAttribPointer(n.a_opacity,1,ci,!1,32,24),t.enableVertexAttribArray(n.a_rotateWithView),t.vertexAttribPointer(n.a_rotateWithView,1,ci,!1,32,28),n},sp.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_offsets),t.disableVertexAttribArray(e.a_texCoord),t.disableVertexAttribArray(e.a_opacity),t.disableVertexAttribArray(e.a_rotateWithView)}
1,sp.prototype.drawReplay=function(t,e,i,r){var n,o,s,a=r?this.getHitDetectionTextures():this.getTextures(),h=r?this.hitDetectionGroupIndices:this.groupIndices;if(Et(i))for(n=0,o=a.length,s=0;n<o;++n){t.bindTexture(fi,a[n]);var l=h[n];this.drawElements(t,e,s,l),s=l}else this.drawReplaySkipping(t,e,i,a,h)},sp.prototype.drawReplaySkipping=function(t,e,i,r,n){var o,s,a=0;for(o=0,s=r.length;o<s;++o){t.bindTexture(fi,r[o]);for(var h=0<o?n[o-1]:0,l=n[o],u=h,c=h;a<this.startIndices.length&&this.startIndices[a]<=l;){void 0!==i[wt(this.startIndicesFeature[a]).toString()]?(u!==c&&this.drawElements(t,e,u,c),c=u=a===this.startIndices.length-1?l:this.startIndices[a+1]):c=a===this.startIndices.length-1?l:this.startIndices[a+1],a++}u!==c&&this.drawElements(t,e,u,c)}},sp.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u=this.startIndices.length-1,c=this.getHitDetectionTextures();for(o=c.length-1;0<=o;--o)for(t.bindTexture(fi,c[o]),s=0<o?this.hitDetectionGroupIndices[o-1]:0,h=this.hitDetectionGroupIndices[o];0<=u&&this.startIndices[u]>=s;){if(a=this.startIndices[u],void 0===i[wt(l=this.startIndicesFeature[u]).toString()]&&l.getGeometry()&&(void 0===n||Nt(n,l.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,a,h);var p=r(l);if(p)return p}h=a,u--}},sp.prototype.finish=function(t){this.anchorX=void 0,this.anchorY=void 0,this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.indices=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.vertices=null,this.width=void 0},sp.prototype.getTextures=function(t){},sp.prototype.getHitDetectionTextures=function(){};var ap=function(t,e){sp.call(this,t,e),this.images_=[],this.hitDetectionImages_=[],this.textures_=[],this.hitDetectionTextures_=[]};function hp(t,e,i,r){var n=i-r;return t[e]===t[n]&&t[e+1]===t[n+1]&&3<(i-e)/r&&!!zr(t,e,i,r)}t(ap,sp),ap.prototype.drawMultiPoint=function(t,e){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var i=t.getFlatCoordinates(),r=t.getStride();this.drawCoordinates(i,0,i.length,r)},ap.prototype.drawPoint=function(t,e){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var i=t.getFlatCoordinates(),r=t.getStride();this.drawCoordinates(i,0,i.length,r)},ap.prototype.finish=function(t){var e=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices.push(this.indices.length),this.verticesBuffer=new Hc(this.vertices);var i=this.indices;this.indicesBuffer=new Hc(i);var r={};this.createTextures(this.textures_,this.images_,r,e),this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,r,e),this.images_=null,this.hitDetectionImages_=null,sp.prototype.finish.call(this,t)},ap.prototype.setImageStyle=function(t){var e=t.getAnchor(),i=t.getImage(1),r=t.getImageSize(),n=t.getHitDetectionImage(1),o=t.getOpacity(),s=t.getOrigin(),a=t.getRotateWithView(),h=t.getRotation(),l=t.getSize(),u=t.getScale();0===this.images_.length?this.images_.push(i):wt(this.images_[this.images_.length-1])!=wt(i)&&(this.groupIndices.push(this.indices.length),this.images_.push(i)),0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(n):wt(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=wt(n)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(n)),this.anchorX=e[0],this.anchorY=e[1],this.height=l[1],this.imageHeight=r[1],this.imageWidth=r[0],this.opacity=o,this.originX=s[0],this.originY=s[1],this.rotation=h,this.rotateWithView=a,this.scale=u,this.width=l[0]},ap.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_},ap.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var lp=new kc("precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),up=new Gc("
vendor: 5,625 bytes, line 1
1varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n
1"),cp=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_lineWidth=t.getUniformLocation(e,"u_lineWidth"),this.u_miterLimit=t.getUniformLocation(e,"u_miterLimit"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_color=t.getUniformLocation(e,"u_color"),this.u_size=t.getUniformLocation(e,"u_size"),this.u_pixelRatio=t.getUniformLocation(e,"u_pixelRatio"),this.a_lastPos=t.getAttribLocation(e,"a_lastPos"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_nextPos=t.getAttribLocation(e,"a_nextPos"),this.a_direction=t.getAttribLocation(e,"a_direction")},pp=3,dp=5,fp=7,gp=11,_p=13,vp=17,yp=19,mp=23,xp=function(t,e){Bc.call(this,t,e),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,changed:!1}};t(xp,Bc),xp.prototype.drawCoordinates_=function(t,e,i,r){var n,o,s,a,h,l,u,c,p=this,d=this.vertices.length,f=this.indices.length,g="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,_="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,v=hp(t,e,i,r),y=f,m=1;for(n=e,o=i;n<o;n+=r){if(h=d/7,l=u,u=c||[t[n],t[n+1]],n===e){if(c=[t[n+r],t[n+r+1]],i-e==2*r&&Ar(u,c))break;if(!v){_&&(d=p.addVertices_([0,0],u,c,m*fp*_,d),d=p.addVertices_([0,0],u,c,-m*fp*_,d),p.indices[f++]=h+2,p.indices[f++]=h,p.indices[f++]=h+1,p.indices[f++]=h+1,p.indices[f++]=h+3,p.indices[f++]=h+2),d=p.addVertices_([0,0],u,c,m*pp*(_||1),d),y=(d=p.addVertices_([0,0],u,c,-m*pp*(_||1),d))/7-1;continue}l=[t[i-2*r],t[i-2*r+1]],s=c}else{if(n===i-r){if(v){c=s;break}l=l||[0,0],d=p.addVertices_(l,u,[0,0],m*dp*(_||1),d),d=p.addVertices_(l,u,[0,0],-m*dp*(_||1),d),p.indices[f++]=h,p.indices[f++]=y-1,p.indices[f++]=y,p.indices[f++]=y,p.indices[f++]=h+1,p.indices[f++]=h,_&&(d=p.addVertices_(l,u,[0,0],m*gp*_,d),d=p.addVertices_(l,u,[0,0],-m*gp*_,d),p.indices[f++]=h+2,p.indices[f++]=h,p.indices[f++]=h+1,p.indices[f++]=h+1,p.indices[f++]=h+3,p.indices[f++]=h+2);break}c=[t[n+r],t[n+r+1]]}a=Kc(l[0],l[1],u[0],u[1],c[0],c[1])?-1:1,d=p.addVertices_(l,u,c,a*_p*(g||1),d),d=p.addVertices_(l,u,c,a*vp*(g||1),d),d=p.addVertices_(l,u,c,-a*yp*(g||1),d),e<n&&(p.indices[f++]=h,p.indices[f++]=y-1,p.indices[f++]=y,p.indices[f++]=h+2,p.indices[f++]=h,p.indices[f++]=0<m*a?y:y-1),p.indices[f++]=h,p.indices[f++]=h+2,p.indices[f++]=h+1,y=h+2,m=a,g&&(d=p.addVertices_(l,u,c,a*mp*g,d),p.indices[f++]=h+1,p.indices[f++]=h+3,p.indices[f++]=h)}v&&(h=h||d/7,a=_n([l[0],l[1],u[0],u[1],c[0],c[1]],0,6,2)?1:-1,d=this.addVertices_(l,u,c,a*_p*(g||1),d),d=this.addVertices_(l,u,c,-a*yp*(g||1),d),this.indices[f++]=h,this.indices[f++]=y-1,this.indices[f++]=y,this.indices[f++]=h+1,this.indices[f++]=h,this.indices[f++]=0<m*a?y:y-1)}
1,xp.prototype.addVertices_=function(t,e,i,r,n){return this.vertices[n++]=t[0],this.vertices[n++]=t[1],this.vertices[n++]=e[0],this.vertices[n++]=e[1],this.vertices[n++]=i[0],this.vertices[n++]=i[1],this.vertices[n++]=r,n},xp.prototype.isValid_=function(t,e,i,r){var n=i-e;return!(n<2*r)&&(n!==2*r||!Ar([t[e],t[e+1]],[t[e+r],t[e+r+1]]))},xp.prototype.drawLineString=function(t,e){var i=t.getFlatCoordinates(),r=t.getStride();this.isValid_(i,0,i.length,r)&&(i=Ut(i,0,i.length,r,-this.origin[0],-this.origin[1]),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.drawCoordinates_(i,0,i.length,r))},xp.prototype.drawMultiLineString=function(t,e){var i=this.indices.length,r=t.getEnds();r.unshift(0);var n,o,s=t.getFlatCoordinates(),a=t.getStride();if(1<r.length)for(n=1,o=r.length;n<o;++n)if(this.isValid_(s,r[n-1],r[n],a)){var h=Ut(s,r[n-1],r[n],a,-this.origin[0],-this.origin[1]);this.drawCoordinates_(h,0,h.length,a)}this.indices.length>i&&(this.startIndices.push(i),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(i),this.state_.changed=!1))},xp.prototype.drawPolygonCoordinates=function(t,e,i){var r,n;if(hp(t,0,t.length,i)||(t.push(t[0]),t.push(t[1])),this.drawCoordinates_(t,0,t.length,i),e.length)for(r=0,n=e.length;r<n;++r)hp(e[r],0,e[r].length,i)||(e[r].push(e[r][0]),e[r].push(e[r][1])),this.drawCoordinates_(e[r],0,e[r].length,i)},xp.prototype.setPolygonStyle=function(t,e){var i=void 0===e?this.indices.length:e;this.startIndices.push(i),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(i),this.state_.changed=!1)},xp.prototype.getCurrentIndex=function(){return this.indices.length},xp.prototype.finish=function(t){this.verticesBuffer=new Hc(this.vertices),this.indicesBuffer=new Hc(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&0<this.styles_.length&&(this.styles_=[]),this.vertices=null,this.indices=null},xp.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer;return function(){t.deleteBuffer(e),t.deleteBuffer(i)}},xp.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(lp,up);return this.defaultLocations_?n=this.defaultLocations_:(n=new cp(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_lastPos),t.vertexAttribPointer(n.a_lastPos,2,ci,!1,28,0),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,ci,!1,28,8),t.enableVertexAttribArray(n.a_nextPos),t.vertexAttribPointer(n.a_nextPos,2,ci,!1,28,16),t.enableVertexAttribArray(n.a_direction),t.vertexAttribPointer(n.a_direction,1,ci,!1,28,24),t.uniform2fv(n.u_size,i),t.uniform1f(n.u_pixelRatio,r),n},xp.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_lastPos),t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_nextPos),t.disableVertexAttribArray(e.a_direction)},xp.prototype.drawReplay=function(t,e,i,r){var n,o,s,a,h=t.getParameter(t.DEPTH_FUNC),l=t.getParameter(t.DEPTH_WRITEMASK);if(r||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Et(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;0<=n;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setStrokeStyle_(t,a[0],a[1],a[2]),this.drawElements(t,e,o,s),t.clear(t.DEPTH_BUFFER_BIT),s=o;else this.drawReplaySkipping_(t,e,i);r||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(l),t.depthFunc(h))},xp.prototype.drawReplaySkipping_=function(t,e,i){var r,n,o,s,a,h,l;for(h=this.startIndices.length-2,o=n=this.startIndices[h+1],r=this.styleIndices_.length-1;0<=r;--r){for(s=this.styles_[r],this.setStrokeStyle_(t,s[0],s[1],s[2]),a=this.styleIndices_[r];0<=h&&this.startIndices[h]>=a;)l=this.startIndices[h],i[wt(this.startIndicesFeature[h]).toString()]&&(n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),o=l),h--,n=l;n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),n=o=a}}
1,xp.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u,c;for(c=this.startIndices.length-2,a=this.startIndices[c+1],o=this.styleIndices_.length-1;0<=o;--o)for(h=this.styles_[o],this.setStrokeStyle_(t,h[0],h[1],h[2]),l=this.styleIndices_[o];0<=c&&this.startIndices[c]>=l;){if(s=this.startIndices[c],void 0===i[wt(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||Nt(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,s,a);var p=r(u);if(p)return p}c--,a=s}},xp.prototype.setStrokeStyle_=function(t,e,i,r){t.uniform4fv(this.defaultLocations_.u_color,e),t.uniform1f(this.defaultLocations_.u_lineWidth,i),t.uniform1f(this.defaultLocations_.u_miterLimit,r)},xp.prototype.setFillStrokeStyle=function(t,e){var i=e.getLineCap();this.state_.lineCap=void 0!==i?i:"round";var r=e.getLineDash();this.state_.lineDash=r||Xc;var n=e.getLineDashOffset();this.state_.lineDashOffset=n||0;var o=e.getLineJoin();this.state_.lineJoin=void 0!==o?o:"round";var s=e.getColor();s=s instanceof CanvasGradient||s instanceof CanvasPattern?Vc:ti(s).map(function(t,e){return 3!=e?t/255:t})||Vc;var a=e.getWidth();a=void 0!==a?a:1;var h=e.getMiterLimit();h=void 0!==h?h:10,this.state_.strokeColor&&Ar(this.state_.strokeColor,s)&&this.state_.lineWidth===a&&this.state_.miterLimit===h||(this.state_.changed=!0,this.state_.strokeColor=s,this.state_.lineWidth=a,this.state_.miterLimit=h,this.styles_.push([s,a,h]))};var Sp=new kc("precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),Cp=new Gc("\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n"),wp=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_color=t.getUniformLocation(e,"u_color"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.a_position=t.getAttribLocation(e,"a_position")},Ep=function(t){this.first_,this.last_,this.head_,this.circular_=void 0===t||t,this.length_=0};Ep.prototype.insertItem=function(t){var e={prev:void 0,next:void 0,data:t},i=this.head_;if(i){var r=i.next;e.prev=i,e.next=r,i.next=e,r&&(r.prev=e),i===this.last_&&(this.last_=e)}else this.first_=e,this.last_=e,this.circular_&&((e.next=e).prev=e);this.head_=e,this.length_++},Ep.prototype.removeItem=function(){var t=this.head_;if(t){var e=t.next,i=t.prev;e&&(e.prev=i),i&&(i.next=e),this.head_=e||i,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=i?this.head_.prev:this.head_),this.length_--}},Ep.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data},Ep.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data},Ep.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data},Ep.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data},Ep.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data},Ep.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data},Ep.prototype.getCurrItem=function(){if(this.head_)return this.head_.data},Ep.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)},Ep.prototype.concat=function(t){if(t.head_){if(this.head_){var e=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,e.prev=t.last_,t.last_.next=e,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}},Ep.prototype.getLength=function(){return this.length_};var Tp=function(t,e){Bc.call(this,t,e),this.lineStringReplay=new xp(t,e),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={fillColor:null,changed:!1}};
1t(Tp,Bc),Tp.prototype.drawCoordinates_=function(t,e,i){var r=new Ep,n=new Dh;this.processFlatCoordinates_(t,i,r,n,!0);var o=this.getMaxCoords_(r);if(e.length){var s,a,h=[];for(s=0,a=e.length;s<a;++s){var l={list:new Ep,maxCoords:void 0,rtree:new Dh};h.push(l),this.processFlatCoordinates_(e[s],i,l.list,l.rtree,!1),this.classifyPoints_(l.list,l.rtree,!0),l.maxCoords=this.getMaxCoords_(l.list)}for(h.sort(function(t,e){return e.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-e.maxCoords[1]:e.maxCoords[0]-t.maxCoords[0]}),s=0;s<h.length;++s){var u=h[s].list,c=u.firstItem(),p=c,d=void 0;do{if(this.getIntersections_(p,n).length){d=!0;break}p=u.nextItem()}while(c!==p);d||this.bridgeHole_(u,h[s].maxCoords[0],r,o[0],n)&&(n.concat(h[s].rtree),this.classifyPoints_(r,n,!1))}}else this.classifyPoints_(r,n,!1);this.triangulate_(r,n)},Tp.prototype.processFlatCoordinates_=function(t,e,i,r,n){var o,s,a,h,l,u=_n(t,0,t.length,e),c=this.vertices.length/2,p=[],d=[];if(n===u){for(h=a=this.createPoint_(t[0],t[1],c++),o=e,s=t.length;o<s;o+=e)l=this.createPoint_(t[o],t[o+1],c++),d.push(this.insertItem_(h,l,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)]),h=l;d.push(this.insertItem_(l,a,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)])}else{var f=t.length-e;for(h=a=this.createPoint_(t[f],t[f+1],c++),o=f-e,s=0;s<=o;o-=e)l=this.createPoint_(t[o],t[o+1],c++),d.push(this.insertItem_(h,l,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)]),h=l;d.push(this.insertItem_(l,a,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)])}r.load(p,d)},Tp.prototype.getMaxCoords_=function(t){for(var e=t.firstItem(),i=e,r=[i.p0.x,i.p0.y];(i=t.nextItem()).p0.x>r[0]&&(r=[i.p0.x,i.p0.y]),i!==e;);return r},Tp.prototype.classifyPoints_=function(t,e,i){var r=t.firstItem(),n=r,o=t.nextItem(),s=!1;do{var a=i?Kc(o.p1.x,o.p1.y,n.p1.x,n.p1.y,n.p0.x,n.p0.y):Kc(n.p0.x,n.p0.y,n.p1.x,n.p1.y,o.p1.x,o.p1.y);void 0===a?(this.removeItem_(n,o,t,e),s=!0,o===r&&(r=t.getNextItem()),o=n,t.prevItem()):n.p1.reflex!==a&&(n.p1.reflex=a,s=!0),n=o,o=t.nextItem()}while(n!==r);return s},Tp.prototype.bridgeHole_=function(t,e,i,r,n){for(var o=t.firstItem();o.p1.x!==e;)o=t.nextItem();var s,a,h,l,u=o.p1,c={x:r,y:u.y,i:-1},p=1/0,d=this.getIntersections_({p0:u,p1:c},n,!0);for(s=0,a=d.length;s<a;++s){var f=d[s],g=this.calculateIntersection_(u,c,f.p0,f.p1,!0),_=Math.abs(u.x-g[0]);_<p&&void 0!==Kc(u.x,u.y,f.p0.x,f.p0.y,f.p1.x,f.p1.y)&&(p=_,l={x:g[0],y:g[1],i:-1},o=f)}if(p===1/0)return!1;if(h=o.p1,0<p){var v=this.getPointsInTriangle_(u,l,o.p1,n);if(v.length){var y=1/0;for(s=0,a=v.length;s<a;++s){var m=v[s],x=Math.atan2(u.y-m.y,c.x-m.x);(x<y||x===y&&m.x<h.x)&&(y=x,h=m)}}}for(o=i.firstItem();o.p1.x!==h.x||o.p1.y!==h.y;)o=i.nextItem();var S={x:u.x,y:u.y,i:u.i,reflex:void 0},C={x:o.p1.x,y:o.p1.y,i:o.p1.i,reflex:void 0};return t.getNextItem().p0=S,this.insertItem_(u,o.p1,t,n),this.insertItem_(C,S,t,n),o.p1=C,t.setFirstItem(),i.concat(t),!0},Tp.prototype.triangulate_=function(t,e){for(var i=this,r=!1,n=this.isSimple_(t,e);3<t.getLength();)if(n){if(!i.clipEars_(t,e,n,r)&&!i.classifyPoints_(t,e,r)&&!i.resolveSelfIntersections_(t,e,!0))break}else if(!i.clipEars_(t,e,n,r)&&!i.classifyPoints_(t,e,r)&&!i.resolveSelfIntersections_(t,e)){if(!(n=i.isSimple_(t,e))){i.splitPolygon_(t,e);break}r=!i.isClockwise_(t),i.classifyPoints_(t,e,r)}if(3===t.getLength()){var o=this.indices.length;this.indices[o++]=t.getPrevItem().p0.i,this.indices[o++]=t.getCurrItem().p0.i,this.indices[o++]=t.getNextItem().p0.i}},Tp.prototype.clipEars_=function(t,e,i,r){var n,o,s,a=this.indices.length,h=t.firstItem(),l=t.getPrevItem(),u=h,c=t.nextItem(),p=t.getNextItem(),d=!1;do{if(n=u.p0,o=u.p1,s=c.p1,!1===o.reflex){var f=void 0;f=i?0===this.getPointsInTriangle_(n,o,s,e,!0).length:r?this.diagonalIsInside_(p.p1,s,o,n,l.p0):this.diagonalIsInside_(l.p0,n,o,s,p.p1),(i||0===this.getIntersections_({p0:n,p1:s},e).length)&&f&&(i||!1===n.reflex||!1===s.reflex||_n([l.p0.x,l.p0.y,n.x,n.y,o.x,o.y,s.x,s.y,p.p1.x,p.p1.y],0,10,2)===!r)&&(this.indices[a++]=n.i,this.indices[a++]=o.i,this.indices[a++]=s.i,this.removeItem_(u,c,t,e),c===h&&(h=p),d=!0)}l=t.getPrevItem(),u=t.getCurrItem(),c=t.nextItem(),p=t.getNextItem()}while(u!==h&&3<t.getLength());return d}
1,Tp.prototype.resolveSelfIntersections_=function(t,e,i){var r=t.firstItem();t.nextItem();var n=r,o=t.nextItem(),s=!1;do{var a=this.calculateIntersection_(n.p0,n.p1,o.p0,o.p1,i);if(a){var h=!1,l=this.vertices.length,u=this.indices.length,c=l/2,p=t.prevItem();t.removeItem(),e.remove(p),h=p===r;var d=void 0;if(i?(a[0]===n.p0.x&&a[1]===n.p0.y?(t.prevItem(),d=n.p0,o.p0=d,e.remove(n),h=h||n===r):(d=o.p1,n.p1=d,e.remove(o),h=h||o===r),t.removeItem()):(d=this.createPoint_(a[0],a[1],c),n.p1=d,o.p0=d,e.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n),e.update([Math.min(o.p0.x,o.p1.x),Math.min(o.p0.y,o.p1.y),Math.max(o.p0.x,o.p1.x),Math.max(o.p0.y,o.p1.y)],o)),this.indices[u++]=p.p0.i,this.indices[u++]=p.p1.i,this.indices[u++]=d.i,s=!0,h)break}n=t.getPrevItem(),o=t.nextItem()}while(n!==r);return s},Tp.prototype.isSimple_=function(t,e){var i=t.firstItem(),r=i;do{if(this.getIntersections_(r,e).length)return!1;r=t.nextItem()}while(r!==i);return!0},Tp.prototype.isClockwise_=function(t){for(var e=2*t.getLength(),i=new Array(e),r=t.firstItem(),n=r,o=0;i[o++]=n.p0.x,i[o++]=n.p0.y,(n=t.nextItem())!==r;);return _n(i,0,e,2)},Tp.prototype.splitPolygon_=function(t,e){var i=this,r=t.firstItem(),n=r;do{var o=i.getIntersections_(n,e);if(o.length){var s=o[0],a=i.vertices.length/2,h=i.calculateIntersection_(n.p0,n.p1,s.p0,s.p1),l=i.createPoint_(h[0],h[1],a),u=new Ep,c=new Dh;i.insertItem_(l,n.p1,u,c),n.p1=l,e.update([Math.min(n.p0.x,l.x),Math.min(n.p0.y,l.y),Math.max(n.p0.x,l.x),Math.max(n.p0.y,l.y)],n);for(var p=t.nextItem();p!==s;)i.insertItem_(p.p0,p.p1,u,c),e.remove(p),t.removeItem(),p=t.getCurrItem();i.insertItem_(s.p0,l,u,c),s.p0=l,e.update([Math.min(s.p1.x,l.x),Math.min(s.p1.y,l.y),Math.max(s.p1.x,l.x),Math.max(s.p1.y,l.y)],s),i.classifyPoints_(t,e,!1),i.triangulate_(t,e),i.classifyPoints_(u,c,!1),i.triangulate_(u,c);break}n=t.nextItem()}while(n!==r)},Tp.prototype.createPoint_=function(t,e,i){var r=this.vertices.length;return{x:this.vertices[r++]=t,y:this.vertices[r++]=e,i:i,reflex:void 0}},Tp.prototype.insertItem_=function(t,e,i,r){var n={p0:t,p1:e};return i.insertItem(n),r&&r.insert([Math.min(t.x,e.x),Math.min(t.y,e.y),Math.max(t.x,e.x),Math.max(t.y,e.y)],n),n},Tp.prototype.removeItem_=function(t,e,i,r){i.getCurrItem()===e&&(i.removeItem(),t.p1=e.p1,r.remove(e),r.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t))},Tp.prototype.getPointsInTriangle_=function(t,e,i,r,n){for(var o=[],s=r.getInExtent([Math.min(t.x,e.x,i.x),Math.min(t.y,e.y,i.y),Math.max(t.x,e.x,i.x),Math.max(t.y,e.y,i.y)]),a=0,h=s.length;a<h;++a)for(var l in s[a]){var u=s[a][l];"object"!=typeof u||n&&!u.reflex||u.x===t.x&&u.y===t.y||u.x===e.x&&u.y===e.y||u.x===i.x&&u.y===i.y||-1!==o.indexOf(u)||!hn([t.x,t.y,e.x,e.y,i.x,i.y],0,6,2,u.x,u.y)||o.push(u)}return o},Tp.prototype.getIntersections_=function(t,e,i){for(var r=t.p0,n=t.p1,o=e.getInExtent([Math.min(r.x,n.x),Math.min(r.y,n.y),Math.max(r.x,n.x),Math.max(r.y,n.y)]),s=[],a=0,h=o.length;a<h;++a){var l=o[a];t!==l&&(i||l.p0!==n||l.p1!==r)&&this.calculateIntersection_(r,n,l.p0,l.p1,i)&&s.push(l)}return s},Tp.prototype.calculateIntersection_=function(t,e,i,r,n){var o=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==o){var s=((r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x))/o,a=((e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x))/o;if(!n&&Wc<s&&s<1-Wc&&Wc<a&&a<1-Wc||n&&0<=s&&s<=1&&0<=a&&a<=1)return[t.x+s*(e.x-t.x),t.y+s*(e.y-t.y)]}},Tp.prototype.diagonalIsInside_=function(t,e,i,r,n){if(void 0===e.reflex||void 0===r.reflex)return!1;var o=(i.x-r.x)*(e.y-r.y)>(i.y-r.y)*(e.x-r.x),s=(n.x-r.x)*(e.y-r.y)<(n.y-r.y)*(e.x-r.x),a=(t.x-e.x)*(r.y-e.y)>(t.y-e.y)*(r.x-e.x),h=(i.x-e.x)*(r.y-e.y)<(i.y-e.y)*(r.x-e.x),l=r.reflex?s||o:s&&o,u=e.reflex?h||a:h&&a;return l&&u},Tp.prototype.drawMultiPolygon=function(t,e){var i,r,n,o,s=t.getEndss(),a=t.getStride(),h=this.indices.length,l=this.lineStringReplay.getCurrentIndex(),u=t.getFlatCoordinates(),c=0;for(i=0,r=s.length;i<r;++i){var p=s[i];if(0<p.length){var d=Ut(u,c,p[0],a,-this.origin[0],-this.origin[1]);if(d.length){var f=[],g=void 0;for(n=1,o=p.length;n<o;++n)p[n]!==p[n-1]&&(g=Ut(u,p[n-1],p[n],a,-this.origin[0],-this.origin[1]),f.push(g));this.lineStringReplay.drawPolygonCoordinates(d,f,a),this.drawCoordinates_(d,f,a)}}c=p[p.length-1]}this.indices.length>h&&(this.startIndices.push(h),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(h),this.state_.changed=!1)),this.lineStringReplay.getCurrentIndex()>l&&this.lineStringReplay.setPolygonStyle(e,l)},Tp.prototype.drawPolygon=function(t,e){var i=t.getEnds(),r=t.getStride();if(0<i.length){var n=t.getFlatCoordinates().map(Number),o=Ut(n,0,i[0],r,-this.origin[0],-this.origin[1]);if(o.length){var s,a,h,l=[];for(s=1,a=i.length;s<a;++s)i[s]!==i[s-1]&&(h=Ut(n,i[s-1],i[s],r,-this.origin[0],-this.origin[1]),l.push(h));this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.lineStringReplay.setPolygonStyle(e),this.lineStringReplay.drawPolygonCoordinates(o,l,r),this.drawCoordinates_(o,l,r)}}},Tp.prototype.finish=function(t){this.verticesBuffer=new Hc(this.vertices),this.indicesBuffer=new Hc(this.indices),this.startIndices.push(this.indices.length),this.lineStringReplay.finish(t),0===this.styleIndices_.length&&0<this.styles_.length&&(this.styles_=[]),this.vertices=null,this.indices=null},Tp.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer,r=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(e),t.deleteBuffer(i),r()}}
1,Tp.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(Sp,Cp);return this.defaultLocations_?n=this.defaultLocations_:(n=new wp(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,ci,!1,8,0),n},Tp.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position)},Tp.prototype.drawReplay=function(t,e,i,r){var n,o,s,a,h=t.getParameter(t.DEPTH_FUNC),l=t.getParameter(t.DEPTH_WRITEMASK);if(r||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Et(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;0<=n;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setFillStyle_(t,a),this.drawElements(t,e,o,s),s=o;else this.drawReplaySkipping_(t,e,i);r||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(l),t.depthFunc(h))},Tp.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u,c;for(c=this.startIndices.length-2,a=this.startIndices[c+1],o=this.styleIndices_.length-1;0<=o;--o)for(h=this.styles_[o],this.setFillStyle_(t,h),l=this.styleIndices_[o];0<=c&&this.startIndices[c]>=l;){if(s=this.startIndices[c],void 0===i[wt(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||Nt(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,s,a);var p=r(u);if(p)return p}c--,a=s}},Tp.prototype.drawReplaySkipping_=function(t,e,i){var r,n,o,s,a,h,l;for(h=this.startIndices.length-2,o=n=this.startIndices[h+1],r=this.styleIndices_.length-1;0<=r;--r){for(s=this.styles_[r],this.setFillStyle_(t,s),a=this.styleIndices_[r];0<=h&&this.startIndices[h]>=a;)l=this.startIndices[h],i[wt(this.startIndicesFeature[h]).toString()]&&(n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),o=l),h--,n=l;n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),n=o=a}},Tp.prototype.setFillStyle_=function(t,e){t.uniform4fv(this.defaultLocations_.u_color,e)},Tp.prototype.setFillStrokeStyle=function(t,e){var i=t?t.getColor():[0,0,0,0];if(i=i instanceof CanvasGradient||i instanceof CanvasPattern?Yc:ti(i).map(function(t,e){return 3!=e?t/255:t})||Yc,this.state_.fillColor&&Ar(i,this.state_.fillColor)||(this.state_.fillColor=i,this.state_.changed=!0,this.styles_.push(i)),e)this.lineStringReplay.setFillStrokeStyle(null,e);else{var r=new pr({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,r)}};var Rp=function(t,e){this.space_=e,this.emptyBlocks_=[{x:0,y:0,width:t,height:t}],this.entries_={},this.context_=ni(t,t),this.canvas_=this.context_.canvas};Rp.prototype.get=function(t){return this.entries_[t]||null},Rp.prototype.add=function(t,e,i,r,n){for(var o=this,s=0,a=this.emptyBlocks_.length;s<a;++s){var h=o.emptyBlocks_[s];if(h.width>=e+o.space_&&h.height>=i+o.space_){var l={offsetX:h.x+o.space_,offsetY:h.y+o.space_,image:o.canvas_};return o.entries_[t]=l,r.call(n,o.context_,h.x+o.space_,h.y+o.space_),o.split_(s,h,e+o.space_,i+o.space_),l}}return null},Rp.prototype.split_=function(t,e,i,r){var n,o,s=e.width-i;e.height-r<s?(n={x:e.x+i,y:e.y,width:e.width-i,height:e.height},o={x:e.x,y:e.y+r,width:i,height:e.height-r}):(n={x:e.x+i,y:e.y,width:e.width-i,height:r},o={x:e.x,y:e.y+r,width:e.width,height:e.height-r}),this.updateBlocks_(t,n,o)},Rp.prototype.updateBlocks_=function(t,e,i){var r=[t,1];0<e.width&&0<e.height&&r.push(e),0<i.width&&0<i.height&&r.push(i),this.emptyBlocks_.splice.apply(this.emptyBlocks_,r)};var Ip=function(t){var e=t||{};this.currentSize_=void 0!==e.initialSize?e.initialSize:256,this.maxSize_=void 0!==e.maxSize?e.maxSize:void 0!==hi?hi:2048,this.space_=void 0!==e.space?e.space:1,this.atlases_=[new Rp(this.currentSize_,this.space_)],this.currentHitSize_=this.currentSize_,this.hitAtlases_=[new Rp(this.currentHitSize_,this.space_)]};Ip.prototype.getInfo=function(t){var e=this.getInfo_(this.atlases_,t);if(!e)return null;var i=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(e,i)},Ip.prototype.getInfo_=function(t,e){for(var i=0,r=t.length;i<r;++i){var n=t[i].get(e);if(n)return n}return null},Ip.prototype.mergeInfos_=function(t,e){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:e.image}}
1,Ip.prototype.add=function(t,e,i,r,n,o){if(e+this.space_>this.maxSize_||i+this.space_>this.maxSize_)return null;var s=this.add_(!1,t,e,i,r,o);if(!s)return null;var a=void 0!==n?n:F,h=this.add_(!0,t,e,i,a,o);return this.mergeInfos_(s,h)},Ip.prototype.add_=function(t,e,i,r,n,o){var s,a,h,l,u=t?this.hitAtlases_:this.atlases_;for(h=0,l=u.length;h<l;++h){if(a=(s=u[h]).add(e,i,r,n,o))return a;if(!a&&h===l-1){var c=void 0;t?(c=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=c):(c=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=c),s=new Rp(c,this.space_),u.push(s),++l}}return null};var Fp=function(t,e){sp.call(this,t,e),this.images_=[],this.textures_=[],this.measureCanvas_=ni(0,0).canvas,this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.atlases_={},this.currAtlas_=void 0,this.scale=1,this.opacity=1};t(Fp,sp),Fp.prototype.drawText=function(t,e){var i=this;if(this.text_){var r=null,n=2,o=2;switch(t.getType()){case Zt.POINT:case Zt.MULTI_POINT:n=(r=t.getFlatCoordinates()).length,o=t.getStride();break;case Zt.CIRCLE:r=t.getCenter();break;case Zt.LINE_STRING:r=t.getFlatMidpoint();break;case Zt.MULTI_LINE_STRING:n=(r=t.getFlatMidpoints()).length;break;case Zt.POLYGON:r=t.getFlatInteriorPoint();break;case Zt.MULTI_POLYGON:n=(r=t.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var s,a,h,l,u,c,p,d,f=this.currAtlas_,g=this.text_.split("\n"),_=this.getTextSize_(g),v=Math.round(_[0]*this.textAlign_-this.offsetX_),y=Math.round(_[1]*this.textBaseline_-this.offsetY_),m=this.state_.lineWidth/2*this.state_.scale;for(s=0,a=g.length;s<a;++s)for(u=0,c=f.height*s,h=0,l=(p=g[s].split("")).length;h<l;++h){if(d=f.atlas.getInfo(p[h])){var x=d.image;if(i.anchorX=v-u,i.anchorY=y-c,i.originX=0===h?d.offsetX-m:d.offsetX,i.originY=d.offsetY,i.height=f.height,i.width=0===h||h===p.length-1?f.width[p[h]]+m:f.width[p[h]],i.imageHeight=x.height,i.imageWidth=x.width,0===i.images_.length)i.images_.push(x);else wt(i.images_[i.images_.length-1])!=wt(x)&&(i.groupIndices.push(i.indices.length),i.images_.push(x));i.drawText_(r,0,n,o)}u+=i.width}}},Fp.prototype.getTextSize_=function(t){var o=this,s=this.currAtlas_,e=t.length*s.height;return[t.map(function(t){for(var e=0,i=0,r=t.length;i<r;++i){var n=t[i];s.width[n]||o.addCharToAtlas_(n),e+=s.width[n]?s.width[n]:0}return e}).reduce(function(t,e){return Math.max(t,e)}),e]},Fp.prototype.drawText_=function(t,e,i,r){for(var n=e,o=i;n<o;n+=r)this.drawCoordinates(t,e,i,r)},Fp.prototype.addCharToAtlas_=function(r){if(1===r.length){var t=this.currAtlas_,n=this.state_,e=this.measureCanvas_.getContext("2d");e.font=n.font;var i=Math.ceil(e.measureText(r).width*n.scale);t.atlas.add(r,i,t.height,function(t,e,i){t.font=n.font,t.fillStyle=n.fillColor,t.strokeStyle=n.strokeColor,t.lineWidth=n.lineWidth,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.miterLimit=n.miterLimit,t.textAlign="left",t.textBaseline="top",Li&&n.lineDash&&(t.setLineDash(n.lineDash),t.lineDashOffset=n.lineDashOffset),1!==n.scale&&t.setTransform(n.scale,0,0,n.scale,0,0),n.strokeColor&&t.strokeText(r,e,i),n.fillColor&&t.fillText(r,e,i)})&&(t.width[r]=i)}},Fp.prototype.finish=function(t){var e=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices=this.groupIndices,this.verticesBuffer=new Hc(this.vertices),this.indicesBuffer=new Hc(this.indices);this.createTextures(this.textures_,this.images_,{},e),this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.images_=null,this.atlases_={},this.currAtlas_=void 0,sp.prototype.finish.call(this,t)},Fp.prototype.setTextStyle=function(t){var e=this.state_,i=t.getFill(),r=t.getStroke();if(t&&t.getText()&&(i||r)){if(i){var n=i.getColor();e.fillColor=ri(n||Yc)}else e.fillColor=null;if(r){var o=r.getColor();e.strokeColor=ri(o||Vc),e.lineWidth=r.getWidth()||1,e.lineCap=r.getLineCap()||"round",e.lineDashOffset=r.getLineDashOffset()||0,e.lineJoin=r.getLineJoin()||"round",e.miterLimit=r.getMiterLimit()||10;var s=r.getLineDash();e.lineDash=s?s.slice():Xc}else e.strokeColor=null,e.lineWidth=0;e.font=t.getFont()||"10px sans-serif",e.scale=t.getScale()||1,this.text_=t.getText();wu[t.getTextAlign()],wu[t.getTextBaseline()];this.textAlign_=.5,this.textBaseline_=.5,this.offsetX_=t.getOffsetX()||0,this.offsetY_=t.getOffsetY()||0,this.rotateWithView=!!t.getRotateWithView(),this.rotation=t.getRotation()||0,this.currAtlas_=this.getAtlas_(e)}else this.text_=""},Fp.prototype.getAtlas_=function(t){var e=[];for(var i in t)(t[i]||0===t[i])&&(Array.isArray(t[i])?e=e.concat(t[i]):e.push(t[i]));var r=this.calculateHash_(e);if(!this.atlases_[r]){var n=this.measureCanvas_.getContext("2d");n.font=t.font;var o=Math.ceil((1.5*n.measureText("M").width+t.lineWidth/2)*t.scale);this.atlases_[r]={atlas:new Ip({space:t.lineWidth+1}),width:{},height:o}}return this.atlases_[r]},Fp.prototype.calculateHash_=function(t){for(var e="",i=0,r=t.length;i<r;++i)e+=t[i];return e},Fp.prototype.getTextures=function(t){return this.textures_},Fp.prototype.getHitDetectionTextures=function(){return this.textures_};var Lp=[1,1],Pp={Circle:qc,Image:ap,LineString:xp,Polygon:Tp,Text:Fp}
1,Mp=function(t,e,i){iu.call(this),this.maxExtent_=e,this.tolerance_=t,this.renderBuffer_=i,this.replaysByZIndex_={}};t(Mp,iu),Mp.prototype.addDeclutter=function(t,e){},Mp.prototype.getDeleteResourcesFunction=function(t){var e,n=[];for(e in this.replaysByZIndex_){var i=this.replaysByZIndex_[e];for(var r in i)n.push(i[r].getDeleteResourcesFunction(t))}return function(){for(var t,e=arguments,i=n.length,r=0;r<i;r++)t=n[r].apply(this,e);return t}},Mp.prototype.finish=function(t){var e;for(e in this.replaysByZIndex_){var i=this.replaysByZIndex_[e];for(var r in i)i[r].finish(t)}},Mp.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[e];void 0===n&&(n=new Pp[e](this.tolerance_,this.maxExtent_),r[e]=n);return n},Mp.prototype.isEmpty=function(){return Et(this.replaysByZIndex_)},Mp.prototype.replay=function(t,e,i,r,n,o,s,a){var h,l,u,c,p,d,f=Object.keys(this.replaysByZIndex_).map(Number);for(f.sort(Lr),h=0,l=f.length;h<l;++h)for(p=this.replaysByZIndex_[f[h].toString()],u=0,c=Cu.length;u<c;++u)void 0!==(d=p[Cu[u]])&&d.replay(t,e,i,r,n,o,s,a,void 0,!1)},Mp.prototype.replayHitDetection_=function(t,e,i,r,n,o,s,a,h,l,u){var c,p,d,f,g,_,v=Object.keys(this.replaysByZIndex_).map(Number);for(v.sort(function(t,e){return e-t}),c=0,p=v.length;c<p;++c)for(f=this.replaysByZIndex_[v[c].toString()],d=Cu.length-1;0<=d;--d)if(void 0!==(g=f[Cu[d]])&&(_=g.replay(t,e,i,r,n,o,s,a,h,l,u)))return _},Mp.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s,a,h,l){var u,c=e.getGL();return c.bindFramebuffer(c.FRAMEBUFFER,e.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(u=rt(dt(t),r*this.renderBuffer_)),this.replayHitDetection_(e,t,r,n,Lp,s,a,h,function(t){var e=new Uint8Array(4);if(c.readPixels(0,0,1,1,c.RGBA,c.UNSIGNED_BYTE,e),0<e[3]){var i=l(t);if(i)return i}},!0,u)},Mp.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n,o,s,a,h){var l=e.getGL();return l.bindFramebuffer(l.FRAMEBUFFER,e.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(e,t,r,n,Lp,s,a,h,function(t){var e=new Uint8Array(4);return l.readPixels(0,0,1,1,l.RGBA,l.UNSIGNED_BYTE,e),0<e[3]},!1)};var bp=function(t,e,i,r,n,o,s){Ul.call(this),this.context_=t,this.center_=e,this.extent_=o,this.pixelRatio_=s,this.size_=n,this.rotation_=r,this.resolution_=i,this.imageStyle_=null,this.fillStyle_=null,this.strokeStyle_=null,this.textStyle_=null};t(bp,Ul),bp.prototype.drawText_=function(t,e){var i=this.context_,r=t.getReplay(0,ru.TEXT);r.setTextStyle(this.textStyle_),r.drawText(e,null),r.finish(i);r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),r.getDeleteResourcesFunction(i)()},bp.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},bp.prototype.drawGeometry=function(t){switch(t.getType()){case Zt.POINT:this.drawPoint(t,null);break;case Zt.LINE_STRING:this.drawLineString(t,null);break;case Zt.POLYGON:this.drawPolygon(t,null);break;case Zt.MULTI_POINT:this.drawMultiPoint(t,null);break;case Zt.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case Zt.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case Zt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case Zt.CIRCLE:this.drawCircle(t,null)}},bp.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Nt(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},bp.prototype.drawGeometryCollection=function(t,e){var i,r,n=t.getGeometriesArray();for(i=0,r=n.length;i<r;++i)this.drawGeometry(n[i])},bp.prototype.drawPoint=function(t,e){var i=this.context_,r=new Mp(1,this.extent_),n=r.getReplay(0,ru.IMAGE);n.setImageStyle(this.imageStyle_),n.drawPoint(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},bp.prototype.drawMultiPoint=function(t,e){var i=this.context_,r=new Mp(1,this.extent_),n=r.getReplay(0,ru.IMAGE);n.setImageStyle(this.imageStyle_),n.drawMultiPoint(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},bp.prototype.drawLineString=function(t,e){var i=this.context_,r=new Mp(1,this.extent_),n=r.getReplay(0,ru.LINE_STRING);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawLineString(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},bp.prototype.drawMultiLineString=function(t,e){var i=this.context_,r=new Mp(1,this.extent_),n=r.getReplay(0,ru.LINE_STRING);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawMultiLineString(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},bp.prototype.drawPolygon=function(t,e){var i=this.context_,r=new Mp(1,this.extent_),n=r.getReplay(0,ru.POLYGON);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawPolygon(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},bp.prototype.drawMultiPolygon=function(t,e){var i=this.context_,r=new Mp(1,this.extent_),n=r.getReplay(0,ru.POLYGON);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawMultiPolygon(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},bp.prototype.drawCircle=function(t,e){var i=this.context_,r=new Mp(1,this.extent_),n=r.getReplay(0,ru.CIRCLE);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawCircle(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},bp.prototype.setImageStyle=function(t){this.imageStyle_=t},bp.prototype.setFillStrokeStyle=function(t,e){this.fillStyle_=t,this.strokeStyle_=e},bp.prototype.setTextStyle=function(t){this.textStyle_=t};var Op=new kc("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n"),Np=new Gc("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n"),Ap=function(t,e){this.u_texCoordMatrix=t.getUniformLocation(e,"u_texCoordMatrix"),this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_texture=t.getUniformLocation(e,"u_texture"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord")},kp=function(t,e){Hl.call(this,e),this.mapRenderer=t,this.arrayBuffer_=ne
1w Hc([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0,this.texCoordMatrix=[1,0,0,1,0,0],this.projectionMatrix=[1,0,0,1,0,0],this.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.defaultLocations_=null};t(kp,Hl),kp.prototype.bindFramebuffer=function(t,e){var i=this.mapRenderer.getGL();if(void 0===this.framebufferDimension||this.framebufferDimension!=e){var r=function(t,e,i){t.isContextLost()||(t.deleteFramebuffer(e),t.deleteTexture(i))}.bind(null,i,this.framebuffer,this.texture);t.postRenderFunctions.push(r);var n=np(i,e,e),o=i.createFramebuffer();i.bindFramebuffer(_i,o),i.framebufferTexture2D(_i,36064,fi,n,0),this.texture=n,this.framebuffer=o,this.framebufferDimension=e}else i.bindFramebuffer(_i,this.framebuffer)},kp.prototype.composeFrame=function(t,e,i){this.dispatchComposeEvent_(Vn,i,t),i.bindBuffer(ui,this.arrayBuffer_);var r,n=i.getGL(),o=i.getProgram(Op,Np);this.defaultLocations_?r=this.defaultLocations_:(r=new Ap(n,o),this.defaultLocations_=r),i.useProgram(o)&&(n.enableVertexAttribArray(r.a_position),n.vertexAttribPointer(r.a_position,2,ci,!1,16,0),n.enableVertexAttribArray(r.a_texCoord),n.vertexAttribPointer(r.a_texCoord,2,ci,!1,16,8),n.uniform1i(r.u_texture,0)),n.uniformMatrix4fv(r.u_texCoordMatrix,!1,zc(this.tmpMat4_,this.getTexCoordMatrix())),n.uniformMatrix4fv(r.u_projectionMatrix,!1,zc(this.tmpMat4_,this.getProjectionMatrix())),n.uniform1f(r.u_opacity,e.opacity),n.bindTexture(fi,this.getTexture()),n.drawArrays(5,0,4),this.dispatchComposeEvent_(Xn,i,t)},kp.prototype.dispatchComposeEvent_=function(t,e,i){var r=this.getLayer();if(r.hasListener(t)){var n=i.viewState,o=n.resolution,s=i.pixelRatio,a=i.extent,h=n.center,l=n.rotation,u=i.size,c=new bp(e,h,o,l,u,a,s),p=new Dl(t,c,i,null,e);r.dispatchEvent(p)}},kp.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},kp.prototype.getTexture=function(){return this.texture},kp.prototype.getProjectionMatrix=function(){return this.projectionMatrix},kp.prototype.handleWebGLContextLost=function(){this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0},kp.prototype.prepareFrame=function(t,e,i){},kp.prototype.forEachLayerAtPixel=function(t,e,i,r){};var Gp=function(t,e){kp.call(this,t,e),this.image_=null,this.hitCanvasContext_=null,this.hitTransformationMatrix_=null};t(Gp,kp),Gp.handles=function(t){return t.getType()===ah.IMAGE},Gp.create=function(t,e){return new Gp(t,e)},Gp.prototype.createTexture_=function(t){var e=t.getImage();return op(this.mapRenderer.getGL(),e,gi,gi)},Gp.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var o=this.getLayer(),s=o.getSource(),a=e.viewState.resolution,h=e.viewState.rotation,l=e.skippedFeatureUids;return s.forEachFeatureAtCoordinate(t,a,h,i,l,function(t){return r.call(n,t,o)})},Gp.prototype.prepareFrame=function(t,e,i){var r=this.mapRenderer.getGL(),n=t.pixelRatio,o=t.viewState,s=o.center,a=o.resolution,h=o.rotation,l=this.image_,u=this.texture,c=this.getLayer().getSource(),p=t.viewHints,d=t.extent;if(void 0!==e.extent&&(d=Pt(d,e.extent)),!p[ts]&&!p[es]&&!At(d)){var f=o.projection,g=c.getImage(d,a,n,f);if(g)if(this.loadImage(g)&&(l=g,u=this.createTexture_(g),this.texture)){var _=function(t,e){t.isContextLost()||t.deleteTexture(e)}.bind(null,r,this.texture);t.postRenderFunctions.push(_)}}if(l){var v=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(v.width,v.height,n,s,a,h,l.getExtent()),this.hitTransformationMatrix_=null;var y=this.texCoordMatrix;ke(y),Be(y,1,-1),Ye(y,0,-1),this.image_=l,this.texture=u}return!!l},Gp.prototype.updateProjectionMatrix_=function(t,e,i,r,n,o,s){var a=t*n,h=e*n,l=this.projectionMatrix;ke(l),Be(l,2*i/a,2*i/h),ze(l,-o),Ye(l,s[0]-r[0],s[1]-r[1]),Be(l,(s[2]-s[0])/2,(s[3]-s[1])/2),Ye(l,1,1)},Gp.prototype.hasFeatureAtCoordinate=function(t,e){return void 0!==this.forEachFeatureAtCoordinate(t,e,0,v,this)},Gp.prototype.forEachLayerAtPixel=function(t,e,i,r){if(this.image_&&this.image_.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==F){var n=je(e.pixelToCoordinateTransform,t.slice());return this.forEachFeatureAtCoordinate(n,e,0,v,this)?i.call(r,this.getLayer(),null):void 0}var o=[this.image_.getImage().width,this.image_.getImage().height];this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(e.size,o));var s=je(this.hitTransformationMatrix_,t.slice());if(!(s[0]<0||s[0]>o[0]||s[1]<0||s[1]>
1o[1])){this.hitCanvasContext_||(this.hitCanvasContext_=ni(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),s[0],s[1],1,1,0,0,1,1);var a=this.hitCanvasContext_.getImageData(0,0,1,1).data;return 0<a[3]?i.call(r,this.getLayer(),a):void 0}}},Gp.prototype.getHitTransformationMatrix_=function(t,e){var i=[1,0,0,1,0,0];Ye(i,-1,-1),Be(i,2/t[0],2/t[1]),Ye(i,0,t[1]),Be(i,1,-1);var r=Ve(this.projectionMatrix.slice()),n=[1,0,0,1,0,0];return Ye(n,0,e[1]),Be(n,1,-1),Be(n,e[0]/2,e[1]/2),Ye(n,1,1),Ge(n,r),Ge(n,i),n};var Dp=function(t){Xl.call(this,t);var e=t.getViewport();this.canvas_=document.createElement("CANVAS"),this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=ki,e.insertBefore(this.canvas_,e.childNodes[0]||null),this.clipTileCanvasWidth_=0,this.clipTileCanvasHeight_=0,this.clipTileContext_=ni(),this.renderedVisible_=!0,this.gl_=yi(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.context_=new ip(this.canvas_,this.gl_),S(this.canvas_,tp,this.handleWebGLContextLost,this),S(this.canvas_,ep,this.handleWebGLContextRestored,this),this.textureCache_=new ji,this.focus_=null,this.tileTextureQueue_=new Ko(function(t){var e=t[1],i=t[2],r=e[0]-this.focus_[0],n=e[1]-this.focus_[1];return 65536*Math.log(i)+Math.sqrt(r*r+n*n)/i}.bind(this),function(t){return t[0].getKey()}),this.loadNextTileTexture_=function(t,e){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var i=this.tileTextureQueue_.dequeue(),r=i[0],n=i[3],o=i[4];this.bindTileTexture(r,n,o,9729,9729)}return!1}.bind(this),this.textureCacheFrameMarkerCount_=0,this.initializeGL_()};t(Dp,Xl),Dp.prototype.bindTileTexture=function(t,e,i,r,n){var o=this.getGL(),s=t.getKey();if(this.textureCache_.containsKey(s)){var a=this.textureCache_.get(s);o.bindTexture(fi,a.texture),a.magFilter!=r&&(o.texParameteri(fi,10240,r),a.magFilter=r),a.minFilter!=n&&(o.texParameteri(fi,10241,n),a.minFilter=n)}else{var h=o.createTexture();if(o.bindTexture(fi,h),0<i){var l=this.clipTileContext_.canvas,u=this.clipTileContext_;this.clipTileCanvasWidth_!==e[0]||this.clipTileCanvasHeight_!==e[1]?(l.width=e[0],l.height=e[1],this.clipTileCanvasWidth_=e[0],this.clipTileCanvasHeight_=e[1]):u.clearRect(0,0,e[0],e[1]),u.drawImage(t.getImage(),i,i,e[0],e[1],0,0,e[0],e[1]),o.texImage2D(fi,0,6408,6408,5121,l)}else o.texImage2D(fi,0,6408,6408,5121,t.getImage());o.texParameteri(fi,10240,r),o.texParameteri(fi,10241,n),o.texParameteri(fi,pi,gi),o.texParameteri(fi,di,gi),this.textureCache_.set(s,{texture:h,magFilter:r,minFilter:n})}},Dp.prototype.dispatchComposeEvent_=function(t,e){var i=this.getMap();if(i.hasListener(t)){var r=this.context_,n=e.extent,o=e.size,s=e.viewState,a=e.pixelRatio,h=s.resolution,l=s.center,u=s.rotation,c=new bp(r,l,h,u,o,n,a),p=new Dl(t,c,e,null,r);i.dispatchEvent(p)}},Dp.prototype.disposeInternal=function(){var e=this.getGL();e.isContextLost()||this.textureCache_.forEach(function(t){t&&e.deleteTexture(t.texture)}),this.context_.dispose(),Xl.prototype.disposeInternal.call(this)},Dp.prototype.expireCache_=function(t,e){for(var i,r=this.getGL();1024<this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_;){if(i=this.textureCache_.peekLast())r.deleteTexture(i.texture);else{if(+this.textureCache_.peekLastKey()==e.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},Dp.prototype.getContext=function(){return this.context_},Dp.prototype.getGL=function(){return this.gl_},Dp.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},Dp.prototype.handleWebGLContextLost=function(t){t.preventDefault(),this.textureCache_.clear(),this.textureCacheFrameMarkerCount_=0;var e=this.getLayerRenderers();for(var i in e){e[i].handleWebGLContextLost()}},Dp.prototype.handleWebGLContextRestored=function(){this.initializeGL_(),this.getMap().render()},Dp.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(33984),t.blendFuncSeparate(770,771,1,771),t.disable(2884),t.disable(2929),t.disable(3089),t.disable(2960)},Dp.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())},Dp.prototype.renderFrame=function(t){var e=this.getContext(),i=this.getGL();if(i.isContextLost())return!1;if(!t)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;this.focus_=t.focus,this.textureCache_.set((-t.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchComposeEvent_(Vn,t);var r=[],n=t.layerStatesArray;kr(n,Wl);var o,s,a,h=t.viewState.resolution;for(o=0,s=n.length;o<s;++o)Is(a=n[o],h)&&a.sourceState==vs&&this.getLayerRenderer(a.layer).prepareFrame(t,a,e)&&r.push(a);var l=t.size[0]*t.pixelRatio,u=t.size[1]*t.pixelRatio;for(this.canvas_.width==l&&this.canvas_.height==u||(this.canvas_.width=l,this.canvas_.height=u),i.bindFramebuffer(_i,null),i.clearColor(0,0,0,0),i.clear(16384),i.enable(3042),i.viewport(0,0,this.canvas_.width,this.canvas_.height),o=0,s=r.length;o<s;++o)a=r[o],this.getLayerRenderer(a.layer).composeFrame(t,a,e);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.calculateMatrices2D(t),1024<this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_&&t.postRenderFunctions.push(this.expireCache_.bind(this)),this.tileTextureQueue_.isEmpty()||(t.postRenderFunctions.push(this.loadNextTileTexture_),t.animate=!0),this.dispatchComposeEvent_(Xn,t),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}
1,Dp.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s){var a;if(this.getGL().isContextLost())return!1;var h,l=e.viewState,u=e.layerStatesArray;for(h=u.length-1;0<=h;--h){var c=u[h],p=c.layer;if(Is(c,l.resolution)&&o.call(s,p))if(a=this.getLayerRenderer(p).forEachFeatureAtCoordinate(t,e,i,r,n))return a}},Dp.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n){var o=!1;if(this.getGL().isContextLost())return!1;var s,a=e.viewState,h=e.layerStatesArray;for(s=h.length-1;0<=s;--s){var l=h[s],u=l.layer;if(Is(l,a.resolution)&&r.call(n,u))if(o=this.getLayerRenderer(u).hasFeatureAtCoordinate(t,e))return!0}return o},Dp.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){if(this.getGL().isContextLost())return!1;var a,h,l=e.viewState,u=e.layerStatesArray;for(h=u.length-1;0<=h;--h){var c=u[h],p=c.layer;if(Is(c,l.resolution)&&o.call(n,p))if(a=this.getLayerRenderer(p).forEachLayerAtPixel(t,e,r,n))return a}};var Up=new kc("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n"),jp=new Gc("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n"),zp=function(t,e){this.u_tileOffset=t.getUniformLocation(e,"u_tileOffset"),this.u_texture=t.getUniformLocation(e,"u_texture"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord")},Bp=function(t,e){kp.call(this,t,e),this.fragmentShader_=Up,this.vertexShader_=jp,this.locations_=null,this.renderArrayBuffer_=new Hc([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,this.tmpSize_=[0,0]};t(Bp,kp),Bp.handles=function(t){return t.getType()===ah.TILE},Bp.create=function(t,e){return new Bp(t,e)},Bp.prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_),kp.prototype.disposeInternal.call(this)},Bp.prototype.createLoadedTileFinder=function(e,r,n){var o=this.mapRenderer;return function(i,t){return e.forEachLoadedTile(r,i,t,function(t){var e=o.isTileTextureLoaded(t);return e&&(n[i]||(n[i]={}),n[i][t.tileCoord.toString()]=t),e})}},Bp.prototype.handleWebGLContextLost=function(){kp.prototype.handleWebGLContextLost.call(this),this.locations_=null},Bp.prototype.prepareFrame=function(t,e,i){var r,n,o=this.mapRenderer,s=i.getGL(),a=t.viewState,h=a.projection,l=this.getLayer(),u=l.getSource(),c=u.getTileGridForProjection(h),p=c.getZForResolution(a.resolution),d=c.getResolution(p),f=u.getTilePixelSize(p,t.pixelRatio,h),g=f[0]/ws(c.getTileSize(p),this.tmpSize_)[0],_=d/g,v=u.getTilePixelRatio(g)*u.getGutter(h),y=a.center,m=t.extent,x=c.getTileRangeForExtentAndZ(m,p);if(this.renderedTileRange_&&this.renderedTileRange_.equals(x)&&this.renderedRevision_==u.getRevision())r=this.renderedFramebufferExtent_;else{var S=x.getSize(),C=Math.max(S[0]*f[0],S[1]*f[1]),w=($(0<(n=C),29),Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))),E=_*w,T=c.getOrigin(p),R=T[0]+x.minX*f[0]*_,I=T[1]+x.minY*f[1]*_;r=[R,I,R+E,I+E],this.bindFramebuffer(t,w),s.viewport(0,0,w,w),s.clearColor(0,0,0,0),s.clear(16384),s.disable(3042);var F=i.getProgram(this.fragmentShader_,this.vertexShader_);i.useProgram(F),this.locations_||(this.locations_=new zp(s,F)),i.bindBuffer(ui,this.renderArrayBuffer_),s.enableVertexAttribArray(this.locations_.a_position),s.vertexAttribPointer(this.locations_.a_position,2,ci,!1,16,0),s.enableVertexAttribArray(this.locations_.a_texCoord),s.vertexAttribPointer(this.locations_.a_texCoord,2,ci,!1,16,8),s.uniform1i(this.locations_.u_texture,0);var L={};L[p]={};var P,M,b,O,N,A,k=this.createLoadedTileFinder(u,h,L),G=l.getUseInterimTilesOnError(),D=!0,U=[1/0,1/0,-1/0,-1/0],j=new $l(0,0,0,0);for(O=x.minX;O<=x.maxX;++O)for(N=x.minY;N<=x.maxY;++N)if(M=u.getTile(p,O,N,g,h),void 0===e.extent||Nt(A=c.getTileCoordExtent(M.tileCoord,U),e.extent)){if((b=M.getState())==ro||b==oo||b==no&&!G||(M=M.getInterimTile()),(b=M.getState())==ro){if(o.isTileTextureLoaded(M)){L[p][M.tileCoord.toString()]=M;continue}}else if(b==oo||b==no&&!G)continue;
1D=!1,c.forEachTileCoordParentTileRange(M.tileCoord,k,null,j,U)||(P=c.getTileCoordChildTileRange(M.tileCoord,j,U))&&k(p+1,P)}var z=Object.keys(L).map(Number);z.sort(Lr);for(var B=new Float32Array(4),Y=0,X=z.length;Y<X;++Y){var V=L[z[Y]];for(var W in V)M=V[W],A=c.getTileCoordExtent(M.tileCoord,U),B[0]=2*(A[2]-A[0])/E,B[1]=2*(A[3]-A[1])/E,B[2]=2*(A[0]-r[0])/E-1,B[3]=2*(A[1]-r[1])/E-1,s.uniform4fv(this.locations_.u_tileOffset,B),o.bindTileTexture(M,f,v*g,9729,9729),s.drawArrays(5,0,4)}D?(this.renderedTileRange_=x,this.renderedFramebufferExtent_=r,this.renderedRevision_=u.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,t.animate=!0)}this.updateUsedTiles(t.usedTiles,u,p,x);var K=o.getTileTextureQueue();this.manageTilePyramid(t,u,c,g,h,m,p,l.getPreload(),function(t){t.getState()!=ro||o.isTileTextureLoaded(t)||K.isKeyQueued(t.getKey())||K.enqueue([t,c.getTileCoordCenter(t.tileCoord),c.getResolution(t.tileCoord[0]),f,v*g])},this),this.scheduleExpireCache(t,u);var Z=this.texCoordMatrix;return ke(Z),Ye(Z,(Math.round(y[0]/d)*d-r[0])/(r[2]-r[0]),(Math.round(y[1]/d)*d-r[1])/(r[3]-r[1])),0!==a.rotation&&ze(Z,a.rotation),Be(Z,t.size[0]*a.resolution/(r[2]-r[0]),t.size[1]*a.resolution/(r[3]-r[1])),Ye(Z,-.5,-.5),!0},Bp.prototype.forEachLayerAtPixel=function(t,e,i,r){if(this.framebuffer){var n=[t[0]/e.size[0],(e.size[1]-t[1])/e.size[1]],o=je(this.texCoordMatrix,n.slice()),s=[o[0]*this.framebufferDimension,o[1]*this.framebufferDimension],a=this.mapRenderer.getContext().getG
1L();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var h=new Uint8Array(4);return a.readPixels(s[0],s[1],1,1,a.RGBA,a.UNSIGNED_BYTE,h),0<h[3]?i.call(r,this.getLayer(),h):void 0}};var Yp=function(t,e){kp.call(this,t,e),this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.layerState_=null};t(Yp,kp),Yp.handles=function(t){return t.getType()===ah.VECTOR},Yp.create=function(t,e){return new Yp(t,e)},Yp.prototype.composeFrame=function(t,e,i){this.layerState_=e;var r=t.viewState,n=this.replayGroup_,o=t.size,s=t.pixelRatio,a=this.mapRenderer.getGL();n&&!n.isEmpty()&&(a.enable(a.SCISSOR_TEST),a.scissor(0,0,o[0]*s,o[1]*s),n.replay(i,r.center,r.resolution,r.rotation,o,s,e.opacity,e.managed?t.skippedFeatureUids:{}),a.disable(a.SCISSOR_TEST))},Yp.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var e=this.mapRenderer.getContext();t.getDeleteResourcesFunction(e)(),this.replayGroup_=null}kp.prototype.disposeInternal.call(this)},Yp.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){if(this.replayGroup_&&this.layerState_){var o=this.mapRenderer.getContext(),s=e.viewState,a=this.getLayer(),h=this.layerState_,l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s.center,s.resolution,s.rotation,e.size,e.pixelRatio,h.opacity,{},function(t){var e=wt(t).toString();if(!(e in l))return l[e]=!0,r.call(n,t,a)})}},Yp.prototype.hasFeatureAtCoordinate=function(t,e){if(this.replayGroup_&&this.layerState_){var i=this.mapRenderer.getContext(),r=e.viewState,n=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,i,r.center,r.resolution,r.rotation,e.size,e.pixelRatio,n.opacity,e.skippedFeatureUids)}return!1},Yp.prototype.forEachLayerAtPixel=function(t,e,i,r){var n=je(e.pixelToCoordinateTransform,t.slice());return this.hasFeatureAtCoordinate(n,e)?i.call(r,this.getLayer(),null):void 0},Yp.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},Yp.prototype.prepareFrame=function(t,e,i){var n=this.getLayer(),r=n.getSource(),o=t.viewHints[ts],s=t.viewHints[es],a=n.getUpdateWhileAnimating(),h=n.getUpdateWhileInteracting();if(!this.dirty_&&!a&&o||!h&&s)return!0;var l=t.extent,u=t.viewState,c=u.projection,p=u.resolution,d=t.pixelRatio,f=n.getRevision(),g=n.getRenderBuffer(),_=n.getRenderOrder();void 0===_&&(_=Du);var v=rt(l,g*p);if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==f&&this.renderedRenderOrder_==_&&at(this.renderedExtent_,v))return!0;this.replayGroup_&&t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(i)),this.dirty_=!1;var y=new Mp(ju(p,d),v,n.getRenderBuffer());r.loadFeatures(v,p,c);var m=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,p)),e){var r=this.renderFeature(t,p,d,e,y);this.dirty_=this.dirty_||r}};if(_){var x=[];r.forEachFeatureInExtent(v,function(t){x.push(t)},this),x.sort(_),x.forEach(m.bind(this))}else r.forEachFeatureInExtent(v,m,this);return y.finish(i),this.renderedResolution_=p,this.renderedRevision_=f,this.renderedRenderOrder_=_,this.renderedExtent_=v,this.replayGroup_=y,!0},Yp.prototype.renderFeature=function(t,e,i,r,n){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=r.length-1;0<=s;--s)o=zu(n,t,r[s],Uu(e,i),this.handleStyleImageChange_,this)||o;else o=zu(n,t,r,Uu(e,i),this.handleStyleImageChange_,this)||o;return o};var Xp=function(t){(t=C({},t)).controls||(t.controls=Os()),t.interactions||(t.interactions=kl()),Es.call(this,t)};t(Xp,Es),Xp.prototype.createRenderer=function(){var t=new Dp(this);return t.registerLayerRenderers([Gp,Bp,Yp]),t};var Vp="projection",Wp="coordinateFormat",Kp=function(t){var e=t||{},i=document.createElement("DIV");i.className=void 0!==e.className?e.className:"ol-mouse-position",Ts.call(this,{element:i,render:e.render||Zp,target:e.target}),S(this,H(Vp),this.handleProjectionChanged_,this),e.coordinateFormat&&this.setCoordinateFormat(e.coordinateFormat),e.projection&&this.setProjection(e.projection),this.undefinedHTML_="undefinedHTML"in e?e.undefinedHTML:" ",this.renderOnMouseOut_=!!this.undefinedHTML_,this.renderedHTML_=i.innerHTML,this.mapProjection_=null,this.transform_=null,this.lastMouseMovePixel_=null};function Zp(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null,this.updateHTML_(this.lastMouseMovePixel_)}t(Kp,Ts),Kp.prototype.handleProjectionChanged_=function(){this.transform_=null},Kp.prototype.getCoordinateFormat=function(){return this.get(Wp)},Kp.prototype.getProjection=function(){return this.get(Vp)},Kp.prototype.handleMouseMove=function(t){var e=this.getMap();this.lastMouseMovePixel_=e.getEventPixel(t),this.updateHTML_(this.lastMouseMovePixel_)},Kp.prototype.handleMouseOut=function(t){this.updateHTML_(null),this.lastMouseMovePixel_=null},Kp.prototype.setMap=function(t){if(Ts.prototype.setMap.call(this,t),t){var e=t.getViewport();this.listenerKeys.push(S(e,D,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(S(e,U,this.handleMouseOut,this))}},Kp.prototype.setCoordinateFormat=function(t){this.set(Wp,t)},Kp.prototype.setProjection=function(t){this.set(Vp,Ee(t))},Kp.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var i=this.getProjection();this.transform_=i?Me(this.mapProjection_,i):Ce}var r=this.getMap().getCoordinateFromPixel(t);if(r){this.transform_(r,r);var n=this.getCoordinateFormat();e=n?n(r):r.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)};var Hp=function(){this.dataProjection=null,this.defaultFeatureProjection=null};function qp(t,e,i){var r,n=i?Ee(i.featureProjection):null,o=i?Ee(i.dataProjection):null;if(r=n&&o&&!Pe(n,o)?t instanceof We?(e?t.clone():t).transform(e?n:o,e?o:n):Ne(t,o,n):t,e&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);r===t&&(r=r.clone()),r.applyTransform(function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*s)/s;return t})}return r}Hp.prototype.getReadOptions=function(t,e){var i;return e&&(i={dataProjection:e.dataProjection?e.dataProjection:this.readProjection(t),featureProjection:e.featureProjection}),this.adaptOptions(i)},Hp.prototype.adaptOptions=function(t){return C({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},Hp.prototype.getLastExtent=function(){return null},Hp.prototype.getType=function(){},Hp.prototype.readFeature=function(t,e){},Hp.prototype.readFeatures=function(t,e){},Hp.prototype.readGeometry=function(t,e){},Hp.prototype.readProjection=function(t){},Hp.prototype.writeFeature=function(t,e){},Hp.prototype.writeFeatures=function(t,e){},Hp.prototype.writeGeometry=function(t,e){};var Jp=function(){Hp.call(this)};function Qp(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}t(Jp,Hp),Jp.prototype.getType=function(){return ph.JSON},Jp.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Qp(t),this.getReadOptions(t,e))},Jp.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Qp(t),this.getReadOptions(t,e))},Jp.prototype.readFeatureFromObject=function(t,e){},Jp.prototype.readFeaturesFromObject=function(t,e){},Jp.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Qp(t),this.getReadOptions(t,e))},Jp.prototype.readGeometryFromObject=function(t,e){},Jp.prototype.readProjection=function(t){return this.readProjectionFromObject(Qp(t))},Jp.prototype.readProjectionFromObject=function(t){},Jp.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},Jp.prototype.writeFeatureObject=function(t,e){},Jp.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},Jp.prototype.writeFeaturesObject=function(t,e){},Jp.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},Jp.prototype.writeGeometryObject=function(t,e){};var $p={};$p[Zt.POINT]=function(t){var e;e=void 0!==t.m&&void 0!==t.z?new sn([t.x,t.y,t.z,t.m],Dr.XYZM):void 0!==t.z?new sn([t.x,t.y,t.z],Dr.XYZ):void 0!==t.m?new sn([t.x,t.y,t.m],Dr.XYM):new sn([t.x,t.y]);return e},$p[Zt.LINE_STRING]=function(t){var e=rd(t);return new Bn(t.paths[0],e)},$p[Zt.POLYGON]=function(t){var e=rd(t);return new xn(t.rings,e)},$p[Zt.MULTI_POINT]=function(t){var e=rd(t);return new nh(t.points,e)},$p[Zt.MULTI_LINE_STRING]=function(t){var e=rd(t);return new rh(t.paths,e)},$p[Zt.MULTI_POLYGON]=function(t){var e=rd(t);return new sh(t.rings,e)};var td={};td[Zt.POINT]=function(t,e){var i,r=t.getCoordinates(),n=t.getLayout();n===Dr.XYZ?i={x:r[0],y:r[1],z:r[2]}:n===Dr.XYM?i={x:r[0],y:r[1],m:r[2]}:n===Dr.XYZM?i={x:r[0],y:r[1],z:r[2],m:r[3]}:n===Dr.XY?i={x:r[0],y:r[1]}:$(!1,34);return i},td[Zt.LINE_STRING]=function(t,e){var i=nd(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},td[Zt.POLYGON]=function(t,e){var i=nd(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},td[Zt.MULTI_POINT]=function(t,e){var i=nd(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},td[Zt.MULTI_LINE_STRING]=function(t,e){var i=nd(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},td[Zt.MULTI_POLYGON]=function(t,e){for(var i=nd(t),r=t.getCoordinates(!1),n=[],o=0;o<r.length;o++)for(var s=r[o].length-1;0<=s;s--)n.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:n}};var ed=function(t){var e=t||{};Jp.call(this),this.geometryName_=e.geometryName};function id(t,e){if(!t)return null;var i;if("number"==typeof t.x&&"number"==typeof t.y)i=Zt.POINT;else if(t.points)i=Zt.MULTI_POINT;else if(t.paths)i=1===t.paths.length?Zt.LINE_STRING:Zt.MULTI_LINE_STRING;else if(t.rings){var r=rd(t),n=function(t,e){var i,r,n=[],o=[],s=[];for(i=0,r=t.length;i<r;++i){n.length=0,Hr(n,0,t[i],e.length);var a=_n(n,0,n.length,e.length);a?o.push([t[i]]):s.push(t[i])}for(;s.length;){var h=s.shift(),l=!1;for(i=o.length-1;0<=i;i--){var u=o[i][0],c=at(new on(u).getExtent(),new on(h).getExtent());if(c){o[i].push(h),l=!0;break}}l||o.push([h.reverse()])}return o}(t.rings,r);t=C({},t),1===n.length?(i=Zt.POLYGON,t.rings=n[0]):(i=Zt.MULTI_POLYGON,t.rings=n)}return qp((0,$p[i])(t),!1,e)}function rd(t){var e=Dr.XY;
1return!0===t.hasZ&&!0===t.hasM?e=Dr.XYZM:!0===t.hasZ?e=Dr.XYZ:!0===t.hasM&&(e=Dr.XYM),e}function nd(t){var e=t.getLayout();return{hasZ:e===Dr.XYZ||e===Dr.XYZM,hasM:e===Dr.XYM||e===Dr.XYZM}}function od(t,e){return(0,td[t.getType()])(qp(t,!0,e),e)}t(ed,Jp),ed.prototype.readFeatureFromObject=function(t,e){var i=t,r=id(i.geometry,e),n=new yr;return this.geometryName_&&n.setGeometryName(this.geometryName_),n.setGeometry(r),e&&e.idField&&i.attributes[e.idField]&&n.setId(i.attributes[e.idField]),i.attributes&&n.setProperties(i.attributes),n},ed.prototype.readFeaturesFromObject=function(t,e){var i=e||{};if(t.features){var r=[],n=t.features;i.idField=t.objectIdFieldName;for(var o=0,s=n.length;o<s;++o)r.push(this.readFeatureFromObject(n[o],i));return r}return[this.readFeatureFromObject(t,i)]},ed.prototype.readGeometryFromObject=function(t,e){return id(t,e)},ed.prototype.readProjectionFromObject=function(t){var e=t;return e.spatialReference&&e.spatialReference.wkid?Ee("EPSG:"+e.spatialReference.wkid):null},ed.prototype.writeGeometryObject=function(t,e){return od(t,this.adaptOptions(e))},ed.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={},r=t.getGeometry();r&&(i.geometry=od(r,e),e&&e.featureProjection&&(i.geometry.spatialReference={wkid:Ee(e.featureProjection).getCode().split(":").pop()}));var n=t.getProperties();return delete n[t.getGeometryName()],Et(n)?i.attributes={}:i.attributes=n,i},ed.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{features:i}};var sd=document.implementation.createDocument("","",null),ad="http://www.w3.org/2001/XMLSchema-instance";function hd(t,e){return sd.createElementNS(t,e)}function ld(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;for(n=e.firstChild;n;n=n.nextSibling)t(n,i,r)}return r}(t,e,[]).join("")}function ud(t){return t instanceof Document}function cd(t){return t instanceof Node}function pd(t){return(new DOMParser).parseFromString(t,"application/xml")}function dd(r,n){return function(t,e){var i=r.call(void 0!==n?n:this,t,e);void 0!==i&&Or(e[e.length-1],i)}}function fd(r,n){return function(t,e){var i=r.call(void 0!==n?n:this,t,e);void 0!==i&&e[e.length-1].push(i)}}function gd(r,n){return function(t,e){var i=r.call(void 0!==n?n:this,t,e);void 0!==i&&(e[e.length-1]=i)}}function _d(o,s,a){return function(t,e){var i=o.call(void 0!==a?a:this,t,e);if(void 0!==i){var r=e[e.length-1],n=void 0!==s?s:t.localName;(n in r?r[n]:r[n]=[]).push(i)}}}function vd(r,n,o){return function(t,e){var i=r.call(void 0!==o?o:this,t,e);void 0!==i&&(e[e.length-1][void 0!==n?n:t.localName]=i)}}function yd(r,n){return function(t,e,i){r.call(void 0!==n?n:this,t,e,i),i[i.length-1].node.appendChild(t)}}function md(n,t){var o,s;return function(t,e,i){if(void 0===o){o={};var r={};r[t.localName]=n,o[t.namespaceURI]=r,s=xd(t.localName)}Rd(o,s,e,i)}}function xd(t,o){var s=t;return function(t,e,i){var r=e[e.length-1].node,n=s;return void 0===n&&(n=i),hd(void 0!==o?o:r.namespaceURI,n)}}var Sd=xd();function Cd(t,e){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=t[e[n]];return r}function wd(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 Ed(t,e,i,r){var n;for(n=e.firstElementChild;n;n=n.nextElementSibling){var o=t[n.namespaceURI];if(void 0!==o){var s=o[n.localName];void 0!==s&&s.call(r,n,i)}}}function Td(t,e,i,r,n){return r.push(t),Ed(e,i,r,n),r.pop()}function Rd(t,e,i,r,n,o){for(var s,a,h=(void 0!==n?n:i).length,l=0;l<h;++l)void 0!==(s=i[l])&&void 0!==(a=e.call(void 0!==o?o:this,s,r,void 0!==n?n[l]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,r)}function Id(t,e,i,r,n,o,s){return n.push(t),Rd(e,i,r,n,o,s),n.pop()}var Fd=function(){this.xmlSerializer_=new XMLSerializer,Hp.call(this)};t(Fd,Hp),Fd.prototype.getType=function(){return ph.XML},Fd.prototype.readFeature=function(t,e){if(ud(t))return this.readFeatureFromDocument(t,e);if(cd(t))return this.readFeatureFromNode(t,e);if("string"==typeof t){var i=pd(t);return this.readFeatureFromDocument(i,e)}return null},Fd.prototype.readFeatureFromDocument=function(t,e){var i=this.readFeaturesFromDocument(t,e);return 0<i.length?i[0]:null},Fd.prototype.readFeatureFromNode=function(t,e){return null},Fd.prototype.readFeatures=function(t,e){if(ud(t))return this.readFeaturesFromDocument(t,e);
1if(cd(t))return this.readFeaturesFromNode(t,e);if("string"==typeof t){var i=pd(t);return this.readFeaturesFromDocument(i,e)}return[]},Fd.prototype.readFeaturesFromDocument=function(t,e){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&Or(i,this.readFeaturesFromNode(r,e));return i},Fd.prototype.readFeaturesFromNode=function(t,e){},Fd.prototype.readGeometry=function(t,e){if(ud(t))return this.readGeometryFromDocument(t,e);if(cd(t))return this.readGeometryFromNode(t,e);if("string"==typeof t){var i=pd(t);return this.readGeometryFromDocument(i,e)}return null},Fd.prototype.readGeometryFromDocument=function(t,e){return null},Fd.prototype.readGeometryFromNode=function(t,e){return null},Fd.prototype.readProjection=function(t){if(ud(t))return this.readProjectionFromDocument(t);if(cd(t))return this.readProjectionFromNode(t);if("string"==typeof t){var e=pd(t);return this.readProjectionFromDocument(e)}return null},Fd.prototype.readProjectionFromDocument=function(t){return this.dataProjection},Fd.prototype.readProjectionFromNode=function(t){return this.dataProjection},Fd.prototype.writeFeature=function(t,e){var i=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(i)},Fd.prototype.writeFeatureNode=function(t,e){return null},Fd.prototype.writeFeatures=function(t,e){var i=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(i)},Fd.prototype.writeFeaturesNode=function(t,e){return null},Fd.prototype.writeGeometry=function(t,e){var i=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(i)},Fd.prototype.writeGeometryNode=function(t,e){return null};var Ld="http://www.opengis.net/gml",Pd=function(t){var e=t||{};this.featureType=e.featureType,this.featureNS=e.featureNS,this.srsName=e.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[Ld]={featureMember:gd(Pd.prototype.readFeaturesInternal),featureMembers:gd(Pd.prototype.readFeaturesInternal)},Fd.call(this)};t(Pd,Fd);var Md=/^[\s\xa0]*$/;function bd(t){return Od(ld(t,!1))}function Od(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);return e?void 0!==e[1]||!1:void 0}function Nd(t){var e=ld(t,!1),i=Date.parse(e);return isNaN(i)?void 0:i/1e3}function Ad(t){return kd(ld(t,!1))}function kd(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return e?parseFloat(e[1]):void 0}function Gd(t){return Dd(ld(t,!1))}function Dd(t){var e=/^\s*(\d+)\s*$/.exec(t);return e?parseInt(e[1],10):void 0}function Ud(t){return ld(t,!1).trim()}function jd(t,e){Yd(t,e?"1":"0")}function zd(t,e){var i=e.toPrecision();t.appendChild(sd.createTextNode(i))}function Bd(t,e){var i=e.toString();t.appendChild(sd.createTextNode(i))}function Yd(t,e){t.appendChild(sd.createTextNode(e))}Pd.prototype.readFeaturesInternal=function(t,e){var i=t.localName,r=null;if("FeatureCollection"==i)r="http://www.opengis.net/wfs"===t.namespaceURI?Td([],this.FEATURE_COLLECTION_PARSERS,t,e,this):Td(null,this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==i||"featureMember"==i){var n=e[0],o=n.featureType,s=n.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,h=t.childNodes.length;a<h;++a){var l=t.childNodes[a];if(1===l.nodeType){var u=l.nodeName.split(":").pop();if(-1===o.indexOf(u)){var c="",p=0,d=l.namespaceURI;for(var f in s){if(s[f]===d){c=f;break}++p}c||(s[c="p"+p]=d),o.push(c+":"+u)}}}"featureMember"!=i&&(n.featureType=o,n.featureNS=s)}if("string"==typeof s){var g=s;(s={}).p0=g}var _={},v=Array.isArray(o)?o:[o];for(var y in s){for(var m={},x=0,S=v.length;x<S;++x){(-1===v[x].indexOf(":")?"p0":v[x].split(":")[0])===y&&(m[v[x].split(":").pop()]="featureMembers"==i?fd(this.readFeatureElement,this):gd(this.readFeatureElement,this))}_[s[y]]=m}r=Td("featureMember"==i?void 0:[],_,t,e)}return null===r&&(r=[]),r},Pd.prototype.readGeometryElement=function(t,e){var i=e[0];i.srsName=t.firstElementChild.getAttribute("srsName"),i.srsDimension=t.firstElementChild.getAttribute("srsDimension");var r=Td(null,this.GEOMETRY_PARSERS_,t,e,this);return r?qp(r,!1,i):void 0},Pd.prototype.readFeatureElement=function(t,e){var i,r,n,o,s=t.getAttribute("fid")||(r=Ld,n="id",t.getAttributeNS(r,n)||""),a={};for(i=t.firstElementChild;i;i=i.nextElementSibling){var h=i.localName;if(0===i.childNodes.length||1===i.childNodes.length&&(3===i.firstChild.nodeType||4===i.firstChild.nodeType)){var l=ld(i,!1);Md.test(l)&&(l=void 0),a[h]=l}else"boundedBy"!==h&&(o=h),a[h]=this.readGeometryElement(i,e)}
1var u=new yr(a);return o&&u.setGeometryName(o),s&&u.setId(s),u},Pd.prototype.readPoint=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);if(i){var r=new sn(null);return r.setFlatCoordinates(Dr.XYZ,i),r}},Pd.prototype.readMultiPoint=function(t,e){var i=Td([],this.MULTIPOINT_PARSERS_,t,e,this);return i?new nh(i):void 0},Pd.prototype.readMultiLineString=function(t,e){var i=Td([],this.MULTILINESTRING_PARSERS_,t,e,this);if(i){var r=new rh(null);return r.setLineStrings(i),r}},Pd.prototype.readMultiPolygon=function(t,e){var i=Td([],this.MULTIPOLYGON_PARSERS_,t,e,this);if(i){var r=new sh(null);return r.setPolygons(i),r}},Pd.prototype.pointMemberParser_=function(t,e){Ed(this.POINTMEMBER_PARSERS_,t,e,this)},Pd.prototype.lineStringMemberParser_=function(t,e){Ed(this.LINESTRINGMEMBER_PARSERS_,t,e,this)},Pd.prototype.polygonMemberParser_=function(t,e){Ed(this.POLYGONMEMBER_PARSERS_,t,e,this)},Pd.prototype.readLineString=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);if(i){var r=new Bn(null);return r.setFlatCoordinates(Dr.XYZ,i),r}},Pd.prototype.readFlatLinearRing_=function(t,e){var i=Td(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS_,t,e,this);return i||void 0},Pd.prototype.readLinearRing=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);if(i){var r=new on(null);return r.setFlatCoordinates(Dr.XYZ,i),r}},Pd.prototype.readPolygon=function(t,e){var i=Td([null],this.FLAT_LINEAR_RINGS_PARSERS_,t,e,this);if(i&&i[0]){var r,n,o=new xn(null),s=i[0],a=[s.length];for(r=1,n=i.length;r<n;++r)Or(s,i[r]),a.push(s.length);return o.setFlatCoordinates(Dr.XYZ,s,a),o}},Pd.prototype.readFlatCoordinatesFromNode_=function(t,e){return Td(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS_,t,e,this)},Pd.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml":{pointMember:fd(Pd.prototype.pointMemberParser_),pointMembers:fd(Pd.prototype.pointMemberParser_)}},Pd.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml":{lineStringMember:fd(Pd.prototype.lineStringMemberParser_),lineStringMembers:fd(Pd.prototype.lineStringMemberParser_)}},Pd.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml":{polygonMember:fd(Pd.prototype.polygonMemberParser_),polygonMembers:fd(Pd.prototype.polygonMemberParser_)}},Pd.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml":{Point:fd(Pd.prototype.readFlatCoordinatesFromNode_)}},Pd.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:fd(Pd.prototype.readLineString)}},Pd.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:fd(Pd.prototype.readPolygon)}},Pd.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:gd(Pd.prototype.readFlatLinearRing_)}},Pd.prototype.readGeometryFromNode=function(t,e){var i=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return i||null},Pd.prototype.readFeaturesFromNode=function(t,e){var i={featureType:this.featureType,featureNS:this.featureNS};return e&&C(i,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[i])||[]},Pd.prototype.readProjectionFromNode=function(t){return Ee(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))};var Xd=Ld+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",Vd=function(t){var e=t||{};Pd.call(this,e),this.surface_=void 0!==e.surface&&e.surface,this.curve_=void 0!==e.curve&&e.curve,this.multiCurve_=void 0===e.multiCurve||e.multiCurve,this.multiSurface_=void 0===e.multiSurface||e.multiSurface,this.schemaLocation=e.schemaLocation?e.schemaLocation:Xd,this.hasZ=void 0!==e.hasZ&&e.hasZ};t(Vd,Pd),Vd.prototype.readMultiCurve_=function(t,e){var i=Td([],this.MULTICURVE_PARSERS_,t,e,this);if(i){var r=new rh(null);return r.setLineStrings(i),r}},Vd.prototype.readMultiSurface_=function(t,e){var i=Td([],this.MULTISURFACE_PARSERS_,t,e,this);if(i){var r=new sh(null);return r.setPolygons(i),r}},Vd.prototype.curveMemberParser_=function(t,e){Ed(this.CURVEMEMBER_PARSERS_,t,e,this)},Vd.prototype.surfaceMemberParser_=function(t,e){Ed(this.SURFACEMEMBER_PARSERS_,t,e,this)},Vd.prototype.readPatch_=function(t,e){return Td([null],this.PATCHES_PARSERS_,t,e,this)},Vd.prototype.readSegment_=function(t,e){return Td([null],this.SEGMENTS_PARSERS_,t,e,this)},Vd.prototype.readPolygonPatch_=function(t,e){return Td([null],this.FLAT_LINEAR_RINGS_PARSERS_,t,e,this)},Vd.prototype.readLineStringSegment_=function(t,e){return Td([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS_,t,e,this)},Vd.prototype.interiorParser_=function(t,e){var i=Td(void 0,this.RING_PARSERS,t,e,this);i&&e[e.length-1].push(i)},Vd.prototype.exteriorParser_=function(t,e){var i=Td(void 0,this.RING_PARSERS,t,e,this);i&&(e[e.length-1][0]=i)},Vd.prototype.readSurface_=function(t,e){var i=Td([null],this.SURFACE_PARSERS_,t,e,this);if(i&&i[0]){var r,n,o=new xn(null),s=i[0],a=[s.length];for(r=1,n=i.length;r<n;++r)Or(s,i[r]),a.push(s.length);return o.setFlatCoordinates(Dr.XYZ,s,a),o}},Vd.prototype.readCurve_=function(t,e){var i=Td([null],this.CURVE_PARSERS_,t,e,this);if(i){var r=new Bn(null);return r.setFlatCoordinates(Dr.XYZ,i),r}},Vd.prototype.readEnvelope_=function(t,e){var i=Td([null],this.ENVELOPE_PARSERS_,t,e,this);return ct(i[1][0],i[1][1],i[2][0],i[2][1])},Vd.prototype.readFlatPos_=function(t,e){for(var i,r=ld(t,!1),n=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];i=n.exec(r);)o.push(parseFloat(i[1])),r=r.substr(i[0].length);if(""===r){var s,a,h=e[0].srsName,l="enu";if(h)l=Ee(h).getAxisOrientation();if("neu"===l)for(s=0,a=o.length;s<a;s+=3){var u=o[s],c=o[s+1];o[s]=c,o[s+1]=u}var p=o.length;if(2==p&&o.push(0),0!==p)return o}},Vd.prototype.readFlatPosList_=function(t,e){var i=ld(t,!1).replace(/^\s*|\s*$/g,""),r=e[0],n=r.srsName,o=r.srsDimension,s="enu";n&&(s=Ee(n).getAxisOrientation());var a,h,l,u=i.split(/\s+/),c=2;t.getAttribute("srsDimension")?c=Dd(t.getAttribute("srsDimension")):t.getAttribute("dimension")?c=Dd(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?c=Dd(t.parentNode.getAttribute("srsDimension")):o&&(c=Dd(o));for(var p=[],d=0,f=u.length;d<f;d+=c)a=parseFloat(u[d]),h=parseFloat(u[d+1]),l=3===c?parseFloat(u[d+2]):0,"en"===s.substr(0,2)?p.push(a,h,l):p.push(h,a,l);return p},Vd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_={"http://www.opengis.net/gml":{pos:gd(Vd.prototype.readFlatPos_),posList:gd(Vd.prototype.readFlatPosList_)}}
1,Vd.prototype.FLAT_LINEAR_RINGS_PARSERS_={"http://www.opengis.net/gml":{interior:Vd.prototype.interiorParser_,exterior:Vd.prototype.exteriorParser_}},Vd.prototype.GEOMETRY_PARSERS_={"http://www.opengis.net/gml":{Point:gd(Pd.prototype.readPoint),MultiPoint:gd(Pd.prototype.readMultiPoint),LineString:gd(Pd.prototype.readLineString),MultiLineString:gd(Pd.prototype.readMultiLineString),LinearRing:gd(Pd.prototype.readLinearRing),Polygon:gd(Pd.prototype.readPolygon),MultiPolygon:gd(Pd.prototype.readMultiPolygon),Surface:gd(Vd.prototype.readSurface_),MultiSurface:gd(Vd.prototype.readMultiSurface_),Curve:gd(Vd.prototype.readCurve_),MultiCurve:gd(Vd.prototype.readMultiCurve_),Envelope:gd(Vd.prototype.readEnvelope_)}},Vd.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml":{curveMember:fd(Vd.prototype.curveMemberParser_),curveMembers:fd(Vd.prototype.curveMemberParser_)}},Vd.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml":{surfaceMember:fd(Vd.prototype.surfaceMemberParser_),surfaceMembers:fd(Vd.prototype.surfaceMemberParser_)}},Vd.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:fd(Pd.prototype.readLineString),Curve:fd(Vd.prototype.readCurve_)}},Vd.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:fd(Pd.prototype.readPolygon),Surface:fd(Vd.prototype.readSurface_)}},Vd.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml":{patches:gd(Vd.prototype.readPatch_)}},Vd.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml":{segments:gd(Vd.prototype.readSegment_)}},Vd.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml":{lowerCorner:fd(Vd.prototype.readFlatPosList_),upperCorner:fd(Vd.prototype.readFlatPosList_)}},Vd.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml":{PolygonPatch:gd(Vd.prototype.readPolygonPatch_)}},Vd.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml":{LineStringSegment:gd(Vd.prototype.readLineStringSegment_)}},Vd.prototype.writePos_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=n?3:2;t.setAttribute("srsDimension",o);var s=r.srsName,a="enu";s&&(a=Ee(s).getAxisOrientation());var h,l=e.getCoordinates();(h="en"===a.substr(0,2)?l[0]+" "+l[1]:l[1]+" "+l[0],n)&&(h+=" "+(l[2]||0));Yd(t,h)},Vd.prototype.getCoords_=function(t,e,i){var r="enu";e&&(r=Ee(e).getAxisOrientation());var n="en"===r.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];i&&(n+=" "+(t[2]||0));return n},Vd.prototype.writePosList_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=n?3:2;t.setAttribute("srsDimension",o);for(var s,a=r.srsName,h=e.getCoordinates(),l=h.length,u=new Array(l),c=0;c<l;++c)s=h[c],u[c]=this.getCoords_(s,a,n);Yd(t,u.join(" "))},Vd.prototype.writePoint_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=hd(t.namespaceURI,"pos");t.appendChild(n),this.writePos_(n,e,i)},Vd.prototype.writeEnvelope=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];Id({node:t},this.ENVELOPE_SERIALIZERS_,Sd,n,i,["lowerCorner","upperCorner"],this)},Vd.prototype.writeLinearRing_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=hd(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)},Vd.prototype.RING_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1],n=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),hd(n.namespaceURI,void 0!==o?"interior":"exterior")},Vd.prototype.writeSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();Id({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=hd(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,i)}},Vd.prototype.writeCurveOrLineString_=function(t,e,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=hd(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)}else if("Curve"===t.nodeName){var o=hd(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,i)}}
1,Vd.prototype.writeMultiSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();Id({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},Vd.prototype.writeMultiPoint_=function(t,e,i){var r=i[i.length-1],n=r.srsName,o=r.hasZ;n&&t.setAttribute("srsName",n);var s=e.getPoints();Id({node:t,hasZ:o,srsName:n},this.POINTMEMBER_SERIALIZERS_,xd("pointMember"),s,i,void 0,this)},Vd.prototype.writeMultiCurveOrLineString_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();Id({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},Vd.prototype.writeRing_=function(t,e,i){var r=hd(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing_(r,e,i)},Vd.prototype.writeSurfaceOrPolygonMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i))},Vd.prototype.writePointMember_=function(t,e,i){var r=hd(t.namespaceURI,"Point");t.appendChild(r),this.writePoint_(r,e,i)},Vd.prototype.writeLineStringOrCurveMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeCurveOrLineString_(r,e,i))},Vd.prototype.writeSurfacePatches_=function(t,e,i){var r=hd(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i)},Vd.prototype.writeCurveSegments_=function(t,e,i){var r=hd(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString_(r,e,i)},Vd.prototype.writeGeometryElement=function(t,e,i){var r,n=i[i.length-1],o=C({},n);o.node=t,r=Array.isArray(e)?n.dataProjection?Ne(e,n.featureProjection,n.dataProjection):e:qp(e,!0,n),Id(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[r],i,void 0,this)},Vd.prototype.writeFeatureElement=function(t,e,i){var r=e.getId();r&&t.setAttribute("fid",r);var n=i[i.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=e.getProperties(),h=[],l=[];for(var u in a){var c=a[u];null!==c&&(h.push(u),l.push(c),u==s||c instanceof We?u in n.serializers[o]||(n.serializers[o][u]=yd(this.writeGeometryElement,this)):u in n.serializers[o]||(n.serializers[o][u]=yd(Yd)))}var p=C({},n);p.node=t,Id(p,n.serializers,xd(void 0,o),l,i,h)},Vd.prototype.writeFeatureMembers_=function(t,e,i){var r=i[i.length-1],n=r.featureType,o=r.featureNS,s={};s[o]={},s[o][n]=yd(this.writeFeatureElement,this);var a=C({},r);a.node=t,Id(a,s,xd(n,o),e,i)};var Wd={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};Vd.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1].node;return hd("http://www.opengis.net/gml",Wd[r.nodeName])},Vd.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,i){var r,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.curve,h=n.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"LineString"===r&&!0===a?r="Curve":"MultiLineString"===r&&!0===h&&(r="MultiCurve"),hd("http://www.opengis.net/gml",r)},Vd.prototype.writeGeometryNode=function(t,e){e=this.adaptOptions(e);var i=hd("http://www.opengis.net/gml","geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&C(r,e),this.writeGeometryElement(i,t,[r]),i},Vd.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=hd("http://www.opengis.net/gml","featureMembers");i.setAttributeNS(ad,"xsi:schemaLocation",this.schemaLocation);var r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&C(r,e),this.writeFeatureMembers_(i,t,[r]),i},Vd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{exterior:yd(Vd.prototype.writeRing_),interior:yd(Vd.prototype.writeRing_)}},Vd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:yd(Yd),upperCorner:yd(Yd)}},Vd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:yd(Vd.prototype.writeSurfaceOrPolygonMember_),polygonMember:yd(Vd.prototype.writeSurfaceOrPolygonMember_)}},Vd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:yd(Vd.prototype.writePointMember_)}},Vd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:yd(Vd.prototype.writeLineStringOrCurveMember_),curveMember:yd(Vd.prototype.writeLineStringOrCurveMember_)}},Vd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:yd(Vd.prototype.writeCurveOrLineString_),MultiCurve:yd(Vd.prototype.writeMultiCurveOrLineString_),Point:yd(Vd.prototype.writePoint_),MultiPoint:yd(Vd.prototype.writeMultiPoint_),LineString:yd(Vd.prototype.writeCurveOrLineString_),MultiLineString:yd(Vd.prototype.writeMultiCurveOrLineString_),LinearRing:yd(Vd.prototype.writeLinearRing_),Polygon:yd(Vd.prototype.writeSurfaceOrPolygon_),MultiPolygon:yd(Vd.prototype.writeMultiSurfaceOrPolygon_),Surface:yd(Vd.prototype.writeSurfaceOrPolygon_),MultiSurface:yd(Vd.prototype.writeMultiSurfaceOrPolygon_),Envelope:yd(Vd.prototype.writeEnvelope)}};var Kd=Vd,Zd=Ld+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",Hd=function(t){var e=t||{};Pd.call(this,e),this.FEATURE_COLLECTION_PARSERS[Ld].featureMember=fd(Pd.prototype.readFeaturesInternal),this.schemaLocation=e.schemaLocation?e.schemaLocation:Zd};t(Hd,Pd),Hd.prototype.readFlatCoordinates_=function(t,e){var i=ld(t,!1).replace(/^\s*|\s*$/g,""),r=e[0].srsName,n="enu";if(r){var o=Ee(r);o&&(n=o.getAxisOrientation())}for(var s=i.trim().split(/\s+/),a=[],h=0,l=s.length;h<l;h++){var u=s[h].split(/,+/),c=parseFloat(u[0]),p=parseFloat(u[1]),d=3===u.length?parseFloat(u[2]):0;"en"===n.substr(0,2)?a.push(c,p,d):a.push(p,c,d)}return a},Hd.prototype.readBox_=function(t,e){var i=Td([null],this.BOX_PARSERS_,t,e,this);return ct(i[1][0],i[1][1],i[1][3],i[1][4])},Hd.prototype.innerBoundaryIsParser_=function(t,e){var i=Td(void 0,this.RING_PARSERS,t,e,this);i&&e[e.length-1].push(i)},Hd.prototype.outerBoundaryIsParser_=function(t,e){var i=Td(void 0,this.RING_PARSERS,t,e,this);i&&(e[e.length-1][0]=i)}
1,Hd.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,i){var r,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"MultiLineString"===r&&!0===a&&(r="MultiCurve"),hd("http://www.opengis.net/gml",r)},Hd.prototype.writeFeatureElement=function(t,e,i){var r=e.getId();r&&t.setAttribute("fid",r);var n=i[i.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=e.getProperties(),h=[],l=[];for(var u in a){var c=a[u];null!==c&&(h.push(u),l.push(c),u==s||c instanceof We?u in n.serializers[o]||(n.serializers[o][u]=yd(this.writeGeometryElement,this)):u in n.serializers[o]||(n.serializers[o][u]=yd(Yd)))}var p=C({},n);p.node=t,Id(p,n.serializers,xd(void 0,o),l,i,h)},Hd.prototype.writeCurveOrLineString_=function(t,e,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,i)}else if("Curve"===t.nodeName){var o=hd(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,i)}},Hd.prototype.writeLineStringOrCurveMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeCurveOrLineString_(r,e,i))},Hd.prototype.writeMultiCurveOrLineString_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();Id({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},Hd.prototype.writeGeometryElement=function(t,e,i){var r,n=i[i.length-1],o=C({},n);o.node=t,r=Array.isArray(e)?n.dataProjection?Ne(e,n.featureProjection,n.dataProjection):e:qp(e,!0,n),Id(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[r],i,void 0,this)},Hd.prototype.createCoordinatesNode_=function(t){var e=hd(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e},Hd.prototype.writeCoordinates_=function(t,e,i){for(var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=e.getCoordinates(),a=s.length,h=new Array(a),l=0;l<a;++l){var u=s[l];h[l]=this.getCoords_(u,o,n)}Yd(t,h.join(" "))},Hd.prototype.writeCurveSegments_=function(t,e,i){var r=hd(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString_(r,e,i)},Hd.prototype.writeSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();Id({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=hd(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,i)}},Hd.prototype.RING_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1],n=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),hd(n.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},Hd.prototype.writeSurfacePatches_=function(t,e,i){var r=hd(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i)},Hd.prototype.writeRing_=function(t,e,i){var r=hd(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing_(r,e,i)},Hd.prototype.getCoords_=function(t,e,i){var r="enu";e&&(r=Ee(e).getAxisOrientation());var n="en"===r.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];i&&(n+=","+(t[2]||0));return n},Hd.prototype.writePoint_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(s);var a=e.getCoordinates();Yd(s,this.getCoords_(a,o,n))},Hd.prototype.writeMultiPoint_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=e.getPoints();Id({node:t,hasZ:n,srsName:o},this.POINTMEMBER_SERIALIZERS_,xd("pointMember"),s,i,void 0,this)}
1,Hd.prototype.writePointMember_=function(t,e,i){var r=hd(t.namespaceURI,"Point");t.appendChild(r),this.writePoint_(r,e,i)},Hd.prototype.writeLinearRing_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,i)},Hd.prototype.writeMultiSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();Id({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},Hd.prototype.writeSurfaceOrPolygonMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i))},Hd.prototype.writeEnvelope=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];Id({node:t},this.ENVELOPE_SERIALIZERS_,Sd,n,i,["lowerCorner","upperCorner"],this)};var qd={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};Hd.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1].node;return hd("http://www.opengis.net/gml",qd[r.nodeName])},Hd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_={"http://www.opengis.net/gml":{coordinates:gd(Hd.prototype.readFlatCoordinates_)}},Hd.prototype.FLAT_LINEAR_RINGS_PARSERS_={"http://www.opengis.net/gml":{innerBoundaryIs:Hd.prototype.innerBoundaryIsParser_,outerBoundaryIs:Hd.prototype.outerBoundaryIsParser_}},Hd.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:fd(Hd.prototype.readFlatCoordinates_)}},Hd.prototype.GEOMETRY_PARSERS_={"http://www.opengis.net/gml":{Point:gd(Pd.prototype.readPoint),MultiPoint:gd(Pd.prototype.readMultiPoint),LineString:gd(Pd.prototype.readLineString),MultiLineString:gd(Pd.prototype.readMultiLineString),LinearRing:gd(Pd.prototype.readLinearRing),Polygon:gd(Pd.prototype.readPolygon),MultiPolygon:gd(Pd.prototype.readMultiPolygon),Box:gd(Hd.prototype.readBox_)}},Hd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:yd(Hd.prototype.writeCurveOrLineString_),MultiCurve:yd(Hd.prototype.writeMultiCurveOrLineString_),Point:yd(Hd.prototype.writePoint_),MultiPoint:yd(Hd.prototype.writeMultiPoint_),LineString:yd(Hd.prototype.writeCurveOrLineString_),MultiLineString:yd(Hd.prototype.writeMultiCurveOrLineString_),LinearRing:yd(Hd.prototype.writeLinearRing_),Polygon:yd(Hd.prototype.writeSurfaceOrPolygon_),MultiPolygon:yd(Hd.prototype.writeMultiSurfaceOrPolygon_),Surface:yd(Hd.prototype.writeSurfaceOrPolygon_),MultiSurface:yd(Hd.prototype.writeMultiSurfaceOrPolygon_),Envelope:yd(Hd.prototype.writeEnvelope)}},Hd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:yd(Hd.prototype.writeLineStringOrCurveMember_),curveMember:yd(Hd.prototype.writeLineStringOrCurveMember_)}},Hd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{outerBoundaryIs:yd(Hd.prototype.writeRing_),innerBoundaryIs:yd(Hd.prototype.writeRing_)}},Hd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:yd(Hd.prototype.writePointMember_)}},Hd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:yd(Hd.prototype.writeSurfaceOrPolygonMember_),polygonMember:yd(Hd.prototype.writeSurfaceOrPolygonMember_)}},Hd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:yd(Yd),upperCorner:yd(Yd)}};var Jd=function(t){var e=t||{};Fd.call(this),this.dataProjection=Ee("EPSG:4326"),this.readExtensions_=e.readExtensions};t(Jd,Fd);var Qd=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],$d={rte:If,trk:Ff,wpt:Lf},tf=wd(Qd,{rte:fd(If),trk:fd(Ff),wpt:fd(Lf)}),ef=wd(Qd,{text:vd(Ud,"linkText"),type:vd(Ud,"linkType")}),rf=wd(Qd,{name:vd(Ud),cmt:vd(Ud),desc:vd(Ud),src:vd(Ud),link:Tf,number:vd(Gd),extensions:Rf,type:vd(Ud),rtept:function(t,e){var i=Td({},nf,t,e);if(i){var r=e[e.length-1],n=r.flatCoordinates,o=r.layoutOptions;wf(n,o,t,i)}}}),nf=wd(Qd,{ele:vd(Ad),time:vd(Nd)}),of=wd(Qd,{name:vd(Ud),cmt:vd(Ud),desc:vd(Ud),src:vd(Ud),link:Tf,number:vd(Gd),type:vd(Ud),extensions:Rf,trkseg:function(t,e){var i=e[e.length-1];Ed(sf,t,e);var r=i.flatCoordinates;i.ends.push(r.length)}}),sf=wd(Qd,{trkpt:function(t,e){var i=Td({},af,t,e);if(i){var r=e[e.length-1],n=r.flatCoordinates,o=r.layoutOptions;
1wf(n,o,t,i)}}}),af=wd(Qd,{ele:vd(Ad),time:vd(Nd)}),hf=wd(Qd,{ele:vd(Ad),time:vd(Nd),magvar:vd(Ad),geoidheight:vd(Ad),name:vd(Ud),cmt:vd(Ud),desc:vd(Ud),src:vd(Ud),link:Tf,sym:vd(Ud),type:vd(Ud),fix:vd(Ud),sat:vd(Gd),hdop:vd(Ad),vdop:vd(Ad),pdop:vd(Ad),ageofdgpsdata:vd(Ad),dgpsid:vd(Gd),extensions:Rf}),lf=["text","type"],uf=wd(Qd,{text:yd(Yd),type:yd(Yd)}),cf=wd(Qd,["name","cmt","desc","src","link","number","type","rtept"]),pf=wd(Qd,{name:yd(Yd),cmt:yd(Yd),desc:yd(Yd),src:yd(Yd),link:yd(Pf),number:yd(Bd),type:yd(Yd),rtept:md(yd(Mf))}),df=wd(Qd,["ele","time"]),ff=wd(Qd,["name","cmt","desc","src","link","number","type","trkseg"]),gf=wd(Qd,{name:yd(Yd),cmt:yd(Yd),desc:yd(Yd),src:yd(Yd),link:yd(Pf),number:yd(Bd),type:yd(Yd),trkseg:md(yd(function(t,e,i){Id({node:t,geometryLayout:e.getLayout(),properties:{}},vf,_f,e.getCoordinates(),i)}))}),_f=xd("trkpt"),vf=wd(Qd,{trkpt:yd(Mf)}),yf=wd(Qd,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),mf=wd(Qd,{ele:yd(zd),time:yd(function(t,e){var i=new Date(1e3*e),r=i.getUTCFullYear()+"-"+Rn(i.getUTCMonth()+1,2)+"-"+Rn(i.getUTCDate(),2)+"T"+Rn(i.getUTCHours(),2)+":"+Rn(i.getUTCMinutes(),2)+":"+Rn(i.getUTCSeconds(),2)+"Z";t.appendChild(sd.createTextNode(r))}),magvar:yd(zd),geoidheight:yd(zd),name:yd(Yd),cmt:yd(Yd),desc:yd(Yd),src:yd(Yd),link:yd(Pf),sym:yd(Yd),type:yd(Yd),fix:yd(Yd),sat:yd(Bd),hdop:yd(zd),vdop:yd(zd),pdop:yd(zd),ageofdgpsdata:yd(zd),dgpsid:yd(Bd)}),xf={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function Sf(t,e,i){var r=t.getGeometry();if(r){var n=xf[r.getType()];if(n)return hd(e[e.length-1].node.namespaceURI,n)}}var Cf=wd(Qd,{rte:yd(function(t,e,i){var r=i[0],n=e.getProperties(),o={node:t,properties:n},s=e.getGeometry();s&&(s=qp(s,!0,r),o.geometryLayout=s.getLayout(),n.rtept=s.getCoordinates());var a=i[i.length-1].node,h=cf[a.namespaceURI],l=Cd(n,h);Id(o,pf,Sd,l,i,h)}),trk:yd(function(t,e,i){var r=i[0],n=e.getProperties(),o={node:t,properties:n},s=e.getGeometry();s&&(s=qp(s,!0,r),n.trkseg=s.getLineStrings());var a=i[i.length-1].node,h=ff[a.namespaceURI],l=Cd(n,h);Id(o,gf,Sd,l,i,h)}),wpt:yd(function(t,e,i){var r=i[0],n=i[i.length-1];n.properties=e.getProperties();var o=e.getGeometry();o&&(o=qp(o,!0,r),n.geometryLayout=o.getLayout(),Mf(t,o.getCoordinates(),i))})});function wf(t,e,i,r){return t.push(parseFloat(i.getAttribute("lon")),parseFloat(i.getAttribute("lat"))),"ele"in r?(t.push(r.ele),delete r.ele,e.hasZ=!0):t.push(0),"time"in r?(t.push(r.time),delete r.time,e.hasM=!0):t.push(0),t}function Ef(t,e,i){var r=Dr.XY,n=2;if(t.hasZ&&t.hasM?(r=Dr.XYZM,n=4):t.hasZ?(r=Dr.XYZ,n=3):t.hasM&&(r=Dr.XYM,n=3),4!==n){for(var o=0,s=e.length/4;o<s;o++)e[o*n]=e[4*o],e[o*n+1]=e[4*o+1],t.hasZ&&(e[o*n+2]=e[4*o+2]),t.hasM&&(e[o*n+2]=e[4*o+3]);if(e.length=e.length/4*n,i)for(var a=0,h=i.length;a<h;a++)i[a]=i[a]/4*n}return r}function Tf(t,e){var i=e[e.length-1],r=t.getAttribute("href");null!==r&&(i.link=r),Ed(ef,t,e)}function Rf(t,e){e[e.length-1].extensionsNode_=t}function If(t,e){var i=e[0],r=Td({flatCoordinates:[],layoutOptions:{}},rf,t,e);if(r){var n=r.flatCoordinates;delete r.flatCoordinates;var o=r.layoutOptions;delete r.layoutOptions;var s=Ef(o,n),a=new Bn(null);a.setFlatCoordinates(s,n),qp(a,!1,i);var h=new yr(a);return h.setProperties(r),h}}function Ff(t,e){var i=e[0],r=Td({flatCoordinates:[],ends:[],layoutOptions:{}},of,t,e);if(r){var n=r.flatCoordinates;delete r.flatCoordinates;var o=r.ends;delete r.ends;var s=r.layoutOptions;delete r.layoutOptions;var a=Ef(s,n,o),h=new rh(null);h.setFlatCoordinates(a,n,o),qp(h,!1,i);var l=new yr(h);return l.setProperties(r),l}}function Lf(t,e){var i=e[0],r=Td({},hf,t,e);if(r){var n={},o=wf([],n,t,r),s=Ef(n,o),a=new sn(o,s);qp(a,!1,i);var h=new yr(a);return h.setProperties(r),h}}function Pf(t,e,i){t.setAttribute("href",e);var r=i[i.length-1].properties,n=[r.linkText,r.linkType];Id({node:t},uf,Sd,n,i,lf)}function Mf(t,e,i){var r=i[i.length-1],n=r.node.namespaceURI,o=r.properties;switch(t.setAttributeNS(null,"lat",e[1]),t.setAttributeNS(null,"lon",e[0]),r.geometryLayout){case Dr.XYZM:0!==e[3]&&(o.time=e[3]);case Dr.XYZ:0!==e[2]&&(o.ele=e[2]);break;case Dr.XYM:0!==e[2]&&(o.time=e[2])}var s="rtept"==t.nodeName?df[n]:yf[n],a=Cd(o,s);Id({node:t,properties:o},mf,Sd,a,i,s)}Jd.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,i=t.length;e<i;++e){var r=t[e];if(this.readExtensions_){var n=r.get("extensionsNode_")||null;this.readExtensions_(r,n)}r.set("extensionsNode_",void 0)}},Jd.prototype.readFeatureFromNode=function(t,e){if(!Pr(Qd,t.namespaceURI))return null;var i=$d[t.localName];if(!i)return null;var r=i(t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_([r]),r):null}
1,Jd.prototype.readFeaturesFromNode=function(t,e){if(!Pr(Qd,t.namespaceURI))return[];if("gpx"==t.localName){var i=Td([],tf,t,[this.getReadOptions(t,e)]);return i?(this.handleReadExtensions_(i),i):[]}return[]},Jd.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=hd("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",ad),i.setAttributeNS(ad,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),Id({node:i},Cf,Sf,t,[e]),i};var bf=function(t){We.call(this),this.geometries_=t||null,this.listenGeometriesChange_()};function Of(t){for(var e=[],i=0,r=t.length;i<r;++i)e.push(t[i].clone());return e}t(bf,We),bf.prototype.unlistenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)d(this.geometries_[t],E,this.changed,this)},bf.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)S(this.geometries_[t],E,this.changed,this)},bf.prototype.clone=function(){var t=new bf(null);return t.setGeometries(this.geometries_),t},bf.prototype.closestPointXY=function(t,e,i,r){if(r<ot(this.getExtent(),t,e))return r;for(var n=this.geometries_,o=0,s=n.length;o<s;++o)r=n[o].closestPointXY(t,e,i,r);return r},bf.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},bf.prototype.computeExtent=function(t){pt(t);for(var e=this.geometries_,i=0,r=e.length;i<r;++i)vt(t,e[i].getExtent());return t},bf.prototype.getGeometries=function(){return Of(this.geometries_)},bf.prototype.getGeometriesArray=function(){return this.geometries_},bf.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(g(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(e))return this.simplifiedGeometryCache[e];for(var i=[],r=this.geometries_,n=!1,o=0,s=r.length;o<s;++o){var a=r[o],h=a.getSimplifiedGeometry(t);i.push(h),h!==a&&(n=!0)}if(n){var l=new bf(null);return l.setGeometriesArray(i),this.simplifiedGeometryCache[e]=l}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},bf.prototype.getType=function(){return Zt.GEOMETRY_COLLECTION},bf.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},bf.prototype.isEmpty=function(){return 0===this.geometries_.length},bf.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()},bf.prototype.scale=function(t,e,i){var r=i;r||(r=It(this.getExtent()));for(var n=this.geometries_,o=0,s=n.length;o<s;++o)n[o].scale(t,e,r);this.changed()},bf.prototype.setGeometries=function(t){this.setGeometriesArray(Of(t))},bf.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},bf.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,r=e.length;i<r;++i)e[i].applyTransform(t);this.changed()},bf.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()},bf.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),We.prototype.disposeInternal.call(this)};var Nf=function(t){var e=t||{};Jp.call(this),this.dataProjection=Ee(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=Ee(e.featureProjection)),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName};t(Nf,Jp);var Af={Point:function(t){return new sn(t.coordinates)},LineString:function(t){return new Bn(t.coordinates)},Polygon:function(t){return new xn(t.coordinates)},MultiPoint:function(t){return new nh(t.coordinates)},MultiLineString:function(t){return new rh(t.coordinates)},MultiPolygon:function(t){return new sh(t.coordinates)},GeometryCollection:function(t,e){var i=t.geometries.map(function(t){return Gf(t,e)});return new bf(i)}},kf={Point:function(t,e){return{type:"Point",coordinates:t.getCoordinates()}},LineString:function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}},Polygon:function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}},MultiPoint:function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}},MultiLineString:function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}},MultiPolygon:function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}},GeometryCollection:function(t,i){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(t){var e=C({},i);return delete e.featureProjection,Df(t,e)})}},Circle:function(t){return{type:"GeometryCollection",geometries:[]}}};function Gf(t,e){return t?qp((0,Af[t.type])(t),!1,e):null}function Df(t,e){return(0,kf[t.getType()])(qp(t,!0,e),e)}Nf.prototype.readFeatureFromObject=function(t,e){var i=null,r=Gf((i="Feature"===t.type?t:{type:"Feature",geometry:t}).geometry,e),n=new yr;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&void 0!==i.geometry_name&&n.setGeometryName(i.geometry_name),n.setGeometry(r),void 0!==i.id&&n.setId(i.id
1),i.properties&&n.setProperties(i.properties),n},Nf.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},Nf.prototype.readGeometryFromObject=function(t,e){return Gf(t,e)},Nf.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Ee(i.properties.name):$(!1,36):e=this.dataProjection,e},Nf.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature"},r=t.getId();void 0!==r&&(i.id=r);var n=t.getGeometry();i.geometry=n?Df(n,e):null;var o=t.getProperties();return delete o[t.getGeometryName()],Et(o)?i.properties=null:i.properties=o,i},Nf.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}},Nf.prototype.writeGeometryObject=function(t,e){return Df(t,this.adaptOptions(e))};var Uf=function(){Hp.call(this)};function jf(t){return"string"==typeof t?t:""}t(Uf,Hp),Uf.prototype.getType=function(){return ph.TEXT},Uf.prototype.readFeature=function(t,e){return this.readFeatureFromText(jf(t),this.adaptOptions(e))},Uf.prototype.readFeatureFromText=function(t,e){},Uf.prototype.readFeatures=function(t,e){return this.readFeaturesFromText(jf(t),this.adaptOptions(e))},Uf.prototype.readFeaturesFromText=function(t,e){},Uf.prototype.readGeometry=function(t,e){return this.readGeometryFromText(jf(t),this.adaptOptions(e))},Uf.prototype.readGeometryFromText=function(t,e){},Uf.prototype.readProjection=function(t){return this.readProjectionFromText(jf(t))},Uf.prototype.readProjectionFromText=function(t){return this.dataProjection},Uf.prototype.writeFeature=function(t,e){return this.writeFeatureText(t,this.adaptOptions(e))},Uf.prototype.writeFeatureText=function(t,e){},Uf.prototype.writeFeatures=function(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))},Uf.prototype.writeFeaturesText=function(t,e){},Uf.prototype.writeGeometry=function(t,e){return this.writeGeometryText(t,this.adaptOptions(e))},Uf.prototype.writeGeometryText=function(t,e){};var zf="barometric",Bf="gps",Yf="none",Xf=function(t){var e=t||{};Uf.call(this),this.dataProjection=Ee("EPSG:4326"),this.altitudeMode_=e.altitudeMode?e.altitudeMode:Yf};t(Xf,Uf);var Vf=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,Wf=/^H.([A-Z]{3}).*?:(.*)/,Kf=/^HFDTE(\d{2})(\d{2})(\d{2})/,Zf=/\r\n|\r|\n/;Xf.prototype.readFeatureFromText=function(t,e){var i,r,n=this.altitudeMode_,o=t.split(Zf),s={},a=[],h=2e3,l=0,u=1,c=-1;for(i=0,r=o.length;i<r;++i){var p=o[i],d=void 0;if("B"==p.charAt(0)){if(d=Vf.exec(p)){var f=parseInt(d[1],10),g=parseInt(d[2],10),_=parseInt(d[3],10),v=parseInt(d[4],10)+parseInt(d[5],10)/6e4;"S"==d[6]&&(v=-v);var y=parseInt(d[7],10)+parseInt(d[8],10)/6e4;if("W"==d[9]&&(y=-y),a.push(y,v),n!=Yf){var m=void 0;m=n==Bf?parseInt(d[11],10):n==zf?parseInt(d[12],10):0,a.push(m)}var x=Date.UTC(h,l,u,f,g,_);x<c&&(x=Date.UTC(h,l,u+1,f,g,_)),a.push(x/1e3),c=x}}else"H"==p.charAt(0)&&((d=Kf.exec(p))?(u=parseInt(d[1],10),l=parseInt(d[2],10)-1,h=2e3+parseInt(d[3],10)):(d=Wf.exec(p))&&(s[d[1]]=d[2].trim()))}if(0===a.length)return null;var S=new Bn(null),C=n==Yf?Dr.XYM:Dr.XYZM;S.setFlatCoordinates(C,a);var w=new yr(qp(S,!1,e));return w.setProperties(s),w},Xf.prototype.readFeaturesFromText=function(t,e){var i=this.readFeatureFromText(t,e);return i?[i]:[]},Xf.prototype.writeFeatureText=function(t,e){},Xf.prototype.writeFeaturesText=function(t,e){},Xf.prototype.writeGeometryText=function(t,e){},Xf.prototype.readGeometryFromText=function(t,e){};var Hf="fraction",qf="pixels",Jf=function(t,e,i,r,n,o){w.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==r&&(this.image_.crossOrigin=r),this.canvas_=o?document.createElement("CANVAS"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=n,this.size_=i,this.src_=e,this.tainting_=!1,this.imageState_==Ni.LOADED&&this.determineTainting_()};t(Jf,w),Jf.prototype.determineTainting_=function(){var t=ni(1,1);
1try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(t){this.tainting_=!0}},Jf.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(E)},Jf.prototype.handleImageError_=function(){this.imageState_=Ni.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},Jf.prototype.handleImageLoad_=function(){this.imageState_=Ni.LOADED,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.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},Jf.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_},Jf.prototype.getImageState=function(){return this.imageState_},Jf.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_)if(this.tainting_){var e=this.size_[0],i=this.size_[1],r=ni(e,i);r.fillRect(0,0,e,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},Jf.prototype.getSize=function(){return this.size_},Jf.prototype.getSrc=function(){return this.src_},Jf.prototype.load=function(){if(this.imageState_==Ni.IDLE){this.imageState_=Ni.LOADING,this.imageListenerKeys_=[p(this.image_,O,this.handleImageError_,this),p(this.image_,k,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},Jf.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var e=t.getImageData(0,0,this.image_.width,this.image_.height),i=e.data,r=this.color_[0]/255,n=this.color_[1]/255,o=this.color_[2]/255,s=0,a=i.length;s<a;s+=4)i[s]*=r,i[s+1]*=n,i[s+2]*=o;t.putImageData(e,0,0)}},Jf.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(f),this.imageListenerKeys_=null};var Qf,$f="bottom-left",tg="bottom-right",eg="top-left",ig="top-right",rg=function(t){var e=t||{};this.anchor_=void 0!==e.anchor?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==e.anchorOrigin?e.anchorOrigin:eg,this.anchorXUnits_=void 0!==e.anchorXUnits?e.anchorXUnits:Hf,this.anchorYUnits_=void 0!==e.anchorYUnits?e.anchorYUnits:Hf,this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null;var i=void 0!==e.img?e.img:null,r=void 0!==e.imgSize?e.imgSize:null,n=e.src;$(!(void 0!==n&&i),4),$(!i||i&&r,5),void 0!==n&&0!==n.length||!i||(n=i.src||wt(i).toString()),$(void 0!==n&&0<n.length,6);var o,s,a,h,l,u,c,p=void 0!==e.src?Ni.IDLE:Ni.LOADED;this.color_=void 0!==e.color?ti(e.color):null,this.iconImage_=(o=i,s=n,a=r,h=this.crossOrigin_,l=p,u=this.color_,(c=Yl.get(s,h,u))||(c=new Jf(o,s,a,h,l,u),Yl.set(s,h,u,c)),c),this.offset_=void 0!==e.offset?e.offset:[0,0],this.offsetOrigin_=void 0!==e.offsetOrigin?e.offsetOrigin:eg,this.origin_=null,this.size_=void 0!==e.size?e.size:null;var d=void 0!==e.opacity?e.opacity:1,f=void 0!==e.rotateWithView&&e.rotateWithView,g=void 0!==e.rotation?e.rotation:0,_=void 0!==e.scale?e.scale:1,v=void 0===e.snapToPixel||e.snapToPixel;hr.call(this,{opacity:d,rotation:g,scale:_,snapToPixel:v,rotateWithView:f})};t(rg,hr),rg.prototype.clone=function(){return new rg({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:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},rg.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Hf||this.anchorYUnits_==Hf){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Hf&&(t[0]*=e[0]),this.anchorYUnits_==Hf&&(t[1]*=e[1])}if(this.anchorOrigin_!=eg){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=ig&&this.anchorOrigin_!=tg||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=$f&&this.anchorOrigin_!=tg||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},rg.prototype.getColor=function(){return this.color_},rg.prototype.getImage=function(t){return this.iconImage_.getImage(t)},rg.prototype.getImageSize=function(){return this.iconImage_.getSize()},rg.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},rg.prototype.getImageState=function(){return this.iconImage_.getImageState()},rg.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},rg.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=eg){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=ig&&this.offsetOrigin_!=tg||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=$f&&this.offsetOrigin_!=tg||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},rg.prototype.getSrc=function(){return this.iconImage_.getSrc()},rg.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},rg.prototype.listenImageChange=function(t,e){return S(this.iconImage_,E,t,e)},rg.prototype.load=function(){this.iconImage_.load()},rg.prototype.unlistenImageChange=function(t,e){d(this.iconImage_,E,t,e)};var ng,og,sg,ag,hg,lg,ug,cg,pg=null,dg=null,fg=null,gg=null,_g=null,vg=null;var yg=function(t){var e=t||{};Fd.call(this),vg||(pg=new cr({color:Qf=[255,255,255,1]}),dg=new rg({anchor:ng=[20,2],anchorOrigin:$f,anchorXUnits:og=qf,anchorYUnits:sg=qf,crossOrigin:"anonymous",rotation:0,scale:lg=.5,size:ag=[64,64],src:hg="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),ug="NO_IMAGE",fg=new pr({color:Qf,width:1}
1),cg=new pr({color:[51,51,51,1],width:2}),gg=new Hn({font:"bold 16px Helvetica",fill:pg,stroke:cg,scale:.8}),_g=new dr({fill:pg,image:dg,text:gg,stroke:fg,zIndex:0}),vg=[_g]),this.dataProjection=Ee("EPSG:4326"),this.defaultStyle_=e.defaultStyle?e.defaultStyle:vg,this.extractStyles_=void 0===e.extractStyles||e.extractStyles,this.writeStyles_=void 0===e.writeStyles||e.writeStyles,this.sharedStyles_={},this.showPointNames_=void 0===e.showPointNames||e.showPointNames};t(yg,Fd);var mg=["http://www.google.com/kml/ext/2.2"],xg=[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"],Sg={fraction:Hf,pixels:qf,insetPixels:qf};function Cg(t,e){var i=null,r=[0,0],n="start";if(t.getImage()){var o=t.getImage().getImageSize();if(null===o&&(o=ag),2==o.length){var s=t.getImage().getScale();r[0]=s*o[0]/2,r[1]=-s*o[1]/2,n="left"}}if(null!==t.getText()){var a=t.getText();(i=a.clone()).setFont(a.getFont()||gg.getFont()),i.setScale(a.getScale()||gg.getScale()),i.setFill(a.getFill()||gg.getFill()),i.setStroke(a.getStroke()||cg)}else i=gg.clone();return i.setText(e),i.setOffsetX(r[0]),i.setOffsetY(r[1]),i.setTextAlign(n),new dr({text:i})}function wg(a,h,l,u,c){return function(t,e){var i,r=c,n="";if(r){var o=t.getGeometry();o&&(r=o.getType()===Zt.POINT)}if(r&&(n=t.get("name"),r=r&&n),a)return r?(i=Cg(a[0],n),a.concat(i)):a;if(h){var s=function t(e,i,r){return Array.isArray(e)?e:"string"==typeof e?(!(e in r)&&"#"+e in r&&(e="#"+e),t(r[e],i,r)):i}(h,l,u);return r?(i=Cg(s[0],n),s.concat(i)):s}return r?(i=Cg(l[0],n),l.concat(i)):l}}function Eg(t){var e=ld(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 Tg(t){for(var e,i=ld(t,!1),r=[],n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=n.exec(i);){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=e[3]?parseFloat(e[3]):0;r.push(o,s,a),i=i.substr(e[0].length)}if(""===i)return r}function Rg(t){var e=ld(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function Ig(t){return Ad(t)}var Fg=wd(xg,{Pair:function(t,e){var i=Td({},n_,t,e);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 Lg(t,e){return Td(void 0,Fg,t,e)}var Pg=wd(xg,{Icon:vd(function(t,e){var i=Td({},Ug,t,e);return i||null}),heading:vd(Ad),hotSpot:vd(function(t){var e,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return e="insetPixels"!==i?"insetPixels"!==r?$f:eg:"insetPixels"!==r?tg:ig,{x:parseFloat(t.getAttribute("x")),xunits:Sg[i],y:parseFloat(t.getAttribute("y")),yunits:Sg[r],origin:e}}),scale:vd(Ig)});var Mg=wd(xg,{color:vd(Eg),scale:vd(Ig)});var bg=wd(xg,{color:vd(Eg),width:vd(Ad)});var Og=wd(xg,{color:vd(Eg),fill:vd(bd),outline:vd(bd)});var Ng=wd(xg,{coordinates:gd(Tg)});function Ag(t,e){return Td(null,Ng,t,e)}var kg=wd(mg,{Track:fd(Dg)});var Gg=wd(xg,{when:function(t,e){var i=e[e.length-1].whens,r=ld(t,!1),n=Date.parse(r);i.push(isNaN(n)?0:n)}},wd(mg,{coord:function(t,e){var i=e[e.length-1].flatCoordinates,r=ld(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]),s=parseFloat(n[2]),a=parseFloat(n[3]);i.push(o,s,a,0)}else i.push(0,0,0,0)}}));function Dg(t,e){var i=Td({flatCoordinates:[],whens:[]},Gg,t,e);if(i){for(var r=i.flatCoordinates,n=i.whens,o=0,s=Math.min(r.length,n.length);o<s;++o)r[4*o+3]=n[o];var a=new Bn(null);return a.setFlatCoordinates(Dr.XYZM,r),a}}var Ug=wd(xg,{href:vd(Rg)},wd(mg,{x:vd(Ad),y:vd(Ad),w:vd(Ad),h:vd(Ad)}));var jg=wd(xg,{coordinates:gd(Tg)});function zg(t,e){return Td(null,jg,t,e)}var Bg=wd(xg,{extrude:vd(bd),tessellate:vd(bd),altitudeMode:vd(Ud)});function Yg(t,e){var i=Td({},Bg,t,e),r=zg(t,e);if(r){var n=new Bn(null);return n.setFlatCoordinates(Dr.XYZ,r),n.setProperties(i),n}}function Xg(t,e){var i=Td({},Bg,t,e),r=zg(t,e);if(r){var n=new xn(null);return n.setFlatCoordinates(Dr.XYZ,r,[r.length]),n.setProperties(i),n}}var Vg=wd(xg,{LineString:fd(Yg),LinearRing:fd(Xg),MultiGeometry:fd(Wg),Point:fd(Kg),Polygon:fd(Hg)});function Wg(t,e){var i,r=Td([],Vg,t,e);if(!r)return null;if(0===r.length)return new bf(r);for(var n,o,s=!0,a=r[0].getType(),h=1,l=r.length;h<l;++h)if(r[h].getType()!=a){s=!1;break}
1if(s)if(a==Zt.POINT){var u=r[0];n=u.getLayout(),o=u.getFlatCoordinates();for(var c=1,p=r.length;c<p;++c)Or(o,r[c].getFlatCoordinates());(i=new nh(null)).setFlatCoordinates(n,o),Qg(i,r)}else a==Zt.LINE_STRING?((i=new rh(null)).setLineStrings(r),Qg(i,r)):a==Zt.POLYGON?((i=new sh(null)).setPolygons(r),Qg(i,r)):a==Zt.GEOMETRY_COLLECTION?i=new bf(r):$(!1,37);else i=new bf(r);return i}function Kg(t,e){var i=Td({},Bg,t,e),r=zg(t,e);if(r){var n=new sn(null);return n.setFlatCoordinates(Dr.XYZ,r),n.setProperties(i),n}}var Zg=wd(xg,{innerBoundaryIs:function(t,e){var i=Td(void 0,h_,t,e);if(i){var r=e[e.length-1];r.push(i)}},outerBoundaryIs:function(t,e){var i=Td(void 0,l_,t,e);if(i){var r=e[e.length-1];r[0]=i}}});function Hg(t,e){var i=Td({},Bg,t,e),r=Td([null],Zg,t,e);if(r&&r[0]){for(var n=new xn(null),o=r[0],s=[o.length],a=1,h=r.length;a<h;++a)Or(o,r[a]),s.push(o.length);return n.setFlatCoordinates(Dr.XYZ,o,s),n.setProperties(i),n}}var qg=wd(xg,{IconStyle:function(t,e){var i=Td({},Pg,t,e);if(i){var r,n,o,s,a=e[e.length-1],h="Icon"in i?i.Icon:{},l=!("Icon"in i)||0<Object.keys(h).length,u=h.href;u?r=u:l&&(r=hg);var c,p=$f,d=i.hotSpot;d?(n=[d.x,d.y],o=d.xunits,s=d.yunits,p=d.origin):r===hg?(n=ng,o=og,s=sg):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(n=[.5,0],s=o=Hf);var f,g=h.x,_=h.y;void 0!==g&&void 0!==_&&(c=[g,_]);var v,y=h.w,m=h.h;void 0!==y&&void 0!==m&&(f=[y,m]);var x=i.heading;void 0!==x&&(v=Vt(x));var S=i.scale;if(l){r==hg&&(f=ag,void 0===S&&(S=lg));var C=new rg({anchor:n,anchorOrigin:p,anchorXUnits:o,anchorYUnits:s,crossOrigin:"anonymous",offset:c,offsetOrigin:$f,rotation:v,scale:S,size:f,src:r});a.imageStyle=C}else a.imageStyle=ug}},LabelStyle:function(t,e){var i=Td({},Mg,t,e);if(i){var r=e[e.length-1],n=new Hn({fill:new cr({color:"color"in i?i.color:Qf}),scale:i.scale});r.textStyle=n}},LineStyle:function(t,e){var i=Td({},bg,t,e);if(i){var r=e[e.length-1],n=new pr({color:"color"in i?i.color:Qf,width:"width"in i?i.width:1});r.strokeStyle=n}},PolyStyle:function(t,e){var i=Td({},Og,t,e);if(i){var r=e[e.length-1],n=new cr({color:"color"in i?i.color:Qf});r.fillStyle=n;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function Jg(t,e){var i=Td({},qg,t,e);if(!i)return null;var r="fillStyle"in i?i.fillStyle:pg,n=i.fill;void 0===n||n||(r=null);var o="imageStyle"in i?i.imageStyle:dg;o==ug&&(o=void 0);var s="textStyle"in i?i.textStyle:gg,a="strokeStyle"in i?i.strokeStyle:fg,h=i.outline;return void 0===h||h||(a=null),[new dr({fill:r,image:o,stroke:a,text:s,zIndex:void 0})]}function Qg(t,e){var i,r,n,o=e.length,s=new Array(e.length),a=new Array(e.length),h=new Array(e.length);i=r=n=!1;for(var l=0;l<o;++l){var u=e[l];s[l]=u.get("extrude"),a[l]=u.get("tessellate"),h[l]=u.get("altitudeMode"),i=i||void 0!==s[l],r=r||void 0!==a[l],n=n||h[l]}i&&t.set("extrude",s),r&&t.set("tessellate",a),n&&t.set("altitudeMode",h)}var $g=wd(xg,{displayName:vd(Ud),value:vd(Ud)});var t_=wd(xg,{Data:function(t,e){var i=t.getAttribute("name");Ed($g,t,e);var r=e[e.length-1];null!==i?r[i]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,e){Ed(o_,t,e)}});function e_(t,e){Ed(t_,t,e)}var i_=wd(xg,{LatLonAltBox:function(t,e){var i=Td({},s_,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=Td({},a_,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)}});function r_(t,e){Ed(i_,t,e)}var n_=wd(xg,{Style:vd(Jg),key:vd(Ud),styleUrl:vd(Rg)});var o_=wd(xg,{SimpleData:function(t,e){var i=t.getAttribute("name");if(null!==i){var r=Ud(t),n=e[e.length-1];n[i]=r}}});var s_=wd(xg,{altitudeMode:vd(Ud),minAltitude:vd(Ad),maxAltitude:vd(Ad),north:vd(Ad),south:vd(Ad),east:vd(Ad),west:vd(Ad)});var a_=wd(xg,{minLodPixels:vd(Ad),maxLodPixels:vd(Ad),minFadeExtent:vd(Ad),maxFadeExtent:vd(Ad)});var h_=wd(xg,{LinearRing:gd(Ag)});var l_=wd(xg,{LinearRing:gd(Ag)});var u_=wd(xg,{ExtendedData:e_,Region:r_,Link:function(t,e){Ed(c_,t,e)},address:vd(Ud),description:vd(Ud),name:vd(Ud),open:vd(bd),phoneNumber:vd(Ud),visibility:vd(bd)}),c_=wd(xg,{href:vd(Rg)});var p_=wd(xg,{ExtendedData:e_,Region:r_,MultiGeometry:vd(Wg,"geometry"),LineString:vd(Yg,"geometry"),LinearRing:vd(Xg,"geometry"),Point:vd(Kg,"geometry"),Polygon:vd(Hg,"geometry"),Style:vd(Jg),StyleMap:function(t,e){var i=Lg(t,e);if(i){var r=e[e.length-1];Array.isArray(i)?r.Style=i:"string"==typeof i?r.styleUrl=i:$(!1,38)}},address:vd(Ud),description:vd(Ud),name:vd(Ud),open:vd(bd),phoneNumber:vd(Ud),styleUrl:vd(Rg),visibility:vd(bd)},wd(mg,{MultiTrack:vd(function(t,e){var i=Td([],kg,t,e);if(i){var r=new rh(null);return r.setLineStrings(i),r}},"geometry"),Track:vd(Dg,"geometry")}));function d_(t,e){for(var i=ti(e),r=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],n=0;n<4;++n){var o=parseInt(r[n],10).toString(16);r[n]=1==o.length?"0"+o:o}Yd(t,r.join(""))}yg.prototype.readDocumentOrFolder_=function(t,e){var i=Td([],wd(xg,{Document:dd(this.readDocumentOrFolder_,this),Folder:dd(this.readDocumentOrFolder_,this),Placemark:fd(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return i||void 0},yg.prototype.readPlacemark_=function(t,e){var i=Td({geometry:null},p_,t,e);if(i){var r=new yr,n=t.getAttribute("id");null!==n&&r.setId(n);var o=e[0],s=i.geometry;if(s&&qp(s,!1,o),r.setGeometry(s),delete i.geometry,this.extractStyles_){var a=wg(i.Style,i.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);r.setStyle(a)}return delete i.Style,r.setProperties(i),r}},yg.prototype.readSharedStyle_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=Jg(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}}},yg.prototype.readSharedStyleMap_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=Lg(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}}},yg.prototype.readFeatureFromNode=function(t,e){if(!Pr(xg,t.namespaceURI))return null;var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i||null}
1,yg.prototype.readFeaturesFromNode=function(t,e){var i;if(!Pr(xg,t.namespaceURI))return[];var 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 s=this.readFeaturesFromNode(o,e);s&&Or(i,s)}return i}return[]},yg.prototype.readName=function(t){if(ud(t))return this.readNameFromDocument(t);if(cd(t))return this.readNameFromNode(t);if("string"==typeof t){var e=pd(t);return this.readNameFromDocument(e)}},yg.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}},yg.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(Pr(xg,e.namespaceURI)&&"name"==e.localName)return Ud(e);for(var i=t.firstElementChild;i;i=i.nextElementSibling){var r=i.localName;if(Pr(xg,i.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(i);if(n)return n}}},yg.prototype.readNetworkLinks=function(t){var e=[];if(ud(t))Or(e,this.readNetworkLinksFromDocument(t));else if(cd(t))Or(e,this.readNetworkLinksFromNode(t));else if("string"==typeof t){var i=pd(t);Or(e,this.readNetworkLinksFromDocument(i))}return e},yg.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&Or(e,this.readNetworkLinksFromNode(i));return e},yg.prototype.readNetworkLinksFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(Pr(xg,i.namespaceURI)&&"NetworkLink"==i.localName){var r=Td({},u_,i,[]);e.push(r)}for(var n=t.firstElementChild;n;n=n.nextElementSibling){var o=n.localName;!Pr(xg,n.namespaceURI)||"Document"!=o&&"Folder"!=o&&"kml"!=o||Or(e,this.readNetworkLinksFromNode(n))}return e},yg.prototype.readRegion=function(t){var e=[];if(ud(t))Or(e,this.readRegionFromDocument(t));else if(cd(t))Or(e,this.readRegionFromNode(t));else if("string"==typeof t){var i=pd(t);Or(e,this.readRegionFromDocument(i))}return e},yg.prototype.readRegionFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&Or(e,this.readRegionFromNode(i));return e},yg.prototype.readRegionFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(Pr(xg,i.namespaceURI)&&"Region"==i.localName){var r=Td({},i_,i,[]);e.push(r)}for(var n=t.firstElementChild;n;n=n.nextElementSibling){var o=n.localName;!Pr(xg,n.namespaceURI)||"Document"!=o&&"Folder"!=o&&"kml"!=o||Or(e,this.readRegionFromNode(n))}return e};var f_=wd(xg,{Data:yd(function(t,e,i){t.setAttribute("name",e.name);var r={node:t},n=e.value;"object"==typeof n?(null!==n&&n.displayName&&Id(r,f_,Sd,[n.displayName],i,["displayName"]),null!==n&&n.value&&Id(r,f_,Sd,[n.value],i,["value"])):Id(r,f_,Sd,[n],i,["value"])}),value:yd(function(t,e){Yd(t,e)}),displayName:yd(function(t,e){i=t,r=e,i.appendChild(sd.createCDATASection(r));var i,r})});var g_=wd(xg,{Placemark:yd(j_)}),__=function(t,e,i){return hd(e[e.length-1].node.namespaceURI,"Placemark")};var v_=xd("Data");var y_=wd(xg,["href"],wd(mg,["x","y","w","h"])),m_=wd(xg,{href:yd(Yd)},wd(mg,{x:yd(zd),y:yd(zd),w:yd(zd),h:yd(zd)})),x_=function(t,e,i){return hd(mg[0],"gx:"+i)};var S_=wd(xg,["scale","heading","Icon","hotSpot"]),C_=wd(xg,{Icon:yd(function(t,e,i){var r={node:t},n=i[i.length-1].node,o=y_[n.namespaceURI],s=Cd(e,o);Id(r,m_,Sd,s,i,o),s=Cd(e,o=y_[mg[0]]),Id(r,m_,x_,s,i,o)}),heading:yd(zd),hotSpot:yd(function(t,e){t.setAttribute("x",e.x),t.setAttribute("y",e.y),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)}),scale:yd(q_)});var w_=wd(xg,["color","scale"]),E_=wd(xg,{color:yd(d_),scale:yd(q_)});var T_=wd(xg,["color","width"]),R_=wd(xg,{color:yd(d_),width:yd(zd)});var I_={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"}
1,F_=function(t,e,i){if(t)return hd(e[e.length-1].node.namespaceURI,I_[t.getType()])},L_=xd("Point"),P_=xd("LineString"),M_=xd("LinearRing"),b_=xd("Polygon"),O_=wd(xg,{LineString:yd(Y_),Point:yd(Y_),Polygon:yd(K_),GeometryCollection:yd(N_)});function N_(t,e,i){var r,n,o={node:t},s=e.getType();s==Zt.GEOMETRY_COLLECTION?(r=e.getGeometries(),n=F_):s==Zt.MULTI_POINT?(r=e.getPoints(),n=L_):s==Zt.MULTI_LINE_STRING?(r=e.getLineStrings(),n=P_):s==Zt.MULTI_POLYGON?(r=e.getPolygons(),n=b_):$(!1,39),Id(o,O_,n,r,i)}var A_=wd(xg,{LinearRing:yd(Y_)});function k_(t,e,i){Id({node:t},A_,M_,[e],i)}var G_=wd(xg,{ExtendedData:yd(function(t,e,i){for(var r={node:t},n=e.names,o=e.values,s=n.length,a=0;a<s;a++)Id(r,f_,v_,[{name:n[a],value:o[a]}],i)}),MultiGeometry:yd(N_),LineString:yd(Y_),LinearRing:yd(Y_),Point:yd(Y_),Polygon:yd(K_),Style:yd(function(t,e,i){var r={node:t},n={},o=e.getFill(),s=e.getStroke(),a=e.getImage(),h=e.getText();a instanceof rg&&(n.IconStyle=a);h&&(n.LabelStyle=h);s&&(n.LineStyle=s);o&&(n.PolyStyle=o);var l=i[i.length-1].node,u=J_[l.namespaceURI],c=Cd(n,u);Id(r,Q_,Sd,c,i,u)}),address:yd(Yd),description:yd(Yd),name:yd(Yd),open:yd(jd),phoneNumber:yd(Yd),styleUrl:yd(Yd),visibility:yd(jd)}),D_=wd(xg,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),U_=xd("ExtendedData");function j_(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 s=Object.keys(n||{}).sort().filter(function(t){return!o[t]});if(0<s.length){var a=Cd(n,s);Id(r,G_,U_,[{names:s,values:a}],i)}var h=e.getStyleFunction();if(h){var l=h(e,0);if(l){var u=Array.isArray(l)?l[0]:l;this.writeStyles_&&(n.Style=u);var c=u.getText();c&&(n.name=c.getText())}}var p=i[i.length-1].node,d=D_[p.namespaceURI],f=Cd(n,d);Id(r,G_,Sd,f,i,d);var g=i[0],_=e.getGeometry();_&&(_=qp(_,!0,g)),Id(r,G_,F_,[_],i)}var z_=wd(xg,["extrude","tessellate","altitudeMode","coordinates"]),B_=wd(xg,{extrude:yd(jd),tessellate:yd(jd),altitudeMode:yd(Yd),coordinates:yd(function(t,e,i){var r,n=i[i.length-1],o=n.layout,s=n.stride;o==Dr.XY||o==Dr.XYM?r=2:o==Dr.XYZ||o==Dr.XYZM?r=3:$(!1,34);var a=e.length,h="";if(0<a){h+=e[0];for(var l=1;l<r;++l)h+=","+e[l];for(var u=s;u<a;u+=s){h+=" "+e[u];for(var c=1;c<r;++c)h+=","+e[u+c]}}Yd(t,h)})});function Y_(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 s=i[i.length-1].node,a=z_[s.namespaceURI],h=Cd(o,a);Id(n,B_,Sd,h,i,a)}var X_=wd(xg,{outerBoundaryIs:yd(k_),innerBoundaryIs:yd(k_)}),V_=xd("innerBoundaryIs"),W_=xd("outerBoundaryIs");function K_(t,e,i){var r=e.getLinearRings(),n=r.shift(),o={node:t};Id(o,X_,V_,r,i),Id(o,X_,W_,[n],i)}var Z_=wd(xg,{color:yd(d_)}),H_=xd("color");function q_(t,e){zd(t,Math.round(1e6*e)/1e6)}var J_=wd(xg,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Q_=wd(xg,{IconStyle:yd(function(t,e,i){var r={node:t},n={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),h={href:o};if(s){h.w=s[0],h.h=s[1];var l=e.getAnchor(),u=e.getOrigin();if(u&&a&&0!==u[0]&&u[1]!==s[1]&&(h.x=u[0],h.y=a[1]-(u[1]+s[1])),l&&(l[0]!==s[0]/2||l[1]!==s[1]/2)){var c={x:l[0],xunits:qf,y:s[1]-l[1],yunits:qf};n.hotSpot=c}}n.Icon=h;var p=e.getScale();1!==p&&(n.scale=p);var d=e.getRotation();0!==d&&(n.heading=d);var f=i[i.length-1].node,g=S_[f.namespaceURI],_=Cd(n,g);Id(r,C_,Sd,_,i,g)}),LabelStyle:yd(function(t,e,i){var r={node:t},n={},o=e.getFill();o&&(n.color=o.getColor());var s=e.getScale();s&&1!==s&&(n.scale=s);var a=i[i.length-1].node,h=w_[a.namespaceURI],l=Cd(n,h);Id(r,E_,Sd,l,i,h)}),LineStyle:yd(function(t,e,i){var r={node:t},n={color:e.getColor(),width:e.getWidth()},o=i[i.length-1].node,s=T_[o.namespaceURI],a=Cd(n,s);Id(r,R_,Sd,a,i,s)}),PolyStyle:yd(function(t,e,i){Id({node:t},Z_,H_,[e.getColor()],i)})});var $_=wd(xg,["Document","Placemark"]),tv=wd(xg,{Document:yd(function(t,e,i){Id({node:t},g_,__,e,i,void 0,this)}),Placemark:yd(j_)});yg.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=hd(xg[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",mg[0]),i.setAttributeNS(r,"xmlns:xsi",ad),i.setAttributeNS(ad,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var n={node:i}
1,o={};1<t.length?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=$_[i.namespaceURI],a=Cd(o,s);return Id(n,tv,Sd,a,[e],s,this),i};var ev=function(t,e,i,r,n){var o,s,a=8*n-r-1,h=(1<<a)-1,l=h>>1,u=-7,c=i?n-1:0,p=i?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-u)-1,d>>=-u,u+=a;0<u;o=256*o+t[e+c],c+=p,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;0<u;s=256*s+t[e+c],c+=p,u-=8);if(0===o)o=1-l;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=l}return(d?-1:1)*s*Math.pow(2,o-r)},iv=function(t,e,i,r,n,o){var s,a,h,l=8*o-n-1,u=(1<<l)-1,c=u>>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?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),2<=(e+=1<=s+c?p/h:p*Math.pow(2,1-c))*h&&(s++,h/=2),u<=s+c?(a=0,s=u):1<=s+c?(a=(e*h-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));8<=n;t[i+d]=255&a,d+=f,a/=256,n-=8);for(s=s<<n|a,l+=n;0<l;t[i+d]=255&s,d+=f,s/=256,l-=8);t[i+d-f]|=128*g},rv=nv;function nv(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}nv.Varint=0,nv.Fixed64=1,nv.Bytes=2,nv.Fixed32=5;var ov=4294967296,sv=1/ov;function av(t){return t.type===nv.Bytes?t.readVarint()+t.pos:t.pos+1}function hv(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function lv(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;t<=n;n--)i.buf[n+r]=i.buf[n]}function uv(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function cv(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function pv(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function dv(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function fv(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function gv(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function _v(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function vv(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function yv(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function mv(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function xv(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Sv(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}nv.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=mv(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Sv(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=mv(this.buf,this.pos)+mv(this.buf,this.pos+4)*ov;return this.pos+=8,t},readSFixed64:function(){var t=mv(this.buf,this.pos)+Sv(this.buf,this.pos+4)*ov;return this.pos+=8,t},readFloat:function(){var t=ev(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ev(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 hv(t,r,e);if(n=o[i.pos++],r|=(127&n)<<3,n<128)return hv(t,r,e);if(n=o[i.pos++],r|=(127&n)<<10,n<128)return hv(t,r,e);if(n=o[i.pos++],r|=(127&n)<<17,n<128)return hv(t,r,e);if(n=o[i.pos++],r|=(127&n)<<24,n<128)return hv(t,r,e);if(n=o[i.pos++],r|=(1&n)<<31,n<128)return hv(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=function(t,e,i){var r="",n=e;for(;n<i;){var o,s,a,h=t[n],l=null,u=239<h?4:223<h?3:191<h?2:1;if(i<n+u)break;
11===u?h<128&&(l=h):2===u?128==(192&(o=t[n+1]))&&(l=(31&h)<<6|63&o)<=127&&(l=null):3===u?(o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&((l=(15&h)<<12|(63&o)<<6|63&s)<=2047||55296<=l&&l<=57343)&&(l=null)):4===u&&(o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((l=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||1114112<=l)&&(l=null)),null===l?(l=65533,u=1):65535<l&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=u}return r}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var i=av(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=av(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===nv.Varint)for(;127<this.buf[this.pos++];);else if(e===nv.Bytes)this.pos=this.readVarint()+this.pos;else if(e===nv.Fixed32)this.pos+=4;else{if(e!==nv.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),xv(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),xv(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),xv(this.buf,-1&t,this.pos),xv(this.buf,Math.floor(t*sv),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),xv(this.buf,-1&t,this.pos),xv(this.buf,Math.floor(t*sv),this.pos+4),this.pos+=8},writeVarint:function(t){268435455<(t=+t||0)||t<0?function(t,e){var i,r;0<=t?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:r=r+1|(i=0));if(0x10000000000000000<=t||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),n=i,o=e,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos]=127&n,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);var n,o}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?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(55295<(r=e.charCodeAt(o))&&r<57344){if(!n){56319<r||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;128<=i&&lv(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),iv(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),iv(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;128<=r&&lv(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}
1,writeMessage:function(t,e,i){this.writeTag(t,nv.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){this.writeMessage(t,uv,e)},writePackedSVarint:function(t,e){this.writeMessage(t,cv,e)},writePackedBoolean:function(t,e){this.writeMessage(t,fv,e)},writePackedFloat:function(t,e){this.writeMessage(t,pv,e)},writePackedDouble:function(t,e){this.writeMessage(t,dv,e)},writePackedFixed32:function(t,e){this.writeMessage(t,gv,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,_v,e)},writePackedFixed64:function(t,e){this.writeMessage(t,vv,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,yv,e)},writeBytesField:function(t,e){this.writeTag(t,nv.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,nv.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,nv.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,nv.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,nv.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,nv.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,nv.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,nv.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,nv.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,nv.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Cv=function(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},wv=[1,0,0,1,0,0];Cv.prototype.get=function(t){return this.properties_[t]},Cv.prototype.getEnds=Cv.prototype.getEndss=function(){return this.ends_},Cv.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Zt.POINT?dt(this.flatCoordinates_):gt(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},Cv.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=It(this.getExtent());this.flatInteriorPoints_=un(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},Cv.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=oh(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=cn(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},Cv.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Un(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},Cv.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],s=Un(t,e,o,2,.5);Or(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},Cv.prototype.getId=function(){return this.id_},Cv.prototype.getFlatCoordinates=Cv.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},Cv.prototype.getGeometry=function(){return this},Cv.prototype.getProperties=function(){return this.properties_},Cv.prototype.getSimplifiedGeometry=Cv.prototype.getGeometry,Cv.prototype.getStride=function(){return 2},Cv.prototype.getStyleFunction=F,Cv.prototype.getType=function(){return this.type_},Cv.prototype.transform=function(t,e){var i=(t=Ee(t)).getExtent(),r=t.getWorldExtent(),n=Lt(r)/Lt(i);Xe(wv,r[0],r[3],n,-n,0,0,0),Dt(this.flatCoordinates_,0,this.flatCoordinates_.length,2,wv,this.flatCoordinates_)};var Ev=function(t){Hp.call(this);var e=t||{};this.dataProjection=new ee({code:"",units:$t.TILE_PIXELS}),this.featureClass_=e.featureClass?e.featureClass:Cv,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.extent_=null};function Tv(t,e,i){if(3===t){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Rv,r,n),r.length=r.features.length,r.length&&(e[r.name]=r)}}function Rv(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 Iv(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 Fv(t,e,i){t.pos=e.features[i];var r=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Iv,n,r),n}
1t(Ev,Hp),Ev.prototype.readRawGeometry_=function(t,e,i,r){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,o=1,s=0,a=0,h=0,l=0,u=0;t.pos<n;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),h+=t.readSVarint(),1===o&&u<l&&(r.push(l),u=l),i.push(a,h),l+=2):7===o?u<l&&(i.push(i[u],i[u+1]),l+=2):$(!1,59)}u<l&&(r.push(l),u=l)},Ev.prototype.createFeature_=function(t,e,i){var r,n=e.type;if(0===n)return null;var o=e.id,s=e.properties;s[this.layerName_]=e.layer.name;var a=[],h=[];this.readRawGeometry_(t,e,a,h);var l,u,c,p=(l=n,u=h.length,1===l?c=1===u?Zt.POINT:Zt.MULTI_POINT:2===l?c=1===u?Zt.LINE_STRING:Zt.MULTI_LINE_STRING:3===l&&(c=Zt.POLYGON),c);if(this.featureClass_===Cv)r=new this.featureClass_(p,a,h,s,o);else{var d;if(p==Zt.POLYGON){for(var f=[],g=0,_=0,v=0,y=h.length;v<y;++v){var m=h[v];_n(a,g,m,2)||(f.push(h.slice(_,v)),_=v),g=m}1<f.length?(h=f,d=new sh(null)):d=new xn(null)}else d=p===Zt.POINT?new sn(null):p===Zt.LINE_STRING?new Bn(null):p===Zt.POLYGON?new xn(null):p===Zt.MULTI_POINT?new nh(null):p===Zt.MULTI_LINE_STRING?new rh(null):null;d.setFlatCoordinates(Dr.XY,a,h),r=new this.featureClass_,this.geometryName_&&r.setGeometryName(this.geometryName_);var x=qp(d,!1,this.adaptOptions(i));r.setGeometry(x),r.setId(o),r.setProperties(s)}return r},Ev.prototype.getLastExtent=function(){return this.extent_},Ev.prototype.getType=function(){return ph.ARRAY_BUFFER},Ev.prototype.readFeatures=function(t,e){var i=this.layers_,r=new rv(t),n=r.readFields(Tv,{}),o=[];for(var s in n)if(!i||-1!=i.indexOf(s)){for(var a=n[s],h=0,l=a.length;h<l;++h){var u=Fv(r,a,h);o.push(this.createFeature_(r,u))}this.extent_=a?[0,0,a.extent,a.extent]:null}return o},Ev.prototype.readProjection=function(t){return this.dataProjection},Ev.prototype.setLayers=function(t){this.layers_=t},Ev.prototype.readFeature=function(){},Ev.prototype.readGeometry=function(){},Ev.prototype.writeFeature=function(){},Ev.prototype.writeGeometry=function(){},Ev.prototype.writeFeatures=function(){};var Lv=function(){Fd.call(this),this.dataProjection=Ee("EPSG:4326")};t(Lv,Fd);var Pv=[null],Mv=wd(Pv,{nd:function(t,e){e[e.length-1].ndrefs.push(t.getAttribute("ref"))},tag:Nv}),bv=wd(Pv,{node:function(t,e){var i=e[0],r=e[e.length-1],n=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];r.nodes[n]=o;var s=Td({tags:{}},Ov,t,e);if(!Et(s.tags)){var a=new sn(o);qp(a,!1,i);var h=new yr(a);h.setId(n),h.setProperties(s.tags),r.features.push(h)}},way:function(t,e){var i=Td({id:t.getAttribute("id"),ndrefs:[],tags:{}},Mv,t,e);e[e.length-1].ways.push(i)}}),Ov=wd(Pv,{tag:Nv});function Nv(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}function Av(t,e,i,r,n,o){var s,a;void 0!==n?(s=n,a=void 0!==o?o:0):(s=[],a=0);for(var h=e;h<i;){var l=t[h++];s[a++]=t[h++],s[a++]=l;for(var u=2;u<r;++u)s[a++]=t[h++]}return s.length=a,s}Lv.prototype.readFeaturesFromNode=function(t,e){var i=this.getReadOptions(t,e);if("osm"==t.localName){for(var r=Td({nodes:{},ways:[],features:[]},bv,t,[i]),n=0;n<r.ways.length;n++){for(var o=r.ways[n],s=[],a=0,h=o.ndrefs.length;a<h;a++){Or(s,r.nodes[o.ndrefs[a]])}var l=void 0;o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?(l=new xn(null)).setFlatCoordinates(Dr.XY,s,[s.length]):(l=new Bn(null)).setFlatCoordinates(Dr.XY,s),qp(l,!1,i);var u=new yr(l);u.setId(o.id),u.setProperties(o.tags),r.features.push(u)}if(r.features)return r.features}return[]},Lv.prototype.writeFeatureNode=function(t,e){},Lv.prototype.writeFeaturesNode=function(t,e){},Lv.prototype.writeGeometryNode=function(t,e){};var kv=function(t){var e=t||{};Uf.call(this),this.dataProjection=Ee("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:Dr.XY};function Gv(t,e,i){var r,n=i||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var s=0,a=t.length;s<a;)for(r=0;r<e;++r,++s){var h=t[s],l=h-o[r];o[r]=h,t[s]=l}return Uv(t,n)}function Dv(t,e,i){var r,n=i||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var s=jv(t,n),a=0,h=s.length;a<h;)for(r=0;r<e;++r,++a)o[r]+=s[a],s[a]=o[r];return s}function Uv(t,e){for(var i=e||1e5,r=0,n=t.length;r<n;++r)t[r]=Math.round(t[r]*i);return function(t){for(var e=0,i=t.length;e<i;++e){var r=t[e];t[e]=r<0?~(r<<1):r<<1}return function(t){for(var e="",i=0,r=t.length;i<r;++i)e+=zv(t[i]);return e}(t)}(t)}function jv(t,e){for(var i=e||1e5,r=function(t){for(var e=function(t){for(var e=[],i=0,r=0,n=0,o=t.length;n<o;++n){var s=t.charCodeAt(n)-63;i|=(31&s)<<r,s<32?(e.push(i),r=i=0):r+=5}return e}(t),i=0,r=e.length;i<r;++i){var n=e[i];e[i]=1&n?~(n>>1):n>>1}return e}(t),n=0,o=r.length;n<o;++n)r[n]/=i;return r}function zv(t){for(var e,i="";32<=t;)e=63+(32|31&t),i+=String.fromCharCode(e),t>>=5;return e=t+63,i+=String.fromCharCode(e)}t(kv,Uf),kv.prototype.readFeatureFromText=function(t,e){var i=this.readGeometryFromText(t,e);return new yr(i)},kv.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},kv.prototype.readGeometryFromText=function(t,e){var i=jr(this.geometryLayout_),r=Dv(t,i,this.factor_);Av(r,0,r.length,i,r);var n=Jr(r,0,r.length,i);return qp(new Bn(n,this.geometryLayout_),!1,this.adaptOptions(e))},kv.prototype.writeFeatureText=function(t,e){var i=t.getGeometry();return i?this.writeGeometryText(i,e):($(!1,40),"")},kv.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},kv.prototype.writeGeometryText=function(t,e){var i=(t=qp(t,!0,this.adaptOptions(e))).getFlatCoordinates(),r=t.getStride();return Av(i,0,i.length,r,i),Gv(i,r,this.factor_)};var Bv=function(t){var e=t||{};Jp.call(this),this.layerName_=e.layerName,this.layers_=e.layers?e.layers:null,this.dataProjection=Ee(e.dataProjection?e.dataProjection:"EPSG:4326")};t(Bv,Jp);
1var Yv={Point:function(t,e,i){var r=t.coordinates;e&&i&&Zv(r,e,i);return new sn(r)},LineString:function(t,e){var i=Xv(t.arcs,e);return new Bn(i)},Polygon:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r)i[r]=Xv(t.arcs[r],e);return new xn(i)},MultiPoint:function(t,e,i){var r=t.coordinates;if(e&&i)for(var n=0,o=r.length;n<o;++n)Zv(r[n],e,i);return new nh(r)},MultiLineString:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r)i[r]=Xv(t.arcs[r],e);return new rh(i)},MultiPolygon:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r){for(var o=t.arcs[r],s=[],a=0,h=o.length;a<h;++a)s[a]=Xv(o[a],e);i[r]=s}return new sh(i)}};function Xv(t,e){for(var i,r,n=[],o=0,s=t.length;o<s;++o)i=t[o],0<o&&n.pop(),r=0<=i?e[i]:e[~i].slice().reverse(),n.push.apply(n,r);for(var a=0,h=n.length;a<h;++a)n[a]=n[a].slice();return n}function Vv(t,e,i,r,n,o,s){for(var a=t.geometries,h=[],l=0,u=a.length;l<u;++l)h[l]=Wv(a[l],e,i,r,n,o,s);return h}function Wv(t,e,i,r,n,o,s){var a,h=t.type,l=Yv[h];a="Point"===h||"MultiPoint"===h?l(t,i,r):l(t,e);var u=new yr;u.setGeometry(qp(a,!1,s)),void 0!==t.id&&u.setId(t.id);var c=t.properties;return n&&(c||(c={}),c[n]=o),c&&u.setProperties(c),u}function Kv(t,e,i){for(var r=0,n=0,o=0,s=t.length;o<s;++o){var a=t[o];r+=a[0],n+=a[1],a[0]=r,a[1]=n,Zv(a,e,i)}}function Zv(t,e,i){t[0]=t[0]*e[0]+i[0],t[1]=t[1]*e[1]+i[1]}Bv.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var i,r=t,n=null,o=null;r.transform&&(n=(i=r.transform).scale,o=i.translate);var s=r.arcs;i&&function(t,e,i){for(var r=0,n=t.length;r<n;++r)Kv(t[r],e,i)}(s,n,o);var a,h=[],l=r.objects,u=this.layerName_;for(var c in l)this.layers_&&-1==this.layers_.indexOf(c)||("GeometryCollection"===l[c].type?(a=l[c],h.push.apply(h,Vv(a,s,n,o,u,c,e))):(a=l[c],h.push(Wv(a,s,n,o,u,c,e))));return h}return[]},Bv.prototype.readProjectionFromObject=function(t){return this.dataProjection},Bv.prototype.writeFeatureObject=function(t,e){},Bv.prototype.writeFeaturesObject=function(t,e){},Bv.prototype.writeGeometryObject=function(t,e){},Bv.prototype.readGeometryFromObject=function(){},Bv.prototype.readFeatureFromObject=function(){};var Hv=function(t){this.tagName_=t};Hv.prototype.getTagName=function(){return this.tagName_};var qv=function(t,e){Hv.call(this,t),this.conditions=Array.prototype.slice.call(arguments,1),$(2<=this.conditions.length,57)};t(qv,Hv);var Jv=function(t){var e=["And"].concat(Array.prototype.slice.call(arguments));qv.apply(this,e)};t(Jv,qv);var Qv=function(t,e,i){Hv.call(this,"BBOX"),this.geometryName=t,this.extent=e,this.srsName=i};t(Qv,Hv);var $v=function(t,e,i,r){Hv.call(this,t),this.geometryName=e||"the_geom",this.geometry=i,this.srsName=r};t($v,Hv);var ty=function(t,e,i){$v.call(this,"Contains",t,e,i)};t(ty,$v);var ey=function(t,e){Hv.call(this,t),this.propertyName=e};t(ey,Hv);var iy=function(t,e,i){ey.call(this,"During",t),this.begin=e,this.end=i};t(iy,ey);var ry=function(t,e,i,r){ey.call(this,t,e),this.expression=i,this.matchCase=r};t(ry,ey);var ny=function(t,e,i){ry.call(this,"PropertyIsEqualTo",t,e,i)};t(ny,ry);var oy=function(t,e){ry.call(this,"PropertyIsGreaterThan",t,e)};t(oy,ry);var sy=function(t,e){ry.call(this,"PropertyIsGreaterThanOrEqualTo",t,e)};t(sy,ry);var ay=function(t,e,i){$v.call(this,"Intersects",t,e,i)};t(ay,$v);var hy=function(t,e,i){ey.call(this,"PropertyIsBetween",t),this.lowerBoundary=e,this.upperBoundary=i};t(hy,ey);var ly=function(t,e,i,r,n,o){ey.call(this,"PropertyIsLike",t),this.pattern=e,this.wildCard=void 0!==i?i:"*",this.singleChar=void 0!==r?r:".",this.escapeChar=void 0!==n?n:"!",this.matchCase=o};t(ly,ey);var uy=function(t){ey.call(this,"PropertyIsNull",t)};t(uy,ey);var cy=function(t,e){ry.call(this,"PropertyIsLessThan",t,e)};t(cy,ry);var py=function(t,e){ry.call(this,"PropertyIsLessThanOrEqualTo",t,e)};t(py,ry);var dy=function(t){Hv.call(this,"Not"),this.condition=t};t(dy,Hv);var fy=function(t,e,i){ry.call(this,"PropertyIsNotEqualTo",t,e,i)};t(fy,ry);var gy=function(t){var e=["Or"].concat(Array.prototype.slice.call(arguments));qv.apply(this,e)};t(gy,qv);var _y=function(t,e,i){$v.call(this,"Within",t,e,i)};function vy(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Jv,e))}function yy(t,e,i){return new Qv(t,e,i)}t(_y,$v);var my="feature",xy="http://www.w3.org/2000/xmlns/",Sy="http://www.opengis.net/ogc",Cy="http://www.opengis.net/wfs",wy={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},Ey=function(t){var e=t||{};this.featureType_=e.featureType,this.featureNS_=e.featureNS,this.gmlFormat_=e.gmlFormat?e.gmlFormat:new Vd,this.schemaLocation_=e.schemaLocation?e.schemaLocation:wy["1.1.0"],Fd.call(this)};t(Ey,Fd),Ey.prototype.getFeatureType=function(){return this.featureType_},Ey.prototype.setFeatureType=function(t){this.featureType_=t}
1,Ey.prototype.readFeaturesFromNode=function(t,e){var i={featureType:this.featureType_,featureNS:this.featureNS_};C(i,this.getReadOptions(t,e||{}));var r=[i];this.gmlFormat_.FEATURE_COLLECTION_PARSERS[Ld].featureMember=fd(Pd.prototype.readFeaturesInternal);var n=Td([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,r,this.gmlFormat_);return n||(n=[]),n},Ey.prototype.readTransactionResponse=function(t){if(ud(t))return this.readTransactionResponseFromDocument(t);if(cd(t))return this.readTransactionResponseFromNode(t);if("string"==typeof t){var e=pd(t);return this.readTransactionResponseFromDocument(e)}},Ey.prototype.readFeatureCollectionMetadata=function(t){if(ud(t))return this.readFeatureCollectionMetadataFromDocument(t);if(cd(t))return this.readFeatureCollectionMetadataFromNode(t);if("string"==typeof t){var e=pd(t);return this.readFeatureCollectionMetadataFromDocument(e)}},Ey.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)};var Ty={"http://www.opengis.net/gml":{boundedBy:vd(Pd.prototype.readGeometryElement,"bounds")}};Ey.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},i=Dd(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=i,Td(e,Ty,t,[],this.gmlFormat_)};var Ry={"http://www.opengis.net/wfs":{totalInserted:vd(Gd),totalUpdated:vd(Gd),totalDeleted:vd(Gd)}};var Iy={"http://www.opengis.net/ogc":{FeatureId:fd(function(t,e){return t.getAttribute("fid")})}};var Fy={"http://www.opengis.net/wfs":{Feature:function(t,e){Ed(Iy,t,e)}}};var Ly={"http://www.opengis.net/wfs":{TransactionSummary:vd(function(t,e){return Td({},Ry,t,e)},"transactionSummary"),InsertResults:vd(function(t,e){return Td([],Fy,t,e)},"insertIds")}};Ey.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},Ey.prototype.readTransactionResponseFromNode=function(t){return Td({},Ly,t,[])};var Py={"http://www.opengis.net/wfs":{PropertyName:yd(Yd)}};function My(t,e,i){var r=hd(Sy,"Filter"),n=hd(Sy,"FeatureId");r.appendChild(n),n.setAttribute("fid",e),t.appendChild(r)}function by(t,e){var i=(t=t||my)+":";return 0===e.indexOf(i)?e:i+e}var Oy={"http://www.opengis.net/wfs":{Insert:yd(function(t,e,i){var r=i[i.length-1],n=r.featureType,o=r.featureNS,s=r.gmlVersion,a=hd(o,n);t.appendChild(a),2===s?Hd.prototype.writeFeatureElement(a,e,i):Vd.prototype.writeFeatureElement(a,e,i)}),Update:yd(function(t,e,i){var r=i[i.length-1];$(void 0!==e.getId(),27);var n=r.featureType,o=r.featurePrefix,s=r.featureNS,a=by(o,n),h=e.getGeometryName();t.setAttribute("typeName",a),t.setAttributeNS(xy,"xmlns:"+o,s);var l=e.getId();if(void 0!==l){for(var u=e.getKeys(),c=[],p=0,d=u.length;p<d;p++){var f=e.get(u[p]);if(void 0!==f){var g=u[p];f instanceof We&&(g=h),c.push({name:g,value:f})}}Id({gmlVersion:r.gmlVersion,node:t,hasZ:r.hasZ,srsName:r.srsName},Oy,xd("Property"),c,i),My(t,l)}}),Delete:yd(function(t,e,i){var r=i[i.length-1];$(void 0!==e.getId(),26);var n=r.featureType,o=r.featurePrefix,s=r.featureNS,a=by(o,n);t.setAttribute("typeName",a),t.setAttributeNS(xy,"xmlns:"+o,s);var h=e.getId();void 0!==h&&My(t,h)}),Property:yd(function(t,e,i){var r=hd(Cy,"Name"),n=i[i.length-1].gmlVersion;if(t.appendChild(r),Yd(r,e.name),void 0!==e.value&&null!==e.value){var o=hd(Cy,"Value");t.appendChild(o),e.value instanceof We?2===n?Hd.prototype.writeGeometryElement(o,e.value,i):Vd.prototype.writeGeometryElement(o,e.value,i):Yd(o,e.value)}}),Native:yd(function(t,e,i){e.vendorId&&t.setAttribute("vendorId",e.vendorId);void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",e.safeToIgnore);void 0!==e.value&&Yd(t,e.value)})}};var Ny={"http://www.opengis.net/wfs":{Query:yd(function(t,e,i){var r,n=i[i.length-1],o=n.featurePrefix,s=n.featureNS,a=n.propertyNames,h=n.srsName;r=o?by(o,e):e;t.setAttribute("typeName",r),h&&t.setAttribute("srsName",h);s&&t.setAttributeNS(xy,"xmlns:"+o,s);var l=C({},n);l.node=t,Id(l,Py,xd("PropertyName"),a,i);var u=n.filter;if(u){var c=hd(Sy,"Filter");t.appendChild(c),Ay(c,u,i)}})}
1,"http://www.opengis.net/ogc":{During:yd(function(t,e,i){var r=hd("http://www.opengis.net/fes","ValueReference");Yd(r,e.propertyName),t.appendChild(r);var n=hd(Ld,"TimePeriod");t.appendChild(n);var o=hd(Ld,"begin");n.appendChild(o),zy(o,e.begin);var s=hd(Ld,"end");n.appendChild(s),zy(s,e.end)}),And:yd(ky),Or:yd(ky),Not:yd(function(t,e,i){var r={node:t},n=e.condition;Id(r,Ny,xd(n.getTagName()),[n],i)}),BBOX:yd(function(t,e,i){i[i.length-1].srsName=e.srsName,Uy(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.extent,i)}),Contains:yd(function(t,e,i){i[i.length-1].srsName=e.srsName,Uy(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.geometry,i)}),Intersects:yd(function(t,e,i){i[i.length-1].srsName=e.srsName,Uy(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.geometry,i)}),Within:yd(function(t,e,i){i[i.length-1].srsName=e.srsName,Uy(t,e.geometryName),Vd.prototype.writeGeometryElement(t,e.geometry,i)}),PropertyIsEqualTo:yd(Gy),PropertyIsNotEqualTo:yd(Gy),PropertyIsLessThan:yd(Gy),PropertyIsLessThanOrEqualTo:yd(Gy),PropertyIsGreaterThan:yd(Gy),PropertyIsGreaterThanOrEqualTo:yd(Gy),PropertyIsNull:yd(function(t,e,i){Uy(t,e.propertyName)}),PropertyIsBetween:yd(function(t,e,i){Uy(t,e.propertyName);var r=hd(Sy,"LowerBoundary");t.appendChild(r),jy(r,""+e.lowerBoundary);var n=hd(Sy,"UpperBoundary");t.appendChild(n),jy(n,""+e.upperBoundary)}),PropertyIsLike:yd(function(t,e,i){t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString());Uy(t,e.propertyName),jy(t,""+e.pattern)})}};function Ay(t,e,i){Id({node:t},Ny,xd(e.getTagName()),[e],i)}function ky(t,e,i){for(var r={node:t},n=e.conditions,o=0,s=n.length;o<s;++o){var a=n[o];Id(r,Ny,xd(a.getTagName()),[a],i)}}function Gy(t,e,i){void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),Uy(t,e.propertyName),jy(t,""+e.expression)}function Dy(t,e,i){var r=hd(Sy,t);Yd(r,i),e.appendChild(r)}function Uy(t,e){Dy("PropertyName",t,e)}function jy(t,e){Dy("Literal",t,e)}function zy(t,e){var i=hd(Ld,"TimeInstant");t.appendChild(i);var r=hd(Ld,"timePosition");i.appendChild(r),Yd(r,e)}Ey.prototype.writeGetFeature=function(t){var e,i=hd(Cy,"GetFeature");if(i.setAttribute("service","WFS"),i.setAttribute("version","1.1.0"),t&&(t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",t.maxFeatures),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",t.startIndex),void 0!==t.count&&i.setAttribute("count",t.count),e=t.filter,t.bbox)){$(t.geometryName,12);var r=yy(t.geometryName,t.bbox,t.srsName);e=e?vy(e,r):r}i.setAttributeNS(ad,"xsi:schemaLocation",this.schemaLocation_);var n,o,s,a,h,l={node:i,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:e,propertyNames:t.propertyNames?t.propertyNames:[]};return $(Array.isArray(t.featureTypes),11),n=i,o=t.featureTypes,a=(s=[l])[s.length-1],(h=C({},a)).node=n,Id(h,Ny,xd("Query"),o,s),i},Ey.prototype.writeTransaction=function(t,e,i,r){var n,o,s=[],a=hd(Cy,"Transaction"),h=r.version?r.version:"1.1.0",l="1.0.0"===h?2:3;a.setAttribute("service","WFS"),a.setAttribute("version",h),r&&(n=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle));var u=wy[h];a.setAttributeNS(ad,"xsi:schemaLocation",u);var c=r.featurePrefix?r.featurePrefix:my;return t&&(o={node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,hasZ:r.hasZ,srsName:r.srsName},C(o,n),Id(o,Oy,xd("Insert"),t,s)),e&&(o={node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,hasZ:r.hasZ,srsName:r.srsName},C(o,n),Id(o,Oy,xd("Update"),e,s)),i&&Id({node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,srsName:r.srsName},Oy,xd("Delete"),i,s),r.nativeElements&&Id({node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,srsName:r.srsName},Oy,xd("Native"),r.nativeElements,s),a},Ey.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},Ey.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var i=[{}];return this.gmlFormat_.readGeometryElement(e,i),Ee(i.pop().srsName)}return null};var By="EMPTY",Yy="Z",Xy="M",Vy=1,Wy=2,Ky=3,Zy=4,Hy=5,qy=6,Jy=function(t){this.wkt=t,this.index_=-1}
1;Jy.prototype.isAlpha_=function(t){return"a"<=t&&t<="z"||"A"<=t&&t<="Z"},Jy.prototype.isNumeric_=function(t,e){return"0"<=t&&t<="9"||"."==t&&!(void 0!==e&&e)},Jy.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},Jy.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},Jy.prototype.nextToken=function(){var t=this.nextChar_(),e={position:this.index_,value:t};if("("==t)e.type=Wy;else if(","==t)e.type=Hy;else if(")"==t)e.type=Ky;else if(this.isNumeric_(t)||"-"==t)e.type=Zy,e.value=this.readNumber_();else if(this.isAlpha_(t))e.type=Vy,e.value=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(""!==t)throw new Error("Unexpected character: "+t);e.type=qy}return e},Jy.prototype.readNumber_=function(){for(var t,e=this.index_,i=!1,r=!1;"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_(),this.isNumeric_(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t););return parseFloat(this.wkt.substring(e,this.index_--))},Jy.prototype.readText_=function(){for(var t,e=this.index_;t=this.nextChar_(),this.isAlpha_(t););return this.wkt.substring(e,this.index_--).toUpperCase()};var Qy=function(t){this.lexer_=t,this.token_,this.layout_=Dr.XY};Qy.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},Qy.prototype.isTokenType=function(t){return this.token_.type==t},Qy.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},Qy.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},Qy.prototype.parseGeometryLayout_=function(){var t=Dr.XY,e=this.token_;if(this.isTokenType(Vy)){var i=e.value;i===Yy?t=Dr.XYZ:i===Xy?t=Dr.XYM:"ZM"===i&&(t=Dr.XYZM),t!==Dr.XY&&this.consume_()}return t},Qy.prototype.parseGeometryCollectionText_=function(){if(this.match(Wy)){for(var t=[];t.push(this.parseGeometry_()),this.match(Hy););if(this.match(Ky))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Qy.prototype.parsePointText_=function(){if(this.match(Wy)){var t=this.parsePoint_();if(this.match(Ky))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},Qy.prototype.parseLineStringText_=function(){if(this.match(Wy)){var t=this.parsePointList_();if(this.match(Ky))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Qy.prototype.parsePolygonText_=function(){if(this.match(Wy)){var t=this.parseLineStringTextList_();if(this.match(Ky))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Qy.prototype.parseMultiPointText_=function(){var t;if(this.match(Wy)){if(t=this.token_.type==Wy?this.parsePointTextList_():this.parsePointList_(),this.match(Ky))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Qy.prototype.parseMultiLineStringText_=function(){if(this.match(Wy)){var t=this.parseLineStringTextList_();if(this.match(Ky))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Qy.prototype.parseMultiPolygonText_=function(){if(this.match(Wy)){var t=this.parsePolygonTextList_();if(this.match(Ky))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Qy.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,i=0;i<e;++i){var r=this.token_;if(!this.match(Zy))break;t.push(r.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())},Qy.prototype.parsePointList_=function(){for(var t=[this.parsePoint_()];this.match(Hy);)t.push(this.parsePoint_());return t},Qy.prototype.parsePointTextList_=function(){for(var t=[this.parsePointText_()];this.match(Hy);)t.push(this.parsePointText_());return t},Qy.prototype.parseLineStringTextList_=function(){for(var t=[this.parseLineStringText_()];this.match(Hy);)t.push(this.parseLineStringText_());return t},Qy.prototype.parsePolygonTextList_=function(){for(var t=[this.parsePolygonText_()];this.match(Hy);)t.push(this.parsePolygonText_());return t},Qy.prototype.isEmptyGeometry_=function(){var t=this.isTokenType(Vy)&&this.token_.value==By;return t&&this.consume_(),t},Qy.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"};var $y=function(t){var e=t||{};Uf.call(this),this.splitCollection_=void 0!==e.splitCollection&&e.splitCollection};function tm(t){var e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function em(t){for(var e=t.getCoordinates(),i=[],r=0,n=e.length;r<n;++r)i.push(e[r].join(" "));return i.join(",")}function im(t){for(var e=[],i=t.getLinearRings(),r=0,n=i.length;r<n;
1++r)e.push("("+em(i[r])+")");return e.join(",")}t($y,Uf);var rm={Point:tm,LineString:em,Polygon:im,MultiPoint:function(t){for(var e=[],i=t.getPoints(),r=0,n=i.length;r<n;++r)e.push("("+tm(i[r])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],i=t.getLineStrings(),r=0,n=i.length;r<n;++r)e.push("("+em(i[r])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],i=t.getPolygons(),r=0,n=i.length;r<n;++r)e.push("("+im(i[r])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],i=t.getGeometries(),r=0,n=i.length;r<n;++r)e.push(nm(i[r]));return e.join(",")}};function nm(t){var e,i,r=t.getType(),n=(0,rm[r])(t);if(r=r.toUpperCase(),t instanceof Ur){var o=(e=t.getLayout(),i="",e!==Dr.XYZ&&e!==Dr.XYZM||(i+=Yy),e!==Dr.XYM&&e!==Dr.XYZM||(i+=Xy),i);0<o.length&&(r+=" "+o)}return 0===n.length?r+" "+By:r+"("+n+")"}$y.prototype.parse_=function(t){var e=new Jy(t);return new Qy(e).parse()},$y.prototype.readFeatureFromText=function(t,e){var i=this.readGeometryFromText(t,e);if(i){var r=new yr;return r.setGeometry(i),r}return null},$y.prototype.readFeaturesFromText=function(t,e){for(var i=[],r=this.readGeometryFromText(t,e),n=[],o=0,s=(i=this.splitCollection_&&r.getType()==Zt.GEOMETRY_COLLECTION?r.getGeometriesArray():[r]).length;o<s;++o){var a=new yr;a.setGeometry(i[o]),n.push(a)}return n},$y.prototype.readGeometryFromText=function(t,e){var i=this.parse_(t);return i?qp(i,!1,e):null};var om={POINT:sn,LINESTRING:Bn,POLYGON:xn,MULTIPOINT:nh,MULTILINESTRING:rh,MULTIPOLYGON:sh},sm={POINT:Qy.prototype.parsePointText_,LINESTRING:Qy.prototype.parseLineStringText_,POLYGON:Qy.prototype.parsePolygonText_,MULTIPOINT:Qy.prototype.parseMultiPointText_,MULTILINESTRING:Qy.prototype.parseMultiLineStringText_,MULTIPOLYGON:Qy.prototype.parseMultiPolygonText_};Qy.prototype.parseGeometry_=function(){var t=this.token_;if(this.match(Vy)){var e=t.value;if(this.layout_=this.parseGeometryLayout_(),e==Zt.GEOMETRY_COLLECTION.toUpperCase()){var i=this.parseGeometryCollectionText_();return new bf(i)}var r=sm[e],n=om[e];if(!r||!n)throw new Error("Invalid geometry type: "+e);return new n(r.call(this),this.layout_)}throw new Error(this.formatErrorMessage_())},$y.prototype.writeFeatureText=function(t,e){var i=t.getGeometry();return i?this.writeGeometryText(i,e):""},$y.prototype.writeFeaturesText=function(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(t[r].getGeometry());var o=new bf(i);return this.writeGeometryText(o,e)},$y.prototype.writeGeometryText=function(t,e){return nm(qp(t,!0,e))};var am="http://www.w3.org/1999/xlink";function hm(t){return t.getAttributeNS(am,"href")}var lm=function(){};lm.prototype.read=function(t){if(ud(t))return this.readFromDocument(t);if(cd(t))return this.readFromNode(t);if("string"==typeof t){var e=pd(t);return this.readFromDocument(e)}return null},lm.prototype.readFromDocument=function(t){},lm.prototype.readFromNode=function(t){};var um=function(){lm.call(this),this.version=void 0};t(um,lm);var cm=[null,"http://www.opengis.net/wms"],pm=wd(cm,{Service:vd(function(t,e){return Td({},fm,t,e)}),Capability:vd(function(t,e){return Td({},dm,t,e)})}),dm=wd(cm,{Request:vd(function(t,e){return Td({},Cm,t,e)}),Exception:vd(function(t,e){return Td([],ym,t,e)}),Layer:vd(function(t,e){return Td({},mm,t,e)})}),fm=wd(cm,{Name:vd(Ud),Title:vd(Ud),Abstract:vd(Ud),KeywordList:vd(bm),OnlineResource:vd(hm),ContactInformation:vd(function(t,e){return Td({},gm,t,e)}),Fees:vd(Ud),AccessConstraints:vd(Ud),LayerLimit:vd(Gd),MaxWidth:vd(Gd),MaxHeight:vd(Gd)}),gm=wd(cm,{ContactPersonPrimary:vd(function(t,e){return Td({},_m,t,e)}),ContactPosition:vd(Ud),ContactAddress:vd(function(t,e){return Td({},vm,t,e)}),ContactVoiceTelephone:vd(Ud),ContactFacsimileTelephone:vd(Ud),ContactElectronicMailAddress:vd(Ud)}),_m=wd(cm,{ContactPerson:vd(Ud),ContactOrganization:vd(Ud)}),vm=wd(cm,{AddressType:vd(Ud),Address:vd(Ud),City:vd(Ud),StateOrProvince:vd(Ud),PostCode:vd(Ud),Country:vd(Ud)}),ym=wd(cm,{Format:fd(Ud)}),mm=wd(cm,{Name:vd(Ud),Title:vd(Ud),Abstract:vd(Ud),KeywordList:vd(bm),CRS:_d(Ud),EX_GeographicBoundingBox:vd(function(t,e){var i=Td({},Sm,t,e);if(!i)return;var r=i.westBoundLongitude,n=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===n||void 0===o||void 0===s)return;return[r,n,o,s]}),BoundingBox:_d(function(t,e){var i=[kd(t.getAttribute("minx")),kd(t.getAttribute("miny")),kd(t.getAttribute("maxx")),kd(t.getAttribute("maxy"))],r=[kd(t.getAttribute("resx")),kd(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}}),Dimension:_d(function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Od(t.getAttribute("multipleValues")),nearestValue:Od(t.getAttribute("nearestValue")),current:Od(t.getAttribute("current")),values:Ud(t)}}),Attribution:vd(function(t,e){return Td({},xm,t,e)}),AuthorityURL:_d(function(t,e){var i=Lm(t,e);if(i)return i.name=t.getAttribute("name"),i;return}),Identifier:_d(Ud),MetadataURL:_d(function(t,e){var i=Lm(t,e);if(i)return i.type=t.getAttribute("type"),i;return}),DataURL:_d(Lm),FeatureListURL:_d(Lm),Style:_d(function(t,e){return Td({},Rm,t,e)}),MinScaleDenominator:vd(Ad),MaxScaleDenominator:vd(Ad),Layer:_d(function(t,e){var i=e[e.length-1],r=Td({},mm,t,e);if(!r)return;var n=Od(t.getAttribute("queryable"));void 0===n&&(n=i.queryable);r.queryable=void 0!==n&&n;var o=Dd(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded);r.cascaded=o;
1var s=Od(t.getAttribute("opaque"));void 0===s&&(s=i.opaque);r.opaque=void 0!==s&&s;var a=Od(t.getAttribute("noSubsets"));void 0===a&&(a=i.noSubsets);r.noSubsets=void 0!==a&&a;var h=kd(t.getAttribute("fixedWidth"));h||(h=i.fixedWidth);r.fixedWidth=h;var l=kd(t.getAttribute("fixedHeight"));l||(l=i.fixedHeight);r.fixedHeight=l,["Style","CRS","AuthorityURL"].forEach(function(t){if(t in i){var e=r[t]||[];r[t]=e.concat(i[t])}});return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(t){if(!(t in r)){var e=i[t];r[t]=e}}),r})}),xm=wd(cm,{Title:vd(Ud),OnlineResource:vd(hm),LogoURL:vd(Mm)}),Sm=wd(cm,{westBoundLongitude:vd(Ad),eastBoundLongitude:vd(Ad),southBoundLatitude:vd(Ad),northBoundLatitude:vd(Ad)}),Cm=wd(cm,{GetCapabilities:vd(Pm),GetMap:vd(Pm),GetFeatureInfo:vd(Pm)}),wm=wd(cm,{Format:_d(Ud),DCPType:_d(function(t,e){return Td({},Em,t,e)})}),Em=wd(cm,{HTTP:vd(function(t,e){return Td({},Tm,t,e)})}),Tm=wd(cm,{Get:vd(Lm),Post:vd(Lm)}),Rm=wd(cm,{Name:vd(Ud),Title:vd(Ud),Abstract:vd(Ud),LegendURL:_d(Mm),StyleSheetURL:vd(Lm),StyleURL:vd(Lm)}),Im=wd(cm,{Format:vd(Ud),OnlineResource:vd(hm)}),Fm=wd(cm,{Keyword:fd(Ud)});function Lm(t,e){return Td({},Im,t,e)}function Pm(t,e){return Td({},wm,t,e)}function Mm(t,e){var i=Lm(t,e);if(i){var r=[Dd(t.getAttribute("width")),Dd(t.getAttribute("height"))];return i.size=r,i}}function bm(t,e){return Td([],Fm,t,e)}um.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},um.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=Td({version:this.version},pm,t,[]);return e||null};var Om=function(t){var e=t||{};this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new Hd,this.layers_=e.layers?e.layers:null,Fd.call(this)};t(Om,Fd);Om.prototype.getLayers=function(){return this.layers_},Om.prototype.setLayers=function(t){this.layers_=t},Om.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var n=0,o=t.childNodes.length;n<o;n++){var s=t.childNodes[n];if(s.nodeType===Node.ELEMENT_NODE){var a=e[0],h=s.localName.replace("_layer","");if(!this.layers_||Pr(this.layers_,h)){var l=h+"_feature";a.featureType=l,a.featureNS=this.featureNS_;var u={};u[l]=fd(this.gmlFormat_.readFeatureElement,this.gmlFormat_);var c=wd([a.featureNS,null],u);s.setAttribute("namespaceURI",this.featureNS_);var p=Td([],c,s,e,this.gmlFormat_);p&&Or(r,p)}}}if("FeatureCollection"==i){var d=Td([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);d&&(r=d)}return r},Om.prototype.readFeaturesFromNode=function(t,e){var i={};return e&&C(i,this.getReadOptions(t,e)),this.readFeatures_(t,[i])},Om.prototype.writeFeatureNode=function(t,e){},Om.prototype.writeFeaturesNode=function(t,e){},Om.prototype.writeGeometryNode=function(t,e){};var Nm=function(){lm.call(this)};t(Nm,lm);var Am=[null,"http://www.opengis.net/ows/1.1"],km=wd(Am,{ServiceIdentification:vd(function(t,e){return Td({},Zm,t,e)}),ServiceProvider:vd(function(t,e){return Td({},Hm,t,e)}),OperationsMetadata:vd(function(t,e){return Td({},Xm,t,e)})}),Gm=wd(Am,{DeliveryPoint:vd(Ud),City:vd(Ud),AdministrativeArea:vd(Ud),PostalCode:vd(Ud),Country:vd(Ud),ElectronicMailAddress:vd(Ud)}),Dm=wd(Am,{Value:_d(function(t,e){return Ud(t)})}),Um=wd(Am,{AllowedValues:vd(function(t,e){return Td({},Dm,t,e)})}),jm=wd(Am,{Phone:vd(function(t,e){return Td({},Vm,t,e)}),Address:vd(function(t,e){return Td({},Gm,t,e)})}),zm=wd(Am,{HTTP:vd(function(t,e){return Td({},Bm,t,e)})}),Bm=wd(Am,{Get:_d(function(t,e){var i=hm(t);if(!i)return;return Td({href:i},Wm,t,e)}),Post:void 0}),Ym=wd(Am,{DCP:vd(function(t,e){return Td({},zm,t,e)})}),Xm=wd(Am,{Operation:function(t,e){var i=t.getAttribute("name"),r=Td({},Ym,t,e);if(!r)return;e[e.length-1][i]=r}}),Vm=wd(Am,{Voice:vd(Ud),Facsimile:vd(Ud)}),Wm=wd(Am,{Constraint:_d(function(t,e){var i=t.getAttribute("name");if(!i)return;return Td({name:i},Um,t,e)})}),Km=wd(Am,{IndividualName:vd(Ud),PositionName:vd(Ud),ContactInfo:vd(function(t,e){return Td({},jm,t,e)})}),Zm=wd(Am,{Abstract:vd(Ud),AccessConstraints:vd(Ud),Fees:vd(Ud),Title:vd(Ud),ServiceTypeVersion:vd(Ud),ServiceType:vd(Ud)}),Hm=wd(Am,{ProviderName:vd(Ud),ProviderSite:vd(hm),ServiceContact:vd(function(t,e){return Td({},Km,t,e)})});Nm.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromN
1ode(e);return null},Nm.prototype.readFromNode=function(t){var e=Td({},km,t,[]);return e||null};var qm=function(){lm.call(this),this.owsParser_=new Nm};t(qm,lm);var Jm=[null,"http://www.opengis.net/wmts/1.0"],Qm=[null,"http://www.opengis.net/ows/1.1"],$m=wd(Jm,{Contents:vd(function(t,e){return Td({},tx,t,e)})}),tx=wd(Jm,{Layer:_d(function(t,e){return Td({},ex,t,e)}),TileMatrixSet:_d(function(t,e){return Td({},hx,t,e)})}),ex=wd(Jm,{Style:_d(function(t,e){var i=Td({},ix,t,e);if(!i)return;var r="true"===t.getAttribute("isDefault");return i.isDefault=r,i}),Format:_d(Ud),TileMatrixSetLink:_d(function(t,e){return Td({},rx,t,e)}),Dimension:_d(function(t,e){return Td({},sx,t,e)}),ResourceURL:_d(function(t,e){var i=t.getAttribute("format"),r=t.getAttribute("template"),n=t.getAttribute("resourceType"),o={};i&&(o.format=i);r&&(o.template=r);n&&(o.resourceType=n);return o})},wd(Qm,{Title:vd(Ud),Abstract:vd(Ud),WGS84BoundingBox:vd(function(t,e){var i=Td([],ax,t,e);if(2!=i.length)return;return it(i)}),Identifier:vd(Ud)})),ix=wd(Jm,{LegendURL:_d(function(t,e){var i={};return i.format=t.getAttribute("format"),i.href=hm(t),i})},wd(Qm,{Title:vd(Ud),Identifier:vd(Ud)})),rx=wd(Jm,{TileMatrixSet:vd(Ud),TileMatrixSetLimits:vd(function(t,e){return Td([],nx,t,e)})}),nx=wd(Jm,{TileMatrixLimits:fd(function(t,e){return Td({},ox,t,e)})}),ox=wd(Jm,{TileMatrix:vd(Ud),MinTileRow:vd(Gd),MaxTileRow:vd(Gd),MinTileCol:vd(Gd),MaxTileCol:vd(Gd)}),sx=wd(Jm,{Default:vd(Ud),Value:_d(Ud)},wd(Qm,{Identifier:vd(Ud)})),ax=wd(Qm,{LowerCorner:fd(ux),UpperCorner:fd(ux)}),hx=wd(Jm,{WellKnownScaleSet:vd(Ud),TileMatrix:_d(function(t,e){return Td({},lx,t,e)})},wd(Qm,{SupportedCRS:vd(Ud),Identifier:vd(Ud)})),lx=wd(Jm,{TopLeftCorner:vd(ux),ScaleDenominator:vd(Ad),TileWidth:vd(Gd),TileHeight:vd(Gd),MatrixWidth:vd(Gd),MatrixHeight:vd(Gd)},wd(Qm,{Identifier:vd(Ud)}));function ux(t,e){var i=Ud(t).split(" ");if(i&&2==i.length){var r=+i[0],n=+i[1];if(!isNaN(r)&&!isNaN(n))return[r,n]}}qm.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},qm.prototype.readFromNode=function(t){var e=t.getAttribute("version").trim(),i=this.owsParser_.readFromNode(t);return i?(i.version=e,(i=Td(i,$m,t,[]))||null):null};var cx="blur",px="gradient",dx="radius",fx=["#00f","#0ff","#0f0","#ff0","#f00"],gx=function(t){var e=t||{},i=C({},e);delete i.gradient,delete i.radius,delete i.blur,delete i.shadow,delete i.weight,ch.call(this,i),this.gradient_=null,this.shadow_=void 0!==e.shadow?e.shadow:250,this.circleImage_=void 0,this.styleCache_=null,S(this,H(px),this.handleGradientChanged_,this),this.setGradient(e.gradient?e.gradient:fx),this.setBlur(void 0!==e.blur?e.blur:15),this.setRadius(void 0!==e.radius?e.radius:8),S(this,H(cx),this.handleStyleChanged_,this),S(this,H(dx),this.handleStyleChanged_,this),this.handleStyleChanged_();var s,r=e.weight?e.weight:"weight";s="string"==typeof r?function(t){return t.get(r)}:r,this.setStyle(function(t,e){var i=s(t),r=void 0!==i?jt(i,0,1):1,n=255*r|0,o=this.styleCache_[n];return o||(o=[new dr({image:new rg({opacity:r,src:this.circleImage_})})],this.styleCache_[n]=o),o}.bind(this)),this.setRenderOrder(null),S(this,Wn,this.handleRender_,this)};t(gx,ch);gx.prototype.createCircle_=function(){var t=this.getRadius(),e=this.getBlur(),i=t+e+1,r=2*i,n=ni(r,r);n.shadowOffsetX=n.shadowOffsetY=this.shadow_,n.shadowBlur=e,n.shadowColor="#000",n.beginPath();var o=i-this.shadow_;return n.arc(o,o,t,0,2*Math.PI,!0),n.fill(),n.canvas.toDataURL()},gx.prototype.getBlur=function(){return this.get(cx)},gx.prototype.getGradient=function(){return this.get(px)},gx.prototype.getRadius=function(){return this.get(dx)},gx.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=ni(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.getImageData(0,0,1,256).data}(this.getGradient())},gx.prototype.handleStyleChanged_=function(){this.circleImage_=this.createCircle_(),this.styleCache_=new Array(256),this.changed()},gx.prototype.handleRender_=function(t){for(var e=t.context,i=e.canvas,r=e.getImageData(0,0,i.width,i.height),n=r.data,o=0,s=n.length;o<s;o+=4){var a=4*n[o+3];a&&(n[o]=this.gradient_[a],n[o+1]=this.gradient_[a+1],n[o+2]=this.gradient_[a+2])}e.putImageData(r,0,0)},gx.prototype.setBlur=function(t){this.set(cx,t)},gx.prototype.setGradient=function(t){this.set(px,t)},gx.prototype.setRadius=function(t){this.set(dx,t)};var _x=function(t){var e=t||{};Rs.call(this,e),this.type=ah.IMAGE};t(_x,Rs);var vx="preload",yx="useInterimTilesOnError",mx=function(t){var e=t||{},i=C({},e);delete i.preload,delete i.useInterimTilesOnError,Rs.call(this,i),this.setPreload(void 0!==e.preload?e.preload:0),this.setUseInterimTilesOnError(void 0===e.useInterimTilesOnError||e.useInterimTilesOnError),this.type=ah.TILE};t(mx,Rs),mx.prototype.getPreload=function(){return this.get(vx)},mx.prototype.setPreload=function(t){this.set(vx,t)},mx.prototype.getUseInterimTilesOnError=function(){return this.get(yx)},mx.prototype.setUseInterimTilesOnError=function(t){this.set(yx,t)};var xx=function(t){var e=t||{},i=e.renderMode||Xu;$(null==i||i==Yu||i==Xu||i==Vu,28),e.declutter&&i==Yu&&(i=Xu),e.renderMode=i;var r=C({},e);delete r.preload,delete r.useInterimTilesOnError,ch.call(this,r),this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(void 0===e.useInterimTilesOnError||e.useInterimTilesOnError),this.type=ah.VECTOR_TILE};function Sx(t,e,i,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=i,r):[t,e,i]}function Cx(t,e,i){return t+"/"+e+"/"+i}function wx(t){return Cx(t[0],t[1],t[2])}function Ex(t){return(t[1]<<t[0])+t[2]}function Tx(r,n){var o=/\{z\}/g,s=/\{x\}/g,a=/\{y\}/g,h=/\{-y\}/g;return function(i,t,e){return i?r.replace(o,i[0].toString()).replace(s,i[1].toString()).replace(a,function(){return(-i[2]-1).toString()}).replace(h,function(){var t=i[0],e=n.getFullTileRange(t);return $(e,55),(e.getHeight()+i[2]).toString()}):void 0}}function Rx(t,e){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=Tx(t[n],e);return Ix(r)}
1function Ix(n){return 1===n.length?n[0]:function(t,e,i){if(t){var r=Wt(Ex(t),n.length);return n[r](t,e,i)}}}function Fx(t,e,i){}function Lx(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var r,n=i[1].charCodeAt(0),o=i[2].charCodeAt(0);for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}function Px(t,e,i,r){var n=document.createElement("script"),o="olc_"+wt(e);function s(){delete window[o],n.parentNode.removeChild(n)}n.async=!0,n.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+o;var a=setTimeout(function(){s(),i&&i()},1e4);window[o]=function(t){clearTimeout(a),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(n)}t(xx,ch),xx.prototype.getPreload=function(){return this.get(vx)},xx.prototype.getUseInterimTilesOnError=function(){return this.get(yx)},xx.prototype.setPreload=function(t){this.set(vx,t)},xx.prototype.setUseInterimTilesOnError=function(t){this.set(yx,t)};var Mx=function(t){ji.call(this,t)};function bx(t,e,i,r){var n=Oe(i,e,t),o=Te(e,r,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var h=t.getExtent();if(!h||st(h,n)){var l=Te(t,o,n)/o;isFinite(l)&&0<l&&(o/=l)}return o}function Ox(t,e,i,r){var n=i-t,o=r-e,s=Math.sqrt(n*n+o*o);return[Math.round(i+n/s),Math.round(r+o/s)]}function Nx(t,e,T,R,i,I,r,n,o,a,s){var F=ni(Math.round(T*t),Math.round(T*e));if(0===o.length)return F.canvas;F.scale(T,T);var L=[1/0,1/0,-1/0,-1/0];o.forEach(function(t,e,i){vt(L,t.extent)});var h=Ot(L),l=Lt(L),P=ni(Math.round(T*h/R),Math.round(T*l/R)),u=T/R;o.forEach(function(t,e,i){var r=t.extent[0]-L[0],n=-(t.extent[3]-L[3]),o=Ot(t.extent),s=Lt(t.extent);P.drawImage(t.image,a,a,t.image.width-2*a,t.image.height-2*a,r*u,n*u,o*u,s*u)});var M=Mt(r);
1return n.getTriangles().forEach(function(t,e,i){var r=t.source,n=t.target,o=r[0][0],s=r[0][1],a=r[1][0],h=r[1][1],l=r[2][0],u=r[2][1],c=(n[0][0]-M[0])/I,p=-(n[0][1]-M[1])/I,d=(n[1][0]-M[0])/I,f=-(n[1][1]-M[1])/I,g=(n[2][0]-M[0])/I,_=-(n[2][1]-M[1])/I,v=o,y=s,m=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 s=Math.abs(t[o][i]);n<s&&(n=s,r=o)}if(0===n)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var h=i+1;h<e;h++)for(var l=-t[h][i]/t[i][i],u=i;u<e+1;u++)i==u?t[h][u]=0:t[h][u]+=l*t[i][u]}for(var c=new Array(e),p=e-1;0<=p;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;0<=d;d--)t[d][e]-=t[d][p]*c[p]}return c}([[a-=v,h-=y,s=o=0,0,d-c],[l-=v,u-=y,0,0,g-c],[0,0,a,h,f-p],[0,0,l,u,_-p]]);if(m){F.save(),F.beginPath();var x=(c+d+g)/3,S=(p+f+_)/3,C=Ox(x,S,c,p),w=Ox(x,S,d,f),E=Ox(x,S,g,_);F.moveTo(w[0],w[1]),F.lineTo(C[0],C[1]),F.lineTo(E[0],E[1]),F.clip(),F.transform(m[0],m[2],m[1],m[3],c,p),F.translate(L[0]-v,L[3]-y),F.scale(R/T,-R/T),F.drawImage(P.canvas,0,0),F.restore()}}),s&&(F.save(),F.strokeStyle="black",F.lineWidth=1,n.getTriangles().forEac
1h(function(t,e,i){var r=t.target,n=(r[0][0]-M[0])/I,o=-(r[0][1]-M[1])/I,s=(r[1][0]-M[0])/I,a=-(r[1][1]-M[1])/I,h=(r[2][0]-M[0])/I,l=-(r[2][1]-M[1])/I;F.beginPath(),F.moveTo(s,a),F.lineTo(n,o),F.lineTo(h,l),F.closePath(),F.stroke()}),F.restore()),F.canvas}t(Mx,ji),Mx.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast(),i=e.tileCoord[0].toString();if(i in t&&t[i].contains(e.tileCoord))break;this.pop().dispose()}},Mx.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),e=t.split("/").map(Number)[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(wx(t.tileCoord)),t.dispose())},this)}};var Ax=function(t,e,i,r,n){this.sourceProj_=t,this.targetProj_=e;var o={},s=be(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=s(t)),o[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&Ot(r)==Ot(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Ot(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Ot(this.targetProj_.getExtent()):null;var a=Mt(i),h=bt(i),l=Rt(i),u=Tt(i),c=this.transformInv_(a),p=this.transformInv_(h),d=this.transformInv_(l),f=this.transformInv_(u);if(this.addQuad_(a,h,l,u,c,p,d,f,10),this.wrapsXInSource_){var g=1/0;this.triangles_.forEach(function(t,e,i){g=Math.min(g,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])-g>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]-g>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-g>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-g>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))}o={}};Ax.prototype.addTriangle_=function(t,e,i,r,n,o){this.triangles_.push({source:[r,n,o],target:[t,e,i]})},Ax.prototype.addQuad_=function(t,e,i,r,n,o,s,a,h){var l=it([n,o,s,a]),u=this.sourceWorldWidth_?Ot(l)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&.5<u&&u<1,d=!1;if(0<h){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d|=.25<Ot(it([t,e,i,r]))/this.targetWorldWidth_;!p&&this.sourceProj_.isGlobal()&&u&&(d|=.25<u)}if(d||!this.maxSourceExtent_||Nt(l,this.maxSourceExtent_)){if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(0<h))return;d=!0}if(0<h){if(!d){var f,g=[(t[0]+i[0])/2,(t[1]+i[1])/2],_=this.transformInv_(g);if(p)f=(Wt(n[0],c)+Wt(s[0],c))/2-Wt(_[0],c);else f=(n[0]+s[0])/2-_[0];var v=(n[1]+s[1])/2-_[1];d=f*f+v*v>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var y=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(y),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],S=this.transformInv_(x);this.addQuad_(t,e,y,x,n,o,m,S,h-1),this.addQuad_(x,y,i,r,S,m,s,a,h-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],w=this.transformInv_(C),E=[(i[0]+r[0])/2,(i[1]+r[1])/2],T=this.transformInv_(E);this.addQuad_(t,C,E,r,n,w,T,a,h-1),this.addQuad_(C,e,i,E,w,o,s,T,h-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,i,r,n,s,a),this.addTriangle_(t,e,i,n,o,s)}},Ax.prototype.calculateSourceExtent=function(){var n=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(t,e,i){var r=t.source;yt(n,r[0]),yt(n,r[1]),yt(n,r[2])}),n},Ax.prototype.getTriangles=function(){return this.triangles_};var kx=function(t,e,i,r,n,o,s,a,h,l,u){co.call(this,n,eo),this.renderEdges_=void 0!==u&&u,this.pixelRatio_=s,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=r,this.wrappedTileCoord_=o||n,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var c=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),d=this.sourceTileGrid_.getExtent(),f=p?Pt(c,p):c;if(0!==Ct(f)){var g=t.getExtent();g&&(d=d?Pt(d,g):g);var _=r.getResolution(this.wrappedTileCoord_[0]),v=bx(t,i,It(f),_);if(!isFinite(v)||v<=0)this.state=oo;else{var y=void 0!==l?l:.5;
1if(this.triangulation_=new Ax(t,i,f,d,v*y),0!==this.triangulation_.getTriangles().length){this.sourceZ_=e.getZForResolution(v);var m=this.triangulation_.calculateSourceExtent();if(d&&(t.canWrapX()?(m[1]=jt(m[1],d[1],d[3]),m[3]=jt(m[3],d[1],d[3])):m=Pt(m,d)),Ct(m)){for(var x=e.getTileRangeForExtentAndZ(m,this.sourceZ_),S=x.minX;S<=x.maxX;S++)for(var C=x.minY;C<=x.maxY;C++){var w=h(this.sourceZ_,S,C,s);w&&this.sourceTiles_.push(w)}0===this.sourceTiles_.length&&(this.state=oo)}else this.state=oo}else this.state=oo}}else this.state=oo};t(kx,co),kx.prototype.disposeInternal=function(){this.state==io&&this.unlistenSources_(),co.prototype.disposeInternal.call(this)},kx.prototype.getImage=function(){return this.canvas_},kx.prototype.reproject_=function(){var r=[];if(this.sourceTiles_.forEach(function(t,e,i){t&&t.getState()==ro&&r.push({extent:this.sourceTileGrid_.getTileCoordExtent(t.tileCoord),image:t.getImage()})}.bind(this)),(this.sourceTiles_.length=0)===r.length)this.state=no;else{var t=this.wrappedTileCoord_[0],e=this.targetTileGrid_.getTileSize(t),i="number"==typeof e?e:e[0],n="number"==typeof e?e:e[1],o=this.targetTileGrid_.getResolution(t),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Nx(i,n,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,r,this.gutter_,this.renderEdges_),this.state=ro}this.changed()},kx.prototype.load=function(){if(this.state==eo){this.state=io,this.changed();var o=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(i,t,e){var r=i.getState();if(r==eo||r==io){o++;var n=S(i,E,function(t){var e=i.getState();e!=ro&&e!=no&&e!=oo||(f(n),0===--o&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(n)}}.bind(this)),this.sourceTiles_.forEach(function(t,e,i){t.getState()==eo&&t.load()}),0===o&&setTimeout(this.reproject_.bind(this),0)}},kx.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(f),this.sourcesListenerKeys_=null};var Gx=function(t){var r,n,o,e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,$((r=this.resolutions_,n=!0,o=function(t,e){return e-t}||Lr,r.every(function(t,e){if(0===e)return!0;var i=o(r[e-1],t);return!(0<i||n&&0===i)})),17),!t.origins)for(var i=0,s=this.resolutions_.length-1;i<s;++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,$(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=Mt(a)),$(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,$(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:qo,$(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){return new $l(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this):a&&this.calculateTileRanges_(a)},Dx=[0,0,0];function Ux(t){var e=t.getDefaultTileGrid();return e||(e=Yx(t),t.setDefaultTileGrid(e)),e}function jx(t,e,i,r){var n,o,s,a=void 0!==r?r:tt.TOP_LEFT,h=Bx(t,e,i);return new Gx({extent:t,origin:(n=t,o=a,o===tt.BOTTOM_LEFT?s=Tt(n):o===tt.BOTTOM_RIGHT?s=Rt(n):o===tt.TOP_LEFT?s=Mt(n):o===tt.TOP_RIGHT?s=bt(n):$(!1,13),s),resolutions:h,tileSize:i})}function zx(t){var e={};return C(e,void 0!==t?t:{}),void 0===e.extent&&(e.extent=Ee("EPSG:3857").getExtent()),e.resolutions=Bx(e.extent,e.maxZoom,e.tileSize),delete e.maxZoom,new Gx(e)}function Bx(t,e,i){for(var r=void 0!==e?e:Ho,n=Lt(t),o=Ot(t),s=ws(void 0!==i?i:qo),a=Math.max(o/s[0],n/s[1]),h=r+1,l=new Array(h),u=0;u<h;++u)l[u]=a/Math.pow(2,u);return l}
1function Yx(t,e,i,r){return jx(Xx(t),e,i,r)}function Xx(t){var e=(t=Ee(t)).getExtent();if(!e){var i=180*te[$t.DEGREES]/t.getMetersPerUnit();e=ct(-i,-i,i,i)}return e}Gx.prototype.forEachTileCoord=function(t,e,i){for(var r=this.getTileRangeForExtentAndZ(t,e),n=r.minX,o=r.maxX;n<=o;++n)for(var s=r.minY,a=r.maxY;s<=a;++s)i([e,n,s])},Gx.prototype.forEachTileCoordParentTileRange=function(t,e,i,r,n){var o,s,a,h=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],a=t[2]):h=this.getTileCoordExtent(t,n);l>=this.minZoom;){if(o=2===this.zoomFactor_?tu(s=Math.floor(s/2),s,a=Math.floor(a/2),a,r):this.getTileRangeForExtentAndZ(h,l,r),e.call(i,l,o))return!0;--l}return!1},Gx.prototype.getExtent=function(){return this.extent_},Gx.prototype.getMaxZoom=function(){return this.maxZoom},Gx.prototype.getMinZoom=function(){return this.minZoom},Gx.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},Gx.prototype.getResolution=function(t){return this.resolutions_[t]},Gx.prototype.getResolutions=function(){return this.resolutions_},Gx.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 tu(r,r+1,n,n+1,e)}var o=this.getTileCoordExtent(t,i);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},Gx.prototype.getTileRangeExtent=function(t,e,i){var r=this.getOrigin(t),n=this.getResolution(t),o=ws(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*n,a=r[0]+(e.maxX+1)*o[0]*n;return ct(s,r[1]+e.minY*o[1]*n,a,r[1]+(e.maxY+1)*o[1]*n,i)},Gx.prototype.getTileRangeForExtentAndZ=function(t,e,i){var r=Dx;this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r);var n=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[3],e,!0,r),tu(n,r[1],o,r[2],i)},Gx.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=ws(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*i,e[1]+(t[2]+.5)*r[1]*i]},Gx.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=ws(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*n[0]*r,s=i[1]+t[2]*n[1]*r;return ct(o,s,o+n[0]*r,s+n[1]*r,e)},Gx.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},Gx.prototype.getTileCoordForXYAndResolution_=function(t,e,i,r,n){var o=this.getZForResolution(i),s=i/this.getResolution(o),a=this.getOrigin(o),h=ws(this.getTileSize(o),this.tmpSize_),l=r?.5:0,u=r?0:.5,c=Math.floor((t-a[0])/i+l),p=Math.floor((e-a[1])/i+u),d=s*c/h[0],f=s*p/h[1];return r?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),Sx(o,d,f,n)},Gx.prototype.getTileCoordForXYAndZ_=function(t,e,i,r,n){var o=this.getOrigin(i),s=this.getResolution(i),a=ws(this.getTileSize(i),this.tmpSize_),h=r?.5:0,l=r?0:.5,u=Math.floor((t-o[0])/s+h),c=Math.floor((e-o[1])/s+l),p=u/a[0],d=c/a[1];return r?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),Sx(i,p,d,n)},Gx.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},Gx.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},Gx.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},Gx.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},Gx.prototype.getZForResolution=function(t,e){return jt(Mr(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},Gx.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};var Vx=function(t){_h.call(this,{attributions:t.attributions,extent:t.extent,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.opaque_=void 0!==t.opaque&&t.opaque,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileCache=new Mx(t.cacheSize),this.tmpSize=[0,0],this.key_="",this.tileOptions={transition:t.transition}};t(Vx,_h),Vx.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},Vx.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);
1i&&i.expireCache(e)},Vx.prototype.forEachLoadedTile=function(t,e,i,r){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var o,s,a,h=!0,l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u)s=Cx(e,l,u),a=!1,n.containsKey(s)&&(a=(o=n.get(s)).getState()===ro)&&(a=!1!==r(o)),a||(h=!1);return h},Vx.prototype.getGutter=function(t){return 0},Vx.prototype.getKey=function(){return this.key_},Vx.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},Vx.prototype.getOpaque=function(t){return this.opaque_},Vx.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},Vx.prototype.getTile=function(t,e,i,r,n){},Vx.prototype.getTileGrid=function(){return this.tileGrid},Vx.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ux(t)},Vx.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!Pe(e,t)?null:this.tileCache},Vx.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},Vx.prototype.getTilePixelSize=function(t,e,i){var r=this.getTileGridForProjection(i),n=this.getTilePixelRatio(e),o=ws(r.getTileSize(t),this.tmpSize);return 1==n?o:Cs(o,n,this.tmpSize)},Vx.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=Xx(i);if(st(o,n))return e;var s=Ot(o),a=Math.ceil((o[0]-n[0])/s);return n[0]+=s*a,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,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||o.containsXY(r,n)}(t,r)?t:null},Vx.prototype.refresh=function(){this.tileCache.clear(),this.changed()},Vx.prototype.useTile=F;var Wx=function(t,e){m.call(this,t),this.tile=e};t(Wx,m);var Kx="tileloadstart",Zx="tileloadend",Hx="tileloaderror",qx=function(t){Vx.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition}),this.tileLoadFunction=t.tileLoadFunction,this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Fx,this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),t.tileUrlFunction&&this.setTileUrlFunction(t.tileUrlFunction),this.tileLoadingKeys_={}};t(qx,Vx),qx.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},qx.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},qx.prototype.getUrls=function(){return this.urls},qx.prototype.handleTileChange=function(t){var e,i=t.target,r=wt(i),n=i.getState();n==io?(this.tileLoadingKeys_[r]=!0,e=Kx):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=n==no?Hx:n==ro||n==so?Zx:void 0),null!=e&&this.dispatchEvent(new Wx(e,i))},qx.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},qx.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},qx.prototype.setUrl=function(t){var e=this.urls=Lx(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Rx(e,this.tileGrid),t)},qx.prototype.setUrls=function(t){var e=(this.urls=t).join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Rx(t,this.tileGrid),e)},qx.prototype.useTile=function(t,e,i){var r=Cx(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)};var Jx=function(t){qx.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Qx,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:po,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1};function Qx(t,e){t.getImage().src=e}t(Jx,qx),Jx.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},Jx.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:{})}},Jx.prototype.getGutter=function(t){return this.getProjection()&&t&&!Pe(this.getProjection(),t)?0:this.getGutterInternal()},Jx.prototype.getGutterInternal=function(){return 0},Jx.prototype.getOpaque=function(t){return!(this.getProjection()&&t&&!Pe(this.getProjection(),t))&&qx.prototype.getOpaque.call(this,t)},Jx.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Pe(e,t)){var i=wt(t).toString();return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Ux(t)),this.tileGridForProjection[i]}return this.tileGrid},Jx.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Pe(e,t))return this.tileCache;var i=wt(t).toString();return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Mx(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}
1,Jx.prototype.createTile_=function(t,e,i,r,n,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=a?this.tileUrlFunction(a,r,n):void 0,l=new this.tileClass(s,void 0!==h?eo:oo,void 0!==h?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,S(l,E,this.handleTileChange,this),l},Jx.prototype.getTile=function(t,e,i,r,n){var o=this.getProjection();if(o&&n&&!Pe(o,n)){var s,a=this.getTileCacheForProjection(n),h=[t,e,i],l=wx(h);a.containsKey(l)&&(s=a.get(l));var u=this.getKey();if(s&&s.key==u)return s;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(n),d=this.getTileCoordForTileUrlFunction(h,n),f=new kx(o,c,n,p,h,d,this.getTilePixelRatio(r),this.getGutterInternal(),function(t,e,i,r){return this.getTileInternal(t,e,i,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return f.key=u,s?(f.interimTile=s,f.refreshInterimChain(),a.replace(l,f)):a.set(l,f),f}return this.getTileInternal(t,e,i,r,o||n)},Jx.prototype.getTileInternal=function(t,e,i,r,n){var o=null,s=Cx(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var h=o;o=this.createTile_(t,e,i,r,n,a),h.getState()==eo?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,r,n,a),this.tileCache.set(s,o);return o},Jx.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},Jx.prototype.setTileGridForProjection=function(t,e){var i=Ee(t);if(i){var r=wt(i).toString();r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}};var $x=function(t){this.hidpi_=void 0!==t.hidpi&&t.hidpi,Jx.call(this,{cacheSize:t.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:Ee("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:_s,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:this.hidpi_?2:1,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition}),this.culture_=void 0!==t.culture?t.culture:"en-us",this.maxZoom_=void 0!==t.maxZoom?t.maxZoom:-1,this.apiKey_=t.key,this.imagerySet_=t.imagerySet,Px("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&ke
1y="+this.apiKey_+"&c="+this.culture_,this.handleImageryMetadataResponse.bind(this),void 0,"jsonp")};t($x,Jx);$x.prototype.getApiKey=function(){return this.apiKey_},$x.prototype.getImagerySet=function(){return this.imagerySet_},$x.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=Xx(this.getProjection()),n=e.imageWidth==e.imageHeight?e.imageWidth:[e.imageWidth,e.imageHeight],o=zx({extent:r,minZoom:e.zoomMin,maxZoom:i,tileSize:n/(this.hidpi_?2:1)});this.tileGrid=o;var s=this.culture_,a=this.hidpi_;if(this.tileUrlFunction=Ix(e.imageUrlSubdomains.map(function(t){var n=[0,0,0],o=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,i){if(t){Sx(t[0],t[1],-t[2]-1,n);var r=o;return a&&(r+="&dpi=d1&device=mobile"),r.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("")}(n))}}})),e.imageryProviders){var u=Me(Ee("EPSG:4326"),this.getProjection());this.setAttributions(function(a){var h=[],l=a.viewState.zoom;return e.imageryProviders.map(function(t){for(var e=!1,i=t.coverageAreas,r=0,n=i.length;r<n;++r){var o=i[r];if(l>=o.zoomMin&&l<=o.zoomMax){var s=o.bbox;if(Nt(Gt([s[1],s[0],s[3],s[2]],u),a.extent)){e=!0;break}}}e&&h.push(t.attribution)}),h.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'),h})}this.setState(vs)}else this.setState(ys)};var tS=function(t){var e=t||{},i=void 0!==e.projection?e.projection:"EPSG:3857",r=void 0!==e.tileGrid?e.tileGrid:zx({extent:Xx(i),maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});Jx.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,opaque:e.opaque,projection:i,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})};t(tS,Jx);var eS=function(t){this.account_=t.account,this.mapId_=t.map||"",this.config_=t.config||{},this.templateCache_={},tS.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,maxZoom:void 0!==t.maxZoom?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,state:_s,wrapX:t.wrapX}),this.initializeMap_()};t(eS,tS),eS.prototype.getConfig=function(){return this.config_},eS.prototype.updateConfig=function(t){C(this.config_,t),this.initializeMap_()},eS.prototype.setConfig=function(t){this.config_=t||{},this.initializeMap_()},eS.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var i=new XMLHttpRequest;i.addEventListener("load",this.handleInitResponse_.bind(this,t)),i.addEventListener("error",this.handleInitError_.bind(this)),i.open("POST",e),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.config_))}},eS.prototype.handleInitResponse_=function(t,e){var i=e.target;if(!i.status||200<=i.status&&i.status<300){var r;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState(ys)}this.applyTemplate_(r),this.templateCache_[t]=r,this.setState(vs)}else this.setState(ys)},eS.prototype.handleInitError_=function(t){this.setState(ys)},eS.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)};var iS=function(t){jh.call(this,{attributions:t.attributions,extent:t.extent,projection:t.projection,wrapX:t.wrapX}),this.resolution=void 0,this.distance=void 0!==t.distance?t.distance:20,this.features=[],this.geometryFunction=t.geometryFunction||function(t){var e=t.getGeometry();return $(e instanceof sn,10),e},this.source=t.source,S(this.source,E,this.refresh,this)};t(iS,jh),iS.prototype.getDistance=function(){return this.distance},iS.prototype.getSource=function(){return this.source}
1,iS.prototype.loadFeatures=function(t,e,i){this.source.loadFeatures(t,e,i),e!==this.resolution&&(this.clear(),this.resolution=e,this.cluster(),this.addFeatures(this.features))},iS.prototype.setDistance=function(t){this.distance=t,this.refresh()},iS.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features),jh.prototype.refresh.call(this)},iS.prototype.cluster=function(){if(void 0!==this.resolution)for(var t=[1/(this.features.length=0),1/0,-1/0,-1/0],e=this.distance*this.resolution,i=this.source.getFeatures(),r={},n=0,o=i.length;n<o;n++){var s=i[n];if(!(wt(s).toString()in r)){var a=this.geometryFunction(s);if(a){dt(a.getCoordinates(),t),rt(t,e,t);var h=this.source.getFeaturesInExtent(t);h=h.filter(function(t){var e=wt(t).toString();return!(e in r)&&(r[e]=!0)}),this.features.push(this.createCluster(h))}}}},iS.prototype.createCluster=function(t){for(var e=[0,0],i=t.length-1;0<=i;--i){var r=this.geometryFunction(t[i]);r?Fn(e,r.getCoordinates()):t.splice(i,1)}Nn(e,1/t.length);var n=new yr(new sn(e));return n.set("features",t),n};var rS=function(t,e,i,r,n,o){this.targetProj_=e,this.maxSourceExtent_=t.getExtent();var s=e.getExtent(),a=s?Pt(i,s):i,h=bx(t,e,It(a),r);this.triangulation_=new Ax(t,e,a,this.maxSourceExtent_,.5*h),this.targetResolution_=r,this.targetExtent_=i;var l=this.triangulation_.calculateSourceExtent();this.sourceImage_=o(l,h,n),this.sourcePixelRatio_=this.sourceImage_?this.sourceImage_.getPixelRatio():1,this.canvas_=null,this.sourceListenerKey_=null;var u=Ni.LOADED;this.sourceImage_&&(u=Ni.IDLE),$n.call(this,i,r,this.sourcePixelRatio_,u)};t(rS,$n),rS.prototype.disposeInternal=function(){this.state==Ni.LOADING&&this.unlistenSource_(),$n.prototype.disposeInternal.call(this)},rS.prototype.getImage=function(){return this.canvas_},rS.prototype.getProjection=function(){return this.targetProj_},rS.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Ni.LOADED){var e=Ot(this.targetExtent_)/this.targetResolution_,i=Lt(this.targetExtent_)/this.targetResolution_;this.canvas_=Nx(e,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0)}this.state=t,this.changed()},rS.prototype.load=function(){if(this.state==Ni.IDLE){this.state=Ni.LOADING,this.changed();var t=this.sourceImage_.getState();t==Ni.LOADED||t==Ni.ERROR?this.reproject_():(this.sourceListenerKey_=S(this.sourceImage_,E,function(t){var e=this.sourceImage_.getState();e!=Ni.LOADED&&e!=Ni.ERROR||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},rS.prototype.unlistenSource_=function(){f(this.sourceListenerKey_),this.sourceListenerKey_=null};var nS="imageloadstart",oS="imageloadend",sS="imageloaderror",aS=function(t,e){m.call(this,t),this.image=e};t(aS,m);var hS=function(t){_h.call(this,{attributions:t.attributions,extent:t.extent,projection:t.projection,state:t.state}),this.resolutions_=void 0!==t.resolutions?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0};function lS(t,e){t.getImage().src=e}function uS(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}t(hS,_h),hS.prototype.getResolutions=function(){return this.resolutions_},hS.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=Mr(this.resolutions_,t,0);t=this.resolutions_[e]}return t},hS.prototype.getImage=function(t,e,i,r){var n=this.getProjection();if(n&&r&&!Pe(n,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Pe(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&_t(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new rS(n,r,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,n)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return n&&(r=n),this.getImageInternal(t,e,i,r)}
1,hS.prototype.getImageInternal=function(t,e,i,r){},hS.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Ni.LOADING:this.dispatchEvent(new aS(nS,e));break;case Ni.LOADED:this.dispatchEvent(new aS(oS,e));break;case Ni.ERROR:this.dispatchEvent(new aS(sS,e))}};var cS=function(t){var e=t||{};hS.call(this,{attributions:e.attributions,projection:e.projection,resolutions:e.resolutions}),this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,this.hidpi_=void 0===e.hidpi||e.hidpi,this.url_=e.url,this.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:lS,this.params_=e.params||{},this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==e.ratio?e.ratio:1.5};t(cS,hS),cS.prototype.getParams=function(){return this.params_},cS.prototype.getImageInternal=function(t,e,i,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),i=this.hidpi_?i:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&at(n.getExtent(),t))return n;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};C(o,this.params_);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.ratio_){var h=this.ratio_*Ot(t)/2,l=this.ratio_*Lt(t)/2;t[0]=s-h,t[1]=a-l,t[2]=s+h,t[3]=a+l}var u=e/i,c=Math.ceil(Ot(t)/u),p=Math.ceil(Lt(t)/u);t[0]=s-u*c/2,t[2]=s+u*c/2,t[1]=a-u*p/2,t[3]=a+u*p/2,this.imageSize_[0]=c,this.imageSize_[1]=p;var d=this.getRequestUrl_(t,this.imageSize_,i,r,o);return this.image_=new to(t,e,i,d,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),S(this.image_,E,this.handleImageChange,this),this.image_},cS.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},cS.prototype.getRequestUrl_=function(t,e,i,r,n){var o=r.getCode().split(":").pop();n.SIZE=e[0]+","+e[1],n.BBOX=t.join(","),n.BBOXSR=o,n.IMAGESR=o,n.DPI=Math.round(90*i);var s=this.url_,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&$(!1,50),uS(a,n)},cS.prototype.getUrl=function(){return this.url_},cS.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},cS.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},cS.prototype.updateParams=function(t){C(this.params_,t),this.image_=null,this.changed()};var pS=function(t){hS.call(this,{attributions:t.attributions,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5};t(pS,hS),pS.prototype.getImageInternal=function(t,e,i,r){e=this.findNearestResolution(e);var n=this.canvas_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&at(n.getExtent(),t))return n;kt(t=t.slice(),this.ratio_);var o=[Ot(t)/e*i,Lt(t)/e*i],s=this.canvasFunction_(t,e,i,o,r);return s&&(n=new Gl(t,e,i,s)),this.canvas_=n,this.renderedRevision_=this.getRevision(),n};var dS=function(t){hS.call(this,{projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.displayDpi_=void 0!==t.displayDpi?t.displayDpi:96,this.params_=t.params||{},this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:lS,this.hidpi_=void 0===t.hidpi||t.hidpi,this.metersPerUnit_=void 0!==t.metersPerUnit?t.metersPerUnit:1,this.ratio_=void 0!==t.ratio?t.ratio:1,this.useOverlay_=void 0!==t.useOverlay&&t.useOverlay,this.image_=null,this.renderedRevision_=0};t(dS,hS),dS.prototype.getParams=function(){return this.params_},dS.prototype.getImageInternal=function(t,e,i,r){e=this.findNearestResolution(e),i=this.hidpi_?i:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&at(n.getExtent(),t))return n;1!=this.ratio_&&kt(t=t.slice(),this.ratio_);var o=[Ot(t)/e*i,Lt(t)/e*i];if(void 0!==this.url_){var s=this.getUrl(this.url_,this.params_,t,o,r);S(n=new to(t,e,i,s,this.crossOrigin_,this.imageLoadFunction_),E,this.handleImageChange,this)}else n=null;return this.image_=n,this.renderedRevision_=this.getRevision(),n},dS.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},dS.prototype.updateParams=function(t){C(this.params_,t),this.changed()}
1,dS.prototype.getUrl=function(t,e,i,r,n){var o,s,a,h,l,u,c,p,d,f=(o=i,s=r,a=this.metersPerUnit_,h=this.displayDpi_,l=Ot(o),u=Lt(o),c=s[0],p=s[1],d=.0254/h,c*u<p*l?l*a/(c*d):u*a/(p*d)),g=It(i),_={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:f,SETVIEWCENTERX:g[0],SETVIEWCENTERY:g[1]};return C(_,e),uS(t,_)},dS.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()};var fS=function(t){var e=t.imageExtent,i=void 0!==t.crossOrigin?t.crossOrigin:null,r=void 0!==t.imageLoadFunction?t.imageLoadFunction:lS;hS.call(this,{attributions:t.attributions,projection:Ee(t.projection)}),this.image_=new to(e,void 0,1,t.url,i,r),this.imageSize_=t.imageSize?t.imageSize:null,S(this.image_,E,this.handleImageChange,this)};t(fS,hS),fS.prototype.getImageInternal=function(t,e,i,r){return Nt(t,this.image_.getExtent())?this.image_:null},fS.prototype.handleImageChange=function(t){if(this.image_.getState()==Ni.LOADED){var e,i,r=this.image_.getExtent(),n=this.image_.getImage();this.imageSize_?(e=this.imageSize_[0],i=this.imageSize_[1]):(e=n.width,i=n.height);var o=Lt(r)/i,s=Math.ceil(Ot(r)/o);if(s!=e){var a=ni(s,i),h=a.canvas;a.drawImage(n,0,0,e,i,0,0,h.width,h.height),this.image_.setImage(h)}}hS.prototype.handleImageChange.call(this,t)};var gS="1.3.0",_S="carmentaserver",vS="geoserver",yS="mapserver",mS="qgis",xS=function(t){var e=t||{};hS.call(this,{attributions:e.attributions,projection:e.projection,resolutions:e.resolutions}),this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,this.url_=e.url,this.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:lS,this.params_=e.params||{},this.v13_=!0,this.updateV13_(),this.serverType_=e.serverType,this.hidpi_=void 0===e.hidpi||e.hidpi,this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==e.ratio?e.ratio:1.5};t(xS,hS);var SS=[101,101];xS.prototype.getGetFeatureInfoUrl=function(t,e,i,r){if(void 0!==this.url_){var n=Ee(i),o=this.getProjection();o&&o!==n&&(e=bx(o,n,t,e),t=Oe(t,n,o));var s=Ft(t,e,0,SS),a={SERVICE:"WMS",VERSION:gS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};C(a,this.params_,r);var h=Math.floor((t[0]-s[0])/e),l=Math.floor((s[3]-t[1])/e);return a[this.v13_?"I":"X"]=h,a[this.v13_?"J":"Y"]=l,this.getRequestUrl_(s,SS,1,o||n,a)}},xS.prototype.getParams=function(){return this.params_},xS.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=It(t),s=Ft(o,n,0,[Math.ceil(Ot(t)/n),Math.ceil(Lt(t)/n)]),a=Ft(o,n,0,[Math.ceil(this.ratio_*Ot(t)/n),Math.ceil(this.ratio_*Lt(t)/n)]),h=this.image_;if(h&&this.renderedRevision_==this.getRevision()&&h.getResolution()==e&&h.getPixelRatio()==i&&at(h.getExtent(),s))return h;var l={SERVICE:"WMS",VERSION:gS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};C(l,this.params_),this.imageSize_[0]=Math.round(Ot(a)/n),this.imageSize_[1]=Math.round(Lt(a)/n);var u=this.getRequestUrl_(a,this.imageSize_,i,r,l);return this.image_=new to(a,e,i,u,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),S(this.image_,E,this.handleImageChange,this),this.image_},xS.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},xS.prototype.getRequestUrl_=function(t,e,i,r,n){if($(void 0!==this.url_,9),n[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(n.STYLES=""),1!=i)switch(this.serverType_){case vS:var o=90*i+.5|0;"FORMAT_OPTIONS"in n?n.FORMAT_OPTIONS+=";dpi:"+o:n.FORMAT_OPTIONS="dpi:"+o;break;case yS:n.MAP_RESOLUTION=90*i;break;case _S:case mS:n.DPI=90*i;break;default:$(!1,8)}n.WIDTH=e[0],n.HEIGHT=e[1];var s,a=r.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,n.BBOX=s.join(","),uS(this.url_,n)},xS.prototype.getUrl=function(){return this.url_},xS.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},xS.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},xS.prototype.updateParams=function(t){C(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},xS.prototype.updateV13_=function(){var t=this.params_.VERSION||gS;this.v13_=0<=In(t,"1.3")};var CS='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',wS=function(t){var e,i=t||{};e=void 0!==i.attributions?i.attributions:[CS];var r=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",n=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";tS.call(this,{attributions:e,cacheSize:i.cacheSize,crossOrigin:r,opaque:void 0===i.opaque||i.opaque,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,url:n,wrapX:i.wrapX})};t(wS,tS);var ES=!0;try{new ImageData(10,10)}catch(t){ES=!1}var TS=document.createElement("canvas").getContext("2d");
1var RS={newImageData:function(t,e,i){if(ES)return new ImageData(t,e,i);var r=TS.createImageData(e,i);return r.data.set(t),r}}.newImageData;function IS(x){var S=!0;try{new ImageData(10,10)}catch(t){S=!1}return function(t){var e,i,r,n,o,s=t.buffers,a=t.meta,h=t.imageOps,l=t.width,u=t.height,c=s.length,p=s[0].byteLength;if(h){var d=new Array(c);for(i=0;i<c;++i)d[i]=(r=new Uint8ClampedArray(s[i]),n=l,o=u,S?new ImageData(r,n,o):{data:r,width:n,height:o});e=x(d,a).data}else{e=new Uint8ClampedArray(p);var f=new Array(c),g=new Array(c);for(i=0;i<c;++i)f[i]=new Uint8ClampedArray(s[i]),g[i]=[0,0,0,0];for(var _=0;_<p;_+=4){for(var v=0;v<c;++v){var y=f[v];g[v][0]=y[_],g[v][1]=y[_+1],g[v][2]=y[_+2],g[v][3]=y[_+3]}var m=x(g,a);e[_]=m[0],e[_+1]=m[1],e[_+2]=m[2],e[_+3]=m[3]}}return e.buffer}}function FS(e,t){var i=Object.keys(e.lib||{}).map(function(t){return"var "+t+" = "+e.lib[t].toString()+";"}).concat(["var __minion__ = ("+IS.toString()+")(",e.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Blob(i,{type:"text/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return o.addEventListener("message",t),o}function LS(t){var e;this._imageOps=!!t.imageOps;var i,r,n,o=[];if(e=0===t.threads?0:this._imageOps?1:t.threads||1)for(var s=0;s<e;++s)o[s]=FS(t,this._onWorkerMessage.bind(this,s));else o[0]=(i=t,r=this._onWorkerMessage.bind(this,0),n=IS(i.operation),{postMessage:function(t){setTimeout(function(){r({data:{buffer:n(t),meta:t.meta}})},0)}});this._workers=o,this._queue=[],this._maxQueueLength=t.queue||1/0,this._running=0,this._dataLookup={},this._job=null}LS.prototype.process=function(t,e,i){this._enqueue({inputs:t,meta:e,callback:i}),this._dispatch()},LS.prototype.destroy=function(){for(var t in this)this[t]=null;this._destroyed=!0},LS.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},LS.prototype._dispatch=function(){if(0===this._running&&0<this._queue.length){var t=this._job=this._queue.shift(),e=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map(function(t){return t.data.buffer}),n=this._workers.length;if(1===(this._running=n))this._workers[0].postMessage({buffers:r,meta:t.meta,imageOps:this._imageOps,width:e,height:i},r);else for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/n),a=0;a<n;++a){for(var h=a*s,l=[],u=0,c=r.length;u<c;++u)l.push(r[a].slice(h,h+s));this._workers[a].postMessage({buffers:l,meta:t.meta,imageOps:this._imageOps,width:e,height:i},l)}}},LS.prototype._onWorkerMessage=function(t,e){this._destroyed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())},LS.prototype._resolveJob=function(){var t,e,i=this._job,r=this._workers.length;if(1===r)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var n=i.inputs[0].data.length;t=new Uint8ClampedArray(n),e=new Array(n);for(var o=4*Math.ceil(n/4/r),s=0;s<r;++s){var a=this._dataLookup[s].buffer,h=s*o;t.set(new Uint8ClampedArray(a),h),e[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},i.callback(null,RS(t,i.inputs[0].width,i.inputs[0].height),e),this._dispatch()};var PS=LS,MS="beforeoperations",bS="afteroperations",OS="pixel",NS="image",AS=function(t,e,i){m.call(this,t),this.extent=e.extent,this.resolution=e.viewState.resolution/e.pixelRatio,this.data=i};t(AS,m);var kS=function(t){this.worker_=null,this.operationType_=void 0!==t.operationType?t.operationType:OS,this.threads_=void 0!==t.threads?t.threads:1,this.renderers_=function(t){for(var e=t.length,i=new Array(e),r=0;r<e;++r)i[r]=US(t[r]);return i}(t.sources);for(var e=0,i=this.renderers_.length;e<i;++e)S(this.renderers_[e],E,this.changed,this);this.tileQueue_=new Zo(function(){return 1},this.changed.bind(this));for(var r=this.renderers_.map(function(t){return t.getLayer().getLayerState()}),n={},o=0,s=r.length;o<s;++o)n[wt(r[o].layer)]=r[o];this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],extent:null,focus:null,index:0,layerStates:n,layerStatesArray:r,pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],skippedFeatureUids:{},tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{}},hS.call(this,{}),void 0!==t.operation&&this.setOperation(t.operation,t.lib)};t(kS,hS),kS.prototype.setOperation=function(t,e){this.worker_=new PS({operation:t,imageOps:this.operationType_===NS,queue:1,lib:e,threads:this.threads_}),this.changed()}
1,kS.prototype.updateFrameState_=function(t,e,i){var r=C({},this.frameState_);r.viewState=C({},r.viewState);var n=It(t);r.extent=t.slice(),r.focus=n,r.size[0]=Math.round(Ot(t)/e),r.size[1]=Math.round(Lt(t)/e),r.time=Date.now(),r.animate=!1;var o=r.viewState;return o.center=n,o.projection=i,o.resolution=e,r},kS.prototype.allSourcesReady_=function(){for(var t=!0,e=0,i=this.renderers_.length;e<i;++e)if(this.renderers_[e].getLayer().getSource().getState()!==vs){t=!1;break}return t},kS.prototype.getImage=function(t,e,i,r){if(!this.allSourcesReady_())return null;var n=this.updateFrameState_(t,e,r);if(this.requestedFrameState_=n,this.renderedImageCanvas_){var o=this.renderedImageCanvas_.getResolution(),s=this.renderedImageCanvas_.getExtent();e===o&&_t(t,s)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),n.tileQueue.loadMoreTiles(16,16),n.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_},kS.prototype.processSources_=function(){for(var t=this.requestedFrameState_,e=this.renderers_.length,i=new Array(e),r=0;r<e;++r){var n=DS(this.renderers_[r],t,t.layerStatesArray[r]);if(!n)return;i[r]=n}var o={};this.dispatchEvent(new AS(MS,t,o)),this.worker_.process(i,o,this.onWorkerComplete_.bind(this,t))},kS.prototype.onWorkerComplete_=function(t,e,i,r){if(!e&&i){var n=t.extent,o=t.viewState.resolution;if(o===this.requestedFrameState_.viewState.resolution&&_t(n,this.requestedFrameState_.extent)){var s;if(this.renderedImageCanvas_)s=this.renderedImageCanvas_.getImage().getContext("2d");else s=ni(Math.round(Ot(n)/o),Math.round(Lt(n)/o)),this.renderedImageCanvas_=new Gl(n,o,1,s.canvas);s.putImageData(i,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new AS(bS,t,r))}}};var GS=null;function DS(t,e,i){if(!t.prepareFrame(e,i))return null;var r=e.size[0],n=e.size[1];if(GS){var o=GS.canvas;o.width!==r||o.height!==n?GS=ni(r,n):GS.clearRect(0,0,r,n)}else GS=ni(r,n);return t.composeFrame(e,i,GS),GS.getImageData(0,0,r,n)}function US(t){var e,i,r=null;return t instanceof Vx?(i=new mx({source:t}),r=new eu(i)):t instanceof hS?(e=new _x({source:t}),r=new Ql(e)):t instanceof mx?r=new eu(t):t instanceof Rs&&(t.getType()==ah.IMAGE||t.getType()==ah.VECTOR)&&(r=new Ql(t)),r}var jS=['Map tiles by <a href="https://stamen.com/">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.',CS],zS={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!(kS.prototype.getImageInternal=function(){return null})},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},BS={terrain:{minZoom:4,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:1,maxZoom:16}},YS=function(t){var e=t.layer.indexOf("-"),i=-1==e?t.layer:t.layer.slice(0,e),r=BS[i],n=zS[t.layer],o=void 0!==t.url?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+n.extension;tS.call(this,{attributions:jS,cacheSize:t.cacheSize,crossOrigin:"anonymous",maxZoom:null!=t.maxZoom?t.maxZoom:r.maxZoom,minZoom:null!=t.minZoom?t.minZoom:r.minZoom,opaque:n.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,url:o,wrapX:t.wrapX})};t(YS,tS);var XS=function(t){var e=t||{};Jx.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.params_=e.params||{},this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.setKey(this.getKeyForParams_())};t(XS,Jx),XS.prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},XS.prototype.getParams=function(){return this.params_}
1,XS.prototype.getRequestUrl_=function(t,e,i,r,n,o){var s=this.urls;if(s){var a,h=n.getCode().split(":").pop();if(o.SIZE=e[0]+","+e[1],o.BBOX=i.join(","),o.BBOXSR=h,o.IMAGESR=h,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)a=s[0];else a=s[Wt(Ex(t),s.length)];return uS(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},XS.prototype.getTilePixelRatio=function(t){return t},XS.prototype.fixedTileUrlFunction=function(t,e,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){var n=r.getTileCoordExtent(t,this.tmpExtent_),o=ws(r.getTileSize(t[0]),this.tmpSize);1!=e&&(o=Cs(o,e,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return C(s,this.params_),this.getRequestUrl_(t,o,n,e,i,s)}},XS.prototype.updateParams=function(t){C(this.params_,t),this.setKey(this.getKeyForParams_())};var VS=function(t,e,i){co.call(this,t,ro),this.tileSize_=e,this.text_=i,this.canvas_=null};t(VS,co),VS.prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,e=ni(t[0],t[1]);return e.strokeStyle="black",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="black",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.fillText(this.text_,t[0]/2,t[1]/2),this.canvas_=e.canvas,e.canvas},VS.prototype.load=function(){};var WS=function(t){Vx.call(this,{opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:void 0===t.wrapX||t.wrapX})};t(WS,Vx),WS.prototype.getTile=function(t,e,i){var r=Cx(t,e,i);if(this.tileCache.containsKey(r))return this.tileCache.get(r);var n=ws(this.tileGrid.getTileSize(t)),o=[t,e,i],s=this.getTileCoordForTileUrlFunction(o),a=s?this.getTileCoordForTileUrlFunction(s).toString():"",h=new VS(o,n,a);return this.tileCache.set(r,h),h};var KS=function(t){if(this.tileJSON_=null,Jx.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:Ee("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:_s,tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition}),t.url)if(t.jsonp)Px(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{var e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):$(!1,51)};t(KS,Jx),KS.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||200<=e.status&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},KS.prototype.onXHRError_=function(t){this.handleTileJSONError()},KS.prototype.getTileJSON=function(){return this.tileJSON_},KS.prototype.handleTileJSONResponse=function(e){var t,i=Ee("EPSG:4326"),r=this.getProjection();if(void 0!==e.bounds){var n=Me(i,r);t=Gt(e.bounds,n)}var o=e.minzoom||0,s=e.maxzoom||22,a=zx({extent:Xx(r),maxZoom:s,minZoom:o});if(this.tileGrid=a,this.tileUrlFunction=Rx(e.tiles,a),void 0!==e.attribution&&!this.getAttributions()){var h=void 0!==t?t:i.getExtent();this.setAttributions(function(t){return Nt(h,t.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(vs)},KS.prototype.handleTileJSONError=function(){this.setState(ys)};var ZS=function(t){var e=t||{},i=e.params||{},r=!("TRANSPARENT"in i)||i.TRANSPARENT;Jx.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,opaque:!r,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.gutter_=void 0!==e.gutter?e.gutter:0,this.params_=i,this.v13_=!0,this.serverType_=e.serverType,this.hidpi_=void 0===e.hidpi||e.hidpi,this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.updateV13_(),this.setKey(this.getKeyForParams_())};t(ZS,Jx),ZS.prototype.getGetFeatureInfoUrl=function(t,e,i,r){var n=Ee(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(n));var a=s.getTileCoordForCoordAndResolution(t,e);if(!(s.getResolutions().length<=a[0])){var h=s.getResolution(a[0]),l=s.getTileCoordExtent(a,this.tmpExtent_),u=ws(s.getTileSize(a[0]),this.tmpSize),c=this.gutter_;0!==c&&(u=Ss(u,c,this.tmpSize),l=rt(l,h*c,l)),o&&o!==n&&(h=bx(o,n,t,h),l=Ne(l,n,o),t=Oe(t,n,o));var p={SERVICE:"WMS",VERSION:gS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};C(p,this.params_,r);var d=Math.floor((t[0]-l[0])/h),f=Math.floor((l[3]-t[1])/h);return p[this.v13_?"I":"X"]=d,p[this.v13_?"J":"Y"]=f,this.getRequestUrl_(a,u,l,1,o||n,p)}},ZS.prototype.getGutterInternal=function(){return this.gutter_},ZS.prototype.getParams=function(){return this.params_}
1,ZS.prototype.getRequestUrl_=function(t,e,i,r,n,o){var s=this.urls;if(s){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 vS:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case yS:o.MAP_RESOLUTION=90*r;break;case _S:case mS:o.DPI=90*r;break;default:$(!1,52)}var h,l,u=n.getAxisOrientation(),c=i;if(this.v13_&&"ne"==u.substr(0,2))h=i[0],c[0]=i[1],c[1]=h,h=i[2],c[2]=i[3],c[3]=h;if(o.BBOX=c.join(","),1==s.length)l=s[0];else l=s[Wt(Ex(t),s.length)];return uS(l,o)}},ZS.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},ZS.prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},ZS.prototype.fixedTileUrlFunction=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_),s=ws(r.getTileSize(t[0]),this.tmpSize),a=this.gutter_;0!==a&&(s=Ss(s,a,this.tmpSize),o=rt(o,n*a,o)),1!=e&&(s=Cs(s,e,this.tmpSize));var h={SERVICE:"WMS",VERSION:gS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return C(h,this.params_),this.getRequestUrl_(t,s,o,e,i,h)}},ZS.prototype.updateParams=function(t){C(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},ZS.prototype.updateV13_=function(){var t=this.params_.VERSION||gS;this.v13_=0<=In(t,"1.3")};var HS=function(t,e,i,r,n,o){co.call(this,t,e),this.src_=i,this.extent_=r,this.preemptive_=n,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=o};t(HS,co),HS.prototype.getImage=function(){return null},HS.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),i=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),r=this.grid_[Math.floor((1-i)*this.grid_.length)];if("string"!=typeof r)return null;var n=r.charCodeAt(Math.floor(e*r.length));93<=n&&n--,35<=n&&n--;var o=null;if((n-=32)in this.keys_){var s=this.keys_[n];o=this.data_&&s in this.data_?this.data_[s]:s}return o},HS.prototype.forDataAtCoordinate=function(e,i,r,t){this.state==eo&&!0===t?(p(this,E,function(t){i.call(r,this.getData(e))},this),this.loadInternal_()):!0===t?setTimeout(function(){i.call(r,this.getData(e))}.bind(this),0):i.call(r,this.getData(e))},HS.prototype.getKey=function(){return this.src_},HS.prototype.handleError_=function(){this.state=no,this.changed()},HS.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=oo,this.changed()},HS.prototype.loadInternal_=function(){if(this.state==eo)if(this.state=io,this.jsonp_)Px(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},HS.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||200<=e.status&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(i)}else this.handleError_()},HS.prototype.onXHRError_=function(t){this.handleError_()},HS.prototype.load=function(){this.preemptive_&&this.loadInternal_()};var qS=function(t){if(Vx.call(this,{projection:Ee("EPSG:3857"),state:_s}),this.preemptive_=void 0===t.preemptive||t.preemptive,this.tileUrlFunction_=Fx,this.template_=void 0,this.jsonp_=t.jsonp||!1,t.url)if(this.jsonp_)Px(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{var e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):$(!1,51)};t(qS,Vx),qS.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||200<=e.status&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},qS.prototype.onXHRError_=function(t){this.handleTileJSONError()},qS.prototype.getTemplate=function(){return this.template_}
1,qS.prototype.forDataAtCoordinateAndResolution=function(t,e,i,r){if(this.tileGrid){var n=this.tileGrid.getTileCoordForCoordAndResolution(t,e);this.getTile(n[0],n[1],n[2],1,this.getProjection()).forDataAtCoordinate(t,i,null,r)}else!0===r?setTimeout(function(){i(null)},0):i(null)},qS.prototype.handleTileJSONError=function(){this.setState(ys)},qS.prototype.handleTileJSONResponse=function(e){var t,i=Ee("EPSG:4326"),r=this.getProjection();if(void 0!==e.bounds){var n=Me(i,r);t=Gt(e.bounds,n)}var o=e.minzoom||0,s=e.maxzoom||22,a=zx({extent:Xx(r),maxZoom:s,minZoom:o});this.tileGrid=a,this.template_=e.template;var h=e.grids;if(h){if(this.tileUrlFunction_=Rx(h,a),void 0!==e.attribution){var l=void 0!==t?t:i.getExtent();this.setAttributions(function(t){return Nt(l,t.extent)?[e.attribution]:null})}this.setState(vs)}else this.setState(ys)},qS.prototype.getTile=function(t,e,i,r,n){var o=Cx(t,e,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=this.tileUrlFunction_(a,r,n),l=new HS(s,void 0!==h?eo:oo,void 0!==h?h:"",this.tileGrid.getTileCoordExtent(s),this.preemptive_,this.jsonp_);return this.tileCache.set(o,l),l},qS.prototype.useTile=function(t,e,i){var r=Cx(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)};var JS=function(t,e,i,s,a,r,h,l,n,u,c,p,d,f,o){if(co.call(this,t,e,{transition:0}),this.context_={},this.loader_,this.replayState_={},this.sourceTiles_=u,this.tileKeys=[],this.extent=null,this.sourceRevision_=i,this.wrappedTileCoord=r,this.loadListenerKeys_=[],this.sourceTileListenerKeys_=[],r){var g=this.extent=n.getTileCoordExtent(r),_=n.getResolution(o),v=l.getZForResolution(_),y=o!=t[0],m=0;if(l.forEachTileCoord(g,v,function(t){var e=Pt(g,l.getTileCoordExtent(t)),i=l.getExtent();if(i&&(e=Pt(e,i,e)),.5<=Ot(e)/_&&.5<=Lt(e)/_){++m;var r=t.toString(),n=u[r];if(!n&&!y){var o=h(t,c,p);n=u[r]=new d(t,null==o?oo:eo,null==o?"":o,s,a),this.sourceTileListenerKeys_.push(S(n,E,f))}!n||y&&n.getState()!=ro||(n.consumers++,this.tileKeys.push(r))}}.bind(this)),y&&m==this.tileKeys.length&&this.finishLoading_(),o<=t[0]&&this.state!=ro)for(;o>n.getMinZoom();){var x=new JS(t,e,i,s,a,r,h,l,n,u,c,p,d,F,--o);if(x.state==ro){this.interimTile=x;break}}}};function QS(t,e){var i=dh(e,t.getFormat(),t.onLoad.bind(t),t.onError.bind(t));t.setLoader(i)}t(JS,co),JS.prototype.disposeInternal=function(){this.state=so,this.changed(),this.interimTile&&this.interimTile.dispose();for(var t=0,e=this.tileKeys.length;t<e;++t){var i=this.tileKeys[t],r=this.getTile(i);r.consumers--,0==r.consumers&&(delete this.sourceTiles_[i],r.dispose())}this.tileKeys.length=0,this.sourceTiles_=null,this.loadListenerKeys_.forEach(f),this.loadListenerKeys_.length=0,this.sourceTileListenerKeys_.forEach(f),this.sourceTileListenerKeys_.length=0,co.prototype.disposeInternal.call(this)},JS.prototype.getContext=function(t){var e=wt(t).toString();return e in this.context_||(this.context_[e]=ni()),this.context_[e]},JS.prototype.getImage=function(t){return-1==this.getReplayState(t).renderedTileRevision?null:this.getContext(t).canvas},JS.prototype.getReplayState=function(t){var e=wt(t).toString();return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedRevision:-1,renderedTileRevision:-1}),this.replayState_[e]},JS.prototype.getKey=function(){return this.tileKeys.join("/")+"-"+this.sourceRevision_},JS.prototype.getTile=function(t){return this.sourceTiles_[t]},JS.prototype.load=function(){var n=0,o={};this.state==eo&&this.setState(io),this.state==io&&this.tileKeys.forEach(function(t){var r=this.getTile(t);if(r.state==eo&&(r.setLoader(this.loader_),r.load()),r.state==io){var e=S(r,E,function(t){var e=r.getState();if(e==ro||e==no){var i=wt(r);e==no?o[i]=!0:(--n,delete o[i]),n-Object.keys(o).length==0&&this.finishLoading_()}}.bind(this));this.loadListenerKeys_.push(e),++n}}.bind(this)),n-Object.keys(o).length==0&&setTimeout(this.finishLoading_.bind(this),0)},JS.prototype.finishLoading_=function(){for(var t=this.tileKeys.length,e=0,i=t-1;0<=i;--i){var r=this.getTile(this.tileKeys[i]).getState();r!=ro&&--t,r==oo&&++e}t==this.tileKeys.length?(this.loadListenerKeys_.forEach(f),this.loadListenerKeys_.length=0,this.setState(ro)):this.setState(e==this.tileKeys.length?oo:no)};var $S=function(t){var e=t.projection||"EPSG:3857",i=t.extent||Xx(e),r=t.tileGrid||zx({extent:i,maxZoom:t.maxZoom||22,minZoom:t.minZoom,tileSize:t.tileSize||512});qx.call(this,{attributions:t.attributions,cacheSize:void 0!==t.cacheSize?t.cac
1heSize:128,extent:i,opaque:!1,projection:e,state:t.state,tileGrid:r,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:QS,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition}),this.format_=t.format?t.format:null,this.sourceTiles_={},this.overlaps_=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass?t.tileClass:cc,this.tileGrids_={}};t($S,qx),$S.prototype.getOverlaps=function(){return this.overlaps_},$S.prototype.clear=function(){this.tileCache.clear(),this.sourceTiles_={}},$S.prototype.getTile=function(t,e,i,r,n){var o=Cx(t,e,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=new JS(s,null!==a?eo:oo,this.getRevision(),this.format_,this.tileLoadFunction,a,this.tileUrlFunction,this.tileGrid,this.getTileGridForProjection(n),this.sourceTiles_,r,n,this.tileClass,this.handleTileChange.bind(this),s[0]);return this.tileCache.set(o,h),h},$S.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var r=this.tileGrid;i=this.tileGrids_[e]=Yx(t,void 0,r?r.getTileSize(r.getMinZoom()):void 0)}return i},$S.prototype.getTilePixelRatio=function(t){return t},$S.prototype.getTilePixelSize=function(t,e,i){var r=ws(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(r[0]*e),Math.round(r[1]*e)]};var tC="KVP",eC="REST",iC=function(t){this.matrixIds_=t.matrixIds,Gx.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};function rC(n,t,e){var o=[],s=[],a=[],h=[],l=[],u=void 0!==e?e:[],c="TileMatrix",p="Identifier",d="ScaleDenominator",f="TopLeftCorner",i=n.SupportedCRS,r=Ee(i.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Ee(i),g=r.getMetersPerUnit(),_="ne"==r.getAxisOrientation().substr(0,2);return n[c].sort(function(t,e){return e[d]-t[d]}),n[c].forEach(function(e){if(!(0<u.length)||Nr(u,function(t){return e[p]==t[c]||-1===e[p].indexOf(":")&&n[p]+":"+e[p]===t[c]})){s.push(e[p]);var t=28e-5*e[d]/g,i=e.TileWidth,r=e.TileHeight;_?a.push([e[f][1],e[f][0]]):a.push(e[f]),o.push(t),h.push(i==r?i:[i,r]),l.push([e.MatrixWidth,-e.MatrixHeight])}}),new iC({extent:t,origins:a,resolutions:o,matrixIds:s,tileSizes:h,sizes:l})}t(iC,Gx),iC.prototype.getMatrixId=function(t){return this.matrixIds_[t]},iC.prototype.getMatrixIds=function(){return this.matrixIds_};var nC=function(t){this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style;var e=t.urls;void 0===e&&void 0!==t.url&&(e=Lx(t.url)),this.requestEncoding_=void 0!==t.requestEncoding?t.requestEncoding:tC;var s=this.requestEncoding_,a=t.tileGrid,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};s==tC&&C(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_});var h=this.dimensions_;this.createFromWMTSTemplate_=function(o){return o=s==tC?uS(o,i):o.replace(/\{(\w+?)\}/g,function(t,e){return e.toLowerCase()in i?i[e.toLowerCase()]:t}),function(t,e,i){if(t){var r={TileMatrix:a.getMatrixId(t[0]),TileCol:t[1],TileRow:-t[2]-1};C(r,h);var n=o;return n=s==tC?uS(n,r):n.replace(/\{(\w+?)\}/g,function(t,e){return r[e]})}}};var r=e&&0<e.length?Ix(e.map(this.createFromWMTSTemplate_)):Fx;Jx.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:a,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:r,urls:e,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition}
1),this.setKey(this.getKeyForDimensions_())};t(nC,Jx),nC.prototype.setUrls=function(t){var e=(this.urls=t).join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ix(t.map(this.createFromWMTSTemplate_.bind(this))),e)},nC.prototype.getDimensions=function(){return this.dimensions_},nC.prototype.getFormat=function(){return this.format_},nC.prototype.getLayer=function(){return this.layer_},nC.prototype.getMatrixSet=function(){return this.matrixSet_},nC.prototype.getRequestEncoding=function(){return this.requestEncoding_},nC.prototype.getStyle=function(){return this.style_},nC.prototype.getVersion=function(){return this.version_},nC.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var i in this.dimensions_)e[t++]=i+"-"+this.dimensions_[i];return e.join("/")},nC.prototype.updateDimensions=function(t){C(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())};var oC="default",sC="truncated",aC=function(t,e,i,r,n,o,s){po.call(this,e,i,r,n,o,s),this.zoomifyImage_=null,this.tileSize_=ws(t.getTileSize(e[0]))};t(aC,po),aC.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var t=po.prototype.getImage.call(this);if(this.state==ro){var e=this.tileSize_;if(t.width==e[0]&&t.height==e[1])return this.zoomifyImage_=t;var i=ni(e[0],e[1]);return i.drawImage(t,0,0),this.zoomifyImage_=i.canvas,i.canvas}return t};var hC=function(t){var e=t||{},i=e.size,r=void 0!==e.tierSizeCalculation?e.tierSizeCalculation:oC,n=i[0],o=i[1],s=e.extent||[0,-i[1],i[0],0],u=[],a=e.tileSize||qo,h=a;switch(r){case oC:for(;h<n||h<o;)u.push([Math.ceil(n/h),Math.ceil(o/h)]),h+=h;break;case sC:for(var l=n,c=o;h<l||h<c;)u.push([Math.ceil(l/h),Math.ceil(c/h)]),l>>=1,c>>=1;break;default:$(!1,53)}u.push([1,1]),u.reverse();for(var p=[1],d=[0],f=1,g=u.length;f<g;f++)p.push(1<<f),d.push(u[f-1][0]*u[f-1][1]+d[f-1]);p.reverse();var _=new Gx({tileSize:a,extent:s,origin:Mt(s),resolutions:p}),v=e.url;v&&-1==v.indexOf("{TileGroup}")&&-1==v.indexOf("{tileIndex}")&&(v+="{TileGroup}/{z}-{x}-{y}.jpg");var y=Ix(Lx(v).map(function(l){return function(t,e,i){if(t){var r=t[0],n=t[1],o=-t[2]-1,s=n+o*u[r][0],a=_.getTileSize(r),h={z:r,x:n,y:o,tileIndex:s,TileGroup:"TileGroup"+((s+d[r])/a|0)};return l.replace(/\{(\w+?)\}/g,function(t,e){return h[e]})}}})),m=aC.bind(null,_);Jx.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:m,tileGrid:_,tileUrlFunction:y,transition:e.transition})};t(hC,Jx);var lC=window.ol={};lC.color={},lC.colorlike={},lC.control={},lC.coordinate={},lC.easing={},lC.events={},lC.events.condition={},lC.extent={},lC.featureloader={},lC.format={},lC.format.filter={},lC.geom={},lC.has={},lC.interaction={},lC.layer={},lC.loadingstrategy={},lC.proj={},lC.proj.Units={},lC.proj.proj4={},lC.render={},lC.render.canvas={},lC.renderer={},lC.renderer.canvas={},lC.renderer.webgl={},lC.size={},lC.source={},lC.sphere={},lC.style={},lC.style.IconImageCache={},lC.tilegrid={},lC.xml={},lC.Collection=Q,lC.Feature=yr,lC.Geolocation=Tn,lC.Graticule=Qn,lC.Kinetic=go,lC.Map=Hu,lC.Object=K,lC.Observable=V,lC.Observable.unByKey=function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)f(t[e]);else f(t)},lC.Overlay=uc,lC.PluggableMap=Es,lC.View=os,lC.WebGLMap=Xp,lC.color.asArray=ti,lC.color.asString=qe,lC.colorlike.asColorLike=ri,lC.control.Attribution=Fs,lC.control.Attribution.render=Ls,lC.control.Control=Ts,lC.control.FullScreen=gc,lC.control.MousePosition=Kp,lC.control.MousePosition.render=Zp,lC.control.OverviewMap=mc,lC.control.OverviewMap.render=xc,lC.control.Rotate=Ps,lC.control.Rotate.render=Ms,lC.control.ScaleLine=Fc,lC.control.ScaleLine.render=Lc,lC.control.Zoom=bs,lC.control.ZoomSlider=bc,lC.control.ZoomSlider.render=Oc,lC.control.ZoomToExtent=Nc,lC.control.defaults=Os,lC.coordinate.add=Fn,lC.coordinate.createStringXY=function(e){return function(t){return Dn(t,e)}},lC.coordinate.format=Mn,lC.coordinate.rotate=On,lC.coordinate.toStringHDMS=function(t,e){return t?Pn("NS",t[1],e)+" "+Pn("EW",t[0],e):""},lC.coordinate.toStringXY=Dn,lC.easing.easeIn=ao,lC.easing.easeOut=ho,lC.easing.inAndOut=lo,lC.easing.linear=uo,lC.easing.upAndDown=function(t){return t<.5?lo(2*t):1-lo(2*(t-.5))}
1,lC.events.condition.altKeyOnly=Ys,lC.events.condition.altShiftKeysOnly=Xs,lC.events.condition.always=Vs,lC.events.condition.click=function(t){return t.type==yo.CLICK},lC.events.condition.doubleClick=function(t){return t.type==yo.DBLCLICK},lC.events.condition.focus=function(t){return t.target.getTargetElement()===document.activeElement},lC.events.condition.mouseOnly=$s,lC.events.condition.never=Ks,lC.events.condition.noModifierKeys=qs,lC.events.condition.platformModifierKeyOnly=function(t){var e=t.originalEvent;return!e.altKey&&(Ii?e.metaKey:e.ctrlKey)&&!e.shiftKey},lC.events.condition.pointerMove=Zs,lC.events.condition.primaryAction=ta,lC.events.condition.shiftKeyOnly=Js,lC.events.condition.singleClick=Hs,lC.events.condition.targetNotEditable=Qs,lC.extent.applyTransform=Gt,lC.extent.boundingExtent=it,lC.extent.buffer=rt,lC.extent.containsCoordinate=st,lC.extent.containsExtent=at,lC.extent.containsXY=ht,lC.extent.createEmpty=ut,lC.extent.equals=_t,lC.extent.extend=vt,lC.extent.getArea=Ct,lC.extent.getBottomLeft=Tt,lC.extent.getBottomRight=Rt,lC.extent.getCenter=It,lC.extent.getHeight=Lt,lC.extent.getIntersection=Pt,lC.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},lC.extent.getTopLeft=Mt,lC.extent.getTopRight=bt,lC.extent.getWidth=Ot,lC.extent.intersects=Nt,lC.extent.isEmpty=At,lC.featureloader.xhr=fh,lC.format.EsriJSON=ed,lC.format.Feature=Hp,lC.format.GML=Kd,lC.format.GML2=Hd,lC.format.GML3=Vd,lC.format.GPX=Jd,lC.format.GeoJSON=Nf,lC.format.IGC=Xf,lC.format.KML=yg,lC.format.MVT=Ev,lC.format.OSMXML=Lv,lC.format.Polyline=kv,lC.format.Polyline.decodeDeltas=Dv,lC.format.Polyline.decodeFloats=jv,lC.format.Polyline.encodeDeltas=Gv,lC.format.Polyline.encodeFloats=Uv,lC.format.TopoJSON=Bv,lC.format.WFS=Ey,lC.format.WFS.writeFilter=function(t){var e=hd(Sy,"Filter");return Ay(e,t,[]),e},lC.format.WKT=$y,lC.format.WMSCapabilities=um,lC.format.WMSGetFeatureInfo=Om,lC.format.WMTSCapabilities=qm,lC.format.filter.Bbox=Qv,lC.format.filter.Contains=ty,lC.format.filter.During=iy,lC.format.filter.EqualTo=ny,lC.format.filter.GreaterThan=oy,lC.format.filter.GreaterThanOrEqualTo=sy,lC.format.filter.Intersects=ay,lC.format.filter.IsBetween=hy,lC.format.filter.IsLike=ly,lC.format.filter.IsNull=uy,lC.format.filter.LessThan=cy,lC.format.filter.LessThanOrEqualTo=py,lC.format.filter.Not=dy,lC.format.filter.NotEqualTo=fy,lC.format.filter.Or=gy,lC.format.filter.Within=_y,lC.format.filter.and=vy,lC.format.filter.bbox=yy,lC.format.filter.between=function(t,e,i){return new hy(t,e,i)},lC.format.filter.contains=function(t,e,i){return new ty(t,e,i)},lC.format.filter.during=function(t,e,i){return new iy(t,e,i)},lC.format.filter.equalTo=function(t,e,i){return new ny(t,e,i)},lC.format.filter.greaterThan=function(t,e){return new oy(t,e)},lC.format.filter.greaterThanOrEqualTo=function(t,e){return new sy(t,e)},lC.format.filter.intersects=function(t,e,i){return new ay(t,e,i)},lC.format.filter.isNull=function(t){return new uy(t)},lC.format.filter.lessThan=function(t,e){return new cy(t,e)},lC.format.filter.lessThanOrEqualTo=function(t,e){return new py(t,e)},lC.format.filter.like=function(t,e,i,r,n,o){return new ly(t,e,i,r,n,o)},lC.format.filter.not=function(t){return new dy(t)},lC.format.filter.notEqualTo=function(t,e,i){return new fy(t,e,i)},lC.format.filter.or=function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(gy,e))},lC.format.filter.within=function(t,e,i){return new _y(t,e,i)},lC.geom.Circle=ih,lC.geom.Geometry=We,lC.geom.GeometryCollection=bf,lC.geom.LineString=Bn,lC.geom.LinearRing=on,lC.geom.MultiLineString=rh,lC.geom.MultiPoint=nh,lC.geom.MultiPolygon=sh,lC.geom.Point=sn,lC.geom.Polygon=xn,lC.geom.Polygon.circular=Sn,lC.geom.Polygon.fromCircle=wn,lC.geom.Polygon.fromExtent=Cn,lC.geom.SimpleGeometry=Ur,lC.has.DEVICE_PIXEL_RATIO=Fi,lC.has.GEOLOCATION=Pi,lC.has.TOUCH=Mi,lC.has.WEBGL=mi,lC.inherits=t,lC.interaction.DoubleClickZoom=zs,lC.interaction.DragAndDrop=Ha,lC.interaction.DragBox=Sa,lC.interaction.DragPan=ha,lC.interaction.DragRotate=pa,lC.interaction.DragRotateAndZoom=Qa,lC.interaction.DragZoom=Ra,lC.interaction.Draw=Zh,lC.interaction.Draw.createBox=function(){return function(t,e){var i=it(t),r=e||new xn(null);return r.setCoordinates([[Tt(i),Rt(i),bt(i),Mt(i),Tt(i)]]),r}},lC.interaction.Draw.createRegularPolygon=function(s,a){return function(t,e){var i=t[0],r=t[1],n=Math.sqrt(An(i,r)),o=e||wn(new ih(i),s);return En(o,i,n,a||Math.atan((r[1]-i[1])/(r[0]-i[0]))),o}},lC.interaction.Draw.handleEvent=Hh,lC.interaction.Extent=tl,lC.interaction.Interaction=As,lC.interaction.Ke
1yboardPan=Ma,lC.interaction.KeyboardZoom=Oa,lC.interaction.Modify=ul,lC.interaction.MouseWheelZoom=Ga,lC.interaction.PinchRotate=Ua,lC.interaction.PinchZoom=Ya,lC.interaction.Pointer=oa,lC.interaction.Pointer.handleEvent=aa,lC.interaction.Select=Cl,lC.interaction.Snap=El,lC.interaction.Translate=Ml,lC.interaction.defaults=kl,lC.layer.Base=fs,lC.layer.Group=xs,lC.layer.Heatmap=gx,lC.layer.Image=_x,lC.layer.Layer=Rs,lC.layer.Tile=mx,lC.layer.Vector=ch,lC.layer.VectorTile=xx,lC.loadingstrategy.all=gh,lC.loadingstrategy.bbox=function(t,e){return[t]},lC.loadingstrategy.tile=function(s){return function(t,e){var i=s.getZForResolution(e),r=s.getTileRangeForExtentAndZ(t,i),n=[],o=[i,0,0];for(o[1]=r.minX;o[1]<=r.maxX;++o[1])for(o[2]=r.minY;o[2]<=r.maxY;++o[2])n.push(s.getTileCoordExtent(o));return n}},lC.proj.Projection=ee,lC.proj.Units.METERS_PER_UNIT=te,lC.proj.addCoordinateTransforms=Le,lC.proj.addEquivalentProjections=Re,lC.proj.addProjection=we,lC.proj.equivalent=Pe,lC.proj.fromLonLat=function(t,e){return Oe(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},lC.proj.get=Ee,lC.proj.getPointResolution=Te,lC.proj.getTransform=be,lC.proj.proj4.register=function(t){var e,i,r=Object.keys(t.defs),n=r.length;for(e=0;e<n;++e){var o=r[e];if(!Ee(o)){var s=t.defs(o);we(new ee({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:s.units}))}}for(e=0;e<n;++e){var a=r[e],h=Ee(a);for(i=0;i<n;++i){var l=r[i],u=Ee(l);if(!xe(a,l))if(t.defs[a]===t.defs[l])Re([h,u]);else{var c=t(a,l);Le(h,u,c.forward,c.inverse)}}}},lC.proj.toLonLat=function(t,e){var i=Oe(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),r=i[0];return(r<-180||180<r)&&(i[0]=Wt(r+180,360)-180),i},lC.proj.transform=Oe,lC.proj.transformExtent=Ne,lC.render.VectorContext=Ul,lC.render.canvas.labelCache=Hi,lC.render.toContext=function(t,e){var i=t.canvas,r=e||{},n=r.pixelRatio||Fi,o=r.size;o&&(i.width=o[0]*n,i.height=o[1]*n,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],a=Be([1,0,0,1,0,0],n,n);return new jl(t,n,s,a,0)},lC.renderer.canvas.ImageLayer=Ql,lC.renderer.canvas.Map=Zl,lC.renderer.canvas.TileLayer=eu,lC.renderer.canvas.VectorLayer=Bu,lC.renderer.canvas.VectorTileLayer=Zu,lC.renderer.webgl.ImageLayer=Gp,lC.renderer.webgl.Map=Dp,lC.renderer.webgl.TileLayer=Bp,lC.renderer.webgl.VectorLayer=Yp,lC.size.toSize=ws,lC.source.BingMaps=$x,lC.source.CartoDB=eS,lC.source.Cluster=iS,lC.source.Image=hS,lC.source.ImageArcGISRest=cS,lC.source.ImageCanvas=pS,lC.source.ImageMapGuide=dS,lC.source.ImageStatic=fS,lC.source.ImageWMS=xS,lC.source.OSM=wS,lC.source.OSM.ATTRIBUTION=CS,lC.source.Raster=kS,lC.source.Source=_h,lC.source.Stamen=YS,lC.source.Tile=Vx,lC.source.TileArcGISRest=XS,lC.source.TileDebug=WS,lC.source.TileImage=Jx,lC.source.TileJSON=KS,lC.source.TileWMS=ZS,lC.source.UTFGrid=qS,lC.source.Vector=jh,lC.source.VectorTile=$S,lC.source.WMTS=nC,lC.source.WMTS.optionsFromCapabilities=function(t,s){var e=Nr(t.Contents.Layer,function(t,e,i){return t.Identifier==s.layer});if(null===e)return null;var i,a=t.Contents.TileMatrixSet;(i=1<e.TileMatrixSetLink.length?Gr(e.TileMatrixSetLink,"projection"in s?function(e,t,i){var r=Nr(a,function(t){return t.Identifier==e.TileMatrixSet}).SupportedCRS,n=Ee(r.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Ee(r),o=Ee(s.projection);return n&&o?Pe(n,o):r==s.projection}:function(t,e,i){return t.TileMatrixSet==s.matrixSet}):0)<0&&(i=0);var r=e.TileMatrixSetLink[i].TileMatrixSet,n=e.TileMatrixSetLink[i].TileMatrixSetLimits,o=e.Format[0];"format"in s&&(o=s.format),(i=Gr(e.Style,function(t,e,i){return"style"in s?t.Title==s.style:t.isDefault}))<0&&(i=0);var h=e.Style[i].Identifier,l={};"Dimension"in e&&e.Dimension.forEach(function(t,e,i){var r=t.Identifier,n=t.Default;void 0===n&&(n=t.Value[0]),l[r]=n});var u,c=Nr(t.Contents.TileMatrixSet,function(t,e,i){return t.Identifier==r}),p=c.SupportedCRS;if(p&&(u=Ee(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Ee(p)),"projection"in s){var d=Ee(s.projection);d&&(u&&!Pe(d,u)||(u=d))}var f,g,_=e.WGS84BoundingBox;if(void 0!==_){var v=Ee("EPSG:4326").getExtent();g=_[0]==v[0]&&_[2]==v[2],f=Ne(_,"EPSG:4326",u);var y=u.getExtent();y&&(at(y,f)||(f=void 0))}var m=rC(c,f,n),x=[],S=s.requestEncoding;if(S=void 0!==S?S:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var C=t.OperationsMetadata.GetTile.DCP.HTTP.Get,w=0,E=C.length;w<E;++w)if(C[w].Constraint){var T=Nr(C[w].Constraint,function(t){return"GetEncoding"==t.name}
1).AllowedValues.Value;if(""===S&&(S=T[0]),S!==tC)break;Pr(T,tC)&&x.push(C[w].href)}else C[w].href&&(S=tC,x.push(C[w].href));return 0===x.length&&(S=eC,e.ResourceURL.forEach(function(t){"tile"===t.resourceType&&(o=t.format,x.push(t.template))})),{urls:x,layer:s.layer,matrixSet:r,format:o,projection:u,requestEncoding:S,tileGrid:m,style:h,dimensions:l,wrapX:g,crossOrigin:s.crossOrigin}},lC.source.XYZ=tS,lC.source.Zoomify=hC,lC.sphere.getArea=function t(e,i){var r=i||{},n=r.radius||Ht,o=r.projection||"EPSG:3857",s=e.getType();s!==Zt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,h,l,u,c,p,d=0;switch(s){case Zt.POINT:case Zt.MULTI_POINT:case Zt.LINE_STRING:case Zt.MULTI_LINE_STRING:case Zt.LINEAR_RING:break;case Zt.POLYGON:for(a=e.getCoordinates(),d=Math.abs(Qt(a[0],n)),l=1,u=a.length;l<u;++l)d-=Math.abs(Qt(a[l],n));break;case Zt.MULTI_POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)for(h=a[l],d+=Math.abs(Qt(h[0],n)),c=1,p=h.length;c<p;++c)d-=Math.abs(Qt(h[c],n));break;case Zt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(l=0,u=f.length;l<u;++l)d+=t(f[l],i);break;default:throw new Error("Unsupported geometry type: "+s)}return d},lC.sphere.getDistance=qt,lC.sphere.getLength=function t(e,i){var r=i||{},n=r.radius||Ht,o=r.projection||"EPSG:3857",s=e.getType();s!==Zt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,h,l,u,c,p,d=0;switch(s){case Zt.POINT:case Zt.MULTI_POINT:break;case Zt.LINE_STRING:case Zt.LINEAR_RING:d=Jt(a=e.getCoordinates(),n);break;case Zt.MULTI_LINE_STRING:case Zt.POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)d+=Jt(a[l],n);break;case Zt.MULTI_POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)for(c=0,p=(h=a[l]).length;c<p;++c)d+=Jt(h[c],n);break;case Zt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(l=0,u=f.length;l<u;++l)d+=t(f[l],i);break;default:throw new Error("Unsupported geometry type: "+s)}return d},lC.style.AtlasManager=Ip,lC.style.Circle=ur,lC.style.Fill=cr,lC.style.Icon=rg,lC.style.IconImageCache.shared=Yl,lC.style.Image=hr,lC.style.RegularShape=lr,lC.style.Stroke=pr,lC.style.Style=dr,lC.style.Text=Hn,lC.tilegrid.TileGrid=Gx,lC.tilegrid.WMTS=iC,lC.tilegrid.WMTS.createFromCapabilitiesMatrixSet=rC,lC.tilegrid.createXYZ=zx,lC.xml.getAllTextContent=ld,lC.xml.parse=pd}(); 2
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.