!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.turf={})}(this,function(t){"use strict";var f=6371008.8,r={meters:f,metres:f,millimeters:1e3*f,millimetres:1e3*f,centimeters:100*f,centimetres:100*f,kilometers:f/1e3,kilometres:f/1e3,miles:f/1609.344,nauticalmiles:f/1852,inches:39.37*f,yards:f/1.0936,feet:3.28084*f,radians:1,degrees:f/111325},e={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/f,degrees:1/111325},o={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006};function j(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&w(r),i&&b(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r,i=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");switch(i&&w(i),t){case"Point":r=X(e).geometry;break;case"LineString":r=U(e).geometry;break;case"Polygon":r=B(e).geometry;break;case"MultiPoint":r=u(e).geometry;break;case"MultiLineString":r=x(e).geometry;break;case"MultiPolygon":r=E(e).geometry;break;default:throw new Error(t+" is invalid")}return i&&(r.bbox=i),r}function X(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!V(t[0])||!V(t[1]))throw new Error("coordinates must contain numbers");return j({type:"Point",coordinates:t},e,n)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return Y(t.map(function(t){return X(t,e)}),n)}function B(t,e,n){if(!t)throw new Error("coordinates is required");for(var r=0;rt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=t.minX&&e.maxY>=t.minY}function Mt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Lt(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,ft(t,o,e,n,i),s.push(e,o,o,n))}function Pt(t,e){return t(e={exports:{}},e.exports),e.exports}_t.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!St(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;ithis._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Mt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,vt(n,this.toBBox),vt(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Mt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,vt(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h,l,p,f,g,d,y;for(u=c=1/0,r=e;r<=n-e;r++)i=xt(t,0,r,this.toBBox),o=xt(t,r,n,this.toBBox),l=i,p=o,void 0,f=Math.max(l.minX,p.minX),g=Math.max(l.minY,p.minY),d=Math.min(l.maxX,p.maxX),y=Math.min(l.maxY,p.maxY),s=Math.max(0,d-f)*Math.max(0,y-g),a=It(i)+It(o),s>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function p(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n>1)-1;0<=n;n--)this._down(n)}function Xt(t,e){return t>1,o=e[i];if(0<=n(r,o))break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];tr[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;o=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function $t(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),c=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),l=n.search({minX:a,minY:u,maxX:c,maxY:h}),p=0;p=i[0]&&o[3]>=i[1]))return!1;"Polygon"===u&&(a=[a]);for(var h=0,l=!1;ht[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function ue(t,e){var n=[];return R(e,function(e){L(t,function(t){se(t,e)&&n.push(t)})}),Y(n)}function ce(t,n){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var o=!1;return Y(function(t){if(t.length<3)return[];t.sort(le);var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,h=t[a].y,l=h;for(;a--;)t[a].yl&&(l=t[a].y);var p,f=c-u,g=l-h,d=gm[p].r?(v.push(m[p]),m.splice(p,1)):(g=t[a].y-m[p].y,f*f+g*g>m[p].r||(x.push(m[p].a,m[p].b,m[p].b,m[p].c,m[p].c,m[p].a),m.splice(p,1)));for(pe(x),p=x.length;p;)n=x[--p],e=x[--p],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),1e-12s&&(i=n[0],n[0]=n[o],n[o]=i,s=r);return n})}}.apply(this,arguments))};var be=function(o,s,a,t,u,e){3===arguments.length&&(t=e=Array,u=null);for(var c=new t(o=1<=o)throw new Error("full hashmap");r=c[n=n+1&l]}return c[n]=t,h[n]=e},maybeSet:function(t,e){for(var n=s(t)&l,r=c[n],i=0;r!=u;){if(a(r,t))return h[n];if(++i>=o)throw new Error("full hashmap");r=c[n=n+1&l]}return c[n]=t,h[n]=e},get:function(t,e){for(var n=s(t)&l,r=c[n],i=0;r!=u;){if(a(r,t))return h[n];if(++i>=o)break;r=c[n=n+1&l]}return e},keys:function(){for(var t=[],e=0,n=c.length;e>7^Se[2]^Se[3])},Le=function(t){var e,n,r,i,o=t.coordinates,s=t.lines,a=t.rings,u=function(){for(var t=be(1.4*o.length,E,w,Int32Array,-1,Int32Array),e=new Int32Array(o.length),n=0,r=o.length;n=i)throw new Error("full hashset");n=u[e=e+1&c]}return u[e]=t,!0},has:function(t){for(var e=o(t)&c,n=u[e],r=0;n!=a;){if(s(n,t))return!0;if(++r>=i)break;n=u[e=e+1&c]}return!1},values:function(){for(var t=[],e=0,n=u.length;e>1);e=Math.abs(h)?0this.duration&&(e=this.duration-1);var n=e/this.duration;if(1<=n)return this.points[this.length-1];var r,i,o,s,a,u,c,h,l=Math.floor((this.points.length-1)*n),p=(this.length-1)*n-l;return r=p,i=this.points[l],o=this.controls[l][1],s=this.controls[l+1][0],a=this.points[l+1],h=[(c=(u=r)*u)*u,3*c*(1-u),3*u*(1-u)*(1-u),(1-u)*(1-u)*(1-u)],{x:a.x*h[0]+s.x*h[1]+o.x*h[2]+i.x*h[3],y:a.y*h[0]+s.y*h[1]+o.y*h[2]+i.y*h[3],z:a.z*h[0]+s.z*h[1]+o.z*h[2]+i.z*h[3]}};var sn=un,an=un;function un(t,e,n){n=n||2;var r,i,o,s,a,u,c,h=e&&e.length,l=h?e[0]*n:t.length,p=cn(t,0,l,n,!0),f=[];if(!p)return f;if(h&&(p=function(t,e,n,r){var i,o,s,a,u,c=[];for(i=0,o=e.length;i80*n){r=o=t[0],i=s=t[1];for(var g=n;go.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,h=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=mn(a,u,e,n,r),p=mn(c,h,e,n,r),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&xn(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=En(f.prev,f,f.next))return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&xn(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=En(f.prev,f,f.next))return!1;f=f.prevZ}return!0}function gn(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!wn(i,o)&&bn(i,r,r.next,o)&&In(i,o)&&In(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Sn(r),Sn(r.next),r=t=o),r=r.next}while(r!==t);return r}function dn(t,e,n,r,i,o){var s,a,u=t;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(a=c,(s=u).next.i!==a.i&&s.prev.i!==a.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&bn(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(s,a)&&In(s,a)&&In(a,s)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==t;);return r}(s,a))){var h=Nn(u,c);return u=hn(u,u.next),h=hn(h,h.next),ln(u,e,n,r,i,o),void ln(h,e,n,r,i,o)}c=c.next}u=u.next}while(u!==t)}function yn(t,e){return t.x-e.x}function _n(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&s=r.x&&r.x>=h&&i!==r.x&&xn(on.x)&&In(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=Nn(e,t);hn(n,n.next)}}function mn(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function vn(t){for(var e=t,n=t;e.x=t.minX&&e.maxY>=t.minY}function Vn(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Hn(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(Rn(t,o=e+Math.ceil((n-e)/r/2)*r,e,n,i),s.push(e,o,o,n))}function Wn(t){var e=Dn(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=Jn(e)).bbox=e}else t.bbox=t.bbox?t.bbox:Zn(t);return Dn.prototype.insert.call(this,t)},e.load=function(t){var n=[];return Array.isArray(t)?t.forEach(function(t){var e=Jn(t);e.bbox=t,n.push(e)}):L(t,function(t){t.bbox=t.bbox?t.bbox:Zn(t),n.push(t)}),Dn.prototype.load.call(this,n)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=Jn(e)).bbox=e}return Dn.prototype.remove.call(this,t)},e.clear=function(){return Dn.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:Dn.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return Dn.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:Dn.prototype.all.call(this)}},e.toJSON=function(){return Dn.prototype.toJSON.call(this)},e.fromJSON=function(t){return Dn.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:Zn(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function Jn(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function Zn(t){var e=[1/0,1/0,-1/0,-1/0];return N(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2] line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],u=r[0][0],c=r[0][1],h=r[1][0],l=r[1][1],p=(l-c)*(s-i)-(h-u)*(a-o),f=(h-u)*(o-c)-(l-c)*(i-u),g=(s-i)*(o-c)-(a-o)*(i-u);if(0===p)return null;var d=f/p,y=g/p;return 0<=d&&d<=1&&0<=y&&y<=1?X([i+d*(s-i),o+d*(a-o)]):null}function tr(t,p,f){if(!H(f=f||{}))throw new Error("options is invalid");var e=t.geometry?t.geometry.type:t.type;if("LineString"!==e&&"MultiLineString"!==e)throw new Error("lines must be LineString or MultiLineString");var g=X([1/0,1/0],{dist:1/0}),d=0;return A(t,function(t){for(var e=Z(t),n=0;nMath.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(y(Math.atan2(i,o))+360)%360}function rr(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=J(t),o=J(e);return o[0]+=180Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=1e-11r&&(i[0]=r),i[0]<-r&&(i[0]=-r),i[1]>r&&(i[1]=r),i[1]<-r&&(i[1]=-r),i}function ur(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}un.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Ln(t,0,o,n));if(i)for(var a=0,u=e.length;athis._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Vn(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,qn(n,this.toBBox),qn(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Vn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,qn(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h,l,p,f,g,d,y;for(u=c=1/0,r=e;r<=n-e;r++)i=Gn(t,0,r,this.toBBox),o=Gn(t,r,n,this.toBBox),l=i,p=o,void 0,f=Math.max(l.minX,p.minX),g=Math.max(l.minY,p.minY),d=Math.min(l.maxX,p.maxX),y=Math.min(l.maxY,p.maxY),s=Math.max(0,d-f)*Math.max(0,y-g),a=jn(i)+jn(o),s=Math.abs(l)?0=Math.abs(l)?0=Math.abs(l)?0=Math.abs(l)?0e[0])&&(!(t[2]e[1])&&!(t[3] is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof r)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return N(t,function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;rp){var E=parseFloat(n[v-1][0]),w=parseFloat(n[v-1][1]),b=parseFloat(n[v][0]),I=parseFloat(n[v][1]);if(-180h&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(Eh?180:-180,M]),(m=[]).push([n[v-1][0]>h?-180:180,M]),_.push(m)}else m=[],_.push(m);m.push([x,n[v][1]])}else m.push([n[v][0],n[v][1]])}}else{var L=[];_.push(L);for(var P=0;Pe[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function ni(t,e){for(var n=[],r=0;rMath.PI/2&&(c=0 "+this.to.id+" }"},To.prototype.toLineString=function(){return U([this.from.coordinates,this.to.coordinates])},To.prototype.compareTo=function(t){return Po(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var Ao=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},Do={length:{configurable:!0}};Ao.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Ao.prototype.get=function(t){return this.edges[t]},Do.length.get=function(){return this.edges.length},Ao.prototype.forEach=function(t){this.edges.forEach(t)},Ao.prototype.map=function(t){return this.edges.map(t)},Ao.prototype.some=function(t){return this.edges.some(t)},Ao.prototype.isValid=function(){return!0},Ao.prototype.isHole=function(){var r=this,t=this.edges.reduce(function(t,e,n){return e.from.coordinates[1]>r.edges[t].from.coordinates[1]&&(t=n),t},0),e=(0===t?this.length:t)-1,n=(t+1)%this.length,i=Po(this.edges[e].from.coordinates,this.edges[t].from.coordinates,this.edges[n].from.coordinates);return 0===i?this.edges[e].from.coordinates[0]>this.edges[n].from.coordinates[0]:0=Math.abs(s)?0e[0])&&(!(t[2]e[1])&&!(t[3]=Math.abs(a)?0=Math.abs(a)?0=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n=this.minPts)return n}},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r>1)-1,r=this.content[n];if(!(this.scoreFunction(e)=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]Qs||Math.abs(i[0][1]-i[1][1])>Qs)||delete Ks[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,h,l,p,f,g,d,y,_,m=Js.length,v=!0;for(i=0;iQs||Math.abs(d-p)>Qs)&&(u.splice(a,0,Ks.push(Ps(s,f,Math.abs(g-t)=n)return null;for(var r=s-u.site[0],i=a-u.site[1],l=r*r+i*i;u=c.cells[e=h],h=null,u.halfedges.forEach(function(t){var e=c.edges[t],n=e.left;if(n!==u.site&&n||(n=e.right)){var r=s-n[0],i=a-n[1],o=r*r+i*i;oe.x?1:this.ye.y?1:0},Pa.prototype.clone=function(){},Pa.prototype.copy=function(){return new Pa(this)},Pa.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Pa.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},Pa.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},Pa.prototype.hashCode=function(){var t=17;return t=37*(t=37*t+Pa.hashCode(this.x))+Pa.hashCode(this.y)},Pa.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},Pa.prototype.interfaces_=function(){return[Ca,Sa,La]},Pa.prototype.getClass=function(){return Pa},Pa.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=Ia.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Oa.DimensionalComparator.get=function(){return Ra},Oa.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Oa.NULL_ORDINATE.get=function(){return Ia.NaN},Oa.X.get=function(){return 0},Oa.Y.get=function(){return 1},Oa.Z.get=function(){return 2},Object.defineProperties(Pa,Oa);var Ra=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=t;if(2!==e&&3!==e)throw new ba("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Ra.prototype.compare=function(t,e){var n=t,r=e,i=Ra.compare(n.x,r.x);if(0!==i)return i;var o=Ra.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:Ra.compare(n.z,r.z)},Ra.prototype.interfaces_=function(){return[Ma]},Ra.prototype.getClass=function(){return Ra},Ra.compare=function(t,e){return tt?1:0},ka.isNaN=function(t){return Number.isNaN(t)};var za=function(){};za.isWhitespace=function(t){return t<=32&&0<=t||127===t},za.toUpperCase=function(t){return t.toUpperCase()};var ja=function t(){if(this._hi=0,(this._lo=0)===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},Xa={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};ja.prototype.le=function(t){return(this._hi=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},ja.prototype.sqr=function(){return this.multiply(this)},ja.prototype.doubleValue=function(){return this._hi+this._lo},ja.prototype.subtract=function(){if(arguments[0]instanceof ja){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},ja.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},ja.prototype.isZero=function(){return 0===this._hi&&0===this._lo},ja.prototype.selfSubtract=function(){if(arguments[0]instanceof ja){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},ja.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},ja.prototype.min=function(t){return this.le(t)?this:t},ja.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof ja){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n,r,i,o,s=arguments[0],a=arguments[1],u=null,c=null,h=null,l=null;return i=this._hi/s,l=(u=(h=ja.SPLIT*i)-(u=h-i))*(c=(l=ja.SPLIT*s)-(c=l-s))-(o=i*s)+u*(r=s-c)+(n=i-u)*c+n*r,l=i+(h=(this._hi-o-l+this._lo-i*a)/s),this._hi=l,this._lo=i-l+h,this}},ja.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},ja.prototype.divide=function(){if(arguments[0]instanceof ja){var t,e,n,r,i=arguments[0],o=null,s=null,a=null,u=null;return t=(n=this._hi/i._hi)-(o=(a=ja.SPLIT*n)-(o=a-n)),u=o*(s=(u=ja.SPLIT*i._hi)-(s=u-i._hi))-(r=n*i._hi)+o*(e=i._hi-s)+t*s+t*e,a=(this._hi-r-u+this._lo-n*i._lo)/i._hi,new ja(u=n+a,n-u+a)}if("number"==typeof arguments[0]){var c=arguments[0];return Ia.isNaN(c)?ja.createNaN():ja.copy(this).selfDivide(c,0)}},ja.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},ja.prototype.pow=function(t){if(0===t)return ja.valueOf(1);var e=new ja(this),n=ja.valueOf(1),r=Math.abs(t);if(1e._hi?1:this._loe._lo?1:0},ja.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},ja.prototype.setValue=function(){if(arguments[0]instanceof ja){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},ja.prototype.max=function(t){return this.ge(t)?this:t},ja.prototype.sqrt=function(){if(this.isZero())return ja.valueOf(0);if(this.isNegative())return ja.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=ja.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},ja.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof ja){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e,n,r,i,o,s=arguments[0],a=null;return a=(r=this._hi+s)-(i=r-this._hi),n=(o=(a=s-i+(this._hi-a))+this._lo)+(r-(e=r+o)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var u,c,h,l,p=arguments[0],f=arguments[1],g=null,d=null,y=null;h=this._hi+p,c=this._lo+f,d=h-(y=h-this._hi),g=c-(l=c-this._lo);var _=(u=h+(y=(d=p-y+(this._hi-d))+c))+(y=(g=f-l+(this._lo-g))+(y+(h-u))),m=y+(u-_);return this._hi=_,this._lo=m,this}},ja.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof ja){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n,r,i=arguments[0],o=arguments[1],s=null,a=null,u=null,c=null;s=(u=ja.SPLIT*this._hi)-this._hi,c=ja.SPLIT*i,s=u-s,n=this._hi-s,a=c-i;var h=(u=this._hi*i)+(c=s*(a=c-a)-u+s*(r=i-a)+n*a+n*r+(this._hi*o+this._lo*i)),l=c+(s=u-h);return this._hi=h,this._lo=l,this}},ja.prototype.selfSqr=function(){return this.selfMultiply(this)},ja.prototype.floor=function(){if(this.isNaN())return ja.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new ja(t,e)},ja.prototype.negate=function(){return this.isNaN()?this:new ja(-this._hi,-this._lo)},ja.prototype.clone=function(){},ja.prototype.multiply=function(){if(arguments[0]instanceof ja){var t=arguments[0];return t.isNaN()?ja.createNaN():ja.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Ia.isNaN(e)?ja.createNaN():ja.copy(this).selfMultiply(e,0)}},ja.prototype.isNaN=function(){return Ia.isNaN(this._hi)},ja.prototype.intValue=function(){return Math.trunc(this._hi)},ja.prototype.toString=function(){var t=ja.magnitude(this._hi);return-3<=t&&t<=20?this.toStandardNotation():this.toSciNotation()},ja.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+ja.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+ja.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},ja.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=ja.SPLIT*n)-(i=s-n)),o=(a=ja.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new ja(u,n-u+s)},ja.prototype.toSciNotation=function(){if(this.isZero())return ja.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=ja.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";1t._hi||this._hi===t._hi)&&this._lo>t._lo},ja.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},ja.prototype.trunc=function(){return this.isNaN()?ja.NaN:this.isPositive()?this.floor():this.ceil()},ja.prototype.signum=function(){return 0t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&(n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy)}},Qa.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Qa){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},Qa.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Qa.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Qa.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Qa.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Qa.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Qa.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return ethis._maxx||this._miny>this._maxy)&&this.setToNull()}},Qa.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Qa){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof Pa){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Qa.prototype.centre=function(){return this.isNull()?null:new Pa((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Qa.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof Pa){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Qa){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._maxx=it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Qa.prototype.hashCode=function(){var t=17;return t=37*(t=37*(t=37*(t=37*t+Pa.hashCode(this._minx))+Pa.hashCode(this._maxx))+Pa.hashCode(this._miny))+Pa.hashCode(this._maxy)},Qa.prototype.interfaces_=function(){return[Ca,La]},Qa.prototype.getClass=function(){return Qa},Qa.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(un.y&&(n=o,r=i)}for(var s=r;(s-=1)<0&&(s=e),t[s].equals2D(n)&&s!==r;);for(var a=r;t[a=(a+1)%e].equals2D(n)&&a!==r;);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var h=fu.computeOrientation(u,n,c),l=!1;return l=0===h?u.x>c.x:0=this.size())throw new Su;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=t?e:[]},Au.indexOf=function(t,e){for(var n=0;n=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=Au.compare(n,r);return Au.isEqualReversed(n,r)?0:i},qu.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=Au.increasingDirection(n),o=Au.increasingDirection(r),s=0= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(vc),Cc=function(n){function r(){n.apply(this,arguments)}n&&(r.__proto__=n);var t={serialVersionUID:{configurable:!0}};return((r.prototype=Object.create(n&&n.prototype)).constructor=r).prototype.getSortIndex=function(){return yu.SORTINDEX_MULTIPOLYGON},r.prototype.equalsExact=function(){if(2!==arguments.length)return n.prototype.equalsExact.apply(this,arguments);var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&n.prototype.equalsExact.call(this,t,e)},r.prototype.getBoundaryDimension=function(){return 1},r.prototype.getDimension=function(){return 2},r.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n=this.size())throw new Error;return this.array_[t]},Qc.prototype.push=function(t){return this.array_.push(t),t},Qc.prototype.pop=function(t){if(0===this.array_.length)throw new Kc;return this.array_.pop()},Qc.prototype.peek=function(){if(0===this.array_.length)throw new Kc;return this.array_[this.array_.length-1]},Qc.prototype.empty=function(){return 0===this.array_.length},Qc.prototype.isEmpty=function(){return this.empty()},Qc.prototype.search=function(t){return this.array_.indexOf(t)},Qc.prototype.size=function(){return this.array_.length},Qc.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;ethis._minCoord.y&&n.y>this._minCoord.y&&r===fu.CLOCKWISE&&(i=!0),i&&(this._minIndex=this._minIndex-1)},$c.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Jc.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},$c.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},$c.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}au.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Jc.LEFT&&(this._orientedDe=this._minDe.getSym())},$c.prototype.interfaces_=function(){return[]},$c.prototype.getClass=function(){return $c};var th=function(n){function r(t,e){n.call(this,r.msgWithCoord(t,e)),this.pt=e?new Pa(e):null,this.name="TopologyException"}return n&&(r.__proto__=n),((r.prototype=Object.create(n&&n.prototype)).constructor=r).prototype.getCoordinate=function(){return this.pt},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},r}(ou),eh=function(){this.array_=[]};eh.prototype.addLast=function(t){this.array_.push(t)},eh.prototype.removeFirst=function(){return this.array_.shift()},eh.prototype.isEmpty=function(){return 0===this.array_.length};var nh=function(){this._finder=null,this._dirEdgeList=new Ou,this._nodes=new Ou,this._rightMostCoord=null,this._env=null,this._finder=new $c};nh.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},nh.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},nh.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new th("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},nh.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Jc.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},nh.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},nh.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();1<=e.getDepth(Jc.RIGHT)&&e.getDepth(Jc.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},nh.prototype.computeDepths=function(t){var e=new ju,n=new eh,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},nh.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},nh.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Qa,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;rthis.location.length){var e=new Array(3).fill(null);e[Jc.ON]=this.location[Jc.ON],e[Jc.LEFT]=Aa.NONE,e[Jc.RIGHT]=Aa.NONE,this.location=e}for(var n=0;nthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},oh.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=n.x?r.y>=n.y?lh.NE:lh.SE:r.y>=n.y?lh.NW:lh.SW}},ph.NE.get=function(){return 0},ph.NW.get=function(){return 1},ph.SW.get=function(){return 2},ph.SE.get=function(){return 3},Object.defineProperties(lh,ph);var fh=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};fh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrantCh.area(this._boundable2)?this.expand(this._boundable1,this._boundable2,t,e):this.expand(this._boundable2,this._boundable1,t,e),null;if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ba("neither boundable is composite")},Ch.prototype.isLeaves=function(){return!(Ch.isComposite(this._boundable1)||Ch.isComposite(this._boundable2))},Ch.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},Ch.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new Ch(o,e,this._itemDistance);s.getDistance()>32),n=Ia.doubleToLongBits(this.p1.x);return n^=31*Ia.doubleToLongBits(this.p1.y),e^(Math.trunc(n)^Math.trunc(n>>32))},kh.prototype.interfaces_=function(){return[Ca,La]},kh.prototype.getClass=function(){return kh},kh.midPoint=function(t,e){return new Pa((t.x+e.x)/2,(t.y+e.y)/2)},zh.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(kh,zh);var jh=function(){this.tempEnv1=new Qa,this.tempEnv2=new Qa,this._overlapSeg1=new kh,this._overlapSeg2=new kh};jh.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},jh.prototype.interfaces_=function(){return[]},jh.prototype.getClass=function(){return jh};var Xh=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Xh.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Xh.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=lh.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.SegmentOverlapAction.get=function(){return Wh},Object.defineProperties(t,n),t}(Vh),Wh=function(s){function t(){s.call(this),this._si=null;var t=arguments[0];this._si=t}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.overlap=function(){if(4!==arguments.length)return s.prototype.overlap.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3],i=t.getContext(),o=n.getContext();this._si.processIntersections(i,e,o,r)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(jh),Jh=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Zh={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Jh.prototype.getEndCapStyle=function(){return this._endCapStyle},Jh.prototype.isSingleSided=function(){return this._isSingleSided},Jh.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Jh.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Jh.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Jh.JOIN_ROUND&&(this._quadrantSegments=Jh.DEFAULT_QUADRANT_SEGMENTS)},Jh.prototype.getJoinStyle=function(){return this._joinStyle},Jh.prototype.setJoinStyle=function(t){this._joinStyle=t},Jh.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Jh.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Jh.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Jh.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Jh.prototype.getMitreLimit=function(){return this._mitreLimit},Jh.prototype.setMitreLimit=function(t){this._mitreLimit=t},Jh.prototype.setSingleSided=function(t){this._isSingleSided=t},Jh.prototype.interfaces_=function(){return[]},Jh.prototype.getClass=function(){return Jh},Jh.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Zh.CAP_ROUND.get=function(){return 1},Zh.CAP_FLAT.get=function(){return 2},Zh.CAP_SQUARE.get=function(){return 3},Zh.JOIN_ROUND.get=function(){return 1},Zh.JOIN_MITRE.get=function(){return 2},Zh.JOIN_BEVEL.get=function(){return 3},Zh.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Zh.DEFAULT_MITRE_LIMIT.get=function(){return 5},Zh.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Jh,Zh);var Kh=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=fu.COUNTERCLOCKWISE,this._inputLine=t||null},Qh={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Kh.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&(!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r))},Kh.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;nMath.PI;)t-=el.PI_TIMES_2;for(;t<=-Math.PI;)t+=el.PI_TIMES_2;return t},el.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},el.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return 0Math.PI&&(n=2*Math.PI-n),n},el.toRadians=function(t){return t*Math.PI/180},el.getTurn=function(t,e){var n=Math.sin(e-t);return 0Math.PI?i-el.PI_TIMES_2:i},nl.PI_TIMES_2.get=function(){return 2*Math.PI},nl.PI_OVER_2.get=function(){return Math.PI/2},nl.PI_OVER_4.get=function(){return Math.PI/4},nl.COUNTERCLOCKWISE.get=function(){return fu.COUNTERCLOCKWISE},nl.CLOCKWISE.get=function(){return fu.CLOCKWISE},nl.NONE.get=function(){return fu.COLLINEAR},Object.defineProperties(el,nl);var rl=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new kh,this._seg1=new kh,this._offset0=new kh,this._offset1=new kh,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new hu,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),8<=n.getQuadrantSegments()&&n.getJoinStyle()===Jh.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},il={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};rl.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=fu.computeOrientation(this._s0,this._s1,this._s2),r=n===fu.CLOCKWISE&&this._side===Jc.LEFT||n===fu.COUNTERCLOCKWISE&&this._side===Jc.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},rl.prototype.addLineEndCap=function(t,e){var n=new kh(t,e),r=new kh;this.computeOffsetSegment(n,Jc.LEFT,this._distance,r);var i=new kh;this.computeOffsetSegment(n,Jc.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Jh.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,fu.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Jh.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Jh.CAP_SQUARE:var u=new Pa;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new Pa(r.p1.x+u.x,r.p1.y+u.y),h=new Pa(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(h)}},rl.prototype.getCoordinates=function(){return this._segList.getCoordinates()},rl.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Ka.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof Ja))throw t;o=new Pa(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},rl.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,h=Math.atan2(c,u);r===fu.CLOCKWISE?a<=h&&(a+=2*Math.PI):h<=a&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,h,r,i),this._segList.addPt(n)},rl.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)o.getMaxY()||t.findStabbedSegments(e,i.getDirectedEdges(),n)}return n}if(3===arguments.length)if(Fa(arguments[2],Lu)&&arguments[0]instanceof Pa&&arguments[1]instanceof gh)for(var s=arguments[0],a=arguments[1],u=arguments[2],c=a.getEdge().getCoordinates(),h=0;ht._seg.p1.y&&t._seg.reverse(),!(Math.max(t._seg.p0.x,t._seg.p1.x)t._seg.p1.y||fu.computeOrientation(t._seg.p0,t._seg.p1,s)===fu.RIGHT)){var l=a.getDepth(Jc.LEFT);t._seg.p0.equals(c[h])||(l=a.getDepth(Jc.RIGHT));var p=new ul(t._seg,l);u.add(p)}}else if(Fa(arguments[2],Lu)&&arguments[0]instanceof Pa&&Fa(arguments[1],Lu))for(var f=arguments[0],g=arguments[1],d=arguments[2],y=g.iterator();y.hasNext();){var _=y.next();_.isForward()&&t.findStabbedSegments(f,_,d)}},sl.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Nh.min(e)._leftDepth},sl.prototype.interfaces_=function(){return[]},sl.prototype.getClass=function(){return sl},al.DepthSegment.get=function(){return ul},Object.defineProperties(sl,al);var ul=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new kh(t),this._leftDepth=e};ul.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n?n:0!==(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},ul.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},ul.prototype.toString=function(){return this._upwardSeg.toString()},ul.prototype.interfaces_=function(){return[Ca]},ul.prototype.getClass=function(){return ul};var cl=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};cl.prototype.area=function(){return cl.area(this.p0,this.p1,this.p2)},cl.prototype.signedArea=function(){return cl.signedArea(this.p0,this.p1,this.p2)},cl.prototype.interpolateZ=function(t){if(null===t)throw new ba("Supplied point is null.");return cl.interpolateZ(t,this.p0,this.p1,this.p2)},cl.prototype.longestSideLength=function(){return cl.longestSideLength(this.p0,this.p1,this.p2)},cl.prototype.isAcute=function(){return cl.isAcute(this.p0,this.p1,this.p2)},cl.prototype.circumcentre=function(){return cl.circumcentre(this.p0,this.p1,this.p2)},cl.prototype.area3D=function(){return cl.area3D(this.p0,this.p1,this.p2)},cl.prototype.centroid=function(){return cl.centroid(this.p0,this.p1,this.p2)},cl.prototype.inCentre=function(){return cl.inCentre(this.p0,this.p1,this.p2)},cl.prototype.interfaces_=function(){return[]},cl.prototype.getClass=function(){return cl},cl.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},cl.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},cl.det=function(t,e,n,r){return t*r-e*n},cl.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,h=s*c-a*u,l=t.x-i,p=t.y-o,f=(c*l-a*p)/h,g=(-u*l+s*p)/h;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},cl.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return s=Nc.MINIMUM_VALID_SIZE&&fu.isCCW(t)&&(o=i,s=r,n=Jc.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},hl.prototype.add=function(t){if(t.isEmpty())return null;t instanceof bc?this.addPolygon(t):t instanceof vc?this.addLineString(t):t instanceof Ec?this.addPoint(t):t instanceof Ic?this.addCollection(t):t instanceof ac?this.addCollection(t):t instanceof Cc?this.addCollection(t):t instanceof sc&&this.addCollection(t)},hl.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},hl.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new Pu;var t=this._parent.getGeometryN(this._index++);return t instanceof sc?(this._subcollectionIterator=new pl(t),this._subcollectionIterator.next()):t},pl.prototype.remove=function(){throw new Error(this.getClass().getName())},pl.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},pl.prototype.interfaces_=function(){return[Mu]},pl.prototype.getClass=function(){return pl},pl.isAtomic=function(t){return!(t instanceof sc)};var fl=function(){this._geom=null;var t=arguments[0];this._geom=t};fl.prototype.locate=function(t){return fl.locate(t,this._geom)},fl.prototype.interfaces_=function(){return[ll]},fl.prototype.getClass=function(){return fl},fl.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&fu.isPointInRing(t,e.getCoordinates())},fl.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!fl.isPointInRing(t,n))return!1;for(var r=0;re&&(r=1),this._depth[t][n]=r}}},Nl.prototype.getDelta=function(t){return this._depth[t][Jc.RIGHT]-this._depth[t][Jc.LEFT]},Nl.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Aa.EXTERIOR:Aa.INTERIOR},Nl.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Nl.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==Aa.EXTERIOR&&r!==Aa.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=Nl.depthAtLocation(r):this._depth[e][n]+=Nl.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===Aa.INTERIOR&&this._depth[i][o]++}},Nl.prototype.interfaces_=function(){return[]},Nl.prototype.getClass=function(){return Nl},Nl.depthAtLocation=function(t){return t===Aa.EXTERIOR?0:t===Aa.INTERIOR?1:Nl.NULL_VALUE},Cl.NULL_VALUE.get=function(){return-1},Object.defineProperties(Nl,Cl);var Sl=function(r){function s(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new wl(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Nl,this._depthDelta=0,1===arguments.length){var t=arguments[0];s.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pts=e,this._label=n}}return r&&(s.__proto__=r),((s.prototype=Object.create(r&&r.prototype)).constructor=s).prototype.getDepth=function(){return this._depth},s.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new s(t,ih.toLineLabel(this._label))},s.prototype.isIsolated=function(){return this._isIsolated},s.prototype.getCoordinates=function(){return this.pts},s.prototype.setIsolated=function(t){this._isIsolated=t},s.prototype.setName=function(t){this._name=t},s.prototype.equals=function(t){if(!(t instanceof s))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;or||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return au.isTrue(!(s&&a),"Found bad envelope test"),a},Rl.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new Pa(this._maxx,this._maxy),this._corner[1]=new Pa(this._minx,this._maxy),this._corner[2]=new Pa(this._minx,this._miny),this._corner[3]=new Pa(this._maxx,this._miny)},Rl.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Rl.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Rl.prototype.getCoordinate=function(){return this._originalPt},Rl.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Rl.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=Rl.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Qa(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Rl.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},Rl.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||(!(!n||!r)||(!!t.equals(this._pt)||!!e.equals(this._pt))))))},Rl.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},Rl.prototype.interfaces_=function(){return[]},Rl.prototype.getClass=function(){return Rl},Tl.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(Rl,Tl);var Al=function(){this.tempEnv1=new Qa,this.selectedSegment=new kh};Al.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},Al.prototype.interfaces_=function(){return[]},Al.prototype.getClass=function(){return Al};var Dl=function(){this._index=null;var t=arguments[0];this._index=t},Fl={HotPixelSnapAction:{configurable:!0}};Dl.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new ql(e,n,r);return this._index.query(i,{interfaces_:function(){return[Eh]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},Dl.prototype.interfaces_=function(){return[]},Dl.prototype.getClass=function(){return Dl},Fl.HotPixelSnapAction.get=function(){return ql},Object.defineProperties(Dl,Fl);var ql=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=n}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(2!==arguments.length)return r.prototype.select.apply(this,arguments);var t=arguments[0],e=arguments[1],n=t.getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Al),Gl=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Ou};Gl.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;uthis._distance&&this.initialize(e,n,r)}},jl.prototype.interfaces_=function(){return[]},jl.prototype.getClass=function(){return jl};var Xl=function(){};Xl.prototype.interfaces_=function(){return[]},Xl.prototype.getClass=function(){return Xl},Xl.computeDistance=function(){if(arguments[2]instanceof jl&&arguments[0]instanceof vc&&arguments[1]instanceof Pa)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new kh,o=0;othis._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var l=u.getCoordinates(),p=c.getCoordinates(),f=0;fthis._distance&&this.initialize(e,n,r)}},np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np};var rp=function(){};rp.prototype.interfaces_=function(){return[]},rp.prototype.getClass=function(){return rp},rp.computeDistance=function(){if(arguments[2]instanceof np&&arguments[0]instanceof vc&&arguments[1]instanceof Pa)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new kh,i=t.getCoordinates(),o=0;on){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+iu.toLineString(i[0],i[1])+")"}},up.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=up.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(0=t.size()-2},fp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},fp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},fp.prototype.interfaces_=function(){return[vl]},fp.prototype.getClass=function(){return fp},fp.createAllIntersectionsFinder=function(t){var e=new fp(t);return e.setFindAllIntersections(!0),e},fp.createAnyIntersectionFinder=function(t){return new fp(t)},fp.createIntersectionCounter=function(t){var e=new fp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var gp=function(){this._li=new hu,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};gp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},gp.prototype.getIntersections=function(){return this._segInt.getIntersections()},gp.prototype.isValid=function(){return this.execute(),this._isValid},gp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},gp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new fp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Hh;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},gp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new th(this.getErrorMessage(),this._segInt.getInteriorIntersection())},gp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+iu.toLineString(t[0],t[1])+" and "+iu.toLineString(t[2],t[3])},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.computeIntersections=function(t){var e=new gp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var dp=function t(){this._nv=null;var e=arguments[0];this._nv=new gp(t.toSegmentStrings(e))};dp.prototype.checkValid=function(){this._nv.checkValid()},dp.prototype.interfaces_=function(){return[]},dp.prototype.getClass=function(){return dp},dp.toSegmentStrings=function(t){for(var e=new Ou,n=t.iterator();n.hasNext();){var r=n.next();e.add(new pp(r.getCoordinates(),r))}return e},dp.checkValid=function(t){new dp(t).checkValid()};var yp=function(t){this._mapOp=t};yp.prototype.map=function(t){for(var e=new Ou,n=0;n>52},Ip.zeroLowerBits=function(t,e){return t&~((1<e._xValue?1:this._eventTypee._eventType?1:0},Rp.prototype.getInsertEvent=function(){return this._insertEvent},Rp.prototype.isInsert=function(){return this._eventType===Rp.INSERT},Rp.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Rp.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Rp.prototype.interfaces_=function(){return[Ca]},Rp.prototype.getClass=function(){return Rp},Tp.INSERT.get=function(){return 1},Tp.DELETE.get=function(){return 2},Object.defineProperties(Rp,Tp);var Ap=function(){};Ap.prototype.interfaces_=function(){return[]},Ap.prototype.getClass=function(){return Ap};var Dp=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Dp.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Dp.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Dp.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Dp.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Dp.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Dp.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},Dp.prototype.hasProperIntersection=function(){return this._hasProper},Dp.prototype.hasIntersection=function(){return this._hasIntersection},Dp.prototype.isDone=function(){return this._isDone},Dp.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},Dp.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Dp.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Dp.prototype.interfaces_=function(){return[]},Dp.prototype.getClass=function(){return Dp},Dp.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Fp=function(t){function e(){t.call(this),this.events=new Ou,this.nOverlaps=null}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.prepareEvents=function(){Nh.sort(this.events);for(var t=0;te||this._max=t.size()?null:t.get(e)},of.union=function(t){return new of(t).union()},sf.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(of,sf);var af=function(){};function uf(t){switch(t.type){case"Polygon":return 1ff?Ef((Cf(r)*(a=bf(o))*Cf(i)-Cf(o)*(s=bf(r))*Cf(n))/(s*a*u)):(r+o)/2,l.point(d,g),l.lineEnd(),l.lineStart(),l.point(c,g),p=0),l.point(f=t,g=e),d=c},lineEnd:function(){l.lineEnd(),f=g=NaN},clean:function(){return 2-p}}},function(t,e,n,r){var i;if(null==t)i=n*df,r.point(-gf,i),r.point(0,i),r.point(gf,i),r.point(gf,0),r.point(gf,-i),r.point(0,-i),r.point(-gf,-i),r.point(-gf,0),r.point(-gf,i);else if(xf(t[0]-e[0])>ff){var o=t[0]ff;function d(t,e){return bf(t)*bf(e)>C}function y(t,e,n){var r=[1,0,0],i=kf(Gf(t),Gf(e)),o=Bf(i,i),s=i[0],a=o-s*s;if(!a)return!n&&t;var u=C*o/a,c=-C*s/a,h=kf(r,i),l=jf(r,u);zf(l,jf(i,c));var p=h,f=Bf(l,p),g=Bf(p,p),d=f*f-g*(Bf(l,l)-1);if(!(d<0)){var y=Sf(d),_=jf(p,(-f-y)/g);if(zf(_,l),_=qf(_),!n)return _;var m,v=t[0],x=e[0],E=t[1],w=e[1];xs;)r=Math.floor((o+1)*Math.random()),n=i[r],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=Ke,t.square=Qe,t.circle=tn,t.midpoint=function(t,e){return $e(t,fe(t,e)/2,en(t,e))},t.center=nn,t.centerOfMass=function t(e,n){switch(rt(e)){case"Point":return e;case"Polygon":var r=[];N(e,function(t){r.push(t)});var i,o,s,a,u,c,h,l,p=rn(e,n),f=p.geometry.coordinates,g=0,d=0,y=0,_=r.map(function(t){return[t[0]-f[0],t[1]-f[1]]});for(i=0;il[e.isect].coord?-1:1}),u=[];0 is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof r)throw new Error(" must be a boolean");!1===r&&(t=ge(t));var i=[];switch(t.type){case"GeometryCollection":return R(t,function(t){di(t,n)}),t;case"FeatureCollection":return L(t,function(t){L(di(t,n),function(t){i.push(t)})}),Y(i)}return di(t,n)},t.isobands=function(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(tt(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!H(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(o))throw new Error("breaksProperties is not an Array");var s,a,u,c,h,l,p,f,g,d,y,_,m=mi(t,{zProperty:r,flip:!0}),v=function(t,e,n){for(var r=[],i=1;ic[c.length-1])e-=c.length;else{var n=qg(e,c);0!==n&&(e-=n)}if(e!==+l){var r,i,o,s=u[e];s&&p&&(void 0!==a&&s.properties[a]!==p.properties[a]||ts(p,s)&&(r=s,i=U(O(p)),o=U(O(r)),0