text: !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(function(){try{return require("angular")}catch(a){}}()):"function"==typeof define&&define.amd?define(["angular"],b):"object"==typeof exports?exports.ionicMaterial=b(function(){try{return require("angular")}catch(a){}}()):a.ionicMaterial=b(a.angular)}(this,function(a){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";a.exports=function(){var a;try{a=c(1)}catch(b){}if(a&&a.version||(a=window.angular),!a||!a.version)throw new Error("ionic-material could not load angular module :(");var d=a.module("ionic-material",["ionic"]);return c(2)(d),c(3)(d),"ionic-material"}()},function(b,c,d){if("undefined"==typeof a){var e=new Error('Cannot find module "angular"');throw e.code="MODULE_NOT_FOUND",e}b.exports=a},function(a,b,c){"use strict";a.exports=function(a){function b(){function a(a){return null!==a&&a===a.window}function b(b){return a(b)?b:9===b.nodeType&&b.defaultView}function c(a){var c,d,e={top:0,left:0},f=a&&a.ownerDocument;return c=f.documentElement,"undefined"!=typeof a.getBoundingClientRect&&(e=a.getBoundingClientRect()),d=b(f),{top:e.top+d.pageYOffset-c.clientTop,left:e.left+d.pageXOffset-c.clientLeft}}function d(a){var b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null}function e(a){var b="";for(var c in a)a.hasOwnProperty(c)&&(b+=c+":"+a[c]+";");return b}var f,g=g||{};if(document&&document.querySelectorAll&&document.querySelectorAll.bind)try{f=document.querySelectorAll.bind(document)}catch(h){}else if(window&&window.angular&&window.angular.element)f=window.angular.element;else{var i=function(a,b,c){var d=a.length;b=null==b?0:0>b?Math.max(d+b,0):Math.min(b,d),c=null==c?d:0>c?Math.max(d+c,0):Math.min(c,d);for(var e=[];c>b;)e.push(a[b++]);return e},j=function(a,b,c){var d=i(arguments,2);return function(){return a.apply(b,d.concat(i(arguments)))}};f=j(document.querySelectorAll,document)}if(!f)throw new Error("ionic material ink module could not create reference of DOM nodes");var k={duration:500,show:function(a){if(2===a.button)return!1;var b=this,f=document.createElement("div"),g=this.dataset.inkColor,h=this.dataset.inkOpacity,i=g||h;f.className="ink-ripple",b.appendChild(f);var j=c(b),l=a.pageY-j.top,m=a.pageX-j.left,n="scale("+b.clientWidth/100*2.5+")";"touches"in a&&(l=a.touches[0].pageY-j.top,m=a.touches[0].pageX-j.left),f.setAttribute("data-hold",Date.now()),f.setAttribute("data-scale",n),f.setAttribute("data-x",m),f.setAttribute("data-y",l);var o={top:l+"px",left:m+"px"};if(f.className=f.className+" ink-notransition",i){var p;if(g){var q=d(g);p=q.r+","+q.g+","+q.b}else p="0,0,0";h||(h=.2);var r="rgba("+p+","+h+")";o["background-color"]=r}f.setAttribute("style",e(o)),f.className=f.className.replace("ink-notransition",""),o["-webkit-transform"]=n,o["-moz-transform"]=n,o["-ms-transform"]=n,o["-o-transform"]=n,o.transform=n,o.opacity="1",o["-webkit-transition-duration"]=k.duration+"ms",o["-moz-transition-duration"]=k.duration+"ms",o["-o-transition-duration"]=k.duration+"ms",o["transition-duration"]=k.duration+"ms",f.setAttribute("style",e(o))},hide:function(){for(var a=this,b=(1.4*a.clientWidth,null),c=a.children.length,d=0;c>d;d++)-1===a.children[d].className.indexOf("ink-ripple")||(b=a.children[d]);if(!b)return!1;var f=b.getAttribute("data-x"),g=b.getAttribute("data-y"),h=b.getAttribute("data-scale"),i=Date.now()-Number(b.getAttribute("data-hold")),j=500-i;0>j&&(j=0),setTimeout(function(){var c={top:g+"px",left:f+"px",opacity:"0","-webkit-transition-duration":k.duration+"ms","-moz-transition-duration":k.duration+"ms","-o-transition-duration":k.duration+"ms","transition-duration":k.duration+"ms","-webkit-transform":h,"-moz-transform":h,"-ms-transform":h,"-o-transform":h,transform:h};b.setAttribute("style",e(c)),setTimeout(function(){try{a.removeChild(b)}catch(c){return!1}},k.duration)},j)},wrapInput:function(a){for(var b=0;b<a.length;b++){var c=a[b];if("input"===c.tagName.toLowerCase()){var d=c.parentNode;if("i"===d.tagName.toLowerCase()&&-1!==d.className.indexOf("ink")&&-1!==d.className.indexOf("tab-item")&&-1!==d.className.indexOf("button-fab")&&-1!==d.className.indexOf("button-raised")&&-1!==d.className.indexOf("button-flat")&&-1!==d.className.indexOf("button-clear")&&-1!==d.className.indexOf("button")&&-1!==d.className.indexOf("item"))return!1;var e=document.createElement("i");e.className=c.className+" ink-input-wrapper";var f=c.getAttribute("style");f||(f=""),e.setAttribute("style",f),c.className="ink-button-input",c.removeAttribute("style"),d.replaceChild(e,c),e.appendChild(c)}}}};return g.displayEffect=function(a){a=a||{},"duration"in a&&(k.duration=a.duration);var b=".ink,.tab-item,.button-fab,.button-raised,.button-flat,.button-clear,a.item,.popup .button";k.wrapInput(f(b)),Array.prototype.forEach.call(f(b),function(a){"ontouchstart"in window?(a.addEventListener("touchstart",k.show,!1),a.addEventListener("touchend",k.hide,!1),a.addEventListener("touchcancel",k.hide,!1)):(a.addEventListener("mousedown",k.show,!1),a.addEventListener("mouseup",k.hide,!1),a.addEventListener("mouseleave",k.hide,!1))})},g}a.factory("ionicMaterialInk",b),b.inject=[]}},function(a,b,c){a.exports=function(a){function b(){"use strict";function a(){return window.innerHeight}function b(a,b){for(var c=0;b>c;c++){var d=a[c];d.className+=" in",d.className+=" done"}}function c(c){var d={finishDelayThrottle:2,finishSpeedPercent:.5,leftOffsetPercentage:.8,selector:".animate-blinds .item",startVelocity:1100};"undefined"==typeof c&&(c={}),c.finishDelayThrottle=c.finishDelayThrottle||d.finishDelayThrottle,c.finishSpeedPercent=c.finishSpeedPercent||d.finishSpeedPercent,c.leftOffsetPercentage=c.leftOffsetPercentage||d.leftOffsetPercentage,c.startVelocity=c.startVelocity||d.startVelocity,"undefined"==typeof c.selector&&(c.selector=d.selector);var e="undefined"==typeof c.selector||""===c.selector;if(e)return console.log("invalid blinds selector"),!1;for(var f=document.querySelectorAll(c.selector),g=f.length,h=0,i=a(),j=0;g>j&&f[j].offsetTop<i;j++)h+=1;for(var k=c.startVelocity,j=0;h>j;j++){var l=f[j],m=l.getBoundingClientRect(),n=m.left*c.leftOffsetPercentage+m.top,o=parseFloat(n/k).toFixed(2);l.style.webkitTransitionDelay=o+"s",l.style.transitionDelay=o+"s",l.className+=" in"}setTimeout(function(){for(var a=0;h>a;a++){var b=f[a],d=b.getBoundingClientRect(),e=d.left*c.leftOffsetPercentage+d.top;parseFloat(e/k/c.finishDelayThrottle).toFixed(2),f[a].className+=" done"}},k*c.finishSpeedPercent),b(f,g)}function d(c){var d={finishDelayThrottle:2,finishSpeedPercent:.72,leftOffsetPercentage:.8,selector:".animate-fade-slide-in .item",startVelocity:1100};"undefined"==typeof c&&(c={}),c.finishDelayThrottle=c.finishDelayThrottle||d.finishDelayThrottle,c.finishSpeedPercent=c.finishSpeedPercent||d.finishSpeedPercent,c.leftOffsetPercentage=c.leftOffsetPercentage||d.leftOffsetPercentage,c.startVelocity=c.startVelocity||d.startVelocity,"undefined"==typeof c.selector&&(c.selector=d.selector);var e="undefined"==typeof c.selector||""===c.selector;if(e)return console.log("invalid fadeSlideIn selector"),!1;for(var f=document.querySelectorAll(c.selector),g=f.length,h=0,i=a(),j=0;g>j&&f[j].offsetTop<i;j++)h+=1;for(var k=c.startVelocity,j=0;h>j;j++){var l=f[j],m=l.getBoundingClientRect(),n=m.left*c.leftOffsetPercentage+m.top,o=parseFloat(n/k).toFixed(2);l.style.webkitTransitionDelay=o+"s",l.style.transitionDelay=o+"s",l.className+=" in"}setTimeout(function(){for(var a=0;h>a;a++){var b=f[a],d=b.getBoundingClientRect(),e=d.left*c.leftOffsetPercentage+d.top,g=e/k/c.finishDelayThrottle;parseFloat(g).toFixed(2)}f[0].className+=" done"},k*c.finishSpeedPercent),b(f,g)}function e(c){var d={finishDelayThrottle:2,finishSpeedPercent:.72,leftOffsetPercentage:.8,selector:".animate-fade-slide-in-right .item",startVelocity:1100};"undefined"==typeof c&&(c={}),c.finishDelayThrottle=c.finishDelayThrottle||d.finishDelayThrottle,c.finishSpeedPercent=c.finishSpeedPercent||d.finishSpeedPercent,c.leftOffsetPercentage=c.leftOffsetPercentage||d.leftOffsetPercentage,c.startVelocity=c.startVelocity||d.startVelocity,"undefined"==typeof c.selector&&(c.selector=d.selector);var e="undefined"==typeof c.selector||""===c.selector;if(e)return console.log("invalid fadeSlideInRight selector"),!1;for(var f=document.querySelectorAll(c.selector),g=f.length,h=0,i=a(),j=0;g>j&&f[j].offsetTop<i;j++)h+=1;for(var k=c.startVelocity,j=0;h>j;j++){var l=f[j],m=l.getBoundingClientRect(),n=m.left*c.leftOffsetPercentage+m.top,o=parseFloat(n/k).toFixed(2);l.style.webkitTransitionDelay=o+"s",l.style.transitionDelay=o+"s",l.className+=" in"}setTimeout(function(){for(var a=0;h>a;a++){var b=f[a],d=b.getBoundingClientRect(),e=d.left*c.leftOffsetPercentage+d.top,g=e/k/c.finishDelayThrottle;parseFloat(g).toFixed(2)}f[0].className+=" done"},k*c.finishSpeedPercent),b(f,g)}function f(c){var d={finishDelayThrottle:2,finishSpeedPercent:.72,leftOffsetPercentage:.8,selector:".animate-ripple .item",startVelocity:1100};"undefined"==typeof c&&(c={}),c.finishDelayThrottle=c.finishDelayThrottle||d.finishDelayThrottle,c.finishSpeedPercent=c.finishSpeedPercent||d.finishSpeedPercent,c.leftOffsetPercentage=c.leftOffsetPercentage||d.leftOffsetPercentage,c.startVelocity=c.startVelocity||d.startVelocity,"undefined"==typeof c.selector&&(c.selector=d.selector);var e="undefined"==typeof c.selector||""===c.selector;if(e)return console.log("invalid ripple selector"),!1;for(var f=document.querySelectorAll(c.selector),g=f.length,h=0,i=a(),j=0;j<f.length&&f[j].offsetTop<i;j++)h+=1;for(var k=c.startVelocity,j=0;h>j;j++){var l=f[j],m=l.getBoundingClientRect(),n=m.left*c.leftOffsetPercentage+m.top,o=parseFloat(n/k).toFixed(2);l.style.webkitTransitionDelay=o+"s",l.style.transitionDelay=o+"s",l.className+=" in"}setTimeout(function(){for(var a=0;h>a;a++){var b=f[a],d=b.getBoundingClientRect(),e=d.left*c.leftOffsetPercentage+d.top,g=e/k/c.finishDelayThrottle;parseFloat(g).toFixed(2)}f[0].className+=" done"},k*c.finishSpeedPercent),b(f,g)}function g(a){"string"==typeof a&&(a={selector:a});var b="undefined"==typeof a.selector||""===a.selector;if(b)return console.log("invalid pushDown selector"),!1;for(var c=document.querySelectorAll(a.selector),d=c.length,e=0;d>e;e++){var f=c[e],g="animate-pan-in-left",h=f.className.lastIndexOf(g);f.className=f.className.substr(0,h)}}function h(a){"string"==typeof a&&(a={selector:a});var b="undefined"==typeof a.selector||""===a.selector;if(b)return console.log("invalid pushDown selector"),!1;for(var c=document.querySelectorAll(a.selector),d=c.length,e=0;d>e;e++){var f=c[e],g=a.selector.split(".")[1],h=f.className.lastIndexOf(g);f.className=f.className.substr(0,h)}}function i(a){"string"==typeof a&&(a={selector:a});var b="undefined"==typeof a.selector||""===a.selector;if(b)return console.log("invalid pushDown selector"),!1;for(var c=document.querySelectorAll(a.selector),d=c.length,e=0;d>e;e++){var f=c[e],g=a.selector.split(".")[1],h=f.className.lastIndexOf(g);f.className=f.className.substr(0,h)}}var j={blinds:c,fadeSlideIn:d,fadeSlideInRight:e,panInLeft:g,pushDown:h,ripple:f,slideUp:i};return j}a.factory("ionicMaterialMotion",b),b.$inject=[]}}])}),function(a,b,c){"use strict";function d(a,c){c=c||{},b.forEach(c,function(a,b){delete c[b]});for(var d in a)!a.hasOwnProperty(d)||"$"===d.charAt(0)&&"$"===d.charAt(1)||(c[d]=a[d]);return c}var e=b.$$minErr("$resource"),f=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;b.module("ngResource",["ng"]).provider("$resource",function(){var a=/^https?:\/\/[^\/]*/,g=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}},this.$get=["$http","$q",function(h,i){function j(a,b){this.template=a,this.defaults=n({},g.defaults,b),this.urlParams={}}function k(a,q,r,s){function t(a,d){var g={};return d=n({},q,d),m(d,function(d,h){p(d)&&(d=d());var i;if(d&&d.charAt&&"@"==d.charAt(0)){i=a;var j=d.substr(1);if(null==j||""===j||"hasOwnProperty"===j||!f.test("."+j))throw e("badmember",j);for(var j=j.split("."),k=0,l=j.length;l>k&&b.isDefined(i);k++){var m=j[k];i=null!==i?i[m]:c}}else i=d;g[h]=i}),g}function u(a){return a.resource}function v(a){d(a||{},this)}var w=new j(a,s);return r=n({},g.defaults.actions,r),v.prototype.toJSON=function(){var a=n({},this);return delete a.$promise,delete a.$resolved,a},m(r,function(a,f){var g=/^(POST|PUT|PATCH)$/i.test(a.method);v[f]=function(j,k,q,r){var s,x,y,z={};switch(arguments.length){case 4:y=r,x=q;case 3:case 2:if(!p(k)){z=j,s=k,x=q;break}if(p(j)){x=j,y=k;break}x=k,y=q;case 1:p(j)?x=j:g?s=j:z=j;break;case 0:break;default:throw e("badargs",arguments.length)}var A=this instanceof v,B=A?s:a.isArray?[]:new v(s),C={},D=a.interceptor&&a.interceptor.response||u,E=a.interceptor&&a.interceptor.responseError||c;return m(a,function(a,b){"params"!=b&&"isArray"!=b&&"interceptor"!=b&&(C[b]=o(a))}),g&&(C.data=s),w.setUrlParams(C,n({},t(s,a.params||{}),z),a.url),z=h(C).then(function(c){var g=c.data,h=B.$promise;if(g){if(b.isArray(g)!==!!a.isArray)throw e("badcfg",f,a.isArray?"array":"object",b.isArray(g)?"array":"object",C.method,C.url);a.isArray?(B.length=0,m(g,function(a){"object"==typeof a?B.push(new v(a)):B.push(a)})):(d(g,B),B.$promise=h)}return B.$resolved=!0,c.resource=B,c},function(a){return B.$resolved=!0,(y||l)(a),i.reject(a)}),z=z.then(function(a){var b=D(a);return(x||l)(b,a.headers),b},E),A?z:(B.$promise=z,B.$resolved=!1,B)},v.prototype["$"+f]=function(a,b,c){return p(a)&&(c=b,b=a,a={}),a=v[f].call(this,a,this,b,c),a.$promise||a}}),v.bind=function(b){return k(a,n({},q,b),r)},v}var l=b.noop,m=b.forEach,n=b.extend,o=b.copy,p=b.isFunction;return j.prototype={setUrlParams:function(c,d,f){var g,h,i=this,j=f||i.template,k="",l=i.urlParams={};m(j.split(/\W/),function(a){if("hasOwnProperty"===a)throw e("badname");!/^\d+$/.test(a)&&a&&new RegExp("(^|[^\\\\]):"+a+"(\\W|$)").test(j)&&(l[a]=!0)}),j=j.replace(/\\:/g,":"),j=j.replace(a,function(a){return k=a,""}),d=d||{},m(i.urlParams,function(a,c){g=d.hasOwnProperty(c)?d[c]:i.defaults[c],b.isDefined(g)&&null!==g?(h=encodeURIComponent(g).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),j=j.replace(new RegExp(":"+c+"(\\W|$)","g"),function(a,b){return h+b})):j=j.replace(new RegExp("(/?):"+c+"(\\W|$)","g"),function(a,b,c){return"/"==c.charAt(0)?c:b+c})}),i.defaults.stripTrailingSlashes&&(j=j.replace(/\/+$/,"")||"/"),j=j.replace(/\/\.(?=\w+($|\?))/,"."),c.url=k+j.replace(/\/\\\./,"/."),m(d,function(a,b){i.urlParams[b]||(c.params=c.params||{},c.params[b]=a)})}},k}]})}(window,window.angular),angular.module("jett.ionic.filter.bar",["ionic"]),function(a,b){"use strict";a.module("jett.ionic.filter.bar").directive("ionFilterBar",["$timeout","$ionicGesture","$ionicPlatform",function(c,d,e){var f;return f=e.is("android")?'<div class="filter-bar-wrapper filter-bar-{{::config.theme}} filter-bar-transition-{{::config.transition}}"><div class="bar bar-header bar-{{::config.theme}} item-input-inset"><button class="filter-bar-cancel button button-icon icon {{::config.back}}"></button><label class="item-input-wrapper"><input type="search" class="filter-bar-search" ng-model="data.filterText" placeholder="{{::config.placeholder}}" /><button class="filter-bar-clear button button-icon icon" ng-class="getClearButtonClass()"></button></label></div></div>':'<div class="filter-bar-wrapper filter-bar-{{::config.theme}} filter-bar-transition-{{::config.transition}}"><div class="bar bar-header bar-{{::config.theme}} item-input-inset"><label class="item-input-wrapper"><i class="icon {{::config.search}} placeholder-icon"></i><input type="search" class="filter-bar-search" ng-model="data.filterText" placeholder="{{::config.placeholder}}"/><button class="filter-bar-clear button button-icon icon" ng-class="getClearButtonClass()"></button></label><button class="filter-bar-cancel button button-clear" ng-bind-html="::cancelText"></button></div></div>',{restrict:"E",scope:!0,link:function(e,f){var g,h,i,j,k,l=f[0],m=l.querySelector(".filter-bar-clear"),n=l.querySelector(".filter-bar-cancel"),o=l.querySelector(".filter-bar-search"),p=function(){e.cancelFilterBar()};e.config.backdrop&&(i=a.element('<div class="filter-bar-backdrop"></div>'),f.append(i),j=function(a){a.target==i[0]&&p()},i.bind("click",j),h=d.on("swipe",j,i)),e.favoritesEnabled?e.getClearButtonClass=function(){return e.data.filterText.length?e.config.clear:e.config.favorite}:e.getClearButtonClass=function(){return e.data.filterText.length?e.config.clear:"filter-bar-element-hide"};var q=function(){m.classList.contains(e.config.favorite)?e.showModal():c(function(){e.data.filterText="",ionic.requestAnimationFrame(function(){e.showBackdrop(),e.scrollItemsTop(),e.focusInput()})})},r=function(){e.scrollItemsTop(),e.focusInput()},s=function(a){27==a.which?p():e.data.filterText&&e.data.filterText.length?e.hideBackdrop():e.showBackdrop()};n.addEventListener("click",p),m.addEventListener("touchstart",q),m.addEventListener("mousedown",q),o.addEventListener("touchstart",r),o.addEventListener("mousedown",r),b.addEventListener("keyup",s);var t=function(){e.filterItems(e.data.filterText)};e.$on("$destroy",function(){f.remove(),b.removeEventListener("keyup",s),i&&d.off(h,"swipe",j),k()}),k=e.$watch("data.filterText",function(a,b){var d;g&&c.cancel(g),a!==b&&(d=a.length&&e.debounce?e.delay:0,g=c(t,d,!1))})},template:f}}])}(angular,document),function(a){"use strict";a.module("jett.ionic.filter.bar").provider("$ionicFilterBarConfig",function(){function b(a,b){h.platform[a]=b,f.platform[a]={},c(h,h.platform[a]),d(h.platform[a],f.platform[a],"")}function c(b,d){for(var e in b)e!=g&&b.hasOwnProperty(e)&&(a.isObject(b[e])?(a.isDefined(d[e])||(d[e]={}),c(b[e],d[e])):a.isDefined(d[e])||(d[e]=null))}function d(b,c,f){a.forEach(b,function(i,j){a.isObject(b[j])?(c[j]={},d(b[j],c[j],f+"."+j)):c[j]=function(a){if(arguments.length)return b[j]=a,c;if(b[j]==g){var d=e(h.platform,ionic.Platform.platform()+f+"."+j);return d||d===!1?d:e(h.platform,"default"+f+"."+j)}return b[j]}})}function e(b,c){c=c.split(".");for(var d=0;d<c.length;d++){if(!b||!a.isDefined(b[c[d]]))return null;b=b[c[d]]}return b}var f=this;f.platform={};var g="platform",h={theme:g,clear:g,add:g,close:g,done:g,remove:g,reorder:g,favorite:g,search:g,backdrop:g,transition:g,platform:{},placeholder:g};d(h,f,""),b("default",{clear:"ion-ios-close",add:"ion-ios-plus-outline",close:"ion-ios-close-empty",done:"ion-ios-checkmark-empty",remove:"ion-ios-trash-outline",reorder:"ion-drag",favorite:"ion-ios-star",search:"ion-ios-search-strong",backdrop:!0,transition:"vertical",placeholder:"Search"}),b("ios",{}),b("android",{clear:"ion-android-close",close:"ion-android-close",done:"ion-android-done",remove:"ion-android-delete",favorite:"ion-android-star",search:!1,backdrop:!1,transition:"horizontal"}),f.setPlatformConfig=b,f.$get=function(){return f}})}(angular),function(a,b){"use strict";var c='<ion-modal-view ng-controller="$ionicFilterBarModalCtrl" class="filter-bar-modal"><ion-header-bar class="bar bar-{{::config.theme}} disable-user-behavior"><button class="button button-icon {{::config.close}}" ng-click="closeModal()"></button><h1 class="title" ng-bind-html="::favoritesTitle"></h1><button ng-if="searches.length > 1" class="button button-icon" ng-class="displayData.showReorder ? config.done : config.reorder" ng-click="displayData.showReorder = !displayData.showReorder"></button></ion-header-bar><ion-content><ion-list show-reorder="displayData.showReorder" delegate-handle="searches-list"><ion-item ng-repeat="item in searches" class="item-remove-animate" ng-class="{reordered: item.reordered}" ng-click="itemClicked(item.text, $event)"><span ng-bind-html="item.text"></span><ion-option-button class="button-assertive icon {{::config.remove}}" ng-click="deleteItem(item)"></ion-option-button><ion-reorder-button class="{{::config.reorder}}" on-reorder="moveItem(item, $fromIndex, $toIndex)"></ion-reorder-button></ion-item><div class="item item-input"><input type="text" ng-model="newItem.text" placeholder="{{::favoritesAddPlaceholder}}"/><button class="button button-icon icon {{::config.add}}" ng-click="addItem(newItem)"></button></div></ion-list></ion-content> </ion-modal-view>',d=function(a){var b=["light","stable","positive","calm","balanced","energized","assertive","royal","dark"],c=a&&a.classList;if(c)for(var d=0;d<b.length;d++)if(c.contains("bar-"+b[d]))return b[d]};a.module("jett.ionic.filter.bar").factory("$ionicFilterBar",["$document","$rootScope","$compile","$timeout","$filter","$ionicPlatform","$ionicFilterBarConfig","$ionicConfig","$ionicModal","$ionicScrollDelegate",function(e,f,g,h,i,j,k,l,m,n){function o(e){if(!p){p=!0,e=e||{};var k=f.$new(!0),l=!1,o=!1;e.container&&(e.container=q.querySelector(e.container)),a.extend(k,{config:r,$deregisterBackButton:a.noop,update:a.noop,cancel:a.noop,done:a.noop,scrollDelegate:n,filter:i("filter"),filterProperties:null,expression:null,comparator:null,debounce:!0,delay:300,cancelText:"Cancel",cancelOnStateChange:!0,container:q,favoritesTitle:"Favorite Searches",favoritesAddPlaceholder:"Add a search term",favoritesEnabled:!1,favoritesKey:"ionic_filter_bar_favorites"},e),k.data={filterText:""},k.config.theme||(k.config.theme=d(k.container.querySelector(".bar.bar-header")));var s=k.element=g('<ion-filter-bar class="filter-bar"></ion-filter-bar>')(k),t=s.children().eq(0),u=t.find("input")[0],v=s.children().eq(1),w=k.scrollDelegate.getScrollView(),x=!!w,y=x?w.__container:null,z=k.cancelOnStateChange?f.$on("$stateChangeSuccess",function(){k.cancelFilterBar()}):a.noop,A=function(){o||(o=!0,u&&u.focus())},B=function(){o&&(o=!1,u&&u.blur())},C=function(){w.__scrollTop>0&&B()};return k.scrollItemsTop=function(){x&&w.__scrollTop>0&&k.scrollDelegate.scrollTop&&k.scrollDelegate.scrollTop()},k.focusInput=function(){o=!1,A()},k.hideBackdrop=function(){v.length&&l&&(l=!1,v.removeClass("active").css("display","none"))},k.showBackdrop=function(){v.length&&!l&&(l=!0,v.css("display","block").addClass("active"))},k.showModal=function(){k.modal=m.fromTemplate(c,{scope:k}),k.modal.show()},k.filterItems=function(b){var c,d;b.length?(k.expression?c=a.bind(this,k.expression,b):a.isArray(k.filterProperties)?(c={},a.forEach(k.filterProperties,function(a){c[a]=b})):k.filterProperties?(c={},c[k.filterProperties]=b):c=b,d=k.filter(k.items,c,k.comparator)):d=k.items,h(function(){k.update(d,b),k.scrollItemsTop()})},k.$deregisterBackButton=j.registerBackButtonAction(function(){h(k.cancelFilterBar)},300),k.removeFilterBar=function(c){k.removed||(k.removed=!0,b.requestAnimationFrame(function(){t.removeClass("filter-bar-in"),B(),k.hideBackdrop(),h(function(){k.scrollItemsTop(),k.update(k.items),k.$destroy(),s.remove(),k.cancelFilterBar.$scope=k.modal=y=w=t=v=u=null,p=!1,(c||a.noop)()},350)}),h(function(){k.container.classList.remove("filter-bar-open")},400),k.$deregisterBackButton(),z(),y&&y.removeEventListener("scroll",C))},k.showFilterBar=function(c){k.removed||(k.container.appendChild(s[0]),k.container.classList.add("filter-bar-open"),k.scrollItemsTop(),b.requestAnimationFrame(function(){k.removed||h(function(){t.addClass("filter-bar-in"),k.focusInput(),k.showBackdrop(),(c||a.noop)()},20,!1)}),y&&y.addEventListener("scroll",C))},k.cancelFilterBar=function(){k.removeFilterBar(k.cancel)},k.showFilterBar(k.done),k.cancelFilterBar.$scope=k,k.cancelFilterBar}}var p=!1,q=e[0].body,r={theme:k.theme(),transition:k.transition(),back:l.backButton.icon(),clear:k.clear(),favorite:k.favorite(),search:k.search(),backdrop:k.backdrop(),placeholder:k.placeholder(),close:k.close(),done:k.done(),reorder:k.reorder(),remove:k.remove(),add:k.add()};return{show:o}}])}(angular,ionic),function(a){"use strict";a.module("jett.ionic.filter.bar").controller("$ionicFilterBarModalCtrl",["$window","$scope","$timeout","$ionicListDelegate",function(b,c,d,e){var f=c.$parent.favoritesKey;c.displayData={showReorder:!1},c.searches=a.fromJson(b.localStorage.getItem(f))||[],c.newItem={text:""},c.moveItem=function(a,b,e){a.reordered=!0,c.searches.splice(b,1),c.searches.splice(e,0,a),d(function(){delete a.reordered},500)},c.deleteItem=function(a){var b=c.searches.indexOf(a);c.searches.splice(b,1)},c.addItem=function(){c.newItem.text&&(c.searches.push({text:c.newItem.text}),c.newItem.text="")},c.closeModal=function(){b.localStorage.setItem(f,a.toJson(c.searches)),c.$parent.modal.remove()},c.itemClicked=function(a,b){var d=!!b.currentTarget.querySelector(".item-options.invisible");d?(c.closeModal(),c.$parent.hideBackdrop(),c.$parent.data.filterText=a,c.$parent.filterItems(a)):e.$getByHandle("searches-list").closeOptionButtons()}}])}(angular),function(){"use strict";angular.module("http-auth-interceptor",["http-auth-interceptor-buffer"]).factory("authService",["$rootScope","httpBuffer",function(a,b){return{loginConfirmed:function(c,d){var e=d||function(a){return a};a.$broadcast("event:auth-loginConfirmed",c),b.retryAll(e)},loginCancelled:function(c,d){b.rejectAll(d),a.$broadcast("event:auth-loginCancelled",c)}}}]).config(["$httpProvider",function(a){a.interceptors.push(["$rootScope","$q","httpBuffer",function(a,b,c){return{responseError:function(d){if(!d.config.ignoreAuthModule)switch(d.status){case 401:var e=b.defer();return c.append(d.config,e),a.$broadcast("event:auth-loginRequired",d),e.promise;case 403:a.$broadcast("event:auth-forbidden",d)}return b.reject(d)}}}])}]),angular.module("http-auth-interceptor-buffer",[]).factory("httpBuffer",["$injector",function(a){function b(b,d){function e(a){d.resolve(a)}function f(a){d.reject(a)}c=c||a.get("$http"),c(b).then(e,f)}var c,d=[];return{append:function(a,b){d.push({config:a,deferred:b})},rejectAll:function(a){if(a)for(var b=0;b<d.length;++b)d[b].deferred.reject(a);d=[]},retryAll:function(a){for(var c=0;c<d.length;++c)b(a(d[c].config),d[c].deferred);d=[]}}}])}(),angular.module("ionicLazyLoad",[]),angular.module("ionicLazyLoad").directive("lazyScroll",["$rootScope","$timeout",function(a,b){return{restrict:"A",link:function(c,d){var e=0;c.invoke=function(){a.$broadcast("lazyScrollEvent")},d.bind("scroll",function(){b.cancel(e),e=b(c.invoke,0)})}}}]).directive("imageLazySrc",["$document","$timeout","$ionicScrollDelegate","$compile",function(a,b,c,d){return{restrict:"A",scope:{lazyScrollResize:"@lazyScrollResize",imageLazyBackgroundImage:"@imageLazyBackgroundImage"},link:function(e,f,g){function h(){if(f.bind("load",function(a){g.imageLazyLoader&&j.remove(),"true"==e.lazyScrollResize&&c.resize()}),"true"==e.imageLazyBackgroundImage){var a=new Image;a.onload=function(){g.imageLazyLoader&&j.remove(),f[0].style.backgroundImage="url("+g.imageLazySrc+")","true"==e.lazyScrollResize&&c.resize()},a.src=g.imageLazySrc}else f[0].src=g.imageLazySrc}function i(){var b=a[0].documentElement.clientHeight,c=a[0].documentElement.clientWidth,d=f[0].getBoundingClientRect();return d.top>=0&&d.top<=b+parseInt(g.imageLazyDistanceFromBottomToLoad)&&d.left>=0&&d.left<=c+parseInt(g.imageLazyDistanceFromRightToLoad)}if(g.imageLazyDistanceFromBottomToLoad||(g.imageLazyDistanceFromBottomToLoad=0),g.imageLazyDistanceFromRightToLoad||(g.imageLazyDistanceFromRightToLoad=0),g.imageLazyLoader){var j=d('<div class="image-loader-container"><ion-spinner class="image-loader" icon="'+g.imageLazyLoader+'"></ion-spinner></div>')(e);f.after(j)}var k=e.$on("lazyScrollEvent",function(){i()&&(h(),k())});f.on("$destroy",function(){k()}),b(function(){i()&&(h(),k())},500)}}}]),function(){"use strict";function a(a,b,c,m){function n(b,c,e){e||!i(c)||j(c)||(e=c,c=void 0),this.protocols=c,this.url=b||"Missing URL",this.ssl=/(wss)/i.test(this.url),this.scope=e&&e.scope||a,this.rootScopeFailover=e&&e.rootScopeFailover&&!0,this.useApplyAsync=e&&e.useApplyAsync||!1,this.initialTimeout=e&&e.initialTimeout||500,this.maxTimeout=e&&e.maxTimeout||3e5,this.reconnectIfNotNormalClose=e&&e.reconnectIfNotNormalClose||!1,this._reconnectAttempts=0,this.sendQueue=[],this.onOpenCallbacks=[],this.onMessageCallbacks=[],this.onErrorCallbacks=[],this.onCloseCallbacks=[],d(this._readyStateConstants),b?this._connect():this._setInternalState(0)}return n.prototype._readyStateConstants={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3,RECONNECT_ABORTED:4},n.prototype._normalCloseCode=1e3,n.prototype._reconnectableStatusCodes=[4e3],n.prototype.safeDigest=function(a){a&&!this.scope.$$phase&&this.scope.$digest()},n.prototype.bindToScope=function(b){var c=this;return b&&(this.scope=b,this.rootScopeFailover&&this.scope.$on("$destroy",function(){c.scope=a})),c},n.prototype._connect=function(a){(a||!this.socket||this.socket.readyState!==this._readyStateConstants.OPEN)&&(this.socket=m.create(this.url,this.protocols),this.socket.onmessage=angular.bind(this,this._onMessageHandler),this.socket.onopen=angular.bind(this,this._onOpenHandler),this.socket.onerror=angular.bind(this,this._onErrorHandler),this.socket.onclose=angular.bind(this,this._onCloseHandler))},n.prototype.fireQueue=function(){for(;this.sendQueue.length&&this.socket.readyState===this._readyStateConstants.OPEN;){var a=this.sendQueue.shift();this.socket.send(f(a.message)?a.message:JSON.stringify(a.message)),a.deferred.resolve()}},n.prototype.notifyOpenCallbacks=function(a){for(var b=0;b<this.onOpenCallbacks.length;b++)this.onOpenCallbacks[b].call(this,a)},n.prototype.notifyCloseCallbacks=function(a){for(var b=0;b<this.onCloseCallbacks.length;b++)this.onCloseCallbacks[b].call(this,a)},n.prototype.notifyErrorCallbacks=function(a){for(var b=0;b<this.onErrorCallbacks.length;b++)this.onErrorCallbacks[b].call(this,a)},n.prototype.onOpen=function(a){return this.onOpenCallbacks.push(a),this},n.prototype.onClose=function(a){return this.onCloseCallbacks.push(a),this},n.prototype.onError=function(a){return this.onErrorCallbacks.push(a),this},n.prototype.onMessage=function(a,b){if(!g(a))throw new Error("Callback must be a function");if(b&&h(b.filter)&&!f(b.filter)&&!(b.filter instanceof RegExp))throw new Error("Pattern must be a string or regular expression");return this.onMessageCallbacks.push({fn:a,pattern:b?b.filter:void 0,autoApply:b?b.autoApply:!0}),this},n.prototype._onOpenHandler=function(a){this._reconnectAttempts=0,this.notifyOpenCallbacks(a),this.fireQueue()},n.prototype._onCloseHandler=function(a){this.notifyCloseCallbacks(a),(this.reconnectIfNotNormalClose&&a.code!==this._normalCloseCode||this._reconnectableStatusCodes.indexOf(a.code)>-1)&&this.reconnect()},n.prototype._onErrorHandler=function(a){this.notifyErrorCallbacks(a)},n.prototype._onMessageHandler=function(a){function b(a,b,c){c=l.call(arguments,2),e.useApplyAsync?e.scope.$applyAsync(function(){a.apply(e,c)}):(a.apply(e,c),e.safeDigest(b))}for(var c,d,e=this,g=0;g<e.onMessageCallbacks.length;g++)d=e.onMessageCallbacks[g],c=d.pattern,c?f(c)&&a.data===c?b(d.fn,d.autoApply,a):c instanceof RegExp&&c.exec(a.data)&&b(d.fn,d.autoApply,a):b(d.fn,d.autoApply,a)},n.prototype.close=function(a){return(a||!this.socket.bufferedAmount)&&this.socket.close(),this},n.prototype.send=function(a){function c(a){a.cancel=d;var b=a.then;return a.then=function(){var a=b.apply(this,arguments);return c(a)},a}function d(b){return f.sendQueue.splice(f.sendQueue.indexOf(a),1),e.reject(b),f}var e=b.defer(),f=this,g=c(e.promise);return f.readyState===f._readyStateConstants.RECONNECT_ABORTED?e.reject("Socket connection has been closed"):(f.sendQueue.push({message:a,deferred:e}),f.fireQueue()),m.isMocked&&m.isMocked()&&m.isConnected(this.url)&&this._onMessageHandler(m.mockSend()),g},n.prototype.reconnect=function(){this.close();var a=this._getBackoffDelay(++this._reconnectAttempts),b=a/1e3;return console.log("Reconnecting in "+b+" seconds"),c(angular.bind(this,this._connect),a),this},n.prototype._getBackoffDelay=function(a){
  var b=Math.random()+1,c=this.initialTimeout,d=2,e=a,f=this.maxTimeout;return Math.floor(Math.min(b*c*Math.pow(d,e),f))},n.prototype._setInternalState=function(a){if(Math.floor(a)!==a||0>a||a>4)throw new Error("state must be an integer between 0 and 4, got: "+a);e||(this.readyState=a||this.socket.readyState),this._internalConnectionState=a,k(this.sendQueue,function(a){a.deferred.reject("Message cancelled due to closed socket connection")})},e&&e(n.prototype,"readyState",{get:function(){return this._internalConnectionState||this.socket.readyState},set:function(){throw new Error("The readyState property is read-only")}}),function(a,b,c){return new n(a,b,c)}}function b(a,b){this.create=function(b,c){var d,e,f=/wss?:\/\//.exec(b);if(!f)throw new Error("Invalid url provided");if("object"==typeof exports&&require)try{e=require("ws"),d=e.Client||e.client||e}catch(g){}return d=d||a.WebSocket||a.MozWebSocket,c?new d(b,c):new d(b)},this.createWebSocketBackend=function(a,c){return b.warn("Deprecated: Please use .create(url, protocols)"),this.create(a,c)}}var c=angular.noop,d=Object.freeze?Object.freeze:c,e=Object.defineProperty,f=angular.isString,g=angular.isFunction,h=angular.isDefined,i=angular.isObject,j=angular.isArray,k=angular.forEach,l=Array.prototype.slice;Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=this.length>>>0,c=Number(arguments[1])||0;for(c=0>c?Math.ceil(c):Math.floor(c),0>c&&(c+=b);b>c;c++)if(c in this&&this[c]===a)return c;return-1}),angular.module("ngWebSocket",[]).factory("$websocket",["$rootScope","$q","$timeout","$websocketBackend",a]).factory("WebSocket",["$rootScope","$q","$timeout","WebsocketBackend",a]).service("$websocketBackend",["$window","$log",b]).service("WebSocketBackend",["$window","$log",b]),angular.module("angular-websocket",["ngWebSocket"]),"object"==typeof module&&"function"!=typeof define&&(module.exports=angular.module("ngWebSocket"))}(),function(){"use strict";function a(a,b){return a.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null,statefulFilters:!0}).constant("moment",b).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null,titleFormat:null,fullDateThreshold:null,fullDateFormat:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function(b,c,d,e,f){return function(g,h,i){function j(){var a;if(p)a=p;else if(e.serverTime){var b=(new Date).getTime(),d=b-w+e.serverTime;a=c(d)}else a=c();return a}function k(){q&&(b.clearTimeout(q),q=null)}function l(a){var c=j().diff(a,"day"),d=u&&c>=u;if(d?h.text(a.format(v)):h.text(a.from(j(),s)),t&&!h.attr("title")&&h.attr("title",a.local().format(t)),!d){var e=Math.abs(j().diff(a,"minute")),f=3600;1>e?f=1:60>e?f=30:180>e&&(f=300),q=b.setTimeout(function(){l(a)},1e3*f)}}function m(a){z&&h.attr("datetime",a)}function n(){if(k(),o){var a=d.preprocessDate(o,x,r);l(a),m(a.toISOString())}}var o,p,q=null,r=f.format,s=e.withoutSuffix,t=e.titleFormat,u=e.fullDateThreshold,v=e.fullDateFormat,w=(new Date).getTime(),x=f.preprocess,y=i.amTimeAgo,z="TIME"===h[0].nodeName.toUpperCase();g.$watch(y,function(a){return"undefined"==typeof a||null===a||""===a?(k(),void(o&&(h.text(""),m(""),o=null))):(o=a,void n())}),a.isDefined(i.amFrom)&&g.$watch(i.amFrom,function(a){p="undefined"==typeof a||null===a||""===a?null:c(a),n()}),a.isDefined(i.amWithoutSuffix)&&g.$watch(i.amWithoutSuffix,function(a){"boolean"==typeof a?(s=a,n()):s=e.withoutSuffix}),i.$observe("amFormat",function(a){"undefined"!=typeof a&&(r=a,n())}),i.$observe("amPreprocess",function(a){x=a,n()}),i.$observe("amFullDateThreshold",function(a){u=a,n()}),i.$observe("amFullDateFormat",function(a){v=a,n()}),g.$on("$destroy",function(){k()}),g.$on("amMoment:localeChanged",function(){n()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(b,c,d,e){this.preprocessors={utc:b.utc,unix:b.unix},this.changeLocale=function(d,e){var f=b.locale(d,e);return a.isDefined(d)&&c.$broadcast("amMoment:localeChanged"),f},this.changeTimezone=function(a){e.timezone=a,c.$broadcast("amMoment:timezoneChanged")},this.preprocessDate=function(c,f,g){return a.isUndefined(f)&&(f=e.preprocess),this.preprocessors[f]?this.preprocessors[f](c,g):(f&&d.warn("angular-moment: Ignoring unsupported value for preprocess: "+f),!isNaN(parseFloat(c))&&isFinite(c)?b(parseInt(c,10)):b(c,g))},this.applyTimezone=function(a,b){return(b=b||e.timezone)?(b.match(/^Z|[+-]\d\d:?\d\d$/i)?a=a.utcOffset(b):a.tz?a=a.tz(b):d.warn("angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?"),a):a}}]).filter("amCalendar",["moment","amMoment","angularMomentConfig",function(a,b,c){function d(c,d,e){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,d);var f=a(c);return f.isValid()?b.applyTimezone(f,e).calendar():""}return d.$stateful=c.statefulFilters,d}]).filter("amDifference",["moment","amMoment","angularMomentConfig",function(a,b,c){function d(c,d,e,f,g,h){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,g);var i=a(c);if(!i.isValid())return"";var j;if("undefined"==typeof d||null===d)j=a();else if(d=b.preprocessDate(d,h),j=a(d),!j.isValid())return"";return b.applyTimezone(i).diff(b.applyTimezone(j),e,f)}return d.$stateful=c.statefulFilters,d}]).filter("amDateFormat",["moment","amMoment","angularMomentConfig",function(a,b,c){function d(d,e,f,g,h){var i=h||c.format;if("undefined"==typeof d||null===d)return"";d=b.preprocessDate(d,f,i);var j=a(d);return j.isValid()?b.applyTimezone(j,g).format(e):""}return d.$stateful=c.statefulFilters,d}]).filter("amDurationFormat",["moment","angularMomentConfig",function(a,b){function c(b,c,d){return"undefined"==typeof b||null===b?"":a.duration(b,c).humanize(d)}return c.$stateful=b.statefulFilters,c}]).filter("amTimeAgo",["moment","amMoment","angularMomentConfig",function(a,b,c){function d(c,d,e,f){var g,h;return"undefined"==typeof c||null===c?"":(c=b.preprocessDate(c,d),g=a(c),g.isValid()?(h=a(f),"undefined"!=typeof f&&h.isValid()?b.applyTimezone(g).from(h,e):b.applyTimezone(g).fromNow(e)):"")}return d.$stateful=c.statefulFilters,d}]).filter("amSubtract",["moment","angularMomentConfig",function(a,b){function c(b,c,d){return"undefined"==typeof b||null===b?"":a(b).subtract(parseInt(c,10),d)}return c.$stateful=b.statefulFilters,c}]).filter("amAdd",["moment","angularMomentConfig",function(a,b){function c(b,c,d){return"undefined"==typeof b||null===b?"":a(b).add(parseInt(c,10),d)}return c.$stateful=b.statefulFilters,c}])}"function"==typeof define&&define.amd?define(["angular","moment"],a):"undefined"!=typeof module&&module&&module.exports?(a(angular,require("moment")),module.exports="angularMoment"):a(angular,("undefined"!=typeof global?global:window).moment)}(),angular.module("ion-affix",["ionic"]).directive("ionAffix",["$ionicPosition","$compile",function(a,b){function c(a,b){return angular.element(ionic.DomUtil.getParentWithClass(a[0],b))}function d(a){return ionic.Utils.throttle(a)}function e(a){return ionic.requestAnimationFrame(a)}function f(b){return a.offset(b)}function g(b){return a.position(b)}function h(a,b){a.style[ionic.CSS.TRANSFORM]==b||(a.style[ionic.CSS.TRANSFORM]=b)}function i(a,b,c){var d=0==b?"translate3d(0px, 0px, 0px)":"translate3d(0px, -"+b+"px, 0px)";c?h(a,d):e(function(){h(a,d)})}var j=500;return{restrict:"A",require:"^$ionicScroll",link:function(a,e,h,k){var l;h.affixWithinParentWithClass?(l=c(e,h.affixWithinParentWithClass),l||(l=e.parent())):l=e.parent();var m=0,n=0,o=0,p=function(a){var b=g(l),c=f(e),d=b.top,h=b.height,i=c.height;m=a+d,n=m+h,o=n-i},q=d(p,j,{trailing:!1}),r=null,s=function(){var c=e.clone().css({position:"absolute",top:0,left:0,right:0});return h.affixClass&&c.addClass(h.affixClass),c.removeAttr("ion-affix").removeAttr("data-ion-affix").removeAttr("x-ion-affix"),angular.element(k.element).append(c),b(c)(a),c},t=function(){r&&r.remove(),r=null};a.$on("$destroy",function(){t(),angular.element(k.element).off("scroll")}),angular.element(k.element).on("scroll",function(a){var b=(a.detail||a.originalEvent&&a.originalEvent.detail).scrollTop;if(0==b?p(b):q(b),b>=m&&n>=b){var c=!1;r||(r=s(),c=!0),b>o?i(r[0],Math.floor(b-o),c):i(r[0],0,c)}else t()})}}}]),function(){angular.module("ionic.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d;return d={$setViewValue:angular.noop},this.init=function(e){var f,g;return d=e,d.$render=this.render,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,f=angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max,g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(f),a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){var b,c,d,e;for(e=a.length,c=0,d=e.length;d>c;c++)b=e[c],a[b]=angular.extend({index:1},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){return!a.readonly&&b>=0&&b<=a.range.length?(d.$setViewValue(b),d.$render()):void 0},a.reset=function(){return a.value=d.$viewValue,a.onLeave()},a.enter=function(b){return a.readonly||(a.value=b),a.onHover({value:b})},a.onKeydown=function(b){return/(37|38|39|40)/.test(b.which)?(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?{1:-1}:void 0))):void 0},this.render=function(){return a.value=d.$viewValue},this}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",template:'<ul class="rating" ng-mouseleave="reset()" ng-keydown="onKeydown($event)"><li ng-repeat="r in range track by $index" ng-click="rate($index + 1)"><i class="icon" ng-class="$index < value && (r.stateOn || \'ion-ios-star\') || (r.stateOff || \'ion-ios-star-outline\')"></i></li></ul>',replace:!0,link:function(a,b,c,d){var e,f;return f=d[0],e=d[1],e?f.init(e):void 0}}})}.call(this),function(){angular.module("ionic.resetfield",[]).directive("resetField",["$compile","$timeout",function(a,b){return{require:"ngModel",scope:{},link:function(c,d,e,f){var g,h,i;if(h=/text|search|tel|url|email|password/i,"INPUT"!==d[0].nodeName)throw new Error("restFieeld is limited to input elements");if(!h.test(e.type))throw new Error("Invalid input type for resetField");return g="ion-ios7-close",e.resetField.length>0&&(g=e.resetField),i=a('<i ng-show="enabled" ng-click="reset()" class="icon '+g+' reset-field-icon"></i>')(c),d.after(i),c.reset=function(){return f.$setViewValue(null),f.$render(),b(function(){return d[0].focus()},0,!1)},d.bind("input",function(){return c.enabled=!f.$isEmpty(d.val())}).bind("focus",function(){return c.enabled=!f.$isEmpty(d.val()),c.$apply()}).bind("blur",function(){return c.enabled=!1,c.$apply()})}}}])}.call(this),!function(){var a,b,c,d;!function(){var e={},f={};a=function(a,b,c){e[a]={deps:b,callback:c}},d=c=b=function(a){function c(b){if("."!==b.charAt(0))return b;for(var c=b.split("/"),d=a.split("/").slice(0,-1),e=0,f=c.length;f>e;e++){var g=c[e];if(".."===g)d.pop();else{if("."===g)continue;d.push(g)}}return d.join("/")}if(d._eak_seen=e,f[a])return f[a];if(f[a]={},!e[a])throw new Error("Could not find module "+a);for(var g,h=e[a],i=h.deps,j=h.callback,k=[],l=0,m=i.length;m>l;l++)k.push("exports"===i[l]?g={}:b(c(i[l])));var n=j.apply(this,k);return f[a]=g||n}}(),a("promise/all",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){f(a,b)}}function f(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;j<a.length;j++)g=a[j],g&&e(g.then)?g.then(d(j),c):f(j,g)})}var d=a.isArray,e=a.isFunction;b.all=c}),a("promise/asap",["exports"],function(a){"use strict";function b(){return function(){process.nextTick(e)}}function c(){var a=0,b=new i(e),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function d(){return function(){j.setTimeout(e,1)}}function e(){for(var a=0;a<k.length;a++){var b=k[a],c=b[0],d=b[1];c(d)}k=[]}function f(a,b){var c=k.push([a,b]);1===c&&g()}var g,h="undefined"!=typeof window?window:{},i=h.MutationObserver||h.WebKitMutationObserver,j="undefined"!=typeof global?global:void 0===this?window:this,k=[];g="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?b():i?c():d(),a.asap=f}),a("promise/config",["exports"],function(a){"use strict";function b(a,b){return 2!==arguments.length?c[a]:void(c[a]=b)}var c={instrument:!1};a.config=c,a.configure=b}),a("promise/polyfill",["./promise","./utils","exports"],function(a,b,c){"use strict";function d(){var a;a="undefined"!=typeof global?global:"undefined"!=typeof window&&window.document?window:self;var b="Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;return new a.Promise(function(a){b=a}),f(b)}();b||(a.Promise=e)}var e=a.Promise,f=b.isFunction;c.polyfill=d}),a("promise/promise",["./config","./utils","./all","./race","./resolve","./reject","./asap","exports"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){if(!v(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof i))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],j(a,this)}function j(a,b){function c(a){o(b,a)}function d(a){q(b,a)}try{a(c,d)}catch(e){d(e)}}function k(a,b,c,d){var e,f,g,h,i=v(c);if(i)try{e=c(d),g=!0}catch(j){h=!0,f=j}else e=d,g=!0;n(b,e)||(i&&g?o(b,e):h?q(b,f):a===D?o(b,e):a===E&&q(b,e))}function l(a,b,c,d){var e=a._subscribers,f=e.length;e[f]=b,e[f+D]=c,e[f+E]=d}function m(a,b){for(var c,d,e=a._subscribers,f=a._detail,g=0;g<e.length;g+=3)c=e[g],d=e[g+b],k(b,c,d,f);a._subscribers=null}function n(a,b){var c,d=null;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(u(b)&&(d=b.then,v(d)))return d.call(b,function(d){return c?!0:(c=!0,void(b!==d?o(a,d):p(a,d)))},function(b){return c?!0:(c=!0,void q(a,b))}),!0}catch(e){return c?!0:(q(a,e),!0)}return!1}function o(a,b){a===b?p(a,b):n(a,b)||p(a,b)}function p(a,b){a._state===B&&(a._state=C,a._detail=b,t.async(r,a))}function q(a,b){a._state===B&&(a._state=C,a._detail=b,t.async(s,a))}function r(a){m(a,a._state=D)}function s(a){m(a,a._state=E)}var t=a.config,u=(a.configure,b.objectOrFunction),v=b.isFunction,w=(b.now,c.all),x=d.race,y=e.resolve,z=f.reject,A=g.asap;t.async=A;var B=void 0,C=0,D=1,E=2;i.prototype={constructor:i,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(a,b){var c=this,d=new this.constructor(function(){});if(this._state){var e=arguments;t.async(function(){k(c._state,d,e[c._state-1],c._detail)})}else l(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}},i.all=w,i.race=x,i.resolve=y,i.reject=z,h.Promise=i}),a("promise/race",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to race.");return new b(function(b,c){for(var d,e=0;e<a.length;e++)d=a[e],d&&"function"==typeof d.then?d.then(b,c):b(d)})}var d=a.isArray;b.race=c}),a("promise/reject",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b,c){c(a)})}a.reject=b}),a("promise/resolve",["exports"],function(a){"use strict";function b(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=this;return new b(function(b){b(a)})}a.resolve=b}),a("promise/utils",["exports"],function(a){"use strict";function b(a){return c(a)||"object"==typeof a&&null!==a}function c(a){return"function"==typeof a}function d(a){return"[object Array]"===Object.prototype.toString.call(a)}var e=Date.now||function(){return(new Date).getTime()};a.objectOrFunction=b,a.isFunction=c,a.isArray=d,a.now=e}),b("promise/polyfill").polyfill()}(),function(){"use strict";function a(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(c){if("TypeError"!==c.name)throw c;for(var d=w.BlobBuilder||w.MSBlobBuilder||w.MozBlobBuilder||w.WebKitBlobBuilder,e=new d,f=0;f<a.length;f+=1)e.append(a[f]);return e.getBlob(b.type)}}function b(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,f=i;a instanceof ArrayBuffer?(d=a,f+=k):(d=a.buffer,"[object Int8Array]"===c?f+=m:"[object Uint8Array]"===c?f+=n:"[object Uint8ClampedArray]"===c?f+=o:"[object Int16Array]"===c?f+=p:"[object Uint16Array]"===c?f+=r:"[object Int32Array]"===c?f+=q:"[object Uint32Array]"===c?f+=s:"[object Float32Array]"===c?f+=t:"[object Float64Array]"===c?f+=u:b(new Error("Failed to get type for BinaryArray"))),b(f+e(d))}else if("[object Blob]"===c){var h=new FileReader;h.onload=function(){var c=g+a.type+"~"+e(this.result);b(i+l+c)},h.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(j){console.error("Couldn't convert value into a JSON string: ",a),b(null,j)}}function c(b){if(b.substring(0,j)!==i)return JSON.parse(b);var c,e=b.substring(v),f=b.substring(j,v);if(f===l&&h.test(e)){var g=e.match(h);c=g[1],e=e.substring(g[0].length)}var w=d(e);switch(f){case k:return w;case l:return a([w],{type:c});case m:return new Int8Array(w);case n:return new Uint8Array(w);case o:return new Uint8ClampedArray(w);case p:return new Int16Array(w);case r:return new Uint16Array(w);case q:return new Int32Array(w);case s:return new Uint32Array(w);case t:return new Float32Array(w);case u:return new Float64Array(w);default:throw new Error("Unkown type: "+f)}}function d(a){var b,c,d,e,g,h=.75*a.length,i=a.length,j=0;"="===a[a.length-1]&&(h--,"="===a[a.length-2]&&h--);var k=new ArrayBuffer(h),l=new Uint8Array(k);for(b=0;i>b;b+=4)c=f.indexOf(a[b]),d=f.indexOf(a[b+1]),e=f.indexOf(a[b+2]),g=f.indexOf(a[b+3]),l[j++]=c<<2|d>>4,l[j++]=(15&d)<<4|e>>2,l[j++]=(3&e)<<6|63&g;return k}function e(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=f[c[b]>>2],d+=f[(3&c[b])<<4|c[b+1]>>4],d+=f[(15&c[b+1])<<2|c[b+2]>>6],d+=f[63&c[b+2]];return c.length%3===2?d=d.substring(0,d.length-1)+"=":c.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="~~local_forage_type~",h=/^~~local_forage_type~([^~]+)~/,i="__lfsc__:",j=i.length,k="arbf",l="blob",m="si08",n="ui08",o="uic8",p="si16",q="si32",r="ur16",s="ui32",t="fl32",u="fl64",v=j+k.length,w=this,x={serialize:b,deserialize:c,stringToBuffer:d,bufferToString:e};"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?module.exports=x:"function"==typeof define&&define.amd?define("localforageSerializer",function(){return x}):this.localforageSerializer=x}.call(window),function(){"use strict";function a(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(c){if("TypeError"!==c.name)throw c;for(var d=window.BlobBuilder||window.MSBlobBuilder||window.MozBlobBuilder||window.WebKitBlobBuilder,e=new d,f=0;f<a.length;f+=1)e.append(a[f]);return e.getBlob(b.type)}}function b(a){for(var b=a.length,c=new ArrayBuffer(b),d=new Uint8Array(c),e=0;b>e;e++)d[e]=a.charCodeAt(e);return c}function c(a){return new s(function(b,c){var d=new XMLHttpRequest;d.open("GET",a),d.withCredentials=!0,d.responseType="arraybuffer",d.onreadystatechange=function(){return 4===d.readyState?200===d.status?b({response:d.response,type:d.getResponseHeader("Content-Type")}):void c({status:d.status,response:d.response}):void 0},d.send()})}function d(b){return new s(function(d,e){var f=a([""],{type:"image/png"}),g=b.transaction([v],"readwrite");g.objectStore(v).put(f,"key"),g.oncomplete=function(){var a=b.transaction([v],"readwrite"),f=a.objectStore(v).get("key");f.onerror=e,f.onsuccess=function(a){var b=a.target.result,e=URL.createObjectURL(b);c(e).then(function(a){d(!(!a||"image/png"!==a.type))},function(){d(!1)}).then(function(){URL.revokeObjectURL(e)})}}})["catch"](function(){return!1})}function e(a){return"boolean"==typeof u?s.resolve(u):d(a).then(function(a){return u=a})}function f(a){return new s(function(b,c){var d=new FileReader;d.onerror=c,d.onloadend=function(c){var d=btoa(c.target.result||"");b({__local_forage_encoded_blob:!0,data:d,type:a.type})},d.readAsBinaryString(a)})}function g(c){var d=b(atob(c.data));return a([d],{type:c.type})}function h(a){return a&&a.__local_forage_encoded_blob}function i(a){var b=this,c={db:null};if(a)for(var d in a)c[d]=a[d];return new s(function(a,d){var e=t.open(c.name,c.version);e.onerror=function(){d(e.error)},e.onupgradeneeded=function(a){e.result.createObjectStore(c.storeName),a.oldVersion<=1&&e.result.createObjectStore(v)},e.onsuccess=function(){c.db=e.result,b._dbInfo=c,a()}})}function j(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new s(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),i=f.get(a);i.onsuccess=function(){var a=i.result;void 0===a&&(a=null),h(a)&&(a=g(a)),b(a)},i.onerror=function(){d(i.error)}})["catch"](d)});return r(d,b),d}function k(a,b){var c=this,d=new s(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),i=f.openCursor(),j=1;i.onsuccess=function(){var c=i.result;if(c){var d=c.value;h(d)&&(d=g(d));var e=a(d,c.key,j++);void 0!==e?b(e):c["continue"]()}else b()},i.onerror=function(){d(i.error)}})["catch"](d)});return r(d,b),d}function l(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var g=new s(function(c,g){var h;d.ready().then(function(){return h=d._dbInfo,e(h.db)}).then(function(a){return!a&&b instanceof Blob?f(b):b}).then(function(b){var d=h.db.transaction(h.storeName,"readwrite"),e=d.objectStore(h.storeName);null===b&&(b=void 0);var f=e.put(b,a);d.oncomplete=function(){void 0===b&&(b=null),c(b)},d.onabort=d.onerror=function(){var a=f.error?f.error:f.transaction.error;g(a)}})["catch"](g)});return r(g,c),g}function m(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new s(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readwrite"),g=f.objectStore(e.storeName),h=g["delete"](a);f.oncomplete=function(){b()},f.onerror=function(){d(h.error)},f.onabort=function(){var a=h.error?h.error:h.transaction.error;d(a)}})["catch"](d)});return r(d,b),d}function n(a){var b=this,c=new s(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readwrite"),f=e.objectStore(d.storeName),g=f.clear();e.oncomplete=function(){a()},e.onabort=e.onerror=function(){var a=g.error?g.error:g.transaction.error;c(a)}})["catch"](c)});return r(c,a),c}function o(a){var b=this,c=new s(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName),f=e.count();f.onsuccess=function(){a(f.result)},f.onerror=function(){c(f.error)}})["catch"](c)});return r(c,a),c}function p(a,b){var c=this,d=new s(function(b,d){return 0>a?void b(null):void c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),g=!1,h=f.openCursor();h.onsuccess=function(){var c=h.result;return c?void(0===a?b(c.key):g?b(c.key):(g=!0,c.advance(a))):void b(null)},h.onerror=function(){d(h.error)}})["catch"](d)});return r(d,b),d}function q(a){var b=this,c=new s(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName),f=e.openCursor(),g=[];f.onsuccess=function(){var b=f.result;return b?(g.push(b.key),void b["continue"]()):void a(g)},f.onerror=function(){c(f.error)}})["catch"](c)});return r(c,a),c}function r(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var s="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?require("promise"):this.Promise,t=t||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(t){var u,v="local-forage-detect-blob-support",w={_driver:"asyncStorage",_initStorage:i,iterate:k,getItem:j,setItem:l,removeItem:m,clear:n,length:o,key:p,keys:q};"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?module.exports=w:"function"==typeof define&&define.amd?define("asyncStorage",function(){return w}):this.asyncStorage=w}}.call(window),function(){"use strict";function a(a){var b=this,c={};if(a)for(var d in a)c[d]=a[d];c.keyPrefix=c.name+"/",b._dbInfo=c;var e=new k(function(a){q===p.DEFINE?require(["localforageSerializer"],a):a(q===p.EXPORT?require("./../utils/serializer"):l.localforageSerializer)});return e.then(function(a){return m=a,k.resolve()})}function b(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo.keyPrefix,c=n.length-1;c>=0;c--){var d=n.key(c);0===d.indexOf(a)&&n.removeItem(d)}});return j(c,a),c}function c(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo,d=n.getItem(b.keyPrefix+a);return d&&(d=m.deserialize(d)),d});return j(d,b),d}function d(a,b){var c=this,d=c.ready().then(function(){for(var b=c._dbInfo.keyPrefix,d=b.length,e=n.length,f=0;e>f;f++){var g=n.key(f),h=n.getItem(g);if(h&&(h=m.deserialize(h)),h=a(h,g.substring(d),f+1),void 0!==h)return h}});return j(d,b),d}function e(a,b){var c=this,d=c.ready().then(function(){var b,d=c._dbInfo;try{b=n.key(a)}catch(e){b=null}return b&&(b=b.substring(d.keyPrefix.length)),b});return j(d,b),d}function f(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo,c=n.length,d=[],e=0;c>e;e++)0===n.key(e).indexOf(a.keyPrefix)&&d.push(n.key(e).substring(a.keyPrefix.length));return d});return j(c,a),c}function g(a){var b=this,c=b.keys().then(function(a){return a.length});return j(c,a),c}function h(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo;n.removeItem(b.keyPrefix+a)});return j(d,b),d}function i(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=d.ready().then(function(){void 0===b&&(b=null);var c=b;return new k(function(e,f){m.serialize(b,function(b,g){if(g)f(g);else try{var h=d._dbInfo;n.setItem(h.keyPrefix+a,b),e(c)}catch(i){("QuotaExceededError"===i.name||"NS_ERROR_DOM_QUOTA_REACHED"===i.name)&&f(i),f(i)}})})});return j(e,c),e}function j(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var k="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?require("promise"):this.Promise,l=this,m=null,n=null;try{if(!(this.localStorage&&"setItem"in this.localStorage))return;n=this.localStorage}catch(o){return}var p={DEFINE:1,EXPORT:2,WINDOW:3},q=p.WINDOW;"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?q=p.EXPORT:"function"==typeof define&&define.amd&&(q=p.DEFINE);var r={_driver:"localStorageWrapper",_initStorage:a,iterate:d,getItem:c,setItem:i,removeItem:h,clear:b,length:g,key:e,keys:f};q===p.EXPORT?module.exports=r:q===p.DEFINE?define("localStorageWrapper",function(){return r}):this.localStorageWrapper=r}.call(window),function(){"use strict";function a(a){var b=this,c={db:null};if(a)for(var d in a)c[d]="string"!=typeof a[d]?a[d].toString():a[d];var e=new k(function(a){p===o.DEFINE?require(["localforageSerializer"],a):a(p===o.EXPORT?require("./../utils/serializer"):l.localforageSerializer)}),f=new k(function(d,e){try{c.db=n(c.name,String(c.version),c.description,c.size)}catch(f){return b.setDriver(b.LOCALSTORAGE).then(function(){return b._initStorage(a)}).then(d)["catch"](e)}c.db.transaction(function(a){a.executeSql("CREATE TABLE IF NOT EXISTS "+c.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){b._dbInfo=c,d()},function(a,b){e(b)})})});return e.then(function(a){return m=a,f})}function b(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new k(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var d=c.rows.length?c.rows.item(0).value:null;d&&(d=m.deserialize(d)),b(d)},function(a,b){d(b)})})})["catch"](d)});return j(d,b),d}function c(a,b){var c=this,d=new k(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName,[],function(c,d){for(var e=d.rows,f=e.length,g=0;f>g;g++){var h=e.item(g),i=h.value;if(i&&(i=m.deserialize(i)),i=a(i,h.key,g+1),void 0!==i)return void b(i)}b()},function(a,b){d(b)})})})["catch"](d)});return j(d,b),d}function d(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new k(function(c,e){d.ready().then(function(){void 0===b&&(b=null);var f=b;m.serialize(b,function(b,g){if(g)e(g);else{var h=d._dbInfo;h.db.transaction(function(d){d.executeSql("INSERT OR REPLACE INTO "+h.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c(f)},function(a,b){e(b)})},function(a){a.code===a.QUOTA_ERR&&e(a)})}})})["catch"](e)});return j(e,c),e}function e(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new k(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("DELETE FROM "+e.storeName+" WHERE key = ?",[a],function(){b()},function(a,b){d(b)})})})["catch"](d)});return j(d,b),d}function f(a){var b=this,c=new k(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("DELETE FROM "+d.storeName,[],function(){a()},function(a,b){c(b)})})})["catch"](c)});return j(c,a),c}function g(a){var b=this,c=new k(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+d.storeName,[],function(b,c){var d=c.rows.item(0).c;a(d)},function(a,b){c(b)})})})["catch"](c)});return j(c,a),c}function h(a,b){var c=this,d=new k(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT key FROM "+e.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var d=c.rows.length?c.rows.item(0).key:null;b(d)},function(a,b){d(b)})})})["catch"](d)});return j(d,b),d}function i(a){var b=this,c=new k(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT key FROM "+d.storeName,[],function(b,c){for(var d=[],e=0;e<c.rows.length;e++)d.push(c.rows.item(e).key);a(d)},function(a,b){c(b)})})})["catch"](c)});return j(c,a),c}function j(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var k="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?require("promise"):this.Promise,l=this,m=null,n=this.openDatabase;if(n){var o={DEFINE:1,EXPORT:2,WINDOW:3},p=o.WINDOW;"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?p=o.EXPORT:"function"==typeof define&&define.amd&&(p=o.DEFINE);var q={_driver:"webSQLStorage",_initStorage:a,iterate:c,getItem:b,setItem:d,removeItem:e,clear:f,length:g,key:h,keys:i};p===o.DEFINE?define("webSQLStorage",function(){return q}):p===o.EXPORT?module.exports=q:this.webSQLStorage=q}}.call(window),function(){"use strict";function a(a,b){a[b]=function(){var c=arguments;return a.ready().then(function(){return a[b].apply(a,c)})}}function b(){for(var a=1;a<arguments.length;a++){var b=arguments[a];if(b)for(var c in b)b.hasOwnProperty(c)&&(arguments[0][c]=n(b[c])?b[c].slice():b[c])}return arguments[0]}function c(a){for(var b in g)if(g.hasOwnProperty(b)&&g[b]===a)return!0;return!1}function d(c){
  this._config=b({},k,c),this._driverSet=null,this._ready=!1,this._dbInfo=null;for(var d=0;d<i.length;d++)a(this,i[d]);this.setDriver(this._config.driver)}var e="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?require("promise"):this.Promise,f={},g={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage"},h=[g.INDEXEDDB,g.WEBSQL,g.LOCALSTORAGE],i=["clear","getItem","iterate","key","keys","length","removeItem","setItem"],j={DEFINE:1,EXPORT:2,WINDOW:3},k={description:"",driver:h.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},l=j.WINDOW;"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require?l=j.EXPORT:"function"==typeof define&&define.amd&&(l=j.DEFINE);var m=function(a){var b=b||a.indexedDB||a.webkitIndexedDB||a.mozIndexedDB||a.OIndexedDB||a.msIndexedDB,c={};return c[g.WEBSQL]=!!a.openDatabase,c[g.INDEXEDDB]=!!function(){if("undefined"!=typeof a.openDatabase&&a.navigator&&a.navigator.userAgent&&/Safari/.test(a.navigator.userAgent)&&!/Chrome/.test(a.navigator.userAgent))return!1;try{return b&&"function"==typeof b.open&&"undefined"!=typeof a.IDBKeyRange}catch(c){return!1}}(),c[g.LOCALSTORAGE]=!!function(){try{return a.localStorage&&"setItem"in a.localStorage&&a.localStorage.setItem}catch(b){return!1}}(),c}(this),n=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},o=this;d.prototype.INDEXEDDB=g.INDEXEDDB,d.prototype.LOCALSTORAGE=g.LOCALSTORAGE,d.prototype.WEBSQL=g.WEBSQL,d.prototype.config=function(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a)"storeName"===b&&(a[b]=a[b].replace(/\W/g,"_")),this._config[b]=a[b];return"driver"in a&&a.driver&&this.setDriver(this._config.driver),!0}return"string"==typeof a?this._config[a]:this._config},d.prototype.defineDriver=function(a,b,d){var g=new e(function(b,d){try{var g=a._driver,h=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),j=new Error("Custom driver name already in use: "+a._driver);if(!a._driver)return void d(h);if(c(a._driver))return void d(j);for(var k=i.concat("_initStorage"),l=0;l<k.length;l++){var n=k[l];if(!n||!a[n]||"function"!=typeof a[n])return void d(h)}var o=e.resolve(!0);"_support"in a&&(o=a._support&&"function"==typeof a._support?a._support():e.resolve(!!a._support)),o.then(function(c){m[g]=c,f[g]=a,b()},d)}catch(p){d(p)}});return g.then(b,d),g},d.prototype.driver=function(){return this._driver||null},d.prototype.ready=function(a){var b=this,c=new e(function(a,c){b._driverSet.then(function(){null===b._ready&&(b._ready=b._initStorage(b._config)),b._ready.then(a,c)})["catch"](c)});return c.then(a,a),c},d.prototype.setDriver=function(a,b,d){function g(){h._config.driver=h.driver()}var h=this;return"string"==typeof a&&(a=[a]),this._driverSet=new e(function(b,d){var g=h._getFirstSupportedDriver(a),i=new Error("No available storage method found.");if(!g)return h._driverSet=e.reject(i),void d(i);if(h._dbInfo=null,h._ready=null,c(g)){var k=new e(function(a){if(l===j.DEFINE)require([g],a);else if(l===j.EXPORT)switch(g){case h.INDEXEDDB:a(require("./drivers/indexeddb"));break;case h.LOCALSTORAGE:a(require("./drivers/localstorage"));break;case h.WEBSQL:a(require("./drivers/websql"))}else a(o[g])});k.then(function(a){h._extend(a),b()})}else f[g]?(h._extend(f[g]),b()):(h._driverSet=e.reject(i),d(i))}),this._driverSet.then(g,g),this._driverSet.then(b,d),this._driverSet},d.prototype.supports=function(a){return!!m[a]},d.prototype._extend=function(a){b(this,a)},d.prototype._getFirstSupportedDriver=function(a){if(a&&n(a))for(var b=0;b<a.length;b++){var c=a[b];if(this.supports(c))return c}return null},d.prototype.createInstance=function(a){return new d(a)};var p=new d;l===j.DEFINE?define("localforage",function(){return p}):l===j.EXPORT?module.exports=p:this.localforage=p}.call(window),!function(a,b){"use strict";if("function"==typeof define&&define.amd)define(["localforage"],function(c){b(a.angular,c)});else if("object"==typeof exports||"object"==typeof global){var c=a.angular||window&&window.angular;module.exports=b(c,require("localforage"))}else b(a.angular,a.localforage)}(this,function(a,b,c){"use strict";var d=a.module("LocalForageModule",["ng"]);d.provider("$localForage",function(){var c={},d={name:"lf"},e={setItem:!1,removeItem:!1},f={};this.setNotify=function(a,b){e={setItem:a,removeItem:b}},this.config=function(b){if(!a.isObject(b))throw new Error("The config parameter should be an object");a.extend(d,b)},this.$get=["$rootScope","$q","$parse",function(g,h,i){var j=function(c){a.isDefined(c)?this._localforage=b.createInstance(c):(this._localforage=b,b.config(d))};j.prototype.createInstance=function(b){if(a.isObject(b)){if(b=a.extend({},d,b),a.isDefined(c[b.name]))throw new Error("A localForage instance with the name "+b.name+" is already defined.");return c[b.name]=new j(b),c[b.name]}throw new Error("The parameter should be a config object.")},j.prototype.instance=function(b){if(a.isUndefined(b))return c[d.name];if(a.isString(b)){if(a.isDefined(c[b]))return c[b];throw new Error("No localForage instance of that name exists.")}throw new Error("The parameter should be a string.")},j.prototype.setDriver=function(a){return this._localforage.setDriver(a)},j.prototype.driver=function(){return this._localforage.driver()},j.prototype.setItem=function(b,c){if(a.isUndefined(b))throw new Error("You must define a key to set");var d=this;if(a.isArray(b)){if(!a.isArray(c))throw new Error("If you set an array of keys, the values should be an array too");var f=[];return a.forEach(b,function(a,b){f.push(d.setItem(a,c[b]))}),h.all(f)}var i=h.defer(),j=arguments,k="undefined"!=typeof Blob&&c instanceof Blob?c:a.copy(c);return a.isObject(k)&&a.isDefined(k.$promise)&&delete k.$promise,d._localforage.setItem(d.prefix()+b,k).then(function(){e.setItem&&g.$broadcast("LocalForageModule.setItem",{key:b,newvalue:k,driver:d.driver()}),i.resolve(k)},function(a){d.onError(a,j,d.setItem,i)}),i.promise},j.prototype.getItem=function(b){if(a.isUndefined(b))throw new Error("You must define a key to get");var c,d=h.defer(),e=arguments,f=this;if(a.isArray(b)){var g=[],i=0;c=f._localforage.iterate(function(a,c){var d=b.indexOf(f.prefix()+c);return d>-1&&(g[d]=a,i++),i===b.length?g:void 0}).then(function(){d.resolve(g)})}else c=f._localforage.getItem(f.prefix()+b).then(function(a){d.resolve(a)});return c.then(null,function(a){f.onError(a,e,f.getItem,d)}),d.promise},j.prototype.iterate=function(b){if(a.isUndefined(b))throw new Error("You must define a callback to iterate");var c=h.defer(),d=arguments,e=this;return e._localforage.iterate(b).then(function(a){c.resolve(a)},function(a){e.onError(a,d,e.iterate,c)}),c.promise},j.prototype.removeItem=function(b){if(a.isUndefined(b))throw new Error("You must define a key to remove");var c=this;if(a.isArray(b)){var d=[];return a.forEach(b,function(a,b){d.push(c.removeItem(a))}),h.all(d)}var f=h.defer(),i=arguments;return c._localforage.removeItem(c.prefix()+b).then(function(){e.removeItem&&g.$broadcast("LocalForageModule.removeItem",{key:b,driver:c.driver()}),f.resolve()},function(a){c.onError(a,i,c.removeItem,f)}),f.promise},j.prototype.pull=function(b){if(a.isUndefined(b))throw new Error("You must define a key to pull");var c=this,d=h.defer(),e=function(a){d.reject(a)};return c.getItem(b).then(function(a){c.removeItem(b).then(function(){d.resolve(a)},e)},e),d.promise},j.prototype.clear=function(){var a=h.defer(),b=arguments,c=this;return c._localforage.clear().then(function(b){a.resolve()},function(d){c.onError(d,b,c.clear,a)}),a.promise},j.prototype.key=function(b){if(a.isUndefined(b))throw new Error("You must define a position to get for the key function");var c=h.defer(),d=arguments,e=this;return e._localforage.key(b).then(function(a){c.resolve(a)},function(a){e.onError(a,d,e.key,c)}),c.promise};var k=function(){var a=h.defer(),b=arguments,c=this;return c._localforage.keys().then(function(b){if(d.oldPrefix&&"localStorageWrapper"===c.driver()){for(var e=[],f=0,g=b.length;g>f;f++)e.push(b[f].substr(c.prefix().length,b[f].length));b=e}a.resolve(b)},function(d){c.onError(d,b,c.keys,a)}),a.promise};return j.prototype.keys=k,j.prototype.getKeys=k,j.prototype.length=function(){var a=h.defer(),b=arguments,c=this;return c._localforage.length().then(function(b){a.resolve(b)},function(d){c.onError(d,b,length,a)}),a.promise},j.prototype.bind=function(b,e){if(a.isString(e))e={key:e};else if(!a.isObject(e)||a.isUndefined(e.key))throw new Error("You must define a key to bind");var g={defaultValue:"",name:d.name};e=a.extend({},g,e);var h=c[e.name];if(a.isUndefined(h))throw new Error("You must use the name of an existing instance");var j=e.scopeKey||e.key,k=i(j);return h.getItem(e.key).then(function(c){return null!==c?k.assign(b,c):a.isUndefined(e.defaultValue)||(k.assign(b,e.defaultValue),h.setItem(e.key,e.defaultValue)),a.isDefined(f[e.key])&&f[e.key](),f[e.key]=b.$watch(j,function(b){a.isDefined(b)&&h.setItem(e.key,b)},!0),c})},j.prototype.unbind=function(b,e){if(a.isString(e))e={key:e};else if(!a.isObject(e)||a.isUndefined(e.key))throw new Error("You must define a key to unbind");var g={scopeKey:e.key,name:d.name};e=a.extend({},g,e);var h=c[e.name];if(a.isUndefined(h))throw new Error("You must use the name of an existing instance");return i(e.scopeKey).assign(b,null),a.isDefined(f[e.key])&&(f[e.key](),delete f[e.key]),h.removeItem(e.key)},j.prototype.prefix=function(){return"localStorageWrapper"===this.driver()&&d.oldPrefix?this._localforage.config().name+".":""},j.prototype.onError=function(b,c,d,e){if((a.isObject(b)&&b.name?"InvalidStateError"===b.name:a.isString(b)&&"InvalidStateError"===b)&&"asyncStorage"===this.driver()||a.isObject(b)&&b.code&&5===b.code){var f=this;f.setDriver("localStorageWrapper").then(function(){d.apply(f,c).then(function(a){e.resolve(a)},function(a){e.reject(a)})},function(){e.reject(b)})}else e.reject(b)},c[d.name]=new j,c[d.name]}]}),d.directive("localForage",["$localForage",function(b){return{restrict:"A",link:function(c,d,e){var f=c.$eval(e.localForage);a.isObject(f)&&a.isDefined(f.key)?b.bind(c,f):b.bind(c,e.localForage)}}}])});var scripts=document.getElementsByTagName("script"),currentScriptPath=scripts[scripts.length-1].src,templateUrl=currentScriptPath.replace(new RegExp("ng-walkthrough.js.*"),"ng-walkthrough.html"),iconsUrl=currentScriptPath.replace(new RegExp("ng-walkthrough.js.*"),"icons/");angular.module("ng-walkthrough",[]).directive("walkthrough",["$log","$timeout","$window","$injector",function(a,b,c,d){var e=".walkthrough-text",f=".walkthrough-tip-text-box",g=".walkthrough-hole",h=".walkthrough-icon",i=".walkthrough-tip-icon-text-box",j=".walkthrough-arrow",k="walkthrough-done-button",l="Got it!",m=5,n=5,o=!1;return{restrict:"E",transclude:!0,scope:{walkthroughType:"@",isActive:"=",icon:"@",focusElementId:"@",mainCaption:"@",forceCaptionLocation:"@",isRound:"=",hasGlow:"=",useButton:"=",iconPaddingLeft:"@",iconPaddingTop:"@",tipLocation:"@",tipIconLocation:"@",tipColor:"@",isBindClickEventToBody:"=",onWalkthroughShow:"&",onWalkthroughHide:"&"},link:function(p,q,r,s,t){var u=function(a){var b=null;switch(a){case"single_tap":b=iconsUrl+"Single_Tap.png";break;case"double_tap":b=iconsUrl+"Double_Tap.png";break;case"swipe_down":b=iconsUrl+"Swipe_Down.png";break;case"swipe_left":b=iconsUrl+"Swipe_Left.png";break;case"swipe_right":b=iconsUrl+"Swipe_Right.png";break;case"swipe_up":b=iconsUrl+"Swipe_Up.png";break;case"arrow":b=""}return null===b&&a&&a.length>0&&(b=a),b},v=function(a){"click"==p.clickEvent&&(p.useButton||(a.stopPropagation(),a.preventDefault(),p.onCloseClicked(a),b(function(){y()},1e3)))},w=function(a){"touch"==p.clickEvent&&(p.useButton||(a.stopPropagation(),a.preventDefault(),p.onCloseTouched(a),b(function(){y()},1e3)))},x=function(){p.setFocusOnElement(r.focusElementId)},y=function(){angular.element(document.body).off("mousedown",v),angular.element(document.body).off("mouseup",v),angular.element(document.body).off("click",v),angular.element(document.body).off("touch",w)},z=function(){b(function(){angular.element(document.body).on("mousedown",v),angular.element(document.body).on("mouseup",v),angular.element(document.body).on("click",v),angular.element(document.body).on("touch",w)},1e3)},A=function(){angular.element(c).on("resize",x)},B=function(){angular.element(c).off("resize",x)},C=function(a){try{d.get("$ionicPosition");o=!0}catch(b){o=!1}a.clickEvent="click",o&&(a.clickEvent="touch"),a.closeWalkthrough=function(){a.isActive=!1,a.onWalkthroughHide()},a.onCloseClicked=function(b){"click"==a.clickEvent?(!a.useButton||b.currentTarget.className.indexOf(k)>-1)&&a.closeWalkthrough():"touch"==a.clickEvent&&(!a.useButton||b.currentTarget.className.indexOf(k)>-1)&&a.closeWalkthrough(),b.stopPropagation()},a.onCloseTouched=function(b){"touch"==a.clickEvent&&(!a.useButton||b.currentTarget.className.indexOf(k)>-1)&&a.closeWalkthrough(),b.stopPropagation()},a.closeIcon=iconsUrl+"Hotspot-close.png",a.walkthroughIcon=u(a.icon),a.buttonCaption=l},D=function(a,b,c,d){var e="left:"+(a-m)+"px;top:"+(b-m)+"px;width:"+(c+2*m)+"px;height:"+(d+2*m)+"px;";p.walkthroughHoleElements.attr("style",e)},E=function(a){var b="top:"+a+"px;margin-top: 10px;";p.walkthroughTextElement.attr("style",b)},F=function(a,b,c,d){var e=J(p.walkthroughTextElement),f=!1,g=e.left,h=e.left+e.width,i=e.top,j=e.top+e.height;return a>h||g>c||b>j||i>d||(f=!0),f},G=function(a,b,c,d){var e=J(p.walkthroughIconElement),f=e.height,g=e.width,h=a+c,i=b+d,j=h+g,k=i+f;F(h,i,j,k)&&E(k);var l="position: absolute;left:"+h+"px;top:"+i+"px;margin-top:-"+f/6+"px;margin-left:-"+g/4+"px;";p.walkthroughIconElement.attr("style",l)},H=function(a,b,c,d,e){var f=J(p.walkthroughTextElement),g=f.left+f.width/2,h=f.top+n;"TOP"===p.forceCaptionLocation&&(h+=f.height);var i=0,j=0;g>a?(j=a+e+c,i=b+d/2):a>g&&(j=a-e,i=b+d/2),F(g,h,j,i)&&E(h);var k='<svg width="100%" height="100%"><defs><marker id="arrow" markerWidth="13" markerHeight="13" refx="2" refy="6" orient="auto"><path d="M2,1 L2,10 L10,6 L2,2" style="fill:#fff;" /></marker></defs><path d="M'+g+","+h+" Q"+g+","+i+" "+j+","+i+'"style="stroke:#fff; stroke-width: 2px; fill: none;marker-end: url(#arrow);"/>/></svg>';p.walkthroughArrowElement.append(k)},I=function(a,b){var c="";b&&(c+="margin-top:"+b+"px;"),a&&(c+="right:"+a+"%;"),p.walkthroughIconElement.attr("style",c)},J=function(a){var b,c,e,f;if(o){var g=d.get("$ionicPosition"),h=g.offset(a);b=h.width,c=h.height,e=h.left,f=h.top}else{b=a[0].offsetWidth,c=a[0].offsetHeight,e=a[0].offsetLeft,f=a[0].offsetTop;for(var i=a[0].offsetParent;i;)e+=i.offsetLeft,f+=i.offsetTop,i=i.offsetParent}return{top:f,left:e,height:c,width:b}},K=function(b,c,d,e){var f=document.querySelector("#"+c),g=angular.element(f);if(g.length>0){var h=J(g),i=h.width,j=h.height,k=h.left,l=h.top;D(k,l,i,j);var m=parseFloat(d),n=parseFloat(e);m||(m=0),n||(n=0),b&&"arrow"!==b&&"transparency"===p.walkthroughType&&p.$applyAsync(function(){G(k+i/2,l+j/2,m,n)}),"arrow"==b&&p.$applyAsync(function(){H(k,l+n,i,j,m)}),"tip"==p.walkthroughType&&b&&b.length>0&&(d||e)&&I(d,e)}else c?a.info("Unable to find element requested to be focused: #"+c):"tip"==p.walkthroughType&&b&&b.length>0&&(d||e)&&I(d,e)};p.setFocusOnElement=function(a){K(p.icon,a,p.iconPaddingLeft,p.iconPaddingTop)};var L=q[0].querySelectorAll(g);p.walkthroughHoleElements=angular.element(L);var M="tip"==p.walkthroughType?f:e;p.walkthroughTextElement=angular.element(q[0].querySelector(M));var N="tip"==p.walkthroughType?i:h;p.walkthroughIconElement=angular.element(q[0].querySelector(N)),p.walkthroughArrowElement=angular.element(q[0].querySelector(j)),t(function(a){C(p);var b=a.text().trim();0===b.length&&a.length<=1||(p.hasTransclude=!0)});var O=function(){console.warn("Since version 0.3.1 tipLocation is deprecated and will be deleted in next versions. Use property 'forceCaptionLocation' instead."),p.forceCaptionLocation=p.tipLocation};p.tipLocation&&O(),p.$watch("isActive",function(c){if(c){if(A(),p.isBindClickEventToBody&&z(),!p.hasTransclude){try{r.focusElementId&&p.setFocusOnElement(r.focusElementId)}catch(d){a.warn("failed to focus on element prior to timeout: "+r.focusElementId)}r.focusElementId&&b(function(){p.setFocusOnElement(r.focusElementId)},300)}p.onWalkthroughShow()}else B()})},templateUrl:templateUrl}}]),function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b,c){function d(a){return a>=200&&300>a||304===a}function e(){void 0===h.status||d(h.status)?b.call(h,null,h):b.call(h,h,null)}var f=!1;if("undefined"==typeof window.XMLHttpRequest)return b(Error("Browser not supported"));if("undefined"==typeof c){var g=a.match(/^\s*https?:\/\/[^\/]*/);c=g&&g[0]!==location.protocol+"//"+location.domain+(location.port?":"+location.port:"")}var h=new window.XMLHttpRequest;if(c&&!("withCredentials"in h)){h=new window.XDomainRequest;var i=b;b=function(){if(f)i.apply(this,arguments);else{var a=this,b=arguments;setTimeout(function(){i.apply(a,b)},0)}}}return"onload"in h?h.onload=e:h.onreadystatechange=function(){4===h.readyState&&e()},h.onerror=function(a){b.call(this,a||!0,null),b=function(){}},h.onprogress=function(){},h.ontimeout=function(a){b.call(this,a,null),b=function(){}},h.onabort=function(a){b.call(this,a,null),b=function(){}},h.open("GET",a,!0),h.send(null),f=!0,h}"undefined"!=typeof b&&(b.exports=d)},{}],2:[function(a,b,c){b.exports=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)}},{}],3:[function(a,b,c){!function(a,c,d){var e=a.L,f={};f.version="0.7.7","object"==typeof b&&"object"==typeof b.exports?b.exports=f:"function"==typeof define&&define.amd&&define(f),f.noConflict=function(){return a.L=e,this},a.L=f,f.Util={extend:function(a){var b,c,d,e,f=Array.prototype.slice.call(arguments,1);for(c=0,d=f.length;d>c;c++){e=f[c]||{};for(b in e)e.hasOwnProperty(b)&&(a[b]=e[b])}return a},bind:function(a,b){var c=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return a.apply(b,c||arguments)}},stamp:function(){var a=0,b="_leaflet_id";return function(c){return c[b]=c[b]||++a,c[b]}}(),invokeEach:function(a,b,c){var d,e;if("object"==typeof a){e=Array.prototype.slice.call(arguments,3);for(d in a)b.apply(c,[d,a[d]].concat(e));return!0}return!1},limitExecByInterval:function(a,b,c){var d,e;return function f(){var g=arguments;return d?void(e=!0):(d=!0,setTimeout(function(){d=!1,e&&(f.apply(c,g),e=!1)},b),void a.apply(c,g))}},falseFn:function(){return!1},formatNum:function(a,b){var c=Math.pow(10,b||5);return Math.round(a*c)/c},trim:function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},splitWords:function(a){return f.Util.trim(a).split(/\s+/)},setOptions:function(a,b){return a.options=f.extend({},a.options,b),a.options},getParamString:function(a,b,c){var d=[];for(var e in a)d.push(encodeURIComponent(c?e.toUpperCase():e)+"="+encodeURIComponent(a[e]));return(b&&-1!==b.indexOf("?")?"&":"?")+d.join("&")},template:function(a,b){return a.replace(/\{ *([\w_]+) *\}/g,function(a,c){var e=b[c];if(e===d)throw new Error("No value provided for variable "+a);return"function"==typeof e&&(e=e(b)),e})},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function b(b){var c,d,e=["webkit","moz","o","ms"];for(c=0;c<e.length&&!d;c++)d=a[e[c]+b];return d}function c(b){var c=+new Date,e=Math.max(0,16-(c-d));return d=c+e,a.setTimeout(b,e)}var d=0,e=a.requestAnimationFrame||b("RequestAnimationFrame")||c,g=a.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(b){a.clearTimeout(b)};f.Util.requestAnimFrame=function(b,d,g,h){return b=f.bind(b,d),g&&e===c?void b():e.call(a,b,h)},f.Util.cancelAnimFrame=function(b){b&&g.call(a,b)}}(),f.extend=f.Util.extend,f.bind=f.Util.bind,f.stamp=f.Util.stamp,f.setOptions=f.Util.setOptions,f.Class=function(){},f.Class.extend=function(a){var b=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},c=function(){};c.prototype=this.prototype;var d=new c;d.constructor=b,b.prototype=d;for(var e in this)this.hasOwnProperty(e)&&"prototype"!==e&&(b[e]=this[e]);a.statics&&(f.extend(b,a.statics),delete a.statics),a.includes&&(f.Util.extend.apply(null,[d].concat(a.includes)),delete a.includes),a.options&&d.options&&(a.options=f.extend({},d.options,a.options)),f.extend(d,a),d._initHooks=[];var g=this;return b.__super__=g.prototype,d.callInitHooks=function(){if(!this._initHooksCalled){g.prototype.callInitHooks&&g.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var a=0,b=d._initHooks.length;b>a;a++)d._initHooks[a].call(this)}},b},f.Class.include=function(a){f.extend(this.prototype,a)},f.Class.mergeOptions=function(a){f.extend(this.prototype.options,a)},f.Class.addInitHook=function(a){var b=Array.prototype.slice.call(arguments,1),c="function"==typeof a?a:function(){this[a].apply(this,b)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c)};var g="_leaflet_events";f.Mixin={},f.Mixin.Events={addEventListener:function(a,b,c){if(f.Util.invokeEach(a,this.addEventListener,this,b,c))return this;var d,e,h,i,j,k,l,m=this[g]=this[g]||{},n=c&&c!==this&&f.stamp(c);for(a=f.Util.splitWords(a),d=0,e=a.length;e>d;d++)h={action:b,context:c||this},i=a[d],n?(j=i+"_idx",k=j+"_len",l=m[j]=m[j]||{},l[n]||(l[n]=[],m[k]=(m[k]||0)+1),l[n].push(h)):(m[i]=m[i]||[],m[i].push(h));return this},hasEventListeners:function(a){var b=this[g];return!!b&&(a in b&&b[a].length>0||a+"_idx"in b&&b[a+"_idx_len"]>0)},removeEventListener:function(a,b,c){if(!this[g])return this;if(!a)return this.clearAllEventListeners();if(f.Util.invokeEach(a,this.removeEventListener,this,b,c))return this;var d,e,h,i,j,k,l,m,n,o=this[g],p=c&&c!==this&&f.stamp(c);for(a=f.Util.splitWords(a),d=0,e=a.length;e>d;d++)if(h=a[d],k=h+"_idx",l=k+"_len",m=o[k],b){if(i=p&&m?m[p]:o[h]){for(j=i.length-1;j>=0;j--)i[j].action!==b||c&&i[j].context!==c||(n=i.splice(j,1),n[0].action=f.Util.falseFn);c&&m&&0===i.length&&(delete m[p],o[l]--)}}else delete o[h],delete o[k],delete o[l];return this},clearAllEventListeners:function(){return delete this[g],this},fireEvent:function(a,b){if(!this.hasEventListeners(a))return this;var c,d,e,h,i,j=f.Util.extend({},b,{type:a,target:this}),k=this[g];if(k[a])for(c=k[a].slice(),d=0,e=c.length;e>d;d++)c[d].action.call(c[d].context,j);h=k[a+"_idx"];for(i in h)if(c=h[i].slice())for(d=0,e=c.length;e>d;d++)c[d].action.call(c[d].context,j);return this},addOneTimeEventListener:function(a,b,c){if(f.Util.invokeEach(a,this.addOneTimeEventListener,this,b,c))return this;var d=f.bind(function(){this.removeEventListener(a,b,c).removeEventListener(a,d,c)},this);return this.addEventListener(a,b,c).addEventListener(a,d,c)}},f.Mixin.Events.on=f.Mixin.Events.addEventListener,f.Mixin.Events.off=f.Mixin.Events.removeEventListener,f.Mixin.Events.once=f.Mixin.Events.addOneTimeEventListener,f.Mixin.Events.fire=f.Mixin.Events.fireEvent,function(){var b="ActiveXObject"in a,e=b&&!c.addEventListener,g=navigator.userAgent.toLowerCase(),h=-1!==g.indexOf("webkit"),i=-1!==g.indexOf("chrome"),j=-1!==g.indexOf("phantom"),k=-1!==g.indexOf("android"),l=-1!==g.search("android [23]"),m=-1!==g.indexOf("gecko"),n=typeof orientation!=d+"",o=!a.PointerEvent&&a.MSPointerEvent,p=a.PointerEvent&&a.navigator.pointerEnabled||o,q="devicePixelRatio"in a&&a.devicePixelRatio>1||"matchMedia"in a&&a.matchMedia("(min-resolution:144dpi)")&&a.matchMedia("(min-resolution:144dpi)").matches,r=c.documentElement,s=b&&"transition"in r.style,t="WebKitCSSMatrix"in a&&"m11"in new a.WebKitCSSMatrix&&!l,u="MozPerspective"in r.style,v="OTransition"in r.style,w=!a.L_DISABLE_3D&&(s||t||u||v)&&!j,x=!a.L_NO_TOUCH&&!j&&(p||"ontouchstart"in a||a.DocumentTouch&&c instanceof a.DocumentTouch);f.Browser={ie:b,ielt9:e,webkit:h,gecko:m&&!h&&!a.opera&&!b,android:k,android23:l,chrome:i,ie3d:s,webkit3d:t,gecko3d:u,opera3d:v,any3d:w,mobile:n,mobileWebkit:n&&h,mobileWebkit3d:n&&t,mobileOpera:n&&a.opera,touch:x,msPointer:o,pointer:p,retina:q}}(),f.Point=function(a,b,c){this.x=c?Math.round(a):a,this.y=c?Math.round(b):b},f.Point.prototype={clone:function(){return new f.Point(this.x,this.y)},add:function(a){return this.clone()._add(f.point(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(f.point(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(a){a=f.point(a);var b=a.x-this.x,c=a.y-this.y;return Math.sqrt(b*b+c*c)},equals:function(a){return a=f.point(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=f.point(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+f.Util.formatNum(this.x)+", "+f.Util.formatNum(this.y)+")"}},f.point=function(a,b,c){return a instanceof f.Point?a:f.Util.isArray(a)?new f.Point(a[0],a[1]):a===d||null===a?a:new f.Point(a,b,c)},f.Bounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},f.Bounds.prototype={extend:function(a){return a=f.point(a),this.min||this.max?(this.min.x=Math.min(a.x,this.min.x),this.max.x=Math.max(a.x,this.max.x),this.min.y=Math.min(a.y,this.min.y),this.max.y=Math.max(a.y,this.max.y)):(this.min=a.clone(),this.max=a.clone()),this},getCenter:function(a){return new f.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return new f.Point(this.min.x,this.max.y)},getTopRight:function(){return new f.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var b,c;return a="number"==typeof a[0]||a instanceof f.Point?f.point(a):f.bounds(a),a instanceof f.Bounds?(b=a.min,c=a.max):b=c=a,b.x>=this.min.x&&c.x<=this.max.x&&b.y>=this.min.y&&c.y<=this.max.y},intersects:function(a){a=f.bounds(a);var b=this.min,c=this.max,d=a.min,e=a.max,g=e.x>=b.x&&d.x<=c.x,h=e.y>=b.y&&d.y<=c.y;return g&&h},isValid:function(){return!(!this.min||!this.max)}},f.bounds=function(a,b){return!a||a instanceof f.Bounds?a:new f.Bounds(a,b)},f.Transformation=function(a,b,c,d){this._a=a,this._b=b,this._c=c,this._d=d},f.Transformation.prototype={transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){return b=b||1,a.x=b*(this._a*a.x+this._b),a.y=b*(this._c*a.y+this._d),a},untransform:function(a,b){return b=b||1,new f.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}},f.DomUtil={get:function(a){return"string"==typeof a?c.getElementById(a):a},getStyle:function(a,b){var d=a.style[b];if(!d&&a.currentStyle&&(d=a.currentStyle[b]),(!d||"auto"===d)&&c.defaultView){var e=c.defaultView.getComputedStyle(a,null);d=e?e[b]:null}return"auto"===d?null:d},getViewportOffset:function(a){var b,d=0,e=0,g=a,h=c.body,i=c.documentElement;do{if(d+=g.offsetTop||0,e+=g.offsetLeft||0,d+=parseInt(f.DomUtil.getStyle(g,"borderTopWidth"),10)||0,e+=parseInt(f.DomUtil.getStyle(g,"borderLeftWidth"),10)||0,b=f.DomUtil.getStyle(g,"position"),g.offsetParent===h&&"absolute"===b)break;if("fixed"===b){d+=h.scrollTop||i.scrollTop||0,e+=h.scrollLeft||i.scrollLeft||0;break}if("relative"===b&&!g.offsetLeft){var j=f.DomUtil.getStyle(g,"width"),k=f.DomUtil.getStyle(g,"max-width"),l=g.getBoundingClientRect();("none"!==j||"none"!==k)&&(e+=l.left+g.clientLeft),d+=l.top+(h.scrollTop||i.scrollTop||0);break}g=g.offsetParent}while(g);g=a;do{if(g===h)break;d-=g.scrollTop||0,e-=g.scrollLeft||0,g=g.parentNode}while(g);return new f.Point(e,d)},documentIsLtr:function(){return f.DomUtil._docIsLtrCached||(f.DomUtil._docIsLtrCached=!0,f.DomUtil._docIsLtr="ltr"===f.DomUtil.getStyle(c.body,"direction")),f.DomUtil._docIsLtr},create:function(a,b,d){var e=c.createElement(a);return e.className=b,d&&d.appendChild(e),e},hasClass:function(a,b){if(a.classList!==d)return a.classList.contains(b);var c=f.DomUtil._getClass(a);return c.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)},addClass:function(a,b){if(a.classList!==d)for(var c=f.Util.splitWords(b),e=0,g=c.length;g>e;e++)a.classList.add(c[e]);else if(!f.DomUtil.hasClass(a,b)){var h=f.DomUtil._getClass(a);f.DomUtil._setClass(a,(h?h+" ":"")+b)}},removeClass:function(a,b){a.classList!==d?a.classList.remove(b):f.DomUtil._setClass(a,f.Util.trim((" "+f.DomUtil._getClass(a)+" ").replace(" "+b+" "," ")))},_setClass:function(a,b){a.className.baseVal===d?a.className=b:a.className.baseVal=b},_getClass:function(a){return a.className.baseVal===d?a.className:a.className.baseVal},setOpacity:function(a,b){if("opacity"in a.style)a.style.opacity=b;else if("filter"in a.style){var c=!1,d="DXImageTransform.Microsoft.Alpha";try{c=a.filters.item(d)}catch(e){if(1===b)return}b=Math.round(100*b),c?(c.Enabled=100!==b,c.Opacity=b):a.style.filter+=" progid:"+d+"(opacity="+b+")"}},testProp:function(a){for(var b=c.documentElement.style,d=0;d<a.length;d++)if(a[d]in b)return a[d];return!1},getTranslateString:function(a){var b=f.Browser.webkit3d,c="translate"+(b?"3d":"")+"(",d=(b?",0":"")+")";return c+a.x+"px,"+a.y+"px"+d},getScaleString:function(a,b){var c=f.DomUtil.getTranslateString(b.add(b.multiplyBy(-1*a))),d=" scale("+a+") ";return c+d},setPosition:function(a,b,c){a._leaflet_pos=b,!c&&f.Browser.any3d?a.style[f.DomUtil.TRANSFORM]=f.DomUtil.getTranslateString(b):(a.style.left=b.x+"px",a.style.top=b.y+"px")},getPosition:function(a){return a._leaflet_pos}},f.DomUtil.TRANSFORM=f.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),f.DomUtil.TRANSITION=f.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),f.DomUtil.TRANSITION_END="webkitTransition"===f.DomUtil.TRANSITION||"OTransition"===f.DomUtil.TRANSITION?f.DomUtil.TRANSITION+"End":"transitionend",function(){if("onselectstart"in c)f.extend(f.DomUtil,{disableTextSelection:function(){f.DomEvent.on(a,"selectstart",f.DomEvent.preventDefault)},enableTextSelection:function(){f.DomEvent.off(a,"selectstart",f.DomEvent.preventDefault)}});else{var b=f.DomUtil.testProp(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);f.extend(f.DomUtil,{disableTextSelection:function(){if(b){var a=c.documentElement.style;this._userSelect=a[b],a[b]="none"}},enableTextSelection:function(){b&&(c.documentElement.style[b]=this._userSelect,delete this._userSelect)}})}f.extend(f.DomUtil,{disableImageDrag:function(){f.DomEvent.on(a,"dragstart",f.DomEvent.preventDefault)},enableImageDrag:function(){f.DomEvent.off(a,"dragstart",f.DomEvent.preventDefault)}})}(),f.LatLng=function(a,b,c){if(a=parseFloat(a),b=parseFloat(b),isNaN(a)||isNaN(b))throw new Error("Invalid LatLng object: ("+a+", "+b+")");this.lat=a,this.lng=b,c!==d&&(this.alt=parseFloat(c))},f.extend(f.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),f.LatLng.prototype={equals:function(a){if(!a)return!1;a=f.latLng(a);var b=Math.max(Math.abs(this.lat-a.lat),Math.abs(this.lng-a.lng));return b<=f.LatLng.MAX_MARGIN},toString:function(a){return"LatLng("+f.Util.formatNum(this.lat,a)+", "+f.Util.formatNum(this.lng,a)+")";
  },distanceTo:function(a){a=f.latLng(a);var b=6378137,c=f.LatLng.DEG_TO_RAD,d=(a.lat-this.lat)*c,e=(a.lng-this.lng)*c,g=this.lat*c,h=a.lat*c,i=Math.sin(d/2),j=Math.sin(e/2),k=i*i+j*j*Math.cos(g)*Math.cos(h);return 2*b*Math.atan2(Math.sqrt(k),Math.sqrt(1-k))},wrap:function(a,b){var c=this.lng;return a=a||-180,b=b||180,c=(c+b)%(b-a)+(a>c||c===b?b:a),new f.LatLng(this.lat,c)}},f.latLng=function(a,b){return a instanceof f.LatLng?a:f.Util.isArray(a)?"number"==typeof a[0]||"string"==typeof a[0]?new f.LatLng(a[0],a[1],a[2]):null:a===d||null===a?a:"object"==typeof a&&"lat"in a?new f.LatLng(a.lat,"lng"in a?a.lng:a.lon):b===d?null:new f.LatLng(a,b)},f.LatLngBounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},f.LatLngBounds.prototype={extend:function(a){if(!a)return this;var b=f.latLng(a);return a=null!==b?b:f.latLngBounds(a),a instanceof f.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(a.lat,this._southWest.lat),this._southWest.lng=Math.min(a.lng,this._southWest.lng),this._northEast.lat=Math.max(a.lat,this._northEast.lat),this._northEast.lng=Math.max(a.lng,this._northEast.lng)):(this._southWest=new f.LatLng(a.lat,a.lng),this._northEast=new f.LatLng(a.lat,a.lng)):a instanceof f.LatLngBounds&&(this.extend(a._southWest),this.extend(a._northEast)),this},pad:function(a){var b=this._southWest,c=this._northEast,d=Math.abs(b.lat-c.lat)*a,e=Math.abs(b.lng-c.lng)*a;return new f.LatLngBounds(new f.LatLng(b.lat-d,b.lng-e),new f.LatLng(c.lat+d,c.lng+e))},getCenter:function(){return new f.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new f.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new f.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){a="number"==typeof a[0]||a instanceof f.LatLng?f.latLng(a):f.latLngBounds(a);var b,c,d=this._southWest,e=this._northEast;return a instanceof f.LatLngBounds?(b=a.getSouthWest(),c=a.getNorthEast()):b=c=a,b.lat>=d.lat&&c.lat<=e.lat&&b.lng>=d.lng&&c.lng<=e.lng},intersects:function(a){a=f.latLngBounds(a);var b=this._southWest,c=this._northEast,d=a.getSouthWest(),e=a.getNorthEast(),g=e.lat>=b.lat&&d.lat<=c.lat,h=e.lng>=b.lng&&d.lng<=c.lng;return g&&h},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a){return a?(a=f.latLngBounds(a),this._southWest.equals(a.getSouthWest())&&this._northEast.equals(a.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},f.latLngBounds=function(a,b){return!a||a instanceof f.LatLngBounds?a:new f.LatLngBounds(a,b)},f.Projection={},f.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(a){var b=f.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),e=a.lng*b,g=d*b;return g=Math.log(Math.tan(Math.PI/4+g/2)),new f.Point(e,g)},unproject:function(a){var b=f.LatLng.RAD_TO_DEG,c=a.x*b,d=(2*Math.atan(Math.exp(a.y))-Math.PI/2)*b;return new f.LatLng(d,c)}},f.Projection.LonLat={project:function(a){return new f.Point(a.lng,a.lat)},unproject:function(a){return new f.LatLng(a.y,a.x)}},f.CRS={latLngToPoint:function(a,b){var c=this.projection.project(a),d=this.scale(b);return this.transformation._transform(c,d)},pointToLatLng:function(a,b){var c=this.scale(b),d=this.transformation.untransform(a,c);return this.projection.unproject(d)},project:function(a){return this.projection.project(a)},scale:function(a){return 256*Math.pow(2,a)},getSize:function(a){var b=this.scale(a);return f.point(b,b)}},f.CRS.Simple=f.extend({},f.CRS,{projection:f.Projection.LonLat,transformation:new f.Transformation(1,0,-1,0),scale:function(a){return Math.pow(2,a)}}),f.CRS.EPSG3857=f.extend({},f.CRS,{code:"EPSG:3857",projection:f.Projection.SphericalMercator,transformation:new f.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(a){var b=this.projection.project(a),c=6378137;return b.multiplyBy(c)}}),f.CRS.EPSG900913=f.extend({},f.CRS.EPSG3857,{code:"EPSG:900913"}),f.CRS.EPSG4326=f.extend({},f.CRS,{code:"EPSG:4326",projection:f.Projection.LonLat,transformation:new f.Transformation(1/360,.5,-1/360,.5)}),f.Map=f.Class.extend({includes:f.Mixin.Events,options:{crs:f.CRS.EPSG3857,fadeAnimation:f.DomUtil.TRANSITION&&!f.Browser.android23,trackResize:!0,markerZoomAnimation:f.DomUtil.TRANSITION&&f.Browser.any3d},initialize:function(a,b){b=f.setOptions(this,b),this._initContainer(a),this._initLayout(),this._onResize=f.bind(this._onResize,this),this._initEvents(),b.maxBounds&&this.setMaxBounds(b.maxBounds),b.center&&b.zoom!==d&&this.setView(f.latLng(b.center),b.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(b.layers)},setView:function(a,b){return b=b===d?this.getZoom():b,this._resetView(f.latLng(a),this._limitZoom(b)),this},setZoom:function(a,b){return this._loaded?this.setView(this.getCenter(),a,{zoom:b}):(this._zoom=this._limitZoom(a),this)},zoomIn:function(a,b){return this.setZoom(this._zoom+(a||1),b)},zoomOut:function(a,b){return this.setZoom(this._zoom-(a||1),b)},setZoomAround:function(a,b,c){var d=this.getZoomScale(b),e=this.getSize().divideBy(2),g=a instanceof f.Point?a:this.latLngToContainerPoint(a),h=g.subtract(e).multiplyBy(1-1/d),i=this.containerPointToLatLng(e.add(h));return this.setView(i,b,{zoom:c})},fitBounds:function(a,b){b=b||{},a=a.getBounds?a.getBounds():f.latLngBounds(a);var c=f.point(b.paddingTopLeft||b.padding||[0,0]),d=f.point(b.paddingBottomRight||b.padding||[0,0]),e=this.getBoundsZoom(a,!1,c.add(d));e=b.maxZoom?Math.min(b.maxZoom,e):e;var g=d.subtract(c).divideBy(2),h=this.project(a.getSouthWest(),e),i=this.project(a.getNorthEast(),e),j=this.unproject(h.add(i).divideBy(2).add(g),e);return this.setView(j,e,b)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,b){return this.setView(a,this._zoom,{pan:b})},panBy:function(a){return this.fire("movestart"),this._rawPanBy(f.point(a)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(a){return a=f.latLngBounds(a),this.options.maxBounds=a,a?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(a,b){var c=this.getCenter(),d=this._limitCenter(c,this._zoom,a);return c.equals(d)?this:this.panTo(d,b)},addLayer:function(a){var b=f.stamp(a);return this._layers[b]?this:(this._layers[b]=a,!a.options||isNaN(a.options.maxZoom)&&isNaN(a.options.minZoom)||(this._zoomBoundLayers[b]=a,this._updateZoomLevels()),this.options.zoomAnimation&&f.TileLayer&&a instanceof f.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,a.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(a),this)},removeLayer:function(a){var b=f.stamp(a);return this._layers[b]?(this._loaded&&a.onRemove(this),delete this._layers[b],this._loaded&&this.fire("layerremove",{layer:a}),this._zoomBoundLayers[b]&&(delete this._zoomBoundLayers[b],this._updateZoomLevels()),this.options.zoomAnimation&&f.TileLayer&&a instanceof f.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,a.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(a){return a?f.stamp(a)in this._layers:!1},eachLayer:function(a,b){for(var c in this._layers)a.call(b,this._layers[c]);return this},invalidateSize:function(a){if(!this._loaded)return this;a=f.extend({animate:!1,pan:!0},a===!0?{animate:!0}:a);var b=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var c=this.getSize(),d=b.divideBy(2).round(),e=c.divideBy(2).round(),g=d.subtract(e);return g.x||g.y?(a.animate&&a.pan?this.panBy(g):(a.pan&&this._rawPanBy(g),this.fire("move"),a.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(f.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:b,newSize:c})):this},addHandler:function(a,b){if(!b)return this;var c=this[a]=new b(this);return this._handlers.push(c),this.options[a]&&c.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(a){this._container._leaflet=d}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var a=this.getPixelBounds(),b=this.unproject(a.getBottomLeft()),c=this.unproject(a.getTopRight());return new f.LatLngBounds(b,c)},getMinZoom:function(){return this.options.minZoom===d?this._layersMinZoom===d?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===d?this._layersMaxZoom===d?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(a,b,c){a=f.latLngBounds(a);var d,e=this.getMinZoom()-(b?1:0),g=this.getMaxZoom(),h=this.getSize(),i=a.getNorthWest(),j=a.getSouthEast(),k=!0;c=f.point(c||[0,0]);do e++,d=this.project(j,e).subtract(this.project(i,e)).add(c),k=b?d.x<h.x||d.y<h.y:h.contains(d);while(k&&g>=e);return k&&b?null:b?e:e-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new f.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var a=this._getTopLeftPoint();return new f.Bounds(a,a.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a){var b=this.options.crs;return b.scale(a)/b.scale(this._zoom)},getScaleZoom:function(a){return this._zoom+Math.log(a)/Math.LN2},project:function(a,b){return b=b===d?this._zoom:b,this.options.crs.latLngToPoint(f.latLng(a),b)},unproject:function(a,b){return b=b===d?this._zoom:b,this.options.crs.pointToLatLng(f.point(a),b)},layerPointToLatLng:function(a){var b=f.point(a).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(a){var b=this.project(f.latLng(a))._round();return b._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(a){return f.point(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return f.point(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var b=this.containerPointToLayerPoint(f.point(a));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(f.latLng(a)))},mouseEventToContainerPoint:function(a){return f.DomEvent.getMousePosition(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var b=this._container=f.DomUtil.get(a);if(!b)throw new Error("Map container not found.");if(b._leaflet)throw new Error("Map container is already initialized.");b._leaflet=!0},_initLayout:function(){var a=this._container;f.DomUtil.addClass(a,"leaflet-container"+(f.Browser.touch?" leaflet-touch":"")+(f.Browser.retina?" leaflet-retina":"")+(f.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var b=f.DomUtil.getStyle(a,"position");"absolute"!==b&&"relative"!==b&&"fixed"!==b&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._mapPane=a.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=a.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),a.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),a.shadowPane=this._createPane("leaflet-shadow-pane"),a.overlayPane=this._createPane("leaflet-overlay-pane"),a.markerPane=this._createPane("leaflet-marker-pane"),a.popupPane=this._createPane("leaflet-popup-pane");var b=" leaflet-zoom-hide";this.options.markerZoomAnimation||(f.DomUtil.addClass(a.markerPane,b),f.DomUtil.addClass(a.shadowPane,b),f.DomUtil.addClass(a.popupPane,b))},_createPane:function(a,b){return f.DomUtil.create("div",a,b||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(a){a=a?f.Util.isArray(a)?a:[a]:[];for(var b=0,c=a.length;c>b;b++)this.addLayer(a[b])},_resetView:function(a,b,c,d){var e=this._zoom!==b;d||(this.fire("movestart"),e&&this.fire("zoomstart")),this._zoom=b,this._initialCenter=a,this._initialTopLeftPoint=this._getNewTopLeftPoint(a),c?this._initialTopLeftPoint._add(this._getMapPanePos()):f.DomUtil.setPosition(this._mapPane,new f.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var g=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!c}),g&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("move"),(e||d)&&this.fire("zoomend"),this.fire("moveend",{hard:!c})},_rawPanBy:function(a){f.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var a,b=1/0,c=-(1/0),e=this._getZoomSpan();for(a in this._zoomBoundLayers){var f=this._zoomBoundLayers[a];isNaN(f.options.minZoom)||(b=Math.min(b,f.options.minZoom)),isNaN(f.options.maxZoom)||(c=Math.max(c,f.options.maxZoom))}a===d?this._layersMaxZoom=this._layersMinZoom=d:(this._layersMaxZoom=c,this._layersMinZoom=b),e!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(b){if(f.DomEvent){b=b||"on",f.DomEvent[b](this._container,"click",this._onMouseClick,this);var c,d,e=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(c=0,d=e.length;d>c;c++)f.DomEvent[b](this._container,e[c],this._fireMouseEvent,this);this.options.trackResize&&f.DomEvent[b](a,"resize",this._onResize,this)}},_onResize:function(){f.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=f.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(a){!this._loaded||!a._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||f.DomEvent._skipped(a)||(this.fire("preclick"),this._fireMouseEvent(a))},_fireMouseEvent:function(a){if(this._loaded&&!f.DomEvent._skipped(a)){var b=a.type;if(b="mouseenter"===b?"mouseover":"mouseleave"===b?"mouseout":b,this.hasEventListeners(b)){"contextmenu"===b&&f.DomEvent.preventDefault(a);var c=this.mouseEventToContainerPoint(a),d=this.containerPointToLayerPoint(c),e=this.layerPointToLatLng(d);this.fire(b,{latlng:e,layerPoint:d,containerPoint:c,originalEvent:a})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var a=0,b=this._handlers.length;b>a;a++)this._handlers[a].disable()},whenReady:function(a,b){return this._loaded?a.call(b||this,this):this.on("load",a,b),this},_layerAdd:function(a){a.onAdd(this),this.fire("layeradd",{layer:a})},_getMapPanePos:function(){return f.DomUtil.getPosition(this._mapPane)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(a,b){var c=this.getSize()._divideBy(2);return this.project(a,b)._subtract(c)._round()},_latLngToNewLayerPoint:function(a,b,c){var d=this._getNewTopLeftPoint(c,b).add(this._getMapPanePos());return this.project(a,b)._subtract(d)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitCenter:function(a,b,c){if(!c)return a;var d=this.project(a,b),e=this.getSize().divideBy(2),g=new f.Bounds(d.subtract(e),d.add(e)),h=this._getBoundsOffset(g,c,b);return this.unproject(d.add(h),b)},_limitOffset:function(a,b){if(!b)return a;var c=this.getPixelBounds(),d=new f.Bounds(c.min.add(a),c.max.add(a));return a.add(this._getBoundsOffset(d,b))},_getBoundsOffset:function(a,b,c){var d=this.project(b.getNorthWest(),c).subtract(a.min),e=this.project(b.getSouthEast(),c).subtract(a.max),g=this._rebound(d.x,-e.x),h=this._rebound(d.y,-e.y);return new f.Point(g,h)},_rebound:function(a,b){return a+b>0?Math.round(a-b)/2:Math.max(0,Math.ceil(a))-Math.max(0,Math.floor(b))},_limitZoom:function(a){var b=this.getMinZoom(),c=this.getMaxZoom();return Math.max(b,Math.min(c,a))}}),f.map=function(a,b){return new f.Map(a,b)},f.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(a){var b=f.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),e=this.R_MAJOR,g=this.R_MINOR,h=a.lng*b*e,i=d*b,j=g/e,k=Math.sqrt(1-j*j),l=k*Math.sin(i);l=Math.pow((1-l)/(1+l),.5*k);var m=Math.tan(.5*(.5*Math.PI-i))/l;return i=-e*Math.log(m),new f.Point(h,i)},unproject:function(a){for(var b,c=f.LatLng.RAD_TO_DEG,d=this.R_MAJOR,e=this.R_MINOR,g=a.x*c/d,h=e/d,i=Math.sqrt(1-h*h),j=Math.exp(-a.y/d),k=Math.PI/2-2*Math.atan(j),l=15,m=1e-7,n=l,o=.1;Math.abs(o)>m&&--n>0;)b=i*Math.sin(k),o=Math.PI/2-2*Math.atan(j*Math.pow((1-b)/(1+b),.5*i))-k,k+=o;return new f.LatLng(k*c,g)}},f.CRS.EPSG3395=f.extend({},f.CRS,{code:"EPSG:3395",projection:f.Projection.Mercator,transformation:function(){var a=f.Projection.Mercator,b=a.R_MAJOR,c=.5/(Math.PI*b);return new f.Transformation(c,.5,-c,.5)}()}),f.TileLayer=f.Class.extend({includes:f.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:f.Browser.mobile,updateWhenIdle:f.Browser.mobile},initialize:function(a,b){b=f.setOptions(this,b),b.detectRetina&&f.Browser.retina&&b.maxZoom>0&&(b.tileSize=Math.floor(b.tileSize/2),b.zoomOffset++,b.minZoom>0&&b.minZoom--,this.options.maxZoom--),b.bounds&&(b.bounds=f.latLngBounds(b.bounds)),this._url=a;var c=this.options.subdomains;"string"==typeof c&&(this.options.subdomains=c.split(""))},onAdd:function(a){this._map=a,this._animated=a._zoomAnimated,this._initContainer(),a.on({viewreset:this._reset,moveend:this._update},this),this._animated&&a.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=f.Util.limitExecByInterval(this._update,150,this),a.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this._container.parentNode.removeChild(this._container),a.off({viewreset:this._reset,moveend:this._update},this),this._animated&&a.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||a.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var a=this._map._panes.tilePane;return this._container&&(a.appendChild(this._container),this._setAutoZIndex(a,Math.max)),this},bringToBack:function(){var a=this._map._panes.tilePane;return this._container&&(a.insertBefore(this._container,a.firstChild),this._setAutoZIndex(a,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},setUrl:function(a,b){return this._url=a,b||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==d&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a,b){var c,d,e,f=a.children,g=-b(1/0,-(1/0));for(d=0,e=f.length;e>d;d++)f[d]!==this._container&&(c=parseInt(f[d].style.zIndex,10),isNaN(c)||(g=b(g,c)));this.options.zIndex=this._container.style.zIndex=(isFinite(g)?g:0)+b(1,-1)},_updateOpacity:function(){var a,b=this._tiles;if(f.Browser.ielt9)for(a in b)f.DomUtil.setOpacity(b[a],this.options.opacity);else f.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var a=this._map._panes.tilePane;if(!this._container){if(this._container=f.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var b="leaflet-tile-container";this._bgBuffer=f.DomUtil.create("div",b,this._container),this._tileContainer=f.DomUtil.create("div",b,this._container)}else this._tileContainer=this._container;a.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(a){for(var b in this._tiles)this.fire("tileunload",{tile:this._tiles[b]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&a&&a.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var a=this._map,b=a.getZoom()+this.options.zoomOffset,c=this.options.maxNativeZoom,d=this.options.tileSize;return c&&b>c&&(d=Math.round(a.getZoomScale(b)/a.getZoomScale(c)*d)),d},_update:function(){if(this._map){var a=this._map,b=a.getPixelBounds(),c=a.getZoom(),d=this._getTileSize();if(!(c>this.options.maxZoom||c<this.options.minZoom)){var e=f.bounds(b.min.divideBy(d)._floor(),b.max.divideBy(d)._floor());this._addTilesFromCenterOut(e),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(e)}}},_addTilesFromCenterOut:function(a){var b,d,e,g=[],h=a.getCenter();for(b=a.min.y;b<=a.max.y;b++)for(d=a.min.x;d<=a.max.x;d++)e=new f.Point(d,b),this._tileShouldBeLoaded(e)&&g.push(e);var i=g.length;if(0!==i){g.sort(function(a,b){return a.distanceTo(h)-b.distanceTo(h)});var j=c.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=i,d=0;i>d;d++)this._addTile(g[d],j);this._tileContainer.appendChild(j)}},_tileShouldBeLoaded:function(a){if(a.x+":"+a.y in this._tiles)return!1;var b=this.options;if(!b.continuousWorld){var c=this._getWrapTileNum();if(b.noWrap&&(a.x<0||a.x>=c.x)||a.y<0||a.y>=c.y)return!1}if(b.bounds){var d=this._getTileSize(),e=a.multiplyBy(d),f=e.add([d,d]),g=this._map.unproject(e),h=this._map.unproject(f);if(b.continuousWorld||b.noWrap||(g=g.wrap(),h=h.wrap()),!b.bounds.intersects([g,h]))return!1}return!0},_removeOtherTiles:function(a){var b,c,d,e;for(e in this._tiles)b=e.split(":"),c=parseInt(b[0],10),d=parseInt(b[1],10),(c<a.min.x||c>a.max.x||d<a.min.y||d>a.max.y)&&this._removeTile(e)},_removeTile:function(a){var b=this._tiles[a];this.fire("tileunload",{tile:b,url:b.src}),this.options.reuseTiles?(f.DomUtil.removeClass(b,"leaflet-tile-loaded"),this._unusedTiles.push(b)):b.parentNode===this._tileContainer&&this._tileContainer.removeChild(b),f.Browser.android||(b.onload=null,b.src=f.Util.emptyImageUrl),delete this._tiles[a]},_addTile:function(a,b){var c=this._getTilePos(a),d=this._getTile();f.DomUtil.setPosition(d,c,f.Browser.chrome),this._tiles[a.x+":"+a.y]=d,this._loadTile(d,a),d.parentNode!==this._tileContainer&&b.appendChild(d)},_getZoomForUrl:function(){var a=this.options,b=this._map.getZoom();return a.zoomReverse&&(b=a.maxZoom-b),b+=a.zoomOffset,a.maxNativeZoom?Math.min(b,a.maxNativeZoom):b},_getTilePos:function(a){var b=this._map.getPixelOrigin(),c=this._getTileSize();return a.multiplyBy(c).subtract(b)},getTileUrl:function(a){return f.Util.template(this._url,f.extend({s:this._getSubdomain(a),z:a.z,x:a.x,y:a.y},this.options))},_getWrapTileNum:function(){var a=this._map.options.crs,b=a.getSize(this._map.getZoom());return b.divideBy(this._getTileSize())._floor()},_adjustTilePoint:function(a){var b=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(a.x=(a.x%b.x+b.x)%b.x),this.options.tms&&(a.y=b.y-a.y-1),a.z=this._getZoomForUrl()},_getSubdomain:function(a){var b=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[b]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var a=this._unusedTiles.pop();return this._resetTile(a),a}return this._createTile()},_resetTile:function(){},_createTile:function(){var a=f.DomUtil.create("img","leaflet-tile");return a.style.width=a.style.height=this._getTileSize()+"px",a.galleryimg="no",a.onselectstart=a.onmousemove=f.Util.falseFn,f.Browser.ielt9&&this.options.opacity!==d&&f.DomUtil.setOpacity(a,this.options.opacity),f.Browser.mobileWebkit3d&&(a.style.WebkitBackfaceVisibility="hidden"),a},_loadTile:function(a,b){a._layer=this,a.onload=this._tileOnLoad,a.onerror=this._tileOnError,this._adjustTilePoint(b),a.src=this.getTileUrl(b),this.fire("tileloadstart",{tile:a,url:a.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&f.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(f.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var a=this._layer;this.src!==f.Util.emptyImageUrl&&(f.DomUtil.addClass(this,"leaflet-tile-loaded"),a.fire("tileload",{tile:this,url:this.src})),a._tileLoaded()},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});var b=a.options.errorTileUrl;b&&(this.src=b),a._tileLoaded()}}),f.tileLayer=function(a,b){return new f.TileLayer(a,b)},f.TileLayer.WMS=f.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;var c=f.extend({},this.defaultWmsParams),d=b.tileSize||this.options.tileSize;b.detectRetina&&f.Browser.retina?c.width=c.height=2*d:c.width=c.height=d;for(var e in b)this.options.hasOwnProperty(e)||"crs"===e||(c[e]=b[e]);this.wmsParams=c,f.setOptions(this,b)},onAdd:function(a){this._crs=this.options.crs||a.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var b=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[b]=this._crs.code,f.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a){var b=this._map,c=this.options.tileSize,d=a.multiplyBy(c),e=d.add([c,c]),g=this._crs.project(b.unproject(d,a.z)),h=this._crs.project(b.unproject(e,a.z)),i=this._wmsVersion>=1.3&&this._crs===f.CRS.EPSG4326?[h.y,g.x,g.y,h.x].join(","):[g.x,h.y,h.x,g.y].join(","),j=f.Util.template(this._url,{s:this._getSubdomain(a)});return j+f.Util.getParamString(this.wmsParams,j,!0)+"&BBOX="+i},setParams:function(a,b){return f.extend(this.wmsParams,a),b||this.redraw(),this}}),f.tileLayer.wms=function(a,b){return new f.TileLayer.WMS(a,b)},f.TileLayer.Canvas=f.TileLayer.extend({options:{async:!1},initialize:function(a){f.setOptions(this,a)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var a in this._tiles)this._redrawTile(this._tiles[a]);return this},_redrawTile:function(a){this.drawTile(a,a._tilePoint,this._map._zoom)},_createTile:function(){var a=f.DomUtil.create("canvas","leaflet-tile");return a.width=a.height=this.options.tileSize,a.onselectstart=a.onmousemove=f.Util.falseFn,a},_loadTile:function(a,b){a._layer=this,a._tilePoint=b,this._redrawTile(a),this.options.async||this.tileDrawn(a)},drawTile:function(){},tileDrawn:function(a){this._tileOnLoad.call(a)}}),f.tileLayer.canvas=function(a){return new f.TileLayer.Canvas(a)},f.ImageOverlay=f.Class.extend({includes:f.Mixin.Events,options:{opacity:1},initialize:function(a,b,c){this._url=a,this._bounds=f.latLngBounds(b),f.setOptions(this,c)},onAdd:function(a){this._map=a,this._image||this._initImage(),a._panes.overlayPane.appendChild(this._image),a.on("viewreset",this._reset,this),a.options.zoomAnimation&&f.Browser.any3d&&a.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image),a.off("viewreset",this._reset,this),a.options.zoomAnimation&&a.off("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var a=this._map._panes.overlayPane;return this._image&&a.insertBefore(this._image,a.firstChild),this},setUrl:function(a){this._url=a,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=f.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&f.Browser.any3d?f.DomUtil.addClass(this._image,"leaflet-zoom-animated"):f.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),f.extend(this._image,{galleryimg:"no",onselectstart:f.Util.falseFn,onmousemove:f.Util.falseFn,onload:f.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(a){var b=this._map,c=this._image,d=b.getZoomScale(a.zoom),e=this._bounds.getNorthWest(),g=this._bounds.getSouthEast(),h=b._latLngToNewLayerPoint(e,a.zoom,a.center),i=b._latLngToNewLayerPoint(g,a.zoom,a.center)._subtract(h),j=h._add(i._multiplyBy(.5*(1-1/d)));c.style[f.DomUtil.TRANSFORM]=f.DomUtil.getTranslateString(j)+" scale("+d+") "},_reset:function(){var a=this._image,b=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),c=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(b);f.DomUtil.setPosition(a,b),a.style.width=c.x+"px",a.style.height=c.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){f.DomUtil.setOpacity(this._image,this.options.opacity)}}),f.imageOverlay=function(a,b,c){return new f.ImageOverlay(a,b,c)},f.Icon=f.Class.extend({options:{className:""},initialize:function(a){f.setOptions(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,b){var c=this._getIconUrl(a);if(!c){if("icon"===a)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var d;return d=b&&"IMG"===b.tagName?this._createImg(c,b):this._createImg(c),this._setIconStyles(d,a),d},_setIconStyles:function(a,b){var c,d=this.options,e=f.point(d[b+"Size"]);c="shadow"===b?f.point(d.shadowAnchor||d.iconAnchor):f.point(d.iconAnchor),!c&&e&&(c=e.divideBy(2,!0)),a.className="leaflet-marker-"+b+" "+d.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),e&&(a.style.width=e.x+"px",a.style.height=e.y+"px")},_createImg:function(a,b){return b=b||c.createElement("img"),b.src=a,b},_getIconUrl:function(a){return f.Browser.retina&&this.options[a+"RetinaUrl"]?this.options[a+"RetinaUrl"]:this.options[a+"Url"]}}),f.icon=function(a){return new f.Icon(a)},f.Icon.Default=f.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(a){var b=a+"Url";if(this.options[b])return this.options[b];f.Browser.retina&&"icon"===a&&(a+="-2x");var c=f.Icon.Default.imagePath;if(!c)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return c+"/marker-"+a+".png"}}),f.Icon.Default.imagePath=function(){var a,b,d,e,f,g=c.getElementsByTagName("script"),h=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(a=0,b=g.length;b>a;a++)if(d=g[a].src,e=d.match(h))return f=d.split(h)[0],(f?f+"/":"")+"images"}(),f.Marker=f.Class.extend({includes:f.Mixin.Events,options:{icon:new f.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(a,b){f.setOptions(this,b),this._latlng=f.latLng(a)},
  onAdd:function(a){this._map=a,a.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),a.options.zoomAnimation&&a.options.markerZoomAnimation&&a.on("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),a.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=f.latLng(a),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update(),this},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){return this._icon&&this._setPos(this._map.latLngToLayerPoint(this._latlng).round()),this},_initIcon:function(){var a=this.options,b=this._map,c=b.options.zoomAnimation&&b.options.markerZoomAnimation,d=c?"leaflet-zoom-animated":"leaflet-zoom-hide",e=a.icon.createIcon(this._icon),g=!1;e!==this._icon&&(this._icon&&this._removeIcon(),g=!0,a.title&&(e.title=a.title),a.alt&&(e.alt=a.alt)),f.DomUtil.addClass(e,d),a.keyboard&&(e.tabIndex="0"),this._icon=e,this._initInteraction(),a.riseOnHover&&f.DomEvent.on(e,"mouseover",this._bringToFront,this).on(e,"mouseout",this._resetZIndex,this);var h=a.icon.createShadow(this._shadow),i=!1;h!==this._shadow&&(this._removeShadow(),i=!0),h&&f.DomUtil.addClass(h,d),this._shadow=h,a.opacity<1&&this._updateOpacity();var j=this._map._panes;g&&j.markerPane.appendChild(this._icon),h&&i&&j.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&f.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(a){f.DomUtil.setPosition(this._icon,a),this._shadow&&f.DomUtil.setPosition(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon.style.zIndex=this._zIndex+a},_animateZoom:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center).round();this._setPos(b)},_initInteraction:function(){if(this.options.clickable){var a=this._icon,b=["dblclick","mousedown","mouseover","mouseout","contextmenu"];f.DomUtil.addClass(a,"leaflet-clickable"),f.DomEvent.on(a,"click",this._onMouseClick,this),f.DomEvent.on(a,"keypress",this._onKeyPress,this);for(var c=0;c<b.length;c++)f.DomEvent.on(a,b[c],this._fireMouseEvent,this);f.Handler.MarkerDrag&&(this.dragging=new f.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(a){var b=this.dragging&&this.dragging.moved();(this.hasEventListeners(a.type)||b)&&f.DomEvent.stopPropagation(a),b||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(a.type,{originalEvent:a,latlng:this._latlng})},_onKeyPress:function(a){13===a.keyCode&&this.fire("click",{originalEvent:a,latlng:this._latlng})},_fireMouseEvent:function(a){this.fire(a.type,{originalEvent:a,latlng:this._latlng}),"contextmenu"===a.type&&this.hasEventListeners(a.type)&&f.DomEvent.preventDefault(a),"mousedown"!==a.type?f.DomEvent.stopPropagation(a):f.DomEvent.preventDefault(a)},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},_updateOpacity:function(){f.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&f.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),f.marker=function(a,b){return new f.Marker(a,b)},f.DivIcon=f.Icon.extend({options:{iconSize:[12,12],className:"leaflet-div-icon",html:!1},createIcon:function(a){var b=a&&"DIV"===a.tagName?a:c.createElement("div"),d=this.options;return d.html!==!1?b.innerHTML=d.html:b.innerHTML="",d.bgPos&&(b.style.backgroundPosition=-d.bgPos.x+"px "+-d.bgPos.y+"px"),this._setIconStyles(b,"icon"),b},createShadow:function(){return null}}),f.divIcon=function(a){return new f.DivIcon(a)},f.Map.mergeOptions({closePopupOnClick:!0}),f.Popup=f.Class.extend({includes:f.Mixin.Events,options:{minWidth:50,maxWidth:300,autoPan:!0,closeButton:!0,offset:[0,7],autoPanPadding:[5,5],keepInView:!1,className:"",zoomAnimation:!0},initialize:function(a,b){f.setOptions(this,a),this._source=b,this._animated=f.Browser.any3d&&this.options.zoomAnimation,this._isOpen=!1},onAdd:function(a){this._map=a,this._container||this._initLayout();var b=a.options.fadeAnimation;b&&f.DomUtil.setOpacity(this._container,0),a._panes.popupPane.appendChild(this._container),a.on(this._getEvents(),this),this.update(),b&&f.DomUtil.setOpacity(this._container,1),this.fire("open"),a.fire("popupopen",{popup:this}),this._source&&this._source.fire("popupopen",{popup:this})},addTo:function(a){return a.addLayer(this),this},openOn:function(a){return a.openPopup(this),this},onRemove:function(a){a._panes.popupPane.removeChild(this._container),f.Util.falseFn(this._container.offsetWidth),a.off(this._getEvents(),this),a.options.fadeAnimation&&f.DomUtil.setOpacity(this._container,0),this._map=null,this.fire("close"),a.fire("popupclose",{popup:this}),this._source&&this._source.fire("popupclose",{popup:this})},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=f.latLng(a),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(a){return this._content=a,this.update(),this},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_getEvents:function(){var a={viewreset:this._updatePosition};return this._animated&&(a.zoomanim=this._zoomAnimation),("closeOnClick"in this.options?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(a.preclick=this._close),this.options.keepInView&&(a.moveend=this._adjustPan),a},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var a,b="leaflet-popup",c=b+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),d=this._container=f.DomUtil.create("div",c);this.options.closeButton&&(a=this._closeButton=f.DomUtil.create("a",b+"-close-button",d),a.href="#close",a.innerHTML="&#215;",f.DomEvent.disableClickPropagation(a),f.DomEvent.on(a,"click",this._onCloseButtonClick,this));var e=this._wrapper=f.DomUtil.create("div",b+"-content-wrapper",d);f.DomEvent.disableClickPropagation(e),this._contentNode=f.DomUtil.create("div",b+"-content",e),f.DomEvent.disableScrollPropagation(this._contentNode),f.DomEvent.on(e,"contextmenu",f.DomEvent.stopPropagation),this._tipContainer=f.DomUtil.create("div",b+"-tip-container",d),this._tip=f.DomUtil.create("div",b+"-tip",this._tipContainer)},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var a=this._contentNode,b=a.style;b.width="",b.whiteSpace="nowrap";var c=a.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),b.width=c+1+"px",b.whiteSpace="",b.height="";var d=a.offsetHeight,e=this.options.maxHeight,g="leaflet-popup-scrolled";e&&d>e?(b.height=e+"px",f.DomUtil.addClass(a,g)):f.DomUtil.removeClass(a,g),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),b=this._animated,c=f.point(this.options.offset);b&&f.DomUtil.setPosition(this._container,a),this._containerBottom=-c.y-(b?0:a.y),this._containerLeft=-Math.round(this._containerWidth/2)+c.x+(b?0:a.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);f.DomUtil.setPosition(this._container,b)},_adjustPan:function(){if(this.options.autoPan){var a=this._map,b=this._container.offsetHeight,c=this._containerWidth,d=new f.Point(this._containerLeft,-b-this._containerBottom);this._animated&&d._add(f.DomUtil.getPosition(this._container));var e=a.layerPointToContainerPoint(d),g=f.point(this.options.autoPanPadding),h=f.point(this.options.autoPanPaddingTopLeft||g),i=f.point(this.options.autoPanPaddingBottomRight||g),j=a.getSize(),k=0,l=0;e.x+c+i.x>j.x&&(k=e.x+c-j.x+i.x),e.x-k-h.x<0&&(k=e.x-h.x),e.y+b+i.y>j.y&&(l=e.y+b-j.y+i.y),e.y-l-h.y<0&&(l=e.y-h.y),(k||l)&&a.fire("autopanstart").panBy([k,l])}},_onCloseButtonClick:function(a){this._close(),f.DomEvent.stop(a)}}),f.popup=function(a,b){return new f.Popup(a,b)},f.Map.include({openPopup:function(a,b,c){if(this.closePopup(),!(a instanceof f.Popup)){var d=a;a=new f.Popup(c).setLatLng(b).setContent(d)}return a._isOpen=!0,this._popup=a,this.addLayer(a)},closePopup:function(a){return a&&a!==this._popup||(a=this._popup,this._popup=null),a&&(this.removeLayer(a),a._isOpen=!1),this}}),f.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(a,b){var c=f.point(this.options.icon.options.popupAnchor||[0,0]);return c=c.add(f.Popup.prototype.options.offset),b&&b.offset&&(c=c.add(b.offset)),b=f.extend({offset:c},b),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),a instanceof f.Popup?(f.setOptions(a,b),this._popup=a,a._source=this):this._popup=new f.Popup(b,this).setContent(a),this},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(a){this._popup.setLatLng(a.latlng)}}),f.LayerGroup=f.Class.extend({initialize:function(a){this._layers={};var b,c;if(a)for(b=0,c=a.length;c>b;b++)this.addLayer(a[b])},addLayer:function(a){var b=this.getLayerId(a);return this._layers[b]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var b=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[b]&&this._map.removeLayer(this._layers[b]),delete this._layers[b],this},hasLayer:function(a){return a?a in this._layers||this.getLayerId(a)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(a){var b,c,d=Array.prototype.slice.call(arguments,1);for(b in this._layers)c=this._layers[b],c[a]&&c[a].apply(c,d);return this},onAdd:function(a){this._map=a,this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a),this._map=null},addTo:function(a){return a.addLayer(this),this},eachLayer:function(a,b){for(var c in this._layers)a.call(b,this._layers[c]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];for(var b in this._layers)a.push(this._layers[b]);return a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return f.stamp(a)}}),f.layerGroup=function(a){return new f.LayerGroup(a)},f.FeatureGroup=f.LayerGroup.extend({includes:f.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(a){return this.hasLayer(a)?this:("on"in a&&a.on(f.FeatureGroup.EVENTS,this._propagateEvent,this),f.LayerGroup.prototype.addLayer.call(this,a),this._popupContent&&a.bindPopup&&a.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return this.hasLayer(a)?(a in this._layers&&(a=this._layers[a]),"off"in a&&a.off(f.FeatureGroup.EVENTS,this._propagateEvent,this),f.LayerGroup.prototype.removeLayer.call(this,a),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:a})):this},bindPopup:function(a,b){return this._popupContent=a,this._popupOptions=b,this.invoke("bindPopup",a,b)},openPopup:function(a){for(var b in this._layers){this._layers[b].openPopup(a);break}return this},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new f.LatLngBounds;return this.eachLayer(function(b){a.extend(b instanceof f.Marker?b.getLatLng():b.getBounds())}),a},_propagateEvent:function(a){a=f.extend({layer:a.target,target:this},a),this.fire(a.type,a)}}),f.featureGroup=function(a){return new f.FeatureGroup(a)},f.Path=f.Class.extend({includes:[f.Mixin.Events],statics:{CLIP_PADDING:function(){var b=f.Browser.mobile?1280:2e3,c=(b/Math.max(a.outerWidth,a.outerHeight)-1)/2;return Math.max(0,Math.min(.5,c))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(a){f.setOptions(this,a)},onAdd:function(a){this._map=a,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),a.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){a._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,f.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),a.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(a){return f.setOptions(this,a),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),f.Map.include({_updatePathViewport:function(){var a=f.Path.CLIP_PADDING,b=this.getSize(),c=f.DomUtil.getPosition(this._mapPane),d=c.multiplyBy(-1)._subtract(b.multiplyBy(a)._round()),e=d.add(b.multiplyBy(1+2*a)._round());this._pathViewport=new f.Bounds(d,e)}}),f.Path.SVG_NS="http://www.w3.org/2000/svg",f.Browser.svg=!(!c.createElementNS||!c.createElementNS(f.Path.SVG_NS,"svg").createSVGRect),f.Path=f.Path.extend({statics:{SVG:f.Browser.svg},bringToFront:function(){var a=this._map._pathRoot,b=this._container;return b&&a.lastChild!==b&&a.appendChild(b),this},bringToBack:function(){var a=this._map._pathRoot,b=this._container,c=a.firstChild;return b&&c!==b&&a.insertBefore(b,c),this},getPathString:function(){},_createElement:function(a){return c.createElementNS(f.Path.SVG_NS,a)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&f.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var a=this.getPathString();a||(a="M0 0"),this._path.setAttribute("d",a)},_initEvents:function(){if(this.options.clickable){(f.Browser.svg||!f.Browser.vml)&&f.DomUtil.addClass(this._path,"leaflet-clickable"),f.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var a=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],b=0;b<a.length;b++)f.DomEvent.on(this._container,a[b],this._fireMouseEvent,this)}},_onMouseClick:function(a){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(a)},_fireMouseEvent:function(a){if(this._map&&this.hasEventListeners(a.type)){var b=this._map,c=b.mouseEventToContainerPoint(a),d=b.containerPointToLayerPoint(c),e=b.layerPointToLatLng(d);this.fire(a.type,{latlng:e,layerPoint:d,containerPoint:c,originalEvent:a}),"contextmenu"===a.type&&f.DomEvent.preventDefault(a),"mousemove"!==a.type&&f.DomEvent.stopPropagation(a)}}}),f.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=f.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&f.Browser.any3d?(f.DomUtil.addClass(this._pathRoot,"leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):f.DomUtil.addClass(this._pathRoot,"leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(a){var b=this.getZoomScale(a.zoom),c=this._getCenterOffset(a.center)._multiplyBy(-b)._add(this._pathViewport.min);this._pathRoot.style[f.DomUtil.TRANSFORM]=f.DomUtil.getTranslateString(c)+" scale("+b+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var a=this._pathViewport,b=a.min,c=a.max,d=c.x-b.x,e=c.y-b.y,g=this._pathRoot,h=this._panes.overlayPane;f.Browser.mobileWebkit&&h.removeChild(g),f.DomUtil.setPosition(g,b),g.setAttribute("width",d),g.setAttribute("height",e),g.setAttribute("viewBox",[b.x,b.y,d,e].join(" ")),f.Browser.mobileWebkit&&h.appendChild(g)}}}),f.Path.include({bindPopup:function(a,b){return a instanceof f.Popup?this._popup=a:((!this._popup||b)&&(this._popup=new f.Popup(b,this)),this._popup.setContent(a)),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(a){return this._popup&&(a=a||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:a})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(a){this._popup.setLatLng(a.latlng),this._map.openPopup(this._popup)}}),f.Browser.vml=!f.Browser.svg&&function(){try{var a=c.createElement("div");a.innerHTML='<v:shape adj="1"/>';var b=a.firstChild;return b.style.behavior="url(#default#VML)",b&&"object"==typeof b.adj}catch(d){return!1}}(),f.Path=f.Browser.svg||!f.Browser.vml?f.Path:f.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return c.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return c.createElement("<lvml:"+a+' class="lvml">')}}catch(a){return function(a){return c.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var a=this._container=this._createElement("shape");f.DomUtil.addClass(a,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&f.DomUtil.addClass(a,"leaflet-clickable"),a.coordsize="1 1",this._path=this._createElement("path"),a.appendChild(this._path),this._map._pathRoot.appendChild(a)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var a=this._stroke,b=this._fill,c=this.options,d=this._container;d.stroked=c.stroke,d.filled=c.fill,c.stroke?(a||(a=this._stroke=this._createElement("stroke"),a.endcap="round",d.appendChild(a)),a.weight=c.weight+"px",a.color=c.color,a.opacity=c.opacity,c.dashArray?a.dashStyle=f.Util.isArray(c.dashArray)?c.dashArray.join(" "):c.dashArray.replace(/( *, *)/g," "):a.dashStyle="",c.lineCap&&(a.endcap=c.lineCap.replace("butt","flat")),c.lineJoin&&(a.joinstyle=c.lineJoin)):a&&(d.removeChild(a),this._stroke=null),c.fill?(b||(b=this._fill=this._createElement("fill"),d.appendChild(b)),b.color=c.fillColor||c.color,b.opacity=c.fillOpacity):b&&(d.removeChild(b),this._fill=null)},_updatePath:function(){var a=this._container.style;a.display="none",this._path.v=this.getPathString()+" ",a.display=""}}),f.Map.include(f.Browser.svg||!f.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var a=this._pathRoot=c.createElement("div");a.className="leaflet-vml-container",this._panes.overlayPane.appendChild(a),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),f.Browser.canvas=function(){return!!c.createElement("canvas").getContext}(),f.Path=f.Path.SVG&&!a.L_PREFER_CANVAS||!f.Browser.canvas?f.Path:f.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(a){return f.setOptions(this,a),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(a){a.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this.fire("remove"),this._map=null},_requestUpdate:function(){this._map&&!f.Path._updateRequest&&(f.Path._updateRequest=f.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){f.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var a=this.options;a.stroke&&(this._ctx.lineWidth=a.weight,this._ctx.strokeStyle=a.color),a.fill&&(this._ctx.fillStyle=a.fillColor||a.color),a.lineCap&&(this._ctx.lineCap=a.lineCap),a.lineJoin&&(this._ctx.lineJoin=a.lineJoin)},_drawPath:function(){var a,b,c,d,e,g;for(this._ctx.beginPath(),a=0,c=this._parts.length;c>a;a++){for(b=0,d=this._parts[a].length;d>b;b++)e=this._parts[a][b],g=(0===b?"move":"line")+"To",this._ctx[g](e.x,e.y);this instanceof f.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var a=this._ctx,b=this.options;this._drawPath(),a.save(),this._updateStyle(),b.fill&&(a.globalAlpha=b.fillOpacity,a.fill(b.fillRule||"evenodd")),b.stroke&&(a.globalAlpha=b.opacity,a.stroke()),a.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click dblclick contextmenu",this._fireMouseEvent,this))},_fireMouseEvent:function(a){this._containsPoint(a.layerPoint)&&this.fire(a.type,a)},_onMouseMove:function(a){this._map&&!this._map._animatingZoom&&(this._containsPoint(a.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",a)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",a)))}}),f.Map.include(f.Path.SVG&&!a.L_PREFER_CANVAS||!f.Browser.canvas?{}:{_initPathRoot:function(){var a,b=this._pathRoot;b||(b=this._pathRoot=c.createElement("canvas"),b.style.position="absolute",a=this._canvasCtx=b.getContext("2d"),a.lineCap="round",a.lineJoin="round",this._panes.overlayPane.appendChild(b),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var a=this._pathViewport,b=a.min,c=a.max.subtract(b),d=this._pathRoot;f.DomUtil.setPosition(d,b),d.width=c.x,d.height=c.y,d.getContext("2d").translate(-b.x,-b.y)}}}),f.LineUtil={simplify:function(a,b){if(!b||!a.length)return a.slice();var c=b*b;return a=this._reducePoints(a,c),a=this._simplifyDP(a,c)},pointToSegmentDistance:function(a,b,c){return Math.sqrt(this._sqClosestPointOnSegment(a,b,c,!0))},closestPointOnSegment:function(a,b,c){return this._sqClosestPointOnSegment(a,b,c)},_simplifyDP:function(a,b){var c=a.length,e=typeof Uint8Array!=d+""?Uint8Array:Array,f=new e(c);f[0]=f[c-1]=1,this._simplifyDPStep(a,f,b,0,c-1);var g,h=[];for(g=0;c>g;g++)f[g]&&h.push(a[g]);return h},_simplifyDPStep:function(a,b,c,d,e){var f,g,h,i=0;for(g=d+1;e-1>=g;g++)h=this._sqClosestPointOnSegment(a[g],a[d],a[e],!0),h>i&&(f=g,i=h);i>c&&(b[f]=1,this._simplifyDPStep(a,b,c,d,f),this._simplifyDPStep(a,b,c,f,e))},_reducePoints:function(a,b){for(var c=[a[0]],d=1,e=0,f=a.length;f>d;d++)this._sqDist(a[d],a[e])>b&&(c.push(a[d]),e=d);return f-1>e&&c.push(a[f-1]),c},clipSegment:function(a,b,c,d){var e,f,g,h=d?this._lastCode:this._getBitCode(a,c),i=this._getBitCode(b,c);for(this._lastCode=i;;){if(!(h|i))return[a,b];if(h&i)return!1;e=h||i,f=this._getEdgeIntersection(a,b,e,c),g=this._getBitCode(f,c),e===h?(a=f,h=g):(b=f,i=g)}},_getEdgeIntersection:function(a,b,c,d){var e=b.x-a.x,g=b.y-a.y,h=d.min,i=d.max;return 8&c?new f.Point(a.x+e*(i.y-a.y)/g,i.y):4&c?new f.Point(a.x+e*(h.y-a.y)/g,h.y):2&c?new f.Point(i.x,a.y+g*(i.x-a.x)/e):1&c?new f.Point(h.x,a.y+g*(h.x-a.x)/e):void 0},_getBitCode:function(a,b){var c=0;return a.x<b.min.x?c|=1:a.x>b.max.x&&(c|=2),a.y<b.min.y?c|=4:a.y>b.max.y&&(c|=8),c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqClosestPointOnSegment:function(a,b,c,d){var e,g=b.x,h=b.y,i=c.x-g,j=c.y-h,k=i*i+j*j;return k>0&&(e=((a.x-g)*i+(a.y-h)*j)/k,e>1?(g=c.x,h=c.y):e>0&&(g+=i*e,h+=j*e)),i=a.x-g,j=a.y-h,d?i*i+j*j:new f.Point(g,h)}},f.Polyline=f.Path.extend({initialize:function(a,b){f.Path.prototype.initialize.call(this,b),this._latlngs=this._convertLatLngs(a)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var a=0,b=this._latlngs.length;b>a;a++)this._originalPoints[a]=this._map.latLngToLayerPoint(this._latlngs[a])},getPathString:function(){for(var a=0,b=this._parts.length,c="";b>a;a++)c+=this._getPathPartStr(this._parts[a]);return c},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._latlngs=this._convertLatLngs(a),this.redraw()},addLatLng:function(a){return this._latlngs.push(f.latLng(a)),this.redraw()},spliceLatLngs:function(){var a=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),a},closestLayerPoint:function(a){for(var b,c,d=1/0,e=this._parts,g=null,h=0,i=e.length;i>h;h++)for(var j=e[h],k=1,l=j.length;l>k;k++){b=j[k-1],c=j[k];var m=f.LineUtil._sqClosestPointOnSegment(a,b,c,!0);d>m&&(d=m,g=f.LineUtil._sqClosestPointOnSegment(a,b,c))}return g&&(g.distance=Math.sqrt(d)),g},getBounds:function(){return new f.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(a,b){var c,d,e=b?a:[];for(c=0,d=a.length;d>c;c++){if(f.Util.isArray(a[c])&&"number"!=typeof a[c][0])return;e[c]=f.latLng(a[c])}return e},_initEvents:function(){f.Path.prototype._initEvents.call(this)},_getPathPartStr:function(a){for(var b,c=f.Path.VML,d=0,e=a.length,g="";e>d;d++)b=a[d],c&&b._round(),g+=(d?"L":"M")+b.x+" "+b.y;return g},_clipPoints:function(){var a,b,c,d=this._originalPoints,e=d.length;if(this.options.noClip)return void(this._parts=[d]);this._parts=[];var g=this._parts,h=this._map._pathViewport,i=f.LineUtil;for(a=0,b=0;e-1>a;a++)c=i.clipSegment(d[a],d[a+1],h,a),c&&(g[b]=g[b]||[],g[b].push(c[0]),(c[1]!==d[a+1]||a===e-2)&&(g[b].push(c[1]),b++))},_simplifyPoints:function(){for(var a=this._parts,b=f.LineUtil,c=0,d=a.length;d>c;c++)a[c]=b.simplify(a[c],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),f.Path.prototype._updatePath.call(this))}}),f.polyline=function(a,b){return new f.Polyline(a,b)},f.PolyUtil={},f.PolyUtil.clipPolygon=function(a,b){var c,d,e,g,h,i,j,k,l,m=[1,4,2,8],n=f.LineUtil;for(d=0,j=a.length;j>d;d++)a[d]._code=n._getBitCode(a[d],b);for(g=0;4>g;g++){for(k=m[g],c=[],d=0,j=a.length,e=j-1;j>d;e=d++)h=a[d],i=a[e],h._code&k?i._code&k||(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)):(i._code&k&&(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)),c.push(h));a=c}return a},f.Polygon=f.Polyline.extend({options:{fill:!0},initialize:function(a,b){f.Polyline.prototype.initialize.call(this,a,b),this._initWithHoles(a)},_initWithHoles:function(a){var b,c,d;if(a&&f.Util.isArray(a[0])&&"number"!=typeof a[0][0])for(this._latlngs=this._convertLatLngs(a[0]),this._holes=a.slice(1),b=0,c=this._holes.length;c>b;b++)d=this._holes[b]=this._convertLatLngs(this._holes[b]),d[0].equals(d[d.length-1])&&d.pop();a=this._latlngs,a.length>=2&&a[0].equals(a[a.length-1])&&a.pop()},projectLatlngs:function(){if(f.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var a,b,c,d;for(a=0,c=this._holes.length;c>a;a++)for(this._holePoints[a]=[],b=0,d=this._holes[a].length;d>b;b++)this._holePoints[a][b]=this._map.latLngToLayerPoint(this._holes[a][b])}},setLatLngs:function(a){return a&&f.Util.isArray(a[0])&&"number"!=typeof a[0][0]?(this._initWithHoles(a),this.redraw()):f.Polyline.prototype.setLatLngs.call(this,a)},_clipPoints:function(){var a=this._originalPoints,b=[];if(this._parts=[a].concat(this._holePoints),!this.options.noClip){for(var c=0,d=this._parts.length;d>c;c++){var e=f.PolyUtil.clipPolygon(this._parts[c],this._map._pathViewport);e.length&&b.push(e)}this._parts=b}},_getPathPartStr:function(a){var b=f.Polyline.prototype._getPathPartStr.call(this,a);return b+(f.Browser.svg?"z":"x")}}),f.polygon=function(a,b){return new f.Polygon(a,b)},function(){function a(a){return f.FeatureGroup.extend({initialize:function(a,b){this._layers={},this._options=b,this.setLatLngs(a)},setLatLngs:function(b){var c=0,d=b.length;for(this.eachLayer(function(a){d>c?a.setLatLngs(b[c++]):this.removeLayer(a)},this);d>c;)this.addLayer(new a(b[c++],this._options));return this},getLatLngs:function(){var a=[];return this.eachLayer(function(b){a.push(b.getLatLngs())}),a}})}f.MultiPolyline=a(f.Polyline),f.MultiPolygon=a(f.Polygon),f.multiPolyline=function(a,b){return new f.MultiPolyline(a,b)},f.multiPolygon=function(a,b){return new f.MultiPolygon(a,b)}}(),f.Rectangle=f.Polygon.extend({initialize:function(a,b){f.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(a),b)},setBounds:function(a){this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=f.latLngBounds(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}}),f.rectangle=function(a,b){return new f.Rectangle(a,b)},f.Circle=f.Path.extend({initialize:function(a,b,c){f.Path.prototype.initialize.call(this,c),this._latlng=f.latLng(a),this._mRadius=b},options:{fill:!0},setLatLng:function(a){return this._latlng=f.latLng(a),this.redraw()},setRadius:function(a){return this._mRadius=a,this.redraw()},projectLatlngs:function(){var a=this._getLngRadius(),b=this._latlng,c=this._map.latLngToLayerPoint([b.lat,b.lng-a]);this._point=this._map.latLngToLayerPoint(b),this._radius=Math.max(this._point.x-c.x,1);
  },getBounds:function(){var a=this._getLngRadius(),b=this._mRadius/40075017*360,c=this._latlng;return new f.LatLngBounds([c.lat-b,c.lng-a],[c.lat+b,c.lng+a])},getLatLng:function(){return this._latlng},getPathString:function(){var a=this._point,b=this._radius;return this._checkIfEmpty()?"":f.Browser.svg?"M"+a.x+","+(a.y-b)+"A"+b+","+b+",0,1,1,"+(a.x-.1)+","+(a.y-b)+" z":(a._round(),b=Math.round(b),"AL "+a.x+","+a.y+" "+b+","+b+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(f.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var a=this._map._pathViewport,b=this._radius,c=this._point;return c.x-b>a.max.x||c.y-b>a.max.y||c.x+b<a.min.x||c.y+b<a.min.y}}),f.circle=function(a,b,c){return new f.Circle(a,b,c)},f.CircleMarker=f.Circle.extend({options:{radius:10,weight:2},initialize:function(a,b){f.Circle.prototype.initialize.call(this,a,null,b),this._radius=this.options.radius},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},_updateStyle:function(){f.Circle.prototype._updateStyle.call(this),this.setRadius(this.options.radius)},setLatLng:function(a){return f.Circle.prototype.setLatLng.call(this,a),this._popup&&this._popup._isOpen&&this._popup.setLatLng(a),this},setRadius:function(a){return this.options.radius=this._radius=a,this.redraw()},getRadius:function(){return this._radius}}),f.circleMarker=function(a,b){return new f.CircleMarker(a,b)},f.Polyline.include(f.Path.CANVAS?{_containsPoint:function(a,b){var c,d,e,g,h,i,j,k=this.options.weight/2;for(f.Browser.touch&&(k+=10),c=0,g=this._parts.length;g>c;c++)for(j=this._parts[c],d=0,h=j.length,e=h-1;h>d;e=d++)if((b||0!==d)&&(i=f.LineUtil.pointToSegmentDistance(a,j[e],j[d]),k>=i))return!0;return!1}}:{}),f.Polygon.include(f.Path.CANVAS?{_containsPoint:function(a){var b,c,d,e,g,h,i,j,k=!1;if(f.Polyline.prototype._containsPoint.call(this,a,!0))return!0;for(e=0,i=this._parts.length;i>e;e++)for(b=this._parts[e],g=0,j=b.length,h=j-1;j>g;h=g++)c=b[g],d=b[h],c.y>a.y!=d.y>a.y&&a.x<(d.x-c.x)*(a.y-c.y)/(d.y-c.y)+c.x&&(k=!k);return k}}:{}),f.Circle.include(f.Path.CANVAS?{_drawPath:function(){var a=this._point;this._ctx.beginPath(),this._ctx.arc(a.x,a.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(a){var b=this._point,c=this.options.stroke?this.options.weight/2:0;return a.distanceTo(b)<=this._radius+c}}:{}),f.CircleMarker.include(f.Path.CANVAS?{_updateStyle:function(){f.Path.prototype._updateStyle.call(this)}}:{}),f.GeoJSON=f.FeatureGroup.extend({initialize:function(a,b){f.setOptions(this,b),this._layers={},a&&this.addData(a)},addData:function(a){var b,c,d,e=f.Util.isArray(a)?a:a.features;if(e){for(b=0,c=e.length;c>b;b++)d=e[b],(d.geometries||d.geometry||d.features||d.coordinates)&&this.addData(e[b]);return this}var g=this.options;if(!g.filter||g.filter(a)){var h=f.GeoJSON.geometryToLayer(a,g.pointToLayer,g.coordsToLatLng,g);return h.feature=f.GeoJSON.asFeature(a),h.defaultOptions=h.options,this.resetStyle(h),g.onEachFeature&&g.onEachFeature(a,h),this.addLayer(h)}},resetStyle:function(a){var b=this.options.style;b&&(f.Util.extend(a.options,a.defaultOptions),this._setLayerStyle(a,b))},setStyle:function(a){this.eachLayer(function(b){this._setLayerStyle(b,a)},this)},_setLayerStyle:function(a,b){"function"==typeof b&&(b=b(a.feature)),a.setStyle&&a.setStyle(b)}}),f.extend(f.GeoJSON,{geometryToLayer:function(a,b,c,d){var e,g,h,i,j="Feature"===a.type?a.geometry:a,k=j.coordinates,l=[];switch(c=c||this.coordsToLatLng,j.type){case"Point":return e=c(k),b?b(a,e):new f.Marker(e);case"MultiPoint":for(h=0,i=k.length;i>h;h++)e=c(k[h]),l.push(b?b(a,e):new f.Marker(e));return new f.FeatureGroup(l);case"LineString":return g=this.coordsToLatLngs(k,0,c),new f.Polyline(g,d);case"Polygon":if(2===k.length&&!k[1].length)throw new Error("Invalid GeoJSON object.");return g=this.coordsToLatLngs(k,1,c),new f.Polygon(g,d);case"MultiLineString":return g=this.coordsToLatLngs(k,1,c),new f.MultiPolyline(g,d);case"MultiPolygon":return g=this.coordsToLatLngs(k,2,c),new f.MultiPolygon(g,d);case"GeometryCollection":for(h=0,i=j.geometries.length;i>h;h++)l.push(this.geometryToLayer({geometry:j.geometries[h],type:"Feature",properties:a.properties},b,c,d));return new f.FeatureGroup(l);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(a){return new f.LatLng(a[1],a[0],a[2])},coordsToLatLngs:function(a,b,c){var d,e,f,g=[];for(e=0,f=a.length;f>e;e++)d=b?this.coordsToLatLngs(a[e],b-1,c):(c||this.coordsToLatLng)(a[e]),g.push(d);return g},latLngToCoords:function(a){var b=[a.lng,a.lat];return a.alt!==d&&b.push(a.alt),b},latLngsToCoords:function(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(f.GeoJSON.latLngToCoords(a[c]));return b},getFeature:function(a,b){return a.feature?f.extend({},a.feature,{geometry:b}):f.GeoJSON.asFeature(b)},asFeature:function(a){return"Feature"===a.type?a:{type:"Feature",properties:{},geometry:a}}});var h={toGeoJSON:function(){return f.GeoJSON.getFeature(this,{type:"Point",coordinates:f.GeoJSON.latLngToCoords(this.getLatLng())})}};f.Marker.include(h),f.Circle.include(h),f.CircleMarker.include(h),f.Polyline.include({toGeoJSON:function(){return f.GeoJSON.getFeature(this,{type:"LineString",coordinates:f.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),f.Polygon.include({toGeoJSON:function(){var a,b,c,d=[f.GeoJSON.latLngsToCoords(this.getLatLngs())];if(d[0].push(d[0][0]),this._holes)for(a=0,b=this._holes.length;b>a;a++)c=f.GeoJSON.latLngsToCoords(this._holes[a]),c.push(c[0]),d.push(c);return f.GeoJSON.getFeature(this,{type:"Polygon",coordinates:d})}}),function(){function a(a){return function(){var b=[];return this.eachLayer(function(a){b.push(a.toGeoJSON().geometry.coordinates)}),f.GeoJSON.getFeature(this,{type:a,coordinates:b})}}f.MultiPolyline.include({toGeoJSON:a("MultiLineString")}),f.MultiPolygon.include({toGeoJSON:a("MultiPolygon")}),f.LayerGroup.include({toGeoJSON:function(){var b,c=this.feature&&this.feature.geometry,d=[];if(c&&"MultiPoint"===c.type)return a("MultiPoint").call(this);var e=c&&"GeometryCollection"===c.type;return this.eachLayer(function(a){a.toGeoJSON&&(b=a.toGeoJSON(),d.push(e?b.geometry:f.GeoJSON.asFeature(b)))}),e?f.GeoJSON.getFeature(this,{geometries:d,type:"GeometryCollection"}):{type:"FeatureCollection",features:d}}})}(),f.geoJson=function(a,b){return new f.GeoJSON(a,b)},f.DomEvent={addListener:function(a,b,c,d){var e,g,h,i=f.stamp(c),j="_leaflet_"+b+i;return a[j]?this:(e=function(b){return c.call(d||a,b||f.DomEvent._getEvent())},f.Browser.pointer&&0===b.indexOf("touch")?this.addPointerListener(a,b,e,i):(f.Browser.touch&&"dblclick"===b&&this.addDoubleTapListener&&this.addDoubleTapListener(a,e,i),"addEventListener"in a?"mousewheel"===b?(a.addEventListener("DOMMouseScroll",e,!1),a.addEventListener(b,e,!1)):"mouseenter"===b||"mouseleave"===b?(g=e,h="mouseenter"===b?"mouseover":"mouseout",e=function(b){return f.DomEvent._checkMouse(a,b)?g(b):void 0},a.addEventListener(h,e,!1)):"click"===b&&f.Browser.android?(g=e,e=function(a){return f.DomEvent._filterClick(a,g)},a.addEventListener(b,e,!1)):a.addEventListener(b,e,!1):"attachEvent"in a&&a.attachEvent("on"+b,e),a[j]=e,this))},removeListener:function(a,b,c){var d=f.stamp(c),e="_leaflet_"+b+d,g=a[e];return g?(f.Browser.pointer&&0===b.indexOf("touch")?this.removePointerListener(a,b,d):f.Browser.touch&&"dblclick"===b&&this.removeDoubleTapListener?this.removeDoubleTapListener(a,d):"removeEventListener"in a?"mousewheel"===b?(a.removeEventListener("DOMMouseScroll",g,!1),a.removeEventListener(b,g,!1)):"mouseenter"===b||"mouseleave"===b?a.removeEventListener("mouseenter"===b?"mouseover":"mouseout",g,!1):a.removeEventListener(b,g,!1):"detachEvent"in a&&a.detachEvent("on"+b,g),a[e]=null,this):this},stopPropagation:function(a){return a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,f.DomEvent._skipped(a),this},disableScrollPropagation:function(a){var b=f.DomEvent.stopPropagation;return f.DomEvent.on(a,"mousewheel",b).on(a,"MozMousePixelScroll",b)},disableClickPropagation:function(a){for(var b=f.DomEvent.stopPropagation,c=f.Draggable.START.length-1;c>=0;c--)f.DomEvent.on(a,f.Draggable.START[c],b);return f.DomEvent.on(a,"click",f.DomEvent._fakeStop).on(a,"dblclick",b)},preventDefault:function(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this},stop:function(a){return f.DomEvent.preventDefault(a).stopPropagation(a)},getMousePosition:function(a,b){if(!b)return new f.Point(a.clientX,a.clientY);var c=b.getBoundingClientRect();return new f.Point(a.clientX-c.left-b.clientLeft,a.clientY-c.top-b.clientTop)},getWheelDelta:function(a){var b=0;return a.wheelDelta&&(b=a.wheelDelta/120),a.detail&&(b=-a.detail/3),b},_skipEvents:{},_fakeStop:function(a){f.DomEvent._skipEvents[a.type]=!0},_skipped:function(a){var b=this._skipEvents[a.type];return this._skipEvents[a.type]=!1,b},_checkMouse:function(a,b){var c=b.relatedTarget;if(!c)return!0;try{for(;c&&c!==a;)c=c.parentNode}catch(d){return!1}return c!==a},_getEvent:function(){var b=a.event;if(!b)for(var c=arguments.callee.caller;c&&(b=c.arguments[0],!b||a.Event!==b.constructor);)c=c.caller;return b},_filterClick:function(a,b){var c=a.timeStamp||a.originalEvent.timeStamp,d=f.DomEvent._lastClick&&c-f.DomEvent._lastClick;return d&&d>100&&500>d||a.target._simulatedClick&&!a._simulated?void f.DomEvent.stop(a):(f.DomEvent._lastClick=c,b(a))}},f.DomEvent.on=f.DomEvent.addListener,f.DomEvent.off=f.DomEvent.removeListener,f.Draggable=f.Class.extend({includes:f.Mixin.Events,statics:{START:f.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(a,b){this._element=a,this._dragStartTarget=b||a},enable:function(){if(!this._enabled){for(var a=f.Draggable.START.length-1;a>=0;a--)f.DomEvent.on(this._dragStartTarget,f.Draggable.START[a],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var a=f.Draggable.START.length-1;a>=0;a--)f.DomEvent.off(this._dragStartTarget,f.Draggable.START[a],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(a){if(this._moved=!1,!(a.shiftKey||1!==a.which&&1!==a.button&&!a.touches||(f.DomEvent.stopPropagation(a),f.Draggable._disabled||(f.DomUtil.disableImageDrag(),f.DomUtil.disableTextSelection(),this._moving)))){var b=a.touches?a.touches[0]:a;this._startPoint=new f.Point(b.clientX,b.clientY),this._startPos=this._newPos=f.DomUtil.getPosition(this._element),f.DomEvent.on(c,f.Draggable.MOVE[a.type],this._onMove,this).on(c,f.Draggable.END[a.type],this._onUp,this)}},_onMove:function(a){if(a.touches&&a.touches.length>1)return void(this._moved=!0);var b=a.touches&&1===a.touches.length?a.touches[0]:a,d=new f.Point(b.clientX,b.clientY),e=d.subtract(this._startPoint);(e.x||e.y)&&(f.Browser.touch&&Math.abs(e.x)+Math.abs(e.y)<3||(f.DomEvent.preventDefault(a),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=f.DomUtil.getPosition(this._element).subtract(e),f.DomUtil.addClass(c.body,"leaflet-dragging"),this._lastTarget=a.target||a.srcElement,f.DomUtil.addClass(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,f.Util.cancelAnimFrame(this._animRequest),this._animRequest=f.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)))},_updatePosition:function(){this.fire("predrag"),f.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(){f.DomUtil.removeClass(c.body,"leaflet-dragging"),this._lastTarget&&(f.DomUtil.removeClass(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var a in f.Draggable.MOVE)f.DomEvent.off(c,f.Draggable.MOVE[a],this._onMove).off(c,f.Draggable.END[a],this._onUp);f.DomUtil.enableImageDrag(),f.DomUtil.enableTextSelection(),this._moved&&this._moving&&(f.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),f.Handler=f.Class.extend({initialize:function(a){this._map=a},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),f.Map.mergeOptions({dragging:!0,inertia:!f.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:f.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),f.Map.Drag=f.Handler.extend({addHooks:function(){if(!this._draggable){var a=this._map;this._draggable=new f.Draggable(a._mapPane,a._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),a.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),a.on("viewreset",this._onViewReset,this),a.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var a=this._map;a._panAnim&&a._panAnim.stop(),a.fire("movestart").fire("dragstart"),a.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var a=this._lastTime=+new Date,b=this._lastPos=this._draggable._newPos;this._positions.push(b),this._times.push(a),a-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var a=this._map.getSize()._divideBy(2),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(a).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var a=this._worldWidth,b=Math.round(a/2),c=this._initialWorldOffset,d=this._draggable._newPos.x,e=(d-b+c)%a+b-c,f=(d+b+c)%a-b-c,g=Math.abs(e+c)<Math.abs(f+c)?e:f;this._draggable._newPos.x=g},_onDragEnd:function(a){var b=this._map,c=b.options,d=+new Date-this._lastTime,e=!c.inertia||d>c.inertiaThreshold||!this._positions[0];if(b.fire("dragend",a),e)b.fire("moveend");else{var g=this._lastPos.subtract(this._positions[0]),h=(this._lastTime+d-this._times[0])/1e3,i=c.easeLinearity,j=g.multiplyBy(i/h),k=j.distanceTo([0,0]),l=Math.min(c.inertiaMaxSpeed,k),m=j.multiplyBy(l/k),n=l/(c.inertiaDeceleration*i),o=m.multiplyBy(-n/2).round();o.x&&o.y?(o=b._limitOffset(o,b.options.maxBounds),f.Util.requestAnimFrame(function(){b.panBy(o,{duration:n,easeLinearity:i,noMoveStart:!0})})):b.fire("moveend")}}}),f.Map.addInitHook("addHandler","dragging",f.Map.Drag),f.Map.mergeOptions({doubleClickZoom:!0}),f.Map.DoubleClickZoom=f.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(a){var b=this._map,c=b.getZoom()+(a.originalEvent.shiftKey?-1:1);"center"===b.options.doubleClickZoom?b.setZoom(c):b.setZoomAround(a.containerPoint,c)}}),f.Map.addInitHook("addHandler","doubleClickZoom",f.Map.DoubleClickZoom),f.Map.mergeOptions({scrollWheelZoom:!0}),f.Map.ScrollWheelZoom=f.Handler.extend({addHooks:function(){f.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),f.DomEvent.on(this._map._container,"MozMousePixelScroll",f.DomEvent.preventDefault),this._delta=0},removeHooks:function(){f.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),f.DomEvent.off(this._map._container,"MozMousePixelScroll",f.DomEvent.preventDefault)},_onWheelScroll:function(a){var b=f.DomEvent.getWheelDelta(a);this._delta+=b,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var c=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(f.bind(this._performZoom,this),c),f.DomEvent.preventDefault(a),f.DomEvent.stopPropagation(a)},_performZoom:function(){var a=this._map,b=this._delta,c=a.getZoom();b=b>0?Math.ceil(b):Math.floor(b),b=Math.max(Math.min(b,4),-4),b=a._limitZoom(c+b)-c,this._delta=0,this._startTime=null,b&&("center"===a.options.scrollWheelZoom?a.setZoom(c+b):a.setZoomAround(this._lastMousePos,c+b))}}),f.Map.addInitHook("addHandler","scrollWheelZoom",f.Map.ScrollWheelZoom),f.extend(f.DomEvent,{_touchstart:f.Browser.msPointer?"MSPointerDown":f.Browser.pointer?"pointerdown":"touchstart",_touchend:f.Browser.msPointer?"MSPointerUp":f.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(a,b,d){function e(a){var b;if(f.Browser.pointer?(o.push(a.pointerId),b=o.length):b=a.touches.length,!(b>1)){var c=Date.now(),d=c-(h||c);i=a.touches?a.touches[0]:a,j=d>0&&k>=d,h=c}}function g(a){if(f.Browser.pointer){var c=o.indexOf(a.pointerId);if(-1===c)return;o.splice(c,1)}if(j){if(f.Browser.pointer){var d,e={};for(var g in i)d=i[g],"function"==typeof d?e[g]=d.bind(i):e[g]=d;i=e}i.type="dblclick",b(i),h=null}}var h,i,j=!1,k=250,l="_leaflet_",m=this._touchstart,n=this._touchend,o=[];a[l+m+d]=e,a[l+n+d]=g;var p=f.Browser.pointer?c.documentElement:a;return a.addEventListener(m,e,!1),p.addEventListener(n,g,!1),f.Browser.pointer&&p.addEventListener(f.DomEvent.POINTER_CANCEL,g,!1),this},removeDoubleTapListener:function(a,b){var d="_leaflet_";return a.removeEventListener(this._touchstart,a[d+this._touchstart+b],!1),(f.Browser.pointer?c.documentElement:a).removeEventListener(this._touchend,a[d+this._touchend+b],!1),f.Browser.pointer&&c.documentElement.removeEventListener(f.DomEvent.POINTER_CANCEL,a[d+this._touchend+b],!1),this}}),f.extend(f.DomEvent,{POINTER_DOWN:f.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:f.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:f.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:f.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(a,b,c,d){switch(b){case"touchstart":return this.addPointerListenerStart(a,b,c,d);case"touchend":return this.addPointerListenerEnd(a,b,c,d);case"touchmove":return this.addPointerListenerMove(a,b,c,d);default:throw"Unknown touch event type"}},addPointerListenerStart:function(a,b,d,e){var g="_leaflet_",h=this._pointers,i=function(a){"mouse"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_MOUSE&&f.DomEvent.preventDefault(a);for(var b=!1,c=0;c<h.length;c++)if(h[c].pointerId===a.pointerId){b=!0;break}b||h.push(a),a.touches=h.slice(),a.changedTouches=[a],d(a)};if(a[g+"touchstart"+e]=i,a.addEventListener(this.POINTER_DOWN,i,!1),!this._pointerDocumentListener){var j=function(a){for(var b=0;b<h.length;b++)if(h[b].pointerId===a.pointerId){h.splice(b,1);break}};c.documentElement.addEventListener(this.POINTER_UP,j,!1),c.documentElement.addEventListener(this.POINTER_CANCEL,j,!1),this._pointerDocumentListener=!0}return this},addPointerListenerMove:function(a,b,c,d){function e(a){if(a.pointerType!==a.MSPOINTER_TYPE_MOUSE&&"mouse"!==a.pointerType||0!==a.buttons){for(var b=0;b<g.length;b++)if(g[b].pointerId===a.pointerId){g[b]=a;break}a.touches=g.slice(),a.changedTouches=[a],c(a)}}var f="_leaflet_",g=this._pointers;return a[f+"touchmove"+d]=e,a.addEventListener(this.POINTER_MOVE,e,!1),this},addPointerListenerEnd:function(a,b,c,d){var e="_leaflet_",f=this._pointers,g=function(a){for(var b=0;b<f.length;b++)if(f[b].pointerId===a.pointerId){f.splice(b,1);break}a.touches=f.slice(),a.changedTouches=[a],c(a)};return a[e+"touchend"+d]=g,a.addEventListener(this.POINTER_UP,g,!1),a.addEventListener(this.POINTER_CANCEL,g,!1),this},removePointerListener:function(a,b,c){var d="_leaflet_",e=a[d+b+c];switch(b){case"touchstart":a.removeEventListener(this.POINTER_DOWN,e,!1);break;case"touchmove":a.removeEventListener(this.POINTER_MOVE,e,!1);break;case"touchend":a.removeEventListener(this.POINTER_UP,e,!1),a.removeEventListener(this.POINTER_CANCEL,e,!1)}return this}}),f.Map.mergeOptions({touchZoom:f.Browser.touch&&!f.Browser.android23,bounceAtZoomLimits:!0}),f.Map.TouchZoom=f.Handler.extend({addHooks:function(){f.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){f.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(a){var b=this._map;if(a.touches&&2===a.touches.length&&!b._animatingZoom&&!this._zooming){var d=b.mouseEventToLayerPoint(a.touches[0]),e=b.mouseEventToLayerPoint(a.touches[1]),g=b._getCenterLayerPoint();this._startCenter=d.add(e)._divideBy(2),this._startDist=d.distanceTo(e),this._moved=!1,this._zooming=!0,this._centerOffset=g.subtract(this._startCenter),b._panAnim&&b._panAnim.stop(),f.DomEvent.on(c,"touchmove",this._onTouchMove,this).on(c,"touchend",this._onTouchEnd,this),f.DomEvent.preventDefault(a)}},_onTouchMove:function(a){var b=this._map;if(a.touches&&2===a.touches.length&&this._zooming){var c=b.mouseEventToLayerPoint(a.touches[0]),d=b.mouseEventToLayerPoint(a.touches[1]);this._scale=c.distanceTo(d)/this._startDist,this._delta=c._add(d)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(b.options.bounceAtZoomLimits||!(b.getZoom()===b.getMinZoom()&&this._scale<1||b.getZoom()===b.getMaxZoom()&&this._scale>1))&&(this._moved||(f.DomUtil.addClass(b._mapPane,"leaflet-touching"),b.fire("movestart").fire("zoomstart"),this._moved=!0),f.Util.cancelAnimFrame(this._animRequest),this._animRequest=f.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),f.DomEvent.preventDefault(a))}},_updateOnMove:function(){var a=this._map,b=this._getScaleOrigin(),c=a.layerPointToLatLng(b),d=a.getScaleZoom(this._scale);a._animateZoom(c,d,this._startCenter,this._scale,this._delta,!1,!0)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return void(this._zooming=!1);var a=this._map;this._zooming=!1,f.DomUtil.removeClass(a._mapPane,"leaflet-touching"),f.Util.cancelAnimFrame(this._animRequest),f.DomEvent.off(c,"touchmove",this._onTouchMove).off(c,"touchend",this._onTouchEnd);var b=this._getScaleOrigin(),d=a.layerPointToLatLng(b),e=a.getZoom(),g=a.getScaleZoom(this._scale)-e,h=g>0?Math.ceil(g):Math.floor(g),i=a._limitZoom(e+h),j=a.getZoomScale(i)/this._scale;a._animateZoom(d,i,b,j)},_getScaleOrigin:function(){var a=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(a)}}),f.Map.addInitHook("addHandler","touchZoom",f.Map.TouchZoom),f.Map.mergeOptions({tap:!0,tapTolerance:15}),f.Map.Tap=f.Handler.extend({addHooks:function(){f.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){f.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(a){if(a.touches){if(f.DomEvent.preventDefault(a),this._fireClick=!0,a.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var b=a.touches[0],d=b.target;this._startPos=this._newPos=new f.Point(b.clientX,b.clientY),d.tagName&&"a"===d.tagName.toLowerCase()&&f.DomUtil.addClass(d,"leaflet-active"),this._holdTimeout=setTimeout(f.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",b))},this),1e3),f.DomEvent.on(c,"touchmove",this._onMove,this).on(c,"touchend",this._onUp,this)}},_onUp:function(a){if(clearTimeout(this._holdTimeout),f.DomEvent.off(c,"touchmove",this._onMove,this).off(c,"touchend",this._onUp,this),this._fireClick&&a&&a.changedTouches){var b=a.changedTouches[0],d=b.target;d&&d.tagName&&"a"===d.tagName.toLowerCase()&&f.DomUtil.removeClass(d,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",b)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(a){var b=a.touches[0];this._newPos=new f.Point(b.clientX,b.clientY)},_simulateEvent:function(b,d){var e=c.createEvent("MouseEvents");e._simulated=!0,d.target._simulatedClick=!0,e.initMouseEvent(b,!0,!0,a,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),d.target.dispatchEvent(e)}}),f.Browser.touch&&!f.Browser.pointer&&f.Map.addInitHook("addHandler","tap",f.Map.Tap),f.Map.mergeOptions({boxZoom:!0}),f.Map.BoxZoom=f.Handler.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane,this._moved=!1},addHooks:function(){f.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){f.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(a){return this._moved=!1,!a.shiftKey||1!==a.which&&1!==a.button?!1:(f.DomUtil.disableTextSelection(),f.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(a),void f.DomEvent.on(c,"mousemove",this._onMouseMove,this).on(c,"mouseup",this._onMouseUp,this).on(c,"keydown",this._onKeyDown,this))},_onMouseMove:function(a){this._moved||(this._box=f.DomUtil.create("div","leaflet-zoom-box",this._pane),f.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var b=this._startLayerPoint,c=this._box,d=this._map.mouseEventToLayerPoint(a),e=d.subtract(b),g=new f.Point(Math.min(d.x,b.x),Math.min(d.y,b.y));f.DomUtil.setPosition(c,g),this._moved=!0,c.style.width=Math.max(0,Math.abs(e.x)-4)+"px",c.style.height=Math.max(0,Math.abs(e.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),f.DomUtil.enableTextSelection(),f.DomUtil.enableImageDrag(),f.DomEvent.off(c,"mousemove",this._onMouseMove).off(c,"mouseup",this._onMouseUp).off(c,"keydown",this._onKeyDown)},_onMouseUp:function(a){this._finish();var b=this._map,c=b.mouseEventToLayerPoint(a);if(!this._startLayerPoint.equals(c)){var d=new f.LatLngBounds(b.layerPointToLatLng(this._startLayerPoint),b.layerPointToLatLng(c));b.fitBounds(d),b.fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){27===a.keyCode&&this._finish()}}),f.Map.addInitHook("addHandler","boxZoom",f.Map.BoxZoom),f.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),f.Map.Keyboard=f.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(a){this._map=a,this._setPanOffset(a.options.keyboardPanOffset),this._setZoomOffset(a.options.keyboardZoomOffset)},addHooks:function(){var a=this._map._container;-1===a.tabIndex&&(a.tabIndex="0"),f.DomEvent.on(a,"focus",this._onFocus,this).on(a,"blur",this._onBlur,this).on(a,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var a=this._map._container;f.DomEvent.off(a,"focus",this._onFocus,this).off(a,"blur",this._onBlur,this).off(a,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var b=c.body,d=c.documentElement,e=b.scrollTop||d.scrollTop,f=b.scrollLeft||d.scrollLeft;this._map._container.focus(),a.scrollTo(f,e)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(a){var b,c,d=this._panKeys={},e=this.keyCodes;for(b=0,c=e.left.length;c>b;b++)d[e.left[b]]=[-1*a,0];for(b=0,c=e.right.length;c>b;b++)d[e.right[b]]=[a,0];for(b=0,c=e.down.length;c>b;b++)d[e.down[b]]=[0,a];for(b=0,c=e.up.length;c>b;b++)d[e.up[b]]=[0,-1*a]},_setZoomOffset:function(a){var b,c,d=this._zoomKeys={},e=this.keyCodes;for(b=0,c=e.zoomIn.length;c>b;b++)d[e.zoomIn[b]]=a;for(b=0,c=e.zoomOut.length;c>b;b++)d[e.zoomOut[b]]=-a},_addHooks:function(){f.DomEvent.on(c,"keydown",this._onKeyDown,this)},_removeHooks:function(){f.DomEvent.off(c,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){var b=a.keyCode,c=this._map;if(b in this._panKeys){if(c._panAnim&&c._panAnim._inProgress)return;c.panBy(this._panKeys[b]),c.options.maxBounds&&c.panInsideBounds(c.options.maxBounds)}else{if(!(b in this._zoomKeys))return;c.setZoom(c.getZoom()+this._zoomKeys[b])}f.DomEvent.stop(a)}}),f.Map.addInitHook("addHandler","keyboard",f.Map.Keyboard),f.Handler.MarkerDrag=f.Handler.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new f.Draggable(a,a)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),f.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),f.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var a=this._marker,b=a._shadow,c=f.DomUtil.getPosition(a._icon),d=a._map.layerPointToLatLng(c);b&&f.DomUtil.setPosition(b,c),a._latlng=d,a.fire("move",{latlng:d}).fire("drag")},_onDragEnd:function(a){this._marker.fire("moveend").fire("dragend",a)}}),f.Control=f.Class.extend({options:{position:"topright"},initialize:function(a){f.setOptions(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var b=this._map;return b&&b.removeControl(this),this.options.position=a,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this._map=a;var b=this._container=this.onAdd(a),c=this.getPosition(),d=a._controlCorners[c];return f.DomUtil.addClass(b,"leaflet-control"),-1!==c.indexOf("bottom")?d.insertBefore(b,d.firstChild):d.appendChild(b),this},removeFrom:function(a){var b=this.getPosition(),c=a._controlCorners[b];return c.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(a),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),f.control=function(a){return new f.Control(a)},f.Map.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.removeFrom(this),this},_initControlPos:function(){function a(a,e){var g=c+a+" "+c+e;b[a+e]=f.DomUtil.create("div",g,d)}var b=this._controlCorners={},c="leaflet-",d=this._controlContainer=f.DomUtil.create("div",c+"control-container",this._container);a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),f.Control.Zoom=f.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(a){var b="leaflet-control-zoom",c=f.DomUtil.create("div",b+" leaflet-bar");return this._map=a,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,b+"-in",c,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,b+"-out",c,this._zoomOut,this),this._updateDisabled(),a.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(a){this._map.zoomIn(a.shiftKey?3:1)},_zoomOut:function(a){this._map.zoomOut(a.shiftKey?3:1)},_createButton:function(a,b,c,d,e,g){var h=f.DomUtil.create("a",c,d);h.innerHTML=a,h.href="#",h.title=b;var i=f.DomEvent.stopPropagation;return f.DomEvent.on(h,"click",i).on(h,"mousedown",i).on(h,"dblclick",i).on(h,"click",f.DomEvent.preventDefault).on(h,"click",e,g).on(h,"click",this._refocusOnMap,g),h},_updateDisabled:function(){var a=this._map,b="leaflet-disabled";f.DomUtil.removeClass(this._zoomInButton,b),f.DomUtil.removeClass(this._zoomOutButton,b),a._zoom===a.getMinZoom()&&f.DomUtil.addClass(this._zoomOutButton,b),a._zoom===a.getMaxZoom()&&f.DomUtil.addClass(this._zoomInButton,b)}}),f.Map.mergeOptions({zoomControl:!0}),f.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new f.Control.Zoom,this.addControl(this.zoomControl))}),f.control.zoom=function(a){return new f.Control.Zoom(a);
  },f.Control.Attribution=f.Control.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(a){f.setOptions(this,a),this._attributions={}},onAdd:function(a){this._container=f.DomUtil.create("div","leaflet-control-attribution"),f.DomEvent.disableClickPropagation(this._container);for(var b in a._layers)a._layers[b].getAttribution&&this.addAttribution(a._layers[b].getAttribution());return a.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(a){a.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):void 0},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):void 0},_update:function(){if(this._map){var a=[];for(var b in this._attributions)this._attributions[b]&&a.push(b);var c=[];this.options.prefix&&c.push(this.options.prefix),a.length&&c.push(a.join(", ")),this._container.innerHTML=c.join(" | ")}},_onLayerAdd:function(a){a.layer.getAttribution&&this.addAttribution(a.layer.getAttribution())},_onLayerRemove:function(a){a.layer.getAttribution&&this.removeAttribution(a.layer.getAttribution())}}),f.Map.mergeOptions({attributionControl:!0}),f.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new f.Control.Attribution).addTo(this))}),f.control.attribution=function(a){return new f.Control.Attribution(a)},f.Control.Scale=f.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(a){this._map=a;var b="leaflet-control-scale",c=f.DomUtil.create("div",b),d=this.options;return this._addScales(d,b,c),a.on(d.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),c},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,b,c){a.metric&&(this._mScale=f.DomUtil.create("div",b+"-line",c)),a.imperial&&(this._iScale=f.DomUtil.create("div",b+"-line",c))},_update:function(){var a=this._map.getBounds(),b=a.getCenter().lat,c=6378137*Math.PI*Math.cos(b*Math.PI/180),d=c*(a.getNorthEast().lng-a.getSouthWest().lng)/180,e=this._map.getSize(),f=this.options,g=0;e.x>0&&(g=d*(f.maxWidth/e.x)),this._updateScales(f,g)},_updateScales:function(a,b){a.metric&&b&&this._updateMetric(b),a.imperial&&b&&this._updateImperial(b)},_updateMetric:function(a){var b=this._getRoundNum(a);this._mScale.style.width=this._getScaleWidth(b/a)+"px",this._mScale.innerHTML=1e3>b?b+" m":b/1e3+" km"},_updateImperial:function(a){var b,c,d,e=3.2808399*a,f=this._iScale;e>5280?(b=e/5280,c=this._getRoundNum(b),f.style.width=this._getScaleWidth(c/b)+"px",f.innerHTML=c+" mi"):(d=this._getRoundNum(e),f.style.width=this._getScaleWidth(d/e)+"px",f.innerHTML=d+" ft")},_getScaleWidth:function(a){return Math.round(this.options.maxWidth*a)-10},_getRoundNum:function(a){var b=Math.pow(10,(Math.floor(a)+"").length-1),c=a/b;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,b*c}}),f.control.scale=function(a){return new f.Control.Scale(a)},f.Control.Layers=f.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(a,b,c){f.setOptions(this,c),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var d in a)this._addLayer(a[d],d);for(d in b)this._addLayer(b[d],d,!0)},onAdd:function(a){return this._initLayout(),this._update(),a.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(a){a.off("layeradd",this._onLayerChange,this).off("layerremove",this._onLayerChange,this)},addBaseLayer:function(a,b){return this._addLayer(a,b),this._update(),this},addOverlay:function(a,b){return this._addLayer(a,b,!0),this._update(),this},removeLayer:function(a){var b=f.stamp(a);return delete this._layers[b],this._update(),this},_initLayout:function(){var a="leaflet-control-layers",b=this._container=f.DomUtil.create("div",a);b.setAttribute("aria-haspopup",!0),f.Browser.touch?f.DomEvent.on(b,"click",f.DomEvent.stopPropagation):f.DomEvent.disableClickPropagation(b).disableScrollPropagation(b);var c=this._form=f.DomUtil.create("form",a+"-list");if(this.options.collapsed){f.Browser.android||f.DomEvent.on(b,"mouseover",this._expand,this).on(b,"mouseout",this._collapse,this);var d=this._layersLink=f.DomUtil.create("a",a+"-toggle",b);d.href="#",d.title="Layers",f.Browser.touch?f.DomEvent.on(d,"click",f.DomEvent.stop).on(d,"click",this._expand,this):f.DomEvent.on(d,"focus",this._expand,this),f.DomEvent.on(c,"click",function(){setTimeout(f.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=f.DomUtil.create("div",a+"-base",c),this._separator=f.DomUtil.create("div",a+"-separator",c),this._overlaysList=f.DomUtil.create("div",a+"-overlays",c),b.appendChild(c)},_addLayer:function(a,b,c){var d=f.stamp(a);this._layers[d]={layer:a,name:b,overlay:c},this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var a,b,c=!1,d=!1;for(a in this._layers)b=this._layers[a],this._addItem(b),d=d||b.overlay,c=c||!b.overlay;this._separator.style.display=d&&c?"":"none"}},_onLayerChange:function(a){var b=this._layers[f.stamp(a.layer)];if(b){this._handlingClick||this._update();var c=b.overlay?"layeradd"===a.type?"overlayadd":"overlayremove":"layeradd"===a.type?"baselayerchange":null;c&&this._map.fire(c,b)}},_createRadioElement:function(a,b){var d='<input type="radio" class="leaflet-control-layers-selector" name="'+a+'"';b&&(d+=' checked="checked"'),d+="/>";var e=c.createElement("div");return e.innerHTML=d,e.firstChild},_addItem:function(a){var b,d=c.createElement("label"),e=this._map.hasLayer(a.layer);a.overlay?(b=c.createElement("input"),b.type="checkbox",b.className="leaflet-control-layers-selector",b.defaultChecked=e):b=this._createRadioElement("leaflet-base-layers",e),b.layerId=f.stamp(a.layer),f.DomEvent.on(b,"click",this._onInputClick,this);var g=c.createElement("span");g.innerHTML=" "+a.name,d.appendChild(b),d.appendChild(g);var h=a.overlay?this._overlaysList:this._baseLayersList;return h.appendChild(d),d},_onInputClick:function(){var a,b,c,d=this._form.getElementsByTagName("input"),e=d.length;for(this._handlingClick=!0,a=0;e>a;a++)b=d[a],c=this._layers[b.layerId],b.checked&&!this._map.hasLayer(c.layer)?this._map.addLayer(c.layer):!b.checked&&this._map.hasLayer(c.layer)&&this._map.removeLayer(c.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){f.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),f.control.layers=function(a,b,c){return new f.Control.Layers(a,b,c)},f.PosAnimation=f.Class.extend({includes:f.Mixin.Events,run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._newPos=b,this.fire("start"),a.style[f.DomUtil.TRANSITION]="all "+(c||.25)+"s cubic-bezier(0,0,"+(d||.5)+",1)",f.DomEvent.on(a,f.DomUtil.TRANSITION_END,this._onTransitionEnd,this),f.DomUtil.setPosition(a,b),f.Util.falseFn(a.offsetWidth),this._stepTimer=setInterval(f.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(f.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),f.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var a=this._getPos();return a?(this._el._leaflet_pos=a,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var b,c,d,e=this._el,g=a.getComputedStyle(e);if(f.Browser.any3d){if(d=g[f.DomUtil.TRANSFORM].match(this._transformRe),!d)return;b=parseFloat(d[1]),c=parseFloat(d[2])}else b=parseFloat(g.left),c=parseFloat(g.top);return new f.Point(b,c,!0)},_onTransitionEnd:function(){f.DomEvent.off(this._el,f.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[f.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),f.Map.include({setView:function(a,b,c){if(b=b===d?this._zoom:this._limitZoom(b),a=this._limitCenter(f.latLng(a),b,this.options.maxBounds),c=c||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==d&&(c.zoom=f.extend({animate:c.animate},c.zoom),c.pan=f.extend({animate:c.animate},c.pan));var e=this._zoom!==b?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,b,c.zoom):this._tryAnimatedPan(a,c.pan);if(e)return clearTimeout(this._sizeTimer),this}return this._resetView(a,b),this},panBy:function(a,b){if(a=f.point(a).round(),b=b||{},!a.x&&!a.y)return this;if(this._panAnim||(this._panAnim=new f.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),b.noMoveStart||this.fire("movestart"),b.animate!==!1){f.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(a);this._panAnim.run(this._mapPane,c,b.duration||.25,b.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){f.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,b){var c=this._getCenterOffset(a)._floor();return(b&&b.animate)===!0||this.getSize().contains(c)?(this.panBy(c,b),!0):!1}}),f.PosAnimation=f.DomUtil.TRANSITION?f.PosAnimation:f.PosAnimation.extend({run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(d||.5,.2),this._startPos=f.DomUtil.getPosition(a),this._offset=b.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=f.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var a=+new Date-this._startTime,b=1e3*this._duration;b>a?this._runFrame(this._easeOut(a/b)):(this._runFrame(1),this._complete())},_runFrame:function(a){var b=this._startPos.add(this._offset.multiplyBy(a));f.DomUtil.setPosition(this._el,b),this.fire("step")},_complete:function(){f.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),f.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),f.DomUtil.TRANSITION&&f.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&f.DomUtil.TRANSITION&&f.Browser.any3d&&!f.Browser.android23&&!f.Browser.mobileOpera,this._zoomAnimated&&f.DomEvent.on(this._mapPane,f.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),f.Map.include(f.DomUtil.TRANSITION?{_catchTransitionEnd:function(a){this._animatingZoom&&a.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(a,b,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var d=this.getZoomScale(b),e=this._getCenterOffset(a)._divideBy(1-1/d),f=this._getCenterLayerPoint()._add(e);return c.animate===!0||this.getSize().contains(e)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(a,b,f,d,null,!0),!0):!1},_animateZoom:function(a,b,c,d,e,g,h){h||(this._animatingZoom=!0),f.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=a,this._animateToZoom=b,f.Draggable&&(f.Draggable._disabled=!0),f.Util.requestAnimFrame(function(){this.fire("zoomanim",{center:a,zoom:b,origin:c,scale:d,delta:e,backwards:g}),setTimeout(f.bind(this._onZoomTransitionEnd,this),250)},this)},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._animatingZoom=!1,f.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),f.Util.requestAnimFrame(function(){this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),f.Draggable&&(f.Draggable._disabled=!1)},this))}}:{}),f.TileLayer.include({_animateZoom:function(a){this._animating||(this._animating=!0,this._prepareBgBuffer());var b=this._bgBuffer,c=f.DomUtil.TRANSFORM,d=a.delta?f.DomUtil.getTranslateString(a.delta):b.style[c],e=f.DomUtil.getScaleString(a.scale,a.origin);b.style[c]=a.backwards?e+" "+d:d+" "+e},_endZoomAnim:function(){var a=this._tileContainer,b=this._bgBuffer;a.style.visibility="",a.parentNode.appendChild(a),f.Util.falseFn(b.offsetWidth);var c=this._map.getZoom();(c>this.options.maxZoom||c<this.options.minZoom)&&this._clearBgBuffer(),this._animating=!1},_clearBgBuffer:function(){var a=this._map;!a||a._animatingZoom||a.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[f.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var a=this._tileContainer,b=this._bgBuffer,c=this._getLoadedTilesPercentage(b),d=this._getLoadedTilesPercentage(a);return b&&c>.5&&.5>d?(a.style.visibility="hidden",void this._stopLoadingImages(a)):(b.style.visibility="hidden",b.style[f.DomUtil.TRANSFORM]="",this._tileContainer=b,b=this._bgBuffer=a,this._stopLoadingImages(b),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(a){var b,c,d=a.getElementsByTagName("img"),e=0;for(b=0,c=d.length;c>b;b++)d[b].complete&&e++;return e/c},_stopLoadingImages:function(a){var b,c,d,e=Array.prototype.slice.call(a.getElementsByTagName("img"));for(b=0,c=e.length;c>b;b++)d=e[b],d.complete||(d.onload=f.Util.falseFn,d.onerror=f.Util.falseFn,d.src=f.Util.emptyImageUrl,d.parentNode.removeChild(d))}}),f.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(a){if(a=this._locateOptions=f.extend(this._defaultLocateOptions,a),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var b=f.bind(this._handleGeolocationResponse,this),c=f.bind(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,c,a):navigator.geolocation.getCurrentPosition(b,c,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){var b=a.code,c=a.message||(1===b?"permission denied":2===b?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+c+"."})},_handleGeolocationResponse:function(a){var b=a.coords.latitude,c=a.coords.longitude,d=new f.LatLng(b,c),e=180*a.coords.accuracy/40075017,g=e/Math.cos(f.LatLng.DEG_TO_RAD*b),h=f.latLngBounds([b-e,c-g],[b+e,c+g]),i=this._locateOptions;if(i.setView){var j=Math.min(this.getBoundsZoom(h),i.maxZoom);this.setView(d,j)}var k={latlng:d,bounds:h,timestamp:a.timestamp};for(var l in a.coords)"number"==typeof a.coords[l]&&(k[l]=a.coords[l]);this.fire("locationfound",k)}})}(window,document)},{}],4:[function(a,b,c){!function(a,b){if("object"==typeof c&&c)b(c);else{var d={};b(d),"function"==typeof define&&define.amd?define(d):a.Mustache=d}}(this,function(a){function b(a,b){return u.call(a,b)}function c(a){return!b(q,a)}function d(a){return"function"==typeof a}function e(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function f(a){return String(a).replace(/[&<>"'\/]/g,function(a){return x[a]})}function g(a){this.string=a,this.tail=a,this.pos=0}function h(a,b){this.view=null==a?{}:a,this.parent=b,this._cache={".":this.view}}function i(){this.clearCache()}function j(b,c,e,f){function g(a){return c.render(a,e)}for(var h,i,k,l="",m=0,n=b.length;n>m;++m)switch(h=b[m],i=h[1],h[0]){case"#":if(k=e.lookup(i),"object"==typeof k||"string"==typeof k)if(w(k))for(var o=0,p=k.length;p>o;++o)l+=j(h[4],c,e.push(k[o]),f);else k&&(l+=j(h[4],c,e.push(k),f));else if(d(k)){var q=null==f?null:f.slice(h[3],h[5]);k=k.call(e.view,q,g),null!=k&&(l+=k)}else k&&(l+=j(h[4],c,e,f));break;case"^":k=e.lookup(i),(!k||w(k)&&0===k.length)&&(l+=j(h[4],c,e,f));break;case">":k=c.getPartial(i),d(k)&&(l+=k(e));break;case"&":k=e.lookup(i),null!=k&&(l+=k);break;case"name":k=e.lookup(i),null!=k&&(l+=a.escape(k));break;case"text":l+=i}return l}function k(a){for(var b,c=[],d=c,e=[],f=0,g=a.length;g>f;++f)switch(b=a[f],b[0]){case"#":case"^":e.push(b),d.push(b),d=b[4]=[];break;case"/":var h=e.pop();h[5]=b[2],d=e.length>0?e[e.length-1][4]:c;break;default:d.push(b)}return c}function l(a){for(var b,c,d=[],e=0,f=a.length;f>e;++e)b=a[e],b&&("text"===b[0]&&c&&"text"===c[0]?(c[1]+=b[1],c[3]=b[3]):(c=b,d.push(b)));return d}function m(a){return[new RegExp(e(a[0])+"\\s*"),new RegExp("\\s*"+e(a[1]))]}function n(b,d){function f(){if(A&&!B)for(;z.length;)delete y[z.pop()];else z=[];A=!1,B=!1}if(b=b||"",d=d||a.tags,"string"==typeof d&&(d=d.split(p)),2!==d.length)throw new Error("Invalid tags: "+d.join(", "));for(var h,i,j,n,q,u,v=m(d),w=new g(b),x=[],y=[],z=[],A=!1,B=!1;!w.eos();){if(h=w.pos,j=w.scanUntil(v[0]))for(var C=0,D=j.length;D>C;++C)n=j.charAt(C),c(n)?z.push(y.length):B=!0,y.push(["text",n,h,h+1]),h+=1,"\n"==n&&f();if(!w.scan(v[0]))break;if(A=!0,i=w.scan(t)||"name",w.scan(o),"="===i?(j=w.scanUntil(r),w.scan(r),w.scanUntil(v[1])):"{"===i?(j=w.scanUntil(new RegExp("\\s*"+e("}"+d[1]))),w.scan(s),w.scanUntil(v[1]),i="&"):j=w.scanUntil(v[1]),!w.scan(v[1]))throw new Error("Unclosed tag at "+w.pos);if(q=[i,j,h,w.pos],y.push(q),"#"===i||"^"===i)x.push(q);else if("/"===i){if(u=x.pop(),!u)throw new Error('Unopened section "'+j+'" at '+h);if(u[1]!==j)throw new Error('Unclosed section "'+u[1]+'" at '+h)}else if("name"===i||"{"===i||"&"===i)B=!0;else if("="===i){if(d=j.split(p),2!==d.length)throw new Error("Invalid tags at "+h+": "+d.join(", "));v=m(d)}}if(u=x.pop())throw new Error('Unclosed section "'+u[1]+'" at '+w.pos);return k(l(y))}var o=/\s*/,p=/\s+/,q=/\S/,r=/\s*=/,s=/\s*\}/,t=/#|\^|\/|>|\{|&|=|!/,u=RegExp.prototype.test,v=Object.prototype.toString,w=Array.isArray||function(a){return"[object Array]"===v.call(a)},x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};g.prototype.eos=function(){return""===this.tail},g.prototype.scan=function(a){var b=this.tail.match(a);if(b&&0===b.index){var c=b[0];return this.tail=this.tail.substring(c.length),this.pos+=c.length,c}return""},g.prototype.scanUntil=function(a){var b,c=this.tail.search(a);switch(c){case-1:b=this.tail,this.tail="";break;case 0:b="";break;default:b=this.tail.substring(0,c),this.tail=this.tail.substring(c)}return this.pos+=b.length,b},h.make=function(a){return a instanceof h?a:new h(a)},h.prototype.push=function(a){return new h(a,this)},h.prototype.lookup=function(a){var b;if(a in this._cache)b=this._cache[a];else{for(var c=this;c;){if(a.indexOf(".")>0){b=c.view;for(var e=a.split("."),f=0;null!=b&&f<e.length;)b=b[e[f++]]}else b=c.view[a];if(null!=b)break;c=c.parent}this._cache[a]=b}return d(b)&&(b=b.call(this.view)),b},i.prototype.clearCache=function(){this._cache={},this._partialCache={}},i.prototype.compile=function(b,c){var d=this._cache[b];if(!d){var e=a.parse(b,c);d=this._cache[b]=this.compileTokens(e,b)}return d},i.prototype.compilePartial=function(a,b,c){var d=this.compile(b,c);return this._partialCache[a]=d,d},i.prototype.getPartial=function(a){return a in this._partialCache||!this._loadPartial||this.compilePartial(a,this._loadPartial(a)),this._partialCache[a]},i.prototype.compileTokens=function(a,b){var c=this;return function(e,f){if(f)if(d(f))c._loadPartial=f;else for(var g in f)c.compilePartial(g,f[g]);return j(a,c,h.make(e),b)}},i.prototype.render=function(a,b,c){return this.compile(a)(b,c)},a.name="mustache.js",a.version="0.7.3",a.tags=["{{","}}"],a.Scanner=g,a.Context=h,a.Writer=i,a.parse=n,a.escape=f;var y=new i;a.clearCache=function(){return y.clearCache()},a.compile=function(a,b){return y.compile(a,b)},a.compilePartial=function(a,b,c){return y.compilePartial(a,b,c)},a.compileTokens=function(a,b){return y.compileTokens(a,b)},a.render=function(a,b,c){return y.render(a,b,c)},a.to_html=function(b,c,e,f){var g=a.render(b,c,e);return d(f)?void f(g):g}})},{}],5:[function(a,b,c){function d(a){"use strict";return/^https?/.test(a.getScheme())?a.toString():/^mailto?/.test(a.getScheme())?a.toString():"data"==a.getScheme()&&/^image/.test(a.getPath())?a.toString():void 0}function e(a){return a}var f=a("./sanitizer-bundle.js");b.exports=function(a){return a?f(a,d,e):""}},{"./sanitizer-bundle.js":6}],6:[function(a,b,c){var d=function(){function a(a){var b=(""+a).match(n);return b?new i(j(b[1]),j(b[2]),j(b[3]),j(b[4]),j(b[5]),j(b[6]),j(b[7])):null}function b(a,b,f,g,h,j,k){var l=new i(d(a,o),d(b,o),c(f),g>0?g.toString():null,d(h,p),null,c(k));return j&&("string"==typeof j?l.setRawQuery(j.replace(/[^?&=0-9A-Za-z_\-~.%]/g,e)):l.setAllParameters(j)),l}function c(a){return"string"==typeof a?encodeURIComponent(a):null}function d(a,b){return"string"==typeof a?encodeURI(a).replace(b,e):null}function e(a){var b=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(b>>4&15)+"0123456789ABCDEF".charAt(15&b)}function f(a){return a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/")}function g(a){if(null===a)return null;for(var b,c=f(a),d=l;(b=c.replace(d,"$1"))!=c;c=b);return c}function h(a,b){var c=a.clone(),d=b.hasScheme();d?c.setRawScheme(b.getRawScheme()):d=b.hasCredentials(),d?c.setRawCredentials(b.getRawCredentials()):d=b.hasDomain(),d?c.setRawDomain(b.getRawDomain()):d=b.hasPort();var e=b.getRawPath(),f=g(e);if(d)c.setPort(b.getPort()),f=f&&f.replace(m,"");else if(d=!!e){if(47!==f.charCodeAt(0)){var h=g(c.getRawPath()||"").replace(m,""),i=h.lastIndexOf("/")+1;f=g((i?h.substring(0,i):"")+g(e)).replace(m,"")}}else f=f&&f.replace(m,""),f!==e&&c.setRawPath(f);return d?c.setRawPath(f):d=b.hasQuery(),d?c.setRawQuery(b.getRawQuery()):d=b.hasFragment(),d&&c.setRawFragment(b.getRawFragment()),c}function i(a,b,c,d,e,f,g){this.scheme_=a,this.credentials_=b,this.domain_=c,this.port_=d,this.path_=e,this.query_=f,this.fragment_=g,this.paramCache_=null}function j(a){return"string"==typeof a&&a.length>0?a:null}var k=new RegExp("(/|^)(?:[^./][^/]*|\\.{2,}(?:[^./][^/]*)|\\.{3,}[^/]*)/\\.\\.(?:/|$)"),l=new RegExp(k),m=/^(?:\.\.\/)*(?:\.\.$)?/;i.prototype.toString=function(){var a=[];return null!==this.scheme_&&a.push(this.scheme_,":"),null!==this.domain_&&(a.push("//"),null!==this.credentials_&&a.push(this.credentials_,"@"),a.push(this.domain_),null!==this.port_&&a.push(":",this.port_.toString())),null!==this.path_&&a.push(this.path_),null!==this.query_&&a.push("?",this.query_),null!==this.fragment_&&a.push("#",this.fragment_),a.join("")},i.prototype.clone=function(){return new i(this.scheme_,this.credentials_,this.domain_,this.port_,this.path_,this.query_,this.fragment_)},i.prototype.getScheme=function(){return this.scheme_&&decodeURIComponent(this.scheme_).toLowerCase()},i.prototype.getRawScheme=function(){return this.scheme_},i.prototype.setScheme=function(a){return this.scheme_=d(a,o),this},i.prototype.setRawScheme=function(a){return this.scheme_=a?a:null,this},i.prototype.hasScheme=function(){return null!==this.scheme_},i.prototype.getCredentials=function(){return this.credentials_&&decodeURIComponent(this.credentials_)},i.prototype.getRawCredentials=function(){return this.credentials_},i.prototype.setCredentials=function(a){return this.credentials_=d(a,o),this},i.prototype.setRawCredentials=function(a){return this.credentials_=a?a:null,this},i.prototype.hasCredentials=function(){return null!==this.credentials_},i.prototype.getDomain=function(){return this.domain_&&decodeURIComponent(this.domain_)},i.prototype.getRawDomain=function(){return this.domain_},i.prototype.setDomain=function(a){return this.setRawDomain(a&&encodeURIComponent(a))},i.prototype.setRawDomain=function(a){return this.domain_=a?a:null,this.setRawPath(this.path_)},i.prototype.hasDomain=function(){return null!==this.domain_},i.prototype.getPort=function(){return this.port_&&decodeURIComponent(this.port_)},i.prototype.setPort=function(a){if(a){if(a=Number(a),a!==(65535&a))throw new Error("Bad port number "+a);this.port_=""+a}else this.port_=null;return this},i.prototype.hasPort=function(){return null!==this.port_},i.prototype.getPath=function(){return this.path_&&decodeURIComponent(this.path_)},i.prototype.getRawPath=function(){return this.path_},i.prototype.setPath=function(a){return this.setRawPath(d(a,p))},i.prototype.setRawPath=function(a){return a?(a=String(a),this.path_=!this.domain_||/^\//.test(a)?a:"/"+a):this.path_=null,this},i.prototype.hasPath=function(){return null!==this.path_},i.prototype.getQuery=function(){return this.query_&&decodeURIComponent(this.query_).replace(/\+/g," ")},i.prototype.getRawQuery=function(){return this.query_},i.prototype.setQuery=function(a){return this.paramCache_=null,this.query_=c(a),this},i.prototype.setRawQuery=function(a){return this.paramCache_=null,this.query_=a?a:null,this},i.prototype.hasQuery=function(){return null!==this.query_},i.prototype.setAllParameters=function(a){if("object"==typeof a&&!(a instanceof Array)&&(a instanceof Object||"[object Array]"!==Object.prototype.toString.call(a))){var b=[],c=-1;for(var d in a){var e=a[d];"string"==typeof e&&(b[++c]=d,b[++c]=e)}a=b}this.paramCache_=null;for(var f=[],g="",h=0;h<a.length;){var d=a[h++],e=a[h++];f.push(g,encodeURIComponent(d.toString())),g="&",e&&f.push("=",encodeURIComponent(e.toString()))}return this.query_=f.join(""),this},i.prototype.checkParameterCache_=function(){if(!this.paramCache_){var a=this.query_;if(a){for(var b=a.split(/[&\?]/),c=[],d=-1,e=0;e<b.length;++e){var f=b[e].match(/^([^=]*)(?:=(.*))?$/);c[++d]=decodeURIComponent(f[1]).replace(/\+/g," "),c[++d]=decodeURIComponent(f[2]||"").replace(/\+/g," ")}this.paramCache_=c}else this.paramCache_=[]}},i.prototype.setParameterValues=function(a,b){"string"==typeof b&&(b=[b]),this.checkParameterCache_();for(var c=0,d=this.paramCache_,e=[],f=0;f<d.length;f+=2)a===d[f]?c<b.length&&e.push(a,b[c++]):e.push(d[f],d[f+1]);for(;c<b.length;)e.push(a,b[c++]);return this.setAllParameters(e),this},i.prototype.removeParameter=function(a){return this.setParameterValues(a,[])},i.prototype.getAllParameters=function(){return this.checkParameterCache_(),this.paramCache_.slice(0,this.paramCache_.length)},i.prototype.getParameterValues=function(a){this.checkParameterCache_();for(var b=[],c=0;c<this.paramCache_.length;c+=2)a===this.paramCache_[c]&&b.push(this.paramCache_[c+1]);return b},i.prototype.getParameterMap=function(a){this.checkParameterCache_();for(var b={},c=0;c<this.paramCache_.length;c+=2){var d=this.paramCache_[c++],e=this.paramCache_[c++];d in b?b[d].push(e):b[d]=[e]}return b},i.prototype.getParameterValue=function(a){this.checkParameterCache_();for(var b=0;b<this.paramCache_.length;b+=2)if(a===this.paramCache_[b])return this.paramCache_[b+1];return null},i.prototype.getFragment=function(){return this.fragment_&&decodeURIComponent(this.fragment_)},i.prototype.getRawFragment=function(){return this.fragment_},i.prototype.setFragment=function(a){return this.fragment_=a?encodeURIComponent(a):null,this},i.prototype.setRawFragment=function(a){return this.fragment_=a?a:null,this},i.prototype.hasFragment=function(){return null!==this.fragment_};var n=new RegExp("^(?:([^:/?#]+):)?(?://(?:([^/?#]*)@)?([^/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),o=/[#\/\?@]/g,p=/[\#\?]/g;return i.parse=a,i.create=b,i.resolve=h,i.collapse_dots=g,i.utils={mimeTypeOf:function(b){var c=a(b);return/\.html$/.test(c.getPath())?"text/html":"application/javascript"},resolve:function(b,c){return b?h(a(b),a(c)).toString():""+c}},i}(),e={};if(e.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,HTML:12,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10,MEDIA_QUERY:13},e.atype=e.atype,e.ATTRIBS={"*::class":9,"*::dir":0,"*::draggable":0,"*::hidden":0,"*::id":4,"*::inert":0,"*::itemprop":0,"*::itemref":6,"*::itemscope":0,"*::lang":0,"*::onblur":2,"*::onchange":2,"*::onclick":2,"*::ondblclick":2,"*::onfocus":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::onreset":2,"*::onscroll":2,"*::onselect":2,"*::onsubmit":2,"*::onunload":2,"*::spellcheck":0,"*::style":3,"*::title":0,"*::translate":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"audio::controls":0,"audio::loop":0,"audio::mediagroup":5,"audio::muted":0,"audio::preload":0,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"command::checked":0,"command::command":5,"command::disabled":0,"command::icon":1,"command::label":0,"command::radiogroup":0,"command::type":0,"data::value":0,"del::cite":1,"del::datetime":0,"details::open":0,"dir::compact":0,"div::align":0,"dl::compact":0,"fieldset::disabled":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::novalidate":0,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::inputmode":0,"input::ismap":0,"input::list":5,"input::max":0,"input::maxlength":0,"input::min":0,"input::multiple":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::placeholder":0,"input::readonly":0,"input::required":0,"input::size":0,"input::src":1,"input::step":0,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"menu::label":0,"menu::type":0,"meter::high":0,"meter::low":0,"meter::max":0,"meter::min":0,"meter::value":0,"ol::compact":0,"ol::reversed":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"output::for":6,"output::name":8,"p::align":0,"pre::width":0,"progress::max":0,"progress::min":0,"progress::value":0,"q::cite":1,"select::autocomplete":0,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::required":0,"select::size":0,"select::tabindex":0,"source::type":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,
  "table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::autocomplete":0,"textarea::cols":0,"textarea::disabled":0,"textarea::inputmode":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::placeholder":0,"textarea::readonly":0,"textarea::required":0,"textarea::rows":0,"textarea::tabindex":0,"textarea::wrap":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"track::default":0,"track::kind":0,"track::label":0,"track::srclang":0,"ul::compact":0,"ul::type":0,"video::controls":0,"video::height":0,"video::loop":0,"video::mediagroup":5,"video::muted":0,"video::poster":1,"video::preload":0,"video::width":0},e.ATTRIBS=e.ATTRIBS,e.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128,VIRTUALIZED:256},e.eflags=e.eflags,e.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:272,area:2,article:0,aside:0,audio:0,b:0,base:274,basefont:274,bdi:0,bdo:0,big:0,blockquote:0,body:305,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,command:2,data:0,datalist:0,dd:1,del:0,details:0,dfn:0,dialog:272,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,figcaption:0,figure:0,font:0,footer:0,form:0,frame:274,frameset:272,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:305,header:0,hgroup:0,hr:2,html:305,i:0,iframe:16,img:2,input:2,ins:0,isindex:274,kbd:0,keygen:274,label:0,legend:0,li:1,link:274,map:0,mark:0,menu:0,meta:274,meter:0,nav:0,nobr:0,noembed:276,noframes:276,noscript:276,object:272,ol:0,optgroup:0,option:1,output:0,p:1,param:274,pre:0,progress:0,q:0,s:0,samp:0,script:84,section:0,select:0,small:0,source:2,span:0,strike:0,strong:0,style:148,sub:0,summary:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,time:0,title:280,tr:1,track:2,tt:0,u:0,ul:0,"var":0,video:0,wbr:2},e.ELEMENTS=e.ELEMENTS,e.ELEMENT_DOM_INTERFACES={a:"HTMLAnchorElement",abbr:"HTMLElement",acronym:"HTMLElement",address:"HTMLElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLBaseFontElement",bdi:"HTMLElement",bdo:"HTMLElement",big:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",center:"HTMLElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",command:"HTMLCommandElement",data:"HTMLElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",mark:"HTMLElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",nobr:"HTMLElement",noembed:"HTMLElement",noframes:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",section:"HTMLElement",select:"HTMLSelectElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strike:"HTMLElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableDataCellElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableHeaderCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",tt:"HTMLElement",u:"HTMLElement",ul:"HTMLUListElement","var":"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"},e.ELEMENT_DOM_INTERFACES=e.ELEMENT_DOM_INTERFACES,e.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},e.ueffects=e.ueffects,e.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"command::icon":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0,"video::poster":1},e.URIEFFECTS=e.URIEFFECTS,e.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},e.ltypes=e.ltypes,e.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1},e.LOADERTYPES=e.LOADERTYPES,"i"!=="I".toLowerCase())throw"I/i problem";var f=function(a){function b(a){if(F.hasOwnProperty(a))return F[a];var b=a.match(G);if(b)return String.fromCharCode(parseInt(b[1],10));if(b=a.match(H))return String.fromCharCode(parseInt(b[1],16));if(J&&I.test(a)){J.innerHTML="&"+a+";";var c=J.textContent;return F[a]=c,c}return"&"+a+";"}function c(a,c){return b(c)}function e(a){return a.replace(K,"")}function f(a){return a.replace(L,c)}function g(a){return(""+a).replace(N,"&amp;").replace(P,"&lt;").replace(Q,"&gt;").replace(R,"&#34;")}function h(a){return a.replace(O,"&amp;$1").replace(P,"&lt;").replace(Q,"&gt;")}function i(a){var b={cdata:a.cdata||a.cdata,comment:a.comment||a.comment,endDoc:a.endDoc||a.endDoc,endTag:a.endTag||a.endTag,pcdata:a.pcdata||a.pcdata,rcdata:a.rcdata||a.rcdata,startDoc:a.startDoc||a.startDoc,startTag:a.startTag||a.startTag};return function(a,c){return j(a,b,c)}}function j(a,b,c){var d=m(a),e={noMoreGT:!1,noMoreEndComments:!1};l(b,d,0,e,c)}function k(a,b,c,d,e){return function(){l(a,b,c,d,e)}}function l(b,c,d,e,f){try{b.startDoc&&0==d&&b.startDoc(f);for(var g,h,i,j=d,l=c.length;l>j;){var m=c[j++],q=c[j];switch(m){case"&":M.test(q)?(b.pcdata&&b.pcdata("&"+q,f,V,k(b,c,j,e,f)),j++):b.pcdata&&b.pcdata("&amp;",f,V,k(b,c,j,e,f));break;case"</":(g=/^([-\w:]+)[^\'\"]*/.exec(q))?g[0].length===q.length&&">"===c[j+1]?(j+=2,i=g[1].toLowerCase(),b.endTag&&b.endTag(i,f,V,k(b,c,j,e,f))):j=n(c,j,b,f,V,e):b.pcdata&&b.pcdata("&lt;/",f,V,k(b,c,j,e,f));break;case"<":if(g=/^([-\w:]+)\s*\/?/.exec(q))if(g[0].length===q.length&&">"===c[j+1]){j+=2,i=g[1].toLowerCase(),b.startTag&&b.startTag(i,[],f,V,k(b,c,j,e,f));var r=a.ELEMENTS[i];if(r&U){var s={name:i,next:j,eflags:r};j=p(c,s,b,f,V,e)}}else j=o(c,j,b,f,V,e);else b.pcdata&&b.pcdata("&lt;",f,V,k(b,c,j,e,f));break;case"<!--":if(!e.noMoreEndComments){for(h=j+1;l>h&&(">"!==c[h]||!/--$/.test(c[h-1]));h++);if(l>h){if(b.comment){var t=c.slice(j,h).join("");b.comment(t.substr(0,t.length-2),f,V,k(b,c,h+1,e,f))}j=h+1}else e.noMoreEndComments=!0}e.noMoreEndComments&&b.pcdata&&b.pcdata("&lt;!--",f,V,k(b,c,j,e,f));break;case"<!":if(/^\w/.test(q)){if(!e.noMoreGT){for(h=j+1;l>h&&">"!==c[h];h++);l>h?j=h+1:e.noMoreGT=!0}e.noMoreGT&&b.pcdata&&b.pcdata("&lt;!",f,V,k(b,c,j,e,f))}else b.pcdata&&b.pcdata("&lt;!",f,V,k(b,c,j,e,f));break;case"<?":if(!e.noMoreGT){for(h=j+1;l>h&&">"!==c[h];h++);l>h?j=h+1:e.noMoreGT=!0}e.noMoreGT&&b.pcdata&&b.pcdata("&lt;?",f,V,k(b,c,j,e,f));break;case">":b.pcdata&&b.pcdata("&gt;",f,V,k(b,c,j,e,f));break;case"":break;default:b.pcdata&&b.pcdata(m,f,V,k(b,c,j,e,f))}}b.endDoc&&b.endDoc(f)}catch(u){if(u!==V)throw u}}function m(a){var b=/(<\/|<\!--|<[!?]|[&<>])/g;if(a+="",T)return a.split(b);for(var c,d=[],e=0;null!==(c=b.exec(a));)d.push(a.substring(e,c.index)),d.push(c[0]),e=c.index+c[0].length;return d.push(a.substring(e)),d}function n(a,b,c,d,e,f){var g=q(a,b);return g?(c.endTag&&c.endTag(g.name,d,e,k(c,a,b,f,d)),g.next):a.length}function o(a,b,c,d,e,f){var g=q(a,b);return g?(c.startTag&&c.startTag(g.name,g.attrs,d,e,k(c,a,g.next,f,d)),g.eflags&U?p(a,g,c,d,e,f):g.next):a.length}function p(b,c,d,e,f,g){var i=b.length;W.hasOwnProperty(c.name)||(W[c.name]=new RegExp("^"+c.name+"(?:[\\s\\/]|$)","i"));for(var j=W[c.name],l=c.next,m=c.next+1;i>m&&("</"!==b[m-1]||!j.test(b[m]));m++);i>m&&(m-=1);var n=b.slice(l,m).join("");if(c.eflags&a.eflags.CDATA)d.cdata&&d.cdata(n,e,f,k(d,b,m,g,e));else{if(!(c.eflags&a.eflags.RCDATA))throw new Error("bug");d.rcdata&&d.rcdata(h(n),e,f,k(d,b,m,g,e))}return m}function q(b,c){var d=/^([-\w:]+)/.exec(b[c]),e={};e.name=d[1].toLowerCase(),e.eflags=a.ELEMENTS[e.name];for(var f=b[c].substr(d[0].length),g=c+1,h=b.length;h>g&&">"!==b[g];g++)f+=b[g];if(g>=h)return void 0;for(var i=[];""!==f;)if(d=S.exec(f)){if(d[4]&&!d[5]||d[6]&&!d[7]){for(var j=d[4]||d[6],k=!1,l=[f,b[g++]];h>g;g++){if(k){if(">"===b[g])break}else 0<=b[g].indexOf(j)&&(k=!0);l.push(b[g])}if(g>=h)break;f=l.join("");continue}var m=d[1].toLowerCase(),n=d[2]?r(d[3]):"";i.push(m,n),f=f.substr(d[0].length)}else f=f.replace(/^[\s\S][^a-z\s]*/,"");return e.attrs=i,e.next=g+1,e}function r(a){var b=a.charCodeAt(0);return(34===b||39===b)&&(a=a.substr(1,a.length-2)),f(e(a))}function s(b){var c,d,e=function(a,b){d||b.push(a)};return i({startDoc:function(a){c=[],d=!1},startTag:function(e,f,h){if(!d&&a.ELEMENTS.hasOwnProperty(e)){var i=a.ELEMENTS[e];if(!(i&a.eflags.FOLDABLE)){var j=b(e,f);if(!j)return void(d=!(i&a.eflags.EMPTY));if("object"!=typeof j)throw new Error("tagPolicy did not return object (old API?)");if(!("attribs"in j))throw new Error("tagPolicy gave no attribs");f=j.attribs;var k,l;if("tagName"in j?(l=j.tagName,k=a.ELEMENTS[l]):(l=e,k=i),i&a.eflags.OPTIONAL_ENDTAG){var m=c[c.length-1];!m||m.orig!==e||m.rep===l&&e===l||h.push("</",m.rep,">")}i&a.eflags.EMPTY||c.push({orig:e,rep:l}),h.push("<",l);for(var n=0,o=f.length;o>n;n+=2){var p=f[n],q=f[n+1];null!==q&&void 0!==q&&h.push(" ",p,'="',g(q),'"')}h.push(">"),i&a.eflags.EMPTY&&!(k&a.eflags.EMPTY)&&h.push("</",l,">")}}},endTag:function(b,e){if(d)return void(d=!1);if(a.ELEMENTS.hasOwnProperty(b)){var f=a.ELEMENTS[b];if(!(f&(a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g].orig;if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0&&c[g].orig!==b;);if(0>g)return;for(var i=c.length;--i>g;){var j=c[i].rep;a.ELEMENTS[j]&a.eflags.OPTIONAL_ENDTAG||e.push("</",j,">")}g<c.length&&(b=c[g].rep),c.length=g,e.push("</",b,">")}}},pcdata:e,rcdata:e,cdata:e,endDoc:function(a){for(;c.length;c.length--)a.push("</",c[c.length-1].rep,">")}})}function t(a,b,c,e,f){if(!f)return null;try{var g=d.parse(""+a);if(g&&(!g.hasScheme()||X.test(g.getScheme()))){var h=f(g,b,c,e);return h?h.toString():null}}catch(i){return null}return null}function u(a,b,c,d,e){if(c||a(b+" removed",{change:"removed",tagName:b}),d!==e){var f="changed";d&&!e?f="removed":!d&&e&&(f="added"),a(b+"."+c+" "+f,{change:f,tagName:b,attribName:c,oldValue:d,newValue:e})}}function v(a,b,c){var d;return d=b+"::"+c,a.hasOwnProperty(d)?a[d]:(d="*::"+c,a.hasOwnProperty(d)?a[d]:void 0)}function w(b,c){return v(a.LOADERTYPES,b,c)}function x(b,c){return v(a.URIEFFECTS,b,c)}function y(b,c,d,e,f){for(var g=0;g<c.length;g+=2){var h,i=c[g],j=c[g+1],k=j,l=null;if(h=b+"::"+i,(a.ATTRIBS.hasOwnProperty(h)||(h="*::"+i,a.ATTRIBS.hasOwnProperty(h)))&&(l=a.ATTRIBS[h]),null!==l)switch(l){case a.atype.NONE:break;case a.atype.SCRIPT:j=null,f&&u(f,b,i,k,j);break;case a.atype.STYLE:if("undefined"==typeof C){j=null,f&&u(f,b,i,k,j);break}var m=[];C(j,{declaration:function(b,c){var e=b.toLowerCase(),f=E[e];f&&(D(e,f,c,d?function(b){return t(b,a.ueffects.SAME_DOCUMENT,a.ltypes.SANDBOXED,{TYPE:"CSS",CSS_PROP:e},d)}:null),m.push(b+": "+c.join(" ")))}}),j=m.length>0?m.join(" ; "):null,f&&u(f,b,i,k,j);break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:j=e?e(j):j,f&&u(f,b,i,k,j);break;case a.atype.URI:j=t(j,x(b,i),w(b,i),{TYPE:"MARKUP",XML_ATTR:i,XML_TAG:b},d),f&&u(f,b,i,k,j);break;case a.atype.URI_FRAGMENT:j&&"#"===j.charAt(0)?(j=j.substring(1),j=e?e(j):j,null!==j&&void 0!==j&&(j="#"+j)):j=null,f&&u(f,b,i,k,j);break;default:j=null,f&&u(f,b,i,k,j)}else j=null,f&&u(f,b,i,k,j);c[g+1]=j}return c}function z(b,c,d){return function(e,f){return a.ELEMENTS[e]&a.eflags.UNSAFE?void(d&&u(d,e,void 0,void 0,void 0)):{attribs:y(e,f,b,c,d)}}}function A(a,b){var c=[];return s(b)(a,c),c.join("")}function B(a,b,c,d){var e=z(b,c,d);return A(a,e)}var C,D,E;"undefined"!=typeof window&&(C=window.parseCssDeclarations,D=window.sanitizeCssProperty,E=window.cssSchema);var F={lt:"<",LT:"<",gt:">",GT:">",amp:"&",AMP:"&",quot:'"',apos:"'",nbsp:" "},G=/^#(\d+)$/,H=/^#x([0-9A-Fa-f]+)$/,I=/^[A-Za-z][A-za-z0-9]+$/,J="undefined"!=typeof window&&window.document?window.document.createElement("textarea"):null,K=/\0/g,L=/&(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/g,M=/^(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/,N=/&/g,O=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,P=/[<]/g,Q=/>/g,R=/\"/g,S=new RegExp("^\\s*([-.:\\w]+)(?:\\s*(=)\\s*((\")[^\"]*(\"|$)|(')[^']*('|$)|(?=[a-z][-\\w]*\\s*=)|[^\"'\\s]*))?","i"),T=3==="a,b".split(/(,)/).length,U=a.eflags.CDATA|a.eflags.RCDATA,V={},W={},X=/^(?:https?|mailto|data)$/i,Y={};return Y.escapeAttrib=Y.escapeAttrib=g,Y.makeHtmlSanitizer=Y.makeHtmlSanitizer=s,Y.makeSaxParser=Y.makeSaxParser=i,Y.makeTagPolicy=Y.makeTagPolicy=z,Y.normalizeRCData=Y.normalizeRCData=h,Y.sanitize=Y.sanitize=B,Y.sanitizeAttribs=Y.sanitizeAttribs=y,Y.sanitizeWithPolicy=Y.sanitizeWithPolicy=A,Y.unescapeEntities=Y.unescapeEntities=f,Y}(e),g=f.sanitize;e.ATTRIBS["*::style"]=0,e.ELEMENTS.style=0,e.ATTRIBS["a::target"]=0,e.ELEMENTS.video=0,e.ATTRIBS["video::src"]=0,e.ATTRIBS["video::poster"]=0,e.ATTRIBS["video::controls"]=0,e.ELEMENTS.audio=0,e.ATTRIBS["audio::src"]=0,e.ATTRIBS["video::autoplay"]=0,e.ATTRIBS["video::controls"]=0,"undefined"!=typeof b&&(b.exports=g)},{}],7:[function(a,b,c){b.exports={author:"Mapbox",name:"mapbox.js",description:"mapbox javascript api",version:"2.2.3",homepage:"http://mapbox.com/",repository:{type:"git",url:"git://github.com/mapbox/mapbox.js.git"},main:"src/index.js",dependencies:{corslite:"0.0.6",isarray:"0.0.1",leaflet:"0.7.7",mustache:"0.7.3","sanitize-caja":"0.1.3"},scripts:{test:"eslint --no-eslintrc -c .eslintrc src && mocha-phantomjs test/index.html"},license:"BSD-3-Clause",devDependencies:{browserify:"^6.3.2","clean-css":"~2.0.7",eslint:"^0.23.0","expect.js":"0.3.1",happen:"0.1.3","leaflet-fullscreen":"0.0.4","leaflet-hash":"0.2.1",marked:"~0.3.0",minifyify:"^6.1.0",minimist:"0.0.5",mocha:"1.17.1","mocha-phantomjs":"3.1.6",sinon:"1.10.2"},optionalDependencies:{},engines:{node:"*"}}},{}],8:[function(a,b,c){"use strict";b.exports={HTTP_URL:"http://a.tiles.mapbox.com/v4",HTTPS_URL:"https://a.tiles.mapbox.com/v4",FORCE_HTTPS:!1,REQUIRE_ACCESS_TOKEN:!0}},{}],9:[function(a,b,c){"use strict";var d=a("./util"),e=a("./format_url"),f=a("./request"),g=a("./marker"),h=a("./simplestyle"),i=L.FeatureGroup.extend({options:{filter:function(){return!0},sanitizer:a("sanitize-caja"),style:h.style,popupOptions:{closeButton:!1}},initialize:function(a,b){L.setOptions(this,b),this._layers={},"string"==typeof a?d.idUrl(a,this):a&&"object"==typeof a&&this.setGeoJSON(a)},setGeoJSON:function(a){return this._geojson=a,this.clearLayers(),this._initialize(a),this},getGeoJSON:function(){return this._geojson},loadURL:function(a){return this._request&&"abort"in this._request&&this._request.abort(),this._request=f(a,L.bind(function(b,c){this._request=null,b&&"abort"!==b.type?(d.log("could not load features at "+a),this.fire("error",{error:b})):c&&(this.setGeoJSON(c),this.fire("ready"))},this)),this},loadID:function(a){return this.loadURL(e("/v4/"+a+"/features.json",this.options.accessToken))},setFilter:function(a){return this.options.filter=a,this._geojson&&(this.clearLayers(),this._initialize(this._geojson)),this},getFilter:function(){return this.options.filter},_initialize:function(a){var b,c,d=L.Util.isArray(a)?a:a.features;if(d)for(b=0,c=d.length;c>b;b++)(d[b].geometries||d[b].geometry||d[b].features)&&this._initialize(d[b]);else if(this.options.filter(a)){var e={accessToken:this.options.accessToken},f=this.options.pointToLayer||function(a,b){return g.style(a,b,e)},i=L.GeoJSON.geometryToLayer(a,f),j=g.createPopup(a,this.options.sanitizer),k=this.options.style,l=k===h.style;!(k&&"setStyle"in i)||l&&(i instanceof L.Circle||i instanceof L.CircleMarker)||("function"==typeof k&&(k=k(a)),i.setStyle(k)),i.feature=a,j&&i.bindPopup(j,this.options.popupOptions),this.addLayer(i)}}});b.exports.FeatureLayer=i,b.exports.featureLayer=function(a,b){return new i(a,b)}},{"./format_url":11,"./marker":25,"./request":26,"./simplestyle":28,"./util":30,"sanitize-caja":5}],10:[function(a,b,c){"use strict";var d=L.Class.extend({includes:L.Mixin.Events,data:{},record:function(a){L.extend(this.data,a),this.fire("change")}});b.exports=new d},{}],11:[function(a,b,c){"use strict";var d=a("./config"),e=a("../package.json").version;b.exports=function(a,b){if(b=b||L.mapbox.accessToken,!b&&d.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox.js. See https://www.mapbox.com/mapbox.js/api/v"+e+"/api-access-tokens/");var c="https:"===document.location.protocol||d.FORCE_HTTPS?d.HTTPS_URL:d.HTTP_URL;if(c=c.replace(/\/v4$/,""),c+=a,c+=-1!==c.indexOf("?")?"&access_token=":"?access_token=",d.REQUIRE_ACCESS_TOKEN){if("s"===b[0])throw new Error("Use a public access token (pk.*) with Mapbox.js, not a secret access token (sk.*). See https://www.mapbox.com/mapbox.js/api/v"+e+"/api-access-tokens/");c+=b}return c},b.exports.tileJSON=function(a,c){if(-1!==a.indexOf("/"))return a;var d=b.exports("/v4/"+a+".json",c);return 0===d.indexOf("https")&&(d+="&secure"),d}},{"../package.json":7,"./config":8}],12:[function(a,b,c){"use strict";var d=a("isarray"),e=a("./util"),f=a("./format_url"),g=a("./feedback"),h=a("./request");b.exports=function(a,b){function c(a,b){var c=Math.pow(10,b);return a.lat=Math.round(a.lat*c)/c,a.lng=Math.round(a.lng*c)/c,a}b||(b={});var i={};return e.strict(a,"string"),-1===a.indexOf("/")&&(a=f("/geocoding/v5/"+a+"/{query}.json",b.accessToken,5)),i.getURL=function(){return a},i.queryURL=function(a){var b=!(d(a)||"string"==typeof a),e=b?a.query:a;if(d(e)){for(var f=[],h=0;h<e.length;h++)f[h]=encodeURIComponent(e[h]);e=f.join(";")}else e=encodeURIComponent(e);g.record({geocoding:e});var j=L.Util.template(i.getURL(),{query:e});if(b&&a.types&&(j+=d(a.types)?"&types="+a.types.join():"&types="+a.types),b&&a.proximity){var k=c(L.latLng(a.proximity),3);j+="&proximity="+k.lng+","+k.lat}return j},i.query=function(a,b){return e.strict(b,"function"),h(i.queryURL(a),function(a,c){if(c&&(c.length||c.features)){var d={results:c};c.features&&c.features.length&&(d.latlng=[c.features[0].center[1],c.features[0].center[0]],c.features[0].bbox&&(d.bounds=c.features[0].bbox,d.lbounds=e.lbounds(d.bounds))),b(null,d)}else b(a||!0)}),i},i.reverseQuery=function(a,b){function d(a){var b;return b=void 0!==a.lat&&void 0!==a.lng?L.latLng(a.lat,a.lng):void 0!==a.lat&&void 0!==a.lon?L.latLng(a.lat,a.lon):L.latLng(a[1],a[0]),b=c(b,5),b.lng+","+b.lat}var e="";if(a.length&&a[0].length){for(var f=0,g=[];f<a.length;f++)g.push(d(a[f]));e=g.join(";")}else e=d(a);return h(i.queryURL(e),function(a,c){b(a,c)}),i},i}},{"./feedback":10,"./format_url":11,"./request":26,"./util":30,isarray:2}],13:[function(a,b,c){"use strict";var d=a("./geocoder"),e=a("./util"),f=L.Control.extend({includes:L.Mixin.Events,options:{proximity:!0,position:"topleft",pointZoom:16,keepOpen:!1,autocomplete:!1},initialize:function(a,b){L.Util.setOptions(this,b),this.setURL(a),this._updateSubmit=L.bind(this._updateSubmit,this),this._updateAutocomplete=L.bind(this._updateAutocomplete,this),this._chooseResult=L.bind(this._chooseResult,this)},setURL:function(a){return this.geocoder=d(a,{accessToken:this.options.accessToken}),this},getURL:function(){return this.geocoder.getURL()},setID:function(a){return this.setURL(a)},setTileJSON:function(a){return this.setURL(a.geocoder)},_toggle:function(a){a&&L.DomEvent.stop(a),L.DomUtil.hasClass(this._container,"active")?(L.DomUtil.removeClass(this._container,"active"),this._results.innerHTML="",this._input.blur()):(L.DomUtil.addClass(this._container,"active"),this._input.focus(),this._input.select())},_closeIfOpen:function(){L.DomUtil.hasClass(this._container,"active")&&!this.options.keepOpen&&(L.DomUtil.removeClass(this._container,"active"),this._results.innerHTML="",this._input.blur())},onAdd:function(a){var b=L.DomUtil.create("div","leaflet-control-mapbox-geocoder leaflet-bar leaflet-control"),c=L.DomUtil.create("a","leaflet-control-mapbox-geocoder-toggle mapbox-icon mapbox-icon-geocoder",b),d=L.DomUtil.create("div","leaflet-control-mapbox-geocoder-results",b),e=L.DomUtil.create("div","leaflet-control-mapbox-geocoder-wrap",b),f=L.DomUtil.create("form","leaflet-control-mapbox-geocoder-form",e),g=L.DomUtil.create("input","",f);return c.href="#",c.innerHTML="&nbsp;",g.type="text",g.setAttribute("placeholder","Search"),L.DomEvent.addListener(f,"submit",this._geocode,this),L.DomEvent.addListener(g,"keyup",this._autocomplete,this),L.DomEvent.disableClickPropagation(b),this._map=a,this._results=d,this._input=g,this._form=f,this.options.keepOpen?L.DomUtil.addClass(b,"active"):(this._map.on("click",this._closeIfOpen,this),L.DomEvent.addListener(c,"click",this._toggle,this)),b},_updateSubmit:function(a,b){if(L.DomUtil.removeClass(this._container,"searching"),this._results.innerHTML="",a||!b)this.fire("error",{error:a});else{var c=[];b.results&&b.results.features&&(c=b.results.features),1===c.length?(this.fire("autoselect",{feature:c[0]}),this.fire("found",{results:b.results}),this._chooseResult(c[0]),this._closeIfOpen()):c.length>1?(this.fire("found",{results:b.results}),this._displayResults(c)):this._displayResults(c)}},_updateAutocomplete:function(a,b){if(this._results.innerHTML="",a||!b)this.fire("error",{error:a});else{var c=[];b.results&&b.results.features&&(c=b.results.features),c.length&&this.fire("found",{results:b.results}),this._displayResults(c)}},_displayResults:function(a){for(var b=0,c=Math.min(a.length,5);c>b;b++){var d=a[b],e=d.place_name;if(e.length){var f=L.DomUtil.create("a","",this._results),g="innerText"in f?"innerText":"textContent";f[g]=e,f.setAttribute("title",e),f.href="#",L.bind(function(a){L.DomEvent.addListener(f,"click",function(b){this._chooseResult(a),L.DomEvent.stop(b),this.fire("select",{feature:a})},this)},this)(d)}}if(a.length>5){var h=L.DomUtil.create("span","",this._results);h.innerHTML="Top 5 of "+a.length+"  results"}},_chooseResult:function(a){a.bbox?this._map.fitBounds(e.lbounds(a.bbox)):a.center&&this._map.setView([a.center[1],a.center[0]],void 0===this._map.getZoom()?this.options.pointZoom:Math.max(this._map.getZoom(),this.options.pointZoom))},_geocode:function(a){return L.DomEvent.preventDefault(a),""===this._input.value?this._updateSubmit():(L.DomUtil.addClass(this._container,"searching"),void this.geocoder.query({query:this._input.value,proximity:this.options.proximity?this._map.getCenter():!1},this._updateSubmit))},_autocomplete:function(){return this.options.autocomplete?""===this._input.value?this._updateAutocomplete():void this.geocoder.query({query:this._input.value,proximity:this.options.proximity?this._map.getCenter():!1},this._updateAutocomplete):void 0}});b.exports.GeocoderControl=f,b.exports.geocoderControl=function(a,b){return new f(a,b)}},{"./geocoder":12,"./util":30}],14:[function(a,b,c){"use strict";function d(a){return a>=93&&a--,a>=35&&a--,a-32}b.exports=function(a){return function(b,c){if(a){var e=d(a.grid[c].charCodeAt(b)),f=a.keys[e];return a.data[f]}}}},{}],15:[function(a,b,c){"use strict";var d=a("./util"),e=a("mustache"),f=L.Control.extend({options:{pinnable:!0,follow:!1,sanitizer:a("sanitize-caja"),touchTeaser:!0,location:!0},_currentContent:"",_pinned:!1,initialize:function(a,b){L.Util.setOptions(this,b),d.strict_instance(a,L.Class,"L.mapbox.gridLayer"),this._layer=a},setTemplate:function(a){return d.strict(a,"string"),this.options.template=a,this},_template:function(a,b){if(b){var c=this.options.template||this._layer.getTileJSON().template;if(c){var d={};return d["__"+a+"__"]=!0,this.options.sanitizer(e.to_html(c,L.extend(d,b)))}}},_show:function(a,b){a!==this._currentContent&&(this._currentContent=a,this.options.follow?(this._popup.setContent(a).setLatLng(b.latLng),this._map._popup!==this._popup&&this._popup.openOn(this._map)):(this._container.style.display="block",this._contentWrapper.innerHTML=a))},hide:function(){return this._pinned=!1,this._currentContent="",this._map.closePopup(),this._container.style.display="none",this._contentWrapper.innerHTML="",L.DomUtil.removeClass(this._container,"closable"),this},_mouseover:function(a){if(a.data?L.DomUtil.addClass(this._map._container,"map-clickable"):L.DomUtil.removeClass(this._map._container,"map-clickable"),!this._pinned){var b=this._template("teaser",a.data);b?this._show(b,a):this.hide()}},_mousemove:function(a){this._pinned||this.options.follow&&this._popup.setLatLng(a.latLng)},_navigateTo:function(a){window.top.location.href=a},_click:function(a){var b=this._template("location",a.data);if(this.options.location&&b&&0===b.search(/^https?:/))return this._navigateTo(this._template("location",a.data));if(this.options.pinnable){var c=this._template("full",a.data);!c&&this.options.touchTeaser&&L.Browser.touch&&(c=this._template("teaser",a.data)),c?(L.DomUtil.addClass(this._container,"closable"),this._pinned=!0,this._show(c,a)):this._pinned&&(L.DomUtil.removeClass(this._container,"closable"),this._pinned=!1,this.hide())}},_onPopupClose:function(){this._currentContent=null,this._pinned=!1},_createClosebutton:function(a,b){var c=L.DomUtil.create("a","close",a);return c.innerHTML="close",c.href="#",c.title="close",L.DomEvent.on(c,"click",L.DomEvent.stopPropagation).on(c,"mousedown",L.DomEvent.stopPropagation).on(c,"dblclick",L.DomEvent.stopPropagation).on(c,"click",L.DomEvent.preventDefault).on(c,"click",b,this),c},onAdd:function(a){this._map=a;var b="leaflet-control-grid map-tooltip",c=L.DomUtil.create("div",b),d=L.DomUtil.create("div","map-tooltip-content");return c.style.display="none",this._createClosebutton(c,this.hide),c.appendChild(d),this._contentWrapper=d,this._popup=new L.Popup({autoPan:!1,closeOnClick:!1}),a.on("popupclose",this._onPopupClose,this),L.DomEvent.disableClickPropagation(c).addListener(c,"mousewheel",L.DomEvent.stopPropagation),this._layer.on("mouseover",this._mouseover,this).on("mousemove",this._mousemove,this).on("click",this._click,this),c},onRemove:function(a){a.off("popupclose",this._onPopupClose,this),this._layer.off("mouseover",this._mouseover,this).off("mousemove",this._mousemove,this).off("click",this._click,this)}});b.exports.GridControl=f,b.exports.gridControl=function(a,b){return new f(a,b)}},{"./util":30,mustache:4,"sanitize-caja":5}],16:[function(a,b,c){"use strict";var d=a("./util"),e=a("./request"),f=a("./grid"),g=L.Class.extend({includes:[L.Mixin.Events,a("./load_tilejson")],options:{template:function(){return""}},_mouseOn:null,_tilejson:{},_cache:{},initialize:function(a,b){L.Util.setOptions(this,b),this._loadTileJSON(a)},_setTileJSON:function(a){return d.strict(a,"object"),L.extend(this.options,{grids:a.grids,minZoom:a.minzoom,maxZoom:a.maxzoom,bounds:a.bounds&&d.lbounds(a.bounds)}),this._tilejson=a,this._cache={},this._update(),this},getTileJSON:function(){return this._tilejson},active:function(){return!!(this._map&&this.options.grids&&this.options.grids.length)},addTo:function(a){return a.addLayer(this),this},onAdd:function(a){this._map=a,this._update(),this._map.on("click",this._click,this).on("mousemove",this._move,this).on("moveend",this._update,this)},onRemove:function(){this._map.off("click",this._click,this).off("mousemove",this._move,this).off("moveend",this._update,this)},getData:function(a,b){if(this.active()){var c=this._map,d=c.project(a.wrap()),e=256,f=4,g=Math.floor(d.x/e),h=Math.floor(d.y/e),i=c.options.crs.scale(c.getZoom())/e;return g=(g+i)%i,h=(h+i)%i,this._getTile(c.getZoom(),g,h,function(a){var c=Math.floor((d.x-g*e)/f),i=Math.floor((d.y-h*e)/f);b(a(c,i))}),this}},_click:function(a){this.getData(a.latlng,L.bind(function(b){this.fire("click",{latLng:a.latlng,data:b})},this))},_move:function(a){this.getData(a.latlng,L.bind(function(b){b!==this._mouseOn?(this._mouseOn&&this.fire("mouseout",{latLng:a.latlng,data:this._mouseOn}),this.fire("mouseover",{latLng:a.latlng,data:b}),this._mouseOn=b):this.fire("mousemove",{latLng:a.latlng,data:b})},this))},_getTileURL:function(a){var b=this.options.grids,c=(a.x+a.y)%b.length,d=b[c];return L.Util.template(d,a)},_update:function(){if(this.active()){var a=this._map.getPixelBounds(),b=this._map.getZoom(),c=256;if(!(b>this.options.maxZoom||b<this.options.minZoom))for(var d=L.bounds(a.min.divideBy(c)._floor(),a.max.divideBy(c)._floor()),e=this._map.options.crs.scale(b)/c,f=d.min.x;f<=d.max.x;f++)for(var g=d.min.y;g<=d.max.y;g++)this._getTile(b,(f%e+e)%e,(g%e+e)%e)}},_getTile:function(a,b,c,d){var g=a+"_"+b+"_"+c,h=L.point(b,c);if(h.z=a,this._tileShouldBeLoaded(h)){if(g in this._cache){if(!d)return;return void("function"==typeof this._cache[g]?d(this._cache[g]):this._cache[g].push(d))}this._cache[g]=[],d&&this._cache[g].push(d),e(this._getTileURL(h),L.bind(function(a,b){var c=this._cache[g];this._cache[g]=f(b);for(var d=0;d<c.length;++d)c[d](this._cache[g])},this))}},_tileShouldBeLoaded:function(a){if(a.z>this.options.maxZoom||a.z<this.options.minZoom)return!1;if(this.options.bounds){var b=256,c=a.multiplyBy(b),d=c.add(new L.Point(b,b)),e=this._map.unproject(c),f=this._map.unproject(d),g=new L.LatLngBounds([e,f]);if(!this.options.bounds.intersects(g))return!1}return!0}});b.exports.GridLayer=g,b.exports.gridLayer=function(a,b){return new g(a,b)}},{"./grid":14,"./load_tilejson":21,"./request":26,"./util":30}],17:[function(a,b,c){"use strict";var d=a("./leaflet");a("./mapbox"),b.exports=d},{"./leaflet":19,"./mapbox":23}],18:[function(a,b,c){"use strict";var d=L.Control.extend({options:{position:"bottomright",sanitizer:a("sanitize-caja")},initialize:function(a){L.setOptions(this,a),this._info={},console.warn("infoControl has been deprecated and will be removed in mapbox.js v3.0.0. Use the default attribution control instead, which is now responsive.")},onAdd:function(a){this._container=L.DomUtil.create("div","mapbox-control-info mapbox-small"),this._content=L.DomUtil.create("div","map-info-container",this._container);var b=L.DomUtil.create("a","mapbox-info-toggle mapbox-icon mapbox-icon-info",this._container);b.href="#",L.DomEvent.addListener(b,"click",this._showInfo,this),L.DomEvent.disableClickPropagation(this._container);for(var c in a._layers)a._layers[c].getAttribution&&this.addInfo(a._layers[c].getAttribution());return a.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),
  this._container},onRemove:function(a){a.off("layeradd",this._onLayerAdd,this).off("layerremove",this._onLayerRemove,this)},addInfo:function(a){return a?(this._info[a]||(this._info[a]=0),this._info[a]=!0,this._update()):this},removeInfo:function(a){return a?(this._info[a]&&(this._info[a]=!1),this._update()):this},_showInfo:function(a){return L.DomEvent.preventDefault(a),this._active===!0?this._hidecontent():(L.DomUtil.addClass(this._container,"active"),this._active=!0,void this._update())},_hidecontent:function(){this._content.innerHTML="",this._active=!1,L.DomUtil.removeClass(this._container,"active")},_update:function(){if(!this._map)return this;this._content.innerHTML="";var a="none",b=[];for(var c in this._info)this._info.hasOwnProperty(c)&&this._info[c]&&(b.push(this.options.sanitizer(c)),a="block");return this._content.innerHTML+=b.join(" | "),this._container.style.display=a,this},_onLayerAdd:function(a){a.layer.getAttribution&&a.layer.getAttribution()?this.addInfo(a.layer.getAttribution()):"on"in a.layer&&a.layer.getAttribution&&a.layer.on("ready",L.bind(function(){this.addInfo(a.layer.getAttribution())},this))},_onLayerRemove:function(a){a.layer.getAttribution&&this.removeInfo(a.layer.getAttribution())}});b.exports.InfoControl=d,b.exports.infoControl=function(a){return new d(a)}},{"sanitize-caja":5}],19:[function(a,b,c){b.exports=window.L=a("leaflet/dist/leaflet-src")},{"leaflet/dist/leaflet-src":3}],20:[function(a,b,c){"use strict";var d=L.Control.extend({options:{position:"bottomright",sanitizer:a("sanitize-caja")},initialize:function(a){L.setOptions(this,a),this._legends={}},onAdd:function(){return this._container=L.DomUtil.create("div","map-legends wax-legends"),L.DomEvent.disableClickPropagation(this._container),this._update(),this._container},addLegend:function(a){return a?(this._legends[a]||(this._legends[a]=0),this._legends[a]++,this._update()):this},removeLegend:function(a){return a?(this._legends[a]&&this._legends[a]--,this._update()):this},_update:function(){if(!this._map)return this;this._container.innerHTML="";var a="none";for(var b in this._legends)if(this._legends.hasOwnProperty(b)&&this._legends[b]){var c=L.DomUtil.create("div","map-legend wax-legend",this._container);c.innerHTML=this.options.sanitizer(b),a="block"}return this._container.style.display=a,this}});b.exports.LegendControl=d,b.exports.legendControl=function(a){return new d(a)}},{"sanitize-caja":5}],21:[function(a,b,c){"use strict";var d=a("./request"),e=a("./format_url"),f=a("./util");b.exports={_loadTileJSON:function(a){"string"==typeof a?(a=e.tileJSON(a,this.options&&this.options.accessToken),d(a,L.bind(function(b,c){b?(f.log("could not load TileJSON at "+a),this.fire("error",{error:b})):c&&(this._setTileJSON(c),this.fire("ready"))},this))):a&&"object"==typeof a&&this._setTileJSON(a)}}},{"./format_url":11,"./request":26,"./util":30}],22:[function(a,b,c){"use strict";function d(a,b){return!b||a.accessToken?a:L.extend({accessToken:b},a)}var e=a("./tile_layer").tileLayer,f=a("./feature_layer").featureLayer,g=a("./grid_layer").gridLayer,h=a("./grid_control").gridControl,i=a("./info_control").infoControl,j=a("./share_control").shareControl,k=a("./legend_control").legendControl,l=a("./mapbox_logo").mapboxLogoControl,m=a("./feedback"),n=L.Map.extend({includes:[a("./load_tilejson")],options:{tileLayer:{},featureLayer:{},gridLayer:{},legendControl:{},gridControl:{},infoControl:!1,shareControl:!1,sanitizer:a("sanitize-caja")},_tilejson:{},initialize:function(a,b,c){if(L.Map.prototype.initialize.call(this,a,L.extend({},L.Map.prototype.options,c)),this.attributionControl){this.attributionControl.setPrefix("");var n=this.options.attributionControl.compact;(n||n!==!1&&this._container.offsetWidth<=640)&&L.DomUtil.addClass(this.attributionControl._container,"leaflet-compact-attribution"),void 0===n&&this.on("resize",function(){this._container.offsetWidth>640?L.DomUtil.removeClass(this.attributionControl._container,"leaflet-compact-attribution"):L.DomUtil.addClass(this.attributionControl._container,"leaflet-compact-attribution")})}this.options.tileLayer&&(this.tileLayer=e(void 0,d(this.options.tileLayer,this.options.accessToken)),this.addLayer(this.tileLayer)),this.options.featureLayer&&(this.featureLayer=f(void 0,d(this.options.featureLayer,this.options.accessToken)),this.addLayer(this.featureLayer)),this.options.gridLayer&&(this.gridLayer=g(void 0,d(this.options.gridLayer,this.options.accessToken)),this.addLayer(this.gridLayer)),this.options.gridLayer&&this.options.gridControl&&(this.gridControl=h(this.gridLayer,this.options.gridControl),this.addControl(this.gridControl)),this.options.infoControl&&(this.infoControl=i(this.options.infoControl),this.addControl(this.infoControl)),this.options.legendControl&&(this.legendControl=k(this.options.legendControl),this.addControl(this.legendControl)),this.options.shareControl&&(this.shareControl=j(void 0,d(this.options.shareControl,this.options.accessToken)),this.addControl(this.shareControl)),this._mapboxLogoControl=l(this.options.mapboxLogoControl),this.addControl(this._mapboxLogoControl),this._loadTileJSON(b),this.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this).on("moveend",this._updateMapFeedbackLink,this),this.whenReady(function(){m.on("change",this._updateMapFeedbackLink,this)}),this.on("unload",function(){m.off("change",this._updateMapFeedbackLink,this)})},_setTileJSON:function(a){return this._tilejson=a,this._initialize(a),this},getTileJSON:function(){return this._tilejson},_initialize:function(a){if(this.tileLayer&&(this.tileLayer._setTileJSON(a),this._updateLayer(this.tileLayer)),this.featureLayer&&!this.featureLayer.getGeoJSON()&&a.data&&a.data[0]&&this.featureLayer.loadURL(a.data[0]),this.gridLayer&&(this.gridLayer._setTileJSON(a),this._updateLayer(this.gridLayer)),this.infoControl&&a.attribution&&(this.infoControl.addInfo(this.options.sanitizer(a.attribution)),this._updateMapFeedbackLink()),this.legendControl&&a.legend&&this.legendControl.addLegend(a.legend),this.shareControl&&this.shareControl._setTileJSON(a),this._mapboxLogoControl._setTileJSON(a),!this._loaded&&a.center){var b=void 0!==this.getZoom()?this.getZoom():a.center[2],c=L.latLng(a.center[1],a.center[0]);this.setView(c,b)}},_updateMapFeedbackLink:function(){if(this._controlContainer.getElementsByClassName){var a=this._controlContainer.getElementsByClassName("mapbox-improve-map");if(a.length&&this._loaded){var b=this.getCenter().wrap(),c=this._tilejson||{},d=c.id||"",e="#"+d+"/"+b.lng.toFixed(3)+"/"+b.lat.toFixed(3)+"/"+this.getZoom();for(var f in m.data)e+="/"+f+"="+m.data[f];for(var g=0;g<a.length;g++)a[g].hash=e}}},_onLayerAdd:function(a){"on"in a.layer&&a.layer.on("ready",this._onLayerReady,this),window.setTimeout(L.bind(this._updateMapFeedbackLink,this),0)},_onLayerRemove:function(a){"on"in a.layer&&a.layer.off("ready",this._onLayerReady,this),window.setTimeout(L.bind(this._updateMapFeedbackLink,this),0)},_onLayerReady:function(a){this._updateLayer(a.target)},_updateLayer:function(a){a.options&&(this.infoControl&&this._loaded&&this.infoControl.addInfo(a.options.infoControl),this.attributionControl&&this._loaded&&a.getAttribution&&this.attributionControl.addAttribution(a.getAttribution()),L.stamp(a)in this._zoomBoundLayers||!a.options.maxZoom&&!a.options.minZoom||(this._zoomBoundLayers[L.stamp(a)]=a),this._updateMapFeedbackLink(),this._updateZoomLevels())}});b.exports.Map=n,b.exports.map=function(a,b,c){return new n(a,b,c)}},{"./feature_layer":9,"./feedback":10,"./grid_control":15,"./grid_layer":16,"./info_control":18,"./legend_control":20,"./load_tilejson":21,"./mapbox_logo":24,"./share_control":27,"./tile_layer":29,"sanitize-caja":5}],23:[function(a,b,c){"use strict";var d=a("./geocoder_control"),e=a("./grid_control"),f=a("./feature_layer"),g=a("./legend_control"),h=a("./share_control"),i=a("./tile_layer"),j=a("./info_control"),k=a("./map"),l=a("./grid_layer");L.mapbox=b.exports={VERSION:a("../package.json").version,geocoder:a("./geocoder"),marker:a("./marker"),simplestyle:a("./simplestyle"),tileLayer:i.tileLayer,TileLayer:i.TileLayer,infoControl:j.infoControl,InfoControl:j.InfoControl,shareControl:h.shareControl,ShareControl:h.ShareControl,legendControl:g.legendControl,LegendControl:g.LegendControl,geocoderControl:d.geocoderControl,GeocoderControl:d.GeocoderControl,gridControl:e.gridControl,GridControl:e.GridControl,gridLayer:l.gridLayer,GridLayer:l.GridLayer,featureLayer:f.featureLayer,FeatureLayer:f.FeatureLayer,map:k.map,Map:k.Map,config:a("./config"),sanitize:a("sanitize-caja"),template:a("mustache").to_html,feedback:a("./feedback")},window.L.Icon.Default.imagePath=("https:"===document.location.protocol||"http:"===document.location.protocol?"":"https:")+"//api.tiles.mapbox.com/mapbox.js/v"+a("../package.json").version+"/images"},{"../package.json":7,"./config":8,"./feature_layer":9,"./feedback":10,"./geocoder":12,"./geocoder_control":13,"./grid_control":15,"./grid_layer":16,"./info_control":18,"./legend_control":20,"./map":22,"./marker":25,"./share_control":27,"./simplestyle":28,"./tile_layer":29,mustache:4,"sanitize-caja":5}],24:[function(a,b,c){"use strict";var d=L.Control.extend({options:{position:"bottomleft"},initialize:function(a){L.setOptions(this,a)},onAdd:function(){return this._container=L.DomUtil.create("div","mapbox-logo"),this._container},_setTileJSON:function(a){a.mapbox_logo&&L.DomUtil.addClass(this._container,"mapbox-logo-true")}});b.exports.MapboxLogoControl=d,b.exports.mapboxLogoControl=function(a){return new d(a)}},{}],25:[function(a,b,c){"use strict";function d(a,b){a=a||{};var c={small:[20,50],medium:[30,70],large:[35,90]},d=a["marker-size"]||"medium",e="marker-symbol"in a&&""!==a["marker-symbol"]?"-"+a["marker-symbol"]:"",f=(a["marker-color"]||"7e7e7e").replace("#","");return L.icon({iconUrl:g("/v4/marker/pin-"+d.charAt(0)+e+"+"+f+(L.Browser.retina?"@2x":"")+".png",b&&b.accessToken),iconSize:c[d],iconAnchor:[c[d][0]/2,c[d][1]/2],popupAnchor:[0,-c[d][1]/2]})}function e(a,b,c){return L.marker(b,{icon:d(a.properties,c),title:h.strip_tags(i(a.properties&&a.properties.title||""))})}function f(a,b){if(!a||!a.properties)return"";var c="";return a.properties.title&&(c+='<div class="marker-title">'+a.properties.title+"</div>"),a.properties.description&&(c+='<div class="marker-description">'+a.properties.description+"</div>"),(b||i)(c)}var g=a("./format_url"),h=a("./util"),i=a("sanitize-caja");b.exports={icon:d,style:e,createPopup:f}},{"./format_url":11,"./util":30,"sanitize-caja":5}],26:[function(a,b,c){"use strict";var d=a("corslite"),e=a("./util").strict,f=a("./config"),g=/^(https?:)?(?=\/\/(.|api)\.tiles\.mapbox\.com\/)/;b.exports=function(a,b){function c(a,c){!a&&c&&(c=JSON.parse(c.responseText)),b(a,c)}return e(a,"string"),e(b,"function"),a=a.replace(g,function(a,b){return"withCredentials"in new window.XMLHttpRequest?"https:"===b||"https:"===document.location.protocol||f.FORCE_HTTPS?"https:":"http:":document.location.protocol}),d(a,c)}},{"./config":8,"./util":30,corslite:1}],27:[function(a,b,c){"use strict";var d=a("./format_url"),e=L.Control.extend({includes:[a("./load_tilejson")],options:{position:"topleft",url:""},initialize:function(a,b){L.setOptions(this,b),this._loadTileJSON(a)},_setTileJSON:function(a){this._tilejson=a},onAdd:function(a){this._map=a;var b=L.DomUtil.create("div","leaflet-control-mapbox-share leaflet-bar"),c=L.DomUtil.create("a","mapbox-share mapbox-icon mapbox-icon-share",b);return c.href="#",this._modal=L.DomUtil.create("div","mapbox-modal",this._map._container),this._mask=L.DomUtil.create("div","mapbox-modal-mask",this._modal),this._content=L.DomUtil.create("div","mapbox-modal-content",this._modal),L.DomEvent.addListener(c,"click",this._shareClick,this),L.DomEvent.disableClickPropagation(b),this._map.on("mousedown",this._clickOut,this),b},_clickOut:function(a){return this._sharing?(L.DomEvent.preventDefault(a),L.DomUtil.removeClass(this._modal,"active"),this._content.innerHTML="",void(this._sharing=null)):void 0},_shareClick:function(a){if(L.DomEvent.stop(a),this._sharing)return this._clickOut(a);var b=this._tilejson||this._map._tilejson||{},c=encodeURIComponent(this.options.url||b.webpage||window.location),e=encodeURIComponent(b.name),f=d("/v4/"+b.id+"/"+this._map.getCenter().lng+","+this._map.getCenter().lat+","+this._map.getZoom()+"/600x600.png",this.options.accessToken),g=d("/v4/"+b.id+".html",this.options.accessToken),h="//twitter.com/intent/tweet?status="+e+" "+c,i="//www.facebook.com/sharer.php?u="+c+"&t="+encodeURIComponent(b.name),j="//www.pinterest.com/pin/create/button/?url="+c+"&media="+f+"&description="+b.name,k='<h3>Share this map</h3><div class="mapbox-share-buttons"><a class="mapbox-button mapbox-button-icon mapbox-icon-facebook" target="_blank" href="{{facebook}}">Facebook</a><a class="mapbox-button mapbox-button-icon mapbox-icon-twitter" target="_blank" href="{{twitter}}">Twitter</a><a class="mapbox-button mapbox-button-icon mapbox-icon-pinterest" target="_blank" href="{{pinterest}}">Pinterest</a></div>'.replace("{{twitter}}",h).replace("{{facebook}}",i).replace("{{pinterest}}",j),l='<iframe width="100%" height="500px" frameBorder="0" src="{{embed}}"></iframe>'.replace("{{embed}}",g),m="Copy and paste this <strong>HTML code</strong> into documents to embed this map on web pages.";L.DomUtil.addClass(this._modal,"active"),this._sharing=L.DomUtil.create("div","mapbox-modal-body",this._content),this._sharing.innerHTML=k;var n=L.DomUtil.create("input","mapbox-embed",this._sharing);n.type="text",n.value=l;var o=L.DomUtil.create("label","mapbox-embed-description",this._sharing);o.innerHTML=m;var p=L.DomUtil.create("a","leaflet-popup-close-button",this._sharing);p.href="#",L.DomEvent.disableClickPropagation(this._sharing),L.DomEvent.addListener(p,"click",this._clickOut,this),L.DomEvent.addListener(n,"click",function(a){a.target.focus(),a.target.select()})}});b.exports.ShareControl=e,b.exports.shareControl=function(a,b){return new e(a,b)}},{"./format_url":11,"./load_tilejson":21}],28:[function(a,b,c){"use strict";function d(a,b){var c={};for(var d in b)void 0===a[d]?c[d]=b[d]:c[d]=a[d];return c}function e(a){for(var b={},c=0;c<h.length;c++)b[h[c][1]]=a[h[c][0]];return b}function f(a){return e(d(a.properties||{},g))}var g={stroke:"#555555","stroke-width":2,"stroke-opacity":1,fill:"#555555","fill-opacity":.5},h=[["stroke","color"],["stroke-width","weight"],["stroke-opacity","opacity"],["fill","fillColor"],["fill-opacity","fillOpacity"]];b.exports={style:f,defaults:g}},{}],29:[function(a,b,c){"use strict";var d=a("./util"),e=/\.((?:png|jpg)\d*)(?=$|\?)/,f=L.TileLayer.extend({includes:[a("./load_tilejson")],options:{sanitizer:a("sanitize-caja")},formats:["png","jpg","png32","png64","png128","png256","jpg70","jpg80","jpg90"],scalePrefix:"@2x.",initialize:function(a,b){L.TileLayer.prototype.initialize.call(this,void 0,b),this._tilejson={},b&&b.format&&d.strict_oneof(b.format,this.formats),this._loadTileJSON(a)},setFormat:function(a){return d.strict(a,"string"),this.options.format=a,this.redraw(),this},setUrl:null,_setTileJSON:function(a){return d.strict(a,"object"),this.options.format=this.options.format||a.tiles[0].match(e)[1],L.extend(this.options,{tiles:a.tiles,attribution:this.options.sanitizer(a.attribution),minZoom:a.minzoom||0,maxZoom:a.maxzoom||18,tms:"tms"===a.scheme,bounds:a.bounds&&d.lbounds(a.bounds)}),this._tilejson=a,this.redraw(),this},getTileJSON:function(){return this._tilejson},getTileUrl:function(a){var b=this.options.tiles,c=Math.floor(Math.abs(a.x+a.y)%b.length),d=b[c],f=L.Util.template(d,a);return f?f.replace(e,(L.Browser.retina?this.scalePrefix:".")+this.options.format):f},_update:function(){this.options.tiles&&L.TileLayer.prototype._update.call(this)}});b.exports.TileLayer=f,b.exports.tileLayer=function(a,b){return new f(a,b)}},{"./load_tilejson":21,"./util":30,"sanitize-caja":5}],30:[function(a,b,c){"use strict";function d(a,b){if(!b||!b.length)return!1;for(var c=0;c<b.length;c++)if(b[c]===a)return!0;return!1}b.exports={idUrl:function(a,b){-1===a.indexOf("/")?b.loadID(a):b.loadURL(a)},log:function(a){"object"==typeof console&&"function"==typeof console.error&&console.error(a)},strict:function(a,b){if(typeof a!==b)throw new Error("Invalid argument: "+b+" expected")},strict_instance:function(a,b,c){if(!(a instanceof b))throw new Error("Invalid argument: "+c+" expected")},strict_oneof:function(a,b){if(!d(a,b))throw new Error("Invalid argument: "+a+" given, valid values are "+b.join(", "))},strip_tags:function(a){return a.replace(/<[^<]+>/g,"")},lbounds:function(a){return new L.LatLngBounds([[a[1],a[0]],[a[3],a[2]]])}}},{}]},{},[17]),!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.turf=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){b.exports={isolines:a("turf-isolines"),merge:a("turf-merge"),convex:a("turf-convex"),within:a("turf-within"),concave:a("turf-concave"),count:a("turf-count"),erase:a("turf-erase"),variance:a("turf-variance"),deviation:a("turf-deviation"),median:a("turf-median"),min:a("turf-min"),max:a("turf-max"),aggregate:a("turf-aggregate"),flip:a("turf-flip"),simplify:a("turf-simplify"),sum:a("turf-sum"),average:a("turf-average"),bezier:a("turf-bezier"),tag:a("turf-tag"),size:a("turf-size"),sample:a("turf-sample"),jenks:a("turf-jenks"),quantile:a("turf-quantile"),envelope:a("turf-envelope"),square:a("turf-square"),midpoint:a("turf-midpoint"),buffer:a("turf-buffer"),center:a("turf-center"),centroid:a("turf-centroid"),combine:a("turf-combine"),distance:a("turf-distance"),explode:a("turf-explode"),extent:a("turf-extent"),bboxPolygon:a("turf-bbox-polygon"),featurecollection:a("turf-featurecollection"),filter:a("turf-filter"),inside:a("turf-inside"),intersect:a("turf-intersect"),linestring:a("turf-linestring"),nearest:a("turf-nearest"),planepoint:a("turf-planepoint"),point:a("turf-point"),polygon:a("turf-polygon"),random:a("turf-random"),reclass:a("turf-reclass"),remove:a("turf-remove"),tin:a("turf-tin"),union:a("turf-union"),bearing:a("turf-bearing"),destination:a("turf-destination"),kinks:a("turf-kinks"),pointOnSurface:a("turf-point-on-surface"),area:a("turf-area"),along:a("turf-along"),lineDistance:a("turf-line-distance"),lineSlice:a("turf-line-slice"),pointOnLine:a("turf-point-on-line"),pointGrid:a("turf-point-grid"),squareGrid:a("turf-square-grid"),triangleGrid:a("turf-triangle-grid"),hexGrid:a("turf-hex-grid")}},{"turf-aggregate":6,"turf-along":7,"turf-area":8,"turf-average":11,"turf-bbox-polygon":12,"turf-bearing":13,"turf-bezier":14,"turf-buffer":16,"turf-center":21,"turf-centroid":22,"turf-combine":24,"turf-concave":25,"turf-convex":26,"turf-count":56,"turf-destination":57,"turf-deviation":58,"turf-distance":60,"turf-envelope":62,"turf-erase":63,"turf-explode":68,"turf-extent":70,"turf-featurecollection":72,"turf-filter":73,"turf-flip":74,"turf-hex-grid":75,"turf-inside":76,"turf-intersect":77,"turf-isolines":83,"turf-jenks":85,"turf-kinks":87,"turf-line-distance":88,"turf-line-slice":89,"turf-linestring":90,"turf-max":91,"turf-median":92,"turf-merge":93,"turf-midpoint":95,"turf-min":96,"turf-nearest":97,"turf-planepoint":98,"turf-point":102,"turf-point-grid":99,"turf-point-on-line":100,"turf-point-on-surface":101,"turf-polygon":103,"turf-quantile":104,"turf-random":106,"turf-reclass":108,"turf-remove":109,"turf-sample":110,"turf-simplify":111,"turf-size":113,"turf-square":115,"turf-square-grid":114,"turf-sum":116,"turf-tag":117,"turf-tin":118,"turf-triangle-grid":119,"turf-union":120,"turf-variance":125,"turf-within":127}],2:[function(a,b,c){function d(a){return this instanceof d?(this.length=0,this.parent=void 0,"number"==typeof a?e(this,a):"string"==typeof a?f(this,a,arguments.length>1?arguments[1]:"utf8"):g(this,a)):arguments.length>1?new d(a,arguments[1]):new d(a)}function e(a,b){if(a=m(a,0>b?0:0|n(b)),!d.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function f(a,b,c){("string"!=typeof c||""===c)&&(c="utf8");var d=0|p(b,c);return a=m(a,d),a.write(b,c),a}function g(a,b){if(d.isBuffer(b))return h(a,b);if(U(b))return i(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");return"undefined"!=typeof ArrayBuffer&&b.buffer instanceof ArrayBuffer?j(a,b):b.length?k(a,b):l(a,b)}function h(a,b){var c=0|n(b.length);return a=m(a,c),b.copy(a,0,0,c),a}function i(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function j(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function k(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function l(a,b){var c,d=0;"Buffer"===b.type&&U(b.data)&&(c=b.data,d=0|n(c.length)),a=m(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function m(a,b){d.TYPED_ARRAY_SUPPORT?a=d._augment(new Uint8Array(b)):(a.length=b,a._isBuffer=!0);var c=0!==b&&b<=d.poolSize>>>1;return c&&(a.parent=W),a}function n(a){if(a>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return 0|a}function o(a,b){if(!(this instanceof o))return new o(a,b);var c=new d(a,b);return delete c.parent,c}function p(a,b){if("string"!=typeof a&&(a=String(a)),0===a.length)return 0;switch(b||"utf8"){case"ascii":case"binary":case"raw":return a.length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a.length;case"hex":return a.length>>>1;case"utf8":case"utf-8":return M(a).length;case"base64":return P(a).length;default:return a.length}}function q(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function r(a,b,c,d){return Q(M(b,a.length-c),a,c,d)}function s(a,b,c,d){return Q(N(b),a,c,d)}function t(a,b,c,d){return s(a,b,c,d)}function u(a,b,c,d){return Q(P(b),a,c,d)}function v(a,b,c,d){return Q(O(b,a.length-c),a,c,d)}function w(a,b,c){return 0===b&&c===a.length?S.fromByteArray(a):S.fromByteArray(a.slice(b,c))}function x(a,b,c){var d="",e="";c=Math.min(a.length,c);for(var f=b;c>f;f++)a[f]<=127?(d+=R(e)+String.fromCharCode(a[f]),e=""):e+="%"+a[f].toString(16);return d+R(e)}function y(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function z(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function A(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=L(a[f]);return e}function B(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function C(a,b,c){if(a%1!==0||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function D(a,b,c,e,f,g){if(!d.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>f||g>b)throw new RangeError("value is out of bounds");if(c+e>a.length)throw new RangeError("index out of range")}function E(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);f>e;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function F(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);f>e;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function G(a,b,c,d,e,f){if(b>e||f>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(0>c)throw new RangeError("index out of range")}function H(a,b,c,d,e){return e||G(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),T.write(a,b,c,d,23,4),c+4}function I(a,b,c,d,e){return e||G(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),T.write(a,b,c,d,52,8),c+8}function J(a){if(a=K(a).replace(Y,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function K(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function L(a){return 16>a?"0"+a.toString(16):a.toString(16)}function M(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;d>g;g++){if(c=a.charCodeAt(g),c>55295&&57344>c){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(56320>c){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=e-55296<<10|c-56320|65536,e=null}else e&&((b-=3)>-1&&f.push(239,191,189),e=null);if(128>c){if((b-=1)<0)break;f.push(c)}else if(2048>c){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(65536>c){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(2097152>c))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function N(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b}function O(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);g++)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function P(a){return S.toByteArray(J(a))}function Q(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}function R(a){try{return decodeURIComponent(a)}catch(b){return String.fromCharCode(65533)}}var S=a("base64-js"),T=a("ieee754"),U=a("is-array");c.Buffer=d,c.SlowBuffer=o,c.INSPECT_MAX_BYTES=50,d.poolSize=8192;var V=1073741823,W={};d.TYPED_ARRAY_SUPPORT=function(){try{var a=new ArrayBuffer(0),b=new Uint8Array(a);return b.foo=function(){return 42},42===b.foo()&&"function"==typeof b.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(c){return!1}}(),d.isBuffer=function(a){return!(null==a||!a._isBuffer)},d.compare=function(a,b){if(!d.isBuffer(a)||!d.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,e=b.length,f=0,g=Math.min(c,e);g>f&&a[f]===b[f];)++f;return f!==g&&(c=a[f],e=b[f]),e>c?-1:c>e?1:0},d.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(a,b){if(!U(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new d(0);if(1===a.length)return a[0];var c;if(void 0===b)for(b=0,c=0;c<a.length;c++)b+=a[c].length;var e=new d(b),f=0;for(c=0;c<a.length;c++){var g=a[c];g.copy(e,f),f+=g.length}return e},d.byteLength=p,d.prototype.length=void 0,d.prototype.parent=void 0,d.prototype.toString=function(a,b,c){var d=!1;if(b=0|b,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),0>b&&(b=0),c>this.length&&(c=this.length),b>=c)return"";for(;;)switch(a){case"hex":return A(this,b,c);case"utf8":case"utf-8":return x(this,b,c);case"ascii":return y(this,b,c);case"binary":return z(this,b,c);case"base64":return w(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}},d.prototype.equals=function(a){if(!d.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===d.compare(this,a)},d.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},d.prototype.compare=function(a){if(!d.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:d.compare(this,a)},d.prototype.indexOf=function(a,b){function c(a,b,c){for(var d=-1,e=0;c+e<a.length;e++)if(a[c+e]===b[-1===d?0:e-d]){if(-1===d&&(d=e),e-d+1===b.length)return c+d}else d=-1;return-1}if(b>2147483647?b=2147483647:-2147483648>b&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(0>b&&(b=Math.max(this.length+b,0)),"string"==typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(d.isBuffer(a))return c(this,a,b);if("number"==typeof a)return d.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):c(this,[a],b);throw new TypeError("val must be string, number or Buffer")},d.prototype.get=function(a){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(a)},d.prototype.set=function(a,b){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(a,b)},d.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b=0|b,isFinite(c)?(c=0|c,void 0===d&&(d="utf8")):(d=c,c=void 0);else{var e=d;d=b,b=0|c,c=e}var f=this.length-b;if((void 0===c||c>f)&&(c=f),a.length>0&&(0>c||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");d||(d="utf8");for(var g=!1;;)switch(d){case"hex":return q(this,a,b,c);case"utf8":case"utf-8":return r(this,a,b,c);case"ascii":return s(this,a,b,c);case"binary":return t(this,a,b,c);case"base64":return u(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,a,b,c);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),g=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},d.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c),0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c),a>b&&(b=a);var e;if(d.TYPED_ARRAY_SUPPORT)e=d._augment(this.subarray(a,b));else{var f=b-a;e=new d(f,void 0);for(var g=0;f>g;g++)e[g]=this[g+a]}return e.length&&(e.parent=this.parent||this),e},d.prototype.readUIntLE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},d.prototype.readUIntBE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},d.prototype.readUInt8=function(a,b){return b||C(a,1,this.length),this[a]},d.prototype.readUInt16LE=function(a,b){return b||C(a,2,this.length),this[a]|this[a+1]<<8},d.prototype.readUInt16BE=function(a,b){return b||C(a,2,this.length),this[a]<<8|this[a+1]},d.prototype.readUInt32LE=function(a,b){return b||C(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},d.prototype.readUInt32BE=function(a,b){return b||C(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},d.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},d.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||C(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},d.prototype.readInt8=function(a,b){return b||C(a,1,this.length),128&this[a]?-1*(255-this[a]+1):this[a]},d.prototype.readInt16LE=function(a,b){b||C(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},d.prototype.readInt16BE=function(a,b){b||C(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},d.prototype.readInt32LE=function(a,b){return b||C(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},d.prototype.readInt32BE=function(a,b){return b||C(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},d.prototype.readFloatLE=function(a,b){return b||C(a,4,this.length),T.read(this,a,!0,23,4)},d.prototype.readFloatBE=function(a,b){return b||C(a,4,this.length),T.read(this,a,!1,23,4)},d.prototype.readDoubleLE=function(a,b){return b||C(a,8,this.length),T.read(this,a,!0,52,8);
  },d.prototype.readDoubleBE=function(a,b){return b||C(a,8,this.length),T.read(this,a,!1,52,8)},d.prototype.writeUIntLE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||D(this,a,b,c,Math.pow(2,8*c),0);var e=1,f=0;for(this[b]=255&a;++f<c&&(e*=256);)this[b+f]=a/e&255;return b+c},d.prototype.writeUIntBE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||D(this,a,b,c,Math.pow(2,8*c),0);var e=c-1,f=1;for(this[b+e]=255&a;--e>=0&&(f*=256);)this[b+e]=a/f&255;return b+c},d.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,1,255,0),d.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=a,b+1},d.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):E(this,a,b,!0),b+2},d.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):E(this,a,b,!1),b+2},d.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a):F(this,a,b,!0),b+4},d.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a):F(this,a,b,!1),b+4},d.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);D(this,a,b,c,e-1,-e)}var f=0,g=1,h=0>a?1:0;for(this[b]=255&a;++f<c&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},d.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);D(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0>a?1:0;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},d.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,1,127,-128),d.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),0>a&&(a=255+a+1),this[b]=a,b+1},d.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):E(this,a,b,!0),b+2},d.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):E(this,a,b,!1),b+2},d.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):F(this,a,b,!0),b+4},d.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||D(this,a,b,4,2147483647,-2147483648),0>a&&(a=4294967295+a+1),d.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a):F(this,a,b,!1),b+4},d.prototype.writeFloatLE=function(a,b,c){return H(this,a,b,!0,c)},d.prototype.writeFloatBE=function(a,b,c){return H(this,a,b,!1,c)},d.prototype.writeDoubleLE=function(a,b,c){return I(this,a,b,!0,c)},d.prototype.writeDoubleBE=function(a,b,c){return I(this,a,b,!1,c)},d.prototype.copy=function(a,b,c,e){if(c||(c=0),e||0===e||(e=this.length),b>=a.length&&(b=a.length),b||(b=0),e>0&&c>e&&(e=c),e===c)return 0;if(0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),a.length-b<e-c&&(e=a.length-b+c);var f=e-c;if(1e3>f||!d.TYPED_ARRAY_SUPPORT)for(var g=0;f>g;g++)a[g+b]=this[g+c];else a._set(this.subarray(c,c+f),b);return f},d.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),b>c)throw new RangeError("end < start");if(c!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");if(0>c||c>this.length)throw new RangeError("end out of bounds");var d;if("number"==typeof a)for(d=b;c>d;d++)this[d]=a;else{var e=M(a.toString()),f=e.length;for(d=b;c>d;d++)this[d]=e[d%f]}return this}},d.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(d.TYPED_ARRAY_SUPPORT)return new d(this).buffer;for(var a=new Uint8Array(this.length),b=0,c=a.length;c>b;b+=1)a[b]=this[b];return a.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var X=d.prototype;d._augment=function(a){return a.constructor=d,a._isBuffer=!0,a._set=a.set,a.get=X.get,a.set=X.set,a.write=X.write,a.toString=X.toString,a.toLocaleString=X.toString,a.toJSON=X.toJSON,a.equals=X.equals,a.compare=X.compare,a.indexOf=X.indexOf,a.copy=X.copy,a.slice=X.slice,a.readUIntLE=X.readUIntLE,a.readUIntBE=X.readUIntBE,a.readUInt8=X.readUInt8,a.readUInt16LE=X.readUInt16LE,a.readUInt16BE=X.readUInt16BE,a.readUInt32LE=X.readUInt32LE,a.readUInt32BE=X.readUInt32BE,a.readIntLE=X.readIntLE,a.readIntBE=X.readIntBE,a.readInt8=X.readInt8,a.readInt16LE=X.readInt16LE,a.readInt16BE=X.readInt16BE,a.readInt32LE=X.readInt32LE,a.readInt32BE=X.readInt32BE,a.readFloatLE=X.readFloatLE,a.readFloatBE=X.readFloatBE,a.readDoubleLE=X.readDoubleLE,a.readDoubleBE=X.readDoubleBE,a.writeUInt8=X.writeUInt8,a.writeUIntLE=X.writeUIntLE,a.writeUIntBE=X.writeUIntBE,a.writeUInt16LE=X.writeUInt16LE,a.writeUInt16BE=X.writeUInt16BE,a.writeUInt32LE=X.writeUInt32LE,a.writeUInt32BE=X.writeUInt32BE,a.writeIntLE=X.writeIntLE,a.writeIntBE=X.writeIntBE,a.writeInt8=X.writeInt8,a.writeInt16LE=X.writeInt16LE,a.writeInt16BE=X.writeInt16BE,a.writeInt32LE=X.writeInt32LE,a.writeInt32BE=X.writeInt32BE,a.writeFloatLE=X.writeFloatLE,a.writeFloatBE=X.writeFloatBE,a.writeDoubleLE=X.writeDoubleLE,a.writeDoubleBE=X.writeDoubleBE,a.fill=X.fill,a.inspect=X.inspect,a.toArrayBuffer=X.toArrayBuffer,a};var Y=/[^+\/0-9A-z\-]/g},{"base64-js":3,ieee754:4,"is-array":5}],3:[function(a,b,c){var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(a){"use strict";function b(a){var b=a.charCodeAt(0);return b===g||b===l?62:b===h||b===m?63:i>b?-1:i+10>b?b-i+26+26:k+26>b?b-k:j+26>b?b-j+26:void 0}function c(a){function c(a){j[l++]=a}var d,e,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new f(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;g>d;d+=4,e+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function e(a){function b(a){return d.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var e,f,g,h=a.length%3,i="";for(e=0,g=a.length-h;g>e;e+=3)f=(a[e]<<16)+(a[e+1]<<8)+a[e+2],i+=c(f);switch(h){case 1:f=a[a.length-1],i+=b(f>>2),i+=b(f<<4&63),i+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="="}return i}var f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=e}("undefined"==typeof c?this.base64js={}:c)},{}],4:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],5:[function(a,b,c){var d=Array.isArray,e=Object.prototype.toString;b.exports=d||function(a){return!!a&&"[object Array]"==e.call(a)}},{}],6:[function(a,b,c){function d(a){return"average"===a||"sum"===a||"median"===a||"min"===a||"max"===a||"deviation"===a||"variance"===a||"count"===a}var e=a("turf-average"),f=a("turf-sum"),g=a("turf-median"),h=a("turf-min"),i=a("turf-max"),j=a("turf-deviation"),k=a("turf-variance"),l=a("turf-count"),m={};m.average=e,m.sum=f,m.median=g,m.min=h,m.max=i,m.deviation=j,m.variance=k,m.count=l,b.exports=function(a,b,c){for(var e=0,f=c.length;f>e;e++){var g=c[e],h=g.aggregation;if(!d(h))throw new Error('"'+h+'" is not a recognized aggregation operation.');a="count"===h?m[h](a,b,g.outField):m[h](a,b,g.inField,g.outField)}return a}},{"turf-average":11,"turf-count":56,"turf-deviation":58,"turf-max":91,"turf-median":92,"turf-min":96,"turf-sum":116,"turf-variance":125}],7:[function(a,b,c){var d=a("turf-distance"),e=a("turf-point"),f=a("turf-bearing"),g=a("turf-destination");b.exports=function(a,b,c){var h;if("Feature"===a.type)h=a.geometry.coordinates;else{if("LineString"!==a.type)throw new Error("input must be a LineString Feature or Geometry");h=a.geometry.coordinates}for(var i=0,j=0;j<h.length&&!(b>=i&&j===h.length-1);j++){if(i>=b){var k=b-i;if(k){var l=f(e(h[j]),e(h[j-1]))-180,m=g(e(h[j]),k,l,c);return m}return e(h[j])}i+=d(e(h[j]),e(h[j+1]),c)}return e(h[h.length-1])}},{"turf-bearing":13,"turf-destination":57,"turf-distance":60,"turf-point":102}],8:[function(a,b,c){var d=a("geojson-area").geometry;b.exports=function(a){if("FeatureCollection"===a.type){for(var b=0,c=0;b<a.features.length;b++)a.features[b].geometry&&(c+=d(a.features[b].geometry));return c}return d("Feature"===a.type?a.geometry:a)}},{"geojson-area":9}],9:[function(a,b,c){function d(a){var b,c=0;switch(a.type){case"Polygon":return e(a.coordinates);case"MultiPolygon":for(b=0;b<a.coordinates.length;b++)c+=e(a.coordinates[b]);return c;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(b=0;b<a.geometries.length;b++)c+=d(a.geometries[b]);return c}}function e(a){var b=0;if(a&&a.length>0){b+=Math.abs(f(a[0]));for(var c=1;c<a.length;c++)b-=Math.abs(f(a[c]))}return b}function f(a){var b=0;if(a.length>2){for(var c,d,e=0;e<a.length-1;e++)c=a[e],d=a[e+1],b+=g(d[0]-c[0])*(2+Math.sin(g(c[1]))+Math.sin(g(d[1])));b=b*h.RADIUS*h.RADIUS/2}return b}function g(a){return a*Math.PI/180}var h=a("wgs84");b.exports.geometry=d,b.exports.ring=f},{wgs84:10}],10:[function(a,b,c){b.exports.RADIUS=6378137,b.exports.FLATTENING=1/298.257223563,b.exports.POLAR_RADIUS=6356752.3142},{}],11:[function(a,b,c){function d(a){for(var b=0,c=0;c<a.length;c++)b+=a[c];return b/a.length}var e=a("turf-inside");b.exports=function(a,b,c,f,g){return a.features.forEach(function(a){a.properties||(a.properties={});var g=[];b.features.forEach(function(b){e(b,a)&&g.push(b.properties[c])}),a.properties[f]=d(g)}),a}},{"turf-inside":76}],12:[function(a,b,c){var d=a("turf-polygon");b.exports=function(a){var b=[a[0],a[1]],c=[a[0],a[3]],e=[a[2],a[3]],f=[a[2],a[1]],g=d([[b,f,e,c,b]]);return g}},{"turf-polygon":103}],13:[function(a,b,c){function d(a){return a*Math.PI/180}function e(a){return 180*a/Math.PI}b.exports=function(a,b){var c=a.geometry.coordinates,f=b.geometry.coordinates,g=d(c[0]),h=d(f[0]),i=d(c[1]),j=d(f[1]),k=Math.sin(h-g)*Math.cos(j),l=Math.cos(i)*Math.sin(j)-Math.sin(i)*Math.cos(j)*Math.cos(h-g),m=e(Math.atan2(k,l));return m}},{}],14:[function(a,b,c){var d=a("turf-linestring"),e=a("./spline.js");b.exports=function(a,b,c){var f=d([]);f.properties=a.properties;for(var g=a.geometry.coordinates.map(function(a){return{x:a[0],y:a[1]}}),h=new e({points:g,duration:b,sharpness:c}),i=0;i<h.duration;i+=10){var j=h.pos(i);Math.floor(i/100)%2===0&&f.geometry.coordinates.push([j.x,j.y])}return f}},{"./spline.js":15,"turf-linestring":90}],15:[function(a,b,c){var d=function(a){this.points=a.points||[],this.duration=a.duration||1e4,this.sharpness=a.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=a.stepLength||60,this.length=this.points.length,this.delay=0;for(var b=0;b<this.length;b++)this.points[b].z=this.points[b].z||0;for(var b=0;b<this.length-1;b++){var c=this.points[b],d=this.points[b+1];this.centers.push({x:(c.x+d.x)/2,y:(c.y+d.y)/2,z:(c.z+d.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var b=0;b<this.centers.length-1;b++){var c=this.centers[b],d=this.centers[b+1],e=this.points[b+1].x-(this.centers[b].x+this.centers[b+1].x)/2,f=this.points[b+1].y-(this.centers[b].y+this.centers[b+1].y)/2,g=this.points[b+1].z-(this.centers[b].y+this.centers[b+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[b+1].x+this.sharpness*(this.centers[b].x+e),y:(1-this.sharpness)*this.points[b+1].y+this.sharpness*(this.centers[b].y+f),z:(1-this.sharpness)*this.points[b+1].z+this.sharpness*(this.centers[b].z+g)},{x:(1-this.sharpness)*this.points[b+1].x+this.sharpness*(this.centers[b+1].x+e),y:(1-this.sharpness)*this.points[b+1].y+this.sharpness*(this.centers[b+1].y+f),z:(1-this.sharpness)*this.points[b+1].z+this.sharpness*(this.centers[b+1].z+g)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this};d.prototype.cacheSteps=function(a){var b=[],c=this.pos(0);b.push(0);for(var d=0;d<this.duration;d+=10){var e=this.pos(d),f=Math.sqrt((e.x-c.x)*(e.x-c.x)+(e.y-c.y)*(e.y-c.y)+(e.z-c.z)*(e.z-c.z));f>a&&(b.push(d),c=e)}return b},d.prototype.vector=function(a){var b=this.pos(a+10),c=this.pos(a-10);return{angle:180*Math.atan2(b.y-c.y,b.x-c.x)/3.14,speed:Math.sqrt((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y)+(c.z-b.z)*(c.z-b.z))}},d.prototype.pos=function(a){function b(a,b,c,d,e){var f=function(a){var b=a*a,c=b*a;return[c,3*b*(1-a),3*a*(1-a)*(1-a),(1-a)*(1-a)*(1-a)]},g=f(a),h={x:e.x*g[0]+d.x*g[1]+c.x*g[2]+b.x*g[3],y:e.y*g[0]+d.y*g[1]+c.y*g[2]+b.y*g[3],z:e.z*g[0]+d.z*g[1]+c.z*g[2]+b.z*g[3]};return h}var c=a-this.delay;0>c&&(c=0),c>this.duration&&(c=this.duration-1);var d=c/this.duration;if(d>=1)return this.points[this.length-1];var e=Math.floor((this.points.length-1)*d),f=(this.length-1)*d-e;return b(f,this.points[e],this.controls[e][1],this.controls[e+1][0],this.points[e+1])},b.exports=d},{}],16:[function(a,b,c){var d=a("turf-featurecollection"),e=a("turf-polygon"),f=a("turf-combine"),g=a("jsts");b.exports=function(a,b,c){var d;switch(c){case"miles":b/=69.047;break;case"feet":b/=364568;break;case"kilometers":b/=111.12;break;case"meters":b/=111120;break;case"degrees":}if("FeatureCollection"===a.type){var e=f(a);return e.properties={},d=h(e,b)}return d=h(a,b)};var h=function(a,b){var c=new g.io.GeoJSONReader,f=c.read(JSON.stringify(a.geometry)),h=f.buffer(b),i=new g.io.GeoJSONParser;return h=i.write(h),"MultiPolygon"===h.type?(h={type:"Feature",geometry:h,properties:{}},h=d([h])):h=d([e(h.coordinates)]),h}},{jsts:17,"turf-combine":24,"turf-featurecollection":72,"turf-polygon":103}],17:[function(a,b,c){a("javascript.util");var d=a("./lib/jsts");b.exports=d},{"./lib/jsts":18,"javascript.util":20}],18:[function(a,b,c){jsts={version:"0.15.0",algorithm:{distance:{},locate:{}},error:{},geom:{util:{}},geomgraph:{index:{}},index:{bintree:{},chain:{},kdtree:{},quadtree:{},strtree:{}},io:{},noding:{snapround:{}},operation:{buffer:{},distance:{},overlay:{snap:{}},polygonize:{},predicate:{},relate:{},union:{},valid:{}},planargraph:{},simplify:{},triangulate:{quadedge:{}},util:{}},"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),jsts.abstractFunc=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.error={},jsts.error.IllegalArgumentError=function(a){this.name="IllegalArgumentError",this.message=a},jsts.error.IllegalArgumentError.prototype=new Error,jsts.error.TopologyError=function(a,b){this.name="TopologyError",this.message=b?a+" [ "+b+" ]":a},jsts.error.TopologyError.prototype=new Error,jsts.error.AbstractMethodInvocationError=function(){this.name="AbstractMethodInvocationError",this.message="Abstract method called, should be implemented in subclass."},jsts.error.AbstractMethodInvocationError.prototype=new Error,jsts.error.NotImplementedError=function(){this.name="NotImplementedError",this.message="This method has not yet been implemented."},jsts.error.NotImplementedError.prototype=new Error,jsts.error.NotRepresentableError=function(a){this.name="NotRepresentableError",this.message=a},jsts.error.NotRepresentableError.prototype=new Error,jsts.error.LocateFailureError=function(a){this.name="LocateFailureError",this.message=a},jsts.error.LocateFailureError.prototype=new Error,"undefined"!=typeof b&&(b.exports=jsts),jsts.geom.GeometryFilter=function(){},jsts.geom.GeometryFilter.prototype.filter=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.util.PolygonExtracter=function(a){this.comps=a},jsts.geom.util.PolygonExtracter.prototype=new jsts.geom.GeometryFilter,jsts.geom.util.PolygonExtracter.prototype.comps=null,jsts.geom.util.PolygonExtracter.getPolygons=function(a,b){return void 0===b&&(b=[]),a instanceof jsts.geom.Polygon?b.push(a):a instanceof jsts.geom.GeometryCollection&&a.apply(new jsts.geom.util.PolygonExtracter(b)),b},jsts.geom.util.PolygonExtracter.prototype.filter=function(a){a instanceof jsts.geom.Polygon&&this.comps.push(a)},jsts.io.WKTParser=function(a){this.geometryFactory=a||new jsts.geom.GeometryFactory,this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/}},jsts.io.WKTParser.prototype.read=function(a){var b,c,d;a=a.replace(/[\n\r]/g," ");var e=this.regExes.typeStr.exec(a);if(-1!==a.search("EMPTY")&&(e=this.regExes.emptyTypeStr.exec(a),e[2]=void 0),e&&(c=e[1].toLowerCase(),d=e[2],this.parse[c]&&(b=this.parse[c].apply(this,[d]))),void 0===b)throw new Error("Could not parse WKT "+a);return b},jsts.io.WKTParser.prototype.write=function(a){return this.extractGeometry(a)},jsts.io.WKTParser.prototype.extractGeometry=function(a){var b=a.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[b])return null;var c,d=b.toUpperCase();return c=a.isEmpty()?d+" EMPTY":d+"("+this.extract[b].apply(this,[a])+")"},jsts.io.WKTParser.prototype.extract={coordinate:function(a){return a.x+" "+a.y},point:function(a){return a.coordinate.x+" "+a.coordinate.y},multipoint:function(a){for(var b=[],c=0,d=a.geometries.length;d>c;++c)b.push("("+this.extract.point.apply(this,[a.geometries[c]])+")");return b.join(",")},linestring:function(a){for(var b=[],c=0,d=a.points.length;d>c;++c)b.push(this.extract.coordinate.apply(this,[a.points[c]]));return b.join(",")},multilinestring:function(a){for(var b=[],c=0,d=a.geometries.length;d>c;++c)b.push("("+this.extract.linestring.apply(this,[a.geometries[c]])+")");return b.join(",")},polygon:function(a){var b=[];b.push("("+this.extract.linestring.apply(this,[a.shell])+")");for(var c=0,d=a.holes.length;d>c;++c)b.push("("+this.extract.linestring.apply(this,[a.holes[c]])+")");return b.join(",")},multipolygon:function(a){for(var b=[],c=0,d=a.geometries.length;d>c;++c)b.push("("+this.extract.polygon.apply(this,[a.geometries[c]])+")");return b.join(",")},geometrycollection:function(a){for(var b=[],c=0,d=a.geometries.length;d>c;++c)b.push(this.extractGeometry.apply(this,[a.geometries[c]]));return b.join(",")}},jsts.io.WKTParser.prototype.parse={point:function(a){if(void 0===a)return this.geometryFactory.createPoint(null);var b=a.trim().split(this.regExes.spaces);return this.geometryFactory.createPoint(new jsts.geom.Coordinate(b[0],b[1]))},multipoint:function(a){if(void 0===a)return this.geometryFactory.createMultiPoint(null);for(var b,c=a.trim().split(","),d=[],e=0,f=c.length;f>e;++e)b=c[e].replace(this.regExes.trimParens,"$1"),d.push(this.parse.point.apply(this,[b]));return this.geometryFactory.createMultiPoint(d)},linestring:function(a){if(void 0===a)return this.geometryFactory.createLineString(null);for(var b,c=a.trim().split(","),d=[],e=0,f=c.length;f>e;++e)b=c[e].trim().split(this.regExes.spaces),d.push(new jsts.geom.Coordinate(b[0],b[1]));return this.geometryFactory.createLineString(d)},linearring:function(a){if(void 0===a)return this.geometryFactory.createLinearRing(null);for(var b,c=a.trim().split(","),d=[],e=0,f=c.length;f>e;++e)b=c[e].trim().split(this.regExes.spaces),d.push(new jsts.geom.Coordinate(b[0],b[1]));return this.geometryFactory.createLinearRing(d)},multilinestring:function(a){if(void 0===a)return this.geometryFactory.createMultiLineString(null);for(var b,c=a.trim().split(this.regExes.parenComma),d=[],e=0,f=c.length;f>e;++e)b=c[e].replace(this.regExes.trimParens,"$1"),d.push(this.parse.linestring.apply(this,[b]));return this.geometryFactory.createMultiLineString(d)},polygon:function(a){if(void 0===a)return this.geometryFactory.createPolygon(null);for(var b,c,d,e,f=a.trim().split(this.regExes.parenComma),g=[],h=0,i=f.length;i>h;++h)b=f[h].replace(this.regExes.trimParens,"$1"),c=this.parse.linestring.apply(this,[b]),d=this.geometryFactory.createLinearRing(c.points),0===h?e=d:g.push(d);return this.geometryFactory.createPolygon(e,g)},multipolygon:function(a){if(void 0===a)return this.geometryFactory.createMultiPolygon(null);for(var b,c=a.trim().split(this.regExes.doubleParenComma),d=[],e=0,f=c.length;f>e;++e)b=c[e].replace(this.regExes.trimParens,"$1"),d.push(this.parse.polygon.apply(this,[b]));return this.geometryFactory.createMultiPolygon(d)},geometrycollection:function(a){if(void 0===a)return this.geometryFactory.createGeometryCollection(null);a=a.replace(/,\s*([A-Za-z])/g,"|$1");for(var b=a.trim().split("|"),c=[],d=0,e=b.length;e>d;++d)c.push(jsts.io.WKTParser.prototype.read.apply(this,[b[d]]));return this.geometryFactory.createGeometryCollection(c)}},jsts.index.ItemVisitor=function(){},jsts.index.ItemVisitor.prototype.visitItem=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.CGAlgorithms=function(){},jsts.algorithm.CGAlgorithms.CLOCKWISE=-1,jsts.algorithm.CGAlgorithms.RIGHT=jsts.algorithm.CGAlgorithms.CLOCKWISE,jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE=1,jsts.algorithm.CGAlgorithms.LEFT=jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE,jsts.algorithm.CGAlgorithms.COLLINEAR=0,jsts.algorithm.CGAlgorithms.STRAIGHT=jsts.algorithm.CGAlgorithms.COLLINEAR,jsts.algorithm.CGAlgorithms.orientationIndex=function(a,b,c){var d,e,f,g;return d=b.x-a.x,e=b.y-a.y,f=c.x-b.x,g=c.y-b.y,jsts.algorithm.RobustDeterminant.signOfDet2x2(d,e,f,g)},jsts.algorithm.CGAlgorithms.isPointInRing=function(a,b){return jsts.algorithm.CGAlgorithms.locatePointInRing(a,b)!==jsts.geom.Location.EXTERIOR},jsts.algorithm.CGAlgorithms.locatePointInRing=function(a,b){return jsts.algorithm.RayCrossingCounter.locatePointInRing(a,b)},jsts.algorithm.CGAlgorithms.isOnLine=function(a,b){var c,d,e,f,g;for(c=new jsts.algorithm.RobustLineIntersector,d=1,e=b.length;e>d;d++)if(f=b[d-1],g=b[d],c.computeIntersection(a,f,g),c.hasIntersection())return!0;return!1},jsts.algorithm.CGAlgorithms.isCCW=function(a){var b,c,d,e,f,g,h,i,j,k,l;if(b=a.length-1,3>b)throw new jsts.IllegalArgumentError("Ring has fewer than 3 points, so orientation cannot be determined");for(c=a[0],d=0,j=1;b>=j;j++)e=a[j],e.y>c.y&&(c=e,d=j);f=d;do f-=1,0>f&&(f=b);while(a[f].equals2D(c)&&f!==d);g=d;do g=(g+1)%b;while(a[g].equals2D(c)&&g!==d);return h=a[f],i=a[g],h.equals2D(c)||i.equals2D(c)||h.equals2D(i)?!1:(k=jsts.algorithm.CGAlgorithms.computeOrientation(h,c,i),l=!1,l=0===k?h.x>i.x:k>0)},jsts.algorithm.CGAlgorithms.computeOrientation=function(a,b,c){return jsts.algorithm.CGAlgorithms.orientationIndex(a,b,c)},jsts.algorithm.CGAlgorithms.distancePointLine=function(a,b,c){if(b instanceof jsts.geom.Coordinate||jsts.algorithm.CGAlgorithms.distancePointLine2.apply(this,arguments),b.x===c.x&&b.y===c.y)return a.distance(b);var d,e;return d=((a.x-b.x)*(c.x-b.x)+(a.y-b.y)*(c.y-b.y))/((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y)),0>=d?a.distance(b):d>=1?a.distance(c):(e=((b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y))/((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y)),Math.abs(e)*Math.sqrt((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y)))},jsts.algorithm.CGAlgorithms.distancePointLinePerpendicular=function(a,b,c){var d=((b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y))/((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y));return Math.abs(d)*Math.sqrt((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y))},jsts.algorithm.CGAlgorithms.distancePointLine2=function(a,b){var c,d,e,f;if(0===b.length)throw new jsts.error.IllegalArgumentError("Line array must contain at least one vertex");for(c=a.distance(b[0]),d=0,e=b.length-1;e>d;d++)f=jsts.algorithm.CGAlgorithms.distancePointLine(a,b[d],b[d+1]),c>f&&(c=f);return c},jsts.algorithm.CGAlgorithms.distanceLineLine=function(a,b,c,d){if(a.equals(b))return jsts.algorithm.CGAlgorithms.distancePointLine(a,c,d);if(c.equals(d))return jsts.algorithm.CGAlgorithms.distancePointLine(d,a,b);var e,f,g,h,i,j;return e=(a.y-c.y)*(d.x-c.x)-(a.x-c.x)*(d.y-c.y),f=(b.x-a.x)*(d.y-c.y)-(b.y-a.y)*(d.x-c.x),g=(a.y-c.y)*(b.x-a.x)-(a.x-c.x)*(b.y-a.y),h=(b.x-a.x)*(d.y-c.y)-(b.y-a.y)*(d.x-c.x),0===f||0===h?Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(a,c,d),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(b,c,d),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(c,a,b),jsts.algorithm.CGAlgorithms.distancePointLine(d,a,b)))):(i=g/h,j=e/f,0>j||j>1||0>i||i>1?Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(a,c,d),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(b,c,d),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(c,a,b),jsts.algorithm.CGAlgorithms.distancePointLine(d,a,b)))):0)},jsts.algorithm.CGAlgorithms.signedArea=function(a){if(a.length<3)return 0;var b,c,d,e,f,g,h;for(b=0,c=0,d=a.length-1;d>c;c++)e=a[c].x,f=a[c].y,g=a[c+1].x,h=a[c+1].y,b+=(e+g)*(h-f);return-b/2},jsts.algorithm.CGAlgorithms.signedArea=function(a){var b,c,d,e,f,g,h,i;if(b=a.length,3>b)return 0;for(c=0,d=a[0],e=d.x,f=d.y,g=1;b>g;g++)d=a[g],h=d.x,i=d.y,c+=(e+h)*(i-f),e=h,f=i;return-c/2},jsts.algorithm.CGAlgorithms.computeLength=function(a){var b,c,d,e,f,g,h,i,j,k,l=a.length;if(1>=l)return 0;for(b=0,i=a[0],c=i.x,d=i.y,j=1,k=l,j;l>j;j++)i=a[j],e=i.x,f=i.y,g=e-c,h=f-d,b+=Math.sqrt(g*g+h*h),c=e,d=f;return b},jsts.algorithm.CGAlgorithms.length=function(){},jsts.algorithm.Angle=function(){},jsts.algorithm.Angle.PI_TIMES_2=2*Math.PI,jsts.algorithm.Angle.PI_OVER_2=Math.PI/2,jsts.algorithm.Angle.PI_OVER_4=Math.PI/4,jsts.algorithm.Angle.COUNTERCLOCKWISE=jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE,jsts.algorithm.Angle.CLOCKWISE=jsts.algorithm.CGAlgorithms.CLOCKWISE,jsts.algorithm.Angle.NONE=jsts.algorithm.CGAlgorithms.COLLINEAR,jsts.algorithm.Angle.toDegrees=function(a){return 180*a/Math.PI},jsts.algorithm.Angle.toRadians=function(a){return a*Math.PI/180},jsts.algorithm.Angle.angle=function(){return 1===arguments.length?jsts.algorithm.Angle.angleFromOrigo(arguments[0]):jsts.algorithm.Angle.angleBetweenCoords(arguments[0],arguments[1])},jsts.algorithm.Angle.angleBetweenCoords=function(a,b){var c,d;return c=b.x-a.x,d=b.y-a.y,Math.atan2(d,c)},jsts.algorithm.Angle.angleFromOrigo=function(a){return Math.atan2(a.y,a.x)},jsts.algorithm.Angle.isAcute=function(a,b,c){var d,e,f,g,h;return d=a.x-b.x,e=a.y-b.y,f=c.x-b.x,g=c.y-b.y,h=d*f+e*g,h>0},jsts.algorithm.Angle.isObtuse=function(a,b,c){var d,e,f,g,h;return d=a.x-b.x,e=a.y-b.y,f=c.x-b.x,g=c.y-b.y,h=d*f+e*g,0>h},jsts.algorithm.Angle.angleBetween=function(a,b,c){var d,e;return d=jsts.algorithm.Angle.angle(b,a),e=jsts.algorithm.Angle.angle(b,c),jsts.algorithm.Angle.diff(d,e)},jsts.algorithm.Angle.angleBetweenOriented=function(a,b,c){var d,e,f;return d=jsts.algorithm.Angle.angle(b,a),e=jsts.algorithm.Angle.angle(b,c),f=e-d,f<=-Math.PI?f+jsts.algorithm.Angle.PI_TIMES_2:f>Math.PI?f-jsts.algorithm.Angle.PI_TIMES_2:f},jsts.algorithm.Angle.interiorAngle=function(a,b,c){var d,e;return d=jsts.algorithm.Angle.angle(b,a),e=jsts.algorithm.Angle.angle(b,c),Math.abs(e-d)},jsts.algorithm.Angle.getTurn=function(a,b){var c=Math.sin(b-a);return c>0?jsts.algorithm.Angle.COUNTERCLOCKWISE:0>c?jsts.algorithm.Angle.CLOCKWISE:jsts.algorithm.Angle.NONE},jsts.algorithm.Angle.normalize=function(a){for(;a>Math.PI;)a-=jsts.algorithm.Angle.PI_TIMES_2;for(;a<=-Math.PI;)a+=jsts.algorithm.Angle.PI_TIMES_2;return a},jsts.algorithm.Angle.normalizePositive=function(a){if(0>a){for(;0>a;)a+=jsts.algorithm.Angle.PI_TIMES_2;a>=jsts.algorithm.Angle.PI_TIMES_2&&(a=0)}else{for(;a>=jsts.algorithm.Angle.PI_TIMES_2;)a-=jsts.algorithm.Angle.PI_TIMES_2;0>a&&(a=0)}return a},jsts.algorithm.Angle.diff=function(a,b){var c;return c=b>a?b-a:a-b,c>Math.PI&&(c=2*Math.PI-c),c},jsts.geom.GeometryComponentFilter=function(){},jsts.geom.GeometryComponentFilter.prototype.filter=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.util.LinearComponentExtracter=function(a,b){this.lines=a,this.isForcedToLineString=b},jsts.geom.util.LinearComponentExtracter.prototype=new jsts.geom.GeometryComponentFilter,jsts.geom.util.LinearComponentExtracter.prototype.lines=null,jsts.geom.util.LinearComponentExtracter.prototype.isForcedToLineString=!1,jsts.geom.util.LinearComponentExtracter.getLines=function(a,b){if(1==arguments.length)return jsts.geom.util.LinearComponentExtracter.getLines5.apply(this,arguments);if(2==arguments.length&&"boolean"==typeof b)return jsts.geom.util.LinearComponentExtracter.getLines6.apply(this,arguments);if(2==arguments.length&&a instanceof jsts.geom.Geometry)return jsts.geom.util.LinearComponentExtracter.getLines3.apply(this,arguments);if(3==arguments.length&&a instanceof jsts.geom.Geometry)return jsts.geom.util.LinearComponentExtracter.getLines4.apply(this,arguments);if(3==arguments.length)return jsts.geom.util.LinearComponentExtracter.getLines2.apply(this,arguments);for(var c=0;c<a.length;c++){var d=a[c];jsts.geom.util.LinearComponentExtracter.getLines3(d,b)}return b},jsts.geom.util.LinearComponentExtracter.getLines2=function(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];jsts.geom.util.LinearComponentExtracter.getLines4(e,b,c)}return b},jsts.geom.util.LinearComponentExtracter.getLines3=function(a,b){return a instanceof LineString?b.add(a):a.apply(new jsts.geom.util.LinearComponentExtracter(b)),b},jsts.geom.util.LinearComponentExtracter.getLines4=function(a,b,c){return a.apply(new jsts.geom.util.LinearComponentExtracter(b,c)),b},jsts.geom.util.LinearComponentExtracter.getLines5=function(a){return jsts.geom.util.LinearComponentExtracter.getLines6(a,!1)},jsts.geom.util.LinearComponentExtracter.getLines6=function(a,b){var c=[];return a.apply(new jsts.geom.util.LinearComponentExtracter(c,b)),c},jsts.geom.util.LinearComponentExtracter.prototype.setForceToLineString=function(a){this.isForcedToLineString=a},jsts.geom.util.LinearComponentExtracter.prototype.filter=function(a){if(this.isForcedToLineString&&a instanceof jsts.geom.LinearRing){var b=a.getFactory().createLineString(a.getCoordinateSequence());return void this.lines.push(b)}(a instanceof jsts.geom.LineString||a instanceof jsts.geom.LinearRing)&&this.lines.push(a)},jsts.geom.Location=function(){},jsts.geom.Location.INTERIOR=0,jsts.geom.Location.BOUNDARY=1,jsts.geom.Location.EXTERIOR=2,jsts.geom.Location.NONE=-1,jsts.geom.Location.toLocationSymbol=function(a){switch(a){case jsts.geom.Location.EXTERIOR:return"e";case jsts.geom.Location.BOUNDARY:return"b";case jsts.geom.Location.INTERIOR:return"i";case jsts.geom.Location.NONE:return"-"}throw new jsts.IllegalArgumentError("Unknown location value: "+a)},function(){jsts.io.GeoJSONReader=function(a){this.geometryFactory=a||new jsts.geom.GeometryFactory,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new jsts.io.GeoJSONParser(this.geometryFactory)},jsts.io.GeoJSONReader.prototype.read=function(a){var b=this.parser.read(a);return this.precisionModel.getType()===jsts.geom.PrecisionModel.FIXED&&this.reducePrecision(b),b},jsts.io.GeoJSONReader.prototype.reducePrecision=function(a){var b,c;if(a.coordinate)this.precisionModel.makePrecise(a.coordinate);else if(a.points)for(b=0,c=a.points.length;c>b;b++)this.precisionModel.makePrecise(a.points[b]);else if(a.geometries)for(b=0,
  c=a.geometries.length;c>b;b++)this.reducePrecision(a.geometries[b])}}(),jsts.geom.Geometry=function(a){this.factory=a},jsts.geom.Geometry.prototype.envelope=null,jsts.geom.Geometry.prototype.factory=null,jsts.geom.Geometry.prototype.getGeometryType=function(){return"Geometry"},jsts.geom.Geometry.hasNonEmptyElements=function(a){var b;for(b=0;b<a.length;b++)if(!a[b].isEmpty())return!0;return!1},jsts.geom.Geometry.hasNullElements=function(a){var b;for(b=0;b<a.length;b++)if(null===a[b])return!0;return!1},jsts.geom.Geometry.prototype.getFactory=function(){return(null===this.factory||void 0===this.factory)&&(this.factory=new jsts.geom.GeometryFactory),this.factory},jsts.geom.Geometry.prototype.getNumGeometries=function(){return 1},jsts.geom.Geometry.prototype.getGeometryN=function(a){return this},jsts.geom.Geometry.prototype.getPrecisionModel=function(){return this.getFactory().getPrecisionModel()},jsts.geom.Geometry.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getCoordinates=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getNumPoints=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.isSimple=function(){this.checkNotGeometryCollection(this);var a=new jsts.operation.IsSimpleOp(this);return a.isSimple()},jsts.geom.Geometry.prototype.isValid=function(){var a=new jsts.operation.valid.IsValidOp(this);return a.isValid()},jsts.geom.Geometry.prototype.isEmpty=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.distance=function(a){return jsts.operation.distance.DistanceOp.distance(this,a)},jsts.geom.Geometry.prototype.isWithinDistance=function(a,b){var c=this.getEnvelopeInternal().distance(a.getEnvelopeInternal());return c>b?!1:DistanceOp.isWithinDistance(this,a,b)},jsts.geom.Geometry.prototype.isRectangle=function(){return!1},jsts.geom.Geometry.prototype.getArea=function(){return 0},jsts.geom.Geometry.prototype.getLength=function(){return 0},jsts.geom.Geometry.prototype.getCentroid=function(){if(this.isEmpty())return null;var a,b=null,c=this.getDimension();return 0===c?(a=new jsts.algorithm.CentroidPoint,a.add(this),b=a.getCentroid()):1===c?(a=new jsts.algorithm.CentroidLine,a.add(this),b=a.getCentroid()):(a=new jsts.algorithm.CentroidArea,a.add(this),b=a.getCentroid()),this.createPointFromInternalCoord(b,this)},jsts.geom.Geometry.prototype.getInteriorPoint=function(){var a,b=null,c=this.getDimension();return 0===c?(a=new jsts.algorithm.InteriorPointPoint(this),b=a.getInteriorPoint()):1===c?(a=new jsts.algorithm.InteriorPointLine(this),b=a.getInteriorPoint()):(a=new jsts.algorithm.InteriorPointArea(this),b=a.getInteriorPoint()),this.createPointFromInternalCoord(b,this)},jsts.geom.Geometry.prototype.getDimension=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getBoundary=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getBoundaryDimension=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},jsts.geom.Geometry.prototype.getEnvelopeInternal=function(){return null===this.envelope&&(this.envelope=this.computeEnvelopeInternal()),this.envelope},jsts.geom.Geometry.prototype.disjoint=function(a){return!this.intersects(a)},jsts.geom.Geometry.prototype.touches=function(a){return this.getEnvelopeInternal().intersects(a.getEnvelopeInternal())?this.relate(a).isTouches(this.getDimension(),a.getDimension()):!1},jsts.geom.Geometry.prototype.intersects=function(a){return this.getEnvelopeInternal().intersects(a.getEnvelopeInternal())?this.isRectangle()?jsts.operation.predicate.RectangleIntersects.intersects(this,a):a.isRectangle()?jsts.operation.predicate.RectangleIntersects.intersects(a,this):this.relate(a).isIntersects():!1},jsts.geom.Geometry.prototype.crosses=function(a){return this.getEnvelopeInternal().intersects(a.getEnvelopeInternal())?this.relate(a).isCrosses(this.getDimension(),a.getDimension()):!1},jsts.geom.Geometry.prototype.within=function(a){return a.contains(this)},jsts.geom.Geometry.prototype.contains=function(a){return this.getEnvelopeInternal().contains(a.getEnvelopeInternal())?this.isRectangle()?jsts.operation.predicate.RectangleContains.contains(this,a):this.relate(a).isContains():!1},jsts.geom.Geometry.prototype.overlaps=function(a){return this.getEnvelopeInternal().intersects(a.getEnvelopeInternal())?this.relate(a).isOverlaps(this.getDimension(),a.getDimension()):!1},jsts.geom.Geometry.prototype.covers=function(a){return this.getEnvelopeInternal().covers(a.getEnvelopeInternal())?this.isRectangle()?!0:this.relate(a).isCovers():!1},jsts.geom.Geometry.prototype.coveredBy=function(a){return a.covers(this)},jsts.geom.Geometry.prototype.relate=function(a,b){return 1===arguments.length?this.relate2.apply(this,arguments):this.relate2(a).matches(b)},jsts.geom.Geometry.prototype.relate2=function(a){return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(a),jsts.operation.relate.RelateOp.relate(this,a)},jsts.geom.Geometry.prototype.equalsTopo=function(a){return this.getEnvelopeInternal().equals(a.getEnvelopeInternal())?this.relate(a).isEquals(this.getDimension(),a.getDimension()):!1},jsts.geom.Geometry.prototype.equals=function(a){return a instanceof jsts.geom.Geometry||a instanceof jsts.geom.LinearRing||a instanceof jsts.geom.Polygon||a instanceof jsts.geom.GeometryCollection||a instanceof jsts.geom.MultiPoint||a instanceof jsts.geom.MultiLineString||a instanceof jsts.geom.MultiPolygon?this.equalsExact(a):!1},jsts.geom.Geometry.prototype.buffer=function(a,b,c){var d=new jsts.operation.buffer.BufferParameters(b,c);return jsts.operation.buffer.BufferOp.bufferOp2(this,a,d)},jsts.geom.Geometry.prototype.convexHull=function(){return new jsts.algorithm.ConvexHull(this).getConvexHull()},jsts.geom.Geometry.prototype.intersection=function(a){return this.isEmpty()?this.getFactory().createGeometryCollection(null):a.isEmpty()?this.getFactory().createGeometryCollection(null):(this.isGeometryCollection(this),this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(a),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,a,jsts.operation.overlay.OverlayOp.INTERSECTION))},jsts.geom.Geometry.prototype.union=function(a){return 0===arguments.length?jsts.operation.union.UnaryUnionOp.union(this):this.isEmpty()?a.clone():a.isEmpty()?this.clone():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(a),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,a,jsts.operation.overlay.OverlayOp.UNION))},jsts.geom.Geometry.prototype.difference=function(a){return this.isEmpty()?this.getFactory().createGeometryCollection(null):a.isEmpty()?this.clone():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(a),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,a,jsts.operation.overlay.OverlayOp.DIFFERENCE))},jsts.geom.Geometry.prototype.symDifference=function(a){return this.isEmpty()?a.clone():a.isEmpty()?this.clone():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(a),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,a,jsts.operation.overlay.OverlayOp.SYMDIFFERENCE))},jsts.geom.Geometry.prototype.equalsExact=function(a,b){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.equalsNorm=function(a){return null===a||void 0===a?!1:this.norm().equalsExact(a.norm())},jsts.geom.Geometry.prototype.apply=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.clone=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.normalize=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.norm=function(){var a=this.clone();return a.normalize(),a},jsts.geom.Geometry.prototype.compareTo=function(a){var b=a;return this.getClassSortIndex()!==b.getClassSortIndex()?this.getClassSortIndex()-b.getClassSortIndex():this.isEmpty()&&b.isEmpty()?0:this.isEmpty()?-1:b.isEmpty()?1:this.compareToSameClass(a)},jsts.geom.Geometry.prototype.isEquivalentClass=function(a){return this instanceof jsts.geom.Point&&a instanceof jsts.geom.Point?!0:this instanceof jsts.geom.LineString&&a instanceof jsts.geom.LineString|a instanceof jsts.geom.LinearRing?!0:this instanceof jsts.geom.LinearRing&&a instanceof jsts.geom.LineString|a instanceof jsts.geom.LinearRing?!0:this instanceof jsts.geom.Polygon&&a instanceof jsts.geom.Polygon?!0:this instanceof jsts.geom.MultiPoint&&a instanceof jsts.geom.MultiPoint?!0:this instanceof jsts.geom.MultiLineString&&a instanceof jsts.geom.MultiLineString?!0:this instanceof jsts.geom.MultiPolygon&&a instanceof jsts.geom.MultiPolygon?!0:this instanceof jsts.geom.GeometryCollection&&a instanceof jsts.geom.GeometryCollection?!0:!1},jsts.geom.Geometry.prototype.checkNotGeometryCollection=function(a){if(a.isGeometryCollectionBase())throw new jsts.error.IllegalArgumentError("This method does not support GeometryCollection")},jsts.geom.Geometry.prototype.isGeometryCollection=function(){return this instanceof jsts.geom.GeometryCollection},jsts.geom.Geometry.prototype.isGeometryCollectionBase=function(){return"jsts.geom.GeometryCollection"===this.CLASS_NAME},jsts.geom.Geometry.prototype.computeEnvelopeInternal=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.compareToSameClass=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.compare=function(a,b){for(var c=a.iterator(),d=b.iterator();c.hasNext()&&d.hasNext();){var e=c.next(),f=d.next(),g=e.compareTo(f);if(0!==g)return g}return c.hasNext()?1:d.hasNext()?-1:0},jsts.geom.Geometry.prototype.equal=function(a,b,c){return void 0===c||null===c||0===c?a.equals(b):a.distance(b)<=c},jsts.geom.Geometry.prototype.getClassSortIndex=function(){for(var a=[jsts.geom.Point,jsts.geom.MultiPoint,jsts.geom.LineString,jsts.geom.LinearRing,jsts.geom.MultiLineString,jsts.geom.Polygon,jsts.geom.MultiPolygon,jsts.geom.GeometryCollection],b=0;b<a.length;b++)if(this instanceof a[b])return b;return jsts.util.Assert.shouldNeverReachHere("Class not supported: "+this),-1},jsts.geom.Geometry.prototype.toString=function(){return(new jsts.io.WKTWriter).write(this)},jsts.geom.Geometry.prototype.createPointFromInternalCoord=function(a,b){return b.getPrecisionModel().makePrecise(a),b.getFactory().createPoint(a)},function(){jsts.geom.Coordinate=function(a,b){"number"==typeof a?(this.x=a,this.y=b):a instanceof jsts.geom.Coordinate?(this.x=parseFloat(a.x),this.y=parseFloat(a.y)):void 0===a||null===a?(this.x=0,this.y=0):"string"==typeof a&&(this.x=parseFloat(a),this.y=parseFloat(b))},jsts.geom.Coordinate.prototype.setCoordinate=function(a){this.x=a.x,this.y=a.y},jsts.geom.Coordinate.prototype.clone=function(){return new jsts.geom.Coordinate(this.x,this.y)},jsts.geom.Coordinate.prototype.distance=function(a){var b=this.x-a.x,c=this.y-a.y;return Math.sqrt(b*b+c*c)},jsts.geom.Coordinate.prototype.equals2D=function(a){return this.x!==a.x?!1:this.y!==a.y?!1:!0},jsts.geom.Coordinate.prototype.equals=function(a){return!a instanceof jsts.geom.Coordinate||void 0===a?!1:this.equals2D(a)},jsts.geom.Coordinate.prototype.compareTo=function(a){return this.x<a.x?-1:this.x>a.x?1:this.y<a.y?-1:this.y>a.y?1:0},jsts.geom.Coordinate.prototype.toString=function(){return"("+this.x+", "+this.y+")"}}(),jsts.geom.Envelope=function(){jsts.geom.Envelope.prototype.init.apply(this,arguments)},jsts.geom.Envelope.prototype.minx=null,jsts.geom.Envelope.prototype.maxx=null,jsts.geom.Envelope.prototype.miny=null,jsts.geom.Envelope.prototype.maxy=null,jsts.geom.Envelope.prototype.init=function(){"number"==typeof arguments[0]&&4===arguments.length?this.initFromValues(arguments[0],arguments[1],arguments[2],arguments[3]):arguments[0]instanceof jsts.geom.Coordinate&&1===arguments.length?this.initFromCoordinate(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate&&2===arguments.length?this.initFromCoordinates(arguments[0],arguments[1]):arguments[0]instanceof jsts.geom.Envelope&&1===arguments.length?this.initFromEnvelope(arguments[0]):this.setToNull()},jsts.geom.Envelope.prototype.initFromValues=function(a,b,c,d){b>a?(this.minx=a,this.maxx=b):(this.minx=b,this.maxx=a),d>c?(this.miny=c,this.maxy=d):(this.miny=d,this.maxy=c)},jsts.geom.Envelope.prototype.initFromCoordinates=function(a,b){this.initFromValues(a.x,b.x,a.y,b.y)},jsts.geom.Envelope.prototype.initFromCoordinate=function(a){this.initFromValues(a.x,a.x,a.y,a.y)},jsts.geom.Envelope.prototype.initFromEnvelope=function(a){this.minx=a.minx,this.maxx=a.maxx,this.miny=a.miny,this.maxy=a.maxy},jsts.geom.Envelope.prototype.setToNull=function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},jsts.geom.Envelope.prototype.isNull=function(){return this.maxx<this.minx},jsts.geom.Envelope.prototype.getHeight=function(){return this.isNull()?0:this.maxy-this.miny},jsts.geom.Envelope.prototype.getWidth=function(){return this.isNull()?0:this.maxx-this.minx},jsts.geom.Envelope.prototype.getMinX=function(){return this.minx},jsts.geom.Envelope.prototype.getMaxX=function(){return this.maxx},jsts.geom.Envelope.prototype.getMinY=function(){return this.miny},jsts.geom.Envelope.prototype.getMaxY=function(){return this.maxy},jsts.geom.Envelope.prototype.getArea=function(){return this.getWidth()*this.getHeight()},jsts.geom.Envelope.prototype.expandToInclude=function(){arguments[0]instanceof jsts.geom.Coordinate?this.expandToIncludeCoordinate(arguments[0]):arguments[0]instanceof jsts.geom.Envelope?this.expandToIncludeEnvelope(arguments[0]):this.expandToIncludeValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.expandToIncludeCoordinate=function(a){this.expandToIncludeValues(a.x,a.y)},jsts.geom.Envelope.prototype.expandToIncludeValues=function(a,b){this.isNull()?(this.minx=a,this.maxx=a,this.miny=b,this.maxy=b):(a<this.minx&&(this.minx=a),a>this.maxx&&(this.maxx=a),b<this.miny&&(this.miny=b),b>this.maxy&&(this.maxy=b))},jsts.geom.Envelope.prototype.expandToIncludeEnvelope=function(a){a.isNull()||(this.isNull()?(this.minx=a.getMinX(),this.maxx=a.getMaxX(),this.miny=a.getMinY(),this.maxy=a.getMaxY()):(a.minx<this.minx&&(this.minx=a.minx),a.maxx>this.maxx&&(this.maxx=a.maxx),a.miny<this.miny&&(this.miny=a.miny),a.maxy>this.maxy&&(this.maxy=a.maxy)))},jsts.geom.Envelope.prototype.expandBy=function(){1===arguments.length?this.expandByDistance(arguments[0]):this.expandByDistances(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.expandByDistance=function(a){this.expandByDistances(a,a)},jsts.geom.Envelope.prototype.expandByDistances=function(a,b){this.isNull()||(this.minx-=a,this.maxx+=a,this.miny-=b,this.maxy+=b,(this.minx>this.maxx||this.miny>this.maxy)&&this.setToNull())},jsts.geom.Envelope.prototype.translate=function(a,b){this.isNull()||this.init(this.minx+a,this.maxx+a,this.miny+b,this.maxy+b)},jsts.geom.Envelope.prototype.centre=function(){return this.isNull()?null:new jsts.geom.Coordinate((this.minx+this.maxx)/2,(this.miny+this.maxy)/2)},jsts.geom.Envelope.prototype.intersection=function(a){if(this.isNull()||a.isNull()||!this.intersects(a))return new jsts.geom.Envelope;var b=this.minx>a.minx?this.minx:a.minx,c=this.miny>a.miny?this.miny:a.miny,d=this.maxx<a.maxx?this.maxx:a.maxx,e=this.maxy<a.maxy?this.maxy:a.maxy;return new jsts.geom.Envelope(b,d,c,e)},jsts.geom.Envelope.prototype.intersects=function(){return arguments[0]instanceof jsts.geom.Envelope?this.intersectsEnvelope(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate?this.intersectsCoordinate(arguments[0]):this.intersectsValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.intersectsEnvelope=function(a){if(this.isNull()||a.isNull())return!1;var b=!(a.minx>this.maxx||a.maxx<this.minx||a.miny>this.maxy||a.maxy<this.miny);return b},jsts.geom.Envelope.prototype.intersectsCoordinate=function(a){return this.intersectsValues(a.x,a.y)},jsts.geom.Envelope.prototype.intersectsValues=function(a,b){return this.isNull()?!1:!(a>this.maxx||a<this.minx||b>this.maxy||b<this.miny)},jsts.geom.Envelope.prototype.contains=function(){return arguments[0]instanceof jsts.geom.Envelope?this.containsEnvelope(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate?this.containsCoordinate(arguments[0]):this.containsValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.containsEnvelope=function(a){return this.coversEnvelope(a)},jsts.geom.Envelope.prototype.containsCoordinate=function(a){return this.coversCoordinate(a)},jsts.geom.Envelope.prototype.containsValues=function(a,b){return this.coversValues(a,b)},jsts.geom.Envelope.prototype.covers=function(){return arguments[0]instanceof jsts.geom.Envelope?this.coversEnvelope(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate?this.coversCoordinate(arguments[0]):this.coversValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.coversValues=function(a,b){return this.isNull()?!1:a>=this.minx&&a<=this.maxx&&b>=this.miny&&b<=this.maxy},jsts.geom.Envelope.prototype.coversCoordinate=function(a){return this.coversValues(a.x,a.y)},jsts.geom.Envelope.prototype.coversEnvelope=function(a){return this.isNull()||a.isNull()?!1:a.minx>=this.minx&&a.maxx<=this.maxx&&a.miny>=this.miny&&a.maxy<=this.maxy},jsts.geom.Envelope.prototype.distance=function(a){if(this.intersects(a))return 0;var b=0;this.maxx<a.minx&&(b=a.minx-this.maxx),this.minx>a.maxx&&(b=this.minx-a.maxx);var c=0;return this.maxy<a.miny&&(c=a.miny-this.maxy),this.miny>a.maxy&&(c=this.miny-a.maxy),0===b?c:0===c?b:Math.sqrt(b*b+c*c)},jsts.geom.Envelope.prototype.equals=function(a){return this.isNull()?a.isNull():this.maxx===a.maxx&&this.maxy===a.maxy&&this.minx===a.minx&&this.miny===a.miny},jsts.geom.Envelope.prototype.toString=function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},jsts.geom.Envelope.intersects=function(a,b,c){if(4===arguments.length)return jsts.geom.Envelope.intersectsEnvelope(arguments[0],arguments[1],arguments[2],arguments[3]);var d=a.x<b.x?a.x:b.x,e=a.x>b.x?a.x:b.x,f=a.y<b.y?a.y:b.y,g=a.y>b.y?a.y:b.y;return c.x>=d&&c.x<=e&&c.y>=f&&c.y<=g?!0:!1},jsts.geom.Envelope.intersectsEnvelope=function(a,b,c,d){var e=Math.min(c.x,d.x),f=Math.max(c.x,d.x),g=Math.min(a.x,b.x),h=Math.max(a.x,b.x);return g>f?!1:e>h?!1:(e=Math.min(c.y,d.y),f=Math.max(c.y,d.y),g=Math.min(a.y,b.y),h=Math.max(a.y,b.y),g>f?!1:e>h?!1:!0)},jsts.geom.Envelope.prototype.clone=function(){return new jsts.geom.Envelope(this.minx,this.maxx,this.miny,this.maxy)},jsts.geom.util.GeometryCombiner=function(a){this.geomFactory=jsts.geom.util.GeometryCombiner.extractFactory(a),this.inputGeoms=a},jsts.geom.util.GeometryCombiner.combine=function(a){if(arguments.length>1)return this.combine2.apply(this,arguments);var b=new jsts.geom.util.GeometryCombiner(a);return b.combine()},jsts.geom.util.GeometryCombiner.combine2=function(){var a=new javascript.util.ArrayList;Array.prototype.slice.call(arguments).forEach(function(b){a.add(b)});var b=new jsts.geom.util.GeometryCombiner(a);return b.combine()},jsts.geom.util.GeometryCombiner.prototype.geomFactory=null,jsts.geom.util.GeometryCombiner.prototype.skipEmpty=!1,jsts.geom.util.GeometryCombiner.prototype.inputGeoms,jsts.geom.util.GeometryCombiner.extractFactory=function(a){return a.isEmpty()?null:a.iterator().next().getFactory()},jsts.geom.util.GeometryCombiner.prototype.combine=function(){var a,b=new javascript.util.ArrayList;for(a=this.inputGeoms.iterator();a.hasNext();){var c=a.next();this.extractElements(c,b)}return 0===b.size()?null!==this.geomFactory?this.geomFactory.createGeometryCollection(null):null:this.geomFactory.buildGeometry(b)},jsts.geom.util.GeometryCombiner.prototype.extractElements=function(a,b){if(null!==a)for(var c=0;c<a.getNumGeometries();c++){var d=a.getGeometryN(c);this.skipEmpty&&d.isEmpty()||b.add(d)}},jsts.geom.PrecisionModel=function(a){return"number"==typeof a?(this.modelType=jsts.geom.PrecisionModel.FIXED,void(this.scale=a)):(this.modelType=a||jsts.geom.PrecisionModel.FLOATING,void(this.modelType===jsts.geom.PrecisionModel.FIXED&&(this.scale=1)))},jsts.geom.PrecisionModel.FLOATING="FLOATING",jsts.geom.PrecisionModel.FIXED="FIXED",jsts.geom.PrecisionModel.FLOATING_SINGLE="FLOATING_SINGLE",jsts.geom.PrecisionModel.prototype.scale=null,jsts.geom.PrecisionModel.prototype.modelType=null,jsts.geom.PrecisionModel.prototype.isFloating=function(){return this.modelType===jsts.geom.PrecisionModel.FLOATING||this.modelType===jsts.geom.PrecisionModel.FLOATING_SINLGE},jsts.geom.PrecisionModel.prototype.getScale=function(){return this.scale},jsts.geom.PrecisionModel.prototype.getType=function(){return this.modelType},jsts.geom.PrecisionModel.prototype.equals=function(a){return!0},jsts.geom.PrecisionModel.prototype.makePrecise=function(a){return a instanceof jsts.geom.Coordinate?void this.makePrecise2(a):isNaN(a)?a:this.modelType===jsts.geom.PrecisionModel.FIXED?Math.round(a*this.scale)/this.scale:a},jsts.geom.PrecisionModel.prototype.makePrecise2=function(a){this.modelType!==jsts.geom.PrecisionModel.FLOATING&&(a.x=this.makePrecise(a.x),a.y=this.makePrecise(a.y))},jsts.geom.PrecisionModel.prototype.compareTo=function(a){return 0},jsts.geom.CoordinateFilter=function(){},jsts.geom.CoordinateFilter.prototype.filter=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.simplify.DouglasPeuckerLineSimplifier=function(a){this.pts=a,this.seg=new jsts.geom.LineSegment},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.pts=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.usePt=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.distanceTolerance=null,jsts.simplify.DouglasPeuckerLineSimplifier.simplify=function(a,b){var c=new jsts.simplify.DouglasPeuckerLineSimplifier(a);return c.setDistanceTolerance(b),c.simplify()},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.setDistanceTolerance=function(a){this.distanceTolerance=a},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.simplify=function(){this.usePt=[];for(var a=0;a<this.pts.length;a++)this.usePt[a]=!0;this.simplifySection(0,this.pts.length-1);for(var b=new jsts.geom.CoordinateList,c=0;c<this.pts.length;c++)this.usePt[c]&&b.add(new jsts.geom.Coordinate(this.pts[c]));return b.toCoordinateArray()},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.seg=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.simplifySection=function(a,b){if(a+1!=b){this.seg.p0=this.pts[a],this.seg.p1=this.pts[b];for(var c=-1,d=a,e=a+1;b>e;e++){var f=this.seg.distance(this.pts[e]);f>c&&(c=f,d=e)}if(c<=this.distanceTolerance)for(var g=a+1;b>g;g++)this.usePt[g]=!1;else this.simplifySection(a,d),this.simplifySection(d,b)}},jsts.geomgraph.EdgeIntersection=function(a,b,c){this.coord=new jsts.geom.Coordinate(a),this.segmentIndex=b,this.dist=c},jsts.geomgraph.EdgeIntersection.prototype.coord=null,jsts.geomgraph.EdgeIntersection.prototype.segmentIndex=null,jsts.geomgraph.EdgeIntersection.prototype.dist=null,jsts.geomgraph.EdgeIntersection.prototype.getCoordinate=function(){return this.coord},jsts.geomgraph.EdgeIntersection.prototype.getSegmentIndex=function(){return this.segmentIndex},jsts.geomgraph.EdgeIntersection.prototype.getDistance=function(){return this.dist},jsts.geomgraph.EdgeIntersection.prototype.compareTo=function(a){return this.compare(a.segmentIndex,a.dist)},jsts.geomgraph.EdgeIntersection.prototype.compare=function(a,b){return this.segmentIndex<a?-1:this.segmentIndex>a?1:this.dist<b?-1:this.dist>b?1:0},jsts.geomgraph.EdgeIntersection.prototype.isEndPoint=function(a){return 0===this.segmentIndex&&0===this.dist?!0:this.segmentIndex===a?!0:!1},jsts.geomgraph.EdgeIntersection.prototype.toString=function(){return""+this.segmentIndex+this.dist},function(){var a=jsts.geomgraph.EdgeIntersection,b=javascript.util.TreeMap;jsts.geomgraph.EdgeIntersectionList=function(a){this.nodeMap=new b,this.edge=a},jsts.geomgraph.EdgeIntersectionList.prototype.nodeMap=null,jsts.geomgraph.EdgeIntersectionList.prototype.edge=null,jsts.geomgraph.EdgeIntersectionList.prototype.isIntersection=function(a){for(var b=this.iterator();b.hasNext();){var c=b.next();if(c.coord.equals(a))return!0}return!1},jsts.geomgraph.EdgeIntersectionList.prototype.add=function(b,c,d){var e=new a(b,c,d),f=this.nodeMap.get(e);return null!==f?f:(this.nodeMap.put(e,e),e)},jsts.geomgraph.EdgeIntersectionList.prototype.iterator=function(){return this.nodeMap.values().iterator()},jsts.geomgraph.EdgeIntersectionList.prototype.addEndpoints=function(){var a=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[a],a,0)},jsts.geomgraph.EdgeIntersectionList.prototype.addSplitEdges=function(a){this.addEndpoints();for(var b=this.iterator(),c=b.next();b.hasNext();){var d=b.next(),e=this.createSplitEdge(c,d);a.add(e),c=d}},jsts.geomgraph.EdgeIntersectionList.prototype.createSplitEdge=function(a,b){var c=b.segmentIndex-a.segmentIndex+2,d=this.edge.pts[b.segmentIndex],e=b.dist>0||!b.coord.equals2D(d);e||c--;var f=[],g=0;f[g++]=new jsts.geom.Coordinate(a.coord);for(var h=a.segmentIndex+1;h<=b.segmentIndex;h++)f[g++]=this.edge.pts[h];return e&&(f[g]=b.coord),new jsts.geomgraph.Edge(f,new jsts.geomgraph.Label(this.edge.label))}}(),function(){var a=function(a){this.message=a};a.prototype=new Error,a.prototype.name="AssertionFailedException",jsts.util.AssertionFailedException=a}(),function(){var a=jsts.util.AssertionFailedException;jsts.util.Assert=function(){},jsts.util.Assert.isTrue=function(b,c){if(!b)throw null===c?new a:new a(c)},jsts.util.Assert.equals=function(b,c,d){if(!c.equals(b))throw new a("Expected "+b+" but encountered "+c+(null!=d?": "+d:""))},jsts.util.Assert.shouldNeverReachHere=function(b){throw new a("Should never reach here"+(null!=b?": "+b:""))}}(),function(){var a=jsts.geom.Location,b=jsts.util.Assert,c=javascript.util.ArrayList;jsts.operation.relate.RelateComputer=function(a){this.li=new jsts.algorithm.RobustLineIntersector,this.ptLocator=new jsts.algorithm.PointLocator,this.nodes=new jsts.geomgraph.NodeMap(new jsts.operation.relate.RelateNodeFactory),this.isolatedEdges=new c,this.arg=a},jsts.operation.relate.RelateComputer.prototype.li=null,jsts.operation.relate.RelateComputer.prototype.ptLocator=null,jsts.operation.relate.RelateComputer.prototype.arg=null,jsts.operation.relate.RelateComputer.prototype.nodes=null,jsts.operation.relate.RelateComputer.prototype.im=null,jsts.operation.relate.RelateComputer.prototype.isolatedEdges=null,jsts.operation.relate.RelateComputer.prototype.invalidPoint=null,jsts.operation.relate.RelateComputer.prototype.computeIM=function(){var b=new jsts.geom.IntersectionMatrix;if(b.set(a.EXTERIOR,a.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(b),b;this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1);var c=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(c,b);var d=new jsts.operation.relate.EdgeEndBuilder,e=d.computeEdgeEnds(this.arg[0].getEdgeIterator());this.insertEdgeEnds(e);var f=d.computeEdgeEnds(this.arg[1].getEdgeIterator());return this.insertEdgeEnds(f),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(b),b},jsts.operation.relate.RelateComputer.prototype.insertEdgeEnds=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();this.nodes.add(c)}},jsts.operation.relate.RelateComputer.prototype.computeProperIntersectionIM=function(a,b){var c=this.arg[0].getGeometry().getDimension(),d=this.arg[1].getGeometry().getDimension(),e=a.hasProperIntersection(),f=a.hasProperInteriorIntersection();2===c&&2===d?e&&b.setAtLeast("212101212"):2===c&&1===d?(e&&b.setAtLeast("FFF0FFFF2"),f&&b.setAtLeast("1FFFFF1FF")):1===c&&2===d?(e&&b.setAtLeast("F0FFFFFF2"),f&&b.setAtLeast("1F1FFFFFF")):1===c&&1===d&&f&&b.setAtLeast("0FFFFFFFF")},jsts.operation.relate.RelateComputer.prototype.copyNodesAndLabels=function(a){for(var b=this.arg[a].getNodeIterator();b.hasNext();){var c=b.next(),d=this.nodes.addNode(c.getCoordinate());d.setLabel(a,c.getLabel().getLocation(a))}},jsts.operation.relate.RelateComputer.prototype.computeIntersectionNodes=function(b){for(var c=this.arg[b].getEdgeIterator();c.hasNext();)for(var d=c.next(),e=d.getLabel().getLocation(b),f=d.getEdgeIntersectionList().iterator();f.hasNext();){var g=f.next(),h=this.nodes.addNode(g.coord);e===a.BOUNDARY?h.setLabelBoundary(b):h.getLabel().isNull(b)&&h.setLabel(b,a.INTERIOR)}},jsts.operation.relate.RelateComputer.prototype.labelIntersectionNodes=function(b){for(var c=this.arg[b].getEdgeIterator();c.hasNext();)for(var d=c.next(),e=d.getLabel().getLocation(b),f=d.getEdgeIntersectionList().iterator();f.hasNext();){var g=f.next(),h=this.nodes.find(g.coord);h.getLabel().isNull(b)&&(e===a.BOUNDARY?h.setLabelBoundary(b):h.setLabel(b,a.INTERIOR))}},jsts.operation.relate.RelateComputer.prototype.computeDisjointIM=function(b){var c=this.arg[0].getGeometry();c.isEmpty()||(b.set(a.INTERIOR,a.EXTERIOR,c.getDimension()),b.set(a.BOUNDARY,a.EXTERIOR,c.getBoundaryDimension()));var d=this.arg[1].getGeometry();d.isEmpty()||(b.set(a.EXTERIOR,a.INTERIOR,d.getDimension()),b.set(a.EXTERIOR,a.BOUNDARY,d.getBoundaryDimension()))},jsts.operation.relate.RelateComputer.prototype.labelNodeEdges=function(){for(var a=this.nodes.iterator();a.hasNext();){var b=a.next();b.getEdges().computeLabelling(this.arg)}},jsts.operation.relate.RelateComputer.prototype.updateIM=function(a){for(var b=this.isolatedEdges.iterator();b.hasNext();){var c=b.next();c.updateIM(a)}for(var d=this.nodes.iterator();d.hasNext();){var e=d.next();e.updateIM(a),e.updateIMFromEdges(a)}},jsts.operation.relate.RelateComputer.prototype.labelIsolatedEdges=function(a,b){for(var c=this.arg[a].getEdgeIterator();c.hasNext();){var d=c.next();d.isIsolated()&&(this.labelIsolatedEdge(d,b,this.arg[b].getGeometry()),this.isolatedEdges.add(d))}},jsts.operation.relate.RelateComputer.prototype.labelIsolatedEdge=function(b,c,d){if(d.getDimension()>0){var e=this.ptLocator.locate(b.getCoordinate(),d);b.getLabel().setAllLocations(c,e)}else b.getLabel().setAllLocations(c,a.EXTERIOR)},jsts.operation.relate.RelateComputer.prototype.labelIsolatedNodes=function(){for(var a=this.nodes.iterator();a.hasNext();){var c=a.next(),d=c.getLabel();b.isTrue(d.getGeometryCount()>0,"node with empty label found"),c.isIsolated()&&(d.isNull(0)?this.labelIsolatedNode(c,0):this.labelIsolatedNode(c,1))}},jsts.operation.relate.RelateComputer.prototype.labelIsolatedNode=function(a,b){var c=this.ptLocator.locate(a.getCoordinate(),this.arg[b].getGeometry());a.getLabel().setAllLocations(b,c)}}(),function(){var a=jsts.util.Assert;jsts.geomgraph.GraphComponent=function(a){this.label=a},jsts.geomgraph.GraphComponent.prototype.label=null,jsts.geomgraph.GraphComponent.prototype._isInResult=!1,jsts.geomgraph.GraphComponent.prototype._isCovered=!1,jsts.geomgraph.GraphComponent.prototype._isCoveredSet=!1,jsts.geomgraph.GraphComponent.prototype._isVisited=!1,jsts.geomgraph.GraphComponent.prototype.getLabel=function(){return this.label},jsts.geomgraph.GraphComponent.prototype.setLabel=function(a){return 2===arguments.length?void this.setLabel2.apply(this,arguments):void(this.label=a)},jsts.geomgraph.GraphComponent.prototype.setInResult=function(a){this._isInResult=a},jsts.geomgraph.GraphComponent.prototype.isInResult=function(){return this._isInResult},jsts.geomgraph.GraphComponent.prototype.setCovered=function(a){this._isCovered=a,this._isCoveredSet=!0},jsts.geomgraph.GraphComponent.prototype.isCovered=function(){return this._isCovered},jsts.geomgraph.GraphComponent.prototype.isCoveredSet=function(){return this._isCoveredSet;
  },jsts.geomgraph.GraphComponent.prototype.isVisited=function(){return this._isVisited},jsts.geomgraph.GraphComponent.prototype.setVisited=function(a){this._isVisited=a},jsts.geomgraph.GraphComponent.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.GraphComponent.prototype.computeIM=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.GraphComponent.prototype.isIsolated=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.GraphComponent.prototype.updateIM=function(b){a.isTrue(this.label.getGeometryCount()>=2,"found partial label"),this.computeIM(b)}}(),jsts.geomgraph.Node=function(a,b){this.coord=a,this.edges=b,this.label=new jsts.geomgraph.Label(0,jsts.geom.Location.NONE)},jsts.geomgraph.Node.prototype=new jsts.geomgraph.GraphComponent,jsts.geomgraph.Node.prototype.coord=null,jsts.geomgraph.Node.prototype.edges=null,jsts.geomgraph.Node.prototype.isIsolated=function(){return 1==this.label.getGeometryCount()},jsts.geomgraph.Node.prototype.setLabel2=function(a,b){null===this.label?this.label=new jsts.geomgraph.Label(a,b):this.label.setLocation(a,b)},jsts.geomgraph.Node.prototype.setLabelBoundary=function(a){var b=jsts.geom.Location.NONE;null!==this.label&&(b=this.label.getLocation(a));var c;switch(b){case jsts.geom.Location.BOUNDARY:c=jsts.geom.Location.INTERIOR;break;case jsts.geom.Location.INTERIOR:c=jsts.geom.Location.BOUNDARY;break;default:c=jsts.geom.Location.BOUNDARY}this.label.setLocation(a,c)},jsts.geomgraph.Node.prototype.add=function(a){this.edges.insert(a),a.setNode(this)},jsts.geomgraph.Node.prototype.getCoordinate=function(){return this.coord},jsts.geomgraph.Node.prototype.getEdges=function(){return this.edges},jsts.geomgraph.Node.prototype.isIncidentEdgeInResult=function(){for(var a=this.getEdges().getEdges().iterator();a.hasNext();){var b=a.next();if(b.getEdge().isInResult())return!0}return!1},jsts.geom.Point=function(a,b){this.factory=b,void 0!==a&&(this.coordinate=a)},jsts.geom.Point.prototype=new jsts.geom.Geometry,jsts.geom.Point.constructor=jsts.geom.Point,jsts.geom.Point.CLASS_NAME="jsts.geom.Point",jsts.geom.Point.prototype.coordinate=null,jsts.geom.Point.prototype.getX=function(){return this.coordinate.x},jsts.geom.Point.prototype.getY=function(){return this.coordinate.y},jsts.geom.Point.prototype.getCoordinate=function(){return this.coordinate},jsts.geom.Point.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.coordinate]},jsts.geom.Point.prototype.getCoordinateSequence=function(){return this.isEmpty()?[]:[this.coordinate]},jsts.geom.Point.prototype.isEmpty=function(){return null===this.coordinate},jsts.geom.Point.prototype.equalsExact=function(a,b){return this.isEquivalentClass(a)?this.isEmpty()&&a.isEmpty()?!0:this.equal(a.getCoordinate(),this.getCoordinate(),b):!1},jsts.geom.Point.prototype.getNumPoints=function(){return this.isEmpty()?0:1},jsts.geom.Point.prototype.isSimple=function(){return!0},jsts.geom.Point.prototype.getBoundary=function(){return new jsts.geom.GeometryCollection(null)},jsts.geom.Point.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new jsts.geom.Envelope:new jsts.geom.Envelope(this.coordinate)},jsts.geom.Point.prototype.apply=function(a){if(a instanceof jsts.geom.GeometryFilter||a instanceof jsts.geom.GeometryComponentFilter)a.filter(this);else if(a instanceof jsts.geom.CoordinateFilter){if(this.isEmpty())return;a.filter(this.getCoordinate())}},jsts.geom.Point.prototype.clone=function(){return new jsts.geom.Point(this.coordinate.clone(),this.factory)},jsts.geom.Point.prototype.getDimension=function(){return 0},jsts.geom.Point.prototype.getBoundaryDimension=function(){return jsts.geom.Dimension.FALSE},jsts.geom.Point.prototype.reverse=function(){return this.clone()},jsts.geom.Point.prototype.isValid=function(){return jsts.operation.valid.IsValidOp.isValid(this.getCoordinate())?!0:!1},jsts.geom.Point.prototype.normalize=function(){},jsts.geom.Point.prototype.compareToSameClass=function(a){var b=a;return this.getCoordinate().compareTo(b.getCoordinate())},jsts.geom.Point.prototype.getGeometryType=function(){return"Point"},jsts.geom.Point.prototype.hashCode=function(){return"Point_"+this.coordinate.hashCode()},jsts.geom.Point.prototype.CLASS_NAME="jsts.geom.Point",jsts.geom.Dimension=function(){},jsts.geom.Dimension.P=0,jsts.geom.Dimension.L=1,jsts.geom.Dimension.A=2,jsts.geom.Dimension.FALSE=-1,jsts.geom.Dimension.TRUE=-2,jsts.geom.Dimension.DONTCARE=-3,jsts.geom.Dimension.toDimensionSymbol=function(a){switch(a){case jsts.geom.Dimension.FALSE:return"F";case jsts.geom.Dimension.TRUE:return"T";case jsts.geom.Dimension.DONTCARE:return"*";case jsts.geom.Dimension.P:return"0";case jsts.geom.Dimension.L:return"1";case jsts.geom.Dimension.A:return"2"}throw new jsts.IllegalArgumentError("Unknown dimension value: "+a)},jsts.geom.Dimension.toDimensionValue=function(a){switch(a.toUpperCase()){case"F":return jsts.geom.Dimension.FALSE;case"T":return jsts.geom.Dimension.TRUE;case"*":return jsts.geom.Dimension.DONTCARE;case"0":return jsts.geom.Dimension.P;case"1":return jsts.geom.Dimension.L;case"2":return jsts.geom.Dimension.A}throw new jsts.error.IllegalArgumentError("Unknown dimension symbol: "+a)},function(){var a=jsts.geom.Dimension;jsts.geom.LineString=function(a,b){this.factory=b,this.points=a||[]},jsts.geom.LineString.prototype=new jsts.geom.Geometry,jsts.geom.LineString.constructor=jsts.geom.LineString,jsts.geom.LineString.prototype.points=null,jsts.geom.LineString.prototype.getCoordinates=function(){return this.points},jsts.geom.LineString.prototype.getCoordinateSequence=function(){return this.points},jsts.geom.LineString.prototype.getCoordinateN=function(a){return this.points[a]},jsts.geom.LineString.prototype.getCoordinate=function(){return this.isEmpty()?null:this.getCoordinateN(0)},jsts.geom.LineString.prototype.getDimension=function(){return 1},jsts.geom.LineString.prototype.getBoundaryDimension=function(){return this.isClosed()?a.FALSE:0},jsts.geom.LineString.prototype.isEmpty=function(){return 0===this.points.length},jsts.geom.LineString.prototype.getNumPoints=function(){return this.points.length},jsts.geom.LineString.prototype.getPointN=function(a){return this.getFactory().createPoint(this.points[a])},jsts.geom.LineString.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},jsts.geom.LineString.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},jsts.geom.LineString.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.points.length-1))},jsts.geom.LineString.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},jsts.geom.LineString.prototype.getGeometryType=function(){return"LineString"},jsts.geom.LineString.prototype.getLength=function(){return jsts.algorithm.CGAlgorithms.computeLength(this.points)},jsts.geom.LineString.prototype.getBoundary=function(){return new jsts.operation.BoundaryOp(this).getBoundary()},jsts.geom.LineString.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new jsts.geom.Envelope;var a=new jsts.geom.Envelope;return this.points.forEach(function(b){a.expandToInclude(b)}),a},jsts.geom.LineString.prototype.equalsExact=function(a,b){return this.isEquivalentClass(a)?this.points.length!==a.points.length?!1:this.isEmpty()&&a.isEmpty()?!0:this.points.reduce(function(c,d,e){return c&&jsts.geom.Geometry.prototype.equal(d,a.points[e],b)}):!1},jsts.geom.LineString.prototype.isEquivalentClass=function(a){return a instanceof jsts.geom.LineString},jsts.geom.LineString.prototype.compareToSameClass=function(a){for(var b=a,c=0,d=this.points.length,e=0,f=b.points.length;d>c&&f>e;){var g=this.points[c].compareTo(b.points[e]);if(0!==g)return g;c++,e++}return d>c?1:f>e?-1:0},jsts.geom.LineString.prototype.apply=function(a){if(a instanceof jsts.geom.GeometryFilter||a instanceof jsts.geom.GeometryComponentFilter)a.filter(this);else if(a instanceof jsts.geom.CoordinateFilter)for(var b=0,c=this.points.length;c>b;b++)a.filter(this.points[b]);else a instanceof jsts.geom.CoordinateSequenceFilter&&this.apply2.apply(this,arguments)},jsts.geom.LineString.prototype.apply2=function(a){if(0!==this.points.length){for(var b=0;b<this.points.length&&(a.filter(this.points,b),!a.isDone());b++);a.isGeometryChanged()}},jsts.geom.LineString.prototype.clone=function(){for(var a=[],b=0,c=this.points.length;c>b;b++)a.push(this.points[b].clone());return this.factory.createLineString(a)},jsts.geom.LineString.prototype.normalize=function(){var a,b,c,d,e,f;for(f=this.points.length,b=parseInt(f/2),a=0;b>a;a++)if(c=f-1-a,d=this.points[a],e=this.points[c],!d.equals(e))return void(d.compareTo(e)>0&&this.points.reverse())},jsts.geom.LineString.prototype.CLASS_NAME="jsts.geom.LineString"}(),function(){jsts.geom.Polygon=function(a,b,c){this.shell=a||c.createLinearRing(null),this.holes=b||[],this.factory=c},jsts.geom.Polygon.prototype=new jsts.geom.Geometry,jsts.geom.Polygon.constructor=jsts.geom.Polygon,jsts.geom.Polygon.prototype.getCoordinate=function(){return this.shell.getCoordinate()},jsts.geom.Polygon.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var a=[],b=-1,c=this.shell.getCoordinates(),d=0;d<c.length;d++)b++,a[b]=c[d];for(var e=0;e<this.holes.length;e++)for(var f=this.holes[e].getCoordinates(),g=0;g<f.length;g++)b++,a[b]=f[g];return a},jsts.geom.Polygon.prototype.getNumPoints=function(){for(var a=this.shell.getNumPoints(),b=0;b<this.holes.length;b++)a+=this.holes[b].getNumPoints();return a},jsts.geom.Polygon.prototype.isEmpty=function(){return this.shell.isEmpty()},jsts.geom.Polygon.prototype.isRectangle=function(){if(0!=this.getNumInteriorRing())return!1;if(null==this.shell)return!1;if(5!=this.shell.getNumPoints())return!1;for(var a=this.shell.getCoordinateSequence(),b=this.getEnvelopeInternal(),c=0;5>c;c++){var d=a[c].x;if(d!=b.getMinX()&&d!=b.getMaxX())return!1;var e=a[c].y;if(e!=b.getMinY()&&e!=b.getMaxY())return!1}for(var f=a[0].x,g=a[0].y,c=1;4>=c;c++){var d=a[c].x,e=a[c].y,h=d!=f,i=e!=g;if(h==i)return!1;f=d,g=e}return!0},jsts.geom.Polygon.prototype.getExteriorRing=function(){return this.shell},jsts.geom.Polygon.prototype.getInteriorRingN=function(a){return this.holes[a]},jsts.geom.Polygon.prototype.getNumInteriorRing=function(){return this.holes.length},jsts.geom.Polygon.prototype.getArea=function(){var a=0;a+=Math.abs(jsts.algorithm.CGAlgorithms.signedArea(this.shell.getCoordinateSequence()));for(var b=0;b<this.holes.length;b++)a-=Math.abs(jsts.algorithm.CGAlgorithms.signedArea(this.holes[b].getCoordinateSequence()));return a},jsts.geom.Polygon.prototype.getLength=function(){var a=0;a+=this.shell.getLength();for(var b=0;b<this.holes.length;b++)a+=this.holes[b].getLength();return a},jsts.geom.Polygon.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString(null);var a=[];a[0]=this.shell.clone();for(var b=0,c=this.holes.length;c>b;b++)a[b+1]=this.holes[b].clone();return a.length<=1?a[0]:this.getFactory().createMultiLineString(a)},jsts.geom.Polygon.prototype.computeEnvelopeInternal=function(){return this.shell.getEnvelopeInternal()},jsts.geom.Polygon.prototype.getDimension=function(){return 2},jsts.geom.Polygon.prototype.getBoundaryDimension=function(){return 1},jsts.geom.Polygon.prototype.equalsExact=function(a,b){if(!this.isEquivalentClass(a))return!1;if(this.isEmpty()&&a.isEmpty())return!0;if(this.isEmpty()!==a.isEmpty())return!1;if(!this.shell.equalsExact(a.shell,b))return!1;if(this.holes.length!==a.holes.length)return!1;if(this.holes.length!==a.holes.length)return!1;for(var c=0;c<this.holes.length;c++)if(!this.holes[c].equalsExact(a.holes[c],b))return!1;return!0},jsts.geom.Polygon.prototype.compareToSameClass=function(a){return this.shell.compareToSameClass(a.shell)},jsts.geom.Polygon.prototype.apply=function(a){if(a instanceof jsts.geom.GeometryComponentFilter){a.filter(this),this.shell.apply(a);for(var b=0,c=this.holes.length;c>b;b++)this.holes[b].apply(a)}else if(a instanceof jsts.geom.GeometryFilter)a.filter(this);else if(a instanceof jsts.geom.CoordinateFilter){this.shell.apply(a);for(var b=0,c=this.holes.length;c>b;b++)this.holes[b].apply(a)}else a instanceof jsts.geom.CoordinateSequenceFilter&&this.apply2.apply(this,arguments)},jsts.geom.Polygon.prototype.apply2=function(a){if(this.shell.apply(a),!a.isDone())for(var b=0;b<this.holes.length&&(this.holes[b].apply(a),!a.isDone());b++);a.isGeometryChanged()},jsts.geom.Polygon.prototype.clone=function(){for(var a=[],b=0,c=this.holes.length;c>b;b++)a.push(this.holes[b].clone());return this.factory.createPolygon(this.shell.clone(),a)},jsts.geom.Polygon.prototype.normalize=function(){this.normalize2(this.shell,!0);for(var a=0,b=this.holes.length;b>a;a++)this.normalize2(this.holes[a],!1);this.holes.sort()},jsts.geom.Polygon.prototype.normalize2=function(a,b){if(!a.isEmpty()){var c=a.points.slice(0,a.points.length-1),d=jsts.geom.CoordinateArrays.minCoordinate(a.points);jsts.geom.CoordinateArrays.scroll(c,d),a.points=c.concat(),a.points[c.length]=c[0],jsts.algorithm.CGAlgorithms.isCCW(a.points)===b&&a.points.reverse()}},jsts.geom.Polygon.prototype.getGeometryType=function(){return"Polygon"},jsts.geom.Polygon.prototype.CLASS_NAME="jsts.geom.Polygon"}(),function(){var a=jsts.geom.Geometry,b=javascript.util.TreeSet,c=javascript.util.Arrays;jsts.geom.GeometryCollection=function(a,b){this.geometries=a||[],this.factory=b},jsts.geom.GeometryCollection.prototype=new a,jsts.geom.GeometryCollection.constructor=jsts.geom.GeometryCollection,jsts.geom.GeometryCollection.prototype.isEmpty=function(){for(var a=0,b=this.geometries.length;b>a;a++){var c=this.getGeometryN(a);if(!c.isEmpty())return!1}return!0},jsts.geom.GeometryCollection.prototype.getArea=function(){for(var a=0,b=0,c=this.geometries.length;c>b;b++)a+=this.getGeometryN(b).getArea();return a},jsts.geom.GeometryCollection.prototype.getLength=function(){for(var a=0,b=0,c=this.geometries.length;c>b;b++)a+=this.getGeometryN(b).getLength();return a},jsts.geom.GeometryCollection.prototype.getCoordinate=function(){return this.isEmpty()?null:this.getGeometryN(0).getCoordinate()},jsts.geom.GeometryCollection.prototype.getCoordinates=function(){for(var a=[],b=-1,c=0,d=this.geometries.length;d>c;c++)for(var e=this.getGeometryN(c),f=e.getCoordinates(),g=0;g<f.length;g++)b++,a[b]=f[g];return a},jsts.geom.GeometryCollection.prototype.getNumGeometries=function(){return this.geometries.length},jsts.geom.GeometryCollection.prototype.getGeometryN=function(a){var b=this.geometries[a];return b instanceof jsts.geom.Coordinate&&(b=new jsts.geom.Point(b)),b},jsts.geom.GeometryCollection.prototype.getNumPoints=function(a){for(var b=0,c=0;c<this.geometries.length;c++)b+=this.geometries[c].getNumPoints();return b},jsts.geom.GeometryCollection.prototype.equalsExact=function(a,b){if(!this.isEquivalentClass(a))return!1;if(this.geometries.length!==a.geometries.length)return!1;for(var c=0,d=this.geometries.length;d>c;c++){var e=this.getGeometryN(c);if(!e.equalsExact(a.getGeometryN(c),b))return!1}return!0},jsts.geom.GeometryCollection.prototype.clone=function(){for(var a=[],b=0,c=this.geometries.length;c>b;b++)a.push(this.geometries[b].clone());return this.factory.createGeometryCollection(a)},jsts.geom.GeometryCollection.prototype.normalize=function(){for(var a=0,b=this.geometries.length;b>a;a++)this.getGeometryN(a).normalize();this.geometries.sort()},jsts.geom.GeometryCollection.prototype.compareToSameClass=function(a){var d=new b(c.asList(this.geometries)),e=new b(c.asList(a.geometries));return this.compare(d,e)},jsts.geom.GeometryCollection.prototype.apply=function(a){if(a instanceof jsts.geom.GeometryFilter||a instanceof jsts.geom.GeometryComponentFilter){a.filter(this);for(var b=0,c=this.geometries.length;c>b;b++)this.getGeometryN(b).apply(a)}else if(a instanceof jsts.geom.CoordinateFilter)for(var b=0,c=this.geometries.length;c>b;b++)this.getGeometryN(b).apply(a);else a instanceof jsts.geom.CoordinateSequenceFilter&&this.apply2.apply(this,arguments)},jsts.geom.GeometryCollection.prototype.apply2=function(a){if(0!=this.geometries.length){for(var b=0;b<this.geometries.length&&(this.geometries[b].apply(a),!a.isDone());b++);a.isGeometryChanged()}},jsts.geom.GeometryCollection.prototype.getDimension=function(){for(var a=jsts.geom.Dimension.FALSE,b=0,c=this.geometries.length;c>b;b++){var d=this.getGeometryN(b);a=Math.max(a,d.getDimension())}return a},jsts.geom.GeometryCollection.prototype.computeEnvelopeInternal=function(){for(var a=new jsts.geom.Envelope,b=0,c=this.geometries.length;c>b;b++){var d=this.getGeometryN(b);a.expandToInclude(d.getEnvelopeInternal())}return a},jsts.geom.GeometryCollection.prototype.CLASS_NAME="jsts.geom.GeometryCollection"}(),jsts.algorithm.Centroid=function(a){this.areaBasePt=null,this.triangleCent3=new jsts.geom.Coordinate,this.areasum2=0,this.cg3=new jsts.geom.Coordinate,this.lineCentSum=new jsts.geom.Coordinate,this.totalLength=0,this.ptCount=0,this.ptCentSum=new jsts.geom.Coordinate,this.add(a)},jsts.algorithm.Centroid.getCentroid=function(a){var b=new jsts.algorithm.Centroid(a);return b.getCentroid()},jsts.algorithm.Centroid.centroid3=function(a,b,c,d){d.x=a.x+b.x+c.x,d.y=a.y+b.y+c.y},jsts.algorithm.Centroid.area2=function(a,b,c){return(b.x-a.x)*(c.y-a.y)-(c.x-a.x)*(b.y-a.y)},jsts.algorithm.Centroid.prototype.add=function(a){if(!a.isEmpty())if(a instanceof jsts.geom.Point)this.addPoint(a.getCoordinate());else if(a instanceof jsts.geom.LineString)this.addLineSegments(a.getCoordinates());else if(a instanceof jsts.geom.Polygon)this.addPolygon(a);else if(a instanceof jsts.geom.GeometryCollection)for(var b=0;b<a.getNumGeometries();b++)this.add(a.getGeometryN(b))},jsts.algorithm.Centroid.prototype.getCentroid=function(){var a=new jsts.geom.Coordinate;if(Math.abs(this.areasum2)>0)a.x=this.cg3.x/3/this.areasum2,a.y=this.cg3.y/3/this.areasum2;else if(this.totalLength>0)a.x=this.lineCentSum.x/this.totalLength,a.y=this.lineCentSum.y/this.totalLength;else{if(!(this.ptCount>0))return null;a.x=this.ptCentSum.x/this.ptCount,a.y=this.ptCentSum.y/this.ptCount}return a},jsts.algorithm.Centroid.prototype.setBasePoint=function(a){null===this.areaBasePt&&(this.areaBasePt=a)},jsts.algorithm.Centroid.prototype.addPolygon=function(a){this.addShell(a.getExteriorRing().getCoordinates());for(var b=0;b<a.getNumInteriorRing();b++)this.addHole(a.getInteriorRingN(b).getCoordinates())},jsts.algorithm.Centroid.prototype.addShell=function(a){a.length>0&&this.setBasePoint(a[0]);for(var b=!jsts.algorithm.CGAlgorithms.isCCW(a),c=0;c<a.length-1;c++)this.addTriangle(this.areaBasePt,a[c],a[c+1],b);this.addLineSegments(a)},jsts.algorithm.Centroid.prototype.addHole=function(a){for(var b=jsts.algorithm.CGAlgorithms.isCCW(a),c=0;c<a.length-1;c++)this.addTriangle(this.areaBasePt,a[c],a[c+1],b);this.addLineSegments(a)},jsts.algorithm.Centroid.prototype.addTriangle=function(a,b,c,d){var e=d?1:-1;jsts.algorithm.Centroid.centroid3(a,b,c,this.triangleCent3);var f=jsts.algorithm.Centroid.area2(a,b,c);this.cg3.x+=e*f*this.triangleCent3.x,this.cg3.y+=e*f*this.triangleCent3.y,this.areasum2+=e*f},jsts.algorithm.Centroid.prototype.addLineSegments=function(a){for(var b=0,c=0;c<a.length-1;c++){var d=a[c].distance(a[c+1]);if(0!==d){b+=d;var e=(a[c].x+a[c+1].x)/2;this.lineCentSum.x+=d*e;var f=(a[c].y+a[c+1].y)/2;this.lineCentSum.y+=d*f}}this.totalLength+=b,0===b&&a.length>0&&this.addPoint(a[0])},jsts.algorithm.Centroid.prototype.addPoint=function(a){this.ptCount+=1,this.ptCentSum.x+=a.x,this.ptCentSum.y+=a.y},function(){var a=function(a){this.deList=new javascript.util.ArrayList,this.factory=a};a.findEdgeRingContaining=function(a,b){for(var c=a.getRing(),d=c.getEnvelopeInternal(),e=c.getCoordinateN(0),f=null,g=null,h=b.iterator();h.hasNext();){var i=h.next(),j=i.getRing(),k=j.getEnvelopeInternal();null!=f&&(g=f.getRing().getEnvelopeInternal());var l=!1;k.equals(d)||(e=jsts.geom.CoordinateArrays.ptNotInList(c.getCoordinates(),j.getCoordinates()),k.contains(d)&&jsts.algorithm.CGAlgorithms.isPointInRing(e,j.getCoordinates())&&(l=!0),l&&(null==f||g.contains(k))&&(f=i))}return f},a.ptNotInList=function(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(!isInList(d,b))return d}return null},a.isInList=function(a,b){for(var c=0;c<b.length;c++)if(a.equals(b[c]))return!0;return!1},a.prototype.factory=null,a.prototype.deList=null,a.prototype.ring=null,a.prototype.ringPts=null,a.prototype.holes=null,a.prototype.add=function(a){this.deList.add(a)},a.prototype.isHole=function(){var a=this.getRing();return jsts.algorithm.CGAlgorithms.isCCW(a.getCoordinates())},a.prototype.addHole=function(a){null==this.holes&&(this.holes=new javascript.util.ArrayList),this.holes.add(a)},a.prototype.getPolygon=function(){var a=null;if(null!=this.holes){a=[];for(var b=0;b<this.holes.size();b++)a[b]=this.holes.get(b)}var c=this.factory.createPolygon(this.ring,a);return c},a.prototype.isValid=function(){return this.getCoordinates(),this.ringPts.length<=3?!1:(this.getRing(),this.ring.isValid())},a.prototype.getCoordinates=function(){if(null==this.ringPts){for(var b=new jsts.geom.CoordinateList,c=this.deList.iterator();c.hasNext();){var d=c.next(),e=d.getEdge();a.addEdge(e.getLine().getCoordinates(),d.getEdgeDirection(),b)}this.ringPts=b.toCoordinateArray()}return this.ringPts},a.prototype.getLineString=function(){return this.getCoordinates(),this.factory.createLineString(this.ringPts)},a.prototype.getRing=function(){if(null!=this.ring)return this.ring;this.getCoordinates(),this.ringPts.length<3&&console.log(this.ringPts);try{this.ring=this.factory.createLinearRing(this.ringPts)}catch(a){console.log(this.ringPts)}return this.ring},a.addEdge=function(a,b,c){if(b)for(var d=0;d<a.length;d++)c.add(a[d],!1);else for(var d=a.length-1;d>=0;d--)c.add(a[d],!1)},jsts.operation.polygonize.EdgeRing=a}(),function(){var a=function(){};a.setVisited=function(a,b){for(;a.hasNext();){var c=a.next();c.setVisited(b)}},a.setMarked=function(a,b){for(;a.hasNext();){var c=a.next();c.setMarked(b)}},a.getComponentWithVisitedState=function(a,b){for(;a.hasNext();){var c=a.next();if(c.isVisited()==b)return c}return null},a.prototype._isMarked=!1,a.prototype._isVisited=!1,a.prototype.data,a.prototype.isVisited=function(){return this._isVisited},a.prototype.setVisited=function(a){this._isVisited=a},a.prototype.isMarked=function(){return this._isMarked},a.prototype.setMarked=function(a){this._isMarked=a},a.prototype.setContext=function(a){this.data=a},a.prototype.getContext=function(){return data},a.prototype.setData=function(a){this.data=a},a.prototype.getData=function(){return data},a.prototype.isRemoved=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.planargraph.GraphComponent=a}(),function(){var a=jsts.planargraph.GraphComponent,b=function(a,b){void 0!==a&&this.setDirectedEdges(a,b)};b.prototype=new a,b.prototype.dirEdge=null,b.prototype.setDirectedEdges=function(a,b){this.dirEdge=[a,b],a.setEdge(this),b.setEdge(this),a.setSym(b),b.setSym(a),a.getFromNode().addOutEdge(a),b.getFromNode().addOutEdge(b)},b.prototype.getDirEdge=function(a){return a instanceof jsts.planargraph.Node&&this.getDirEdge2(a),this.dirEdge[a]},b.prototype.getDirEdge2=function(a){return this.dirEdge[0].getFromNode()==a?this.dirEdge[0]:this.dirEdge[1].getFromNode()==a?this.dirEdge[1]:null},b.prototype.getOppositeNode=function(a){return this.dirEdge[0].getFromNode()==a?this.dirEdge[0].getToNode():this.dirEdge[1].getFromNode()==a?this.dirEdge[1].getToNode():null},b.prototype.remove=function(){this.dirEdge=null},b.prototype.isRemoved=function(){return null==dirEdge},jsts.planargraph.Edge=b}(),jsts.operation.polygonize.PolygonizeEdge=function(a){this.line=a},jsts.operation.polygonize.PolygonizeEdge.prototype=new jsts.planargraph.Edge,jsts.operation.polygonize.PolygonizeEdge.prototype.line=null,jsts.operation.polygonize.PolygonizeEdge.prototype.getLine=function(){return this.line},function(){var a=javascript.util.ArrayList,b=jsts.planargraph.GraphComponent,c=function(a,b,c,d){if(void 0!==a){this.from=a,this.to=b,this.edgeDirection=d,this.p0=a.getCoordinate(),this.p1=c;var e=this.p1.x-this.p0.x,f=this.p1.y-this.p0.y;this.quadrant=jsts.geomgraph.Quadrant.quadrant(e,f),this.angle=Math.atan2(f,e)}};c.prototype=new b,c.toEdges=function(b){for(var c=new a,d=b.iterator();d.hasNext();)c.add(d.next().parentEdge);return c},c.prototype.parentEdge=null,c.prototype.from=null,c.prototype.to=null,c.prototype.p0=null,c.prototype.p1=null,c.prototype.sym=null,c.prototype.edgeDirection=null,c.prototype.quadrant=null,c.prototype.angle=null,c.prototype.getEdge=function(){return this.parentEdge},c.prototype.setEdge=function(a){this.parentEdge=a},c.prototype.getQuadrant=function(){return this.quadrant},c.prototype.getDirectionPt=function(){return this.p1},c.prototype.getEdgeDirection=function(){return this.edgeDirection},c.prototype.getFromNode=function(){return this.from},c.prototype.getToNode=function(){return this.to},c.prototype.getCoordinate=function(){return this.from.getCoordinate()},c.prototype.getAngle=function(){return this.angle},c.prototype.getSym=function(){return this.sym},c.prototype.setSym=function(a){this.sym=a},c.prototype.remove=function(){this.sym=null,this.parentEdge=null},c.prototype.isRemoved=function(){return null==this.parentEdge},c.prototype.compareTo=function(a){var b=a;return this.compareDirection(b)},c.prototype.compareDirection=function(a){return this.quadrant>a.quadrant?1:this.quadrant<a.quadrant?-1:jsts.algorithm.CGAlgorithms.computeOrientation(a.p0,a.p1,this.p1)},jsts.planargraph.DirectedEdge=c}(),function(){var a=jsts.planargraph.DirectedEdge,b=function(b,c,d,e){a.apply(this,arguments)};b.prototype=new a,b.prototype.edgeRing=null,b.prototype.next=null,b.prototype.label=-1,b.prototype.getLabel=function(){return this.label},b.prototype.setLabel=function(a){this.label=a},b.prototype.getNext=function(){return this.next},b.prototype.setNext=function(a){this.next=a},b.prototype.isInRing=function(){return null!=this.edgeRing},b.prototype.setRing=function(a){this.edgeRing=a},jsts.operation.polygonize.PolygonizeDirectedEdge=b}(),function(){var a=javascript.util.ArrayList,b=function(){this.outEdges=new a};b.prototype.outEdges=null,b.prototype.sorted=!1,b.prototype.add=function(a){this.outEdges.add(a),this.sorted=!1},b.prototype.remove=function(a){this.outEdges.remove(a)},b.prototype.iterator=function(){return this.sortEdges(),this.outEdges.iterator()},b.prototype.getDegree=function(){return this.outEdges.size()},b.prototype.getCoordinate=function(){var a=iterator();if(!a.hasNext())return null;var b=a.next();return b.getCoordinate()},b.prototype.getEdges=function(){return this.sortEdges(),this.outEdges},b.prototype.sortEdges=function(){if(!this.sorted){var a=this.outEdges.toArray();a.sort(function(a,b){return a.compareTo(b)}),this.outEdges=javascript.util.Arrays.asList(a),this.sorted=!0}},b.prototype.getIndex=function(a){if(a instanceof jsts.planargraph.DirectedEdge)return this.getIndex2(a);if("number"==typeof a)return this.getIndex3(a);this.sortEdges();for(var b=0;b<this.outEdges.size();b++){var c=this.outEdges.get(b);if(c.getEdge()==a)return b}return-1},b.prototype.getIndex2=function(a){this.sortEdges();for(var b=0;b<this.outEdges.size();b++){var c=this.outEdges.get(b);if(c==a)return b}return-1},b.prototype.getIndex3=function(a){var b=toInt(a%this.outEdges.size());return 0>b&&(b+=this.outEdges.size()),b},b.prototype.getNextEdge=function(a){var b=this.getIndex(a);return this.outEdges.get(getIndex(b+1))},b.prototype.getNextCWEdge=function(a){var b=this.getIndex(a);return this.outEdges.get(getIndex(b-1))},jsts.planargraph.DirectedEdgeStar=b}(),function(){var a=jsts.planargraph.GraphComponent,b=jsts.planargraph.DirectedEdgeStar,c=function(a,c){this.pt=a,this.deStar=c||new b};c.prototype=new a,c.getEdgesBetween=function(a,b){var c=DirectedEdge.toEdges(a.getOutEdges().getEdges()),d=new javascript.util.HashSet(c),e=DirectedEdge.toEdges(b.getOutEdges().getEdges());return d.retainAll(e),d},c.prototype.pt=null,c.prototype.deStar=null,c.prototype.getCoordinate=function(){return this.pt},c.prototype.addOutEdge=function(a){this.deStar.add(a)},c.prototype.getOutEdges=function(){return this.deStar},c.prototype.getDegree=function(){return this.deStar.getDegree()},c.prototype.getIndex=function(a){return this.deStar.getIndex(a)},c.prototype.remove=function(a){return void 0===a?this.remove2():void this.deStar.remove(a)},c.prototype.remove2=function(){this.pt=null},c.prototype.isRemoved=function(){return null==this.pt},jsts.planargraph.Node=c}(),function(){var a=function(){this.nodeMap=new javascript.util.TreeMap};a.prototype.nodeMap=null,a.prototype.add=function(a){return this.nodeMap.put(a.getCoordinate(),a),a},a.prototype.remove=function(a){return this.nodeMap.remove(a)},a.prototype.find=function(a){return this.nodeMap.get(a)},a.prototype.iterator=function(){return this.nodeMap.values().iterator()},a.prototype.values=function(){return this.nodeMap.values()},jsts.planargraph.NodeMap=a}(),function(){var a=javascript.util.ArrayList,b=function(){this.edges=new javascript.util.HashSet,this.dirEdges=new javascript.util.HashSet,this.nodeMap=new jsts.planargraph.NodeMap};b.prototype.edges=null,b.prototype.dirEdges=null,b.prototype.nodeMap=null,b.prototype.findNode=function(a){return this.nodeMap.find(a)},b.prototype.add=function(a){return a instanceof jsts.planargraph.Edge?this.add2(a):a instanceof jsts.planargraph.DirectedEdge?this.add3(a):void this.nodeMap.add(a)},b.prototype.add2=function(a){this.edges.add(a),this.add(a.getDirEdge(0)),this.add(a.getDirEdge(1))},b.prototype.add3=function(a){this.dirEdges.add(a)},b.prototype.nodeIterator=function(){return this.nodeMap.iterator()},b.prototype.contains=function(a){return a instanceof jsts.planargraph.DirectedEdge?this.contains2(a):this.edges.contains(a)},b.prototype.contains2=function(a){return this.dirEdges.contains(a)},b.prototype.getNodes=function(){return this.nodeMap.values()},b.prototype.dirEdgeIterator=function(){return this.dirEdges.iterator()},b.prototype.edgeIterator=function(){return this.edges.iterator()},b.prototype.getEdges=function(){return this.edges},b.prototype.remove=function(a){return a instanceof jsts.planargraph.DirectedEdge?this.remove2(a):(this.remove(a.getDirEdge(0)),this.remove(a.getDirEdge(1)),this.edges.remove(a),void this.edge.remove())},b.prototype.remove2=function(a){if(a instanceof jsts.planargraph.Node)return this.remove3(a);var b=a.getSym();null!=b&&b.setSym(null),a.getFromNode().remove(a),a.remove(),this.dirEdges.remove(a)},b.prototype.remove3=function(a){for(var b=a.getOutEdges().getEdges(),c=b.iterator();c.hasNext();){var d=c.next(),e=d.getSym();null!=e&&this.remove(e),this.dirEdges.remove(d);var f=d.getEdge();null!=f&&this.edges.remove(f)}this.nodeMap.remove(a.getCoordinate()),a.remove()},b.prototype.findNodesOfDegree=function(b){for(var c=new a,d=this.nodeIterator();d.hasNext();){var e=d.next();e.getDegree()==b&&c.add(e)}return c},jsts.planargraph.PlanarGraph=b}(),function(){var a=javascript.util.ArrayList,b=javascript.util.Stack,c=javascript.util.HashSet,d=jsts.util.Assert,e=jsts.operation.polygonize.EdgeRing,f=jsts.operation.polygonize.PolygonizeEdge,g=jsts.operation.polygonize.PolygonizeDirectedEdge,h=jsts.planargraph.PlanarGraph,i=jsts.planargraph.Node,j=function(a){h.apply(this),this.factory=a};j.prototype=new h,j.getDegreeNonDeleted=function(a){for(var b=a.getOutEdges().getEdges(),c=0,d=b.iterator();d.hasNext();){var e=d.next();e.isMarked()||c++}return c},j.getDegree=function(a,b){for(var c=a.getOutEdges().getEdges(),d=0,e=c.iterator();e.hasNext();){var f=e.next();f.getLabel()==b&&d++}return d},j.deleteAllEdges=function(a){for(var b=a.getOutEdges().getEdges(),c=b.iterator();c.hasNext();){var d=c.next();d.setMarked(!0);var e=d.getSym();null!=e&&e.setMarked(!0)}},j.prototype.factory=null,j.prototype.addEdge=function(a){if(!a.isEmpty()){var b=jsts.geom.CoordinateArrays.removeRepeatedPoints(a.getCoordinates());
  if(!(b.length<2)){var c=b[0],d=b[b.length-1],e=this.getNode(c),h=this.getNode(d),i=new g(e,h,b[1],!0),j=new g(h,e,b[b.length-2],!1),k=new f(a);k.setDirectedEdges(i,j),this.add(k)}}},j.prototype.getNode=function(a){var b=this.findNode(a);return null==b&&(b=new i(a),this.add(b)),b},j.prototype.computeNextCWEdges=function(){for(var a=this.nodeIterator();a.hasNext();){var b=a.next();j.computeNextCWEdges(b)}},j.prototype.convertMaximalToMinimalEdgeRings=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next(),d=c.getLabel(),e=j.findIntersectionNodes(c,d);if(null!=e)for(var f=e.iterator();f.hasNext();){var g=f.next();j.computeNextCCWEdges(g,d)}}},j.findIntersectionNodes=function(b,c){var e=b,f=null;do{var g=e.getFromNode();j.getDegree(g,c)>1&&(null==f&&(f=new a),f.add(g)),e=e.getNext(),d.isTrue(null!=e,"found null DE in ring"),d.isTrue(e==b||!e.isInRing(),"found DE already in ring")}while(e!=b);return f},j.prototype.getEdgeRings=function(){this.computeNextCWEdges(),j.label(this.dirEdges,-1);var b=j.findLabeledEdgeRings(this.dirEdges);this.convertMaximalToMinimalEdgeRings(b);for(var c=new a,d=this.dirEdges.iterator();d.hasNext();){var e=d.next();if(!e.isMarked()&&!e.isInRing()){var f=this.findEdgeRing(e);c.add(f)}}return c},j.findLabeledEdgeRings=function(b){for(var c=new a,d=1,e=b.iterator();e.hasNext();){var f=e.next();if(!(f.isMarked()||f.getLabel()>=0)){c.add(f);var g=j.findDirEdgesInRing(f);j.label(g,d),d++}}return c},j.prototype.deleteCutEdges=function(){this.computeNextCWEdges(),j.findLabeledEdgeRings(this.dirEdges);for(var b=new a,c=this.dirEdges.iterator();c.hasNext();){var d=c.next();if(!d.isMarked()){var e=d.getSym();if(d.getLabel()==e.getLabel()){d.setMarked(!0),e.setMarked(!0);var f=d.getEdge();b.add(f.getLine())}}}return b},j.label=function(a,b){for(var c=a.iterator();c.hasNext();){var d=c.next();d.setLabel(b)}},j.computeNextCWEdges=function(a){for(var b=a.getOutEdges(),c=null,d=null,e=b.getEdges().iterator();e.hasNext();){var f=e.next();if(!f.isMarked()){if(null==c&&(c=f),null!=d){var g=d.getSym();g.setNext(f)}d=f}}if(null!=d){var g=d.getSym();g.setNext(c)}},j.computeNextCCWEdges=function(a,b){for(var c=a.getOutEdges(),e=null,f=null,g=c.getEdges(),h=g.size()-1;h>=0;h--){var i=g.get(h),j=i.getSym(),k=null;i.getLabel()==b&&(k=i);var l=null;j.getLabel()==b&&(l=j),(null!=k||null!=l)&&(null!=l&&(f=l),null!=k&&(null!=f&&(f.setNext(k),f=null),null==e&&(e=k)))}null!=f&&(d.isTrue(null!=e),f.setNext(e))},j.findDirEdgesInRing=function(b){var c=b,e=new a;do e.add(c),c=c.getNext(),d.isTrue(null!=c,"found null DE in ring"),d.isTrue(c==b||!c.isInRing(),"found DE already in ring");while(c!=b);return e},j.prototype.findEdgeRing=function(a){var b=a,c=new e(this.factory);do c.add(b),b.setRing(c),b=b.getNext(),d.isTrue(null!=b,"found null DE in ring"),d.isTrue(b==a||!b.isInRing(),"found DE already in ring");while(b!=a);return c},j.prototype.deleteDangles=function(){for(var a=this.findNodesOfDegree(1),d=new c,e=new b,f=a.iterator();f.hasNext();)e.push(f.next());for(;!e.isEmpty();){var g=e.pop();j.deleteAllEdges(g);for(var h=g.getOutEdges().getEdges(),f=h.iterator();f.hasNext();){var i=f.next();i.setMarked(!0);var k=i.getSym();null!=k&&k.setMarked(!0);var l=i.getEdge();d.add(l.getLine());var m=i.getToNode();1==j.getDegreeNonDeleted(m)&&e.push(m)}}return d},j.prototype.computeDepthParity=function(){for(;;){var a=null;if(null==a)return;this.computeDepthParity(a)}},j.prototype.computeDepthParity=function(a){},jsts.operation.polygonize.PolygonizeGraph=j}(),jsts.index.strtree.Interval=function(){var a;return 1===arguments.length?(a=arguments[0],jsts.index.strtree.Interval(a.min,a.max)):void(2===arguments.length&&(jsts.util.Assert.isTrue(this.min<=this.max),this.min=arguments[0],this.max=arguments[1]))},jsts.index.strtree.Interval.prototype.min=null,jsts.index.strtree.Interval.prototype.max=null,jsts.index.strtree.Interval.prototype.getCentre=function(){return(this.min+this.max)/2},jsts.index.strtree.Interval.prototype.expandToInclude=function(a){return this.max=Math.max(this.max,a.max),this.min=Math.min(this.min,a.min),this},jsts.index.strtree.Interval.prototype.intersects=function(a){return!(a.min>this.max||a.max<this.min)},jsts.index.strtree.Interval.prototype.equals=function(a){return a instanceof jsts.index.strtree.Interval?(other=a,this.min===other.min&&this.max===other.max):!1},jsts.geom.GeometryFactory=function(a){this.precisionModel=a||new jsts.geom.PrecisionModel},jsts.geom.GeometryFactory.prototype.precisionModel=null,jsts.geom.GeometryFactory.prototype.getPrecisionModel=function(){return this.precisionModel},jsts.geom.GeometryFactory.prototype.createPoint=function(a){var b=new jsts.geom.Point(a,this);return b},jsts.geom.GeometryFactory.prototype.createLineString=function(a){var b=new jsts.geom.LineString(a,this);return b},jsts.geom.GeometryFactory.prototype.createLinearRing=function(a){var b=new jsts.geom.LinearRing(a,this);return b},jsts.geom.GeometryFactory.prototype.createPolygon=function(a,b){var c=new jsts.geom.Polygon(a,b,this);return c},jsts.geom.GeometryFactory.prototype.createMultiPoint=function(a){if(a&&a[0]instanceof jsts.geom.Coordinate){var b,c=[];for(b=0;b<a.length;b++)c.push(this.createPoint(a[b]));a=c}return new jsts.geom.MultiPoint(a,this)},jsts.geom.GeometryFactory.prototype.createMultiLineString=function(a){return new jsts.geom.MultiLineString(a,this)},jsts.geom.GeometryFactory.prototype.createMultiPolygon=function(a){return new jsts.geom.MultiPolygon(a,this)},jsts.geom.GeometryFactory.prototype.buildGeometry=function(a){for(var b=null,c=!1,d=!1,e=a.iterator();e.hasNext();){var f=e.next(),g=f.CLASS_NAME;null===b&&(b=g),g!==b&&(c=!0),f.isGeometryCollectionBase()&&(d=!0)}if(null===b)return this.createGeometryCollection(null);if(c||d)return this.createGeometryCollection(a.toArray());var h=a.get(0),i=a.size()>1;if(i){if(h instanceof jsts.geom.Polygon)return this.createMultiPolygon(a.toArray());if(h instanceof jsts.geom.LineString)return this.createMultiLineString(a.toArray());if(h instanceof jsts.geom.Point)return this.createMultiPoint(a.toArray());jsts.util.Assert.shouldNeverReachHere("Unhandled class: "+h)}return h},jsts.geom.GeometryFactory.prototype.createGeometryCollection=function(a){return new jsts.geom.GeometryCollection(a,this)},jsts.geom.GeometryFactory.prototype.toGeometry=function(a){return a.isNull()?this.createPoint(null):a.getMinX()===a.getMaxX()&&a.getMinY()===a.getMaxY()?this.createPoint(new jsts.geom.Coordinate(a.getMinX(),a.getMinY())):a.getMinX()===a.getMaxX()||a.getMinY()===a.getMaxY()?this.createLineString([new jsts.geom.Coordinate(a.getMinX(),a.getMinY()),new jsts.geom.Coordinate(a.getMaxX(),a.getMaxY())]):this.createPolygon(this.createLinearRing([new jsts.geom.Coordinate(a.getMinX(),a.getMinY()),new jsts.geom.Coordinate(a.getMinX(),a.getMaxY()),new jsts.geom.Coordinate(a.getMaxX(),a.getMaxY()),new jsts.geom.Coordinate(a.getMaxX(),a.getMinY()),new jsts.geom.Coordinate(a.getMinX(),a.getMinY())]),null)},jsts.geomgraph.NodeFactory=function(){},jsts.geomgraph.NodeFactory.prototype.createNode=function(a){return new jsts.geomgraph.Node(a,null)},function(){jsts.geomgraph.Position=function(){},jsts.geomgraph.Position.ON=0,jsts.geomgraph.Position.LEFT=1,jsts.geomgraph.Position.RIGHT=2,jsts.geomgraph.Position.opposite=function(a){return a===jsts.geomgraph.Position.LEFT?jsts.geomgraph.Position.RIGHT:a===jsts.geomgraph.Position.RIGHT?jsts.geomgraph.Position.LEFT:a}}(),jsts.geomgraph.TopologyLocation=function(){if(this.location=[],3===arguments.length){var a=arguments[0],b=arguments[1],c=arguments[2];this.init(3),this.location[jsts.geomgraph.Position.ON]=a,this.location[jsts.geomgraph.Position.LEFT]=b,this.location[jsts.geomgraph.Position.RIGHT]=c}else if(arguments[0]instanceof jsts.geomgraph.TopologyLocation){var d=arguments[0];if(this.init(d.location.length),null!=d)for(var e=0;e<this.location.length;e++)this.location[e]=d.location[e]}else if("number"==typeof arguments[0]){var a=arguments[0];this.init(1),this.location[jsts.geomgraph.Position.ON]=a}else if(arguments[0]instanceof Array){var f=arguments[0];this.init(f.length)}},jsts.geomgraph.TopologyLocation.prototype.location=null,jsts.geomgraph.TopologyLocation.prototype.init=function(a){this.location[a-1]=null,this.setAllLocations(jsts.geom.Location.NONE)},jsts.geomgraph.TopologyLocation.prototype.get=function(a){return a<this.location.length?this.location[a]:jsts.geom.Location.NONE},jsts.geomgraph.TopologyLocation.prototype.isNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]!==jsts.geom.Location.NONE)return!1;return!0},jsts.geomgraph.TopologyLocation.prototype.isAnyNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]===jsts.geom.Location.NONE)return!0;return!1},jsts.geomgraph.TopologyLocation.prototype.isEqualOnSide=function(a,b){return this.location[b]==a.location[b]},jsts.geomgraph.TopologyLocation.prototype.isArea=function(){return this.location.length>1},jsts.geomgraph.TopologyLocation.prototype.isLine=function(){return 1===this.location.length},jsts.geomgraph.TopologyLocation.prototype.flip=function(){if(!(this.location.length<=1)){var a=this.location[jsts.geomgraph.Position.LEFT];this.location[jsts.geomgraph.Position.LEFT]=this.location[jsts.geomgraph.Position.RIGHT],this.location[jsts.geomgraph.Position.RIGHT]=a}},jsts.geomgraph.TopologyLocation.prototype.setAllLocations=function(a){for(var b=0;b<this.location.length;b++)this.location[b]=a},jsts.geomgraph.TopologyLocation.prototype.setAllLocationsIfNull=function(a){for(var b=0;b<this.location.length;b++)this.location[b]===jsts.geom.Location.NONE&&(this.location[b]=a)},jsts.geomgraph.TopologyLocation.prototype.setLocation=function(a,b){void 0!==b?this.location[a]=b:this.setLocation(jsts.geomgraph.Position.ON,a)},jsts.geomgraph.TopologyLocation.prototype.getLocations=function(){return location},jsts.geomgraph.TopologyLocation.prototype.setLocations=function(a,b,c){this.location[jsts.geomgraph.Position.ON]=a,this.location[jsts.geomgraph.Position.LEFT]=b,this.location[jsts.geomgraph.Position.RIGHT]=c},jsts.geomgraph.TopologyLocation.prototype.allPositionsEqual=function(a){for(var b=0;b<this.location.length;b++)if(this.location[b]!==a)return!1;return!0},jsts.geomgraph.TopologyLocation.prototype.merge=function(a){if(a.location.length>this.location.length){var b=[];b[jsts.geomgraph.Position.ON]=this.location[jsts.geomgraph.Position.ON],b[jsts.geomgraph.Position.LEFT]=jsts.geom.Location.NONE,b[jsts.geomgraph.Position.RIGHT]=jsts.geom.Location.NONE,this.location=b}for(var c=0;c<this.location.length;c++)this.location[c]===jsts.geom.Location.NONE&&c<a.location.length&&(this.location[c]=a.location[c])},jsts.geomgraph.Label=function(){this.elt=[];var a,b,c,d,e;4===arguments.length?(a=arguments[0],b=arguments[1],c=arguments[2],e=arguments[3],this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE),this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE),this.elt[a].setLocations(b,c,e)):3===arguments.length?(b=arguments[0],c=arguments[1],e=arguments[2],this.elt[0]=new jsts.geomgraph.TopologyLocation(b,c,e),this.elt[1]=new jsts.geomgraph.TopologyLocation(b,c,e)):2===arguments.length?(a=arguments[0],b=arguments[1],this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE),this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE),this.elt[a].setLocation(b)):arguments[0]instanceof jsts.geomgraph.Label?(d=arguments[0],this.elt[0]=new jsts.geomgraph.TopologyLocation(d.elt[0]),this.elt[1]=new jsts.geomgraph.TopologyLocation(d.elt[1])):"number"==typeof arguments[0]&&(b=arguments[0],this.elt[0]=new jsts.geomgraph.TopologyLocation(b),this.elt[1]=new jsts.geomgraph.TopologyLocation(b))},jsts.geomgraph.Label.toLineLabel=function(a){var b,c=new jsts.geomgraph.Label(jsts.geom.Location.NONE);for(b=0;2>b;b++)c.setLocation(b,a.getLocation(b));return c},jsts.geomgraph.Label.prototype.elt=null,jsts.geomgraph.Label.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},jsts.geomgraph.Label.prototype.getLocation=function(a,b){return 1==arguments.length?this.getLocation2.apply(this,arguments):this.elt[a].get(b)},jsts.geomgraph.Label.prototype.getLocation2=function(a){return this.elt[a].get(jsts.geomgraph.Position.ON)},jsts.geomgraph.Label.prototype.setLocation=function(a,b,c){return 2==arguments.length?void this.setLocation2.apply(this,arguments):void this.elt[a].setLocation(b,c)},jsts.geomgraph.Label.prototype.setLocation2=function(a,b){this.elt[a].setLocation(jsts.geomgraph.Position.ON,b)},jsts.geomgraph.Label.prototype.setAllLocations=function(a,b){this.elt[a].setAllLocations(b)},jsts.geomgraph.Label.prototype.setAllLocationsIfNull=function(a,b){return 1==arguments.length?void this.setAllLocationsIfNull2.apply(this,arguments):void this.elt[a].setAllLocationsIfNull(b)},jsts.geomgraph.Label.prototype.setAllLocationsIfNull2=function(a){this.setAllLocationsIfNull(0,a),this.setAllLocationsIfNull(1,a)},jsts.geomgraph.Label.prototype.merge=function(a){var b;for(b=0;2>b;b++)null===this.elt[b]&&null!==a.elt[b]?this.elt[b]=new jsts.geomgraph.TopologyLocation(a.elt[b]):this.elt[b].merge(a.elt[b])},jsts.geomgraph.Label.prototype.getGeometryCount=function(){var a=0;return this.elt[0].isNull()||a++,this.elt[1].isNull()||a++,a},jsts.geomgraph.Label.prototype.isNull=function(a){return this.elt[a].isNull()},jsts.geomgraph.Label.prototype.isAnyNull=function(a){return this.elt[a].isAnyNull()},jsts.geomgraph.Label.prototype.isArea=function(){return 1==arguments.length?this.isArea2(arguments[0]):this.elt[0].isArea()||this.elt[1].isArea()},jsts.geomgraph.Label.prototype.isArea2=function(a){return this.elt[a].isArea()},jsts.geomgraph.Label.prototype.isLine=function(a){return this.elt[a].isLine()},jsts.geomgraph.Label.prototype.isEqualOnSide=function(a,b){return this.elt[0].isEqualOnSide(a.elt[0],b)&&this.elt[1].isEqualOnSide(a.elt[1],b)},jsts.geomgraph.Label.prototype.allPositionsEqual=function(a,b){return this.elt[a].allPositionsEqual(b)},jsts.geomgraph.Label.prototype.toLine=function(a){this.elt[a].isArea()&&(this.elt[a]=new jsts.geomgraph.TopologyLocation(this.elt[a].location[0]))},jsts.geomgraph.EdgeRing=function(a,b){this.edges=[],this.pts=[],this.holes=[],this.label=new jsts.geomgraph.Label(jsts.geom.Location.NONE),this.geometryFactory=b,a&&(this.computePoints(a),this.computeRing())},jsts.geomgraph.EdgeRing.prototype.startDe=null,jsts.geomgraph.EdgeRing.prototype.maxNodeDegree=-1,jsts.geomgraph.EdgeRing.prototype.edges=null,jsts.geomgraph.EdgeRing.prototype.pts=null,jsts.geomgraph.EdgeRing.prototype.label=null,jsts.geomgraph.EdgeRing.prototype.ring=null,jsts.geomgraph.EdgeRing.prototype._isHole=null,jsts.geomgraph.EdgeRing.prototype.shell=null,jsts.geomgraph.EdgeRing.prototype.holes=null,jsts.geomgraph.EdgeRing.prototype.geometryFactory=null,jsts.geomgraph.EdgeRing.prototype.isIsolated=function(){return 1==this.label.getGeometryCount()},jsts.geomgraph.EdgeRing.prototype.isHole=function(){return this._isHole},jsts.geomgraph.EdgeRing.prototype.getCoordinate=function(a){return this.pts[a]},jsts.geomgraph.EdgeRing.prototype.getLinearRing=function(){return this.ring},jsts.geomgraph.EdgeRing.prototype.getLabel=function(){return this.label},jsts.geomgraph.EdgeRing.prototype.isShell=function(){return null===this.shell},jsts.geomgraph.EdgeRing.prototype.getShell=function(){return this.shell},jsts.geomgraph.EdgeRing.prototype.setShell=function(a){this.shell=a,null!==a&&a.addHole(this)},jsts.geomgraph.EdgeRing.prototype.addHole=function(a){this.holes.push(a)},jsts.geomgraph.EdgeRing.prototype.toPolygon=function(a){for(var b=[],c=0;c<this.holes.length;c++)b[c]=this.holes[c].getLinearRing();var d=this.geometryFactory.createPolygon(this.getLinearRing(),b);return d},jsts.geomgraph.EdgeRing.prototype.computeRing=function(){if(null===this.ring){for(var a=[],b=0;b<this.pts.length;b++)a[b]=this.pts[b];this.ring=this.geometryFactory.createLinearRing(a),this._isHole=jsts.algorithm.CGAlgorithms.isCCW(this.ring.getCoordinates())}},jsts.geomgraph.EdgeRing.prototype.getNext=function(a){throw new jsts.error.AbstractInvocationError},jsts.geomgraph.EdgeRing.prototype.setEdgeRing=function(a,b){throw new jsts.error.AbstractInvocationError},jsts.geomgraph.EdgeRing.prototype.getEdges=function(){return this.edges},jsts.geomgraph.EdgeRing.prototype.computePoints=function(a){this.startDe=a;var b=a,c=!0;do{if(null===b)throw new jsts.error.TopologyError("Found null DirectedEdge");if(b.getEdgeRing()===this)throw new jsts.error.TopologyError("Directed Edge visited twice during ring-building at "+b.getCoordinate());this.edges.push(b);var d=b.getLabel();jsts.util.Assert.isTrue(d.isArea()),this.mergeLabel(d),this.addPoints(b.getEdge(),b.isForward(),c),c=!1,this.setEdgeRing(b,this),b=this.getNext(b)}while(b!==this.startDe)},jsts.geomgraph.EdgeRing.prototype.getMaxNodeDegree=function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},jsts.geomgraph.EdgeRing.prototype.computeMaxNodeDegree=function(){this.maxNodeDegree=0;var a=this.startDe;do{var b=a.getNode(),c=b.getEdges().getOutgoingDegree(this);c>this.maxNodeDegree&&(this.maxNodeDegree=c),a=this.getNext(a)}while(a!==this.startDe);this.maxNodeDegree*=2},jsts.geomgraph.EdgeRing.prototype.setInResult=function(){var a=this.startDe;do a.getEdge().setInResult(!0),a=a.getNext();while(a!=this.startDe)},jsts.geomgraph.EdgeRing.prototype.mergeLabel=function(a){this.mergeLabel2(a,0),this.mergeLabel2(a,1)},jsts.geomgraph.EdgeRing.prototype.mergeLabel2=function(a,b){var c=a.getLocation(b,jsts.geomgraph.Position.RIGHT);return c!=jsts.geom.Location.NONE&&this.label.getLocation(b)===jsts.geom.Location.NONE?void this.label.setLocation(b,c):void 0},jsts.geomgraph.EdgeRing.prototype.addPoints=function(a,b,c){var d=a.getCoordinates();if(b){var e=1;c&&(e=0);for(var f=e;f<d.length;f++)this.pts.push(d[f])}else{var e=d.length-2;c&&(e=d.length-1);for(var f=e;f>=0;f--)this.pts.push(d[f])}},jsts.geomgraph.EdgeRing.prototype.containsPoint=function(a){var b=this.getLinearRing(),c=b.getEnvelopeInternal();if(!c.contains(a))return!1;if(!jsts.algorithm.CGAlgorithms.isPointInRing(a,b.getCoordinates()))return!1;for(var d=0;d<this.holes.length;d++){var e=this.holes[d];if(e.containsPoint(a))return!1}return!0},function(){jsts.geom.LinearRing=function(a,b){jsts.geom.LineString.apply(this,arguments)},jsts.geom.LinearRing.prototype=new jsts.geom.LineString,jsts.geom.LinearRing.constructor=jsts.geom.LinearRing,jsts.geom.LinearRing.prototype.getBoundaryDimension=function(){return jsts.geom.Dimension.FALSE},jsts.geom.LinearRing.prototype.isSimple=function(){return!0},jsts.geom.LinearRing.prototype.getGeometryType=function(){return"LinearRing"},jsts.geom.LinearRing.MINIMUM_VALID_SIZE=4,jsts.geom.LinearRing.prototype.CLASS_NAME="jsts.geom.LinearRing"}(),jsts.index.strtree.Boundable=function(){},jsts.index.strtree.Boundable.prototype.getBounds=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractNode=function(a){this.level=a,this.childBoundables=[]},jsts.index.strtree.AbstractNode.prototype=new jsts.index.strtree.Boundable,jsts.index.strtree.AbstractNode.constructor=jsts.index.strtree.AbstractNode,jsts.index.strtree.AbstractNode.prototype.childBoundables=null,jsts.index.strtree.AbstractNode.prototype.bounds=null,jsts.index.strtree.AbstractNode.prototype.level=null,jsts.index.strtree.AbstractNode.prototype.getChildBoundables=function(){return this.childBoundables},jsts.index.strtree.AbstractNode.prototype.computeBounds=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractNode.prototype.getBounds=function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},jsts.index.strtree.AbstractNode.prototype.getLevel=function(){return this.level},jsts.index.strtree.AbstractNode.prototype.addChildBoundable=function(a){this.childBoundables.push(a)},function(){jsts.noding.Noder=function(){},jsts.noding.Noder.prototype.computeNodes=jsts.abstractFunc,jsts.noding.Noder.prototype.getNodedSubstrings=jsts.abstractFunc}(),function(){var a=jsts.noding.Noder;jsts.noding.SinglePassNoder=function(){},jsts.noding.SinglePassNoder.prototype=new a,jsts.noding.SinglePassNoder.constructor=jsts.noding.SinglePassNoder,jsts.noding.SinglePassNoder.prototype.segInt=null,jsts.noding.SinglePassNoder.prototype.setSegmentIntersector=function(a){this.segInt=a}}(),jsts.index.SpatialIndex=function(){},jsts.index.SpatialIndex.prototype.insert=function(a,b){throw new jsts.error.AbstractMethodInvocationError},jsts.index.SpatialIndex.prototype.query=function(a,b){throw new jsts.error.AbstractMethodInvocationError},jsts.index.SpatialIndex.prototype.remove=function(a,b){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree=function(a){void 0!==a&&(this.itemBoundables=[],jsts.util.Assert.isTrue(a>1,"Node capacity must be greater than 1"),this.nodeCapacity=a)},jsts.index.strtree.AbstractSTRtree.IntersectsOp=function(){},jsts.index.strtree.AbstractSTRtree.IntersectsOp.prototype.intersects=function(a,b){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.root=null,jsts.index.strtree.AbstractSTRtree.prototype.built=!1,jsts.index.strtree.AbstractSTRtree.prototype.itemBoundables=null,jsts.index.strtree.AbstractSTRtree.prototype.nodeCapacity=null,jsts.index.strtree.AbstractSTRtree.prototype.build=function(){jsts.util.Assert.isTrue(!this.built),this.root=0===this.itemBoundables.length?this.createNode(0):this.createHigherLevels(this.itemBoundables,-1),this.built=!0},jsts.index.strtree.AbstractSTRtree.prototype.createNode=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.createParentBoundables=function(a,b){jsts.util.Assert.isTrue(!(0===a.length));var c=[];c.push(this.createNode(b));for(var d=[],e=0;e<a.length;e++)d.push(a[e]);d.sort(this.getComparator());for(var e=0;e<d.length;e++){var f=d[e];this.lastNode(c).getChildBoundables().length===this.getNodeCapacity()&&c.push(this.createNode(b)),this.lastNode(c).addChildBoundable(f)}return c},jsts.index.strtree.AbstractSTRtree.prototype.lastNode=function(a){return a[a.length-1]},jsts.index.strtree.AbstractSTRtree.prototype.compareDoubles=function(a,b){return a>b?1:b>a?-1:0},jsts.index.strtree.AbstractSTRtree.prototype.createHigherLevels=function(a,b){jsts.util.Assert.isTrue(!(0===a.length));var c=this.createParentBoundables(a,b+1);return 1===c.length?c[0]:this.createHigherLevels(c,b+1)},jsts.index.strtree.AbstractSTRtree.prototype.getRoot=function(){return this.built||this.build(),this.root},jsts.index.strtree.AbstractSTRtree.prototype.getNodeCapacity=function(){return this.nodeCapacity},jsts.index.strtree.AbstractSTRtree.prototype.size=function(){return 1===arguments.length?this.size2(arguments[0]):(this.built||this.build(),0===this.itemBoundables.length?0:this.size2(root))},jsts.index.strtree.AbstractSTRtree.prototype.size2=function(a){for(var b=0,c=a.getChildBoundables(),d=0;d<c.length;d++){var e=c[d];e instanceof jsts.index.strtree.AbstractNode?b+=this.size(e):e instanceof jsts.index.strtree.ItemBoundable&&(b+=1)}return b},jsts.index.strtree.AbstractSTRtree.prototype.depth=function(){return 1===arguments.length?this.depth2(arguments[0]):(this.built||this.build(),0===this.itemBoundables.length?0:this.depth2(root))},jsts.index.strtree.AbstractSTRtree.prototype.depth2=function(){for(var a=0,b=node.getChildBoundables(),c=0;c<b.length;c++){var d=b[c];if(d instanceof jsts.index.strtree.AbstractNode){var e=this.depth(d);e>a&&(a=e)}}return a+1},jsts.index.strtree.AbstractSTRtree.prototype.insert=function(a,b){jsts.util.Assert.isTrue(!this.built,"Cannot insert items into an STR packed R-tree after it has been built."),this.itemBoundables.push(new jsts.index.strtree.ItemBoundable(a,b))},jsts.index.strtree.AbstractSTRtree.prototype.query=function(a){arguments.length>1&&this.query2.apply(this,arguments),this.built||this.build();var b=[];return 0===this.itemBoundables.length?(jsts.util.Assert.isTrue(null===this.root.getBounds()),b):(this.getIntersectsOp().intersects(this.root.getBounds(),a)&&this.query3(a,this.root,b),b)},jsts.index.strtree.AbstractSTRtree.prototype.query2=function(a,b){arguments.length>2&&this.query3.apply(this,arguments),this.built||this.build(),0===this.itemBoundables.length&&jsts.util.Assert.isTrue(null===this.root.getBounds()),this.getIntersectsOp().intersects(this.root.getBounds(),a)&&this.query4(a,this.root,b)},jsts.index.strtree.AbstractSTRtree.prototype.query3=function(a,b,c){arguments[2]instanceof Array||this.query4.apply(this,arguments);for(var d=b.getChildBoundables(),e=0;e<d.length;e++){var f=d[e];this.getIntersectsOp().intersects(f.getBounds(),a)&&(f instanceof jsts.index.strtree.AbstractNode?this.query3(a,f,c):f instanceof jsts.index.strtree.ItemBoundable?c.push(f.getItem()):jsts.util.Assert.shouldNeverReachHere())}},jsts.index.strtree.AbstractSTRtree.prototype.query4=function(a,b,c){for(var d=b.getChildBoundables(),e=0;e<d.length;e++){var f=d[e];this.getIntersectsOp().intersects(f.getBounds(),a)&&(f instanceof jsts.index.strtree.AbstractNode?this.query4(a,f,c):f instanceof jsts.index.strtree.ItemBoundable?c.visitItem(f.getItem()):jsts.util.Assert.shouldNeverReachHere())}},jsts.index.strtree.AbstractSTRtree.prototype.getIntersectsOp=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.itemsTree=function(){if(1===arguments.length)return this.itemsTree2.apply(this,arguments);this.built||this.build();var a=this.itemsTree2(this.root);return null===a?[]:a},jsts.index.strtree.AbstractSTRtree.prototype.itemsTree2=function(a){for(var b=[],c=a.getChildBoundables(),d=0;d<c.length;d++){var e=c[d];if(e instanceof jsts.index.strtree.AbstractNode){var f=this.itemsTree(e);null!=f&&b.push(f)}else e instanceof jsts.index.strtree.ItemBoundable?b.push(e.getItem()):jsts.util.Assert.shouldNeverReachHere()}return b.length<=0?null:b},jsts.index.strtree.AbstractSTRtree.prototype.remove=function(a,b){return this.built||this.build(),0===this.itemBoundables.length&&jsts.util.Assert.isTrue(null==this.root.getBounds()),this.getIntersectsOp().intersects(this.root.getBounds(),a)?this.remove2(a,this.root,b):!1},jsts.index.strtree.AbstractSTRtree.prototype.remove2=function(a,b,c){var d=this.removeItem(b,c);if(d)return!0;for(var e=null,f=b.getChildBoundables(),g=0;g<f.length;g++){var h=f[g];if(this.getIntersectsOp().intersects(h.getBounds(),a)&&h instanceof jsts.index.strtree.AbstractNode&&(d=this.remove(a,h,c))){e=h;break}}return null!=e&&0===e.getChildBoundables().length&&f.splice(f.indexOf(e),1),d},jsts.index.strtree.AbstractSTRtree.prototype.removeItem=function(a,b){for(var c=null,d=a.getChildBoundables(),e=0;e<d.length;e++){var f=d[e];f instanceof jsts.index.strtree.ItemBoundable&&f.getItem()===b&&(c=f)}return null!==c?(d.splice(d.indexOf(c),1),!0):!1},jsts.index.strtree.AbstractSTRtree.prototype.boundablesAtLevel=function(a){if(arguments.length>1)return void this.boundablesAtLevel2.apply(this,arguments);var b=[];return this.boundablesAtLevel2(a,this.root,b),b},jsts.index.strtree.AbstractSTRtree.prototype.boundablesAtLevel2=function(a,b,c){if(jsts.util.Assert.isTrue(a>-2),b.getLevel()===a)return void c.add(b);for(var d=node.getChildBoundables(),e=0;e<d.length;e++){var f=d[e];f instanceof jsts.index.strtree.AbstractNode?this.boundablesAtLevel(a,f,c):(jsts.util.Assert.isTrue(f instanceof jsts.index.strtree.ItemBoundable),-1===a&&c.add(f))}},jsts.index.strtree.AbstractSTRtree.prototype.getComparator=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.STRtree=function(a){a=a||jsts.index.strtree.STRtree.DEFAULT_NODE_CAPACITY,jsts.index.strtree.AbstractSTRtree.call(this,a)},jsts.index.strtree.STRtree.prototype=new jsts.index.strtree.AbstractSTRtree,jsts.index.strtree.STRtree.constructor=jsts.index.strtree.STRtree,jsts.index.strtree.STRtree.prototype.xComparator=function(a,b){return jsts.index.strtree.AbstractSTRtree.prototype.compareDoubles(jsts.index.strtree.STRtree.prototype.centreX(a.getBounds()),jsts.index.strtree.STRtree.prototype.centreX(b.getBounds()))},jsts.index.strtree.STRtree.prototype.yComparator=function(a,b){return jsts.index.strtree.AbstractSTRtree.prototype.compareDoubles(jsts.index.strtree.STRtree.prototype.centreY(a.getBounds()),jsts.index.strtree.STRtree.prototype.centreY(b.getBounds()))},jsts.index.strtree.STRtree.prototype.centreX=function(a){return jsts.index.strtree.STRtree.prototype.avg(a.getMinX(),a.getMaxX())},jsts.index.strtree.STRtree.prototype.centreY=function(a){return jsts.index.strtree.STRtree.prototype.avg(a.getMinY(),a.getMaxY())},jsts.index.strtree.STRtree.prototype.avg=function(a,b){return(a+b)/2},jsts.index.strtree.STRtree.prototype.intersectsOp={intersects:function(a,b){return a.intersects(b)}},jsts.index.strtree.STRtree.prototype.createParentBoundables=function(a,b){jsts.util.Assert.isTrue(!(0===a.length));for(var c=Math.ceil(a.length/this.getNodeCapacity()),d=[],e=0;e<a.length;e++)d.push(a[e]);d.sort(this.xComparator);var f=this.verticalSlices(d,Math.ceil(Math.sqrt(c)));return this.createParentBoundablesFromVerticalSlices(f,b)},jsts.index.strtree.STRtree.prototype.createParentBoundablesFromVerticalSlices=function(a,b){jsts.util.Assert.isTrue(a.length>0);for(var c=[],d=0;d<a.length;d++)c=c.concat(this.createParentBoundablesFromVerticalSlice(a[d],b));return c},jsts.index.strtree.STRtree.prototype.createParentBoundablesFromVerticalSlice=function(a,b){return jsts.index.strtree.AbstractSTRtree.prototype.createParentBoundables.call(this,a,b)},jsts.index.strtree.STRtree.prototype.verticalSlices=function(a,b){for(var c,d,e=Math.ceil(a.length/b),f=[],g=0,h=0;b>h;h++)for(f[h]=[],c=0;g<a.length&&e>c;)d=a[g++],f[h].push(d),c++;return f},jsts.index.strtree.STRtree.DEFAULT_NODE_CAPACITY=10,jsts.index.strtree.STRtree.prototype.createNode=function(a){var b=new jsts.index.strtree.AbstractNode(a);return b.computeBounds=function(){for(var a=null,b=this.getChildBoundables(),c=0;c<b.length;c++){var d=b[c];null===a?a=new jsts.geom.Envelope(d.getBounds()):a.expandToInclude(d.getBounds())}return a},b},jsts.index.strtree.STRtree.prototype.getIntersectsOp=function(){return this.intersectsOp},jsts.index.strtree.STRtree.prototype.insert=function(a,b){a.isNull()||jsts.index.strtree.AbstractSTRtree.prototype.insert.call(this,a,b)},jsts.index.strtree.STRtree.prototype.query=function(a,b){return jsts.index.strtree.AbstractSTRtree.prototype.query.apply(this,arguments)},jsts.index.strtree.STRtree.prototype.remove=function(a,b){return jsts.index.strtree.AbstractSTRtree.prototype.remove.call(this,a,b)},jsts.index.strtree.STRtree.prototype.size=function(){return jsts.index.strtree.AbstractSTRtree.prototype.size.call(this)},jsts.index.strtree.STRtree.prototype.depth=function(){return jsts.index.strtree.AbstractSTRtree.prototype.depth.call(this)},jsts.index.strtree.STRtree.prototype.getComparator=function(){return this.yComparator},jsts.index.strtree.STRtree.prototype.nearestNeighbour=function(a){var b=new jsts.index.strtree.BoundablePair(this.getRoot(),this.getRoot(),a);return this.nearestNeighbour4(b)},jsts.index.strtree.STRtree.prototype.nearestNeighbour2=function(a,b,c){var d=new jsts.index.strtree.ItemBoundable(a,b),e=new jsts.index.strtree.BoundablePair(this.getRoot(),d,c);return this.nearestNeighbour4(e)[0]},jsts.index.strtree.STRtree.prototype.nearestNeighbour3=function(a,b){var c=new jsts.index.strtree.BoundablePair(this.getRoot(),a.getRoot(),b);return this.nearestNeighbour4(c)},jsts.index.strtree.STRtree.prototype.nearestNeighbour4=function(a){return this.nearestNeighbour5(a,Double.POSITIVE_INFINITY)},jsts.index.strtree.STRtree.prototype.nearestNeighbour5=function(a,b){var c=b,d=null,e=[];for(e.push(a);!e.isEmpty()&&c>0;){var f=e.pop(),g=f.getDistance();if(g>=c)break;f.isLeaves()?(c=g,d=f):f.expandToQueue(e,c);
  }return[d.getBoundable(0).getItem(),d.getBoundable(1).getItem()]},jsts.noding.SegmentString=function(){},jsts.noding.SegmentString.prototype.getData=jsts.abstractFunc,jsts.noding.SegmentString.prototype.setData=jsts.abstractFunc,jsts.noding.SegmentString.prototype.size=jsts.abstractFunc,jsts.noding.SegmentString.prototype.getCoordinate=jsts.abstractFunc,jsts.noding.SegmentString.prototype.getCoordinates=jsts.abstractFunc,jsts.noding.SegmentString.prototype.isClosed=jsts.abstractFunc,jsts.noding.NodableSegmentString=function(){},jsts.noding.NodableSegmentString.prototype=new jsts.noding.SegmentString,jsts.noding.NodableSegmentString.prototype.addIntersection=jsts.abstractFunc,jsts.noding.NodedSegmentString=function(a,b){this.nodeList=new jsts.noding.SegmentNodeList(this),this.pts=a,this.data=b},jsts.noding.NodedSegmentString.prototype=new jsts.noding.NodableSegmentString,jsts.noding.NodedSegmentString.constructor=jsts.noding.NodedSegmentString,jsts.noding.NodedSegmentString.getNodedSubstrings=function(a){if(2===arguments.length)return void jsts.noding.NodedSegmentString.getNodedSubstrings2.apply(this,arguments);var b=new javascript.util.ArrayList;return jsts.noding.NodedSegmentString.getNodedSubstrings2(a,b),b},jsts.noding.NodedSegmentString.getNodedSubstrings2=function(a,b){for(var c=a.iterator();c.hasNext();){var d=c.next();d.getNodeList().addSplitEdges(b)}},jsts.noding.NodedSegmentString.prototype.nodeList=null,jsts.noding.NodedSegmentString.prototype.pts=null,jsts.noding.NodedSegmentString.prototype.data=null,jsts.noding.NodedSegmentString.prototype.getData=function(){return this.data},jsts.noding.NodedSegmentString.prototype.setData=function(a){this.data=a},jsts.noding.NodedSegmentString.prototype.getNodeList=function(){return this.nodeList},jsts.noding.NodedSegmentString.prototype.size=function(){return this.pts.length},jsts.noding.NodedSegmentString.prototype.getCoordinate=function(a){return this.pts[a]},jsts.noding.NodedSegmentString.prototype.getCoordinates=function(){return this.pts},jsts.noding.NodedSegmentString.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.noding.NodedSegmentString.prototype.getSegmentOctant=function(a){return a===this.pts.length-1?-1:this.safeOctant(this.getCoordinate(a),this.getCoordinate(a+1))},jsts.noding.NodedSegmentString.prototype.safeOctant=function(a,b){return a.equals2D(b)?0:jsts.noding.Octant.octant(a,b)},jsts.noding.NodedSegmentString.prototype.addIntersections=function(a,b,c){for(var d=0;d<a.getIntersectionNum();d++)this.addIntersection(a,b,c,d)},jsts.noding.NodedSegmentString.prototype.addIntersection=function(a,b,c,d){if(a instanceof jsts.geom.Coordinate)return void this.addIntersection2.apply(this,arguments);var e=new jsts.geom.Coordinate(a.getIntersection(d));this.addIntersection2(e,b)},jsts.noding.NodedSegmentString.prototype.addIntersection2=function(a,b){this.addIntersectionNode(a,b)},jsts.noding.NodedSegmentString.prototype.addIntersectionNode=function(a,b){var c=b,d=c+1;if(d<this.pts.length){var e=this.pts[d];a.equals2D(e)&&(c=d)}var f=this.nodeList.add(a,c);return f},jsts.noding.NodedSegmentString.prototype.toString=function(){var a=new jsts.geom.GeometryFactory;return(new jsts.io.WKTWriter).write(a.createLineString(this.pts))},jsts.index.chain.MonotoneChainBuilder=function(){},jsts.index.chain.MonotoneChainBuilder.toIntArray=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b},jsts.index.chain.MonotoneChainBuilder.getChains=function(a){return 2===arguments.length?jsts.index.chain.MonotoneChainBuilder.getChains2.apply(this,arguments):jsts.index.chain.MonotoneChainBuilder.getChains2(a,null)},jsts.index.chain.MonotoneChainBuilder.getChains2=function(a,b){for(var c=[],d=jsts.index.chain.MonotoneChainBuilder.getChainStartIndices(a),e=0;e<d.length-1;e++){var f=new jsts.index.chain.MonotoneChain(a,d[e],d[e+1],b);c.push(f)}return c},jsts.index.chain.MonotoneChainBuilder.getChainStartIndices=function(a){var b=0,c=[];c.push(b);do{var d=jsts.index.chain.MonotoneChainBuilder.findChainEnd(a,b);c.push(d),b=d}while(b<a.length-1);var e=jsts.index.chain.MonotoneChainBuilder.toIntArray(c);return e},jsts.index.chain.MonotoneChainBuilder.findChainEnd=function(a,b){for(var c=b;c<a.length-1&&a[c].equals2D(a[c+1]);)c++;if(c>=a.length-1)return a.length-1;for(var d=jsts.geomgraph.Quadrant.quadrant(a[c],a[c+1]),e=b+1;e<a.length;){if(!a[e-1].equals2D(a[e])){var f=jsts.geomgraph.Quadrant.quadrant(a[e-1],a[e]);if(f!==d)break}e++}return e-1},jsts.algorithm.LineIntersector=function(){this.inputLines=[[],[]],this.intPt=[null,null],this.pa=this.intPt[0],this.pb=this.intPt[1],this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION},jsts.algorithm.LineIntersector.NO_INTERSECTION=0,jsts.algorithm.LineIntersector.POINT_INTERSECTION=1,jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION=2,jsts.algorithm.LineIntersector.prototype.setPrecisionModel=function(a){this.precisionModel=a},jsts.algorithm.LineIntersector.prototype.getEndpoint=function(a,b){return this.inputLines[a][b]},jsts.algorithm.LineIntersector.computeEdgeDistance=function(a,b,c){var d=Math.abs(c.x-b.x),e=Math.abs(c.y-b.y),f=-1;if(a.equals(b))f=0;else if(a.equals(c))f=d>e?d:e;else{var g=Math.abs(a.x-b.x),h=Math.abs(a.y-b.y);f=d>e?g:h,0!==f||a.equals(b)||(f=Math.max(g,h))}if(0===f&&!a.equals(b))throw new jsts.error.IllegalArgumentError("Bad distance calculation");return f},jsts.algorithm.LineIntersector.nonRobustComputeEdgeDistance=function(a,b,c){var d=a.x-b.x,e=a.y-b.y,f=Math.sqrt(d*d+e*e);if(0!==f||a.equals(b))throw new jsts.error.IllegalArgumentError("Invalid distance calculation");return f},jsts.algorithm.LineIntersector.prototype.result=null,jsts.algorithm.LineIntersector.prototype.inputLines=null,jsts.algorithm.LineIntersector.prototype.intPt=null,jsts.algorithm.LineIntersector.prototype.intLineIndex=null,jsts.algorithm.LineIntersector.prototype._isProper=null,jsts.algorithm.LineIntersector.prototype.pa=null,jsts.algorithm.LineIntersector.prototype.pb=null,jsts.algorithm.LineIntersector.prototype.precisionModel=null,jsts.algorithm.LineIntersector.prototype.computeIntersection=function(a,b,c){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.LineIntersector.prototype.isCollinear=function(){return this.result===jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION},jsts.algorithm.LineIntersector.prototype.computeIntersection=function(a,b,c,d){this.inputLines[0][0]=a,this.inputLines[0][1]=b,this.inputLines[1][0]=c,this.inputLines[1][1]=d,this.result=this.computeIntersect(a,b,c,d)},jsts.algorithm.LineIntersector.prototype.computeIntersect=function(a,b,c,d){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.LineIntersector.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},jsts.algorithm.LineIntersector.prototype.hasIntersection=function(){return this.result!==jsts.algorithm.LineIntersector.NO_INTERSECTION},jsts.algorithm.LineIntersector.prototype.getIntersectionNum=function(){return this.result},jsts.algorithm.LineIntersector.prototype.getIntersection=function(a){return this.intPt[a]},jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(){null===this.intLineIndex&&(this.intLineIndex=[[],[]],this.computeIntLineIndex(0),this.computeIntLineIndex(1))},jsts.algorithm.LineIntersector.prototype.isIntersection=function(a){var b;for(b=0;b<this.result;b++)if(this.intPt[b].equals2D(a))return!0;return!1},jsts.algorithm.LineIntersector.prototype.isInteriorIntersection=function(){return 1===arguments.length?this.isInteriorIntersection2.apply(this,arguments):this.isInteriorIntersection(0)?!0:this.isInteriorIntersection(1)?!0:!1},jsts.algorithm.LineIntersector.prototype.isInteriorIntersection2=function(a){var b;for(b=0;b<this.result;b++)if(!this.intPt[b].equals2D(this.inputLines[a][0])&&!this.intPt[b].equals2D(this.inputLines[a][1]))return!0;return!1},jsts.algorithm.LineIntersector.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},jsts.algorithm.LineIntersector.prototype.getIntersectionAlongSegment=function(a,b){return this.computeIntLineIndex(),this.intPt[intLineIndex[a][b]]},jsts.algorithm.LineIntersector.prototype.getIndexAlongSegment=function(a,b){return this.computeIntLineIndex(),this.intLineIndex[a][b]},jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(a){var b=this.getEdgeDistance(a,0),c=this.getEdgeDistance(a,1);b>c?(this.intLineIndex[a][0]=0,this.intLineIndex[a][1]=1):(this.intLineIndex[a][0]=1,this.intLineIndex[a][1]=0)},jsts.algorithm.LineIntersector.prototype.getEdgeDistance=function(a,b){var c=jsts.algorithm.LineIntersector.computeEdgeDistance(this.intPt[b],this.inputLines[a][0],this.inputLines[a][1]);return c},jsts.algorithm.RobustLineIntersector=function(){jsts.algorithm.RobustLineIntersector.prototype.constructor.call(this)},jsts.algorithm.RobustLineIntersector.prototype=new jsts.algorithm.LineIntersector,jsts.algorithm.RobustLineIntersector.prototype.computeIntersection=function(a,b,c){return 4===arguments.length?void jsts.algorithm.LineIntersector.prototype.computeIntersection.apply(this,arguments):(this._isProper=!1,jsts.geom.Envelope.intersects(b,c,a)&&0===jsts.algorithm.CGAlgorithms.orientationIndex(b,c,a)&&0===jsts.algorithm.CGAlgorithms.orientationIndex(c,b,a)?(this._isProper=!0,(a.equals(b)||a.equals(c))&&(this._isProper=!1),void(this.result=jsts.algorithm.LineIntersector.POINT_INTERSECTION)):void(this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION))},jsts.algorithm.RobustLineIntersector.prototype.computeIntersect=function(a,b,c,d){if(this._isProper=!1,!jsts.geom.Envelope.intersects(a,b,c,d))return jsts.algorithm.LineIntersector.NO_INTERSECTION;var e=jsts.algorithm.CGAlgorithms.orientationIndex(a,b,c),f=jsts.algorithm.CGAlgorithms.orientationIndex(a,b,d);if(e>0&&f>0||0>e&&0>f)return jsts.algorithm.LineIntersector.NO_INTERSECTION;var g=jsts.algorithm.CGAlgorithms.orientationIndex(c,d,a),h=jsts.algorithm.CGAlgorithms.orientationIndex(c,d,b);if(g>0&&h>0||0>g&&0>h)return jsts.algorithm.LineIntersector.NO_INTERSECTION;var i=0===e&&0===f&&0===g&&0===h;return i?this.computeCollinearIntersection(a,b,c,d):(0===e||0===f||0===g||0===h?(this._isProper=!1,a.equals2D(c)||a.equals2D(d)?this.intPt[0]=a:b.equals2D(c)||b.equals2D(d)?this.intPt[0]=b:0===e?this.intPt[0]=new jsts.geom.Coordinate(c):0===f?this.intPt[0]=new jsts.geom.Coordinate(d):0===g?this.intPt[0]=new jsts.geom.Coordinate(a):0===h&&(this.intPt[0]=new jsts.geom.Coordinate(b))):(this._isProper=!0,this.intPt[0]=this.intersection(a,b,c,d)),jsts.algorithm.LineIntersector.POINT_INTERSECTION)},jsts.algorithm.RobustLineIntersector.prototype.computeCollinearIntersection=function(a,b,c,d){var e=jsts.geom.Envelope.intersects(a,b,c),f=jsts.geom.Envelope.intersects(a,b,d),g=jsts.geom.Envelope.intersects(c,d,a),h=jsts.geom.Envelope.intersects(c,d,b);return e&&f?(this.intPt[0]=c,this.intPt[1]=d,jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION):g&&h?(this.intPt[0]=a,this.intPt[1]=b,jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION):e&&g?(this.intPt[0]=c,this.intPt[1]=a,!c.equals(a)||f||h?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):e&&h?(this.intPt[0]=c,this.intPt[1]=b,!c.equals(b)||f||g?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):f&&g?(this.intPt[0]=d,this.intPt[1]=a,!d.equals(a)||e||h?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):f&&h?(this.intPt[0]=d,this.intPt[1]=b,!d.equals(b)||e||g?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):jsts.algorithm.LineIntersector.NO_INTERSECTION},jsts.algorithm.RobustLineIntersector.prototype.intersection=function(a,b,c,d){var e=this.intersectionWithNormalization(a,b,c,d);return this.isInSegmentEnvelopes(e)||(e=jsts.algorithm.CentralEndpointIntersector.getIntersection(a,b,c,d)),null!==this.precisionModel&&this.precisionModel.makePrecise(e),e},jsts.algorithm.RobustLineIntersector.prototype.intersectionWithNormalization=function(a,b,c,d){var e=new jsts.geom.Coordinate(a),f=new jsts.geom.Coordinate(b),g=new jsts.geom.Coordinate(c),h=new jsts.geom.Coordinate(d),i=new jsts.geom.Coordinate;this.normalizeToEnvCentre(e,f,g,h,i);var j=this.safeHCoordinateIntersection(e,f,g,h);return j.x+=i.x,j.y+=i.y,j},jsts.algorithm.RobustLineIntersector.prototype.safeHCoordinateIntersection=function(a,b,c,d){var e=null;try{e=jsts.algorithm.HCoordinate.intersection(a,b,c,d)}catch(f){if(!(f instanceof jsts.error.NotRepresentableError))throw f;e=jsts.algorithm.CentralEndpointIntersector.getIntersection(a,b,c,d)}return e},jsts.algorithm.RobustLineIntersector.prototype.normalizeToMinimum=function(a,b,c,d,e){e.x=this.smallestInAbsValue(a.x,b.x,c.x,d.x),e.y=this.smallestInAbsValue(a.y,b.y,c.y,d.y),a.x-=e.x,a.y-=e.y,b.x-=e.x,b.y-=e.y,c.x-=e.x,c.y-=e.y,d.x-=e.x,d.y-=e.y},jsts.algorithm.RobustLineIntersector.prototype.normalizeToEnvCentre=function(a,b,c,d,e){var f=a.x<b.x?a.x:b.x,g=a.y<b.y?a.y:b.y,h=a.x>b.x?a.x:b.x,i=a.y>b.y?a.y:b.y,j=c.x<d.x?c.x:d.x,k=c.y<d.y?c.y:d.y,l=c.x>d.x?c.x:d.x,m=c.y>d.y?c.y:d.y,n=f>j?f:j,o=l>h?h:l,p=g>k?g:k,q=m>i?i:m,r=(n+o)/2,s=(p+q)/2;e.x=r,e.y=s,a.x-=e.x,a.y-=e.y,b.x-=e.x,b.y-=e.y,c.x-=e.x,c.y-=e.y,d.x-=e.x,d.y-=e.y},jsts.algorithm.RobustLineIntersector.prototype.smallestInAbsValue=function(a,b,c,d){var e=a,f=Math.abs(e);return Math.abs(b)<f&&(e=b,f=Math.abs(b)),Math.abs(c)<f&&(e=c,f=Math.abs(c)),Math.abs(d)<f&&(e=d),e},jsts.algorithm.RobustLineIntersector.prototype.isInSegmentEnvelopes=function(a){var b=new jsts.geom.Envelope(this.inputLines[0][0],this.inputLines[0][1]),c=new jsts.geom.Envelope(this.inputLines[1][0],this.inputLines[1][1]);return b.contains(a)&&c.contains(a)},jsts.algorithm.HCoordinate=function(){this.x=0,this.y=0,this.w=1,1===arguments.length?this.initFrom1Coordinate(arguments[0]):2===arguments.length&&arguments[0]instanceof jsts.geom.Coordinate?this.initFrom2Coordinates(arguments[0],arguments[1]):2===arguments.length&&arguments[0]instanceof jsts.algorithm.HCoordinate?this.initFrom2HCoordinates(arguments[0],arguments[1]):2===arguments.length?this.initFromXY(arguments[0],arguments[1]):3===arguments.length?this.initFromXYW(arguments[0],arguments[1],arguments[2]):4===arguments.length&&this.initFromXYW(arguments[0],arguments[1],arguments[2],arguments[3])},jsts.algorithm.HCoordinate.intersection=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o;if(e=a.y-b.y,f=b.x-a.x,g=a.x*b.y-b.x*a.y,h=c.y-d.y,i=d.x-c.x,j=c.x*d.y-d.x*c.y,k=f*j-i*g,l=h*g-e*j,m=e*i-h*f,n=k/m,o=l/m,!isFinite(n)||!isFinite(o))throw new jsts.error.NotRepresentableError;return new jsts.geom.Coordinate(n,o)},jsts.algorithm.HCoordinate.prototype.initFrom1Coordinate=function(a){this.x=a.x,this.y=a.y,this.w=1},jsts.algorithm.HCoordinate.prototype.initFrom2Coordinates=function(a,b){this.x=a.y-b.y,this.y=b.x-a.x,this.w=a.x*b.y-b.x*a.y},jsts.algorithm.HCoordinate.prototype.initFrom2HCoordinates=function(a,b){this.x=a.y*b.w-b.y*a.w,this.y=b.x*a.w-a.x*b.w,this.w=a.x*b.y-b.x*a.y},jsts.algorithm.HCoordinate.prototype.initFromXYW=function(a,b,c){this.x=a,this.y=b,this.w=c},jsts.algorithm.HCoordinate.prototype.initFromXY=function(a,b){this.x=a,this.y=b,this.w=1},jsts.algorithm.HCoordinate.prototype.initFrom4Coordinates=function(a,b,c,d){var e,f,g,h,i,j;e=a.y-b.y,f=b.x-a.x,g=a.x*b.y-b.x*a.y,h=c.y-d.y,i=d.x-c.x,j=c.x*d.y-d.x*c.y,this.x=f*j-i*g,this.y=h*g-e*j,this.w=e*i-h*f},jsts.algorithm.HCoordinate.prototype.getX=function(){var a=this.x/this.w;if(!isFinite(a))throw new jsts.error.NotRepresentableError;return a},jsts.algorithm.HCoordinate.prototype.getY=function(){var a=this.y/this.w;if(!isFinite(a))throw new jsts.error.NotRepresentableError;return a},jsts.algorithm.HCoordinate.prototype.getCoordinate=function(){var a=new jsts.geom.Coordinate;return a.x=this.getX(),a.y=this.getY(),a},jsts.geom.LineSegment=function(){0===arguments.length?(this.p0=new jsts.geom.Coordinate,this.p1=new jsts.geom.Coordinate):1===arguments.length?(this.p0=arguments[0].p0,this.p1=arguments[0].p1):2===arguments.length?(this.p0=arguments[0],this.p1=arguments[1]):4===arguments.length&&(this.p0=new jsts.geom.Coordinate(arguments[0],arguments[1]),this.p1=new jsts.geom.Coordinate(arguments[2],arguments[3]))},jsts.geom.LineSegment.prototype.p0=null,jsts.geom.LineSegment.prototype.p1=null,jsts.geom.LineSegment.midPoint=function(a,b){return new jsts.geom.Coordinate((a.x+b.x)/2,(a.y+b.y)/2)},jsts.geom.LineSegment.prototype.getCoordinate=function(a){return 0===a?this.p0:this.p1},jsts.geom.LineSegment.prototype.getLength=function(){return this.p0.distance(this.p1)},jsts.geom.LineSegment.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},jsts.geom.LineSegment.prototype.isVertical=function(){return this.p0.x===this.p1.x},jsts.geom.LineSegment.prototype.orientationIndex=function(a){return a instanceof jsts.geom.LineSegment?this.orientationIndex1(a):a instanceof jsts.geom.Coordinate?this.orientationIndex2(a):void 0},jsts.geom.LineSegment.prototype.orientationIndex1=function(a){var b=jsts.algorithm.CGAlgorithms.orientationIndex(this.p0,this.p1,a.p0),c=jsts.algorithm.CGAlgorithms.orientationIndex(this.p0,this.p1,a.p1);return b>=0&&c>=0?Math.max(b,c):0>=b&&0>=c?Math.max(b,c):0},jsts.geom.LineSegment.prototype.orientationIndex2=function(a){return jsts.algorithm.CGAlgorithms.orientationIndex(this.p0,this.p1,a)},jsts.geom.LineSegment.prototype.reverse=function(){var a=this.p0;this.p0=this.p1,this.p1=a},jsts.geom.LineSegment.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},jsts.geom.LineSegment.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},jsts.geom.LineSegment.prototype.midPoint=function(){return jsts.geom.LineSegment.midPoint(this.p0,this.p1)},jsts.geom.LineSegment.prototype.distance=function(a){return a instanceof jsts.geom.LineSegment?this.distance1(a):a instanceof jsts.geom.Coordinate?this.distance2(a):void 0},jsts.geom.LineSegment.prototype.distance1=function(a){return jsts.algorithm.CGAlgorithms.distanceLineLine(this.p0,this.p1,a.p0,a.p1)},jsts.geom.LineSegment.prototype.distance2=function(a){return jsts.algorithm.CGAlgorithms.distancePointLine(a,this.p0,this.p1)},jsts.geom.LineSegment.prototype.pointAlong=function(a){var b=new jsts.geom.Coordinate;return b.x=this.p0.x+a*(this.p1.x-this.p0.x),b.y=this.p0.y+a*(this.p1.y-this.p0.y),b},jsts.geom.LineSegment.prototype.pointAlongOffset=function(a,b){var c=this.p0.x+a*(this.p1.x-this.p0.x),d=this.p0.y+a*(this.p1.y-this.p0.y),e=this.p1.x-this.p0.x,f=this.p1.y-this.p0.y,g=Math.sqrt(e*e+f*f),h=0,i=0;if(0!==b){if(0>=g)throw"Cannot compute offset from zero-length line segment";h=b*e/g,i=b*f/g}var j=c-i,k=d+h,l=new jsts.geom.Coordinate(j,k);return l},jsts.geom.LineSegment.prototype.projectionFactor=function(a){if(a.equals(this.p0))return 0;if(a.equals(this.p1))return 1;var b=this.p1.x-this.p0.x,c=this.p1.y-this.p0.y,d=b*b+c*c,e=((a.x-this.p0.x)*b+(a.y-this.p0.y)*c)/d;return e},jsts.geom.LineSegment.prototype.segmentFraction=function(a){var b=this.projectionFactor(a);return 0>b?b=0:(b>1||isNaN(b))&&(b=1),b},jsts.geom.LineSegment.prototype.project=function(a){return a instanceof jsts.geom.Coordinate?this.project1(a):a instanceof jsts.geom.LineSegment?this.project2(a):void 0},jsts.geom.LineSegment.prototype.project1=function(a){if(a.equals(this.p0)||a.equals(this.p1))return new jsts.geom.Coordinate(a);var b=this.projectionFactor(a),c=new jsts.geom.Coordinate;return c.x=this.p0.x+b*(this.p1.x-this.p0.x),c.y=this.p0.y+b*(this.p1.y-this.p0.y),c},jsts.geom.LineSegment.prototype.project2=function(a){var b=this.projectionFactor(a.p0),c=this.projectionFactor(a.p1);if(b>=1&&c>=1)return null;if(0>=b&&0>=c)return null;var d=this.project(a.p0);0>b&&(d=p0),b>1&&(d=p1);var e=this.project(a.p1);return 0>c&&(e=p0),c>1&&(e=p1),new jsts.geom.LineSegment(d,e)},jsts.geom.LineSegment.prototype.closestPoint=function(a){var b=this.projectionFactor(a);if(b>0&&1>b)return this.project(a);var c=this.p0.distance(a),d=this.p1.distance(a);return d>c?this.p0:this.p1},jsts.geom.LineSegment.prototype.closestPoints=function(a){var b=this.intersection(a);if(null!==b)return[b,b];var c,d=[],e=Number.MAX_VALUE,f=this.closestPoint(a.p0);e=f.distance(a.p0),d[0]=f,d[1]=a.p0;var g=this.closestPoint(a.p1);c=g.distance(a.p1),e>c&&(e=c,d[0]=g,d[1]=a.p1);var h=a.closestPoint(this.p0);c=h.distance(this.p0),e>c&&(e=c,d[0]=this.p0,d[1]=h);var i=a.closestPoint(this.p1);return c=i.distance(this.p1),e>c&&(e=c,d[0]=this.p1,d[1]=i),d},jsts.geom.LineSegment.prototype.intersection=function(a){var b=new jsts.algorithm.RobustLineIntersector;return b.computeIntersection(this.p0,this.p1,a.p0,a.p1),b.hasIntersection()?b.getIntersection(0):null},jsts.geom.LineSegment.prototype.setCoordinates=function(a){return a instanceof jsts.geom.Coordinate?void this.setCoordinates2.apply(this,arguments):void this.setCoordinates2(a.p0,a.p1)},jsts.geom.LineSegment.prototype.setCoordinates2=function(a,b){this.p0.x=a.x,this.p0.y=a.y,this.p1.x=b.x,this.p1.y=b.y},jsts.geom.LineSegment.prototype.distancePerpendicular=function(a){return jsts.algorithm.CGAlgorithms.distancePointLinePerpendicular(a,this.p0,this.p1)},jsts.geom.LineSegment.prototype.lineIntersection=function(a){try{var b=jsts.algorithm.HCoordinate.intersection(this.p0,this.p1,a.p0,a.p1);return b}catch(c){}return null},jsts.geom.LineSegment.prototype.toGeometry=function(a){return a.createLineString([this.p0,this.p1])},jsts.geom.LineSegment.prototype.equals=function(a){return a instanceof jsts.geom.LineSegment?this.p0.equals(a.p0)&&this.p1.equals(a.p1):!1},jsts.geom.LineSegment.prototype.compareTo=function(a){var b=this.p0.compareTo(a.p0);return 0!==b?b:this.p1.compareTo(a.p1)},jsts.geom.LineSegment.prototype.equalsTopo=function(a){return this.p0.equals(a.p0)&&this.p1.equals(a.p1)||this.p0.equals(a.p1)&&this.p1.equals(a.p0)},jsts.geom.LineSegment.prototype.toString=function(){return"LINESTRING("+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},jsts.index.chain.MonotoneChainOverlapAction=function(){this.tempEnv1=new jsts.geom.Envelope,this.tempEnv2=new jsts.geom.Envelope,this.overlapSeg1=new jsts.geom.LineSegment,this.overlapSeg2=new jsts.geom.LineSegment},jsts.index.chain.MonotoneChainOverlapAction.prototype.tempEnv1=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.tempEnv2=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.overlapSeg1=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.overlapSeg2=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.overlap=function(a,b,c,d){this.mc1.getLineSegment(b,this.overlapSeg1),this.mc2.getLineSegment(d,this.overlapSeg2),this.overlap2(this.overlapSeg1,this.overlapSeg2)},jsts.index.chain.MonotoneChainOverlapAction.prototype.overlap2=function(a,b){},function(){var a=jsts.index.chain.MonotoneChainOverlapAction,b=jsts.noding.SinglePassNoder,c=jsts.index.strtree.STRtree,d=jsts.noding.NodedSegmentString,e=jsts.index.chain.MonotoneChainBuilder,f=function(a){this.si=a};f.prototype=new a,f.constructor=f,f.prototype.si=null,f.prototype.overlap=function(a,b,c,d){var e=a.getContext(),f=c.getContext();this.si.processIntersections(e,b,f,d)},jsts.noding.MCIndexNoder=function(){this.monoChains=[],this.index=new c},jsts.noding.MCIndexNoder.prototype=new b,jsts.noding.MCIndexNoder.constructor=jsts.noding.MCIndexNoder,jsts.noding.MCIndexNoder.prototype.monoChains=null,jsts.noding.MCIndexNoder.prototype.index=null,jsts.noding.MCIndexNoder.prototype.idCounter=0,jsts.noding.MCIndexNoder.prototype.nodedSegStrings=null,jsts.noding.MCIndexNoder.prototype.nOverlaps=0,jsts.noding.MCIndexNoder.prototype.getMonotoneChains=function(){return this.monoChains},jsts.noding.MCIndexNoder.prototype.getIndex=function(){return this.index},jsts.noding.MCIndexNoder.prototype.getNodedSubstrings=function(){return d.getNodedSubstrings(this.nodedSegStrings)},jsts.noding.MCIndexNoder.prototype.computeNodes=function(a){this.nodedSegStrings=a;for(var b=a.iterator();b.hasNext();)this.add(b.next());this.intersectChains()},jsts.noding.MCIndexNoder.prototype.intersectChains=function(){for(var a=new f(this.segInt),b=0;b<this.monoChains.length;b++)for(var c=this.monoChains[b],d=this.index.query(c.getEnvelope()),e=0;e<d.length;e++){var g=d[e];if(g.getId()>c.getId()&&(c.computeOverlaps(g,a),this.nOverlaps++),this.segInt.isDone())return}},jsts.noding.MCIndexNoder.prototype.add=function(a){for(var b=e.getChains(a.getCoordinates(),a),c=0;c<b.length;c++){var d=b[c];d.setId(this.idCounter++),this.index.insert(d.getEnvelope(),d),this.monoChains.push(d)}}}(),jsts.simplify.LineSegmentIndex=function(){this.index=new jsts.index.quadtree.Quadtree},jsts.simplify.LineSegmentIndex.prototype.index=null,jsts.simplify.LineSegmentIndex.prototype.add=function(a){if(a instanceof jsts.geom.LineSegment)return void this.add2(a);for(var b=a.getSegments(),c=0;c<b.length;c++){var d=b[c];this.add2(d)}},jsts.simplify.LineSegmentIndex.prototype.add2=function(a){this.index.insert(new jsts.geom.Envelope(a.p0,a.p1),a)},jsts.simplify.LineSegmentIndex.prototype.remove=function(a){this.index.remove(new jsts.geom.Envelope(a.p0,a.p1),a)},jsts.simplify.LineSegmentIndex.prototype.query=function(a){var b=new jsts.geom.Envelope(a.p0,a.p1),c=new jsts.simplify.LineSegmentIndex.LineSegmentVisitor(a);this.index.query(b,c);var d=c.getItems();return d},jsts.simplify.LineSegmentIndex.LineSegmentVisitor=function(a){this.items=[],this.querySeg=a},jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype=new jsts.index.ItemVisitor,jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.querySeg=null,jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.items=null,jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.visitItem=function(a){var b=a;jsts.geom.Envelope.intersects(b.p0,b.p1,this.querySeg.p0,this.querySeg.p1)&&this.items.push(a)},jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.getItems=function(){return this.items},jsts.geomgraph.EdgeEndStar=function(){this.edgeMap=new javascript.util.TreeMap,this.edgeList=null,this.ptInAreaLocation=[jsts.geom.Location.NONE,jsts.geom.Location.NONE]},jsts.geomgraph.EdgeEndStar.prototype.edgeMap=null,jsts.geomgraph.EdgeEndStar.prototype.edgeList=null,jsts.geomgraph.EdgeEndStar.prototype.ptInAreaLocation=null,jsts.geomgraph.EdgeEndStar.prototype.insert=function(a){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.EdgeEndStar.prototype.insertEdgeEnd=function(a,b){this.edgeMap.put(a,b),this.edgeList=null},jsts.geomgraph.EdgeEndStar.prototype.getCoordinate=function(){var a=this.iterator();if(!a.hasNext())return null;var b=a.next();return b.getCoordinate()},jsts.geomgraph.EdgeEndStar.prototype.getDegree=function(){return this.edgeMap.size()},jsts.geomgraph.EdgeEndStar.prototype.iterator=function(){return this.getEdges().iterator()},jsts.geomgraph.EdgeEndStar.prototype.getEdges=function(){return null===this.edgeList&&(this.edgeList=new javascript.util.ArrayList(this.edgeMap.values())),this.edgeList},jsts.geomgraph.EdgeEndStar.prototype.getNextCW=function(a){this.getEdges();var b=this.edgeList.indexOf(a),c=b-1;return 0===b&&(c=this.edgeList.length-1),this.edgeList[c]},jsts.geomgraph.EdgeEndStar.prototype.computeLabelling=function(a){this.computeEdgeEndLabels(a[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var b=[!1,!1],c=this.iterator();c.hasNext();)for(var d=c.next(),e=d.getLabel(),f=0;2>f;f++)e.isLine(f)&&e.getLocation(f)===jsts.geom.Location.BOUNDARY&&(b[f]=!0);for(var c=this.iterator();c.hasNext();)for(var d=c.next(),e=d.getLabel(),f=0;2>f;f++)if(e.isAnyNull(f)){var g=jsts.geom.Location.NONE;if(b[f])g=jsts.geom.Location.EXTERIOR;else{var h=d.getCoordinate();g=this.getLocation(f,h,a)}e.setAllLocationsIfNull(f,g)}},jsts.geomgraph.EdgeEndStar.prototype.computeEdgeEndLabels=function(a){for(var b=this.iterator();b.hasNext();){var c=b.next();c.computeLabel(a)}},jsts.geomgraph.EdgeEndStar.prototype.getLocation=function(a,b,c){return this.ptInAreaLocation[a]===jsts.geom.Location.NONE&&(this.ptInAreaLocation[a]=jsts.algorithm.locate.SimplePointInAreaLocator.locate(b,c[a].getGeometry())),this.ptInAreaLocation[a]},jsts.geomgraph.EdgeEndStar.prototype.isAreaLabelsConsistent=function(a){return this.computeEdgeEndLabels(a.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jsts.geomgraph.EdgeEndStar.prototype.checkAreaLabelsConsistent=function(a){var b=this.getEdges();if(b.size()<=0)return!0;var c=b.size()-1,d=b.get(c).getLabel(),e=d.getLocation(a,jsts.geomgraph.Position.LEFT);jsts.util.Assert.isTrue(e!=jsts.geom.Location.NONE,"Found unlabelled area edge");for(var f=e,g=this.iterator();g.hasNext();){var h=g.next(),i=h.getLabel();jsts.util.Assert.isTrue(i.isArea(a),"Found non-area edge");var j=i.getLocation(a,jsts.geomgraph.Position.LEFT),k=i.getLocation(a,jsts.geomgraph.Position.RIGHT);if(j===k)return!1;if(k!==f)return!1;f=j}return!0},jsts.geomgraph.EdgeEndStar.prototype.propagateSideLabels=function(a){for(var b=jsts.geom.Location.NONE,c=this.iterator();c.hasNext();){var d=c.next(),e=d.getLabel();e.isArea(a)&&e.getLocation(a,jsts.geomgraph.Position.LEFT)!==jsts.geom.Location.NONE&&(b=e.getLocation(a,jsts.geomgraph.Position.LEFT))}if(b!==jsts.geom.Location.NONE)for(var f=b,c=this.iterator();c.hasNext();){var d=c.next(),e=d.getLabel();if(e.getLocation(a,jsts.geomgraph.Position.ON)===jsts.geom.Location.NONE&&e.setLocation(a,jsts.geomgraph.Position.ON,f),e.isArea(a)){var g=e.getLocation(a,jsts.geomgraph.Position.LEFT),h=e.getLocation(a,jsts.geomgraph.Position.RIGHT);if(h!==jsts.geom.Location.NONE){if(h!==f)throw new jsts.error.TopologyError("side location conflict",d.getCoordinate());g===jsts.geom.Location.NONE&&jsts.util.Assert.shouldNeverReachHere("found single null side (at "+d.getCoordinate()+")"),f=g}else jsts.util.Assert.isTrue(e.getLocation(a,jsts.geomgraph.Position.LEFT)===jsts.geom.Location.NONE,"found single null side"),e.setLocation(a,jsts.geomgraph.Position.RIGHT,f),e.setLocation(a,jsts.geomgraph.Position.LEFT,f)}}},jsts.geomgraph.EdgeEndStar.prototype.findIndex=function(a){this.iterator();for(var b=0;b<this.edgeList.size();b++){var c=this.edgeList.get(b);if(c===a)return b}return-1},jsts.operation.relate.EdgeEndBundleStar=function(){jsts.geomgraph.EdgeEndStar.apply(this,arguments)},jsts.operation.relate.EdgeEndBundleStar.prototype=new jsts.geomgraph.EdgeEndStar,jsts.operation.relate.EdgeEndBundleStar.prototype.insert=function(a){var b=this.edgeMap.get(a);null===b?(b=new jsts.operation.relate.EdgeEndBundle(a),this.insertEdgeEnd(a,b)):b.insert(a)},jsts.operation.relate.EdgeEndBundleStar.prototype.updateIM=function(a){for(var b=this.iterator();b.hasNext();){var c=b.next();c.updateIM(a)}},jsts.index.ArrayListVisitor=function(){this.items=[]},jsts.index.ArrayListVisitor.prototype.visitItem=function(a){this.items.push(a)},jsts.index.ArrayListVisitor.prototype.getItems=function(){return this.items},jsts.algorithm.distance.DistanceToPoint=function(){},jsts.algorithm.distance.DistanceToPoint.computeDistance=function(a,b,c){if(a instanceof jsts.geom.LineString)jsts.algorithm.distance.DistanceToPoint.computeDistance2(a,b,c);else if(a instanceof jsts.geom.Polygon)jsts.algorithm.distance.DistanceToPoint.computeDistance4(a,b,c);else if(a instanceof jsts.geom.GeometryCollection)for(var d=a,e=0;e<d.getNumGeometries();e++){var f=d.getGeometryN(e);jsts.algorithm.distance.DistanceToPoint.computeDistance(f,b,c)}else c.setMinimum(a.getCoordinate(),b)},jsts.algorithm.distance.DistanceToPoint.computeDistance2=function(a,b,c){for(var d=new jsts.geom.LineSegment,e=a.getCoordinates(),f=0;f<e.length-1;f++){d.setCoordinates(e[f],e[f+1]);var g=d.closestPoint(b);c.setMinimum(g,b)}},jsts.algorithm.distance.DistanceToPoint.computeDistance3=function(a,b,c){var d=a.closestPoint(b);c.setMinimum(d,b)},jsts.algorithm.distance.DistanceToPoint.computeDistance4=function(a,b,c){jsts.algorithm.distance.DistanceToPoint.computeDistance2(a.getExteriorRing(),b,c);
  for(var d=0;d<a.getNumInteriorRing();d++)jsts.algorithm.distance.DistanceToPoint.computeDistance2(a.getInteriorRingN(d),b,c)},jsts.index.strtree.ItemBoundable=function(a,b){this.bounds=a,this.item=b},jsts.index.strtree.ItemBoundable.prototype=new jsts.index.strtree.Boundable,jsts.index.strtree.ItemBoundable.constructor=jsts.index.strtree.ItemBoundable,jsts.index.strtree.ItemBoundable.prototype.bounds=null,jsts.index.strtree.ItemBoundable.prototype.item=null,jsts.index.strtree.ItemBoundable.prototype.getBounds=function(){return this.bounds},jsts.index.strtree.ItemBoundable.prototype.getItem=function(){return this.item},function(){var a=javascript.util.ArrayList,b=javascript.util.TreeMap;jsts.geomgraph.EdgeList=function(){this.edges=new a,this.ocaMap=new b},jsts.geomgraph.EdgeList.prototype.edges=null,jsts.geomgraph.EdgeList.prototype.ocaMap=null,jsts.geomgraph.EdgeList.prototype.add=function(a){this.edges.add(a);var b=new jsts.noding.OrientedCoordinateArray(a.getCoordinates());this.ocaMap.put(b,a)},jsts.geomgraph.EdgeList.prototype.addAll=function(a){for(var b=a.iterator();b.hasNext();)this.add(b.next())},jsts.geomgraph.EdgeList.prototype.getEdges=function(){return this.edges},jsts.geomgraph.EdgeList.prototype.findEqualEdge=function(a){var b=new jsts.noding.OrientedCoordinateArray(a.getCoordinates()),c=this.ocaMap.get(b);return c},jsts.geomgraph.EdgeList.prototype.getEdges=function(){return this.edges},jsts.geomgraph.EdgeList.prototype.iterator=function(){return this.edges.iterator()},jsts.geomgraph.EdgeList.prototype.get=function(a){return this.edges.get(a)},jsts.geomgraph.EdgeList.prototype.findEdgeIndex=function(a){for(var b=0;b<this.edges.size();b++)if(this.edges.get(b).equals(a))return b;return-1}}(),jsts.operation.IsSimpleOp=function(a){this.geom=a},jsts.operation.IsSimpleOp.prototype.geom=null,jsts.operation.IsSimpleOp.prototype.isClosedEndpointsInInterior=!0,jsts.operation.IsSimpleOp.prototype.nonSimpleLocation=null,jsts.operation.IsSimpleOp.prototype.IsSimpleOp=function(a){this.geom=a},jsts.operation.IsSimpleOp.prototype.isSimple=function(){return this.nonSimpleLocation=null,this.geom instanceof jsts.geom.LineString?this.isSimpleLinearGeometry(this.geom):this.geom instanceof jsts.geom.MultiLineString?this.isSimpleLinearGeometry(this.geom):this.geom instanceof jsts.geom.MultiPoint?this.isSimpleMultiPoint(this.geom):!0},jsts.operation.IsSimpleOp.prototype.isSimpleMultiPoint=function(a){if(a.isEmpty())return!0;for(var b=[],c=0;c<a.getNumGeometries();c++){for(var d=a.getGeometryN(c),e=d.getCoordinate(),f=0;f<b.length;f++){var g=b[f];if(e.equals2D(g))return this.nonSimpleLocation=e,!1}b.push(e)}return!0},jsts.operation.IsSimpleOp.prototype.isSimpleLinearGeometry=function(a){if(a.isEmpty())return!0;var b=new jsts.geomgraph.GeometryGraph(0,a),c=new jsts.algorithm.RobustLineIntersector,d=b.computeSelfNodes(c,!0);return d.hasIntersection()?d.hasProperIntersection()?(this.nonSimpleLocation=d.getProperIntersectionPoint(),!1):this.hasNonEndpointIntersection(b)?!1:this.isClosedEndpointsInInterior&&this.hasClosedEndpointIntersection(b)?!1:!0:!0},jsts.operation.IsSimpleOp.prototype.hasNonEndpointIntersection=function(a){for(var b=a.getEdgeIterator();b.hasNext();)for(var c=b.next(),d=c.getMaximumSegmentIndex(),e=c.getEdgeIntersectionList().iterator();e.hasNext();){var f=e.next();if(!f.isEndPoint(d))return this.nonSimpleLocation=f.getCoordinate(),!0}return!1},jsts.operation.IsSimpleOp.prototype.hasClosedEndpointIntersection=function(a){for(var b=new javascript.util.TreeMap,c=a.getEdgeIterator();c.hasNext();){var d=c.next(),e=(d.getMaximumSegmentIndex(),d.isClosed()),f=d.getCoordinate(0);this.addEndpoint(b,f,e);var g=d.getCoordinate(d.getNumPoints()-1);this.addEndpoint(b,g,e)}for(var c=b.values().iterator();c.hasNext();){var h=c.next();if(h.isClosed&&2!=h.degree)return this.nonSimpleLocation=h.getCoordinate(),!0}return!1},jsts.operation.IsSimpleOp.EndpointInfo=function(a){this.pt=a,this.isClosed=!1,this.degree=0},jsts.operation.IsSimpleOp.EndpointInfo.prototype.pt=null,jsts.operation.IsSimpleOp.EndpointInfo.prototype.isClosed=null,jsts.operation.IsSimpleOp.EndpointInfo.prototype.degree=null,jsts.operation.IsSimpleOp.EndpointInfo.prototype.getCoordinate=function(){return this.pt},jsts.operation.IsSimpleOp.EndpointInfo.prototype.addEndpoint=function(a){this.degree++,this.isClosed=this.isClosed||a},jsts.operation.IsSimpleOp.prototype.addEndpoint=function(a,b,c){var d=a.get(b);null===d&&(d=new jsts.operation.IsSimpleOp.EndpointInfo(b),a.put(b,d)),d.addEndpoint(c)},function(){var a=function(){this.snapTolerance=0,this.seg=new jsts.geom.LineSegment,this.allowSnappingToSourceVertices=!1,this.isClosed=!1,this.srcPts=[],arguments[0]instanceof jsts.geom.LineString?this.initFromLine.apply(this,arguments):this.initFromPoints.apply(this,arguments)};a.prototype.initFromLine=function(a,b){this.initFromPoints(a.getCoordinates(),b)},a.prototype.initFromPoints=function(a,b){this.srcPts=a,this.isClosed=this.calcIsClosed(a),this.snapTolerance=b},a.prototype.setAllowSnappingToSourceVertices=function(a){this.allowSnappingToSourceVertices=a},a.prototype.calcIsClosed=function(a){return a.length<=1?!1:a[0].equals(a[a.length-1])},a.prototype.snapTo=function(a){var b=new jsts.geom.CoordinateList(this.srcPts);return this.snapVertices(b,a),this.snapSegments(b,a),b.toCoordinateArray()},a.prototype.snapVertices=function(a,b){var c,d,e=this.isClosed?a.size()-1:a.size(),f=0;for(f;e>f;f++)c=a.get(f),d=this.findSnapForVertex(c,b),null!==d&&(a.set(f,new jsts.geom.Coordinate(d)),0===f&&this.isClosed&&a.set(a.size()-1,new jsts.geom.Coordinate(d)))},a.prototype.findSnapForVertex=function(a,b){var c=0,d=b.length;for(c=0;d>c;c++){if(a.equals(b[c]))return null;if(a.distance(b[c])<this.snapTolerance)return b[c]}return null},a.prototype.snapSegments=function(a,b){if(0!==b.length){var c,d,e,f=b.length;for(b.length>1&&b[0].equals2D(b[b.length-1])&&(f=b.length-1),c=0;f>c;c++)d=b[c],e=this.findSegmentIndexToSnap(d,a),e>=0&&a.add(e+1,new jsts.geom.Coordinate(d),!1)}},a.prototype.findSegmentIndexToSnap=function(a,b){var c,d=Number.MAX_VALUE,e=-1,f=0;for(f;f<b.size()-1;f++){if(this.seg.p0=b.get(f),this.seg.p1=b.get(f+1),this.seg.p0.equals(a)||this.seg.p1.equals(a)){if(this.allowSnappingToSourceVertices)continue;return-1}c=this.seg.distance(a),c<this.snapTolerance&&d>c&&(d=c,e=f)}return e},jsts.operation.overlay.snap.LineStringSnapper=a}(),function(){var a=javascript.util.ArrayList,b=jsts.geom.GeometryComponentFilter,c=jsts.geom.LineString,d=jsts.operation.polygonize.EdgeRing,e=jsts.operation.polygonize.PolygonizeGraph,f=function(){var d=this,e=function(){};e.prototype=new b,e.prototype.filter=function(a){a instanceof c&&d.add(a)},this.lineStringAdder=new e,this.dangles=new a,this.cutEdges=new a,this.invalidRingLines=new a};f.prototype.lineStringAdder=null,f.prototype.graph=null,f.prototype.dangles=null,f.prototype.cutEdges=null,f.prototype.invalidRingLines=null,f.prototype.holeList=null,f.prototype.shellList=null,f.prototype.polyList=null,f.prototype.add=function(a){if(a instanceof jsts.geom.LineString)return this.add3(a);if(a instanceof jsts.geom.Geometry)return this.add2(a);for(var b=a.iterator();b.hasNext();){var c=b.next();this.add2(c)}},f.prototype.add2=function(a){a.apply(this.lineStringAdder)},f.prototype.add3=function(a){null==this.graph&&(this.graph=new e(a.getFactory())),this.graph.addEdge(a)},f.prototype.getPolygons=function(){return this.polygonize(),this.polyList},f.prototype.getDangles=function(){return this.polygonize(),this.dangles},f.prototype.getCutEdges=function(){return this.polygonize(),this.cutEdges},f.prototype.getInvalidRingLines=function(){return this.polygonize(),this.invalidRingLines},f.prototype.polygonize=function(){if(null==this.polyList&&(this.polyList=new a,null!=this.graph)){this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var b=this.graph.getEdgeRings(),c=new a;this.invalidRingLines=new a,this.findValidRings(b,c,this.invalidRingLines),this.findShellsAndHoles(c),f.assignHolesToShells(this.holeList,this.shellList),this.polyList=new a;for(var d=this.shellList.iterator();d.hasNext();){var e=d.next();this.polyList.add(e.getPolygon())}}},f.prototype.findValidRings=function(a,b,c){for(var d=a.iterator();d.hasNext();){var e=d.next();e.isValid()?b.add(e):c.add(e.getLineString())}},f.prototype.findShellsAndHoles=function(b){this.holeList=new a,this.shellList=new a;for(var c=b.iterator();c.hasNext();){var d=c.next();d.isHole()?this.holeList.add(d):this.shellList.add(d)}},f.assignHolesToShells=function(a,b){for(var c=a.iterator();c.hasNext();){var d=c.next();f.assignHoleToShell(d,b)}},f.assignHoleToShell=function(a,b){var c=d.findEdgeRingContaining(a,b);null!=c&&c.addHole(a.getRing())},jsts.operation.polygonize.Polygonizer=f}(),function(){var a=javascript.util.ArrayList,b=function(){};b.prototype.inputGeom=null,b.prototype.factory=null,b.prototype.pruneEmptyGeometry=!0,b.prototype.preserveGeometryCollectionType=!0,b.prototype.preserveCollections=!1,b.prototype.reserveType=!1,b.prototype.getInputGeometry=function(){return this.inputGeom},b.prototype.transform=function(a){if(this.inputGeom=a,this.factory=a.getFactory(),a instanceof jsts.geom.Point)return this.transformPoint(a,null);if(a instanceof jsts.geom.MultiPoint)return this.transformMultiPoint(a,null);if(a instanceof jsts.geom.LinearRing)return this.transformLinearRing(a,null);if(a instanceof jsts.geom.LineString)return this.transformLineString(a,null);if(a instanceof jsts.geom.MultiLineString)return this.transformMultiLineString(a,null);if(a instanceof jsts.geom.Polygon)return this.transformPolygon(a,null);if(a instanceof jsts.geom.MultiPolygon)return this.transformMultiPolygon(a,null);if(a instanceof jsts.geom.GeometryCollection)return this.transformGeometryCollection(a,null);throw new jsts.error.IllegalArgumentException("Unknown Geometry subtype: "+a.getClass().getName())},b.prototype.createCoordinateSequence=function(a){return this.factory.getCoordinateSequenceFactory().create(a)},b.prototype.copy=function(a){return a.clone()},b.prototype.transformCoordinates=function(a,b){return this.copy(a)},b.prototype.transformPoint=function(a,b){return this.factory.createPoint(this.transformCoordinates(a.getCoordinateSequence(),a))},b.prototype.transformMultiPoint=function(b,c){for(var d=new a,e=0;e<b.getNumGeometries();e++){var f=this.transformPoint(b.getGeometryN(e),b);null!=f&&(f.isEmpty()||d.add(f))}return this.factory.buildGeometry(d)},b.prototype.transformLinearRing=function(a,b){var c=this.transformCoordinates(a.getCoordinateSequence(),a),d=c.length;return d>0&&4>d&&!this.preserveType?this.factory.createLineString(c):this.factory.createLinearRing(c)},b.prototype.transformLineString=function(a,b){return this.factory.createLineString(this.transformCoordinates(a.getCoordinateSequence(),a))},b.prototype.transformMultiLineString=function(b,c){for(var d=new a,e=0;e<b.getNumGeometries();e++){var f=this.transformLineString(b.getGeometryN(e),b);null!=f&&(f.isEmpty()||d.add(f))}return this.factory.buildGeometry(d)},b.prototype.transformPolygon=function(b,c){var d=!0,e=this.transformLinearRing(b.getExteriorRing(),b);null!=e&&e instanceof jsts.geom.LinearRing&&!e.isEmpty()||(d=!1);for(var f=new a,g=0;g<b.getNumInteriorRing();g++){var h=this.transformLinearRing(b.getInteriorRingN(g),b);null==h||h.isEmpty()||(h instanceof jsts.geom.LinearRing||(d=!1),f.add(h))}if(d)return this.factory.createPolygon(e,f.toArray());var i=new a;return null!=e&&i.add(e),i.addAll(f),this.factory.buildGeometry(i)},b.prototype.transformMultiPolygon=function(b,c){for(var d=new a,e=0;e<b.getNumGeometries();e++){var f=this.transformPolygon(b.getGeometryN(e),b);null!=f&&(f.isEmpty()||d.add(f))}return this.factory.buildGeometry(d)},b.prototype.transformGeometryCollection=function(b,c){for(var d=new a,e=0;e<b.getNumGeometries();e++){var f=this.transform(b.getGeometryN(e));null!=f&&(this.pruneEmptyGeometry&&f.isEmpty()||d.add(f))}return this.preserveGeometryCollectionType?this.factory.createGeometryCollection(GeometryFactory.toGeometryArray(d)):this.factory.buildGeometry(d)},jsts.geom.util.GeometryTransformer=b}(),function(){var a=jsts.operation.overlay.snap.LineStringSnapper,b=jsts.geom.PrecisionModel,c=javascript.util.TreeSet,d=function(a,b,c){this.snapTolerance=a,this.snapPts=b,this.isSelfSnap=c||!1};d.prototype=new jsts.geom.util.GeometryTransformer,d.prototype.snapTolerance=null,d.prototype.snapPts=null,d.prototype.isSelfSnap=!1,d.prototype.transformCoordinates=function(a,b){var c=a,d=this.snapLine(c,this.snapPts);return d},d.prototype.snapLine=function(b,c){var d=new a(b,this.snapTolerance);return d.setAllowSnappingToSourceVertices(this.isSelfSnap),d.snapTo(c)};var e=function(a){this.srcGeom=a};e.SNAP_PRECISION_FACTOR=1e-9,e.computeOverlaySnapTolerance=function(a){if(2===arguments.length)return e.computeOverlaySnapTolerance2.apply(this,arguments);var c=this.computeSizeBasedSnapTolerance(a),d=a.getPrecisionModel();if(d.getType()==b.FIXED){var f=1/d.getScale()*2/1.415;f>c&&(c=f)}return c},e.computeSizeBasedSnapTolerance=function(a){var b=a.getEnvelopeInternal(),c=Math.min(b.getHeight(),b.getWidth()),d=c*e.SNAP_PRECISION_FACTOR;return d},e.computeOverlaySnapTolerance2=function(a,b){return Math.min(this.computeOverlaySnapTolerance(a),this.computeOverlaySnapTolerance(b))},e.snap=function(a,b,c){var d=[],f=new e(a);d[0]=f.snapTo(b,c);var g=new e(b);return d[1]=g.snapTo(d[0],c),d},e.snapToSelf=function(a,b,c){var d=new e(a);return d.snapToSelf(b,c)},e.prototype.srcGeom=null,e.prototype.snapTo=function(a,b){var c=this.extractTargetCoordinates(a),e=new d(b,c);return e.transform(this.srcGeom)},e.prototype.snapToSelf=function(a,b){var c=this.extractTargetCoordinates(srcGeom),e=new d(a,c,!0),f=e.transform(srcGeom),g=f;return b&&g instanceof Polygonal&&(g=f.buffer(0)),g},e.prototype.extractTargetCoordinates=function(a){for(var b=new c,d=a.getCoordinates(),e=0;e<d.length;e++)b.add(d[e]);return b.toArray()},e.prototype.computeSnapTolerance=function(a){var b=this.computeMinimumSegmentLength(a),c=b/10;return c},e.prototype.computeMinimumSegmentLength=function(a){for(var b=Number.MAX_VALUE,c=0;c<a.length-1;c++){var d=a[c].distance(a[c+1]);b>d&&(b=d)}return b},jsts.operation.overlay.snap.GeometrySnapper=e}(),jsts.algorithm.PointLocator=function(a){this.boundaryRule=a?a:jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE},jsts.algorithm.PointLocator.prototype.boundaryRule=null,jsts.algorithm.PointLocator.prototype.isIn=null,jsts.algorithm.PointLocator.prototype.numBoundaries=null,jsts.algorithm.PointLocator.prototype.intersects=function(a,b){return this.locate(a,b)!==jsts.geom.Location.EXTERIOR},jsts.algorithm.PointLocator.prototype.locate=function(a,b){return b.isEmpty()?jsts.geom.Location.EXTERIOR:b instanceof jsts.geom.Point?this.locate2(a,b):b instanceof jsts.geom.LineString?this.locate3(a,b):b instanceof jsts.geom.Polygon?this.locate4(a,b):(this.isIn=!1,this.numBoundaries=0,this.computeLocation(a,b),this.boundaryRule.isInBoundary(this.numBoundaries)?jsts.geom.Location.BOUNDARY:this.numBoundaries>0||this.isIn?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR)},jsts.algorithm.PointLocator.prototype.computeLocation=function(a,b){if(b instanceof jsts.geom.Point||b instanceof jsts.geom.LineString||b instanceof jsts.geom.Polygon)this.updateLocationInfo(this.locate(a,b));else if(b instanceof jsts.geom.MultiLineString)for(var c=b,d=0;d<c.getNumGeometries();d++){var e=c.getGeometryN(d);this.updateLocationInfo(this.locate(a,e))}else if(b instanceof jsts.geom.MultiPolygon)for(var f=b,d=0;d<f.getNumGeometries();d++){var g=f.getGeometryN(d);this.updateLocationInfo(this.locate(a,g))}else if(b instanceof jsts.geom.MultiPoint||b instanceof jsts.geom.GeometryCollection)for(var d=0;d<b.getNumGeometries();d++){var h=b.getGeometryN(d);h!==b&&this.computeLocation(a,h)}},jsts.algorithm.PointLocator.prototype.updateLocationInfo=function(a){a===jsts.geom.Location.INTERIOR&&(this.isIn=!0),a===jsts.geom.Location.BOUNDARY&&this.numBoundaries++},jsts.algorithm.PointLocator.prototype.locate2=function(a,b){var c=b.getCoordinate();return c.equals2D(a)?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR},jsts.algorithm.PointLocator.prototype.locate3=function(a,b){if(!b.getEnvelopeInternal().intersects(a))return jsts.geom.Location.EXTERIOR;var c=b.getCoordinates();return b.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?jsts.algorithm.CGAlgorithms.isOnLine(a,c)?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR:jsts.geom.Location.BOUNDARY},jsts.algorithm.PointLocator.prototype.locateInPolygonRing=function(a,b){return b.getEnvelopeInternal().intersects(a)?jsts.algorithm.CGAlgorithms.locatePointInRing(a,b.getCoordinates()):jsts.geom.Location.EXTERIOR},jsts.algorithm.PointLocator.prototype.locate4=function(a,b){if(b.isEmpty())return jsts.geom.Location.EXTERIOR;var c=b.getExteriorRing(),d=this.locateInPolygonRing(a,c);if(d===jsts.geom.Location.EXTERIOR)return jsts.geom.Location.EXTERIOR;if(d===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY;for(var e=0;e<b.getNumInteriorRing();e++){var f=b.getInteriorRingN(e),g=this.locateInPolygonRing(a,f);if(g===jsts.geom.Location.INTERIOR)return jsts.geom.Location.EXTERIOR;if(g===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY}return jsts.geom.Location.INTERIOR},function(){var a=jsts.geom.Location,b=javascript.util.ArrayList,c=javascript.util.TreeMap;jsts.geomgraph.NodeMap=function(a){this.nodeMap=new c,this.nodeFact=a},jsts.geomgraph.NodeMap.prototype.nodeMap=null,jsts.geomgraph.NodeMap.prototype.nodeFact=null,jsts.geomgraph.NodeMap.prototype.addNode=function(a){var b,c;if(a instanceof jsts.geom.Coordinate)return c=a,b=this.nodeMap.get(c),null===b&&(b=this.nodeFact.createNode(c),this.nodeMap.put(c,b)),b;if(a instanceof jsts.geomgraph.Node){var d=a;return c=d.getCoordinate(),b=this.nodeMap.get(c),null===b?(this.nodeMap.put(c,d),d):(b.mergeLabel(d),b)}},jsts.geomgraph.NodeMap.prototype.add=function(a){var b=a.getCoordinate(),c=this.addNode(b);c.add(a)},jsts.geomgraph.NodeMap.prototype.find=function(a){return this.nodeMap.get(a)},jsts.geomgraph.NodeMap.prototype.values=function(){return this.nodeMap.values()},jsts.geomgraph.NodeMap.prototype.iterator=function(){return this.values().iterator()},jsts.geomgraph.NodeMap.prototype.getBoundaryNodes=function(c){for(var d=new b,e=this.iterator();e.hasNext();){var f=e.next();f.getLabel().getLocation(c)===a.BOUNDARY&&d.add(f)}return d}}(),function(){var a=javascript.util.ArrayList;jsts.geomgraph.PlanarGraph=function(b){this.edges=new a,this.edgeEndList=new a,this.nodes=new jsts.geomgraph.NodeMap(b||new jsts.geomgraph.NodeFactory)},jsts.geomgraph.PlanarGraph.prototype.edges=null,jsts.geomgraph.PlanarGraph.prototype.nodes=null,jsts.geomgraph.PlanarGraph.prototype.edgeEndList=null,jsts.geomgraph.PlanarGraph.linkResultDirectedEdges=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();c.getEdges().linkResultDirectedEdges()}},jsts.geomgraph.PlanarGraph.prototype.getEdgeIterator=function(){return this.edges.iterator()},jsts.geomgraph.PlanarGraph.prototype.getEdgeEnds=function(){return this.edgeEndList},jsts.geomgraph.PlanarGraph.prototype.isBoundaryNode=function(a,b){var c=this.nodes.find(b);if(null===c)return!1;var d=c.getLabel();return null!==d&&d.getLocation(a)===jsts.geom.Location.BOUNDARY?!0:!1},jsts.geomgraph.PlanarGraph.prototype.insertEdge=function(a){this.edges.add(a)},jsts.geomgraph.PlanarGraph.prototype.add=function(a){this.nodes.add(a),this.edgeEndList.add(a)},jsts.geomgraph.PlanarGraph.prototype.getNodeIterator=function(){return this.nodes.iterator()},jsts.geomgraph.PlanarGraph.prototype.getNodes=function(){return this.nodes.values()},jsts.geomgraph.PlanarGraph.prototype.addNode=function(a){return this.nodes.addNode(a)},jsts.geomgraph.PlanarGraph.prototype.addEdges=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();this.edges.add(c);var d=new jsts.geomgraph.DirectedEdge(c,!0),e=new jsts.geomgraph.DirectedEdge(c,!1);d.setSym(e),e.setSym(d),this.add(d),this.add(e)}},jsts.geomgraph.PlanarGraph.prototype.linkResultDirectedEdges=function(){for(var a=this.nodes.iterator();a.hasNext();){var b=a.next();b.getEdges().linkResultDirectedEdges()}},jsts.geomgraph.PlanarGraph.prototype.findEdgeInSameDirection=function(a,b){var c,d,e=0,f=this.edges.size();for(e;f>e;e++){if(c=this.edges.get(e),d=c.getCoordinates(),this.matchInSameDirection(a,b,d[0],d[1]))return c;if(this.matchInSameDirection(a,b,d[d.length-1],d[d.length-2]))return c}return null},jsts.geomgraph.PlanarGraph.prototype.matchInSameDirection=function(a,b,c,d){return a.equals(c)&&jsts.algorithm.CGAlgorithms.computeOrientation(a,b,d)===jsts.algorithm.CGAlgorithms.COLLINEAR&&jsts.geomgraph.Quadrant.quadrant(a,b)===jsts.geomgraph.Quadrant.quadrant(c,d)?!0:!1},jsts.geomgraph.PlanarGraph.prototype.findEdgeEnd=function(a){for(var b=this.getEdgeEnds().iterator();b.hasNext();){var c=b.next();if(c.getEdge()===a)return c}return null}}(),jsts.noding.SegmentIntersector=function(){},jsts.noding.SegmentIntersector.prototype.processIntersections=jsts.abstractFunc,jsts.noding.SegmentIntersector.prototype.isDone=jsts.abstractFunc,function(){var a=jsts.noding.SegmentIntersector,b=javascript.util.ArrayList;jsts.noding.InteriorIntersectionFinder=function(a){this.li=a,this.intersections=new b,this.interiorIntersection=null},jsts.noding.InteriorIntersectionFinder.prototype=new a,jsts.noding.InteriorIntersectionFinder.constructor=jsts.noding.InteriorIntersectionFinder,jsts.noding.InteriorIntersectionFinder.prototype.findAllIntersections=!1,jsts.noding.InteriorIntersectionFinder.prototype.isCheckEndSegmentsOnly=!1,jsts.noding.InteriorIntersectionFinder.prototype.li=null,jsts.noding.InteriorIntersectionFinder.prototype.interiorIntersection=null,jsts.noding.InteriorIntersectionFinder.prototype.intSegments=null,jsts.noding.InteriorIntersectionFinder.prototype.intersections=null,jsts.noding.InteriorIntersectionFinder.prototype.setFindAllIntersections=function(a){this.findAllIntersections=a},jsts.noding.InteriorIntersectionFinder.prototype.getIntersections=function(){return intersections},jsts.noding.InteriorIntersectionFinder.prototype.setCheckEndSegmentsOnly=function(a){this.isCheckEndSegmentsOnly=a},jsts.noding.InteriorIntersectionFinder.prototype.hasIntersection=function(){return null!=this.interiorIntersection},jsts.noding.InteriorIntersectionFinder.prototype.getInteriorIntersection=function(){return this.interiorIntersection},jsts.noding.InteriorIntersectionFinder.prototype.getIntersectionSegments=function(){return this.intSegments},jsts.noding.InteriorIntersectionFinder.prototype.processIntersections=function(a,b,c,d){if(!this.hasIntersection()&&(a!=c||b!=d)){if(this.isCheckEndSegmentsOnly){var e=this.isEndSegment(a,b)||isEndSegment(c,d);if(!e)return}var f=a.getCoordinates()[b],g=a.getCoordinates()[b+1],h=c.getCoordinates()[d],i=c.getCoordinates()[d+1];this.li.computeIntersection(f,g,h,i),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=[],this.intSegments[0]=f,this.intSegments[1]=g,this.intSegments[2]=h,this.intSegments[3]=i,this.interiorIntersection=this.li.getIntersection(0),this.intersections.add(this.interiorIntersection))}},jsts.noding.InteriorIntersectionFinder.prototype.isEndSegment=function(a,b){return 0==b?!0:b>=a.size()-2?!0:!1},jsts.noding.InteriorIntersectionFinder.prototype.isDone=function(){return this.findAllIntersections?!1:null!=this.interiorIntersection}}(),function(){var a=jsts.algorithm.RobustLineIntersector,b=jsts.noding.InteriorIntersectionFinder,c=jsts.noding.MCIndexNoder;jsts.noding.FastNodingValidator=function(b){this.li=new a,this.segStrings=b},jsts.noding.FastNodingValidator.prototype.li=null,jsts.noding.FastNodingValidator.prototype.segStrings=null,jsts.noding.FastNodingValidator.prototype.findAllIntersections=!1,jsts.noding.FastNodingValidator.prototype.segInt=null,jsts.noding.FastNodingValidator.prototype._isValid=!0,jsts.noding.FastNodingValidator.prototype.setFindAllIntersections=function(a){this.findAllIntersections=a},jsts.noding.FastNodingValidator.prototype.getIntersections=function(){return segInt.getIntersections()},jsts.noding.FastNodingValidator.prototype.isValid=function(){return this.execute(),this._isValid},jsts.noding.FastNodingValidator.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var a=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+jsts.io.WKTWriter.toLineString(a[0],a[1])+" and "+jsts.io.WKTWriter.toLineString(a[2],a[3])},jsts.noding.FastNodingValidator.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new jsts.error.TopologyError(this.getErrorMessage(),this.segInt.getInteriorIntersection())},jsts.noding.FastNodingValidator.prototype.execute=function(){null==this.segInt&&this.checkInteriorIntersections()},jsts.noding.FastNodingValidator.prototype.checkInteriorIntersections=function(){this._isValid=!0,this.segInt=new b(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var a=new c;return a.setSegmentIntersector(this.segInt),a.computeNodes(this.segStrings),this.segInt.hasIntersection()?void(this._isValid=!1):void 0}}(),function(){jsts.noding.BasicSegmentString=function(a,b){this.pts=a,this.data=b},jsts.noding.BasicSegmentString.prototype=new jsts.noding.SegmentString,jsts.noding.BasicSegmentString.prototype.pts=null,jsts.noding.BasicSegmentString.prototype.data=null,jsts.noding.BasicSegmentString.prototype.getData=function(){return this.data},jsts.noding.BasicSegmentString.prototype.setData=function(a){this.data=a},jsts.noding.BasicSegmentString.prototype.size=function(){return this.pts.length},jsts.noding.BasicSegmentString.prototype.getCoordinate=function(a){return this.pts[a]},jsts.noding.BasicSegmentString.prototype.getCoordinates=function(){return this.pts},jsts.noding.BasicSegmentString.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.noding.BasicSegmentString.prototype.getSegmentOctant=function(a){return a==this.pts.length-1?-1:jsts.noding.Octant.octant(this.getCoordinate(a),this.getCoordinate(a+1))}}(),function(){var a=jsts.noding.FastNodingValidator,b=jsts.noding.BasicSegmentString,c=javascript.util.ArrayList;jsts.geomgraph.EdgeNodingValidator=function(b){this.nv=new a(jsts.geomgraph.EdgeNodingValidator.toSegmentStrings(b))},jsts.geomgraph.EdgeNodingValidator.checkValid=function(a){var b=new jsts.geomgraph.EdgeNodingValidator(a);b.checkValid()},jsts.geomgraph.EdgeNodingValidator.toSegmentStrings=function(a){for(var d=new c,e=a.iterator();e.hasNext();){var f=e.next();d.add(new b(f.getCoordinates(),f))}return d},jsts.geomgraph.EdgeNodingValidator.prototype.nv=null,jsts.geomgraph.EdgeNodingValidator.prototype.checkValid=function(){this.nv.checkValid()}}(),jsts.operation.GeometryGraphOperation=function(a,b,c){if(this.li=new jsts.algorithm.RobustLineIntersector,this.arg=[],void 0!==a){if(void 0===b)return this.setComputationPrecision(a.getPrecisionModel()),void(this.arg[0]=new jsts.geomgraph.GeometryGraph(0,a));c=c||jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE,a.getPrecisionModel().compareTo(b.getPrecisionModel())>=0?this.setComputationPrecision(a.getPrecisionModel()):this.setComputationPrecision(b.getPrecisionModel()),this.arg[0]=new jsts.geomgraph.GeometryGraph(0,a,c),this.arg[1]=new jsts.geomgraph.GeometryGraph(1,b,c)}},jsts.operation.GeometryGraphOperation.prototype.li=null,jsts.operation.GeometryGraphOperation.prototype.resultPrecisionModel=null,jsts.operation.GeometryGraphOperation.prototype.arg=null,jsts.operation.GeometryGraphOperation.prototype.getArgGeometry=function(a){return arg[a].getGeometry()},jsts.operation.GeometryGraphOperation.prototype.setComputationPrecision=function(a){this.resultPrecisionModel=a,this.li.setPrecisionModel(this.resultPrecisionModel)},jsts.operation.overlay.OverlayNodeFactory=function(){},jsts.operation.overlay.OverlayNodeFactory.prototype=new jsts.geomgraph.NodeFactory,jsts.operation.overlay.OverlayNodeFactory.constructor=jsts.operation.overlay.OverlayNodeFactory,jsts.operation.overlay.OverlayNodeFactory.prototype.createNode=function(a){return new jsts.geomgraph.Node(a,new jsts.geomgraph.DirectedEdgeStar)},jsts.operation.overlay.PolygonBuilder=function(a){this.shellList=[],this.geometryFactory=a},jsts.operation.overlay.PolygonBuilder.prototype.geometryFactory=null,jsts.operation.overlay.PolygonBuilder.prototype.shellList=null,jsts.operation.overlay.PolygonBuilder.prototype.add=function(a){return 2===arguments.length?void this.add2.apply(this,arguments):void this.add2(a.getEdgeEnds(),a.getNodes())},jsts.operation.overlay.PolygonBuilder.prototype.add2=function(a,b){jsts.geomgraph.PlanarGraph.linkResultDirectedEdges(b);var c=this.buildMaximalEdgeRings(a),d=[],e=this.buildMinimalEdgeRings(c,this.shellList,d);this.sortShellsAndHoles(e,this.shellList,d),this.placeFreeHoles(this.shellList,d)},jsts.operation.overlay.PolygonBuilder.prototype.getPolygons=function(){var a=this.computePolygons(this.shellList);return a},jsts.operation.overlay.PolygonBuilder.prototype.buildMaximalEdgeRings=function(a){for(var b=[],c=a.iterator();c.hasNext();){var d=c.next();if(d.isInResult()&&d.getLabel().isArea()&&null==d.getEdgeRing()){var e=new jsts.operation.overlay.MaximalEdgeRing(d,this.geometryFactory);b.push(e),e.setInResult()}}return b},jsts.operation.overlay.PolygonBuilder.prototype.buildMinimalEdgeRings=function(a,b,c){for(var d=[],e=0;e<a.length;e++){var f=a[e];if(f.getMaxNodeDegree()>2){f.linkDirectedEdgesForMinimalEdgeRings();var g=f.buildMinimalRings(),h=this.findShell(g);null!==h?(this.placePolygonHoles(h,g),b.push(h)):c=c.concat(g)}else d.push(f)}return d},jsts.operation.overlay.PolygonBuilder.prototype.findShell=function(a){for(var b=0,c=null,d=0;d<a.length;d++){var e=a[d];e.isHole()||(c=e,b++)}return jsts.util.Assert.isTrue(1>=b,"found two shells in MinimalEdgeRing list"),c},jsts.operation.overlay.PolygonBuilder.prototype.placePolygonHoles=function(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.isHole()&&d.setShell(a)}},jsts.operation.overlay.PolygonBuilder.prototype.sortShellsAndHoles=function(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.isHole()?c.push(e):b.push(e)}},jsts.operation.overlay.PolygonBuilder.prototype.placeFreeHoles=function(a,b){for(var c=0;c<b.length;c++){var d=b[c];if(null==d.getShell()){var e=this.findEdgeRingContaining(d,a);if(null===e)throw new jsts.error.TopologyError("unable to assign hole to a shell",d.getCoordinate(0));d.setShell(e)}}},jsts.operation.overlay.PolygonBuilder.prototype.findEdgeRingContaining=function(a,b){for(var c=a.getLinearRing(),d=c.getEnvelopeInternal(),e=c.getCoordinateN(0),f=null,g=null,h=0;h<b.length;h++){var i=b[h],j=i.getLinearRing(),k=j.getEnvelopeInternal();null!==f&&(g=f.getLinearRing().getEnvelopeInternal());var l=!1;k.contains(d)&&jsts.algorithm.CGAlgorithms.isPointInRing(e,j.getCoordinates())&&(l=!0),l&&(null==f||g.contains(k))&&(f=i)}return f},jsts.operation.overlay.PolygonBuilder.prototype.computePolygons=function(a){for(var b=new javascript.util.ArrayList,c=0;c<a.length;c++){var d=a[c],e=d.toPolygon(this.geometryFactory);b.add(e)}return b},jsts.operation.overlay.PolygonBuilder.prototype.containsPoint=function(a){for(var b=0;b<this.shellList.length;b++){var c=this.shellList[b];if(c.containsPoint(a))return!0}return!1},function(){var a=jsts.util.Assert,b=javascript.util.ArrayList,c=function(a,c,d){this.lineEdgesList=new b,this.resultLineList=new b,this.op=a,this.geometryFactory=c,this.ptLocator=d};c.prototype.op=null,c.prototype.geometryFactory=null,c.prototype.ptLocator=null,c.prototype.lineEdgesList=null,c.prototype.resultLineList=null,c.prototype.build=function(a){return this.findCoveredLineEdges(),this.collectLines(a),this.buildLines(a),this.resultLineList},c.prototype.findCoveredLineEdges=function(){for(var a=this.op.getGraph().getNodes().iterator();a.hasNext();){var b=a.next();b.getEdges().findCoveredLineEdges();
  }for(var c=this.op.getGraph().getEdgeEnds().iterator();c.hasNext();){var d=c.next(),e=d.getEdge();if(d.isLineEdge()&&!e.isCoveredSet()){var f=this.op.isCoveredByA(d.getCoordinate());e.setCovered(f)}}},c.prototype.collectLines=function(a){for(var b=this.op.getGraph().getEdgeEnds().iterator();b.hasNext();){var c=b.next();this.collectLineEdge(c,a,this.lineEdgesList),this.collectBoundaryTouchEdge(c,a,this.lineEdgesList)}},c.prototype.collectLineEdge=function(a,b,c){var d=a.getLabel(),e=a.getEdge();a.isLineEdge()&&(a.isVisited()||!jsts.operation.overlay.OverlayOp.isResultOfOp(d,b)||e.isCovered()||(c.add(e),a.setVisitedEdge(!0)))},c.prototype.collectBoundaryTouchEdge=function(b,c,d){var e=b.getLabel();b.isLineEdge()||b.isVisited()||b.isInteriorAreaEdge()||b.getEdge().isInResult()||(a.isTrue(!(b.isInResult()||b.getSym().isInResult())||!b.getEdge().isInResult()),jsts.operation.overlay.OverlayOp.isResultOfOp(e,c)&&c===jsts.operation.overlay.OverlayOp.INTERSECTION&&(d.add(b.getEdge()),b.setVisitedEdge(!0)))},c.prototype.buildLines=function(a){for(var b=this.lineEdgesList.iterator();b.hasNext();){var c=b.next(),d=(c.getLabel(),this.geometryFactory.createLineString(c.getCoordinates()));this.resultLineList.add(d),c.setInResult(!0)}},c.prototype.labelIsolatedLines=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next(),d=c.getLabel();c.isIsolated()&&(d.isNull(0)?this.labelIsolatedLine(c,0):this.labelIsolatedLine(c,1))}},c.prototype.labelIsolatedLine=function(a,b){var c=ptLocator.locate(a.getCoordinate(),op.getArgGeometry(b));a.getLabel().setLocation(b,c)},jsts.operation.overlay.LineBuilder=c}(),function(){var a=javascript.util.ArrayList,b=function(b,c,d){this.resultPointList=new a,this.op=b,this.geometryFactory=c};b.prototype.op=null,b.prototype.geometryFactory=null,b.prototype.resultPointList=null,b.prototype.build=function(a){return this.extractNonCoveredResultNodes(a),this.resultPointList},b.prototype.extractNonCoveredResultNodes=function(a){for(var b=this.op.getGraph().getNodes().iterator();b.hasNext();){var c=b.next();if(!(c.isInResult()||c.isIncidentEdgeInResult()||0!==c.getEdges().getDegree()&&a!==jsts.operation.overlay.OverlayOp.INTERSECTION)){var d=c.getLabel();jsts.operation.overlay.OverlayOp.isResultOfOp(d,a)&&this.filterCoveredNodeToPoint(c)}}},b.prototype.filterCoveredNodeToPoint=function(a){var b=a.getCoordinate();if(!this.op.isCoveredByLA(b)){var c=this.geometryFactory.createPoint(b);this.resultPointList.add(c)}},jsts.operation.overlay.PointBuilder=b}(),function(){var a=jsts.algorithm.PointLocator,b=jsts.geom.Location,c=jsts.geomgraph.EdgeList,d=jsts.geomgraph.Label,e=jsts.geomgraph.PlanarGraph,f=jsts.geomgraph.Position,g=jsts.geomgraph.EdgeNodingValidator,h=jsts.operation.GeometryGraphOperation,i=jsts.operation.overlay.OverlayNodeFactory,j=jsts.operation.overlay.PolygonBuilder,k=jsts.operation.overlay.LineBuilder,l=jsts.operation.overlay.PointBuilder,m=jsts.util.Assert,n=javascript.util.ArrayList;jsts.operation.overlay.OverlayOp=function(b,d){this.ptLocator=new a,this.edgeList=new c,this.resultPolyList=new n,this.resultLineList=new n,this.resultPointList=new n,h.call(this,b,d),this.graph=new e(new i),this.geomFact=b.getFactory()},jsts.operation.overlay.OverlayOp.prototype=new h,jsts.operation.overlay.OverlayOp.constructor=jsts.operation.overlay.OverlayOp,jsts.operation.overlay.OverlayOp.INTERSECTION=1,jsts.operation.overlay.OverlayOp.UNION=2,jsts.operation.overlay.OverlayOp.DIFFERENCE=3,jsts.operation.overlay.OverlayOp.SYMDIFFERENCE=4,jsts.operation.overlay.OverlayOp.overlayOp=function(a,b,c){var d=new jsts.operation.overlay.OverlayOp(a,b),e=d.getResultGeometry(c);return e},jsts.operation.overlay.OverlayOp.isResultOfOp=function(a,b){if(3===arguments.length)return jsts.operation.overlay.OverlayOp.isResultOfOp2.apply(this,arguments);var c=a.getLocation(0),d=a.getLocation(1);return jsts.operation.overlay.OverlayOp.isResultOfOp2(c,d,b)},jsts.operation.overlay.OverlayOp.isResultOfOp2=function(a,c,d){switch(a==b.BOUNDARY&&(a=b.INTERIOR),c==b.BOUNDARY&&(c=b.INTERIOR),d){case jsts.operation.overlay.OverlayOp.INTERSECTION:return a==b.INTERIOR&&c==b.INTERIOR;case jsts.operation.overlay.OverlayOp.UNION:return a==b.INTERIOR||c==b.INTERIOR;case jsts.operation.overlay.OverlayOp.DIFFERENCE:return a==b.INTERIOR&&c!=b.INTERIOR;case jsts.operation.overlay.OverlayOp.SYMDIFFERENCE:return a==b.INTERIOR&&c!=b.INTERIOR||a!=b.INTERIOR&&c==b.INTERIOR}return!1},jsts.operation.overlay.OverlayOp.prototype.ptLocator=null,jsts.operation.overlay.OverlayOp.prototype.geomFact=null,jsts.operation.overlay.OverlayOp.prototype.resultGeom=null,jsts.operation.overlay.OverlayOp.prototype.graph=null,jsts.operation.overlay.OverlayOp.prototype.edgeList=null,jsts.operation.overlay.OverlayOp.prototype.resultPolyList=null,jsts.operation.overlay.OverlayOp.prototype.resultLineList=null,jsts.operation.overlay.OverlayOp.prototype.resultPointList=null,jsts.operation.overlay.OverlayOp.prototype.getResultGeometry=function(a){return this.computeOverlay(a),this.resultGeom},jsts.operation.overlay.OverlayOp.prototype.getGraph=function(){return this.graph},jsts.operation.overlay.OverlayOp.prototype.computeOverlay=function(a){this.copyPoints(0),this.copyPoints(1),this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1),this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!0);var b=new n;this.arg[0].computeSplitEdges(b),this.arg[1].computeSplitEdges(b),this.insertUniqueEdges(b),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),g.checkValid(this.edgeList.getEdges()),this.graph.addEdges(this.edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(a),this.cancelDuplicateResultEdges();var c=new j(this.geomFact);c.add(this.graph),this.resultPolyList=c.getPolygons();var d=new k(this,this.geomFact,this.ptLocator);this.resultLineList=d.build(a);var e=new l(this,this.geomFact,this.ptLocator);this.resultPointList=e.build(a),this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,a)},jsts.operation.overlay.OverlayOp.prototype.insertUniqueEdges=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();this.insertUniqueEdge(c)}},jsts.operation.overlay.OverlayOp.prototype.insertUniqueEdge=function(a){var b=this.edgeList.findEqualEdge(a);if(null!==b){var c=b.getLabel(),e=a.getLabel();b.isPointwiseEqual(a)||(e=new d(a.getLabel()),e.flip());var f=b.getDepth();f.isNull()&&f.add(c),f.add(e),c.merge(e)}else this.edgeList.add(a)},jsts.operation.overlay.OverlayOp.prototype.computeLabelsFromDepths=function(){for(var a=this.edgeList.iterator();a.hasNext();){var b=a.next(),c=b.getLabel(),d=b.getDepth();if(!d.isNull()){d.normalize();for(var e=0;2>e;e++)c.isNull(e)||!c.isArea()||d.isNull(e)||(0==d.getDelta(e)?c.toLine(e):(m.isTrue(!d.isNull(e,f.LEFT),"depth of LEFT side has not been initialized"),c.setLocation(e,f.LEFT,d.getLocation(e,f.LEFT)),m.isTrue(!d.isNull(e,f.RIGHT),"depth of RIGHT side has not been initialized"),c.setLocation(e,f.RIGHT,d.getLocation(e,f.RIGHT))))}}},jsts.operation.overlay.OverlayOp.prototype.replaceCollapsedEdges=function(){for(var a=new n,b=this.edgeList.iterator();b.hasNext();){var c=b.next();c.isCollapsed()&&(b.remove(),a.add(c.getCollapsedEdge()))}this.edgeList.addAll(a)},jsts.operation.overlay.OverlayOp.prototype.copyPoints=function(a){for(var b=this.arg[a].getNodeIterator();b.hasNext();){var c=b.next(),d=this.graph.addNode(c.getCoordinate());d.setLabel(a,c.getLabel().getLocation(a))}},jsts.operation.overlay.OverlayOp.prototype.computeLabelling=function(){for(var a=this.graph.getNodes().iterator();a.hasNext();){var b=a.next();b.getEdges().computeLabelling(this.arg)}this.mergeSymLabels(),this.updateNodeLabelling()},jsts.operation.overlay.OverlayOp.prototype.mergeSymLabels=function(){for(var a=this.graph.getNodes().iterator();a.hasNext();){var b=a.next();b.getEdges().mergeSymLabels()}},jsts.operation.overlay.OverlayOp.prototype.updateNodeLabelling=function(){for(var a=this.graph.getNodes().iterator();a.hasNext();){var b=a.next(),c=b.getEdges().getLabel();b.getLabel().merge(c)}},jsts.operation.overlay.OverlayOp.prototype.labelIncompleteNodes=function(){for(var a=0,b=this.graph.getNodes().iterator();b.hasNext();){var c=b.next(),d=c.getLabel();c.isIsolated()&&(a++,d.isNull(0)?this.labelIncompleteNode(c,0):this.labelIncompleteNode(c,1)),c.getEdges().updateLabelling(d)}},jsts.operation.overlay.OverlayOp.prototype.labelIncompleteNode=function(a,b){var c=this.ptLocator.locate(a.getCoordinate(),this.arg[b].getGeometry());a.getLabel().setLocation(b,c)},jsts.operation.overlay.OverlayOp.prototype.findResultAreaEdges=function(a){for(var b=this.graph.getEdgeEnds().iterator();b.hasNext();){var c=b.next(),d=c.getLabel();d.isArea()&&!c.isInteriorAreaEdge()&&jsts.operation.overlay.OverlayOp.isResultOfOp(d.getLocation(0,f.RIGHT),d.getLocation(1,f.RIGHT),a)&&c.setInResult(!0)}},jsts.operation.overlay.OverlayOp.prototype.cancelDuplicateResultEdges=function(){for(var a=this.graph.getEdgeEnds().iterator();a.hasNext();){var b=a.next(),c=b.getSym();b.isInResult()&&c.isInResult()&&(b.setInResult(!1),c.setInResult(!1))}},jsts.operation.overlay.OverlayOp.prototype.isCoveredByLA=function(a){return this.isCovered(a,this.resultLineList)?!0:this.isCovered(a,this.resultPolyList)?!0:!1},jsts.operation.overlay.OverlayOp.prototype.isCoveredByA=function(a){return this.isCovered(a,this.resultPolyList)?!0:!1},jsts.operation.overlay.OverlayOp.prototype.isCovered=function(a,c){for(var d=c.iterator();d.hasNext();){var e=d.next(),f=this.ptLocator.locate(a,e);if(f!=b.EXTERIOR)return!0}return!1},jsts.operation.overlay.OverlayOp.prototype.computeGeometry=function(a,b,c,d){var e=new n;return e.addAll(a),e.addAll(b),e.addAll(c),this.geomFact.buildGeometry(e)},jsts.operation.overlay.OverlayOp.prototype.createEmptyResult=function(a){var b=null;switch(resultDimension(a,this.arg[0].getGeometry(),this.arg[1].getGeometry())){case-1:b=geomFact.createGeometryCollection();break;case 0:b=geomFact.createPoint(null);break;case 1:b=geomFact.createLineString(null);break;case 2:b=geomFact.createPolygon(null,null)}return b},jsts.operation.overlay.OverlayOp.prototype.resultDimension=function(a,b,c){var d=b.getDimension(),e=c.getDimension(),f=-1;switch(a){case jsts.operation.overlay.OverlayOp.INTERSECTION:f=Math.min(d,e);break;case jsts.operation.overlay.OverlayOp.UNION:f=Math.max(d,e);break;case jsts.operation.overlay.OverlayOp.DIFFERENCE:f=d;break;case jsts.operation.overlay.OverlayOp.SYMDIFFERENCE:f=Math.max(d,e)}return f}}(),function(){var a=jsts.operation.overlay.OverlayOp,b=jsts.operation.overlay.snap.GeometrySnapper,c=function(a,b){this.geom=[],this.geom[0]=a,this.geom[1]=b,this.computeSnapTolerance()};c.overlayOp=function(a,b,d){var e=new c(a,b);return e.getResultGeometry(d)},c.intersection=function(b,c){return this.overlayOp(b,c,a.INTERSECTION)},c.union=function(b,c){return this.overlayOp(b,c,a.UNION)},c.difference=function(b,c){return overlayOp(b,c,a.DIFFERENCE)},c.symDifference=function(b,c){return overlayOp(b,c,a.SYMDIFFERENCE)},c.prototype.geom=null,c.prototype.snapTolerance=null,c.prototype.computeSnapTolerance=function(){this.snapTolerance=b.computeOverlaySnapTolerance(this.geom[0],this.geom[1])},c.prototype.getResultGeometry=function(b){var c=this.snap(this.geom),d=a.overlayOp(c[0],c[1],b);return this.prepareResult(d)},c.prototype.selfSnap=function(a){var c=new b(a),d=c.snapTo(a,this.snapTolerance);return d},c.prototype.snap=function(a){var c=a,d=b.snap(c[0],c[1],this.snapTolerance);return d},c.prototype.prepareResult=function(a){return a},c.prototype.cbr=null,c.prototype.removeCommonBits=function(a){this.cbr=new jsts.precision.CommonBitsRemover,this.cbr.add(this.geom[0]),this.cbr.add(this.geom[1]);var b=[];return b[0]=cbr.removeCommonBits(this.geom[0].clone()),b[1]=cbr.removeCommonBits(this.geom[1].clone()),b},jsts.operation.overlay.snap.SnapOverlayOp=c}(),jsts.geomgraph.index.EdgeSetIntersector=function(){},jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections=function(a,b,c){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections2=function(a,b,c){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.index.SimpleMCSweepLineIntersector=function(){this.events=[]},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector,jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.events=null,jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.nOverlaps=0,jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.computeIntersections=function(a,b,c){return b instanceof javascript.util.List?void this.computeIntersections2.apply(this,arguments):(c?this.addList2(a,null):this.addList(a),void this.computeIntersections3(b))},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.computeIntersections2=function(a,b,c){this.addList2(a,a),this.addList2(b,b),this.computeIntersections3(c)},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.add=function(a,b){if(a instanceof javascript.util.List)return void this.addList.apply(this,arguments);for(var c=a.getMonotoneChainEdge(),d=c.getStartIndexes(),e=0;e<d.length-1;e++){var f=new jsts.geomgraph.index.MonotoneChain(c,e),g=new jsts.geomgraph.index.SweepLineEvent(c.getMinX(e),f,b);this.events.push(g),this.events.push(new jsts.geomgraph.index.SweepLineEvent(c.getMaxX(e),g))}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.addList=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();this.add(c,c)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.addList2=function(a,b){for(var c=a.iterator();c.hasNext();){var d=c.next();this.add(d,b)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.prepareEvents=function(){this.events.sort(function(a,b){return a.compareTo(b)});for(var a=0;a<this.events.length;a++){var b=this.events[a];b.isDelete()&&b.getInsertEvent().setDeleteEventIndex(a)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.computeIntersections3=function(a){this.nOverlaps=0,this.prepareEvents();for(var b=0;b<this.events.length;b++){var c=this.events[b];c.isInsert()&&this.processOverlaps(b,c.getDeleteEventIndex(),c,a)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.processOverlaps=function(a,b,c,d){for(var e=c.getObject(),f=a;b>f;f++){var g=this.events[f];if(g.isInsert()){var h=g.getObject();c.isSameLabel(g)||(e.computeIntersections(h,d),this.nOverlaps++)}}},jsts.algorithm.locate.SimplePointInAreaLocator=function(a){this.geom=a},jsts.algorithm.locate.SimplePointInAreaLocator.locate=function(a,b){return b.isEmpty()?jsts.geom.Location.EXTERIOR:jsts.algorithm.locate.SimplePointInAreaLocator.containsPoint(a,b)?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR},jsts.algorithm.locate.SimplePointInAreaLocator.containsPoint=function(a,b){if(b instanceof jsts.geom.Polygon)return jsts.algorithm.locate.SimplePointInAreaLocator.containsPointInPolygon(a,b);if(b instanceof jsts.geom.GeometryCollection||b instanceof jsts.geom.MultiPoint||b instanceof jsts.geom.MultiLineString||b instanceof jsts.geom.MultiPolygon)for(var c=0;c<b.geometries.length;c++){var d=b.geometries[c];if(d!==b&&jsts.algorithm.locate.SimplePointInAreaLocator.containsPoint(a,d))return!0}return!1},jsts.algorithm.locate.SimplePointInAreaLocator.containsPointInPolygon=function(a,b){if(b.isEmpty())return!1;var c=b.getExteriorRing();if(!jsts.algorithm.locate.SimplePointInAreaLocator.isPointInRing(a,c))return!1;for(var d=0;d<b.getNumInteriorRing();d++){var e=b.getInteriorRingN(d);if(jsts.algorithm.locate.SimplePointInAreaLocator.isPointInRing(a,e))return!1}return!0},jsts.algorithm.locate.SimplePointInAreaLocator.isPointInRing=function(a,b){return b.getEnvelopeInternal().intersects(a)?jsts.algorithm.CGAlgorithms.isPointInRing(a,b.getCoordinates()):!1},jsts.algorithm.locate.SimplePointInAreaLocator.prototype.geom=null,jsts.algorithm.locate.SimplePointInAreaLocator.prototype.locate=function(a){return jsts.algorithm.locate.SimplePointInAreaLocator.locate(a,geom)},function(){var a=jsts.geom.Location,b=jsts.geomgraph.Position,c=jsts.geomgraph.EdgeEndStar,d=jsts.util.Assert;jsts.geomgraph.DirectedEdgeStar=function(){jsts.geomgraph.EdgeEndStar.call(this)},jsts.geomgraph.DirectedEdgeStar.prototype=new c,jsts.geomgraph.DirectedEdgeStar.constructor=jsts.geomgraph.DirectedEdgeStar,jsts.geomgraph.DirectedEdgeStar.prototype.resultAreaEdgeList=null,jsts.geomgraph.DirectedEdgeStar.prototype.label=null,jsts.geomgraph.DirectedEdgeStar.prototype.insert=function(a){var b=a;this.insertEdgeEnd(b,b)},jsts.geomgraph.DirectedEdgeStar.prototype.getLabel=function(){return this.label},jsts.geomgraph.DirectedEdgeStar.prototype.getOutgoingDegree=function(){for(var a=0,b=this.iterator();b.hasNext();){var c=b.next();c.isInResult()&&a++}return a},jsts.geomgraph.DirectedEdgeStar.prototype.getOutgoingDegree=function(a){for(var b=0,c=this.iterator();c.hasNext();){var d=c.next();d.getEdgeRing()===a&&b++}return b},jsts.geomgraph.DirectedEdgeStar.prototype.getRightmostEdge=function(){var a=this.getEdges(),b=a.size();if(1>b)return null;var c=a.get(0);if(1==b)return c;var e=a.get(b-1),f=c.getQuadrant(),g=e.getQuadrant();return jsts.geomgraph.Quadrant.isNorthern(f)&&jsts.geomgraph.Quadrant.isNorthern(g)?c:jsts.geomgraph.Quadrant.isNorthern(f)||jsts.geomgraph.Quadrant.isNorthern(g)?0!=c.getDy()?c:0!=e.getDy()?e:(d.shouldNeverReachHere("found two horizontal edges incident on node"),null):e},jsts.geomgraph.DirectedEdgeStar.prototype.computeLabelling=function(b){c.prototype.computeLabelling.call(this,b),this.label=new jsts.geomgraph.Label(a.NONE);for(var d=this.iterator();d.hasNext();)for(var e=d.next(),f=e.getEdge(),g=f.getLabel(),h=0;2>h;h++){var i=g.getLocation(h);(i===a.INTERIOR||i===a.BOUNDARY)&&this.label.setLocation(h,a.INTERIOR)}},jsts.geomgraph.DirectedEdgeStar.prototype.mergeSymLabels=function(){for(var a=this.iterator();a.hasNext();){var b=a.next(),c=b.getLabel();c.merge(b.getSym().getLabel())}},jsts.geomgraph.DirectedEdgeStar.prototype.updateLabelling=function(a){for(var b=this.iterator();b.hasNext();){var c=b.next(),d=c.getLabel();d.setAllLocationsIfNull(0,a.getLocation(0)),d.setAllLocationsIfNull(1,a.getLocation(1))}},jsts.geomgraph.DirectedEdgeStar.prototype.getResultAreaEdges=function(){if(null!==this.resultAreaEdgeList)return this.resultAreaEdgeList;this.resultAreaEdgeList=new javascript.util.ArrayList;for(var a=this.iterator();a.hasNext();){var b=a.next();(b.isInResult()||b.getSym().isInResult())&&this.resultAreaEdgeList.add(b)}return this.resultAreaEdgeList},jsts.geomgraph.DirectedEdgeStar.prototype.SCANNING_FOR_INCOMING=1,jsts.geomgraph.DirectedEdgeStar.prototype.LINKING_TO_OUTGOING=2,jsts.geomgraph.DirectedEdgeStar.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var a=null,b=null,c=this.SCANNING_FOR_INCOMING,e=0;e<this.resultAreaEdgeList.size();e++){var f=this.resultAreaEdgeList.get(e),g=f.getSym();if(f.getLabel().isArea())switch(null===a&&f.isInResult()&&(a=f),c){case this.SCANNING_FOR_INCOMING:if(!g.isInResult())continue;b=g,c=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(!f.isInResult())continue;b.setNext(f),c=this.SCANNING_FOR_INCOMING}}if(c===this.LINKING_TO_OUTGOING){if(null===a)throw new jsts.error.TopologyError("no outgoing dirEdge found",this.getCoordinate());d.isTrue(a.isInResult(),"unable to link last incoming dirEdge"),b.setNext(a)}},jsts.geomgraph.DirectedEdgeStar.prototype.linkMinimalDirectedEdges=function(a){for(var b=null,c=null,e=this.SCANNING_FOR_INCOMING,f=this.resultAreaEdgeList.size()-1;f>=0;f--){var g=this.resultAreaEdgeList.get(f),h=g.getSym();switch(null===b&&g.getEdgeRing()===a&&(b=g),e){case this.SCANNING_FOR_INCOMING:if(h.getEdgeRing()!=a)continue;c=h,e=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(g.getEdgeRing()!==a)continue;c.setNextMin(g),e=this.SCANNING_FOR_INCOMING}}e===this.LINKING_TO_OUTGOING&&(d.isTrue(null!==b,"found null for first outgoing dirEdge"),d.isTrue(b.getEdgeRing()===a,"unable to link last incoming dirEdge"),c.setNextMin(b))},jsts.geomgraph.DirectedEdgeStar.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var a=null,b=null,c=this.edgeList.size()-1;c>=0;c--){var d=this.edgeList.get(c),e=d.getSym();null===b&&(b=e),null!==a&&e.setNext(a),a=d}b.setNext(a)},jsts.geomgraph.DirectedEdgeStar.prototype.findCoveredLineEdges=function(){for(var b=a.NONE,c=this.iterator();c.hasNext();){var d=c.next(),e=d.getSym();if(!d.isLineEdge()){if(d.isInResult()){b=a.INTERIOR;break}if(e.isInResult()){b=a.EXTERIOR;break}}}if(b!==a.NONE)for(var f=b,c=this.iterator();c.hasNext();){var d=c.next(),e=d.getSym();d.isLineEdge()?d.getEdge().setCovered(f===a.INTERIOR):(d.isInResult()&&(f=a.EXTERIOR),e.isInResult()&&(f=a.INTERIOR))}},jsts.geomgraph.DirectedEdgeStar.prototype.computeDepths=function(a){if(2===arguments.length)return void this.computeDepths2.apply(this,arguments);var c=this.findIndex(a),d=(a.getLabel(),a.getDepth(b.LEFT)),e=a.getDepth(b.RIGHT),f=this.computeDepths2(c+1,this.edgeList.size(),d),g=this.computeDepths2(0,c,f);if(g!=e)throw new jsts.error.TopologyError("depth mismatch at "+a.getCoordinate())},jsts.geomgraph.DirectedEdgeStar.prototype.computeDepths2=function(a,c,d){for(var e=d,f=a;c>f;f++){var g=this.edgeList.get(f);g.getLabel(),g.setEdgeDepths(b.RIGHT,e),e=g.getDepth(b.LEFT)}return e}}(),jsts.algorithm.CentroidLine=function(){this.centSum=new jsts.geom.Coordinate},jsts.algorithm.CentroidLine.prototype.centSum=null,jsts.algorithm.CentroidLine.prototype.totalLength=0,jsts.algorithm.CentroidLine.prototype.add=function(a){if(a instanceof Array)return void this.add2.apply(this,arguments);if(a instanceof jsts.geom.LineString)this.add(a.getCoordinates());else if(a instanceof jsts.geom.Polygon){var b=a;this.add(b.getExteriorRing().getCoordinates());for(var c=0;c<b.getNumInteriorRing();c++)this.add(b.getInteriorRingN(c).getCoordinates())}else if(a instanceof jsts.geom.GeometryCollection||a instanceof jsts.geom.MultiPoint||a instanceof jsts.geom.MultiLineString||a instanceof jsts.geom.MultiPolygon)for(var d=a,c=0;c<d.getNumGeometries();c++)this.add(d.getGeometryN(c))},jsts.algorithm.CentroidLine.prototype.getCentroid=function(){var a=new jsts.geom.Coordinate;return a.x=this.centSum.x/this.totalLength,a.y=this.centSum.y/this.totalLength,a},jsts.algorithm.CentroidLine.prototype.add2=function(a){for(var b=0;b<a.length-1;b++){var c=a[b].distance(a[b+1]);this.totalLength+=c;var d=(a[b].x+a[b+1].x)/2;this.centSum.x+=c*d;var e=(a[b].y+a[b+1].y)/2;this.centSum.y+=c*e}},jsts.index.IntervalSize=function(){},jsts.index.IntervalSize.MIN_BINARY_EXPONENT=-50,jsts.index.IntervalSize.isZeroWidth=function(a,b){var c=b-a;if(0===c)return!0;var d,e,f;return d=Math.max(Math.abs(a),Math.abs(b)),e=c/d,f=jsts.index.DoubleBits.exponent(e),f<=jsts.index.IntervalSize.MIN_BINARY_EXPONENT},jsts.geomgraph.index.SimpleEdgeSetIntersector=function(){},jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector,jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.nOverlaps=0,jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersections=function(a,b,c){if(b instanceof javascript.util.List)return void this.computeIntersections2.apply(this,arguments);this.nOverlaps=0;for(var d=a.iterator();d.hasNext();)for(var e=d.next(),f=a.iterator();f.hasNext();){var g=f.next();(c||e!=g)&&this.computeIntersects(e,g,b)}},jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersections2=function(a,b,c){this.nOverlaps=0;for(var d=a.iterator();d.hasNext();)for(var e=d.next(),f=b.iterator();f.hasNext();){var g=f.next();this.computeIntersects(e,g,c)}},jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersects=function(a,b,c){var d,e,f=a.getCoordinates(),g=b.getCoordinates();for(d=0;d<f.length-1;d++)for(e=0;e<g.length-1;e++)c.addIntersections(a,d,b,e)},jsts.geomgraph.Edge=function(a,b){this.pts=a,this.label=b,this.eiList=new jsts.geomgraph.EdgeIntersectionList(this),this.depth=new jsts.geomgraph.Depth},jsts.geomgraph.Edge.prototype=new jsts.geomgraph.GraphComponent,jsts.geomgraph.Edge.constructor=jsts.geomgraph.Edge,jsts.geomgraph.Edge.updateIM=function(a,b){b.setAtLeastIfValid(a.getLocation(0,jsts.geomgraph.Position.ON),a.getLocation(1,jsts.geomgraph.Position.ON),1),a.isArea()&&(b.setAtLeastIfValid(a.getLocation(0,jsts.geomgraph.Position.LEFT),a.getLocation(1,jsts.geomgraph.Position.LEFT),2),b.setAtLeastIfValid(a.getLocation(0,jsts.geomgraph.Position.RIGHT),a.getLocation(1,jsts.geomgraph.Position.RIGHT),2))},jsts.geomgraph.Edge.prototype.pts=null,jsts.geomgraph.Edge.prototype.env=null,jsts.geomgraph.Edge.prototype.name=null,jsts.geomgraph.Edge.prototype.mce=null,jsts.geomgraph.Edge.prototype._isIsolated=!0,jsts.geomgraph.Edge.prototype.depth=null,jsts.geomgraph.Edge.prototype.depthDelta=0,jsts.geomgraph.Edge.prototype.eiList=null,jsts.geomgraph.Edge.prototype.getNumPoints=function(){return this.pts.length},jsts.geomgraph.Edge.prototype.getEnvelope=function(){if(null===this.env){this.env=new jsts.geom.Envelope;for(var a=0;a<this.pts.length;a++)this.env.expandToInclude(pts[a])}return env},jsts.geomgraph.Edge.prototype.getDepth=function(){return this.depth},jsts.geomgraph.Edge.prototype.getDepthDelta=function(){return this.depthDelta},jsts.geomgraph.Edge.prototype.setDepthDelta=function(a){this.depthDelta=a},jsts.geomgraph.Edge.prototype.getCoordinates=function(){return this.pts},jsts.geomgraph.Edge.prototype.getCoordinate=function(a){return void 0===a?this.pts.length>0?this.pts[0]:null:this.pts[a]},jsts.geomgraph.Edge.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.geomgraph.Edge.prototype.setIsolated=function(a){this._isIsolated=a},jsts.geomgraph.Edge.prototype.isIsolated=function(){return this._isIsolated},jsts.geomgraph.Edge.prototype.addIntersections=function(a,b,c){for(var d=0;d<a.getIntersectionNum();d++)this.addIntersection(a,b,c,d)},jsts.geomgraph.Edge.prototype.addIntersection=function(a,b,c,d){var e=new jsts.geom.Coordinate(a.getIntersection(d)),f=b,g=a.getEdgeDistance(c,d),h=f+1;if(h<this.pts.length){var i=this.pts[h];e.equals2D(i)&&(f=h,g=0)}this.eiList.add(e,f,g)},jsts.geomgraph.Edge.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},jsts.geomgraph.Edge.prototype.getEdgeIntersectionList=function(){return this.eiList},jsts.geomgraph.Edge.prototype.getMonotoneChainEdge=function(){return null==this.mce&&(this.mce=new jsts.geomgraph.index.MonotoneChainEdge(this)),this.mce},jsts.geomgraph.Edge.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.geomgraph.Edge.prototype.isCollapsed=function(){return this.label.isArea()?3!=this.pts.length?!1:this.pts[0].equals(this.pts[2])?!0:!1:!1},jsts.geomgraph.Edge.prototype.getCollapsedEdge=function(){var a=[];a[0]=this.pts[0],a[1]=this.pts[1];var b=new jsts.geomgraph.Edge(a,jsts.geomgraph.Label.toLineLabel(this.label));return b},jsts.geomgraph.Edge.prototype.computeIM=function(a){jsts.geomgraph.Edge.updateIM(this.label,a)},jsts.geomgraph.Edge.prototype.isPointwiseEqual=function(a){if(this.pts.length!=a.pts.length)return!1;for(var b=0;b<this.pts.length;b++)if(!this.pts[b].equals2D(a.pts[b]))return!1;return!0},jsts.noding.Octant=function(){throw jsts.error.AbstractMethodInvocationError()},jsts.noding.Octant.octant=function(a,b){if(a instanceof jsts.geom.Coordinate)return jsts.noding.Octant.octant2.apply(this,arguments);if(0===a&&0===b)throw new jsts.error.IllegalArgumentError("Cannot compute the octant for point ( "+a+", "+b+" )");var c=Math.abs(a),d=Math.abs(b);return a>=0?b>=0?c>=d?0:1:c>=d?7:6:b>=0?c>=d?3:2:c>=d?4:5},jsts.noding.Octant.octant2=function(a,b){var c=b.x-a.x,d=b.y-a.y;if(0===c&&0===d)throw new jsts.error.IllegalArgumentError("Cannot compute the octant for two identical points "+a);return jsts.noding.Octant.octant(c,d)},jsts.operation.union.UnionInteracting=function(a,b){this.g0=a,this.g1=b,this.geomFactory=a.getFactory(),this.interacts0=[],this.interacts1=[]},jsts.operation.union.UnionInteracting.union=function(a,b){var c=new jsts.operation.union.UnionInteracting(a,b);return c.union()},jsts.operation.union.UnionInteracting.prototype.geomFactory=null,jsts.operation.union.UnionInteracting.prototype.g0=null,jsts.operation.union.UnionInteracting.prototype.g1=null,jsts.operation.union.UnionInteracting.prototype.interacts0=null,jsts.operation.union.UnionInteracting.prototype.interacts1=null,jsts.operation.union.UnionInteracting.prototype.union=function(){this.computeInteracting();var a=this.extractElements(this.g0,this.interacts0,!0),b=this.extractElements(this.g1,this.interacts1,!0);a.isEmpty()||b.isEmpty();var c=in0.union(b),d=this.extractElements(this.g0,this.interacts0,!1),e=this.extractElements(this.g1,this.interacts1,!1),f=jsts.geom.util.GeometryCombiner.combine(c,d,e);return f},jsts.operation.union.UnionInteracting.prototype.bufferUnion=function(a,b){var c=a.getFactory(),d=c.createGeometryCollection([a,b]),e=d.buffer(0);return e},jsts.operation.union.UnionInteracting.prototype.computeInteracting=function(a){if(a){for(var b=!1,c=0,d=g1.getNumGeometries();d>c;c++){var e=this.g1.getGeometryN(c),f=e.getEnvelopeInternal().intersects(a.getEnvelopeInternal());f&&(this.interacts1[c]=!0,b=!0)}return b}for(var c=0,d=this.g0.getNumGeometries();d>c;c++){var g=this.g0.getGeometryN(c);this.interacts0[c]=this.computeInteracting(g)}},jsts.operation.union.UnionInteracting.prototype.extractElements=function(a,b,c){for(var d=[],e=0,f=a.getNumGeometries();f>e;e++){var g=a.getGeometryN(e);b[e]===c&&d.push(g)}return this.geomFactory.buildGeometry(d)},jsts.triangulate.quadedge.TrianglePredicate=function(){},jsts.triangulate.quadedge.TrianglePredicate.isInCircleNonRobust=function(a,b,c,d){var e=(a.x*a.x+a.y*a.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(b,c,d)-(b.x*b.x+b.y*b.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(a,c,d)+(c.x*c.x+c.y*c.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(a,b,d)-(d.x*d.x+d.y*d.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(a,b,c)>0;return e},jsts.triangulate.quadedge.TrianglePredicate.isInCircleNormalized=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q;return e=a.x-d.x,f=a.y-d.y,g=b.x-d.x,h=b.y-d.y,i=c.x-d.x,j=c.y-d.y,k=e*h-g*f,l=g*j-i*h,m=i*f-e*j,n=e*e+f*f,o=g*g+h*h,p=i*i+j*j,q=n*l+o*m+p*k,q>0},jsts.triangulate.quadedge.TrianglePredicate.triArea=function(a,b,c){return(b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x)},jsts.triangulate.quadedge.TrianglePredicate.isInCircleRobust=function(a,b,c,d){return jsts.triangulate.quadedge.TrianglePredicate.isInCircleNormalized(a,b,c,d)},jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDSlow=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;return e=jsts.math.DD.valueOf(d.x),f=jsts.math.DD.valueOf(d.y),g=jsts.math.DD.valueOf(a.x),h=jsts.math.DD.valueOf(a.y),i=jsts.math.DD.valueOf(b.x),j=jsts.math.DD.valueOf(b.y),k=jsts.math.DD.valueOf(c.x),l=jsts.math.DD.valueOf(c.y),m=g.multiply(g).add(h.multiply(h)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(i,j,k,l,e,f)),n=i.multiply(i).add(j.multiply(j)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(g,h,k,l,e,f)),o=k.multiply(k).add(l.multiply(l)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(g,h,i,j,e,f)),p=e.multiply(e).add(f.multiply(f)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(g,h,i,j,k,l)),q=m.subtract(n).add(o).subtract(p),r=q.doubleValue()>0},jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow=function(a,b,c,d,e,f){return c.subtract(a).multiply(f.subtract(b)).subtract(d.subtract(b).multiply(e.subtract(a)))},jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDFast=function(a,b,c,d){var e,f,g,h,i,j;return e=jsts.math.DD.sqr(a.x).selfAdd(jsts.math.DD.sqr(a.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(b,c,d)),f=jsts.math.DD.sqr(b.x).selfAdd(jsts.math.DD.sqr(b.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(a,c,d)),
  g=jsts.math.DD.sqr(c.x).selfAdd(jsts.math.DD.sqr(c.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(a,b,d)),h=jsts.math.DD.sqr(d.x).selfAdd(jsts.math.DD.sqr(d.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(a,b,c)),i=e.selfSubtract(f).selfAdd(g).selfSubtract(h),j=i.doubleValue()>0},jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast=function(a,b,c){var d,e;return d=jsts.math.DD.valueOf(b.x).selfSubtract(a.x).selfMultiply(jsts.math.DD.valueOf(c.y).selfSubtract(a.y)),e=jsts.math.DD.valueOf(b.y).selSubtract(a.y).selfMultiply(jsts.math.DD.valueOf(c.x).selfSubtract(a.x)),d.selfSubtract(e)},jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDNormalized=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;return e=jsts.math.DD.valueOf(a.x).selfSubtract(d.x),f=jsts.math.DD.valueOf(a.y).selfSubtract(d.y),g=jsts.math.DD.valueOf(b.x).selfSubtract(d.x),g=jsts.math.DD.valueOf(b.y).selfSubtract(d.y),i=jsts.math.DD.valueOf(c.x).selfSubtract(d.x),i=jsts.math.DD.valueOf(c.y).selfSubtract(d.y),k=e.multiply(h).selfSubtract(g.multiply(f)),l=g.multiply(j).selfSubtract(i.multiply(h)),m=i.multiply(f).selfSubtract(e.multiply(j)),n=e.multiply(e).selfAdd(f.multiply(f)),o=g.multiply(g).selfAdd(h.multiply(h)),p=i.multiply(i).selfAdd(j.multiply(j)),q=n.selfMultiply(l).selfAdd(o.selfMultiply(m)).selfAdd(p.selfMultiply(k)),r=q.doubleValue()>0},jsts.triangulate.quadedge.TrianglePredicate.isInCircleCC=function(a,b,c,d){var e,f,g;return e=jsts.geom.Triangle.circumcentre(a,b,c),f=a.distance(e),g=d.distance(e)-f,0>=g},jsts.operation.union.PointGeometryUnion=function(a,b){this.pointGeom=a,this.otherGeom=b,this.geomFact=b.getFactory()},jsts.operation.union.PointGeometryUnion.union=function(a,b){var c=new jsts.operation.union.PointGeometryUnion(a,b);return c.union()},jsts.operation.union.PointGeometryUnion.prototype.pointGeom=null,jsts.operation.union.PointGeometryUnion.prototype.otherGeom=null,jsts.operation.union.PointGeometryUnion.prototype.geomFact=null,jsts.operation.union.PointGeometryUnion.prototype.union=function(){for(var a=new jsts.algorithm.PointLocator,b=[],c=0,d=this.pointGeom.getNumGeometries();d>c;c++){var e=this.pointGeom.getGeometryN(c),f=e.getCoordinate(),g=a.locate(f,this.otherGeom);if(g===jsts.geom.Location.EXTERIOR){for(var h=!0,i=b.length;c--;)if(b[i].equals(f)){h=!1;break}h&&b.push(f)}}if(b.sort(function(a,b){return a.compareTo(b)}),0===b.length)return this.otherGeom;var j=null,k=jsts.geom.CoordinateArrays.toCoordinateArray(b);return j=1===k.length?this.geomFact.createPoint(k[0]):this.geomFact.createMultiPoint(k),jsts.geom.util.GeometryCombiner.combine(j,this.otherGeom)},jsts.noding.IntersectionFinderAdder=function(a){this.li=a,this.interiorIntersections=new javascript.util.ArrayList},jsts.noding.IntersectionFinderAdder.prototype=new jsts.noding.SegmentIntersector,jsts.noding.IntersectionFinderAdder.constructor=jsts.noding.IntersectionFinderAdder,jsts.noding.IntersectionFinderAdder.prototype.li=null,jsts.noding.IntersectionFinderAdder.prototype.interiorIntersections=null,jsts.noding.IntersectionFinderAdder.prototype.getInteriorIntersections=function(){return this.interiorIntersections},jsts.noding.IntersectionFinderAdder.prototype.processIntersections=function(a,b,c,d){if(a!==c||b!==d){var e=a.getCoordinates()[b],f=a.getCoordinates()[b+1],g=c.getCoordinates()[d],h=c.getCoordinates()[d+1];if(this.li.computeIntersection(e,f,g,h),this.li.hasIntersection()&&this.li.isInteriorIntersection()){for(var i=0;i<this.li.getIntersectionNum();i++)this.interiorIntersections.add(this.li.getIntersection(i));a.addIntersections(this.li,b,0),c.addIntersections(this.li,d,1)}}},jsts.noding.IntersectionFinderAdder.prototype.isDone=function(){return!1},jsts.noding.snapround.MCIndexSnapRounder=function(a){this.pm=a,this.li=new jsts.algorithm.RobustLineIntersector,this.li.setPrecisionModel(a),this.scaleFactor=a.getScale()},jsts.noding.snapround.MCIndexSnapRounder.prototype=new jsts.noding.Noder,jsts.noding.snapround.MCIndexSnapRounder.constructor=jsts.noding.snapround.MCIndexSnapRounder,jsts.noding.snapround.MCIndexSnapRounder.prototype.pm=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.li=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.scaleFactor=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.noder=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.pointSnapper=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.nodedSegStrings=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.getNodedSubstrings=function(){return jsts.noding.NodedSegmentString.getNodedSubstrings(this.nodedSegStrings)},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeNodes=function(a){this.nodedSegStrings=a,this.noder=new jsts.noding.MCIndexNoder,this.pointSnapper=new jsts.noding.snapround.MCIndexPointSnapper(this.noder.getIndex()),this.snapRound(a,this.li)},jsts.noding.snapround.MCIndexSnapRounder.prototype.snapRound=function(a,b){var c=this.findInteriorIntersections(a,b);this.computeIntersectionSnaps(c),this.computeVertexSnaps(a)},jsts.noding.snapround.MCIndexSnapRounder.prototype.findInteriorIntersections=function(a,b){var c=new jsts.noding.IntersectionFinderAdder(b);return this.noder.setSegmentIntersector(c),this.noder.computeNodes(a),c.getInteriorIntersections()},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeIntersectionSnaps=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next(),d=new jsts.noding.snapround.HotPixel(c,this.scaleFactor,this.li);this.pointSnapper.snap(d)}},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeVertexSnaps=function(a){if(a instanceof jsts.noding.NodedSegmentString)return void this.computeVertexSnaps2.apply(this,arguments);for(var b=a.iterator();b.hasNext();){var c=b.next();this.computeVertexSnaps(c)}},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeVertexSnaps2=function(a){for(var b=a.getCoordinates(),c=0;c<b.length-1;c++){var d=new jsts.noding.snapround.HotPixel(b[c],this.scaleFactor,this.li),e=this.pointSnapper.snap(d,a,c);e&&a.addIntersection(b[c],c)}},jsts.operation.valid.ConnectedInteriorTester=function(a){this.geomGraph=a,this.geometryFactory=new jsts.geom.GeometryFactory,this.disconnectedRingcoord=null},jsts.operation.valid.ConnectedInteriorTester.findDifferentPoint=function(a,b){var c=0,d=a.length;for(c;d>c;c++)if(!a[c].equals(b))return a[c];return null},jsts.operation.valid.ConnectedInteriorTester.prototype.getCoordinate=function(){return this.disconnectedRingcoord},jsts.operation.valid.ConnectedInteriorTester.prototype.isInteriorsConnected=function(){var a=new javascript.util.ArrayList;this.geomGraph.computeSplitEdges(a);var b=new jsts.geomgraph.PlanarGraph(new jsts.operation.overlay.OverlayNodeFactory);b.addEdges(a),this.setInteriorEdgesInResult(b),b.linkResultDirectedEdges();var c=this.buildEdgeRings(b.getEdgeEnds());return this.visitShellInteriors(this.geomGraph.getGeometry(),b),!this.hasUnvisitedShellEdge(c)},jsts.operation.valid.ConnectedInteriorTester.prototype.setInteriorEdgesInResult=function(a){for(var b,c=a.getEdgeEnds().iterator();c.hasNext();)b=c.next(),b.getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR&&b.setInResult(!0)},jsts.operation.valid.ConnectedInteriorTester.prototype.buildEdgeRings=function(a){for(var b=new javascript.util.ArrayList,c=a.iterator();c.hasNext();){var d=c.next();if(d.isInResult()&&null==d.getEdgeRing()){var e=new jsts.operation.overlay.MaximalEdgeRing(d,this.geometryFactory);e.linkDirectedEdgesForMinimalEdgeRings();var f=e.buildMinimalRings(),g=0,h=f.length;for(g;h>g;g++)b.add(f[g])}}return b},jsts.operation.valid.ConnectedInteriorTester.prototype.visitShellInteriors=function(a,b){if(a instanceof jsts.geom.Polygon){var c=a;this.visitInteriorRing(c.getExteriorRing(),b)}if(a instanceof jsts.geom.MultiPolygon)for(var d=a,e=0;e<d.getNumGeometries();e++){var c=d.getGeometryN(e);this.visitInteriorRing(c.getExteriorRing(),b)}},jsts.operation.valid.ConnectedInteriorTester.prototype.visitInteriorRing=function(a,b){var c=a.getCoordinates(),d=c[0],e=jsts.operation.valid.ConnectedInteriorTester.findDifferentPoint(c,d),f=b.findEdgeInSameDirection(d,e),g=b.findEdgeEnd(f),h=null;g.getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR?h=g:g.getSym().getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR&&(h=g.getSym()),this.visitLinkedDirectedEdges(h)},jsts.operation.valid.ConnectedInteriorTester.prototype.visitLinkedDirectedEdges=function(a){var b=a,c=a;do c.setVisited(!0),c=c.getNext();while(c!=b)},jsts.operation.valid.ConnectedInteriorTester.prototype.hasUnvisitedShellEdge=function(a){for(var b=0;b<a.size();b++){var c=a.get(b);if(!c.isHole()){var d=c.getEdges(),e=d[0];if(e.getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR)for(var f=0;f<d.length;f++)if(e=d[f],!e.isVisited())return disconnectedRingcoord=e.getCoordinate(),!0}}return!1},jsts.algorithm.InteriorPointLine=function(a){this.centroid,this.minDistance=Number.MAX_VALUE,this.interiorPoint=null,this.centroid=a.getCentroid().getCoordinate(),this.addInterior(a),null==this.interiorPoint&&this.addEndpoints(a)},jsts.algorithm.InteriorPointLine.prototype.getInteriorPoint=function(){return this.interiorPoint},jsts.algorithm.InteriorPointLine.prototype.addInterior=function(a){if(a instanceof jsts.geom.LineString)this.addInteriorCoord(a.getCoordinates());else if(a instanceof jsts.geom.GeometryCollection)for(var b=0;b<a.getNumGeometries();b++)this.addInterior(a.getGeometryN(b))},jsts.algorithm.InteriorPointLine.prototype.addInteriorCoord=function(a){for(var b=1;b<a.length-1;b++)this.add(a[b])},jsts.algorithm.InteriorPointLine.prototype.addEndpoints=function(a){if(a instanceof jsts.geom.LineString)this.addEndpointsCoord(a.getCoordinates());else if(a instanceof jsts.geom.GeometryCollection)for(var b=0;b<a.getNumGeometries();b++)this.addEndpoints(a.getGeometryN(b))},jsts.algorithm.InteriorPointLine.prototype.addEndpointsCoord=function(a){this.add(a[0]),this.add(a[a.length-1])},jsts.algorithm.InteriorPointLine.prototype.add=function(a){var b=a.distance(this.centroid);b<this.minDistance&&(this.interiorPoint=new jsts.geom.Coordinate(a),this.minDistance=b)},jsts.index.chain.MonotoneChainSelectAction=function(){this.tempEnv1=new jsts.geom.Envelope,this.selectedSegment=new jsts.geom.LineSegment},jsts.index.chain.MonotoneChainSelectAction.prototype.tempEnv1=null,jsts.index.chain.MonotoneChainSelectAction.prototype.selectedSegment=null,jsts.index.chain.MonotoneChainSelectAction.prototype.select=function(a,b){a.getLineSegment(b,this.selectedSegment),this.select2(this.selectedSegment)},jsts.index.chain.MonotoneChainSelectAction.prototype.select2=function(a){},jsts.algorithm.MCPointInRing=function(a){this.ring=a,this.tree=null,this.crossings=0,this.interval=new jsts.index.bintree.Interval,this.buildIndex()},jsts.algorithm.MCPointInRing.MCSelecter=function(a,b){this.parent=b,this.p=a},jsts.algorithm.MCPointInRing.MCSelecter.prototype=new jsts.index.chain.MonotoneChainSelectAction,jsts.algorithm.MCPointInRing.MCSelecter.prototype.constructor=jsts.algorithm.MCPointInRing.MCSelecter,jsts.algorithm.MCPointInRing.MCSelecter.prototype.select2=function(a){this.parent.testLineSegment.apply(this.parent,[this.p,a])},jsts.algorithm.MCPointInRing.prototype.buildIndex=function(){this.tree=new jsts.index.bintree.Bintree;for(var a=jsts.geom.CoordinateArrays.removeRepeatedPoints(this.ring.getCoordinates()),b=jsts.index.chain.MonotoneChainBuilder.getChains(a),c=0;c<b.length;c++){var d=b[c],e=d.getEnvelope();this.interval.min=e.getMinY(),this.interval.max=e.getMaxY(),this.tree.insert(this.interval,d)}},jsts.algorithm.MCPointInRing.prototype.isInside=function(a){this.crossings=0;var b=new jsts.geom.Envelope(-Number.MAX_VALUE,Number.MAX_VALUE,a.y,a.y);this.interval.min=a.y,this.interval.max=a.y;for(var c=this.tree.query(this.interval),d=new jsts.algorithm.MCPointInRing.MCSelecter(a,this),e=c.iterator();e.hasNext();){var f=e.next();this.testMonotoneChain(b,d,f)}return this.crossings%2==1?!0:!1},jsts.algorithm.MCPointInRing.prototype.testMonotoneChain=function(a,b,c){c.select(a,b)},jsts.algorithm.MCPointInRing.prototype.testLineSegment=function(a,b){var c,d,e,f,g,h,i;h=b.p0,i=b.p1,d=h.x-a.x,e=h.y-a.y,f=i.x-a.x,g=i.y-a.y,(e>0&&0>=g||g>0&&0>=e)&&(c=jsts.algorithm.RobustDeterminant.signOfDet2x2(d,e,f,g)/(g-e),c>0&&this.crossings++)},jsts.operation.valid.TopologyValidationError=function(a,b){this.errorType=a,this.pt=null,null!=b&&(this.pt=b.clone())},jsts.operation.valid.TopologyValidationError.HOLE_OUTSIDE_SHELL=2,jsts.operation.valid.TopologyValidationError.NESTED_HOLES=3,jsts.operation.valid.TopologyValidationError.DISCONNECTED_INTERIOR=4,jsts.operation.valid.TopologyValidationError.SELF_INTERSECTION=5,jsts.operation.valid.TopologyValidationError.RING_SELF_INTERSECTION=6,jsts.operation.valid.TopologyValidationError.NESTED_SHELLS=7,jsts.operation.valid.TopologyValidationError.DUPLICATE_RINGS=8,jsts.operation.valid.TopologyValidationError.TOO_FEW_POINTS=9,jsts.operation.valid.TopologyValidationError.INVALID_COORDINATE=10,jsts.operation.valid.TopologyValidationError.RING_NOT_CLOSED=11,jsts.operation.valid.TopologyValidationError.prototype.errMsg=["Topology Validation Error","Repeated Point","Hole lies outside shell","Holes are nested","Interior is disconnected","Self-intersection","Ring Self-intersection","Nested shells","Duplicate Rings","Too few distinct points in geometry component","Invalid Coordinate","Ring is not closed"],jsts.operation.valid.TopologyValidationError.prototype.getCoordinate=function(){return this.pt},jsts.operation.valid.TopologyValidationError.prototype.getErrorType=function(){return this.errorType},jsts.operation.valid.TopologyValidationError.prototype.getMessage=function(){return this.errMsg[this.errorType]},jsts.operation.valid.TopologyValidationError.prototype.toString=function(){var a="";return null!=this.pt?(a=" at or near point "+this.pt,this.getMessage()+a):a},function(){jsts.geom.MultiPolygon=function(a,b){this.geometries=a||[],this.factory=b},jsts.geom.MultiPolygon.prototype=new jsts.geom.GeometryCollection,jsts.geom.MultiPolygon.constructor=jsts.geom.MultiPolygon,jsts.geom.MultiPolygon.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString(null);for(var a=[],b=0;b<this.geometries.length;b++)for(var c=this.geometries[b],d=c.getBoundary(),e=0;e<d.getNumGeometries();e++)a.push(d.getGeometryN(e));return this.getFactory().createMultiLineString(a)},jsts.geom.MultiPolygon.prototype.equalsExact=function(a,b){return this.isEquivalentClass(a)?jsts.geom.GeometryCollection.prototype.equalsExact.call(this,a,b):!1},jsts.geom.MultiPolygon.prototype.CLASS_NAME="jsts.geom.MultiPolygon"}(),jsts.geom.CoordinateSequenceFilter=function(){},jsts.geom.CoordinateSequenceFilter.prototype.filter=jsts.abstractFunc,jsts.geom.CoordinateSequenceFilter.prototype.isDone=jsts.abstractFunc,jsts.geom.CoordinateSequenceFilter.prototype.isGeometryChanged=jsts.abstractFunc,function(){var a=function(){if(this.min=0,this.max=0,1===arguments.length){var a=arguments[0];this.init(a.min,a.max)}else 2===arguments.length&&this.init(arguments[0],arguments[1])};a.prototype.init=function(a,b){this.min=a,this.max=b,a>b&&(this.min=b,this.max=a)},a.prototype.getMin=function(){return this.min},a.prototype.getMax=function(){return this.max},a.prototype.getWidth=function(){return this.max-this.min},a.prototype.expandToInclude=function(a){a.max>this.max&&(this.max=a.max),a.min<this.min&&(this.min=a.min)},a.prototype.overlaps=function(){return 1===arguments.length?this.overlapsInterval.apply(this,arguments):this.overlapsMinMax.apply(this,arguments)},a.prototype.overlapsInterval=function(a){return this.overlaps(a.min,a.max)},a.prototype.overlapsMinMax=function(a,b){return this.min>b||this.max<a?!1:!0},a.prototype.contains=function(){var a;return arguments[0]instanceof jsts.index.bintree.Interval?(a=arguments[0],this.containsMinMax(a.min,a.max)):1===arguments.length?this.containsPoint(arguments[0]):this.containsMinMax(arguments[0],arguments[1])},a.prototype.containsMinMax=function(a,b){return a>=this.min&&b<=this.max},a.prototype.containsPoint=function(a){return a>=this.min&&a<=this.max},jsts.index.bintree.Interval=a}(),jsts.index.DoubleBits=function(){},jsts.index.DoubleBits.powerOf2=function(a){return Math.pow(2,a)},jsts.index.DoubleBits.exponent=function(a){return jsts.index.DoubleBits.CVTFWD(64,a)-1023},jsts.index.DoubleBits.CVTFWD=function(a,b){var c,d,e,f,g="",h={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}},i={32:8,64:11}[a];if(f||(c=0>b||0>1/b,isFinite(b)||(f=h[a],c&&(f.d+=1<<a/4-1),d=Math.pow(2,i)-1,e=0)),!f){for(d={32:127,64:1023}[a],e=Math.abs(b);e>=2;)d++,e/=2;for(;1>e&&d>0;)d--,e*=2;0>=d&&(e/=2,g="Zero or Denormal"),32===a&&d>254&&(g="Too big for Single",f={d:c?255:127,c:128,b:0,a:0},d=Math.pow(2,i)-1,e=0)}return d},function(){var a=jsts.index.DoubleBits,b=jsts.index.bintree.Interval,c=function(a){this.pt=0,this.level=0,this.computeKey(a)};c.computeLevel=function(b){var c,d=b.getWidth();return c=a.exponent(d)+1},c.prototype.getPoint=function(){return this.pt},c.prototype.getLevel=function(){return this.level},c.prototype.getInterval=function(){return this.interval},c.prototype.computeKey=function(a){for(this.level=c.computeLevel(a),this.interval=new b,this.computeInterval(this.level,a);!this.interval.contains(a);)this.level+=1,this.computeInterval(this.level,a)},c.prototype.computeInterval=function(b,c){var d=a.powerOf2(b);this.pt=Math.floor(c.getMin()/d)*d,this.interval.init(this.pt,this.pt+d)},jsts.index.bintree.Key=c}(),jsts.operation.buffer.SubgraphDepthLocater=function(a){this.subgraphs=[],this.seg=new jsts.geom.LineSegment,this.subgraphs=a},jsts.operation.buffer.SubgraphDepthLocater.prototype.subgraphs=null,jsts.operation.buffer.SubgraphDepthLocater.prototype.seg=null,jsts.operation.buffer.SubgraphDepthLocater.prototype.getDepth=function(a){var b=this.findStabbedSegments(a);if(0===b.length)return 0;b.sort();var c=b[0];return c.leftDepth},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments=function(a){if(3===arguments.length)return void this.findStabbedSegments2.apply(this,arguments);for(var b=[],c=0;c<this.subgraphs.length;c++){var d=this.subgraphs[c],e=d.getEnvelope();a.y<e.getMinY()||a.y>e.getMaxY()||this.findStabbedSegments2(a,d.getDirectedEdges(),b)}return b},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments2=function(a,b,c){if(arguments[1]instanceof jsts.geomgraph.DirectedEdge)return void this.findStabbedSegments3(a,b,c);for(var d=b.iterator();d.hasNext();){var e=d.next();e.isForward()&&this.findStabbedSegments3(a,e,c)}},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments3=function(a,b,c){for(var d=b.getEdge().getCoordinates(),e=0;e<d.length-1;e++){this.seg.p0=d[e],this.seg.p1=d[e+1],this.seg.p0.y>this.seg.p1.y&&this.seg.reverse();var f=Math.max(this.seg.p0.x,this.seg.p1.x);if(!(f<a.x||this.seg.isHorizontal()||a.y<this.seg.p0.y||a.y>this.seg.p1.y||jsts.algorithm.CGAlgorithms.computeOrientation(this.seg.p0,this.seg.p1,a)===jsts.algorithm.CGAlgorithms.RIGHT)){var g=b.getDepth(jsts.geomgraph.Position.LEFT);this.seg.p0.equals(d[e])||(g=b.getDepth(jsts.geomgraph.Position.RIGHT));var h=new jsts.operation.buffer.SubgraphDepthLocater.DepthSegment(this.seg,g);c.push(h)}}},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment=function(a,b){this.upwardSeg=new jsts.geom.LineSegment(a),this.leftDepth=b},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.upwardSeg=null,jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.leftDepth=null,jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.compareTo=function(a){var b=a,c=this.upwardSeg.orientationIndex(b.upwardSeg);return 0===c&&(c=-1*b.upwardSeg.orientationIndex(upwardSeg)),0!==c?c:this.compareX(this.upwardSeg,b.upwardSeg)},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.compareX=function(a,b){var c=a.p0.compareTo(b.p0);return 0!==c?c:a.p1.compareTo(b.p1)},jsts.noding.snapround.HotPixel=function(a,b,c){this.corner=[],this.originalPt=a,this.pt=a,this.scaleFactor=b,this.li=c,1!==this.scaleFactor&&(this.pt=new jsts.geom.Coordinate(this.scale(a.x),this.scale(a.y)),this.p0Scaled=new jsts.geom.Coordinate,this.p1Scaled=new jsts.geom.Coordinate),this.initCorners(this.pt)},jsts.noding.snapround.HotPixel.prototype.li=null,jsts.noding.snapround.HotPixel.prototype.pt=null,jsts.noding.snapround.HotPixel.prototype.originalPt=null,jsts.noding.snapround.HotPixel.prototype.ptScaled=null,jsts.noding.snapround.HotPixel.prototype.p0Scaled=null,jsts.noding.snapround.HotPixel.prototype.p1Scaled=null,jsts.noding.snapround.HotPixel.prototype.scaleFactor=void 0,jsts.noding.snapround.HotPixel.prototype.minx=void 0,jsts.noding.snapround.HotPixel.prototype.maxx=void 0,jsts.noding.snapround.HotPixel.prototype.miny=void 0,jsts.noding.snapround.HotPixel.prototype.maxy=void 0,jsts.noding.snapround.HotPixel.prototype.corner=null,jsts.noding.snapround.HotPixel.prototype.safeEnv=null,jsts.noding.snapround.HotPixel.prototype.getCoordinate=function(){return this.originalPt},jsts.noding.snapround.HotPixel.SAFE_ENV_EXPANSION_FACTOR=.75,jsts.noding.snapround.HotPixel.prototype.getSafeEnvelope=function(){if(null===this.safeEnv){var a=jsts.noding.snapround.HotPixel.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new jsts.geom.Envelope(this.originalPt.x-a,this.originalPt.x+a,this.originalPt.y-a,this.originalPt.y+a)}return this.safeEnv},jsts.noding.snapround.HotPixel.prototype.initCorners=function(a){var b=.5;this.minx=a.x-b,this.maxx=a.x+b,this.miny=a.y-b,this.maxy=a.y+b,this.corner[0]=new jsts.geom.Coordinate(this.maxx,this.maxy),this.corner[1]=new jsts.geom.Coordinate(this.minx,this.maxy),this.corner[2]=new jsts.geom.Coordinate(this.minx,this.miny),this.corner[3]=new jsts.geom.Coordinate(this.maxx,this.miny)},jsts.noding.snapround.HotPixel.prototype.scale=function(a){return Math.round(a*this.scaleFactor)},jsts.noding.snapround.HotPixel.prototype.intersects=function(a,b){return 1===this.scaleFactor?this.intersectsScaled(a,b):(this.copyScaled(a,this.p0Scaled),this.copyScaled(b,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},jsts.noding.snapround.HotPixel.prototype.copyScaled=function(a,b){b.x=this.scale(a.x),b.y=this.scale(a.y)},jsts.noding.snapround.HotPixel.prototype.intersectsScaled=function(a,b){var c=Math.min(a.x,b.x),d=Math.max(a.x,b.x),e=Math.min(a.y,b.y),f=Math.max(a.y,b.y),g=this.maxx<c||this.minx>d||this.maxy<e||this.miny>f;if(g)return!1;var h=this.intersectsToleranceSquare(a,b);return jsts.util.Assert.isTrue(!(g&&h),"Found bad envelope test"),h},jsts.noding.snapround.HotPixel.prototype.intersectsToleranceSquare=function(a,b){var c=!1,d=!1;return this.li.computeIntersection(a,b,this.corner[0],this.corner[1]),this.li.isProper()?!0:(this.li.computeIntersection(a,b,this.corner[1],this.corner[2]),this.li.isProper()?!0:(this.li.hasIntersection()&&(c=!0),this.li.computeIntersection(a,b,this.corner[2],this.corner[3]),this.li.isProper()?!0:(this.li.hasIntersection()&&(d=!0),this.li.computeIntersection(a,b,this.corner[3],this.corner[0]),this.li.isProper()?!0:c&&d?!0:a.equals(this.pt)?!0:b.equals(this.pt)?!0:!1)))},jsts.noding.snapround.HotPixel.prototype.intersectsPixelClosure=function(a,b){return this.li.computeIntersection(a,b,this.corner[0],this.corner[1]),this.li.hasIntersection()?!0:(this.li.computeIntersection(a,b,this.corner[1],this.corner[2]),this.li.hasIntersection()?!0:(this.li.computeIntersection(a,b,this.corner[2],this.corner[3]),this.li.hasIntersection()?!0:(this.li.computeIntersection(a,b,this.corner[3],this.corner[0]),this.li.hasIntersection()?!0:!1)))},jsts.noding.snapround.HotPixel.prototype.addSnappedNode=function(a,b){var c=a.getCoordinate(b),d=a.getCoordinate(b+1);return this.intersects(c,d)?(a.addIntersection(this.getCoordinate(),b),!0):!1},jsts.operation.buffer.BufferInputLineSimplifier=function(a){this.inputLine=a},jsts.operation.buffer.BufferInputLineSimplifier.simplify=function(a,b){var c=new jsts.operation.buffer.BufferInputLineSimplifier(a);return c.simplify(b)},jsts.operation.buffer.BufferInputLineSimplifier.INIT=0,jsts.operation.buffer.BufferInputLineSimplifier.DELETE=1,jsts.operation.buffer.BufferInputLineSimplifier.KEEP=1,jsts.operation.buffer.BufferInputLineSimplifier.prototype.inputLine=null,jsts.operation.buffer.BufferInputLineSimplifier.prototype.distanceTol=null,jsts.operation.buffer.BufferInputLineSimplifier.prototype.isDeleted=null,jsts.operation.buffer.BufferInputLineSimplifier.prototype.angleOrientation=jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE,jsts.operation.buffer.BufferInputLineSimplifier.prototype.simplify=function(a){this.distanceTol=Math.abs(a),0>a&&(this.angleOrientation=jsts.algorithm.CGAlgorithms.CLOCKWISE),this.isDeleted=[],this.isDeleted.length=this.inputLine.length;var b=!1;do b=this.deleteShallowConcavities();while(b);return this.collapseLine()},jsts.operation.buffer.BufferInputLineSimplifier.prototype.deleteShallowConcavities=function(){for(var a=1,b=(this.inputLine.length-1,this.findNextNonDeletedIndex(a)),c=this.findNextNonDeletedIndex(b),d=!1;c<this.inputLine.length;){var e=!1;this.isDeletable(a,b,c,this.distanceTol)&&(this.isDeleted[b]=jsts.operation.buffer.BufferInputLineSimplifier.DELETE,e=!0,d=!0),a=e?c:b,b=this.findNextNonDeletedIndex(a),c=this.findNextNonDeletedIndex(b)}return d},jsts.operation.buffer.BufferInputLineSimplifier.prototype.findNextNonDeletedIndex=function(a){for(var b=a+1;b<this.inputLine.length&&this.isDeleted[b]===jsts.operation.buffer.BufferInputLineSimplifier.DELETE;)b++;return b},jsts.operation.buffer.BufferInputLineSimplifier.prototype.collapseLine=function(){for(var a=[],b=0;b<this.inputLine.length;b++)this.isDeleted[b]!==jsts.operation.buffer.BufferInputLineSimplifier.DELETE&&a.push(this.inputLine[b]);return a},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isDeletable=function(a,b,c,d){var e=this.inputLine[a],f=this.inputLine[b],g=this.inputLine[c];return this.isConcave(e,f,g)&&this.isShallow(e,f,g,d)?this.isShallowSampled(e,f,a,c,d):!1},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isShallowConcavity=function(a,b,c,d){var e=jsts.algorithm.CGAlgorithms.computeOrientation(a,b,c),f=e===this.angleOrientation;if(!f)return!1;var g=jsts.algorithm.CGAlgorithms.distancePointLine(b,a,c);return d>g},jsts.operation.buffer.BufferInputLineSimplifier.NUM_PTS_TO_CHECK=10,jsts.operation.buffer.BufferInputLineSimplifier.prototype.isShallowSampled=function(a,b,c,d,e){var f=parseInt((d-c)/jsts.operation.buffer.BufferInputLineSimplifier.NUM_PTS_TO_CHECK);0>=f&&(f=1);for(var g=c;d>g;g+=f)if(!this.isShallow(a,b,this.inputLine[g],e))return!1;return!0},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isShallow=function(a,b,c,d){var e=jsts.algorithm.CGAlgorithms.distancePointLine(b,a,c);return d>e},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isConcave=function(a,b,c){var d=jsts.algorithm.CGAlgorithms.computeOrientation(a,b,c),e=d===this.angleOrientation;return e},jsts.geomgraph.index.SweepLineEvent=function(a,b,c){return b instanceof jsts.geomgraph.index.SweepLineEvent?(this.eventType=jsts.geomgraph.index.SweepLineEvent.DELETE,this.xValue=a,void(this.insertEvent=b)):(this.eventType=jsts.geomgraph.index.SweepLineEvent.INSERT,this.label=c,this.xValue=a,void(this.obj=b))},jsts.geomgraph.index.SweepLineEvent.INSERT=1,jsts.geomgraph.index.SweepLineEvent.DELETE=2,jsts.geomgraph.index.SweepLineEvent.prototype.label=null,jsts.geomgraph.index.SweepLineEvent.prototype.xValue=null,jsts.geomgraph.index.SweepLineEvent.prototype.eventType=null,jsts.geomgraph.index.SweepLineEvent.prototype.insertEvent=null,jsts.geomgraph.index.SweepLineEvent.prototype.deleteEventIndex=null,jsts.geomgraph.index.SweepLineEvent.prototype.obj=null,jsts.geomgraph.index.SweepLineEvent.prototype.isInsert=function(){return this.eventType==jsts.geomgraph.index.SweepLineEvent.INSERT},jsts.geomgraph.index.SweepLineEvent.prototype.isDelete=function(){return this.eventType==jsts.geomgraph.index.SweepLineEvent.DELETE},jsts.geomgraph.index.SweepLineEvent.prototype.getInsertEvent=function(){return this.insertEvent},jsts.geomgraph.index.SweepLineEvent.prototype.getDeleteEventIndex=function(){return this.deleteEventIndex},jsts.geomgraph.index.SweepLineEvent.prototype.setDeleteEventIndex=function(a){this.deleteEventIndex=a},jsts.geomgraph.index.SweepLineEvent.prototype.getObject=function(){return this.obj},jsts.geomgraph.index.SweepLineEvent.prototype.isSameLabel=function(a){return null==this.label?!1:this.label==a.label},jsts.geomgraph.index.SweepLineEvent.prototype.compareTo=function(a){return this.xValue<a.xValue?-1:this.xValue>a.xValue?1:this.eventType<a.eventType?-1:this.eventType>a.eventType?1:0},jsts.geom.CoordinateList=function(a,b){this.array=[],b=void 0===b?!0:b,void 0!==a&&this.add(a,b)},jsts.geom.CoordinateList.prototype=new javascript.util.ArrayList,jsts.geom.CoordinateList.prototype.iterator=null,jsts.geom.CoordinateList.prototype.remove=null,jsts.geom.CoordinateList.prototype.get=function(a){return this.array[a]},jsts.geom.CoordinateList.prototype.set=function(a,b){var c=this.array[a];return this.array[a]=b,c},jsts.geom.CoordinateList.prototype.size=function(){return this.array.length},jsts.geom.CoordinateList.prototype.add=function(){return arguments.length>1?this.addCoordinates.apply(this,arguments):this.array.push(arguments[0])},jsts.geom.CoordinateList.prototype.addCoordinates=function(a,b,c){if(a instanceof jsts.geom.Coordinate)return this.addCoordinate.apply(this,arguments);if("number"==typeof a)return this.insertCoordinate.apply(this,arguments);if(c=c||!0)for(var d=0;d<a.length;d++)this.addCoordinate(a[d],b);else for(var d=a.length-1;d>=0;d--)this.addCoordinate(a[d],b);return!0},jsts.geom.CoordinateList.prototype.addCoordinate=function(a,b){if(!b&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(a))return}this.add(a)},jsts.geom.CoordinateList.prototype.insertCoordinate=function(a,b,c){if(!c){var d=a>0?a-1:-1;if(-1!==d&&this.get(d).equals2D(b))return;var e=a<this.size()-1?a+1:-1;if(-1!==e&&this.get(e).equals2D(b))return}this.array.splice(a,0,b)},jsts.geom.CoordinateList.prototype.closeRing=function(){this.size()>0&&this.addCoordinate(new jsts.geom.Coordinate(this.get(0)),!1)},jsts.geom.CoordinateList.prototype.toArray=function(){return this.array},jsts.geom.CoordinateList.prototype.toCoordinateArray=function(){return this.array},jsts.operation.buffer.OffsetSegmentGenerator=function(a,b,c){this.seg0=new jsts.geom.LineSegment,this.seg1=new jsts.geom.LineSegment,this.offset0=new jsts.geom.LineSegment,this.offset1=new jsts.geom.LineSegment,this.precisionModel=a,this.bufParams=b,this.li=new jsts.algorithm.RobustLineIntersector,this.filletAngleQuantum=Math.PI/2/b.getQuadrantSegments(),this.bufParams.getQuadrantSegments()>=8&&this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_ROUND&&(this.closingSegLengthFactor=jsts.operation.buffer.OffsetSegmentGenerator.MAX_CLOSING_SEG_LEN_FACTOR),this.init(c)},jsts.operation.buffer.OffsetSegmentGenerator.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,jsts.operation.buffer.OffsetSegmentGenerator.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,jsts.operation.buffer.OffsetSegmentGenerator.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,jsts.operation.buffer.OffsetSegmentGenerator.MAX_CLOSING_SEG_LEN_FACTOR=80,jsts.operation.buffer.OffsetSegmentGenerator.prototype.maxCurveSegmentError=0,jsts.operation.buffer.OffsetSegmentGenerator.prototype.filletAngleQuantum=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.closingSegLengthFactor=1,jsts.operation.buffer.OffsetSegmentGenerator.prototype.segList=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.distance=0,jsts.operation.buffer.OffsetSegmentGenerator.prototype.precisionModel=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.bufParams=null,
  jsts.operation.buffer.OffsetSegmentGenerator.prototype.li=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.s0=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.s1=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.s2=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.seg0=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.seg1=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.offset0=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.offset1=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.side=0,jsts.operation.buffer.OffsetSegmentGenerator.prototype.hasNarrowConcaveAngle=!1,jsts.operation.buffer.OffsetSegmentGenerator.prototype.hasNarrowConcaveAngle=function(){return this.hasNarrowConcaveAngle},jsts.operation.buffer.OffsetSegmentGenerator.prototype.init=function(a){this.distance=a,this.maxCurveSegmentError=this.distance*(1-Math.cos(this.filletAngleQuantum/2)),this.segList=new jsts.operation.buffer.OffsetSegmentString,this.segList.setPrecisionModel(this.precisionModel),this.segList.setMinimumVertexDistance(this.distance*jsts.operation.buffer.OffsetSegmentGenerator.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.initSideSegments=function(a,b,c){this.s1=a,this.s2=b,this.side=c,this.seg1.setCoordinates(this.s1,this.s2),this.computeOffsetSegment(this.seg1,this.side,this.distance,this.offset1)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.getCoordinates=function(){return this.segList.getCoordinates()},jsts.operation.buffer.OffsetSegmentGenerator.prototype.closeRing=function(){this.segList.closeRing()},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addSegments=function(a,b){this.segList.addPts(a,b)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addFirstSegment=function(){this.segList.addPt(this.offset1.p0)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addLastSegment=function(){this.segList.addPt(this.offset1.p1)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addNextSegment=function(a,b){if(this.s0=this.s1,this.s1=this.s2,this.s2=a,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)){var c=jsts.algorithm.CGAlgorithms.computeOrientation(this.s0,this.s1,this.s2),d=c===jsts.algorithm.CGAlgorithms.CLOCKWISE&&this.side===jsts.geomgraph.Position.LEFT||c===jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE&&this.side===jsts.geomgraph.Position.RIGHT;0==c?this.addCollinear(b):d?this.addOutsideTurn(c,b):this.addInsideTurn(c,b)}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addCollinear=function(a){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2);var b=this.li.getIntersectionNum();b>=2&&(this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_BEVEL||this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_MITRE?(a&&this.segList.addPt(this.offset0.p1),this.segList.addPt(this.offset1.p0)):this.addFillet(this.s1,this.offset0.p1,this.offset1.p0,jsts.algorithm.CGAlgorithms.CLOCKWISE,this.distance))},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addOutsideTurn=function(a,b){return this.offset0.p1.distance(this.offset1.p0)<this.distance*jsts.operation.buffer.OffsetSegmentGenerator.OFFSET_SEGMENT_SEPARATION_FACTOR?void this.segList.addPt(this.offset0.p1):void(this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_MITRE?this.addMitreJoin(this.s1,this.offset0,this.offset1,this.distance):this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_BEVEL?this.addBevelJoin(this.offset0,this.offset1):(b&&this.segList.addPt(this.offset0.p1),this.addFillet(this.s1,this.offset0.p1,this.offset1.p0,a,this.distance),this.segList.addPt(this.offset1.p0)))},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addInsideTurn=function(a,b){if(this.li.computeIntersection(this.offset0.p0,this.offset0.p1,this.offset1.p0,this.offset1.p1),this.li.hasIntersection())this.segList.addPt(this.li.getIntersection(0));else if(this.hasNarrowConcaveAngle=!0,this.offset0.p1.distance(this.offset1.p0)<this.distance*jsts.operation.buffer.OffsetSegmentGenerator.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this.segList.addPt(this.offset0.p1);else{if(this.segList.addPt(this.offset0.p1),this.closingSegLengthFactor>0){var c=new jsts.geom.Coordinate((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(c);var d=new jsts.geom.Coordinate((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(d)}else this.segList.addPt(this.s1);this.segList.addPt(this.offset1.p0)}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.computeOffsetSegment=function(a,b,c,d){var e=b===jsts.geomgraph.Position.LEFT?1:-1,f=a.p1.x-a.p0.x,g=a.p1.y-a.p0.y,h=Math.sqrt(f*f+g*g),i=e*c*f/h,j=e*c*g/h;d.p0.x=a.p0.x-j,d.p0.y=a.p0.y+i,d.p1.x=a.p1.x-j,d.p1.y=a.p1.y+i},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addLineEndCap=function(a,b){var c=new jsts.geom.LineSegment(a,b),d=new jsts.geom.LineSegment;this.computeOffsetSegment(c,jsts.geomgraph.Position.LEFT,this.distance,d);var e=new jsts.geom.LineSegment;this.computeOffsetSegment(c,jsts.geomgraph.Position.RIGHT,this.distance,e);var f=b.x-a.x,g=b.y-a.y,h=Math.atan2(g,f);switch(this.bufParams.getEndCapStyle()){case jsts.operation.buffer.BufferParameters.CAP_ROUND:this.segList.addPt(d.p1),this.addFillet(b,h+Math.PI/2,h-Math.PI/2,jsts.algorithm.CGAlgorithms.CLOCKWISE,this.distance),this.segList.addPt(e.p1);break;case jsts.operation.buffer.BufferParameters.CAP_FLAT:this.segList.addPt(d.p1),this.segList.addPt(e.p1);break;case jsts.operation.buffer.BufferParameters.CAP_SQUARE:var i=new jsts.geom.Coordinate;i.x=Math.abs(this.distance)*Math.cos(h),i.y=Math.abs(this.distance)*Math.sin(h);var j=new jsts.geom.Coordinate(d.p1.x+i.x,d.p1.y+i.y),k=new jsts.geom.Coordinate(e.p1.x+i.x,e.p1.y+i.y);this.segList.addPt(j),this.segList.addPt(k)}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addMitreJoin=function(a,b,c,d){var e=!0,f=null;try{f=jsts.algorithm.HCoordinate.intersection(b.p0,b.p1,c.p0,c.p1);var g=0>=d?1:f.distance(a)/Math.abs(d);g>this.bufParams.getMitreLimit()&&(this.isMitreWithinLimit=!1)}catch(h){h instanceof jsts.error.NotRepresentableError&&(f=new jsts.geom.Coordinate(0,0),this.isMitreWithinLimit=!1)}e?this.segList.addPt(f):this.addLimitedMitreJoin(b,c,d,bufParams.getMitreLimit())},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addLimitedMitreJoin=function(a,b,c,d){var e=this.seg0.p1,f=jsts.algorithm.Angle.angle(e,this.seg0.p0),g=(jsts.algorithm.Angle.angle(e,this.seg1.p1),jsts.algorithm.Angle.angleBetweenOriented(this.seg0.p0,e,this.seg1.p1)),h=g/2,i=jsts.algorithm.Angle.normalize(f+h),j=jsts.algorithm.Angle.normalize(i+Math.PI),k=d*c,l=k*Math.abs(Math.sin(h)),m=c-l,n=e.x+k*Math.cos(j),o=e.y+k*Math.sin(j),p=new jsts.geom.Coordinate(n,o),q=new jsts.geom.LineSegment(e,p),r=q.pointAlongOffset(1,m),s=q.pointAlongOffset(1,-m);this.side==jsts.geomgraph.Position.LEFT?(this.segList.addPt(r),this.segList.addPt(s)):(this.segList.addPt(s),this.segList.addPt(r))},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addBevelJoin=function(a,b){this.segList.addPt(a.p1),this.segList.addPt(b.p0)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addFillet=function(a,b,c,d,e){if(!(c instanceof jsts.geom.Coordinate))return void this.addFillet2.apply(this,arguments);var f=b.x-a.x,g=b.y-a.y,h=Math.atan2(g,f),i=c.x-a.x,j=c.y-a.y,k=Math.atan2(j,i);d===jsts.algorithm.CGAlgorithms.CLOCKWISE?k>=h&&(h+=2*Math.PI):h>=k&&(h-=2*Math.PI),this.segList.addPt(b),this.addFillet(a,h,k,d,e),this.segList.addPt(c)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addFillet2=function(a,b,c,d,e){var f=d===jsts.algorithm.CGAlgorithms.CLOCKWISE?-1:1,g=Math.abs(b-c),h=parseInt(g/this.filletAngleQuantum+.5);if(!(1>h)){var i,j;i=0,j=g/h;for(var k=i,l=new jsts.geom.Coordinate;g>k;){var m=b+f*k;l.x=a.x+e*Math.cos(m),l.y=a.y+e*Math.sin(m),this.segList.addPt(l),k+=j}}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.createCircle=function(a){var b=new jsts.geom.Coordinate(a.x+this.distance,a.y);this.segList.addPt(b),this.addFillet(a,0,2*Math.PI,-1,this.distance),this.segList.closeRing()},jsts.operation.buffer.OffsetSegmentGenerator.prototype.createSquare=function(a){this.segList.addPt(new jsts.geom.Coordinate(a.x+distance,a.y+distance)),this.segList.addPt(new jsts.geom.Coordinate(a.x+distance,a.y-distance)),this.segList.addPt(new jsts.geom.Coordinate(a.x-distance,a.y-distance)),this.segList.addPt(new jsts.geom.Coordinate(a.x-distance,a.y+distance)),this.segList.closeRing()},jsts.operation.overlay.MaximalEdgeRing=function(a,b){jsts.geomgraph.EdgeRing.call(this,a,b)},jsts.operation.overlay.MaximalEdgeRing.prototype=new jsts.geomgraph.EdgeRing,jsts.operation.overlay.MaximalEdgeRing.constructor=jsts.operation.overlay.MaximalEdgeRing,jsts.operation.overlay.MaximalEdgeRing.prototype.getNext=function(a){return a.getNext()},jsts.operation.overlay.MaximalEdgeRing.prototype.setEdgeRing=function(a,b){a.setEdgeRing(b)},jsts.operation.overlay.MaximalEdgeRing.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var a=this.startDe;do{var b=a.getNode();b.getEdges().linkMinimalDirectedEdges(this),a=a.getNext()}while(a!=this.startDe)},jsts.operation.overlay.MaximalEdgeRing.prototype.buildMinimalRings=function(){var a=[],b=this.startDe;do{if(null===b.getMinEdgeRing()){var c=new jsts.operation.overlay.MinimalEdgeRing(b,this.geometryFactory);a.push(c)}b=b.getNext()}while(b!=this.startDe);return a},jsts.algorithm.CentroidPoint=function(){this.centSum=new jsts.geom.Coordinate},jsts.algorithm.CentroidPoint.prototype.ptCount=0,jsts.algorithm.CentroidPoint.prototype.centSum=null,jsts.algorithm.CentroidPoint.prototype.add=function(a){if(a instanceof jsts.geom.Point)this.add2(a.getCoordinate());else if(a instanceof jsts.geom.GeometryCollection||a instanceof jsts.geom.MultiPoint||a instanceof jsts.geom.MultiLineString||a instanceof jsts.geom.MultiPolygon)for(var b=a,c=0;c<b.getNumGeometries();c++)this.add(b.getGeometryN(c))},jsts.algorithm.CentroidPoint.prototype.add2=function(a){this.ptCount+=1,this.centSum.x+=a.x,this.centSum.y+=a.y},jsts.algorithm.CentroidPoint.prototype.getCentroid=function(){var a=new jsts.geom.Coordinate;return a.x=this.centSum.x/this.ptCount,a.y=this.centSum.y/this.ptCount,a},jsts.operation.distance.ConnectedElementLocationFilter=function(a){this.locations=a},jsts.operation.distance.ConnectedElementLocationFilter.prototype=new jsts.geom.GeometryFilter,jsts.operation.distance.ConnectedElementLocationFilter.prototype.locations=null,jsts.operation.distance.ConnectedElementLocationFilter.getLocations=function(a){var b=[];return a.apply(new jsts.operation.distance.ConnectedElementLocationFilter(b)),b},jsts.operation.distance.ConnectedElementLocationFilter.prototype.filter=function(a){(a instanceof jsts.geom.Point||a instanceof jsts.geom.LineString||a instanceof jsts.geom.Polygon)&&this.locations.push(new jsts.operation.distance.GeometryLocation(a,0,a.getCoordinate()))},jsts.geomgraph.index.MonotoneChainEdge=function(a){this.e=a,this.pts=a.getCoordinates();var b=new jsts.geomgraph.index.MonotoneChainIndexer;this.startIndex=b.getChainStartIndices(this.pts)},jsts.geomgraph.index.MonotoneChainEdge.prototype.e=null,jsts.geomgraph.index.MonotoneChainEdge.prototype.pts=null,jsts.geomgraph.index.MonotoneChainEdge.prototype.startIndex=null,jsts.geomgraph.index.MonotoneChainEdge.prototype.env1=new jsts.geom.Envelope,jsts.geomgraph.index.MonotoneChainEdge.prototype.env2=new jsts.geom.Envelope,jsts.geomgraph.index.MonotoneChainEdge.prototype.getCoordinates=function(){return this.pts},jsts.geomgraph.index.MonotoneChainEdge.prototype.getStartIndexes=function(){return this.startIndex},jsts.geomgraph.index.MonotoneChainEdge.prototype.getMinX=function(a){var b=this.pts[this.startIndex[a]].x,c=this.pts[this.startIndex[a+1]].x;return c>b?b:c},jsts.geomgraph.index.MonotoneChainEdge.prototype.getMaxX=function(a){var b=this.pts[this.startIndex[a]].x,c=this.pts[this.startIndex[a+1]].x;return b>c?b:c},jsts.geomgraph.index.MonotoneChainEdge.prototype.computeIntersects=function(a,b){for(var c=0;c<this.startIndex.length-1;c++)for(var d=0;d<a.startIndex.length-1;d++)this.computeIntersectsForChain(c,a,d,b)},jsts.geomgraph.index.MonotoneChainEdge.prototype.computeIntersectsForChain=function(a,b,c,d){this.computeIntersectsForChain2(this.startIndex[a],this.startIndex[a+1],b,b.startIndex[c],b.startIndex[c+1],d)},jsts.geomgraph.index.MonotoneChainEdge.prototype.computeIntersectsForChain2=function(a,b,c,d,e,f){var g=this.pts[a],h=this.pts[b],i=c.pts[d],j=c.pts[e];if(b-a==1&&e-d==1)return void f.addIntersections(this.e,a,c.e,d);if(this.env1.init(g,h),this.env2.init(i,j),this.env1.intersects(this.env2)){var k=Math.floor((a+b)/2),l=Math.floor((d+e)/2);k>a&&(l>d&&this.computeIntersectsForChain2(a,k,c,d,l,f),e>l&&this.computeIntersectsForChain2(a,k,c,l,e,f)),b>k&&(l>d&&this.computeIntersectsForChain2(k,b,c,d,l,f),e>l&&this.computeIntersectsForChain2(k,b,c,l,e,f))}},function(){var a=javascript.util.ArrayList;jsts.operation.relate.EdgeEndBuilder=function(){},jsts.operation.relate.EdgeEndBuilder.prototype.computeEdgeEnds=function(b){if(2==arguments.length)return void this.computeEdgeEnds2.apply(this,arguments);for(var c=new a,d=b;d.hasNext();){var e=d.next();this.computeEdgeEnds2(e,c)}return c},jsts.operation.relate.EdgeEndBuilder.prototype.computeEdgeEnds2=function(a,b){var c=a.getEdgeIntersectionList();c.addEndpoints();var d=c.iterator(),e=null,f=null;if(d.hasNext()){var g=d.next();do e=f,f=g,g=null,d.hasNext()&&(g=d.next()),null!==f&&(this.createEdgeEndForPrev(a,b,f,e),this.createEdgeEndForNext(a,b,f,g));while(null!==f)}},jsts.operation.relate.EdgeEndBuilder.prototype.createEdgeEndForPrev=function(a,b,c,d){var e=c.segmentIndex;if(0===c.dist){if(0===e)return;e--}var f=a.getCoordinate(e);null!==d&&d.segmentIndex>=e&&(f=d.coord);var g=new jsts.geomgraph.Label(a.getLabel());g.flip();var h=new jsts.geomgraph.EdgeEnd(a,c.coord,f,g);b.add(h)},jsts.operation.relate.EdgeEndBuilder.prototype.createEdgeEndForNext=function(a,b,c,d){var e=c.segmentIndex+1;if(!(e>=a.getNumPoints()&&null===d)){var f=a.getCoordinate(e);null!==d&&d.segmentIndex===c.segmentIndex&&(f=d.coord);var g=new jsts.geomgraph.EdgeEnd(a,c.coord,f,new jsts.geomgraph.Label(a.getLabel()));b.add(g)}}}(),function(){var a=javascript.util.ArrayList,b=javascript.util.TreeSet,c=jsts.geom.CoordinateFilter;jsts.util.UniqueCoordinateArrayFilter=function(){this.treeSet=new b,this.list=new a},jsts.util.UniqueCoordinateArrayFilter.prototype=new c,jsts.util.UniqueCoordinateArrayFilter.prototype.treeSet=null,jsts.util.UniqueCoordinateArrayFilter.prototype.list=null,jsts.util.UniqueCoordinateArrayFilter.prototype.getCoordinates=function(){return this.list.toArray()},jsts.util.UniqueCoordinateArrayFilter.prototype.filter=function(a){this.treeSet.contains(a)||(this.list.add(a),this.treeSet.add(a))}}(),function(){var a=jsts.algorithm.CGAlgorithms,b=jsts.util.UniqueCoordinateArrayFilter,c=jsts.util.Assert,d=javascript.util.Stack,e=javascript.util.ArrayList,f=javascript.util.Arrays,g=function(a){this.origin=a};g.prototype.origin=null,g.prototype.compare=function(a,b){var c=a,d=b;return g.polarCompare(this.origin,c,d)},g.polarCompare=function(b,c,d){var e=c.x-b.x,f=c.y-b.y,g=d.x-b.x,h=d.y-b.y,i=a.computeOrientation(b,c,d);if(i==a.COUNTERCLOCKWISE)return 1;if(i==a.CLOCKWISE)return-1;var j=e*e+f*f,k=g*g+h*h;return k>j?-1:j>k?1:0},jsts.algorithm.ConvexHull=function(){if(1===arguments.length){var a=arguments[0];this.inputPts=jsts.algorithm.ConvexHull.extractCoordinates(a),this.geomFactory=a.getFactory()}else this.pts=arguments[0],this.geomFactory=arguments[1]},jsts.algorithm.ConvexHull.prototype.geomFactory=null,jsts.algorithm.ConvexHull.prototype.inputPts=null,jsts.algorithm.ConvexHull.extractCoordinates=function(a){var c=new b;return a.apply(c),c.getCoordinates()},jsts.algorithm.ConvexHull.prototype.getConvexHull=function(){if(0==this.inputPts.length)return this.geomFactory.createGeometryCollection(null);if(1==this.inputPts.length)return this.geomFactory.createPoint(this.inputPts[0]);if(2==this.inputPts.length)return this.geomFactory.createLineString(this.inputPts);var a=this.inputPts;this.inputPts.length>50&&(a=this.reduce(this.inputPts));var b=this.preSort(a),c=this.grahamScan(b),d=c.toArray();return this.lineOrPolygon(d)},jsts.algorithm.ConvexHull.prototype.reduce=function(b){var c=this.computeOctRing(b);if(null==c)return this.inputPts;for(var d=new javascript.util.TreeSet,e=0;e<c.length;e++)d.add(c[e]);for(var e=0;e<b.length;e++)a.isPointInRing(b[e],c)||d.add(b[e]);var f=d.toArray();return f.length<3?this.padArray3(f):f},jsts.algorithm.ConvexHull.prototype.padArray3=function(a){for(var b=[],c=0;c<b.length;c++)c<a.length?b[c]=a[c]:b[c]=a[0];return b},jsts.algorithm.ConvexHull.prototype.preSort=function(a){for(var b,c=1;c<a.length;c++)(a[c].y<a[0].y||a[c].y==a[0].y&&a[c].x<a[0].x)&&(b=a[0],a[0]=a[c],a[c]=b);return f.sort(a,1,a.length,new g(a[0])),a},jsts.algorithm.ConvexHull.prototype.grahamScan=function(b){var c,e=new d;c=e.push(b[0]),c=e.push(b[1]),c=e.push(b[2]);for(var f=3;f<b.length;f++){for(c=e.pop();!e.empty()&&a.computeOrientation(e.peek(),c,b[f])>0;)c=e.pop();c=e.push(c),c=e.push(b[f])}return c=e.push(b[0]),e},jsts.algorithm.ConvexHull.prototype.isBetween=function(b,c,d){if(0!==a.computeOrientation(b,c,d))return!1;if(b.x!=d.x){if(b.x<=c.x&&c.x<=d.x)return!0;if(d.x<=c.x&&c.x<=b.x)return!0}if(b.y!=d.y){if(b.y<=c.y&&c.y<=d.y)return!0;if(d.y<=c.y&&c.y<=b.y)return!0}return!1},jsts.algorithm.ConvexHull.prototype.computeOctRing=function(a){var b=this.computeOctPts(a),c=new jsts.geom.CoordinateList;return c.add(b,!1),c.size()<3?null:(c.closeRing(),c.toCoordinateArray())},jsts.algorithm.ConvexHull.prototype.computeOctPts=function(a){for(var b=[],c=0;8>c;c++)b[c]=a[0];for(var d=1;d<a.length;d++)a[d].x<b[0].x&&(b[0]=a[d]),a[d].x-a[d].y<b[1].x-b[1].y&&(b[1]=a[d]),a[d].y>b[2].y&&(b[2]=a[d]),a[d].x+a[d].y>b[3].x+b[3].y&&(b[3]=a[d]),a[d].x>b[4].x&&(b[4]=a[d]),a[d].x-a[d].y>b[5].x-b[5].y&&(b[5]=a[d]),a[d].y<b[6].y&&(b[6]=a[d]),a[d].x+a[d].y<b[7].x+b[7].y&&(b[7]=a[d]);return b},jsts.algorithm.ConvexHull.prototype.lineOrPolygon=function(a){if(a=this.cleanRing(a),3==a.length)return this.geomFactory.createLineString([a[0],a[1]]);var b=this.geomFactory.createLinearRing(a);return this.geomFactory.createPolygon(b,null)},jsts.algorithm.ConvexHull.prototype.cleanRing=function(a){c.equals(a[0],a[a.length-1]);for(var b=new e,d=null,f=0;f<=a.length-2;f++){var g=a[f],h=a[f+1];g.equals(h)||null!=d&&this.isBetween(d,g,h)||(b.add(g),d=g)}b.add(a[a.length-1]);var i=[];return b.toArray(i)}}(),jsts.algorithm.MinimumDiameter=function(a,b){this.convexHullPts=null,this.minBaseSeg=new jsts.geom.LineSegment,this.minWidthPt=null,this.minPtIndex=0,this.minWidth=0,jsts.algorithm.MinimumDiameter.inputGeom=a,jsts.algorithm.MinimumDiameter.isConvex=b||!1},jsts.algorithm.MinimumDiameter.inputGeom=null,jsts.algorithm.MinimumDiameter.isConvex=!1,jsts.algorithm.MinimumDiameter.nextIndex=function(a,b){return b++,b>=a.length&&(b=0),b},jsts.algorithm.MinimumDiameter.computeC=function(a,b,c){return a*c.y-b*c.x},jsts.algorithm.MinimumDiameter.computeSegmentForLine=function(a,b,c){var d,e;return Math.abs(b)>Math.abs(a)?(d=new jsts.geom.Coordinate(0,c/b),e=new jsts.geom.Coordinate(1,c/b-a/b)):(d=new jsts.geom.Coordinate(c/a,0),e=new jsts.geom.Coordinate(c/a-b/a,1)),new jsts.geom.LineSegment(d,e)},jsts.algorithm.MinimumDiameter.prototype.getLength=function(){return this.computeMinimumDiameter(),this.minWidth},jsts.algorithm.MinimumDiameter.prototype.getWidthCoordinate=function(){return this.computeMinimumDiameter(),this.minWidthPt},jsts.algorithm.MinimumDiameter.prototype.getSupportingSegment=function(){this.computeMinimumDiameter();var a=[this.minBaseSeg.p0,this.minBaseSeg.p1];return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString(a)},jsts.algorithm.MinimumDiameter.prototype.getDiameter=function(){if(this.computeMinimumDiameter(),null===this.minWidthPt)return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString(null);var a=this.minBaseSeg.project(this.minWidthPt);return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString([a,this.minWidthPt])},jsts.algorithm.MinimumDiameter.prototype.computeMinimumDiameter=function(){if(null===this.minWidthPt)if(jsts.algorithm.MinimumDiameter.isConvex)this.computeWidthConvex(jsts.algorithm.MinimumDiameter.inputGeom);else{var a=new jsts.algorithm.ConvexHull(jsts.algorithm.MinimumDiameter.inputGeom).getConvexHull();this.computeWidthConvex(a)}},jsts.algorithm.MinimumDiameter.prototype.computeWidthConvex=function(a){a instanceof jsts.geom.Polygon?this.convexHullPts=a.getExteriorRing().getCoordinates():this.convexHullPts=a.getCoordinates(),0===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=null,this.minBaseSeg=null):1===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[0]):2===this.convexHullPts.length||3===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[1]):this.computeConvexRingMinDiameter(this.convexHullPts)},jsts.algorithm.MinimumDiameter.prototype.computeConvexRingMinDiameter=function(a){this.minWidth=Number.MAX_VALUE;for(var b=1,c=new jsts.geom.LineSegment,d=0;d<a.length-1;d++)c.p0=a[d],c.p1=a[d+1],b=this.findMaxPerpDistance(a,c,b)},jsts.algorithm.MinimumDiameter.prototype.findMaxPerpDistance=function(a,b,c){for(var d=b.distancePerpendicular(a[c]),e=d,f=c,g=f;e>=d;)d=e,f=g,g=jsts.algorithm.MinimumDiameter.nextIndex(a,f),e=b.distancePerpendicular(a[g]);return d<this.minWidth&&(this.minPtIndex=f,this.minWidth=d,this.minWidthPt=a[this.minPtIndex],this.minBaseSeg=new jsts.geom.LineSegment(b)),f},jsts.algorithm.MinimumDiameter.prototype.getMinimumRectangle=function(){if(this.computeMinimumDiameter(),0===this.minWidth)return this.minBaseSeg.p0.equals2D(this.minBaseSeg.p1)?jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createPoint(this.minBaseSeg.p0):this.minBaseSeg.toGeometry(jsts.algorithm.MinimumDiameter.inputGeom.getFactory());for(var a=this.minBaseSeg.p1.x-this.minBaseSeg.p0.x,b=this.minBaseSeg.p1.y-this.minBaseSeg.p0.y,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,e=Number.MAX_VALUE,f=-Number.MAX_VALUE,g=0;g<this.convexHullPts.length;g++){var h=jsts.algorithm.MinimumDiameter.computeC(a,b,this.convexHullPts[g]);h>d&&(d=h),c>h&&(c=h);var i=jsts.algorithm.MinimumDiameter.computeC(-b,a,this.convexHullPts[g]);i>f&&(f=i),e>i&&(e=i)}var j=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-a,-b,f),k=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-a,-b,e),l=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-b,a,d),m=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-b,a,c),n=l.lineIntersection(j),o=m.lineIntersection(j),p=m.lineIntersection(k),q=l.lineIntersection(k),r=jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLinearRing([n,o,p,q,n]);return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createPolygon(r,null)},function(){jsts.io.GeoJSONParser=function(a){this.geometryFactory=a||new jsts.geom.GeometryFactory,this.geometryTypes=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"]},jsts.io.GeoJSONParser.prototype.read=function(a){var b;b="string"==typeof a?JSON.parse(a):a;var c=b.type;if(!this.parse[c])throw new Error("Unknown GeoJSON type: "+b.type);return-1!=this.geometryTypes.indexOf(c)?this.parse[c].apply(this,[b.coordinates]):"GeometryCollection"===c?this.parse[c].apply(this,[b.geometries]):this.parse[c].apply(this,[b])},jsts.io.GeoJSONParser.prototype.parse={Feature:function(a){var b={};for(var c in a)b[c]=a[c];if(a.geometry){var d=a.geometry.type;if(!this.parse[d])throw new Error("Unknown GeoJSON type: "+a.type);b.geometry=this.read(a.geometry)}return a.bbox&&(b.bbox=this.parse.bbox.apply(this,[a.bbox])),b},FeatureCollection:function(a){var b={};if(a.features){b.features=[];for(var c=0;c<a.features.length;++c)b.features.push(this.read(a.features[c]))}return a.bbox&&(b.bbox=this.parse.bbox.apply(this,[a.bbox])),b},coordinates:function(a){for(var b=[],c=0;c<a.length;++c){var d=a[c];b.push(new jsts.geom.Coordinate(d[0],d[1]))}return b},bbox:function(a){return this.geometryFactory.createLinearRing([new jsts.geom.Coordinate(a[0],a[1]),new jsts.geom.Coordinate(a[2],a[1]),new jsts.geom.Coordinate(a[2],a[3]),new jsts.geom.Coordinate(a[0],a[3]),new jsts.geom.Coordinate(a[0],a[1])])},Point:function(a){var b=new jsts.geom.Coordinate(a[0],a[1]);return this.geometryFactory.createPoint(b)},MultiPoint:function(a){for(var b=[],c=0;c<a.length;++c)b.push(this.parse.Point.apply(this,[a[c]]));return this.geometryFactory.createMultiPoint(b)},LineString:function(a){var b=this.parse.coordinates.apply(this,[a]);return this.geometryFactory.createLineString(b)},MultiLineString:function(a){for(var b=[],c=0;c<a.length;++c)b.push(this.parse.LineString.apply(this,[a[c]]));return this.geometryFactory.createMultiLineString(b)},Polygon:function(a){for(var b=this.parse.coordinates.apply(this,[a[0]]),c=this.geometryFactory.createLinearRing(b),d=[],e=1;e<a.length;++e){var f=a[e],g=this.parse.coordinates.apply(this,[f]),h=this.geometryFactory.createLinearRing(g);d.push(h)}return this.geometryFactory.createPolygon(c,d)},MultiPolygon:function(a){for(var b=[],c=0;c<a.length;++c){var d=a[c];b.push(this.parse.Polygon.apply(this,[d]))}return this.geometryFactory.createMultiPolygon(b)},GeometryCollection:function(a){for(var b=[],c=0;c<a.length;++c){var d=a[c];b.push(this.read(d))}return this.geometryFactory.createGeometryCollection(b)}},jsts.io.GeoJSONParser.prototype.write=function(a){var b=a.CLASS_NAME.slice(10);if(!this.extract[b])throw new Error("Geometry is not supported");return this.extract[b].apply(this,[a])},jsts.io.GeoJSONParser.prototype.extract={coordinate:function(a){return[a.x,a.y]},Point:function(a){var b=this.extract.coordinate.apply(this,[a.coordinate]);return{type:"Point",coordinates:b}},MultiPoint:function(a){for(var b=[],c=0;c<a.geometries.length;++c){var d=a.geometries[c],e=this.extract.Point.apply(this,[d]);b.push(e.coordinates)}return{type:"MultiPoint",coordinates:b}},LineString:function(a){for(var b=[],c=0;c<a.points.length;++c){var d=a.points[c];b.push(this.extract.coordinate.apply(this,[d]))}return{type:"LineString",coordinates:b}},MultiLineString:function(a){for(var b=[],c=0;c<a.geometries.length;++c){var d=a.geometries[c],e=this.extract.LineString.apply(this,[d]);b.push(e.coordinates)}return{type:"MultiLineString",coordinates:b}},Polygon:function(a){var b=[],c=this.extract.LineString.apply(this,[a.shell]);b.push(c.coordinates);for(var d=0;d<a.holes.length;++d){var e=a.holes[d],f=this.extract.LineString.apply(this,[e]);b.push(f.coordinates)}return{type:"Polygon",coordinates:b}},MultiPolygon:function(a){for(var b=[],c=0;c<a.geometries.length;++c){var d=a.geometries[c],e=this.extract.Polygon.apply(this,[d]);b.push(e.coordinates)}return{type:"MultiPolygon",coordinates:b}},GeometryCollection:function(a){for(var b=[],c=0;c<a.geometries.length;++c){var d=a.geometries[c],e=d.CLASS_NAME.slice(10);b.push(this.extract[e].apply(this,[d]))}return{type:"GeometryCollection",geometries:b}}}}(),jsts.triangulate.quadedge.Vertex=function(){1===arguments.length?this.initFromCoordinate(arguments[0]):this.initFromXY(arguments[0],arguments[1])},jsts.triangulate.quadedge.Vertex.LEFT=0,jsts.triangulate.quadedge.Vertex.RIGHT=1,jsts.triangulate.quadedge.Vertex.BEYOND=2,jsts.triangulate.quadedge.Vertex.BEHIND=3,jsts.triangulate.quadedge.Vertex.BETWEEN=4,jsts.triangulate.quadedge.Vertex.ORIGIN=5,jsts.triangulate.quadedge.Vertex.DESTINATION=6,jsts.triangulate.quadedge.Vertex.prototype.initFromXY=function(a,b){this.p=new jsts.geom.Coordinate(a,b)},jsts.triangulate.quadedge.Vertex.prototype.initFromCoordinate=function(a){this.p=new jsts.geom.Coordinate(a)},jsts.triangulate.quadedge.Vertex.prototype.getX=function(){return this.p.x},jsts.triangulate.quadedge.Vertex.prototype.getY=function(){return this.p.y},jsts.triangulate.quadedge.Vertex.prototype.getZ=function(){return this.p.z},jsts.triangulate.quadedge.Vertex.prototype.setZ=function(a){this.p.z=a},jsts.triangulate.quadedge.Vertex.prototype.getCoordinate=function(){return this.p},jsts.triangulate.quadedge.Vertex.prototype.toString=function(){return"POINT ("+this.p.x+" "+this.p.y+")"},jsts.triangulate.quadedge.Vertex.prototype.equals=function(){return 1===arguments.length?this.equalsExact(arguments[0]):this.equalsWithTolerance(arguments[0],arguments[1])},jsts.triangulate.quadedge.Vertex.prototype.equalsExact=function(a){return this.p.x===a.getX()&&this.p.y===a.getY()},jsts.triangulate.quadedge.Vertex.prototype.equalsWithTolerance=function(a,b){return this.p.distance(a.getCoordinate())<b},jsts.triangulate.quadedge.Vertex.prototype.classify=function(a,b){var c,d,e,f;return c=this,d=b.sub(a),e=c.sub(a),f=d.crossProduct(e),f>0?jsts.triangulate.quadedge.Vertex.LEFT:0>f?jsts.triangulate.quadedge.Vertex.RIGHT:d.getX()*e.getX()<0||d.getY()*e.getY()<0?jsts.triangulate.quadedge.Vertex.BEHIND:d.magn()<e.magn()?jsts.triangulate.quadedge.Vertex.BEYOND:a.equals(c)?jsts.triangulate.quadedge.Vertex.ORIGIN:b.equals(c)?jsts.triangulate.quadedge.Vertex.DESTINATION:jsts.triangulate.quadedge.Vertex.BETWEEN},jsts.triangulate.quadedge.Vertex.prototype.crossProduct=function(a){return this.p.x*a.getY()-this.p.y*a.getX()},jsts.triangulate.quadedge.Vertex.prototype.dot=function(a){return this.p.x*a.getX()+this.p.y*a.getY()},jsts.triangulate.quadedge.Vertex.prototype.times=function(a){return new jsts.triangulate.quadedge.Vertex(a*this.p.x,a*this.p.y)},jsts.triangulate.quadedge.Vertex.prototype.sum=function(a){return new jsts.triangulate.quadedge.Vertex(this.p.x+a.getX(),this.p.y+a.getY())},jsts.triangulate.quadedge.Vertex.prototype.sub=function(a){return new jsts.triangulate.quadedge.Vertex(this.p.x-a.getX(),this.p.y-a.getY())},jsts.triangulate.quadedge.Vertex.prototype.magn=function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},jsts.triangulate.quadedge.Vertex.prototype.cross=function(){return new Vertex(this.p.y,-this.p.x)},jsts.triangulate.quadedge.Vertex.prototype.isInCircle=function(a,b,c){return jsts.triangulate.quadedge.TrianglePredicate.isInCircleRobust(a.p,b.p,c.p,this.p)},jsts.triangulate.quadedge.Vertex.prototype.isCCW=function(a,b){return(a.p.x-this.p.x)*(b.p.y-this.p.y)-(a.p.y-this.p.y)*(b.p.x-this.p.x)>0},jsts.triangulate.quadedge.Vertex.prototype.rightOf=function(a){return this.isCCW(a.dest(),a.orig())},jsts.triangulate.quadedge.Vertex.prototype.leftOf=function(a){return this.isCCW(a.orig(),a.dest())},jsts.triangulate.quadedge.Vertex.prototype.bisector=function(a,b){var c,d,e,f;return c=b.getX()-a.getX(),d=b.getY()-a.getY(),e=new jsts.algorithm.HCoordinate(a.getX()+c/2,a.getY()+d/2,1),f=new jsts.algorithm.HCoordinate(a.getX()-d+c/2,a.getY()+c+d/2,1),new jsts.algorithm.HCoordinate(e,f)},jsts.triangulate.quadedge.Vertex.prototype.distance=function(a,b){return a.p.distance(b.p)},jsts.triangulate.quadedge.Vertex.prototype.circumRadiusRatio=function(a,b){var c,d,e,f;return c=this.circleCenter(a,b),d=this.distance(c,a),e=this.distance(this,a),f=this.distance(a,b),e>f&&(e=f),f=this.distance(b,this),e>f&&(e=f),d/e},jsts.triangulate.quadedge.Vertex.prototype.midPoint=function(a){var b,c;return b=(this.p.x+a.getX())/2,c=(this.p.y+a.getY())/2,new jsts.triangulate.quadedge.Vertex(b,c);
  },jsts.triangulate.quadedge.Vertex.prototype.circleCenter=function(a,b){var c,d,e,f,g;c=new jsts.triangulate.quadedge.Vertex(this.getX(),this.getY()),d=this.bisector(c,a),e=this.bisector(a,b),f=new jsts.algorithm.HCoordinate(d,e),g=null;try{g=new jsts.triangulate.quadedge.Vertex(f.getX(),f.getY())}catch(h){}return g},jsts.operation.valid.IsValidOp=function(a){this.parentGeometry=a,this.isSelfTouchingRingFormingHoleValid=!1,this.validErr=null},jsts.operation.valid.IsValidOp.isValid=function(a){if(arguments[0]instanceof jsts.geom.Coordinate)return isNaN(a.x)?!1:isFinite(a.x)||isNaN(a.x)?isNaN(a.y)?!1:isFinite(a.y)||isNaN(a.y)?!0:!1:!1;var b=new jsts.operation.valid.IsValidOp(a);return b.isValid()},jsts.operation.valid.IsValidOp.findPtNotNode=function(a,b,c){for(var d=c.findEdge(b),e=d.getEdgeIntersectionList(),f=0;f<a.length;f++){var g=a[f];if(!e.isIntersection(g))return g}return null},jsts.operation.valid.IsValidOp.prototype.setSelfTouchingRingFormingHoleValid=function(a){this.isSelfTouchingRingFormingHoleValid=a},jsts.operation.valid.IsValidOp.prototype.isValid=function(){return this.checkValid(this.parentGeometry),null==this.validErr},jsts.operation.valid.IsValidOp.prototype.getValidationError=function(){return this.checkValid(this.parentGeometry),this.validErr},jsts.operation.valid.IsValidOp.prototype.checkValid=function(a){if(this.validErr=null,!a.isEmpty())if(a instanceof jsts.geom.Point)this.checkValidPoint(a);else if(a instanceof jsts.geom.MultiPoint)this.checkValidMultiPoint(a);else if(a instanceof jsts.geom.LinearRing)this.checkValidLinearRing(a);else if(a instanceof jsts.geom.LineString)this.checkValidLineString(a);else if(a instanceof jsts.geom.Polygon)this.checkValidPolygon(a);else if(a instanceof jsts.geom.MultiPolygon)this.checkValidMultiPolygon(a);else{if(!(a instanceof jsts.geom.GeometryCollection))throw a.constructor;this.checkValidGeometryCollection(a)}},jsts.operation.valid.IsValidOp.prototype.checkValidPoint=function(a){this.checkInvalidCoordinates(a.getCoordinates())},jsts.operation.valid.IsValidOp.prototype.checkValidMultiPoint=function(a){this.checkInvalidCoordinates(a.getCoordinates())},jsts.operation.valid.IsValidOp.prototype.checkValidLineString=function(a){if(this.checkInvalidCoordinates(a.getCoordinates()),null==this.validErr){var b=new jsts.geomgraph.GeometryGraph(0,a);this.checkTooFewPoints(b)}},jsts.operation.valid.IsValidOp.prototype.checkValidLinearRing=function(a){if(this.checkInvalidCoordinates(a.getCoordinates()),null==this.validErr&&(this.checkClosedRing(a),null==this.validErr)){var b=new jsts.geomgraph.GeometryGraph(0,a);if(this.checkTooFewPoints(b),null==this.validErr){var c=new jsts.algorithm.RobustLineIntersector;b.computeSelfNodes(c,!0),this.checkNoSelfIntersectingRings(b)}}},jsts.operation.valid.IsValidOp.prototype.checkValidPolygon=function(a){if(this.checkInvalidCoordinates(a),null==this.validErr&&(this.checkClosedRings(a),null==this.validErr)){var b=new jsts.geomgraph.GeometryGraph(0,a);this.checkTooFewPoints(b),null==this.validErr&&(this.checkConsistentArea(b),null==this.validErr&&(this.isSelfTouchingRingFormingHoleValid||(this.checkNoSelfIntersectingRings(b),null==this.validErr))&&(this.checkHolesInShell(a,b),null==this.validErr&&(this.checkHolesNotNested(a,b),null==this.validErr&&this.checkConnectedInteriors(b))))}},jsts.operation.valid.IsValidOp.prototype.checkValidMultiPolygon=function(a){for(var b=a.getNumGeometries(),c=0;b>c;c++){var d=a.getGeometryN(c);if(this.checkInvalidCoordinates(d),null!=this.validErr)return;if(this.checkClosedRings(d),null!=this.validErr)return}var e=new jsts.geomgraph.GeometryGraph(0,a);if(this.checkTooFewPoints(e),null==this.validErr&&(this.checkConsistentArea(e),null==this.validErr&&(this.isSelfTouchingRingFormingHoleValid||(this.checkNoSelfIntersectingRings(e),null==this.validErr)))){for(var c=0;c<a.getNumGeometries();c++){var d=a.getGeometryN(c);if(this.checkHolesInShell(d,e),null!=this.validErr)return}for(var c=0;c<a.getNumGeometries();c++){var d=a.getGeometryN(c);if(this.checkHolesNotNested(d,e),null!=this.validErr)return}this.checkShellsNotNested(a,e),null==this.validErr&&this.checkConnectedInteriors(e)}},jsts.operation.valid.IsValidOp.prototype.checkValidGeometryCollection=function(a){for(var b=0;b<a.getNumGeometries();b++){var c=a.getGeometryN(b);if(this.checkValid(c),null!=this.validErr)return}},jsts.operation.valid.IsValidOp.prototype.checkInvalidCoordinates=function(a){if(a instanceof jsts.geom.Polygon){var b=a;if(this.checkInvalidCoordinates(b.getExteriorRing().getCoordinates()),null!=this.validErr)return;for(var c=0;c<b.getNumInteriorRing();c++)if(this.checkInvalidCoordinates(b.getInteriorRingN(c).getCoordinates()),null!=this.validErr)return}else for(var d=a,c=0;c<d.length;c++)if(!jsts.operation.valid.IsValidOp.isValid(d[c]))return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.INVALID_COORDINATE,d[c]))},jsts.operation.valid.IsValidOp.prototype.checkClosedRings=function(a){if(this.checkClosedRing(a.getExteriorRing()),null==this.validErr)for(var b=0;b<a.getNumInteriorRing();b++)if(this.checkClosedRing(a.getInteriorRingN(b)),null!=this.validErr)return},jsts.operation.valid.IsValidOp.prototype.checkClosedRing=function(a){if(!a.isClosed()){var b=null;a.getNumPoints()>=1&&(b=a.getCoordinateN(0)),this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.RING_NOT_CLOSED,b)}},jsts.operation.valid.IsValidOp.prototype.checkTooFewPoints=function(a){return a.hasTooFewPoints?void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.TOO_FEW_POINTS,a.getInvalidPoint())):void 0},jsts.operation.valid.IsValidOp.prototype.checkConsistentArea=function(a){var b=new jsts.operation.valid.ConsistentAreaTester(a),c=b.isNodeConsistentArea();return c?void(b.hasDuplicateRings()&&(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.DUPLICATE_RINGS,b.getInvalidPoint()))):void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.SELF_INTERSECTION,b.getInvalidPoint()))},jsts.operation.valid.IsValidOp.prototype.checkNoSelfIntersectingRings=function(a){for(var b=a.getEdgeIterator();b.hasNext();){var c=b.next();if(this.checkNoSelfIntersectingRing(c.getEdgeIntersectionList()),null!=this.validErr)return}},jsts.operation.valid.IsValidOp.prototype.checkNoSelfIntersectingRing=function(a){for(var b=[],c=!0,d=a.iterator();d.hasNext();){var e=d.next();if(c)c=!1;else{if(b.indexOf(e.coord)>=0)return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.RING_SELF_INTERSECTION,e.coord));b.push(e.coord)}}},jsts.operation.valid.IsValidOp.prototype.checkHolesInShell=function(a,b){for(var c=a.getExteriorRing(),d=new jsts.algorithm.MCPointInRing(c),e=0;e<a.getNumInteriorRing();e++){var f=a.getInteriorRingN(e),g=jsts.operation.valid.IsValidOp.findPtNotNode(f.getCoordinates(),c,b);if(null==g)return;var h=!d.isInside(g);if(h)return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.HOLE_OUTSIDE_SHELL,g))}},jsts.operation.valid.IsValidOp.prototype.checkHolesNotNested=function(a,b){for(var c=new jsts.operation.valid.IndexedNestedRingTester(b),d=0;d<a.getNumInteriorRing();d++){var e=a.getInteriorRingN(d);c.add(e)}var f=c.isNonNested();f||(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.NESTED_HOLES,c.getNestedPoint()))},jsts.operation.valid.IsValidOp.prototype.checkShellsNotNested=function(a,b){for(var c=0;c<a.getNumGeometries();c++)for(var d=a.getGeometryN(c),e=d.getExteriorRing(),f=0;f<a.getNumGeometries();f++)if(c!=f){var g=a.getGeometryN(f);if(this.checkShellNotNested(e,g,b),null!=this.validErr)return}},jsts.operation.valid.IsValidOp.prototype.checkShellNotNested=function(a,b,c){var d=a.getCoordinates(),e=b.getExteriorRing(),f=e.getCoordinates(),g=jsts.operation.valid.IsValidOp.findPtNotNode(d,e,c);if(null!=g){var h=jsts.algorithm.CGAlgorithms.isPointInRing(g,f);if(h){if(b.getNumInteriorRing()<=0)return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.NESTED_SHELLS,g));for(var i=null,j=0;j<b.getNumInteriorRing();j++){var k=b.getInteriorRingN(j);if(i=this.checkShellInsideHole(a,k,c),null==i)return}this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.NESTED_SHELLS,i)}}},jsts.operation.valid.IsValidOp.prototype.checkShellInsideHole=function(a,b,c){var d=a.getCoordinates(),e=b.getCoordinates(),f=jsts.operation.valid.IsValidOp.findPtNotNode(d,b,c);if(null!=f){var g=jsts.algorithm.CGAlgorithms.isPointInRing(f,e);if(!g)return f}var h=jsts.operation.valid.IsValidOp.findPtNotNode(e,a,c);if(null!=h){var i=jsts.algorithm.CGAlgorithms.isPointInRing(h,d);return i?h:null}return jsts.util.Assert.shouldNeverReachHere("points in shell and hole appear to be equal"),null},jsts.operation.valid.IsValidOp.prototype.checkConnectedInteriors=function(a){var b=new jsts.operation.valid.ConnectedInteriorTester(a);b.isInteriorsConnected()||(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.DISCONNECTED_INTERIOR,b.getCoordinate()))},jsts.algorithm.RobustDeterminant=function(){},jsts.algorithm.RobustDeterminant.signOfDet2x2=function(a,b,c,d){var e,f,g,h;if(h=0,e=1,0===a||0===d)return 0===b||0===c?0:b>0?c>0?-e:e:c>0?e:-e;if(0===b||0===c)return d>0?a>0?e:-e:a>0?-e:e;if(b>0?d>0?b>d&&(e=-e,f=a,a=c,c=f,f=b,b=d,d=f):-d>=b?(e=-e,c=-c,d=-d):(f=a,a=-c,c=f,f=b,b=-d,d=f):d>0?d>=-b?(e=-e,a=-a,b=-b):(f=-a,a=c,c=f,f=-b,b=d,d=f):b>=d?(a=-a,b=-b,c=-c,d=-d):(e=-e,f=-a,a=-c,c=f,f=-b,b=-d,d=f),a>0){if(!(c>0))return e;if(a>c)return e}else{if(c>0)return-e;if(!(a>=c))return-e;e=-e,a=-a,c=-c}for(;;){if(h+=1,g=Math.floor(c/a),c-=g*a,d-=g*b,0>d)return-e;if(d>b)return e;if(a>c+c){if(d+d>b)return e}else{if(b>d+d)return-e;c=a-c,d=b-d,e=-e}if(0===d)return 0===c?0:-e;if(0===c)return e;if(g=Math.floor(a/c),a-=g*c,b-=g*d,0>b)return e;if(b>d)return-e;if(c>a+a){if(b+b>d)return-e}else{if(d>b+b)return e;a=c-a,b=d-b,e=-e}if(0===b)return 0===a?0:e;if(0===a)return-e}},jsts.algorithm.RobustDeterminant.orientationIndex=function(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=c.x-b.x,g=c.y-b.y;return jsts.algorithm.RobustDeterminant.signOfDet2x2(d,e,f,g)},jsts.index.quadtree.NodeBase=function(){this.subnode=new Array(4),this.subnode[0]=null,this.subnode[1]=null,this.subnode[2]=null,this.subnode[3]=null,this.items=[]},jsts.index.quadtree.NodeBase.prototype.getSubnodeIndex=function(a,b){var c=-1;return a.getMinX()>=b.x&&(a.getMinY()>=b.y&&(c=3),a.getMaxY()<=b.y&&(c=1)),a.getMaxX()<=b.x&&(a.getMinY()>=b.y&&(c=2),a.getMaxY()<=b.y&&(c=0)),c},jsts.index.quadtree.NodeBase.prototype.getItems=function(){return this.items},jsts.index.quadtree.NodeBase.prototype.hasItems=function(){return this.items.length>0},jsts.index.quadtree.NodeBase.prototype.add=function(a){this.items.push(a)},jsts.index.quadtree.NodeBase.prototype.remove=function(a,b){if(!this.isSearchMatch(a))return!1;var c=!1,d=0;for(d;4>d;d++)if(null!==this.subnode[d]&&(c=this.subnode[d].remove(a,b))){this.subnode[d].isPrunable()&&(this.subnode[d]=null);break}if(c)return c;if(-1!==this.items.indexOf(b)){for(var d=this.items.length-1;d>=0;d--)this.items[d]===b&&this.items.splice(d,1);c=!0}return c},jsts.index.quadtree.NodeBase.prototype.isPrunable=function(){return!(this.hasChildren()||this.hasItems())},jsts.index.quadtree.NodeBase.prototype.hasChildren=function(){var a=0;for(a;4>a;a++)if(null!==this.subnode[a])return!0;return!1},jsts.index.quadtree.NodeBase.prototype.isEmpty=function(){var a=!0;this.items.length>0&&(a=!1);var b=0;for(b;4>b;b++)null!==this.subnode[b]&&(this.subnode[b].isEmpty()||(a=!1));return a},jsts.index.quadtree.NodeBase.prototype.addAllItems=function(a){a=a.concat(this.items);var b=0;for(b;4>b;b++)null!==this.subnode[b]&&(a=this.subnode[b].addAllItems(a));return a},jsts.index.quadtree.NodeBase.prototype.addAllItemsFromOverlapping=function(a,b){if(this.isSearchMatch(a)){b=b.concat(this.items);var c=0;for(c;4>c;c++)null!==this.subnode[c]&&(b=this.subnode[c].addAllItemsFromOverlapping(a,b))}},jsts.index.quadtree.NodeBase.prototype.visit=function(a,b){if(this.isSearchMatch(a)){this.visitItems(a,b);var c=0;for(c;4>c;c++)null!==this.subnode[c]&&this.subnode[c].visit(a,b)}},jsts.index.quadtree.NodeBase.prototype.visitItems=function(a,b){var c=0,d=this.items.length;for(c;d>c;c++)b.visitItem(this.items[c])},jsts.index.quadtree.NodeBase.prototype.depth=function(){var a,b=0,c=0;for(c;4>c;c++)null!==this.subnode[c]&&(a=this.subnode[c].depth(),a>b&&(b=a));return b+1},jsts.index.quadtree.NodeBase.prototype.size=function(){var a=0,b=0;for(b;4>b;b++)null!==this.subnode[b]&&(a+=this.subnode[b].size());return a+this.items.length},jsts.index.quadtree.NodeBase.prototype.getNodeCount=function(){var a=0,b=0;for(b;4>b;b++)null!==this.subnode[b]&&(a+=this.subnode[b].size());return a+1},jsts.index.quadtree.Node=function(a,b){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments),this.env=a,this.level=b,this.centre=new jsts.geom.Coordinate,this.centre.x=(a.getMinX()+a.getMaxX())/2,this.centre.y=(a.getMinY()+a.getMaxY())/2},jsts.index.quadtree.Node.prototype=new jsts.index.quadtree.NodeBase,jsts.index.quadtree.Node.createNode=function(a){var b,c;return b=new jsts.index.quadtree.Key(a),c=new jsts.index.quadtree.Node(b.getEnvelope(),b.getLevel())},jsts.index.quadtree.Node.createExpanded=function(a,b){var c,d=new jsts.geom.Envelope(b);return null!==a&&d.expandToInclude(a.env),c=jsts.index.quadtree.Node.createNode(d),null!==a&&c.insertNode(a),c},jsts.index.quadtree.Node.prototype.getEnvelope=function(){return this.env},jsts.index.quadtree.Node.prototype.isSearchMatch=function(a){return this.env.intersects(a)},jsts.index.quadtree.Node.prototype.getNode=function(a){var b,c=this.getSubnodeIndex(a,this.centre);return-1!==c?(b=this.getSubnode(c),b.getNode(a)):this},jsts.index.quadtree.Node.prototype.find=function(a){var b,c=this.getSubnodeIndex(a,this.centre);return-1===c?this:null!==this.subnode[c]?(b=this.subnode[c],b.find(a)):this},jsts.index.quadtree.Node.prototype.insertNode=function(a){var b,c=this.getSubnodeIndex(a.env,this.centre);a.level===this.level-1?this.subnode[c]=a:(b=this.createSubnode(c),b.insertNode(a),this.subnode[c]=b)},jsts.index.quadtree.Node.prototype.getSubnode=function(a){return null===this.subnode[a]&&(this.subnode[a]=this.createSubnode(a)),this.subnode[a]},jsts.index.quadtree.Node.prototype.createSubnode=function(a){var b,c,d=0,e=0,f=0,g=0;switch(a){case 0:d=this.env.getMinX(),e=this.centre.x,f=this.env.getMinY(),g=this.centre.y;break;case 1:d=this.centre.x,e=this.env.getMaxX(),f=this.env.getMinY(),g=this.centre.y;break;case 2:d=this.env.getMinX(),e=this.centre.x,f=this.centre.y,g=this.env.getMaxY();break;case 3:d=this.centre.x,e=this.env.getMaxX(),f=this.centre.y,g=this.env.getMaxY()}return b=new jsts.geom.Envelope(d,e,f,g),c=new jsts.index.quadtree.Node(b,this.level-1)},function(){jsts.triangulate.quadedge.QuadEdge=function(){this.rot=null,this.vertex=null,this.next=null,this.data=null};var a=jsts.triangulate.quadedge.QuadEdge;jsts.triangulate.quadedge.QuadEdge.makeEdge=function(b,c){var d,e,f,g,h;return d=new a,e=new a,f=new a,g=new a,d.rot=e,e.rot=f,f.rot=g,g.rot=d,d.setNext(d),e.setNext(g),f.setNext(f),g.setNext(e),h=d,h.setOrig(b),h.setDest(c),h},jsts.triangulate.quadedge.QuadEdge.connect=function(b,c){var d=a.makeEdge(b.dest(),c.orig());return a.splice(d,b.lNext()),a.splice(d.sym(),c),d},jsts.triangulate.quadedge.QuadEdge.splice=function(a,b){var c,d,e,f,g,h;c=a.oNext().rot,d=b.oNext().rot,e=b.oNext(),f=a.oNext(),g=d.oNext(),h=c.oNext(),a.setNext(e),b.setNext(f),c.setNext(g),d.setNext(h)},jsts.triangulate.quadedge.QuadEdge.swap=function(b){var c,d;c=b.oPrev(),d=b.sym().oPrev(),a.splice(b,c),a.splice(b.sym(),d),a.splice(b,c.lNext()),a.splice(b.sym(),d.lNext()),b.setOrig(c.dest()),b.setDest(d.dest())},jsts.triangulate.quadedge.QuadEdge.prototype.getPrimary=function(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()},jsts.triangulate.quadedge.QuadEdge.prototype.setData=function(a){this.data=a},jsts.triangulate.quadedge.QuadEdge.prototype.getData=function(){return this.data},jsts.triangulate.quadedge.QuadEdge.prototype.delete_jsts=function(){this.rot=null},jsts.triangulate.quadedge.QuadEdge.prototype.isLive=function(){return null!==this.rot},jsts.triangulate.quadedge.QuadEdge.prototype.setNext=function(a){this.next=a},jsts.triangulate.quadedge.QuadEdge.prototype.invRot=function(){return this.rot.sym()},jsts.triangulate.quadedge.QuadEdge.prototype.sym=function(){return this.rot.rot},jsts.triangulate.quadedge.QuadEdge.prototype.oNext=function(){return this.next},jsts.triangulate.quadedge.QuadEdge.prototype.oPrev=function(){return this.rot.next.rot},jsts.triangulate.quadedge.QuadEdge.prototype.dNext=function(){return this.sym().oNext().sym()},jsts.triangulate.quadedge.QuadEdge.prototype.dPrev=function(){return this.invRot().oNext().invRot()},jsts.triangulate.quadedge.QuadEdge.prototype.lNext=function(){return this.invRot().oNext().rot},jsts.triangulate.quadedge.QuadEdge.prototype.lPrev=function(){return this.next.sym()},jsts.triangulate.quadedge.QuadEdge.prototype.rNext=function(){return this.rot.next.invRot()},jsts.triangulate.quadedge.QuadEdge.prototype.rPrev=function(){return this.sym().oNext()},jsts.triangulate.quadedge.QuadEdge.prototype.setOrig=function(a){this.vertex=a},jsts.triangulate.quadedge.QuadEdge.prototype.setDest=function(a){this.sym().setOrig(a)},jsts.triangulate.quadedge.QuadEdge.prototype.orig=function(){return this.vertex},jsts.triangulate.quadedge.QuadEdge.prototype.dest=function(){return this.sym().orig()},jsts.triangulate.quadedge.QuadEdge.prototype.getLength=function(){return this.orig().getCoordinate().distance(dest().getCoordinate())},jsts.triangulate.quadedge.QuadEdge.prototype.equalsNonOriented=function(a){return this.equalsOriented(a)?!0:this.equalsOriented(a.sym())?!0:!1},jsts.triangulate.quadedge.QuadEdge.prototype.equalsOriented=function(a){return this.orig().getCoordinate().equals2D(a.orig().getCoordinate())&&this.dest().getCoordinate().equals2D(a.dest().getCoordinate())?!0:!1},jsts.triangulate.quadedge.QuadEdge.prototype.toLineSegment=function(){return new jsts.geom.LineSegment(this.vertex.getCoordinate(),this.dest().getCoordinate())},jsts.triangulate.quadedge.QuadEdge.prototype.toString=function(){var a,b;return a=this.vertex.getCoordinate(),b=this.dest().getCoordinate(),jsts.io.WKTWriter.toLineString(a,b)}}(),function(){var a=jsts.util.Assert;jsts.geomgraph.EdgeEnd=function(a,b,c,d){this.edge=a,b&&c&&this.init(b,c),d&&(this.label=d||null)},jsts.geomgraph.EdgeEnd.prototype.edge=null,jsts.geomgraph.EdgeEnd.prototype.label=null,jsts.geomgraph.EdgeEnd.prototype.node=null,jsts.geomgraph.EdgeEnd.prototype.p0=null,jsts.geomgraph.EdgeEnd.prototype.p1=null,jsts.geomgraph.EdgeEnd.prototype.dx=null,jsts.geomgraph.EdgeEnd.prototype.dy=null,jsts.geomgraph.EdgeEnd.prototype.quadrant=null,jsts.geomgraph.EdgeEnd.prototype.init=function(b,c){this.p0=b,this.p1=c,this.dx=c.x-b.x,this.dy=c.y-b.y,this.quadrant=jsts.geomgraph.Quadrant.quadrant(this.dx,this.dy),a.isTrue(!(0===this.dx&&0===this.dy),"EdgeEnd with identical endpoints found")},jsts.geomgraph.EdgeEnd.prototype.getEdge=function(){return this.edge},jsts.geomgraph.EdgeEnd.prototype.getLabel=function(){return this.label},jsts.geomgraph.EdgeEnd.prototype.getCoordinate=function(){return this.p0},jsts.geomgraph.EdgeEnd.prototype.getDirectedCoordinate=function(){return this.p1},jsts.geomgraph.EdgeEnd.prototype.getQuadrant=function(){return this.quadrant},jsts.geomgraph.EdgeEnd.prototype.getDx=function(){return this.dx},jsts.geomgraph.EdgeEnd.prototype.getDy=function(){return this.dy},jsts.geomgraph.EdgeEnd.prototype.setNode=function(a){this.node=a},jsts.geomgraph.EdgeEnd.prototype.getNode=function(){return this.node},jsts.geomgraph.EdgeEnd.prototype.compareTo=function(a){return this.compareDirection(a)},jsts.geomgraph.EdgeEnd.prototype.compareDirection=function(a){return this.dx===a.dx&&this.dy===a.dy?0:this.quadrant>a.quadrant?1:this.quadrant<a.quadrant?-1:jsts.algorithm.CGAlgorithms.computeOrientation(a.p0,a.p1,this.p1)},jsts.geomgraph.EdgeEnd.prototype.computeLabel=function(a){}}(),jsts.operation.buffer.RightmostEdgeFinder=function(){},jsts.operation.buffer.RightmostEdgeFinder.prototype.minIndex=-1,jsts.operation.buffer.RightmostEdgeFinder.prototype.minCoord=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.minDe=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.orientedDe=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.getEdge=function(){return this.orientedDe},jsts.operation.buffer.RightmostEdgeFinder.prototype.getCoordinate=function(){return this.minCoord},jsts.operation.buffer.RightmostEdgeFinder.prototype.findEdge=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();c.isForward()&&this.checkForRightmostCoordinate(c)}jsts.util.Assert.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;var d=this.getRightmostSide(this.minDe,this.minIndex);d==jsts.geomgraph.Position.LEFT&&(this.orientedDe=this.minDe.getSym())},jsts.operation.buffer.RightmostEdgeFinder.prototype.findRightmostEdgeAtNode=function(){var a=this.minDe.getNode(),b=a.getEdges();this.minDe=b.getRightmostEdge(),this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},jsts.operation.buffer.RightmostEdgeFinder.prototype.findRightmostEdgeAtVertex=function(){var a=this.minDe.getEdge().getCoordinates();jsts.util.Assert.isTrue(this.minIndex>0&&this.minIndex<a.length,"rightmost point expected to be interior vertex of edge");var b=a[this.minIndex-1],c=a[this.minIndex+1],d=jsts.algorithm.CGAlgorithms.computeOrientation(this.minCoord,c,b),e=!1;b.y<this.minCoord.y&&c.y<this.minCoord.y&&d===jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE?e=!0:b.y>this.minCoord.y&&c.y>this.minCoord.y&&d===jsts.algorithm.CGAlgorithms.CLOCKWISE&&(e=!0),e&&(this.minIndex=this.minIndex-1)},jsts.operation.buffer.RightmostEdgeFinder.prototype.checkForRightmostCoordinate=function(a){for(var b=a.getEdge().getCoordinates(),c=0;c<b.length-1;c++)(null===this.minCoord||b[c].x>this.minCoord.x)&&(this.minDe=a,this.minIndex=c,this.minCoord=b[c])},jsts.operation.buffer.RightmostEdgeFinder.prototype.getRightmostSide=function(a,b){var c=this.getRightmostSideOfSegment(a,b);return 0>c&&(c=this.getRightmostSideOfSegment(a,b-1)),0>c&&(this.minCoord=null,this.checkForRightmostCoordinate(a)),c},jsts.operation.buffer.RightmostEdgeFinder.prototype.getRightmostSideOfSegment=function(a,b){var c=a.getEdge(),d=c.getCoordinates();if(0>b||b+1>=d.length)return-1;if(d[b].y==d[b+1].y)return-1;var e=jsts.geomgraph.Position.LEFT;return d[b].y<d[b+1].y&&(e=jsts.geomgraph.Position.RIGHT),e},function(){jsts.triangulate.IncrementalDelaunayTriangulator=function(a){this.subdiv=a,this.isUsingTolerance=a.getTolerance()>0},jsts.triangulate.IncrementalDelaunayTriangulator.prototype.insertSites=function(a){var b,c=0,d=a.length;for(c;d>c;c++)b=a[c],this.insertSite(b)},jsts.triangulate.IncrementalDelaunayTriangulator.prototype.insertSite=function(a){var b,c,d,e;if(b=this.subdiv.locate(a),this.subdiv.isVertexOfEdge(b,a))return b;this.subdiv.isOnEdge(b,a.getCoordinate())&&(b=b.oPrev(),this.subdiv.delete_jsts(b.oNext())),c=this.subdiv.makeEdge(b.orig(),a),jsts.triangulate.quadedge.QuadEdge.splice(c,b),d=c;do c=this.subdiv.connect(b,c.sym()),b=c.oPrev();while(b.lNext()!=d);for(;;)if(e=b.oPrev(),e.dest().rightOf(b)&&a.isInCircle(b.orig(),e.dest(),b.dest()))jsts.triangulate.quadedge.QuadEdge.swap(b),b=b.oPrev();else{if(b.oNext()==d)return c;b=b.oNext().lPrev()}}}(),jsts.algorithm.CentroidArea=function(){this.basePt=null,this.triangleCent3=new jsts.geom.Coordinate,this.centSum=new jsts.geom.Coordinate,this.cg3=new jsts.geom.Coordinate},jsts.algorithm.CentroidArea.prototype.basePt=null,jsts.algorithm.CentroidArea.prototype.triangleCent3=null,jsts.algorithm.CentroidArea.prototype.areasum2=0,jsts.algorithm.CentroidArea.prototype.cg3=null,jsts.algorithm.CentroidArea.prototype.centSum=null,jsts.algorithm.CentroidArea.prototype.totalLength=0,jsts.algorithm.CentroidArea.prototype.add=function(a){if(a instanceof jsts.geom.Polygon){var b=a;this.setBasePoint(b.getExteriorRing().getCoordinateN(0)),this.add3(b)}else if(a instanceof jsts.geom.GeometryCollection||a instanceof jsts.geom.MultiPolygon)for(var c=a,d=0;d<c.getNumGeometries();d++)this.add(c.getGeometryN(d));else a instanceof Array&&this.add2(a)},jsts.algorithm.CentroidArea.prototype.add2=function(a){this.setBasePoint(a[0]),this.addShell(a)},jsts.algorithm.CentroidArea.prototype.getCentroid=function(){var a=new jsts.geom.Coordinate;return Math.abs(this.areasum2)>0?(a.x=this.cg3.x/3/this.areasum2,a.y=this.cg3.y/3/this.areasum2):(a.x=this.centSum.x/this.totalLength,a.y=this.centSum.y/this.totalLength),a},jsts.algorithm.CentroidArea.prototype.setBasePoint=function(a){null==this.basePt&&(this.basePt=a)},jsts.algorithm.CentroidArea.prototype.add3=function(a){this.addShell(a.getExteriorRing().getCoordinates());for(var b=0;b<a.getNumInteriorRing();b++)this.addHole(a.getInteriorRingN(b).getCoordinates())},jsts.algorithm.CentroidArea.prototype.addShell=function(a){for(var b=!jsts.algorithm.CGAlgorithms.isCCW(a),c=0;c<a.length-1;c++)this.addTriangle(this.basePt,a[c],a[c+1],b);this.addLinearSegments(a)},jsts.algorithm.CentroidArea.prototype.addHole=function(a){for(var b=jsts.algorithm.CGAlgorithms.isCCW(a),c=0;c<a.length-1;c++)this.addTriangle(this.basePt,a[c],a[c+1],b);this.addLinearSegments(a)},jsts.algorithm.CentroidArea.prototype.addTriangle=function(a,b,c,d){var e=d?1:-1;jsts.algorithm.CentroidArea.centroid3(a,b,c,this.triangleCent3);var f=jsts.algorithm.CentroidArea.area2(a,b,c);this.cg3.x+=e*f*this.triangleCent3.x,this.cg3.y+=e*f*this.triangleCent3.y,this.areasum2+=e*f},jsts.algorithm.CentroidArea.centroid3=function(a,b,c,d){d.x=a.x+b.x+c.x,d.y=a.y+b.y+c.y},jsts.algorithm.CentroidArea.area2=function(a,b,c){return(b.x-a.x)*(c.y-a.y)-(c.x-a.x)*(b.y-a.y)},jsts.algorithm.CentroidArea.prototype.addLinearSegments=function(a){for(var b=0;b<a.length-1;b++){var c=a[b].distance(a[b+1]);this.totalLength+=c;var d=(a[b].x+a[b+1].x)/2;this.centSum.x+=c*d;var e=(a[b].y+a[b+1].y)/2;this.centSum.y+=c*e}},jsts.geomgraph.index.SweepLineSegment=function(a,b){this.edge=a,this.ptIndex=b,this.pts=a.getCoordinates()},jsts.geomgraph.index.SweepLineSegment.prototype.edge=null,jsts.geomgraph.index.SweepLineSegment.prototype.pts=null,jsts.geomgraph.index.SweepLineSegment.prototype.ptIndex=null,jsts.geomgraph.index.SweepLineSegment.prototype.getMinX=function(){var a=this.pts[this.ptIndex].x,b=this.pts[this.ptIndex+1].x;return b>a?a:b},jsts.geomgraph.index.SweepLineSegment.prototype.getMaxX=function(){var a=this.pts[this.ptIndex].x,b=this.pts[this.ptIndex+1].x;return a>b?a:b},jsts.geomgraph.index.SweepLineSegment.prototype.computeIntersections=function(a,b){b.addIntersections(this.edge,this.ptIndex,a.edge,a.ptIndex)},jsts.index.quadtree.Root=function(){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments),this.origin=new jsts.geom.Coordinate(0,0)},jsts.index.quadtree.Root.prototype=new jsts.index.quadtree.NodeBase,jsts.index.quadtree.Root.prototype.insert=function(a,b){var c=this.getSubnodeIndex(a,this.origin);if(-1===c)return void this.add(b);var d=this.subnode[c];if(null===d||!d.getEnvelope().contains(a)){var e=jsts.index.quadtree.Node.createExpanded(d,a);this.subnode[c]=e}this.insertContained(this.subnode[c],a,b)},jsts.index.quadtree.Root.prototype.insertContained=function(a,b,c){var d,e,f;d=jsts.index.IntervalSize.isZeroWidth(b.getMinX(),b.getMaxX()),e=jsts.index.IntervalSize.isZeroWidth(b.getMinY(),b.getMaxY()),f=d||e?a.find(b):a.getNode(b),f.add(c)},jsts.index.quadtree.Root.prototype.isSearchMatch=function(a){return!0},jsts.geomgraph.index.MonotoneChainIndexer=function(){},jsts.geomgraph.index.MonotoneChainIndexer.toIntArray=function(a){for(var b=[],c=a.iterator();c.hasNext();){var d=c.next();b.push(d)}return b},jsts.geomgraph.index.MonotoneChainIndexer.prototype.getChainStartIndices=function(a){var b=0,c=new javascript.util.ArrayList;c.add(b);do{var d=this.findChainEnd(a,b);c.add(d),b=d}while(b<a.length-1);var e=jsts.geomgraph.index.MonotoneChainIndexer.toIntArray(c);return e},jsts.geomgraph.index.MonotoneChainIndexer.prototype.findChainEnd=function(a,b){for(var c=jsts.geomgraph.Quadrant.quadrant(a[b],a[b+1]),d=b+1;d<a.length;){var e=jsts.geomgraph.Quadrant.quadrant(a[d-1],a[d]);if(e!=c)break;d++}return d-1},jsts.noding.IntersectionAdder=function(a){this.li=a},jsts.noding.IntersectionAdder.prototype=new jsts.noding.SegmentIntersector,jsts.noding.IntersectionAdder.constructor=jsts.noding.IntersectionAdder,jsts.noding.IntersectionAdder.isAdjacentSegments=function(a,b){return 1===Math.abs(a-b)},jsts.noding.IntersectionAdder.prototype._hasIntersection=!1,jsts.noding.IntersectionAdder.prototype.hasProper=!1,jsts.noding.IntersectionAdder.prototype.hasProperInterior=!1,jsts.noding.IntersectionAdder.prototype.hasInterior=!1,jsts.noding.IntersectionAdder.prototype.properIntersectionPoint=null,jsts.noding.IntersectionAdder.prototype.li=null,jsts.noding.IntersectionAdder.prototype.isSelfIntersection=null,jsts.noding.IntersectionAdder.prototype.numIntersections=0,jsts.noding.IntersectionAdder.prototype.numInteriorIntersections=0,jsts.noding.IntersectionAdder.prototype.numProperIntersections=0,jsts.noding.IntersectionAdder.prototype.numTests=0,jsts.noding.IntersectionAdder.prototype.getLineIntersector=function(){return this.li},jsts.noding.IntersectionAdder.prototype.getProperIntersectionPoint=function(){return this.properIntersectionPoint},jsts.noding.IntersectionAdder.prototype.hasIntersection=function(){return this._hasIntersection},jsts.noding.IntersectionAdder.prototype.hasProperIntersection=function(){return this.hasProper},jsts.noding.IntersectionAdder.prototype.hasProperInteriorIntersection=function(){return this.hasProperInterior},jsts.noding.IntersectionAdder.prototype.hasInteriorIntersection=function(){return this.hasInterior},jsts.noding.IntersectionAdder.prototype.isTrivialIntersection=function(a,b,c,d){if(a==c&&1==this.li.getIntersectionNum()){if(jsts.noding.IntersectionAdder.isAdjacentSegments(b,d))return!0;if(a.isClosed()){var e=a.size()-1;if(0===b&&d===e||0===d&&b===e)return!0}}return!1},jsts.noding.IntersectionAdder.prototype.processIntersections=function(a,b,c,d){if(a!==c||b!==d){this.numTests++;var e=a.getCoordinates()[b],f=a.getCoordinates()[b+1],g=c.getCoordinates()[d],h=c.getCoordinates()[d+1];this.li.computeIntersection(e,f,g,h),this.li.hasIntersection()&&(this.numIntersections++,this.li.isInteriorIntersection()&&(this.numInteriorIntersections++,this.hasInterior=!0),this.isTrivialIntersection(a,b,c,d)||(this._hasIntersection=!0,a.addIntersections(this.li,b,0),c.addIntersections(this.li,d,1),this.li.isProper()&&(this.numProperIntersections++,this.hasProper=!0,this.hasProperInterior=!0)))}},jsts.noding.IntersectionAdder.prototype.isDone=function(){return!1},jsts.operation.union.CascadedPolygonUnion=function(a){this.inputPolys=a},jsts.operation.union.CascadedPolygonUnion.union=function(a){var b=new jsts.operation.union.CascadedPolygonUnion(a);return b.union()},jsts.operation.union.CascadedPolygonUnion.prototype.inputPolys,jsts.operation.union.CascadedPolygonUnion.prototype.geomFactory=null,jsts.operation.union.CascadedPolygonUnion.prototype.STRTREE_NODE_CAPACITY=4,jsts.operation.union.CascadedPolygonUnion.prototype.union=function(){
  if(0===this.inputPolys.length)return null;this.geomFactory=this.inputPolys[0].getFactory();for(var a=new jsts.index.strtree.STRtree(this.STRTREE_NODE_CAPACITY),b=0,c=this.inputPolys.length;c>b;b++){var d=this.inputPolys[b];a.insert(d.getEnvelopeInternal(),d)}var e=a.itemsTree(),f=this.unionTree(e);return f},jsts.operation.union.CascadedPolygonUnion.prototype.unionTree=function(a){var b=this.reduceToGeometries(a),c=this.binaryUnion(b);return c},jsts.operation.union.CascadedPolygonUnion.prototype.binaryUnion=function(a,b,c){if(b=b||0,c=c||a.length,1>=c-b){var d=this.getGeometry(a,b);return this.unionSafe(d,null)}if(c-b===2)return this.unionSafe(this.getGeometry(a,b),this.getGeometry(a,b+1));var e=parseInt((c+b)/2),d=this.binaryUnion(a,b,e),f=this.binaryUnion(a,e,c);return this.unionSafe(d,f)},jsts.operation.union.CascadedPolygonUnion.prototype.getGeometry=function(a,b){return b>=a.length?null:a[b]},jsts.operation.union.CascadedPolygonUnion.prototype.reduceToGeometries=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=null;e instanceof Array?f=this.unionTree(e):e instanceof jsts.geom.Geometry&&(f=e),b.push(f)}return b},jsts.operation.union.CascadedPolygonUnion.prototype.unionSafe=function(a,b){return null===a&&null===b?null:null===a?b.clone():null===b?a.clone():this.unionOptimized(a,b)},jsts.operation.union.CascadedPolygonUnion.prototype.unionOptimized=function(a,b){var c=a.getEnvelopeInternal(),d=b.getEnvelopeInternal();if(!c.intersects(d)){var e=jsts.geom.util.GeometryCombiner.combine(a,b);return e}if(a.getNumGeometries<=1&&b.getNumGeometries<=1)return this.unionActual(a,b);var f=c.intersection(d);return this.unionUsingEnvelopeIntersection(a,b,f)},jsts.operation.union.CascadedPolygonUnion.prototype.unionUsingEnvelopeIntersection=function(a,b,c){var d=new javascript.util.ArrayList,e=this.extractByEnvelope(c,a,d),f=this.extractByEnvelope(c,b,d),g=this.unionActual(e,f);d.add(g);var h=jsts.geom.util.GeometryCombiner.combine(d);return h},jsts.operation.union.CascadedPolygonUnion.prototype.extractByEnvelope=function(a,b,c){for(var d=new javascript.util.ArrayList,e=0;e<b.getNumGeometries();e++){var f=b.getGeometryN(e);f.getEnvelopeInternal().intersects(a)?d.add(f):c.add(f)}return this.geomFactory.buildGeometry(d)},jsts.operation.union.CascadedPolygonUnion.prototype.unionActual=function(a,b){return a.union(b)},function(){jsts.geom.MultiPoint=function(a,b){this.geometries=a||[],this.factory=b},jsts.geom.MultiPoint.prototype=new jsts.geom.GeometryCollection,jsts.geom.MultiPoint.constructor=jsts.geom.MultiPoint,jsts.geom.MultiPoint.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},jsts.geom.MultiPoint.prototype.getGeometryN=function(a){return this.geometries[a]},jsts.geom.MultiPoint.prototype.equalsExact=function(a,b){return this.isEquivalentClass(a)?jsts.geom.GeometryCollection.prototype.equalsExact.call(this,a,b):!1},jsts.geom.MultiPoint.prototype.CLASS_NAME="jsts.geom.MultiPoint"}(),jsts.operation.buffer.OffsetCurveBuilder=function(a,b){this.precisionModel=a,this.bufParams=b},jsts.operation.buffer.OffsetCurveBuilder.prototype.distance=0,jsts.operation.buffer.OffsetCurveBuilder.prototype.precisionModel=null,jsts.operation.buffer.OffsetCurveBuilder.prototype.bufParams=null,jsts.operation.buffer.OffsetCurveBuilder.prototype.getBufferParameters=function(){return this.bufParams},jsts.operation.buffer.OffsetCurveBuilder.prototype.getLineCurve=function(a,b){if(this.distance=b,this.distance<0&&!this.bufParams.isSingleSided())return null;if(0==this.distance)return null;var c=Math.abs(this.distance),d=this.getSegGen(c);if(a.length<=1)this.computePointCurve(a[0],d);else if(this.bufParams.isSingleSided()){var e=0>b;this.computeSingleSidedBufferCurve(a,e,d)}else this.computeLineBufferCurve(a,d);var f=d.getCoordinates();return f},jsts.operation.buffer.OffsetCurveBuilder.prototype.getRingCurve=function(a,b,c){if(this.distance=c,a.length<=2)return this.getLineCurve(a,c);if(0==this.distance)return jsts.operation.buffer.OffsetCurveBuilder.copyCoordinates(a);var d=this.getSegGen(this.distance);return this.computeRingBufferCurve(a,b,d),d.getCoordinates()},jsts.operation.buffer.OffsetCurveBuilder.prototype.getOffsetCurve=function(a,b){if(this.distance=b,0===this.distance)return null;var c=this.distance<0,d=Math.abs(this.distance),e=this.getSegGen(d);a.length<=1?this.computePointCurve(a[0],e):this.computeOffsetCurve(a,c,e);var f=e.getCoordinates();return c&&f.reverse(),f},jsts.operation.buffer.OffsetCurveBuilder.copyCoordinates=function(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c].clone());return b},jsts.operation.buffer.OffsetCurveBuilder.prototype.getSegGen=function(a){return new jsts.operation.buffer.OffsetSegmentGenerator(this.precisionModel,this.bufParams,a)},jsts.operation.buffer.OffsetCurveBuilder.SIMPLIFY_FACTOR=100,jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance=function(a){return a/jsts.operation.buffer.OffsetCurveBuilder.SIMPLIFY_FACTOR},jsts.operation.buffer.OffsetCurveBuilder.prototype.computePointCurve=function(a,b){switch(this.bufParams.getEndCapStyle()){case jsts.operation.buffer.BufferParameters.CAP_ROUND:b.createCircle(a);break;case jsts.operation.buffer.BufferParameters.CAP_SQUARE:b.createSquare(a)}},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeLineBufferCurve=function(a,b){var c=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance),d=jsts.operation.buffer.BufferInputLineSimplifier.simplify(a,c),e=d.length-1;b.initSideSegments(d[0],d[1],jsts.geomgraph.Position.LEFT);for(var f=2;e>=f;f++)b.addNextSegment(d[f],!0);b.addLastSegment(),b.addLineEndCap(d[e-1],d[e]);var g=jsts.operation.buffer.BufferInputLineSimplifier.simplify(a,-c),h=g.length-1;b.initSideSegments(g[h],g[h-1],jsts.geomgraph.Position.LEFT);for(var f=h-2;f>=0;f--)b.addNextSegment(g[f],!0);b.addLastSegment(),b.addLineEndCap(g[1],g[0]),b.closeRing()},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeSingleSidedBufferCurve=function(a,b,c){var d=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance);if(b){c.addSegments(a,!0);var e=jsts.operation.buffer.BufferInputLineSimplifier.simplify(a,-d),f=e.length-1;c.initSideSegments(e[f],e[f-1],jsts.geomgraph.Position.LEFT),c.addFirstSegment();for(var g=f-2;g>=0;g--)c.addNextSegment(e[g],!0)}else{c.addSegments(a,!1);var h=jsts.operation.buffer.BufferInputLineSimplifier.simplify(a,d),i=h.length-1;c.initSideSegments(h[0],h[1],jsts.geomgraph.Position.LEFT),c.addFirstSegment();for(var g=2;i>=g;g++)c.addNextSegment(h[g],!0)}c.addLastSegment(),c.closeRing()},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeOffsetCurve=function(a,b,c){var d=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance);if(b){var e=jsts.operation.buffer.BufferInputLineSimplifier.simplify(a,-d),f=e.length-1;c.initSideSegments(e[f],e[f-1],jsts.geomgraph.Position.LEFT),c.addFirstSegment();for(var g=f-2;g>=0;g--)c.addNextSegment(e[g],!0)}else{var h=jsts.operation.buffer.BufferInputLineSimplifier.simplify(a,d),i=h.length-1;c.initSideSegments(h[0],h[1],jsts.geomgraph.Position.LEFT),c.addFirstSegment();for(var g=2;i>=g;g++)c.addNextSegment(h[g],!0)}c.addLastSegment()},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeRingBufferCurve=function(a,b,c){var d=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance);b===jsts.geomgraph.Position.RIGHT&&(d=-d);var e=jsts.operation.buffer.BufferInputLineSimplifier.simplify(a,d),f=e.length-1;c.initSideSegments(e[f-1],e[0],b);for(var g=1;f>=g;g++){var h=1!==g;c.addNextSegment(e[g],h)}c.closeRing()},function(){var a=function(a,b,c){this.hotPixel=a,this.parentEdge=b,this.vertexIndex=c};a.prototype=new jsts.index.chain.MonotoneChainSelectAction,a.constructor=a,a.prototype.hotPixel=null,a.prototype.parentEdge=null,a.prototype.vertexIndex=null,a.prototype._isNodeAdded=!1,a.prototype.isNodeAdded=function(){return this._isNodeAdded},a.prototype.select=function(a,b){var c=a.getContext();(null===this.parentEdge||c!==this.parentEdge||b!==this.vertexIndex)&&(this._isNodeAdded=this.hotPixel.addSnappedNode(c,b))},jsts.noding.snapround.MCIndexPointSnapper=function(a){this.index=a},jsts.noding.snapround.MCIndexPointSnapper.prototype.index=null,jsts.noding.snapround.MCIndexPointSnapper.prototype.snap=function(b,c,d){if(1===arguments.length)return void this.snap2.apply(this,arguments);var e=b.getSafeEnvelope(),f=new a(b,c,d);return this.index.query(e,{visitItem:function(a){a.select(e,f)}}),f.isNodeAdded()},jsts.noding.snapround.MCIndexPointSnapper.prototype.snap2=function(a){return this.snap(a,null,-1)}}(),function(){var a=function(){this.items=new javascript.util.ArrayList,this.subnode=[null,null]};a.getSubnodeIndex=function(a,b){var c=-1;return a.min>=b&&(c=1),a.max<=b&&(c=0),c},a.prototype.getItems=function(){return this.items},a.prototype.add=function(a){this.items.add(a)},a.prototype.addAllItems=function(a){a.addAll(this.items);var b=0,c=2;for(b;c>b;b++)null!==this.subnode[b]&&this.subnode[b].addAllItems(a);return a},a.prototype.addAllItemsFromOverlapping=function(a,b){(null===a||this.isSearchMatch(a))&&(b.addAll(this.items),null!==this.subnode[0]&&this.subnode[0].addAllItemsFromOverlapping(a,b),null!==this.subnode[1]&&this.subnode[1].addAllItemsFromOverlapping(a,b))},a.prototype.remove=function(a,b){if(!this.isSearchMatch(a))return!1;var c=!1,d=0,e=2;for(d;e>d;d++)if(null!==this.subnode[d]&&(c=this.subnode[d].remove(a,b))){this.subnode[d].isPrunable()&&(this.subnode[d]=null);break}return c?c:c=this.items.remove(b)},a.prototype.isPrunable=function(){return!(this.hasChildren()||this.hasItems())},a.prototype.hasChildren=function(){var a=0,b=2;for(a;b>a;a++)if(null!==this.subnode[a])return!0;return!1},a.prototype.hasItems=function(){return!this.items.isEmpty()},a.prototype.depth=function(){var a,b=0,c=0,d=2;for(c;d>c;c++)null!==this.subnode[c]&&(a=this.subnode[c].depth(),a>b&&(b=a));return b+1},a.prototype.size=function(){var a=0,b=0,c=2;for(b;c>b;b++)null!==this.subnode[b]&&(a+=this.subnode[b].size());return a+this.items.size()},a.prototype.nodeSize=function(){var a=0,b=0,c=2;for(b;c>b;b++)null!==this.subnode[b]&&(a+=this.subnode[b].nodeSize());return a+1},jsts.index.bintree.NodeBase=a}(),function(){var a=jsts.index.bintree.NodeBase,b=jsts.index.bintree.Key,c=jsts.index.bintree.Interval,d=function(a,b){this.items=new javascript.util.ArrayList,this.subnode=[null,null],this.interval=a,this.level=b,this.centre=(a.getMin()+a.getMax())/2};d.prototype=new a,d.constructor=d,d.createNode=function(a){var c,e;return c=new b(a),e=new d(c.getInterval(),c.getLevel())},d.createExpanded=function(a,b){var e,f;return e=new c(b),null!==a&&e.expandToInclude(a.interval),f=d.createNode(e),null!==a&&f.insert(a),f},d.prototype.getInterval=function(){return this.interval},d.prototype.isSearchMatch=function(a){return a.overlaps(this.interval)},d.prototype.getNode=function(b){var c,d=a.getSubnodeIndex(b,this.centre);return-1!=d?(c=this.getSubnode(d),c.getNode(b)):this},d.prototype.find=function(b){var c,d=a.getSubnodeIndex(b,this.centre);return-1===d?this:null!==this.subnode[d]?(c=this.subnode[d],c.find(b)):this},d.prototype.insert=function(b){var c,d=a.getSubnodeIndex(b.interval,this.centre);b.level===this.level-1?this.subnode[d]=b:(c=this.createSubnode(d),c.insert(b),this.subnode[d]=c)},d.prototype.getSubnode=function(a){return null===this.subnode[a]&&(this.subnode[a]=this.createSubnode(a)),this.subnode[a]},d.prototype.createSubnode=function(a){var b,e,f,g;switch(b=0,e=0,a){case 0:b=this.interval.getMin(),e=this.centre;break;case 1:b=this.centre,e=this.interval.getMax()}return f=new c(b,e),g=new d(f,this.level-1)},jsts.index.bintree.Node=d}(),function(){var a=jsts.index.bintree.Node,b=jsts.index.bintree.NodeBase,c=function(){this.subnode=[null,null],this.items=new javascript.util.ArrayList};c.prototype=new jsts.index.bintree.NodeBase,c.constructor=c,c.origin=0,c.prototype.insert=function(d,e){var f,g,h=b.getSubnodeIndex(d,c.origin);return-1===h?void this.add(e):(f=this.subnode[h],null!==f&&f.getInterval().contains(d)||(g=a.createExpanded(f,d),this.subnode[h]=g),void this.insertContained(this.subnode[h],d,e))},c.prototype.insertContained=function(a,b,c){var d,e;d=jsts.index.IntervalSize.isZeroWidth(b.getMin(),b.getMax()),e=d?a.find(b):a.getNode(b),e.add(c)},c.prototype.isSearchMatch=function(a){return!0},jsts.index.bintree.Root=c}(),jsts.geomgraph.Quadrant=function(){},jsts.geomgraph.Quadrant.NE=0,jsts.geomgraph.Quadrant.NW=1,jsts.geomgraph.Quadrant.SW=2,jsts.geomgraph.Quadrant.SE=3,jsts.geomgraph.Quadrant.quadrant=function(a,b){if(a instanceof jsts.geom.Coordinate)return jsts.geomgraph.Quadrant.quadrant2.apply(this,arguments);if(0===a&&0===b)throw new jsts.error.IllegalArgumentError("Cannot compute the quadrant for point ( "+a+", "+b+" )");return a>=0?b>=0?jsts.geomgraph.Quadrant.NE:jsts.geomgraph.Quadrant.SE:b>=0?jsts.geomgraph.Quadrant.NW:jsts.geomgraph.Quadrant.SW},jsts.geomgraph.Quadrant.quadrant2=function(a,b){if(b.x===a.x&&b.y===a.y)throw new jsts.error.IllegalArgumentError("Cannot compute the quadrant for two identical points "+a);return b.x>=a.x?b.y>=a.y?jsts.geomgraph.Quadrant.NE:jsts.geomgraph.Quadrant.SE:b.y>=a.y?jsts.geomgraph.Quadrant.NW:jsts.geomgraph.Quadrant.SW},jsts.geomgraph.Quadrant.isOpposite=function(a,b){if(a===b)return!1;var c=(a-b+4)%4;return 2===c?!0:!1},jsts.geomgraph.Quadrant.commonHalfPlane=function(a,b){if(a===b)return a;var c=(a-b+4)%4;if(2===c)return-1;var d=b>a?a:b,e=a>b?a:b;return 0===d&&3===e?3:d},jsts.geomgraph.Quadrant.isInHalfPlane=function(a,b){return b===jsts.geomgraph.Quadrant.SE?a===jsts.geomgraph.Quadrant.SE||a===jsts.geomgraph.Quadrant.SW:a===b||a===b+1},jsts.geomgraph.Quadrant.isNorthern=function(a){return a===jsts.geomgraph.Quadrant.NE||a===jsts.geomgraph.Quadrant.NW},jsts.operation.valid.ConsistentAreaTester=function(a){this.geomGraph=a,this.li=new jsts.algorithm.RobustLineIntersector,this.nodeGraph=new jsts.operation.relate.RelateNodeGraph,this.invalidPoint=null},jsts.operation.valid.ConsistentAreaTester.prototype.getInvalidPoint=function(){return this.invalidPoint},jsts.operation.valid.ConsistentAreaTester.prototype.isNodeConsistentArea=function(){var a=this.geomGraph.computeSelfNodes(this.li,!0);return a.hasProperIntersection()?(this.invalidPoint=a.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},jsts.operation.valid.ConsistentAreaTester.prototype.isNodeEdgeAreaLabelsConsistent=function(){for(var a=this.nodeGraph.getNodeIterator();a.hasNext();){var b=a.next();if(!b.getEdges().isAreaLabelsConsistent(this.geomGraph))return this.invalidPoint=b.getCoordinate().clone(),!1}return!0},jsts.operation.valid.ConsistentAreaTester.prototype.hasDuplicateRings=function(){for(var a=this.nodeGraph.getNodeIterator();a.hasNext();)for(var b=a.next(),c=b.getEdges().iterator();c.hasNext();){var d=c.next();if(d.getEdgeEnds().length>1)return invalidPoint=d.getEdge().getCoordinate(0),!0}return!1},jsts.operation.relate.RelateNode=function(a,b){jsts.geomgraph.Node.apply(this,arguments)},jsts.operation.relate.RelateNode.prototype=new jsts.geomgraph.Node,jsts.operation.relate.RelateNode.prototype.computeIM=function(a){a.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},jsts.operation.relate.RelateNode.prototype.updateIMFromEdges=function(a){this.edges.updateIM(a)},function(){var a=jsts.geom.Location,b=jsts.geomgraph.Position,c=jsts.geomgraph.EdgeEnd;jsts.geomgraph.DirectedEdge=function(a,b){if(c.call(this,a),this.depth=[0,-999,-999],this._isForward=b,b)this.init(a.getCoordinate(0),a.getCoordinate(1));else{var d=a.getNumPoints()-1;this.init(a.getCoordinate(d),a.getCoordinate(d-1))}this.computeDirectedLabel()},jsts.geomgraph.DirectedEdge.prototype=new c,jsts.geomgraph.DirectedEdge.constructor=jsts.geomgraph.DirectedEdge,jsts.geomgraph.DirectedEdge.depthFactor=function(b,c){return b===a.EXTERIOR&&c===a.INTERIOR?1:b===a.INTERIOR&&c===a.EXTERIOR?-1:0},jsts.geomgraph.DirectedEdge.prototype._isForward=null,jsts.geomgraph.DirectedEdge.prototype._isInResult=!1,jsts.geomgraph.DirectedEdge.prototype._isVisited=!1,jsts.geomgraph.DirectedEdge.prototype.sym=null,jsts.geomgraph.DirectedEdge.prototype.next=null,jsts.geomgraph.DirectedEdge.prototype.nextMin=null,jsts.geomgraph.DirectedEdge.prototype.edgeRing=null,jsts.geomgraph.DirectedEdge.prototype.minEdgeRing=null,jsts.geomgraph.DirectedEdge.prototype.depth=null,jsts.geomgraph.DirectedEdge.prototype.getEdge=function(){return this.edge},jsts.geomgraph.DirectedEdge.prototype.setInResult=function(a){this._isInResult=a},jsts.geomgraph.DirectedEdge.prototype.isInResult=function(){return this._isInResult},jsts.geomgraph.DirectedEdge.prototype.isVisited=function(){return this._isVisited},jsts.geomgraph.DirectedEdge.prototype.setVisited=function(a){this._isVisited=a},jsts.geomgraph.DirectedEdge.prototype.setEdgeRing=function(a){this.edgeRing=a},jsts.geomgraph.DirectedEdge.prototype.getEdgeRing=function(){return this.edgeRing},jsts.geomgraph.DirectedEdge.prototype.setMinEdgeRing=function(a){this.minEdgeRing=a},jsts.geomgraph.DirectedEdge.prototype.getMinEdgeRing=function(){return this.minEdgeRing},jsts.geomgraph.DirectedEdge.prototype.getDepth=function(a){return this.depth[a]},jsts.geomgraph.DirectedEdge.prototype.setDepth=function(a,b){if(-999!==this.depth[a]&&this.depth[a]!==b)throw new jsts.error.TopologyError("assigned depths do not match",this.getCoordinate());this.depth[a]=b},jsts.geomgraph.DirectedEdge.prototype.getDepthDelta=function(){var a=this.edge.getDepthDelta();return this._isForward||(a=-a),a},jsts.geomgraph.DirectedEdge.prototype.setVisitedEdge=function(a){this.setVisited(a),this.sym.setVisited(a)},jsts.geomgraph.DirectedEdge.prototype.getSym=function(){return this.sym},jsts.geomgraph.DirectedEdge.prototype.isForward=function(){return this._isForward},jsts.geomgraph.DirectedEdge.prototype.setSym=function(a){this.sym=a},jsts.geomgraph.DirectedEdge.prototype.getNext=function(){return this.next},jsts.geomgraph.DirectedEdge.prototype.setNext=function(a){this.next=a},jsts.geomgraph.DirectedEdge.prototype.getNextMin=function(){return this.nextMin},jsts.geomgraph.DirectedEdge.prototype.setNextMin=function(a){this.nextMin=a},jsts.geomgraph.DirectedEdge.prototype.isLineEdge=function(){var b=this.label.isLine(0)||this.label.isLine(1),c=!this.label.isArea(0)||this.label.allPositionsEqual(0,a.EXTERIOR),d=!this.label.isArea(1)||this.label.allPositionsEqual(1,a.EXTERIOR);return b&&c&&d},jsts.geomgraph.DirectedEdge.prototype.isInteriorAreaEdge=function(){for(var c=!0,d=0;2>d;d++)this.label.isArea(d)&&this.label.getLocation(d,b.LEFT)===a.INTERIOR&&this.label.getLocation(d,b.RIGHT)===a.INTERIOR||(c=!1);return c},jsts.geomgraph.DirectedEdge.prototype.computeDirectedLabel=function(){this.label=new jsts.geomgraph.Label(this.edge.getLabel()),this._isForward||this.label.flip()},jsts.geomgraph.DirectedEdge.prototype.setEdgeDepths=function(a,c){var d=this.getEdge().getDepthDelta();this._isForward||(d=-d);var e=1;a===b.LEFT&&(e=-1);var f=b.opposite(a),g=d*e,h=c+g;this.setDepth(a,c),this.setDepth(f,h)}}(),jsts.operation.distance.DistanceOp=function(a,b,c){this.ptLocator=new jsts.algorithm.PointLocator,this.geom=[],this.geom[0]=a,this.geom[1]=b,this.terminateDistance=c},jsts.operation.distance.DistanceOp.prototype.geom=null,jsts.operation.distance.DistanceOp.prototype.terminateDistance=0,jsts.operation.distance.DistanceOp.prototype.ptLocator=null,jsts.operation.distance.DistanceOp.prototype.minDistanceLocation=null,jsts.operation.distance.DistanceOp.prototype.minDistance=Number.MAX_VALUE,jsts.operation.distance.DistanceOp.distance=function(a,b){var c=new jsts.operation.distance.DistanceOp(a,b,0);return c.distance()},jsts.operation.distance.DistanceOp.isWithinDistance=function(a,b,c){var d=new jsts.operation.distance.DistanceOp(a,b,c);return d.distance()<=c},jsts.operation.distance.DistanceOp.nearestPoints=function(a,b){var c=new jsts.operation.distance.DistanceOp(a,b,0);return c.nearestPoints()},jsts.operation.distance.DistanceOp.prototype.distance=function(){if(null===this.geom[0]||null===this.geom[1])throw new jsts.error.IllegalArgumentError("null geometries are not supported");return this.geom[0].isEmpty()||this.geom[1].isEmpty()?0:(this.computeMinDistance(),this.minDistance)},jsts.operation.distance.DistanceOp.prototype.nearestPoints=function(){this.computeMinDistance();var a=[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()];return a},jsts.operation.distance.DistanceOp.prototype.nearestLocations=function(){return this.computeMinDistance(),this.minDistanceLocation},jsts.operation.distance.DistanceOp.prototype.updateMinDistance=function(a,b){null!==a[0]&&(b?(this.minDistanceLocation[0]=a[1],this.minDistanceLocation[1]=a[0]):(this.minDistanceLocation[0]=a[0],this.minDistanceLocation[1]=a[1]))},jsts.operation.distance.DistanceOp.prototype.computeMinDistance=function(){return arguments.length>0?void this.computeMinDistance2.apply(this,arguments):void(null===this.minDistanceLocation&&(this.minDistanceLocation=[],this.computeContainmentDistance(),this.minDistance<=this.terminateDistance||this.computeFacetDistance()))},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance=function(){if(2===arguments.length)return void this.computeContainmentDistance2.apply(this,arguments);if(3===arguments.length&&!arguments[0]instanceof jsts.operation.distance.GeometryLocation)return void this.computeContainmentDistance3.apply(this,arguments);if(3===arguments.length)return void this.computeContainmentDistance4.apply(this,arguments);var a=[];this.computeContainmentDistance2(0,a),this.minDistance<=this.terminateDistance||this.computeContainmentDistance2(1,a)},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance2=function(a,b){var c=1-a,d=jsts.geom.util.PolygonExtracter.getPolygons(this.geom[a]);if(d.length>0){var e=jsts.operation.distance.ConnectedElementLocationFilter.getLocations(this.geom[c]);if(this.computeContainmentDistance3(e,d,b),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[c]=b[0],void(this.minDistanceLocation[a]=b[1])}},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance3=function(a,b,c){for(var d=0;d<a.length;d++)for(var e=a[d],f=0;f<b.length;f++)if(this.computeContainmentDistance4(e,b[f],c),this.minDistance<=this.terminateDistance)return},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance4=function(a,b,c){var d=a.getCoordinate();return jsts.geom.Location.EXTERIOR!==this.ptLocator.locate(d,b)?(this.minDistance=0,c[0]=a,void(c[1]=new jsts.operation.distance.GeometryLocation(b,d))):void 0},jsts.operation.distance.DistanceOp.prototype.computeFacetDistance=function(){var a=[],b=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[0]),c=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[1]),d=jsts.geom.util.PointExtracter.getPoints(this.geom[0]),e=jsts.geom.util.PointExtracter.getPoints(this.geom[1]);this.computeMinDistanceLines(b,c,a),this.updateMinDistance(a,!1),this.minDistance<=this.terminateDistance||(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(b,e,a),this.updateMinDistance(a,!1),this.minDistance<=this.terminateDistance||(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(c,d,a),this.updateMinDistance(a,!0),this.minDistance<=this.terminateDistance||(a[0]=null,a[1]=null,this.computeMinDistancePoints(d,e,a),this.updateMinDistance(a,!1))))},jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLines=function(a,b,c){for(var d=0;d<a.length;d++)for(var e=a[d],f=0;f<b.length;f++){var g=b[f];if(this.computeMinDistance(e,g,c),this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistancePoints=function(a,b,c){for(var d=0;d<a.length;d++)for(var e=a[d],f=0;f<b.length;f++){var g=b[f],h=e.getCoordinate().distance(g.getCoordinate());if(h<this.minDistance&&(this.minDistance=h,c[0]=new jsts.operation.distance.GeometryLocation(e,0,e.getCoordinate()),c[1]=new jsts.operation.distance.GeometryLocation(g,0,g.getCoordinate())),this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLinesPoints=function(a,b,c){for(var d=0;d<a.length;d++)for(var e=a[d],f=0;f<b.length;f++){var g=b[f];if(this.computeMinDistance(e,g,c),this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistance2=function(a,b,c){if(b instanceof jsts.geom.Point)return void this.computeMinDistance3(a,b,c);if(!(a.getEnvelopeInternal().distance(b.getEnvelopeInternal())>this.minDistance))for(var d=a.getCoordinates(),e=b.getCoordinates(),f=0;f<d.length-1;f++)for(var g=0;g<e.length-1;g++){var h=jsts.algorithm.CGAlgorithms.distanceLineLine(d[f],d[f+1],e[g],e[g+1]);if(h<this.minDistance){this.minDistance=h;var i=new jsts.geom.LineSegment(d[f],d[f+1]),j=new jsts.geom.LineSegment(e[g],e[g+1]),k=i.closestPoints(j);c[0]=new jsts.operation.distance.GeometryLocation(a,f,k[0]),c[1]=new jsts.operation.distance.GeometryLocation(b,g,k[1])}if(this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistance3=function(a,b,c){if(!(a.getEnvelopeInternal().distance(b.getEnvelopeInternal())>this.minDistance))for(var d=a.getCoordinates(),e=b.getCoordinate(),f=0;f<d.length-1;f++){var g=jsts.algorithm.CGAlgorithms.distancePointLine(e,d[f],d[f+1]);if(g<this.minDistance){this.minDistance=g;var h=new jsts.geom.LineSegment(d[f],d[f+1]),i=h.closestPoint(e);c[0]=new jsts.operation.distance.GeometryLocation(a,f,i),c[1]=new jsts.operation.distance.GeometryLocation(b,0,e)}if(this.minDistance<=this.terminateDistance)return}},jsts.index.strtree.SIRtree=function(a){a=a||10,jsts.index.strtree.AbstractSTRtree.call(this,a)},jsts.index.strtree.SIRtree.prototype=new jsts.index.strtree.AbstractSTRtree,jsts.index.strtree.SIRtree.constructor=jsts.index.strtree.SIRtree,jsts.index.strtree.SIRtree.prototype.comperator={compare:function(a,b){return a.getBounds().getCentre()-b.getBounds().getCentre()}},jsts.index.strtree.SIRtree.prototype.intersectionOp={intersects:function(a,b){return a.intersects(b)}},jsts.index.strtree.SIRtree.prototype.createNode=function(a){var b=function(a){jsts.index.strtree.AbstractNode.apply(this,arguments)};return b.prototype=new jsts.index.strtree.AbstractNode,b.constructor=b,b.prototype.computeBounds=function(){for(var a,b=null,c=this.getChildBoundables(),d=0,e=c.length;e>d;d++)a=c[d],null===b?b=new jsts.index.strtree.Interval(a.getBounds()):b.expandToInclude(a.getBounds());return b},b},jsts.index.strtree.SIRtree.prototype.insert=function(a,b,c){jsts.index.strtree.AbstractSTRtree.prototype.insert(new jsts.index.strtree.Interval(Math.min(a,b),Math.max(a,b)),c)},jsts.index.strtree.SIRtree.prototype.query=function(a,b){b=b||a,jsts.index.strtree.AbstractSTRtree.prototype.query(new jsts.index.strtree.Interval(Math.min(a,b),Math.max(a,b)))},jsts.index.strtree.SIRtree.prototype.getIntersectsOp=function(){return this.intersectionOp},jsts.index.strtree.SIRtree.prototype.getComparator=function(){return this.comperator},jsts.simplify.DouglasPeuckerSimplifier=function(a){this.inputGeom=a,this.isEnsureValidTopology=!0},jsts.simplify.DouglasPeuckerSimplifier.prototype.inputGeom=null,jsts.simplify.DouglasPeuckerSimplifier.prototype.distanceTolerance=null,jsts.simplify.DouglasPeuckerSimplifier.prototype.isEnsureValidTopology=null,jsts.simplify.DouglasPeuckerSimplifier.simplify=function(a,b){var c=new jsts.simplify.DouglasPeuckerSimplifier(a);return c.setDistanceTolerance(b),c.getResultGeometry()},jsts.simplify.DouglasPeuckerSimplifier.prototype.setDistanceTolerance=function(a){if(0>a)throw"Tolerance must be non-negative";this.distanceTolerance=a},jsts.simplify.DouglasPeuckerSimplifier.prototype.setEnsureValid=function(a){this.isEnsureValidTopology=a},jsts.simplify.DouglasPeuckerSimplifier.prototype.getResultGeometry=function(){return this.inputGeom.isEmpty()?this.inputGeom.clone():new jsts.simplify.DPTransformer(this.distanceTolerance,this.isEnsureValidTopology).transform(this.inputGeom)},function(){jsts.operation.predicate.RectangleContains=function(a){this.rectEnv=a.getEnvelopeInternal()},jsts.operation.predicate.RectangleContains.contains=function(a,b){var c=new jsts.operation.predicate.RectangleContains(a);return c.contains(b)},jsts.operation.predicate.RectangleContains.prototype.rectEnv=null,jsts.operation.predicate.RectangleContains.prototype.contains=function(a){return this.rectEnv.contains(a.getEnvelopeInternal())?this.isContainedInBoundary(a)?!1:!0:!1},jsts.operation.predicate.RectangleContains.prototype.isContainedInBoundary=function(a){if(a instanceof jsts.geom.Polygon)return!1;if(a instanceof jsts.geom.Point)return this.isPointContainedInBoundary(a.getCoordinate());if(a instanceof jsts.geom.LineString)return this.isLineStringContainedInBoundary(a);for(var b=0;b<a.getNumGeometries();b++){var c=a.getGeometryN(b);if(!this.isContainedInBoundary(c))return!1}return!0},jsts.operation.predicate.RectangleContains.prototype.isPointContainedInBoundary=function(a){return a.x==this.rectEnv.getMinX()||a.x==this.rectEnv.getMaxX()||a.y==this.rectEnv.getMinY()||a.y==this.rectEnv.getMaxY()},jsts.operation.predicate.RectangleContains.prototype.isLineStringContainedInBoundary=function(a){for(var b=a.getCoordinateSequence(),c=0;c<b.length-1;c++){var d=b[c],e=b[c+1];if(!this.isLineSegmentContainedInBoundary(d,e))return!1}return!0},jsts.operation.predicate.RectangleContains.prototype.isLineSegmentContainedInBoundary=function(a,b){if(a.equals(b))return this.isPointContainedInBoundary(a);if(a.x==b.x){if(a.x==this.rectEnv.getMinX()||a.x==this.rectEnv.getMaxX())return!0}else if(a.y==b.y&&(a.y==this.rectEnv.getMinY()||a.y==this.rectEnv.getMaxY()))return!0;return!1}}(),function(){var a=jsts.geom.Location,b=jsts.geomgraph.Position;jsts.geomgraph.Depth=function(){this.depth=[[],[]];for(var a=0;2>a;a++)for(var b=0;3>b;b++)this.depth[a][b]=jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.NULL_VALUE=-1,jsts.geomgraph.Depth.depthAtLocation=function(b){return b===a.EXTERIOR?0:b===a.INTERIOR?1:jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.prototype.depth=null,jsts.geomgraph.Depth.prototype.getDepth=function(a,b){return this.depth[a][b]},jsts.geomgraph.Depth.prototype.setDepth=function(a,b,c){this.depth[a][b]=c},jsts.geomgraph.Depth.prototype.getLocation=function(b,c){return this.depth[b][c]<=0?a.EXTERIOR:a.INTERIOR},jsts.geomgraph.Depth.prototype.add=function(b,c,d){d===a.INTERIOR&&this.depth[b][c]++},jsts.geomgraph.Depth.prototype.isNull=function(){if(arguments.length>0)return this.isNull2.apply(this,arguments);for(var a=0;2>a;a++)for(var b=0;3>b;b++)if(this.depth[a][b]!==jsts.geomgraph.Depth.NULL_VALUE)return!1;return!0},jsts.geomgraph.Depth.prototype.isNull2=function(a){return arguments.length>1?this.isNull3.apply(this,arguments):this.depth[a][1]==jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.prototype.isNull3=function(a,b){return this.depth[a][b]==jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.prototype.add=function(b){for(var c=0;2>c;c++)for(var d=1;3>d;d++){var e=b.getLocation(c,d);(e===a.EXTERIOR||e===a.INTERIOR)&&(this.isNull(c,d)?this.depth[c][d]=jsts.geomgraph.Depth.depthAtLocation(e):this.depth[c][d]+=jsts.geomgraph.Depth.depthAtLocation(e))}},jsts.geomgraph.Depth.prototype.getDelta=function(a){return this.depth[a][b.RIGHT]-this.depth[a][b.LEFT]},jsts.geomgraph.Depth.prototype.normalize=function(){for(var a=0;2>a;a++)if(!this.isNull(a)){var b=this.depth[a][1];this.depth[a][2]<b&&(b=this.depth[a][2]),0>b&&(b=0);for(var c=1;3>c;c++){var d=0;this.depth[a][c]>b&&(d=1),this.depth[a][c]=d}}},jsts.geomgraph.Depth.prototype.toString=function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]}}(),jsts.algorithm.BoundaryNodeRule=function(){},jsts.algorithm.BoundaryNodeRule.prototype.isInBoundary=function(a){throw new jsts.error.AbstractMethodInvocationError;
  },jsts.algorithm.Mod2BoundaryNodeRule=function(){},jsts.algorithm.Mod2BoundaryNodeRule.prototype=new jsts.algorithm.BoundaryNodeRule,jsts.algorithm.Mod2BoundaryNodeRule.prototype.isInBoundary=function(a){return a%2===1},jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE=new jsts.algorithm.Mod2BoundaryNodeRule,jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE=jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE,jsts.operation.distance.GeometryLocation=function(a,b,c){this.component=a,this.segIndex=b,this.pt=c},jsts.operation.distance.GeometryLocation.INSIDE_AREA=-1,jsts.operation.distance.GeometryLocation.prototype.component=null,jsts.operation.distance.GeometryLocation.prototype.segIndex=null,jsts.operation.distance.GeometryLocation.prototype.pt=null,jsts.operation.distance.GeometryLocation.prototype.getGeometryComponent=function(){return this.component},jsts.operation.distance.GeometryLocation.prototype.getSegmentIndex=function(){return this.segIndex},jsts.operation.distance.GeometryLocation.prototype.getCoordinate=function(){return this.pt},jsts.operation.distance.GeometryLocation.prototype.isInsideArea=function(){return this.segIndex===jsts.operation.distance.GeometryLocation.INSIDE_AREA},jsts.geom.util.PointExtracter=function(a){this.pts=a},jsts.geom.util.PointExtracter.prototype=new jsts.geom.GeometryFilter,jsts.geom.util.PointExtracter.prototype.pts=null,jsts.geom.util.PointExtracter.getPoints=function(a,b){return void 0===b&&(b=[]),a instanceof jsts.geom.Point?b.push(a):(a instanceof jsts.geom.GeometryCollection||a instanceof jsts.geom.MultiPoint||a instanceof jsts.geom.MultiLineString||a instanceof jsts.geom.MultiPolygon)&&a.apply(new jsts.geom.util.PointExtracter(b)),b},jsts.geom.util.PointExtracter.prototype.filter=function(a){a instanceof jsts.geom.Point&&this.pts.push(a)},function(){var a=jsts.geom.Location;jsts.operation.relate.RelateNodeGraph=function(){this.nodes=new jsts.geomgraph.NodeMap(new jsts.operation.relate.RelateNodeFactory)},jsts.operation.relate.RelateNodeGraph.prototype.nodes=null,jsts.operation.relate.RelateNodeGraph.prototype.build=function(a){this.computeIntersectionNodes(a,0),this.copyNodesAndLabels(a,0);var b=new jsts.operation.relate.EdgeEndBuilder,c=b.computeEdgeEnds(a.getEdgeIterator());this.insertEdgeEnds(c)},jsts.operation.relate.RelateNodeGraph.prototype.computeIntersectionNodes=function(b,c){for(var d=b.getEdgeIterator();d.hasNext();)for(var e=d.next(),f=e.getLabel().getLocation(c),g=e.getEdgeIntersectionList().iterator();g.hasNext();){var h=g.next(),i=this.nodes.addNode(h.coord);f===a.BOUNDARY?i.setLabelBoundary(c):i.getLabel().isNull(c)&&i.setLabel(c,a.INTERIOR)}},jsts.operation.relate.RelateNodeGraph.prototype.copyNodesAndLabels=function(a,b){for(var c=a.getNodeIterator();c.hasNext();){var d=c.next(),e=this.nodes.addNode(d.getCoordinate());e.setLabel(b,d.getLabel().getLocation(b))}},jsts.operation.relate.RelateNodeGraph.prototype.insertEdgeEnds=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();this.nodes.add(c)}},jsts.operation.relate.RelateNodeGraph.prototype.getNodeIterator=function(){return this.nodes.iterator()}}(),jsts.geomgraph.index.SimpleSweepLineIntersector=function(){},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector,jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.events=[],jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.nOverlaps=null,jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.computeIntersections=function(a,b,c){return b instanceof javascript.util.List?void this.computeIntersections2.apply(this,arguments):(c?this.add(a,null):this.add(a),void this.computeIntersections3(b))},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.computeIntersections2=function(a,b,c){this.add(a,a),this.add(b,b),this.computeIntersections3(c)},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.add=function(a,b){if(a instanceof javascript.util.List)return void this.add2.apply(this,arguments);for(var c=a.getCoordinates(),d=0;d<c.length-1;d++){var e=new jsts.geomgraph.index.SweepLineSegment(a,d),f=new jsts.geomgraph.index.SweepLineEvent(e.getMinX(),e,b);this.events.push(f),this.events.push(new jsts.geomgraph.index.SweepLineEvent(e.getMaxX(),f))}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.add2=function(a,b){for(var c=a.iterator();c.hasNext();){var d=c.next();b?this.add(d,b):this.add(d,d)}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.prepareEvents=function(){this.events.sort(function(a,b){return a.compareTo(b)});for(var a=0;a<this.events.length;a++){var b=this.events[a];b.isDelete()&&b.getInsertEvent().setDeleteEventIndex(a)}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.computeIntersections3=function(a){this.nOverlaps=0,this.prepareEvents();for(var b=0;b<this.events.length;b++){var c=this.events[b];c.isInsert()&&this.processOverlaps(b,c.getDeleteEventIndex(),c,a)}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.processOverlaps=function(a,b,c,d){for(var e=c.getObject(),f=a;b>f;f++){var g=this.events[f];if(g.isInsert()){var h=g.getObject();c.isSameLabel(g)||(e.computeIntersections(h,d),this.nOverlaps++)}}},jsts.triangulate.VoronoiDiagramBuilder=function(){this.siteCoords=null,this.tolerance=0,this.subdiv=null,this.clipEnv=null,this.diagramEnv=null},jsts.triangulate.VoronoiDiagramBuilder.prototype.setSites=function(){var a=arguments[0];a instanceof jsts.geom.Geometry||a instanceof jsts.geom.Coordinate||a instanceof jsts.geom.Point||a instanceof jsts.geom.MultiPoint||a instanceof jsts.geom.LineString||a instanceof jsts.geom.MultiLineString||a instanceof jsts.geom.LinearRing||a instanceof jsts.geom.Polygon||a instanceof jsts.geom.MultiPolygon?this.setSitesByGeometry(a):this.setSitesByArray(a)},jsts.triangulate.VoronoiDiagramBuilder.prototype.setSitesByGeometry=function(a){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates(a)},jsts.triangulate.VoronoiDiagramBuilder.prototype.setSitesByArray=function(a){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.unique(a)},jsts.triangulate.VoronoiDiagramBuilder.prototype.setClipEnvelope=function(a){this.clipEnv=a},jsts.triangulate.VoronoiDiagramBuilder.prototype.setTolerance=function(a){this.tolerance=a},jsts.triangulate.VoronoiDiagramBuilder.prototype.create=function(){if(null===this.subdiv){var a,b,c,d;a=jsts.triangulate.DelaunayTriangulationBuilder.envelope(this.siteCoords),this.diagramEnv=a,b=Math.max(this.diagramEnv.getWidth(),this.diagramEnv.getHeight()),this.diagramEnv.expandBy(b),null!==this.clipEnv&&this.diagramEnv.expandToInclude(this.clipEnv),c=jsts.triangulate.DelaunayTriangulationBuilder.toVertices(this.siteCoords),this.subdiv=new jsts.triangulate.quadedge.QuadEdgeSubdivision(a,this.tolerance),d=new jsts.triangulate.IncrementalDelaunayTriangulator(this.subdiv),d.insertSites(c)}},jsts.triangulate.VoronoiDiagramBuilder.prototype.getSubdivision=function(){return this.create(),this.subdiv},jsts.triangulate.VoronoiDiagramBuilder.prototype.getDiagram=function(a){this.create();var b=this.subdiv.getVoronoiDiagram(a);return this.clipGeometryCollection(b,this.diagramEnv)},jsts.triangulate.VoronoiDiagramBuilder.prototype.clipGeometryCollection=function(a,b){var c,d,e,f,g,h;for(c=a.getFactory().toGeometry(b),d=[],e=0,f=a.getNumGeometries(),e;f>e;e++)g=a.getGeometryN(e),h=null,b.contains(g.getEnvelopeInternal())?h=g:b.intersects(g.getEnvelopeInternal())&&(h=c.intersection(g)),null===h||h.isEmpty()||d.push(h);return a.getFactory().createGeometryCollection(d)},jsts.operation.valid.IndexedNestedRingTester=function(a){this.graph=a,this.rings=new javascript.util.ArrayList,this.totalEnv=new jsts.geom.Envelope,this.index=null,this.nestedPt=null},jsts.operation.valid.IndexedNestedRingTester.prototype.getNestedPoint=function(){return this.nestedPt},jsts.operation.valid.IndexedNestedRingTester.prototype.add=function(a){this.rings.add(a),this.totalEnv.expandToInclude(a.getEnvelopeInternal())},jsts.operation.valid.IndexedNestedRingTester.prototype.isNonNested=function(){this.buildIndex();for(var a=0;a<this.rings.size();a++)for(var b=this.rings.get(a),c=b.getCoordinates(),d=this.index.query(b.getEnvelopeInternal()),e=0;e<d.length;e++){var f=d[e],g=f.getCoordinates();if(b!=f&&b.getEnvelopeInternal().intersects(f.getEnvelopeInternal())){var h=jsts.operation.valid.IsValidOp.findPtNotNode(c,f,this.graph);if(null!=h){var i=jsts.algorithm.CGAlgorithms.isPointInRing(h,g);if(i)return this.nestedPt=h,!1}}}return!0},jsts.operation.valid.IndexedNestedRingTester.prototype.buildIndex=function(){this.index=new jsts.index.strtree.STRtree;for(var a=0;a<this.rings.size();a++){var b=this.rings.get(a),c=b.getEnvelopeInternal();this.index.insert(c,b)}},jsts.geomgraph.index.MonotoneChain=function(a,b){this.mce=a,this.chainIndex=b},jsts.geomgraph.index.MonotoneChain.prototype.mce=null,jsts.geomgraph.index.MonotoneChain.prototype.chainIndex=null,jsts.geomgraph.index.MonotoneChain.prototype.computeIntersections=function(a,b){this.mce.computeIntersectsForChain(this.chainIndex,a.mce,a.chainIndex,b)},jsts.noding.SegmentNode=function(a,b,c,d){this.segString=a,this.coord=new jsts.geom.Coordinate(b),this.segmentIndex=c,this.segmentOctant=d,this._isInterior=!b.equals2D(a.getCoordinate(c))},jsts.noding.SegmentNode.prototype.segString=null,jsts.noding.SegmentNode.prototype.coord=null,jsts.noding.SegmentNode.prototype.segmentIndex=null,jsts.noding.SegmentNode.prototype.segmentOctant=null,jsts.noding.SegmentNode.prototype._isInterior=null,jsts.noding.SegmentNode.prototype.getCoordinate=function(){return this.coord},jsts.noding.SegmentNode.prototype.isInterior=function(){return this._isInterior},jsts.noding.SegmentNode.prototype.isEndPoint=function(a){return 0!==this.segmentIndex||this._isInterior?this.segmentIndex===this.maxSegmentIndex?!0:!1:!0},jsts.noding.SegmentNode.prototype.compareTo=function(a){var b=a;return this.segmentIndex<b.segmentIndex?-1:this.segmentIndex>b.segmentIndex?1:this.coord.equals2D(b.coord)?0:jsts.noding.SegmentPointComparator.compare(this.segmentOctant,this.coord,b.coord)},function(){jsts.io.GeoJSONWriter=function(){this.parser=new jsts.io.GeoJSONParser(this.geometryFactory)},jsts.io.GeoJSONWriter.prototype.write=function(a){var b=this.parser.write(a);return b}}(),jsts.io.OpenLayersParser=function(a){this.geometryFactory=a||new jsts.geom.GeometryFactory},jsts.io.OpenLayersParser.prototype.read=function(a){return"OpenLayers.Geometry.Point"===a.CLASS_NAME?this.convertFromPoint(a):"OpenLayers.Geometry.LineString"===a.CLASS_NAME?this.convertFromLineString(a):"OpenLayers.Geometry.LinearRing"===a.CLASS_NAME?this.convertFromLinearRing(a):"OpenLayers.Geometry.Polygon"===a.CLASS_NAME?this.convertFromPolygon(a):"OpenLayers.Geometry.MultiPoint"===a.CLASS_NAME?this.convertFromMultiPoint(a):"OpenLayers.Geometry.MultiLineString"===a.CLASS_NAME?this.convertFromMultiLineString(a):"OpenLayers.Geometry.MultiPolygon"===a.CLASS_NAME?this.convertFromMultiPolygon(a):"OpenLayers.Geometry.Collection"===a.CLASS_NAME?this.convertFromCollection(a):void 0},jsts.io.OpenLayersParser.prototype.convertFromPoint=function(a){return this.geometryFactory.createPoint(new jsts.geom.Coordinate(a.x,a.y))},jsts.io.OpenLayersParser.prototype.convertFromLineString=function(a){var b,c=[];for(b=0;b<a.components.length;b++)c.push(new jsts.geom.Coordinate(a.components[b].x,a.components[b].y));return this.geometryFactory.createLineString(c)},jsts.io.OpenLayersParser.prototype.convertFromLinearRing=function(a){var b,c=[];for(b=0;b<a.components.length;b++)c.push(new jsts.geom.Coordinate(a.components[b].x,a.components[b].y));return this.geometryFactory.createLinearRing(c)},jsts.io.OpenLayersParser.prototype.convertFromPolygon=function(a){var b,c=null,d=[];for(b=0;b<a.components.length;b++){var e=this.convertFromLinearRing(a.components[b]);0===b?c=e:d.push(e)}return this.geometryFactory.createPolygon(c,d)},jsts.io.OpenLayersParser.prototype.convertFromMultiPoint=function(a){var b,c=[];for(b=0;b<a.components.length;b++)c.push(this.convertFromPoint(a.components[b]));return this.geometryFactory.createMultiPoint(c)},jsts.io.OpenLayersParser.prototype.convertFromMultiLineString=function(a){var b,c=[];for(b=0;b<a.components.length;b++)c.push(this.convertFromLineString(a.components[b]));return this.geometryFactory.createMultiLineString(c)},jsts.io.OpenLayersParser.prototype.convertFromMultiPolygon=function(a){var b,c=[];for(b=0;b<a.components.length;b++)c.push(this.convertFromPolygon(a.components[b]));return this.geometryFactory.createMultiPolygon(c)},jsts.io.OpenLayersParser.prototype.convertFromCollection=function(a){var b,c=[];for(b=0;b<a.components.length;b++)c.push(this.read(a.components[b]));return this.geometryFactory.createGeometryCollection(c)},jsts.io.OpenLayersParser.prototype.write=function(a){return"jsts.geom.Point"===a.CLASS_NAME?this.convertToPoint(a.coordinate):"jsts.geom.LineString"===a.CLASS_NAME?this.convertToLineString(a):"jsts.geom.LinearRing"===a.CLASS_NAME?this.convertToLinearRing(a):"jsts.geom.Polygon"===a.CLASS_NAME?this.convertToPolygon(a):"jsts.geom.MultiPoint"===a.CLASS_NAME?this.convertToMultiPoint(a):"jsts.geom.MultiLineString"===a.CLASS_NAME?this.convertToMultiLineString(a):"jsts.geom.MultiPolygon"===a.CLASS_NAME?this.convertToMultiPolygon(a):"jsts.geom.GeometryCollection"===a.CLASS_NAME?this.convertToCollection(a):void 0},jsts.io.OpenLayersParser.prototype.convertToPoint=function(a){return new OpenLayers.Geometry.Point(a.x,a.y)},jsts.io.OpenLayersParser.prototype.convertToLineString=function(a){var b,c=[];for(b=0;b<a.points.length;b++){var d=a.points[b];c.push(this.convertToPoint(d))}return new OpenLayers.Geometry.LineString(c)},jsts.io.OpenLayersParser.prototype.convertToLinearRing=function(a){var b,c=[];for(b=0;b<a.points.length;b++){var d=a.points[b];c.push(this.convertToPoint(d))}return new OpenLayers.Geometry.LinearRing(c)},jsts.io.OpenLayersParser.prototype.convertToPolygon=function(a){var b,c=[];for(c.push(this.convertToLinearRing(a.shell)),b=0;b<a.holes.length;b++){var d=a.holes[b];c.push(this.convertToLinearRing(d))}return new OpenLayers.Geometry.Polygon(c)},jsts.io.OpenLayersParser.prototype.convertToMultiPoint=function(a){var b,c=[];for(b=0;b<a.geometries.length;b++){var d=a.geometries[b].coordinate;c.push(new OpenLayers.Geometry.Point(d.x,d.y))}return new OpenLayers.Geometry.MultiPoint(c)},jsts.io.OpenLayersParser.prototype.convertToMultiLineString=function(a){var b,c=[];for(b=0;b<a.geometries.length;b++)c.push(this.convertToLineString(a.geometries[b]));return new OpenLayers.Geometry.MultiLineString(c)},jsts.io.OpenLayersParser.prototype.convertToMultiPolygon=function(a){var b,c=[];for(b=0;b<a.geometries.length;b++)c.push(this.convertToPolygon(a.geometries[b]));return new OpenLayers.Geometry.MultiPolygon(c)},jsts.io.OpenLayersParser.prototype.convertToCollection=function(a){var b,c=[];for(b=0;b<a.geometries.length;b++){var d=a.geometries[b],e=this.write(d);c.push(e)}return new OpenLayers.Geometry.Collection(c)},jsts.index.quadtree.Quadtree=function(){this.root=new jsts.index.quadtree.Root,this.minExtent=1},jsts.index.quadtree.Quadtree.ensureExtent=function(a,b){var c,d,e,f;return c=a.getMinX(),d=a.getMaxX(),e=a.getMinY(),f=a.getMaxY(),c!==d&&e!==f?a:(c===d&&(c-=b/2,d=c+b/2),e===f&&(e-=b/2,f=e+b/2),new jsts.geom.Envelope(c,d,e,f))},jsts.index.quadtree.Quadtree.prototype.depth=function(){return this.root.depth()},jsts.index.quadtree.Quadtree.prototype.size=function(){return this.root.size()},jsts.index.quadtree.Quadtree.prototype.insert=function(a,b){this.collectStats(a);var c=jsts.index.quadtree.Quadtree.ensureExtent(a,this.minExtent);this.root.insert(c,b)},jsts.index.quadtree.Quadtree.prototype.remove=function(a,b){var c=jsts.index.quadtree.Quadtree.ensureExtent(a,this.minExtent);return this.root.remove(c,b)},jsts.index.quadtree.Quadtree.prototype.query=function(){return 1===arguments.length?jsts.index.quadtree.Quadtree.prototype.queryByEnvelope.apply(this,arguments):void jsts.index.quadtree.Quadtree.prototype.queryWithVisitor.apply(this,arguments)},jsts.index.quadtree.Quadtree.prototype.queryByEnvelope=function(a){var b=new jsts.index.ArrayListVisitor;return this.query(a,b),b.getItems()},jsts.index.quadtree.Quadtree.prototype.queryWithVisitor=function(a,b){this.root.visit(a,b)},jsts.index.quadtree.Quadtree.prototype.queryAll=function(){var a=[];return a=this.root.addAllItems(a)},jsts.index.quadtree.Quadtree.prototype.collectStats=function(a){var b=a.getWidth();b<this.minExtent&&b>0&&(this.minExtent=b);var c=a.getHeight();c<this.minExtent&&c>0&&(this.minExtent=c)},jsts.operation.relate.RelateNodeFactory=function(){},jsts.operation.relate.RelateNodeFactory.prototype=new jsts.geomgraph.NodeFactory,jsts.operation.relate.RelateNodeFactory.prototype.createNode=function(a){return new jsts.operation.relate.RelateNode(a,new jsts.operation.relate.EdgeEndBundleStar)},jsts.index.quadtree.Key=function(a){this.pt=new jsts.geom.Coordinate,this.level=0,this.env=null,this.computeKey(a)},jsts.index.quadtree.Key.computeQuadLevel=function(a){var b,c,d,e;return b=a.getWidth(),c=a.getHeight(),d=b>c?b:c,e=jsts.index.DoubleBits.exponent(d)+1},jsts.index.quadtree.Key.prototype.getPoint=function(){return this.pt},jsts.index.quadtree.Key.prototype.getLevel=function(){return this.level},jsts.index.quadtree.Key.prototype.getEnvelope=function(){return this.env},jsts.index.quadtree.Key.prototype.getCentre=function(){var a,b;return a=(this.env.getMinX()+this.env.getMaxX())/2,b=(this.env.getMinY()+this.env.getMaxY())/2,new jsts.geom.Coordinate(a,b)},jsts.index.quadtree.Key.prototype.computeKey=function(){arguments[0]instanceof jsts.geom.Envelope?this.computeKeyFromEnvelope(arguments[0]):this.computeKeyFromLevel(arguments[0],arguments[1])},jsts.index.quadtree.Key.prototype.computeKeyFromEnvelope=function(a){for(this.level=jsts.index.quadtree.Key.computeQuadLevel(a),this.env=new jsts.geom.Envelope,this.computeKey(this.level,a);!this.env.contains(a);)this.level+=1,this.computeKey(this.level,a)},jsts.index.quadtree.Key.prototype.computeKeyFromLevel=function(a,b){var c=jsts.index.DoubleBits.powerOf2(a);this.pt.x=Math.floor(b.getMinX()/c)*c,this.pt.y=Math.floor(b.getMinY()/c)*c,this.env.init(this.pt.x,this.pt.x+c,this.pt.y,this.pt.y+c)},jsts.geom.CoordinateArrays=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.CoordinateArrays.copyDeep=function(){return 1===arguments.length?jsts.geom.CoordinateArrays.copyDeep1(arguments[0]):void(5===arguments.length&&jsts.geom.CoordinateArrays.copyDeep2(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]))},jsts.geom.CoordinateArrays.copyDeep1=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=new jsts.geom.Coordinate(a[c]);return b},jsts.geom.CoordinateArrays.copyDeep2=function(a,b,c,d,e){for(var f=0;e>f;f++)c[d+f]=new jsts.geom.Coordinate(a[b+f])},jsts.geom.CoordinateArrays.removeRepeatedPoints=function(a){var b;return this.hasRepeatedPoints(a)?(b=new jsts.geom.CoordinateList(a,!1),b.toCoordinateArray()):a},jsts.geom.CoordinateArrays.hasRepeatedPoints=function(a){var b;for(b=1;b<a.length;b++)if(a[b-1].equals(a[b]))return!0;return!1},jsts.geom.CoordinateArrays.ptNotInList=function(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(jsts.geom.CoordinateArrays.indexOf(d,b)<0)return d}return null},jsts.geom.CoordinateArrays.increasingDirection=function(a){for(var b=0;b<parseInt(a.length/2);b++){var c=a.length-1-b,d=a[b].compareTo(a[c]);if(0!=d)return d}return 1},jsts.geom.CoordinateArrays.minCoordinate=function(a){for(var b=null,c=0;c<a.length;c++)(null===b||b.compareTo(a[c])>0)&&(b=a[c]);return b},jsts.geom.CoordinateArrays.scroll=function(a,b){var c=jsts.geom.CoordinateArrays.indexOf(b,a);if(!(0>c)){var d=a.slice(c).concat(a.slice(0,c));for(c=0;c<d.length;c++)a[c]=d[c]}},jsts.geom.CoordinateArrays.indexOf=function(a,b){for(var c=0;c<b.length;c++)if(a.equals(b[c]))return c;return-1},jsts.operation.overlay.MinimalEdgeRing=function(a,b){jsts.geomgraph.EdgeRing.call(this,a,b)},jsts.operation.overlay.MinimalEdgeRing.prototype=new jsts.geomgraph.EdgeRing,jsts.operation.overlay.MinimalEdgeRing.constructor=jsts.operation.overlay.MinimalEdgeRing,jsts.operation.overlay.MinimalEdgeRing.prototype.getNext=function(a){return a.getNextMin()},jsts.operation.overlay.MinimalEdgeRing.prototype.setEdgeRing=function(a,b){a.setMinEdgeRing(b)},jsts.triangulate.DelaunayTriangulationBuilder=function(){this.siteCoords=null,this.tolerance=0,this.subdiv=null},jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates=function(a){if(void 0===a||null===a)return new jsts.geom.CoordinateList([],!1).toArray();var b=a.getCoordinates();return jsts.triangulate.DelaunayTriangulationBuilder.unique(b)},jsts.triangulate.DelaunayTriangulationBuilder.unique=function(a){a.sort(function(a,b){return a.compareTo(b)});var b=new jsts.geom.CoordinateList(a,!1);return b.toArray()},jsts.triangulate.DelaunayTriangulationBuilder.toVertices=function(a){var b,c=new Array(a.length),d=0,e=a.length;for(d;e>d;d++)b=a[d],c[d]=new jsts.triangulate.quadedge.Vertex(b);return c},jsts.triangulate.DelaunayTriangulationBuilder.envelope=function(a){var b=new jsts.geom.Envelope,c=0,d=a.length;for(c;d>c;c++)b.expandToInclude(a[c]);return b},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSites=function(){var a=arguments[0];a instanceof jsts.geom.Geometry||a instanceof jsts.geom.Coordinate||a instanceof jsts.geom.Point||a instanceof jsts.geom.MultiPoint||a instanceof jsts.geom.LineString||a instanceof jsts.geom.MultiLineString||a instanceof jsts.geom.LinearRing||a instanceof jsts.geom.Polygon||a instanceof jsts.geom.MultiPolygon?this.setSitesFromGeometry(a):this.setSitesFromCollection(a)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSitesFromGeometry=function(a){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates(a)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSitesFromCollection=function(a){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.unique(a)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setTolerance=function(a){this.tolerance=a},jsts.triangulate.DelaunayTriangulationBuilder.prototype.create=function(){if(null===this.subdiv){var a,b,c;a=jsts.triangulate.DelaunayTriangulationBuilder.envelope(this.siteCoords),b=jsts.triangulate.DelaunayTriangulationBuilder.toVertices(this.siteCoords),this.subdiv=new jsts.triangulate.quadedge.QuadEdgeSubdivision(a,this.tolerance),c=new jsts.triangulate.IncrementalDelaunayTriangulator(this.subdiv),c.insertSites(b)}},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getSubdivision=function(){return this.create(),this.subdiv},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getEdges=function(a){return this.create(),this.subdiv.getEdges(a)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getTriangles=function(a){return this.create(),this.subdiv.getTriangles(a)},jsts.algorithm.RayCrossingCounter=function(a){this.p=a},jsts.algorithm.RayCrossingCounter.locatePointInRing=function(a,b){for(var c=new jsts.algorithm.RayCrossingCounter(a),d=1;d<b.length;d++){var e=b[d],f=b[d-1];if(c.countSegment(e,f),c.isOnSegment())return c.getLocation()}return c.getLocation()},jsts.algorithm.RayCrossingCounter.prototype.p=null,jsts.algorithm.RayCrossingCounter.prototype.crossingCount=0,jsts.algorithm.RayCrossingCounter.prototype.isPointOnSegment=!1,jsts.algorithm.RayCrossingCounter.prototype.countSegment=function(a,b){if(!(a.x<this.p.x&&b.x<this.p.x)){if(this.p.x==b.x&&this.p.y===b.y)return void(this.isPointOnSegment=!0);if(a.y===this.p.y&&b.y===this.p.y){var c=a.x,d=b.x;return c>d&&(c=b.x,d=a.x),void(this.p.x>=c&&this.p.x<=d&&(this.isPointOnSegment=!0))}if(a.y>this.p.y&&b.y<=this.p.y||b.y>this.p.y&&a.y<=this.p.y){var e=a.x-this.p.x,f=a.y-this.p.y,g=b.x-this.p.x,h=b.y-this.p.y,i=jsts.algorithm.RobustDeterminant.signOfDet2x2(e,f,g,h);if(0===i)return void(this.isPointOnSegment=!0);f>h&&(i=-i),i>0&&this.crossingCount++}}},jsts.algorithm.RayCrossingCounter.prototype.isOnSegment=function(){return jsts.geom.isPointOnSegment},jsts.algorithm.RayCrossingCounter.prototype.getLocation=function(){return this.isPointOnSegment?jsts.geom.Location.BOUNDARY:this.crossingCount%2===1?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR},jsts.algorithm.RayCrossingCounter.prototype.isPointInPolygon=function(){return this.getLocation()!==jsts.geom.Location.EXTERIOR},jsts.operation.BoundaryOp=function(a,b){this.geom=a,this.geomFact=a.getFactory(),this.bnRule=b||jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE},jsts.operation.BoundaryOp.prototype.geom=null,jsts.operation.BoundaryOp.prototype.geomFact=null,jsts.operation.BoundaryOp.prototype.bnRule=null,jsts.operation.BoundaryOp.prototype.getBoundary=function(){return this.geom instanceof jsts.geom.LineString?this.boundaryLineString(this.geom):this.geom instanceof jsts.geom.MultiLineString?this.boundaryMultiLineString(this.geom):this.geom.getBoundary()},jsts.operation.BoundaryOp.prototype.getEmptyMultiPoint=function(){return this.geomFact.createMultiPoint(null)},jsts.operation.BoundaryOp.prototype.boundaryMultiLineString=function(a){if(this.geom.isEmpty())return this.getEmptyMultiPoint();var b=this.computeBoundaryCoordinates(a);return 1==b.length?this.geomFact.createPoint(b[0]):this.geomFact.createMultiPoint(b)},jsts.operation.BoundaryOp.prototype.endpoints=null,jsts.operation.BoundaryOp.prototype.computeBoundaryCoordinates=function(a){var b,c,d,e=[];for(this.endpoints=[],b=0;b<a.getNumGeometries();b++)c=a.getGeometryN(b),0!=c.getNumPoints()&&(this.addEndpoint(c.getCoordinateN(0)),this.addEndpoint(c.getCoordinateN(c.getNumPoints()-1)));for(b=0;b<this.endpoints.length;b++)d=this.endpoints[b],this.bnRule.isInBoundary(d.count)&&e.push(d.coordinate);return e},jsts.operation.BoundaryOp.prototype.addEndpoint=function(a){var b,c,d=!1;for(b=0;b<this.endpoints.length;b++)if(c=this.endpoints[b],c.coordinate.equals(a)){d=!0;break}d||(c={},c.coordinate=a,c.count=0,this.endpoints.push(c)),c.count++},jsts.operation.BoundaryOp.prototype.boundaryLineString=function(a){if(this.geom.isEmpty())return this.getEmptyMultiPoint();if(a.isClosed()){var b=this.bnRule.isInBoundary(2);return b?a.getStartPoint():this.geomFact.createMultiPoint(null)}return this.geomFact.createMultiPoint([a.getStartPoint(),a.getEndPoint()])},jsts.operation.buffer.OffsetCurveSetBuilder=function(a,b,c){this.inputGeom=a,this.distance=b,this.curveBuilder=c,this.curveList=new javascript.util.ArrayList},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.inputGeom=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.distance=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.curveBuilder=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.curveList=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.getCurves=function(){return this.add(this.inputGeom),this.curveList},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addCurve=function(a,b,c){if(!(null==a||a.length<2)){var d=new jsts.noding.NodedSegmentString(a,new jsts.geomgraph.Label(0,jsts.geom.Location.BOUNDARY,b,c));this.curveList.add(d)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.add=function(a){if(!a.isEmpty())if(a instanceof jsts.geom.Polygon)this.addPolygon(a);else if(a instanceof jsts.geom.LineString)this.addLineString(a);else if(a instanceof jsts.geom.Point)this.addPoint(a);else if(a instanceof jsts.geom.MultiPoint)this.addCollection(a);else if(a instanceof jsts.geom.MultiLineString)this.addCollection(a);else if(a instanceof jsts.geom.MultiPolygon)this.addCollection(a);else{if(!(a instanceof jsts.geom.GeometryCollection))throw new jsts.error.IllegalArgumentError;this.addCollection(a)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addCollection=function(a){for(var b=0;b<a.getNumGeometries();b++){var c=a.getGeometryN(b);this.add(c)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addPoint=function(a){if(!(this.distance<=0)){var b=a.getCoordinates(),c=this.curveBuilder.getLineCurve(b,this.distance);this.addCurve(c,jsts.geom.Location.EXTERIOR,jsts.geom.Location.INTERIOR)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addLineString=function(a){if(!(this.distance<=0)||this.curveBuilder.getBufferParameters().isSingleSided()){var b=jsts.geom.CoordinateArrays.removeRepeatedPoints(a.getCoordinates()),c=this.curveBuilder.getLineCurve(b,this.distance);this.addCurve(c,jsts.geom.Location.EXTERIOR,jsts.geom.Location.INTERIOR)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addPolygon=function(a){var b=this.distance,c=jsts.geomgraph.Position.LEFT;this.distance<0&&(b=-this.distance,c=jsts.geomgraph.Position.RIGHT);var d=a.getExteriorRing(),e=jsts.geom.CoordinateArrays.removeRepeatedPoints(d.getCoordinates());if(!(this.distance<0&&this.isErodedCompletely(d,this.distance)||this.distance<=0&&e.length<3)){this.addPolygonRing(e,b,c,jsts.geom.Location.EXTERIOR,jsts.geom.Location.INTERIOR);for(var f=0;f<a.getNumInteriorRing();f++){var g=a.getInteriorRingN(f),h=jsts.geom.CoordinateArrays.removeRepeatedPoints(g.getCoordinates());this.distance>0&&this.isErodedCompletely(g,-this.distance)||this.addPolygonRing(h,b,jsts.geomgraph.Position.opposite(c),jsts.geom.Location.INTERIOR,jsts.geom.Location.EXTERIOR)}}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addPolygonRing=function(a,b,c,d,e){if(!(0==b&&a.length<jsts.geom.LinearRing.MINIMUM_VALID_SIZE)){var f=d,g=e;a.length>=jsts.geom.LinearRing.MINIMUM_VALID_SIZE&&jsts.algorithm.CGAlgorithms.isCCW(a)&&(f=e,g=d,c=jsts.geomgraph.Position.opposite(c));var h=this.curveBuilder.getRingCurve(a,c,b);this.addCurve(h,f,g)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.isErodedCompletely=function(a,b){var c=a.getCoordinates();if(c.length<4)return 0>b;if(4==c.length)return this.isTriangleErodedCompletely(c,b);var d=a.getEnvelopeInternal(),e=Math.min(d.getHeight(),d.getWidth());return 0>b&&2*Math.abs(b)>e?!0:!1},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.isTriangleErodedCompletely=function(a,b){var c=new jsts.geom.Triangle(a[0],a[1],a[2]),d=c.inCentre(),e=jsts.algorithm.CGAlgorithms.distancePointLine(d,c.p0,c.p1);return e<Math.abs(b)},jsts.operation.buffer.BufferSubgraph=function(){this.dirEdgeList=new javascript.util.ArrayList,this.nodes=new javascript.util.ArrayList,this.finder=new jsts.operation.buffer.RightmostEdgeFinder},jsts.operation.buffer.BufferSubgraph.prototype.finder=null,jsts.operation.buffer.BufferSubgraph.prototype.dirEdgeList=null,jsts.operation.buffer.BufferSubgraph.prototype.nodes=null,jsts.operation.buffer.BufferSubgraph.prototype.rightMostCoord=null,jsts.operation.buffer.BufferSubgraph.prototype.env=null,jsts.operation.buffer.BufferSubgraph.prototype.getDirectedEdges=function(){return this.dirEdgeList},jsts.operation.buffer.BufferSubgraph.prototype.getNodes=function(){return this.nodes},jsts.operation.buffer.BufferSubgraph.prototype.getEnvelope=function(){if(null===this.env){for(var a=new jsts.geom.Envelope,b=this.dirEdgeList.iterator();b.hasNext();)for(var c=b.next(),d=c.getEdge().getCoordinates(),e=0;e<d.length-1;e++)a.expandToInclude(d[e]);this.env=a}return this.env},jsts.operation.buffer.BufferSubgraph.prototype.getRightmostCoordinate=function(){return this.rightMostCoord},jsts.operation.buffer.BufferSubgraph.prototype.create=function(a){this.addReachable(a),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},jsts.operation.buffer.BufferSubgraph.prototype.addReachable=function(a){var b=[];for(b.push(a);0!==b.length;){var c=b.pop();this.add(c,b)}},jsts.operation.buffer.BufferSubgraph.prototype.add=function(a,b){a.setVisited(!0),this.nodes.add(a);for(var c=a.getEdges().iterator();c.hasNext();){var d=c.next();this.dirEdgeList.add(d);var e=d.getSym(),f=e.getNode();f.isVisited()||b.push(f)}},jsts.operation.buffer.BufferSubgraph.prototype.clearVisitedEdges=function(){for(var a=this.dirEdgeList.iterator();a.hasNext();){var b=a.next();b.setVisited(!1);
  }},jsts.operation.buffer.BufferSubgraph.prototype.computeDepth=function(a){this.clearVisitedEdges();var b=this.finder.getEdge();b.getNode(),b.getLabel(),b.setEdgeDepths(jsts.geomgraph.Position.RIGHT,a),this.copySymDepths(b),this.computeDepths(b)},jsts.operation.buffer.BufferSubgraph.prototype.computeDepths=function(a){var b=[],c=[],d=a.getNode();for(c.push(d),b.push(d),a.setVisited(!0);0!==c.length;){var e=c.shift();b.push(e),this.computeNodeDepth(e);for(var f=e.getEdges().iterator();f.hasNext();){var g=f.next(),h=g.getSym();if(!h.isVisited()){var i=h.getNode();-1===b.indexOf(i)&&(c.push(i),b.push(i))}}}},jsts.operation.buffer.BufferSubgraph.prototype.computeNodeDepth=function(a){for(var b=null,c=a.getEdges().iterator();c.hasNext();){var d=c.next();if(d.isVisited()||d.getSym().isVisited()){b=d;break}}if(null==b)throw new jsts.error.TopologyError("unable to find edge to compute depths at "+a.getCoordinate());a.getEdges().computeDepths(b);for(var c=a.getEdges().iterator();c.hasNext();){var d=c.next();d.setVisited(!0),this.copySymDepths(d)}},jsts.operation.buffer.BufferSubgraph.prototype.copySymDepths=function(a){var b=a.getSym();b.setDepth(jsts.geomgraph.Position.LEFT,a.getDepth(jsts.geomgraph.Position.RIGHT)),b.setDepth(jsts.geomgraph.Position.RIGHT,a.getDepth(jsts.geomgraph.Position.LEFT))},jsts.operation.buffer.BufferSubgraph.prototype.findResultEdges=function(){for(var a=this.dirEdgeList.iterator();a.hasNext();){var b=a.next();b.getDepth(jsts.geomgraph.Position.RIGHT)>=1&&b.getDepth(jsts.geomgraph.Position.LEFT)<=0&&!b.isInteriorAreaEdge()&&b.setInResult(!0)}},jsts.operation.buffer.BufferSubgraph.prototype.compareTo=function(a){var b=a;return this.rightMostCoord.x<b.rightMostCoord.x?-1:this.rightMostCoord.x>b.rightMostCoord.x?1:0},jsts.simplify.DPTransformer=function(a,b){this.distanceTolerance=a,this.isEnsureValidTopology=b},jsts.simplify.DPTransformer.prototype=new jsts.geom.util.GeometryTransformer,jsts.simplify.DPTransformer.prototype.distanceTolerance=null,jsts.simplify.DPTransformer.prototype.isEnsureValidTopology=null,jsts.simplify.DPTransformer.prototype.transformCoordinates=function(a,b){var c=a,d=null;return d=0==c.length?[]:jsts.simplify.DouglasPeuckerLineSimplifier.simplify(c,this.distanceTolerance)},jsts.simplify.DPTransformer.prototype.transformPolygon=function(a,b){if(a.isEmpty())return null;var c=jsts.geom.util.GeometryTransformer.prototype.transformPolygon.apply(this,arguments);return b instanceof jsts.geom.MultiPolygon?c:this.createValidArea(c)},jsts.simplify.DPTransformer.prototype.transformLinearRing=function(a,b){var c=b instanceof jsts.geom.Polygon,d=jsts.geom.util.GeometryTransformer.prototype.transformLinearRing.apply(this,arguments);return!c||d instanceof jsts.geom.LinearRing?d:null},jsts.simplify.DPTransformer.prototype.transformMultiPolygon=function(a,b){var c=jsts.geom.util.GeometryTransformer.prototype.transformMultiPolygon.apply(this,arguments);return this.createValidArea(c)},jsts.simplify.DPTransformer.prototype.createValidArea=function(a){return this.isEnsureValidTopology?a.buffer(0):a},jsts.geom.util.GeometryExtracter=function(a,b){this.clz=a,this.comps=b},jsts.geom.util.GeometryExtracter.prototype=new jsts.geom.GeometryFilter,jsts.geom.util.GeometryExtracter.prototype.clz=null,jsts.geom.util.GeometryExtracter.prototype.comps=null,jsts.geom.util.GeometryExtracter.extract=function(a,b,c){return c=c||new javascript.util.ArrayList,a instanceof b?c.add(a):(a instanceof jsts.geom.GeometryCollection||a instanceof jsts.geom.MultiPoint||a instanceof jsts.geom.MultiLineString||a instanceof jsts.geom.MultiPolygon)&&a.apply(new jsts.geom.util.GeometryExtracter(b,c)),c},jsts.geom.util.GeometryExtracter.prototype.filter=function(a){(null===this.clz||a instanceof this.clz)&&this.comps.add(a)},function(){var a=jsts.operation.overlay.OverlayOp,b=jsts.operation.overlay.snap.SnapOverlayOp,c=function(a,b){this.geom=[],this.geom[0]=a,this.geom[1]=b};c.overlayOp=function(a,b,d){var e=new c(a,b);return e.getResultGeometry(d)},c.intersection=function(b,c){return overlayOp(b,c,a.INTERSECTION)},c.union=function(b,c){return overlayOp(b,c,a.UNION)},c.difference=function(b,c){return overlayOp(b,c,a.DIFFERENCE)},c.symDifference=function(b,c){return overlayOp(b,c,a.SYMDIFFERENCE)},c.prototype.geom=null,c.prototype.getResultGeometry=function(c){var d=null,e=!1,f=null;try{d=a.overlayOp(this.geom[0],this.geom[1],c);var g=!0;g&&(e=!0)}catch(h){f=h}if(!e)try{d=b.overlayOp(this.geom[0],this.geom[1],c)}catch(h){throw f}return d},jsts.operation.overlay.snap.SnapIfNeededOverlayOp=c}(),function(){var a=jsts.geom.util.GeometryExtracter,b=jsts.operation.union.CascadedPolygonUnion,c=jsts.operation.union.PointGeometryUnion,d=jsts.operation.overlay.OverlayOp,e=jsts.operation.overlay.snap.SnapIfNeededOverlayOp,f=javascript.util.ArrayList;jsts.operation.union.UnaryUnionOp=function(a,b){this.polygons=new f,this.lines=new f,this.points=new f,b&&(this.geomFact=b),this.extract(a)},jsts.operation.union.UnaryUnionOp.union=function(a,b){var c=new jsts.operation.union.UnaryUnionOp(a,b);return c.union()},jsts.operation.union.UnaryUnionOp.prototype.polygons=null,jsts.operation.union.UnaryUnionOp.prototype.lines=null,jsts.operation.union.UnaryUnionOp.prototype.points=null,jsts.operation.union.UnaryUnionOp.prototype.geomFact=null,jsts.operation.union.UnaryUnionOp.prototype.extract=function(b){if(b instanceof f)for(var c=b.iterator();c.hasNext();){var d=c.next();this.extract(d)}else null===this.geomFact&&(this.geomFact=b.getFactory()),a.extract(b,jsts.geom.Polygon,this.polygons),a.extract(b,jsts.geom.LineString,this.lines),a.extract(b,jsts.geom.Point,this.points)},jsts.operation.union.UnaryUnionOp.prototype.union=function(){if(null===this.geomFact)return null;var a=null;if(this.points.size()>0){var d=this.geomFact.buildGeometry(this.points);a=this.unionNoOpt(d)}var e=null;if(this.lines.size()>0){var f=this.geomFact.buildGeometry(this.lines);e=this.unionNoOpt(f)}var g=null;this.polygons.size()>0&&(g=b.union(this.polygons));var h=this.unionWithNull(e,g),i=null;return i=null===a?h:null===h?a:c(a,h),null===i?this.geomFact.createGeometryCollection(null):i},jsts.operation.union.UnaryUnionOp.prototype.unionWithNull=function(a,b){return null===a&&null===b?null:null===b?a:null===a?b:a.union(b)},jsts.operation.union.UnaryUnionOp.prototype.unionNoOpt=function(a){var b=this.geomFact.createPoint(null);return e.overlayOp(a,b,d.UNION)}}(),jsts.index.kdtree.KdNode=function(){this.left=null,this.right=null,this.count=1,2===arguments.length?this.initializeFromCoordinate.apply(this,arguments[0],arguments[1]):3===arguments.length&&this.initializeFromXY.apply(this,arguments[0],arguments[1],arguments[2])},jsts.index.kdtree.KdNode.prototype.initializeFromXY=function(a,b,c){this.p=new jsts.geom.Coordinate(a,b),this.data=c},jsts.index.kdtree.KdNode.prototype.initializeFromCoordinate=function(a,b){this.p=a,this.data=b},jsts.index.kdtree.KdNode.prototype.getX=function(){return this.p.x},jsts.index.kdtree.KdNode.prototype.getY=function(){return this.p.y},jsts.index.kdtree.KdNode.prototype.getCoordinate=function(){return this.p},jsts.index.kdtree.KdNode.prototype.getData=function(){return this.data},jsts.index.kdtree.KdNode.prototype.getLeft=function(){return this.left},jsts.index.kdtree.KdNode.prototype.getRight=function(){return this.right},jsts.index.kdtree.KdNode.prototype.increment=function(){this.count+=1},jsts.index.kdtree.KdNode.prototype.getCount=function(){return this.count},jsts.index.kdtree.KdNode.prototype.isRepeated=function(){return count>1},jsts.index.kdtree.KdNode.prototype.setLeft=function(a){this.left=a},jsts.index.kdtree.KdNode.prototype.setRight=function(a){this.right=a},jsts.algorithm.InteriorPointPoint=function(a){this.minDistance=Number.MAX_VALUE,this.interiorPoint=null,this.centroid=a.getCentroid().getCoordinate(),this.add(a)},jsts.algorithm.InteriorPointPoint.prototype.add=function(a){if(a instanceof jsts.geom.Point)this.addPoint(a.getCoordinate());else if(a instanceof jsts.geom.GeometryCollection)for(var b=0;b<a.getNumGeometries();b++)this.add(a.getGeometryN(b))},jsts.algorithm.InteriorPointPoint.prototype.addPoint=function(a){var b=a.distance(this.centroid);b<this.minDistance&&(this.interiorPoint=new jsts.geom.Coordinate(a),this.minDistance=b)},jsts.algorithm.InteriorPointPoint.prototype.getInteriorPoint=function(){return this.interiorPoint},function(){jsts.geom.MultiLineString=function(a,b){this.geometries=a||[],this.factory=b},jsts.geom.MultiLineString.prototype=new jsts.geom.GeometryCollection,jsts.geom.MultiLineString.constructor=jsts.geom.MultiLineString,jsts.geom.MultiLineString.prototype.getBoundary=function(){return new jsts.operation.BoundaryOp(this).getBoundary()},jsts.geom.MultiLineString.prototype.equalsExact=function(a,b){return this.isEquivalentClass(a)?jsts.geom.GeometryCollection.prototype.equalsExact.call(this,a,b):!1},jsts.geom.MultiLineString.prototype.CLASS_NAME="jsts.geom.MultiLineString"}(),function(){var a=jsts.index.bintree.Interval,b=jsts.index.bintree.Root,c=function(){this.root=new b,this.minExtent=1};c.ensureExtent=function(b,c){var d,e;return d=b.getMin(),e=b.getMax(),d!==e?b:(d===e&&(d-=c/2,e=d+c/2),new a(d,e))},c.prototype.depth=function(){return null!==this.root?this.root.depth():0},c.prototype.size=function(){return null!==this.root?this.root.size():0},c.prototype.nodeSize=function(){return null!==this.root?this.root.nodeSize():0},c.prototype.insert=function(a,b){this.collectStats(a);var d=c.ensureExtent(a,this.minExtent);this.root.insert(d,b)},c.prototype.remove=function(a,b){var d=c.ensureExtent(a,this.minExtent);return this.root.remove(d,b)},c.prototype.iterator=function(){var a=new javascript.util.ArrayList;return this.root.addAllItems(a),a.iterator()},c.prototype.query=function(){if(2!==arguments.length){var b=arguments[0];return!b instanceof a&&(b=new a(b,b)),this.queryInterval(b)}this.queryAndAdd(arguments[0],arguments[1])},c.prototype.queryInterval=function(a){var b=new javascript.util.ArrayList;return this.query(a,b),b},c.prototype.queryAndAdd=function(a,b){this.root.addAllItemsFromOverlapping(a,b)},c.prototype.collectStats=function(a){var b=a.getWidth();b<this.minExtent&&b>0&&(this.minExtent=b)},jsts.index.bintree.Bintree=c}(),jsts.algorithm.InteriorPointArea=function(a){this.factory,this.interiorPoint=null,this.maxWidth=0,this.factory=a.getFactory(),this.add(a)},jsts.algorithm.InteriorPointArea.avg=function(a,b){return(a+b)/2},jsts.algorithm.InteriorPointArea.prototype.getInteriorPoint=function(){return this.interiorPoint},jsts.algorithm.InteriorPointArea.prototype.add=function(a){if(a instanceof jsts.geom.Polygon)this.addPolygon(a);else if(a instanceof jsts.geom.GeometryCollection)for(var b=0;b<a.getNumGeometries();b++)this.add(a.getGeometryN(b))},jsts.algorithm.InteriorPointArea.prototype.addPolygon=function(a){if(!a.isEmpty()){var b,c=0,d=this.horizontalBisector(a);if(0==d.getLength())c=0,b=d.getCoordinate();else{var e=d.intersection(a),f=this.widestGeometry(e);c=f.getEnvelopeInternal().getWidth(),b=this.centre(f.getEnvelopeInternal())}(null==this.interiorPoint||c>this.maxWidth)&&(this.interiorPoint=b,this.maxWidth=c)}},jsts.algorithm.InteriorPointArea.prototype.widestGeometry=function(a){if(a instanceof jsts.geom.GeometryCollection){var b=a;if(b.isEmpty())return b;for(var c=b.getGeometryN(0),d=1;d<b.getNumGeometries();d++)b.getGeometryN(d).getEnvelopeInternal().getWidth()>c.getEnvelopeInternal().getWidth()&&(c=b.getGeometryN(d));return c}return a instanceof jsts.geom.Geometry?a:void 0},jsts.algorithm.InteriorPointArea.prototype.horizontalBisector=function(a){var b=a.getEnvelopeInternal(),c=jsts.algorithm.SafeBisectorFinder.getBisectorY(a);return this.factory.createLineString([new jsts.geom.Coordinate(b.getMinX(),c),new jsts.geom.Coordinate(b.getMaxX(),c)])},jsts.algorithm.InteriorPointArea.prototype.centre=function(a){return new jsts.geom.Coordinate(jsts.algorithm.InteriorPointArea.avg(a.getMinX(),a.getMaxX()),jsts.algorithm.InteriorPointArea.avg(a.getMinY(),a.getMaxY()))},jsts.algorithm.SafeBisectorFinder=function(a){this.poly,this.centreY,this.hiY=Number.MAX_VALUE,this.loY=-Number.MAX_VALUE,this.poly=a,this.hiY=a.getEnvelopeInternal().getMaxY(),this.loY=a.getEnvelopeInternal().getMinY(),this.centreY=jsts.algorithm.InteriorPointArea.avg(this.loY,this.hiY)},jsts.algorithm.SafeBisectorFinder.getBisectorY=function(a){var b=new jsts.algorithm.SafeBisectorFinder(a);return b.getBisectorY()},jsts.algorithm.SafeBisectorFinder.prototype.getBisectorY=function(){this.process(this.poly.getExteriorRing());for(var a=0;a<this.poly.getNumInteriorRing();a++)this.process(this.poly.getInteriorRingN(a));var b=jsts.algorithm.InteriorPointArea.avg(this.hiY,this.loY);return b},jsts.algorithm.SafeBisectorFinder.prototype.process=function(a){for(var b=a.getCoordinateSequence(),c=0;c<b.length;c++){var d=b[c].y;this.updateInterval(d)}},jsts.algorithm.SafeBisectorFinder.prototype.updateInterval=function(a){a<=this.centreY?a>this.loY&&(this.loY=a):a>this.centreY&&a<this.hiY&&(this.hiY=a)},jsts.operation.buffer.BufferParameters=function(a,b,c,d){a&&this.setQuadrantSegments(a),b&&this.setEndCapStyle(b),c&&this.setJoinStyle(c),d&&this.setMitreLimit(d)},jsts.operation.buffer.BufferParameters.CAP_ROUND=1,jsts.operation.buffer.BufferParameters.CAP_FLAT=2,jsts.operation.buffer.BufferParameters.CAP_SQUARE=3,jsts.operation.buffer.BufferParameters.JOIN_ROUND=1,jsts.operation.buffer.BufferParameters.JOIN_MITRE=2,jsts.operation.buffer.BufferParameters.JOIN_BEVEL=3,jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS=8,jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT=5,jsts.operation.buffer.BufferParameters.prototype.quadrantSegments=jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS,jsts.operation.buffer.BufferParameters.prototype.endCapStyle=jsts.operation.buffer.BufferParameters.CAP_ROUND,jsts.operation.buffer.BufferParameters.prototype.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_ROUND,jsts.operation.buffer.BufferParameters.prototype.mitreLimit=jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT,jsts.operation.buffer.BufferParameters.prototype._isSingleSided=!1,jsts.operation.buffer.BufferParameters.prototype.getQuadrantSegments=function(){return this.quadrantSegments},jsts.operation.buffer.BufferParameters.prototype.setQuadrantSegments=function(a){this.quadrantSegments=a},jsts.operation.buffer.BufferParameters.prototype.setQuadrantSegments=function(a){this.quadrantSegments=a,0===this.quadrantSegments&&(this.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_BEVEL),this.quadrantSegments<0&&(this.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_MITRE,this.mitreLimit=Math.abs(this.quadrantSegments)),0>=a&&(this.quadrantSegments=1),this.joinStyle!==jsts.operation.buffer.BufferParameters.JOIN_ROUND&&(this.quadrantSegments=jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS)},jsts.operation.buffer.BufferParameters.bufferDistanceError=function(a){var b=Math.PI/2/a;return 1-Math.cos(b/2)},jsts.operation.buffer.BufferParameters.prototype.getEndCapStyle=function(){return this.endCapStyle},jsts.operation.buffer.BufferParameters.prototype.setEndCapStyle=function(a){this.endCapStyle=a},jsts.operation.buffer.BufferParameters.prototype.getJoinStyle=function(){return this.joinStyle},jsts.operation.buffer.BufferParameters.prototype.setJoinStyle=function(a){this.joinStyle=a},jsts.operation.buffer.BufferParameters.prototype.getMitreLimit=function(){return this.mitreLimit},jsts.operation.buffer.BufferParameters.prototype.setMitreLimit=function(a){this.mitreLimit=a},jsts.operation.buffer.BufferParameters.prototype.setSingleSided=function(a){this._isSingleSided=a},jsts.operation.buffer.BufferParameters.prototype.isSingleSided=function(){return this._isSingleSided},function(){jsts.geom.util.ShortCircuitedGeometryVisitor=function(){},jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.isDone=!1,jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.applyTo=function(a){for(var b=0;b<a.getNumGeometries()&&!this.isDone;b++){var c=a.getGeometryN(b);if(c instanceof jsts.geom.GeometryCollection)this.applyTo(c);else if(this.visit(c),this.isDone())return void(this.isDone=!0)}},jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.visit=function(a){},jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.isDone=function(){}}(),function(){var a=function(a){this.rectEnv=a};a.prototype=new jsts.geom.util.ShortCircuitedGeometryVisitor,a.constructor=a,a.prototype.rectEnv=null,a.prototype.intersects=!1,a.prototype.intersects=function(){return this.intersects},a.prototype.visit=function(a){var b=a.getEnvelopeInternal();return this.rectEnv.intersects(b)?this.rectEnv.contains(b)?void(this.intersects=!0):b.getMinX()>=rectEnv.getMinX()&&b.getMaxX()<=rectEnv.getMaxX()?void(this.intersects=!0):b.getMinY()>=rectEnv.getMinY()&&b.getMaxY()<=rectEnv.getMaxY()?void(this.intersects=!0):void 0:void 0},a.prototype.isDone=function(){return 1==this.intersects};var b=function(a){this.rectSeq=a.getExteriorRing().getCoordinateSequence(),this.rectEnv=a.getEnvelopeInternal()};b.prototype=new jsts.geom.util.ShortCircuitedGeometryVisitor,b.constructor=b,b.prototype.rectSeq=null,b.prototype.rectEnv=null,b.prototype.containsPoint=!1,b.prototype.containsPoint=function(){return this.containsPoint},b.prototype.visit=function(a){if(a instanceof jsts.geom.Polygon){var b=a.getEnvelopeInternal();if(this.rectEnv.intersects(b))for(var c=new jsts.geom.Coordinate,d=0;4>d;d++)if(this.rectSeq.getCoordinate(d,c),b.contains(c)&&SimplePointInAreaLocator.containsPointInPolygon(c,a))return void(this.containsPoint=!0)}},b.prototype.isDone=function(){return 1==this.containsPoint};var c=function(a){this.rectEnv=a.getEnvelopeInternal(),this.rectIntersector=new RectangleLineIntersector(rectEnv)};c.prototype=new jsts.geom.util.ShortCircuitedGeometryVisitor,c.constructor=c,c.prototype.rectEnv=null,c.prototype.rectIntersector=null,c.prototype.hasIntersection=!1,c.prototype.p0=null,c.prototype.p1=null,c.prototype.intersects=function(){return this.hasIntersection},c.prototype.visit=function(a){var b=a.getEnvelopeInternal();if(this.rectEnv.intersects(b)){var c=LinearComponentExtracter.getLines(a);this.checkIntersectionWithLineStrings(c)}},c.prototype.checkIntersectionWithLineStrings=function(a){for(var b=a.iterator();b.hasNext();){var c=b.next();if(this.checkIntersectionWithSegments(c),this.hasIntersection)return}},c.prototype.checkIntersectionWithSegments=function(a){for(var b=a.getCoordinateSequence(),c=1;c<b.length;c++)if(this.p0=b[c-1],this.p1=b[c],rectIntersector.intersects(p0,p1))return void(this.hasIntersection=!0)},c.prototype.isDone=function(){return 1==this.hasIntersection},jsts.operation.predicate.RectangleIntersects=function(a){this.rectangle=a,this.rectEnv=a.getEnvelopeInternal()},jsts.operation.predicate.RectangleIntersects.intersects=function(a,b){var c=new jsts.operation.predicate.RectangleIntersects(a);return c.intersects(b)},jsts.operation.predicate.RectangleIntersects.prototype.rectangle=null,jsts.operation.predicate.RectangleIntersects.prototype.rectEnv=null,jsts.operation.predicate.RectangleIntersects.prototype.intersects=function(d){if(!this.rectEnv.intersects(d.getEnvelopeInternal()))return!1;var e=new a(this.rectEnv);if(e.applyTo(d),e.intersects())return!0;var f=new b(rectangle);if(f.applyTo(d),f.containsPoint())return!0;var g=new c(rectangle);return g.applyTo(d),g.intersects()?!0:!1}}(),jsts.operation.buffer.BufferBuilder=function(a){this.bufParams=a,this.edgeList=new jsts.geomgraph.EdgeList},jsts.operation.buffer.BufferBuilder.depthDelta=function(a){var b=a.getLocation(0,jsts.geomgraph.Position.LEFT),c=a.getLocation(0,jsts.geomgraph.Position.RIGHT);return b===jsts.geom.Location.INTERIOR&&c===jsts.geom.Location.EXTERIOR?1:b===jsts.geom.Location.EXTERIOR&&c===jsts.geom.Location.INTERIOR?-1:0},jsts.operation.buffer.BufferBuilder.prototype.bufParams=null,jsts.operation.buffer.BufferBuilder.prototype.workingPrecisionModel=null,jsts.operation.buffer.BufferBuilder.prototype.workingNoder=null,jsts.operation.buffer.BufferBuilder.prototype.geomFact=null,jsts.operation.buffer.BufferBuilder.prototype.graph=null,jsts.operation.buffer.BufferBuilder.prototype.edgeList=null,jsts.operation.buffer.BufferBuilder.prototype.setWorkingPrecisionModel=function(a){this.workingPrecisionModel=a},jsts.operation.buffer.BufferBuilder.prototype.setNoder=function(a){this.workingNoder=a},jsts.operation.buffer.BufferBuilder.prototype.buffer=function(a,b){var c=this.workingPrecisionModel;null===c&&(c=a.getPrecisionModel()),this.geomFact=a.getFactory();var d=new jsts.operation.buffer.OffsetCurveBuilder(c,this.bufParams),e=new jsts.operation.buffer.OffsetCurveSetBuilder(a,b,d),f=e.getCurves();if(f.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(f,c),this.graph=new jsts.geomgraph.PlanarGraph(new jsts.operation.overlay.OverlayNodeFactory),this.graph.addEdges(this.edgeList.getEdges());var g=this.createSubgraphs(this.graph),h=new jsts.operation.overlay.PolygonBuilder(this.geomFact);this.buildSubgraphs(g,h);var i=h.getPolygons();if(i.size()<=0)return this.createEmptyResultGeometry();var j=this.geomFact.buildGeometry(i);return j},jsts.operation.buffer.BufferBuilder.prototype.getNoder=function(a){if(null!==this.workingNoder)return this.workingNoder;var b=new jsts.noding.MCIndexNoder,c=new jsts.algorithm.RobustLineIntersector;return c.setPrecisionModel(a),b.setSegmentIntersector(new jsts.noding.IntersectionAdder(c)),b},jsts.operation.buffer.BufferBuilder.prototype.computeNodedEdges=function(a,b){var c=this.getNoder(b);c.computeNodes(a);for(var d=c.getNodedSubstrings(),e=d.iterator();e.hasNext();){var f=e.next(),g=f.getData(),h=new jsts.geomgraph.Edge(f.getCoordinates(),new jsts.geomgraph.Label(g));this.insertUniqueEdge(h)}},jsts.operation.buffer.BufferBuilder.prototype.insertUniqueEdge=function(a){var b=this.edgeList.findEqualEdge(a);if(null!=b){var c=b.getLabel(),d=a.getLabel();b.isPointwiseEqual(a)||(d=new jsts.geomgraph.Label(a.getLabel()),d.flip()),c.merge(d);var e=jsts.operation.buffer.BufferBuilder.depthDelta(d),f=b.getDepthDelta(),g=f+e;b.setDepthDelta(g)}else this.edgeList.add(a),a.setDepthDelta(jsts.operation.buffer.BufferBuilder.depthDelta(a.getLabel()))},jsts.operation.buffer.BufferBuilder.prototype.createSubgraphs=function(a){for(var b=[],c=a.getNodes().iterator();c.hasNext();){var d=c.next();if(!d.isVisited()){var e=new jsts.operation.buffer.BufferSubgraph;e.create(d),b.push(e)}}var f=function(a,b){return a.compareTo(b)};return b.sort(f),b.reverse(),b},jsts.operation.buffer.BufferBuilder.prototype.buildSubgraphs=function(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d],f=e.getRightmostCoordinate(),g=new jsts.operation.buffer.SubgraphDepthLocater(c),h=g.getDepth(f);e.computeDepth(h),e.findResultEdges(),c.push(e),b.add(e.getDirectedEdges(),e.getNodes())}},jsts.operation.buffer.BufferBuilder.convertSegStrings=function(a){for(var b=new jsts.geom.GeometryFactory,c=new javascript.util.ArrayList;a.hasNext();){var d=a.next(),e=b.createLineString(d.getCoordinates());c.add(e)}return b.buildGeometry(c)},jsts.operation.buffer.BufferBuilder.prototype.createEmptyResultGeometry=function(){var a=this.geomFact.createPolygon(null,null);return a},jsts.noding.SegmentPointComparator=function(){},jsts.noding.SegmentPointComparator.compare=function(a,b,c){if(b.equals2D(c))return 0;var d=jsts.noding.SegmentPointComparator.relativeSign(b.x,c.x),e=jsts.noding.SegmentPointComparator.relativeSign(b.y,c.y);switch(a){case 0:return jsts.noding.SegmentPointComparator.compareValue(d,e);case 1:return jsts.noding.SegmentPointComparator.compareValue(e,d);case 2:return jsts.noding.SegmentPointComparator.compareValue(e,-d);case 3:return jsts.noding.SegmentPointComparator.compareValue(-d,e);case 4:return jsts.noding.SegmentPointComparator.compareValue(-d,-e);case 5:return jsts.noding.SegmentPointComparator.compareValue(-e,-d);case 6:return jsts.noding.SegmentPointComparator.compareValue(-e,d);case 7:return jsts.noding.SegmentPointComparator.compareValue(d,-e)}return 0},jsts.noding.SegmentPointComparator.relativeSign=function(a,b){return b>a?-1:a>b?1:0},jsts.noding.SegmentPointComparator.compareValue=function(a,b){return 0>a?-1:a>0?1:0>b?-1:b>0?1:0},jsts.operation.relate.RelateOp=function(){jsts.operation.GeometryGraphOperation.apply(this,arguments),this._relate=new jsts.operation.relate.RelateComputer(this.arg)},jsts.operation.relate.RelateOp.prototype=new jsts.operation.GeometryGraphOperation,jsts.operation.relate.RelateOp.relate=function(a,b,c){var d=new jsts.operation.relate.RelateOp(a,b,c),e=d.getIntersectionMatrix();return e},jsts.operation.relate.RelateOp.prototype._relate=null,jsts.operation.relate.RelateOp.prototype.getIntersectionMatrix=function(){return this._relate.computeIM()},jsts.index.chain.MonotoneChain=function(a,b,c,d){this.pts=a,this.start=b,this.end=c,this.context=d},jsts.index.chain.MonotoneChain.prototype.pts=null,jsts.index.chain.MonotoneChain.prototype.start=null,jsts.index.chain.MonotoneChain.prototype.end=null,jsts.index.chain.MonotoneChain.prototype.env=null,jsts.index.chain.MonotoneChain.prototype.context=null,jsts.index.chain.MonotoneChain.prototype.id=null,jsts.index.chain.MonotoneChain.prototype.setId=function(a){this.id=a},jsts.index.chain.MonotoneChain.prototype.getId=function(){return this.id},jsts.index.chain.MonotoneChain.prototype.getContext=function(){return this.context},jsts.index.chain.MonotoneChain.prototype.getEnvelope=function(){if(null==this.env){var a=this.pts[this.start],b=this.pts[this.end];this.env=new jsts.geom.Envelope(a,b)}return this.env},jsts.index.chain.MonotoneChain.prototype.getStartIndex=function(){return this.start},jsts.index.chain.MonotoneChain.prototype.getEndIndex=function(){return this.end},jsts.index.chain.MonotoneChain.prototype.getLineSegment=function(a,b){b.p0=this.pts[a],b.p1=this.pts[a+1]},jsts.index.chain.MonotoneChain.prototype.getCoordinates=function(){for(var a=[],b=0,c=this.start;c<=this.end;c++)a[b++]=this.pts[c];return a},jsts.index.chain.MonotoneChain.prototype.select=function(a,b){this.computeSelect2(a,this.start,this.end,b)},jsts.index.chain.MonotoneChain.prototype.computeSelect2=function(a,b,c,d){var e=this.pts[b],f=this.pts[c];if(d.tempEnv1.init(e,f),c-b===1)return void d.select(this,b);if(a.intersects(d.tempEnv1)){var g=parseInt((b+c)/2);g>b&&this.computeSelect2(a,b,g,d),c>g&&this.computeSelect2(a,g,c,d)}},jsts.index.chain.MonotoneChain.prototype.computeOverlaps=function(a,b){return 6===arguments.length?this.computeOverlaps2.apply(this,arguments):void this.computeOverlaps2(this.start,this.end,a,a.start,a.end,b)},jsts.index.chain.MonotoneChain.prototype.computeOverlaps2=function(a,b,c,d,e,f){var g=this.pts[a],h=this.pts[b],i=c.pts[d],j=c.pts[e];if(b-a===1&&e-d===1)return void f.overlap(this,a,c,d);if(f.tempEnv1.init(g,h),f.tempEnv2.init(i,j),f.tempEnv1.intersects(f.tempEnv2)){var k=parseInt((a+b)/2),l=parseInt((d+e)/2);k>a&&(l>d&&this.computeOverlaps2(a,k,c,d,l,f),e>l&&this.computeOverlaps2(a,k,c,l,e,f)),b>k&&(l>d&&this.computeOverlaps2(k,b,c,d,l,f),e>l&&this.computeOverlaps2(k,b,c,l,e,f))}},function(){var a=jsts.geom.Location,b=jsts.geom.Dimension;jsts.geom.IntersectionMatrix=function(c){var d=c;void 0===c||null===c?(this.matrix=[[],[],[]],this.setAll(b.FALSE)):"string"==typeof c?this.set(c):d instanceof jsts.geom.IntersectionMatrix&&(this.matrix[a.INTERIOR][a.INTERIOR]=d.matrix[a.INTERIOR][a.INTERIOR],this.matrix[a.INTERIOR][a.BOUNDARY]=d.matrix[a.INTERIOR][a.BOUNDARY],this.matrix[a.INTERIOR][a.EXTERIOR]=d.matrix[a.INTERIOR][a.EXTERIOR],this.matrix[a.BOUNDARY][a.INTERIOR]=d.matrix[a.BOUNDARY][a.INTERIOR],this.matrix[a.BOUNDARY][a.BOUNDARY]=d.matrix[a.BOUNDARY][a.BOUNDARY],this.matrix[a.BOUNDARY][a.EXTERIOR]=d.matrix[a.BOUNDARY][a.EXTERIOR],this.matrix[a.EXTERIOR][a.INTERIOR]=d.matrix[a.EXTERIOR][a.INTERIOR],this.matrix[a.EXTERIOR][a.BOUNDARY]=d.matrix[a.EXTERIOR][a.BOUNDARY],this.matrix[a.EXTERIOR][a.EXTERIOR]=d.matrix[a.EXTERIOR][a.EXTERIOR])},jsts.geom.IntersectionMatrix.prototype.matrix=null,jsts.geom.IntersectionMatrix.prototype.add=function(a){var b,c;for(b=0;3>b;b++)for(c=0;3>c;c++)this.setAtLeast(b,c,a.get(b,c))},jsts.geom.IntersectionMatrix.matches=function(a,c){return"string"==typeof a?jsts.geom.IntersectionMatrix.matches2.call(this,arguments):"*"===c?!0:"T"===c&&(a>=0||a===b.TRUE)?!0:"F"===c&&a===b.FALSE?!0:"0"===c&&a===b.P?!0:"1"===c&&a===b.L?!0:"2"===c&&a===b.A?!0:!1},jsts.geom.IntersectionMatrix.matches2=function(a,b){var c=new jsts.geom.IntersectionMatrix(a);return c.matches(b)},jsts.geom.IntersectionMatrix.prototype.set=function(a,b,c){return"string"==typeof a?void this.set2(a):void(this.matrix[a][b]=c)},jsts.geom.IntersectionMatrix.prototype.set2=function(a){for(var c=0;c<a.length();c++){var d=c/3,e=c%3;this.matrix[d][e]=b.toDimensionValue(a.charAt(c))}},jsts.geom.IntersectionMatrix.prototype.setAtLeast=function(a,b,c){return 1===arguments.length?void this.setAtLeast2(arguments[0]):void(this.matrix[a][b]<c&&(this.matrix[a][b]=c))},jsts.geom.IntersectionMatrix.prototype.setAtLeastIfValid=function(a,b,c){a>=0&&b>=0&&this.setAtLeast(a,b,c)},jsts.geom.IntersectionMatrix.prototype.setAtLeast2=function(a){var b;for(b=0;b<a.length;b++){var c=parseInt(b/3),d=parseInt(b%3);this.setAtLeast(c,d,jsts.geom.Dimension.toDimensionValue(a.charAt(b)))}},jsts.geom.IntersectionMatrix.prototype.setAll=function(a){var b,c;for(b=0;3>b;b++)for(c=0;3>c;c++)this.matrix[b][c]=a},jsts.geom.IntersectionMatrix.prototype.get=function(a,b){return this.matrix[a][b]},jsts.geom.IntersectionMatrix.prototype.isDisjoint=function(){return this.matrix[a.INTERIOR][a.INTERIOR]===b.FALSE&&this.matrix[a.INTERIOR][a.BOUNDARY]===b.FALSE&&this.matrix[a.BOUNDARY][a.INTERIOR]===b.FALSE&&this.matrix[a.BOUNDARY][a.BOUNDARY]===b.FALSE},jsts.geom.IntersectionMatrix.prototype.isIntersects=function(){return!this.isDisjoint()},jsts.geom.IntersectionMatrix.prototype.isTouches=function(c,d){return c>d?this.isTouches(d,c):c==b.A&&d==b.A||c==b.L&&d==b.L||c==b.L&&d==b.A||c==b.P&&d==b.A||c==b.P&&d==b.L?this.matrix[a.INTERIOR][a.INTERIOR]===b.FALSE&&(jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.BOUNDARY],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.BOUNDARY][a.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.BOUNDARY][a.BOUNDARY],"T")):!1},jsts.geom.IntersectionMatrix.prototype.isCrosses=function(c,d){return c==b.P&&d==b.L||c==b.P&&d==b.A||c==b.L&&d==b.A?jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.INTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.EXTERIOR],"T"):c==b.L&&d==b.P||c==b.A&&d==b.P||c==b.A&&d==b.L?jsts.geom.IntersectionMatrix.matches(matrix[a.INTERIOR][a.INTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[a.EXTERIOR][a.INTERIOR],"T"):c===b.L&&d===b.L?0===this.matrix[a.INTERIOR][a.INTERIOR]:!1},jsts.geom.IntersectionMatrix.prototype.isWithin=function(){return jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.INTERIOR],"T")&&this.matrix[a.INTERIOR][a.EXTERIOR]==b.FALSE&&this.matrix[a.BOUNDARY][a.EXTERIOR]==b.FALSE},jsts.geom.IntersectionMatrix.prototype.isContains=function(){return jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.INTERIOR],"T")&&this.matrix[a.EXTERIOR][a.INTERIOR]==b.FALSE&&this.matrix[a.EXTERIOR][a.BOUNDARY]==b.FALSE},jsts.geom.IntersectionMatrix.prototype.isCovers=function(){var c=jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.BOUNDARY],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.BOUNDARY][a.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.BOUNDARY][a.BOUNDARY],"T");return c&&this.matrix[a.EXTERIOR][a.INTERIOR]==b.FALSE&&this.matrix[a.EXTERIOR][a.BOUNDARY]==b.FALSE},jsts.geom.IntersectionMatrix.prototype.isCoveredBy=function(){var c=jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.BOUNDARY],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.BOUNDARY][a.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[a.BOUNDARY][a.BOUNDARY],"T");
  return c&&this.matrix[a.INTERIOR][a.EXTERIOR]===b.FALSE&&this.matrix[a.BOUNDARY][a.EXTERIOR]===b.FALSE},jsts.geom.IntersectionMatrix.prototype.isEquals=function(c,d){return c!==d?!1:jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.INTERIOR],"T")&&this.matrix[a.EXTERIOR][a.INTERIOR]===b.FALSE&&this.matrix[a.INTERIOR][a.EXTERIOR]===b.FALSE&&this.matrix[a.EXTERIOR][a.BOUNDARY]===b.FALSE&&this.matrix[a.BOUNDARY][a.EXTERIOR]===b.FALSE},jsts.geom.IntersectionMatrix.prototype.isOverlaps=function(c,d){return c==b.P&&d===b.P||c==b.A&&d===b.A?jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.INTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.EXTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[a.EXTERIOR][a.INTERIOR],"T"):c===b.L&&d===b.L?1==this.matrix[a.INTERIOR][a.INTERIOR]&&jsts.geom.IntersectionMatrix.matches(this.matrix[a.INTERIOR][a.EXTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[a.EXTERIOR][a.INTERIOR],"T"):!1},jsts.geom.IntersectionMatrix.prototype.matches=function(a){if(9!=a.length)throw new jsts.error.IllegalArgumentException("Should be length 9: "+a);for(var b=0;3>b;b++)for(var c=0;3>c;c++)if(!jsts.geom.IntersectionMatrix.matches(this.matrix[b][c],a.charAt(3*b+c)))return!1;return!0},jsts.geom.IntersectionMatrix.prototype.transpose=function(){var a=matrix[1][0];return this.matrix[1][0]=this.matrix[0][1],this.matrix[0][1]=a,a=this.matrix[2][0],this.matrix[2][0]=this.matrix[0][2],this.matrix[0][2]=a,a=this.matrix[2][1],this.matrix[2][1]=this.matrix[1][2],this.matrix[1][2]=a,this},jsts.geom.IntersectionMatrix.prototype.toString=function(){var a,c,d="";for(a=0;3>a;a++)for(c=0;3>c;c++)d+=b.toDimensionSymbol(this.matrix[a][c]);return d}}(),jsts.triangulate.quadedge.LastFoundQuadEdgeLocator=function(a){this.subdiv=a,this.lastEdge=null,this.init()},jsts.triangulate.quadedge.LastFoundQuadEdgeLocator.prototype.init=function(){this.lastEdge=this.findEdge()},jsts.triangulate.quadedge.LastFoundQuadEdgeLocator.prototype.findEdge=function(){var a=this.subdiv.getEdges();return a[0]},jsts.triangulate.quadedge.LastFoundQuadEdgeLocator.prototype.locate=function(a){this.lastEdge.isLive()||this.init();var b=this.subdiv.locateFromEdge(a,this.lastEdge);return this.lastEdge=b,b},jsts.noding.SegmentNodeList=function(a){this.nodeMap=new javascript.util.TreeMap,this.edge=a},jsts.noding.SegmentNodeList.prototype.nodeMap=null,jsts.noding.SegmentNodeList.prototype.iterator=function(){return this.nodeMap.values().iterator()},jsts.noding.SegmentNodeList.prototype.edge=null,jsts.noding.SegmentNodeList.prototype.getEdge=function(){return this.edge},jsts.noding.SegmentNodeList.prototype.add=function(a,b){var c=new jsts.noding.SegmentNode(this.edge,a,b,this.edge.getSegmentOctant(b)),d=this.nodeMap.get(c);return null!==d?(jsts.util.Assert.isTrue(d.coord.equals2D(a),"Found equal nodes with different coordinates"),d):(this.nodeMap.put(c,c),c)},jsts.noding.SegmentNodeList.prototype.addEndpoints=function(){var a=this.edge.size()-1;this.add(this.edge.getCoordinate(0),0),this.add(this.edge.getCoordinate(a),a)},jsts.noding.SegmentNodeList.prototype.addCollapsedNodes=function(){var a=[];this.findCollapsesFromInsertedNodes(a),this.findCollapsesFromExistingVertices(a);for(var b=0;b<a.length;b++){var c=a[b];this.add(this.edge.getCoordinate(c),c)}},jsts.noding.SegmentNodeList.prototype.findCollapsesFromExistingVertices=function(a){for(var b=0;b<this.edge.size()-2;b++){var c=this.edge.getCoordinate(b),d=(this.edge.getCoordinate(b+1),this.edge.getCoordinate(b+2));c.equals2D(d)&&a.push(b+1)}},jsts.noding.SegmentNodeList.prototype.findCollapsesFromInsertedNodes=function(a){for(var b=[null],c=this.iterator(),d=c.next();c.hasNext();){var e=c.next(),f=this.findCollapseIndex(d,e,b);f&&a.push(b[0]),d=e}},jsts.noding.SegmentNodeList.prototype.findCollapseIndex=function(a,b,c){if(!a.coord.equals2D(b.coord))return!1;var d=b.segmentIndex-a.segmentIndex;return b.isInterior()||d--,1===d?(c[0]=a.segmentIndex+1,!0):!1},jsts.noding.SegmentNodeList.prototype.addSplitEdges=function(a){this.addEndpoints(),this.addCollapsedNodes();for(var b=this.iterator(),c=b.next();b.hasNext();){var d=b.next(),e=this.createSplitEdge(c,d);a.add(e),c=d}},jsts.noding.SegmentNodeList.prototype.checkSplitEdgesCorrectness=function(a){var b=edge.getCoordinates(),c=a[0],d=c.getCoordinate(0);if(!d.equals2D(b[0]))throw new Error("bad split edge start point at "+d);var e=a[a.length-1],f=e.getCoordinates(),g=f[f.length-1];if(!g.equals2D(b[b.length-1]))throw new Error("bad split edge end point at "+g)},jsts.noding.SegmentNodeList.prototype.createSplitEdge=function(a,b){var c=b.segmentIndex-a.segmentIndex+2,d=this.edge.getCoordinate(b.segmentIndex),e=b.isInterior()||!b.coord.equals2D(d);e||c--;var f=[],g=0;f[g++]=new jsts.geom.Coordinate(a.coord);for(var h=a.segmentIndex+1;h<=b.segmentIndex;h++)f[g++]=this.edge.getCoordinate(h);return e&&(f[g]=b.coord),new jsts.noding.NodedSegmentString(f,this.edge.getData())},jsts.io.WKTWriter=function(){this.parser=new jsts.io.WKTParser(this.geometryFactory)},jsts.io.WKTWriter.prototype.write=function(a){var b=this.parser.write(a);return b},jsts.io.WKTWriter.toLineString=function(a,b){if(2!==arguments.length)throw new jsts.error.NotImplementedError;return"LINESTRING ( "+a.x+" "+a.y+", "+b.x+" "+b.y+" )"},jsts.io.WKTReader=function(a){this.geometryFactory=a||new jsts.geom.GeometryFactory,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new jsts.io.WKTParser(this.geometryFactory)},jsts.io.WKTReader.prototype.read=function(a){var b=this.parser.read(a);return this.precisionModel.getType()===jsts.geom.PrecisionModel.FIXED&&this.reducePrecision(b),b},jsts.io.WKTReader.prototype.reducePrecision=function(a){var b,c;if(a.coordinate)this.precisionModel.makePrecise(a.coordinate);else if(a.points)for(b=0,c=a.points.length;c>b;b++)this.precisionModel.makePrecise(a.points[b]);else if(a.geometries)for(b=0,c=a.geometries.length;c>b;b++)this.reducePrecision(a.geometries[b])},jsts.triangulate.quadedge.QuadEdgeSubdivision=function(a,b){this.tolerance=b,this.edgeCoincidenceTolerance=b/jsts.triangulate.quadedge.QuadEdgeSubdivision.EDGE_COINCIDENCE_TOL_FACTOR,this.visitedKey=0,this.quadEdges=[],this.startingEdge,this.tolerance,this.edgeCoincidenceTolerance,this.frameEnv,this.locator=null,this.seg=new jsts.geom.LineSegment,this.triEdges=new Array(3),this.frameVertex=new Array(3),this.createFrame(a),this.startingEdge=this.initSubdiv(),this.locator=new jsts.triangulate.quadedge.LastFoundQuadEdgeLocator(this)},jsts.triangulate.quadedge.QuadEdgeSubdivision.EDGE_COINCIDENCE_TOL_FACTOR=1e3,jsts.triangulate.quadedge.QuadEdgeSubdivision.getTriangleEdges=function(a,b){if(b[0]=a,b[1]=b[0].lNext(),b[2]=b[1].lNext(),b[2].lNext()!=b[0])throw new jsts.IllegalArgumentError("Edges do not form a triangle")},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.createFrame=function(a){var b,c,d;b=a.getWidth(),c=a.getHeight(),d=0,d=b>c?10*b:10*c,this.frameVertex[0]=new jsts.triangulate.quadedge.Vertex((a.getMaxX()+a.getMinX())/2,a.getMaxY()+d),this.frameVertex[1]=new jsts.triangulate.quadedge.Vertex(a.getMinX()-d,a.getMinY()-d),this.frameVertex[2]=new jsts.triangulate.quadedge.Vertex(a.getMaxX()+d,a.getMinY()-d),this.frameEnv=new jsts.geom.Envelope(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate()),this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.initSubdiv=function(){var a,b,c;return a=this.makeEdge(this.frameVertex[0],this.frameVertex[1]),b=this.makeEdge(this.frameVertex[1],this.frameVertex[2]),jsts.triangulate.quadedge.QuadEdge.splice(a.sym(),b),c=this.makeEdge(this.frameVertex[2],this.frameVertex[0]),jsts.triangulate.quadedge.QuadEdge.splice(b.sym(),c),jsts.triangulate.quadedge.QuadEdge.splice(c.sym(),a),a},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTolerance=function(){return this.tolerance},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getEnvelope=function(){return new jsts.geom.Envelope(this.frameEnv)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getEdges=function(){return arguments.length>0?this.getEdgesByFactory(arguments[0]):this.quadEdges},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.setLocator=function(a){this.locator=a},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.makeEdge=function(a,b){var c=jsts.triangulate.quadedge.QuadEdge.makeEdge(a,b);return this.quadEdges.push(c),c},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.connect=function(a,b){var c=jsts.triangulate.quadedge.QuadEdge.connect(a,b);return this.quadEdges.push(c),c},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.delete_jsts=function(a){jsts.triangulate.quadedge.QuadEdge.splice(a,a.oPrev()),jsts.triangulate.quadedge.QuadEdge.splice(a.sym(),a.sym().oPrev());var b,c,d;a.eSym=a.sym(),c=a.rot,d=a.rot.sym();var e=this.quadEdges.indexOf(a);-1!==e&&this.quadEdges.splice(e,1),e=this.quadEdges.indexOf(b),-1!==e&&this.quadEdges.splice(e,1),e=this.quadEdges.indexOf(c),-1!==e&&this.quadEdges.splice(e,1),e=this.quadEdges.indexOf(d),-1!==e&&this.quadEdges.splice(e,1),a.delete_jsts(),b.delete_jsts(),c.delete_jsts(),d.delete_jsts()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateFromEdge=function(a,b){var c,d=0,e=this.quadEdges.length;for(c=b;;){if(d++,d>e)throw new jsts.error.LocateFailureError(c.toLineSegment());if(a.equals(c.orig())||a.equals(c.dest()))break;if(a.rightOf(c))c=c.sym();else if(a.rightOf(c.oNext())){if(a.rightOf(c.dPrev()))break;c=c.dPrev()}else c=c.oNext()}return c},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locate=function(){return 1===arguments.length?arguments[0]instanceof jsts.triangulate.quadedge.Vertex?this.locateByVertex(arguments[0]):this.locateByCoordinate(arguments[0]):this.locateByCoordinates(arguments[0],arguments[1])},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateByVertex=function(a){return this.locator.locate(a)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateByCoordinate=function(a){return this.locator.locate(new jsts.triangulate.quadedge.Vertex(a))},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateByCoordinates=function(a,b){var c,d,e,c=this.locator.locate(new jsts.triangulate.quadedge.Vertex(a));if(null===c)return null;d=c,c.dest().getCoordinate().equals2D(a)&&(d=c.sym()),e=d;do{if(e.dest().getCoordinate().equals2D(b))return e;e=e.oNext()}while(e!=d);return null},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.insertSite=function(a){var b,c,d;if(b=this.locate(a),a.equals(b.orig(),this.tolerance)||a.equals(b.dest(),this.tolerance))return b;c=this.makeEdge(b.orig(),a),jsts.triangulate.quadedge.QuadEdge.splice(c,b),d=c;do c=this.connect(b,c.sym()),b=c.oPrev();while(b.lNext()!=d);return d},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isFrameEdge=function(a){return this.isFrameVertex(a.orig())||this.isFrameVertex(a.dest())?!0:!1},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isFrameBorderEdge=function(a){var b,c,d,e;return b=new Array(3),this.getTriangleEdges(a,b),c=new Array(3),this.getTriangleEdges(a.sym(),c),d=a.lNext().dest(),this.isFrameVertex(d)?!0:(e=a.sym().lNext().dest(),this.isFrameVertex(e)?!0:!1)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isFrameVertex=function(a){return a.equals(this.frameVertex[0])?!0:a.equals(this.frameVertex[1])?!0:a.equals(this.frameVertex[2])?!0:!1},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isOnEdge=function(a,b){this.seg.setCoordinates(a.orig().getCoordinate(),a.dest().getCoordinate());var c=this.seg.distance(b);return c<this.edgeCoincidenceTolerance},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isVertexOfEdge=function(a,b){return b.equals(a.orig(),this.tolerance)||b.equals(a.dest(),this.tolerance)?!0:!1},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVertices=function(a){var b,c,d,e,f,g=[];for(b=0,c=this.quadEdges.length,b;c>b;b++)d=this.quadEdges[b],e=d.orig(),(a||!this.isFrameVertex(e))&&g.push(e),f=d.dest(),(a||!this.isFrameVertex(f))&&g.push(f);return g},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVertexUniqueEdges=function(a){var b,c,d,e,f,g,h,i;for(b=[],c=[],d=0,e=this.quadEdges.length,d;e>d;d++)f=this.quadEdges[d],g=f.orig(),-1===c.indexOf(g)&&(c.push(g),(a||!this.isFrameVertex(g))&&b.push(f)),h=f.sym(),i=h.orig(),-1===c.indexOf(i)&&(c.push(i),(a||!this.isFrameVertex(i))&&b.push(h));return b},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getPrimaryEdges=function(a){this.visitedKey++;var b,c,d,e,f;for(b=[],c=[],c.push(this.startingEdge),d=[];c.length>0;)e=c.pop(),-1===d.indexOf(e)&&(f=e.getPrimary(),(a||!this.isFrameEdge(f))&&b.push(f),c.push(e.oNext()),c.push(e.sym().oNext()),d.push(e),d.push(e.sym()));return b},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.visitTriangles=function(a,b){this.visitedKey++;var c,d,e,f;for(c=[],c.push(this.startingEdge),d=[];c.length>0;)e=c.pop(),-1===d.indexOf(e)&&(f=this.fetchTriangleToVisit(e,c,b,d),null!==f&&a.visit(f))},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.fetchTriangleToVisit=function(a,b,c,d){var e,f,g,h;e=a,f=0,g=!1;do this.triEdges[f]=e,this.isFrameEdge(e)&&(g=!0),h=e.sym(),-1===d.indexOf(h)&&b.push(h),d.push(e),f++,e=e.lNext();while(e!==a);return g&&!c?null:this.triEdges},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangleEdges=function(a){var b=new jsts.triangulate.quadedge.TriangleEdgesListVisitor;return this.visitTriangles(b,a),b.getTriangleEdges()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangleVertices=function(a){var b=new TriangleVertexListVisitor;return this.visitTriangles(b,a),b.getTriangleVertices()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangleCoordinates=function(a){var b=new jsts.triangulate.quadedge.TriangleCoordinatesVisitor;return this.visitTriangles(b,a),b.getTriangles()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getEdgesByFactory=function(a){var b,c,d,e,f,g;for(b=this.getPrimaryEdges(!1),c=[],d=0,e=b.length,d;e>d;d++)f=b[d],g=[],g[0]=f.orig().getCoordinate(),g[1]=f.dest().getCoordinate(),c[d]=a.createLineString(g);return a.createMultiLineString(c)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangles=function(a){var b,c,d,e,f;for(b=this.getTriangleCoordinates(!1),c=new Array(b.length),e=0,f=b.length,e;f>e;e++)d=b[e],c[e]=a.createPolygon(a.createLinearRing(d,null));return a.createGeometryCollection(c)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVoronoiDiagram=function(a){var b=this.getVoronoiCellPolygons(a);return a.createGeometryCollection(b)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVoronoiCellPolygons=function(a){this.visitTriangles(new jsts.triangulate.quadedge.TriangleCircumcentreVisitor,!0);var b,c,d,e,f;for(b=[],c=this.getVertexUniqueEdges(!1),d=0,e=c.length,d;e>d;d++)f=c[d],b.push(this.getVoronoiCellPolygon(f,a));return b},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVoronoiCellPolygon=function(a,b){var c,d,e,f,g;c=[],startQE=a;do d=a.rot.orig().getCoordinate(),c.push(d),a=a.oPrev();while(a!==startQE);return e=new jsts.geom.CoordinateList([],!1),e.add(c,!1),e.closeRing(),e.size()<4&&e.add(e.get(e.size()-1),!0),f=b.createPolygon(b.createLinearRing(e.toArray()),null),g=startQE.orig(),f},jsts.triangulate.quadedge.TriangleCircumcentreVisitor=function(){},jsts.triangulate.quadedge.TriangleCircumcentreVisitor.prototype.visit=function(a){var b,c,d,e,f,g;for(b=a[0].orig().getCoordinate(),c=a[1].orig().getCoordinate(),d=a[2].orig().getCoordinate(),e=jsts.geom.Triangle.circumcentre(b,c,d),f=new jsts.triangulate.quadedge.Vertex(e),g=0;3>g;g++)a[g].rot.setOrig(f)},jsts.triangulate.quadedge.TriangleEdgesListVisitor=function(){this.triList=[]},jsts.triangulate.quadedge.TriangleEdgesListVisitor.prototype.visit=function(a){var b=a.concat();this.triList.push(b)},jsts.triangulate.quadedge.TriangleEdgesListVisitor.prototype.getTriangleEdges=function(){return this.triList},jsts.triangulate.quadedge.TriangleVertexListVisitor=function(){this.triList=[]},jsts.triangulate.quadedge.TriangleVertexListVisitor.prototype.visit=function(a){var b=[];b.push(trieEdges[0].orig()),b.push(trieEdges[1].orig()),b.push(trieEdges[2].orig()),this.triList.push(b)},jsts.triangulate.quadedge.TriangleVertexListVisitor.prototype.getTriangleVertices=function(){return this.triList},jsts.triangulate.quadedge.TriangleCoordinatesVisitor=function(){this.coordList=new jsts.geom.CoordinateList([],!1),this.triCoords=[]},jsts.triangulate.quadedge.TriangleCoordinatesVisitor.prototype.visit=function(a){this.coordList=new jsts.geom.CoordinateList([],!1);var b,c,d=0;for(d;3>d;d++)b=a[d].orig(),this.coordList.add(b.getCoordinate());if(this.coordList.size()>0){if(this.coordList.closeRing(),c=this.coordList.toArray(),4!==c.length)return;this.triCoords.push(c)}},jsts.triangulate.quadedge.TriangleCoordinatesVisitor.prototype.getTriangles=function(){return this.triCoords},jsts.operation.relate.EdgeEndBundle=function(){this.edgeEnds=[];var a=arguments[0]instanceof jsts.geomgraph.EdgeEnd?arguments[0]:arguments[1],b=a.getEdge(),c=a.getCoordinate(),d=a.getDirectedCoordinate(),e=new jsts.geomgraph.Label(a.getLabel());jsts.geomgraph.EdgeEnd.call(this,b,c,d,e),this.insert(a)},jsts.operation.relate.EdgeEndBundle.prototype=new jsts.geomgraph.EdgeEnd,jsts.operation.relate.EdgeEndBundle.prototype.edgeEnds=null,jsts.operation.relate.EdgeEndBundle.prototype.getLabel=function(){return this.label},jsts.operation.relate.EdgeEndBundle.prototype.getEdgeEnds=function(){return this.edgeEnds},jsts.operation.relate.EdgeEndBundle.prototype.insert=function(a){this.edgeEnds.push(a)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabel=function(a){for(var b=!1,c=0;c<this.edgeEnds.length;c++){var d=this.edgeEnds[c];d.getLabel().isArea()&&(b=!0)}b?this.label=new jsts.geomgraph.Label(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE):this.label=new jsts.geomgraph.Label(jsts.geom.Location.NONE);for(var c=0;2>c;c++)this.computeLabelOn(c,a),b&&this.computeLabelSides(c)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabelOn=function(a,b){for(var c=0,d=!1,e=0;e<this.edgeEnds.length;e++){var f=this.edgeEnds[e],g=f.getLabel().getLocation(a);g==jsts.geom.Location.BOUNDARY&&c++,g==jsts.geom.Location.INTERIOR&&(d=!0)}var g=jsts.geom.Location.NONE;d&&(g=jsts.geom.Location.INTERIOR),c>0&&(g=jsts.geomgraph.GeometryGraph.determineBoundary(b,c)),this.label.setLocation(a,g)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabelSides=function(a){this.computeLabelSide(a,jsts.geomgraph.Position.LEFT),this.computeLabelSide(a,jsts.geomgraph.Position.RIGHT)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabelSide=function(a,b){for(var c=0;c<this.edgeEnds.length;c++){var d=this.edgeEnds[c];if(d.getLabel().isArea()){var e=d.getLabel().getLocation(a,b);if(e===jsts.geom.Location.INTERIOR)return void this.label.setLocation(a,b,jsts.geom.Location.INTERIOR);e===jsts.geom.Location.EXTERIOR&&this.label.setLocation(a,b,jsts.geom.Location.EXTERIOR)}}},jsts.operation.relate.EdgeEndBundle.prototype.updateIM=function(a){jsts.geomgraph.Edge.updateIM(this.label,a)},jsts.index.kdtree.KdTree=function(a){var b=0;void 0!==a&&(b=a),this.root=null,this.last=null,this.numberOfNodes=0,this.tolerance=b},jsts.index.kdtree.KdTree.prototype.insert=function(){return 1===arguments.length?this.insertCoordinate.apply(this,arguments[0]):this.insertWithData.apply(this,arguments[0],arguments[1])},jsts.index.kdtree.KdTree.prototype.insertCoordinate=function(a){return this.insertWithData(a,null)},jsts.index.kdtree.KdTree.prototype.insertWithData=function(a,b){if(null===this.root)return this.root=new jsts.index.kdtree.KdNode(a,b),this.root;for(var c=this.root,d=this.root,e=!0,f=!0;c!==last;){if(f=e?a.x<c.getX():a.y<c.getY(),d=c,c=f?c.getLeft():c.getRight(),null!==c){var g=a.distance(c.getCoordinate())<=this.tolerance;if(g)return c.increment(),c}e=!e}this.numberOfNodes=numberOfNodes+1;var h=new jsts.index.kdtree.KdNode(a,b);return h.setLeft(this.last),h.setRight(this.last),f?d.setLeft(h):d.setRight(h),h},jsts.index.kdtree.KdTree.prototype.queryNode=function(a,b,c,d,e){if(a!==b){var f,g,h;d?(f=c.getMinX(),g=c.getMaxX(),h=a.getX()):(f=c.getMinY(),g=c.getMaxY(),h=a.getY());var i=h>f,j=g>=h;i&&this.queryNode(a.getLeft(),b,c,!d,e),c.contains(a.getCoordinate())&&e.add(a),j&&this.queryNode(a.getRight(),b,c,!d,e)}},jsts.index.kdtree.KdTree.prototype.query=function(){return 1===arguments.length?this.queryByEnvelope.apply(this,arguments[0]):this.queryWithArray.apply(this,arguments[0],arguments[1])},jsts.index.kdtree.KdTree.prototype.queryByEnvelope=function(a){var b=[];return this.queryNode(this.root,this.last,a,!0,b),b},jsts.index.kdtree.KdTree.prototype.queryWithArray=function(a,b){this.queryNode(this.root,this.last,a,!0,b)},jsts.geom.Triangle=function(a,b,c){this.p0=a,this.p1=b,this.p2=c},jsts.geom.Triangle.isAcute=function(a,b,c){return jsts.algorithm.Angle.isAcute(a,b,c)&&jsts.algorithm.Angle.isAcute(b,c,a)&&jsts.algorithm.Angle.isAcute(c,a,b)?!0:!1},jsts.geom.Triangle.perpendicularBisector=function(a,b){var c,d,e,f;return c=b.x-a.x,d=b.y-a.y,e=new jsts.algorithm.HCoordinate(a.x+c/2,a.y+d/2,1),f=new jsts.algorithm.HCoordinate(a.x-d+c/2,a.y+c+d/2,1),new jsts.algorithm.HCoordinate(e,f)},jsts.geom.Triangle.circumcentre=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n;return d=c.x,e=c.y,f=a.x-d,g=a.y-e,h=b.x-d,i=b.y-e,j=2*jsts.geom.Triangle.det(f,g,h,i),k=jsts.geom.Triangle.det(g,f*f+g*g,i,h*h+i*i),l=jsts.geom.Triangle.det(f,f*f+g*g,h,h*h+i*i),m=d-k/j,n=e+l/j,new jsts.geom.Coordinate(m,n)},jsts.geom.Triangle.det=function(a,b,c,d){return a*d-b*c},jsts.geom.Triangle.inCentre=function(a,b,c){var d,e,f,g,h,i;return d=b.distance(c),e=a.distance(c),f=a.distance(b),g=d+e+f,h=(d*a.x+e*b.x+f*c.x)/g,i=(d*a.y+e*b.y+f*c.y)/g,new jsts.geom.Coordinate(h,i)},jsts.geom.Triangle.centroid=function(a,b,c){var d,e;return d=(a.x+b.x+c.x)/3,e=(a.y+b.y+c.y)/3,new jsts.geom.Coordinate(d,e)},jsts.geom.Triangle.longestSideLength=function(a,b,c){var d,e,f,g;return d=a.distance(b),e=b.distance(c),f=c.distance(a),g=d,e>g&&(g=e),f>g&&(g=f),g},jsts.geom.Triangle.angleBisector=function(a,b,c){var d,e,f,g,h,i;return d=b.distance(a),e=b.distance(c),f=d/(d+e),g=c.x-a.x,h=c.y-a.y,i=new jsts.geom.Coordinate(a.x+f*g,a.y+f*h)},jsts.geom.Triangle.area=function(a,b,c){return Math.abs(((c.x-a.x)*(b.y-a.y)-(b.x-a.x)*(c.y-a.y))/2)},jsts.geom.Triangle.signedArea=function(a,b,c){return((c.x-a.x)*(b.y-a.y)-(b.x-a.x)*(c.y-a.y))/2},jsts.geom.Triangle.prototype.inCentre=function(){return jsts.geom.Triangle.inCentre(this.p0,this.p1,this.p2)},jsts.noding.OrientedCoordinateArray=function(a){this.pts=a,this._orientation=jsts.noding.OrientedCoordinateArray.orientation(a)},jsts.noding.OrientedCoordinateArray.prototype.pts=null,jsts.noding.OrientedCoordinateArray.prototype._orientation=void 0,jsts.noding.OrientedCoordinateArray.orientation=function(a){return 1===jsts.geom.CoordinateArrays.increasingDirection(a)},jsts.noding.OrientedCoordinateArray.prototype.compareTo=function(a){var b=a,c=jsts.noding.OrientedCoordinateArray.compareOriented(this.pts,this._orientation,b.pts,b._orientation);return c},jsts.noding.OrientedCoordinateArray.compareOriented=function(a,b,c,d){for(var e=b?1:-1,f=d?1:-1,g=b?a.length:-1,h=d?c.length:-1,i=b?0:a.length-1,j=d?0:c.length-1;;){var k=a[i].compareTo(c[j]);if(0!==k)return k;i+=e,j+=f;var l=i===g,m=j===h;if(l&&!m)return-1;if(!l&&m)return 1;if(l&&m)return 0}},jsts.algorithm.CentralEndpointIntersector=function(a,b,c,d){this.pts=[a,b,c,d],this.compute()},jsts.algorithm.CentralEndpointIntersector.getIntersection=function(a,b,c,d){var e=new jsts.algorithm.CentralEndpointIntersector(a,b,c,d);return e.getIntersection()},jsts.algorithm.CentralEndpointIntersector.prototype.pts=null,jsts.algorithm.CentralEndpointIntersector.prototype.intPt=null,jsts.algorithm.CentralEndpointIntersector.prototype.compute=function(){var a=jsts.algorithm.CentralEndpointIntersector.average(this.pts);this.intPt=this.findNearestPoint(a,this.pts)},jsts.algorithm.CentralEndpointIntersector.prototype.getIntersection=function(){return this.intPt},jsts.algorithm.CentralEndpointIntersector.average=function(a){var b,c=new jsts.geom.Coordinate,d=a.length;for(b=0;d>b;b++)c.x+=a[b].x,c.y+=a[b].y;return d>0&&(c.x/=d,c.y/=d),c},jsts.algorithm.CentralEndpointIntersector.prototype.findNearestPoint=function(a,b){var c,d,e=Number.MAX_VALUE,f=null;for(c=0;c<b.length;c++)d=a.distance(b[c]),e>d&&(e=d,f=b[c]);return f},jsts.operation.buffer.BufferOp=function(a,b){this.argGeom=a,this.bufParams=b?b:new jsts.operation.buffer.BufferParameters},jsts.operation.buffer.BufferOp.MAX_PRECISION_DIGITS=12,jsts.operation.buffer.BufferOp.precisionScaleFactor=function(a,b,c){var d=a.getEnvelopeInternal(),e=Math.max(d.getHeight(),d.getWidth()),f=b>0?b:0,g=e+2*f,h=Math.log(g)/Math.log(10)+1,i=h-c,j=Math.pow(10,-i);return j},jsts.operation.buffer.BufferOp.bufferOp=function(a,b){if(arguments.length>2)return jsts.operation.buffer.BufferOp.bufferOp2.apply(this,arguments);var c=new jsts.operation.buffer.BufferOp(a),d=c.getResultGeometry(b);return d},jsts.operation.buffer.BufferOp.bufferOp2=function(a,b,c){if(arguments.length>3)return jsts.operation.buffer.BufferOp.bufferOp3.apply(this,arguments);var d=new jsts.operation.buffer.BufferOp(a,c),e=d.getResultGeometry(b);return e},jsts.operation.buffer.BufferOp.bufferOp3=function(a,b,c){if(arguments.length>4)return jsts.operation.buffer.BufferOp.bufferOp4.apply(this,arguments);var d=new jsts.operation.buffer.BufferOp(a);d.setQuadrantSegments(c);var e=d.getResultGeometry(b);return e},jsts.operation.buffer.BufferOp.bufferOp4=function(a,b,c,d){var e=new jsts.operation.buffer.BufferOp(a);e.setQuadrantSegments(c),e.setEndCapStyle(d);var f=e.getResultGeometry(b);return f},jsts.operation.buffer.BufferOp.prototype.argGeom=null,jsts.operation.buffer.BufferOp.prototype.distance=null,jsts.operation.buffer.BufferOp.prototype.bufParams=null,jsts.operation.buffer.BufferOp.prototype.resultGeometry=null,jsts.operation.buffer.BufferOp.prototype.setEndCapStyle=function(a){this.bufParams.setEndCapStyle(a)},jsts.operation.buffer.BufferOp.prototype.setQuadrantSegments=function(a){this.bufParams.setQuadrantSegments(a)},jsts.operation.buffer.BufferOp.prototype.getResultGeometry=function(a){return this.distance=a,this.computeGeometry(),this.resultGeometry},jsts.operation.buffer.BufferOp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null===this.resultGeometry){var a=this.argGeom.getPrecisionModel();a.getType()===jsts.geom.PrecisionModel.FIXED?this.bufferFixedPrecision(a):this.bufferReducedPrecision()}},jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision=function(){var a,b=null;for(a=jsts.operation.buffer.BufferOp.MAX_PRECISION_DIGITS;a>=0;a--){try{this.bufferReducedPrecision2(a)}catch(c){b=c}if(null!==this.resultGeometry)return}throw b},jsts.operation.buffer.BufferOp.prototype.bufferOriginalPrecision=function(){try{var a=new jsts.operation.buffer.BufferBuilder(this.bufParams);this.resultGeometry=a.buffer(this.argGeom,this.distance)}catch(b){}},jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision2=function(a){var b=jsts.operation.buffer.BufferOp.precisionScaleFactor(this.argGeom,this.distance,a),c=new jsts.geom.PrecisionModel(b);this.bufferFixedPrecision(c)},jsts.operation.buffer.BufferOp.prototype.bufferFixedPrecision=function(a){var b=new jsts.noding.ScaledNoder(new jsts.noding.snapround.MCIndexSnapRounder(new jsts.geom.PrecisionModel(1)),a.getScale()),c=new jsts.operation.buffer.BufferBuilder(this.bufParams);c.setWorkingPrecisionModel(a),c.setNoder(b),this.resultGeometry=c.buffer(this.argGeom,this.distance)},function(){var a=jsts.geom.Location,b=jsts.geomgraph.Position,c=jsts.util.Assert;jsts.geomgraph.GeometryGraph=function(a,b,c){jsts.geomgraph.PlanarGraph.call(this),this.lineEdgeMap=new javascript.util.HashMap,this.ptLocator=new jsts.algorithm.PointLocator,this.argIndex=a,this.parentGeom=b,this.boundaryNodeRule=c||jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE,null!==b&&this.add(b)},jsts.geomgraph.GeometryGraph.prototype=new jsts.geomgraph.PlanarGraph,jsts.geomgraph.GeometryGraph.constructor=jsts.geomgraph.GeometryGraph,jsts.geomgraph.GeometryGraph.prototype.createEdgeSetIntersector=function(){return new jsts.geomgraph.index.SimpleMCSweepLineIntersector},jsts.geomgraph.GeometryGraph.determineBoundary=function(b,c){return b.isInBoundary(c)?a.BOUNDARY:a.INTERIOR},jsts.geomgraph.GeometryGraph.prototype.parentGeom=null,jsts.geomgraph.GeometryGraph.prototype.lineEdgeMap=null,jsts.geomgraph.GeometryGraph.prototype.boundaryNodeRule=null,jsts.geomgraph.GeometryGraph.prototype.useBoundaryDeterminationRule=!0,jsts.geomgraph.GeometryGraph.prototype.argIndex=null,jsts.geomgraph.GeometryGraph.prototype.boundaryNodes=null,jsts.geomgraph.GeometryGraph.prototype.hasTooFewPoints=!1,jsts.geomgraph.GeometryGraph.prototype.invalidPoint=null,jsts.geomgraph.GeometryGraph.prototype.areaPtLocator=null,jsts.geomgraph.GeometryGraph.prototype.ptLocator=null,jsts.geomgraph.GeometryGraph.prototype.getGeometry=function(){return this.parentGeom},jsts.geomgraph.GeometryGraph.prototype.getBoundaryNodes=function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},jsts.geomgraph.GeometryGraph.prototype.getBoundaryNodeRule=function(){return this.boundaryNodeRule},jsts.geomgraph.GeometryGraph.prototype.findEdge=function(a){return this.lineEdgeMap.get(a)},jsts.geomgraph.GeometryGraph.prototype.computeSplitEdges=function(a){for(var b=this.edges.iterator();b.hasNext();){var c=b.next();c.eiList.addSplitEdges(a)}},jsts.geomgraph.GeometryGraph.prototype.add=function(a){if(!a.isEmpty())if(a instanceof jsts.geom.MultiPolygon&&(this.useBoundaryDeterminationRule=!1),a instanceof jsts.geom.Polygon)this.addPolygon(a);else if(a instanceof jsts.geom.LineString)this.addLineString(a);else if(a instanceof jsts.geom.Point)this.addPoint(a);else if(a instanceof jsts.geom.MultiPoint)this.addCollection(a);else if(a instanceof jsts.geom.MultiLineString)this.addCollection(a);else if(a instanceof jsts.geom.MultiPolygon)this.addCollection(a);else{if(!(a instanceof jsts.geom.GeometryCollection))throw new jsts.error.IllegalArgumentError("Geometry type not supported.");this.addCollection(a)}},jsts.geomgraph.GeometryGraph.prototype.addCollection=function(a){for(var b=0;b<a.getNumGeometries();b++){var c=a.getGeometryN(b);this.add(c)}},jsts.geomgraph.GeometryGraph.prototype.addEdge=function(b){this.insertEdge(b);var c=b.getCoordinates();this.insertPoint(this.argIndex,c[0],a.BOUNDARY),this.insertPoint(this.argIndex,c[c.length-1],a.BOUNDARY)},jsts.geomgraph.GeometryGraph.prototype.addPoint=function(b){var c=b.getCoordinate();this.insertPoint(this.argIndex,c,a.INTERIOR)},jsts.geomgraph.GeometryGraph.prototype.addLineString=function(b){var d=jsts.geom.CoordinateArrays.removeRepeatedPoints(b.getCoordinates());if(d.length<2)return this.hasTooFewPoints=!0,void(this.invalidPoint=coords[0]);var e=new jsts.geomgraph.Edge(d,new jsts.geomgraph.Label(this.argIndex,a.INTERIOR));this.lineEdgeMap.put(b,e),this.insertEdge(e),c.isTrue(d.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this.argIndex,d[0]),this.insertBoundaryPoint(this.argIndex,d[d.length-1])},jsts.geomgraph.GeometryGraph.prototype.addPolygonRing=function(b,c,d){if(!b.isEmpty()){var e=jsts.geom.CoordinateArrays.removeRepeatedPoints(b.getCoordinates());if(e.length<4)return this.hasTooFewPoints=!0,void(this.invalidPoint=e[0]);var f=c,g=d;jsts.algorithm.CGAlgorithms.isCCW(e)&&(f=d,g=c);var h=new jsts.geomgraph.Edge(e,new jsts.geomgraph.Label(this.argIndex,a.BOUNDARY,f,g));this.lineEdgeMap.put(b,h),this.insertEdge(h),this.insertPoint(this.argIndex,e[0],a.BOUNDARY)}},jsts.geomgraph.GeometryGraph.prototype.addPolygon=function(b){this.addPolygonRing(b.getExteriorRing(),a.EXTERIOR,a.INTERIOR);
  for(var c=0;c<b.getNumInteriorRing();c++){var d=b.getInteriorRingN(c);this.addPolygonRing(d,a.INTERIOR,a.EXTERIOR)}},jsts.geomgraph.GeometryGraph.prototype.computeEdgeIntersections=function(a,b,c){var d=new jsts.geomgraph.index.SegmentIntersector(b,c,!0);d.setBoundaryNodes(this.getBoundaryNodes(),a.getBoundaryNodes());var e=this.createEdgeSetIntersector();return e.computeIntersections(this.edges,a.edges,d),d},jsts.geomgraph.GeometryGraph.prototype.computeSelfNodes=function(a,b){var c=new jsts.geomgraph.index.SegmentIntersector(a,!0,!1),d=this.createEdgeSetIntersector();return!b&&(this.parentGeom instanceof jsts.geom.LinearRing||this.parentGeom instanceof jsts.geom.Polygon||this.parentGeom instanceof jsts.geom.MultiPolygon)?d.computeIntersections(this.edges,c,!1):d.computeIntersections(this.edges,c,!0),this.addSelfIntersectionNodes(this.argIndex),c},jsts.geomgraph.GeometryGraph.prototype.insertPoint=function(a,b,c){var d=this.nodes.addNode(b),e=d.getLabel();null==e?d.label=new jsts.geomgraph.Label(a,c):e.setLocation(a,c)},jsts.geomgraph.GeometryGraph.prototype.insertBoundaryPoint=function(c,d){var e=this.nodes.addNode(d),f=e.getLabel(),g=1,h=a.NONE;null!==f&&(h=f.getLocation(c,b.ON)),h===a.BOUNDARY&&g++;var i=jsts.geomgraph.GeometryGraph.determineBoundary(this.boundaryNodeRule,g);f.setLocation(c,i)},jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNodes=function(a){for(var b=this.edges.iterator();b.hasNext();)for(var c=b.next(),d=c.getLabel().getLocation(a),e=c.eiList.iterator();e.hasNext();){var f=e.next();this.addSelfIntersectionNode(a,f.coord,d)}},jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNode=function(b,c,d){this.isBoundaryNode(b,c)||(d===a.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(b,c):this.insertPoint(b,c,d))},jsts.geomgraph.GeometryGraph.prototype.getInvalidPoint=function(){return this.invalidPoint}}(),jsts.operation.buffer.OffsetSegmentString=function(){this.ptList=[]},jsts.operation.buffer.OffsetSegmentString.prototype.ptList=null,jsts.operation.buffer.OffsetSegmentString.prototype.precisionModel=null,jsts.operation.buffer.OffsetSegmentString.prototype.minimimVertexDistance=0,jsts.operation.buffer.OffsetSegmentString.prototype.setPrecisionModel=function(a){this.precisionModel=a},jsts.operation.buffer.OffsetSegmentString.prototype.setMinimumVertexDistance=function(a){this.minimimVertexDistance=a},jsts.operation.buffer.OffsetSegmentString.prototype.addPt=function(a){var b=new jsts.geom.Coordinate(a);this.precisionModel.makePrecise(b),this.isRedundant(b)||this.ptList.push(b)},jsts.operation.buffer.OffsetSegmentString.prototype.addPts=function(a,b){if(b)for(var c=0;c<a.length;c++)this.addPt(a[c]);else for(var c=a.length-1;c>=0;c--)this.addPt(a[c])},jsts.operation.buffer.OffsetSegmentString.prototype.isRedundant=function(a){if(this.ptList.length<1)return!1;var b=this.ptList[this.ptList.length-1],c=a.distance(b);return c<this.minimimVertexDistance?!0:!1},jsts.operation.buffer.OffsetSegmentString.prototype.closeRing=function(){if(!(this.ptList.length<1)){var a=new jsts.geom.Coordinate(this.ptList[0]),b=this.ptList[this.ptList.length-1],c=null;this.ptList.length>=2&&(c=this.ptList[this.ptList.length-2]),a.equals(b)||this.ptList.push(a)}},jsts.operation.buffer.OffsetSegmentString.prototype.reverse=function(){},jsts.operation.buffer.OffsetSegmentString.prototype.getCoordinates=function(){return this.ptList},jsts.algorithm.distance.PointPairDistance=function(){this.pt=[new jsts.geom.Coordinate,new jsts.geom.Coordinate]},jsts.algorithm.distance.PointPairDistance.prototype.pt=null,jsts.algorithm.distance.PointPairDistance.prototype.distance=NaN,jsts.algorithm.distance.PointPairDistance.prototype.isNull=!0,jsts.algorithm.distance.PointPairDistance.prototype.initialize=function(a,b,c){return void 0===a?void(this.isNull=!0):(this.pt[0].setCoordinate(a),this.pt[1].setCoordinate(b),this.distance=void 0!==c?c:a.distance(b),void(this.isNull=!1))},jsts.algorithm.distance.PointPairDistance.prototype.getDistance=function(){return this.distance},jsts.algorithm.distance.PointPairDistance.prototype.getCoordinates=function(){return this.pt},jsts.algorithm.distance.PointPairDistance.prototype.getCoordinate=function(a){return this.pt[a]},jsts.algorithm.distance.PointPairDistance.prototype.setMaximum=function(a){return 2===arguments.length?void this.setMaximum2.apply(this,arguments):void this.setMaximum(a.pt[0],a.pt[1])},jsts.algorithm.distance.PointPairDistance.prototype.setMaximum2=function(a,b){if(this.isNull)return void this.initialize(a,b);var c=a.distance(b);c>this.distance&&this.initialize(a,b,c)},jsts.algorithm.distance.PointPairDistance.prototype.setMinimum=function(a){return 2===arguments.length?void this.setMinimum2.apply(this,arguments):void this.setMinimum(a.pt[0],a.pt[1])},jsts.algorithm.distance.PointPairDistance.prototype.setMinimum2=function(a,b){if(this.isNull)return void this.initialize(a,b);var c=a.distance(b);c<this.distance&&this.initialize(a,b,c)},function(){var a=jsts.algorithm.distance.PointPairDistance,b=jsts.algorithm.distance.DistanceToPoint,c=function(c){this.maxPtDist=new a,this.minPtDist=new a,this.euclideanDist=new b,this.geom=c};c.prototype=new jsts.geom.CoordinateFilter,c.prototype.maxPtDist=new a,c.prototype.minPtDist=new a,c.prototype.euclideanDist=new b,c.prototype.geom,c.prototype.filter=function(a){this.minPtDist.initialize(),b.computeDistance(this.geom,a,this.minPtDist),this.maxPtDist.setMaximum(this.minPtDist)},c.prototype.getMaxPointDistance=function(){return this.maxPtDist};var d=function(b,c){this.maxPtDist=new a,this.minPtDist=new a,this.geom=b,this.numSubSegs=Math.round(1/c)};d.prototype=new jsts.geom.CoordinateSequenceFilter,d.prototype.maxPtDist=new a,d.prototype.minPtDist=new a,d.prototype.geom,d.prototype.numSubSegs=0,d.prototype.filter=function(a,c){if(0!=c)for(var d=a[c-1],e=a[c],f=(e.x-d.x)/this.numSubSegs,g=(e.y-d.y)/this.numSubSegs,h=0;h<this.numSubSegs;h++){var i=d.x+h*f,j=d.y+h*g,k=new jsts.geom.Coordinate(i,j);this.minPtDist.initialize(),b.computeDistance(this.geom,k,this.minPtDist),this.maxPtDist.setMaximum(this.minPtDist)}},d.prototype.isGeometryChanged=function(){return!1},d.prototype.isDone=function(){return!1},d.prototype.getMaxPointDistance=function(){return this.maxPtDist},jsts.algorithm.distance.DiscreteHausdorffDistance=function(a,b){this.g0=a,this.g1=b,this.ptDist=new jsts.algorithm.distance.PointPairDistance},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.g0=null,jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.g1=null,jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.ptDist=null,jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.densifyFrac=0,jsts.algorithm.distance.DiscreteHausdorffDistance.distance=function(a,b,c){var d=new jsts.algorithm.distance.DiscreteHausdorffDistance(a,b);return void 0!==c&&d.setDensifyFraction(c),d.distance()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.setDensifyFraction=function(a){if(a>1||0>=a)throw new jsts.error.IllegalArgumentError("Fraction is not in range (0.0 - 1.0]");this.densifyFrac=a},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.distance=function(){return this.compute(this.g0,this.g1),ptDist.getDistance()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.orientedDistance=function(){return this.computeOrientedDistance(this.g0,this.g1,this.ptDist),this.ptDist.getDistance()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.getCoordinates=function(){return ptDist.getCoordinates()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.compute=function(a,b){this.computeOrientedDistance(a,b,this.ptDist),this.computeOrientedDistance(b,a,this.ptDist)},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.computeOrientedDistance=function(a,b,e){var f=new c(b);if(a.apply(f),e.setMaximum(f.getMaxPointDistance()),this.densifyFrac>0){var g=new d(b,this.densifyFrac);a.apply(g),e.setMaximum(g.getMaxPointDistance())}}}(),jsts.algorithm.MinimumBoundingCircle=function(a){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0,this.input=a},jsts.algorithm.MinimumBoundingCircle.prototype.getCircle=function(){if(this.compute(),null===this.centre)return this.input.getFactory().createPolygon(null,null);var a=this.input.getFactory().createPoint(this.centre);return 0===this.radius?a:a.buffer(this.radius)},jsts.algorithm.MinimumBoundingCircle.prototype.getExtremalPoints=function(){return this.compute(),this.extremalPts},jsts.algorithm.MinimumBoundingCircle.prototype.getCentre=function(){return this.compute(),this.centre},jsts.algorithm.MinimumBoundingCircle.prototype.getRadius=function(){return this.compute(),this.radius},jsts.algorithm.MinimumBoundingCircle.prototype.computeCentre=function(){switch(this.extremalPts.length){case 0:this.centre=null;break;case 1:this.centre=this.extremalPts[0];break;case 2:this.centre=new jsts.geom.Coordinate((this.extremalPts[0].x+this.extremalPts[1].x)/2,(this.extremalPts[0].y+this.extremalPts[1].y)/2);break;case 3:this.centre=jsts.geom.Triangle.circumcentre(this.extremalPts[0],this.extremalPts[1],this.extremalPts[2])}},jsts.algorithm.MinimumBoundingCircle.prototype.compute=function(){null===this.extremalPts&&(this.computeCirclePoints(),this.computeCentre(),null!==this.centre&&(this.radius=this.centre.distance(this.extremalPts[0])))},jsts.algorithm.MinimumBoundingCircle.prototype.computeCirclePoints=function(){if(this.input.isEmpty())return void(this.extremalPts=[]);var a;if(1===this.input.getNumPoints())return a=this.input.getCoordinates(),void(this.extremalPts=[new jsts.geom.Coordinate(a[0])]);var b=this.input.convexHull(),c=b.getCoordinates();if(a=c,c[0].equals2D(c[c.length-1])&&(a=[],jsts.geom.CoordinateArrays.copyDeep(c,0,a,0,c.length-1)),a.length<=2)return void(this.extremalPts=jsts.geom.CoordinateArrays.copyDeep(a));for(var d=jsts.algorithm.MinimumBoundingCircle.lowestPoint(a),e=jsts.algorithm.MinimumBoundingCircle.pointWitMinAngleWithX(a,d),f=0;f<a.length;f++){var g=jsts.algorithm.MinimumBoundingCircle.pointWithMinAngleWithSegment(a,d,e);if(jsts.algorithm.Angle.isObtuse(d,g,e))return void(this.extremalPts=[new jsts.geom.Coordinate(d),new jsts.geom.Coordinate(e)]);if(jsts.algorithm.Angle.isObtuse(g,d,e))d=g;else{if(!jsts.algorithm.Angle.isObtuse(g,e,d))return void(this.extremalPts=[new jsts.geom.Coordinate(d),new jsts.geom.Coordinate(e),new jsts.geom.Coordinate(g)]);e=g}}throw new Error("Logic failure in Minimum Bounding Circle algorithm!")},jsts.algorithm.MinimumBoundingCircle.lowestPoint=function(a){for(var b=a[0],c=1;c<a.length;c++)a[c].y<b.y&&(b=a[c]);return b},jsts.algorithm.MinimumBoundingCircle.pointWitMinAngleWithX=function(a,b){for(var c=Number.MAX_VALUE,d=null,e=0;e<a.length;e++){var f=a[e];if(f!==b){var g=f.x-b.x,h=f.y-b.y;0>h&&(h=-h);var i=Math.sqrt(g*g+h*h),j=h/i;c>j&&(c=j,d=f)}}return d},jsts.algorithm.MinimumBoundingCircle.pointWithMinAngleWithSegment=function(a,b,c){for(var d=Number.MAX_VALUE,e=null,f=0;f<a.length;f++){var g=a[f];if(g!==b&&g!==c){var h=jsts.algorithm.Angle.angleBetween(b,g,c);d>h&&(d=h,e=g)}}return e},jsts.noding.ScaledNoder=function(a,b,c,d){this.offsetX=c?c:0,this.offsetY=d?d:0,this.noder=a,this.scaleFactor=b,this.isScaled=!this.isIntegerPrecision()},jsts.noding.ScaledNoder.prototype=new jsts.noding.Noder,jsts.noding.ScaledNoder.constructor=jsts.noding.ScaledNoder,jsts.noding.ScaledNoder.prototype.noder=null,jsts.noding.ScaledNoder.prototype.scaleFactor=void 0,jsts.noding.ScaledNoder.prototype.offsetX=void 0,jsts.noding.ScaledNoder.prototype.offsetY=void 0,jsts.noding.ScaledNoder.prototype.isScaled=!1,jsts.noding.ScaledNoder.prototype.isIntegerPrecision=function(){return 1===this.scaleFactor},jsts.noding.ScaledNoder.prototype.getNodedSubstrings=function(){var a=this.noder.getNodedSubstrings();return this.isScaled&&this.rescale(a),a},jsts.noding.ScaledNoder.prototype.computeNodes=function(a){var b=a;this.isScaled&&(b=this.scale(a)),this.noder.computeNodes(b)},jsts.noding.ScaledNoder.prototype.scale=function(a){if(a instanceof Array)return this.scale2(a);for(var b=new javascript.util.ArrayList,c=a.iterator();c.hasNext();){var d=c.next();b.add(new jsts.noding.NodedSegmentString(this.scale(d.getCoordinates()),d.getData()))}return b},jsts.noding.ScaledNoder.prototype.scale2=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=new jsts.geom.Coordinate(Math.round((a[c].x-this.offsetX)*this.scaleFactor),Math.round((a[c].y-this.offsetY)*this.scaleFactor));var d=jsts.geom.CoordinateArrays.removeRepeatedPoints(b);return d},jsts.noding.ScaledNoder.prototype.rescale=function(a){if(a instanceof Array)return void this.rescale2(a);for(var b=a.iterator();b.hasNext();){var c=b.next();this.rescale(c.getCoordinates())}},jsts.noding.ScaledNoder.prototype.rescale2=function(a){for(var b=0;b<a.length;b++)a[b].x=a[b].x/this.scaleFactor+this.offsetX,a[b].y=a[b].y/this.scaleFactor+this.offsetY},function(){javascript.util.ArrayList,jsts.geomgraph.index.SegmentIntersector=function(a,b,c){this.li=a,this.includeProper=b,this.recordIsolated=c},jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments=function(a,b){return 1===Math.abs(a-b)},jsts.geomgraph.index.SegmentIntersector.prototype._hasIntersection=!1,jsts.geomgraph.index.SegmentIntersector.prototype.hasProper=!1,jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInterior=!1,jsts.geomgraph.index.SegmentIntersector.prototype.properIntersectionPoint=null,jsts.geomgraph.index.SegmentIntersector.prototype.li=null,jsts.geomgraph.index.SegmentIntersector.prototype.includeProper=null,jsts.geomgraph.index.SegmentIntersector.prototype.recordIsolated=null,jsts.geomgraph.index.SegmentIntersector.prototype.isSelfIntersection=null,jsts.geomgraph.index.SegmentIntersector.prototype.numIntersections=0,jsts.geomgraph.index.SegmentIntersector.prototype.numTests=0,jsts.geomgraph.index.SegmentIntersector.prototype.bdyNodes=null,jsts.geomgraph.index.SegmentIntersector.prototype.setBoundaryNodes=function(a,b){this.bdyNodes=[],this.bdyNodes[0]=a,this.bdyNodes[1]=b},jsts.geomgraph.index.SegmentIntersector.prototype.getProperIntersectionPoint=function(){return this.properIntersectionPoint},jsts.geomgraph.index.SegmentIntersector.prototype.hasIntersection=function(){return this._hasIntersection},jsts.geomgraph.index.SegmentIntersector.prototype.hasProperIntersection=function(){return this.hasProper},jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInteriorIntersection=function(){return this.hasProperInterior},jsts.geomgraph.index.SegmentIntersector.prototype.isTrivialIntersection=function(a,b,c,d){if(a===c&&1===this.li.getIntersectionNum()){if(jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments(b,d))return!0;if(a.isClosed()){var e=a.getNumPoints()-1;if(0===b&&d===e||0===d&&b===e)return!0}}return!1},jsts.geomgraph.index.SegmentIntersector.prototype.addIntersections=function(a,b,c,d){if(a!==c||b!==d){this.numTests++;var e=a.getCoordinates()[b],f=a.getCoordinates()[b+1],g=c.getCoordinates()[d],h=c.getCoordinates()[d+1];this.li.computeIntersection(e,f,g,h),this.li.hasIntersection()&&(this.recordIsolated&&(a.setIsolated(!1),c.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(a,b,c,d)||(this._hasIntersection=!0,(this.includeProper||!this.li.isProper())&&(a.addIntersections(this.li,b,0),c.addIntersections(this.li,d,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).clone(),this.hasProper=!0,this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))}},jsts.geomgraph.index.SegmentIntersector.prototype.isBoundaryPoint=function(a,b){if(null===b)return!1;if(b instanceof Array)return this.isBoundaryPoint(a,b[0])?!0:this.isBoundaryPoint(a,b[1])?!0:!1;for(var c=b.iterator();c.hasNext();){var d=c.next(),e=d.getCoordinate();if(a.isIntersection(e))return!0}return!1}}()},{}],19:[function(a,b,c){(function(a){(function(){function b(a,b){var c=a.split("."),d=F;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b}function c(a,b){function c(){}c.prototype=b.prototype,a.q=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.p=function(a,c,d){var e=Array.prototype.slice.call(arguments,2);return b.prototype[c].apply(a,e)}}function d(a){this.message=a||""}function e(a){this.message=a||""}function f(){}function g(){}function h(){}function i(){}function j(a){this.message=a||""}function k(a){this.message=a||""}function l(a){this.a=[],a instanceof g&&this.e(a)}function m(a){this.j=a}function n(){}function o(){this.i={}}function p(){}function q(a){this.a=[],a instanceof g&&this.e(a)}function r(a){this.k=a}function s(){}function t(){}function u(){this.a=[]}function v(a){return null==a?null:a.parent}function w(a,b){null!==a&&(a.color=b)}function x(a){return null==a?null:a.left}function y(a){return null==a?null:a.right}function z(){this.d=null,this.n=0}function A(a,b){if(null!=b){var c=b.right;b.right=c.left,null!=c.left&&(c.left.parent=b),c.parent=b.parent,null==b.parent?a.d=c:b.parent.left==b?b.parent.left=c:b.parent.right=c,c.left=b,b.parent=c}}function B(a,b){if(null!=b){var c=b.left;b.left=c.right,null!=c.right&&(c.right.parent=b),c.parent=b.parent,null==b.parent?a.d=c:b.parent.right==b?b.parent.right=c:b.parent.left=c,c.right=b,b.parent=c}}function C(a){if(null===a)return null;if(null!==a.right)for(var b=a.right;null!==b.left;)b=b.left;else for(b=a.parent;null!==b&&a===b.right;)a=b,b=b.parent;return b}function D(a){this.a=[],a instanceof g&&this.e(a)}function E(a){this.l=a}var F=this;c(d,Error),b("javascript.util.EmptyStackException",d),d.prototype.name="EmptyStackException",c(e,Error),b("javascript.util.IndexOutOfBoundsException",e),e.prototype.name="IndexOutOfBoundsException",b("javascript.util.Iterator",f),f.prototype.hasNext=f.prototype.c,f.prototype.next=f.prototype.next,f.prototype.remove=f.prototype.remove,b("javascript.util.Collection",g),c(h,g),b("javascript.util.List",h),b("javascript.util.Map",i),c(j,Error),b("javascript.util.NoSuchElementException",j),j.prototype.name="NoSuchElementException",c(k,Error),k.prototype.name="OperationNotSupported",c(l,h),b("javascript.util.ArrayList",l),l.prototype.a=null,l.prototype.add=function(a){return this.a.push(a),!0},l.prototype.add=l.prototype.add,l.prototype.e=function(a){for(a=a.f();a.c();)this.add(a.next());return!0},l.prototype.addAll=l.prototype.e,l.prototype.set=function(a,b){var c=this.a[a];return this.a[a]=b,c},l.prototype.set=l.prototype.set,l.prototype.f=function(){return new m(this)},l.prototype.iterator=l.prototype.f,l.prototype.get=function(a){if(0>a||a>=this.size())throw new e;return this.a[a]},l.prototype.get=l.prototype.get,l.prototype.g=function(){return 0===this.a.length},l.prototype.isEmpty=l.prototype.g,l.prototype.size=function(){return this.a.length},l.prototype.size=l.prototype.size,l.prototype.h=function(){for(var a=[],b=0,c=this.a.length;c>b;b++)a.push(this.a[b]);return a},l.prototype.toArray=l.prototype.h,l.prototype.remove=function(a){for(var b=!1,c=0,d=this.a.length;d>c;c++)if(this.a[c]===a){this.a.splice(c,1),b=!0;break}return b},l.prototype.remove=l.prototype.remove,b("$jscomp.scope.Iterator_",m),m.prototype.j=null,m.prototype.b=0,m.prototype.next=function(){if(this.b===this.j.size())throw new j;return this.j.get(this.b++)},m.prototype.next=m.prototype.next,m.prototype.c=function(){return this.b<this.j.size()?!0:!1},m.prototype.hasNext=m.prototype.c,m.prototype.remove=function(){throw new k},m.prototype.remove=m.prototype.remove,b("javascript.util.Arrays",n),n.sort=function(){var a,b,c,d=arguments[0];if(1===arguments.length)d.sort();else if(2===arguments.length)b=arguments[1],c=function(a,c){return b.compare(a,c)},d.sort(c);else if(3===arguments.length)for(a=d.slice(arguments[1],arguments[2]),a.sort(),c=d.slice(0,arguments[1]).concat(a,d.slice(arguments[2],d.length)),d.splice(0,d.length),a=0;a<c.length;a++)d.push(c[a]);else if(4===arguments.length)for(a=d.slice(arguments[1],arguments[2]),b=arguments[3],c=function(a,c){return b.compare(a,c)},a.sort(c),c=d.slice(0,arguments[1]).concat(a,d.slice(arguments[2],d.length)),d.splice(0,d.length),a=0;a<c.length;a++)d.push(c[a])},n.asList=function(a){for(var b=new l,c=0,d=a.length;d>c;c++)b.add(a[c]);return b},c(o,i),b("javascript.util.HashMap",o),o.prototype.i=null,o.prototype.get=function(a){return this.i[a]||null},o.prototype.get=o.prototype.get,o.prototype.put=function(a,b){return this.i[a]=b},o.prototype.put=o.prototype.put,o.prototype.m=function(){var a,b=new l;for(a in this.i)this.i.hasOwnProperty(a)&&b.add(this.i[a]);return b},o.prototype.values=o.prototype.m,o.prototype.size=function(){return this.m().size()},o.prototype.size=o.prototype.size,c(p,g),b("javascript.util.Set",p),c(q,p),b("javascript.util.HashSet",q),q.prototype.a=null,q.prototype.contains=function(a){for(var b=0,c=this.a.length;c>b;b++)if(this.a[b]===a)return!0;return!1},q.prototype.contains=q.prototype.contains,q.prototype.add=function(a){return this.contains(a)?!1:(this.a.push(a),!0)},q.prototype.add=q.prototype.add,q.prototype.e=function(a){for(a=a.f();a.c();)this.add(a.next());return!0},q.prototype.addAll=q.prototype.e,q.prototype.remove=function(){throw new k},q.prototype.remove=q.prototype.remove,q.prototype.size=function(){return this.a.length},q.prototype.g=function(){return 0===this.a.length},q.prototype.isEmpty=q.prototype.g,q.prototype.h=function(){for(var a=[],b=0,c=this.a.length;c>b;b++)a.push(this.a[b]);return a},q.prototype.toArray=q.prototype.h,q.prototype.f=function(){return new r(this)},q.prototype.iterator=q.prototype.f,b("$jscomp.scope.Iterator_$1",r),r.prototype.k=null,r.prototype.b=0,r.prototype.next=function(){if(this.b===this.k.size())throw new j;return this.k.a[this.b++]},r.prototype.next=r.prototype.next,r.prototype.c=function(){return this.b<this.k.size()?!0:!1},r.prototype.hasNext=r.prototype.c,r.prototype.remove=function(){throw new k},r.prototype.remove=r.prototype.remove,c(s,i),b("javascript.util.SortedMap",s),c(t,p),b("javascript.util.SortedSet",t),c(u,h),b("javascript.util.Stack",u),u.prototype.a=null,u.prototype.push=function(a){return this.a.push(a),a},u.prototype.push=u.prototype.push,u.prototype.pop=function(){if(0===this.a.length)throw new d;return this.a.pop()},u.prototype.pop=u.prototype.pop,u.prototype.o=function(){if(0===this.a.length)throw new d;return this.a[this.a.length-1]},u.prototype.peek=u.prototype.o,u.prototype.empty=function(){return 0===this.a.length?!0:!1},u.prototype.empty=u.prototype.empty,u.prototype.g=function(){return this.empty()},u.prototype.isEmpty=u.prototype.g,u.prototype.search=function(a){return this.a.indexOf(a)},u.prototype.search=u.prototype.search,u.prototype.size=function(){return this.a.length},u.prototype.size=u.prototype.size,u.prototype.h=function(){for(var a=[],b=0,c=this.a.length;c>b;b++)a.push(this.a[b]);return a},u.prototype.toArray=u.prototype.h,c(z,s),b("javascript.util.TreeMap",z),z.prototype.get=function(a){for(var b=this.d;null!==b;){var c=a.compareTo(b.key);if(0>c)b=b.left;else{if(!(c>0))return b.value;b=b.right}}return null},z.prototype.get=z.prototype.get,z.prototype.put=function(a,b){if(null===this.d)return this.d={key:a,value:b,left:null,right:null,parent:null,color:0},this.n=1,null;var c,d,e=this.d;do if(c=e,d=a.compareTo(e.key),0>d)e=e.left;else{if(!(d>0))return c=e.value,e.value=b,c;e=e.right}while(null!==e);for(e={key:a,left:null,right:null,value:b,parent:c,color:0},0>d?c.left=e:c.right=e,e.color=1;null!=e&&e!=this.d&&1==e.parent.color;)v(e)==x(v(v(e)))?(c=y(v(v(e))),1==(null==c?0:c.color)?(w(v(e),0),w(c,0),w(v(v(e)),1),e=v(v(e))):(e==y(v(e))&&(e=v(e),A(this,e)),w(v(e),0),w(v(v(e)),1),B(this,v(v(e))))):(c=x(v(v(e))),1==(null==c?0:c.color)?(w(v(e),0),w(c,0),w(v(v(e)),1),e=v(v(e))):(e==x(v(e))&&(e=v(e),B(this,e)),w(v(e),0),w(v(v(e)),1),A(this,v(v(e)))));return this.d.color=0,this.n++,null},z.prototype.put=z.prototype.put,z.prototype.m=function(){var a,b=new l;if(a=this.d,null!=a)for(;null!=a.left;)a=a.left;if(null!==a)for(b.add(a.value);null!==(a=C(a));)b.add(a.value);return b},z.prototype.values=z.prototype.m,z.prototype.size=function(){return this.n},z.prototype.size=z.prototype.size,c(D,t),b("javascript.util.TreeSet",D),D.prototype.a=null,D.prototype.contains=function(a){for(var b=0,c=this.a.length;c>b;b++)if(0===this.a[b].compareTo(a))return!0;return!1},D.prototype.contains=D.prototype.contains,D.prototype.add=function(a){if(this.contains(a))return!1;for(var b=0,c=this.a.length;c>b;b++)if(1===this.a[b].compareTo(a))return this.a.splice(b,0,a),!0;return this.a.push(a),!0},D.prototype.add=D.prototype.add,D.prototype.e=function(a){for(a=a.f();a.c();)this.add(a.next());return!0},D.prototype.addAll=D.prototype.e,D.prototype.remove=function(){throw new k},D.prototype.remove=D.prototype.remove,D.prototype.size=function(){return this.a.length},D.prototype.size=D.prototype.size,D.prototype.g=function(){return 0===this.a.length},D.prototype.isEmpty=D.prototype.g,D.prototype.h=function(){for(var a=[],b=0,c=this.a.length;c>b;b++)a.push(this.a[b]);return a},D.prototype.toArray=D.prototype.h,D.prototype.f=function(){return new E(this)},D.prototype.iterator=D.prototype.f,b("$jscomp.scope.Iterator_$2",E),E.prototype.l=null,E.prototype.b=0,E.prototype.next=function(){if(this.b===this.l.size())throw new j;return this.l.a[this.b++]},E.prototype.next=E.prototype.next,E.prototype.c=function(){return this.b<this.l.size()?!0:!1},E.prototype.hasNext=E.prototype.c,E.prototype.remove=function(){throw new k},E.prototype.remove=E.prototype.remove,"undefined"!=typeof a&&(a.javascript={},a.javascript.util={},a.javascript.util.ArrayList=l,a.javascript.util.Arrays=n,a.javascript.util.Collection=g,a.javascript.util.EmptyStackException=d,a.javascript.util.HashMap=o,a.javascript.util.HashSet=q,a.javascript.util.IndexOutOfBoundsException=e,a.javascript.util.Iterator=f,a.javascript.util.List=h,a.javascript.util.Map=i,a.javascript.util.NoSuchElementException=j,a.javascript.util.OperationNotSupported=k,a.javascript.util.Set=p,a.javascript.util.SortedMap=s,a.javascript.util.SortedSet=t,a.javascript.util.Stack=u,a.javascript.util.TreeMap=z,a.javascript.util.TreeSet=D)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(a,b,c){a("./dist/javascript.util-node.min.js")},{"./dist/javascript.util-node.min.js":19}],21:[function(a,b,c){var d=a("turf-extent"),e=a("turf-point");b.exports=function(a,b){var c=d(a),f=(c[0]+c[2])/2,g=(c[1]+c[3])/2;return e([f,g])}},{"turf-extent":70,"turf-point":102}],22:[function(a,b,c){var d=a("turf-meta").coordEach,e=a("turf-point");b.exports=function(a){var b=0,c=0,f=0;return d(a,function(a){b+=a[0],c+=a[1],f++},!0),e([b/f,c/f])}},{"turf-meta":23,"turf-point":102}],23:[function(a,b,c){function d(a,b,c){var d,e,f,g,h,i,j,k,m,n=0,o="FeatureCollection"===a.type,p="Feature"===a.type,q=o?a.features.length:1;for(d=0;q>d;d++)for(k=o?a.features[d].geometry:p?a.geometry:a,m="GeometryCollection"===k.type,i=m?k.geometries.length:1,g=0;i>g;g++)if(h=m?k.geometries[g]:k,j=h.coordinates,n=!c||"Polygon"!==h.type&&"MultiPolygon"!==h.type?0:1,"Point"===h.type)b(j);else if("LineString"===h.type||"MultiPoint"===h.type)for(e=0;e<j.length;e++)b(j[e]);else if("Polygon"===h.type||"MultiLineString"===h.type)for(e=0;e<j.length;e++)for(f=0;f<j[e].length-n;f++)b(j[e][f]);else{if("MultiPolygon"!==h.type)throw new Error("Unknown Geometry Type");for(e=0;e<j.length;e++)for(f=0;f<j[e].length;f++)for(l=0;l<j[e][f].length-n;l++)b(j[e][f][l])}}function e(a,b,c,e){return d(a,function(a){c=b(c,a)},e),c}function f(a,b){var c;switch(a.type){case"FeatureCollection":for(features=a.features,c=0;c<a.features.length;c++)b(a.features[c].properties);break;case"Feature":b(a.properties)}}function g(a,b,c){return f(a,function(a){c=b(c,a)}),c}b.exports.coordEach=d,b.exports.coordReduce=e,b.exports.propEach=f,b.exports.propReduce=g},{}],24:[function(a,b,c){function d(a){return a.map(function(a){return a.coordinates})}b.exports=function(a){var b=a.features[0].geometry.type,c=a.features.map(function(a){return a.geometry});switch(b){case"Point":return{type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:d(c)}};case"LineString":return{type:"Feature",properties:{},geometry:{type:"MultiLineString",coordinates:d(c)}};case"Polygon":return{type:"Feature",properties:{},geometry:{type:"MultiPolygon",coordinates:d(c)}};default:return a}}},{}],25:[function(a,b,c){var d={};d.tin=a("turf-tin"),d.merge=a("turf-merge"),d.distance=a("turf-distance"),d.point=a("turf-point"),b.exports=function(a,b,c){function e(a){var e=d.point(a.geometry.coordinates[0][0]),f=d.point(a.geometry.coordinates[0][1]),g=d.point(a.geometry.coordinates[0][2]),h=d.distance(e,f,c),i=d.distance(f,g,c),j=d.distance(e,g,c);return b>=h&&b>=i&&b>=j}if("number"!=typeof b)throw new Error("maxEdge parameter is required");if("string"!=typeof c)throw new Error("units parameter is required");var f=d.tin(a),g=f.features.filter(e);return f.features=g,d.merge(f)}},{"turf-distance":60,"turf-merge":93,"turf-point":102,"turf-tin":118}],26:[function(a,b,c){var d=a("turf-meta").coordEach,e=a("convex-hull"),f=a("turf-polygon");b.exports=function(a){var b=[];d(a,function(a){b.push(a)});for(var c=e(b),g=[],h=0;h<c.length;h++)g.push(b[c[h][0]]);return g.push(b[c[c.length-1][1]]),f([g])}},{"convex-hull":27,"turf-meta":55,"turf-polygon":103}],27:[function(a,b,c){"use strict";function d(a){var b=a.length;if(0===b)return[];if(1===b)return[[0]];var c=a[0].length;return 0===c?[]:1===c?e(a):2===c?f(a):g(a,c)}var e=a("./lib/ch1d"),f=a("./lib/ch2d"),g=a("./lib/chnd");b.exports=d},{"./lib/ch1d":28,"./lib/ch2d":29,"./lib/chnd":30}],28:[function(a,b,c){"use strict";function d(a){for(var b=0,c=0,d=1;d<a.length;++d)a[d][0]<a[b][0]&&(b=d),a[d][0]>a[c][0]&&(c=d);return c>b?[[b],[c]]:b>c?[[c],[b]]:[[b]]}b.exports=d},{}],29:[function(a,b,c){"use strict";function d(a){var b=e(a),c=b.length;if(2>=c)return[];for(var d=new Array(c),f=b[c-1],g=0;c>g;++g){var h=b[g];d[g]=[f,h],f=h}return d}b.exports=d;var e=a("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":48}],30:[function(a,b,c){"use strict";function d(a,b){for(var c=a.length,d=new Array(c),e=0;e<b.length;++e)d[e]=a[b[e]];for(var f=b.length,e=0;c>e;++e)b.indexOf(e)<0&&(d[f++]=a[e]);return d}function e(a,b){for(var c=a.length,d=b.length,e=0;c>e;++e)for(var f=a[e],g=0;g<f.length;++g){var h=f[g];if(d>h)f[g]=b[h];else{h-=d;for(var i=0;d>i;++i)h>=b[i]&&(h+=1);f[g]=h}}return a}function f(a,b){try{return g(a,!0)}catch(c){var f=h(a);if(f.length<=b)return[];var i=d(a,f),j=g(i,!0);return e(j,f)}}b.exports=f;var g=a("incremental-convex-hull"),h=a("affine-hull")},{"affine-hull":31,"incremental-convex-hull":38}],31:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(b+1),d=0;d<a.length;++d)c[d]=a[d];for(var d=0;d<=a.length;++d){for(var e=a.length;b>=e;++e){for(var g=new Array(b),h=0;b>h;++h)g[h]=Math.pow(e+1-d,h);c[e]=g}var i=f.apply(void 0,c);if(i)return!0}return!1}function e(a){var b=a.length;if(0===b)return[];if(1===b)return[0];for(var c=a[0].length,e=[a[0]],f=[0],g=1;b>g;++g)if(e.push(a[g]),d(e,c)){if(f.push(g),f.length===c+1)return f}else e.pop();return f}b.exports=e;var f=a("robust-orientation")},{"robust-orientation":37}],32:[function(a,b,c){"use strict";function d(a,b,c){var d=a+b,e=d-a,f=d-e,g=b-e,h=a-f;return c?(c[0]=h+g,c[1]=d,c):[h+g,d]}b.exports=d},{}],33:[function(a,b,c){"use strict";function d(a,b){var c=a.length;if(1===c){var d=e(a[0],b);return d[0]?d:[d[1]]}var g=new Array(2*c),h=[.1,.1],i=[.1,.1],j=0;e(a[0],b,h),h[0]&&(g[j++]=h[0]);for(var k=1;c>k;++k){e(a[k],b,i);var l=h[1];f(l,i[0],h),h[0]&&(g[j++]=h[0]);var m=i[1],n=h[1],o=m+n,p=o-m,q=n-p;h[1]=o,q&&(g[j++]=q)}return h[1]&&(g[j++]=h[1]),0===j&&(g[j++]=0),g.length=j,g}var e=a("two-product"),f=a("two-sum");b.exports=d},{"two-product":36,"two-sum":32}],34:[function(a,b,c){"use strict";function d(a,b){var c=a+b,d=c-a,e=c-d,f=b-d,g=a-e,h=g+f;return h?[h,c]:[c]}function e(a,b){var c=0|a.length,e=0|b.length;
  if(1===c&&1===e)return d(a[0],-b[0]);var f,g,h=c+e,i=new Array(h),j=0,k=0,l=0,m=Math.abs,n=a[k],o=m(n),p=-b[l],q=m(p);q>o?(g=n,k+=1,c>k&&(n=a[k],o=m(n))):(g=p,l+=1,e>l&&(p=-b[l],q=m(p))),c>k&&q>o||l>=e?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=-b[l],q=m(p)));for(var r,s,t,u,v,w=f+g,x=w-f,y=g-x,z=y,A=w;c>k&&e>l;)q>o?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=-b[l],q=m(p))),g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r;for(;c>k;)f=n,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,k+=1,c>k&&(n=a[k]);for(;e>l;)f=p,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,l+=1,e>l&&(p=-b[l]);return z&&(i[j++]=z),A&&(i[j++]=A),j||(i[j++]=0),i.length=j,i}b.exports=e},{}],35:[function(a,b,c){"use strict";function d(a,b){var c=a+b,d=c-a,e=c-d,f=b-d,g=a-e,h=g+f;return h?[h,c]:[c]}function e(a,b){var c=0|a.length,e=0|b.length;if(1===c&&1===e)return d(a[0],b[0]);var f,g,h=c+e,i=new Array(h),j=0,k=0,l=0,m=Math.abs,n=a[k],o=m(n),p=b[l],q=m(p);q>o?(g=n,k+=1,c>k&&(n=a[k],o=m(n))):(g=p,l+=1,e>l&&(p=b[l],q=m(p))),c>k&&q>o||l>=e?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=b[l],q=m(p)));for(var r,s,t,u,v,w=f+g,x=w-f,y=g-x,z=y,A=w;c>k&&e>l;)q>o?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=b[l],q=m(p))),g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r;for(;c>k;)f=n,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,k+=1,c>k&&(n=a[k]);for(;e>l;)f=p,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,l+=1,e>l&&(p=b[l]);return z&&(i[j++]=z),A&&(i[j++]=A),j||(i[j++]=0),i.length=j,i}b.exports=e},{}],36:[function(a,b,c){"use strict";function d(a,b,c){var d=a*b,f=e*a,g=f-a,h=f-g,i=a-h,j=e*b,k=j-b,l=j-k,m=b-l,n=d-h*l,o=n-i*l,p=o-h*m,q=i*m-p;return c?(c[0]=q,c[1]=d,c):[q,d]}b.exports=d;var e=+(Math.pow(2,27)+1)},{}],37:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a.length-1),d=1;d<a.length;++d)for(var e=c[d-1]=new Array(a.length-1),f=0,g=0;f<a.length;++f)f!==b&&(e[g++]=a[d][f]);return c}function e(a){for(var b=new Array(a),c=0;a>c;++c){b[c]=new Array(a);for(var d=0;a>d;++d)b[c][d]=["m",d,"[",a-c-1,"]"].join("")}return b}function f(a){return 1&a?"-":""}function g(a){if(1===a.length)return a[0];if(2===a.length)return["sum(",a[0],",",a[1],")"].join("");var b=a.length>>1;return["sum(",g(a.slice(0,b)),",",g(a.slice(b)),")"].join("")}function h(a){if(2===a.length)return[["sum(prod(",a[0][0],",",a[1][1],"),prod(-",a[0][1],",",a[1][0],"))"].join("")];for(var b=[],c=0;c<a.length;++c)b.push(["scale(",g(h(d(a,c))),",",f(c),a[0][c],")"].join(""));return b}function i(a){for(var b=[],c=[],f=e(a),i=[],j=0;a>j;++j)0===(1&j)?b.push.apply(b,h(d(f,j))):c.push.apply(c,h(d(f,j))),i.push("m"+j);var k=g(b),p=g(c),q="orientation"+a+"Exact",r=["function ",q,"(",i.join(),"){var p=",k,",n=",p,",d=sub(p,n);return d[d.length-1];};return ",q].join(""),s=new Function("sum","prod","scale","sub",r);return s(m,l,n,o)}function j(a){var b=v[a.length];return b||(b=v[a.length]=i(a.length)),b.apply(void 0,a)}function k(){for(;v.length<=p;)v.push(i(v.length));for(var a=[],c=["slow"],d=0;p>=d;++d)a.push("a"+d),c.push("o"+d);for(var e=["function getOrientation(",a.join(),"){switch(arguments.length){case 0:case 1:return 0;"],d=2;p>=d;++d)e.push("case ",d,":return o",d,"(",a.slice(0,d).join(),");");e.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),c.push(e.join(""));var f=Function.apply(void 0,c);b.exports=f.apply(void 0,[j].concat(v));for(var d=0;p>=d;++d)b.exports[d]=v[d]}var l=a("two-product"),m=a("robust-sum"),n=a("robust-scale"),o=a("robust-subtract"),p=5,q=1.1102230246251565e-16,r=(3+16*q)*q,s=(7+56*q)*q,t=i(3),u=i(4),v=[function(){return 0},function(){return 0},function(a,b){return b[0]-a[0]},function(a,b,c){var d,e=(a[1]-c[1])*(b[0]-c[0]),f=(a[0]-c[0])*(b[1]-c[1]),g=e-f;if(e>0){if(0>=f)return g;d=e+f}else{if(!(0>e))return g;if(f>=0)return g;d=-(e+f)}var h=r*d;return g>=h||-h>=g?g:t(a,b,c)},function(a,b,c,d){var e=a[0]-d[0],f=b[0]-d[0],g=c[0]-d[0],h=a[1]-d[1],i=b[1]-d[1],j=c[1]-d[1],k=a[2]-d[2],l=b[2]-d[2],m=c[2]-d[2],n=f*j,o=g*i,p=g*h,q=e*j,r=e*i,t=f*h,v=k*(n-o)+l*(p-q)+m*(r-t),w=(Math.abs(n)+Math.abs(o))*Math.abs(k)+(Math.abs(p)+Math.abs(q))*Math.abs(l)+(Math.abs(r)+Math.abs(t))*Math.abs(m),x=s*w;return v>x||-v>x?v:u(a,b,c,d)}];k()},{"robust-scale":33,"robust-subtract":34,"robust-sum":35,"two-product":36}],38:[function(a,b,c){"use strict";function d(a,b,c){this.vertices=a,this.adjacent=b,this.boundary=c,this.lastVisited=-1}function e(a,b,c){this.vertices=a,this.cell=b,this.index=c}function f(a,b){return k(a.vertices,b.vertices)}function g(a){for(var b=["function orient(){var tuple=this.tuple;return test("],c=0;a>=c;++c)c>0&&b.push(","),b.push("tuple[",c,"]");b.push(")}return orient");var d=new Function("test",b.join("")),e=j[a+1];return e||(e=j),d(e)}function h(a,b,c){this.dimension=a,this.vertices=b,this.simplices=c,this.interior=c.filter(function(a){return!a.boundary}),this.tuple=new Array(a+1);for(var d=0;a>=d;++d)this.tuple[d]=this.vertices[d];var e=l[a];e||(e=l[a]=g(a)),this.orient=e}function i(a,b){var c=a.length;if(0===c)throw new Error("Must have at least d+1 points");var e=a[0].length;if(e>=c)throw new Error("Must input at least d+1 points");var f=a.slice(0,e+1),g=j.apply(void 0,f);if(0===g)throw new Error("Input not in general position");for(var i=new Array(e+1),k=0;e>=k;++k)i[k]=k;0>g&&(i[0]=1,i[1]=0);for(var l=new d(i,new Array(e+1),!1),m=l.adjacent,n=new Array(e+2),k=0;e>=k;++k){for(var o=i.slice(),p=0;e>=p;++p)p===k&&(o[p]=-1);var q=o[0];o[0]=o[1],o[1]=q;var r=new d(o,new Array(e+1),!0);m[k]=r,n[k]=r}n[e+1]=l;for(var k=0;e>=k;++k)for(var o=m[k].vertices,s=m[k].adjacent,p=0;e>=p;++p){var t=o[p];if(0>t)s[p]=l;else for(var u=0;e>=u;++u)m[u].vertices.indexOf(t)<0&&(s[p]=m[u])}for(var v=new h(e,f,n),w=!!b,k=e+1;c>k;++k)v.insert(a[k],w);return v.boundary()}b.exports=i;var j=a("robust-orientation"),k=a("simplicial-complex").compareCells;d.prototype.flip=function(){var a=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=a;var b=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=b};var l=[],m=h.prototype;m.handleBoundaryDegeneracy=function(a,b){var c=this.dimension,d=this.vertices.length-1,e=this.tuple,f=this.vertices,g=[a];for(a.lastVisited=-d;g.length>0;){a=g.pop();for(var h=(a.vertices,a.adjacent),i=0;c>=i;++i){var j=h[i];if(j.boundary&&!(j.lastVisited<=-d)){for(var k=j.vertices,l=0;c>=l;++l){var m=k[l];0>m?e[l]=b:e[l]=f[m]}var n=this.orient();if(n>0)return j;j.lastVisited=-d,0===n&&g.push(j)}}}return null},m.walk=function(a,b){var c=this.vertices.length-1,d=this.dimension,e=this.vertices,f=this.tuple,g=b?this.interior.length*Math.random()|0:this.interior.length-1,h=this.interior[g];a:for(;!h.boundary;){for(var i=h.vertices,j=h.adjacent,k=0;d>=k;++k)f[k]=e[i[k]];h.lastVisited=c;for(var k=0;d>=k;++k){var l=j[k];if(!(l.lastVisited>=c)){var m=f[k];f[k]=a;var n=this.orient();if(f[k]=m,0>n){h=l;continue a}l.boundary?l.lastVisited=-c:l.lastVisited=c}}return}return h},m.addPeaks=function(a,b){var c=this.vertices.length-1,g=this.dimension,h=this.vertices,i=this.tuple,j=this.interior,k=this.simplices,l=[b];b.lastVisited=c,b.vertices[b.vertices.indexOf(-1)]=c,b.boundary=!1,j.push(b);for(var m=[];l.length>0;){var b=l.pop(),n=b.vertices,o=b.adjacent,p=n.indexOf(c);if(!(0>p))for(var q=0;g>=q;++q)if(q!==p){var r=o[q];if(r.boundary&&!(r.lastVisited>=c)){var s=r.vertices;if(r.lastVisited!==-c){for(var t=0,u=0;g>=u;++u)s[u]<0?(t=u,i[u]=a):i[u]=h[s[u]];var v=this.orient();if(v>0){s[t]=c,r.boundary=!1,j.push(r),l.push(r),r.lastVisited=c;continue}r.lastVisited=-c}var w=r.adjacent,x=n.slice(),y=o.slice(),z=new d(x,y,!0);k.push(z);var A=w.indexOf(b);if(!(0>A)){w[A]=z,y[p]=r,x[q]=-1,y[q]=b,o[q]=z,z.flip();for(var u=0;g>=u;++u){var B=x[u];if(!(0>B||B===c)){for(var C=new Array(g-1),D=0,E=0;g>=E;++E){var F=x[E];0>F||E===u||(C[D++]=F)}m.push(new e(C,z,u))}}}}}}m.sort(f);for(var q=0;q+1<m.length;q+=2){var G=m[q],H=m[q+1],I=G.index,J=H.index;0>I||0>J||(G.cell.adjacent[G.index]=H.cell,H.cell.adjacent[H.index]=G.cell)}},m.insert=function(a,b){var c=this.vertices;c.push(a);var d=this.walk(a,b);if(d){for(var e=this.dimension,f=this.tuple,g=0;e>=g;++g){var h=d.vertices[g];0>h?f[g]=a:f[g]=c[h]}var i=this.orient(f);0>i||(0!==i||(d=this.handleBoundaryDegeneracy(d,a)))&&this.addPeaks(a,d)}},m.boundary=function(){for(var a=this.dimension,b=[],c=this.simplices,d=c.length,e=0;d>e;++e){var f=c[e];if(f.boundary){for(var g=new Array(a),h=f.vertices,i=0,j=0,k=0;a>=k;++k)h[k]>=0?g[i++]=h[k]:j=1&k;if(j===(1&a)){var l=g[0];g[0]=g[1],g[1]=l}b.push(g)}}return b}},{"robust-orientation":44,"simplicial-complex":47}],39:[function(a,b,c){arguments[4][32][0].apply(c,arguments)},{dup:32}],40:[function(a,b,c){arguments[4][33][0].apply(c,arguments)},{dup:33,"two-product":43,"two-sum":39}],41:[function(a,b,c){arguments[4][34][0].apply(c,arguments)},{dup:34}],42:[function(a,b,c){arguments[4][35][0].apply(c,arguments)},{dup:35}],43:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],44:[function(a,b,c){arguments[4][37][0].apply(c,arguments)},{dup:37,"robust-scale":40,"robust-subtract":41,"robust-sum":42,"two-product":43}],45:[function(a,b,c){"use strict";"use restrict";function d(a){var b=32;return a&=-a,a&&b--,65535&a&&(b-=16),16711935&a&&(b-=8),252645135&a&&(b-=4),858993459&a&&(b-=2),1431655765&a&&(b-=1),b}var e=32;c.INT_BITS=e,c.INT_MAX=2147483647,c.INT_MIN=-1<<e-1,c.sign=function(a){return(a>0)-(0>a)},c.abs=function(a){var b=a>>e-1;return(a^b)-b},c.min=function(a,b){return b^(a^b)&-(b>a)},c.max=function(a,b){return a^(a^b)&-(b>a)},c.isPow2=function(a){return!(a&a-1||!a)},c.log2=function(a){var b,c;return b=(a>65535)<<4,a>>>=b,c=(a>255)<<3,a>>>=c,b|=c,c=(a>15)<<2,a>>>=c,b|=c,c=(a>3)<<1,a>>>=c,b|=c,b|a>>1},c.log10=function(a){return a>=1e9?9:a>=1e8?8:a>=1e7?7:a>=1e6?6:a>=1e5?5:a>=1e4?4:a>=1e3?3:a>=100?2:a>=10?1:0},c.popCount=function(a){return a-=a>>>1&1431655765,a=(858993459&a)+(a>>>2&858993459),16843009*(a+(a>>>4)&252645135)>>>24},c.countTrailingZeros=d,c.nextPow2=function(a){return a+=0===a,--a,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a+1},c.prevPow2=function(a){return a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a-(a>>>1)},c.parity=function(a){return a^=a>>>16,a^=a>>>8,a^=a>>>4,a&=15,27030>>>a&1};var f=new Array(256);!function(a){for(var b=0;256>b;++b){var c=b,d=b,e=7;for(c>>>=1;c;c>>>=1)d<<=1,d|=1&c,--e;a[b]=d<<e&255}}(f),c.reverse=function(a){return f[255&a]<<24|f[a>>>8&255]<<16|f[a>>>16&255]<<8|f[a>>>24&255]},c.interleave2=function(a,b){return a&=65535,a=16711935&(a|a<<8),a=252645135&(a|a<<4),a=858993459&(a|a<<2),a=1431655765&(a|a<<1),b&=65535,b=16711935&(b|b<<8),b=252645135&(b|b<<4),b=858993459&(b|b<<2),b=1431655765&(b|b<<1),a|b<<1},c.deinterleave2=function(a,b){return a=a>>>b&1431655765,a=858993459&(a|a>>>1),a=252645135&(a|a>>>2),a=16711935&(a|a>>>4),a=65535&(a|a>>>16),a<<16>>16},c.interleave3=function(a,b,c){return a&=1023,a=4278190335&(a|a<<16),a=251719695&(a|a<<8),a=3272356035&(a|a<<4),a=1227133513&(a|a<<2),b&=1023,b=4278190335&(b|b<<16),b=251719695&(b|b<<8),b=3272356035&(b|b<<4),b=1227133513&(b|b<<2),a|=b<<1,c&=1023,c=4278190335&(c|c<<16),c=251719695&(c|c<<8),c=3272356035&(c|c<<4),c=1227133513&(c|c<<2),a|c<<2},c.deinterleave3=function(a,b){return a=a>>>b&1227133513,a=3272356035&(a|a>>>2),a=251719695&(a|a>>>4),a=4278190335&(a|a>>>8),a=1023&(a|a>>>16),a<<22>>22},c.nextCombination=function(a){var b=a|a-1;return b+1|(~b&-~b)-1>>>d(a)+1}},{}],46:[function(a,b,c){"use strict";"use restrict";function d(a){this.roots=new Array(a),this.ranks=new Array(a);for(var b=0;a>b;++b)this.roots[b]=b,this.ranks[b]=0}b.exports=d;var e=d.prototype;Object.defineProperty(e,"length",{get:function(){return this.roots.length}}),e.makeSet=function(){var a=this.roots.length;return this.roots.push(a),this.ranks.push(0),a},e.find=function(a){for(var b=a,c=this.roots;c[a]!==a;)a=c[a];for(;c[b]!==a;){var d=c[b];c[b]=a,b=d}return a},e.link=function(a,b){var c=this.find(a),d=this.find(b);if(c!==d){var e=this.ranks,f=this.roots,g=e[c],h=e[d];h>g?f[c]=d:g>h?f[d]=c:(f[d]=c,++e[c])}}},{}],47:[function(a,b,c){"use strict";"use restrict";function d(a){for(var b=0,c=Math.max,d=0,e=a.length;e>d;++d)b=c(b,a[d].length);return b-1}function e(a){for(var b=-1,c=Math.max,d=0,e=a.length;e>d;++d)for(var f=a[d],g=0,h=f.length;h>g;++g)b=c(b,f[g]);return b+1}function f(a){for(var b=new Array(a.length),c=0,d=a.length;d>c;++c)b[c]=a[c].slice(0);return b}function g(a,b){var c=a.length,d=a.length-b.length,e=Math.min;if(d)return d;switch(c){case 0:return 0;case 1:return a[0]-b[0];case 2:var f=a[0]+a[1]-b[0]-b[1];return f?f:e(a[0],a[1])-e(b[0],b[1]);case 3:var g=a[0]+a[1],h=b[0]+b[1];if(f=g+a[2]-(h+b[2]))return f;var i=e(a[0],a[1]),j=e(b[0],b[1]),f=e(i,a[2])-e(j,b[2]);return f?f:e(i+a[2],g)-e(j+b[2],h);default:var k=a.slice(0);k.sort();var l=b.slice(0);l.sort();for(var m=0;c>m;++m)if(d=k[m]-l[m])return d;return 0}}function h(a,b){return g(a[0],b[0])}function i(a,b){if(b){for(var c=a.length,d=new Array(c),e=0;c>e;++e)d[e]=[a[e],b[e]];d.sort(h);for(var e=0;c>e;++e)a[e]=d[e][0],b[e]=d[e][1];return a}return a.sort(g),a}function j(a){if(0===a.length)return[];for(var b=1,c=a.length,d=1;c>d;++d){var e=a[d];if(g(e,a[d-1])){if(d===b){b++;continue}a[b++]=e}}return a.length=b,a}function k(a,b){for(var c=0,d=a.length-1,e=-1;d>=c;){var f=c+d>>1,h=g(a[f],b);0>=h?(0===h&&(e=f),c=f+1):h>0&&(d=f-1)}return e}function l(a,b){for(var c=new Array(a.length),d=0,e=c.length;e>d;++d)c[d]=[];for(var f=[],d=0,h=b.length;h>d;++d)for(var i=b[d],j=i.length,l=1,m=1<<j;m>l;++l){f.length=t.popCount(l);for(var n=0,o=0;j>o;++o)l&1<<o&&(f[n++]=i[o]);var p=k(a,f);if(!(0>p))for(;c[p++].push(d),!(p>=a.length||0!==g(a[p],f)););}return c}function m(a,b){if(!b)return l(j(o(a,0)),a,0);for(var c=new Array(b),d=0;b>d;++d)c[d]=[];for(var d=0,e=a.length;e>d;++d)for(var f=a[d],g=0,h=f.length;h>g;++g)c[f[g]].push(d);return c}function n(a){for(var b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0|e.length,g=1,h=1<<f;h>g;++g){for(var j=[],k=0;f>k;++k)g>>>k&1&&j.push(e[k]);b.push(j)}return i(b)}function o(a,b){if(0>b)return[];for(var c=[],d=(1<<b+1)-1,e=0;e<a.length;++e)for(var f=a[e],g=d;g<1<<f.length;g=t.nextCombination(g)){for(var h=new Array(b+1),j=0,k=0;k<f.length;++k)g&1<<k&&(h[j++]=f[k]);c.push(h)}return i(c)}function p(a){for(var b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0,g=e.length;g>f;++f){for(var h=new Array(e.length-1),j=0,k=0;g>j;++j)j!==f&&(h[k++]=e[j]);b.push(h)}return i(b)}function q(a,b){for(var c=new u(b),d=0;d<a.length;++d)for(var e=a[d],f=0;f<e.length;++f)for(var g=f+1;g<e.length;++g)c.link(e[f],e[g]);for(var h=[],i=c.ranks,d=0;d<i.length;++d)i[d]=-1;for(var d=0;d<a.length;++d){var j=c.find(a[d][0]);i[j]<0?(i[j]=h.length,h.push([a[d].slice(0)])):h[i[j]].push(a[d].slice(0))}return h}function r(a){for(var b=j(i(o(a,0))),c=new u(b.length),d=0;d<a.length;++d)for(var e=a[d],f=0;f<e.length;++f)for(var g=k(b,[e[f]]),h=f+1;h<e.length;++h)c.link(g,k(b,[e[h]]));for(var l=[],m=c.ranks,d=0;d<m.length;++d)m[d]=-1;for(var d=0;d<a.length;++d){var n=c.find(k(b,[a[d][0]]));m[n]<0?(m[n]=l.length,l.push([a[d].slice(0)])):l[m[n]].push(a[d].slice(0))}return l}function s(a,b){return b?q(a,b):r(a)}var t=a("bit-twiddle"),u=a("union-find");c.dimension=d,c.countVertices=e,c.cloneCells=f,c.compareCells=g,c.normalize=i,c.unique=j,c.findCell=k,c.incidence=l,c.dual=m,c.explode=n,c.skeleton=o,c.boundary=p,c.connectedComponents=s},{"bit-twiddle":45,"union-find":46}],48:[function(a,b,c){"use strict";function d(a){var b=a.length;if(3>b){for(var c=new Array(b),d=0;b>d;++d)c[d]=d;return 2===b&&a[0][0]===a[1][0]&&a[0][1]===a[1][1]?[0]:c}for(var f=new Array(b),d=0;b>d;++d)f[d]=d;f.sort(function(b,c){var d=a[b][0]-a[c][0];return d?d:a[b][1]-a[c][1]});for(var g=[f[0],f[1]],h=[f[0],f[1]],d=2;b>d;++d){for(var i=f[d],j=a[i],k=g.length;k>1&&e(a[g[k-2]],a[g[k-1]],j)<=0;)k-=1,g.pop();for(g.push(i),k=h.length;k>1&&e(a[h[k-2]],a[h[k-1]],j)>=0;)k-=1,h.pop();h.push(i)}for(var c=new Array(h.length+g.length-2),l=0,d=0,m=g.length;m>d;++d)c[l++]=g[d];for(var n=h.length-2;n>0;--n)c[l++]=h[n];return c}b.exports=d;var e=a("robust-orientation")[3]},{"robust-orientation":54}],49:[function(a,b,c){arguments[4][32][0].apply(c,arguments)},{dup:32}],50:[function(a,b,c){arguments[4][33][0].apply(c,arguments)},{dup:33,"two-product":53,"two-sum":49}],51:[function(a,b,c){arguments[4][34][0].apply(c,arguments)},{dup:34}],52:[function(a,b,c){arguments[4][35][0].apply(c,arguments)},{dup:35}],53:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],54:[function(a,b,c){arguments[4][37][0].apply(c,arguments)},{dup:37,"robust-scale":50,"robust-subtract":51,"robust-sum":52,"two-product":53}],55:[function(a,b,c){arguments[4][23][0].apply(c,arguments)},{dup:23}],56:[function(a,b,c){var d=a("turf-inside");b.exports=function(a,b,c,e){for(var f=0;f<a.features.length;f++){var g=a.features[f];g.properties||(g.properties={});for(var h=0,i=0;i<b.features.length;i++){var j=b.features[i];d(j,g)&&h++}g.properties[c]=h}return a}},{"turf-inside":76}],57:[function(a,b,c){function d(a){return a*Math.PI/180}function e(a){return 180*a/Math.PI}var f=a("turf-point");b.exports=function(a,b,c,g){var h=a.geometry.coordinates,i=d(h[0]),j=d(h[1]),k=d(c),l=0;switch(g){case"miles":l=3960;break;case"kilometers":l=6373;break;case"degrees":l=57.2957795;break;case"radians":l=1}var m=Math.asin(Math.sin(j)*Math.cos(b/l)+Math.cos(j)*Math.sin(b/l)*Math.cos(k)),n=i+Math.atan2(Math.sin(k)*Math.sin(b/l)*Math.cos(j),Math.cos(b/l)-Math.sin(j)*Math.sin(m));return f([e(n),e(m)])}},{"turf-point":102}],58:[function(a,b,c){var d=a("simple-statistics"),e=a("turf-inside");b.exports=function(a,b,c,f,g){return a.features.forEach(function(a){a.properties||(a.properties={});var g=[];b.features.forEach(function(b){e(b,a)&&g.push(b.properties[c])}),a.properties[f]=d.standard_deviation(g)}),a}},{"simple-statistics":59,"turf-inside":76}],59:[function(a,b,c){!function(){function a(){var a={},b=[];return a.data=function(c){return arguments.length?(b=c.slice(),a):b},a.mb=function(){var a,c,d=b.length;if(1===d)a=0,c=b[0][1];else{for(var e,f,g,h=0,i=0,j=0,k=0,l=0;d>l;l++)e=b[l],f=e[0],g=e[1],h+=f,i+=g,j+=f*f,k+=f*g;a=(d*k-h*i)/(d*j-h*h),c=i/d-a*h/d}return{m:a,b:c}},a.m=function(){return a.mb().m},a.b=function(){return a.mb().b},a.line=function(){var b=a.mb(),c=b.m,d=b.b;return function(a){return d+c*a}},a}function c(a,b){if(a.length<2)return 1;for(var c,d=0,e=0;e<a.length;e++)d+=a[e][1];c=d/a.length;for(var f=0,g=0;g<a.length;g++)f+=Math.pow(c-a[g][1],2);for(var h=0,i=0;i<a.length;i++)h+=Math.pow(a[i][1]-b(a[i][0]),2);return 1-h/f}function d(){var a={},b=0,c={};return a.train=function(a,d){c[d]||(c[d]={});for(var e in a){var f=a[e];void 0===c[d][e]&&(c[d][e]={}),void 0===c[d][e][f]&&(c[d][e][f]=0),c[d][e][a[e]]++}b++},a.score=function(a){var d,e={};for(var f in a){var g=a[f];for(d in c)void 0===e[d]&&(e[d]={}),c[d][f]?e[d][f+"_"+g]=(c[d][f][g]||0)/b:e[d][f+"_"+g]=0}var h={};for(d in e)for(var i in e[d])void 0===h[d]&&(h[d]=0),h[d]+=e[d][i];return h},a}function e(a){for(var b=0,c=0;c<a.length;c++)b+=a[c];return b}function f(a){return 0===a.length?null:e(a)/a.length}function g(a){if(0===a.length)return null;for(var b=1,c=0;c<a.length;c++){if(a[c]<=0)return null;b*=a[c]}return Math.pow(b,1/a.length)}function h(a){if(0===a.length)return null;for(var b=0,c=0;c<a.length;c++){if(a[c]<=0)return null;b+=1/a[c]}return a.length/b}function i(a){if(0===a.length)return null;for(var b=0,c=0;c<a.length;c++)b+=Math.pow(a[c],2);return Math.sqrt(b/a.length)}function j(a){for(var b,c=0;c<a.length;c++)(a[c]<b||void 0===b)&&(b=a[c]);return b}function k(a){for(var b,c=0;c<a.length;c++)(a[c]>b||void 0===b)&&(b=a[c]);return b}function l(a){if(0===a.length)return null;for(var b=f(a),c=[],d=0;d<a.length;d++)c.push(Math.pow(a[d]-b,2));return f(c)}function m(a){return 0===a.length?null:Math.sqrt(l(a))}function n(a,b){for(var c=f(a),d=0,e=0;e<a.length;e++)d+=Math.pow(a[e]-c,b);return d}function o(a){if(a.length<=1)return null;var b=n(a,2);return b/(a.length-1)}function p(a){return a.length<=1?null:Math.sqrt(o(a))}function q(a,b){if(a.length<=1||a.length!=b.length)return null;for(var c=f(a),d=f(b),e=0,g=0;g<a.length;g++)e+=(a[g]-c)*(b[g]-d);return e/(a.length-1)}function r(a,b){var c=q(a,b),d=p(a),e=p(b);return null===c||null===d||null===e?null:c/d/e}function s(a){if(0===a.length)return null;var b=a.slice().sort(function(a,b){return a-b});if(b.length%2===1)return b[(b.length-1)/2];var c=b[b.length/2-1],d=b[b.length/2];return(c+d)/2}function t(a){if(0===a.length)return null;if(1===a.length)return a[0];for(var b,c=a.slice().sort(function(a,b){return a-b}),d=c[0],e=0,f=1,g=1;g<c.length+1;g++)c[g]!==d?(f>e&&(e=f,b=d),f=1,d=c[g]):f++;return b}function u(a,b){var c=f(a),d=m(a),e=Math.sqrt(a.length);return(c-b)/(d/e)}function v(a,b,c){var d=a.length,e=b.length;if(!d||!e)return null;c||(c=0);var g=f(a),h=f(b),i=((d-1)*o(a)+(e-1)*o(b))/(d+e-2);return(g-h-c)/Math.sqrt(i*(1/d+1/e))}function w(a,b){var c=[];if(0>=b)return null;for(var d=0;d<a.length;d+=b)c.push(a.slice(d,d+b));return c}function x(a,b){b=b||Math.random;for(var c,d,e=a.length;e>0;)d=Math.floor(b()*e--),c=a[e],a[e]=a[d],a[d]=c;return a}function y(a,b){return a=a.slice(),x(a.slice(),b)}function z(a,b,c){var d=y(a,c);return d.slice(0,b)}function A(a,b){if(0===a.length)return null;var c=a.slice().sort(function(a,b){return a-b});if(b.length){for(var d=[],e=0;e<b.length;e++)d[e]=B(c,b[e]);return d}return B(c,b)}function B(a,b){var c=a.length*b;return 0>b||b>1?null:1===b?a[a.length-1]:0===b?a[0]:c%1!==0?a[Math.ceil(c)-1]:a.length%2===0?(a[c-1]+a[c])/2:a[c]}function C(a){return 0===a.length?null:A(a,.75)-A(a,.25)}function D(a){if(!a||0===a.length)return null;for(var b=s(a),c=[],d=0;d<a.length;d++)c.push(Math.abs(a[d]-b));return s(c)}function E(a,b){var c,d,e=[],f=[],g=0;for(c=0;c<a.length+1;c++){var h=[],i=[];for(d=0;b+1>d;d++)h.push(0),i.push(0);e.push(h),f.push(i)}for(c=1;b+1>c;c++)for(e[1][c]=1,f[1][c]=0,d=2;d<a.length+1;d++)f[d][c]=1/0;for(var j=2;j<a.length+1;j++){for(var k=0,l=0,m=0,n=0,o=1;j+1>o;o++){var p=j-o+1,q=a[p-1];if(m++,k+=q,l+=q*q,g=l-k*k/m,n=p-1,0!==n)for(d=2;b+1>d;d++)f[j][d]>=g+f[n][d-1]&&(e[j][d]=p,f[j][d]=g+f[n][d-1])}e[j][1]=1,f[j][1]=g}return{lower_class_limits:e,variance_combinations:f}}function F(a,b,c){var d=a.length,e=[],f=c;for(e[c]=a[a.length-1];f>0;)e[f-1]=a[b[d][f]-1],d=b[d][f]-1,f--;return e}function G(a,b){if(b>a.length)return null;a=a.slice().sort(function(a,b){return a-b});var c=E(a,b),d=c.lower_class_limits;return F(a,d,b)}function H(a){if(a.length<3)return null;var b=a.length,c=Math.pow(p(a),3),d=n(a,3);return b*d/((b-1)*(b-2)*c)}function I(a){var b=1/(1+.5*Math.abs(a)),c=b*Math.exp(-Math.pow(a,2)-1.26551223+1.00002368*b+.37409196*Math.pow(b,2)+.09678418*Math.pow(b,3)-.18628806*Math.pow(b,4)+.27886807*Math.pow(b,5)-1.13520398*Math.pow(b,6)+1.48851587*Math.pow(b,7)-.82215223*Math.pow(b,8)+.17087277*Math.pow(b,9));return a>=0?1-c:c-1}function J(a){var b=Math.abs(a),c=Math.min(Math.round(100*b),S.length-1);return a>=0?S[c]:+(1-S[c]).toFixed(4)}function K(a,b,c){return(a-b)/c}function L(a){if(0>a)return null;for(var b=1,c=2;a>=c;c++)b*=c;return b}function M(a){return 0>a||a>1?null:N(1,a)}function N(a,b){function c(a,b,c){return L(b)/(L(a)*L(b-a))*Math.pow(c,a)*Math.pow(1-c,b-a)}if(0>b||b>1||0>=a||a%1!==0)return null;var d=0,e=0,f={};do f[d]=c(d,a,b),e+=f[d],d++;while(1-T>e);return f}function O(a){function b(a,b){return Math.pow(Math.E,-b)*Math.pow(b,a)/L(a)}if(0>=a)return null;var c=0,d=0,e={};do e[c]=b(c,a),d+=e[c],c++;while(1-T>d);return e}function P(a,b,c){for(var d,e,g=f(a),h=0,i=1,j=b(g),k=[],l=[],m=0;m<a.length;m++)void 0===k[a[m]]&&(k[a[m]]=0),k[a[m]]++;for(m=0;m<k.length;m++)void 0===k[m]&&(k[m]=0);for(e in j)e in k&&(l[e]=j[e]*a.length);for(e=l.length-1;e>=0;e--)l[e]<3&&(l[e-1]+=l[e],l.pop(),k[e-1]+=k[e],k.pop());for(e=0;e<k.length;e++)h+=Math.pow(k[e]-l[e],2)/l[e];return d=k.length-i-1,U[d][c]<h}function Q(a){function b(a){return function(){var b=Array.prototype.slice.apply(arguments);return b.unshift(this),R[a].apply(R,b)}}var c=!(!Object.defineProperty||!Object.defineProperties);if(!c)throw new Error("without defineProperty, simple-statistics cannot be mixed in");var d,e=["median","standard_deviation","sum","sample_skewness","mean","min","max","quantile","geometric_mean","harmonic_mean","root_mean_square"];d=a?a.slice():Array.prototype;for(var f=0;f<e.length;f++)Object.defineProperty(d,e[f],{value:b(e[f]),configurable:!0,enumerable:!1,writable:!0});return d}var R={};"undefined"!=typeof b?b.exports=R:this.ss=R;var S=[.5,.504,.508,.512,.516,.5199,.5239,.5279,.5319,.5359,.5398,.5438,.5478,.5517,.5557,.5596,.5636,.5675,.5714,.5753,.5793,.5832,.5871,.591,.5948,.5987,.6026,.6064,.6103,.6141,.6179,.6217,.6255,.6293,.6331,.6368,.6406,.6443,.648,.6517,.6554,.6591,.6628,.6664,.67,.6736,.6772,.6808,.6844,.6879,.6915,.695,.6985,.7019,.7054,.7088,.7123,.7157,.719,.7224,.7257,.7291,.7324,.7357,.7389,.7422,.7454,.7486,.7517,.7549,.758,.7611,.7642,.7673,.7704,.7734,.7764,.7794,.7823,.7852,.7881,.791,.7939,.7967,.7995,.8023,.8051,.8078,.8106,.8133,.8159,.8186,.8212,.8238,.8264,.8289,.8315,.834,.8365,.8389,.8413,.8438,.8461,.8485,.8508,.8531,.8554,.8577,.8599,.8621,.8643,.8665,.8686,.8708,.8729,.8749,.877,.879,.881,.883,.8849,.8869,.8888,.8907,.8925,.8944,.8962,.898,.8997,.9015,.9032,.9049,.9066,.9082,.9099,.9115,.9131,.9147,.9162,.9177,.9192,.9207,.9222,.9236,.9251,.9265,.9279,.9292,.9306,.9319,.9332,.9345,.9357,.937,.9382,.9394,.9406,.9418,.9429,.9441,.9452,.9463,.9474,.9484,.9495,.9505,.9515,.9525,.9535,.9545,.9554,.9564,.9573,.9582,.9591,.9599,.9608,.9616,.9625,.9633,.9641,.9649,.9656,.9664,.9671,.9678,.9686,.9693,.9699,.9706,.9713,.9719,.9726,.9732,.9738,.9744,.975,.9756,.9761,.9767,.9772,.9778,.9783,.9788,.9793,.9798,.9803,.9808,.9812,.9817,.9821,.9826,.983,.9834,.9838,.9842,.9846,.985,.9854,.9857,.9861,.9864,.9868,.9871,.9875,.9878,.9881,.9884,.9887,.989,.9893,.9896,.9898,.9901,.9904,.9906,.9909,.9911,.9913,.9916,.9918,.992,.9922,.9925,.9927,.9929,.9931,.9932,.9934,.9936,.9938,.994,.9941,.9943,.9945,.9946,.9948,.9949,.9951,.9952,.9953,.9955,.9956,.9957,.9959,.996,.9961,.9962,.9963,.9964,.9965,.9966,.9967,.9968,.9969,.997,.9971,.9972,.9973,.9974,.9974,.9975,.9976,.9977,.9977,.9978,.9979,.9979,.998,.9981,.9981,.9982,.9982,.9983,.9984,.9984,.9985,.9985,.9986,.9986,.9987,.9987,.9987,.9988,.9988,.9989,.9989,.9989,.999,.999],T=1e-4,U={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}};R.linear_regression=a,R.standard_deviation=m,R.r_squared=c,R.median=s,R.mean=f,R.mode=t,R.min=j,R.max=k,R.sum=e,R.quantile=A,R.quantile_sorted=B,R.iqr=C,R.mad=D,R.chunk=w,R.shuffle=y,R.shuffle_in_place=x,R.sample=z,R.sample_covariance=q,R.sample_correlation=r,R.sample_variance=o,R.sample_standard_deviation=p,R.sample_skewness=H,R.geometric_mean=g,R.harmonic_mean=h,R.root_mean_square=i,R.variance=l,R.t_test=u,R.t_test_two_sample=v,R.jenksMatrices=E,R.jenksBreaks=F,R.jenks=G,R.bayesian=d,R.epsilon=T,R.factorial=L,R.bernoulli_distribution=M,R.binomial_distribution=N,R.poisson_distribution=O,R.chi_squared_goodness_of_fit=P,R.z_score=K,R.cumulative_std_normal_probability=J,R.standard_normal_table=S,R.error_function=I,R.average=f,R.interquartile_range=C,R.mixin=Q,R.median_absolute_deviation=D,R.rms=i,R.erf=I}(this)},{}],60:[function(a,b,c){function d(a){return a*Math.PI/180}var e=a("turf-invariant");b.exports=function(a,b,c){e.featureOf(a,"Point","distance"),e.featureOf(b,"Point","distance");var f,g=a.geometry.coordinates,h=b.geometry.coordinates,i=d(h[1]-g[1]),j=d(h[0]-g[0]),k=d(g[1]),l=d(h[1]),m=Math.sin(i/2)*Math.sin(i/2)+Math.sin(j/2)*Math.sin(j/2)*Math.cos(k)*Math.cos(l),n=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m));switch(c){case"miles":f=3960;break;case"kilometers":f=6373;break;case"degrees":f=57.2957795;break;case"radians":f=1;break;case void 0:f=6373;break;default:
  throw new Error('unknown option given to "units"')}var o=f*n;return o}},{"turf-invariant":61}],61:[function(a,b,c){function d(a,b,c){if(!b||!c)throw new Error("type and name required");if(!a||a.type!==b)throw new Error("Invalid input to "+c+": must be a "+b+", given "+a.type)}function e(a,b,c){if(!c)throw new Error(".featureOf() requires a name");if(!a||"Feature"!==a.type||!a.geometry)throw new Error("Invalid input to "+c+", Feature with geometry required");if(!a.geometry||a.geometry.type!==b)throw new Error("Invalid input to "+c+": must be a "+b+", given "+a.geometry.type)}function f(a,b,c){if(!c)throw new Error(".collectionOf() requires a name");if(!a||"FeatureCollection"!==a.type)throw new Error("Invalid input to "+c+", FeatureCollection required");for(var d=0;d<a.features.length;d++){var e=a.features[d];if(!e||"Feature"!==e.type||!e.geometry)throw new Error("Invalid input to "+c+", Feature with geometry required");if(!e.geometry||e.geometry.type!==b)throw new Error("Invalid input to "+c+": must be a "+b+", given "+e.geometry.type)}}b.exports.geojsonType=d,b.exports.collectionOf=f,b.exports.featureOf=e},{}],62:[function(a,b,c){var d=a("turf-extent"),e=a("turf-bbox-polygon");b.exports=function(a,b){var c=d(a),f=e(c);return f}},{"turf-bbox-polygon":12,"turf-extent":70}],63:[function(a,b,c){var d=a("jsts");b.exports=function(a,b,c){var e=JSON.parse(JSON.stringify(a)),f=JSON.parse(JSON.stringify(b));"Feature"!==e.type&&(e={type:"Feature",properties:{},geometry:e}),"Feature"!==f.type&&(f={type:"Feature",properties:{},geometry:f});var g=new d.io.GeoJSONReader,h=g.read(JSON.stringify(e.geometry)),i=g.read(JSON.stringify(f.geometry)),j=h.difference(i),k=new d.io.GeoJSONParser;return j=k.write(j),e.geometry=j,"GeometryCollection"===e.geometry.type&&0===e.geometry.geometries.length?void 0:{type:"Feature",properties:e.properties,geometry:j}}},{jsts:64}],64:[function(a,b,c){arguments[4][17][0].apply(c,arguments)},{"./lib/jsts":65,dup:17,"javascript.util":67}],65:[function(a,b,c){arguments[4][18][0].apply(c,arguments)},{dup:18}],66:[function(a,b,c){arguments[4][19][0].apply(c,arguments)},{dup:19}],67:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{"./dist/javascript.util-node.min.js":66,dup:20}],68:[function(a,b,c){var d=a("turf-featurecollection"),e=a("turf-meta").coordEach,f=a("turf-point");b.exports=function(a){var b=[];return e(a,function(a){b.push(f(a))}),d(b)}},{"turf-featurecollection":72,"turf-meta":69,"turf-point":102}],69:[function(a,b,c){arguments[4][23][0].apply(c,arguments)},{dup:23}],70:[function(a,b,c){var d=a("turf-meta").coordEach;b.exports=function(a){var b=[1/0,1/0,-(1/0),-(1/0)];return d(a,function(a){b[0]>a[0]&&(b[0]=a[0]),b[1]>a[1]&&(b[1]=a[1]),b[2]<a[0]&&(b[2]=a[0]),b[3]<a[1]&&(b[3]=a[1])}),b}},{"turf-meta":71}],71:[function(a,b,c){arguments[4][23][0].apply(c,arguments)},{dup:23}],72:[function(a,b,c){b.exports=function(a){return{type:"FeatureCollection",features:a}}},{}],73:[function(a,b,c){var d=a("turf-featurecollection");b.exports=function(a,b,c){for(var e=d([]),f=0;f<a.features.length;f++)a.features[f].properties[b]===c&&e.features.push(a.features[f]);return e}},{"turf-featurecollection":72}],74:[function(a,b,c){function d(a){var b=JSON.parse(JSON.stringify(a));switch(b.type){case"FeatureCollection":for(var c=0;c<b.features.length;c++)e(b.features[c].geometry);return b;case"Feature":return e(b.geometry),b;default:return e(b),b}}function e(a){var b=a.coordinates;switch(a.type){case"Point":f(b);break;case"LineString":case"MultiPoint":g(b);break;case"Polygon":case"MultiLineString":h(b);break;case"MultiPolygon":i(b);break;case"GeometryCollection":a.geometries.forEach(e)}}function f(a){a.reverse()}function g(a){for(var b=0;b<a.length;b++)a[b].reverse()}function h(a){for(var b=0;b<a.length;b++)for(var c=0;c<a[b].length;c++)a[b][c].reverse()}function i(a){for(var b=0;b<a.length;b++)for(var c=0;c<a[b].length;c++)for(var d=0;d<a[b][c].length;d++)a[b][c][d].reverse()}b.exports=d},{}],75:[function(a,b,c){function d(a,b){for(var c=[],d=0;6>d;d++){var e=a[0]+b*i[d],g=a[1]+b*j[d];c.push([e,g])}return c.push(c[0]),f([c])}for(var e=a("turf-point"),f=a("turf-polygon"),g=a("turf-distance"),h=a("turf-featurecollection"),i=[],j=[],k=0;6>k;k++){var l=2*Math.PI/6*k;i.push(Math.cos(l)),j.push(Math.sin(l))}b.exports=function(a,b,c){var f=b/g(e([a[0],a[1]]),e([a[2],a[1]]),c),i=f*(a[2]-a[0]),j=b/g(e([a[0],a[1]]),e([a[0],a[3]]),c),k=(j*(a[3]-a[1]),i/2),l=2*k,m=Math.sqrt(3)/2*l,n=a[2]-a[0],o=a[3]-a[1],p=.75*l,q=m,r=n/(l-k/2),s=Math.ceil(r);Math.round(r)===s&&s++;var t=(s*p-k/2-n)/2-k/2,u=Math.ceil(o/m),v=(o-u*m)/2,w=u*m-o>m/2;w&&(v-=m/4);for(var x=h([]),y=0;s>y;y++)for(var z=0;u>=z;z++){var A=y%2===1;if(!(0===z&&A||0===z&&w)){var B=y*p+a[0]-t,C=z*q+a[1]+v;A&&(C-=m/2),x.features.push(d([B,C],k))}}return x}},{"turf-distance":60,"turf-featurecollection":72,"turf-point":102,"turf-polygon":103}],76:[function(a,b,c){function d(a,b){for(var c=!1,d=0,e=b.length-1;d<b.length;e=d++){var f=b[d][0],g=b[d][1],h=b[e][0],i=b[e][1],j=g>a[1]!=i>a[1]&&a[0]<(h-f)*(a[1]-g)/(i-g)+f;j&&(c=!c)}return c}b.exports=function(a,b){var c=b.geometry.coordinates,e=[a.geometry.coordinates[0],a.geometry.coordinates[1]];"Polygon"===b.geometry.type&&(c=[c]);for(var f=!1,g=0;g<c.length&&!f;){if(d(e,c[g][0])){for(var h=!1,i=1;i<c[g].length&&!h;)d(e,c[g][i])&&(h=!0),i++;h||(f=!0)}g++}return f}},{}],77:[function(a,b,c){var d=a("jsts");a("turf-featurecollection"),b.exports=function(a,b){var c;c="Feature"===a.type?a.geometry:a,"Feature"===b.type?geom2=b.geometry:geom2=b;var e=new d.io.GeoJSONReader,f=e.read(JSON.stringify(c)),g=e.read(JSON.stringify(geom2)),h=f.intersection(g),i=new d.io.GeoJSONParser;return h=i.write(h),"GeometryCollection"===h.type&&0===h.geometries.length?void 0:{type:"Feature",properties:{},geometry:h}}},{jsts:78,"turf-featurecollection":72}],78:[function(a,b,c){arguments[4][17][0].apply(c,arguments)},{"./lib/jsts":79,dup:17,"javascript.util":81}],79:[function(a,b,c){arguments[4][18][0].apply(c,arguments)},{dup:18}],80:[function(a,b,c){arguments[4][19][0].apply(c,arguments)},{dup:19}],81:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{"./dist/javascript.util-node.min.js":80,dup:20}],82:[function(a,b,c){function d(a,b){var c=a.x-b.x,d=a.y-b.y;return h>c*c+d*d}function e(a){for(var b=a.head;b;){var c=b.next;b.next=b.prev,b.prev=c,b=c}var c=a.head;a.head=a.tail,a.tail=c}function f(a){this.level=a,this.s=null,this.count=0}function g(a){if(a)this.drawContour=a;else{var b=this;b.contours={},this.drawContour=function(a,c,d,e,g,h){var i=b.contours[h];i||(i=b.contours[h]=new f(g)),i.addSegment({x:a,y:c},{x:d,y:e})},this.contourList=function(){var a=[],c=b.contours;for(var d in c)for(var e=c[d].s,f=c[d].level;e;){var g=e.head,h=[];for(h.level=f,h.k=d;g&&g.p;)h.push(g.p),g=g.next;a.push(h),e=e.next}return a.sort(function(a,b){return a.k-b.k}),a}}this.h=new Array(5),this.sh=new Array(5),this.xh=new Array(5),this.yh=new Array(5)}b.exports=g;var h=1e-10;f.prototype.remove_seq=function(a){a.prev?a.prev.next=a.next:this.s=a.next,a.next&&(a.next.prev=a.prev),--this.count},f.prototype.addSegment=function(a,b){for(var c=this.s,f=null,g=null,h=!1,i=!1;c&&(null==f&&(d(a,c.head.p)?(f=c,h=!0):d(a,c.tail.p)&&(f=c)),null==g&&(d(b,c.head.p)?(g=c,i=!0):d(b,c.tail.p)&&(g=c)),null==g||null==f);)c=c.next;var j=(null!=f?1:0)|(null!=g?2:0);switch(j){case 0:var k={p:a,prev:null},l={p:b,next:null};k.next=l,l.prev=k,f={head:k,tail:l,next:this.s,prev:null,closed:!1},this.s&&(this.s.prev=f),this.s=f,++this.count;break;case 1:var m={p:b};h?(m.next=f.head,m.prev=null,f.head.prev=m,f.head=m):(m.next=null,m.prev=f.tail,f.tail.next=m,f.tail=m);break;case 2:var m={p:a};i?(m.next=g.head,m.prev=null,g.head.prev=m,g.head=m):(m.next=null,m.prev=g.tail,g.tail.next=m,g.tail=m);break;case 3:if(f===g){var m={p:f.tail.p,next:f.head,prev:null};f.head.prev=m,f.head=m,f.closed=!0;break}switch((h?1:0)|(i?2:0)){case 0:e(f);case 1:g.tail.next=f.head,f.head.prev=g.tail,g.tail=f.tail,this.remove_seq(f);break;case 3:e(f);case 2:f.tail.next=g.head,g.head.prev=f.tail,f.tail=g.tail,this.remove_seq(g)}}},g.prototype.contour=function(a,b,c,d,e,f,g,i,j){var k=this.h,l=this.sh,m=this.xh,n=this.yh,o=this.drawContour;this.contours={};for(var p,q,r,s,t,u,v=function(a,b){return(k[b]*m[a]-k[a]*m[b])/(k[b]-k[a])},w=function(a,b){return(k[b]*n[a]-k[a]*n[b])/(k[b]-k[a])},x=0,y=0,z=0,A=0,B=[0,1,1,0],C=[0,0,1,1],D=[[[0,0,8],[0,2,5],[7,6,9]],[[0,3,4],[1,3,1],[4,3,0]],[[9,6,7],[5,2,0],[8,0,0]]],E=e-1;E>=d;E--)for(var F=b;c-1>=F;F++){var G,H;if(G=Math.min(a[F][E],a[F][E+1]),H=Math.min(a[F+1][E],a[F+1][E+1]),t=Math.min(G,H),G=Math.max(a[F][E],a[F][E+1]),H=Math.max(a[F+1][E],a[F+1][E+1]),u=Math.max(G,H),u>=j[0]&&t<=j[i-1])for(var I=0;i>I;I++)if(j[I]>=t&&j[I]<=u){for(var J=4;J>=0;J--)J>0?(k[J]=a[F+B[J-1]][E+C[J-1]]-j[I],m[J]=f[F+B[J-1]],n[J]=g[E+C[J-1]]):(k[0]=.25*(k[1]+k[2]+k[3]+k[4]),m[0]=.5*(f[F]+f[F+1]),n[0]=.5*(g[E]+g[E+1])),k[J]>h?l[J]=1:k[J]<-h?l[J]=-1:l[J]=0;for(J=1;4>=J;J++)if(p=J,q=0,r=4!=J?J+1:1,s=D[l[p]+1][l[q]+1][l[r]+1],0!=s){switch(s){case 1:x=m[p],z=n[p],y=m[q],A=n[q];break;case 2:x=m[q],z=n[q],y=m[r],A=n[r];break;case 3:x=m[r],z=n[r],y=m[p],A=n[p];break;case 4:x=m[p],z=n[p],y=v(q,r),A=w(q,r);break;case 5:x=m[q],z=n[q],y=v(r,p),A=w(r,p);break;case 6:x=m[r],z=n[r],y=v(p,q),A=w(p,q);break;case 7:x=v(p,q),z=w(p,q),y=v(q,r),A=w(q,r);break;case 8:x=v(q,r),z=w(q,r),y=v(r,p),A=w(r,p);break;case 9:x=v(r,p),z=w(r,p),y=v(p,q),A=w(p,q)}o(x,z,y,A,j[I],I)}}}}},{}],83:[function(a,b,c){var d=a("turf-tin"),e=a("turf-inside"),f=a("turf-grid"),g=a("turf-extent"),h=a("turf-planepoint"),i=a("turf-featurecollection"),j=a("turf-linestring"),k=a("turf-square"),l=a("./conrec");b.exports=function(a,b,c,m,n){for(var o=d(a,b),p=g(a),q=k(p),r=f(q,c),s=[],t=0;t<r.features.length;t++)for(var u=r.features[t],v=0;v<o.features.length;v++){var w=o.features[v];e(u,w)&&(u.properties={},u.properties[b]=h(u,w))}for(var x=Math.sqrt(r.features.length),y=0;x>y;y++){var z=r.features.slice(y*x,(y+1)*x),A=[];z.forEach(function(a){a.properties?A.push(a.properties[b]):A.push(0)}),s.push(A)}for(var B=(q[2]-q[0])/x,C=[],D=[],y=0;x>y;y++)C.push(y*B+q[0]),D.push(y*B+q[1]);var E=new l;E.contour(s,0,c,0,c,C,D,m.length,m);var F=E.contourList(),G=i([]);return F.forEach(function(a){if(a.length>2){var c=[];a.forEach(function(a){c.push([a.x,a.y])});var d=j(c);d.properties={},d.properties[b]=a.level,G.features.push(d)}}),G}},{"./conrec":82,"turf-extent":70,"turf-featurecollection":72,"turf-grid":84,"turf-inside":76,"turf-linestring":90,"turf-planepoint":98,"turf-square":115,"turf-tin":118}],84:[function(a,b,c){var d=a("turf-point");b.exports=function(a,b){for(var c=a[0],e=a[1],f=a[2],g=(a[3],(f-c)/b),h={type:"FeatureCollection",features:[]},i=0;b>=i;i++)for(var j=0;b>=j;j++)h.features.push(d([i*g+c,j*g+e]));return h}},{"turf-point":102}],85:[function(a,b,c){var d=a("simple-statistics");b.exports=function(a,b,c){var e=[],f=[];return a.features.forEach(function(a){void 0!==a.properties[b]&&e.push(a.properties[b])}),f=d.jenks(e,c)}},{"simple-statistics":86}],86:[function(a,b,c){arguments[4][59][0].apply(c,arguments)},{dup:59}],87:[function(a,b,c){function d(a,b,c,d,e,f,g,h){var i,j,k,l,m,n={x:null,y:null,onLine1:!1,onLine2:!1};return i=(h-f)*(c-a)-(g-e)*(d-b),0==i?null!=n.x&&null!=n.y?n:!1:(j=b-f,k=a-e,l=(g-e)*j-(h-f)*k,m=(c-a)*j-(d-b)*k,j=l/i,k=m/i,n.x=a+j*(c-a),n.y=b+j*(d-b),j>0&&1>j&&(n.onLine1=!0),k>0&&1>k&&(n.onLine2=!0),n.onLine1&&n.onLine2?[n.x,n.y]:!1)}var e=(a("turf-polygon"),a("turf-point")),f=a("turf-featurecollection");b.exports=function(a){var b,c={intersections:f([]),fixed:null};return b="Feature"===a.type?a.geometry:a,b.coordinates.forEach(function(a){b.coordinates.forEach(function(b){for(var f=0;f<a.length-1;f++)for(var g=0;g<b.length-1;g++){var h=d(a[f][0],a[f][1],a[f+1][0],a[f+1][1],b[g][0],b[g][1],b[g+1][0],b[g+1][1]);h&&c.intersections.features.push(e([h[0],h[1]]))}})}),c}},{"turf-featurecollection":72,"turf-point":102,"turf-polygon":103}],88:[function(a,b,c){var d=a("turf-distance"),e=a("turf-point");b.exports=function(a,b){var c;if("Feature"===a.type)c=a.geometry.coordinates;else{if("LineString"!==a.type)throw new Error("input must be a LineString Feature or Geometry");c=a.geometry.coordinates}for(var f=0,g=0;g<c.length-1;g++)f+=d(e(c[g]),e(c[g+1]),b);return f}},{"turf-distance":60,"turf-point":102}],89:[function(a,b,c){function d(a,b){for(var c="miles",d=g([1/0,1/0],{dist:1/0}),h=0;h<b.length-1;h++){var k=g(b[h]),l=g(b[h+1]);k.properties.dist=f(a,k,c),l.properties.dist=f(a,l,c);var m=i(k,l),n=j(a,1e3,m+90,c),o=e(a.geometry.coordinates[0],a.geometry.coordinates[1],n.geometry.coordinates[0],n.geometry.coordinates[1],k.geometry.coordinates[0],k.geometry.coordinates[1],l.geometry.coordinates[0],l.geometry.coordinates[1]);o||(n=j(a,1e3,m-90,c),o=e(a.geometry.coordinates[0],a.geometry.coordinates[1],n.geometry.coordinates[0],n.geometry.coordinates[1],k.geometry.coordinates[0],k.geometry.coordinates[1],l.geometry.coordinates[0],l.geometry.coordinates[1])),n.properties.dist=1/0;var p;if(o){var p=g(o);p.properties.dist=f(a,p,c)}k.properties.dist<d.properties.dist&&(d=k,d.properties.index=h),l.properties.dist<d.properties.dist&&(d=l,d.properties.index=h),p&&p.properties.dist<d.properties.dist&&(d=p,d.properties.index=h)}return d}function e(a,b,c,d,e,f,g,h){var i,j,k,l,m,n={x:null,y:null,onLine1:!1,onLine2:!1};return i=(h-f)*(c-a)-(g-e)*(d-b),0==i?null!=n.x&&null!=n.y?n:!1:(j=b-f,k=a-e,l=(g-e)*j-(h-f)*k,m=(c-a)*j-(d-b)*k,j=l/i,k=m/i,n.x=a+j*(c-a),n.y=b+j*(d-b),j>0&&1>j&&(n.onLine1=!0),k>0&&1>k&&(n.onLine2=!0),n.onLine1&&n.onLine2?[n.x,n.y]:!1)}var f=a("turf-distance"),g=a("turf-point"),h=a("turf-linestring"),i=a("turf-bearing"),j=a("turf-destination");b.exports=function(a,b,c){var e;if("Feature"===c.type)e=c.geometry.coordinates;else{if("LineString"!==c.type)throw new Error("input must be a LineString Feature or Geometry");e=c.geometry.coordinates}var f,g=d(a,e),i=d(b,e);f=g.properties.index<=i.properties.index?[g,i]:[i,g];for(var j=h([f[0].geometry.coordinates],{}),k=f[0].properties.index+1;k<f[1].properties.index+1;k++)j.geometry.coordinates.push(e[k]);return j.geometry.coordinates.push(f[1].geometry.coordinates),j}},{"turf-bearing":13,"turf-destination":57,"turf-distance":60,"turf-linestring":90,"turf-point":102}],90:[function(a,b,c){b.exports=function(a,b){if(!a)throw new Error("No coordinates passed");return{type:"Feature",geometry:{type:"LineString",coordinates:a},properties:b||{}}}},{}],91:[function(a,b,c){function d(a){for(var b,c=0;c<a.length;c++)(a[c]>b||void 0===b)&&(b=a[c]);return b}var e=a("turf-inside");b.exports=function(a,b,c,f){return a.features.forEach(function(a){a.properties||(a.properties={});var g=[];b.features.forEach(function(b){e(b,a)&&g.push(b.properties[c])}),a.properties[f]=d(g)}),a}},{"turf-inside":76}],92:[function(a,b,c){function d(a){if(0===a.length)return null;var b=a.slice().sort(function(a,b){return a-b});if(b.length%2===1)return b[(b.length-1)/2];var c=b[b.length/2-1],d=b[b.length/2];return(c+d)/2}var e=a("turf-inside");b.exports=function(a,b,c,f){return a.features.forEach(function(a){a.properties||(a.properties={});var g=[];b.features.forEach(function(b){e(b,a)&&g.push(b.properties[c])}),a.properties[f]=d(g)}),a}},{"turf-inside":76}],93:[function(a,b,c){var d=a("clone"),e=a("turf-union");b.exports=function(a,b){for(var c=d(a.features[0]),f=a.features,g=0,h=f.length;h>g;g++){var i=f[g];i.geometry&&(c=e(c,i))}return c}},{clone:94,"turf-union":120}],94:[function(a,b,c){(function(a){"use strict";function c(a){return Object.prototype.toString.call(a)}function d(b,c,d,f){function g(b,d){if(null===b)return null;if(0==d)return b;var k,l;if("object"!=typeof b)return b;if(e.isArray(b))k=[];else if(e.isRegExp(b))k=new RegExp(b.source,e.getRegExpFlags(b)),b.lastIndex&&(k.lastIndex=b.lastIndex);else if(e.isDate(b))k=new Date(b.getTime());else{if(j&&a.isBuffer(b))return k=new a(b.length),b.copy(k),k;"undefined"==typeof f?(l=Object.getPrototypeOf(b),k=Object.create(l)):(k=Object.create(f),l=f)}if(c){var m=h.indexOf(b);if(-1!=m)return i[m];h.push(b),i.push(k)}for(var n in b){var o;l&&(o=Object.getOwnPropertyDescriptor(l,n)),o&&null==o.set||(k[n]=g(b[n],d-1))}return k}var h=[],i=[],j="undefined"!=typeof a;return"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=1/0),g(b,d)}var e={isArray:function(a){return Array.isArray(a)||"object"==typeof a&&"[object Array]"===c(a)},isDate:function(a){return"object"==typeof a&&"[object Date]"===c(a)},isRegExp:function(a){return"object"==typeof a&&"[object RegExp]"===c(a)},getRegExpFlags:function(a){var b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),b}};"object"==typeof b&&(b.exports=d),d.clonePrototype=function(a){if(null===a)return null;var b=function(){};return b.prototype=a,new b}}).call(this,a("buffer").Buffer)},{buffer:2}],95:[function(a,b,c){var d=a("turf-point");b.exports=function(a,b){if(null===a||null===b)throw new Error("Less than two points passed.");var c=a.geometry.coordinates[0],e=b.geometry.coordinates[0],f=a.geometry.coordinates[1],g=b.geometry.coordinates[1],h=c+e,i=h/2,j=f+g,k=j/2;return d([i,k])}},{"turf-point":102}],96:[function(a,b,c){function d(a){for(var b,c=0;c<a.length;c++)(a[c]<b||void 0===b)&&(b=a[c]);return b}var e=a("turf-inside");b.exports=function(a,b,c,f){return a.features.forEach(function(a){a.properties||(a.properties={});var g=[];b.features.forEach(function(b){e(b,a)&&g.push(b.properties[c])}),a.properties[f]=d(g)}),a}},{"turf-inside":76}],97:[function(a,b,c){var d=a("turf-distance");b.exports=function(a,b){var c;return b.features.forEach(function(b){if(c){var e=d(a,b,"miles");e<c.properties.distance&&(c=b,c.properties.distance=e)}else{c=b;var e=d(a,b,"miles");c.properties.distance=e}}),delete c.properties.distance,c}},{"turf-distance":60}],98:[function(a,b,c){b.exports=function(a,b){var c=a.geometry.coordinates[0],d=a.geometry.coordinates[1],e=b.geometry.coordinates[0][0][0],f=b.geometry.coordinates[0][0][1],g=b.properties.a,h=b.geometry.coordinates[0][1][0],i=b.geometry.coordinates[0][1][1],j=b.properties.b,k=b.geometry.coordinates[0][2][0],l=b.geometry.coordinates[0][2][1],m=b.properties.c,n=(m*(c-e)*(d-i)+g*(c-h)*(d-l)+j*(c-k)*(d-f)-j*(c-e)*(d-l)-m*(c-h)*(d-f)-g*(c-k)*(d-i))/((c-e)*(d-i)+(c-h)*(d-l)+(c-k)*(d-f)-(c-e)*(d-l)-(c-h)*(d-f)-(c-k)*(d-i));return n}},{}],99:[function(a,b,c){var d=a("turf-point"),e=a("turf-featurecollection"),f=a("turf-distance");b.exports=function(a,b,c){for(var g=e([]),h=b/f(d([a[0],a[1]]),d([a[2],a[1]]),c),i=h*(a[2]-a[0]),j=b/f(d([a[0],a[1]]),d([a[0],a[3]]),c),k=j*(a[3]-a[1]),l=a[0];l<=a[2];){for(var m=a[1];m<=a[3];)g.features.push(d([l,m])),m+=k;l+=i}return g}},{"turf-distance":60,"turf-featurecollection":72,"turf-point":102}],100:[function(a,b,c){function d(a,b){for(var c="miles",d=g([1/0,1/0],{dist:1/0}),j=0;j<b.length-1;j++){var k=g(b[j]),l=g(b[j+1]);k.properties.dist=f(a,k,c),l.properties.dist=f(a,l,c);var m=h(k,l),n=i(a,1e3,m+90,c),o=e(a.geometry.coordinates[0],a.geometry.coordinates[1],n.geometry.coordinates[0],n.geometry.coordinates[1],k.geometry.coordinates[0],k.geometry.coordinates[1],l.geometry.coordinates[0],l.geometry.coordinates[1]);o||(n=i(a,1e3,m-90,c),o=e(a.geometry.coordinates[0],a.geometry.coordinates[1],n.geometry.coordinates[0],n.geometry.coordinates[1],k.geometry.coordinates[0],k.geometry.coordinates[1],l.geometry.coordinates[0],l.geometry.coordinates[1])),n.properties.dist=1/0;var p;if(o){var p=g(o);p.properties.dist=f(a,p,c)}k.properties.dist<d.properties.dist&&(d=k,d.properties.index=j),l.properties.dist<d.properties.dist&&(d=l,d.properties.index=j),p&&p.properties.dist<d.properties.dist&&(d=p,d.properties.index=j)}return d}function e(a,b,c,d,e,f,g,h){var i,j,k,l,m,n={x:null,y:null,onLine1:!1,onLine2:!1};return i=(h-f)*(c-a)-(g-e)*(d-b),0==i?null!=n.x&&null!=n.y?n:!1:(j=b-f,k=a-e,l=(g-e)*j-(h-f)*k,m=(c-a)*j-(d-b)*k,j=l/i,k=m/i,n.x=a+j*(c-a),n.y=b+j*(d-b),j>0&&1>j&&(n.onLine1=!0),k>0&&1>k&&(n.onLine2=!0),n.onLine1&&n.onLine2?[n.x,n.y]:!1)}var f=a("turf-distance"),g=a("turf-point"),h=(a("turf-linestring"),a("turf-bearing")),i=a("turf-destination");b.exports=function(a,b){var c;if("Feature"===a.type)c=a.geometry.coordinates;else{if("LineString"!==a.type)throw new Error("input must be a LineString Feature or Geometry");c=a.geometry.coordinates}return d(b,c)}},{"turf-bearing":13,"turf-destination":57,"turf-distance":60,"turf-linestring":90,"turf-point":102}],101:[function(a,b,c){function d(a,b,c,d,e,f){var g=Math.sqrt((e-c)*(e-c)+(f-d)*(f-d)),h=Math.sqrt((a-c)*(a-c)+(b-d)*(b-d)),i=Math.sqrt((e-a)*(e-a)+(f-b)*(f-b));return g===h+i?!0:void 0}var e=a("turf-featurecollection"),f=a("turf-center"),g=a("turf-distance"),h=a("turf-inside"),i=a("turf-explode");b.exports=function(a){"FeatureCollection"!=a.type&&("Feature"!=a.type&&(a={type:"Feature",geometry:a,properties:{}}),a=e([a]));for(var b=f(a),c=!1,j=0;!c&&j<a.features.length;){var k=a.features[j].geometry;if("Point"===k.type)b.geometry.coordinates[0]===k.coordinates[0]&&b.geometry.coordinates[1]===k.coordinates[1]&&(c=!0);else if("MultiPoint"===k.type)for(var l=!1,m=0;!l&&m<k.coordinates.length;)b.geometry.coordinates[0]===k.coordinates[m][0]&&b.geometry.coordinates[1]===k.coordinates[m][1]&&(c=!0,l=!0),m++;else if("LineString"===k.type)for(var n=!1,m=0;!n&&m<k.coordinates.length-1;){var o=b.geometry.coordinates[0],p=b.geometry.coordinates[1],q=k.coordinates[m][0],r=k.coordinates[m][1],s=k.coordinates[m+1][0],t=k.coordinates[m+1][1];d(o,p,q,r,s,t)&&(n=!0,c=!0),m++}else if("MultiLineString"===k.type)for(var u=!1,v=0;!u&&v<k.coordinates.length;){for(var n=!1,m=0,w=k.coordinates[v];!n&&m<w.length-1;){var o=b.geometry.coordinates[0],p=b.geometry.coordinates[1],q=w[m][0],r=w[m][1],s=w[m+1][0],t=w[m+1][1];d(o,p,q,r,s,t)&&(n=!0,c=!0),m++}v++}else if("Polygon"===k.type||"MultiPolygon"===k.type){var x={type:"Feature",geometry:k,properties:{}};h(b,x)&&(c=!0)}j++}if(c)return b;for(var y=e([]),j=0;j<a.features.length;j++)y.features=y.features.concat(i(a.features[j]).features);for(var z,A=1/0,j=0;j<y.features.length;j++){var B=g(b,y.features[j],"miles");A>B&&(A=B,z=y.features[j])}return z}},{"turf-center":21,"turf-distance":60,"turf-explode":68,"turf-featurecollection":72,"turf-inside":76}],102:[function(a,b,c){var d=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};b.exports=function(a,b){if(!d(a))throw new Error("Coordinates must be an array");if(a.length<2)throw new Error("Coordinates must be at least 2 numbers long");return{type:"Feature",geometry:{type:"Point",coordinates:a},properties:b||{}}}},{}],103:[function(a,b,c){b.exports=function(a,b){if(null===a)throw new Error("No coordinates passed");for(var c=0;c<a.length;c++)for(var d=a[c],e=0;e<d[d.length-1].length;e++){if(d.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(d[d.length-1][e]!==d[0][e])throw new Error("First and last Position are not equivalent.")}var f={type:"Feature",geometry:{type:"Polygon",coordinates:a},properties:b};return f.properties||(f.properties={}),f}},{}],104:[function(a,b,c){var d=a("simple-statistics");b.exports=function(a,b,c){var e=[],f=[];return a.features.forEach(function(a){e.push(a.properties[b])}),c.forEach(function(a){f.push(d.quantile(e,.01*a))}),f}},{"simple-statistics":105}],105:[function(a,b,c){arguments[4][59][0].apply(c,arguments)},{dup:59}],106:[function(a,b,c){var d=a("geojson-random");b.exports=function(a,b,c){switch(c=c||{},b=b||1,a){case"point":case"points":case void 0:return d.point(b,c.bbox);case"polygon":case"polygons":return d.polygon(b,c.num_vertices,c.max_radial_length,c.bbox);default:throw new Error("Unknown type given: valid options are points and polygons")}}},{"geojson-random":107}],107:[function(a,b,c){function d(a){return a?k(a):[g(),h()]}function e(a){return function(b,c){return[b[0]+a[0],b[1]+a[1]]}}function f(){return Math.random()-.5}function g(){return 360*f()}function h(){return 180*f()}function j(a){return{type:"Point",coordinates:a||[g(),h()]}}function k(a){return[Math.random()*(a[2]-a[0])+a[0],Math.random()*(a[3]-a[1])+a[1]]}function l(a){return{type:"Polygon",coordinates:a}}function m(a){return{type:"Feature",geometry:a,properties:{}}}function n(a){return{type:"FeatureCollection",features:a}}b.exports=function(){throw new Error("call .point() or .polygon() instead")},b.exports.position=d,b.exports.point=function(a,b){var c=[];for(i=0;i<a;i++)c.push(m(b?j(d(b)):j()));return n(c)},b.exports.polygon=function(a,b,c,f){function g(a,b,c){c[b]=b>0?a+c[b-1]:a}function h(a,b){a=2*a*Math.PI/o[o.length-1];var d=Math.random();k.push([d*c*Math.sin(a),d*c*Math.cos(a)])}"number"!=typeof b&&(b=10),"number"!=typeof c&&(c=10);var j=[];for(i=0;i<a;i++){var k=[],o=Array.apply(null,new Array(b+1)).map(Math.random);o.forEach(g),o.forEach(h),k[k.length-1]=k[0],k=k.map(e(d(f))),j.push(m(l([k])))}return n(j)}},{}],108:[function(a,b,c){var d=a("turf-featurecollection");a("./index.js"),b.exports=function(a,b,c,e,f){var g=d([]);return a.features.forEach(function(a){for(var d=0;d<e.length;d++)a.properties[b]>=e[d][0]&&a.properties[b]<=e[d][1]&&(a.properties[c]=e[d][2]);g.features.push(a)}),g}},{"./index.js":108,"turf-featurecollection":72}],109:[function(a,b,c){var d=a("turf-featurecollection");b.exports=function(a,b,c){for(var e=d([]),f=0;f<a.features.length;f++)a.features[f].properties[b]!=c&&e.features.push(a.features[f]);return e}},{"turf-featurecollection":72}],110:[function(a,b,c){function d(a,b){for(var c,d,e=a.slice(0),f=a.length,g=f-b;f-->g;)d=Math.floor((f+1)*Math.random()),c=e[d],e[d]=e[f],e[f]=c;return e.slice(g)}var e=a("turf-featurecollection");b.exports=function(a,b){var c=e(d(a.features,b));return c}},{"turf-featurecollection":72}],111:[function(a,b,c){function d(a,b){return{type:"Feature",geometry:a,properties:b}}var e=a("simplify-js");b.exports=function(a,b,c){if("LineString"===a.geometry.type){var f={type:"LineString",coordinates:[]},g=a.geometry.coordinates.map(function(a){return{x:a[0],y:a[1]}});return f.coordinates=e(g,b,c).map(function(a){return[a.x,a.y]}),d(f,a.properties)}if("Polygon"===a.geometry.type){var h={type:"Polygon",coordinates:[]};return a.geometry.coordinates.forEach(function(a){var d=a.map(function(a){return{x:a[0],y:a[1]}}),f=e(d,b,c).map(function(a){return[a.x,a.y]});h.coordinates.push(f)}),d(h,a.properties)}}},{"simplify-js":112}],112:[function(b,c,d){!function(){"use strict";function b(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d}function d(a,b,c){var d=b.x,e=b.y,f=c.x-d,g=c.y-e;if(0!==f||0!==g){var h=((a.x-d)*f+(a.y-e)*g)/(f*f+g*g);h>1?(d=c.x,e=c.y):h>0&&(d+=f*h,e+=g*h)}return f=a.x-d,g=a.y-e,f*f+g*g}function e(a,c){for(var d,e=a[0],f=[e],g=1,h=a.length;h>g;g++)d=a[g],b(d,e)>c&&(f.push(d),e=d);return e!==d&&f.push(d),f}function f(a,b){var c,e,f,g,h=a.length,i="undefined"!=typeof Uint8Array?Uint8Array:Array,j=new i(h),k=0,l=h-1,m=[],n=[];for(j[k]=j[l]=1;l;){for(e=0,c=k+1;l>c;c++)f=d(a[c],a[k],a[l]),f>e&&(g=c,e=f);e>b&&(j[g]=1,m.push(k,g,g,l)),l=m.pop(),k=m.pop()}for(c=0;h>c;c++)j[c]&&n.push(a[c]);return n}function g(a,b,c){var d=void 0!==b?b*b:1;return a=c?a:e(a,d),a=f(a,d)}"function"==typeof a&&a.amd?a(function(){return g}):"undefined"!=typeof c?c.exports=g:"undefined"!=typeof self?self.simplify=g:window.simplify=g}()},{}],113:[function(a,b,c){b.exports=function(a,b){var c=a[2]-a[0],d=a[3]-a[1],e=c*b,f=d*b,g=e-c,h=f-d,i=a[0]-g/2,j=a[1]-h/2,k=g/2+a[2],l=h/2+a[3],m=[i,j,k,l];return m}},{}],114:[function(a,b,c){var d=a("turf-featurecollection"),e=a("turf-point"),f=a("turf-polygon"),g=a("turf-distance");b.exports=function(a,b,c){for(var h=d([]),i=b/g(e([a[0],a[1]]),e([a[2],a[1]]),c),j=i*(a[2]-a[0]),k=b/g(e([a[0],a[1]]),e([a[0],a[3]]),c),l=k*(a[3]-a[1]),m=a[0];m<=a[2];){for(var n=a[1];n<=a[3];){var o=f([[[m,n],[m,n+l],[m+j,n+l],[m+j,n],[m,n]]]);h.features.push(o),n+=l}m+=j}return h}},{"turf-distance":60,"turf-featurecollection":72,"turf-point":102,"turf-polygon":103}],115:[function(a,b,c){var d=a("turf-midpoint"),e=a("turf-point"),f=a("turf-distance");b.exports=function(a){var b=[0,0,0,0],c=e([a[0],a[1]]),g=e([a[0],a[3]]),h=(e([a[2],a[3]]),e([a[2],a[1]])),i=f(c,h,"miles"),j=f(c,g,"miles");if(i>=j){b[0]=a[0],b[2]=a[2];var k=d(c,g);return b[1]=k.geometry.coordinates[1]-(a[2]-a[0])/2,b[3]=k.geometry.coordinates[1]+(a[2]-a[0])/2,b}b[1]=a[1],b[3]=a[3];var l=d(c,h);return b[0]=l.geometry.coordinates[0]-(a[3]-a[1])/2,b[2]=l.geometry.coordinates[0]+(a[3]-a[1])/2,b}},{"turf-distance":60,"turf-midpoint":95,"turf-point":102}],116:[function(a,b,c){function d(a){for(var b=0,c=0;c<a.length;c++)b+=a[c];return b}var e=a("turf-inside");b.exports=function(a,b,c,f){return a.features.forEach(function(a){a.properties||(a.properties={});var g=[];b.features.forEach(function(b){e(b,a)&&g.push(b.properties[c])}),a.properties[f]=d(g)}),a}},{"turf-inside":76}],117:[function(a,b,c){var d=a("turf-inside");b.exports=function(a,b,c,e){return a=JSON.parse(JSON.stringify(a)),b=JSON.parse(JSON.stringify(b)),a.features.forEach(function(a){a.properties||(a.properties={}),b.features.forEach(function(b){if(void 0===a.properties[e]){var f=d(a,b);f&&(a.properties[e]=b.properties[c])}})}),a}},{"turf-inside":76}],118:[function(a,b,c){function d(a,b,c){this.a=a,this.b=b,this.c=c;var d,e,f,g,h=b.x-a.x,i=b.y-a.y,j=c.x-a.x,k=c.y-a.y,l=h*(a.x+b.x)+i*(a.y+b.y),m=j*(a.x+c.x)+k*(a.y+c.y),n=2*(h*(c.y-b.y)-i*(c.x-b.x));Math.abs(n)<1e-6?(d=Math.min(a.x,b.x,c.x),e=Math.min(a.y,b.y,c.y),f=.5*(Math.max(a.x,b.x,c.x)-d),g=.5*(Math.max(a.y,b.y,c.y)-e),this.x=d+f,this.y=e+g,this.r=f*f+g*g):(this.x=(k*l-i*m)/n,this.y=(h*m-j*l)/n,f=this.x-a.x,g=this.y-a.y,this.r=f*f+g*g)}function e(a,b){return b.x-a.x}function f(a){var b,c,d,e,f,g=a.length;a:for(;g;)for(c=a[--g],b=a[--g],d=g;d;)if(f=a[--d],e=a[--d],b===e&&c===f||b===f&&c===e){a.splice(g,2),a.splice(d,2),g-=2;continue a}}function g(a){if(a.length<3)return[];a.sort(e);for(var b=a.length-1,c=a[b].x,g=a[0].x,h=a[b].y,i=h;b--;)a[b].y<h&&(h=a[b].y),a[b].y>i&&(i=a[b].y);var j,k,l,m=g-c,n=i-h,o=m>n?m:n,p=.5*(g+c),q=.5*(i+h),r=[new d({x:p-20*o,y:q-o,__sentinel:!0},{x:p,y:q+20*o,__sentinel:!0},{x:p+20*o,y:q-o,__sentinel:!0})],s=[],t=[];for(b=a.length;b--;){for(t.length=0,j=r.length;j--;)m=a[b].x-r[j].x,m>0&&m*m>r[j].r?(s.push(r[j]),r.splice(j,1)):(n=a[b].y-r[j].y,m*m+n*n>r[j].r||(t.push(r[j].a,r[j].b,r[j].b,r[j].c,r[j].c,r[j].a),r.splice(j,1)));for(f(t),j=t.length;j;)l=t[--j],k=t[--j],r.push(new d(k,l,a[b]))}for(Array.prototype.push.apply(s,r),b=s.length;b--;)(s[b].a.__sentinel||s[b].b.__sentinel||s[b].c.__sentinel)&&s.splice(b,1);return s}var h=a("turf-polygon"),i=a("turf-featurecollection");b.exports=function(a,b){return i(g(a.features.map(function(a){var c={x:a.geometry.coordinates[0],y:a.geometry.coordinates[1]};return b&&(c.z=a.properties[b]),c})).map(function(a){return h([[[a.a.x,a.a.y],[a.b.x,a.b.y],[a.c.x,a.c.y],[a.a.x,a.a.y]]],{a:a.a.z,b:a.b.z,c:a.c.z})}))}},{"turf-featurecollection":72,"turf-polygon":103}],119:[function(a,b,c){var d=a("turf-featurecollection"),e=a("turf-point"),f=a("turf-polygon"),g=a("turf-distance");b.exports=function(a,b,c){for(var h=d([]),i=b/g(e([a[0],a[1]]),e([a[2],a[1]]),c),j=i*(a[2]-a[0]),k=b/g(e([a[0],a[1]]),e([a[0],a[3]]),c),l=k*(a[3]-a[1]),m=0,n=a[0];n<=a[2];){for(var o=0,p=a[1];p<=a[3];){if(m%2===0&&o%2===0){var q=f([[[n,p],[n,p+l],[n+j,p],[n,p]]]);h.features.push(q);var r=f([[[n,p+l],[n+j,p+l],[n+j,p],[n,p+l]]]);h.features.push(r)}else if(m%2===0&&o%2===1){var q=f([[[n,p],[n+j,p+l],[n+j,p],[n,p]]]);h.features.push(q);var r=f([[[n,p],[n,p+l],[n+j,p+l],[n,p]]]);h.features.push(r)}else if(o%2===0&&m%2===1){var q=f([[[n,p],[n,p+l],[n+j,p+l],[n,p]]]);h.features.push(q);var r=f([[[n,p],[n+j,p+l],[n+j,p],[n,p]]]);h.features.push(r)}else if(o%2===1&&m%2===1){var q=f([[[n,p],[n,p+l],[n+j,p],[n,p]]]);h.features.push(q);var r=f([[[n,p+l],[n+j,p+l],[n+j,p],[n,p+l]]]);h.features.push(r)}p+=l,o++}m++,n+=j}return h}},{"turf-distance":60,"turf-featurecollection":72,"turf-point":102,"turf-polygon":103}],120:[function(a,b,c){var d=a("jsts");b.exports=function(a,b){var c=new d.io.GeoJSONReader,e=c.read(JSON.stringify(a.geometry)),f=c.read(JSON.stringify(b.geometry)),g=e.union(f),h=new d.io.GeoJSONParser;
  return g=h.write(g),{type:"Feature",geometry:g,properties:a.properties}}},{jsts:121}],121:[function(a,b,c){arguments[4][17][0].apply(c,arguments)},{"./lib/jsts":122,dup:17,"javascript.util":124}],122:[function(a,b,c){arguments[4][18][0].apply(c,arguments)},{dup:18}],123:[function(a,b,c){arguments[4][19][0].apply(c,arguments)},{dup:19}],124:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{"./dist/javascript.util-node.min.js":123,dup:20}],125:[function(a,b,c){var d=a("simple-statistics"),e=a("turf-inside");b.exports=function(a,b,c,f){return a.features.forEach(function(a){a.properties||(a.properties={});var g=[];b.features.forEach(function(b){e(b,a)&&g.push(b.properties[c])}),a.properties[f]=d.variance(g)}),a}},{"simple-statistics":126,"turf-inside":76}],126:[function(a,b,c){arguments[4][59][0].apply(c,arguments)},{dup:59}],127:[function(a,b,c){var d=a("turf-inside"),e=a("turf-featurecollection");b.exports=function(a,b){for(var c=e([]),f=0;f<b.features.length;f++)for(var g=0;g<a.features.length;g++){var h=d(a.features[g],b.features[f]);h&&c.features.push(a.features[g])}return c}},{"turf-featurecollection":72,"turf-inside":76}]},{},[1])(1)}),function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";if(!L.mapbox)throw new Error("include mapbox.js before mapbox.directions.js");L.mapbox.directions=a("./src/directions"),L.mapbox.directions.format=a("./src/format"),L.mapbox.directions.layer=a("./src/layer"),L.mapbox.directions.inputControl=a("./src/input_control"),L.mapbox.directions.errorsControl=a("./src/errors_control"),L.mapbox.directions.routesControl=a("./src/routes_control"),L.mapbox.directions.instructionsControl=a("./src/instructions_control")},{"./src/directions":6,"./src/errors_control":7,"./src/format":8,"./src/input_control":9,"./src/instructions_control":10,"./src/layer":11,"./src/routes_control":12}],2:[function(a,b,c){!function(){function a(a,b){if(b in a)return b;b=b.charAt(0).toUpperCase()+b.substring(1);for(var c=0,d=Q.length;d>c;++c){var e=Q[c]+b;if(e in a)return e}}function c(a){return P(a,V),a}function d(a){return"function"==typeof a?a:function(){return R(a,this)}}function e(a){return"function"==typeof a?a:function(){return S(a,this)}}function f(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=I.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function g(a){return a.trim().replace(/\s+/g," ")}function h(a){return new RegExp("(?:^|\\s+)"+I.requote(a)+"(?:\\s+|$)","g")}function i(a){return a.trim().split(/^|\s+/)}function j(a,b){function c(){for(var c=-1;++c<e;)a[c](this,b)}function d(){for(var c=-1,d=b.apply(this,arguments);++c<e;)a[c](this,d)}a=i(a).map(k);var e=a.length;return"function"==typeof b?d:c}function k(a){var b=h(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.getAttribute("class")||"";d?(b.lastIndex=0,b.test(e)||c.setAttribute("class",g(e+" "+a))):c.setAttribute("class",g(e.replace(b," ")))}}function l(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return null==b?d:"function"==typeof b?f:e}function m(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}return null==b?c:"function"==typeof b?e:d}function n(a){return"function"==typeof a?a:(a=I.ns.qualify(a)).local?function(){return this.ownerDocument.createElementNS(a.space,a.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,a)}}function o(a,b){try{for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}catch(d){a.prototype=b}}function p(){}function q(a){return Y+a in this}function r(a){return a=Y+a,a in this&&delete this[a]}function s(){var a=[];return this.forEach(function(b){a.push(b)}),a}function t(){var a=0;for(var b in this)b.charCodeAt(0)===Z&&++a;return a}function u(){for(var a in this)if(a.charCodeAt(0)===Z)return!1;return!0}function v(a){return{__data__:a}}function w(a){return function(){return U(this,a)}}function x(a){return arguments.length||(a=I.ascending),function(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}}function y(){}function z(){}function A(a){function b(){for(var b,d=c,e=-1,f=d.length;++e<f;)(b=d[e].on)&&b.apply(this,arguments);return a}var c=[],d=new p;return b.on=function(b,e){var f,g=d.get(b);return arguments.length<2?g&&g.on:(g&&(g.on=null,c=c.slice(0,f=c.indexOf(g)).concat(c.slice(f+1)),d.remove(b)),e&&c.push(d.set(b,{on:e})),a)},b}function B(a,b,c){function d(){var b=this[g];b&&(this.removeEventListener(a,b,b.$),delete this[g])}function e(){var e=i(b,K(arguments));d.call(this),this.addEventListener(a,this[g]=e,e.$=c),e._=b}function f(){var b,c=new RegExp("^__on([^.]+)"+I.requote(a)+"$");for(var d in this)if(b=d.match(c)){var e=this[d];this.removeEventListener(b[1],e,e.$),delete this[d]}}var g="__on"+a,h=a.indexOf("."),i=C;h>0&&(a=a.substring(0,h));var j=$.get(a);return j&&(a=j,i=D),h?b?e:d:b?y:f}function C(a,b){return function(c){var d=I.event;I.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{I.event=d}}}function D(a,b){var c=C(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function E(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function F(a){return P(a,_),a}function G(a){var b,c;return function(d,e,f){var g,h=a[f].update,i=h.length;for(f!=c&&(c=f,b=0),e>=b&&(b=e+1);!(g=h[b])&&++b<i;);return g}}function H(){var a=this.__transition__;a&&++a.active}var I={version:"3.4.1"},J=[].slice,K=function(a){return J.call(a)},L=document,M=L.documentElement,N=window;try{K(M.childNodes)[0].nodeType}catch(O){K=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}var P={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},Q=["webkit","ms","moz","Moz","o","O"],R=function(a,b){return b.querySelector(a)},S=function(a,b){return b.querySelectorAll(a)},T=M[a(M,"matchesSelector")],U=function(a,b){return T.call(a,b)};"function"==typeof Sizzle&&(R=function(a,b){return Sizzle(a,b)[0]||null},S=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},U=Sizzle.matchesSelector),I.selection=function(){return aa};var V=I.selection.prototype=[];V.select=function(a){var b,e,f,g,h=[];a=d(a);for(var i=-1,j=this.length;++i<j;){h.push(b=[]),b.parentNode=(f=this[i]).parentNode;for(var k=-1,l=f.length;++k<l;)(g=f[k])?(b.push(e=a.call(g,g.__data__,k,i)),e&&"__data__"in g&&(e.__data__=g.__data__)):b.push(null)}return c(h)},V.selectAll=function(a){var b,d,f=[];a=e(a);for(var g=-1,h=this.length;++g<h;)for(var i=this[g],j=-1,k=i.length;++j<k;)(d=i[j])&&(f.push(b=K(a.call(d,d.__data__,j,g))),b.parentNode=d);return c(f)};var W={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};I.ns={prefix:W,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.substring(0,b),a=a.substring(b+1)),W.hasOwnProperty(c)?{space:W[c],local:a}:a}},V.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=I.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(f(b,a[b]));return this}return this.each(f(a,b))},I.requote=function(a){return a.replace(X,"\\$&")};var X=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;V.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=i(a)).length,e=-1;if(b=c.classList){for(;++e<d;)if(!b.contains(a[e]))return!1}else for(b=c.getAttribute("class");++e<d;)if(!h(a[e]).test(b))return!1;return!0}for(b in a)this.each(j(b,a[b]));return this}return this.each(j(a,b))},V.style=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b="");for(c in a)this.each(l(c,a[c],b));return this}if(2>d)return N.getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(l(a,b,c))},V.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(m(b,a[b]));return this}return this.each(m(a,b))},V.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},V.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},V.append=function(a){return a=n(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},V.insert=function(a,b){return a=n(a),b=d(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},V.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},I.map=function(a){var b=new p;if(a instanceof p)a.forEach(function(a,c){b.set(a,c)});else for(var c in a)b.set(c,a[c]);return b},o(p,{has:q,get:function(a){return this[Y+a]},set:function(a,b){return this[Y+a]=b},remove:r,keys:s,values:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a},entries:function(){var a=[];return this.forEach(function(b,c){a.push({key:b,value:c})}),a},size:t,empty:u,forEach:function(a){for(var b in this)b.charCodeAt(0)===Z&&a.call(this,b.substring(1),this[b])}});var Y="\x00",Z=Y.charCodeAt(0);V.data=function(a,b){function d(a,c){var d,e,f,g=a.length,h=c.length,l=Math.min(g,h),m=new Array(h),n=new Array(h),o=new Array(g);if(b){var q,r=new p,s=new p,t=[];for(d=-1;++d<g;)q=b.call(e=a[d],e.__data__,d),r.has(q)?o[d]=e:r.set(q,e),t.push(q);for(d=-1;++d<h;)q=b.call(c,f=c[d],d),(e=r.get(q))?(m[d]=e,e.__data__=f):s.has(q)||(n[d]=v(f)),s.set(q,f),r.remove(q);for(d=-1;++d<g;)r.has(t[d])&&(o[d]=a[d])}else{for(d=-1;++d<l;)e=a[d],f=c[d],e?(e.__data__=f,m[d]=e):n[d]=v(f);for(;h>d;++d)n[d]=v(c[d]);for(;g>d;++d)o[d]=a[d]}n.update=m,n.parentNode=m.parentNode=o.parentNode=a.parentNode,i.push(n),j.push(m),k.push(o)}var e,f,g=-1,h=this.length;if(!arguments.length){for(a=new Array(h=(e=this[0]).length);++g<h;)(f=e[g])&&(a[g]=f.__data__);return a}var i=F([]),j=c([]),k=c([]);if("function"==typeof a)for(;++g<h;)d(e=this[g],a.call(e,e.parentNode.__data__,g));else for(;++g<h;)d(e=this[g],a);return j.enter=function(){return i},j.exit=function(){return k},j},V.datum=function(a){return arguments.length?this.property("__data__",a):this.property("__data__")},V.filter=function(a){var b,d,e,f=[];"function"!=typeof a&&(a=w(a));for(var g=0,h=this.length;h>g;g++){f.push(b=[]),b.parentNode=(d=this[g]).parentNode;for(var i=0,j=d.length;j>i;i++)(e=d[i])&&a.call(e,e.__data__,i,g)&&b.push(e)}return c(f)},V.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c,d=this[a],e=d.length-1,f=d[e];--e>=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},I.ascending=function(a,b){return b>a?-1:a>b?1:a>=b?0:NaN},V.sort=function(a){a=x.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},I.dispatch=function(){for(var a=new z,b=-1,c=arguments.length;++b<c;)a[arguments[b]]=A(a);return a},z.prototype.on=function(a,b){var c=a.indexOf("."),d="";if(c>=0&&(d=a.substring(c+1),a=a.substring(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},I.event=null,V.on=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(B(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(B(a,b,c))};var $=I.map({mouseenter:"mouseover",mouseleave:"mouseout"});$.forEach(function(a){"on"+a in L&&$.remove(a)}),V.each=function(a){return E(this,function(b,c,d){a.call(b,b.__data__,c,d)})},V.call=function(a){var b=K(arguments);return a.apply(b[0]=this,b),this},V.empty=function(){return!this.node()},V.node=function(){for(var a=0,b=this.length;b>a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null},V.size=function(){var a=0;return this.each(function(){++a}),a};var _=[];I.selection.enter=F,I.selection.enter.prototype=_,_.append=V.append,_.empty=V.empty,_.node=V.node,_.call=V.call,_.size=V.size,_.select=function(a){for(var b,d,e,f,g,h=[],i=-1,j=this.length;++i<j;){e=(f=this[i]).update,h.push(b=[]),b.parentNode=f.parentNode;for(var k=-1,l=f.length;++k<l;)(g=f[k])?(b.push(e[k]=d=a.call(f.parentNode,g.__data__,k,i)),d.__data__=g.__data__):b.push(null)}return c(h)},_.insert=function(a,b){return arguments.length<2&&(b=G(this)),V.insert.call(this,a,b)},V.transition=function(){for(var a,b,c=d3_transitionInheritId||++d3_transitionId,d=[],e=d3_transitionInherit||{time:Date.now(),ease:d3_ease_cubicInOut,delay:0,duration:250},f=-1,g=this.length;++f<g;){d.push(a=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(b=h[i])&&d3_transitionNode(b,i,c,e),a.push(b)}return d3_transition(d,c)},V.interrupt=function(){return this.each(H)},I.select=function(a){var b=["string"==typeof a?R(a,L):a];return b.parentNode=M,c([b])},I.selectAll=function(a){var b=K("string"==typeof a?S(a,L):a);return b.parentNode=M,c([b])};var aa=I.select(M);"function"==typeof define&&define.amd?define(I):"object"==typeof b&&b.exports?b.exports=I:this.d3=I}()},{}],3:[function(a,b,c){function d(a,b,c){function d(a){return a>=200&&300>a||304===a}function e(){void 0===h.status||d(h.status)?b.call(h,null,h):b.call(h,h,null)}var f=!1;if("undefined"==typeof window.XMLHttpRequest)return b(Error("Browser not supported"));if("undefined"==typeof c){var g=a.match(/^\s*https?:\/\/[^\/]*/);c=g&&g[0]!==location.protocol+"//"+location.domain+(location.port?":"+location.port:"")}var h;if(!c||"object"!=typeof window.XDomainRequest&&"function"!=typeof window.XDomainRequest)h=new window.XMLHttpRequest;else{h=new window.XDomainRequest;var i=b;b=function(){if(f)i.apply(this,arguments);else{var a=this,b=arguments;setTimeout(function(){i.apply(a,b)},0)}}}return"onload"in h?h.onload=e:h.onreadystatechange=function(){4===h.readyState&&e()},h.onerror=function(a){b.call(this,a||!0,null),b=function(){}},h.onprogress=function(){},h.ontimeout=function(a){b.call(this,a,null),b=function(){}},h.onabort=function(a){b.call(this,a,null),b=function(){}},h.open("GET",a,!0),h.send(null),f=!0,h}"undefined"!=typeof b&&(b.exports=d)},{}],4:[function(a,b,c){b.exports=function(a,b,c){var d;return function(){function e(){c||a.apply(f,g),d=null}var f=this,g=arguments;d?clearTimeout(d):c&&a.apply(f,g),d=setTimeout(e,b||100)}}},{}],5:[function(a,b,c){function d(a,b){a=Math.round(a*b),a<<=1,0>a&&(a=~a);for(var c="";a>=32;)c+=String.fromCharCode((32|31&a)+63),a>>=5;return c+=String.fromCharCode(a+63)}var e={};e.decode=function(a,b){for(var c,d,e=0,f=0,g=0,h=[],i=0,j=0,k=null,l=Math.pow(10,b||5);e<a.length;){k=null,i=0,j=0;do k=a.charCodeAt(e++)-63,j|=(31&k)<<i,i+=5;while(k>=32);c=1&j?~(j>>1):j>>1,i=j=0;do k=a.charCodeAt(e++)-63,j|=(31&k)<<i,i+=5;while(k>=32);d=1&j?~(j>>1):j>>1,f+=c,g+=d,h.push([f/l,g/l])}return h},e.encode=function(a,b){if(!a.length)return"";for(var c=Math.pow(10,b||5),e=d(a[0][0],c)+d(a[0][1],c),f=1;f<a.length;f++){var g=a[f],h=a[f-1];e+=d(g[0]-h[0],c),e+=d(g[1]-h[1],c)}return e},void 0!==typeof b&&(b.exports=e)},{}],6:[function(a,b,c){"use strict";var d=a("corslite"),e=a("polyline"),f=L.Class.extend({includes:[L.Mixin.Events],statics:{URL_TEMPLATE:"https://api.tiles.mapbox.com/v4/directions/{profile}/{waypoints}.json?instructions=html&geometry=polyline&access_token={token}"},initialize:function(a){L.setOptions(this,a),this._waypoints=[]},getOrigin:function(){return this.origin},getDestination:function(){return this.destination},setOrigin:function(a){return a=this._normalizeWaypoint(a),this.origin=a,this.fire("origin",{origin:a}),a||this._unload(),this},setDestination:function(a){return a=this._normalizeWaypoint(a),this.destination=a,this.fire("destination",{destination:a}),a||this._unload(),this},getProfile:function(){return this.profile||this.options.profile||"mapbox.driving"},setProfile:function(a){return this.profile=a,this.fire("profile",{profile:a}),this},getWaypoints:function(){return this._waypoints},setWaypoints:function(a){return this._waypoints=a.map(this._normalizeWaypoint),this},addWaypoint:function(a,b){return this._waypoints.splice(a,0,this._normalizeWaypoint(b)),this},removeWaypoint:function(a){return this._waypoints.splice(a,1),this},setWaypoint:function(a,b){return this._waypoints[a]=this._normalizeWaypoint(b),this},reverse:function(){var a=this.origin,b=this.destination;return this.origin=b,this.destination=a,this._waypoints.reverse(),this.fire("origin",{origin:this.origin}).fire("destination",{destination:this.destination}),this},selectRoute:function(a){this.fire("selectRoute",{route:a})},highlightRoute:function(a){this.fire("highlightRoute",{route:a})},highlightStep:function(a){this.fire("highlightStep",{step:a})},queryURL:function(){var a=f.URL_TEMPLATE,b=this.options.accessToken||L.mapbox.accessToken,c=this.getProfile(),d=[this.origin].concat(this._waypoints).concat([this.destination]).map(function(a){return a.properties.query||a.geometry.coordinates}).join(";");return L.mapbox.feedback&&L.mapbox.feedback.record({directions:c+";"+d}),L.Util.template(a,{token:b,profile:c,waypoints:d})},queryable:function(){return this.getOrigin()&&this.getDestination()},query:function(){return this.queryable()?(this._query&&this._query.abort(),this._query=d(this.queryURL(),L.bind(function(a,b){if(this._query=null,!a||"abort"!==a.type){if(b=b||a,b&&b.responseText)try{b=JSON.parse(b.responseText)}catch(c){b={error:b.responseText}}if(a||b.error)return this.fire("error",b);this.directions=b,this.directions.routes.forEach(function(a){a.geometry={type:"LineString",coordinates:e.decode(a.geometry,6).map(function(a){return a.reverse()})}}),this.origin=this.directions.origin,this.destination=this.directions.destination,this.fire("load",this.directions)}},this)),this):this},_unload:function(){this._waypoints=[],delete this.directions,this.fire("unload")},_normalizeWaypoint:function(a){if(!a||"Feature"===a.type)return a;var b,c={};return a instanceof L.LatLng?(a=a.wrap(),b=c.query=[a.lng,a.lat]):"string"==typeof a&&(c.query=a),{type:"Feature",geometry:{type:"Point",coordinates:b},properties:c}}});b.exports=function(a){return new f(a)}},{corslite:3,polyline:5}],7:[function(a,b,c){"use strict";var d=a("../lib/d3");a("./format");b.exports=function(a,b){var c,e={};return e.addTo=function(a){return c=a,e},a=d.select(L.DomUtil.get(a)).classed("mapbox-directions-errors",!0),b.on("load unload",function(){a.classed("mapbox-error-active",!1).html("")}),b.on("error",function(b){a.classed("mapbox-error-active",!0).html("").append("span").attr("class","mapbox-directions-error").text(b.error),a.insert("span","span").attr("class","mapbox-directions-icon mapbox-error-icon")}),e}},{"../lib/d3":2,"./format":8}],8:[function(a,b,c){"use strict";b.exports={duration:function(a){var b=Math.floor(a/60),c=Math.floor(b/60);return a%=60,b%=60,0===c&&0===b?a+" s":0===c?b+" min":c+" h "+b+" min"},imperial:function(a){var b=a/1609.344;return b>=100?b.toFixed(0)+" mi":b>=10?b.toFixed(1)+" mi":b>=.1?b.toFixed(2)+" mi":(5280*b).toFixed(0)+" ft"},metric:function(a){return a>=1e5?(a/1e3).toFixed(0)+" km":a>=1e4?(a/1e3).toFixed(1)+" km":a>=100?(a/1e3).toFixed(2)+" km":a.toFixed(0)+" m"}}},{}],9:[function(a,b,c){"use strict";var d=a("../lib/d3");b.exports=function(a,b){function c(a){if(a){if(a.properties.name)return a.properties.name;if(a.geometry.coordinates){var b=Math.max(0,Math.ceil(Math.log(e.getZoom())/Math.LN2));return a.geometry.coordinates[0].toFixed(b)+", "+a.geometry.coordinates[1].toFixed(b)}return a.properties.query||""}return""}var e,f={};f.addTo=function(a){return e=a,f},a=d.select(L.DomUtil.get(a)).classed("mapbox-directions-inputs",!0);var g=a.append("form").on("keypress",function(){13===d.event.keyCode&&(d.event.preventDefault(),b.setOrigin(i.property("value")).setDestination(k.property("value")),b.queryable()&&b.query())}),h=g.append("div").attr("class","mapbox-directions-origin");h.append("label").attr("class","mapbox-form-label").on("click",function(){b.getOrigin()instanceof L.LatLng&&e.panTo(b.getOrigin())}).append("span").attr("class","mapbox-directions-icon mapbox-depart-icon");var i=h.append("input").attr("type","text").attr("required","required").attr("id","mapbox-directions-origin-input").attr("placeholder","Start");h.append("div").attr("class","mapbox-directions-icon mapbox-close-icon").attr("title","Clear value").on("click",function(){b.setOrigin(void 0)}),g.append("span").attr("class","mapbox-directions-icon mapbox-reverse-icon mapbox-directions-reverse-input").attr("title","Reverse origin & destination").on("click",function(){b.reverse().query()});var j=g.append("div").attr("class","mapbox-directions-destination");j.append("label").attr("class","mapbox-form-label").on("click",function(){b.getDestination()instanceof L.LatLng&&e.panTo(b.getDestination())}).append("span").attr("class","mapbox-directions-icon mapbox-arrive-icon");var k=j.append("input").attr("type","text").attr("required","required").attr("id","mapbox-directions-destination-input").attr("placeholder","End");j.append("div").attr("class","mapbox-directions-icon mapbox-close-icon").attr("title","Clear value").on("click",function(){b.setDestination(void 0)});var l=g.append("div").attr("class","mapbox-directions-profile"),m=l.selectAll("span").data([["mapbox.driving","driving","Driving"],["mapbox.walking","walking","Walking"]]).enter().append("span");return m.append("input").attr("type","radio").attr("name","profile").attr("id",function(a){return"mapbox-directions-profile-"+a[1]}).property("checked",function(a,b){return 0===b}).on("change",function(a){b.setProfile(a[0]).query()}),m.append("label").attr("for",function(a){return"mapbox-directions-profile-"+a[1]}).text(function(a){return a[2]}),b.on("origin",function(a){i.property("value",c(a.origin))}).on("destination",function(a){k.property("value",c(a.destination))}).on("profile",function(a){m.selectAll("input").property("checked",function(b){return b[0]===a.profile})}).on("load",function(a){i.property("value",c(a.origin)),k.property("value",c(a.destination))}),f}},{"../lib/d3":2}],10:[function(a,b,c){"use strict";var d=a("../lib/d3"),e=a("./format");b.exports=function(a,b){var c,f={};return f.addTo=function(a){return c=a,f},a=d.select(L.DomUtil.get(a)).classed("mapbox-directions-instructions",!0),b.on("error",function(){a.html("")}),b.on("selectRoute",function(d){var f=d.route;a.html("");var g=a.append("ol").attr("class","mapbox-directions-steps").selectAll("li").data(f.steps).enter().append("li").attr("class","mapbox-directions-step");g.append("span").attr("class",function(a){return"mapbox-directions-icon mapbox-"+a.maneuver.type.replace(/\s+/g,"-").toLowerCase()+"-icon"}),g.append("div").attr("class","mapbox-directions-step-maneuver").html(function(a){return a.maneuver.instruction}),g.append("div").attr("class","mapbox-directions-step-distance").text(function(a){return a.distance?e.imperial(a.distance):""}),g.on("mouseover",function(a){b.highlightStep(a)}),g.on("mouseout",function(){b.highlightStep(null)}),g.on("click",function(a){c.panTo(L.GeoJSON.coordsToLatLng(a.maneuver.location.coordinates))})}),f}},{"../lib/d3":2,"./format":8}],11:[function(a,b,c){"use strict";var d=a("debounce"),e=L.LayerGroup.extend({options:{readonly:!1},initialize:function(a,b){L.setOptions(this,b),this._directions=a||new L.Directions,L.LayerGroup.prototype.initialize.apply(this),this._drag=d(L.bind(this._drag,this),100),this.originMarker=L.marker([0,0],{draggable:!this.options.readonly,icon:L.mapbox.marker.icon({"marker-size":"medium","marker-color":"#3BB2D0","marker-symbol":"a"})}).on("drag",this._drag,this),this.destinationMarker=L.marker([0,0],{draggable:!this.options.readonly,icon:L.mapbox.marker.icon({"marker-size":"medium","marker-color":"#444","marker-symbol":"b"})}).on("drag",this._drag,this),this.stepMarker=L.marker([0,0],{icon:L.divIcon({className:"mapbox-marker-drag-icon mapbox-marker-drag-icon-step",iconSize:new L.Point(12,12)})}),this.dragMarker=L.marker([0,0],{draggable:!this.options.readonly,icon:this._waypointIcon()}),this.dragMarker.on("dragstart",this._dragStart,this).on("drag",this._drag,this).on("dragend",this._dragEnd,this),this.routeLayer=L.geoJson(),this.routeHighlightLayer=L.geoJson(),this.waypointMarkers=[]},onAdd:function(){L.LayerGroup.prototype.onAdd.apply(this,arguments),this.options.readonly||this._map.on("click",this._click,this).on("mousemove",this._mousemove,this),this._directions.on("origin",this._origin,this).on("destination",this._destination,this).on("load",this._load,this).on("unload",this._unload,this).on("selectRoute",this._selectRoute,this).on("highlightRoute",this._highlightRoute,this).on("highlightStep",this._highlightStep,this)},onRemove:function(){this._directions.off("origin",this._origin,this).off("destination",this._destination,this).off("load",this._load,this).off("unload",this._unload,this).off("selectRoute",this._selectRoute,this).off("highlightRoute",this._highlightRoute,this).off("highlightStep",this._highlightStep,this),this._map.off("click",this._click,this).off("mousemove",this._mousemove,this),L.LayerGroup.prototype.onRemove.apply(this,arguments)},_click:function(a){this._directions.getOrigin()?this._directions.getDestination()||this._directions.setDestination(a.latlng):this._directions.setOrigin(a.latlng),this._directions.queryable()&&this._directions.query()},_mousemove:function(a){if(this.routeLayer&&this.hasLayer(this.routeLayer)&&void 0===this._currentWaypoint){var b=this._routePolyline().closestLayerPoint(a.layerPoint);if(!b||b.distance>15)return this.removeLayer(this.dragMarker);var c=this._map.project(a.latlng),d=this._map.project(this.originMarker.getLatLng()),e=this._map.project(this.destinationMarker.getLatLng());if(d.distanceTo(c)<15||e.distanceTo(c)<15)return this.removeLayer(this.dragMarker);for(var f=0;f<this.waypointMarkers.length;f++){var g=this._map.project(this.waypointMarkers[f].getLatLng());if(f!==this._currentWaypoint&&g.distanceTo(c)<15)return this.removeLayer(this.dragMarker)}this.dragMarker.setLatLng(this._map.layerPointToLatLng(b)),this.addLayer(this.dragMarker)}},_origin:function(a){a.origin&&a.origin.geometry.coordinates?(this.originMarker.setLatLng(L.GeoJSON.coordsToLatLng(a.origin.geometry.coordinates)),this.addLayer(this.originMarker)):this.removeLayer(this.originMarker)},_destination:function(a){a.destination&&a.destination.geometry.coordinates?(this.destinationMarker.setLatLng(L.GeoJSON.coordsToLatLng(a.destination.geometry.coordinates)),this.addLayer(this.destinationMarker)):this.removeLayer(this.destinationMarker)},_dragStart:function(a){a.target===this.dragMarker?(this._currentWaypoint=this._findWaypointIndex(a.target.getLatLng()),this._directions.addWaypoint(this._currentWaypoint,a.target.getLatLng())):this._currentWaypoint=this.waypointMarkers.indexOf(a.target)},_drag:function(a){var b=a.target.getLatLng();a.target===this.originMarker?this._directions.setOrigin(b):a.target===this.destinationMarker?this._directions.setDestination(b):this._directions.setWaypoint(this._currentWaypoint,b),this._directions.queryable()&&this._directions.query()},_dragEnd:function(){this._currentWaypoint=void 0},_removeWaypoint:function(a){this._directions.removeWaypoint(this.waypointMarkers.indexOf(a.target)).query()},_load:function(a){function b(b){return L.GeoJSON.coordsToLatLng(a.waypoints[b].geometry.coordinates)}this._origin(a),this._destination(a);for(var c=Math.min(this.waypointMarkers.length,a.waypoints.length),d=0;c>d;d++)this.waypointMarkers[d].setLatLng(b(d));for(;d<a.waypoints.length;d++){var e=L.marker(b(d),{draggable:!this.options.readonly,icon:this._waypointIcon()});e.on("click",this._removeWaypoint,this).on("dragstart",this._dragStart,this).on("drag",this._drag,this).on("dragend",this._dragEnd,this),this.waypointMarkers.push(e),this.addLayer(e)}for(;d<this.waypointMarkers.length;d++)this.removeLayer(this.waypointMarkers[d]);this.waypointMarkers.length=a.waypoints.length},_unload:function(){this.removeLayer(this.routeLayer);for(var a=0;a<this.waypointMarkers.length;a++)this.removeLayer(this.waypointMarkers[a])},_selectRoute:function(a){this.routeLayer.clearLayers().addData(a.route.geometry),this.addLayer(this.routeLayer)},_highlightRoute:function(a){a.route?(this.routeHighlightLayer.clearLayers().addData(a.route.geometry),this.addLayer(this.routeHighlightLayer)):this.removeLayer(this.routeHighlightLayer)},_highlightStep:function(a){a.step?(this.stepMarker.setLatLng(L.GeoJSON.coordsToLatLng(a.step.maneuver.location.coordinates)),this.addLayer(this.stepMarker)):this.removeLayer(this.stepMarker)},_routePolyline:function(){return this.routeLayer.getLayers()[0]},_findWaypointIndex:function(a){for(var b=this._findNearestRouteSegment(a),c=0;c<this.waypointMarkers.length;c++){var d=this._findNearestRouteSegment(this.waypointMarkers[c].getLatLng());if(d>b)return c}return this.waypointMarkers.length},_findNearestRouteSegment:function(a){for(var b,c=1/0,d=this._map.latLngToLayerPoint(a),e=this._routePolyline()._originalPoints,f=1;f<e.length;f++){var g=L.LineUtil._sqClosestPointOnSegment(d,e[f-1],e[f],!0);c>g&&(c=g,b=f)}return b},_waypointIcon:function(){return L.divIcon({className:"mapbox-marker-drag-icon",iconSize:new L.Point(12,12)})}});b.exports=function(a,b){return new e(a,b)}},{debounce:4}],12:[function(a,b,c){"use strict";var d=a("../lib/d3"),e=a("./format");b.exports=function(a,b){var c,f={};return f.addTo=function(a){return c=a,f},a=d.select(L.DomUtil.get(a)).classed("mapbox-directions-routes",!0),b.on("error",function(){a.html("")}),b.on("load",function(c){a.html("");var d=a.append("ul").selectAll("li").data(c.routes).enter().append("li").attr("class","mapbox-directions-route");d.append("div").attr("class","mapbox-directions-route-heading").text(function(a){return"Route "+(c.routes.indexOf(a)+1)}),d.append("div").attr("class","mapbox-directions-route-summary").text(function(a){return a.summary}),d.append("div").attr("class","mapbox-directions-route-details").text(function(a){return e.imperial(a.distance)+", "+e.duration(a.duration)}),d.on("mouseover",function(a){b.highlightRoute(a)}),d.on("mouseout",function(){b.highlightRoute(null)}),d.on("click",function(a){b.selectRoute(a)}),b.selectRoute(c.routes[0])}),b.on("selectRoute",function(b){a.selectAll(".mapbox-directions-route").classed("mapbox-directions-route-active",function(a){return a===b.route})}),f}},{"../lib/d3":2,"./format":8}]},{},[1]),!function c(a,b,d){function e(g,h){if(!b[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=b[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,c,a,b,d)}return b[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){
  !function(a,d){"function"==typeof define&&define.amd?define([],d):"object"==typeof c?b.exports=d():a.returnExports=d()}(this,function(){function a(e,f){if("function"!=typeof f)throw new Error("Bad callback given: "+f);if(!e)throw new Error("No options given");var h=e.onResponse;if(e="string"==typeof e?{uri:e}:JSON.parse(JSON.stringify(e)),e.onResponse=h,e.verbose&&(a.log=d()),e.url&&(e.uri=e.url,delete e.url),!e.uri&&""!==e.uri)throw new Error("options.uri is a required argument");if("string"!=typeof e.uri)throw new Error("options.uri must be a string");for(var i=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],j=0;j<i.length;j++)if(e[i[j]])throw new Error("options."+i[j]+" is not supported");if(e.callback=f,e.method=e.method||"GET",e.headers=e.headers||{},e.body=e.body||null,e.timeout=e.timeout||a.DEFAULT_TIMEOUT,e.headers.host)throw new Error("Options.headers.host is not supported");e.json&&(e.headers.accept=e.headers.accept||"application/json","GET"!==e.method&&(e.headers["content-type"]="application/json"),"boolean"!=typeof e.json?e.body=JSON.stringify(e.json):"string"!=typeof e.body&&(e.body=JSON.stringify(e.body)));var k=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")};if(e.qs){var l="string"==typeof e.qs?e.qs:k(e.qs);-1!==e.uri.indexOf("?")?e.uri=e.uri+"&"+l:e.uri=e.uri+"?"+l}var m=function(a){var b={};b.boundry="-------------------------------"+Math.floor(1e9*Math.random());var c=[];for(var d in a)a.hasOwnProperty(d)&&c.push("--"+b.boundry+'\nContent-Disposition: form-data; name="'+d+'"\n\n'+a[d]+"\n");return c.push("--"+b.boundry+"--"),b.body=c.join(""),b.length=b.body.length,b.type="multipart/form-data; boundary="+b.boundry,b};if(e.form){if("string"==typeof e.form)throw"form name unsupported";if("POST"===e.method){var n=(e.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(e.headers["content-type"]=n,n){case"application/x-www-form-urlencoded":e.body=k(e.form).replace(/%20/g,"+");break;case"multipart/form-data":var o=m(e.form);e.body=o.body,e.headers["content-type"]=o.type;break;default:throw new Error("unsupported encoding:"+n)}}}return e.onResponse=e.onResponse||c,e.onResponse===!0&&(e.onResponse=f,e.callback=c),!e.headers.authorization&&e.auth&&(e.headers.authorization="Basic "+g(e.auth.username+":"+e.auth.password)),b(e)}function b(b){function c(){l=!0;var c=new Error("ETIMEDOUT");return c.code="ETIMEDOUT",c.duration=b.timeout,a.log.error("Timeout",{id:k._id,milliseconds:b.timeout}),b.callback(c,k)}function d(c){if(l)return a.log.debug("Ignoring timed out state change",{state:k.readyState,id:k.id});if(a.log.debug("State change",{state:k.readyState,id:k.id,timed_out:l}),k.readyState===h.OPENED){a.log.debug("Request started",{id:k.id});for(var d in b.headers)k.setRequestHeader(d,b.headers[d])}else k.readyState===h.HEADERS_RECEIVED?e():k.readyState===h.LOADING?(e(),g()):k.readyState===h.DONE&&(e(),g(),i())}function e(){if(!p.response){if(p.response=!0,a.log.debug("Got response",{id:k.id,status:k.status}),clearTimeout(k.timeoutTimer),k.statusCode=k.status,m&&0==k.statusCode){var c=new Error("CORS request rejected: "+b.uri);return c.cors="rejected",p.loading=!0,p.end=!0,b.callback(c,k)}b.onResponse(null,k)}}function g(){p.loading||(p.loading=!0,a.log.debug("Response body loading",{id:k.id}))}function i(){if(!p.end){if(p.end=!0,a.log.debug("Request done",{id:k.id}),k.body=k.responseText,b.json)try{k.body=JSON.parse(k.responseText)}catch(c){return b.callback(c,k)}b.callback(null,k,k.body)}}var k=new h,l=!1,m=f(b.uri),n="withCredentials"in k;if(j+=1,k.seq_id=j,k.id=j+": "+b.method+" "+b.uri,k._id=k.id,m&&!n){var o=new Error("Browser does not support cross-origin request: "+b.uri);return o.cors="unsupported",b.callback(o,k)}k.timeoutTimer=setTimeout(c,b.timeout);var p={response:!1,loading:!1,end:!1};return k.onreadystatechange=d,k.open(b.method,b.uri,!0),m&&(k.withCredentials=!!b.withCredentials),k.send(b.body),k}function c(){}function d(){var a,b,d={},f=["trace","debug","info","warn","error"];for(b=0;b<f.length;b++)a=f[b],d[a]=c,"undefined"!=typeof console&&console&&console[a]&&(d[a]=e(console,a));return d}function e(a,b){function c(c,d){return"object"==typeof d&&(c+=" "+JSON.stringify(d)),a[b].call(a,c)}return c}function f(a){var b,c=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{b=location.href}catch(d){b=document.createElement("a"),b.href="",b=b.href}var e=c.exec(b.toLowerCase())||[],f=c.exec(a.toLowerCase()),g=!(!f||f[1]==e[1]&&f[2]==e[2]&&(f[3]||("http:"===f[1]?80:443))==(e[3]||("http:"===e[1]?80:443)));return g}function g(a){var b,c,d,e,f,g,h,i,j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",k=0,l=0,m="",n=[];if(!a)return a;do b=a.charCodeAt(k++),c=a.charCodeAt(k++),d=a.charCodeAt(k++),i=b<<16|c<<8|d,e=i>>18&63,f=i>>12&63,g=i>>6&63,h=63&i,n[l++]=j.charAt(e)+j.charAt(f)+j.charAt(g)+j.charAt(h);while(k<a.length);switch(m=n.join(""),a.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"="}return m}var h=XMLHttpRequest;if(!h)throw new Error("missing XMLHttpRequest");a.log={trace:c,debug:c,info:c,warn:c,error:c};var i=18e4,j=0;a.withCredentials=!1,a.DEFAULT_TIMEOUT=i,a.defaults=function(b,c){var d=function(a){var c=function(c,d){c="string"==typeof c?{uri:c}:JSON.parse(JSON.stringify(c));for(var e in b)void 0===c[e]&&(c[e]=b[e]);return a(c,d)};return c},e=d(a);return e.get=d(a.get),e.post=d(a.post),e.put=d(a.put),e.head=d(a.head),e};var k=["get","put","post","head"];return k.forEach(function(b){var c=b.toUpperCase(),d=b.toLowerCase();a[d]=function(b){"string"==typeof b?b={method:c,uri:b}:(b=JSON.parse(JSON.stringify(b)),b.method=c);var d=[b].concat(Array.prototype.slice.apply(arguments,[1]));return a.apply(this,d)}}),a.couch=function(b,d){function e(a,b,c){if(a)return d(a,b,c);if((b.statusCode<200||b.statusCode>299)&&c.error){a=new Error("CouchDB error: "+(c.error.reason||c.error.error));for(var e in c)a[e]=c[e];return d(a,b,c)}return d(a,b,c)}"string"==typeof b&&(b={uri:b}),b.json=!0,b.body&&(b.json=b.body),delete b.body,d=d||c;var f=a(b,e);return f},a})},{}],2:[function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}b.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||0>a||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(d=arguments.length,f=new Array(d-1),i=1;d>i;i++)f[i-1]=arguments[i];c.apply(this,f)}else if(g(c)){for(d=arguments.length,f=new Array(d-1),i=1;d>i;i++)f[i-1]=arguments[i];for(j=c.slice(),d=j.length,i=0;d>i;i++)j[i].apply(this,f)}return!0},d.prototype.addListener=function(a,b){var c;if(!e(b))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,e(b.listener)?b.listener:b),this._events[a]?g(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,g(this._events[a])&&!this._events[a].warned){var c;c=h(this._maxListeners)?d.defaultMaxListeners:this._maxListeners,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())}return this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-->0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(0>d)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?e(a._events[b])?1:a._events[b].length:0}},{}],3:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l<b;)h&&h[l].run();l=-1,b=j.length}h=null,k=!1,clearTimeout(a)}}function f(a,b){this.fun=a,this.array=b}function g(){}var h,i=b.exports={},j=[],k=!1,l=-1;i.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];j.push(new f(a,b)),1!==j.length||k||setTimeout(e,0)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(a){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(a){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],4:[function(a,b,c){(function(c,d){(function(){"use strict";function e(a){return"function"==typeof a||"object"==typeof a&&null!==a}function f(a){return"function"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){T=a}function i(a){X=a}function j(){return function(){c.nextTick(o)}}function k(){return function(){S(o)}}function l(){var a=0,b=new $(o),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function m(){var a=new MessageChannel;return a.port1.onmessage=o,function(){a.port2.postMessage(0)}}function n(){return function(){setTimeout(o,1)}}function o(){for(var a=0;W>a;a+=2){var b=ba[a],c=ba[a+1];b(c),ba[a]=void 0,ba[a+1]=void 0}W=0}function p(){try{var b=a,c=b("vertx");return S=c.runOnLoop||c.runOnContext,k()}catch(d){return n()}}function q(){}function r(){return new TypeError("You cannot resolve a promise with itself")}function s(){return new TypeError("A promises callback cannot return that same promise.")}function t(a){try{return a.then}catch(b){return fa.error=b,fa}}function u(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function v(a,b,c){X(function(a){var d=!1,e=u(c,b,function(c){d||(d=!0,b!==c?y(a,c):A(a,c))},function(b){d||(d=!0,B(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,B(a,e))},a)}function w(a,b){b._state===da?A(a,b._result):b._state===ea?B(a,b._result):C(b,void 0,function(b){y(a,b)},function(b){B(a,b)})}function x(a,b){if(b.constructor===a.constructor)w(a,b);else{var c=t(b);c===fa?B(a,fa.error):void 0===c?A(a,b):f(c)?v(a,b,c):A(a,b)}}function y(a,b){a===b?B(a,r()):e(b)?x(a,b):A(a,b)}function z(a){a._onerror&&a._onerror(a._result),D(a)}function A(a,b){a._state===ca&&(a._result=b,a._state=da,0!==a._subscribers.length&&X(D,a))}function B(a,b){a._state===ca&&(a._state=ea,a._result=b,X(z,a))}function C(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+da]=c,e[f+ea]=d,0===f&&a._state&&X(D,a)}function D(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?G(c,d,e,f):e(f);a._subscribers.length=0}}function E(){this.error=null}function F(a,b){try{return a(b)}catch(c){return ga.error=c,ga}}function G(a,b,c,d){var e,g,h,i,j=f(c);if(j){if(e=F(c,d),e===ga?(i=!0,g=e.error,e=null):h=!0,b===e)return void B(b,s())}else e=d,h=!0;b._state!==ca||(j&&h?y(b,e):i?B(b,g):a===da?A(b,e):a===ea&&B(b,e))}function H(a,b){try{b(function(b){y(a,b)},function(b){B(a,b)})}catch(c){B(a,c)}}function I(a,b){var c=this;c._instanceConstructor=a,c.promise=new a(q),c._validateInput(b)?(c._input=b,c.length=b.length,c._remaining=b.length,c._init(),0===c.length?A(c.promise,c._result):(c.length=c.length||0,c._enumerate(),0===c._remaining&&A(c.promise,c._result))):B(c.promise,c._validationError())}function J(a){return new ha(this,a).promise}function K(a){function b(a){y(e,a)}function c(a){B(e,a)}var d=this,e=new d(q);if(!V(a))return B(e,new TypeError("You must pass an array to race.")),e;for(var f=a.length,g=0;e._state===ca&&f>g;g++)C(d.resolve(a[g]),void 0,b,c);return e}function L(a){var b=this;if(a&&"object"==typeof a&&a.constructor===b)return a;var c=new b(q);return y(c,a),c}function M(a){var b=this,c=new b(q);return B(c,a),c}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function O(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function P(a){this._id=ma++,this._state=void 0,this._result=void 0,this._subscribers=[],q!==a&&(f(a)||N(),this instanceof P||O(),H(this,a))}function Q(){var a;if("undefined"!=typeof d)a=d;else if("undefined"!=typeof self)a=self;else try{a=Function("return this")()}catch(b){throw new Error("polyfill failed because global object is unavailable in this environment")}var c=a.Promise;(!c||"[object Promise]"!==Object.prototype.toString.call(c.resolve())||c.cast)&&(a.Promise=na)}var R;R=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)};var S,T,U,V=R,W=0,X=({}.toString,function(a,b){ba[W]=a,ba[W+1]=b,W+=2,2===W&&(T?T(o):U())}),Y="undefined"!=typeof window?window:void 0,Z=Y||{},$=Z.MutationObserver||Z.WebKitMutationObserver,_="undefined"!=typeof c&&"[object process]"==={}.toString.call(c),aa="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ba=new Array(1e3);U=_?j():$?l():aa?m():void 0===Y&&"function"==typeof a?p():n();var ca=void 0,da=1,ea=2,fa=new E,ga=new E;I.prototype._validateInput=function(a){return V(a)},I.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},I.prototype._init=function(){this._result=new Array(this.length)};var ha=I;I.prototype._enumerate=function(){for(var a=this,b=a.length,c=a.promise,d=a._input,e=0;c._state===ca&&b>e;e++)a._eachEntry(d[e],e)},I.prototype._eachEntry=function(a,b){var c=this,d=c._instanceConstructor;g(a)?a.constructor===d&&a._state!==ca?(a._onerror=null,c._settledAt(a._state,b,a._result)):c._willSettleAt(d.resolve(a),b):(c._remaining--,c._result[b]=a)},I.prototype._settledAt=function(a,b,c){var d=this,e=d.promise;e._state===ca&&(d._remaining--,a===ea?B(e,c):d._result[b]=c),0===d._remaining&&A(e,d._result)},I.prototype._willSettleAt=function(a,b){var c=this;C(a,void 0,function(a){c._settledAt(da,b,a)},function(a){c._settledAt(ea,b,a)})};var ia=J,ja=K,ka=L,la=M,ma=0,na=P;P.all=ia,P.race=ja,P.resolve=ka,P.reject=la,P._setScheduler=h,P._setAsap=i,P._asap=X,P.prototype={constructor:P,then:function(a,b){var c=this,d=c._state;if(d===da&&!a||d===ea&&!b)return this;var e=new this.constructor(q),f=c._result;if(d){var g=arguments[d-1];X(function(){G(d,e,g,f)})}else C(c,e,a,b);return e},"catch":function(a){return this.then(null,a)}};var oa=Q,pa={Promise:na,polyfill:oa};"function"==typeof define&&define.amd?define(function(){return pa}):"undefined"!=typeof b&&b.exports?b.exports=pa:"undefined"!=typeof this&&(this.ES6Promise=pa),oa()}).call(this)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],5:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("../core/request"),g=a("../core/promise"),h=a("../core/settings"),i=a("../core/core"),j=a("../core/logger"),k=a("./storage"),l=a("../core/user"),m=new h.Settings,n=null,o="DEFER_REGISTER",p={},q={},r=[],s=function(){function a(b){d(this,a),this._dispatcher=null,this._dispatchIntervalTime=30,this._useEventCaching=!0,this._serviceHost=m.getURL("analytics"),this.logger=new j.Logger({prefix:"Ionic Analytics:"}),this.logger._silence=!0,this.storage=i.IonicPlatform.getStorage(),this.cache=new k.BucketStorage("ionic_analytics"),this._addGlobalPropertyDefaults(),b!==o&&this.register(b)}return e(a,[{key:"_addGlobalPropertyDefaults",value:function(){var a=this;a.setGlobalProperties(function(a,b){b._user=JSON.parse(JSON.stringify(l.User.current())),b._app={app_id:m.get("app_id"),analytics_version:i.IonicPlatform.Version}})}},{key:"_enqueueEvent",value:function(a,b){var c=this;if(p.dryRun)return c.logger.info("event recieved but not sent (dryRun active):"),c.logger.info(a),void c.logger.info(b);c.logger.info("enqueuing event to send later:"),c.logger.info(a),c.logger.info(b),b.keen||(b.keen={}),b.keen.timestamp=(new Date).toISOString();var d=c.cache.get("event_queue")||{};d[a]||(d[a]=[]),d[a].push(b),c.cache.set("event_queue",d)}},{key:"_requestAnalyticsKey",value:function(){var a={method:"GET",json:!0,uri:m.getURL("api")+"/api/v1/app/"+m.get("app_id")+"/keys/write",headers:{Authorization:"basic "+btoa(m.get("app_id")+":"+m.get("api_key"))}};return new f.APIRequest(a)}},{key:"_postEvent",value:function(a,b){var c=this,d={name:[b]};n||c.logger.error("Cannot send events to the analytics server without an Analytics key.");var e={method:"POST",url:c._serviceHost+"/api/v1/events/"+m.get("app_id"),body:d,json:!0,headers:{Authorization:n}};return new f.APIRequest(e)}},{key:"_postEvents",value:function(a){var b=this;n||b.logger.info("Cannot send events to the analytics server without an Analytics key.");var c={method:"POST",url:b._serviceHost+"/api/v1/events/"+m.get("app_id"),body:a,json:!0,headers:{Authorization:n}};return new f.APIRequest(c)}},{key:"_dispatchQueue",value:function(){var a=this,b=this.cache.get("event_queue")||{};0!==Object.keys(b).length&&i.IonicPlatform.deviceConnectedToNetwork()&&a.storage.lockedAsyncCall(a.cache.scopedKey("event_dispatch"),function(){return a._postEvents(b)}).then(function(){a.cache.set("event_queue",{}),a.logger.info("sent events"),a.logger.info(b)},function(c){a._handleDispatchError(c,this,b)})}},{key:"_getRequestStatusCode",value:function(a){var b=!1;return a&&a.requestInfo._lastResponse&&a.requestInfo._lastResponse.statusCode&&(b=a.requestInfo._lastResponse.statusCode),b}},{key:"_handleDispatchError",value:function(a,b,c){var d=this,e=this._getRequestStatusCode(b);"last_call_interrupted"===a?d.cache.set("event_queue",{}):e?(d.cache.set("event_queue",{}),d.logger.error("Error sending analytics data: Server responded with error"),d.logger.error(c)):d.logger.error("Error sending analytics data: Failed to connect to analytics server.")}},{key:"_handleRegisterError",value:function(a,b){var c=this._getRequestStatusCode(b),d=" See http://docs.ionic.io/v1.0/docs/io-quick-start";switch(c){case 401:self.logger.error("The api key and app id you provided did not register on the server. "+d);break;case 404:self.logger.error('The app id you provided ("'+m.get("app_id")+'") was not found.'+d);break;default:self.logger.error("Unable to request analytics key."),self.logger.error(a)}}},{key:"register",value:function(a){var b=this,c=new g.DeferredPromise;return this.hasValidSettings?(p=a||{},p.silent?this.logger._silence=!0:this.logger._silence=!1,p.dryRun&&this.logger.info("dryRun mode is active. Analytics will not send any events."),this._requestAnalyticsKey().then(function(a){n=a.payload.write_key,b.logger.info("successfully registered analytics key"),b.dispatchInterval=b.dispatchInterval,c.resolve(!0)},function(a){b._handleRegisterError(a,this),c.reject(!1)}),c.promise):(c.reject(!1),c.promise)}},{key:"setGlobalProperties",value:function(a){var b=this,c=typeof a;switch(c){case"object":for(var d in a)a.hasOwnProperty(d)&&(q[d]=a[d]);break;case"function":r.push(a);break;default:b.logger.error("setGlobalProperties parameter must be an object or function.")}}},{key:"track",value:function(a,b){var c=this;if(!this.hasValidSettings)return!1;b||(b={});for(var d in q)q.hasOwnProperty(d)&&void 0===b[d]&&(b[d]=q[d]);for(var e=0;e<r.length;e++){var f=r[e];f.call(null,a,b)}this._useEventCaching?c._enqueueEvent(a,b):p.dryRun?(c.logger.info("dryRun active, will not send event"),c.logger.info(a),c.logger.info(b)):c._postEvent(a,b)}},{key:"unsetGlobalProperty",value:function(a){var b=this,c=typeof a;switch(c){case"string":delete q[a];break;case"function":var d=r.indexOf(a);-1===d&&b.logger.error("The function passed to unsetGlobalProperty was not a global property."),r.splice(d,1);break;default:b.logger.error("unsetGlobalProperty parameter must be a string or function.")}}},{key:"hasValidSettings",get:function(){if(!m.get("app_id")||!m.get("api_key")){var a="A valid app_id and api_key are required before you can utilize analytics properly. See http://docs.ionic.io/v1.0/docs/io-quick-start";return this.logger.info(a),!1}return!0}},{key:"dispatchInterval",set:function(a){var b=this;this._dispatchIntervalTime=a,this._dispatcher&&window.clearInterval(this.dispatcher),a>0?(this._dispatcher=window.setInterval(function(){b._dispatchQueue()},1e3*a),this._useEventCaching=!0):this._useEventCaching=!1},get:function(){return this._dispatchIntervalTime}}]),a}();c.Analytics=s},{"../core/core":12,"../core/logger":16,"../core/promise":17,"../core/request":18,"../core/settings":19,"../core/user":21,"./storage":9}],6:[function(a,b,c){"use strict";if("object"==typeof angular&&angular.module){var d=function(a){return["$ionicAnalytics","$ionicGesture",function(b,c){for(var d=["drag","dragstart","dragend","dragleft","dragright","dragup","dragdown","swipe","swipeleft","swiperight","swipeup","swipedown","tap","doubletap","hold","transform","pinch","pinchin","pinchout","rotate"],e=!1,f=0;f<d.length;f++)d[f]===a.toLowerCase()&&(e=!0);return{restrict:"A",link:function(d,f,g){function h(a){var c=d.$eval(g.ionTrackData)||{};j?b.track(j,c):b.trackClick(a.pageX,a.pageY,a.target,{data:c})}var i=a[0].toUpperCase()+a.slice(1),j=g["ionTrack"+i];if(e){var k=c.on(a,h,f);d.$on("$destroy",function(){c.off(k,a,h)})}else f.on(a,h),d.$on("$destroy",function(){f.off(a,h)})}}}]},e=null;angular.module("ionic.service.analytics",["ionic"]).value("IONIC_ANALYTICS_VERSION",Ionic.Analytics.version).factory("$ionicAnalytics",[function(){return e||(e=new Ionic.Analytics("DEFER_REGISTER")),e}]).factory("domSerializer",[function(){return new Ionic.AnalyticSerializers.DOMSerializer}]).run(["$ionicAnalytics","$state",function(a,b){a.setGlobalProperties(function(a,c){c._ui||(c._ui={}),c._ui.active_state=b.current.name})}]),angular.module("ionic.service.analytics").provider("$ionicAutoTrack",[function(){var a={},b=!1;this.disableTracking=function(c){c?a[c]=!0:b=!0},this.$get=[function(){return{isEnabled:function(c){return!b&&!a[c]}}}]}]).run(["$ionicAutoTrack","$ionicAnalytics",function(a,b){a.isEnabled("Load")&&b.track("Load")}]).run(["$ionicAutoTrack","$document","$ionicAnalytics","domSerializer",function(a,b,c,d){a.isEnabled("Tap")&&b.on("click",function(a){var b=a.target.getBoundingClientRect(),e=b.right-b.left,f=b.bottom-b.top,g=(a.pageX-b.left)/e,h=(a.pageY-b.top)/f,i={coordinates:{x:a.pageX,y:a.pageY},target:d.elementSelector(a.target),target_identifier:d.elementName(a.target)};isFinite(g)&&isFinite(h)&&(i.coordinates.x_norm=g,i.coordinates.y_norm=h),c.track("Tap",{_ui:i})})}]).run(["$ionicAutoTrack","$ionicAnalytics","$rootScope",function(a,b,c){a.isEnabled("State Change")&&c.$on("$stateChangeSuccess",function(a,c,d,e,f){b.track("State Change",{from:e.name,to:c.name})})}]).directive("ionTrackClick",d("click")).directive("ionTrackTap",d("tap")).directive("ionTrackDoubletap",d("doubletap")).directive("ionTrackHold",d("hold")).directive("ionTrackRelease",d("release")).directive("ionTrackDrag",d("drag")).directive("ionTrackDragLeft",d("dragleft")).directive("ionTrackDragRight",d("dragright")).directive("ionTrackDragUp",d("dragup")).directive("ionTrackDragDown",d("dragdown")).directive("ionTrackSwipeLeft",d("swipeleft")).directive("ionTrackSwipeRight",d("swiperight")).directive("ionTrackSwipeUp",d("swipeup")).directive("ionTrackSwipeDown",d("swipedown")).directive("ionTrackTransform",d("hold")).directive("ionTrackPinch",d("pinch")).directive("ionTrackPinchIn",d("pinchin")).directive("ionTrackPinchOut",d("pinchout")).directive("ionTrackRotate",d("rotate"))}},{}],7:[function(a,b,c){"use strict";var d=a("./analytics"),e=a("./storage"),f=a("./serializers");window.Ionic=window.Ionic||{},Ionic.Analytics=d.Analytics,Ionic.AnalyticStorage={},Ionic.AnalyticStorage.BucketStorage=e.BucketStorage,Ionic.AnalyticSerializers={},Ionic.AnalyticSerializers.DOMSerializer=f.DOMSerializer},{"./analytics":5,"./serializers":8,"./storage":9}],8:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(){d(this,a)}return e(a,[{key:"elementSelector",value:function(a){for(var b=[];"HTML"!==a.tagName;){var c=a.tagName.toLowerCase(),d=a.getAttribute("id");d&&(c+="#"+d);var e=a.className;if(e)for(var f=e.split(" "),g=0;g<f.length;g++){var h=f[g];h&&(c+="."+h)}if(!a.parentNode)return null;var i=Array.prototype.indexOf.call(a.parentNode.children,a);c+=":nth-child("+(i+1)+")",a=a.parentNode,b.push(c)}return b.reverse().join(">")}},{key:"elementName",value:function(a){var b=a.getAttribute("ion-track-name");if(b)return b;var c=a.getAttribute("id");return c?c:null}}]),a}();c.DOMSerializer=f},{}],9:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("../core/settings"),g=a("../core/core"),h=new f.Settings,i=function(){function a(b){d(this,a),this.name=b,this.baseStorage=g.IonicPlatform.getStorage()}return e(a,[{key:"get",value:function(a){return this.baseStorage.retrieveObject(this.scopedKey(a))}},{key:"set",value:function(a,b){return this.baseStorage.storeObject(this.scopedKey(a),b)}},{key:"scopedKey",value:function(a){return this.name+"_"+a+"_"+h.get("app_id")}}]),a}();c.BucketStorage=i},{"../core/core":12,"../core/settings":19}],10:[function(a,b,c){"use strict";"object"==typeof angular&&angular.module&&angular.module("ionic.service.core",[]).provider("persistentStorage",function(){return{$get:[function(){var a=Ionic.getService("Storage");return a||(a=new Ionic.IO.Storage,Ionic.addService("Storage",a,!0)),a}]}}).factory("$ionicCoreSettings",[function(){return new Ionic.IO.Settings}]).factory("$ionicUser",[function(){return Ionic.User}]).run([function(){Ionic.io()}])},{}],11:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a){return h[a]||null}Object.defineProperty(c,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=a("./logger"),h={},i=function(){function a(b,c){return d(this,a),this.logger=new g.Logger({prefix:"Ionic App:"}),b&&""!==b?c&&""!==c?(h.id=b,h.apiKey=c,this.devPush=null,void(this.gcmKey=null)):(this.logger.info("No api_key was provided"),!1):(this.logger.info("No app_id was provided"),!1)}return f(a,[{key:"toString",value:function(){return"<IonicApp ['"+this.id+"'>"}},{key:"id",get:function(){return e("id")}},{key:"apiKey",get:function(){return e("apiKey")}}]),a}();c.App=i},{"./logger":16}],12:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("./events"),g=a("./storage"),h=a("./logger"),i=new f.EventEmitter,j=new g.Storage,k=function(){function a(){d(this,a);var b=this;if(this.logger=new h.Logger({prefix:"Ionic Core:"}),this.logger.info("init"),this._pluginsReady=!1,this.emitter=a.getEmitter(),this._bootstrap(),b.cordovaPlatformUnknown)b.logger.info("attempting to mock plugins"),b._pluginsReady=!0,b.emitter.emit("ionic_core:plugins_ready");else try{document.addEventListener("deviceready",function(){b.logger.info("plugins are ready"),b._pluginsReady=!0,b.emitter.emit("ionic_core:plugins_ready")},!1)}catch(c){b.logger.info("unable to listen for cordova plugins to be ready")}}return e(a,[{key:"_isCordovaAvailable",value:function(){var a=this;if(this.logger.info("searching for cordova.js"),"undefined"!=typeof cordova)return this.logger.info("cordova.js has already been loaded"),!0;for(var b=document.getElementsByTagName("script"),c=b.length,d=0;c>d;d++){var e=b[d].getAttribute("src");if(e){var f=e.split("/"),g=0;try{if(g=f.length,"cordova.js"===f[g-1])return a.logger.info("cordova.js has previously been included."),!0}catch(h){a.logger.info("encountered error while testing for cordova.js presence, "+h.toString())}}}return!1}},{key:"loadCordova",value:function(){var b=this;if(!this._isCordovaAvailable()){var c=document.createElement("script"),d="cordova.js";switch(a.getDeviceTypeByNavigator()){case"android":"file"===window.location.href.substring(0,4)&&(d="file:///android_asset/www/cordova.js");break;case"ipad":case"iphone":try{var e=window.location.search.match(/cordova_js_bootstrap_resource=(.*?)(&|#|$)/i);e&&(d=decodeURI(e[1]))}catch(f){b.logger.info("could not find cordova_js_bootstrap_resource query param"),b.logger.info(f)}break;case"unknown":return b.cordovaPlatformUnknown=!0,!1}c.setAttribute("src",d),document.head.appendChild(c),b.logger.info("injecting cordova.js")}}},{key:"_bootstrap",value:function(){this.loadCordova()}},{key:"onReady",
  value:function(a){var b=this;this._pluginsReady?a(b):b.emitter.on("ionic_core:plugins_ready",function(){a(b)})}}],[{key:"getEmitter",value:function(){return i}},{key:"getStorage",value:function(){return j}},{key:"getMain",value:function(){return"undefined"!=typeof Ionic&&Ionic.IO&&Ionic.IO.main?Ionic.IO.main:null}},{key:"getDeviceTypeByNavigator",value:function(){var a=navigator.userAgent,b=a.match(/iPad/i);if(b&&"ipad"===b[0].toLowerCase())return"ipad";var c=a.match(/iPhone/i);if(c&&"iphone"===c[0].toLowerCase())return"iphone";var d=a.match(/Android/i);return d&&"android"===d[0].toLowerCase()?"android":"unknown"}},{key:"isAndroidDevice",value:function(){var b=a.getDeviceTypeByNavigator();return"android"===b?!0:!1}},{key:"isIOSDevice",value:function(){var b=a.getDeviceTypeByNavigator();return"iphone"===b||"ipad"===b?!0:!1}},{key:"deviceConnectedToNetwork",value:function(a){if("undefined"==typeof a&&(a=!1),"undefined"==typeof navigator.connection||"undefined"==typeof navigator.connection.type||"undefined"==typeof Connection)return a?!1:!0;switch(navigator.connection.type){case Connection.ETHERNET:case Connection.WIFI:case Connection.CELL_2G:case Connection.CELL_3G:case Connection.CELL_4G:case Connection.CELL:return!0;default:return!1}}},{key:"Version",get:function(){return"0.2.0"}}]),a}();c.IonicPlatform=k},{"./events":15,"./logger":16,"./storage":20}],13:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f={},g=function(){function a(b){d(this,a),this.data={},this.setProperties(b)}return e(a,[{key:"setProperties",value:function(a){if(a instanceof Object)for(var b in a)this.data[b]=a[b]}},{key:"toJSON",value:function(){var a=this.data;return{__Ionic_DataTypeSchema:a.name,value:a.value}}},{key:"isValid",value:function(){return this.data.name&&this.data.value?!0:!1}}]),a}(),h=function(){function a(){d(this,a)}return e(a,null,[{key:"get",value:function(a,b){return f[a]?new f[a](b):!1}},{key:"getMapping",value:function(){return f}},{key:"register",value:function(a,b){f[a]=b}},{key:"Schema",get:function(){return g}}]),a}();c.DataType=h;var i=function(){function a(b){if(d(this,a),this.data=[],b instanceof Array)for(var c in b)this.push(b[c])}return e(a,[{key:"toJSON",value:function(){var a=this.data,b=new g({name:"UniqueArray",value:a});return b.toJSON()}},{key:"push",value:function(a){-1===this.data.indexOf(a)&&this.data.push(a)}},{key:"pull",value:function(a){var b=this.data.indexOf(a);this.data.splice(b,1)}}],[{key:"fromStorage",value:function(b){return new a(b)}}]),a}();c.UniqueArray=i,h.register("UniqueArray",i)},{}],14:[function(a,b,c){"use strict";var d=a("./app"),e=a("./core"),f=a("./events"),g=a("./logger"),h=a("./promise"),i=a("./request"),j=a("./settings"),k=a("./storage"),l=a("./user"),m=a("./data-types");window.Ionic=window.Ionic||{},Ionic.Core=e.IonicPlatform,Ionic.User=l.User,Ionic.DataType=m.DataType,Ionic.DataTypes=m.DataType.getMapping(),Ionic.IO={},Ionic.IO.App=d.App,Ionic.IO.EventEmitter=f.EventEmitter,Ionic.IO.Logger=g.Logger,Ionic.IO.Promise=h.Promise,Ionic.IO.DeferredPromise=h.DeferredPromise,Ionic.IO.Request=i.Request,Ionic.IO.Response=i.Response,Ionic.IO.APIRequest=i.APIRequest,Ionic.IO.APIResponse=i.APIResponse,Ionic.IO.Storage=k.Storage,Ionic.IO.Settings=j.Settings;var n={};Ionic.io=function(){return"undefined"==typeof Ionic.IO.main&&(Ionic.IO.main=new Ionic.Core),Ionic.IO.main},Ionic.getService=function(a){return"undefined"!=typeof n[a]&&n[a]?n[a]:!1},Ionic.addService=function(a,b,c){b&&"undefined"==typeof n[a]?n[a]=b:b&&c&&(n[a]=b)},Ionic.removeService=function(a){"undefined"!=typeof n[a]&&delete n[a]},Ionic.io()},{"./app":11,"./core":12,"./data-types":13,"./events":15,"./logger":16,"./promise":17,"./request":18,"./settings":19,"./storage":20,"./user":21}],15:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("events"),g=function(){function a(){d(this,a),this._emitter=new f}return e(a,[{key:"on",value:function(a,b){return this._emitter.on(a,b)}},{key:"emit",value:function(a,b){return this._emitter.emit(a,b)}}]),a}();c.EventEmitter=g},{events:2}],16:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(b){d(this,a);var c=b||{};this._silence=!1,this._prefix=!1,this._options=c,this._bootstrap()}return e(a,[{key:"_bootstrap",value:function(){this._options.prefix&&(this._prefix=this._options.prefix)}},{key:"info",value:function(a){this._silence||(this._prefix?console.log(this._prefix,a):console.log(a))}},{key:"warn",value:function(a){this._silence||(this._prefix?console.log(this._prefix,a):console.log(a))}},{key:"error",value:function(a){this._prefix?console.error(this._prefix,a):console.error(a)}}]),a}();c.Logger=f},{}],17:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("es6-promise").Promise,g=f;c.Promise=g;var h=function(){function a(){d(this,a);var b=this;this._update=!1,this.promise=new f(function(a,c){b.resolve=a,b.reject=c});var c=this.promise.then;this.promise.then=function(a,d,e){return b._update=e,c.call(b.promise,a,d)}}return e(a,[{key:"notify",value:function(a){this._update&&"function"==typeof this._update&&this._update(a)}}]),a}();c.DeferredPromise=h},{"es6-promise":4}],18:[function(a,b,c){"use strict";function d(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var f=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},g=a("./promise"),h=a("browser-request"),i=function m(){e(this,m)};c.Request=i;var j=function n(){e(this,n)};c.Response=j;var k=function(a){function b(){e(this,b),f(Object.getPrototypeOf(b.prototype),"constructor",this).call(this)}return d(b,a),b}(j);c.APIResponse=k;var l=function(a){function b(a){e(this,b),f(Object.getPrototypeOf(b.prototype),"constructor",this).call(this);var c={},d=new g.Promise(function(b,d){h(a,function(a,e,f){if(c._lastError=a,c._lastResponse=e,c._lastResult=f,a)d(a);else if(e.statusCode<200||e.statusCode>=400){var g=new Error("Request Failed with status code of "+e.statusCode);d(g)}else b({response:e,payload:f})})});return d.requestInfo=c,d}return d(b,a),b}(i);c.APIRequest=l},{"./promise":17,"browser-request":1}],19:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(){return d(this,a),this._settings=null,this}return e(a,[{key:"factory",value:function(a,b){return this._settings=b(),this}},{key:"get",value:function(a){return this._settings.get(a)}},{key:"finish",value:function(){return this}}]),a}(),g=(new f).factory("$ionicCoreSettings",function(){"IONIC_SETTINGS_STRING_START";"IONIC_SETTINGS_STRING_END"}).finish(),h=function(){function a(){d(this,a),this._locations={api:"https://apps.ionic.io",push:"https://push.ionic.io",analytics:"https://analytics.ionic.io",deploy:"https://apps.ionic.io"},this._devLocations=this.get("dev_locations"),this._devLocations||(this._devLocations={})}return e(a,[{key:"get",value:function(a){return g.get(a)}},{key:"getURL",value:function(a){return this._devLocations[a]?this._devLocations[a]:this._locations[a]?this._locations[a]:null}}]),a}();c.Settings=h},{}],20:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("./promise"),g=function(){function a(){d(this,a)}return e(a,[{key:"get",value:function(a){return window.localStorage.getItem(a)}},{key:"remove",value:function(a){return window.localStorage.removeItem(a)}},{key:"set",value:function(a,b){return window.localStorage.setItem(a,b)}}]),a}(),h={},i={},j=function(){function a(){d(this,a),this.strategy=new g}return e(a,[{key:"storeObject",value:function(a,b){var c=JSON.stringify(b);this.strategy.set(a,c),h[a]=b}},{key:"deleteObject",value:function(a){this.strategy.remove(a),delete h[a]}},{key:"retrieveObject",value:function(a){var b=h[a];if(b)return b;var c=this.strategy.get(a);if(null===c)return null;try{return JSON.parse(c)}catch(d){return null}}},{key:"lockedAsyncCall",value:function(a,b){var c=this,d=new f.DeferredPromise;return i[a]?(d.reject("in_progress"),d.promise):"locked"===this.strategy.get(a)?(d.reject("last_call_interrupted"),d.promise.then(null,function(){c.strategy.remove(a)}),d.promise):(i[a]=!0,c.strategy.set(a,"locked"),b().then(function(b){d.resolve(b),delete i[a],c.strategy.remove(a)},function(b){d.reject(b),delete i[a],c.strategy.remove(a)},function(a){d.notify(a)}),d.promise)}}]),a}();c.Storage=j},{"./promise":17}],21:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("./request"),g=a("./promise"),h=a("./settings"),i=a("./core"),j=a("./storage"),k=a("./logger"),l=a("../push/push-token"),m=a("./data-types.js"),n=i.IonicPlatform,o=null,p=new h.Settings,q=new j.Storage,r=p.getURL("api")+"/api/v1/app/"+p.get("app_id")+"/users",s={load:function(a){return r+"/"+a.id},remove:function(a){return r+"/"+a.id},save:function(a){return r+"/"+a.id},identify:function(){return r+"/identify"},addToken:function(){return r+"/pushUnique"}},t=function(){function a(){d(this,a)}return e(a,null,[{key:"delete",value:function(){q.deleteObject(a.label)}},{key:"store",value:function(){q.storeObject(a.label,w.current())}},{key:"getRawData",value:function(){return q.retrieveObject(a.label)||!1}},{key:"load",value:function(){var b=q.retrieveObject(a.label)||!1;return b?w.fromContext(b):!1}},{key:"label",get:function(){return"ionic_io_user_"+p.get("app_id")}}]),a}(),u=function(){function a(b){d(this,a),this.logger=new k.Logger({prefix:"Ionic Push Token:"}),this.tokens={android:[],ios:[]},b&&"object"==typeof b&&(this.tokens=b)}return e(a,[{key:"addToken",value:function(a){var b=null;if("undefined"==typeof a||!a||""===a)return this.logger.info("you need to pass a valid token to addToken()"),!1;if(a.token&&(a=a.token),"DEV"===a.slice(0,3))return this.logger.info("dev tokens cannot be saved to a user as they are a temporary resource"),!1;if(n.isAndroidDevice()?b="android":n.isIOSDevice()&&(b="ios"),null===b||!this.tokens.hasOwnProperty(b))return this.logger.info("cannot determine the token platform. Are you running on an Android or iOS device?"),!1;var c=this.tokens[b],d=!1,e=null;for(e in c)c[e]===a&&(d=!0);return d||c.push(a),!0}},{key:"removeToken",value:function(a){var b;for(b in this.tokens){var c,d=this.tokens[b];for(c in d)d[c]===a.token&&d.splice(c,1)}return!0}}]),a}(),v=function(){function a(b){d(this,a),this.data={},"object"==typeof b&&(this.data=b,this.deserializerDataTypes())}return e(a,[{key:"deserializerDataTypes",value:function(){for(var a in this.data)if("object"==typeof this.data[a]&&this.data[a].__Ionic_DataTypeSchema){var b=this.data[a].__Ionic_DataTypeSchema,c=m.DataType.getMapping();c[b]&&(this.data[a]=c[b].fromStorage(this.data[a].value))}}},{key:"set",value:function(a,b){this.data[a]=b}},{key:"unset",value:function(a){delete this.data[a]}},{key:"get",value:function(a,b){return this.data.hasOwnProperty(a)?this.data[a]:b||null}}]),a}(),w=function(){function a(){d(this,a),this.logger=new k.Logger({prefix:"Ionic User:"}),this._blockLoad=!1,this._blockSave=!1,this._blockDelete=!1,this._dirty=!1,this._fresh=!0,this._unset={},this.push=new u,this.data=new v}return e(a,[{key:"isDirty",value:function(){return this._dirty}},{key:"isFresh",value:function(){return this._fresh}},{key:"isValid",value:function(){return this.id?!0:!1}},{key:"getAPIFormat",value:function(){var a=this,b=this.data.data;return b.user_id=this.id,b._push={android_tokens:this.push.tokens.android,ios_tokens:this.push.tokens.ios},this.isFresh()?b:{update:b,remove:a._unset}}},{key:"getFormat",value:function(a){var b=this,c=null;switch(a){case"api":c=b.getAPIFormat()}return c}},{key:"delete",value:function(){var a=this,b=new g.DeferredPromise;return a.isValid()?(a._blockDelete?(a.logger.info("a delete operation is already in progress for "+this+"."),b.reject(!1)):(a._blockDelete=!0,a._delete(),new f.APIRequest({uri:s.remove(this),method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(c){a._blockDelete=!1,a.logger.info("deleted "+a),b.resolve(c)},function(c){a._blockDelete=!1,a.logger.error(c),b.reject(c)})),b.promise):!1}},{key:"_store",value:function(){this===a.current()&&t.store()}},{key:"_delete",value:function(){this===a.current()&&t["delete"]()}},{key:"save",value:function(){var a=this,b=new g.DeferredPromise;if(a._blockSave)a.logger.info("a save operation is already in progress for "+this+"."),b.reject(!1);else{a._blockSave=!0,a._store();var c=s.save(this),d="PUT";a.isFresh()&&(c=s.identify(this),d="POST"),new f.APIRequest({uri:c,method:d,headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a.getFormat("api"))}).then(function(c){a._dirty=!1,a.isFresh()||(a._unset={}),a._fresh=!1,a._blockSave=!1,a.logger.info("saved user"),b.resolve(c)},function(c){a._dirty=!0,a._blockSave=!1,a.logger.error(c),b.reject(c)})}return b.promise}},{key:"toString",value:function(){return"<IonicUser ['"+this.id+"']>"}},{key:"addPushToken",value:function(a){return this.push.addToken(a)}},{key:"removePushToken",value:function(a){return a instanceof l.PushToken||(a=new l.PushToken(a)),this.push.removeToken(a)}},{key:"set",value:function(a,b){return delete this._unset[a],this.data.set(a,b)}},{key:"get",value:function(a,b){return this.data.get(a,b)}},{key:"unset",value:function(a){return this._unset[a]=!0,this.data.unset(a)}},{key:"id",set:function(a){return a&&"string"==typeof a&&""!==a?(this._id=a,!0):!1},get:function(){return this._id||null}}],[{key:"current",value:function(b){return b?(o=b,t.store(),o):(o||(o=t.load()),o||(o=new a),o)}},{key:"fromContext",value:function(b){var c=new a;return c.id=b._id,c.data=new v(b.data.data),c.push=new u(b.push.tokens),c._fresh=b._fresh,c._dirty=b._dirty,c}},{key:"load",value:function(b){var c=new g.DeferredPromise,d=new a;return d.id=b,d._blockLoad?(d.logger.info("a load operation is already in progress for "+this+"."),c.reject(!1)):(d._blockLoad=!0,new f.APIRequest({uri:s.load(d),method:"GET",json:!0,headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(a){d._blockLoad=!1,d.logger.info("loaded user"),d.data=new v(a.payload.custom_data),a.payload._push&&a.payload._push.android_tokens&&(d.push.tokens.android=a.payload._push.android_tokens),a.payload._push&&a.payload._push.ios_tokens&&(d.push.tokens.ios=a.payload._push.ios_tokens),d.image=a.payload.image,d._fresh=!1,c.resolve(d)},function(a){d._blockLoad=!1,d.logger.error(a),c.reject(a)})),c.promise}},{key:"anonymousId",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})}}]),a}();c.User=w},{"../push/push-token":29,"./core":12,"./data-types.js":13,"./logger":16,"./promise":17,"./request":18,"./settings":19,"./storage":20}],22:[function(a,b,c){"use strict";if("object"==typeof angular&&angular.module){var d=null;angular.module("ionic.service.deploy",[]).factory("$ionicDeploy",[function(){return d||(d=new Ionic.Deploy),d}])}},{}],23:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("../core/settings"),g=a("../core/promise"),h=a("../core/logger"),i=a("../core/core"),j=a("../core/events"),k=new f.Settings,l="IONIC_DEPLOY_MISSING_PLUGIN",m=5e3,n=6e4,o=function(){function a(){d(this,a);var b=this;this.logger=new h.Logger({prefix:"Ionic Deploy:"}),this._plugin=!1,this._isReady=!1,this._channelTag="production",this._emitter=new j.EventEmitter,this.logger.info("init"),i.IonicPlatform.getMain().onReady(function(){b.initialize(),b._isReady=!0,b._emitter.emit("ionic_deploy:ready")})}return e(a,[{key:"_getPlugin",value:function(){return this._plugin?this._plugin:"undefined"==typeof IonicDeploy?(this.logger.info("plugin is not installed or has not loaded. Have you run `ionic plugin add ionic-plugin-deploy` yet?"),!1):(this._plugin=IonicDeploy,IonicDeploy)}},{key:"initialize",value:function(){var a=this;this.onReady(function(){a._getPlugin()&&a._plugin.init(k.get("app_id"),k.getURL("deploy"))})}},{key:"check",value:function(){var a=this,b=new g.DeferredPromise;return this.onReady(function(){a._getPlugin()?a._plugin.check(k.get("app_id"),a._channelTag,function(c){c&&"true"===c?(a.logger.info("an update is available"),b.resolve(!0)):(a.logger.info("no updates available"),b.resolve(!1))},function(c){a.logger.error("encountered an error while checking for updates"),b.reject(c)}):b.reject(l)}),b.promise}},{key:"download",value:function(){var a=this,b=new g.DeferredPromise;return this.onReady(function(){a._getPlugin()?a._plugin.download(k.get("app_id"),function(c){"true"!==c&&"false"!==c?b.notify(c):("true"===c&&a.logger.info("download complete"),b.resolve("true"===c))},function(a){b.reject(a)}):b.reject(l)}),b.promise}},{key:"extract",value:function(){var a=this,b=new g.DeferredPromise;return this.onReady(function(){a._getPlugin()?a._plugin.extract(k.get("app_id"),function(c){"done"!==c?b.notify(c):("true"===c&&a.logger.info("extraction complete"),b.resolve(c))},function(a){b.reject(a)}):b.reject(l)}),b.promise}},{key:"load",value:function(){var a=this;this.onReady(function(){a._getPlugin()&&a._plugin.redirect(k.get("app_id"))})}},{key:"watch",value:function(a){function b(){e.check().then(function(a){a&&c.notify(a)},function(a){e.logger.info("unable to check for updates, ",a)}),this._checkTimeout&&(this._checkTimeout=setTimeout(b.bind(e),d.interval))}var c=new g.DeferredPromise,d=a||{},e=this;return"undefined"==typeof d.initialDelay&&(d.initialDelay=m),"undefined"==typeof d.interval&&(d.interval=n),this._checkTimeout=setTimeout(b.bind(e),d.initialDelay),c.promise}},{key:"unwatch",value:function(){clearTimeout(this._checkTimeout),this._checkTimeout=null}},{key:"info",value:function(){var a=new g.DeferredPromise,b=this;return this.onReady(function(){b._getPlugin()?b._plugin.info(k.get("app_id"),function(b){a.resolve(b)},function(b){a.reject(b)}):a.reject(l)}),a.promise}},{key:"getVersions",value:function(){var a=new g.DeferredPromise,b=this;return this.onReady(function(){b._getPlugin()?b._plugin.getVersions(k.get("app_id"),function(b){a.resolve(b)},function(b){a.reject(b)}):a.reject(l)}),a.promise}},{key:"deleteVersion",value:function(a){var b=new g.DeferredPromise,c=this;return this.onReady(function(){c._getPlugin()?c._plugin.deleteVersion(k.get("app_id"),a,function(a){b.resolve(a)},function(a){b.reject(a)}):b.reject(l)}),b.promise}},{key:"getMetadata",value:function(a){var b=new g.DeferredPromise,c=this;return this.onReady(function(){c._getPlugin()?c._plugin.getMetadata(k.get("app_id"),a,function(a){b.resolve(a.metadata)},function(a){b.reject(a)}):b.reject(l)}),b.promise}},{key:"setChannel",value:function(a){this._channelTag=a}},{key:"update",value:function(a){var b=new g.DeferredPromise,c=this,d=!1;return"undefined"!=typeof a&&(d=a),this.onReady(function(){c._getPlugin()?c.check().then(function(a){if(a===!0){var e=0;c.download().then(function(a){a||b.reject("download error"),c.extract().then(function(a){a||b.reject("extraction error"),d?b.resolve(!0):(b.resolve(!0),c._plugin.redirect(k.get("app_id")))},function(a){b.reject(a)},function(a){var c=e+a/2;b.notify(c)})},function(a){b.reject(a)},function(a){e=a/2,b.notify(e)})}else b.resolve(!1)},function(a){b.reject(a)}):b.reject(l)}),b.promise}},{key:"onReady",value:function(a){var b=this;this._isReady?a(b):b._emitter.on("ionic_deploy:ready",function(){a(b)})}}]),a}();c.Deploy=o},{"../core/core":12,"../core/events":15,"../core/logger":16,"../core/promise":17,"../core/settings":19}],24:[function(a,b,c){"use strict";var d=a("./deploy");window.Ionic=window.Ionic||{},Ionic.Deploy=d.Deploy},{"./deploy":23}],25:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();if("object"==typeof angular&&angular.module){var f=null;angular.module("ionic.service.push",[]).factory("$ionicPushAction",["$state",function(a){var b=function(){function b(){d(this,b)}return e(b,[{key:"notificationNavigation",value:function(b){var c=!1,d={};try{c=b.additionalData.payload.$state}catch(e){c=!1}try{d=JSON.parse(b.additionalData.payload.$stateParams)}catch(e){d={}}c&&a.go(c,d)}}]),b}();return new b}]).factory("$ionicPush",[function(){return f||(f=new Ionic.Push("DEFER_INIT")),f}]).run(["$ionicPush","$ionicPushAction",function(a,b){a._emitter.on("ionic_push:processNotification",function(a){a&&a.additionalData&&a.additionalData.foreground===!1&&b.notificationNavigation(a)})}])}},{}],26:[function(a,b,c){"use strict";var d=a("./push"),e=a("./push-token");window.Ionic=window.Ionic||{},Ionic.Push=d.Push,Ionic.PushToken=e.PushToken},{"./push":30,"./push-token":29}],27:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("../core/request"),g=a("../core/settings"),h=a("../core/logger"),i=a("./push-token"),j=new g.Settings,k=function(){function a(){d(this,a),this.logger=new h.Logger({prefix:"Ionic Push (dev):"}),this._serviceHost=j.getURL("push"),this._token=!1,this._watch=!1}return e(a,[{key:"getDevToken",value:function(){var a="DEV-xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)});return this._token=a,this._token}},{key:"init",value:function(a,b){this._push=a,this._emitter=this._push._emitter;var c=this._token,d=this;c||(c=this.getDevToken());var e={method:"POST",uri:this._serviceHost+"/dev/push",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({dev_token:c})};new f.APIRequest(e).then(function(){var a={registrationId:c};d.logger.info("registered with development push service",c),d._emitter.emit("ionic_push:token",a),"function"==typeof b&&b(new i.PushToken(d._token)),d.watch()},function(a){d.logger.error("error connecting development push service.",a)})}},{key:"checkForNotifications",value:function(){if(!this._token)return!1;var a=this,b={method:"GET",uri:this._serviceHost+"/dev/push/check",headers:{Accept:"application/json","Content-Type":"application/json","X-Ionic-Dev-Token":this._token},json:!0};new f.APIRequest(b).then(function(b){if(b.payload.messages.length>0){var c={message:b.payload.messages[0],title:"DEVELOPMENT PUSH"};a.logger.warn("Ionic Push: Development Push received. Development pushes will not contain payload data."),a._emitter.emit("ionic_push:notification",c)}},function(b){a.logger.error("unable to check for development pushes.",b)})}},{key:"watch",value:function(){this.logger.info("watching for new notifications");var a=this;this._watch||(this._watch=setInterval(function(){a.checkForNotifications()},5e3))}},{key:"halt",value:function(){this._watch&&clearInterval(this._watch)}}]),a}();c.PushDevService=k},{"../core/logger":16,"../core/request":18,"../core/settings":19,"./push-token":29}],28:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(){d(this,a),this.asleep=!1,this.closed=!1}return e(a,[{key:"wasAsleep",get:function(){return this.asleep}},{key:"wasClosed",get:function(){return this.closed}}]),a}(),g=function(){function a(b){d(this,a),this._raw=b||{},this._raw.additionalData||(this._raw.additionalData={coldstart:!1,foreground:!0}),this._payload=null,this.app=null,this.text=null,this.title=null,this.count=null,this.sound=null,this.image=null}return e(a,[{key:"processRaw",value:function(){this.text=this._raw.message||null,this.title=this._raw.title||null,this.count=this._raw.count||null,this.sound=this._raw.sound||null,this.image=this._raw.image||null,this.app=new f,this._raw.additionalData.foreground||(this.app.asleep=!0),this._raw.additionalData.coldstart&&(this.app.closed=!0),this._raw.additionalData.payload&&(this._payload=this._raw.additionalData.payload)}},{key:"getRawVersion",value:function(){return this._raw}},{key:"toString",value:function(){return"<PushMessage ['"+this.title+"']>"}},{key:"payload",get:function(){return this._payload||{}}}],[{key:"fromPluginJSON",value:function(b){var c=new a(b);return c.processRaw(),c}}]),a}();c.PushMessage=g},{}],29:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(){function a(b){d(this,a),this._token=b||null}return e(a,[{key:"toString",value:function(){var a=this._token||"null";return"<PushToken ['"+a+"']>"}},{key:"token",set:function(a){this._token=a},get:function(){return this._token}}]),a}();c.PushToken=f},{}],30:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("../core/app"),g=a("../core/settings"),h=a("../core/core"),i=a("../core/logger"),j=a("../core/events"),k=a("../core/request"),l=a("../core/promise"),m=a("./push-token"),n=a("./push-message"),o=a("./push-dev"),p=new g.Settings,q="DEFER_INIT",r=p.getURL("api")+"/api/v1/app/"+p.get("app_id")+"/push",s={invalidateToken:function(){return r+"/invalidate-token"}},t=function(){function a(b){d(this,a),this.logger=new i.Logger({prefix:"Ionic Push:"});var c=new f.App(p.get("app_id"),p.get("api_key"));if(c.devPush=p.get("dev_push"),c.gcmKey=p.get("gcm_key"),!c.id||!c.apiKey)return this.logger.error("no app_id or api_key found. (http://docs.ionic.io/docs/io-install)"),!1;if(h.IonicPlatform.isAndroidDevice()&&!c.devPush&&!c.gcmKey)return this.logger.error("GCM project number not found (http://docs.ionic.io/docs/push-android-setup)"),!1;if(this.app=c,this.registerCallback=!1,this.notificationCallback=!1,this.errorCallback=!1,this._token=!1,this._notification=!1,this._debug=!1,this._isReady=!1,this._tokenReady=!1,this._blockRegistration=!1,this._registered=!1,this._emitter=new j.EventEmitter,b!==q){var e=this;h.IonicPlatform.getMain().onReady(function(){e.init(b)})}}return e(a,[{key:"getStorageToken",value:function(){var a=h.IonicPlatform.getStorage(),b=a.retrieveObject("ionic_io_push_token");return b?new m.PushToken(b.token):null}},{key:"clearStorageToken",value:function(){var a=h.IonicPlatform.getStorage();a.deleteObject("ionic_io_push_token")}},{key:"init",value:function(a){if(this._getPushPlugin(),"undefined"==typeof a&&(a={}),"object"!=typeof a)return this.logger.error("init() requires a valid config object."),!1;var b=this;return a.pluginConfig||(a.pluginConfig={}),h.IonicPlatform.isAndroidDevice()&&(a.pluginConfig.android||(a.pluginConfig.android={}),a.pluginConfig.android.senderId||(a.pluginConfig.android.senderID=b.app.gcmKey)),a.onRegister&&this.setRegisterCallback(a.onRegister),a.onNotification&&this.setNotificationCallback(a.onNotification),a.onError&&this.setErrorCallback(a.onError),this._config=a,this._isReady=!0,this._emitter.emit("ionic_push:ready",{config:this._config}),this}},{key:"addTokenToUser",value:function(a){this._token||this.logger.info("a token must be registered before you can add it to a user."),"object"==typeof a?h.IonicPlatform.isAndroidDevice()?a.addPushToken(this._token,"android"):h.IonicPlatform.isIOSDevice()?a.addPushToken(this._token,"ios"):this.logger.info("token is not a valid Android or iOS registration id. Cannot save to user."):this.logger.info("invalid $ionicUser object passed to $ionicPush.addToUser()");
  }},{key:"register",value:function(a){this.logger.info("register");var b=this;return this._blockRegistration?(b.logger.info("another registration is already in progress."),!1):(this._blockRegistration=!0,void this.onReady(function(){if(b.app.devPush){var c=new o.PushDevService;b._debugCallbackRegistration(),b._callbackRegistration(),c.init(b,a),b._blockRegistration=!1,b._tokenReady=!0}else b._plugin=PushNotification.init(b._config.pluginConfig),b._plugin.on("registration",function(c){b._blockRegistration=!1,b.token=new m.PushToken(c.registrationId),b._tokenReady=!0,"function"==typeof a&&a(b._token)}),b._debugCallbackRegistration(),b._callbackRegistration();b._registered=!0}))}},{key:"unregister",value:function(){var a=this,b=new l.DeferredPromise,c=null;return h.IonicPlatform.isAndroidDevice()?c="android":h.IonicPlatform.isIOSDevice()&&(c="ios"),c||b.reject("Could not detect the platform, are you on a device?"),a._blockUnregister?(a.logger.info("an unregister operation is already in progress."),b.reject(!1)):(this._plugin&&this._plugin.unregister(function(){},function(){}),new k.APIRequest({uri:s.invalidateToken(a),method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({platform:c,token:a.getStorageToken().token})}).then(function(c){a._blockUnregister=!1,a.logger.info("unregistered push token: "+a.getStorageToken().token),a.clearStorageToken(),b.resolve(c)},function(c){a._blockUnregister=!1,a.logger.error(c),b.reject(c)})),b.promise}},{key:"getPayload",value:function(a){return a.payload}},{key:"setRegisterCallback",value:function(a){return"function"!=typeof a?(this.logger.info("setRegisterCallback() requires a valid callback function"),!1):(this.registerCallback=a,!0)}},{key:"setNotificationCallback",value:function(a){return"function"!=typeof a?(this.logger.info("setNotificationCallback() requires a valid callback function"),!1):(this.notificationCallback=a,!0)}},{key:"setErrorCallback",value:function(a){return"function"!=typeof a?(this.logger.info("setErrorCallback() requires a valid callback function"),!1):(this.errorCallback=a,!0)}},{key:"_debugRegistrationCallback",value:function(){function a(a){b.token=new m.PushToken(a.registrationId),b.logger.info("(debug) device token registered: "+b._token)}var b=this;return a}},{key:"_debugNotificationCallback",value:function(){function a(a){b._processNotification(a);var c=n.PushMessage.fromPluginJSON(a);b.logger.info("(debug) notification received: "+c),!b.notificationCallback&&b.app.devPush&&alert(c.text)}var b=this;return a}},{key:"_debugErrorCallback",value:function(){function a(a){b.logger.error("(debug) unexpected error occured."),b.logger.error(a)}var b=this;return a}},{key:"_registerCallback",value:function(){function a(a){return b.token=new m.PushToken(a.registrationId),b.registerCallback?b.registerCallback(b._token):void 0}var b=this;return a}},{key:"_notificationCallback",value:function(){function a(a){b._processNotification(a);var c=n.PushMessage.fromPluginJSON(a);return b.notificationCallback?b.notificationCallback(c):void 0}var b=this;return a}},{key:"_errorCallback",value:function(){function a(a){return b.errorCallback?b.errorCallback(a):void 0}var b=this;return a}},{key:"_debugCallbackRegistration",value:function(){this._config.debug&&(this.app.devPush?this._registered||(this._emitter.on("ionic_push:token",this._debugRegistrationCallback()),this._emitter.on("ionic_push:notification",this._debugNotificationCallback()),this._emitter.on("ionic_push:error",this._debugErrorCallback())):(this._plugin.on("registration",this._debugRegistrationCallback()),this._plugin.on("notification",this._debugNotificationCallback()),this._plugin.on("error",this._debugErrorCallback())))}},{key:"_callbackRegistration",value:function(){this.app.devPush?this._registered||(this._emitter.on("ionic_push:token",this._registerCallback()),this._emitter.on("ionic_push:notification",this._notificationCallback()),this._emitter.on("ionic_push:error",this._errorCallback())):(this._plugin.on("registration",this._registerCallback()),this._plugin.on("notification",this._notificationCallback()),this._plugin.on("error",this._errorCallback()))}},{key:"_processNotification",value:function(a){this._notification=a,this._emitter.emit("ionic_push:processNotification",a)}},{key:"_getPushPlugin",value:function(){var a=this,b=!1;try{b=window.PushNotification}catch(c){a.logger.info("something went wrong looking for the PushNotification plugin")}return a.app.devPush||b||!h.IonicPlatform.isIOSDevice()&&!h.IonicPlatform.isAndroidDevice()||a.logger.error("PushNotification plugin is required. Have you run `ionic plugin add phonegap-plugin-push` ?"),b}},{key:"onReady",value:function(a){var b=this;this._isReady?a(b):b._emitter.on("ionic_push:ready",function(){a(b)})}},{key:"token",set:function(a){var b=h.IonicPlatform.getStorage();a instanceof m.PushToken&&b.storeObject("ionic_io_push_token",{token:a.token}),this._token=a}}]),a}();c.Push=t},{"../core/app":11,"../core/core":12,"../core/events":15,"../core/logger":16,"../core/promise":17,"../core/request":18,"../core/settings":19,"./push-dev":27,"./push-message":28,"./push-token":29}]},{},[17,18,15,16,20,19,13,12,21,11,14,10,29,28,27,30,26,25,23,24,22,9,8,5,7,6]);