!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).turf=t()}}(function(){return function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n||t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s=r&&l===i.length-1);l++){if(r>=e){var c=e-r;if(c){var h=o(i[l],i[l-1])-180;return s(i[l],c,h,n)}return u.point(i[l])}r+=a(i[l],i[l+1],n)}return u.point(i[i.length-1])}var o=i(t("@turf/bearing")),s=i(t("@turf/destination")),a=i(t("@turf/distance")),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/destination":68,"@turf/distance":73,"@turf/helpers":79}],2:[function(t,e,n){"use strict";function i(t){return u.geomReduce(t,function(t,e){return t+r(e)},0)}function r(t){var e,n=0;switch(t.type){case"Polygon":return o(t.coordinates);case"MultiPolygon":for(e=0;e0){e+=Math.abs(s(t[0]));for(var n=1;n2){for(s=0;s0&&(r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]||r.push(r[0]),r.length>=4&&n.push(r))}return n}function o(t){return t.geometry?t.geometry.type:t.type}var s=t("@turf/invariant"),a=t("@turf/helpers"),u=t("lineclip");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84,lineclip:4}],4:[function(t,e,n){"use strict";function i(t,e,n){var i,s,a,u,l,c=t.length,h=o(t[0],e),f=[];for(n||(n=[]),i=1;ie[2]&&(n|=2),t[1]e[3]&&(n|=8),n}e.exports=i,i.polyline=i,i.polygon=function(t,e){var n,i,s,a,u,l,c;for(i=1;i<=8;i*=2){for(n=[],a=!(o(s=t[t.length-1],e)&i),u=0;ut[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]t&&(e.push(i),n=r)}return e},s.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},s.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*n);return function(t,e,n,i,r){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:r.x*o[0]+i.x*o[1]+n.x*o[2]+e.x*o[3],y:r.y*o[0]+i.y*o[1]+n.y*o[2]+e.y*o[3],z:r.z*o[0]+i.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-i,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],9:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,i,o=r.getCoords(t),s=0,a=1;a0}var r=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/invariant":84}],10:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=m.getType(t),i=m.getType(e),r=m.getGeom(t),f=m.getGeom(e),d=m.getCoords(t),_=m.getCoords(e);switch(n){case"Point":switch(i){case"Point":return g(d,_);default:throw new Error("feature2 "+i+" geometry not supported")}case"MultiPoint":switch(i){case"Point":return o(r,f);case"MultiPoint":return s(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"LineString":switch(i){case"Point":return v(f,r,{ignoreEndVertices:!0});case"LineString":return l(r,f);case"MultiPoint":return a(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"Polygon":switch(i){case"Point":return p(f,r,{ignoreBoundary:!0});case"LineString":return c(r,f);case"Polygon":return h(r,f);case"MultiPoint":return u(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function o(t,e){var n,i=!1;for(n=0;ne[0])&&(!(t[2]e[1])&&!(t[3]0)for(var n=0;n0}function u(t,e){for(var n=!1,i=!1,r=t.coordinates[0].length,o=0;o=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1]0}function u(t,e){return d(e,p(t)).features.length>0}function l(t,e){for(var n=0;n=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}function h(t,e){return t[0]===e[0]&&t[1]===e[1]}var f=i(t("@turf/boolean-point-in-polygon")),g=t("@turf/meta"),d=i(t("@turf/line-intersect")),p=i(t("@turf/polygon-to-line"));e.exports=r,e.exports.default=r},{"@turf/boolean-point-in-polygon":24,"@turf/line-intersect":91,"@turf/meta":105,"@turf/polygon-to-line":116}],13:[function(t,e,n){"use strict";function i(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");return o.getType(t)===o.getType(e)&&new s({precision:6}).compare(r(t),r(e))}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clean-coords")),o=t("@turf/invariant"),s=t("geojson-equality");e.exports=i,e.exports.default=i},{"@turf/clean-coords":35,"@turf/invariant":84,"geojson-equality":17}],14:[function(t,e,n){function i(t){return null===t||void 0===t}function r(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function o(t,e,n){var o,c;if(i(t)||i(e))return!1;if(t.prototype!==e.prototype)return!1;if(u(t))return!!u(e)&&(t=s.call(t),e=s.call(e),l(t,e,n));if(r(t)){if(!r(e))return!1;if(t.length!==e.length)return!1;for(o=0;o=0;o--)if(h[o]!=f[o])return!1;for(o=h.length-1;o>=0;o--)if(c=h[o],!l(t[c],e[c],n))return!1;return typeof t==typeof e}var s=Array.prototype.slice,a=t("./lib/keys.js"),u=t("./lib/is_arguments.js"),l=e.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:o(t,e,n))}},{"./lib/is_arguments.js":15,"./lib/keys.js":16}],15:[function(t,e,n){function i(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(n=e.exports=o?i:r).supported=i,n.unsupported=r},{}],16:[function(t,e,n){function i(t){var e=[];for(var n in t)e.push(n);return e}(e.exports="function"==typeof Object.keys?Object.keys:i).shim=i},{}],17:[function(t,e,n){function i(t){return t.coordinates.map(function(e){return{type:t.type.replace("Multi",""),coordinates:e}})}function r(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function o(t,e){return s(t,e,{strict:!0})}var s=t("deep-equal"),a=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:o};a.prototype.compare=function(t,e){if(t.type!==e.type||!r(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,o=i(t),s=i(e);return o.every(function(t){return this.some(function(e){return n.compare(t,e)})},s)}}return!1},a.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n=0&&(n=[].concat(t.slice(i,t.length),t.slice(1,i+1))),n},a.prototype.comparePath=function(t,e){var n=this;return t.every(function(t,e){return n.compareCoord(t,this[e])},e)},a.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length),r=this;return n.every(function(t){return this.some(function(e){return r.compareLine(t,e,1,!0)})},i)}return!1},a.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},a.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},a.prototype.removePseudo=function(t){return t},e.exports=a},{"deep-equal":14}],18:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=s.getType(t);if(n!==s.getType(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new l({precision:6}).compare(t,e))return!1;var i=0;switch(n){case"MultiPoint":var r=o.coordAll(t),c=o.coordAll(e);r.forEach(function(t){c.forEach(function(e){t[0]===e[0]&&t[1]===e[1]&&i++})});break;case"LineString":case"MultiLineString":o.segmentEach(t,function(t){o.segmentEach(e,function(e){a(t,e).features.length&&i++})});break;case"Polygon":case"MultiPolygon":o.segmentEach(t,function(t){o.segmentEach(e,function(e){u(t,e).features.length&&i++})})}return i>0}var o=t("@turf/meta"),s=t("@turf/invariant"),a=i(t("@turf/line-overlap")),u=i(t("@turf/line-intersect")),l=t("geojson-equality");e.exports=r,e.exports.default=r},{"@turf/invariant":84,"@turf/line-intersect":91,"@turf/line-overlap":94,"@turf/meta":105,"geojson-equality":22}],19:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{"./lib/is_arguments.js":20,"./lib/keys.js":21,dup:14}],20:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],21:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{dup:16}],22:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{"deep-equal":19,dup:17}],23:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==s(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==s(e,"line2"))throw new Error("line2 must be a LineString");for(var n=u(a(t)).features,i=u(a(e)).features,r=0;rt[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function o(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/invariant":84}],25:[function(t,e,n){"use strict";function i(t,e,n){var i=(n=n||{}).ignoreEndVertices;if(!s.isObject(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var a=o.getCoord(t),u=o.getCoords(e),l=0;l=Math.abs(h)?c>0?s0?a=Math.abs(h)?c>0?s<=r&&r0?a<=o&&o=Math.abs(h)?c>0?s0?a=Math.abs(h)?c>0?s<=r&&r<=u:u<=r&&r<=s:h>0?a<=o&&o<=l:l<=o&&o<=a)}var o=t("@turf/invariant"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],26:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=m.getType(t),i=m.getType(e),r=m.getGeom(t),f=m.getGeom(e);switch(n){case"Point":switch(i){case"MultiPoint":return o(r,f);case"LineString":return _(r,f,{ignoreEndVertices:!0});case"Polygon":return v(r,f,{ignoreBoundary:!0});default:throw new Error("feature2 "+i+" geometry not supported")}case"MultiPoint":switch(i){case"MultiPoint":return s(r,f);case"LineString":return a(r,f);case"Polygon":return u(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"LineString":switch(i){case"LineString":return l(r,f);case"Polygon":return c(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"Polygon":switch(i){case"Polygon":return h(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function o(t,e){var n,i=!1;for(n=0;ne[0])&&(!(t[2]e[1])&&!(t[3]50&&m[3]>50;v=y?{type:c.type,coordinates:a(c.coordinates,l(c))}:g.toMercator(c);var x=(new f.GeoJSONReader).read(v),E=_.radiansToLength(_.lengthToRadians(e,n),"meters"),w=f.BufferOp.bufferOp(x,E);if(w=(new f.GeoJSONWriter).write(w),!s(w.coordinates)){var b;return(b=y?{type:w.type,coordinates:u(w.coordinates,l(c))}:g.toWgs84(w)).geometry?b:_.feature(b,r)}}function s(t){return Array.isArray(t[0])?s(t[0]):isNaN(t[0])}function a(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return a(t,e)})}function u(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return u(t,e)})}function l(t){var e=c(t).geometry.coordinates.reverse(),n=e.map(function(t){return-t});return p.geoTransverseMercator().center(e).rotate(n).scale(_.earthRadius)}var c=i(t("@turf/center")),h=i(t("@turf/bbox")),f=t("jsts-es"),g=t("@turf/projection"),d=t("@turf/meta"),p=t("d3-geo"),_=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/center":32,"@turf/helpers":79,"@turf/meta":105,"@turf/projection":130,"d3-geo":29,"jsts-es":30}],28:[function(t,e,n){!function(t,i){i("object"==typeof n&&void 0!==e?n:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t){return function(e,n){return s(t(e),n)}}function n(t,e){return[t,e]}function i(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=E?10:o>=w?5:o>=b?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=E?10:o>=w?5:o>=b?2:1)}function r(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=E?r*=10:o>=w?r*=5:o>=b&&(r*=2),ee?1:t>=e?0:NaN},a=function(t){return 1===t.length&&(t=e(t)),{left:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)<0?i=o+1:r=o}return i},right:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)>0?r=o:i=o+1}return i}}},u=a(s),l=u.right,c=u.left,h=function(t){return null===t?NaN:+t},f=function(t,e){var n,i,r=t.length,o=0,s=-1,a=0,u=0;if(null==e)for(;++s1)return u/(o-1)},g=function(t,e){var n=f(t,e);return n?Math.sqrt(n):n},d=function(t,e){var n,i,r,o=t.length,s=-1;if(null==e){for(;++s=n)for(i=r=n;++sn&&(i=n),r=n)for(i=r=n;++sn&&(i=n),r=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),s=+n(t[o],o,t);return s+(+n(t[o+1],o+1,t)-s)*(r-o)}},N=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o=n)for(i=n;++on&&(i=n)}else for(;++o=n)for(i=n;++on&&(i=n);return i},S=function(t){if(!(r=t.length))return[];for(var e=-1,n=N(t,o),i=new Array(n);++et?1:e>=t?0:NaN},t.deviation=g,t.extent=d,t.histogram=function(){function t(t){var o,s,a=t.length,u=new Array(a);for(o=0;of;)g.pop(),--d;var p,_=new Array(d+1);for(o=0;o<=d;++o)(p=_[o]=[]).x0=o>0?g[o-1]:h,p.x1=o=n)for(i=n;++oi&&(i=n)}else for(;++o=n)for(i=n;++oi&&(i=n);return i},t.mean=function(t,e){var n,i=t.length,r=i,o=-1,s=0;if(null==e)for(;++o=0;)for(e=(i=t[r]).length;--e>=0;)n[--s]=i[e];return n},t.min=N,t.pairs=function(t,e){null==e&&(e=n);for(var i=0,r=t.length-1,o=t[0],s=new Array(r<0?0:r);i0)return[t];if((r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),s=new Array(o=Math.ceil(e-t+1));++u1?0:t<-1?Ge:Math.acos(t)}function o(t){return t>1?qe:t<-1?-qe:Math.asin(t)}function s(t){return(t=Ke(t/2))*t}function a(){}function u(t,e){t&&nn.hasOwnProperty(t.type)&&nn[t.type](t,e)}function l(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r=0?1:-1,r=i*n,o=Ue(e),s=Ke(e),a=ue*s,u=ae*o+a*Ue(r),l=a*i*Ke(r);on.add(Ve(l,u)),se=t,ae=o,ue=s}function p(t){return[Ve(t[1],t[0]),o(t[2])]}function _(t){var e=t[0],n=t[1],i=Ue(n);return[i*Ue(e),i*Ke(e),Ke(n)]}function v(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function m(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function y(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function x(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function E(t){var e=$e(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function w(t,e){ve.push(me=[le=t,he=t]),efe&&(fe=e)}function b(t,e){var n=_([t*ze,e*ze]);if(_e){var i=m(_e,n),r=m([i[1],-i[0],0],i);E(r),r=p(r);var o,s=t-ge,a=s>0?1:-1,u=r[0]*je*a,l=Ye(s)>180;l^(a*gefe&&(fe=o):(u=(u+360)%360-180,l^(a*gefe&&(fe=e))),l?tM(le,he)&&(he=t):M(t,he)>M(le,he)&&(le=t):he>=le?(the&&(he=t)):t>ge?M(le,t)>M(le,he)&&(he=t):M(t,he)>M(le,he)&&(le=t)}else ve.push(me=[le=t,he=t]);efe&&(fe=e),_e=n,ge=t}function I(){ln.point=b}function C(){me[0]=le,me[1]=he,ln.point=w,_e=null}function N(t,e){if(_e){var n=t-ge;un.add(Ye(n)>180?n+(n>0?360:-360):n)}else de=t,pe=e;an.point(t,e),b(t,e)}function S(){an.lineStart()}function L(){N(de,pe),an.lineEnd(),Ye(un)>Fe&&(le=-(he=180)),me[0]=le,me[1]=he,_e=null}function M(t,e){return(e-=t)<0?e+360:e}function P(t,e){return t[0]-e[0]}function R(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eGe?t-Be:t<-Ge?t+Be:t,e]}function Y(t,e,n){return(t%=Be)?e||n?fn(V(t),U(e,n)):V(t):e||n?U(e,n):z}function X(t){return function(e,n){return e+=t,[e>Ge?e-Be:e<-Ge?e+Be:e,n]}}function V(t){var e=X(t);return e.invert=X(-t),e}function U(t,e){function n(t,e){var n=Ue(e),u=Ue(t)*n,l=Ke(t)*n,c=Ke(e),h=c*i+u*r;return[Ve(l*s-h*a,u*i-c*r),o(h*s+l*a)]}var i=Ue(t),r=Ke(t),s=Ue(e),a=Ke(e);return n.invert=function(t,e){var n=Ue(e),u=Ue(t)*n,l=Ke(t)*n,c=Ke(e),h=c*s-l*a;return[Ve(l*s+c*a,u*i+h*r),o(h*i-u*r)]},n}function H(t,e,n,i,r,o){if(n){var s=Ue(e),a=Ke(e),u=i*n;null==r?(r=e+i*Be,o=e-u/2):(r=W(s,r),o=W(s,o),(i>0?ro)&&(r+=i*Be));for(var l,c=r;i>0?c>o:c0)do{u.point(0===c||3===c?t:i,c>1?r:n)}while((c=(c+s+4)%4)!==h);else u.point(o[0],o[1])}function a(e,r){return Ye(e[0]-t)0?0:3:Ye(e[0]-i)0?2:1:Ye(e[1]-n)0?1:0:r>0?3:2}function u(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){function l(t,e){o(t,e)&&b.point(t,e)}function c(){for(var e=0,n=0,i=g.length;nr&&(h-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(h-o)*(r-s)<(f-s)*(t-o)&&--e;return e}function h(e,s){var a=o(e,s);if(g&&d.push([e,s]),E)p=e,_=s,v=a,E=!1,a&&(b.lineStart(),b.point(e,s));else if(a&&x)b.point(e,s);else{var u=[m=Math.max(Pn,Math.min(Mn,m)),y=Math.max(Pn,Math.min(Mn,y))],l=[e=Math.max(Pn,Math.min(Mn,e)),s=Math.max(Pn,Math.min(Mn,s))];Nn(u,l,t,n,i,r)?(x||(b.lineStart(),b.point(u[0],u[1])),b.point(l[0],l[1]),a||b.lineEnd(),w=!1):a&&(b.lineStart(),b.point(e,s),w=!1)}m=e,y=s,x=a}var f,g,d,p,_,v,m,y,x,E,w,b=a,I=Cn(),C={point:l,lineStart:function(){C.point=h,g&&g.push(d=[]),E=!0,x=!1,m=y=NaN},lineEnd:function(){f&&(h(p,_),v&&x&&I.rejoin(),f.push(I.result())),C.point=l,x&&b.lineEnd()},polygonStart:function(){b=I,f=[],g=[],w=!0},polygonEnd:function(){var t=c(),n=w&&t,i=(f=e.merge(f)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),i&&Ln(f,u,t,s,a),a.polygonEnd()),b=a,f=g=d=null}};return C}}function Q(){An.point=An.lineEnd=a}function $(t,e){gn=t*=ze,dn=Ke(e*=ze),pn=Ue(e),An.point=tt}function tt(t,e){t*=ze;var n=Ke(e*=ze),i=Ue(e),r=Ye(t-gn),o=Ue(r),s=i*Ke(r),a=pn*n-dn*i*o,u=dn*n+pn*i*o;Tn.add(Ve($e(s*s+a*a),u)),gn=t,dn=n,pn=i}function et(t,e){return!(!t||!Bn.hasOwnProperty(t.type))&&Bn[t.type](t,e)}function nt(t,e){return 0===qn(t,e)}function it(t,e){var n=qn(t[0],t[1]);return qn(t[0],e)+qn(e,t[1])<=n+Fe}function rt(t,e){return!!On(t.map(ot),st(e))}function ot(t){return(t=t.map(st)).pop(),t}function st(t){return[t[0]*ze,t[1]*ze]}function at(t,n,i){var r=e.range(t,n-Fe,i).concat(n);return function(t){return r.map(function(e){return[t,e]})}}function ut(t,n,i){var r=e.range(t,n-Fe,i).concat(n);return function(t){return r.map(function(e){return[e,t]})}}function lt(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return e.range(He(s/v)*v,o,v).map(g).concat(e.range(He(c/m)*m,l,m).map(d)).concat(e.range(He(r/p)*p,i,p).filter(function(t){return Ye(t%v)>Fe}).map(h)).concat(e.range(He(u/_)*_,a,_).filter(function(t){return Ye(t%m)>Fe}).map(f))}var i,r,o,s,a,u,l,c,h,f,g,d,p=10,_=p,v=90,m=360,y=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[g(s).concat(d(l).slice(1),g(o).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.extentMajor(e).extentMinor(e):t.extentMinor()},t.extentMajor=function(e){return arguments.length?(s=+e[0][0],o=+e[1][0],c=+e[0][1],l=+e[1][1],s>o&&(e=s,s=o,o=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[s,c],[o,l]]},t.extentMinor=function(e){return arguments.length?(r=+e[0][0],i=+e[1][0],u=+e[0][1],a=+e[1][1],r>i&&(e=r,r=i,i=e),u>a&&(e=u,u=a,a=e),t.precision(y)):[[r,u],[i,a]]},t.step=function(e){return arguments.length?t.stepMajor(e).stepMinor(e):t.stepMinor()},t.stepMajor=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.stepMinor=function(e){return arguments.length?(p=+e[0],_=+e[1],t):[p,_]},t.precision=function(e){return arguments.length?(y=+e,h=at(u,a,90),f=ut(r,i,y),g=at(c,l,90),d=ut(s,o,y),t):y},t.extentMajor([[-180,-90+Fe],[180,90-Fe]]).extentMinor([[-180,-80-Fe],[180,80+Fe]])}function ct(){Xn.point=ht}function ht(t,e){Xn.point=ft,_n=mn=t,vn=yn=e}function ft(t,e){Yn.add(yn*t-mn*e),mn=t,yn=e}function gt(){ft(_n,vn)}function dt(t,e){Zn+=t,Kn+=e,++Qn}function pt(){oi.point=_t}function _t(t,e){oi.point=vt,dt(wn=t,bn=e)}function vt(t,e){var n=t-wn,i=e-bn,r=$e(n*n+i*i);$n+=r*(wn+t)/2,ti+=r*(bn+e)/2,ei+=r,dt(wn=t,bn=e)}function mt(){oi.point=dt}function yt(){oi.point=Et}function xt(){wt(xn,En)}function Et(t,e){oi.point=wt,dt(xn=wn=t,En=bn=e)}function wt(t,e){var n=t-wn,i=e-bn,r=$e(n*n+i*i);$n+=r*(wn+t)/2,ti+=r*(bn+e)/2,ei+=r,ni+=(r=bn*t-wn*e)*(wn+t),ii+=r*(bn+e),ri+=3*r,dt(wn=t,bn=e)}function bt(t){this._context=t}function It(t,e){fi.point=Ct,ai=li=t,ui=ci=e}function Ct(t,e){li-=t,ci-=e,hi.add($e(li*li+ci*ci)),li=t,ci=e}function Nt(){this._string=[]}function St(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Lt(t){return t.length>1}function Mt(t,e){return((t=t.x)[0]<0?t[1]-qe-Fe:qe-t[1])-((e=e.x)[0]<0?e[1]-qe-Fe:qe-e[1])}function Pt(t,e,n,i){var r,o,s=Ke(t-n);return Ye(s)>Fe?Xe((Ke(e)*(o=Ue(i))*Ke(n)-Ke(i)*(r=Ue(e))*Ke(t))/(r*o*s)):(e+i)/2}function Rt(t){return function(e){var n=new Ot;for(var i in t)n[i]=t[i];return n.stream=e,n}}function Ot(){}function Tt(t,e,n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),rn(n,t.stream(Jn));var s=Jn.result(),a=Math.min(i/(s[1][0]-s[0][0]),r/(s[1][1]-s[0][1])),u=+e[0][0]+(i-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(r-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,l])}function At(t,e,n){return Tt(t,[[0,0],e],n)}function Dt(t){return Rt({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function Ft(t,e){function n(i,r,s,a,u,l,c,h,f,g,d,p,_,v){var m=c-i,y=h-r,x=m*m+y*y;if(x>4*e&&_--){var E=a+g,w=u+d,b=l+p,I=$e(E*E+w*w+b*b),C=o(b/=I),N=Ye(Ye(b)-1)e||Ye((m*P+y*R)/x-.5)>.3||a*g+u*d+l*p2?t[2]%360*ze:0,r()):[E*je,w*je,b*je]},e.precision=function(t){return arguments.length?(M=mi(i,L=t*t),o()):$e(L)},e.fitExtent=function(t,n){return Tt(e,t,n)},e.fitSize=function(t,n){return At(e,t,n)},function(){return s=t.apply(this,arguments),e.invert=s.invert&&n,r()}}function kt(t){var e=0,n=Ge/3,i=qt(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*ze,n=t[1]*ze):[e*je,n*je]},r}function Bt(t){function e(t,e){return[t*n,Ke(e)/n]}var n=Ue(t);return e.invert=function(t,e){return[t/n,o(e*n)]},e}function jt(t,e){function n(t,e){var n=$e(s-2*r*Ke(e))/r;return[n*Ke(t*=r),a-n*Ue(t)]}var i=Ke(t),r=(i+Ke(e))/2;if(Ye(r)0?e<-qe+Fe&&(e=-qe+Fe):e>qe-Fe&&(e=qe-Fe);var n=o/Ze(Ht(e),r);return[n*Ke(r*t),o-n*Ue(r*t)]}var i=Ue(t),r=t===e?Ke(t):Je(i/Ue(e))/Je(Ht(e)/Ht(t)),o=i*Ze(Ht(t),r)/r;return r?(n.invert=function(t,e){var n=o-e,i=Qe(r)*$e(t*t+n*n);return[Ve(t,Ye(n))/r*Qe(n),2*Xe(Ze(o/i,1/r))-qe]},n):Vt}function Jt(t,e){return[t,e]}function Zt(t,e){function n(t,e){var n=o-e,i=r*t;return[n*Ke(i),o-n*Ue(i)]}var i=Ue(t),r=t===e?Ke(t):(i-Ue(e))/(e-t),o=i/r+t;return Ye(r)0?1:t<0?-1:0},$e=Math.sqrt,tn=Math.tan,en={Feature:function(t,e){u(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++iFe?fe=90:un<-Fe&&(ce=-90),me[0]=le,me[1]=he}},cn={sphere:a,point:O,lineStart:A,lineEnd:G,polygonStart:function(){cn.lineStart=q,cn.lineEnd=k},polygonEnd:function(){cn.lineStart=A,cn.lineEnd=G}},hn=function(t){return function(){return t}},fn=function(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n};z.invert=z;var gn,dn,pn,_n,vn,mn,yn,xn,En,wn,bn,In=function(t){function e(e){return e=t(e[0]*ze,e[1]*ze),e[0]*=je,e[1]*=je,e}return t=Y(t[0]*ze,t[1]*ze,t.length>2?t[2]*ze:0),e.invert=function(e){return e=t.invert(e[0]*ze,e[1]*ze),e[0]*=je,e[1]*=je,e},e},Cn=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:a,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},Nn=function(t,e,n,i,r,o){var s,a=t[0],u=t[1],l=0,c=1,h=e[0]-a,f=e[1]-u;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s0){if(s>c)return;s>l&&(l=s)}if(s=r-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>l&&(l=s)}else if(h>0){if(s0)){if(s/=f,f<0){if(s0){if(s>c)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>c)return;s>l&&(l=s)}else if(f>0){if(s0&&(t[0]=a+l*h,t[1]=u+l*f),c<1&&(e[0]=a+c*h,e[1]=u+c*f),!0}}}}},Sn=function(t,e){return Ye(t[0]-e[0])=0;--o)r.point((c=l[o])[0],c[1]);else i(f.x,f.p.x,-1,r);f=f.p}l=(f=f.o).z,g=!g}while(!f.v);r.lineEnd()}}},Mn=1e9,Pn=-Mn,Rn=ie(),On=function(t,e){var n=e[0],i=e[1],r=[Ke(n),-Ue(n),0],s=0,a=0;Rn.reset();for(var u=0,l=t.length;u=0?1:-1,L=S*N,M=L>Ge,P=p*I;if(Rn.add(Ve(P*S*Ke(L),v*C+P*Ue(L))),s+=M?N+S*Be:N,M^g>=n^w>=n){var R=m(_(f),_(x));E(R);var O=m(r,R);E(O);var T=(M^N>=0?-1:1)*o(O[2]);(i>T||i===T&&(R[0]||R[1]))&&(a+=M^N>=0?1:-1)}}return(s<-Fe||sHn&&(Hn=t),eWn&&(Wn=e)},lineStart:a,lineEnd:a,polygonStart:a,polygonEnd:a,result:function(){var t=[[Vn,Un],[Hn,Wn]];return Hn=Wn=-(Un=Vn=1/0),t}},Zn=0,Kn=0,Qn=0,$n=0,ti=0,ei=0,ni=0,ii=0,ri=0,oi={point:dt,lineStart:pt,lineEnd:mt,polygonStart:function(){oi.lineStart=yt,oi.lineEnd=xt},polygonEnd:function(){oi.point=dt,oi.lineStart=pt,oi.lineEnd=mt},result:function(){var t=ri?[ni/ri,ii/ri]:ei?[$n/ei,ti/ei]:Qn?[Zn/Qn,Kn/Qn]:[NaN,NaN];return Zn=Kn=Qn=$n=ti=ei=ni=ii=ri=0,t}};bt.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Be)}},result:a};var si,ai,ui,li,ci,hi=ie(),fi={point:a,lineStart:function(){fi.point=It},lineEnd:function(){si&&Ct(ai,ui),fi.point=a},polygonStart:function(){si=!0},polygonEnd:function(){si=null},result:function(){var t=+hi;return hi.reset(),t}};Nt.prototype={_radius:4.5,_circle:St(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=St(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var gi=function(t,n,i,r){return function(o,s){function a(e,n){var i=o(e,n);t(e=i[0],n=i[1])&&s.point(e,n)}function u(t,e){var n=o(t,e);v.point(n[0],n[1])}function l(){w.point=u,v.lineStart()}function c(){w.point=a,v.lineEnd()}function h(t,e){_.push([t,e]);var n=o(t,e);x.point(n[0],n[1])}function f(){x.lineStart(),_=[]}function g(){h(_[0][0],_[0][1]),x.lineEnd();var t,e,n,i,r=x.clean(),o=y.result(),a=o.length;if(_.pop(),d.push(_),_=null,a)if(1&r){if(n=o[0],(e=n.length-1)>0){for(E||(s.polygonStart(),E=!0),s.lineStart(),t=0;t1&&2&r&&o.push(o.pop().concat(o.shift())),p.push(o.filter(Lt))}var d,p,_,v=n(s),m=o.invert(r[0],r[1]),y=Cn(),x=n(y),E=!1,w={point:a,lineStart:l,lineEnd:c,polygonStart:function(){w.point=h,w.lineStart=f,w.lineEnd=g,p=[],d=[]},polygonEnd:function(){w.point=a,w.lineStart=l,w.lineEnd=c,p=e.merge(p);var t=On(d,m);p.length?(E||(s.polygonStart(),E=!0),Ln(p,Mt,t,i,s)):t&&(E||(s.polygonStart(),E=!0),s.lineStart(),i(null,null,1,s),s.lineEnd()),E&&(s.polygonEnd(),E=!1),p=d=null},sphere:function(){s.polygonStart(),s.lineStart(),i(null,null,1,s),s.lineEnd(),s.polygonEnd()}};return w}},di=gi(function(){return!0},function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Ge:-Ge,u=Ye(o-n);Ye(u-Ge)0?qe:-qe),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(o,i),e=0):r!==a&&u>=Ge&&(Ye(n-r)Fe){var o=t[0]o}function i(t,e,n){var i=[1,0,0],r=m(_(t),_(e)),s=v(r,r),a=r[0],u=s-a*a;if(!u)return!n&&t;var l=o*s/u,c=-o*a/u,h=m(i,r),f=x(i,l);y(f,x(r,c));var g=h,d=v(f,g),E=v(g,g),w=d*d-E*(v(f,f)-1);if(!(w<0)){var b=$e(w),I=x(g,(-d-b)/E);if(y(I,f),I=p(I),!n)return I;var C,N=t[0],S=e[0],L=t[1],M=e[1];S0^I[1]<(Ye(I[0]-N)Ge^(N<=I[0]&&I[0]<=S)){var O=x(g,(-d+b)/E);return y(O,f),[I,p(O)]}}}function r(e,n){var i=s?t:Ge-t,r=0;return e<-i?r|=1:e>i&&(r|=2),n<-i?r|=4:n>i&&(r|=8),r}var o=Ue(t),s=o>0,a=Ye(o)>Fe;return gi(n,function(t){var e,o,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var g,d=[h,f],p=n(h,f),_=s?p?0:r(h,f):p?r(h+(h<0?Ge:-Ge),f):0;if(!e&&(l=u=p)&&t.lineStart(),p!==u&&(!(g=i(e,d))||Sn(e,g)||Sn(d,g))&&(d[0]+=Fe,d[1]+=Fe,p=n(d[0],d[1])),p!==u)c=0,p?(t.lineStart(),g=i(d,e),t.point(g[0],g[1])):(g=i(e,d),t.point(g[0],g[1]),t.lineEnd()),e=g;else if(a&&e&&s^p){var v;_&o||!(v=i(d,e,!0))||(c=0,s?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!p||e&&Sn(e,d)||t.point(d[0],d[1]),e=d,u=p,o=_},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}},function(n,i,r,o){H(o,t,e,r,n,i)},s?[0,-t]:[-Ge,t-Ge])};Ot.prototype={constructor:Ot,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var _i=16,vi=Ue(30*ze),mi=function(t,e){return+e?Ft(t,e):Dt(t)},yi=Rt({point:function(t,e){this.stream.point(t*ze,e*ze)}}),xi=function(){return kt(jt).scale(155.424).center([0,33.6442])},Ei=function(){return xi().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},wi=Yt(function(t){return $e(2/(1+t))});wi.invert=Xt(function(t){return 2*o(t/2)});var bi=Yt(function(t){return(t=r(t))&&t/Ke(t)});bi.invert=Xt(function(t){return t});Vt.invert=function(t,e){return[t,2*Xe(We(e))-qe]};Jt.invert=Jt;Kt.invert=Xt(Xe);$t.invert=function(t,e){var n,i=e,r=25;do{var o=i*i,s=o*o;i-=n=(i*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(Ye(n)>Fe&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]};te.invert=Xt(o);ee.invert=Xt(function(t){return 2*Xe(t)});ne.invert=function(t,e){return[-e,2*Xe(We(t))-qe]};t.geoArea=function(t){return sn.reset(),rn(t,an),2*sn},t.geoBounds=function(t){var e,n,i,r,o,s,a;if(fe=he=-(le=ce=1/0),ve=[],rn(t,ln),n=ve.length){for(ve.sort(P),e=1,o=[i=ve[0]];eM(i[0],i[1])&&(i[1]=r[1]),M(r[0],i[1])>M(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(a=M(i[1],r[0]))>s&&(s=a,le=r[0],he=i[1])}return ve=me=null,le===1/0||ce===1/0?[[NaN,NaN],[NaN,NaN]]:[[le,ce],[he,fe]]},t.geoCentroid=function(t){ye=xe=Ee=we=be=Ie=Ce=Ne=Se=Le=Me=0,rn(t,cn);var e=Se,n=Le,i=Me,r=e*e+n*n+i*i;return r<1e-12&&(e=Ie,n=Ce,i=Ne,xe=.12&&r<.234&&i>=-.425&&i<-.214?l:r>=.166&&r<.234&&i>=-.214&&i<-.115?c:u).invert(t)},t.stream=function(t){return n&&i===t?n:n=zt([u.stream(i=t),l.stream(t),c.stream(t)])},t.precision=function(t){return arguments.length?(u.precision(t),l.precision(t),c.precision(t),e()):u.precision()},t.scale=function(e){return arguments.length?(u.scale(e),l.scale(.35*e),c.scale(e),t.translate(u.translate())):u.scale()},t.translate=function(t){if(!arguments.length)return u.translate();var n=u.scale(),i=+t[0],a=+t[1];return r=u.translate(t).clipExtent([[i-.455*n,a-.238*n],[i+.455*n,a+.238*n]]).stream(h),o=l.translate([i-.307*n,a+.201*n]).clipExtent([[i-.425*n+Fe,a+.12*n+Fe],[i-.214*n-Fe,a+.234*n-Fe]]).stream(h),s=c.translate([i-.205*n,a+.212*n]).clipExtent([[i-.214*n+Fe,a+.166*n+Fe],[i-.115*n-Fe,a+.234*n-Fe]]).stream(h),e()},t.fitExtent=function(e,n){return Tt(t,e,n)},t.fitSize=function(e,n){return At(t,e,n)},t.scale(1070)},t.geoAzimuthalEqualArea=function(){return Gt(wi).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=wi,t.geoAzimuthalEquidistant=function(){return Gt(bi).scale(79.4188).clipAngle(179.999)},t.geoAzimuthalEquidistantRaw=bi,t.geoConicConformal=function(){return kt(Wt).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=Wt,t.geoConicEqualArea=xi,t.geoConicEqualAreaRaw=jt,t.geoConicEquidistant=function(){return kt(Zt).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=Zt,t.geoEquirectangular=function(){return Gt(Jt).scale(152.63)},t.geoEquirectangularRaw=Jt,t.geoGnomonic=function(){return Gt(Kt).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=Kt,t.geoIdentity=function(){function t(){return r=o=null,s}var e,n,i,r,o,s,a=1,u=0,l=0,c=1,h=1,f=jn,g=null,d=jn;return s={stream:function(t){return r&&o===t?r:r=f(d(o=t))},clipExtent:function(r){return arguments.length?(d=null==r?(g=e=n=i=null,jn):K(g=+r[0][0],e=+r[0][1],n=+r[1][0],i=+r[1][1]),t()):null==g?null:[[g,e],[n,i]]},scale:function(e){return arguments.length?(f=Qt((a=+e)*c,a*h,u,l),t()):a},translate:function(e){return arguments.length?(f=Qt(a*c,a*h,u=+e[0],l=+e[1]),t()):[u,l]},reflectX:function(e){return arguments.length?(f=Qt(a*(c=e?-1:1),a*h,u,l),t()):c<0},reflectY:function(e){return arguments.length?(f=Qt(a*c,a*(h=e?-1:1),u,l),t()):h<0},fitExtent:function(t,e){return Tt(s,t,e)},fitSize:function(t,e){return At(s,t,e)}}},t.geoProjection=Gt,t.geoProjectionMutator=qt,t.geoMercator=function(){return Ut(Vt).scale(961/Be)},t.geoMercatorRaw=Vt,t.geoNaturalEarth1=function(){return Gt($t).scale(175.295)},t.geoNaturalEarth1Raw=$t,t.geoOrthographic=function(){return Gt(te).scale(249.5).clipAngle(90+Fe)},t.geoOrthographicRaw=te,t.geoStereographic=function(){return Gt(ee).scale(250).clipAngle(142)},t.geoStereographicRaw=ee,t.geoTransverseMercator=function(){var t=Ut(ne),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=ne,t.geoRotation=In,t.geoStream=rn,t.geoTransform=function(t){return{stream:Rt(t)}},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":28}],30:[function(t,e,n){"use strict";function i(){}function r(){}function o(){}function s(){}function a(){}function u(){}function l(){}function c(t){this.name="RuntimeException",this.message=t,this.stack=(new Error).stack,Error.call(this,t)}function h(){if(0===arguments.length)c.call(this);else if(1===arguments.length){var t=arguments[0];c.call(this,t)}}function f(){}function g(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)g.call(this,0,0);else if(1===arguments.length){var t=arguments[0];g.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];g.call(this,e,n,g.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.x=i,this.y=r,this.z=o}}function d(){if(this._dimensionsToTest=2,0===arguments.length)d.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new r("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}function p(){}function _(){}function v(t){this.message=t||""}function m(){}function y(t){this.message=t||""}function x(t){this.message=t||""}function E(){this.array_=[],arguments[0]instanceof _&&this.addAll(arguments[0])}function w(){if(E.apply(this),0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}function b(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof g){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof b){var e=arguments[0];this.init(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(r,o,s,a)}}function I(){}function C(){I.call(this,"Projective point not representable on the Cartesian plane.")}function N(){}function S(){}function L(t){this.str=t}function M(t){this.value=t}function P(){}function R(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof R){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){var n=arguments[0];R.call(this,R.parse(n))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}}function O(){}function T(){}function A(){}function D(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var i=arguments[0],r=arguments[1];this.x=i.y*r.w-r.y*i.w,this.y=r.x*i.w-i.x*r.w,this.w=i.x*r.y-r.x*i.y}else if(arguments[0]instanceof g&&arguments[1]instanceof g){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2];this.x=a,this.y=u,this.w=l}else if(4===arguments.length){var c=arguments[0],h=arguments[1],f=arguments[2],d=arguments[3],p=c.y-h.y,_=h.x-c.x,v=c.x*h.y-h.x*c.y,m=f.y-d.y,y=d.x-f.x,x=f.x*d.y-d.x*f.y;this.x=_*x-y*v,this.y=m*v-p*x,this.w=p*y-m*_}}function F(){}function G(){}function q(){this._envelope=null,this._factory=null,this._SRID=null,this._userData=null;var t=arguments[0];this._factory=t,this._SRID=t.getSRID()}function k(){}function B(){}function j(){}function z(){}function Y(){}function X(){}function V(){}function U(){}function H(){}function W(){}function J(){}function Z(){}function K(){this.array_=[],arguments[0]instanceof _&&this.addAll(arguments[0])}function Q(t){return null==t?es:t.color}function $(t){return null==t?null:t.parent}function tt(t,e){null!==t&&(t.color=e)}function et(t){return null==t?null:t.left}function nt(t){return null==t?null:t.right}function it(){this.root_=null,this.size_=0}function rt(){}function ot(){}function st(){this.array_=[],arguments[0]instanceof _&&this.addAll(arguments[0])}function at(){}function ut(){}function lt(){}function ct(){}function ht(){this._geometries=null;var t=arguments[0],e=arguments[1];if(q.call(this,e),null===t&&(t=[]),q.hasNullElements(t))throw new r("geometries must not contain null elements");this._geometries=t}function ft(){var t=arguments[0],e=arguments[1];ht.call(this,t,e)}function gt(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0];gt.call(this,t,B.MOD2_BOUNDARY_RULE)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._geom=e,this._geomFact=e.getFactory(),this._bnRule=n}}function dt(){this.count=null}function pt(){}function _t(){}function vt(){}function mt(){}function yt(){}function xt(){}function Et(){}function wt(){this._points=null;var t=arguments[0],e=arguments[1];q.call(this,e),this.init(t)}function bt(){}function It(){this._coordinates=null;var t=arguments[0],e=arguments[1];q.call(this,e),this.init(t)}function Ct(){}function Nt(){this._shell=null,this._holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(q.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),q.hasNullElements(e))throw new r("holes must not contain null elements");if(t.isEmpty()&&q.hasNonEmptyElements(e))throw new r("shell is empty but holes are not");this._shell=t,this._holes=e}function St(){var t=arguments[0],e=arguments[1];ht.call(this,t,e)}function Lt(){if(arguments[0]instanceof g&&arguments[1]instanceof Vt){var t=arguments[0],e=arguments[1];Lt.call(this,e.getCoordinateSequenceFactory().create(t),e)}else if($o(arguments[0],T)&&arguments[1]instanceof Vt){var n=arguments[0],i=arguments[1];wt.call(this,n,i),this.validateConstruction()}}function Mt(){var t=arguments[0],e=arguments[1];ht.call(this,t,e)}function Pt(){if(this._factory=null,this._isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._factory=t}}function Rt(){}function Ot(){}function Tt(){}function At(){}function Dt(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];Dt.call(this,t,3)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(a=0;a-1}function Bt(t,e,n){var i=[0],r=!1;return t.push(i),{next:function(){var o,s=i[0];return!r&&s1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}function Le(){}function Me(){if(0===arguments.length)Me.call(this,Me.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];Se.call(this,t)}}function Pe(){var t=arguments[0];Ce.call(this,t)}function Re(){}function Oe(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new g(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}function Te(){this._nodeMap=new it,this._edge=null;var t=arguments[0];this._edge=t}function Ae(){this._nodeList=null,this._edge=null,this._nodeIt=null,this._currNode=null,this._nextNode=null,this._currSegIndex=0;var t=arguments[0];this._nodeList=t,this._edge=t.getEdge(),this._nodeIt=t.iterator(),this.readNextNode()}function De(){}function Fe(){this._nodeList=new Te(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}function Ge(){this.tempEnv1=new b,this.tempEnv2=new b,this._overlapSeg1=new $t,this._overlapSeg2=new $t}function qe(){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],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i}function ke(){}function Be(){}function je(){}function ze(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}function Ye(){if(this._monoChains=new E,this._index=new Me,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];ze.call(this,t)}}function Xe(){Ge.apply(this),this._si=null;var t=arguments[0];this._si=t}function Ve(){if(this.pt=null,1===arguments.length){var t=arguments[0];c.call(this,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];c.call(this,Ve.msgWithCoord(e,n)),this.name="TopologyException",this.pt=new g(n)}}function Ue(){}function He(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new E,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null}function We(){this._li=new Jt,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t}function Je(){this._nv=null;var t=arguments[0];this._nv=new We(Je.toSegmentStrings(t))}function Ze(){this._mapOp=null;var t=arguments[0];this._mapOp=t}function Ke(){}function Qe(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.init(1),this.location[Ke.ON]=e}else if(arguments[0]instanceof Qe){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var i=0;i=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Bn(0,i,o),this._arg[1]=new Bn(1,r,o)}}function zn(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=zn.orientation(t)}function Yn(){this._edges=new E,this._ocaMap=new it}function Xn(){this._ptLocator=new _e,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Yn,this._resultPolyList=new E,this._resultLineList=new E,this._resultPointList=new E;var t=arguments[0],e=arguments[1];jn.call(this,t,e),this._graph=new cn(new mn),this._geomFact=t.getFactory()}function Vn(){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null;var t=arguments[0],e=arguments[1];this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()}function Un(){this._geom=new Array(2).fill(null);var t=arguments[0],e=arguments[1];this._geom[0]=t,this._geom[1]=e}function Hn(){this._factory=null,this._interiorPoint=null,this._maxWidth=0;var t=arguments[0];this._factory=t.getFactory(),this.add(t)}function Wn(){this._poly=null,this._centreY=null,this._hiY=o.MAX_VALUE,this._loY=-o.MAX_VALUE;var t=arguments[0];this._poly=t,this._hiY=t.getEnvelopeInternal().getMaxY(),this._loY=t.getEnvelopeInternal().getMinY(),this._centreY=Hn.avg(this._loY,this._hiY)}function Jn(){this._centroid=null,this._minDistance=o.MAX_VALUE,this._interiorPoint=null;var t=arguments[0];this._centroid=t.getCentroid().getCoordinate(),this.addInterior(t),null===this._interiorPoint&&this.addEndpoints(t)}function Zn(){this._centroid=null,this._minDistance=o.MAX_VALUE,this._interiorPoint=null;var t=arguments[0];this._centroid=t.getCentroid().getCoordinate(),this.add(t)}function Kn(){this.tempEnv1=new b,this.selectedSegment=new $t}function Qn(){this._items=new E,this._subnode=[null,null]}function $n(){if(this.min=null,this.max=null,0===arguments.length)this.min=0,this.max=0;else if(1===arguments.length){var t=arguments[0];this.init(t.min,t.max)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.init(e,n)}}function ti(){}function ei(t,e){var n,i,r,o,s={32:8,64:11}[t];if(o||(n=e<0||1/e<0,isFinite(e)||(o={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}}[t],n&&(o.d+=1<=2;)i++,r/=2;for(;r<1&&i>0;)i--,r*=2;i<=0&&(r/=2),32===t&&i>254&&(o={d:n?255:127,c:128,b:0,a:0},i=Math.pow(2,s)-1,r=0)}return i}function ni(){this._pt=0,this._level=0,this._interval=null;var t=arguments[0];this.computeKey(t)}function ii(){Qn.apply(this),this._interval=null,this._centre=null,this._level=null;var t=arguments[0],e=arguments[1];this._interval=t,this._level=e,this._centre=(t.getMin()+t.getMax())/2}function ri(){}function oi(){Qn.apply(this)}function si(){this._root=null,this._minExtent=1,this._root=new oi}function ai(){}function ui(){this._ring=null,this._tree=null,this._crossings=0,this._interval=new $n;var t=arguments[0];this._ring=t,this.buildIndex()}function li(){Kn.apply(this),this.mcp=null,this.p=null;var t=arguments[0],e=arguments[1];this.mcp=t,this.p=e}function ci(){}function hi(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}function fi(){this._input=null,this._extremalPts=null,this._centre=null,this._radius=0;var t=arguments[0];this._input=t}function gi(){if(this._inputGeom=null,this._isConvex=null,this._convexHullPts=null,this._minBaseSeg=new $t,this._minWidthPt=null,this._minPtIndex=null,this._minWidth=0,1===arguments.length){var t=arguments[0];gi.call(this,t,!1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._inputGeom=e,this._isConvex=n}}function di(){this._inputGeom=null,this._distanceTolerance=null;var t=arguments[0];this._inputGeom=t}function pi(){ae.apply(this),this.distanceTolerance=null;var t=arguments[0];this.distanceTolerance=t}function _i(){this._orig=null,this._sym=null,this._next=null;var t=arguments[0];this._orig=t}function vi(){this._isMarked=!1;var t=arguments[0];_i.call(this,t)}function mi(){this._vertexMap=new zt}function yi(){this._isStart=!1;var t=arguments[0];vi.call(this,t)}function xi(){mi.apply(this)}function Ei(){this._result=null,this._factory=null,this._graph=null,this._lines=new E,this._nodeEdgeStack=new ie,this._ringStartEdge=null,this._graph=new xi}function wi(){this._items=new E,this._subnode=new Array(4).fill(null)}function bi(){this._pt=new g,this._level=0,this._env=null;var t=arguments[0];this.computeKey(t)}function Ii(){wi.apply(this),this._env=null,this._centrex=null,this._centrey=null,this._level=null;var t=arguments[0],e=arguments[1];this._env=t,this._level=e,this._centrex=(t.getMinX()+t.getMaxX())/2,this._centrey=(t.getMinY()+t.getMaxY())/2}function Ci(){wi.apply(this)}function Ni(){this._root=null,this._minExtent=1,this._root=new Ci}function Si(t){this.geometryFactory=t||new Vt}function Li(t){this.geometryFactory=t||new Vt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Si(this.geometryFactory)}function Mi(){this.parser=new Si(this.geometryFactory)}function Pi(t){this.geometryFactory=t||new Vt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Ut(this.geometryFactory)}function Ri(t){return[t.x,t.y]}function Oi(t,e){this.geometryFactory=t||new Vt,this.ol=e||"undefined"!=typeof ol&&ol}function Ti(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];Ti.call(this,t,e,0,0)}else if(4===arguments.length){var n=arguments[0],i=arguments[1];this._noder=n,this._scaleFactor=i,this._isScaled=!this.isIntegerPrecision()}}function Ai(){if(this._inputGeom=null,this._isClosedEndpointsInInterior=!0,this._nonSimpleLocation=null,1===arguments.length){var t=arguments[0];this._inputGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._inputGeom=e,this._isClosedEndpointsInInterior=!n.isInBoundary(2)}}function Di(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function Fi(){if(this._quadrantSegments=Fi.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=Fi.CAP_ROUND,this._joinStyle=Fi.JOIN_ROUND,this._mitreLimit=Fi.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=Fi.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(r),this.setJoinStyle(o),this.setMitreLimit(s)}}function Gi(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}function qi(){this.array_=[]}function ki(){this._finder=null,this._dirEdgeList=new E,this._nodes=new E,this._rightMostCoord=null,this._env=null,this._finder=new Gi}function Bi(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Qt.COUNTERCLOCKWISE;var t=arguments[0];this._inputLine=t}function ji(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new E}function zi(){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 $t,this._seg1=new $t,this._offset0=new $t,this._offset1=new $t,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Jt,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Fi.JOIN_ROUND&&(this._closingSegLengthFactor=zi.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}function Yi(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}function Xi(){this._subgraphs=null,this._seg=new $t,this._cga=new Qt;var t=arguments[0];this._subgraphs=t}function Vi(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new $t(t),this._leftDepth=e}function Ui(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new E;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}function Hi(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t}function Wi(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Yn;var t=arguments[0];this._bufParams=t}function Ji(){this._li=new Jt,this._segStrings=null;var t=arguments[0];this._segStrings=t}function Zi(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new r("Scale factor must be non-zero");1!==e&&(this._pt=new g(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new g,this._p1Scaled=new g),this.initCorners(this._pt)}function Ki(){this._index=null;var t=arguments[0];this._index=t}function Qi(){Kn.apply(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}function $i(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new E}function tr(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Jt,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}function er(){if(this._argGeom=null,this._distance=null,this._bufParams=new Fi,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}}function nr(){this._comps=null;var t=arguments[0];this._comps=t}function ir(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var t=arguments[0],e=arguments[1];ir.call(this,t,ir.INSIDE_AREA,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._component=n,this._segIndex=i,this._pt=r}}function rr(){this._pts=null;var t=arguments[0];this._pts=t}function or(){this._locations=null;var t=arguments[0];this._locations=t}function sr(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new _e,this._minDistanceLocation=null,this._minDistance=o.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];sr.call(this,t,e,0)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=r}}function ar(){this._factory=null,this._directedEdges=new E,this._coordinates=null;var t=arguments[0];this._factory=t}function ur(){this._isMarked=!1,this._isVisited=!1,this._data=null}function lr(){ur.apply(this),this._parentEdge=null,this._from=null,this._to=null,this._p0=null,this._p1=null,this._sym=null,this._edgeDirection=null,this._quadrant=null,this._angle=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._from=t,this._to=e,this._edgeDirection=i,this._p0=t.getCoordinate(),this._p1=n;var r=this._p1.x-this._p0.x,o=this._p1.y-this._p0.y;this._quadrant=ke.quadrant(r,o),this._angle=Math.atan2(o,r)}function cr(){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];lr.call(this,t,e,n,i)}function hr(){if(ur.apply(this),this._dirEdge=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.setDirectedEdges(t,e)}}function fr(){this._outEdges=new E,this._sorted=!1}function gr(){if(ur.apply(this),this._pt=null,this._deStar=null,1===arguments.length){var t=arguments[0];gr.call(this,t,new fr)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._pt=e,this._deStar=n}}function dr(){hr.apply(this),this._line=null;var t=arguments[0];this._line=t}function pr(){this._nodeMap=new it}function _r(){this._edges=new K,this._dirEdges=new K,this._nodeMap=new pr}function vr(){_r.apply(this)}function mr(){this._graph=new vr,this._mergedLineStrings=null,this._factory=null,this._edgeStrings=null}function yr(){this._edgeRing=null,this._next=null,this._label=-1;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];lr.call(this,t,e,n,i)}function xr(){hr.apply(this),this._line=null;var t=arguments[0];this._line=t}function Er(){this._geometryFactory=new Vt,this._geomGraph=null,this._disconnectedRingcoord=null;var t=arguments[0];this._geomGraph=t}function wr(){}function br(){if(this._edgeEnds=new E,1===arguments.length){var t=arguments[0];br.call(this,null,t)}else if(2===arguments.length){arguments[0];var e=arguments[1];an.call(this,e.getEdge(),e.getCoordinate(),e.getDirectedCoordinate(),new $e(e.getLabel())),this.insert(e)}}function Ir(){_n.apply(this)}function Cr(){var t=arguments[0],e=arguments[1];on.call(this,t,e)}function Nr(){ln.apply(this)}function Sr(){this._nodes=new sn(new Nr)}function Lr(){this._li=new Jt,this._geomGraph=null,this._nodeGraph=new Sr,this._invalidPoint=null;var t=arguments[0];this._geomGraph=t}function Mr(){this._graph=null,this._rings=new E,this._totalEnv=new b,this._index=null,this._nestedPt=null;var t=arguments[0];this._graph=t}function Pr(){if(this._errorType=null,this._pt=null,1===arguments.length){var t=arguments[0];Pr.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._errorType=e,null!==n&&(this._pt=n.copy())}}function Rr(){this._parentGeometry=null,this._isSelfTouchingRingFormingHoleValid=!1,this._validErr=null;var t=arguments[0];this._parentGeometry=t}function Or(){this._factory=null,this._deList=new E,this._lowestEdge=null,this._ring=null,this._ringPts=null,this._holes=null,this._shell=null,this._isHole=null,this._isProcessed=!1,this._isIncludedSet=!1,this._isIncluded=!1;var t=arguments[0];this._factory=t}function Tr(){}function Ar(){_r.apply(this),this._factory=null;var t=arguments[0];this._factory=t}function Dr(){if(this._lineStringAdder=new Fr(this),this._graph=null,this._dangles=new E,this._cutEdges=new E,this._invalidRingLines=new E,this._holeList=null,this._shellList=null,this._polyList=null,this._isCheckingRingsValid=!0,this._extractOnlyPolygonal=null,this._geomFactory=null,0===arguments.length)Dr.call(this,!1);else if(1===arguments.length){var t=arguments[0];this._extractOnlyPolygonal=t}}function Fr(){this.p=null;var t=arguments[0];this.p=t}function Gr(){this._li=new Jt,this._ptLocator=new _e,this._arg=null,this._nodes=new sn(new Nr),this._im=null,this._isolatedEdges=new E,this._invalidPoint=null;var t=arguments[0];this._arg=t}function qr(){this._rectEnv=null;var t=arguments[0];this._rectEnv=t.getEnvelopeInternal()}function kr(){this._li=new Jt,this._rectEnv=null,this._diagUp0=null,this._diagUp1=null,this._diagDown0=null,this._diagDown1=null;var t=arguments[0];this._rectEnv=t,this._diagUp0=new g(t.getMinX(),t.getMinY()),this._diagUp1=new g(t.getMaxX(),t.getMaxY()),this._diagDown0=new g(t.getMinX(),t.getMaxY()),this._diagDown1=new g(t.getMaxX(),t.getMinY())}function Br(){this._isDone=!1}function jr(){this._rectangle=null,this._rectEnv=null;var t=arguments[0];this._rectangle=t,this._rectEnv=t.getEnvelopeInternal()}function zr(){Br.apply(this),this._rectEnv=null,this._intersects=!1;var t=arguments[0];this._rectEnv=t}function Yr(){Br.apply(this),this._rectSeq=null,this._rectEnv=null,this._containsPoint=!1;var t=arguments[0];this._rectSeq=t.getExteriorRing().getCoordinateSequence(),this._rectEnv=t.getEnvelopeInternal()}function Xr(){Br.apply(this),this._rectEnv=null,this._rectIntersector=null,this._hasIntersection=!1,this._p0=new g,this._p1=new g;var t=arguments[0];this._rectEnv=t.getEnvelopeInternal(),this._rectIntersector=new kr(this._rectEnv)}function Vr(){if(this._relate=null,2===arguments.length){var t=arguments[0],e=arguments[1];jn.call(this,t,e),this._relate=new Gr(this._arg)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];jn.call(this,n,i,r),this._relate=new Gr(this._arg)}}function Ur(){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null;var t=arguments[0];this._geomFactory=Ur.extractFactory(t),this._inputGeoms=t}function Hr(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new E)}function Wr(){this._pointGeom=null,this._otherGeom=null,this._geomFact=null;var t=arguments[0],e=arguments[1];this._pointGeom=t,this._otherGeom=e,this._geomFact=e.getFactory()}function Jr(){this._sortIndex=-1,this._comps=null;var t=arguments[0],e=arguments[1];this._sortIndex=t,this._comps=e}function Zr(){if(this._polygons=new E,this._lines=new E,this._points=new E,this._geomFact=null,1===arguments.length){if($o(arguments[0],_)){var t=arguments[0];this.extract(t)}else if(arguments[0]instanceof q){var e=arguments[0];this.extract(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this._geomFact=i,this.extract(n)}}function Kr(){this._geomFactory=null,this._g0=null,this._g1=null,this._interacts0=null,this._interacts1=null;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e,this._geomFactory=t.getFactory(),this._interacts0=new Array(t.getNumGeometries()).fill(null),this._interacts1=new Array(e.getNumGeometries()).fill(null)}function Qr(){}function $r(){Pt.CoordinateOperation.apply(this),this._targetPM=null,this._removeCollapsed=!0;var t=arguments[0],e=arguments[1];this._targetPM=t,this._removeCollapsed=e}function to(){this._targetPM=null,this._removeCollapsed=!0,this._changePrecisionModel=!1,this._isPointwise=!1;var t=arguments[0];this._targetPM=t}function eo(){this._pts=null,this._usePt=null,this._distanceTolerance=null,this._seg=new $t;var t=arguments[0];this._pts=t}function no(){this._inputGeom=null,this._distanceTolerance=null,this._isEnsureValidTopology=!0;var t=arguments[0];this._inputGeom=t}function io(){ae.apply(this),this._isEnsureValidTopology=!0,this._distanceTolerance=null;var t=arguments[0],e=arguments[1];this._isEnsureValidTopology=t,this._distanceTolerance=e}function ro(){if(this._parent=null,this._index=null,2===arguments.length){var t=arguments[0],e=arguments[1];ro.call(this,t,e,null,-1)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=arguments[3];$t.call(this,n,i),this._parent=r,this._index=o}}function oo(){if(this._parentLine=null,this._segs=null,this._resultSegs=new E,this._minimumSize=null,1===arguments.length){var t=arguments[0];oo.call(this,t,2)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._parentLine=e,this._minimumSize=n,this.init()}}function so(){this._index=new Ni}function ao(){this._querySeg=null,this._items=new E;var t=arguments[0];this._querySeg=t}function uo(){this._li=new Jt,this._inputIndex=new so,this._outputIndex=new so,this._line=null,this._linePts=null,this._distanceTolerance=0;var t=arguments[0],e=arguments[1];this._inputIndex=t,this._outputIndex=e}function lo(){this._inputIndex=new so,this._outputIndex=new so,this._distanceTolerance=0}function co(){this._inputGeom=null,this._lineSimplifier=new lo,this._linestringMap=null;var t=arguments[0];this._inputGeom=t}function ho(){ae.apply(this),this._linestringMap=null;var t=arguments[0];this._linestringMap=t}function fo(){this.tps=null;var t=arguments[0];this.tps=t}function go(){this._seg=null,this._segLen=null,this._splitPt=null,this._minimumLen=0;var t=arguments[0];this._seg=t,this._segLen=t.getLength()}function po(){}function _o(){}function vo(){}function mo(){if(this._p=null,1===arguments.length){var t=arguments[0];this._p=new g(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._p=new g(e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._p=new g(i,r,o)}}function yo(){this._isOnConstraint=null,this._constraint=null;var t=arguments[0];mo.call(this,t)}function xo(){this._rot=null,this._vertex=null,this._next=null,this._data=null}function Eo(){this._subdiv=null,this._isUsingTolerance=!1;var t=arguments[0];this._subdiv=t,this._isUsingTolerance=t.getTolerance()>0}function wo(){}function bo(){this._subdiv=null,this._lastEdge=null;var t=arguments[0];this._subdiv=t,this.init()}function Io(){if(this._seg=null,1===arguments.length){if("string"==typeof arguments[0]){var t=arguments[0];c.call(this,t)}else if(arguments[0]instanceof $t){var e=arguments[0];c.call(this,"Locate failed to converge (at edge: "+e+"). Possible causes include invalid Subdivision topology or very close sites"),this._seg=new $t(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];c.call(this,Io.msgWithSpatial(n,i)),this._seg=new $t(i)}}function Co(){}function No(){this._visitedKey=0,this._quadEdges=new E,this._startingEdge=null,this._tolerance=null,this._edgeCoincidenceTolerance=null,this._frameVertex=new Array(3).fill(null),this._frameEnv=null,this._locator=null,this._seg=new $t,this._triEdges=new Array(3).fill(null);var t=arguments[0],e=arguments[1];this._tolerance=e,this._edgeCoincidenceTolerance=e/No.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(t),this._startingEdge=this.initSubdiv(),this._locator=new bo(this)}function So(){}function Lo(){this._triList=new E}function Mo(){this._triList=new E}function Po(){this._coordList=new w,this._triCoords=new E}function Ro(){if(this._ls=null,this._data=null,2===arguments.length){var t=arguments[0],e=arguments[1];this._ls=new $t(t,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._ls=new $t(n,i),this._data=r}else if(6===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5];Ro.call(this,new g(o,s,a),new g(u,l,c))}else if(7===arguments.length){var h=arguments[0],f=arguments[1],d=arguments[2],p=arguments[3],_=arguments[4],v=arguments[5],m=arguments[6];Ro.call(this,new g(h,f,d),new g(p,_,v),m)}}function Oo(){}function To(){if(this._p=null,this._data=null,this._left=null,this._right=null,this._count=null,2===arguments.length){var t=arguments[0],e=arguments[1];this._p=new g(t),this._left=null,this._right=null,this._count=1,this._data=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._p=new g(n,i),this._left=null,this._right=null,this._count=1,this._data=r}}function Ao(){if(this._root=null,this._numberOfNodes=null,this._tolerance=null,0===arguments.length)Ao.call(this,0);else if(1===arguments.length){var t=arguments[0];this._tolerance=t}}function Do(){this._tolerance=null,this._matchNode=null,this._matchDist=0,this._p=null;var t=arguments[0],e=arguments[1];this._p=t,this._tolerance=e}function Fo(){this._initialVertices=null,this._segVertices=null,this._segments=new E,this._subdiv=null,this._incDel=null,this._convexHull=null,this._splitFinder=new _o,this._kdt=null,this._vertexFactory=null,this._computeAreaEnv=null,this._splitPt=null,this._tolerance=null;var t=arguments[0],e=arguments[1];this._initialVertices=new E(t),this._tolerance=e,this._kdt=new Ao(e)}function Go(){this._siteCoords=null,this._tolerance=0,this._subdiv=null}function qo(){this._siteCoords=null,this._constraintLines=null,this._tolerance=0,this._subdiv=null,this._constraintVertexMap=new it}function ko(){this._siteCoords=null,this._tolerance=0,this._subdiv=null,this._clipEnv=null,this._diagramEnv=null}function Bo(){if(this._componentIndex=0,this._segmentIndex=0,this._segmentFraction=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._componentIndex=t._componentIndex,this._segmentIndex=t._segmentIndex,this._segmentFraction=t._segmentFraction}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Bo.call(this,0,e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._componentIndex=i,this._segmentIndex=r,this._segmentFraction=o,this.normalize()}else if(4===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._componentIndex=s,this._segmentIndex=a,this._segmentFraction=u,l&&this.normalize()}}function jo(){if(this._linearGeom=null,this._numLines=null,this._currentLine=null,this._componentIndex=0,this._vertexIndex=0,1===arguments.length){var t=arguments[0];jo.call(this,t,0,0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];jo.call(this,e,n.getComponentIndex(),jo.segmentEndVertexIndex(n))}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];if(!$o(i,rt))throw new r("Lineal geometry is required");this._linearGeom=i,this._numLines=i.getNumGeometries(),this._componentIndex=o,this._vertexIndex=s,this.loadCurrentLine()}}function zo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Yo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Xo(){this._geomFact=null,this._lines=new E,this._coordList=null,this._ignoreInvalidLines=!1,this._fixInvalidLines=!1,this._lastPt=null;var t=arguments[0];this._geomFact=t}function Vo(){this._line=null;var t=arguments[0];this._line=t}function Uo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t,this.checkGeometryType()}function Ho(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Wo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Jo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}Object.defineProperty(n,"__esModule",{value:!0});var Zo=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};Zo(i.prototype,{interfaces_:function(){return[]},getClass:function(){return i}}),i.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n},o.isNaN=function(t){return Number.isNaN(t)},o.doubleToLongBits=function(t){return t},o.longBitsToDouble=function(t){return t},o.isInfinite=function(t){return!Number.isFinite(t)},o.MAX_VALUE=Number.MAX_VALUE,c.prototype=Object.create(Error.prototype),c.prototype.constructor=Error;var Ko=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t};Ko(h,c),Zo(h.prototype,{interfaces_:function(){return[]},getClass:function(){return h}}),Zo(f.prototype,{interfaces_:function(){return[]},getClass:function(){return f}}),f.shouldNeverReachHere=function(){if(0===arguments.length)f.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new h("Should never reach here"+(null!==t?": "+t:""))}},f.isTrue=function(){if(1===arguments.length){var t=arguments[0];f.isTrue(t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!e)throw null===n?new h:new h(n)}},f.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];f.equals(t,e,null)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(!i.equals(n))throw new h("Expected "+n+" but encountered "+i+(null!==r?": "+r:""))}},Zo(g.prototype,{setOrdinate:function(t,e){switch(t){case g.X:this.x=e;break;case g.Y:this.y=e;break;case g.Z:this.z=e;break;default:throw new r("Invalid ordinate index: "+t)}},equals2D:function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!i.equalsWithTolerance(this.x,e.x,n)&&!!i.equalsWithTolerance(this.y,e.y,n)}},getOrdinate:function(t){switch(t){case g.X:return this.x;case g.Y:return this.y;case g.Z:return this.z}throw new r("Invalid ordinate index: "+t)},equals3D:function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||o.isNaN(this.z)&&o.isNaN(t.z))},equals:function(t){return t instanceof g&&this.equals2D(t)},equalInZ:function(t,e){return i.equalsWithTolerance(this.z,t.z,e)},compareTo:function(t){var e=t;return this.xe.x?1:this.ye.y?1:0},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return f.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}},copy:function(){return new g(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},distance3D:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},distance:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+g.hashCode(this.x),t=37*t+g.hashCode(this.y)},setCoordinate:function(t){this.x=t.x,this.y=t.y,this.z=t.z},interfaces_:function(){return[s,a,l]},getClass:function(){return g}}),g.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=o.doubleToLongBits(t);return Math.trunc(e^e>>>32)}},Zo(d.prototype,{compare:function(t,e){var n=t,i=e,r=d.compare(n.x,i.x);if(0!==r)return r;var o=d.compare(n.y,i.y);return 0!==o?o:this._dimensionsToTest<=2?0:d.compare(n.z,i.z)},interfaces_:function(){return[u]},getClass:function(){return d}}),d.compare=function(t,e){return te?1:o.isNaN(t)?o.isNaN(e)?0:-1:o.isNaN(e)?1:0},g.DimensionalComparator=d,g.serialVersionUID=0x5cbf2c235c7e5800,g.NULL_ORDINATE=o.NaN,g.X=0,g.Y=1,g.Z=2,p.prototype.hasNext=function(){},p.prototype.next=function(){},p.prototype.remove=function(){},_.prototype.add=function(){},_.prototype.addAll=function(){},_.prototype.isEmpty=function(){},_.prototype.iterator=function(){},_.prototype.size=function(){},_.prototype.toArray=function(){},_.prototype.remove=function(){},(v.prototype=new Error).name="IndexOutOfBoundsException",(m.prototype=Object.create(_.prototype)).constructor=m,m.prototype.get=function(){},m.prototype.set=function(){},m.prototype.isEmpty=function(){},(y.prototype=new Error).name="NoSuchElementException",(x.prototype=new Error).name="OperationNotSupported",E.prototype=Object.create(m.prototype),E.prototype.constructor=E,E.prototype.ensureCapacity=function(){},E.prototype.interfaces_=function(){return[m,_]},E.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},E.prototype.clear=function(){this.array_=[]},E.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},E.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},E.prototype.iterator=function(){return new Qo(this)},E.prototype.get=function(t){if(t<0||t>=this.size())throw new v;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=1&&this.get(this.size()-1).equals2D(i))return null;E.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var r=arguments[0],o=arguments[1];return this.add(r,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];if(arguments[2])for(v=0;v=0;v--)this.add(s[v],a);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof g){var u=arguments[0],l=arguments[1];if(!arguments[2]){var c=this.size();if(c>0){if(u>0&&this.get(u-1).equals2D(l))return null;if(up&&(_=-1);for(var v=d;v!==p;v+=_)this.add(h[v],f);return!0}},closeRing:function(){this.size()>0&&this.add(new g(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return w}}),w.coordArrayType=new Array(0).fill(null),Zo(b.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(t){if(!(t instanceof b))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},intersection:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new b;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny;return new b(e,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],i=arguments[1];return!this.isNull()&&(n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy)}},intersects:function(){if(1===arguments.length){if(arguments[0]instanceof b){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||ithis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(nthis._maxx&&(this._maxx=n),ithis._maxy&&(this._maxy=i))}},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},translate:function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},toString:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},setToNull:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},getHeight:function(){return this.isNull()?0:this._maxy-this._miny},maxExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},expandBy:function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},contains:function(){if(1===arguments.length){if(arguments[0]instanceof b){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof g){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},centre:function(){return this.isNull()?null:new g((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof g){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof b){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],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];rt._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)},hashCode:function(){var t=17;return t=37*t+g.hashCode(this._minx),t=37*t+g.hashCode(this._maxx),t=37*t+g.hashCode(this._miny),t=37*t+g.hashCode(this._maxy)},interfaces_:function(){return[s,l]},getClass:function(){return b}}),b.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 i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(i.x,r.x),c=Math.max(i.x,r.x);return!(l>u)&&(!(cu)&&!(c-1};Zo(S.prototype,{interfaces_:function(){return[]},getClass:function(){return S}}),S.log10=function(t){var e=Math.log(t);return o.isInfinite(e)?e:o.isNaN(e)?e:e/S.LOG_10},S.min=function(t,e,n,i){var r=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],o=arguments[2];return io?o:i}},S.wrap=function(t,e){return t<0?e- -t%e:t%e},S.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return e>(a=t)&&(a=e),n>a&&(a=n),a}if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=i;return r>a&&(a=r),o>a&&(a=o),s>a&&(a=s),a}},S.average=function(t,e){return(t+e)/2},S.LOG_10=Math.log(10),L.prototype.append=function(t){this.str+=t},L.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},L.prototype.toString=function(t){return this.str},M.prototype.intValue=function(){return this.value},M.prototype.compareTo=function(t){return this.valuet?1:0},M.isNaN=function(t){return Number.isNaN(t)},P.isWhitespace=function(t){return t<=32&&t>=0||127==t},P.toUpperCase=function(t){return t.toUpperCase()},Zo(R.prototype,{le:function(t){return this._hi9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(R.valueOf(l)).multiply(R.TEN),c&&n.selfAdd(R.TEN);var f=!0,g=R.magnitude(n._hi);if(g<0&&Math.abs(g)>=a-u&&(f=!1),!f)break}return e[0]=i,s.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this._hi+this._lo},subtract:function(){if(arguments[0]instanceof R){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},equals:function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},isZero:function(){return 0===this._hi&&0===this._lo},selfSubtract:function(){if(arguments[0]instanceof R){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)}},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(t){return this.le(t)?this:t},selfDivide:function(){if(1===arguments.length){if(arguments[0]instanceof R){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=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null,c=null,h=null;return u=this._hi/n,l=R.SPLIT*u,r=l-u,h=R.SPLIT*n,r=l-r,o=u-r,s=h-n,c=u*n,s=h-s,a=n-s,h=r*s-c+r*a+o*s+o*a,l=(this._hi-c-h+this._lo-u*i)/n,h=u+l,this._hi=h,this._lo=u-h+l,this}},dump:function(){return"DD<"+this._hi+", "+this._lo+">"},divide:function(){if(arguments[0]instanceof R){var t=arguments[0],e=null,n=null,i=null,r=null,s=null,a=null,u=null,l=null;return n=(s=this._hi/t._hi)-(e=(a=R.SPLIT*s)-(e=a-s)),l=e*(i=(l=R.SPLIT*t._hi)-(i=l-t._hi))-(u=s*t._hi)+e*(r=t._hi-i)+n*i+n*r,new R(l=s+(a=(this._hi-u-l+this._lo-s*t._lo)/t._hi),s-l+a)}if("number"==typeof arguments[0]){var c=arguments[0];return o.isNaN(c)?R.createNaN():R.copy(this).selfDivide(c,0)}},ge:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo},pow:function(t){if(0===t)return R.valueOf(1);var e=new R(this),n=R.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(e),(i/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},ceil:function(){if(this.isNaN())return R.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new R(t,e)},compareTo:function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){if(arguments[0]instanceof R){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},max:function(t){return this.ge(t)?this:t},sqrt:function(){if(this.isZero())return R.valueOf(0);if(this.isNegative())return R.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=R.valueOf(e),i=this.subtract(n.sqr())._hi*(.5*t);return n.add(i)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof R){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,i=null,r=null,o=null,s=null,a=null;return r=this._hi+e,s=r-this._hi,o=r-s,o=e-s+(this._hi-o),a=o+this._lo,n=r+a,i=a+(r-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],n=null,i=null,c=null,h=null,r=null,o=null,s=null,a=null;r=this._hi+u,c=this._lo+l,o=r-(s=r-this._hi),h=c-(a=c-this._lo);var f=(n=r+(s=(o=u-s+(this._hi-o))+c))+(s=(h=l-a+(this._lo-h))+(i=s+(r-n))),g=s+(n-f);return this._hi=f,this._lo=g,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof R){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=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null;r=(u=R.SPLIT*this._hi)-this._hi,l=R.SPLIT*n,r=u-r,o=this._hi-r,s=l-n;var c=(u=this._hi*n)+(l=r*(s=l-s)-u+r*(a=n-s)+o*s+o*a+(this._hi*i+this._lo*n)),h=l+(r=u-c);return this._hi=c,this._lo=h,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return R.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new R(t,e)},negate:function(){return this.isNaN()?this:new R(-this._hi,-this._lo)},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}},multiply:function(){if(arguments[0]instanceof R){var t=arguments[0];return t.isNaN()?R.createNaN():R.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return o.isNaN(e)?R.createNaN():R.copy(this).selfMultiply(e,0)}},isNaN:function(){return o.isNaN(this._hi)},intValue:function(){return Math.trunc(this._hi)},toString:function(){var t=R.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(i<0)r="0."+R.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length;r=n+R.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+r:r},reciprocal:function(){var t=null,e=null,n=null,i=null,r=null,o=null,s=null,a=null;e=(r=1/this._hi)-(t=(o=R.SPLIT*r)-(t=o-r)),n=(a=R.SPLIT*this._hi)-this._hi;var u=r+(o=(1-(s=r*this._hi)-(a=t*(n=a-n)-s+t*(i=this._hi-n)+e*n+e*i)-r*this._lo)/this._hi);return new R(u,r-u+o)},toSciNotation:function(){if(this.isZero())return R.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=R.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new IllegalStateException("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var o=n.charAt(0)+"."+r;return this.isNegative()?"-"+o+i:o+i},abs:function(){return this.isNaN()?R.NaN:this.isNegative()?this.negate():new R(this)},isPositive:function(){return this._hi>0||0===this._hi&&this._lo>0},lt:function(t){return this._hit._hi||this._hi===t._hi&&this._lo>t._lo},isNegative:function(){return this._hi<0||0===this._hi&&this._lo<0},trunc:function(){return this.isNaN()?R.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},interfaces_:function(){return[l,s,a]},getClass:function(){return R}}),R.sqr=function(t){return R.valueOf(t).selfMultiply(t)},R.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return R.parse(t)}if("number"==typeof arguments[0])return new R(arguments[0])},R.sqrt=function(t){return R.valueOf(t).sqrt()},R.parse=function(t){for(var e=0,n=t.length;P.isWhitespace(t.charAt(e));)e++;var i=!1;if(e=n)break;var l=t.charAt(e);if(e++,P.isDigit(l)){var c=l-"0";o.selfMultiply(R.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=M.parseInt(h)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+h+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var f=o,g=s-a-u;if(0===g)f=o;else if(g>0){d=R.TEN.pow(g);f=o.divide(d)}else if(g<0){var d=R.TEN.pow(-g);f=o.multiply(d)}return i?f.negate():f},R.createNaN=function(){return new R(o.NaN,o.NaN)},R.copy=function(t){return new R(t)},R.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n));return 10*Math.pow(10,i)<=e&&(i+=1),i},R.stringOfChar=function(t,e){for(var n=new L,i=0;i0){if(o<=0)return O.signum(s);i=r+o}else{if(!(r<0))return O.signum(s);if(o>=0)return O.signum(s);i=-r-o}var a=O.DP_SAFE_EPSILON*i;return s>=a||-s>=a?O.signum(s):2},O.signum=function(t){return t>0?1:t<0?-1:0},O.DP_SAFE_EPSILON=1e-15,Zo(T.prototype,{setOrdinate:function(t,e,n){},size:function(){},getOrdinate:function(t,e){},getCoordinate:function(){},getCoordinateCopy:function(t){},getDimension:function(){},getX:function(t){},clone:function(){},expandEnvelope:function(t){},copy:function(){},getY:function(t){},toCoordinateArray:function(){},interfaces_:function(){return[a]},getClass:function(){return T}}),T.X=0,T.Y=1,T.Z=2,T.M=3,A.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;s0},interfaces_:function(){return[B]},getClass:function(){return z}}),Zo(Y.prototype,{isInBoundary:function(t){return t>1},interfaces_:function(){return[B]},getClass:function(){return Y}}),Zo(X.prototype,{isInBoundary:function(t){return 1===t},interfaces_:function(){return[B]},getClass:function(){return X}}),B.Mod2BoundaryNodeRule=j,B.EndPointBoundaryNodeRule=z,B.MultiValentEndPointBoundaryNodeRule=Y,B.MonoValentEndPointBoundaryNodeRule=X,B.MOD2_BOUNDARY_RULE=new j,B.ENDPOINT_BOUNDARY_RULE=new z,B.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new Y,B.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new X,B.OGC_SFS_BOUNDARY_RULE=B.MOD2_BOUNDARY_RULE,Zo(V.prototype,{interfaces_:function(){return[]},getClass:function(){return V}}),V.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},V.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},V.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},V.extract=function(t,e,n){e=S.clamp(e,0,t.length);var i=(n=S.clamp(n,-1,t.length))-e+1;n<0&&(i=0),e>=t.length&&(i=0),ni.length)return 1;if(0===n.length)return 0;var r=V.compare(n,i);return V.isEqualReversed(n,i)?0:r},OLDcompare:function(t,e){var n=t,i=e;if(n.lengthi.length)return 1;if(0===n.length)return 0;for(var r=V.increasingDirection(n),o=V.increasingDirection(i),s=r>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u0))return e.value;e=e.right}}return null},it.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:es,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do{if(n=r,(i=t.compareTo(r.key))<0)r=r.left;else{if(!(i>0)){var o=r.value;return r.value=e,o}r=r.right}}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:n,color:es,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},it.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!=this.root_&&1==t.parent.color;)if($(t)==et($($(t))))1==Q(e=nt($($(t))))?(tt($(t),es),tt(e,es),tt($($(t)),1),t=$($(t))):(t==nt($(t))&&(t=$(t),this.rotateLeft(t)),tt($(t),es),tt($($(t)),1),this.rotateRight($($(t))));else{var e=et($($(t)));1==Q(e)?(tt($(t),es),tt(e,es),tt($($(t)),1),t=$($(t))):(t==et($(t))&&(t=$(t),this.rotateRight(t)),tt($(t),es),tt($($(t)),1),this.rotateLeft($($(t))))}this.root_.color=es},it.prototype.values=function(){var t=new E,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=it.successor(e));)t.add(e.value);return t},it.prototype.entrySet=function(){var t=new K,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=it.successor(e));)t.add(e);return t},it.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left==t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},it.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right==t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},it.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},it.successor=function(t){if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}for(var e=t.parent,n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e},it.prototype.size=function(){return this.size_},Zo(rt.prototype,{interfaces_:function(){return[]},getClass:function(){return rt}}),ot.prototype=new Z,st.prototype=new ot,st.prototype.contains=function(t){for(var e=0,n=this.array_.length;e=0;){var s=r.substring(0,o);i.add(s),o=(r=r.substring(o+n)).indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),u=0;u0)for(var o=r;o0&&i.append(" ");for(var o=0;o0&&i.append(","),i.append(xt.toString(t.getOrdinate(r,o)))}return i.append(")"),i.toString()}},Et.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Et.createClosedRing(t,e,4):e.getOrdinate(0,T.X)===e.getOrdinate(n-1,T.X)&&e.getOrdinate(0,T.Y)===e.getOrdinate(n-1,T.Y)?e:Et.createClosedRing(t,e,n+1)},Et.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();Et.copy(e,0,i,0,r);for(var o=r;o0&&Et.reverse(this._points),null}},getCoordinate:function(){return this.isEmpty()?null:this._points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?ut.FALSE:0},isClosed:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},getEndPoint:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},getDimension:function(){return 1},getLength:function(){return Qt.computeLength(this._points)},getNumPoints:function(){return this._points.size()},reverse:function(){var t=this._points.copy();return Et.reverse(t),this.getFactory().createLineString(t)},compareToSameClass:function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t},isCoordinate:function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new Lt(this._points.copy(),this._factory)},interfaces_:function(){return[]},getClass:function(){return Lt}}),Lt.MINIMUM_VALID_SIZE=4,Lt.serialVersionUID=-0x3b229e262367a600,Ko(Mt,ht),Zo(Mt.prototype,{getSortIndex:function(){return q.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ht.prototype.equalsExact.call(this,t,e)}return ht.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},reverse:function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},interfaces_:function(){return[Rt]},getClass:function(){return Tt}}),Zo(At.prototype,{edit:function(t,e){return t instanceof Lt?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof It?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},interfaces_:function(){return[Rt]},getClass:function(){return At}}),Pt.NoOpGeometryOperation=Ot,Pt.CoordinateOperation=Tt,Pt.CoordinateSequenceOperation=At,Zo(Dt.prototype,{setOrdinate:function(t,e,n){switch(e){case T.X:this._coordinates[t].x=n;break;case T.Y:this._coordinates[t].y=n;break;case T.Z:this._coordinates[t].z=n;break;default:throw new r("invalid ordinateIndex")}},size:function(){return this._coordinates.length},getOrdinate:function(t,e){switch(e){case T.X:return this._coordinates[t].x;case T.Y:return this._coordinates[t].y;case T.Z:return this._coordinates[t].z}return o.NaN},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},getCoordinateCopy:function(t){return new g(this._coordinates[t])},getDimension:function(){return this._dimension},getX:function(t){return this._coordinates[t].x},clone:function(){for(var t=new Array(this.size()).fill(null),e=0;e0){var t=new L(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(e=3),e<2?new Dt(t):new Dt(t,e)}},interfaces_:function(){return[F,l]},getClass:function(){return Ft}}),Ft.instance=function(){return Ft.instanceObject},Ft.serialVersionUID=-0x38e49fa6cf6f2e00,Ft.instanceObject=new Ft;var is,rs=Object.defineProperty,os=function(t,e){function n(t){if(!this||this.constructor!==n)return new n(t);this._keys=[],this._values=[],this._itp=[],this.objectOnly=e,t&&qt.call(this,t)}return e||rs(t,"size",{get:jt}),t.constructor=n,n.prototype=t,n}({delete:function(t){return this.has(t)&&(this._keys.splice(is,1),this._values.splice(is,1),this._itp.forEach(function(t){is-1},has:function(t){return kt.call(this,this._keys,t)},get:function(t){return this.has(t)?this._values[is]:void 0},set:function(t,e){return this.has(t)?this._values[is]=e:this._values[this._keys.push(t)-1]=e,this},keys:function(){return Bt(this._itp,this._keys)},values:function(){return Bt(this._itp,this._values)},entries:function(){return Bt(this._itp,this._keys,this._values)},forEach:function(t,e){for(var n=this.entries();;){var i=n.next();if(i.done)break;t.call(e,i.value[1],i.value[0],this)}},clear:function(){(this._keys||0).length=this._values.length=0}}),ss="undefined"!=typeof Map&&Map.prototype.values?Map:os;zt.prototype=new W,zt.prototype.get=function(t){return this.map_.get(t)||null},zt.prototype.put=function(t,e){return this.map_.set(t,e),e},zt.prototype.values=function(){for(var t=new E,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},zt.prototype.entrySet=function(){var t=new K;return this.map_.entries().forEach(function(e){return t.add(e)}),t},zt.prototype.size=function(){return this.map_.size()},Zo(Yt.prototype,{equals:function(t){if(!(t instanceof Yt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},compareTo:function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new M(n).compareTo(new M(i))},getScale:function(){return this._scale},isFloating:function(){return this._modelType===Yt.FLOATING||this._modelType===Yt.FLOATING_SINGLE},getType:function(){return this._modelType},toString:function(){var t="UNKNOWN";return this._modelType===Yt.FLOATING?t="Floating":this._modelType===Yt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Yt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},makePrecise:function(){if("number"==typeof arguments[0]){var t=arguments[0];return o.isNaN(t)?t:this._modelType===Yt.FLOATING_SINGLE?t:this._modelType===Yt.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof g){var e=arguments[0];if(this._modelType===Yt.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},getMaximumSignificantDigits:function(){var t=16;return this._modelType===Yt.FLOATING?t=16:this._modelType===Yt.FLOATING_SINGLE?t=6:this._modelType===Yt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},setScale:function(t){this._scale=Math.abs(t)},interfaces_:function(){return[l,s]},getClass:function(){return Yt}}),Yt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Zo(Xt.prototype,{readResolve:function(){return Xt.nameToTypeMap.get(this._name)},toString:function(){return this._name},interfaces_:function(){return[l]},getClass:function(){return Xt}}),Xt.serialVersionUID=-552860263173159e4,Xt.nameToTypeMap=new zt,Yt.Type=Xt,Yt.serialVersionUID=0x6bee6404e9a25c00,Yt.FIXED=new Xt("FIXED"),Yt.FLOATING=new Xt("FLOATING"),Yt.FLOATING_SINGLE=new Xt("FLOATING SINGLE"),Yt.maximumPreciseValue=9007199254740992,Zo(Vt.prototype,{toGeometry:function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new g(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new g(t.getMinX(),t.getMinY()),new g(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new g(t.getMinX(),t.getMinY()),new g(t.getMinX(),t.getMaxY()),new g(t.getMaxX(),t.getMaxY()),new g(t.getMaxX(),t.getMinY()),new g(t.getMinX(),t.getMinY())]),null)},createLineString:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if($o(arguments[0],T))return new wt(arguments[0],this)}},createMultiLineString:function(){return 0===arguments.length?new ft(null,this):1===arguments.length?new ft(arguments[0],this):void 0},buildGeometry:function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(Vt.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Nt)return this.createMultiPolygon(Vt.toPolygonArray(t));if(a instanceof wt)return this.createMultiLineString(Vt.toLineStringArray(t));if(a instanceof It)return this.createMultiPoint(Vt.toPointArray(t));f.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},createMultiPointFromCoords:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},createPoint:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof g){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if($o(arguments[0],T))return new It(arguments[0],this)}},getCoordinateSequenceFactory:function(){return this._coordinateSequenceFactory},createPolygon:function(){if(0===arguments.length)return new Nt(null,null,this);if(1===arguments.length){if($o(arguments[0],T)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Lt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Nt(arguments[0],arguments[1],this)},getSRID:function(){return this._SRID},createGeometryCollection:function(){return 0===arguments.length?new ht(null,this):1===arguments.length?new ht(arguments[0],this):void 0},createGeometry:function(t){return new Pt(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},getPrecisionModel:function(){return this._precisionModel},createLinearRing:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if($o(arguments[0],T))return new Lt(arguments[0],this)}},createMultiPolygon:function(){return 0===arguments.length?new Mt(null,this):1===arguments.length?new Mt(arguments[0],this):void 0},createMultiPoint:function(){if(0===arguments.length)return new St(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new St(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if($o(arguments[0],T)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),i=0;ithis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},isProper:function(){return this.hasIntersection()&&this._isProper},setPrecisionModel:function(t){this._precisionModel=t},isInteriorIntersection:function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;er?i:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=i>r?s:a)||t.equals(e)||(o=Math.max(s,a))}return f.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},Wt.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=Math.sqrt(i*i+r*r);return f.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},Wt.DONT_INTERSECT=0,Wt.DO_INTERSECT=1,Wt.COLLINEAR=2,Wt.NO_INTERSECTION=0,Wt.POINT_INTERSECTION=1,Wt.COLLINEAR_INTERSECTION=2,Ko(Jt,Wt),Zo(Jt.prototype,{isInSegmentEnvelopes:function(t){var e=new b(this._inputLines[0][0],this._inputLines[0][1]),n=new b(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},computeIntersection:function(){if(3!==arguments.length)return Wt.prototype.computeIntersection.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,b.intersects(e,n,t)&&0===Qt.orientationIndex(e,n,t)&&0===Qt.orientationIndex(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=Wt.POINT_INTERSECTION,null;this._result=Wt.NO_INTERSECTION},normalizeToMinimum:function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},safeHCoordinateIntersection:function(t,e,n,i){var r=null;try{r=D.intersection(t,e,n,i)}catch(o){if(!(o instanceof C))throw o;r=Jt.nearestEndpoint(t,e,n,i)}return r},intersection:function(t,e,n,i){var r=this.intersectionWithNormalization(t,e,n,i);return this.isInSegmentEnvelopes(r)||(r=new g(Jt.nearestEndpoint(t,e,n,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(r),r},smallestInAbsValue:function(t,e,n,i){var r=t,o=Math.abs(r);return Math.abs(e)1e-4&&A.out.println("Distance = "+r.distance(o))},intersectionWithNormalization:function(t,e,n,i){var r=new g(t),o=new g(e),s=new g(n),a=new g(i),u=new g;this.normalizeToEnvCentre(r,o,s,a,u);var l=this.safeHCoordinateIntersection(r,o,s,a);return l.x+=u.x,l.y+=u.y,l},computeCollinearIntersection:function(t,e,n,i){var r=b.intersects(t,e,n),o=b.intersects(t,e,i),s=b.intersects(n,i,t),a=b.intersects(n,i,e);return r&&o?(this._intPt[0]=n,this._intPt[1]=i,Wt.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=t,this._intPt[1]=e,Wt.COLLINEAR_INTERSECTION):r&&s?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||a?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):r&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||s?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):o&&s?(this._intPt[0]=i,this._intPt[1]=t,!i.equals(t)||r||a?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):o&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||r||s?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):Wt.NO_INTERSECTION},normalizeToEnvCentre:function(t,e,n,i,r){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.xi.x?n.x:i.x,f=n.y>i.y?n.y:i.y,g=((o>l?o:l)+(ac?s:c)+(u0&&o>0||r<0&&o<0)return Wt.NO_INTERSECTION;var s=Qt.orientationIndex(n,i,t),a=Qt.orientationIndex(n,i,e);return s>0&&a>0||s<0&&a<0?Wt.NO_INTERSECTION:0===r&&0===o&&0===s&&0===a?this.computeCollinearIntersection(t,e,n,i):(0===r||0===o||0===s||0===a?(this._isProper=!1,t.equals2D(n)||t.equals2D(i)?this._intPt[0]=t:e.equals2D(n)||e.equals2D(i)?this._intPt[0]=e:0===r?this._intPt[0]=new g(n):0===o?this._intPt[0]=new g(i):0===s?this._intPt[0]=new g(t):0===a&&(this._intPt[0]=new g(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,n,i)),Wt.POINT_INTERSECTION)},interfaces_:function(){return[]},getClass:function(){return Jt}}),Jt.nearestEndpoint=function(t,e,n,i){var r=t,o=Qt.distancePointLine(t,n,i),s=Qt.distancePointLine(e,n,i);return s0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(0=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),0=n))return-r;r=-r,t=-t,n=-n}for(;;){if(s=Math.floor(n/t),n-=s*t,(i-=s*e)<0)return-r;if(i>e)return r;if(t>n+n){if(ei+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n)return r;if(s=Math.floor(t/n),t-=s*n,(e-=s*i)<0)return r;if(e>i)return-r;if(n>t+t){if(ie+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},Zo(Kt.prototype,{countSegment:function(t,e){if(t.xi&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var r=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=Zt.signOfDet2x2(r,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a0&&this._crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==N.EXTERIOR},getLocation:function(){return this._isPointOnSegment?N.BOUNDARY:this._crossingCount%2==1?N.INTERIOR:N.EXTERIOR},isOnSegment:function(){return this._isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return Kt}}),Kt.locatePointInRing=function(){if(arguments[0]instanceof g&&$o(arguments[1],T)){for(var t=arguments[0],e=arguments[1],n=new Kt(t),i=new g,r=new g,o=1;o1||a<0||a>1)&&(r=!0)}}else r=!0;return r?S.min(Qt.distancePointLine(t,n,i),Qt.distancePointLine(e,n,i),Qt.distancePointLine(n,t,e),Qt.distancePointLine(i,t,e)):0},Qt.isPointInRing=function(t,e){return Qt.locatePointInRing(t,e)!==N.EXTERIOR},Qt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new g;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;sn.y&&(n=s,i=o)}var a=i;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(n)&&a!==i);var u=i;do{u=(u+1)%e}while(t[u].equals2D(n)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=Qt.computeOrientation(l,n,c);return 0===h?l.x>c.x:h>0},Qt.locatePointInRing=function(t,e){return Kt.locatePointInRing(t,e)},Qt.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(r)*Math.sqrt(i)},Qt.computeOrientation=function(t,e,n){return Qt.orientationIndex(t,e,n)},Qt.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new r("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i=1)return s.distance(u);var h=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},Qt.isOnLine=function(t,e){for(var n=new Jt,i=1;i=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof g){var i=arguments[0];return Qt.orientationIndex(this.p0,this.p1,i)}},toGeometry:function(t){return t.createLineString([this.p0,this.p1])},isVertical:function(){return this.p0.x===this.p1.x},equals:function(t){if(!(t instanceof $t))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},intersection:function(t){var e=new Jt;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},project:function(){if(arguments[0]instanceof g){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new g(t);var e=this.projectionFactor(t),n=new g;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof $t){var i=arguments[0],r=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(r>=1&&o>=1)return null;if(r<=0&&o<=0)return null;var s=this.project(i.p0);r<0&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(i.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new $t(s,a)}},normalize:function(){this.p1.compareTo(this.p0)<0&&this.reverse()},angle:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},getCoordinate:function(t){return 0===t?this.p0:this.p1},distancePerpendicular:function(t){return Qt.distancePointLinePerpendicular(t,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return $t.midPoint(this.p0,this.p1)},projectionFactor:function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;return i<=0?o.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i},closestPoints:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),i=o.MAX_VALUE,r=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);(r=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||o.isNaN(e))&&(e=1),e},toString:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},isHorizontal:function(){return this.p0.y===this.p1.y},distance:function(){if(arguments[0]instanceof $t){var t=arguments[0];return Qt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof g){var e=arguments[0];return Qt.distancePointLine(e,this.p0,this.p1)}},pointAlong:function(t){var e=new g;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},hashCode:function(){var t=java.lang.Double.doubleToLongBits(this.p0.x);t^=31*java.lang.Double.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=java.lang.Double.doubleToLongBits(this.p1.x);return n^=31*java.lang.Double.doubleToLongBits(this.p1.y),e^(Math.trunc(n)^Math.trunc(n>>32))},interfaces_:function(){return[s,l]},getClass:function(){return $t}}),$t.midPoint=function(t,e){return new g((t.x+e.x)/2,(t.y+e.y)/2)},$t.serialVersionUID=0x2d2172135f411c00,Zo(te.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return(te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])||te.isTrue(this._matrix[N.INTERIOR][N.BOUNDARY])||te.isTrue(this._matrix[N.BOUNDARY][N.INTERIOR])||te.isTrue(this._matrix[N.BOUNDARY][N.BOUNDARY]))&&this._matrix[N.EXTERIOR][N.INTERIOR]===ut.FALSE&&this._matrix[N.EXTERIOR][N.BOUNDARY]===ut.FALSE},isCoveredBy:function(){return(te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])||te.isTrue(this._matrix[N.INTERIOR][N.BOUNDARY])||te.isTrue(this._matrix[N.BOUNDARY][N.INTERIOR])||te.isTrue(this._matrix[N.BOUNDARY][N.BOUNDARY]))&&this._matrix[N.INTERIOR][N.EXTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.EXTERIOR]===ut.FALSE},set:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e=0&&e>=0&&this.setAtLeast(t,e,n)},isWithin:function(){return te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&this._matrix[N.INTERIOR][N.EXTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.EXTERIOR]===ut.FALSE},isTouches:function(t,e){return t>e?this.isTouches(e,t):(t===ut.A&&e===ut.A||t===ut.L&&e===ut.L||t===ut.L&&e===ut.A||t===ut.P&&e===ut.A||t===ut.P&&e===ut.L)&&(this._matrix[N.INTERIOR][N.INTERIOR]===ut.FALSE&&(te.isTrue(this._matrix[N.INTERIOR][N.BOUNDARY])||te.isTrue(this._matrix[N.BOUNDARY][N.INTERIOR])||te.isTrue(this._matrix[N.BOUNDARY][N.BOUNDARY])))},isOverlaps:function(t,e){return t===ut.P&&e===ut.P||t===ut.A&&e===ut.A?te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&te.isTrue(this._matrix[N.INTERIOR][N.EXTERIOR])&&te.isTrue(this._matrix[N.EXTERIOR][N.INTERIOR]):t===ut.L&&e===ut.L&&(1===this._matrix[N.INTERIOR][N.INTERIOR]&&te.isTrue(this._matrix[N.INTERIOR][N.EXTERIOR])&&te.isTrue(this._matrix[N.EXTERIOR][N.INTERIOR]))},isEquals:function(t,e){return t===e&&(te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&this._matrix[N.INTERIOR][N.EXTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.EXTERIOR]===ut.FALSE&&this._matrix[N.EXTERIOR][N.INTERIOR]===ut.FALSE&&this._matrix[N.EXTERIOR][N.BOUNDARY]===ut.FALSE)},toString:function(){for(var t=new L("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,ut.toDimensionSymbol(this._matrix[e][n]));return t.toString()},setAll:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this._matrix[e][n]=t},get:function(t,e){return this._matrix[t][e]},transpose:function(){var t=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=t,t=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=t,t=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=t,this},matches:function(t){if(9!==t.length)throw new r("Should be length 9: "+t);for(var e=0;e<3;e++)for(var n=0;n<3;n++)if(!te.matches(this._matrix[e][n],t.charAt(3*e+n)))return!1;return!0},add:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))},isDisjoint:function(){return this._matrix[N.INTERIOR][N.INTERIOR]===ut.FALSE&&this._matrix[N.INTERIOR][N.BOUNDARY]===ut.FALSE&&this._matrix[N.BOUNDARY][N.INTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.BOUNDARY]===ut.FALSE},isCrosses:function(t,e){return t===ut.P&&e===ut.L||t===ut.P&&e===ut.A||t===ut.L&&e===ut.A?te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&te.isTrue(this._matrix[N.INTERIOR][N.EXTERIOR]):t===ut.L&&e===ut.P||t===ut.A&&e===ut.P||t===ut.A&&e===ut.L?te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&te.isTrue(this._matrix[N.EXTERIOR][N.INTERIOR]):t===ut.L&&e===ut.L&&0===this._matrix[N.INTERIOR][N.INTERIOR]},interfaces_:function(){return[a]},getClass:function(){return te}}),te.matches=function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],e=arguments[1];return e===ut.SYM_DONTCARE||(e===ut.SYM_TRUE&&(t>=0||t===ut.TRUE)||(e===ut.SYM_FALSE&&t===ut.FALSE||(e===ut.SYM_P&&t===ut.P||(e===ut.SYM_L&&t===ut.L||e===ut.SYM_A&&t===ut.A))))}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var n=arguments[0],i=arguments[1];return new te(n).matches(i)}},te.isTrue=function(t){return t>=0||t===ut.TRUE},Zo(ee.prototype,{addPoint:function(t){this._ptCount+=1,this._ptCentSum.x+=t.x,this._ptCentSum.y+=t.y},setBasePoint:function(t){null===this._areaBasePt&&(this._areaBasePt=t)},addLineSegments:function(t){for(var e=0,n=0;n0&&this.addPoint(t[0])},addHole:function(t){for(var e=Qt.isCCW(t),n=0;n0)t.x=this._cg3.x/3/this._areasum2,t.y=this._cg3.y/3/this._areasum2;else if(this._totalLength>0)t.x=this._lineCentSum.x/this._totalLength,t.y=this._lineCentSum.y/this._totalLength;else{if(!(this._ptCount>0))return null;t.x=this._ptCentSum.x/this._ptCount,t.y=this._ptCentSum.y/this._ptCount}return t},addShell:function(t){t.length>0&&this.setBasePoint(t[0]);for(var e=!Qt.isCCW(t),n=0;n=this.size())throw new IndexOutOfBoundsException;return this.array_[t]},ie.prototype.push=function(t){return this.array_.push(t),t},ie.prototype.pop=function(t){if(0===this.array_.length)throw new ne;return this.array_.pop()},ie.prototype.peek=function(){if(0===this.array_.length)throw new ne;return this.array_[this.array_.length-1]},ie.prototype.empty=function(){return 0===this.array_.length},ie.prototype.isEmpty=function(){return this.empty()},ie.prototype.search=function(t){return this.array_.indexOf(t)},ie.prototype.size=function(){return this.array_.length},ie.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e50&&(t=this.reduce(this._inputPts));var e=this.preSort(t),n=this.grahamScan(e),i=this.toCoordinateArray(n);return this.lineOrPolygon(i)},padArray3:function(t){for(var e=new Array(3).fill(null),n=0;ne[2].y&&(e[2]=t[i]),t[i].x+t[i].y>e[3].x+e[3].y&&(e[3]=t[i]),t[i].x>e[4].x&&(e[4]=t[i]),t[i].x-t[i].y>e[5].x-e[5].y&&(e[5]=t[i]),t[i].y0;)e=n.pop();e=n.push(e),e=n.push(t[i])}return e=n.push(t[0]),n},interfaces_:function(){return[]},getClass:function(){return oe}}),oe.extractCoordinates=function(t){var e=new re;return t.apply(e),e.getCoordinates()},Zo(se.prototype,{compare:function(t,e){var n=t,i=e;return se.polarCompare(this._origin,n,i)},interfaces_:function(){return[u]},getClass:function(){return se}}),se.polarCompare=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-t.x,s=n.y-t.y,a=Qt.computeOrientation(t,e,n);if(a===Qt.COUNTERCLOCKWISE)return 1;if(a===Qt.CLOCKWISE)return-1;var u=i*i+r*r,l=o*o+s*s;return ul?1:0},oe.RadialComparator=se,Zo(ae.prototype,{transformPoint:function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},transformPolygon:function(t,e){var n=!0,i=this.transformLinearRing(t.getExteriorRing(),t);null!==i&&i instanceof Lt&&!i.isEmpty()||(n=!1);for(var r=new E,o=0;o0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},interfaces_:function(){return[]},getClass:function(){return ae}}),Zo(ue.prototype,{snapVertices:function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i=0&&t.add(o+1,new g(r),!1)}},findSegmentIndexToSnap:function(t,e){for(var n=o.MAX_VALUE,i=-1,r=0;re&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(le.computeOverlaySnapTolerance(r),le.computeOverlaySnapTolerance(o))}},le.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*le.SNAP_PRECISION_FACTOR},le.snapToSelf=function(t,e,n){return new le(t).snapToSelf(e,n)},le.SNAP_PRECISION_FACTOR=1e-9,Ko(ce,ae),Zo(ce.prototype,{snapLine:function(t,e){var n=new ue(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(i)},interfaces_:function(){return[]},getClass:function(){return ce}}),Zo(he.prototype,{getCommon:function(){return o.longBitsToDouble(this._commonBits)},add:function(t){var e=o.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=he.signExpBits(this._commonBits),this._isFirst=!1,null):he.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=he.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=he.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var t=arguments[0],e=o.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+Long.toBinaryString(t),i=n.substring(n.length-64);return i.substring(0,1)+" "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]"}},interfaces_:function(){return[]},getClass:function(){return he}}),he.getBit=function(t,e){return 0!=(t&1<>52},he.zeroLowerBits=function(t,e){return t&~((1<=0;i--){if(he.getBit(t,i)!==he.getBit(e,i))return n;n++}return 52},Zo(fe.prototype,{addCommonBits:function(t){var e=new de(this._commonCoord);t.apply(e),t.geometryChanged()},removeCommonBits:function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new g(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new de(e);return t.apply(n),t.geometryChanged(),t},getCommonCoordinate:function(){return this._commonCoord},add:function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},interfaces_:function(){return[]},getClass:function(){return fe}}),Zo(ge.prototype,{filter:function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},getCommonCoordinate:function(){return new g(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},interfaces_:function(){return[k]},getClass:function(){return ge}}),Zo(de.prototype,{filter:function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},isDone:function(){return!1},isGeometryChanged:function(){return!0},interfaces_:function(){return[ct]},getClass:function(){return de}}),fe.CommonCoordinateFilter=ge,fe.Translater=de,Zo(pe.prototype,{next:function(){if(this._atStart)return this._atStart=!1,pe.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new y;var t=this._parent.getGeometryN(this._index++);return t instanceof ht?(this._subcollectionIterator=new pe(t),this._subcollectionIterator.next()):t},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},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)},interfaces_:function(){return[p]},getClass:function(){return pe}}),pe.isAtomic=function(t){return!(t instanceof ht)},Zo(_e.prototype,{locateInternal:function(){if(arguments[0]instanceof g&&arguments[1]instanceof Nt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return N.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===N.EXTERIOR)return N.EXTERIOR;if(i===N.BOUNDARY)return N.BOUNDARY;for(var r=0;r0||this._isIn?N.INTERIOR:N.EXTERIOR)},interfaces_:function(){return[]},getClass:function(){return _e}}),Zo(ve.prototype,{interfaces_:function(){return[]},getClass:function(){return ve}}),ve.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new r("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}if(arguments[0]instanceof g&&arguments[1]instanceof g){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(0===a&&0===u)throw new r("Cannot compute the octant for two identical points "+o);return ve.octant(a,u)}},Zo(me.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(t){},isClosed:function(){},setData:function(t){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return me}}),Zo(ye.prototype,{getCoordinates:function(){return this._pts},size:function(){return this._pts.length},getCoordinate:function(t){return this._pts[t]},isClosed:function(){return this._pts[0].equals(this._pts[this._pts.length-1])},getSegmentOctant:function(t){return t===this._pts.length-1?-1:ve.octant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this._data=t},getData:function(){return this._data},toString:function(){return Ht.toLineString(new Dt(this._pts))},interfaces_:function(){return[me]},getClass:function(){return ye}}),Zo(xe.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return xe}}),Zo(Ee.prototype,{getItem:function(){return this._item},getBounds:function(){return this._bounds},interfaces_:function(){return[xe,l]},getClass:function(){return Ee}}),Zo(we.prototype,{poll:function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},size:function(){return this._size},reorder:function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},clear:function(){this._size=0,this._items.clear()},isEmpty:function(){return 0===this._size},add:function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},interfaces_:function(){return[]},getClass:function(){return we}}),Zo(be.prototype,{visitItem:function(t){},interfaces_:function(){return[]},getClass:function(){return be}}),Zo(Ie.prototype,{insert:function(t,e){},remove:function(t,e){},query:function(){},interfaces_:function(){return[]},getClass:function(){return Ie}}),Zo(Ce.prototype,{getLevel:function(){return this._level},size:function(){return this._childBoundables.size()},getChildBoundables:function(){return this._childBoundables},addChildBoundable:function(t){f.isTrue(null===this._bounds),this._childBoundables.add(t)},isEmpty:function(){return this._childBoundables.isEmpty()},getBounds:function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},interfaces_:function(){return[xe,l]},getClass:function(){return Ce}}),Ce.serialVersionUID=0x5a1e55ec41369800;var cs={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return cs.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?at.sort(n,e):at.sort(n);for(var i=t.iterator(),r=0,o=n.length;rNe.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new r("neither boundable is composite")},isLeaves:function(){return!(Ne.isComposite(this._boundable1)||Ne.isComposite(this._boundable2))},compareTo:function(t){var e=t;return this._distancee._distance?1:0},expand:function(t,e,n,i){for(var r=t.getChildBoundables().iterator();r.hasNext();){var o=new Ne(r.next(),e,this._itemDistance);o.getDistance()-2),i.getLevel()===n)return r.add(i),null;for(var o=i.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Ce?this.boundablesAtLevel(n,s,r):(f.isTrue(s instanceof Ee),-1===n&&r.add(s))}return null}},query:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new E;return this.isEmpty()?e:(this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e)}if(2===arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i)}else if(3===arguments.length)if($o(arguments[2],be)&&arguments[0]instanceof Object&&arguments[1]instanceof Ce)for(var r=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;ut&&(t=i)}}return t+1}},createParentBoundables:function(t,e){f.isTrue(!t.isEmpty());var n=new E;n.add(this.createNode(e));var i=new E(t);cs.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var o=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},isEmpty:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},interfaces_:function(){return[l]},getClass:function(){return Se}}),Se.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new E,i=0;i0;){var c=l.poll(),h=c.getDistance();if(h>=a)break;c.isLeaves()?(a=h,u=c):c.expandToQueue(l,a)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],g=arguments[1],d=arguments[2],p=new Ee(f,g),e=new Ne(this.getRoot(),p,d);return this.nearestNeighbour(e)[0]}},interfaces_:function(){return[Ie,l]},getClass:function(){return Me}}),Me.centreX=function(t){return Me.avg(t.getMinX(),t.getMaxX())},Me.avg=function(t,e){return(t+e)/2},Me.centreY=function(t){return Me.avg(t.getMinY(),t.getMaxY())},Ko(Pe,Ce),Zo(Pe.prototype,{computeBounds:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new b(n.getBounds()):t.expandToInclude(n.getBounds())}return t},interfaces_:function(){return[]},getClass:function(){return Pe}}),Me.STRtreeNode=Pe,Me.serialVersionUID=0x39920f7d5f261e0,Me.xComparator={interfaces_:function(){return[u]},compare:function(t,e){return Se.compareDoubles(Me.centreX(t.getBounds()),Me.centreX(e.getBounds()))}},Me.yComparator={interfaces_:function(){return[u]},compare:function(t,e){return Se.compareDoubles(Me.centreY(t.getBounds()),Me.centreY(e.getBounds()))}},Me.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(t,e){return t.intersects(e)}},Me.DEFAULT_NODE_CAPACITY=10,Zo(Re.prototype,{interfaces_:function(){return[]},getClass:function(){return Re}}),Re.relativeSign=function(t,e){return te?1:0},Re.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=Re.relativeSign(e.x,n.x),r=Re.relativeSign(e.y,n.y);switch(t){case 0:return Re.compareValue(i,r);case 1:return Re.compareValue(r,i);case 2:return Re.compareValue(r,-i);case 3:return Re.compareValue(-i,r);case 4:return Re.compareValue(-i,-r);case 5:return Re.compareValue(-r,-i);case 6:return Re.compareValue(-r,i);case 7:return Re.compareValue(i,-r)}return f.shouldNeverReachHere("invalid octant value"),0},Re.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0},Zo(Oe.prototype,{getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},compareTo:function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Re.compare(this._segmentOctant,this.coord,e.coord)},isEndPoint:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},isInterior:function(){return this._isInterior},interfaces_:function(){return[s]},getClass:function(){return Oe}}),Zo(Te.prototype,{getSplitCoordinates:function(){var t=new w;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},addCollapsedNodes:function(){var t=new E;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},findCollapsesFromExistingVertices:function(t){for(var e=0;ee?t:e)?3:n},ke.isInHalfPlane=function(t,e){return e===ke.SE?t===ke.SE||t===ke.SW:t===e||t===e+1},ke.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new r("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ke.NE:ke.SE:e>=0?ke.NW:ke.SW}if(arguments[0]instanceof g&&arguments[1]instanceof g){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new r("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?ke.NE:ke.SE:i.y>=n.y?ke.NW:ke.SW}},ke.NE=0,ke.NW=1,ke.SW=2,ke.SE=3,Zo(Be.prototype,{interfaces_:function(){return[]},getClass:function(){return Be}}),Be.getChainStartIndices=function(t){var e=0,n=new E;n.add(new M(e));do{var i=Be.findChainEnd(t,e);n.add(new M(i)),e=i}while(e=t.length-1)return t.length-1;for(var i=ke.quadrant(t[n],t[n+1]),r=e+1;rn.getId()&&(n.computeOverlaps(r,t),this._nOverlaps++),this._segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return Ye}}),Ko(Xe,Ge),Zo(Xe.prototype,{overlap:function(){if(4!==arguments.length)return Ge.prototype.overlap.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3],r=t.getContext(),o=n.getContext();this._si.processIntersections(r,e,o,i)},interfaces_:function(){return[]},getClass:function(){return Xe}}),Ye.SegmentOverlapAction=Xe,Ko(Ve,c),Zo(Ve.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Ve}}),Ve.msgWithCoord=function(t,e){return null!==e?t+" [ "+e+" ]":t},Zo(Ue.prototype,{processIntersections:function(t,e,n,i){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return Ue}}),Zo(He.prototype,{getInteriorIntersection:function(){return this._interiorIntersection},setCheckEndSegmentsOnly:function(t){this._isCheckEndSegmentsOnly=t},getIntersectionSegments:function(){return this._intSegments},count:function(){return this._intersectionCount},getIntersections:function(){return this._intersections},setFindAllIntersections:function(t){this._findAllIntersections=t},setKeepIntersections:function(t){this._keepIntersections=t},processIntersections:function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly&&!(this.isEndSegment(t,e)||this.isEndSegment(n,i)))return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=r,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},isEndSegment:function(t,e){return 0===e||e>=t.size()-2},hasIntersection:function(){return null!==this._interiorIntersection},isDone:function(){return!this._findAllIntersections&&null!==this._interiorIntersection},interfaces_:function(){return[Ue]},getClass:function(){return He}}),He.createAllIntersectionsFinder=function(t){var e=new He(t);return e.setFindAllIntersections(!0),e},He.createAnyIntersectionFinder=function(t){return new He(t)},He.createIntersectionCounter=function(t){var e=new He(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},Zo(We.prototype,{execute:function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},getIntersections:function(){return this._segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(t){this._findAllIntersections=t},checkInteriorIntersections:function(){this._isValid=!0,this._segInt=new He(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Ye;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},checkValid:function(){if(this.execute(),!this._isValid)throw new Ve(this.getErrorMessage(),this._segInt.getInteriorIntersection())},getErrorMessage:function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ht.toLineString(t[0],t[1])+" and "+Ht.toLineString(t[2],t[3])},interfaces_:function(){return[]},getClass:function(){return We}}),We.computeIntersections=function(t){var e=new We(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},Zo(Je.prototype,{checkValid:function(){this._nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return Je}}),Je.toSegmentStrings=function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next();e.add(new ye(i.getCoordinates(),i))}return e},Je.checkValid=function(t){new Je(t).checkValid()},Zo(Ze.prototype,{map:function(t){for(var e=new E,n=0;nthis.location.length){var e=new Array(3).fill(null);e[Ke.ON]=this.location[Ke.ON],e[Ke.LEFT]=N.NONE,e[Ke.RIGHT]=N.NONE,this.location=e}for(var n=0;n1&&t.append(N.toLocationSymbol(this.location[Ke.LEFT])),t.append(N.toLocationSymbol(this.location[Ke.ON])),this.location.length>1&&t.append(N.toLocationSymbol(this.location[Ke.RIGHT])),t.toString()},setLocations:function(t,e,n){this.location[Ke.ON]=t,this.location[Ke.LEFT]=e,this.location[Ke.RIGHT]=n},get:function(t){return t1},isAnyNull:function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},addPoints:function(t,e,n){var i=t.getCoordinates();if(e){r=1;n&&(r=0);for(o=r;o=0;o--)this._pts.add(i[o])}},isHole:function(){return this._isHole},setInResult:function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},containsPoint:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Qt.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},addHole:function(t){this._holes.add(t)},isShell:function(){return null===this._shell},getLabel:function(){return this._label},getEdges:function(){return this._edges},getMaxNodeDegree:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},getShell:function(){return this._shell},mergeLabel:function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=e.getLocation(n,Ke.RIGHT);if(i===N.NONE)return null;if(this._label.getLocation(n)===N.NONE)return this._label.setLocation(n,i),null}},setShell:function(t){this._shell=t,null!==t&&t.addHole(this)},toPolygon:function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return rn}}),Ko(on,rn),Zo(on.prototype,{isIncidentEdgeInResult:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},isIsolated:function(){return 1===this._label.getGeometryCount()},getCoordinate:function(){return this._coord},print:function(t){t.println("node "+this._coord+" lbl: "+this._label)},computeIM:function(t){},computeMergedLocation:function(t,e){var n=N.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==N.BOUNDARY&&(n=i)}return n},setLabel:function(){if(2!==arguments.length)return rn.prototype.setLabel.apply(this,arguments);var t=arguments[0],e=arguments[1];null===this._label?this._label=new $e(t,e):this._label.setLocation(t,e)},getEdges:function(){return this._edges},mergeLabel:function(){if(arguments[0]instanceof on){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof $e)for(var e=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(e,n);this._label.getLocation(n)===N.NONE&&this._label.setLocation(n,i)}},add:function(t){this._edges.insert(t),t.setNode(this)},setLabelBoundary:function(t){if(null===this._label)return null;var e=N.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case N.BOUNDARY:n=N.INTERIOR;break;case N.INTERIOR:default:n=N.BOUNDARY}this._label.setLocation(t,n)},interfaces_:function(){return[]},getClass:function(){return on}}),Zo(sn.prototype,{find:function(t){return this.nodeMap.get(t)},addNode:function(){if(arguments[0]instanceof g){var t=arguments[0];return null===(n=this.nodeMap.get(t))&&(n=this.nodeFact.createNode(t),this.nodeMap.put(t,n)),n}if(arguments[0]instanceof on){var e=arguments[0],n=this.nodeMap.get(e.getCoordinate());return null===n?(this.nodeMap.put(e.getCoordinate(),e),e):(n.mergeLabel(e),n)}},print:function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},iterator:function(){return this.nodeMap.values().iterator()},values:function(){return this.nodeMap.values()},getBoundaryNodes:function(t){for(var e=new E,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===N.BOUNDARY&&e.add(i)}return e},add:function(t){var e=t.getCoordinate();this.addNode(e).add(t)},interfaces_:function(){return[]},getClass:function(){return sn}}),Zo(an.prototype,{compareDirection:function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else i.add(o)}return i},containsPoint:function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},buildMaximalEdgeRings:function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new nn(i,this._geometryFactory);e.add(r),r.setInResult()}}return e},placePolygonHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},getPolygons:function(){return this.computePolygons(this._shellList)},findEdgeRingContaining:function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(i)&&Qt.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u)}return o},findShell:function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return f.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];cn.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new E,o=this.buildMinimalEdgeRings(i,this._shellList,r);this.sortShellsAndHoles(o,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},interfaces_:function(){return[]},getClass:function(){return hn}}),Zo(fn.prototype,{collectLines:function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},labelIsolatedLine:function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},build:function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},collectLineEdge:function(t,e,n){var i=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Xn.isResultOfOp(i,e)||r.isCovered()||(n.add(r),t.setVisitedEdge(!0)))},findCoveredLineEdges:function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getEdge();if(n.isLineEdge()&&!i.isCoveredSet()){var r=this._op.isCoveredByA(n.getCoordinate());i.setCovered(r)}}},labelIsolatedLines:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},buildLines:function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),i=(n.getLabel(),this._geometryFactory.createLineString(n.getCoordinates()));this._resultLineList.add(i),n.setInResult(!0)}},collectBoundaryTouchEdge:function(t,e,n){var i=t.getLabel();return t.isLineEdge()?null:t.isVisited()?null:t.isInteriorAreaEdge()?null:t.getEdge().isInResult()?null:(f.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Xn.isResultOfOp(i,e)&&e===Xn.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return fn}}),Zo(gn.prototype,{filterCoveredNodeToPoint:function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},extractNonCoveredResultNodes:function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!n.isInResult()&&(!n.isIncidentEdgeInResult()&&(0===n.getEdges().getDegree()||t===Xn.INTERSECTION))){var i=n.getLabel();Xn.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},build:function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},interfaces_:function(){return[]},getClass:function(){return gn}}),Zo(dn.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return dn}}),Zo(pn.prototype,{locate:function(t){return pn.locate(t,this._geom)},interfaces_:function(){return[dn]},getClass:function(){return pn}}),pn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Qt.isPointInRing(t,e.getCoordinates())},pn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!pn.isPointInRing(t,n))return!1;for(var i=0;i=0;n--){var i=this._edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},computeDepths:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=(t.getLabel(),t.getDepth(Ke.LEFT)),i=t.getDepth(Ke.RIGHT),r=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new Ve("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=o;u=0;r--){var o=this._resultAreaEdgeList.get(r),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),i){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),i=this._SCANNING_FOR_INCOMING}}i===this._LINKING_TO_OUTGOING&&(f.isTrue(null!==e,"found null for first outgoing dirEdge"),f.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},getOutgoingDegree:function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)(i=e.next()).isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],t=0,e=this.iterator();e.hasNext();){var i=e.next();i.getEdgeRing()===n&&t++}return t}},getLabel:function(){return this._label},findCoveredLineEdges:function(){for(var t=N.NONE,e=this.iterator();e.hasNext();){r=(i=e.next()).getSym();if(!i.isLineEdge()){if(i.isInResult()){t=N.INTERIOR;break}if(r.isInResult()){t=N.EXTERIOR;break}}}if(t===N.NONE)return null;for(var n=t,e=this.iterator();e.hasNext();){var i=e.next(),r=i.getSym();i.isLineEdge()?i.getEdge().setCovered(n===N.INTERIOR):(i.isInResult()&&(n=N.EXTERIOR),r.isInResult()&&(n=N.INTERIOR))}},computeLabelling:function(t){_n.prototype.computeLabelling.call(this,t),this._label=new $e(N.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(),i=0;i<2;i++){var r=n.getLocation(i);r!==N.INTERIOR&&r!==N.BOUNDARY||this._label.setLocation(i,N.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return vn}}),Ko(mn,ln),Zo(mn.prototype,{createNode:function(t){return new on(t,new vn)},interfaces_:function(){return[]},getClass:function(){return mn}}),Zo(yn.prototype,{computeIntersections:function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},interfaces_:function(){return[]},getClass:function(){return yn}}),Zo(xn.prototype,{isDelete:function(){return this._eventType===xn.DELETE},setDeleteEventIndex:function(t){this._deleteEventIndex=t},getObject:function(){return this._obj},compareTo:function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},getInsertEvent:function(){return this._insertEvent},isInsert:function(){return this._eventType===xn.INSERT},isSameLabel:function(t){return null!==this._label&&this._label===t._label},getDeleteEventIndex:function(){return this._deleteEventIndex},interfaces_:function(){return[s]},getClass:function(){return xn}}),xn.INSERT=1,xn.DELETE=2,Zo(En.prototype,{interfaces_:function(){return[]},getClass:function(){return En}}),Zo(wn.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(wn.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this._properIntersectionPoint},setIsDoneIfProperInt:function(t){this._isDoneWhenProperInt=t},hasProperInteriorIntersection:function(){return this._hasProperInterior},isBoundaryPointInternal:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next().getCoordinate();if(t.isIntersection(i))return!0}return!1},hasProperIntersection:function(){return this._hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},setBoundaryNodes:function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},addIntersections:function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,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))))},interfaces_:function(){return[]},getClass:function(){return wn}}),wn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},Ko(bn,En),Zo(bn.prototype,{prepareEvents:function(){cs.sort(this.events);for(var t=0;te||this._maxo?1:0},interfaces_:function(){return[u]},getClass:function(){return Cn}}),In.NodeComparator=Cn,Ko(Nn,In),Zo(Nn.prototype,{query:function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},interfaces_:function(){return[]},getClass:function(){return Nn}}),Ko(Sn,In),Zo(Sn.prototype,{buildExtent:function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},query:function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},interfaces_:function(){return[]},getClass:function(){return Sn}}),Zo(Ln.prototype,{buildTree:function(){cs.sort(this._leaves,new IntervalRTreeNode.NodeComparator);for(var t=this._leaves,e=null,n=new E;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},insert:function(t,e,n){if(null!==this._root)throw new IllegalStateException("Index cannot be added to once it has been queried");this._leaves.add(new Nn(t,e,n))},query:function(t,e,n){this.init(),this._root.query(t,e,n)},buildRoot:function(){if(null!==this._root)return null;this._root=this.buildTree()},printNode:function(t){A.out.println(Ht.toLineString(new g(t._min,this._level),new g(t._max,this._level)))},init:function(){if(null!==this._root)return null;this.buildRoot()},buildLevel:function(t,e){this._level++,e.clear();for(var n=0;n0||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new g(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new kn(o,new $e(this.edge._label))},add:function(t,e,n){var i=new An(t,e,n),r=this._nodeMap.get(i);return null!==r?r:(this._nodeMap.put(i,i),i)},isIntersection:function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},interfaces_:function(){return[]},getClass:function(){return Dn}}),Zo(Fn.prototype,{getChainStartIndices:function(t){var e=0,n=new E;n.add(new M(e));do{var i=this.findChainEnd(t,e);n.add(new M(i)),e=i}while(en?e:n},getMinX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(i=1),this._depth[t][n]=i}}},getDelta:function(t){return this._depth[t][Ke.RIGHT]-this._depth[t][Ke.LEFT]},getLocation:function(t,e){return this._depth[t][e]<=0?N.EXTERIOR:N.INTERIOR},toString:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},add:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var i=t.getLocation(e,n);i!==N.EXTERIOR&&i!==N.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=qn.depthAtLocation(i):this._depth[e][n]+=qn.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],o=arguments[1];arguments[2]===N.INTERIOR&&this._depth[r][o]++}},interfaces_:function(){return[]},getClass:function(){return qn}}),qn.depthAtLocation=function(t){return t===N.EXTERIOR?0:t===N.INTERIOR?1:qn.NULL_VALUE},qn.NULL_VALUE=-1,Ko(kn,rn),Zo(kn.prototype,{getDepth:function(){return this._depth},getCollapsedEdge:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new kn(t,$e.toLineLabel(this._label))},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(t){this._isIsolated=t},setName:function(t){this._name=t},equals:function(t){if(!(t instanceof kn))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,i=!0,r=this.pts.length,o=0;o0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},print:function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},computeIM:function(t){kn.updateIM(this._label,t)},isCollapsed:function(){return!!this._label.isArea()&&(3===this.pts.length&&!!this.pts[0].equals(this.pts[2]))},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getMaximumSegmentIndex:function(){return this.pts.length-1},getDepthDelta:function(){return this._depthDelta},getNumPoints:function(){return this.pts.length},printReverse:function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},getMonotoneChainEdge:function(){return null===this._mce&&(this._mce=new Gn(this)),this._mce},getEnvelope:function(){if(null===this._env){this._env=new b;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},isPointwiseEqual:function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},getInvalidPoint:function(){return this._invalidPoint},getBoundaryPoints:function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},getBoundaryNodes:function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},addSelfIntersectionNode:function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===N.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},addPolygonRing:function(t,e,n){if(t.isEmpty())return null;var i=V.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var r=e,o=n;Qt.isCCW(i)&&(r=n,o=e);var s=new kn(i,new $e(this._argIndex,N.BOUNDARY,r,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,i[0],N.BOUNDARY)},insertPoint:function(t,e,n){var i=this._nodes.addNode(e),r=i.getLabel();null===r?i._label=new $e(t,n):r.setLocation(t,n)},createEdgeSetIntersector:function(){return new bn},addSelfIntersectionNodes:function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,i)}},add:function(){if(1!==arguments.length)return cn.prototype.add.apply(this,arguments);var t=arguments[0];if(t.isEmpty())return null;if(t instanceof Mt&&(this._useBoundaryDeterminationRule=!1),t instanceof Nt)this.addPolygon(t);else if(t instanceof wt)this.addLineString(t);else if(t instanceof It)this.addPoint(t);else if(t instanceof St)this.addCollection(t);else if(t instanceof ft)this.addCollection(t);else if(t instanceof Mt)this.addCollection(t);else{if(!(t instanceof ht))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},addCollection:function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new Rn(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},findEdge:function(){if(1===arguments.length){var t=arguments[0];return this._lineEdgeMap.get(t)}return cn.prototype.findEdge.apply(this,arguments)},interfaces_:function(){return[]},getClass:function(){return Bn}}),Bn.determineBoundary=function(t,e){return t.isInBoundary(e)?N.BOUNDARY:N.INTERIOR},Zo(jn.prototype,{getArgGeometry:function(t){return this._arg[t].getGeometry()},setComputationPrecision:function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},interfaces_:function(){return[]},getClass:function(){return jn}}),Zo(zn.prototype,{compareTo:function(t){var e=t;return zn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},interfaces_:function(){return[s]},getClass:function(){return zn}}),zn.orientation=function(t){return 1===V.increasingDirection(t)},zn.compareOriented=function(t,e,n,i){for(var r=e?1:-1,o=i?1:-1,s=e?t.length:-1,a=i?n.length:-1,u=e?0:t.length-1,l=i?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=r)===s,f=(l+=o)===a;if(h&&!f)return-1;if(!h&&f)return 1;if(h&&f)return 0}},Zo(Yn.prototype,{print:function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(") ")},addAll:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},findEdgeIndex:function(t){for(var e=0;ethis._maxWidth)&&(this._interiorPoint=e,this._maxWidth=n)},getInteriorPoint:function(){return this._interiorPoint},widestGeometry:function(){if(arguments[0]instanceof ht){var t=arguments[0];if(t.isEmpty())return t;for(var e=t.getGeometryN(0),n=1;ne.getEnvelopeInternal().getWidth()&&(e=t.getGeometryN(n));return e}if(arguments[0]instanceof q){var i=arguments[0];return i instanceof ht?this.widestGeometry(i):i}},horizontalBisector:function(t){var e=t.getEnvelopeInternal(),n=Wn.getBisectorY(t);return this._factory.createLineString([new g(e.getMinX(),n),new g(e.getMaxX(),n)])},add:function(t){if(t instanceof Nt)this.addPolygon(t);else if(t instanceof ht)for(var e=t,n=0;nthis._loY&&(this._loY=t):t>this._centreY&&tt&&(t=n)}return t+1},nodeSize:function(){for(var t=0,e=0;e<2;e++)null!==this._subnode[e]&&(t+=this._subnode[e].nodeSize());return t+1},add:function(t){this._items.add(t)},interfaces_:function(){return[]},getClass:function(){return Qn}}),Qn.getSubnodeIndex=function(t,e){var n=-1;return t.min>=e&&(n=1),t.max<=e&&(n=0),n},Zo($n.prototype,{expandToInclude:function(t){t.max>this.max&&(this.max=t.max),t.minn||this.max=this.min&&e<=this.max}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return n>=this.min&&i<=this.max}},init:function(t,e){this.min=t,this.max=e,t>e&&(this.min=e,this.max=t)},getMax:function(){return this.max},interfaces_:function(){return[]},getClass:function(){return $n}}),ti.exponent=function(t){return ei(64,t)-1023},ti.powerOf2=function(t){return Math.pow(2,t)},Zo(ni.prototype,{getInterval:function(){return this._interval},getLevel:function(){return this._level},computeKey:function(t){for(this._level=ni.computeLevel(t),this._interval=new $n,this.computeInterval(this._level,t);!this._interval.contains(t);)this._level+=1,this.computeInterval(this._level,t)},computeInterval:function(t,e){var n=ti.powerOf2(t);this._pt=Math.floor(e.getMin()/n)*n,this._interval.init(this._pt,this._pt+n)},getPoint:function(){return this._pt},interfaces_:function(){return[]},getClass:function(){return ni}}),ni.computeLevel=function(t){var e=t.getWidth();return ti.exponent(e)+1},Ko(ii,Qn),Zo(ii.prototype,{getInterval:function(){return this._interval},find:function(t){var e=Qn.getSubnodeIndex(t,this._centre);return-1===e?this:null!==this._subnode[e]?this._subnode[e].find(t):this},insert:function(t){f.isTrue(null===this._interval||this._interval.contains(t._interval));var e=Qn.getSubnodeIndex(t._interval,this._centre);if(t._level===this._level-1)this._subnode[e]=t;else{var n=this.createSubnode(e);n.insert(t),this._subnode[e]=n}},isSearchMatch:function(t){return t.overlaps(this._interval)},getSubnode:function(t){return null===this._subnode[t]&&(this._subnode[t]=this.createSubnode(t)),this._subnode[t]},getNode:function(t){var e=Qn.getSubnodeIndex(t,this._centre);return-1!==e?this.getSubnode(e).getNode(t):this},createSubnode:function(t){var e=0,n=0;switch(t){case 0:e=this._interval.getMin(),n=this._centre;break;case 1:e=this._centre,n=this._interval.getMax()}return new ii(new $n(e,n),this._level-1)},interfaces_:function(){return[]},getClass:function(){return ii}}),ii.createNode=function(t){var e=new ni(t);return new ii(e.getInterval(),e.getLevel())},ii.createExpanded=function(t,e){var n=new $n(e);null!==t&&n.expandToInclude(t._interval);var i=ii.createNode(n);return null!==t&&i.insert(t),i},Zo(ri.prototype,{interfaces_:function(){return[]},getClass:function(){return ri}}),ri.isZeroWidth=function(t,e){var n=e-t;if(0===n)return!0;var i=Math.max(Math.abs(t),Math.abs(e));return ti.exponent(n/i)<=ri.MIN_BINARY_EXPONENT},ri.MIN_BINARY_EXPONENT=-50,Ko(oi,Qn),Zo(oi.prototype,{insert:function(t,e){var n=Qn.getSubnodeIndex(t,oi.origin);if(-1===n)return this.add(e),null;var i=this._subnode[n];if(null===i||!i.getInterval().contains(t)){var r=ii.createExpanded(i,t);this._subnode[n]=r}this.insertContained(this._subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){f.isTrue(t.getInterval().contains(e));(ri.isZeroWidth(e.getMin(),e.getMax())?t.find(e):t.getNode(e)).add(n)},interfaces_:function(){return[]},getClass:function(){return oi}}),oi.origin=0,Zo(si.prototype,{size:function(){return null!==this._root?this._root.size():0},insert:function(t,e){this.collectStats(t);var n=si.ensureExtent(t,this._minExtent);this._root.insert(n,e)},query:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];return this.query(new $n(t,t))}if(arguments[0]instanceof $n){var e=arguments[0],n=new E;return this.query(e,n),n}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this._root.addAllItemsFromOverlapping(i,r)}},iterator:function(){var t=new E;return this._root.addAllItems(t),t.iterator()},remove:function(t,e){var n=si.ensureExtent(t,this._minExtent);return this._root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e0&&(this._minExtent=e)},depth:function(){return null!==this._root?this._root.depth():0},nodeSize:function(){return null!==this._root?this._root.nodeSize():0},interfaces_:function(){return[]},getClass:function(){return si}}),si.ensureExtent=function(t,e){var n=t.getMin(),i=t.getMax();return n!==i?t:(n===i&&(i=(n-=e/2)+e/2),new $n(n,i))},Zo(ai.prototype,{isInside:function(t){},interfaces_:function(){return[]},getClass:function(){return ai}}),Zo(ui.prototype,{testLineSegment:function(t,e){var n=null,i=null,r=null,o=null,s=e.p0,a=e.p1;n=s.x-t.x,i=s.y-t.y,r=a.x-t.x,o=a.y-t.y,(i>0&&o<=0||o>0&&i<=0)&&0Math.PI;)t-=ci.PI_TIMES_2;for(;t<=-Math.PI;)t+=ci.PI_TIMES_2;return t},ci.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],i=n.x-e.x,r=n.y-e.y;return Math.atan2(r,i)}},ci.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)>0},ci.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0},ci.interiorAngle=function(t,e,n){var i=ci.angle(e,t),r=ci.angle(e,n);return Math.abs(r-i)},ci.normalizePositive=function(t){if(t<0){for(;t<0;)t+=ci.PI_TIMES_2;t>=ci.PI_TIMES_2&&(t=0)}else{for(;t>=ci.PI_TIMES_2;)t-=ci.PI_TIMES_2;t<0&&(t=0)}return t},ci.angleBetween=function(t,e,n){var i=ci.angle(e,t),r=ci.angle(e,n);return ci.diff(i,r)},ci.diff=function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n},ci.toRadians=function(t){return t*Math.PI/180},ci.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?ci.COUNTERCLOCKWISE:n<0?ci.CLOCKWISE:ci.NONE},ci.angleBetweenOriented=function(t,e,n){var i=ci.angle(e,t),r=ci.angle(e,n)-i;return r<=-Math.PI?r+ci.PI_TIMES_2:r>Math.PI?r-ci.PI_TIMES_2:r},ci.PI_TIMES_2=2*Math.PI,ci.PI_OVER_2=Math.PI/2,ci.PI_OVER_4=Math.PI/4,ci.COUNTERCLOCKWISE=Qt.COUNTERCLOCKWISE,ci.CLOCKWISE=Qt.CLOCKWISE,ci.NONE=Qt.COLLINEAR,Zo(hi.prototype,{area:function(){return hi.area(this.p0,this.p1,this.p2)},signedArea:function(){return hi.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(t){if(null===t)throw new r("Supplied point is null.");return hi.interpolateZ(t,this.p0,this.p1,this.p2)},longestSideLength:function(){return hi.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return hi.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return hi.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return hi.area3D(this.p0,this.p1,this.p2)},centroid:function(){return hi.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return hi.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return hi}}),hi.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)},hi.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},hi.det=function(t,e,n,i){return t*i-e*n},hi.interpolateZ=function(t,e,n,i){var r=e.x,o=e.y,s=n.x-r,a=i.x-r,u=n.y-o,l=i.y-o,c=s*l-a*u,h=t.x-r,f=t.y-o,g=(l*h-a*f)/c,d=(-u*h+s*f)/c;return e.z+g*(n.z-e.z)+d*(i.z-e.z)},hi.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),o=n.distance(t),s=i;return r>s&&(s=r),o>s&&(s=o),s},hi.isAcute=function(t,e,n){return!!ci.isAcute(t,e,n)&&(!!ci.isAcute(e,n,t)&&!!ci.isAcute(n,t,e))},hi.circumcentre=function(t,e,n){var i=n.x,r=n.y,o=t.x-i,s=t.y-r,a=e.x-i,u=e.y-r,l=2*hi.det(o,s,a,u);return new g(i-hi.det(s,o*o+s*s,u,a*a+u*u)/l,r+hi.det(o,o*o+s*s,a,a*a+u*u)/l)},hi.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y;return new D(new D(t.x+n/2,t.y+i/2,1),new D(t.x-i+n/2,t.y+n+i/2,1))},hi.angleBisector=function(t,e,n){var i=e.distance(t),r=i/(i+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new g(t.x+r*o,t.y+r*s)},hi.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=r*u-o*a,c=o*s-i*u,h=i*a-r*s,f=l*l+c*c+h*h;return Math.sqrt(f)/2},hi.centroid=function(t,e,n){return new g((t.x+e.x+n.x)/3,(t.y+e.y+n.y)/3)},hi.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o;return new g((i*t.x+r*e.x+o*n.x)/s,(i*t.y+r*e.y+o*n.y)/s)},Zo(fi.prototype,{getRadius:function(){return this.compute(),this._radius},getDiameter:function(){switch(this.compute(),this._extremalPts.length){case 0:return this._input.getFactory().createLineString();case 1:return this._input.getFactory().createPoint(this._centre)}var t=this._extremalPts[0],e=this._extremalPts[1];return this._input.getFactory().createLineString([t,e])},getExtremalPoints:function(){return this.compute(),this._extremalPts},computeCirclePoints:function(){if(this._input.isEmpty())return this._extremalPts=new Array(0).fill(null),null;if(1===this._input.getNumPoints()){e=this._input.getCoordinates();return this._extremalPts=[new g(e[0])],null}var t=this._input.convexHull().getCoordinates(),e=t;if(t[0].equals2D(t[t.length-1])&&(e=new Array(t.length-1).fill(null),V.copyDeep(t,0,e,0,t.length-1)),e.length<=2)return this._extremalPts=V.copyDeep(e),null;for(var n=fi.lowestPoint(e),i=fi.pointWitMinAngleWithX(e,n),r=0;r=i;)i=r,o=s,s=gi.nextIndex(t,o),r=e.distancePerpendicular(t[s]);return ii&&(i=u),us&&(s=l),l=t.length&&(e=0),e},gi.computeC=function(t,e,n){return t*n.y-e*n.x},gi.getMinimumDiameter=function(t){return new gi(t).getDiameter()},gi.getMinimumRectangle=function(t){return new gi(t).getMinimumRectangle()},gi.computeSegmentForLine=function(t,e,n){var i=null,r=null;return Math.abs(e)>Math.abs(t)?(i=new g(0,n/e),r=new g(1,n/e-t/e)):(i=new g(n/t,0),r=new g(n/t-e/t,1)),new $t(i,r)},Zo(di.prototype,{getResultGeometry:function(){return new pi(this._distanceTolerance).transform(this._inputGeom)},setDistanceTolerance:function(t){if(t<=0)throw new r("Tolerance must be positive");this._distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return di}}),di.densifyPoints=function(t,e,n){for(var i=new $t,r=new w,o=0;o1)for(var u=s/a,l=1;ls?1:ot&&(t=n)}return t+1},isEmpty:function(){var t=!0;this._items.isEmpty()||(t=!1);for(var e=0;e<4;e++)null!==this._subnode[e]&&(this._subnode[e].isEmpty()||(t=!1));return t},add:function(t){this._items.add(t)},interfaces_:function(){return[l]},getClass:function(){return wi}}),wi.getSubnodeIndex=function(t,e,n){var i=-1;return t.getMinX()>=e&&(t.getMinY()>=n&&(i=3),t.getMaxY()<=n&&(i=1)),t.getMaxX()<=e&&(t.getMinY()>=n&&(i=2),t.getMaxY()<=n&&(i=0)),i},Zo(bi.prototype,{getLevel:function(){return this._level},computeKey:function(){if(1===arguments.length){var t=arguments[0];for(this._level=bi.computeQuadLevel(t),this._env=new b,this.computeKey(this._level,t);!this._env.contains(t);)this._level+=1,this.computeKey(this._level,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=ti.powerOf2(e);this._pt.x=Math.floor(n.getMinX()/i)*i,this._pt.y=Math.floor(n.getMinY()/i)*i,this._env.init(this._pt.x,this._pt.x+i,this._pt.y,this._pt.y+i)}},getEnvelope:function(){return this._env},getCentre:function(){return new g((this._env.getMinX()+this._env.getMaxX())/2,(this._env.getMinY()+this._env.getMaxY())/2)},getPoint:function(){return this._pt},interfaces_:function(){return[]},getClass:function(){return bi}}),bi.computeQuadLevel=function(t){var e=t.getWidth(),n=t.getHeight();return ti.exponent(e>n?e:n)+1},Ko(Ii,wi),Zo(Ii.prototype,{find:function(t){var e=wi.getSubnodeIndex(t,this._centrex,this._centrey);return-1===e?this:null!==this._subnode[e]?this._subnode[e].find(t):this},isSearchMatch:function(t){return this._env.intersects(t)},getSubnode:function(t){return null===this._subnode[t]&&(this._subnode[t]=this.createSubnode(t)),this._subnode[t]},getEnvelope:function(){return this._env},getNode:function(t){var e=wi.getSubnodeIndex(t,this._centrex,this._centrey);return-1!==e?this.getSubnode(e).getNode(t):this},createSubnode:function(t){var e=0,n=0,i=0,r=0;switch(t){case 0:e=this._env.getMinX(),n=this._centrex,i=this._env.getMinY(),r=this._centrey;break;case 1:e=this._centrex,n=this._env.getMaxX(),i=this._env.getMinY(),r=this._centrey;break;case 2:e=this._env.getMinX(),n=this._centrex,i=this._centrey,r=this._env.getMaxY();break;case 3:e=this._centrex,n=this._env.getMaxX(),i=this._centrey,r=this._env.getMaxY()}return new Ii(new b(e,n,i,r),this._level-1)},insertNode:function(t){f.isTrue(null===this._env||this._env.contains(t._env));var e=wi.getSubnodeIndex(t._env,this._centrex,this._centrey);if(t._level===this._level-1)this._subnode[e]=t;else{var n=this.createSubnode(e);n.insertNode(t),this._subnode[e]=n}},interfaces_:function(){return[]},getClass:function(){return Ii}}),Ii.createNode=function(t){var e=new bi(t);return new Ii(e.getEnvelope(),e.getLevel())},Ii.createExpanded=function(t,e){var n=new b(e);null!==t&&n.expandToInclude(t._env);var i=Ii.createNode(n);return null!==t&&i.insertNode(t),i},Ko(Ci,wi),Zo(Ci.prototype,{insert:function(t,e){var n=wi.getSubnodeIndex(t,Ci.origin.x,Ci.origin.y);if(-1===n)return this.add(e),null;var i=this._subnode[n];if(null===i||!i.getEnvelope().contains(t)){var r=Ii.createExpanded(i,t);this._subnode[n]=r}this.insertContained(this._subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){f.isTrue(t.getEnvelope().contains(e));var i=ri.isZeroWidth(e.getMinX(),e.getMaxX()),r=ri.isZeroWidth(e.getMinY(),e.getMaxY());(i||r?t.find(e):t.getNode(e)).add(n)},interfaces_:function(){return[]},getClass:function(){return Ci}}),Ci.origin=new g(0,0),Zo(Ni.prototype,{size:function(){return null!==this._root?this._root.size():0},insert:function(t,e){this.collectStats(t);var n=Ni.ensureExtent(t,this._minExtent);this._root.insert(n,e)},query:function(){if(1===arguments.length){var t=arguments[0],e=new Pn;return this.query(t,e),e.getItems()}if(2===arguments.length){var n=arguments[0],i=arguments[1];this._root.visit(n,i)}},queryAll:function(){var t=new E;return this._root.addAllItems(t),t},remove:function(t,e){var n=Ni.ensureExtent(t,this._minExtent);return this._root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e0&&(this._minExtent=e);var n=t.getHeight();n0&&(this._minExtent=n)},depth:function(){return null!==this._root?this._root.depth():0},isEmpty:function(){return null===this._root},interfaces_:function(){return[Ie,l]},getClass:function(){return Ni}}),Ni.ensureExtent=function(t,e){var n=t.getMinX(),i=t.getMaxX(),r=t.getMinY(),o=t.getMaxY();return n!==i&&r!==o?t:(n===i&&(i=(n-=e/2)+e/2),r===o&&(o=(r-=e/2)+e/2),new b(n,i,r,o))},Ni.serialVersionUID=-0x678b60c967a25400;var hs=Object.freeze({Quadtree:Ni}),fs=Object.freeze({STRtree:Me}),gs=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];Zo(Si.prototype,{read:function(t){var e=void 0,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!ds[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==gs.indexOf(n)?ds[n].apply(this,[e.coordinates]):"GeometryCollection"===n?ds[n].apply(this,[e.geometries]):ds[n].apply(this,[e])},write:function(t){var e=t.getGeometryType();if(!ps[e])throw new Error("Geometry is not supported");return ps[e].apply(this,[t])}});var ds={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var i=t.geometry.type;if(!ds[i])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=ds.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&i===Qt.CLOCKWISE&&(r=!0),r&&(this._minIndex=this._minIndex-1)},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 i=Ke.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},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)},findEdge:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}f.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)===Ke.LEFT&&(this._orientedDe=this._minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return Gi}}),qi.prototype.addLast=function(t){this.array_.push(t)},qi.prototype.removeFirst=function(){return this.array_.shift()},qi.prototype.isEmpty=function(){return 0===this.array_.length},Zo(ki.prototype,{clearVisitedEdges:function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},getRightmostCoordinate:function(){return this._rightMostCoord},computeNodeDepth:function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();)if((i=n.next()).isVisited()||i.getSym().isVisited()){e=i;break}if(null===e)throw new Ve("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(n=t.getEdges().iterator();n.hasNext();){var i=n.next();i.setVisited(!0),this.copySymDepths(i)}},computeDepth:function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.getNode(),e.getLabel();e.setEdgeDepths(Ke.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},create:function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},findResultEdges:function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ke.RIGHT)>=1&&e.getDepth(Ke.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},computeDepths:function(t){var e=new K,n=new qi,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.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))}}}},compareTo:function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},getEnvelope:function(){if(null===this._env){for(var t=new b,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),i=0;i=0;n--)this.addPt(t[n])},isRedundant:function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)=2&&this._ptList.get(this._ptList.size()-2),t.equals(e))return null;this._ptList.add(t)},setMinimumVertexDistance:function(t){this._minimimVertexDistance=t},interfaces_:function(){return[]},getClass:function(){return ji}}),ji.COORDINATE_ARRAY_TYPE=new Array(0).fill(null),Zo(zi.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=Qt.computeOrientation(this._s0,this._s1,this._s2),i=n===Qt.CLOCKWISE&&this._side===Ke.LEFT||n===Qt.COUNTERCLOCKWISE&&this._side===Ke.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},addLineEndCap:function(t,e){var n=new $t(t,e),i=new $t;this.computeOffsetSegment(n,Ke.LEFT,this._distance,i);var r=new $t;this.computeOffsetSegment(n,Ke.RIGHT,this._distance,r);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Fi.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,Qt.CLOCKWISE,this._distance),this._segList.addPt(r.p1);break;case Fi.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(r.p1);break;case Fi.CAP_SQUARE:var u=new g;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new g(i.p1.x+u.x,i.p1.y+u.y),c=new g(r.p1.x+u.x,r.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},getCoordinates:function(){return this._segList.getCoordinates()},addMitreJoin:function(t,e,n,i){var r=!0,o=null;try{o=D.intersection(e.p0,e.p1,n.p0,n.p1),(i<=0?1:o.distance(t)/Math.abs(i))>this._bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof C))throw t;o=new g(0,0),r=!1}r?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},addFilletCorner:function(t,e,n,i,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);i===Qt.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,i,r),this._segList.addPt(n)},addOutsideTurn:function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new g((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new g((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},createCircle:function(t){var e=new g(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},addBevelJoin:function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},init:function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new ji,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*zi.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},addCollinear:function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Fi.JOIN_BEVEL||this._bufParams.getJoinStyle()===Fi.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Qt.CLOCKWISE,this._distance))},closeRing:function(){this._segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return zi}}),zi.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,zi.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,zi.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,zi.MAX_CLOSING_SEG_LEN_FACTOR=80,Zo(Yi.prototype,{getOffsetCurve:function(t,e){if(this._distance=e,0===e)return null;var n=e<0,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var o=r.getCoordinates();return n&&V.reverse(o),o},computeSingleSidedBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var r=Bi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Ke.LEFT),n.addFirstSegment();for(u=o-2;u>=0;u--)n.addNextSegment(r[u],!0)}else{n.addSegments(t,!1);var s=Bi.simplify(t,i),a=s.length-1;n.initSideSegments(s[0],s[1],Ke.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},computeRingBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this._distance);e===Ke.RIGHT&&(i=-i);var r=Bi.simplify(t,i),o=r.length-1;n.initSideSegments(r[o-1],r[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(r[s],a)}n.closeRing()},computeLineBufferCurve:function(t,e){var n=this.simplifyTolerance(this._distance),i=Bi.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],Ke.LEFT);for(a=2;a<=r;a++)e.addNextSegment(i[a],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var o=Bi.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],Ke.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},computePointCurve:function(t,e){switch(this._bufParams.getEndCapStyle()){case Fi.CAP_ROUND:e.createCircle(t);break;case Fi.CAP_SQUARE:e.createSquare(t)}},getLineCurve:function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var r=e<0;this.computeSingleSidedBufferCurve(t,r,i)}else this.computeLineBufferCurve(t,i);return i.getCoordinates()},getBufferParameters:function(){return this._bufParams},simplifyTolerance:function(t){return t*this._bufParams.getSimplifyFactor()},getRingCurve:function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Yi.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},computeOffsetCurve:function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var r=Bi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Ke.LEFT),n.addFirstSegment();for(u=o-2;u>=0;u--)n.addNextSegment(r[u],!0)}else{var s=Bi.simplify(t,i),a=s.length-1;n.initSideSegments(s[0],s[1],Ke.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},getSegGen:function(t){return new zi(this._precisionModel,this._bufParams,t)},interfaces_:function(){return[]},getClass:function(){return Yi}}),Yi.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;nr.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if($o(arguments[2],m)&&arguments[0]instanceof g&&arguments[1]instanceof un){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),n=0;nthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||Qt.computeOrientation(this._seg.p0,this._seg.p1,o)===Qt.RIGHT)){var l=s.getDepth(Ke.LEFT);this._seg.p0.equals(u[n])||(l=s.getDepth(Ke.RIGHT));var c=new Vi(this._seg,l);a.add(c)}}else if($o(arguments[2],m)&&arguments[0]instanceof g&&$o(arguments[1],m))for(var h=arguments[0],f=arguments[1],d=arguments[2],n=f.iterator();n.hasNext();){var p=n.next();p.isForward()&&this.findStabbedSegments(h,p,d)}},getDepth:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:cs.min(e)._leftDepth},interfaces_:function(){return[]},getClass:function(){return Xi}}),Zo(Vi.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)},compareX:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},toString:function(){return this._upwardSeg.toString()},interfaces_:function(){return[s]},getClass:function(){return Vi}}),Xi.DepthSegment=Vi,Zo(Ui.prototype,{addPoint:function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},addPolygon:function(t){var e=this._distance,n=Ke.LEFT;this._distance<0&&(e=-this._distance,n=Ke.RIGHT);var i=t.getExteriorRing(),r=V.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance))return null;if(this._distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,N.EXTERIOR,N.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ke.opposite(n),N.INTERIOR,N.EXTERIOR)}},isTriangleErodedCompletely:function(t,e){var n=new hi(t[0],t[1],t[2]),i=n.inCentre();return Qt.distancePointLine(i,n.p0,n.p1)=Lt.MINIMUM_VALID_SIZE&&Qt.isCCW(t)&&(o=r,s=i,n=Ke.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},add:function(t){if(t.isEmpty())return null;if(t instanceof Nt)this.addPolygon(t);else if(t instanceof wt)this.addLineString(t);else if(t instanceof It)this.addPoint(t);else if(t instanceof St)this.addCollection(t);else if(t instanceof ft)this.addCollection(t);else if(t instanceof Mt)this.addCollection(t);else{if(!(t instanceof ht))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},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 i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>r},addCollection:function(t){for(var e=0;ei||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return f.isTrue(!(s&&a),"Found bad envelope test"),a},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 g(this._maxx,this._maxy),this._corner[1]=new g(this._minx,this._maxy),this._corner[2]=new g(this._minx,this._miny),this._corner[3]=new g(this._maxx,this._miny)},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))},scale:function(t){return Math.round(t*this._scaleFactor)},getCoordinate:function(){return this._originalPt},copyScaled:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},getSafeEnvelope:function(){if(null===this._safeEnv){var t=Zi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new b(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},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())))},intersectsToleranceSquare:function(t,e){var n=!1,i=!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()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||(!(!n||!i)||(!!t.equals(this._pt)||!!e.equals(this._pt))))))},addSnappedNode:function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)},interfaces_:function(){return[]},getClass:function(){return Zi}}),Zi.SAFE_ENV_EXPANSION_FACTOR=.75,Zo(Ki.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],i=arguments[2],r=e.getSafeEnvelope(),o=new Qi(e,n,i);return this._index.query(r,{interfaces_:function(){return[be]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return Ki}}),Ko(Qi,Kn),Zo(Qi.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return Kn.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)},interfaces_:function(){return[]},getClass:function(){return Qi}}),Ki.HotPixelSnapAction=Qi,Zo($i.prototype,{processIntersections:function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof Ve))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var e=arguments[0],n=new Yt(er.precisionScaleFactor(this._argGeom,this._distance,e));this.bufferFixedPrecision(n)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Yt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},setQuadrantSegments:function(t){this._bufParams.setQuadrantSegments(t)},bufferOriginalPrecision:function(){try{var t=new Wi(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof c))throw t;this._saveException=t}},getResultGeometry:function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},setEndCapStyle:function(t){this._bufParams.setEndCapStyle(t)},interfaces_:function(){return[]},getClass:function(){return er}}),er.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return f=new er(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof q&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1],r=arguments[2];return(h=new er(n)).setQuadrantSegments(r),f=h.getResultGeometry(i)}if(arguments[2]instanceof Fi&&arguments[0]instanceof q&&"number"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return f=(h=new er(o,arguments[2])).getResultGeometry(s)}}else if(4===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2],c=arguments[3],h=new er(a);h.setQuadrantSegments(l),h.setEndCapStyle(c);var f=h.getResultGeometry(u);return f}},er.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=S.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(r)/Math.log(10)+1);return Math.pow(10,o)},er.CAP_ROUND=Fi.CAP_ROUND,er.CAP_BUTT=Fi.CAP_FLAT,er.CAP_FLAT=Fi.CAP_FLAT,er.CAP_SQUARE=Fi.CAP_SQUARE,er.MAX_PRECISION_DIGITS=12,Zo(nr.prototype,{filter:function(t){t instanceof Nt&&this._comps.add(t)},interfaces_:function(){return[lt]},getClass:function(){return nr}}),nr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return nr.getPolygons(t,new E)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Nt?n.add(e):e instanceof ht&&e.apply(new nr(n)),n}},Zo(ir.prototype,{isInsideArea:function(){return this._segIndex===ir.INSIDE_AREA},getCoordinate:function(){return this._pt},getGeometryComponent:function(){return this._component},getSegmentIndex:function(){return this._segIndex},interfaces_:function(){return[]},getClass:function(){return ir}}),ir.INSIDE_AREA=-1,Zo(rr.prototype,{filter:function(t){t instanceof It&&this._pts.add(t)},interfaces_:function(){return[lt]},getClass:function(){return rr}}),rr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof It?cs.singletonList(t):rr.getPoints(t,new E)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof It?n.add(e):e instanceof ht&&e.apply(new rr(n)),n}},Zo(or.prototype,{filter:function(t){(t instanceof It||t instanceof wt||t instanceof Nt)&&this._locations.add(new ir(t,0,t.getCoordinate()))},interfaces_:function(){return[lt]},getClass:function(){return or}}),or.getLocations=function(t){var e=new E;return t.apply(new or(e)),e},Zo(sr.prototype,{computeContainmentDistance:function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=1-e,r=nr.getPolygons(this._geom[e]);if(r.size()>0){var o=or.getLocations(this._geom[i]);if(this.computeContainmentDistance(o,r,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[i]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&$o(arguments[0],m)&&$o(arguments[1],m)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;lthis._minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;othis._minDistance)return null;for(var i=a.getCoordinates(),c=u.getCoordinates(),o=0;ot&&V.reverse(this._coordinates)}return this._coordinates},toLineString:function(){return this._factory.createLineString(this.getCoordinates())},add:function(t){this._directedEdges.add(t)},interfaces_:function(){return[]},getClass:function(){return ar}}),Zo(ur.prototype,{setVisited:function(t){this._isVisited=t},isMarked:function(){return this._isMarked},setData:function(t){this._data=t},getData:function(){return this._data},setMarked:function(t){this._isMarked=t},getContext:function(){return this._data},isVisited:function(){return this._isVisited},setContext:function(t){this._data=t},interfaces_:function(){return[]},getClass:function(){return ur}}),ur.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if(n.isVisited()===e)return n}return null},ur.setVisited=function(t,e){for(;t.hasNext();)t.next().setVisited(e)},ur.setMarked=function(t,e){for(;t.hasNext();)t.next().setMarked(e)},Ko(lr,ur),Zo(lr.prototype,{isRemoved:function(){return null===this._parentEdge},compareDirection:function(t){return this._quadrant>t._quadrant?1:this._quadrant=t.getNumPoints()&&null===i)return null;var o=t.getCoordinate(r);null!==i&&i.segmentIndex===n.segmentIndex&&(o=i.coord);var s=new an(t,n.coord,o,new $e(t.getLabel()));e.add(s)},createEdgeEndForPrev:function(t,e,n,i){var r=n.segmentIndex;if(0===n.dist){if(0===r)return null;r--}var o=t.getCoordinate(r);null!==i&&i.segmentIndex>=r&&(o=i.coord);var s=new $e(t.getLabel());s.flip();var a=new an(t,n.coord,o,s);e.add(a)},computeEdgeEnds:function(){if(1===arguments.length){for(var t=arguments[0],e=new E,n=t;n.hasNext();){var i=n.next();this.computeEdgeEnds(i,e)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1],s=r.getEdgeIntersectionList();s.addEndpoints();var a=s.iterator(),u=null,l=null;if(!a.hasNext())return null;var c=a.next();do{u=l,l=c,c=null,a.hasNext()&&(c=a.next()),null!==l&&(this.createEdgeEndForPrev(r,o,l,u),this.createEdgeEndForNext(r,o,l,c))}while(null!==l)}},interfaces_:function(){return[]},getClass:function(){return wr}}),Ko(br,an),Zo(br.prototype,{insert:function(t){this._edgeEnds.add(t)},print:function(t){t.println("EdgeEndBundle--\x3e Label: "+this._label);for(var e=this.iterator();e.hasNext();)e.next().print(t),t.println()},iterator:function(){return this._edgeEnds.iterator()},getEdgeEnds:function(){return this._edgeEnds},computeLabelOn:function(t,e){for(var n=0,i=!1,r=this.iterator();r.hasNext();)(o=r.next().getLabel().getLocation(t))===N.BOUNDARY&&n++,o===N.INTERIOR&&(i=!0);var o=N.NONE;i&&(o=N.INTERIOR),n>0&&(o=Bn.determineBoundary(e,n)),this._label.setLocation(t,o)},computeLabelSide:function(t,e){for(var n=this.iterator();n.hasNext();){var i=n.next();if(i.getLabel().isArea()){var r=i.getLabel().getLocation(t,e);if(r===N.INTERIOR)return this._label.setLocation(t,e,N.INTERIOR),null;r===N.EXTERIOR&&this._label.setLocation(t,e,N.EXTERIOR)}}},getLabel:function(){return this._label},computeLabelSides:function(t){this.computeLabelSide(t,Ke.LEFT),this.computeLabelSide(t,Ke.RIGHT)},updateIM:function(t){kn.updateIM(this._label,t)},computeLabel:function(t){for(var e=!1,n=this.iterator();n.hasNext();)n.next().getLabel().isArea()&&(e=!0);this._label=e?new $e(N.NONE,N.NONE,N.NONE):new $e(N.NONE);for(var i=0;i<2;i++)this.computeLabelOn(i,t),e&&this.computeLabelSides(i)},interfaces_:function(){return[]},getClass:function(){return br}}),Ko(Ir,_n),Zo(Ir.prototype,{updateIM:function(t){for(var e=this.iterator();e.hasNext();)e.next().updateIM(t)},insert:function(t){var e=this._edgeMap.get(t);null===e?(e=new br(t),this.insertEdgeEnd(t,e)):e.insert(t)},interfaces_:function(){return[]},getClass:function(){return Ir}}),Ko(Cr,on),Zo(Cr.prototype,{updateIMFromEdges:function(t){this._edges.updateIM(t)},computeIM:function(t){t.setAtLeastIfValid(this._label.getLocation(0),this._label.getLocation(1),0)},interfaces_:function(){return[]},getClass:function(){return Cr}}),Ko(Nr,ln),Zo(Nr.prototype,{createNode:function(t){return new Cr(t,new Ir)},interfaces_:function(){return[]},getClass:function(){return Nr}}),Zo(Sr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._nodes.add(n)}},getNodeIterator:function(){return this._nodes.iterator()},copyNodesAndLabels:function(t,e){for(var n=t.getNodeIterator();n.hasNext();){var i=n.next();this._nodes.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},build:function(t){this.computeIntersectionNodes(t,0),this.copyNodesAndLabels(t,0);var e=(new wr).computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(e)},computeIntersectionNodes:function(t,e){for(var n=t.getEdgeIterator();n.hasNext();)for(var i=n.next(),r=i.getLabel().getLocation(e),o=i.getEdgeIntersectionList().iterator();o.hasNext();){var s=o.next(),a=this._nodes.addNode(s.coord);r===N.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,N.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return Sr}}),Zo(Lr.prototype,{isNodeEdgeAreaLabelsConsistent:function(){for(var t=this._nodeGraph.getNodeIterator();t.hasNext();){var e=t.next();if(!e.getEdges().isAreaLabelsConsistent(this._geomGraph))return this._invalidPoint=e.getCoordinate().copy(),!1}return!0},getInvalidPoint:function(){return this._invalidPoint},hasDuplicateRings:function(){for(var t=this._nodeGraph.getNodeIterator();t.hasNext();)for(var e=t.next().getEdges().iterator();e.hasNext();){var n=e.next();if(n.getEdgeEnds().size()>1)return this._invalidPoint=n.getEdge().getCoordinate(0),!0}return!1},isNodeConsistentArea:function(){var t=this._geomGraph.computeSelfNodes(this._li,!0,!0);return t.hasProperIntersection()?(this._invalidPoint=t.getProperIntersectionPoint(),!1):(this._nodeGraph.build(this._geomGraph),this.isNodeEdgeAreaLabelsConsistent())},interfaces_:function(){return[]},getClass:function(){return Lr}}),Zo(Mr.prototype,{buildIndex:function(){this._index=new Me;for(var t=0;t=1&&(e=t.getCoordinateN(0)),this._validErr=new Pr(Pr.RING_NOT_CLOSED,e)}},checkShellsNotNested:function(t,e){for(var n=0;n=0;i--)n.add(t[i],!1)},Or.findEdgeRingContaining=function(t,e){for(var n=t.getRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getRing(),c=l.getEnvelopeInternal();if(!c.equals(i)&&c.contains(i)){r=V.ptNotInList(n.getCoordinates(),l.getCoordinates());var h=!1;Qt.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(s=(o=u).getRing().getEnvelopeInternal())}}return o},Zo(Tr.prototype,{compare:function(t,e){var n=e;return t.getRing().getEnvelope().compareTo(n.getRing().getEnvelope())},interfaces_:function(){return[u]},getClass:function(){return Tr}}),Or.EnvelopeComparator=Tr,Ko(Ar,_r),Zo(Ar.prototype,{findEdgeRing:function(t){var e=new Or(this._factory);return e.build(t),e},computeDepthParity:function(){if(0===arguments.length)for(;;){return null}else arguments.length},computeNextCWEdges:function(){for(var t=this.nodeIterator();t.hasNext();){var e=t.next();Ar.computeNextCWEdges(e)}},addEdge:function(t){if(t.isEmpty())return null;var e=V.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),o=this.getNode(i),s=new yr(r,o,e[1],!0),a=new yr(o,r,e[e.length-2],!1),u=new xr(t);u.setDirectedEdges(s,a),this.add(u)},deleteCutEdges:function(){this.computeNextCWEdges(),Ar.findLabeledEdgeRings(this._dirEdges);for(var t=new E,e=this._dirEdges.iterator();e.hasNext();){var n=e.next();if(!n.isMarked()){var i=n.getSym();if(n.getLabel()===i.getLabel()){n.setMarked(!0),i.setMarked(!0);var r=n.getEdge();t.add(r.getLine())}}}return t},getEdgeRings:function(){this.computeNextCWEdges(),Ar.label(this._dirEdges,-1);var t=Ar.findLabeledEdgeRings(this._dirEdges);this.convertMaximalToMinimalEdgeRings(t);for(var e=new E,n=this._dirEdges.iterator();n.hasNext();){var i=n.next();if(!i.isMarked()&&!i.isInRing()){var r=this.findEdgeRing(i);e.add(r)}}return e},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new gr(t),this.add(e)),e},convertMaximalToMinimalEdgeRings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel(),r=Ar.findIntersectionNodes(n,i);if(null!==r)for(var o=r.iterator();o.hasNext();){var s=o.next();Ar.computeNextCCWEdges(s,i)}}},deleteDangles:function(){for(var t=this.findNodesOfDegree(1),e=new K,n=new ie,i=t.iterator();i.hasNext();)n.push(i.next());for(;!n.isEmpty();){var r=n.pop();Ar.deleteAllEdges(r);for(i=r.getOutEdges().getEdges().iterator();i.hasNext();){var o=i.next();o.setMarked(!0);var s=o.getSym();null!==s&&s.setMarked(!0);var a=o.getEdge();e.add(a.getLine());var u=o.getToNode();1===Ar.getDegreeNonDeleted(u)&&n.push(u)}}return e},interfaces_:function(){return[]},getClass:function(){return Ar}}),Ar.findLabeledEdgeRings=function(t){for(var e=new E,n=1,i=t.iterator();i.hasNext();){var r=i.next();if(!r.isMarked()&&!(r.getLabel()>=0)){e.add(r);var o=Or.findDirEdgesInRing(r);Ar.label(o,n),n++}}return e},Ar.getDegreeNonDeleted=function(t){for(var e=0,n=t.getOutEdges().getEdges().iterator();n.hasNext();)n.next().isMarked()||e++;return e},Ar.deleteAllEdges=function(t){for(var e=t.getOutEdges().getEdges().iterator();e.hasNext();){var n=e.next();n.setMarked(!0);var i=n.getSym();null!==i&&i.setMarked(!0)}},Ar.label=function(t,e){for(var n=t.iterator();n.hasNext();)n.next().setLabel(e)},Ar.computeNextCWEdges=function(t){for(var e=null,n=null,i=t.getOutEdges().getEdges().iterator();i.hasNext();){var r=i.next();r.isMarked()||(null===e&&(e=r),null!==n&&(o=n.getSym()).setNext(r),n=r)}if(null!==n){var o=n.getSym();o.setNext(e)}},Ar.computeNextCCWEdges=function(t,e){for(var n=null,i=null,r=t.getOutEdges().getEdges(),o=r.size()-1;o>=0;o--){var s=r.get(o),a=s.getSym(),u=null;s.getLabel()===e&&(u=s);var l=null;a.getLabel()===e&&(l=a),null===u&&null===l||(null!==l&&(i=l),null!==u&&(null!==i&&(i.setNext(u),i=null),null===n&&(n=u)))}null!==i&&(f.isTrue(null!==n),i.setNext(n))},Ar.getDegree=function(t,e){for(var n=0,i=t.getOutEdges().getEdges().iterator();i.hasNext();)i.next().getLabel()===e&&n++;return n},Ar.findIntersectionNodes=function(t,e){var n=t,i=null;do{var r=n.getFromNode();Ar.getDegree(r,e)>1&&(null===i&&(i=new E),i.add(r)),n=n.getNext(),f.isTrue(null!==n,"found null DE in ring"),f.isTrue(n===t||!n.isInRing(),"found DE already in ring")}while(n!==t);return i},Zo(Dr.prototype,{getGeometry:function(){return null===this._geomFactory&&(this._geomFactory=new Vt),this.polygonize(),this._extractOnlyPolygonal?this._geomFactory.buildGeometry(this._polyList):this._geomFactory.createGeometryCollection(Vt.toGeometryArray(this._polyList))},getInvalidRingLines:function(){return this.polygonize(),this._invalidRingLines},findValidRings:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isValid()?e.add(r):n.add(r.getLineString())}},polygonize:function(){if(null!==this._polyList)return null;if(this._polyList=new E,null===this._graph)return null;this._dangles=this._graph.deleteDangles(),this._cutEdges=this._graph.deleteCutEdges();var t=this._graph.getEdgeRings(),e=new E;this._invalidRingLines=new E,this._isCheckingRingsValid?this.findValidRings(t,e,this._invalidRingLines):e=t,this.findShellsAndHoles(e),Dr.assignHolesToShells(this._holeList,this._shellList),cs.sort(this._shellList,new Or.EnvelopeComparator);var n=!0;this._extractOnlyPolygonal&&(Dr.findDisjointShells(this._shellList),n=!1),this._polyList=Dr.extractPolygons(this._shellList,n)},getDangles:function(){return this.polygonize(),this._dangles},getCutEdges:function(){return this.polygonize(),this._cutEdges},getPolygons:function(){return this.polygonize(),this._polyList},add:function(){if($o(arguments[0],_))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.add(e)}else if(arguments[0]instanceof wt){var n=arguments[0];this._geomFactory=n.getFactory(),null===this._graph&&(this._graph=new Ar(this._geomFactory)),this._graph.addEdge(n)}else arguments[0]instanceof q&&arguments[0].apply(this._lineStringAdder)},setCheckRingsValid:function(t){this._isCheckingRingsValid=t},findShellsAndHoles:function(t){this._holeList=new E,this._shellList=new E;for(var e=t.iterator();e.hasNext();){var n=e.next();n.computeHole(),n.isHole()?this._holeList.add(n):this._shellList.add(n)}},interfaces_:function(){return[]},getClass:function(){return Dr}}),Dr.findOuterShells=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getOuterHole();null===i||i.isProcessed()||(n.setIncluded(!0),i.setProcessed(!0))}},Dr.extractPolygons=function(t,e){for(var n=new E,i=t.iterator();i.hasNext();){var r=i.next();(e||r.isIncluded())&&n.add(r.getPolygon())}return n},Dr.assignHolesToShells=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();Dr.assignHoleToShell(i,e)}},Dr.assignHoleToShell=function(t,e){var n=Or.findEdgeRingContaining(t,e);null!==n&&n.addHole(t)},Dr.findDisjointShells=function(t){Dr.findOuterShells(t);var e=null;do{e=!1;for(var n=t.iterator();n.hasNext();){var i=n.next();i.isIncludedSet()||(i.updateIncluded(),i.isIncludedSet()||(e=!0))}}while(e)},Zo(Fr.prototype,{filter:function(t){t instanceof wt&&this.p.add(t)},interfaces_:function(){return[G]},getClass:function(){return Fr}}),Dr.LineStringAdder=Fr,Zo(Gr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._nodes.add(n)}},computeProperIntersectionIM:function(t,e){var n=this._arg[0].getGeometry().getDimension(),i=this._arg[1].getGeometry().getDimension(),r=t.hasProperIntersection(),o=t.hasProperInteriorIntersection();2===n&&2===i?r&&e.setAtLeast("212101212"):2===n&&1===i?(r&&e.setAtLeast("FFF0FFFF2"),o&&e.setAtLeast("1FFFFF1FF")):1===n&&2===i?(r&&e.setAtLeast("F0FFFFFF2"),o&&e.setAtLeast("1F1FFFFFF")):1===n&&1===i&&o&&e.setAtLeast("0FFFFFFFF")},labelIsolatedEdges:function(t,e){for(var n=this._arg[t].getEdgeIterator();n.hasNext();){var i=n.next();i.isIsolated()&&(this.labelIsolatedEdge(i,e,this._arg[e].getGeometry()),this._isolatedEdges.add(i))}},labelIsolatedEdge:function(t,e,n){if(n.getDimension()>0){var i=this._ptLocator.locate(t.getCoordinate(),n);t.getLabel().setAllLocations(e,i)}else t.getLabel().setAllLocations(e,N.EXTERIOR)},computeIM:function(){var t=new te;if(t.set(N.EXTERIOR,N.EXTERIOR,2),!this._arg[0].getGeometry().getEnvelopeInternal().intersects(this._arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(t),t;this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1);var e=this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!1);this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(e,t);var n=new wr,i=n.computeEdgeEnds(this._arg[0].getEdgeIterator());this.insertEdgeEnds(i);var r=n.computeEdgeEnds(this._arg[1].getEdgeIterator());return this.insertEdgeEnds(r),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(t),t},labelNodeEdges:function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg)},copyNodesAndLabels:function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._nodes.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},labelIntersectionNodes:function(t){for(var e=this._arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this._nodes.find(o.coord);s.getLabel().isNull(t)&&(i===N.BOUNDARY?s.setLabelBoundary(t):s.setLabel(t,N.INTERIOR))}},labelIsolatedNode:function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setAllLocations(e,n)},computeIntersectionNodes:function(t){for(var e=this._arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this._nodes.addNode(o.coord);i===N.BOUNDARY?s.setLabelBoundary(t):s.getLabel().isNull(t)&&s.setLabel(t,N.INTERIOR)}},labelIsolatedNodes:function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next(),n=e.getLabel();f.isTrue(n.getGeometryCount()>0,"node with empty label found"),e.isIsolated()&&(n.isNull(0)?this.labelIsolatedNode(e,0):this.labelIsolatedNode(e,1))}},updateIM:function(t){for(var e=this._isolatedEdges.iterator();e.hasNext();)e.next().updateIM(t);for(var n=this._nodes.iterator();n.hasNext();){var i=n.next();i.updateIM(t),i.updateIMFromEdges(t)}},computeDisjointIM:function(t){var e=this._arg[0].getGeometry();e.isEmpty()||(t.set(N.INTERIOR,N.EXTERIOR,e.getDimension()),t.set(N.BOUNDARY,N.EXTERIOR,e.getBoundaryDimension()));var n=this._arg[1].getGeometry();n.isEmpty()||(t.set(N.EXTERIOR,N.INTERIOR,n.getDimension()),t.set(N.EXTERIOR,N.BOUNDARY,n.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return Gr}}),Zo(qr.prototype,{isContainedInBoundary:function(t){if(t instanceof Nt)return!1;if(t instanceof It)return this.isPointContainedInBoundary(t);if(t instanceof wt)return this.isLineStringContainedInBoundary(t);for(var e=0;e0){var i=t;t=e,e=i}var r=!1;return e.y>t.y&&(r=!0),r?this._li.computeIntersection(t,e,this._diagDown0,this._diagDown1):this._li.computeIntersection(t,e,this._diagUp0,this._diagUp1),!!this._li.hasIntersection()},interfaces_:function(){return[]},getClass:function(){return kr}}),Zo(Br.prototype,{applyTo:function(t){for(var e=0;e=this._rectEnv.getMinX()&&e.getMaxX()<=this._rectEnv.getMaxX()?(this._intersects=!0,null):e.getMinY()>=this._rectEnv.getMinY()&&e.getMaxY()<=this._rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return zr}}),Ko(Yr,Br),Zo(Yr.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(t){if(!(t instanceof Nt))return null;var e=t.getEnvelopeInternal();if(!this._rectEnv.intersects(e))return null;for(var n=new g,i=0;i<4;i++)if(this._rectSeq.getCoordinate(i,n),e.contains(n)&&pn.containsPointInPolygon(n,t))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return Yr}}),Ko(Xr,Br),Zo(Xr.prototype,{intersects:function(){return this._hasIntersection},isDone:function(){return!0===this._hasIntersection},visit:function(t){var e=t.getEnvelopeInternal();if(!this._rectEnv.intersects(e))return null;var n=Mn.getLines(t);this.checkIntersectionWithLineStrings(n)},checkIntersectionWithLineStrings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();if(this.checkIntersectionWithSegments(n),this._hasIntersection)return null}},checkIntersectionWithSegments:function(t){for(var e=t.getCoordinateSequence(),n=1;n=t.size()?null:t.get(e)},Hr.union=function(t){return new Hr(t).union()},Hr.STRTREE_NODE_CAPACITY=4,Zo(Wr.prototype,{union:function(){for(var t=new _e,e=new st,n=0;n0){var e=this._geomFact.buildGeometry(this._points);t=this.unionNoOpt(e)}var n=null;if(this._lines.size()>0){var i=this._geomFact.buildGeometry(this._lines);n=this.unionNoOpt(i)}var r=null;this._polygons.size()>0&&(r=Hr.union(this._polygons));var o=this.unionWithNull(n,r),s=null;return s=null===t?o:null===o?t:Wr.union(t,o),null===s?this._geomFact.createGeometryCollection():s},interfaces_:function(){return[]},getClass:function(){return Zr}}),Zr.union=function(){if(1===arguments.length){if($o(arguments[0],_))return(t=new Zr(arguments[0])).union();if(arguments[0]instanceof q)return(t=new Zr(arguments[0])).union()}else if(2===arguments.length){var t=new Zr(arguments[0],arguments[1]);return t.union()}},Zo(Kr.prototype,{extractElements:function(t,e,n){for(var i=new E,r=0;r=2&&(n=!0),e.edit(t,new $r(this._targetPM,n))},changePM:function(t,e){return this.createEditor(t.getFactory(),e).edit(t,new Pt.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(t){this._removeCollapsed=t},createFactory:function(t,e){return new Vt(e,t.getSRID(),t.getCoordinateSequenceFactory())},setChangePrecisionModel:function(t){this._changePrecisionModel=t},reduce:function(t){var e=this.reducePointwise(t);return this._isPointwise?e:$o(e,Ct)?e.isValid()?e:this.fixPolygonalTopology(e):e},setPointwise:function(t){this._isPointwise=t},createEditor:function(t,e){return t.getPrecisionModel()===e?new Pt:new Pt(this.createFactory(t,e))},interfaces_:function(){return[]},getClass:function(){return to}}),to.reduce=function(t,e){return new to(e).reduce(t)},to.reducePointwise=function(t,e){var n=new to(e);return n.setPointwise(!0),n.reduce(t)},Zo(eo.prototype,{simplifySection:function(t,e){if(t+1===e)return null;this._seg.p0=this._pts[t],this._seg.p1=this._pts[e];for(var n=-1,i=t,r=t+1;rn&&(n=o,i=r)}if(n<=this._distanceTolerance)for(r=t+1;rthis._distanceTolerance&&(r=!1);var a=new $t;if(a.p0=this._linePts[t],a.p1=this._linePts[e],i[0]=t,i[1]=e,this.hasBadIntersection(this._line,i,a)&&(r=!1),r){var u=this.flatten(t,e);return this._line.addToResult(u),null}this.simplifySection(t,s,n),this.simplifySection(s,e,n)},hasBadOutputIntersection:function(t){for(var e=this._outputIndex.query(t).iterator();e.hasNext();){var n=e.next();if(this.hasInteriorIntersection(n,t))return!0}return!1},findFurthestPoint:function(t,e,n,i){var r=new $t;r.p0=t[e],r.p1=t[n];for(var o=-1,s=e,a=e+1;ao&&(o=l,s=a)}return i[0]=o,s},simplify:function(t){this._line=t,this._linePts=t.getParentCoordinates(),this.simplifySection(0,this._linePts.length-1,0)},remove:function(t,e,n){for(var i=e;i=e[0]&&ii&&(s=i),r.setMinimumLength(s),r.splitAt(o),r.getSplitPoint()},interfaces_:function(){return[po]},getClass:function(){return _o}}),_o.projectedSplitPoint=function(t,e){return t.getLineSegment().project(e)},Zo(vo.prototype,{interfaces_:function(){return[]},getClass:function(){return vo}}),vo.triArea=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)},vo.isInCircleDDNormalized=function(t,e,n,i){var r=R.valueOf(t.x).selfSubtract(i.x),o=R.valueOf(t.y).selfSubtract(i.y),s=R.valueOf(e.x).selfSubtract(i.x),a=R.valueOf(e.y).selfSubtract(i.y),u=R.valueOf(n.x).selfSubtract(i.x),l=R.valueOf(n.y).selfSubtract(i.y),c=r.multiply(a).selfSubtract(s.multiply(o)),h=s.multiply(l).selfSubtract(u.multiply(a)),f=u.multiply(o).selfSubtract(r.multiply(l)),g=r.multiply(r).selfAdd(o.multiply(o)),d=s.multiply(s).selfAdd(a.multiply(a)),p=u.multiply(u).selfAdd(l.multiply(l));return g.selfMultiply(h).selfAdd(d.selfMultiply(f)).selfAdd(p.selfMultiply(c)).doubleValue()>0},vo.checkRobustInCircle=function(t,e,n,i){var r=vo.isInCircleNonRobust(t,e,n,i),o=vo.isInCircleDDSlow(t,e,n,i),s=vo.isInCircleCC(t,e,n,i),a=hi.circumcentre(t,e,n);A.out.println("p radius diff a = "+Math.abs(i.distance(a)-t.distance(a))/t.distance(a)),r===o&&r===s||(A.out.println("inCircle robustness failure (double result = "+r+", DD result = "+o+", CC result = "+s+")"),A.out.println(Ht.toLineString(new Dt([t,e,n,i]))),A.out.println("Circumcentre = "+Ht.toPoint(a)+" radius = "+t.distance(a)),A.out.println("p radius diff a = "+Math.abs(i.distance(a)/t.distance(a)-1)),A.out.println("p radius diff b = "+Math.abs(i.distance(a)/e.distance(a)-1)),A.out.println("p radius diff c = "+Math.abs(i.distance(a)/n.distance(a)-1)),A.out.println())},vo.isInCircleDDFast=function(t,e,n,i){var r=R.sqr(t.x).selfAdd(R.sqr(t.y)).selfMultiply(vo.triAreaDDFast(e,n,i)),o=R.sqr(e.x).selfAdd(R.sqr(e.y)).selfMultiply(vo.triAreaDDFast(t,n,i)),s=R.sqr(n.x).selfAdd(R.sqr(n.y)).selfMultiply(vo.triAreaDDFast(t,e,i)),a=R.sqr(i.x).selfAdd(R.sqr(i.y)).selfMultiply(vo.triAreaDDFast(t,e,n));return r.selfSubtract(o).selfAdd(s).selfSubtract(a).doubleValue()>0},vo.isInCircleCC=function(t,e,n,i){var r=hi.circumcentre(t,e,n),o=t.distance(r);return i.distance(r)-o<=0},vo.isInCircleNormalized=function(t,e,n,i){var r=t.x-i.x,o=t.y-i.y,s=e.x-i.x,a=e.y-i.y,u=n.x-i.x,l=n.y-i.y;return(r*r+o*o)*(s*l-u*a)+(s*s+a*a)*(u*o-r*l)+(u*u+l*l)*(r*a-s*o)>0},vo.isInCircleDDSlow=function(t,e,n,i){var r=R.valueOf(i.x),o=R.valueOf(i.y),s=R.valueOf(t.x),a=R.valueOf(t.y),u=R.valueOf(e.x),l=R.valueOf(e.y),c=R.valueOf(n.x),h=R.valueOf(n.y),f=s.multiply(s).add(a.multiply(a)).multiply(vo.triAreaDDSlow(u,l,c,h,r,o)),g=u.multiply(u).add(l.multiply(l)).multiply(vo.triAreaDDSlow(s,a,c,h,r,o)),d=c.multiply(c).add(h.multiply(h)).multiply(vo.triAreaDDSlow(s,a,u,l,r,o)),p=r.multiply(r).add(o.multiply(o)).multiply(vo.triAreaDDSlow(s,a,u,l,c,h));return f.subtract(g).add(d).subtract(p).doubleValue()>0},vo.isInCircleNonRobust=function(t,e,n,i){return(t.x*t.x+t.y*t.y)*vo.triArea(e,n,i)-(e.x*e.x+e.y*e.y)*vo.triArea(t,n,i)+(n.x*n.x+n.y*n.y)*vo.triArea(t,e,i)-(i.x*i.x+i.y*i.y)*vo.triArea(t,e,n)>0},vo.isInCircleRobust=function(t,e,n,i){return vo.isInCircleNormalized(t,e,n,i)},vo.triAreaDDSlow=function(t,e,n,i,r,o){return n.subtract(t).multiply(o.subtract(e)).subtract(i.subtract(e).multiply(r.subtract(t)))},vo.triAreaDDFast=function(t,e,n){var i=R.valueOf(e.x).selfSubtract(t.x).selfMultiply(R.valueOf(n.y).selfSubtract(t.y)),r=R.valueOf(e.y).selfSubtract(t.y).selfMultiply(R.valueOf(n.x).selfSubtract(t.x));return i.selfSubtract(r)},Zo(mo.prototype,{circleCenter:function(t,e){var n=new mo(this.getX(),this.getY()),i=new D(this.bisector(n,t),this.bisector(t,e)),r=null;try{r=new mo(i.getX(),i.getY())}catch(i){if(!(i instanceof C))throw i;A.err.println("a: "+n+" b: "+t+" c: "+e),A.err.println(i)}return r},dot:function(t){return this._p.x*t.getX()+this._p.y*t.getY()},magn:function(){return Math.sqrt(this._p.x*this._p.x+this._p.y*this._p.y)},getZ:function(){return this._p.z},bisector:function(t,e){var n=e.getX()-t.getX(),i=e.getY()-t.getY();return new D(new D(t.getX()+n/2,t.getY()+i/2,1),new D(t.getX()-i+n/2,t.getY()+n+i/2,1))},equals:function(){if(1===arguments.length){var t=arguments[0];return this._p.x===t.getX()&&this._p.y===t.getY()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this._p.distance(e.getCoordinate())0},getX:function(){return this._p.x},crossProduct:function(t){return this._p.x*t.getY()-this._p.y*t.getX()},setZ:function(t){this._p.z=t},times:function(t){return new mo(t*this._p.x,t*this._p.y)},cross:function(){return new mo(this._p.y,-this._p.x)},leftOf:function(t){return this.isCCW(t.orig(),t.dest())},toString:function(){return"POINT ("+this._p.x+" "+this._p.y+")"},sub:function(t){return new mo(this._p.x-t.getX(),this._p.y-t.getY())},getY:function(){return this._p.y},classify:function(t,e){var n=this,i=e.sub(t),r=n.sub(t),o=i.crossProduct(r);return o>0?mo.LEFT:o<0?mo.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?mo.BEHIND:i.magn()n?10*e:10*n,this._frameVertex[0]=new mo((t.getMaxX()+t.getMinX())/2,t.getMaxY()+i),this._frameVertex[1]=new mo(t.getMinX()-i,t.getMinY()-i),this._frameVertex[2]=new mo(t.getMaxX()+i,t.getMinY()-i),this._frameEnv=new b(this._frameVertex[0].getCoordinate(),this._frameVertex[1].getCoordinate()),this._frameEnv.expandToInclude(this._frameVertex[2].getCoordinate())},getTriangleCoordinates:function(t){var e=new Po;return this.visitTriangles(e,t),e.getTriangles()},getVertices:function(t){for(var e=new K,n=this._quadEdges.iterator();n.hasNext();){var i=n.next(),r=i.orig();!t&&this.isFrameVertex(r)||e.add(r);var o=i.dest();!t&&this.isFrameVertex(o)||e.add(o)}return e},fetchTriangleToVisit:function(t,e,n,i){var r=t,o=0,s=!1;do{this._triEdges[o]=r,this.isFrameEdge(r)&&(s=!0);var a=r.sym();i.contains(a)||e.push(a),i.add(r),o++,r=r.lNext()}while(r!==t);return s&&!n?null:this._triEdges},getEdges:function(){if(0===arguments.length)return this._quadEdges;if(1===arguments.length){for(var t=arguments[0],e=this.getPrimaryEdges(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createLineString([o.orig().getCoordinate(),o.dest().getCoordinate()])}return t.createMultiLineString(n)}},getVertexUniqueEdges:function(t){for(var e=new E,n=new K,i=this._quadEdges.iterator();i.hasNext();){var r=i.next(),o=r.orig();n.contains(o)||(n.add(o),!t&&this.isFrameVertex(o)||e.add(r));var s=r.sym(),a=s.orig();n.contains(a)||(n.add(a),!t&&this.isFrameVertex(a)||e.add(s))}return e},getTriangleEdges:function(t){var e=new Lo;return this.visitTriangles(e,t),e.getTriangleEdges()},getPrimaryEdges:function(t){this._visitedKey++;var e=new E,n=new ie;n.push(this._startingEdge);for(var i=new K;!n.empty();){var r=n.pop();if(!i.contains(r)){var o=r.getPrimary();!t&&this.isFrameEdge(o)||e.add(o),n.push(r.oNext()),n.push(r.sym().oNext()),i.add(r),i.add(r.sym())}}return e},delete:function(t){xo.splice(t,t.oPrev()),xo.splice(t.sym(),t.sym().oPrev());var e=t.sym(),n=t.rot(),i=t.rot().sym();this._quadEdges.remove(t),this._quadEdges.remove(e),this._quadEdges.remove(n),this._quadEdges.remove(i),t.delete(),e.delete(),n.delete(),i.delete()},locateFromEdge:function(t,e){for(var n=0,i=this._quadEdges.size(),r=e;;){if(++n>i)throw new Io(r.toLineSegment());if(t.equals(r.orig())||t.equals(r.dest()))break;if(t.rightOf(r))r=r.sym();else if(t.rightOf(r.oNext())){if(t.rightOf(r.dPrev()))break;r=r.dPrev()}else r=r.oNext()}return r},getTolerance:function(){return this._tolerance},getVoronoiCellPolygons:function(t){this.visitTriangles(new So,!0);for(var e=new E,n=this.getVertexUniqueEdges(!1).iterator();n.hasNext();){var i=n.next();e.add(this.getVoronoiCellPolygon(i,t))}return e},getVoronoiDiagram:function(t){var e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection(Vt.toGeometryArray(e))},getTriangles:function(t){for(var e=this.getTriangleCoordinates(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createPolygon(t.createLinearRing(o),null)}return t.createGeometryCollection(n)},insertSite:function(t){var e=this.locate(t);if(t.equals(e.orig(),this._tolerance)||t.equals(e.dest(),this._tolerance))return e;var n=this.makeEdge(e.orig(),t);xo.splice(n,e);var i=n;do{e=(n=this.connect(e,n.sym())).oPrev()}while(e.lNext()!==i);return i},locate:function(){if(1===arguments.length){if(arguments[0]instanceof mo){var t=arguments[0];return this._locator.locate(t)}if(arguments[0]instanceof g){var e=arguments[0];return this._locator.locate(new mo(e))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this._locator.locate(new mo(n));if(null===r)return null;var o=r;r.dest().getCoordinate().equals2D(n)&&(o=r.sym());var s=o;do{if(s.dest().getCoordinate().equals2D(i))return s;s=s.oNext()}while(s!==o);return null}},interfaces_:function(){return[]},getClass:function(){return No}}),No.getTriangleEdges=function(t,e){if(e[0]=t,e[1]=e[0].lNext(),e[2]=e[1].lNext(),e[2].lNext()!==e[0])throw new r("Edges do not form a triangle")},Zo(So.prototype,{visit:function(t){for(var e=t[0].orig().getCoordinate(),n=t[1].orig().getCoordinate(),i=t[2].orig().getCoordinate(),r=new mo(hi.circumcentre(e,n,i)),o=0;o<3;o++)t[o].rot().setOrig(r)},interfaces_:function(){return[Co]},getClass:function(){return So}}),Zo(Lo.prototype,{getTriangleEdges:function(){return this._triList},visit:function(t){this._triList.add(t.clone())},interfaces_:function(){return[Co]},getClass:function(){return Lo}}),Zo(Mo.prototype,{visit:function(t){this._triList.add([t[0].orig(),t[1].orig(),t[2].orig()])},getTriangleVertices:function(){return this._triList},interfaces_:function(){return[Co]},getClass:function(){return Mo}}),Zo(Po.prototype,{checkTriangleSize:function(t){t.length>=2?Ht.toLineString(t[0],t[1]):t.length>=1&&Ht.toPoint(t[0])},visit:function(t){this._coordList.clear();for(var e=0;e<3;e++){var n=t[e].orig();this._coordList.add(n.getCoordinate())}if(this._coordList.size()>0){this._coordList.closeRing();var i=this._coordList.toCoordinateArray();if(4!==i.length)return null;this._triCoords.add(i)}},getTriangles:function(){return this._triCoords},interfaces_:function(){return[Co]},getClass:function(){return Po}}),No.TriangleCircumcentreVisitor=So,No.TriangleEdgesListVisitor=Lo,No.TriangleVertexListVisitor=Mo,No.TriangleCoordinatesVisitor=Po,No.EDGE_COINCIDENCE_TOL_FACTOR=1e3,Zo(Ro.prototype,{getLineSegment:function(){return this._ls},getEndZ:function(){return this._ls.getCoordinate(1).z},getStartZ:function(){return this._ls.getCoordinate(0).z},intersection:function(t){return this._ls.intersection(t.getLineSegment())},getStart:function(){return this._ls.getCoordinate(0)},getEnd:function(){return this._ls.getCoordinate(1)},getEndY:function(){return this._ls.getCoordinate(1).y},getStartX:function(){return this._ls.getCoordinate(0).x},equalsTopo:function(t){return this._ls.equalsTopo(t.getLineSegment())},getStartY:function(){return this._ls.getCoordinate(0).y},setData:function(t){this._data=t},getData:function(){return this._data},getEndX:function(){return this._ls.getCoordinate(1).x},toString:function(){return this._ls.toString()},interfaces_:function(){return[]},getClass:function(){return Ro}}),Zo(Oo.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return Oo}}),Zo(To.prototype,{isRepeated:function(){return this._count>1},getRight:function(){return this._right},getCoordinate:function(){return this._p},setLeft:function(t){this._left=t},getX:function(){return this._p.x},getData:function(){return this._data},getCount:function(){return this._count},getLeft:function(){return this._left},getY:function(){return this._p.y},increment:function(){this._count=this._count+1},setRight:function(t){this._right=t},interfaces_:function(){return[]},getClass:function(){return To}}),Zo(Ao.prototype,{insert:function(){if(1===arguments.length){var t=arguments[0];return this.insert(t,null)}if(2===arguments.length){var e=arguments[0],n=arguments[1];if(null===this._root)return this._root=new To(e,n),this._root;if(this._tolerance>0){var i=this.findBestMatchNode(e);if(null!==i)return i.increment(),i}return this.insertExact(e,n)}},query:function(){if(1===arguments.length){var t=arguments[0],e=new E;return this.query(t,e),e}if(2===arguments.length)if(arguments[0]instanceof b&&$o(arguments[1],m)){var n=arguments[0],i=arguments[1];this.queryNode(this._root,n,!0,{interfaces_:function(){return[Oo]},visit:function(t){i.add(t)}})}else if(arguments[0]instanceof b&&$o(arguments[1],Oo)){var r=arguments[0],o=arguments[1];this.queryNode(this._root,r,!0,o)}},queryNode:function(t,e,n,i){if(null===t)return null;var r=null,o=null,s=null;n?(r=e.getMinX(),o=e.getMaxX(),s=t.getX()):(r=e.getMinY(),o=e.getMaxY(),s=t.getY());var a=s<=o;r0&&t=e||this._segmentIndex===e&&this._segmentFraction>=1},isValid:function(t){if(this._componentIndex<0||this._componentIndex>=t.getNumGeometries())return!1;var e=t.getGeometryN(this._componentIndex);return!(this._segmentIndex<0||this._segmentIndex>e.getNumPoints())&&((this._segmentIndex!==e.getNumPoints()||0===this._segmentFraction)&&!(this._segmentFraction<0||this._segmentFraction>1))},normalize:function(){this._segmentFraction<0&&(this._segmentFraction=0),this._segmentFraction>1&&(this._segmentFraction=1),this._componentIndex<0&&(this._componentIndex=0,this._segmentIndex=0,this._segmentFraction=0),this._segmentIndex<0&&(this._segmentIndex=0,this._segmentFraction=0),1===this._segmentFraction&&(this._segmentFraction=0,this._segmentIndex+=1)},toLowest:function(t){var e=t.getGeometryN(this._componentIndex).getNumPoints()-1;return this._segmentIndex=e.getNumPoints()-1)return n;var i=e.getCoordinateN(this._segmentIndex+1);return Bo.pointAlongSegmentByFraction(n,i,this._segmentFraction)},getSegmentFraction:function(){return this._segmentFraction},getSegment:function(t){var e=t.getGeometryN(this._componentIndex),n=e.getCoordinateN(this._segmentIndex);return this._segmentIndex>=e.getNumPoints()-1?new $t(e.getCoordinateN(e.getNumPoints()-2),n):new $t(n,e.getCoordinateN(this._segmentIndex+1))},clamp:function(t){if(this._componentIndex>=t.getNumGeometries())return this.setToEnd(t),null;if(this._segmentIndex>=t.getNumPoints()){var e=t.getGeometryN(this._componentIndex);this._segmentIndex=e.getNumPoints()-1,this._segmentFraction=1}},setToEnd:function(t){this._componentIndex=t.getNumGeometries()-1;var e=t.getGeometryN(this._componentIndex);this._segmentIndex=e.getNumPoints()-1,this._segmentFraction=1},compareTo:function(t){var e=t;return this._componentIndexe._componentIndex?1:this._segmentIndexe._segmentIndex?1:this._segmentFractione._segmentFraction?1:0},clone:function(){return new Bo(this._componentIndex,this._segmentIndex,this._segmentFraction)},toString:function(){return"LinearLoc["+this._componentIndex+", "+this._segmentIndex+", "+this._segmentFraction+"]"},isOnSameSegment:function(t){return this._componentIndex===t._componentIndex&&(this._segmentIndex===t._segmentIndex||(t._segmentIndex-this._segmentIndex==1&&0===t._segmentFraction||this._segmentIndex-t._segmentIndex==1&&0===this._segmentFraction))},snapToVertex:function(t,e){if(this._segmentFraction<=0||this._segmentFraction>=1)return null;var n=this.getSegmentLength(t),i=this._segmentFraction*n,r=n-i;i<=r&&it?1:this._segmentIndexe?1:this._segmentFractionn?1:0},getSegmentLength:function(t){var e=t.getGeometryN(this._componentIndex),n=this._segmentIndex;this._segmentIndex>=e.getNumPoints()-1&&(n=e.getNumPoints()-2);var i=e.getCoordinateN(n),r=e.getCoordinateN(n+1);return i.distance(r)},isVertex:function(){return this._segmentFraction<=0||this._segmentFraction>=1},interfaces_:function(){return[s]},getClass:function(){return Bo}}),Bo.getEndLocation=function(t){var e=new Bo;return e.setToEnd(t),e},Bo.pointAlongSegmentByFraction=function(t,e,n){return n<=0?t:n>=1?e:new g((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y,(e.z-t.z)*n+t.z)},Bo.compareLocationValues=function(t,e,n,i,r,o){return ti?1:er?1:no?1:0},Zo(jo.prototype,{getComponentIndex:function(){return this._componentIndex},getLine:function(){return this._currentLine},getVertexIndex:function(){return this._vertexIndex},getSegmentEnd:function(){return this._vertexIndex=this._currentLine.getNumPoints()&&(this._componentIndex++,this.loadCurrentLine(),this._vertexIndex=0)},loadCurrentLine:function(){if(this._componentIndex>=this._numLines)return this._currentLine=null,null;this._currentLine=this._linearGeom.getGeometryN(this._componentIndex)},getSegmentStart:function(){return this._currentLine.getCoordinateN(this._vertexIndex)},isEndOfLine:function(){return!(this._componentIndex>=this._numLines)&&!(this._vertexIndex=this._numLines)&&!(this._componentIndex===this._numLines-1&&this._vertexIndex>=this._currentLine.getNumPoints())},interfaces_:function(){return[]},getClass:function(){return jo}}),jo.segmentEndVertexIndex=function(t){return t.getSegmentFraction()>0?t.getSegmentIndex()+1:t.getSegmentIndex()},Zo(zo.prototype,{indexOf:function(t){return this.indexOfFromStart(t,null)},indexOfFromStart:function(t,e){for(var n=o.MAX_VALUE,i=0,r=0,s=-1,a=new $t,u=new jo(this._linearGeom);u.hasNext();u.next())if(!u.isEndOfLine()){a.p0=u.getSegmentStart(),a.p1=u.getSegmentEnd();var l=a.distance(t),c=a.segmentFraction(t),h=u.getComponentIndex(),f=u.getVertexIndex();l=0,"computed location is before specified minimum location"),i},interfaces_:function(){return[]},getClass:function(){return zo}}),zo.indexOf=function(t,e){return new zo(t).indexOf(e)},zo.indexOfAfter=function(t,e,n){return new zo(t).indexOfAfter(e,n)},Zo(Yo.prototype,{indicesOf:function(t){var e=t.getGeometryN(0).getCoordinateN(0),n=t.getGeometryN(t.getNumGeometries()-1),i=n.getCoordinateN(n.getNumPoints()-1),r=new zo(this._linearGeom),o=new Array(2).fill(null);return o[0]=r.indexOf(e),0===t.getLength()?o[1]=o[0].clone():o[1]=r.indexOfAfter(i,o[0]),o},interfaces_:function(){return[]},getClass:function(){return Yo}}),Yo.indicesOf=function(t,e){return new Yo(t).indicesOf(e)},Zo(Xo.prototype,{getGeometry:function(){return this.endLine(),this._geomFact.buildGeometry(this._lines)},getLastCoordinate:function(){return this._lastPt},endLine:function(){if(null===this._coordList)return null;if(this._ignoreInvalidLines&&this._coordList.size()<2)return this._coordList=null,null;var t=this._coordList.toCoordinateArray(),e=t;this._fixInvalidLines&&(e=this.validCoordinateSequence(t)),this._coordList=null;var n=null;try{n=this._geomFact.createLineString(e)}catch(t){if(!(t instanceof r))throw t;if(!this._ignoreInvalidLines)throw t}null!==n&&this._lines.add(n)},setFixInvalidLines:function(t){this._fixInvalidLines=t},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];null===this._coordList&&(this._coordList=new w),this._coordList.add(e,n),this._lastPt=e}},setIgnoreInvalidLines:function(t){this._ignoreInvalidLines=t},validCoordinateSequence:function(t){return t.length>=2?t:[t[0],t[0]]},interfaces_:function(){return[]},getClass:function(){return Xo}}),Zo(Vo.prototype,{computeLinear:function(t,e){var n=new Xo(this._line.getFactory());n.setFixInvalidLines(!0),t.isVertex()||n.add(t.getCoordinate(this._line));for(var i=new jo(this._line,t);i.hasNext()&&!(e.compareLocationValues(i.getComponentIndex(),i.getVertexIndex(),0)<0);i.next()){var r=i.getSegmentStart();n.add(r),i.isEndOfLine()&&n.endLine()}return e.isVertex()||n.add(e.getCoordinate(this._line)),n.getGeometry()},computeLine:function(t,e){var n=this._line.getCoordinates(),i=new w,r=t.getSegmentIndex();t.getSegmentFraction()>0&&(r+=1);var o=e.getSegmentIndex();1===e.getSegmentFraction()&&(o+=1),o>=n.length&&(o=n.length-1),t.isVertex()||i.add(t.getCoordinate(this._line));for(var s=r;s<=o;s++)i.add(n[s]);e.isVertex()||i.add(e.getCoordinate(this._line)),i.size()<=0&&i.add(t.getCoordinate(this._line));var a=i.toCoordinateArray();return a.length<=1&&(a=[a[0],a[0]]),this._line.getFactory().createLineString(a)},extract:function(t,e){return e.compareTo(t)<0?this.reverse(this.computeLinear(e,t)):this.computeLinear(t,e)},reverse:function(t){return t instanceof wt?t.reverse():t instanceof ft?t.reverse():(f.shouldNeverReachHere("non-linear geometry encountered"),null)},interfaces_:function(){return[]},getClass:function(){return Vo}}),Vo.extract=function(t,e,n){return new Vo(t).extract(e,n)},Zo(Uo.prototype,{clampIndex:function(t){var e=t.clone();return e.clamp(this._linearGeom),e},project:function(t){return zo.indexOf(this._linearGeom,t)},checkGeometryType:function(){if(!(this._linearGeom instanceof wt||this._linearGeom instanceof ft))throw new r("Input geometry must be linear")},extractPoint:function(){if(1===arguments.length)return arguments[0].getCoordinate(this._linearGeom);if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.toLowest(this._linearGeom);return n.getSegment(this._linearGeom).pointAlongOffset(n.getSegmentFraction(),e)}},isValidIndex:function(t){return t.isValid(this._linearGeom)},getEndIndex:function(){return Bo.getEndLocation(this._linearGeom)},getStartIndex:function(){return new Bo},indexOfAfter:function(t,e){return zo.indexOfAfter(this._linearGeom,t,e)},extractLine:function(t,e){return Vo.extract(this._linearGeom,t,e)},indexOf:function(t){return zo.indexOf(this._linearGeom,t)},indicesOf:function(t){return Yo.indicesOf(this._linearGeom,t)},interfaces_:function(){return[]},getClass:function(){return Uo}}),Zo(Ho.prototype,{indexOf:function(t){return this.indexOfFromStart(t,-1)},indexOfFromStart:function(t,e){for(var n=o.MAX_VALUE,i=e,r=0,s=new $t,a=new jo(this._linearGeom);a.hasNext();){if(!a.isEndOfLine()){s.p0=a.getSegmentStart(),s.p1=a.getSegmentEnd();var u=s.distance(t),l=this.segmentNearestMeasure(s,t,r);ue&&(i=l,n=u),r+=s.getLength()}a.next()}return i},indexOfAfter:function(t,e){if(e<0)return this.indexOf(t);var n=this._linearGeom.getLength();if(n=e,"computed index is before specified minimum index"),i},segmentNearestMeasure:function(t,e,n){var i=t.projectionFactor(e);return i<=0?n:i<=1?n+i*t.getLength():n+t.getLength()},interfaces_:function(){return[]},getClass:function(){return Ho}}),Ho.indexOf=function(t,e){return new Ho(t).indexOf(e)},Ho.indexOfAfter=function(t,e,n){return new Ho(t).indexOfAfter(e,n)},Zo(Wo.prototype,{getLength:function(t){for(var e=0,n=new jo(this._linearGeom);n.hasNext();){if(!n.isEndOfLine()){var i=n.getSegmentStart(),r=n.getSegmentEnd().distance(i);if(t.getComponentIndex()===n.getComponentIndex()&&t.getSegmentIndex()===n.getVertexIndex())return e+r*t.getSegmentFraction();e+=r}n.next()}return e},resolveHigher:function(t){if(!t.isEndpoint(this._linearGeom))return t;var e=t.getComponentIndex();if(e>=this._linearGeom.getNumGeometries()-1)return t;do{e++}while(et){var o=(t-e)/r,s=n.getComponentIndex(),a=n.getVertexIndex();return new Bo(s,a,o)}e+=r}n.next()}return Bo.getEndLocation(this._linearGeom)},interfaces_:function(){return[]},getClass:function(){return Wo}}),Wo.getLength=function(t,e){return new Wo(t).getLength(e)},Wo.getLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return(o=new Wo(t)).getLocation(e)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new Wo(n);return o.getLocation(i,r)}},Zo(Jo.prototype,{clampIndex:function(t){var e=this.positiveIndex(t),n=this.getStartIndex();if(ei?i:e},locationOf:function(){if(1===arguments.length){var t=arguments[0];return Wo.getLocation(this._linearGeom,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return Wo.getLocation(this._linearGeom,e,n)}},project:function(t){return Ho.indexOf(this._linearGeom,t)},positiveIndex:function(t){return t>=0?t:this._linearGeom.getLength()+t},extractPoint:function(){if(1===arguments.length){var t=arguments[0];return(i=Wo.getLocation(this._linearGeom,t)).getCoordinate(this._linearGeom)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=Wo.getLocation(this._linearGeom,e),r=i.toLowest(this._linearGeom);return r.getSegment(this._linearGeom).pointAlongOffset(r.getSegmentFraction(),n)}},isValidIndex:function(t){return t>=this.getStartIndex()&&t<=this.getEndIndex()},getEndIndex:function(){return this._linearGeom.getLength()},getStartIndex:function(){return 0},indexOfAfter:function(t,e){return Ho.indexOfAfter(this._linearGeom,t,e)},extractLine:function(t,e){new Uo(this._linearGeom);var n=this.clampIndex(t),i=this.clampIndex(e),r=n===i,o=this.locationOf(n,r),s=this.locationOf(i);return Vo.extract(this._linearGeom,o,s)},indexOf:function(t){return Ho.indexOf(this._linearGeom,t)},indicesOf:function(t){var e=Yo.indicesOf(this._linearGeom,t);return[Wo.getLength(this._linearGeom,e[0]),Wo.getLength(this._linearGeom,e[1])]},interfaces_:function(){return[]},getClass:function(){return Jo}}),n.Coordinate=g,n.CoordinateList=w,n.Envelope=b,n.LineSegment=$t,n.GeometryFactory=Vt,n.Geometry=q,n.Point=It,n.LineString=wt,n.LinearRing=Lt,n.Polygon=Nt,n.GeometryCollection=ht,n.MultiPoint=St,n.MultiLineString=ft,n.MultiPolygon=Mt,n.Dimension=ut,n.IntersectionMatrix=te,n.PrecisionModel=Yt,n.Centroid=ee,n.CGAlgorithms=Qt,n.ConvexHull=oe,n.InteriorPointArea=Hn,n.InteriorPointLine=Jn,n.InteriorPointPoint=Zn,n.RobustLineIntersector=Jt,n.MCPointInRing=ui,n.MinimumBoundingCircle=fi,n.MinimumDiameter=gi,n.Densifier=di,n.LineDissolver=Ei,n.GeometryGraph=Bn,n.quadtree=hs,n.strtree=fs,n.GeoJSONReader=Li,n.GeoJSONWriter=Mi,n.OL3Parser=Oi,n.WKTReader=Pi,n.WKTWriter=Ht,n.BoundaryOp=gt,n.IsSimpleOp=Ai,n.BufferOp=er,n.BufferParameters=Fi,n.DistanceOp=sr,n.LineMerger=mr,n.OverlayOp=Xn,n.Polygonizer=Dr,n.RelateOp=Vr,n.CascadedPolygonUnion=Hr,n.PointGeometryUnion=Wr,n.UnaryUnionOp=Zr,n.UnionInteracting=Kr,n.UnionOp=Qr,n.IsValidOp=Rr,n.ConsistentAreaTester=Lr,n.GeometryPrecisionReducer=to,n.DouglasPeuckerSimplifier=no,n.TopologyPreservingSimplifier=co,n.ConformingDelaunayTriangulationBuilder=qo,n.DelaunayTriangulationBuilder=Go,n.VoronoiDiagramBuilder=ko,n.quadedge=_s,n.LengthIndexedLine=Jo,n.LengthLocationMap=Wo,n.LinearGeometryBuilder=Xo,n.LinearIterator=jo,n.LinearLocation=Bo,n.LocationIndexedLine=Uo},{}],31:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){switch(u.getType(t)){case"Point":return t;case"Polygon":var n=[];l.coordEach(t,function(t){n.push(t)});var i,c,h,f,g,d,p,_,v=s(t,e),m=v.geometry.coordinates,y=0,x=0,E=0,w=n.map(function(t){return[t[0]-m[0],t[1]-m[1]]});for(i=0;i=Math.abs(c)?l>0?o<=i&&i<=a:a<=i&&i<=o:c>0?s<=r&&r<=u:u<=r&&r<=s)}var a=t("@turf/helpers"),u=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],36:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return r(t);case"FeatureCollection":return s(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return a(t);default:throw new Error("unknown GeoJSON type")}}function r(t){var e={type:"Feature"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=o(t.properties),e.geometry=a(t.geometry),e}function o(t){var e={};return t?(Object.keys(t).forEach(function(n){var i=t[n];"object"==typeof i?(i.length&&(e[n]=i.map(function(t){return t})),e[n]=o(i)):e[n]=i}),e):e}function s(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return r(t)}),e}function a(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return a(t)}),e):(e.coordinates=u(t.coordinates),e)}function u(t){return"object"!=typeof t[0]?t.slice():t.map(function(t){return u(t)})}e.exports=i,e.exports.default=i},{}],37:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.minPoints,r=n.units;if(l.collectionOf(t,"Point","Input must contain Points"),null===e||void 0===e)throw new Error("maxDistance is required");if(!(Math.sign(e)>0))throw new Error("Invalid maxDistance");if(!(void 0===i||null===i||Math.sign(i)>0))throw new Error("Invalid minPoints");t=o(t,!0),i=i||3;var h=new c.DBSCAN,f=-1;return h.run(a.coordAll(t),u.convertLength(e,r),i,s).forEach(function(e){f++,e.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=f,n.properties.dbscan="core"})}),h.noise.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"}),t}var o=i(t("@turf/clone")),s=i(t("@turf/distance")),a=t("@turf/meta"),u=t("@turf/helpers"),l=t("@turf/invariant"),c=t("density-clustering");e.exports=r,e.exports.default=r},{"@turf/clone":36,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"density-clustering":42}],38:[function(t,e,n){function i(t,e,n,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,i)}i.prototype.run=function(t,e,n,i){this._init(t,e,n,i);for(var r=0;r=this.minPts&&(e=this._mergeArrays(e,r))}1!==this._assigned[i]&&this._addToCluster(i,t)}},i.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},i.prototype._regionQuery=function(t){for(var e=[],n=0;n0){for(u=0;u=0);return t},i.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,i=0;i=this.minPts)return n},i.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],i=0,r=this.dataset.length;ir&&(n=i):eu&&(n=u),!1!==i&&void 0!==i||(t=r(t,!0));var l=s.coordAll(t),c=l.slice(0,n),h=a(l,n,c),f={};return h.centroids.forEach(function(t,e){f[e]=t}),s.featureEach(t,function(t,e){var n=h.idxs[e];t.properties.cluster=n,t.properties.centroid=f[n]}),t}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clone")),o=t("@turf/invariant"),s=t("@turf/meta"),a=t("skmeans");e.exports=i,e.exports.default=i},{"@turf/clone":36,"@turf/invariant":84,"@turf/meta":105,skmeans:46}],44:[function(t,e,n){"use strict";e.exports={eudist:function(t,e,n){for(var i=t.length,r=0,o=0;o0;i.length0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,i.push(a))}if(i.length0,u=t[Math.floor(Math.random()*s)],l=a?u.join("_"):""+u;for(i.push(u),{}[l]=!0;i.length0,m=[];if(n)o="kmrand"==n?a(t,e):"kmpp"==n?u(t,e):n;else for(var y={};o.lengthn;){if(s-n>600){var u=s-n+1,l=e-n+1,c=Math.log(u),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1);i(t,e,Math.max(n,Math.floor(e-l*h/u+f)),Math.min(s,Math.floor(e+(u-l)*h/u+f)),a)}var g=t[e],d=n,p=s;for(r(t,n,e),a(t[s],g)>0&&r(t,n,s);d0;)p--}0===a(t[n],g)?r(t,n,p):r(t,++p,s),p<=e&&(n=p+1),e<=p&&(s=p-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function o(t,e){return te?1:0}e.exports=i},{}],50:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(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 r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,n,i,r){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=i||(o=e+Math.ceil((n-e)/i/2)*i,m(t,o,e,n,r),s.push(e,o,o,n))}e.exports=i;var m=t("quickselect");i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!p(t,e))return n;for(var r,o,s,a,u=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),a=_(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,a,u,l,h,f;for(l=h=1/0,i=e;i<=n-e;i++)a=g(r=s(t,0,i,this.toBBox),o=s(t,i,n,this.toBBox)),u=c(r)+c(o),a=e;r--)o=t.children[r],a(c,t.leaf?u(o):o),f+=h(c);return f},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():o(t[n],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]+"};")}}},{quickselect:49}],51:[function(t,e,n){"use strict";function i(t){function e(t,e,i){i?n[e].coordinates=n[e].coordinates.concat(t.geometry.coordinates):n[e].coordinates.push(t.geometry.coordinates),n[e].properties.push(t.properties)}var n={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},i=Object.keys(n).reduce(function(t,e){return t[e.replace("Multi","")]=e,t},{});return o.featureEach(t,function(t){t.geometry&&(n[t.geometry.type]?e(t,t.geometry.type,!0):i[t.geometry.type]&&e(t,i[t.geometry.type],!1))}),r.featureCollection(Object.keys(n).filter(function(t){return n[t].coordinates.length}).sort().map(function(t){var e={type:t,coordinates:n[t].coordinates},i={collectedProperties:n[t].properties};return r.feature(e,i)}))}var r=t("@turf/helpers"),o=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],52:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==d.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=g(t));var i=[],r=p.lineReduce(t,function(t,e){var n=s(t,e);return n||(i.push(t),e)});return r&&i.push(r),i.length?1===i.length?i[0]:_.multiLineString(i.map(function(t){return t.coordinates})):null}function o(t){return t[0].toString()+","+t[1].toString()}function s(t,e){var n,i=t.geometry.coordinates,r=e.geometry.coordinates,s=o(i[0]),a=o(i[i.length-1]),u=o(r[0]),l=o(r[r.length-1]);if(s===l)n=r.concat(i.slice(1));else if(u===a)n=i.concat(r.slice(1));else if(s===u)n=i.slice(1).reverse().concat(r);else{if(a!==l)return null;n=i.concat(r.reverse().slice(1))}return _.lineString(n)}function a(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==d.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=g(t));var i=[];p.flattenEach(t,function(t){i.push(t.geometry)});var r=m.topology({geoms:_.geometryCollection(i).geometry});return v.merge(r,r.objects.geoms.geometries)}function u(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==d.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=g(t));var i=l(t);if(!i)throw new Error("geojson must be homogenous");switch(i){case"LineString":return r(t,e);case"Polygon":return a(t,e);default:throw new Error(i+" is not supported")}}function l(t){var e={};p.flattenEach(t,function(t){e[t.geometry.type]=!0});var n=Object.keys(e);return 1===n.length?n[0]:null}function c(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");if(!t)throw new Error("points is required");var n=e.maxEdge||1/0;if(!_.isNumber(n))throw new Error("maxEdge is invalid");var i=h(t),r=f(i);if(r.features=r.features.filter(function(t){var i=t.geometry.coordinates[0][0],r=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=y(i,r,e),a=y(r,o,e),u=y(i,o,e);return s<=n&&a<=n&&u<=n}),r.features.length<1)return null;var o=u(r,e);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),_.feature(o)}function h(t){var e=[],n={};return p.featureEach(t,function(t){if(t.geometry){var i=t.geometry.coordinates.join("-");n.hasOwnProperty(i)||(e.push(t),n[i]=!0)}}),_.featureCollection(e)}var f=i(t("@turf/tin")),g=i(t("@turf/clone")),d=t("@turf/invariant"),p=t("@turf/meta"),_=t("@turf/helpers"),v=t("topojson-client"),m=t("topojson-server"),y=i(t("@turf/distance"));e.exports=c,e.exports.default=c},{"@turf/clone":36,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/tin":146,"topojson-client":53,"topojson-server":54}],53:[function(t,e,n){!function(t,i){i("object"==typeof n&&void 0!==e?n:t.topojson=t.topojson||{})}(this,function(t){"use strict";function e(t,e){var i=e.id,r=e.bbox,o=null==e.properties?{}:e.properties,s=n(t,e);return null==i&&null==r?{type:"Feature",properties:o,geometry:s}:null==r?{type:"Feature",id:i,properties:o,geometry:s}:{type:"Feature",id:i,bbox:r,properties:o,geometry:s}}function n(t,e){function n(t,e){e.length&&e.pop();for(var n=h[t<0?~t:t],i=0,r=n.length;i1)i=r(t,e,n);else for(o=0,i=new Array(s=t.arcs.length);o1)for(var r,o,u=1,l=s(i[0]);ul&&(o=i[0],i[0]=i[u],i[u]=o,l=r);return i})}}var a=function(t){return t},u=function(t){if(null==t)return a;var e,n,i=t.scale[0],r=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*i+o,c[1]=(n+=t[1])*r+s;ua&&(a=t[0]),t[1]l&&(l=t[1])}function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var i,r=u(t.transform),o=1/0,s=o,a=-o,l=-o;t.arcs.forEach(function(t){for(var e,n=-1,i=t.length;++na&&(a=e[0]),e[1]l&&(l=e[1])});for(i in t.objects)n(t.objects[i]);return[o,s,a,l]},c=function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n},h=function(t,e){function n(e){var n,i=t.arcs[e<0?~e:e],r=i[0];return t.transform?(n=[0,0],i.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=i[i.length-1],e<0?[n,r]:[r,n]}function i(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){r[t<0?~t:t]=1}),a.push(i)}}var r={},o={},s={},a=[],u=-1;return e.forEach(function(n,i){var r,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=e[++u],e[u]=n,e[i]=r)}),e.forEach(function(t){var e,i,r=n(t),a=r[0],u=r[1];if(e=s[a])if(delete s[e.end],e.push(t),e.end=u,i=o[u]){delete o[i.start];var l=i===e?e:e.concat(i);o[l.start=e.start]=s[l.end=i.end]=l}else o[e.start]=s[e.end]=e;else if(e=o[u])if(delete o[e.start],e.unshift(t),e.start=a,i=s[a]){delete s[i.end];var c=i===e?e:i.concat(e);o[c.start=i.start]=s[c.end=e.end]=c}else o[e.start]=s[e.end]=e;else o[(e=[t]).start=a]=s[e.end=u]=e}),i(s,o),i(o,s),e.forEach(function(t){r[t<0?~t:t]||a.push([t])}),a},f=function(t,e){for(var n=0,i=t.length;n>>1;t[r]=2))throw new Error("n must be 鈮�2");var r,o=(c=t.bbox||l(t))[0],s=c[1],a=c[2],u=c[3];e={scale:[a-o?(a-o)/(r-1):1,u-s?(u-s)/(r-1):1],translate:[o,s]}}var c,h,f=g(e),d=t.objects,p={};for(h in d)p[h]=i(d[h]);return{type:"Topology",bbox:c,transform:e,objects:p,arcs:t.arcs.map(function(t){var e,n=0,i=1,r=t.length,o=new Array(r);for(o[0]=f(t[0],0);++n>1);ea&&(a=e),nu&&(u=n)}function i(t){t.forEach(n)}function r(t){t.forEach(i)}var o=1/0,s=1/0,a=-1/0,u=-1/0,l={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){i(t.arcs)},MultiLineString:function(t){t.arcs.forEach(i)},Polygon:function(t){t.arcs.forEach(i)},MultiPolygon:function(t){t.arcs.forEach(r)}};for(var c in t)e(t[c]);return a>=o&&u>=s?[o,s,a,u]:void 0},c=function(t,e,n,i,r){3===arguments.length&&(i=Array,r=null);for(var o=new i(t=1<=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=i,!0},has:function(i){for(var a=e(i)&s,u=o[a],l=0;u!=r;){if(n(u,i))return!0;if(++l>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;e=t)throw new Error("full hashmap");c=s[l=l+1&u]}return s[l]=i,a[l]=o,o},maybeSet:function(i,o){for(var l=e(i)&u,c=s[l],h=0;c!=r;){if(n(c,i))return a[l];if(++h>=t)throw new Error("full hashmap");c=s[l=l+1&u]}return s[l]=i,a[l]=o,o},get:function(i,o){for(var l=e(i)&u,c=s[l],h=0;c!=r;){if(n(c,i))return a[l];if(++h>=t)break;c=s[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e>7^p[2]^p[3])},v=function(t){function e(t,e,n,i){if(p[n]!==t){p[n]=t;var r=v[n];if(r>=0){var o=m[n];r===e&&o===i||r===i&&o===e||(++x,y[n]=1)}else v[n]=e,m[n]=i}}function n(t){return _(u[t])}function i(t,e){return f(u[t],u[e])}var r,o,s,a,u=t.coordinates,l=t.lines,g=t.rings,d=function(){for(var t=h(1.4*u.length,n,i,Int32Array,-1,Int32Array),e=new Int32Array(u.length),r=0,o=u.length;r0&&o&&b(t,o,e),c=y(m(E(t))),f=c.coordinates,g=h(1.4*c.arcs.length,a,u);t=c.objects,c.bbox=o,c.arcs=c.arcs.map(function(t,e){return g.set(t,e),f.slice(t[0],t[1]+1)}),delete c.coordinates,f=null;var d={GeometryCollection:function(t){t.geometries.forEach(n)},LineString:function(t){t.arcs=i(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(i)},Polygon:function(t){t.arcs=t.arcs.map(i)},MultiPolygon:function(t){t.arcs=t.arcs.map(r)}};for(var p in t)n(t[p]);return s&&(c.transform=s,c.arcs=x(c.arcs)),c},Object.defineProperty(t,"__esModule",{value:!0})})},{}],55:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.concavity||1/0,i=[];if(r.coordEach(t,function(t){i.push([t[0],t[1]])}),!i.length)return null;var a=s(i,n);return a.length>3?o.polygon([a]):null}var r=t("@turf/meta"),o=t("@turf/helpers"),s=t("concaveman");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105,concaveman:56}],56:[function(t,e,n){"use strict";function i(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var i,o=h(t),s=_(16,["[0]","[1]","[0]","[1]"]).load(t),a=[],u=0;ua||c.push({node:g,dist:p})}for(;c.length&&!c.peek().node.children;){var _=c.pop(),v=_.node,y=d(v,e,n),x=d(v,i,r);if(_.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function u(t,e,n){for(var i=Math.min(t[0],e[0]),r=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:i,minY:r,maxX:o,maxY:s}),u=0;u0!=x(t,e,i)>0&&x(n,i,t)>0!=x(n,i,e)>0}function c(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function h(t){for(var e=t[0],n=t[0],i=t[0],r=t[0],o=0;oi[0]&&(i=s),s[1]r[1]&&(r=s)}var a=[e,n,i,r],u=a.slice();for(o=0;o1?(i=n[0],r=n[1]):a>0&&(i+=o*a,r+=s*a)}return o=t[0]-i,s=t[1]-r,o*o+s*s}function p(t,e,n,i,r,o,s,a){var u,l,c,h,f=n-t,g=i-e,d=s-r,p=a-o,_=t-r,v=e-o,m=f*f+g*g,y=f*d+g*p,x=d*d+p*p,E=f*_+g*v,w=d*_+p*v,b=m*x-y*y,I=b,C=b;0===b?(l=0,I=1,h=w,C=x):(h=m*w-y*E,(l=y*w-x*E)<0?(l=0,h=w,C=x):l>I&&(l=I,h=w+y,C=x)),h<0?(h=0,-E<0?l=0:-E>m?l=I:(l=-E,I=m)):h>C&&(h=C,-E+y<0?l=0:-E+y>m?l=I:(l=-E+y,I=m)),u=0===l?0:l/I;var N=(1-(c=0===h?0:h/C))*r+c*s-((1-u)*t+u*n),S=(1-c)*o+c*a-((1-u)*e+u*i);return N*N+S*S}var _=t("rbush"),v=t("monotone-convex-hull-2d"),m=t("tinyqueue"),y=t("point-in-polygon"),x=t("robust-orientation")[3];e.exports=i,e.exports.default=i},{"monotone-convex-hull-2d":57,"point-in-polygon":58,rbush:60,"robust-orientation":61,tinyqueue:65}],57:[function(t,e,n){"use strict";e.exports=function(t){var e=t.length;if(e<3){for(var n=new Array(e),r=0;r1&&i(t[s[c-2]],t[s[c-1]],l)<=0;)c-=1,s.pop();for(s.push(u),c=a.length;c>1&&i(t[a[c-2]],t[a[c-1]],l)>=0;)c-=1,a.pop();a.push(u)}for(var n=new Array(a.length+s.length-2),h=0,r=0,f=s.length;r0;--g)n[h++]=a[g];return n};var i=t("robust-orientation")[3]},{"robust-orientation":61}],58:[function(t,e,n){e.exports=function(t,e){for(var n=t[0],i=t[1],r=!1,o=0,s=e.length-1;oi!=c>i&&n<(l-a)*(i-u)/(c-u)+a&&(r=!r)}return r}},{}],59:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],60:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{dup:50,quickselect:59}],61:[function(t,e,n){"use strict";function i(t,e){for(var n=new Array(t.length-1),i=1;i>1;return["sum(",s(t.slice(0,e)),",",s(t.slice(e)),")"].join("")}function a(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;n0){if(o<=0)return s;i=r+o}else{if(!(r<0))return s;if(o>=0)return s;i=-(r+o)}var a=3.3306690738754716e-16*i;return s>=a||s<=-a?s:p(t,e,n)},function(t,e,n,i){var r=t[0]-i[0],o=e[0]-i[0],s=n[0]-i[0],a=t[1]-i[1],u=e[1]-i[1],l=n[1]-i[1],c=t[2]-i[2],h=e[2]-i[2],f=n[2]-i[2],g=o*l,d=s*u,p=s*a,v=r*l,m=r*u,y=o*a,x=c*(g-d)+h*(p-v)+f*(m-y),E=7.771561172376103e-16*((Math.abs(g)+Math.abs(d))*Math.abs(c)+(Math.abs(p)+Math.abs(v))*Math.abs(h)+(Math.abs(m)+Math.abs(y))*Math.abs(f));return x>E||-x>E?x:_(t,e,n,i)}];!function(){for(;v.length<=d;)v.push(u(v.length));for(var t=[],n=["slow"],i=0;i<=d;++i)t.push("a"+i),n.push("o"+i);for(var r=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],i=2;i<=d;++i)r.push("case ",i,":return o",i,"(",t.slice(0,i).join(),");");r.push("}var s=new Array(arguments.length);for(var i=0;i=r?(o=g,(c+=1)=r?(o=g,(c+=1)0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function r(t,e){return te?1:0}e.exports=i,e.exports.default=i,i.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,i=e[t];t>0;){var r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i},_down:function(t){for(var e=this.data,n=this.compare,i=this.length>>1,r=e[t];t=0)break;e[t]=a,t=o}e[t]=r}}},{}],66:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r=t*e,o=i*t,s=o-(o-t),a=t-s,u=i*e,l=u-(u-e),c=e-l,h=a*c-(r-s*l-a*l-s*c);return n?(n[0]=h,n[1]=r,n):[h,r]};var i=+(Math.pow(2,27)+1)},{}],67:[function(t,e,n){"use strict";e.exports=function(t,e,n){var i=t+e,r=i-t,o=e-r,s=t-(i-r);return n?(n[0]=s+o,n[1]=i,n):[s+o,i]}},{}],68:[function(t,e,n){"use strict";function i(t,e,n,i){if(i=i||{},!o.isObject(i))throw new Error("options is invalid");var s=i.units,a=r.getCoord(t),u=o.degreesToRadians(a[0]),l=o.degreesToRadians(a[1]),c=o.degreesToRadians(n),h=o.lengthToRadians(e,s),f=Math.asin(Math.sin(l)*Math.cos(h)+Math.cos(l)*Math.sin(h)*Math.cos(c)),g=u+Math.atan2(Math.sin(c)*Math.sin(h)*Math.cos(l),Math.cos(h)-Math.sin(l)*Math.sin(f));return o.point([o.radiansToDegrees(g),o.radiansToDegrees(f)])}var r=t("@turf/invariant"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],69:[function(t,e,n){"use strict";function i(t,e){var n=u.getGeom(t),i=u.getGeom(e),s=t.properties||{};if(n=r(n),i=r(i),!n)return null;if(!i)return a.feature(n,s);var l=new o.GeoJSONReader,c=l.read(n),h=l.read(i),f=o.OverlayOp.difference(c,h);if(f.isEmpty())return null;var g=(new o.GeoJSONWriter).write(f);return a.feature(g,s)}function r(t){switch(t.type){case"Polygon":return s(t)>1?t:null;case"MultiPolygon":var e=[];if(l.flattenEach(t,function(t){s(t)>1&&e.push(t.geometry.coordinates)}),e.length)return{type:"MultiPolygon",coordinates:e}}}var o=t("jsts-es"),s=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/area")),a=t("@turf/helpers"),u=t("@turf/invariant"),l=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/area":2,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"jsts-es":70}],70:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],71:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){var i,r;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach(function(e,o){var s=n(e,t);s>=0&&(void 0===r||s0&&0!==e)if(e>s[s.length-1])e-=s.length;else{var i=o(e,s);0!==i&&(e-=i)}if(e!==+g){var u=r[e];u&&_&&(void 0!==n&&u.properties[n]!==_.properties[n]||c(_,u)&&a(_,u)&&(r[g]=h(_,u),s.push(t.properties.origIndexPosition),s.sort(function(t,e){return t-e}),f.remove(t),r.splice(e,1),_.properties.origIndexPosition=g,f.remove(_,function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition}),v=!0))}}),v){if(!_)continue;_.properties.origIndexPosition=g,f.insert(_),g--}}return r.forEach(function(t){delete t.properties.origIndexPosition,delete t.bbox}),i}function a(t,e){var n=p.lineString(g.coordAll(t)),i=p.lineString(g.coordAll(e));return f(n,i).features.length>0}var u=i(t("geojson-rbush")),l=i(t("@turf/clone")),c=i(t("@turf/boolean-overlap")),h=i(t("@turf/union")),f=i(t("@turf/line-intersect")),g=t("@turf/meta"),d=t("@turf/invariant"),p=t("@turf/helpers");e.exports=s,e.exports.default=s},{"@turf/boolean-overlap":18,"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-intersect":91,"@turf/meta":105,"@turf/union":152,"geojson-rbush":72}],72:[function(t,e,n){"use strict";function i(t,e,n,i,o){r(t,e,n||0,i||t.length-1,o||s)}function r(t,e,n,i,s){for(;i>n;){if(i-n>600){var a=i-n+1,u=e-n+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);r(t,e,Math.max(n,Math.floor(e-u*c/a+h)),Math.min(i,Math.floor(e+(a-u)*c/a+h)),s)}var f=t[e],g=n,d=i;for(o(t,n,e),s(t[i],f)>0&&o(t,n,i);g0;)d--}0===s(t[n],f)?o(t,n,d):o(t,++d,i),d<=e&&(n=d+1),e<=d&&(i=d-1)}}function o(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function s(t,e){return te?1:0}function a(t,e){if(!(this instanceof a))return new a(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 u(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function x(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function E(t,e,n,r,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=r||(i(t,s=e+Math.ceil((n-e)/r/2)*r,e,n,o),a.push(e,s,s,n))}function w(t,e,n){if(null!==t){var i,r,o,s,a,u,l,c,h,f,g=0,d=0,p=t.type,_="FeatureCollection"===p,v="Feature"===p,m=_?t.features.length:1;for(i=0;it[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var o=this._chooseSplitIndex(n,r,i),s=x(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,l(n,this.toBBox),l(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=x([t,e]),this.data.height=t.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,s,a,u,l,h;for(u=l=1/0,i=e;i<=n-e;i++)s=v(r=c(t,0,i,this.toBBox),o=c(t,i,n,this.toBBox)),a=d(r)+d(o),s=e;r--)o=t.children[r],h(u,t.leaf?s(o):o),l+=p(u);return l},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)h(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():l(t[n],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]+"};")}},e.exports=I,e.exports.default=I},{}],73:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!o.isObject(n))throw new Error("options is invalid");var i=n.units,s=r.getCoord(t),a=r.getCoord(e),u=o.degreesToRadians(a[1]-s[1]),l=o.degreesToRadians(a[0]-s[0]),c=o.degreesToRadians(s[1]),h=o.degreesToRadians(a[1]),f=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(c)*Math.cos(h);return o.radiansToLength(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),i)}var r=t("@turf/invariant"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],74:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t){return s(o(t))}var o=i(t("@turf/bbox")),s=i(t("@turf/bbox-polygon"));e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/bbox-polygon":5}],75:[function(t,e,n){"use strict";function i(t){var e=[];return"FeatureCollection"===t.type?r.featureEach(t,function(t){r.coordEach(t,function(n){e.push(o.point(n,t.properties))})}):r.coordEach(t,function(n){e.push(o.point(n,t.properties))}),o.featureCollection(e)}var r=t("@turf/meta"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],76:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("geojson is required");var e=[];return r.flattenEach(t,function(t){e.push(t)}),o.featureCollection(e)}var r=t("@turf/meta"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],77:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.mutate;if(!t)throw new Error("geojson is required");return!1!==n&&void 0!==n||(t=s(t)),r.coordEach(t,function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e}),t}var r=t("@turf/meta"),o=t("@turf/helpers"),s=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clone"));e.exports=i,e.exports.default=i},{"@turf/clone":36,"@turf/helpers":79,"@turf/meta":105}],78:[function(t,e,n){"use strict";function i(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.properties,o=n.npoints,s=n.offset;return t=r.getCoord(t),e=r.getCoord(e),i=i||{},o=o||100,s=s||10,new c({x:t[0],y:t[1]},{x:e[0],y:e[1]},i).Arc(o,{offset:s}).json()}var r=t("@turf/invariant"),o=Math.PI/180,s=180/Math.PI,a=function(t,e){this.lon=t,this.lat=e,this.x=o*t,this.y=o*e};a.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},a.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new a(e,t)};var u=function(){this.coords=[],this.length=0};u.prototype.move_to=function(t){this.length++,this.coords.push(t)};var l=function(t){this.properties=t||{},this.geometries=[]};l.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;ed&&(v>f&&_f&&vc&&(c=m)}var y=[];if(a&&c0&&Math.abs(w-n[E-1][0])>d){var b=parseFloat(n[E-1][0]),I=parseFloat(n[E-1][1]),C=parseFloat(n[E][0]),N=parseFloat(n[E][1]);if(b>-180&&b-180&&n[E-1][0]f&&b<180&&-180===C&&E+1f&&n[E-1][0]<180){x.push([180,n[E][1]]),E++,x.push([n[E][0],n[E][1]]);continue}if(bf){var S=b;b=C,C=S;var L=I;I=N,N=L}if(b>f&&C=180&&bf?180:-180,P]),(x=[]).push([n[E-1][0]>f?-180:180,P]),y.push(x)}else x=[],y.push(x);x.push([w,n[E][1]])}else x.push([n[E][0],n[E][1]])}}else{var R=[];y.push(R);for(var O=0;O=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},n.radiansToLength=c,n.lengthToRadians=h,n.lengthToDegrees=function(t,e){return f(h(t,e))},n.bearingToAzimuth=function(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e},n.radiansToDegrees=f,n.degreesToRadians=function(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180},n.convertLength=function(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),n||"kilometers")},n.convertArea=function(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var i=_[e||"meters"];if(!i)throw new Error("invalid original units");var r=_[n||"kilometers"];if(!r)throw new Error("invalid final units");return t/i*r},n.isNumber=g,n.isObject=function(t){return!!t&&t.constructor===Object},n.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},n.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},n.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},n.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},n.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},n.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},n.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],80:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!c.isObject(n))throw new Error("options is invalid");var i=n.properties||{},r=n.triangles,h=n.mask;if(null===e||void 0===e)throw new Error("cellSide is required");if(!c.isNumber(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(h&&-1===["Polygon","MultiPolygon"].indexOf(l.getType(h)))throw new Error("options.mask must be a (Multi)Polygon");var f=t[0],g=t[1],d=t[2],p=t[3],_=(g+p)/2,v=(f+d)/2,m=2*e/a([f,_],[d,_],n)*(d-f),y=2*e/a([v,g],[v,p],n)*(p-g),x=m/2,E=2*x,w=Math.sqrt(3)/2*y,b=d-f,I=p-g,C=.75*E,N=w,S=(b-E)/(E-x/2),L=Math.floor(S),M=(L*C-x/2-b)/2-x/2+C/2,P=Math.floor((I-w)/w),R=(I-P*w)/2,O=P*w-I>w/2;O&&(R-=w/4);for(var T=[],A=[],D=0;D<6;D++){var F=2*Math.PI/6*D;T.push(Math.cos(F)),A.push(Math.sin(F))}for(var G=[],q=0;q<=L;q++)for(var k=0;k<=P;k++){var B=q%2==1;if((0!==k||!B)&&(0!==k||!O)){var j=q*C+f-M,z=k*N+g+R;if(B&&(z-=w/2),!0===r)s([j,z],m/2,y/2,i,T,A).forEach(function(t){h?u(h,t)&&G.push(t):G.push(t)});else{var Y=o([j,z],m/2,y/2,i,T,A);h?u(h,Y)&&G.push(Y):G.push(Y)}}}return c.featureCollection(G)}function o(t,e,n,i,r,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*r[a],l=t[1]+n*o[a];s.push([u,l])}return s.push(s[0].slice()),c.polygon([s],i)}function s(t,e,n,i,r,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*r[a],t[1]+n*o[a]]),u.push([t[0]+e*r[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(c.polygon([u],i))}return s}var a=i(t("@turf/distance")),u=i(t("@turf/intersect")),l=t("@turf/invariant"),c=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/distance":73,"@turf/helpers":79,"@turf/intersect":82,"@turf/invariant":84}],81:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.gridType,r=n.property,_=n.weight;if(!t)throw new Error("points is required");if(p.collectionOf(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==_&&"number"!=typeof _)throw new Error("weight must be a number");r=r||"elevation",i=i||"square",_=_||1;var v,m=o(t);switch(i){case"point":case"points":v=a(m,e,n);break;case"square":case"squares":v=c(m,e,n);break;case"hex":case"hexes":v=s(m,e,n);break;case"triangle":case"triangles":v=h(m,e,n);break;default:throw new Error("invalid gridType")}var y=[];return d.featureEach(v,function(e){var o=0,s=0;d.featureEach(t,function(t){var a,c="point"===i?e:l(e),h=u(c,t,n);if(void 0!==r&&(a=t.properties[r]),void 0===a&&(a=t.geometry.coordinates[2]),void 0===a)throw new Error("zValue is missing");0===h&&(o=a);var f=1/Math.pow(h,_);s+=f,o+=f*a});var a=f(e);a.properties[r]=o/s,y.push(a)}),g.featureCollection(y)}var o=i(t("@turf/bbox")),s=i(t("@turf/hex-grid")),a=i(t("@turf/point-grid")),u=i(t("@turf/distance")),l=i(t("@turf/centroid")),c=i(t("@turf/square-grid")),h=i(t("@turf/triangle-grid")),f=i(t("@turf/clone")),g=t("@turf/helpers"),d=t("@turf/meta"),p=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/centroid":33,"@turf/clone":36,"@turf/distance":73,"@turf/helpers":79,"@turf/hex-grid":80,"@turf/invariant":84,"@turf/meta":105,"@turf/point-grid":111,"@turf/square-grid":141,"@turf/triangle-grid":150}],82:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=a.getGeom(t),i=a.getGeom(e);if(l(s(i,{precision:4})).coordinates[0].length<4)return null;if(l(s(n,{precision:4})).coordinates[0].length<4)return null;var r=new o.GeoJSONReader,c=r.read(s(n)),h=r.read(s(i)),f=o.OverlayOp.intersection(c,h);if(f.isEmpty())return null;var g=(new o.GeoJSONWriter).write(f);return u.feature(g)}var o=t("jsts-es"),s=i(t("@turf/truncate")),a=t("@turf/invariant"),u=t("@turf/helpers"),l=i(t("@turf/clean-coords"));e.exports=r,e.exports.default=r},{"@turf/clean-coords":35,"@turf/helpers":79,"@turf/invariant":84,"@turf/truncate":151,"jsts-es":83}],83:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],84:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return r(e),e;throw new Error("No valid coordinates")}function r(t){if(t.length>1&&o.isNumber(t[0])&&o.isNumber(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return r(t[0]);throw new Error("coordinates must only contain numbers")}Object.defineProperty(n,"__esModule",{value:!0});var o=t("@turf/helpers");n.getCoord=function(t){if(!t)throw new Error("obj is required");var e=i(t);if(e.length>1&&o.isNumber(e[0])&&o.isNumber(e[1]))return e;throw new Error("Coordinate is not a valid Point")},n.getCoords=i,n.containsNumber=r,n.geojsonType=function(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)},n.featureOf=function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)},n.collectionOf=function(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i-1}function l(t,e,n){for(var i=t.length-1,r=t[0].length-1,o={rows:i,cols:r,cells:[]},s=e+Math.abs(n),u=0;us?128:64,c|=fs?32:16,c|=gs?8:4;var p=+(c|=ds?2:1),_=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var v=(h+f+g+d)/4;_=v>s?2:v0?(c=156,_=4):c=152:33===c?_>0?(c=139,_=4):c=137:72===c?_>0?(c=99,_=4):c=98:132===c&&(_>0?(c=39,_=4):c=38)}if(0!=c&&170!=c){var m,y,x,E,w,b,I,C;m=y=x=E=w=b=I=C=.5;var N=[];1===c?(x=1-a(e,g,d),C=1-a(e,h,d),N.push(vt[c])):169===c?(x=a(s,d,g),C=a(s,d,h),N.push(vt[c])):4===c?(b=1-a(e,f,g),E=a(e,d,g),N.push(pt[c])):166===c?(b=a(s,g,f),E=1-a(s,g,d),N.push(pt[c])):16===c?(w=a(e,g,f),y=a(e,h,f),N.push(dt[c])):154===c?(w=1-a(s,f,g),y=1-a(s,f,h),N.push(dt[c])):64===c?(I=a(e,d,h),m=1-a(e,f,h),N.push(yt[c])):106===c?(I=1-a(s,h,d),m=a(s,h,f),N.push(yt[c])):168===c?(E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),N.push(_t[c]),N.push(vt[c])):2===c?(E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),N.push(_t[c]),N.push(vt[c])):162===c?(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),N.push(_t[c]),N.push(vt[c])):8===c?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),N.push(dt[c]),N.push(pt[c])):138===c?(w=1-a(e,f,g),b=1-a(s,f,g),m=1-a(s,f,h),y=1-a(e,f,h),N.push(dt[c]),N.push(pt[c])):32===c?(w=a(s,g,f),b=a(e,g,f),m=a(e,h,f),y=a(s,h,f),N.push(dt[c]),N.push(pt[c])):42===c?(C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f),N.push(mt[c]),N.push(yt[c])):128===c&&(C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h),N.push(mt[c]),N.push(yt[c])),5===c?(b=1-a(e,f,g),C=1-a(e,h,d),N.push(pt[c])):165===c?(b=a(s,g,f),C=a(s,d,h),N.push(pt[c])):20===c?(E=a(e,d,g),y=a(e,h,f),N.push(_t[c])):150===c?(E=1-a(s,g,d),y=1-a(s,f,h),N.push(_t[c])):80===c?(w=a(e,g,f),I=a(e,d,h),N.push(dt[c])):90===c?(w=1-a(s,f,g),I=1-a(s,h,d),N.push(dt[c])):65===c?(x=1-a(e,g,d),m=1-a(e,f,h),N.push(vt[c])):105===c?(x=a(s,d,g),m=a(s,h,f),N.push(vt[c])):160===c?(w=a(s,g,f),b=a(e,g,f),C=a(e,d,h),I=a(s,d,h),N.push(dt[c]),N.push(pt[c])):10===c?(w=1-a(e,f,g),b=1-a(s,f,g),C=1-a(s,h,d),I=1-a(e,h,d),N.push(dt[c]),N.push(pt[c])):130===c?(E=1-a(e,g,d),x=1-a(s,g,d),m=1-a(s,f,h),y=1-a(e,f,h),N.push(_t[c]),N.push(vt[c])):40===c?(E=a(s,d,g),x=a(e,d,g),m=a(e,h,f),y=a(s,h,f),N.push(_t[c]),N.push(vt[c])):101===c?(b=a(s,g,f),m=a(s,h,f),N.push(pt[c])):69===c?(b=1-a(e,f,g),m=1-a(e,f,h),N.push(pt[c])):149===c?(C=a(s,d,h),y=1-a(s,f,h),N.push(mt[c])):21===c?(C=1-a(e,h,d),y=a(e,h,f),N.push(mt[c])):86===c?(E=1-a(s,g,d),I=1-a(s,h,d),N.push(_t[c])):84===c?(E=a(e,d,g),I=a(e,d,h),N.push(_t[c])):89===c?(w=1-a(s,f,g),x=a(s,d,g),N.push(vt[c])):81===c?(w=a(e,g,f),x=1-a(e,g,d),N.push(vt[c])):96===c?(w=a(s,g,f),b=a(e,g,f),I=a(e,d,h),m=a(s,h,f),N.push(dt[c]),N.push(pt[c])):74===c?(w=1-a(e,f,g),b=1-a(s,f,g),I=1-a(s,h,d),m=1-a(e,f,h),N.push(dt[c]),N.push(pt[c])):24===c?(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),y=a(e,h,f),N.push(dt[c]),N.push(vt[c])):146===c?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),y=1-a(s,f,h),N.push(dt[c]),N.push(vt[c])):6===c?(b=1-a(e,f,g),E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),N.push(pt[c]),N.push(_t[c])):164===c?(b=a(s,g,f),E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),N.push(pt[c]),N.push(_t[c])):129===c?(x=1-a(e,g,d),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h),N.push(vt[c]),N.push(mt[c])):41===c?(x=a(s,d,g),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f),N.push(vt[c]),N.push(mt[c])):66===c?(E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),m=1-a(e,f,h),N.push(_t[c]),N.push(vt[c])):104===c?(E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),m=a(s,h,f),N.push(vt[c]),N.push(xt[c])):144===c?(w=a(e,g,f),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h),N.push(dt[c]),N.push(yt[c])):26===c?(w=1-a(s,f,g),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f),N.push(dt[c]),N.push(yt[c])):36===c?(b=a(s,g,f),E=a(e,d,g),m=a(e,h,f),y=a(s,h,f),N.push(pt[c]),N.push(_t[c])):134===c?(b=1-a(e,f,g),E=1-a(s,g,d),m=1-a(s,f,h),y=1-a(e,f,h),N.push(pt[c]),N.push(_t[c])):9===c?(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),C=1-a(e,h,d),N.push(dt[c]),N.push(pt[c])):161===c?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),C=a(s,d,h),N.push(dt[c]),N.push(pt[c])):37===c?(b=a(s,g,f),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f),N.push(pt[c]),N.push(mt[c])):133===c?(b=1-a(e,f,g),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h),N.push(pt[c]),N.push(mt[c])):148===c?(E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h),N.push(_t[c]),N.push(yt[c])):22===c?(E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f),N.push(_t[c]),N.push(yt[c])):82===c?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),N.push(dt[c]),N.push(vt[c])):88===c?(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),N.push(dt[c]),N.push(vt[c])):73===c?(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),m=1-a(e,f,h),N.push(dt[c]),N.push(pt[c])):97===c?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),m=a(s,h,f),N.push(dt[c]),N.push(pt[c])):145===c?(w=a(e,g,f),x=1-a(e,g,d),C=a(s,d,h),y=1-a(s,f,h),N.push(dt[c]),N.push(mt[c])):25===c?(w=1-a(s,f,g),x=a(s,d,g),C=1-a(e,h,d),y=a(e,h,f),N.push(dt[c]),N.push(mt[c])):70===c?(b=1-a(e,f,g),E=1-a(s,g,d),I=1-a(s,h,d),m=1-a(e,f,h),N.push(pt[c]),N.push(_t[c])):100===c?(b=a(s,g,f),E=a(e,d,g),I=a(e,d,h),m=a(s,h,f),N.push(pt[c]),N.push(_t[c])):34===c?(0===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(mt[c]),N.push(yt[c])):35===c?(4===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(vt[c]),N.push(yt[c])):136===c?(0===_?(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)):(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)),N.push(dt[c]),N.push(pt[c]),N.push(mt[c]),N.push(yt[c])):153===c?(0===_?(w=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(vt[c])):102===c?(0===_?(b=1-a(e,f,g),E=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(pt[c]),N.push(yt[c])):155===c?(4===_?(w=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(mt[c])):103===c?(4===_?(b=1-a(e,f,g),E=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(pt[c]),N.push(_t[c])):152===c?(0===_?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(_t[c]),N.push(vt[c])):156===c?(4===_?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(vt[c]),N.push(yt[c])):137===c?(0===_?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)):(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)),N.push(dt[c]),N.push(pt[c]),N.push(vt[c])):139===c?(4===_?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)):(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)),N.push(dt[c]),N.push(pt[c]),N.push(mt[c])):98===c?(0===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(yt[c])):99===c?(4===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(vt[c])):38===c?(0===_?(b=1-a(e,f,g),E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(pt[c]),N.push(mt[c]),N.push(yt[c])):39===c?(4===_?(b=1-a(e,f,g),E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(pt[c]),N.push(_t[c]),N.push(yt[c])):85===c&&(w=1,b=0,E=1,x=0,C=0,I=1,m=0,y=1),(m<0||m>1||y<0||y>1||w<0||w>1||E<0||E>1||C<0||C>1||I<0||I>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+p+" "+h+","+f+","+g+","+d+" "+_+" "+m+" "+y+" "+w+" "+b+" "+E+" "+x+" "+C+" "+I),o.cells[u][l]={cval:c,cval_real:p,flipped:_,topleft:m,topright:y,righttop:w,rightbottom:b,bottomright:E,bottomleft:x,leftbottom:C,lefttop:I,edges:N}}}}}return o}function c(t){for(var e=[],n=t.rows,i=t.cols,r=[],o=0;o0){var a=g(t.cells[o][s]),u=null,l=s,c=o;null!==a&&r.push([a.p[0]+l,a.p[1]+c]);do{if(null===(u=d(t.cells[c][l],a.x,a.y,a.o)))break;if(r.push([u.p[0]+l,u.p[1]+c]),l+=u.x,c+=u.y,a=u,c<0||c>=n||l<0||l>=i||void 0===t.cells[c][l]){var f=h(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===f)break;f.path.forEach(function(t){r.push(t)}),l=f.i,c=f.j,a=f}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(r),r=[],t.cells[o][s].edges.length>0&&s--}return e}function h(t,e,n,i,r,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+i,l=n+r,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=r,u-=i,s=t.cells[l][u],a=s.cval_real,-1===r)if(0===o)if(a&D)c.push([u,l]),i=-1,r=0,o=0;else{if(!(a&A)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+1,l]),i=1,r=0,o=0}else{if(!(a&D)){if(a&A){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+s.bottomleft,l]),i=0,r=1,o=0,h=!0;break}c.push([u,l]),i=-1,r=0,o=0}else if(1===r)if(0===o){if(!(a&T)){if(a&O){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+s.topright,l+1]),i=0,r=-1,o=1,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}else c.push([u+1,l+1]),i=1,r=0,o=1;else if(-1===i)if(0===o){if(!(a&O)){if(a&D){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+s.lefttop]),i=1,r=0,o=1,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}else{if(!(a&O)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),i=0,r=1,o=0}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&A)){c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}else{if(!(a&A)){if(a&T){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1;break}c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else if(s=t.cells[l][u],a=s.cval_real,-1===i)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])i=0,r=-1,o=1;else{if(!(a&D)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u,l])}else{if(!(a&O)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===i){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])i=0,r=1,o=0;else{if(!(a&T)){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}}else if(-1===r){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])i=1,r=0,o=1;else{if(!(a&A)){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])i=-1,r=0,o=0;else{if(!(a&O)){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}}if(u+=i,l+=r,u===e&&l===n)break}return{path:c,i:u,j:l,x:i,y:r,o:o}}function f(t,e){delete t.edges[e];for(var n=e+1;n0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&T?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&A?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&D?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&T?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&A?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&D?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&D?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&D?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&O?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&D?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&D?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&O?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&O?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&D?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&O?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&O?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&T?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&O?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&T?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function d(t,e,n,i){var r,o,s,a,u,l=t.cval;switch(e){case-1:switch(i){case 0:r=pt[l],s=V[l],a=U[l],u=H[l];break;default:r=dt[l],s=z[l],a=Y[l],u=X[l]}break;case 1:switch(i){case 0:r=mt[l],s=it[l],a=rt[l],u=ot[l];break;default:r=yt[l],s=tt[l],a=et[l],u=nt[l]}break;default:switch(n){case-1:switch(i){case 0:r=xt[l],s=F[l],a=G[l],u=q[l];break;default:r=Et[l],s=k[l],a=B[l],u=j[l]}break;case 1:switch(i){case 0:r=vt[l],s=W[l],a=J[l],u=Z[l];break;default:r=_t[l],s=K[l],a=Q[l],u=$[l]}}}if(o=t.edges.indexOf(r),void 0===t.edges[o])return null;switch(f(t,o),l=t.cval_real,r){case 0:l&T?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:l&A?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:l&A?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:l&D?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:l&T?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:l&A?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:l&A?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:l&D?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:l&A?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:l&D?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:l&D?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:l&O?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:l&A?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:l&D?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:l&D?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:l&O?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:l&A?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:l&O?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:l&D?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:l&O?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:l&O?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:l&T?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:l&O?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:l&T?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==s&&void 0!==a&&void 0!==u||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+s+" "+a+" "+u)),{p:[e,n],x:s,y:a,o:u}}function p(t){var e=[],n=0;return t.cells.forEach(function(t,i){t.forEach(function(t,r){if(void 0!==t){var o=wt[t.cval](t);"object"==typeof o&&u(o)?"object"==typeof o[0]&&u(o[0])?"object"==typeof o[0][0]&&u(o[0][0])?o.forEach(function(t){t.forEach(function(t){t[0]+=r,t[1]+=i}),e[n++]=t}):(o.forEach(function(t){t[0]+=r,t[1]+=i}),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}function _(t,e,n){if(n=n||{},!L.isObject(n))throw new Error("options is invalid");var i=n.zProperty||"elevation",o=n.commonProperties||{},s=n.breaksProperties||[];if(S.collectionOf(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(!L.isObject(o))throw new Error("commonProperties is not an Object");if(!Array.isArray(s))throw new Error("breaksProperties is not an Array");var a=r(t,{zProperty:i,flip:!0}),u=v(a,e,i),l=(u=m(u,a,t)).map(function(t,e){if(s[e]&&!L.isObject(s[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Object.assign({},o,s[e]);return n[i]=t[i],L.multiPolygon(t.groupedRings,n)});return L.featureCollection(l)}function v(t,e,n){for(var i=[],r=1;r=e?8:0,u|=c>=e?4:0,u|=h>=e?2:0;var g=!1;if(5===(u|=f>=e?1:0)||10===u){var d=(l+c+h+f)/4;5===u&&d=0;g--)if(Math.abs(e[g][0][0]-c)<=1e-7&&Math.abs(e[g][0][1]-f)<=1e-7){for(var d=u.path.length-2;d>=0;--d)e[g].unshift(u.path[d]);l=!0;break}l||(e[n++]=u.path)}})}),e}function h(t,e,n){var i,r,o,s=t.length,a=[],c=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],h=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],f=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],g=t[e][n],d=g.cval,p=l(g,o=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][d]);a.push([n+p[0],e+p[1]]),p=l(g,o=f[d]),a.push([n+p[0],e+p[1]]),u(g);for(var _=n+c[d],v=e+h[d],m=d;_>=0&&v>=0&&v=0&&l<=1&&(g.onLine1=!0),c>=0&&c<=1&&(g.onLine2=!0),!(!g.onLine1||!g.onLine2)&&[g.x,g.y])}var o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79}],88:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!s.isObject(e))throw new Error("options is invalid");if(!t)throw new Error("geojson is required");return o.segmentReduce(t,function(t,n){var i=n.geometry.coordinates;return t+r(i[0],i[1],e)},0)}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/distance")),o=t("@turf/meta"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/distance":73,"@turf/helpers":79,"@turf/meta":105}],89:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i,r){if(r=r||{},!u.isObject(r))throw new Error("options is invalid");var l=r.steps,c=r.units;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===i||null===i)throw new Error("bearing2 is required");if("object"!=typeof r)throw new Error("options must be an object");l=l||64;var h=o(n),f=o(i),g=t.properties;if(h===f)return u.lineString(a(t,e,r).geometry.coordinates[0],g);for(var d=h,p=hp&&v.push(s(t,e,p,c).geometry.coordinates),u.lineString(v,g)}function o(t){var e=t%360;return e<0&&(e+=360),e}var s=i(t("@turf/destination")),a=i(t("@turf/circle")),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/circle":34,"@turf/destination":68,"@turf/helpers":79}],90:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!l.isObject(n))throw new Error("options is invalid");var i=n.units,r=n.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var s=[];return u.flattenEach(t,function(t){r&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),o(t,e,i,function(t){s.push(t)})}),l.featureCollection(s)}function o(t,e,n,i){var r=s(t,{units:n});if(r<=e)return i(t);var o=r/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var u=0;u line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var r=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],l=i[0][0],h=i[0][1],f=i[1][0],g=i[1][1],d=(g-h)*(s-r)-(f-l)*(a-o),p=(f-l)*(o-h)-(g-h)*(r-l),_=(s-r)*(o-h)-(a-o)*(r-l);if(0===d)return null;var v=p/d,m=_/d;if(v>=0&&v<=1&&m>=0&&m<=1){var y=r+v*(s-r),x=o+v*(a-o);return c.point([y,x])}return null}var s=i(t("geojson-rbush")),a=i(t("@turf/line-segment")),u=t("@turf/invariant"),l=t("@turf/meta"),c=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/helpers":79,"@turf/invariant":84,"@turf/line-segment":96,"@turf/meta":105,"geojson-rbush":92}],92:[function(t,e,n){arguments[4][72][0].apply(n,arguments)},{dup:72}],93:[function(t,e,n){"use strict";function i(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function r(t,e){return t[0]*e[1]-e[0]*t[1]}function o(t,e){return[t[0]+e[0],t[1]+e[1]]}function s(t,e){return[t[0]-e[0],t[1]-e[1]]}function a(t,e){return[t*e[0],t*e[1]]}function u(t,e){var n=t[0],u=i(t),l=e[0],c=i(e),h=r(u,c);return o(n,a(r(s(l,n),c)/h,u))}function l(t,e){return 0===r(i(t),i(e))}function c(t,e){return!l(t,e)&&u(t,e)}function h(t,e,n){if(n=n||{},!_.isObject(n))throw new Error("options is invalid");var i=n.units;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");var r=p.getType(t),o=t.properties;switch(r){case"LineString":return f(t,e,i);case"MultiLineString":var s=[];return d.flattenEach(t,function(t){s.push(f(t,e,i).geometry.coordinates)}),_.multiLineString(s,o);default:throw new Error("geometry "+r+" is not supported")}}function f(t,e,n){var i=[],r=_.lengthToDegrees(e,n),o=p.getCoords(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=g(t,o[e+1],r);if(i.push(n),e>0){var a=i[e-1],u=c(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}}),_.lineString(s,t.properties)}function g(t,e,n){var i=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),r=t[0]+n*(e[1]-t[1])/i,o=e[0]+n*(e[1]-t[1])/i;return[[r,t[1]+n*(t[0]-e[0])/i],[o,e[1]+n*(t[0]-e[0])/i]]}var d=t("@turf/meta"),p=t("@turf/invariant"),_=t("@turf/helpers");e.exports=h,e.exports.default=h},{"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],94:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function o(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(n.strict,t===e):u(t,e,n))}function s(t){return null===t||void 0===t}function a(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function u(t,e,n){var i,u;if(s(t)||s(e))return!1;if(t.prototype!==e.prototype)return!1;if(r(t))return!!r(e)&&(t=m.call(t),e=m.call(e),o(t,e,n));if(a(t)){if(!a(e))return!1;if(t.length!==e.length)return!1;for(i=0;i=0;i--)if(l[i]!==c[i])return!1;for(i=l.length-1;i>=0;i--)if(u=l[i],!o(t[u],e[u],n))return!1;return typeof t==typeof e}function l(t,e,n){if(n=n||{},!v.isObject(n))throw new Error("options is invalid");var i=n.tolerance||0,r=[],s=h();s.load(f(t));var a;return _.segmentEach(e,function(t){var e=!1;_.featureEach(s.search(t),function(n){if(!1===e){var r=p.getCoords(t).sort(),s=p.getCoords(n).sort();o(r,s)?(e=!0,a=a?c(a,t):t):(0===i?d(r[0],n)&&d(r[1],n):g(n,r[0]).properties.dist<=i&&g(n,r[1]).properties.dist<=i)?(e=!0,a=a?c(a,t):t):(0===i?d(s[0],t)&&d(s[1],t):g(t,s[0]).properties.dist<=i&&g(t,s[1]).properties.dist<=i)&&(a=a?c(a,n):n)}}),!1===e&&a&&(r.push(a),a=void 0)}),a&&r.push(a),v.featureCollection(r)}function c(t,e){var n=p.getCoords(e),i=p.getCoords(t),r=i[0],s=i[i.length-1],a=t.geometry.coordinates;return o(n[0],r)?a.unshift(n[1]):o(n[0],s)?a.push(n[1]):o(n[1],r)?a.unshift(n[0]):o(n[1],s)&&a.push(n[0]),t}var h=i(t("geojson-rbush")),f=i(t("@turf/line-segment")),g=i(t("@turf/nearest-point-on-line")),d=i(t("@turf/boolean-point-on-line")),p=t("@turf/invariant"),_=t("@turf/meta"),v=t("@turf/helpers"),m=Array.prototype.slice;e.exports=l,e.exports.default=l},{"@turf/boolean-point-on-line":25,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-segment":96,"@turf/meta":105,"@turf/nearest-point-on-line":107,"geojson-rbush":95}],95:[function(t,e,n){arguments[4][72][0].apply(n,arguments)},{dup:72}],96:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("geojson is required");var e=[];return l.flattenEach(t,function(t){r(t,e)}),a.featureCollection(e)}function r(t,e){var n=[],i=t.geometry;switch(i.type){case"Polygon":n=u.getCoords(i);break;case"LineString":n=[u.getCoords(i)]}n.forEach(function(n){o(n,t.properties).forEach(function(t){t.id=e.length,e.push(t)})})}function o(t,e){var n=[];return t.reduce(function(t,i){var r=a.lineString([t,i],e);return r.bbox=s(t,i),n.push(r),i}),n}function s(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];return[nr?n:r,i>o?i:o]}var a=t("@turf/helpers"),u=t("@turf/invariant"),l=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],97:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){if(i=i||{},!u.isObject(i))throw new Error("options is invalid");var r,l=[];if("Feature"===t.type)r=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");r=t.coordinates}for(var c,h,f,g=0,d=0;d=g&&d===r.length-1);d++){if(g>e&&0===l.length){if(!(c=e-g))return l.push(r[d]),u.lineString(l);h=o(r[d],r[d-1])-180,f=a(r[d],c,h,i),l.push(f.geometry.coordinates)}if(g>=n)return(c=n-g)?(h=o(r[d],r[d-1])-180,f=a(r[d],c,h,i),l.push(f.geometry.coordinates),u.lineString(l)):(l.push(r[d]),u.lineString(l));if(g>=e&&l.push(r[d]),d===r.length-1)return u.lineString(l);g+=s(r[d],r[d+1],i)}return u.lineString(r[r.length-1])}var o=i(t("@turf/bearing")),s=i(t("@turf/distance")),a=i(t("@turf/destination")),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/destination":68,"@turf/distance":73,"@turf/helpers":79}],98:[function(t,e,n){"use strict";function i(t,e,n){var i;if("Feature"===n.type)i=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");i=n.coordinates}for(var s,a=o(n,t),u=o(n,e),l=[(s=a.properties.index<=u.properties.index?[a,u]:[u,a])[0].geometry.coordinates],c=s[0].properties.index+1;c1&&n.push(v.lineString(d)),v.featureCollection(n)}function a(t,e){if(!e.features)throw new Error(" must contain features");if(1===e.features.length)return e.features[0];var n,i=1/0;return _.featureEach(e,function(e){var r=g(e,t).properties.dist;rf?(h.unshift(t),f=e):h.push(t)}else h.push(t)}),l.polygon(h,e);default:throw new Error("geometry type "+c+" is not supported")}}function o(t){var e=t[0],n=e[0],i=e[1],r=t[t.length-1],o=r[0],s=r[1];return n===o&&i===s||t.push(e),t}function s(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.abs(e-i)*Math.abs(n-r)}var a=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/bbox")),u=t("@turf/invariant"),l=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/bbox":6,"@turf/helpers":79,"@turf/invariant":84}],102:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=a(e),i=s(t),r=i[0],l=i[1];return o(n,r=u(r),l=u(l))}function o(t,e,n){var i=[];return i.push(t.geometry.coordinates[0]),d.flattenEach(e,function(t){i.push(t.geometry.coordinates[0])}),d.flattenEach(n,function(t){i.push(t.geometry.coordinates[0])}),f.polygon(i)}function s(t){var e=[],n=[];return d.flattenEach(t,function(t){var i=t.geometry.coordinates,r=i[0],o=i.slice(1);e.push(f.polygon([r])),o.forEach(function(t){n.push(f.polygon([t]))})}),[f.featureCollection(e),f.featureCollection(n)]}function a(t){var e=t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return f.polygon(e)}function u(t){if(t.features.length<=1)return t;var e=c(t),n=[],i={};return d.flattenEach(t,function(t,r){if(i[r])return!0;for(e.remove({index:r},l),i[r]=!0;;){var o=g(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var a=s.map(function(t){return i[t.index]=!0,e.remove({index:t.index},l),t.geojson});a.push(t),t=h.apply(this,a)}if(0===s.length)break}n.push(t)}),f.featureCollection(n)}function l(t,e){return t.index===e.index}function c(t){var e=p(),n=[];return d.flattenEach(t,function(t,e){var i=g(t);n.push({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],geojson:t,index:e})}),e.load(n),e}var h=i(t("@turf/union")),f=t("@turf/helpers"),g=i(t("@turf/bbox")),d=t("@turf/meta"),p=t("rbush");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/helpers":79,"@turf/meta":105,"@turf/union":152,rbush:104}],103:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],104:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{dup:50,quickselect:103}],105:[function(t,e,n){"use strict";function i(t,e,n){if(null!==t){var r,o,s,a,u,l,c,h,f,g,d=0,p=0,_=t.type,v="FeatureCollection"===_,m="Feature"===_,y=v?t.features.length:1;for(r=0;r0&&((E=x.features[0]).properties.dist=s(e,E,n),E.properties.location=f+s(g,E,n)),g.properties.dista&&(i=a)}),i}function o(t,e,n,i){var r=i.mercator,o=!0!==r?c(e,t,i):u(e,t,i),a=_.bearingToAzimuth(!0!==r?l(e,t):h(e,t)),f=_.bearingToAzimuth(!0!==r?l(e,n):h(e,n)),g=Math.abs(a-f);if(g>90)return o;var d=(f+180)%360,p=_.bearingToAzimuth(!0!==r?l(n,t):h(n,t)),v=Math.abs(p-d);return v>180&&(v=Math.abs(v-360)),v>90?!0!==r?c(t,n,i):u(t,n,i):!0!==r?o*Math.sin(_.degreesToRadians(g)):s(e,n,t,i)}function s(t,e,n,i){var r=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(r=t[0]>0||e[0]>0||n[0]>0?-180:180);var o=_.point(n),s=g.toMercator([t[0]+r,t[1]]),u=g.toMercator([e[0]+r,e[1]]),l=g.toMercator([n[0]+r,n[1]]),c=g.toWgs84(a(s,u,l));return 0!==r&&(c[0]-=r),f(o,c,i)}function a(t,e,n){var i=t[0],r=t[1],o=e[0]-i,s=e[1]-r,a=((n[0]-i)*o+(n[1]-r)*s)/(o*o+s*s);return[i+a*o,r+a*s]}function u(t,e,n){var i=n.units,r=0;Math.abs(t[0])>=180&&(r=t[0]>0?-180:180),Math.abs(e[0])>=180&&(r=e[0]>0?-180:180);var o=g.toMercator([t[0]+r,t[1]]),s=g.toMercator([e[0]+r,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]),l=Math.sqrt(u);return _.convertLength(l,"meters",i)}var l=i(t("@turf/bearing")),c=i(t("@turf/distance")),h=i(t("@turf/rhumb-bearing")),f=i(t("@turf/rhumb-distance")),g=t("@turf/projection"),d=t("@turf/invariant"),p=t("@turf/meta"),_=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/projection":130,"@turf/rhumb-bearing":133,"@turf/rhumb-distance":135}],114:[function(t,e,n){"use strict";function i(t,e){for(var n=o.featureCollection([]),i=0;i0?s(e,c,r)||(r=c):n>0&&i<=0&&(o(e,c,u)||(u=c)),n=i}return[r,u]}function o(t,e,n){return a(t,e,n)>0}function s(t,e,n){return a(t,e,n)<0}function a(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}var u=t("@turf/invariant"),l=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],116:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!s.isObject(e))throw new Error("options is invalid");var n=e.properties,i=o.getType(t),a=o.getCoords(t);if(n=n||t.properties||{},!a.length)throw new Error("polygon must contain coordinates");switch(i){case"Polygon":return r(a,n);case"MultiPolygon":var u=[];return a.forEach(function(t){u.push(r(t,n))}),s.featureCollection(u);default:throw new Error("geom "+i+" not supported")}}function r(t,e){return t.length>1?s.multiLineString(t,e):s.lineString(t[0],e)}var o=t("@turf/invariant"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],117:[function(t,e,n){"use strict";var i=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("polygonize"));e.exports=i,e.exports.default=i},{polygonize:128}],118:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":79,dup:5}],119:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{"@turf/meta":120,dup:6}],120:[function(t,e,n){"use strict";function i(t,e,n){if(null!==t){var r,o,s,a,u,l,c,h,f,g,d=0,p=0,_=t.type,v="FeatureCollection"===_,m="Feature"===_,y=v?t.features.length:1;for(r=0;rt[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function o(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/invariant":123}],123:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return r(e),e;throw new Error("No valid coordinates")}function r(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&t[0].length)return r(t[0]);throw new Error("coordinates must only contain numbers")}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoord=function(t){if(!t)throw new Error("obj is required");var e=i(t);if(e.length>1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")},n.getCoords=i,n.containsNumber=r,n.geojsonType=function(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)},n.featureOf=function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)},n.collectionOf=function(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i "+this.to.id+" }"}},{key:"toLineString",value:function(){return(0,o.lineString)([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return(0,s.orientationIndex)(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}]),t}();n.default=a,e.exports=n.default},{"./util":129,"@turf/helpers":79}],125:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;nt.edges[e].from.coordinates[1]&&(e=i),e},0),n=(0===e?this.length:e)-1,i=(e+1)%this.length,r=(0,s.orientationIndex)(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[i].from.coordinates);return 0===r?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:r>0}},{key:"toMultiPoint",value:function(){return(0,a.multiPoint)(this.edges.map(function(t){return t.from.coordinates}))}},{key:"toPolygon",value:function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=(0,a.polygon)([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=(0,u.default)(this.toPolygon())}},{key:"inside",value:function(t){return(0,l.default)(t,this.toPolygon())}},{key:"length",get:function(){return this.edges.length}}],[{key:"findEdgeRingContaining",value:function(t,e){var n=t.getEnvelope(),i=void 0,r=void 0;return e.forEach(function(e){var o=e.getEnvelope();if(r&&(i=r.getEnvelope()),!(0,s.envelopeIsEqual)(o,n)&&(0,s.envelopeContains)(o,n)){var u=t.map(function(t){return t.from.coordinates}).find(function(t){return!e.some(function(e){return(0,s.coordinatesEqual)(t,e.from.coordinates)})});u&&e.inside((0,a.point)(u))&&(r&&!(0,s.envelopeContains)(i,o)||(r=e))}}),r}}]),t}();n.default=c,e.exports=n.default},{"./util":129,"@turf/envelope":121,"@turf/helpers":79,"@turf/inside":122}],126:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n=0;--o){var s=n[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),i||(i=u)))}r&&(r.next=i)}},{key:"_findLabeledEdgeRings",value:function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var i=n;do{i.label=e,i=i.next}while(!n.isEqual(i));e++}}),t}},{key:"getEdgeRings",value:function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e}},{key:"_findIntersectionNodes",value:function(t){var e=[],n=t;do{!function(){var i=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++i}),i>1&&e.push(n.from),n=n.next}()}while(!t.isEqual(n));return e}},{key:"_findEdgeRing",value:function(t){var e=t,n=new l.default;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n}},{key:"removeNode",value:function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]}},{key:"removeEdge",value:function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()}}]),t}();n.default=f,e.exports=n.default},{"./Edge":124,"./EdgeRing":125,"./Node":127,"@turf/invariant":123,"@turf/meta":105}],127:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=0&&r.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&r.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]==0&&r.coordinates[0]-t.coordinates[0]==0)return i.coordinates[1]-t.coordinates[1]>=0||r.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-r.coordinates[1]:r.coordinates[1]-i.coordinates[1];var s=(0,o.orientationIndex)(t.coordinates,i.coordinates,r.coordinates);return s<0?1:s>0?-1:Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2)-(Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(t){return this.sortOuterEdges(),this.outerEdges[t]}},{key:"addInnerEdge",value:function(t){this.innerEdges.push(t)}}]),t}();n.default=s,e.exports=n.default},{"./util":129}],128:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var r=i(t("./Graph")),o=i(t("./EdgeRing")),s=t("@turf/helpers");n.default=function(t){var e=r.default.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],i=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):i.push(t)}),n.forEach(function(t){o.default.findEdgeRingContaining(t,i)&&i.push(t)}),(0,s.featureCollection)(i.map(function(t){return t.toPolygon()}))},e.exports=n.default},{"./EdgeRing":125,"./Graph":126,"@turf/helpers":79}],129:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.coordinatesEqual=n.envelopeContains=n.envelopeIsEqual=n.orientationIndex=void 0;var i=function(t){return t&&t.__esModule?t:{default:t}}(t("@turf/inside")),r=t("@turf/helpers");n.orientationIndex=function(t,e,n){var i=e[0]-t[0],r=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(i*s-o*r)},n.envelopeIsEqual=function(t,e){var n=t.geometry.coordinates.map(function(t){return t[0]}),i=t.geometry.coordinates.map(function(t){return t[1]}),r=e.geometry.coordinates.map(function(t){return t[0]}),o=e.geometry.coordinates.map(function(t){return t[1]});return Math.max(null,n)===Math.max(null,r)&&Math.max(null,i)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,r)&&Math.min(null,i)===Math.min(null,o)},n.envelopeContains=function(t,e){return e.geometry.coordinates[0].every(function(e){return(0,i.default)((0,r.point)(e),t)})},n.coordinatesEqual=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},{"@turf/helpers":79,"@turf/inside":122}],130:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!u.isObject(n))throw new Error("options is invalid");var i=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&u.isNumber(t[0])?t="mercator"===e?r(t):o(t):(!0!==i&&(t=l(t)),a.coordEach(t,function(t){var n="mercator"===e?r(t):o(t);t[0]=n[0],t[1]=n[1]})),t}function r(t){var e=Math.PI/180,n=6378137,i=20037508.342789244,r=[n*(Math.abs(t[0])<=180?t[0]:t[0]-360*s(t[0]))*e,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>i&&(r[0]=i),r[0]<-i&&(r[0]=-i),r[1]>i&&(r[1]=i),r[1]<-i&&(r[1]=-i),r}function o(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}function s(t){return t<0?-1:t>0?1:0}Object.defineProperty(n,"__esModule",{value:!0});var a=t("@turf/meta"),u=t("@turf/helpers"),l=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clone"));n.toMercator=function(t,e){return i(t,"mercator",e)},n.toWgs84=function(t,e){return i(t,"wgs84",e)}},{"@turf/clone":36,"@turf/helpers":79,"@turf/meta":105}],131:[function(t,e,n){"use strict";function i(t){if(l.isObject(t)&&(t=t.bbox),t&&!Array.isArray(t))throw new Error("bbox is invalid");return t?u(t):[s(),a()]}function r(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}function o(){return Math.random()-.5}function s(){return 360*o()}function a(){return 180*o()}function u(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}Object.defineProperty(n,"__esModule",{value:!0});var l=t("@turf/helpers");n.randomPosition=i,n.randomPoint=function(t,e){if(e=e||{},!l.isObject(e))throw new Error("options is invalid");var n=e.bbox;void 0!==t&&null!==t||(t=1);for(var r=[],o=0;o0?t+n[e-1]:t}),h.forEach(function(t){t=2*t*Math.PI/h[h.length-1];var e=Math.random();c.push([e*s*Math.sin(t),e*s*Math.cos(t)])}),c[c.length-1]=c[0],c=c.map(r(i(n))),a.push(l.polygon([c]))}return l.featureCollection(a)},n.randomLineString=function(t,e){if(e=e||{},!l.isObject(e))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,o=e.max_length,s=e.max_rotation;void 0!==t&&null!==t||(t=1),(!l.isNumber(r)||r<2)&&(r=10),l.isNumber(o)||(o=1e-4),l.isNumber(s)||(s=Math.PI/8);for(var a=[],u=0;u is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof i)throw new Error(" must be a boolean");!1===i&&(t=u(t));var r=[];switch(t.type){case"GeometryCollection":return c.geomEach(t,function(t){o(t,n)}),t;case"FeatureCollection":return c.featureEach(t,function(t){c.featureEach(o(t,n),function(t){r.push(t)})}),f.featureCollection(r)}return o(t,n)}function o(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return c.geomEach(t,function(t){o(t,e)}),t;case"LineString":return s(h.getCoords(t),e),t;case"Polygon":return a(h.getCoords(t),e),t;case"MultiLineString":return h.getCoords(t).forEach(function(t){s(t,e)}),t;case"MultiPolygon":return h.getCoords(t).forEach(function(t){a(t,e)}),t;case"Point":case"MultiPoint":return t}}function s(t,e){l(t)===e&&t.reverse()}function a(t,e){l(t[0])!==e&&t[0].reverse();for(var n=1;n180?-(360-a):a}function r(t,e){var n=s.degreesToRadians(t[1]),i=s.degreesToRadians(e[1]),r=s.degreesToRadians(e[0]-t[0]);r>Math.PI&&(r-=2*Math.PI),r<-Math.PI&&(r+=2*Math.PI);var o=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),a=Math.atan2(r,o);return(s.radiansToDegrees(a)+360)%360}var o=t("@turf/invariant"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],134:[function(t,e,n){"use strict";function i(t,e,n,i){if(i=i||{},!o.isObject(i))throw new Error("options is invalid");var a=i.units,u=i.properties;if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var l=o.convertLength(e,a,"meters"),c=s.getCoord(t),h=r(c,l,n);return h[0]+=h[0]-c[0]>180?-360:c[0]-h[0]>180?360:0,o.point(h,u)}function r(t,e,n,i){var r=e/(i=void 0===i?o.earthRadius:Number(i)),s=t[0]*Math.PI/180,a=o.degreesToRadians(t[1]),u=o.degreesToRadians(n),l=r*Math.cos(u),c=a+l;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),f=Math.abs(h)>1e-11?l/h:Math.cos(a);return[(180*(s+r*Math.sin(u)/f)/Math.PI+540)%360-180,180*c/Math.PI]}var o=t("@turf/helpers"),s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],135:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!o.isObject(n))throw new Error("options is invalid");var i=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var a=s.getCoord(t),u=s.getCoord(e);u[0]+=u[0]-a[0]>180?-360:a[0]-u[0]>180?360:0;var l=r(a,u);return o.convertLength(l,"meters",i)}function r(t,e,n){var i=n=void 0===n?o.earthRadius:Number(n),r=t[1]*Math.PI/180,s=e[1]*Math.PI/180,a=s-r,u=Math.abs(e[0]-t[0])*Math.PI/180;u>Math.PI&&(u-=2*Math.PI);var l=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),c=Math.abs(l)>1e-11?a/l:Math.cos(r);return Math.sqrt(a*a+c*c*u*u)*i}var o=t("@turf/helpers"),s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],136:[function(t,e,n){"use strict";function i(t,e){if(!t)throw new Error("featurecollection is required");if(null===e||void 0===e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return o.featureCollection(r(t.features,e))}function r(t,e){for(var n,i,r=t.slice(0),o=t.length,s=o-e;o-- >s;)n=r[i=Math.floor((o+1)*Math.random())],r[i]=r[o],r[o]=n;return r.slice(s)}var o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79}],137:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i,r){if(r=r||{},!l.isObject(r))throw new Error("options is invalid");if(!t)throw new Error("center is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===i||null===i)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof r)throw new Error("options must be an object");if(o(n)===o(i))return s(t,e,r);var h=c.getCoords(t),f=a(t,e,n,i,r),g=[[h]];return u.coordEach(f,function(t){g[0].push(t)}),g[0].push(h),l.polygon(g)}function o(t){var e=t%360;return e<0&&(e+=360),e}var s=i(t("@turf/circle")),a=i(t("@turf/line-arc")),u=t("@turf/meta"),l=t("@turf/helpers"),c=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/circle":34,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-arc":89,"@turf/meta":105}],138:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function o(){return new u(function(t){return t.f})}function s(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n=E;){for(var G=[],q=[],k=x+L,B=0;k<=w;){var j=m.point([k,D]),z=c(j,o);G.push(z?0:1),q.push(k+"|"+D);var Y=g(j,t);!z&&Y0;){var c=u.pop();if(c===n)return r(c);c.closed=!0;for(var h=t.neighbors(c),f=0,g=h.length;f0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)0;){var n=(t+1>>1)-1,i=this.content[n];if(!(this.scoreFunction(e)1?(i=n.x,r=n.y):a>0&&(i+=o*a,r+=s*a)}return o=t.x-i,s=t.y-r,o*o+s*s}function i(e,n){for(var i,r=e[0],o=[r],s=1,a=e.length;sn&&(o.push(i),r=i);return r!==i&&o.push(i),o}function r(t,e){var i,r,o,s,a=t.length,u=new("undefined"!=typeof Uint8Array?Uint8Array:Array)(a),l=0,c=a-1,h=[],f=[];for(u[l]=u[c]=1;c;){for(r=0,i=l+1;ir&&(s=i,r=o);r>e&&(u[s]=1,h.push(l,s,s,c)),c=h.pop(),l=h.pop()}for(i=0;i=r(t.slice(0,2),[e,o])){var s=(n+o)/2;return[e,s-(i-e)/2,i,s+(i-e)/2]}var a=(e+i)/2;return[a-(o-n)/2,n,a+(o-n)/2,o]}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/distance"));e.exports=i,e.exports.default=i},{"@turf/distance":73}],143:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){return t=s(t),e=s(e),a.featureEach(t,function(t){t.properties||(t.properties={}),a.featureEach(e,function(e){void 0===t.properties[i]&&o(t,e)&&(t.properties[i]=e.properties[n])})}),t}var o=i(t("@turf/boolean-point-in-polygon")),s=i(t("@turf/clone")),a=t("@turf/meta");e.exports=r,e.exports.default=r},{"@turf/boolean-point-in-polygon":24,"@turf/clone":36,"@turf/meta":105}],144:[function(t,e,n){"use strict";function i(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=r(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(r(t))}),e}function r(t){var e=o(t),n=a(e.vertices,e.holes,2),i=[],r=[];n.forEach(function(t,i){var o=n[i];r.push([e.vertices[2*o],e.vertices[2*o+1]])});for(var u=0;u0&&(i+=t[r-1].length,n.holes.push(i))}return n}var s=t("@turf/helpers"),a=t("earcut");e.exports=i,e.exports.default=i},{"@turf/helpers":79,earcut:145}],145:[function(t,e,n){"use strict";function i(t,e,n){n=n||2;var i=e&&e.length,o=i?e[0]*n:t.length,a=r(t,0,o,n,!0),u=[];if(!a)return u;var l,c,f,g,d,p,_;if(i&&(a=h(t,e,a,n)),t.length>80*n){l=f=t[0],c=g=t[1];for(var v=n;vf&&(f=d),p>g&&(g=p);_=Math.max(f-l,g-c)}return s(a,u,n,l,c,_),u}function r(t,e,n,i,r){var o,s;if(r===R(t,e,n,i)>0)for(o=e;o=e;o-=i)s=L(o,t[o],t[o+1],s);return s&&w(s,s.next)&&(M(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!w(i,i.next)&&0!==E(i.prev,i,i.next))i=i.next;else{if(M(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function s(t,e,n,i,r,h,f){if(t){!f&&h&&p(t,i,r,h);for(var g,d,_=t;t.prev!==t.next;)if(g=t.prev,d=t.next,h?u(t,i,r,h):a(t))e.push(g.i/n),e.push(t.i/n),e.push(d.i/n),M(t),t=d.next,_=d.next;else if((t=d)===_){f?1===f?s(t=l(t,e,n),e,n,i,r,h,2):2===f&&c(t,e,n,i,r,h):s(o(t),e,n,i,r,h,1);break}}}function a(t){var e=t.prev,n=t,i=t.next;if(E(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(y(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&E(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(t,e,n,i){var r=t.prev,o=t,s=t.next;if(E(r,o,s)>=0)return!1;for(var a=r.xo.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,c=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=v(a,u,e,n,i),f=v(l,c,e,n,i),g=t.nextZ;g&&g.z<=f;){if(g!==t.prev&&g!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&E(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(g=t.prevZ;g&&g.z>=h;){if(g!==t.prev&&g!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&E(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}function l(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!w(r,o)&&b(r,i,i.next,o)&&C(r,o)&&C(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),M(i),M(i.next),i=t=o),i=i.next}while(i!==t);return i}function c(t,e,n,i,r,a){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&x(u,l)){var c=S(u,l);return u=o(u,u.next),c=o(c,c.next),s(u,e,n,i,r,a),void s(c,e,n,i,r,a)}l=l.next}u=u.next}while(u!==t)}function h(t,e,n,i){var s,a,u,l=[];for(s=0,a=e.length;s=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s){if(s=a,a===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x=i.x&&i.x>=c&&y(on.x)&&C(i,t)&&(n=i,f=u),i=i.next;return n}function p(t,e,n,i){var r=t;do{null===r.z&&(r.z=v(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,_(r)}function _(t){var e,n,i,r,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e0||u>0&&i;)0===a?(r=i,i=i.nextZ,u--):0!==u&&i?n.z<=i.z?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,u--):(r=n,n=n.nextZ,a--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(s>1);return t}function v(t,e,n,i,r){return t=32767*(t-n)/r,e=32767*(e-i)/r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function m(t){var e=t,n=t;do{e.x=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!I(t,e)&&C(t,e)&&C(e,t)&&N(t,e)}function E(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,n,i){return!!(w(t,e)&&w(n,i)||w(t,i)&&w(n,e))||E(t,e,n)>0!=E(t,e,i)>0&&E(n,i,t)>0!=E(n,i,e)>0}function I(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&&b(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function C(t,e){return E(t.prev,t,t.next)<0?E(t,e,t.next)>=0&&E(t,t.prev,e)>=0:E(t,e,t.prev)<0||E(t,t.next,e)<0}function N(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function S(t,e){var n=new P(t.i,t.x,t.y),i=new P(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function L(t,e,n,i){var r=new P(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function P(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function R(t,e,n,i){for(var r=0,o=e,s=n-i;o0&&(i+=t[r-1].length,n.holes.push(i))}return n}},{}],146:[function(t,e,n){"use strict";function i(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return u.featureCollection(a(t.features.map(function(t){var i={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?i.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,i.z=t.geometry.coordinates[2]),i})).map(function(t){var e=[t.a.x,t.a.y],i=[t.b.x,t.b.y],r=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),i.push(t.b.z),r.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},u.polygon([[e,i,r,e]],o)}))}function r(t,e,n){this.a=t,this.b=e,this.c=n;var i,r,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,l=o*(t.x+e.x)+s*(t.y+e.y),c=a*(t.x+n.x)+u*(t.y+n.y),h=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*l-s*c)/h,this.y=(o*c-a*l)/h,i=this.x-t.x,r=this.y-t.y,this.r=i*i+r*r}function o(t,e){return e.x-t.x}function s(t){var e,n,i,r,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],i=s;i;)if(o=t[--i],r=t[--i],e===r&&n===o||e===o&&n===r){t.splice(s,2),t.splice(i,2),s-=2;continue t}}function a(t){if(t.length<3)return[];t.sort(o);for(var e,n,i,a,u,l,c=t.length-1,h=t[c].x,f=t[0].x,g=t[c].y,d=g;c--;)t[c].yd&&(d=t[c].y);var p,_=f-h,v=d-g,m=_>v?_:v,y=.5*(f+h),x=.5*(d+g),E=[new r({x:y-20*m,y:x-m,__sentinel:!0},{x:y,y:x+20*m,__sentinel:!0},{x:y+20*m,y:x-m,__sentinel:!0})],w=[],b=[];for(c=t.length;c--;){for(b.length=0,p=E.length;p--;)(_=t[c].x-E[p].x)>0&&_*_>E[p].r?(w.push(E[p]),E.splice(p,1)):_*_+(v=t[c].y-E[p].y)*v>E[p].r||(b.push(E[p].a,E[p].b,E[p].b,E[p].c,E[p].c,E[p].a),E.splice(p,1));for(s(b),p=b.length;p;)n=b[--p],e=b[--p],i=t[c],a=n.x-e.x,u=n.y-e.y,l=2*(a*(i.y-n.y)-u*(i.x-n.x)),Math.abs(l)>1e-12&&E.push(new r(e,n,i))}for(Array.prototype.push.apply(w,E),c=w.length;c--;)(w[c].a.__sentinel||w[c].b.__sentinel||w[c].c.__sentinel)&&w.splice(c,1);return w}var u=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79}],147:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!f.isObject(n))throw new Error("options is invalid");var i=n.pivot,r=n.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e?t:(i||(i=o(t)),!1!==r&&void 0!==r||(t=l(t)),c.coordEach(t,function(t){var n=s(i,t)+e,r=a(i,t),o=h.getCoords(u(i,r,n));t[0]=o[0],t[1]=o[1]}),t)}var o=i(t("@turf/centroid")),s=i(t("@turf/rhumb-bearing")),a=i(t("@turf/rhumb-distance")),u=i(t("@turf/rhumb-destination")),l=i(t("@turf/clone")),c=t("@turf/meta"),h=t("@turf/invariant"),f=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/centroid":33,"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/rhumb-bearing":133,"@turf/rhumb-destination":134,"@turf/rhumb-distance":135}],148:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!p.isObject(n))throw new Error("options is invalid");var i=n.origin,r=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var s=Array.isArray(i)||"object"==typeof i;return!0!==r&&(t=a(t)),"FeatureCollection"!==t.type||s?o(t,e,i):(d.featureEach(t,function(n,r){t.features[r]=o(n,e,i)}),t)}function o(t,e,n){var i="Point"===_.getType(t);return n=s(t,n),1===e||i?t:(d.coordEach(t,function(t){var i=f(n,t),r=h(n,t),o=i*e,s=_.getCoords(g(n,o,r));t[0]=s[0],t[1]=s[1],3===t.length&&(t[2]*=e)}),t)}function s(t,e){if(void 0!==e&&null!==e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return _.getCoord(e);var n=t.bbox?t.bbox:c(t),i=n[0],r=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return p.point([i,r]);case"se":case"southeast":case"eastsouth":case"bottomright":return p.point([o,r]);case"nw":case"northwest":case"westnorth":case"topleft":return p.point([i,s]);case"ne":case"northeast":case"eastnorth":case"topright":return p.point([o,s]);case"center":return u(t);case void 0:case null:case"centroid":return l(t);default:throw new Error("invalid origin")}}var a=i(t("@turf/clone")),u=i(t("@turf/center")),l=i(t("@turf/centroid")),c=i(t("@turf/bbox")),h=i(t("@turf/rhumb-bearing")),f=i(t("@turf/rhumb-distance")),g=i(t("@turf/rhumb-destination")),d=t("@turf/meta"),p=t("@turf/helpers"),_=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/center":32,"@turf/centroid":33,"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/rhumb-bearing":133,"@turf/rhumb-destination":134,"@turf/rhumb-distance":135}],149:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){if(i=i||{},!s.isObject(i))throw new Error("options is invalid");var r=i.units,c=i.zTranslation,h=i.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");if(c&&"number"!=typeof c&&isNaN(c))throw new Error("zTranslation is not a number");if(c=void 0!==c?c:0,0===e&&0===c)return t;if(void 0===n||null===n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n=-n),!1!==h&&void 0!==h||(t=u(t)),o.coordEach(t,function(t){var i=a.getCoords(l(t,e,n,{units:r}));t[0]=i[0],t[1]=i[1],c&&3===t.length&&(t[2]+=c)}),t}var o=t("@turf/meta"),s=t("@turf/helpers"),a=t("@turf/invariant"),u=i(t("@turf/clone")),l=i(t("@turf/rhumb-destination"));e.exports=r,e.exports.default=r},{"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/rhumb-destination":134}],150:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!u.isObject(n))throw new Error("options is invalid");var i=n.properties,r=n.mask,l=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!u.isNumber(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(r&&-1===["Polygon","MultiPolygon"].indexOf(a.getType(r)))throw new Error("options.mask must be a (Multi)Polygon");for(var c=e/o([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),h=e/o([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),f=0,g=t[0];g<=t[2];){for(var d=0,p=t[1];p<=t[3];){var _=null,v=null;f%2==0&&d%2==0?(_=u.polygon([[[g,p],[g,p+h],[g+c,p],[g,p]]],i),v=u.polygon([[[g,p+h],[g+c,p+h],[g+c,p],[g,p+h]]],i)):f%2==0&&d%2==1?(_=u.polygon([[[g,p],[g+c,p+h],[g+c,p],[g,p]]],i),v=u.polygon([[[g,p],[g,p+h],[g+c,p+h],[g,p]]],i)):d%2==0&&f%2==1?(_=u.polygon([[[g,p],[g,p+h],[g+c,p+h],[g,p]]],i),v=u.polygon([[[g,p],[g+c,p+h],[g+c,p],[g,p]]],i)):d%2==1&&f%2==1&&(_=u.polygon([[[g,p],[g,p+h],[g+c,p],[g,p]]],i),v=u.polygon([[[g,p+h],[g+c,p+h],[g+c,p],[g,p+h]]],i)),r?(s(r,_)&&l.push(_),s(r,v)&&l.push(v)):(l.push(_),l.push(v)),p+=h,d++}f++,g+=c}return u.featureCollection(l)}var o=i(t("@turf/distance")),s=i(t("@turf/intersect")),a=t("@turf/invariant"),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/distance":73,"@turf/helpers":79,"@turf/intersect":82,"@turf/invariant":84}],151:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!s.isObject(e))throw new Error("options is invalid");var n=e.precision,i=e.coordinates,a=e.mutate;if(n=void 0===n||null===n||isNaN(n)?6:n,i=void 0===i||null===i||isNaN(i)?3:i,!t)throw new Error(" is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof i)throw new Error(" must be a number");!1!==a&&void 0!==a||(t=JSON.parse(JSON.stringify(t)));var u=Math.pow(10,n);return o.coordEach(t,function(t){r(t,u,i)}),t}function r(t,e,n){t.length>n&&t.splice(n,t.length);for(var i=0;i=0==e}function a(t){for(var e=0,n=0;n=1||d<=0||p>=1||p<=0)){var _=g,v=!u[_];v&&(u[_]=!0),e?a.push(e(g,t,n,l,c,d,i,o,h,f,p,v)):a.push(g)}}}function o(t,e){var n,i,r,o,a=s[t][e],u=s[t][e+1];return a[0]1)for(e=0;eI[e.isect].coord?-1:1});for(w=[];R.length>0;){var q=R.pop(),k=q.isect,B=q.parent,j=q.winding,z=w.length,Y=[I[k].coord],X=k;if(I[k].ringAndEdge1Walkable)var V=I[k].ringAndEdge1,U=I[k].nxtIsectAlongRingAndEdge1;else var V=I[k].ringAndEdge2,U=I[k].nxtIsectAlongRingAndEdge2;for(;!u(I[k].coord,I[U].coord);){Y.push(I[U].coord);for(var H=void 0,c=0;c0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=g,g<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=r-l,g||!(o<0)){if(o/=g,g<0){if(o>h)return;o>c&&(c=o)}else if(g>0){if(o0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*g]),h<1&&(t[1]=[u+h*f,l+h*g]),!0)}}}}}function f(t,e,n,i,r){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],g=c[0],d=c[1],p=(h+g)/2,_=(f+d)/2;if(d===f){if(p=i)return;if(h>g){if(u){if(u[1]>=r)return}else u=[p,n];o=[p,r]}else{if(u){if(u[1]1)if(h>g){if(u){if(u[1]>=r)return}else u=[(n-a)/s,n];o=[(r-a)/s,r]}else{if(u){if(u[1]=i)return}else u=[e,s*e+a];o=[i,s*i+a]}else{if(u){if(u[0]j||Math.abs(r[0][1]-r[1][1])>j)||delete q[o]}function d(t){return F[t.index]={site:t,halfedges:[]}}function p(t,e){var n=t.site,i=e.left,r=e.right;return n===r&&(r=i,i=n),r?Math.atan2(r[1]-i[1],r[0]-i[0]):(n===i?(i=e[1],r=e[0]):(i=e[0],r=e[1]),Math.atan2(i[0]-r[0],r[1]-i[1]))}function _(t,e){return e[+(e.left!==t.site)]}function v(t,e){return e[+(e.left===t.site)]}function m(){for(var t,e,n,i,r=0,o=F.length;rj||Math.abs(m-g)>j)&&(u.splice(a,0,q.push(l(s,d,Math.abs(p-t)j?[t,Math.abs(f-t)j?[Math.abs(g-i)j?[n,Math.abs(f-n)j?[Math.abs(g-e)=-z)){var g=u*u+l*l,d=c*c+h*h,p=(h*g-l*d)/f,_=(u*d-c*g)/f,v=k.pop()||new x;v.arc=t,v.site=r,v.x=p+s,v.y=(v.cy=_+a)+Math.sqrt(p*p+_*_),t.circle=v;for(var m=null,y=G._;y;)if(v.yj)a=a.L;else{if(!((r=o-M(a,s))>j)){i>-j?(e=a.P,n=a):r>-j?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}d(t);var l=I(t);if(D.insert(e,l),e||n){if(e===n)return w(e),n=I(e.site),D.insert(l,n),l.edge=n.edge=u(e.site,l.site),E(e),void E(n);if(n){w(e),w(n);var h=e.site,f=h[0],g=h[1],p=t[0]-f,_=t[1]-g,v=n.site,m=v[0]-f,y=v[1]-g,x=2*(p*y-_*m),b=p*p+_*_,C=m*m+y*y,N=[(y*b-_*C)/x+f,(p*C-m*b)/x+g];c(n.edge,h,v,N),l.edge=u(h,t,null,N),n.edge=u(t,v,null,N),E(e),E(n)}else l.edge=u(e.site,l.site)}}function L(t,e){var n=t.site,i=n[0],r=n[1],o=r-e;if(!o)return i;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var c=a-i,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+r-o/2)))/h+i:(i+a)/2}function M(t,e){var n=t.N;if(n)return L(n,e);var i=t.site;return i[1]===e?i[0]:1/0}function P(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function R(t,e){return e[1]-t[1]||e[0]-t[0]}function O(t,e){var n,r,o,s=t.sort(R).pop();for(q=[],F=new Array(t.length),D=new i,G=new i;;)if(o=A,s&&(!o||s[1]=a)return null;var u=t-r.site[0],l=e-r.site[1],c=u*u+l*l;do{r=o.cells[i=s],s=null,r.halfedges.forEach(function(n){var i=o.edges[n],a=i.left;if(a!==r.site&&a||(a=i.right)){var u=t-a[0],l=e-a[1],h=u*u+l*l;h