/*! For license information please see main~253ae210.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([["main~253ae210"],[,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"p",(function(){return u})),n.d(e,"i",(function(){return l})),n.d(e,"m",(function(){return c})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return f})),n.d(e,"j",(function(){return p})),n.d(e,"n",(function(){return d})),n.d(e,"a",(function(){return g})),n.d(e,"o",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"r",(function(){return m})),n.d(e,"s",(function(){return b})),n.d(e,"g",(function(){return x})),n.d(e,"f",(function(){return E}));n(36);var r="http://www.w3.org/2001/XMLSchema-instance";function i(t,e){return E().createElementNS(t,e)}function o(t,e){return function t(e,n,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)n?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var i=void 0;for(i=e.firstChild;i;i=i.nextSibling)t(i,n,r)}return r}(t,e,[]).join("")}function a(t){return"documentElement"in t}function s(t,e,n){return t.getAttributeNS(e,n)||""}function u(t){return(new DOMParser).parseFromString(t,"application/xml")}function l(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&r[r.length-1].push(i)}}function c(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&(r[r.length-1]=i)}}function h(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);if(void 0!==o){var a=i[i.length-1],s=void 0!==e?e:r.localName,u=void 0;s in a?u=a[s]:(u=[],a[s]=u),u.push(o)}}}function f(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);void 0!==o&&(i[i.length-1][void 0!==e?e:r.localName]=o)}}function p(t,e){return function(n,r,i){t.call(void 0!==e?e:this,n,r,i),i[i.length-1].node.appendChild(n)}}function d(t,e){var n=t;return function(t,r,o){var a=r[r.length-1].node,s=n;return void 0===s&&(s=o),i(void 0!==e?e:a.namespaceURI,s)}}var g=d();function y(t,e,n){var r,i,o=void 0!==n?n:{};for(r=0,i=t.length;ro&&(l|=i.a.RIGHT),ua&&(l|=i.a.ABOVE),l===i.a.UNKNOWN&&(l=i.a.INTERSECTING),l}function d(){return[1/0,1/0,-1/0,-1/0]}function g(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function y(t){return g(1/0,1/0,-1/0,-1/0,t)}function v(t,e){var n=t[0],r=t[1];return g(n,r,n,r,e)}function m(t,e,n,r,i){return x(y(i),t,e,n,r)}function _(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function b(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function w(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function x(t,e,n,r,i){for(;ne[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function F(t){return t[2]=s&&v<=l),r||!(a&i.a.RIGHT)||o&i.a.RIGHT||(r=(m=g-(d-l)*y)>=u&&m<=c),r||!(a&i.a.BELOW)||o&i.a.BELOW||(r=(v=d-(g-u)/y)>=s&&v<=l),r||!(a&i.a.LEFT)||o&i.a.LEFT||(r=(m=g-(d-s)*y)>=u&&m<=c)}return r}function q(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s=n[2])){var i=R(n),o=Math.floor((r[0]-n[0])/i)*i;t[0]-=o,t[2]-=o}return t}},,function(t,e,n){var r=n(336);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},,function(t,e,n){var r=n(412),i=n(413),o=n(338),a=n(414);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return i.a})),n.d(e,"l",(function(){return C})),n.d(e,"g",(function(){return N})),n.d(e,"h",(function(){return j})),n.d(e,"b",(function(){return P})),n.d(e,"c",(function(){return I})),n.d(e,"j",(function(){return A})),n.d(e,"i",(function(){return R})),n.d(e,"p",(function(){return T})),n.d(e,"q",(function(){return F})),n.d(e,"k",(function(){return z})),n.d(e,"m",(function(){return U})),n.d(e,"d",(function(){return V})),n.d(e,"n",(function(){return Y})),n.d(e,"e",(function(){return W})),n.d(e,"o",(function(){return X})),n.d(e,"f",(function(){return H}));var r,i=n(64),o=n(156),a=n(26),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=6378137*Math.PI,l=[-u,-u,u,u],c=[-180,-85,180,85],h=6378137*Math.log(Math.tan(Math.PI/2)),f=function(t){function e(e){return t.call(this,{code:e,units:i.b.METERS,extent:l,global:!0,worldExtent:c,getPointResolution:function(t,e){return t/Object(a.b)(e[1]/6378137)}})||this}return s(e,t),e}(o.a),p=[new f("EPSG:3857"),new f("EPSG:102100"),new f("EPSG:102113"),new f("EPSG:900913"),new f("http://www.opengis.net/def/crs/EPSG/0/3857"),new f("http://www.opengis.net/gml/srs/epsg.xml#3857")];function d(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var a=0;ah?s=h:s<-h&&(s=-h),o[a+1]=s}return o}function g(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var a=0;a1?(n=i,r=o):l>0&&(n+=a*l,r+=u*l)}return s(t,e,n,r)}function s(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function u(t){for(var e=t.length,n=0;ni&&(i=a,r=o)}if(0===i)return null;var s=t[r];t[r]=t[n],t[n]=s;for(var u=n+1;u=0;f--){h[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*h[f]}return h}function l(t){return 180*t/Math.PI}function c(t){return t*Math.PI/180}function h(t,e){var n=t%e;return n*e<0?n+e:n}function f(t,e,n){return t+n*(e-t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a}));var r=n(25);function i(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var a={target:t,type:e,listener:n};return t.addEventListener(e,n),a}function o(t,e,n,r){return i(t,e,n,r,!0)}function a(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Object(r.b)(t))}},function(t,e,n){"use strict";e.a={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i,o,a,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;(u=new Error(e.replace(/%s/g,(function(){return l[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){var r=n(428),i=n(429),o=n(338),a=n(430);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return f})),n.d(e,"f",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"i",(function(){return g})),n.d(e,"k",(function(){return y})),n.d(e,"l",(function(){return v})),n.d(e,"m",(function(){return m})),n.d(e,"j",(function(){return _})),n.d(e,"h",(function(){return b})),n.d(e,"a",(function(){return w})),n.d(e,"r",(function(){return M})),n.d(e,"p",(function(){return C})),n.d(e,"o",(function(){return j})),n.d(e,"q",(function(){return L})),n.d(e,"n",(function(){return P}));var r=n(86),i=n(140),o=n(81),a=n(25),s=n(59),u=n(66),l="10px sans-serif",c="#000",h="round",f=[],p=0,d="round",g=10,y="#000",v="center",m="middle",_=[0,0,0,0],b=1,w=new r.a;(new i.a).setSize=function(){console.warn("labelCache is deprecated.")};var x,O,E=null,S={},M=function(){var t,e,n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";function o(t,o,a){for(var s=!0,u=0;u2?n-2:0),i=2;i>1)],e))<0?s=r+1:(u=r,l=!o);return l?s:~s}function i(t,e){return t>e?1:t=0}function a(t,e,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i0?i-1:i:t[i-1]-e0||n&&0===o)}))}n.d(e,"a",(function(){return r})),n.d(e,"g",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"h",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"b",(function(){return l})),n.d(e,"e",(function(){return c}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u}));var r=n(82),i=n(0),o=(n(170),n(220),n(221)),a=(n(291),n(102),n(212),n(113),function(t,e){var n=arguments;if(null==e||!r.f.call(e,"css"))return i.createElement.apply(void 0,n);var o=n.length,a=new Array(o);a[0]=r.b,a[1]=Object(r.e)(t,e);for(var s=2;s0){o[u]={_content_:o[u]};for(var c=0;c=1?(n=c,r=h):(n=u+d*f,r=l+d*p),[n,r]}function l(t,e,n){var r=Object(i.e)(e+180,360)-180,a=Math.abs(3600*r),s=n||0,u=Math.pow(10,s),l=Math.floor(a/3600),c=Math.floor((a-3600*l)/60),h=a-3600*l-60*c;return(h=Math.ceil(h*u)/u)>=60&&(h=0,c+=1),c>=60&&(c=0,l+=1),l+"° "+Object(o.b)(c,2)+"′ "+Object(o.b)(h,2,s)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function c(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function h(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function f(t,e){return t[0]*=e,t[1]*=e,t}function p(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function d(t,e){return Math.sqrt(p(t,e))}function g(t,e){return p(t,u(t,e))}function y(t,e){return t?l("NS",t[1],e)+" "+l("EW",t[0],e):""}function v(t,e){if(e.canWrapX()){var n=Object(r.D)(e.getExtent()),i=m(t,e,n);i&&(t[0]-=i*n)}return t}function m(t,e,n){var i=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]i[2])){var a=n||Object(r.D)(i);o=Math.floor((t[0]-i[0])/a)}return o}},,function(t,e,n){var r=n(336);function i(t,e){for(var n=0;n=4;++r,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},d=n(259),g=n(260),y=/[A-Z]|^ms/g,v=/_EMO_([^_]+?)_([^]*?)_EMO_/g,m=function(t){return 45===t.charCodeAt(1)},_=function(t){return null!=t&&"boolean"!=typeof t},b=Object(g.a)((function(t){return m(t)?t:t.replace(y,"-$&").toLowerCase()})),w=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(v,(function(t,e,n){return O={name:e,styles:n,next:O},e}))}return 1===d.a[t]||m(t)||"number"!=typeof e||0===e?e:e+"px"};function x(t,e,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return O={name:n.name,styles:n.styles,next:O},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)O={name:i.name,styles:i.styles,next:O},i=i.next;return n.styles+";"}return function(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i0&&t[1]>0}function o(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function a(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return f}));var r=n(123),i=n(108),o=n(16),a=n(70),s=n(32),u=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=p,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=p,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();function l(t){var e;if("function"==typeof t)e=t;else{var n;if(Array.isArray(t))n=t;else Object(s.a)("function"==typeof t.getZIndex,41),n=[t];e=function(){return n}}return e}var c=null;function h(t,e){if(!c){var n=new i.a({color:"rgba(255,255,255,0.4)"}),o=new a.a({color:"#3399CC",width:1.25});c=[new u({image:new r.a({fill:n,stroke:o,radius:5}),fill:n,stroke:o})]}return c}function f(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t[o.a.POLYGON]=[new u({fill:new i.a({color:[255,255,255,.5]})})],t[o.a.MULTI_POLYGON]=t[o.a.POLYGON],t[o.a.LINE_STRING]=[new u({stroke:new a.a({color:e,width:5})}),new u({stroke:new a.a({color:n,width:3})})],t[o.a.MULTI_LINE_STRING]=t[o.a.LINE_STRING],t[o.a.CIRCLE]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING]),t[o.a.POINT]=[new u({image:new r.a({radius:6,fill:new i.a({color:n}),stroke:new a.a({color:e,width:1.5})}),zIndex:1/0})],t[o.a.MULTI_POINT]=t[o.a.POINT],t[o.a.GEOMETRY_COLLECTION]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING],t[o.a.POINT]),t}function p(t){return t.getGeometry()}e.c=u},function(t,e,n){"use strict";var r=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();e.a=r},,function(t,e,n){"use strict";e.a={ANIMATING:0,INTERACTING:1}},function(t,e,n){"use strict";var r=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();e.a=r},function(t,e,n){"use strict";n.d(e,"c",(function(){return O})),n.d(e,"b",(function(){return E})),n.d(e,"d",(function(){return S}));var r,i=n(55),o=n(16),a=n(233),s=n(120),u=n(96),l=n(122),c=n(8),h=n(114),f=n(36),p=n(267),d=n(84),g=n(177),y=n(186),v=n(205),m=n(143),_=n(26),b=n(141),w=(n(227),r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t){function e(e,n,r){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==n&&r?(i.setFlatCoordinates(n,e),i.ends_=r):i.setCoordinates(e,n),i}return w(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?Object(f.c)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e0}}else if(t.type==o.a.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==o.a.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===o.a.POINTERDOWN||e===o.a.POINTERDRAG||e===o.a.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==o.a.POINTERUP?delete this.trackedPointers_[n]:(t.type==o.a.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=Object(a.c)(this.trackedPointers_)}},e}(i.a);function l(t){for(var e=t.length,n=0,r=0,i=0;i=200&&s.status<300){var r=e.getType(),u=void 0;r==b.a.JSON||r==b.a.TEXT?u=s.responseText:r==b.a.XML?(u=s.responseXML)||(u=(new DOMParser).parseFromString(s.responseText,"application/xml")):r==b.a.ARRAY_BUFFER&&(u=s.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):a()}else a()},s.onerror=a,s.send()}(t,e,n,r,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||f.c)}}var O,E=(O=function(t,e){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return E(e,t),e}(o.a),M=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,projection:void 0,state:c.a.READY,wrapX:void 0===i.wrapX||i.wrapX})||this).on,n.once,n.un,n.loader_=f.c,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(Object(d.a)(n.format_,7),n.loader_=x(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:p.a;var o,a,s=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=s?new u.a:null,n.loadedExtentsRtree_=new u.a,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?a=i.features:i.features&&(a=(o=i.features).getArray()),s||void 0!==o||(o=new r.a(a)),void 0!==a&&n.addFeaturesInternal(a),void 0!==o&&n.bindFeaturesCollection_(o),n}return E(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Object(v.c)(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new S(h.a.ADDFEATURE,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Object(_.a)(e,a.a.CHANGE,this.handleFeatureChange_,this),Object(_.a)(e,s.a.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(Object(d.a)(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,(function(n){if(Object(g.o)(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){var e=Object(v.c)(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=Object(v.c)(t);this.featureChangeKeys_[e].forEach(_.c),delete this.featureChangeKeys_[e];var n=t.getId();void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new S(h.a.REMOVEFEATURE,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Object(d.a)(this.format_,7),this.url_=t,this.setLoader(x(t,this.format_))},e}(l.a);e.a=M},function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=void 0!==i?i:[],a=0,s=e;sn||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"f",(function(){return u}))},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=.5,i=!0},function(t,e){function n(){return t.exports=n=Object.assign?Object.assign.bind():function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,t),this.init(e,n)}return Object(a.a)(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||h,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),r=1;r-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}for(var o="string"!=typeof e?[].concat(e):e.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!t[a]&&n&&(t[a]=new n),t=Object.prototype.hasOwnProperty.call(t,a)?t[a]:{}}return i()?{}:{obj:t,k:r(o.shift())}}function m(t,e,n){var r=v(t,e,Object);r.obj[r.k]=n}function _(t,e){var n=v(t,e),r=n.obj,i=n.k;if(r)return r[i]}function b(t,e,n){var r=_(t,n);return void 0!==r?r:_(e,n)}function w(t,e,n){for(var r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):w(t[r],e[r],n):t[r]=e[r]);return t}function x(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var O={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function E(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return O[t]})):t}var S="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,M=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Object(o.a)(this,e),n=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(n)),n.data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return Object(c.a)(e,t),Object(a.a)(e,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[t,e];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(o=t.split(".")),_(this.data,o)}},{key:"addResource",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[t,e];n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(r=e,e=(a=t.split("."))[1]),this.addNamespaces(e),m(this.data,a,r),i.silent||this.emit("added",t,e,n,r)}},{key:"addResources",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(t,e,i,n[i],{silent:!0});r.silent||this.emit("added",t,e,n)}},{key:"addResourceBundle",value:function(t,e,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[t,e];t.indexOf(".")>-1&&(r=n,n=e,e=(s=t.split("."))[1]),this.addNamespaces(e);var u=_(this.data,s)||{};r?w(u,n,o):u=Object(i.a)({},u,n),m(this.data,s,u),a.silent||this.emit("added",t,e,n)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Object(i.a)({},{},this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"toJSON",value:function(){return this.data}}]),e}(p),C={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,i){var o=this;return t.forEach((function(t){o.processors[t]&&(e=o.processors[t].process(e,n,r,i))})),e}},k={},N=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,e),n=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(n)),y(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,Object(l.a)(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=f.create("translator"),n}return Object(c.a)(e,t),Object(a.a)(e,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(t,e);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,e){var n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,i=e.ns||this.options.defaultNS;if(n&&t.indexOf(n)>-1){var o=t.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:t,namespaces:i};var a=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),t=a.join(r)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}},{key:"translate",value:function(t,n,o){var a=this;if("object"!==Object(r.a)(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(t[t.length-1],n),l=u.key,c=u.namespaces,h=c[c.length-1],f=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(p){var d=n.nsSeparator||this.options.nsSeparator;return h+d+l}return l}var g=this.resolve(t,n),y=g&&g.res,v=g&&g.usedKey||l,m=g&&g.exactUsedKey||l,_=Object.prototype.toString.apply(y),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O="string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y;if(x&&y&&O&&b.indexOf(_)<0&&("string"!=typeof w||"[object Array]"!==_)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,n):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(s){var E="[object Array]"===_,S=E?[]:{},M=E?m:v;for(var C in y)if(Object.prototype.hasOwnProperty.call(y,C)){var k="".concat(M).concat(s).concat(C);S[C]=this.translate(k,Object(i.a)({},n,{joinArrays:!1,ns:c})),S[C]===k&&(S[C]=y[C])}y=S}}else if(x&&"string"==typeof w&&"[object Array]"===_)(y=y.join(w))&&(y=this.extendTranslation(y,t,n,o));else{var N=!1,j=!1,L=void 0!==n.count&&"string"!=typeof n.count,P=e.hasDefaultValue(n),I=L?this.pluralResolver.getSuffix(f,n.count):"",A=n["defaultValue".concat(I)]||n.defaultValue;!this.isValidLookup(y)&&P&&(N=!0,y=A),this.isValidLookup(y)||(j=!0,y=l);var R=P&&A!==y&&this.options.updateMissing;if(j||N||R){if(this.logger.log(R?"updateKey":"missingKey",f,h,l,R?A:y),s){var T=this.resolve(l,Object(i.a)({},n,{keySeparator:!1}));T&&T.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&D&&D[0])for(var B=0;B1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!a.isValidLookup(e)){var u=a.extractFromKey(t,s),l=u.key;n=l;var c=u.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var h=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach((function(t){a.isValidLookup(e)||(o=t,!k["".concat(p[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(k["".concat(p[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(e)){i=n;var o,u,c=l,p=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(p,l,n,t,s);else h&&(o=a.pluralResolver.getSuffix(n,s.count)),h&&f&&p.push(c+o),f&&p.push(c+="".concat(a.options.contextSeparator).concat(s.context)),h&&p.push(c+=o);for(;u=p.pop();)a.isValidLookup(e)||(r=u,e=a.getResource(n,t,u,s))}})))}))}})),{res:e,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}}],[{key:"hasDefaultValue",value:function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,"defaultValue".length)&&void 0!==t[e])return!0;return!1}}]),e}(p);function j(t){return t.charAt(0).toUpperCase()+t.slice(1)}var L=function(){function t(e){Object(o.a)(this,t),this.options=e,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=f.create("languageUtils")}return Object(a.a)(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=j(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=j(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=j(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,n=this;return t?(t.forEach((function(t){if(!e){var r=n.formatLanguageCode(t);n.options.supportedLngs&&!n.isSupportedCode(r)||(e=r)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var r=n.getLanguagePartFromCode(t);if(n.isSupportedCode(r))return e=r;e=n.options.supportedLngs.find((function(t){if(0===t.indexOf(r))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,e){var n=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),i=[],o=function(t){t&&(n.isSupportedCode(t)?i.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),r.forEach((function(t){i.indexOf(t)<0&&o(n.formatLanguageCode(t))})),i}}]),t}(),P=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],I={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};function A(){var t={};return P.forEach((function(e){e.lngs.forEach((function(n){t[n]={numbers:e.nr,plurals:I[e.fc]}}))})),t}var R=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,t),this.languageUtils=e,this.options=n,this.logger=f.create("pluralResolver"),this.rules=A()}return Object(a.a)(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=this.getRule(t);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){return this.getSuffixes(t).map((function(t){return e+t}))}},{key:"getSuffixes",value:function(t){var e=this,n=this.getRule(t);return n?n.numbers.map((function(n){return e.getSuffix(t,n)})):[]}},{key:"getSuffix",value:function(t,e){var n=this,r=this.getRule(t);if(r){var i=r.noAbs?r.plurals(e):r.plurals(Math.abs(e)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),t}(),T=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(o.a)(this,t),this.logger=f.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return Object(a.a)(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:E,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?x(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?x(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?x(e.nestingPrefix):e.nestingPrefixEscaped||x("$t("),this.nestingSuffix=e.nestingSuffix?x(e.nestingSuffix):e.nestingSuffixEscaped||x(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,e,n,r){var i,o,a,s=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(t){return t.replace(/\$/g,"$$$$")}var c=function(t){if(t.indexOf(s.formatSeparator)<0){var i=b(e,u,t);return s.alwaysFormat?s.format(i,void 0,n):i}var o=t.split(s.formatSeparator),a=o.shift().trim(),l=o.join(s.formatSeparator).trim();return s.format(b(e,u,a),l,n,r)};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return l(t)}},{regex:this.regexp,safeValue:function(t){return s.escapeValue?l(s.escape(t)):l(t)}}].forEach((function(e){for(a=0;i=e.regex.exec(t);){if(void 0===(o=c(i[1].trim())))if("function"==typeof h){var n=h(t,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(t)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=g(o));if(t=t.replace(i[0],e.safeValue(o)),e.regex.lastIndex=0,++a>=s.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var n,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Object(i.a)({},a);function u(t,e){var n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;var r=t.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);t=r[0],o=(o=this.interpolate(o,s)).replace(/'/g,'"');try{s=JSON.parse(o),e&&(s=Object(i.a)({},e,s))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(n).concat(o)}return delete s.defaultValue,t}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(t);){var l=[],c=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(t){return t.trim()}));n[1]=h.shift(),l=h,c=!0}if((r=e(u.call(this,n[1].trim(),s),s))&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=g(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),r=""),c&&(r=l.reduce((function(t,e){return o.format(t,e,a.lng,a)}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}]),t}();var F=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Object(o.a)(this,e),i=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(i)),i.backend=t,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=a,i.logger=f.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,a.backend,a),i}return Object(c.a)(e,t),Object(a.a)(e,[{key:"queueLoad",value:function(t,e,n,r){var i=this,o=[],a=[],s=[],u=[];return t.forEach((function(t){var r=!0;e.forEach((function(e){var s="".concat(t,"|").concat(e);!n.reload&&i.store.hasResourceBundle(t,e)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),o.indexOf(s)<0&&o.push(s),u.indexOf(e)<0&&u.push(e)))})),r||s.push(t)})),(o.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:o,pending:a,toLoadLanguages:s,toLoadNamespaces:u}}},{key:"loaded",value:function(t,e,n){var r=t.split("|"),i=r[0],o=r[1];e&&this.emit("failedLoading",i,o,e),n&&this.store.addResourceBundle(i,o,n),this.state[t]=e?-1:2;var a={};this.queue.forEach((function(n){var r,s,u,l,c,h;r=n.loaded,s=o,l=v(r,[i],Object),c=l.obj,h=l.k,c[h]=c[h]||[],u&&(c[h]=c[h].concat(s)),u||c[h].push(s),function(t,e){for(var n=t.indexOf(e);-1!==n;)t.splice(n,1),n=t.indexOf(e)}(n.pending,t),e&&n.errors.push(e),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(t){a[t]||(a[t]=[]),n.loaded[t].length&&n.loaded[t].forEach((function(e){a[t].indexOf(e)<0&&a[t].push(e)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[n](t,e,(function(s,u){s&&u&&i<5?setTimeout((function(){r.read.call(r,t,e,n,i+1,2*o,a)}),o):a(s,u)})):a(null,{})}},{key:"prepareLoading",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var o=this.queueLoad(t,e,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(t){n.loadOne(t)}))}},{key:"load",value:function(t,e,n){this.prepareLoading(t,e,{},n)}},{key:"reload",value:function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}},{key:"loadOne",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,a){r&&e.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&a&&e.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),a),e.loaded(t,r,a)}))}},{key:"saveMissing",value:function(t,e,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,e,n,r,null,Object(i.a)({},a,{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],e,n,r))}}]),e}(p);function D(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===Object(r.a)(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===Object(r.a)(t[2])||"object"===Object(r.a)(t[3])){var n=t[3]||t[2];Object.keys(n).forEach((function(t){e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,n,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function B(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&(t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t.supportedLngs=t.whitelist),t.nonExplicitWhitelist&&(t.nonExplicitSupportedLngs=t.nonExplicitWhitelist),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function G(){}var q=new(function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(Object(o.a)(this,e),t=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(t)),t.options=B(n),t.services={},t.logger=f,t.modules={external:[]},r&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,r),Object(s.a)(t,Object(l.a)(t));setTimeout((function(){t.init(n,r)}),0)}return t}return Object(c.a)(e,t),Object(a.a)(e,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof e&&(n=e,e={}),e.whitelist&&!e.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),e.nonExplicitWhitelist&&!e.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=Object(i.a)({},D(),this.options,B(e)),this.format=this.options.interpolation.format,n||(n=G),!this.options.isClone){this.modules.logger?f.init(r(this.modules.logger),this.options):f.init(null,this.options);var o=new L(this.options);this.store=new M(this.options.resources,this.options);var a=this.services;a.logger=f,a.resourceStore=this.store,a.languageUtils=o,a.pluralResolver=new R(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new T(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new F(r(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}}));var l=["addResource","addResources","addResourceBundle","removeResourceBundle"];l.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var c=d(),h=function(){var e=function(e,r){t.isInitialized&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),c.resolve(r),n(e,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return e(null,t.t.bind(t));t.changeLanguage(t.options.lng,e)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),c}},{key:"loadResources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,r=n,i="string"==typeof t?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],a=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){o.indexOf(t)<0&&o.push(t)}))};if(i)a(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(t){return a(t)}))}this.options.preload&&this.options.preload.forEach((function(t){return a(t)})),this.services.backendConnector.load(o,this.options.ns,r)}else r(null)}},{key:"reloadResources",value:function(t,e,n){var r=d();return t||(t=this.languages),e||(e=this.options.ns),n||(n=G),this.services.backendConnector.reload(t,e,(function(t){r.resolve(),n(t)})),r}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&C.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function(t,e){var n=this;this.isLanguageChangingTo=t;var r=d();this.emit("languageChanging",t);var i=function(t){var i="string"==typeof t?t:n.services.languageUtils.getBestMatchFromCodes(t);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(t){!function(t,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),e&&e(t,(function(){return n.t.apply(n,arguments)}))}(t,i)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(t):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,e){var n=this,o=function t(e,o){var a;if("object"!==Object(r.a)(o)){for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(t,n){var r=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,t)||(!this.services.backendConnector.backend||!(!a(r,t)||i&&!a(o,t)))}},{key:"loadNamespaces",value:function(t,e){var n=this,r=d();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources((function(t){r.resolve(),e&&e(t)})),r):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var n=d();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],i=t.filter((function(t){return r.indexOf(t)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){if(t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),!t)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new e(t,n)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,o=Object(i.a)({},this.options,n,{isClone:!0}),a=new e(o),s=["store","services","language"];return s.forEach((function(e){a[e]=t[e]})),a.services=Object(i.a)({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new N(a.services,a.options),a.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1)u=n;else{if(p>0){for(var d=0;do&&(o=c),a=u,s=l}return o}function a(t,e,n,r,i){for(var a=0,s=n.length;ap&&(p=f=(p+f)/2),d>g&&(g=d=(g+d)/2);var v=Object(y.a)(r[0],f,p),m=Object(y.a)(r[1],d,g),_=30*i;return a&&n&&(v+=-_*Math.log(1+Math.max(0,f-r[0])/_)+_*Math.log(1+Math.max(0,r[0]-p)/_),m+=-_*Math.log(1+Math.max(0,d-r[1])/_)+_*Math.log(1+Math.max(0,r[1]-g)/_)),[v,m]}}}function m(t){return t}var _=n(8),b=n(36);function w(t,e,n,r){var i=Object(_.D)(e)/n[0],o=Object(_.z)(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function x(t,e,n){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/t-1))/50+1),Object(y.a)(r,n/2,2*e)}function O(t,e,n,r,i){return function(o,a,s,u){if(void 0!==o){var l=r?w(t,r,s,i):t;return(void 0===n||n)&&u?x(o,l,e):Object(y.a)(o,e,l)}}}var E,S=n(161),M=n(104),C=n(74),k=(E=function(t,e){return(E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}E(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),N=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(g.a)({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=Object(h.b)(r.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.nextCenter_=null,n.nextResolution_,n.nextRotation_,n.cancelAnchor_=void 0,r.center&&(r.center=Object(h.d)(r.center,n.projection_)),r.extent&&(r.extent=Object(h.e)(r.extent,n.projection_)),n.applyOptions_(r),n}return k(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,n,r,i=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,u=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,f=void 0!==t.showFullExtent&&t.showFullExtent,p=Object(h.b)(t.projection,"EPSG:3857"),d=p.getExtent(),g=t.constrainOnlyCenter,v=t.extent;u||v||!p.isGlobal()||(g=!1,v=d);if(void 0!==t.resolutions){var m=t.resolutions;n=m[i],r=void 0!==m[a]?m[a]:m[m.length-1],e=t.constrainResolution?function(t,e,n,r){return function(i,o,a,s){if(void 0!==i){var u=t[0],l=t[t.length-1],c=n?w(u,n,a,r):u;if(s)return void 0===e||e?x(i,c,l):Object(y.a)(i,l,c);var h=Math.min(c,i),f=Math.floor(Object(b.f)(t,h,o));return t[f]>c&&f1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n);for(var r=0;r0},e.prototype.getInteracting=function(){return this.hints_[a.a.INTERACTING]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(a.a.ANIMATING,-this.hints_[a.a.ANIMATING]);for(var e=0,n=this.animations_.length;e=0;--n){for(var r=this.animations_[n],i=!0,o=0,s=r.length;o0?l/u.duration:1;c>=1?(u.complete=!0,c=1):i=!1;var h=u.easing(c);if(u.sourceCenter){var f=u.sourceCenter[0],p=u.sourceCenter[1],d=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var v=f+h*(d-f),m=p+h*(g-p);this.targetCenter_=[v,m]}if(u.sourceResolution&&u.targetResolution){var _=1===h?u.targetResolution:u.sourceResolution+h*(u.targetResolution-u.sourceResolution);if(u.anchor){var b=this.getViewportSize_(this.getRotation()),w=this.constraints_.resolution(_,0,b,!0);this.targetCenter_=this.calculateCenterZoom(w,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==u.sourceRotation&&void 0!==u.targetRotation){var x=1===h?Object(y.e)(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+h*(u.targetRotation-u.sourceRotation);if(u.anchor){var O=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(O,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!u.complete)break}}if(i){this.animations_[n]=null,this.setHint(a.a.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var E=r[0].callback;E&&j(E,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var n,r=this.getCenterInternal();return void 0!==r&&(n=[r[0]-e[0],r[1]-e[1]],Object(p.g)(n,t-this.getRotation()),Object(p.a)(n,e)),n},e.prototype.calculateCenterZoom=function(t,e){var n,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(n=[e[0]-t*(e[0]-r[0])/i,e[1]-t*(e[1]-r[1])/i]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],r=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Object(h.m)(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(s)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return Object(h.n)(e,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();Object(d.a)(n,1);var r=this.getResolution();Object(d.a)(void 0!==r,2);var i=this.getRotation();return Object(d.a)(void 0!==i,3),Object(_.y)(n,r,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(u)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Object(h.e)(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),r=Object(_.D)(t)/n[0],i=Object(_.z)(t)/n[1];return Math.max(r,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/Math.log(e);return function(t){return n/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(l)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/e;return function(t){return Math.log(n/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=P(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,n)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,n,r=this.minZoom_||0;if(this.resolutions_){var i=Object(b.f)(this.resolutions_,t,1);r=i,e=this.resolutions_[i],n=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,n=this.zoomFactor_;return r+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Object(y.a)(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Object(y.a)(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(Object(d.a)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){Object(d.a)(!Object(_.G)(t),25);var r=Object(h.e)(t,this.getProjection());n=Object(C.c)(r)}else if(t.getType()===i.a.CIRCLE){r=Object(h.e)(t.getExtent(),this.getProjection());(n=Object(C.c)(r)).rotate(this.getRotation(),Object(_.w)(r))}else{var o=Object(h.k)();n=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),r=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),a=1/0,s=1/0,u=-1/0,l=-1/0,c=0,h=i.length;c=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}e.a=p},function(t,e,n){"use strict";function r(t,e,n){var r=void 0!==n?t.toFixed(n):""+t,i=r.indexOf(".");return(i=-1===i?r.length:i)>e?r:new Array(1+e-i).join("0")+r}function i(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;ia)return 1;if(a>o)return-1}return 0}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";var r,i=n(286),o=n(182),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=e||{},r=void 0!==n.projection?n.projection:"EPSG:3857",i=void 0!==n.tileGrid?n.tileGrid:Object(o.a)({extent:Object(o.b)(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,opaque:n.opaque,projection:r,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this}return a(e,t),e}(i.a);e.a=s},function(t,e,n){var r=n(388);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var r=n.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=a.c,++this.pendingRemovals_[t]):(n.splice(r,1),0===n.length&&delete this.listeners_[t]))}},e}(i.a);e.a=l},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return l}));var r=n(26);function i(t,e,n,i,o,a,s){var u=(n-e)/i;if(u<3){for(;e0;){for(var f=c.pop(),p=c.pop(),d=0,g=t[p],y=t[p+1],v=t[f],m=t[f+1],_=p+i;_d&&(h=_,d=x)}d>o&&(l[(h-e)/i]=1,p+i0&&y>d)&&(g<0&&v0&&v>g)?(u=f,l=p):(o[s++]=u,o[s++]=l,c=u,h=l,u=f,l=p)}}return o[s++]=u,o[s++]=l,s}function u(t,e,n,r,i,o,a,u){for(var l=0,c=n.length;lo&&(l-s)*(o-u)-(i-s)*(c-u)>0&&a++:c<=o&&(l-s)*(o-u)-(i-s)*(c-u)<0&&a--,s=l,u=c}return 0!==a}function a(t,e,n,r,i,a){if(0===n.length)return!1;if(!o(t,e,n[0],r,i,a))return!1;for(var s=1,u=n.length;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function p(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var d=6371008.8,g={centimeters:100*d,centimetres:100*d,degrees:360/(2*Math.PI),feet:3.28084*d,inches:39.37*d,kilometers:d/1e3,kilometres:d/1e3,meters:d,metres:d,miles:d/1609.344,millimeters:1e3*d,millimetres:1e3*d,nauticalmiles:d/1852,radians:1,yards:1.0936*d},y={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function v(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function m(t,e){switch(t){case"Point":return _(e).geometry;case"LineString":return O(e).geometry;case"Polygon":return w(e).geometry;case"MultiPoint":return C(e).geometry;case"MultiLineString":return M(e).geometry;case"MultiPolygon":return k(e).geometry;default:throw new Error(t+" is invalid")}}function _(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!G(t[0])||!G(t[1]))throw new Error("coordinates must contain numbers");return v({type:"Point",coordinates:t},e,n)}function b(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return S(t.map((function(t){return _(t,e)})),n)}function w(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=f(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};return S(t.map((function(t){return w(t,e)})),n)}function O(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return v({type:"LineString",coordinates:t},e,n)}function E(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return S(t.map((function(t){return O(t,e)})),n)}function S(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function M(t,e){return v({type:"MultiLineString",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function C(t,e){return v({type:"MultiPoint",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function k(t,e){return v({type:"MultiPolygon",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function N(t,e){return v({type:"GeometryCollection",geometries:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function j(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function L(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=g[e];if(!n)throw new Error(e+" units is invalid");return t*n}function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=g[e];if(!n)throw new Error(e+" units is invalid");return t/n}function I(t,e){return T(P(t,e))}function A(t){var e=t%360;return e<0&&(e+=360),e}function R(t){return(t%=360)>0?t>180?t-360:t:t<-180?t+360:t}function T(t){return t%(2*Math.PI)*180/Math.PI}function F(t){return t%360*Math.PI/180}function D(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("length must be a positive number");return L(P(t,e),n)}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("area must be a positive number");var r=y[e];if(!r)throw new Error("invalid original units");var i=y[n];if(!i)throw new Error("invalid final units");return t/r*i}function G(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function q(t){return null!==t&&"object"===r(t)&&!Array.isArray(t)}function z(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!G(t))throw new Error("bbox must only contain numbers")}))}function U(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(r(t)))throw new Error("id must be a number or a string")}var V=Object.freeze({__proto__:null,areaFactors:y,azimuthToBearing:R,bearingToAzimuth:A,convertArea:B,convertLength:D,degreesToRadians:F,earthRadius:d,factors:g,feature:v,featureCollection:S,geometry:m,geometryCollection:N,isNumber:G,isObject:q,lengthToDegrees:I,lengthToRadians:P,lineString:O,lineStrings:E,multiLineString:M,multiPoint:C,multiPolygon:k,point:_,points:b,polygon:w,polygons:x,radiansToDegrees:T,radiansToLength:L,round:j,validateBBox:z,validateId:U});function Y(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return l(t.geometry.coordinates);if("Point"===t.type)return l(t.coordinates)}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return l(t);throw new Error("coord must be GeoJSON Point or an Array of numbers")}function W(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function X(t){if(t.length>1&&G(t[0])&&G(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return X(t[0]);throw new Error("coordinates must only contain numbers")}function H(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function Z(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function K(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");var r,i=f(t.features);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type)}}catch(t){i.e(t)}finally{i.f()}}function J(t){return"Feature"===t.type?t.geometry:t}function Q(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}var $=Object.freeze({__proto__:null,collectionOf:K,containsNumber:X,featureOf:Z,geojsonType:H,getCoord:Y,getCoords:W,getGeom:J,getType:Q});function tt(t,e){if(!0===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final)return function(t,e){var n=tt(e,t);return(n+180)%360}(t,e);var n=Y(t),r=Y(e),i=F(n[0]),o=F(r[0]),a=F(n[1]),s=F(r[1]),u=Math.sin(o-i)*Math.cos(s),l=Math.cos(a)*Math.sin(s)-Math.sin(a)*Math.cos(s)*Math.cos(o-i);return T(Math.atan2(u,l))}function et(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Y(t),o=F(i[0]),a=F(i[1]),s=F(n),u=P(e,r.units),l=Math.asin(Math.sin(a)*Math.cos(u)+Math.cos(a)*Math.sin(u)*Math.cos(s));return _([T(o+Math.atan2(Math.sin(s)*Math.sin(u)*Math.cos(a),Math.cos(u)-Math.sin(a)*Math.sin(l))),T(l)],r.properties)}function nt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Y(t),i=Y(e),o=F(i[1]-r[1]),a=F(i[0]-r[0]),s=F(r[1]),u=F(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(u);return L(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)}function rt(t,e){var n;return(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final?it(Y(e),Y(t)):it(Y(t),Y(e)))>180?-(360-n):n}function it(t,e){var n=F(t[1]),r=F(e[1]),i=F(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(T(Math.atan2(i,o))+360)%360}function ot(t,e,n){if(null!==t)for(var r,i,o,a,s,u,l,c,h=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;vs||f>u||p>l)return a=o,s=n,u=f,l=p,void(i=0);var d=O([a,o],t.properties);if(!1===e(d,n,r,p,i))return!1;i++,a=o}))&&void 0}}}))}function vt(t,e,n){var r=n,i=!1;return yt(t,(function(t,o,a,s,u){r=!1===i&&void 0===n?t:e(r,t,o,a,s,u),i=!0})),r}function mt(t,e){if(!t)throw new Error("geojson is required");dt(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var a=0;a0){e+=Math.abs(Mt(t[0]));for(var n=1;n=e?(r+2)%e:r+2],s=i[0]*St,u=o[1]*St;n+=(a[0]*St-s)*Math.sin(u),r++}return 20294876564838.72*n}function Ct(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t.bbox&&!0!==e.recompute)return t.bbox;var n=[1/0,1/0,-1/0,-1/0];return ot(t,(function(t){n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]e[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function Lt(t,e){var n,r=[],i=f(t);try{for(i.s();!(n=i.n()).done;){var o=kt(n.value,e);o.length>0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&r.push(o))}}catch(t){i.e(t)}finally{i.f()}return r}function Pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[n,r];return w([[a,[i,r],[i,o],[n,o],a]],e.properties,{bbox:t,id:e.id})}var It=function(){function t(e){i(this,t),this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var n=0;nt&&(e.push(r),n=i)}return e}},{key:"vector",value:function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}}},{key:"pos",value:function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}]),t}();function At(t){for(var e,n,r=W(t),i=0,o=1;o0}function Rt(t,e){for(var n=0,r=0,i=0,o=0,a=0,s=0,u=0,l=0,c=null,h=null,f=t[0],p=t[1],d=e.length;n0&&l>0)s=l,a=(c=h)[0]-f;else{if(u=h[0]-t[0],l>0&&s<=0){if((o=a*l-u*s)>0)i+=1;else if(0===o)return 0}else if(s>0&&l<=0){if((o=a*l-u*s)<0)i+=1;else if(0===o)return 0}else if(0===l&&s<0){if(0==(o=a*l-u*s))return 0}else if(0===s&&l<0){if(0==(o=a*l-u*s))return 0}else if(0===s&&0===l){if(u<=0&&a>=0)return 0;if(a<=0&&u>=0)return 0}c=h,s=l,a=u}}return i%2!=0}function Tt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=Y(t),i=J(e),o=i.type,a=e.bbox,s=i.coordinates;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,a))return!1;"Polygon"===o&&(s=[s]);for(var u=!1,l=0;l2&&void 0!==arguments[2]?arguments[2]:{},r=Y(t),i=W(e),o=0;oi)return!1}else if(0!==p)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(f)?h>0?s0?u=Math.abs(f)?h>0?s<=o&&o0?u<=a&&a=Math.abs(f)?h>0?s0?u=Math.abs(f)?h>0?s<=o&&o<=l:l<=o&&o<=s:f>0?u<=a&&a<=c:c<=a&&a<=u}function Bt(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;if(!Gt(Ct(t),Ct(e)))return!1;var n,r=f(J(e).coordinates);try{for(r.s();!(n=r.n()).done;){var i,o=f(n.value);try{for(o.s();!(i=o.n()).done;)if(!Tt(i.value,t))return!1}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}return!0}function Gt(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3]0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vt;if(i(this,t),this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}return a(t,[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}},{key:"_down",value:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}}]),t}();function Vt(t,e){return te?1:0}function Yt(t,e){return t.p.x>e.p.x?1:t.p.xe.p.y?1:-1:1}function Wt(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x0?(c.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,c.isLeftEndpoint=!1),e.push(l),e.push(c),a=s,Kt+=1}}Ht+=1}var Qt=a((function t(e){i(this,t),this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}));function $t(t,e){if(null===t||null===e)return!1;if(t.leftSweepEvent.ringId===e.leftSweepEvent.ringId&&(t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.rightSweepEvent)||t.leftSweepEvent.isSamePoint(e.leftSweepEvent)||t.leftSweepEvent.isSamePoint(e.rightSweepEvent)))return!1;var n=t.leftSweepEvent.p.x,r=t.leftSweepEvent.p.y,i=t.rightSweepEvent.p.x,o=t.rightSweepEvent.p.y,a=e.leftSweepEvent.p.x,s=e.leftSweepEvent.p.y,u=e.rightSweepEvent.p.x,l=e.rightSweepEvent.p.y,c=(l-s)*(i-n)-(u-a)*(o-r);if(0===c)return!1;var h=((u-a)*(r-s)-(l-s)*(n-a))/c,f=((i-n)*(r-s)-(o-r)*(n-a))/c;return h>=0&&h<=1&&f>=0&&f<=1&&[n+h*(i-n),r+h*(o-r)]}var te=function(t,e){var n=new Ut([],Yt);return function(t,e){if("FeatureCollection"===t.type)for(var n=t.features,r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=n.removeDuplicates,i=void 0===r||r,o=n.ignoreSelfIntersections,a=void 0!==o&&o,s=[];"FeatureCollection"===t.type?s=s.concat(t.features):"Feature"===t.type?s.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||s.push(v(t)),"FeatureCollection"===e.type?s=s.concat(e.features):"Feature"===e.type?s.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||s.push(v(e));var u=te(S(s),a),l=[];if(i){var c={};u.forEach((function(t){var e=t.join(",");c[e]||(c[e]=!0,l.push(t))}))}else l=u;return S(l.map((function(t){return _(t)})))}function ne(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=J(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=J(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{};return re(r,i)}(n,e);case"MultiPolygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=J(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{},o=[];return r.forEach((function(t){o.push(re(t,i))})),S(o)}(n,e);default:throw new Error("invalid poly")}}function re(t,e){return t.length>1?M(t,e):O(t[0],e)}function ie(t,e){var n=J(t),r=J(e),i=n.type,o=r.type;switch(i){case"MultiPoint":switch(o){case"LineString":return oe(n,r);case"Polygon":return se(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"MultiPoint":return oe(r,n);case"LineString":return function(t,e){if(ee(t,e).features.length>0)for(var n=0;n0}function se(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o=Math.abs(s)?a>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(a)>=Math.abs(s)?a>0?t[0]0?t[1]2&&void 0!==arguments[2]?arguments[2]:{}).ignoreSelfIntersections)&&n,i=!0;return dt(t,(function(t){dt(e,(function(e){if(!1===i)return!1;i=function(t,e,n){switch(t.type){case"Point":switch(e.type){case"Point":return r=t.coordinates,i=e.coordinates,!(r[0]===i[0]&&r[1]===i[1]);case"LineString":return!ce(e,t);case"Polygon":return!Tt(t,e)}break;case"LineString":switch(e.type){case"Point":return!ce(t,e);case"LineString":return!function(t,e,n){return ee(t,e,{ignoreSelfIntersections:n}).features.length>0}(t,e,n);case"Polygon":return!he(e,t,n)}break;case"Polygon":switch(e.type){case"Point":return!Tt(e,t);case"LineString":return!he(t,e,n);case"Polygon":return!function(t,e,n){var r,i=f(t.coordinates[0]);try{for(i.s();!(r=i.n()).done;)if(Tt(r.value,e))return!0}catch(t){i.e(t)}finally{i.f()}var o,a=f(e.coordinates[0]);try{for(a.s();!(o=a.n()).done;)if(Tt(o.value,t))return!0}catch(t){a.e(t)}finally{a.f()}return ee(ne(t),ne(e),{ignoreSelfIntersections:n}).features.length>0}(e,t,n)}}var r,i;return!1}(t.geometry,e.geometry,r)}))})),i}function ce(t,e){for(var n=0;n0}function fe(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1];return 0==r*a-i*o&&(Math.abs(o)>=Math.abs(a)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var pe=Object.defineProperty,de=function(t,e){return pe(t,"name",{value:e,configurable:!0})},ge=function(){function t(e){var n,r,o;i(this,t),this.direction=!1,this.compareProperties=!0,this.precision=Math.pow(10,-(null!=(n=null==e?void 0:e.precision)?n:17)),this.direction=null!=(r=null==e?void 0:e.direction)&&r,this.compareProperties=null==(o=null==e?void 0:e.compareProperties)||o}return a(t,[{key:"compare",value:function(t,e){var n=this;if(t.type!==e.type)return!1;if(!ve(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){var r=me(t),i=me(e);return r.every((function(t){return i.some((function(e){return n.compare(t,e)}))}))}}return!1}},{key:"compareCoord",value:function(t,e){var n=this;return t.length===e.length&&t.every((function(t,r){return Math.abs(t-e[r])2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!ve(t,e))return!1;var i=t,o=e;if(r&&!this.compareCoord(i[0],o[0])){var a=this.fixStartIndex(o,i);if(!a)return!1;o=a}var s=this.compareCoord(i[n],o[n]);return this.direction||s?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},{key:"fixStartIndex",value:function(t,e){for(var n,r=-1,i=0;i=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n}},{key:"comparePath",value:function(t,e){var n=this;return t.every((function(t,r){return n.compareCoord(t,e[r])}))}},{key:"comparePolygon",value:function(t,e){var n=this;if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length);return r.every((function(t){return i.some((function(e){return n.compareLine(t,e,1,!0)}))}))}return!1}},{key:"compareGeometryCollection",value:function(t,e){var n=this;return ve(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((function(t,r){return n.compare(t,e.geometries[r])}))}},{key:"compareFeature",value:function(t,e){return t.id===e.id&&(!this.compareProperties||be(t.properties,e.properties))&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}},{key:"compareFeatureCollection",value:function(t,e){var n=this;return ve(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((function(t,r){return n.compare(t,e.features[r])}))}},{key:"compareBBox",value:function(t,e){return Boolean(!t.bbox&&!e.bbox)||!(!t.bbox||!e.bbox)&&this.compareCoord(t.bbox,e.bbox)}}]),t}();de(ge,"GeojsonEquality");var ye=ge;function ve(t,e){return t.coordinates?t.coordinates.length===e.coordinates.length:t.length===e.length}function me(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function _e(t,e,n){return new ye(n).compare(t,e)}function be(t,e){if(null===t&&null===e)return!0;if(null===t||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0,o=n;i1&&void 0!==arguments[1]?arguments[1]:{},n="object"===r(e)?e.mutate:e;if(!t)throw new Error("geojson is required");var i=Q(t),o=[];switch(i){case"LineString":o=Oe(t,i);break;case"MultiLineString":case"Polygon":W(t).forEach((function(t){o.push(Oe(t,i))}));break;case"MultiPolygon":W(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(Oe(t,i))})),o.push(e)}));break;case"Point":return t;case"MultiPoint":var a={};W(t).forEach((function(t){var e=t.join("-");Object.prototype.hasOwnProperty.call(a,e)||(o.push(t),a[e]=!0)}));break;default:throw new Error(i+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=o,t):{type:i,coordinates:o}:!0===n?(t.geometry.coordinates=o,t):v({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Oe(t,e){var n=W(t);if(2===n.length&&!Ee(n[0],n[1]))return n;var r=[],i=n.length-1,o=r.length;r.push(n[0]);for(var a=1;a2&&Se(r[o-3],r[o-1],r[o-2])&&r.splice(r.length-2,1))}if(r.push(n[n.length-1]),o=r.length,("Polygon"===e||"MultiPolygon"===e)&&Ee(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return"LineString"===e&&o<3||Se(r[o-3],r[o-1],r[o-2])&&r.splice(r.length-2,1),r}function Ee(t,e){return t[0]===e[0]&&t[1]===e[1]}function Se(t,e,n){var r=n[0],i=n[1],o=t[0],a=t[1],s=e[0],u=e[1],l=s-o,c=u-a;return 0==(r-o)*c-(i-a)*l&&(Math.abs(l)>=Math.abs(c)?l>0?o<=r&&r<=s:s<=r&&r<=o:c>0?a<=i&&i<=u:u<=i&&i<=a)}function Me(t,e){var n,r=null!=(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).ignoreSelfIntersections)&&n,i=!1;return dt(t,(function(t){dt(e,(function(e){if(!0===i)return!0;i=!le(t.geometry,e.geometry,{ignoreSelfIntersections:r})}))})),i}function Ce(t,e,n,r,i){!function t(e,n,r,i,o){for(;i>r;){if(i-r>600){var a=i-r+1,s=n-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*l/a+c)),Math.min(i,Math.floor(n+(a-s)*l/a+c)),o)}var h=e[n],f=r,p=i;for(ke(e,r,n),o(e[i],h)>0&&ke(e,r,i);f0;)p--}0===o(e[r],h)?ke(e,r,p):ke(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,n||0,r||t.length-1,i||Ne)}function ke(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Ne(t,e){return te?1:0}var je=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;i(this,t),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}return a(t,[{key:"all",value:function(){return this._all(this.data,[])}},{key:"search",value:function(t){var e=this.data,n=[];if(!Ge(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}},{key:"_split",value:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),a=qe(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Pe(n,this.toBBox),Pe(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}},{key:"_splitRoot",value:function(t,e){this.data=qe([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Pe(this.data,this.toBBox)}},{key:"_chooseSplitIndex",value:function(t,e,n){for(var r,i,o,a,s,u,l,c=1/0,h=1/0,f=e;f<=n-e;f++){var p=Ie(t,0,f,this.toBBox),d=Ie(t,f,n,this.toBBox),g=(i=p,o=d,a=Math.max(i.minX,o.minX),s=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),l=Math.min(i.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,l-s)),y=Fe(p)+Fe(d);g=e;c--){var h=t.children[c];Ae(a,t.leaf?i(h):h),s+=De(a)}return s}},{key:"_adjustParentBBoxes",value:function(t,e,n){for(var r=n;r>=0;r--)Ae(e[r],t)}},{key:"_condense",value:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():Pe(t[n],this.toBBox)}}]),t}();function Le(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function qe(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ze(t,e,n,r,i){for(var o=[e,n];o.length;)if(!((n=o.pop())-(e=o.pop())<=r)){var a=e+Math.ceil((n-e)/r/2)*r;Ce(t,a,e,n,i),o.push(e,a,a,n)}}var Ue=Object.freeze({__proto__:null,default:je});function Ve(t){var e=new je(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Ct(t),je.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:Ct(t),e.push(t)})):lt(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:Ct(t),e.push(t)})),je.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Ct(t),je.prototype.remove.call(this,t,e)},e.clear=function(){return je.prototype.clear.call(this)},e.search=function(t){return S(je.prototype.search.call(this,this.toBBox(t)))},e.collides=function(t){return je.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return S(je.prototype.all.call(this))},e.toJSON=function(){return je.prototype.toJSON.call(this)},e.fromJSON=function(t){return je.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=Ct(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=Ct(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function Ye(t){if(!t)throw new Error("geojson is required");var e=[];return dt(t,(function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=W(r);break;case"LineString":n=[W(r)]}n.forEach((function(n){(function(t,e){var n=[];return t.reduce((function(t,r){var i=O([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[ni?n:i,r>o?r:o]}(t,r),n.push(i),r})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),S(e)}var We=Object.defineProperty,Xe=Object.defineProperties,He=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Qe=function(t,e,n){return e in t?We(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},$e=function(t,e){for(var n in e||(e={}))Ke.call(e,n)&&Qe(t,n,e[n]);if(Ze){var r,i=f(Ze(e));try{for(i.s();!(r=i.n()).done;)n=r.value,Je.call(e,n)&&Qe(t,n,e[n])}catch(t){i.e(t)}finally{i.f()}}return t},tn=function(t,e){return Xe(t,He(e))};function en(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)throw new Error("lines and pt are required arguments");var r=_([1/0,1/0],{dist:1/0,index:-1,multiFeatureIndex:-1,location:-1}),i=0;return dt(t,(function(t,o,a){for(var s=W(t),u=0;u0&&y.features[0]&&(v=tn($e({},y.features[0]),{properties:{dist:nt(e,y.features[0],n),multiFeatureIndex:a,location:i+nt(l,y.features[0],n)}})),l.properties.dist2&&void 0!==arguments[2]?arguments[2]:{};if(!q(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],a=Ve(),s=Ye(t);a.load(s);var u=[];return yt(e,(function(t){var e=!1;t&&(lt(a.search(t),(function(n){if(!1===e){var o=W(t).sort(),a=W(n).sort();if(on(o,a))e=!0,r=r?sn(r,t)||r:t;else if(0===i?Ft(o[0],n)&&Ft(o[1],n):en(n,o[0]).properties.dist<=i&&en(n,o[1]).properties.dist<=i)e=!0,r=r?sn(r,t)||r:t;else if(0===i?Ft(a[0],t)&&Ft(a[1],t):en(t,a[0]).properties.dist<=i&&en(t,a[1]).properties.dist<=i)if(r){var s=sn(r,n);s?r=s:u.push(n)}else r=n}})),!1===e&&r&&(o.push(r),u.length&&(o=o.concat(u),u=[]),r=void 0))})),r&&o.push(r),S(o)}function sn(t,e){var n=W(e),r=W(t),i=r[0],o=r[r.length-1],a=t.geometry.coordinates;if(on(n[0],i))a.unshift(n[1]);else if(on(n[0],o))a.push(n[1]);else if(on(n[1],i))a.unshift(n[0]);else{if(!on(n[1],o))return;a.push(n[0])}return t}function un(t,e){var n=A(rt(t[0],t[1])),r=A(rt(e[0],e[1]));return n===r||(r-n)%180==0}function ln(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}function cn(t,e){return!!hn(e.coordinates[0],t.coordinates)||!!hn(e.coordinates[e.coordinates.length-1],t.coordinates)}function hn(t,e){return t[0]===e[0]&&t[1]===e[1]}function fn(t){return t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]}function pn(t){for(var e=0;ee[0]||t[2]e[1]||t[3]1&&void 0!==arguments[1]?arguments[1]:{},n=Ct(t);return _([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}var bn={exports:{}};!function(t,e){t.exports=function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var m=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=e.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=e.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==e.JOIN_ROUND&&(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(t){this._joinStyle=t}},{key:"setSimplifyFactor",value:function(t){this._simplifyFactor=t<0?0:t}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(t){this._endCapStyle=t}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(t){this._mitreLimit=t}},{key:"setSingleSided",value:function(t){this._isSingleSided=t}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}}},{key:"bufferDistanceError",value:function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)}}]),e}();m.CAP_ROUND=1,m.CAP_FLAT=2,m.CAP_SQUARE=3,m.JOIN_ROUND=1,m.JOIN_MITRE=2,m.JOIN_BEVEL=3,m.DEFAULT_QUADRANT_SEGMENTS=8,m.DEFAULT_MITRE_LIMIT=5,m.DEFAULT_SIMPLIFY_FACTOR=.01;var _=function(e){i(o,e);var r=f(o);function o(e){var n;return t(this,o),(n=r.call(this,e)).name=Object.keys({Exception:o})[0],n}return n(o,[{key:"toString",value:function(){return this.message}}]),o}(l(Error)),b=function(e){i(r,e);var n=f(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).name=Object.keys({IllegalArgumentException:r})[0],i}return r}(_),w=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}();function x(){}function O(){}function E(){}var S,M,C,k,N,j,L,P=function(){function e(){t(this,e)}return n(e,null,[{key:"equalsWithTolerance",value:function(t,e,n){return Math.abs(t-e)<=n}}]),e}(),I=function(){function e(n,r){t(this,e),this.low=r||0,this.high=n||0}return n(e,null,[{key:"toBinaryString",value:function(t){var e,n="";for(e=2147483648;e>0;e>>>=1)n+=(t.high&e)===e?"1":"0";for(e=2147483648;e>0;e>>>=1)n+=(t.low&e)===e?"1":"0";return n}}]),e}();function A(){}function R(){}A.NaN=NaN,A.isNaN=function(t){return Number.isNaN(t)},A.isInfinite=function(t){return!Number.isFinite(t)},A.MAX_VALUE=Number.MAX_VALUE,A.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,A.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,"function"==typeof Float64Array&&"function"==typeof Int32Array?(N=2146435072,j=new Float64Array(1),L=new Int32Array(j.buffer),A.doubleToLongBits=function(t){j[0]=t;var e=0|L[0],n=0|L[1];return(n&N)===N&&0!=(1048575&n)&&0!==e&&(e=0,n=2146959360),new I(n,e)},A.longBitsToDouble=function(t){return L[0]=t.low,L[1]=t.high,j[0]}):(S=Math.log2,M=Math.floor,C=Math.pow,k=function(){for(var t=53;t>0;t--){var e=C(2,t)-1;if(M(S(e))+1===t)return e}return 0}(),A.doubleToLongBits=function(t){var e,n,r,i,o,a,s,u,l;if(t<0||1/t===Number.NEGATIVE_INFINITY?(a=1<<31,t=-t):a=0,0===t)return new I(u=a,l=0);if(t===1/0)return new I(u=2146435072|a,l=0);if(t!=t)return new I(u=2146959360,l=0);if(i=0,l=0,(e=M(t))>1)if(e<=k)(i=M(S(e)))<=20?(l=0,u=e<<20-i&1048575):(l=e%(n=C(2,r=i-20))<<32-r,u=e/n&1048575);else for(r=e,l=0;0!==(r=M(n=r/2));)i++,l>>>=1,l|=(1&u)<<31,u>>>=1,n!==r&&(u|=524288);if(s=i+1023,o=0===e,e=t-e,i<52&&0!==e)for(r=0;;){if((n=2*e)>=1?(e=n-1,o?(s--,o=!1):(r<<=1,r|=1,i++)):(e=n,o?0==--s&&(i++,o=!1):(r<<=1,i++)),20===i)u|=r,r=0;else if(52===i){l|=r;break}if(1===n){i<20?u|=r<<20-i:i<52&&(l|=r<<52-i);break}}return u|=s<<20,new I(u|=a,l)},A.longBitsToDouble=function(t){var e,n,r,i,o=t.high,a=t.low,s=o&1<<31?-1:1;for(r=((2146435072&o)>>20)-1023,i=0,n=1<<19,e=1;e<=20;e++)o&n&&(i+=C(2,-e)),n>>>=1;for(n=1<<31,e=21;e<=52;e++)a&n&&(i+=C(2,-e)),n>>>=1;if(-1023===r){if(0===i)return 0*s;r=-1022}else{if(1024===r)return 0===i?s/0:NaN;i+=1}return s*i*C(2,r)});var T=function(e){i(r,e);var n=f(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).name=Object.keys({RuntimeException:r})[0],i}return r}(_),F=function(e){i(o,e);var r=f(o);function o(){var e;return t(this,o),e=r.call(this),o.constructor_.apply(c(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){if(0===arguments.length)T.constructor_.call(this);else if(1===arguments.length){var t=arguments[0];T.constructor_.call(this,t)}}}]),o}(T),D=function(){function e(){t(this,e)}return n(e,null,[{key:"shouldNeverReachHere",value:function(){if(0===arguments.length)e.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new F("Should never reach here"+(null!==t?": "+t:""))}}},{key:"isTrue",value:function(){if(1===arguments.length){var t=arguments[0];e.isTrue(t,null)}else if(2===arguments.length){var n=arguments[1];if(!arguments[0])throw null===n?new F:new F(n)}}},{key:"equals",value:function(){if(2===arguments.length){var t=arguments[0],n=arguments[1];e.equals(t,n,null)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(!i.equals(r))throw new F("Expected "+r+" but encountered "+i+(null!==o?": "+o:""))}}}]),e}(),B=new ArrayBuffer(8),G=new Float64Array(B),q=new Int32Array(B),z=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getM",value:function(){return A.NaN}},{key:"setOrdinate",value:function(t,n){switch(t){case e.X:this.x=n;break;case e.Y:this.y=n;break;case e.Z:this.setZ(n);break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"equals2D",value:function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!P.equalsWithTolerance(this.x,e.x,n)&&!!P.equalsWithTolerance(this.y,e.y,n)}}},{key:"setM",value:function(t){throw new b("Invalid ordinate index: "+e.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(t){switch(t){case e.X:return this.x;case e.Y:return this.y;case e.Z:return this.getZ()}throw new b("Invalid ordinate index: "+t)}},{key:"equals3D",value:function(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||A.isNaN(this.getZ())&&A.isNaN(t.getZ()))}},{key:"equals",value:function(t){return t instanceof e&&this.equals2D(t)}},{key:"equalInZ",value:function(t,e){return P.equalsWithTolerance(this.getZ(),t.getZ(),e)}},{key:"setX",value:function(t){this.x=t}},{key:"compareTo",value:function(t){var e=t;return this.xe.x?1:this.ye.y?1:0}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(t){this.z=t}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return D.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.getZ()-t.getZ();return Math.sqrt(e*e+n*n+r*r)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(t){this.y=t}},{key:"distance",value:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*t+e.hashCode(this.x))+e.hashCode(this.y)}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}},{key:"interfaces_",get:function(){return[x,O,E]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)e.constructor_.call(this,0,0);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.x,t.y,t.getZ())}else if(2===arguments.length){var n=arguments[0],r=arguments[1];e.constructor_.call(this,n,r,e.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];this.x=i,this.y=o,this.z=a}}},{key:"hashCode",value:function(t){return G[0]=t,q[0]^q[1]}}]),e}(),U=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compare",value:function(t,n){var r=e.compare(t.x,n.x);if(0!==r)return r;var i=e.compare(t.y,n.y);return 0!==i?i:this._dimensionsToTest<=2?0:e.compare(t.getZ(),n.getZ())}},{key:"interfaces_",get:function(){return[R]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,0===arguments.length)e.constructor_.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new b("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}},{key:"compare",value:function(t,e){return te?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0}}]),e}();z.DimensionalComparator=U,z.NULL_ORDINATE=A.NaN,z.X=0,z.Y=1,z.Z=2,z.M=3;var V=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.isNull()?n.isNull():this._maxx===n.getMaxX()&&this._maxy===n.getMaxY()&&this._minx===n.getMinX()&&this._miny===n.getMinY()}},{key:"intersection",value:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new e;var n=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny;return new e(n,this._maxx=this._minx&&n.getMaxX()<=this._maxx&&n.getMinY()>=this._miny&&n.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}}},{key:"intersects",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||(r.x>i.x?r.x:i.x)this._maxy||(r.y>i.y?r.y:i.y)this._maxx||othis._maxy||athis._maxx&&(this._maxx=n._maxx),n._minythis._maxy&&(this._maxy=n._maxy))}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(rthis._maxx&&(this._maxx=r),ithis._maxy&&(this._maxy=i))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0}},{key:"translate",value:function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(t){return!(!this.isNull()&&!t.isNull())||t._minx>this._maxx||t._maxxthis._maxy||t._maxye?t:e}},{key:"expandBy",value:function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}},{key:"contains",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof z){var n=arguments[0];return this.covers(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return this.covers(r,i)}}},{key:"centre",value:function(){return this.isNull()?null:new z((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];this._minx=n._minx,this._maxx=n._maxx,this._miny=n._miny,this._maxy=n._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],u=arguments[3];ot._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*(t=37*(t=37*t+z.hashCode(this._minx))+z.hashCode(this._maxx))+z.hashCode(this._miny))+z.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[x,E]}}],[{key:"constructor_",value:function(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],u=arguments[3];this.init(o,a,s,u)}}},{key:"intersects",value:function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||cu||c=this.size())throw new et;return this.array[t]}},{key:"push",value:function(t){return this.array.push(t),t}},{key:"pop",value:function(){if(0===this.array.length)throw new tt;return this.array.pop()}},{key:"peek",value:function(){if(0===this.array.length)throw new tt;return this.array[this.array.length-1]}},{key:"empty",value:function(){return 0===this.array.length}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(t){return this.array.indexOf(t)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}]),o}(nt);function it(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1}var ot=function(){function e(n){t(this,e),this.str=n}return n(e,[{key:"append",value:function(t){this.str+=t}},{key:"setCharAt",value:function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}},{key:"toString",value:function(){return this.str}}]),e}(),at=function(){function e(n){t(this,e),this.value=n}return n(e,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(t){return this.valuet?1:0}}],[{key:"compare",value:function(t,e){return te?1:0}},{key:"isNan",value:function(t){return Number.isNaN(t)}},{key:"valueOf",value:function(t){return new e(t)}}]),e}(),st=function(){function e(){t(this,e)}return n(e,null,[{key:"isWhitespace",value:function(t){return t<=32&&t>=0||127===t}},{key:"toUpperCase",value:function(t){return t.toUpperCase()}}]),e}(),ut=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"le",value:function(t){return this._hi9?(h=!0,f="9"):f="0"+c,s.append(f),r=r.subtract(e.valueOf(c)).multiply(e.TEN),h&&r.selfAdd(e.TEN);var p=!0,d=e.magnitude(r._hi);if(d<0&&Math.abs(d)>=u-l&&(p=!1),!p)break}return n[0]=i,s.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var n=arguments[0];return this.add(-n)}}},{key:"equals",value:function(){if(1===arguments.length&&arguments[0]instanceof e){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}}},{key:"isZero",value:function(){return 0===this._hi&&0===this._lo}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(t){return this.le(t)?this:t}},{key:"selfDivide",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfDivide(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,a=null,s=null,u=null,l=null,c=null,h=null,f=null;return l=this._hi/r,f=(o=(c=e.SPLIT*l)-(o=c-l))*(s=(f=e.SPLIT*r)-(s=f-r))-(h=l*r)+o*(u=r-s)+(a=l-o)*s+a*u,f=l+(c=(this._hi-h-f+this._lo-l*i)/r),this._hi=f,this._lo=l-f+c,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof e){var t=arguments[0],n=null,r=null,i=null,o=null,a=null,s=null,u=null,l=null;return r=(a=this._hi/t._hi)-(n=(s=e.SPLIT*a)-(n=s-a)),l=n*(i=(l=e.SPLIT*t._hi)-(i=l-t._hi))-(u=a*t._hi)+n*(o=t._hi-i)+r*i+r*o,new e(l=a+(s=(this._hi-u-l+this._lo-a*t._lo)/t._hi),a-l+s)}if("number"==typeof arguments[0]){var c=arguments[0];return A.isNaN(c)?e.createNaN():e.copy(this).selfDivide(c,0)}}},{key:"ge",value:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}},{key:"pow",value:function(t){if(0===t)return e.valueOf(1);var n=new e(this),r=e.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&r.selfMultiply(n),(i/=2)>0&&(n=n.sqr());else r=n;return t<0?r.reciprocal():r}},{key:"ceil",value:function(){if(this.isNaN())return e.NaN;var t=Math.ceil(this._hi),n=0;return t===this._hi&&(n=Math.ceil(this._lo)),new e(t,n)}},{key:"compareTo",value:function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var n=arguments[0];return this.init(n),this}}},{key:"max",value:function(t){return this.ge(t)?this:t}},{key:"sqrt",value:function(){if(this.isZero())return e.valueOf(0);if(this.isNegative())return e.NaN;var t=1/Math.sqrt(this._hi),n=this._hi*t,r=e.valueOf(n),i=this.subtract(r.sqr())._hi*(.5*t);return r.add(i)}},{key:"selfAdd",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0],r=null,i=null,o=null,a=null,s=null,u=null;return a=(o=this._hi+n)-(s=o-this._hi),i=(u=(a=n-s+(this._hi-a))+this._lo)+(o-(r=o+u)),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(2===arguments.length){var l=arguments[0],c=arguments[1],h=null,f=null,p=null,d=null,g=null,y=null,v=null;d=this._hi+l,f=this._lo+c,g=d-(y=d-this._hi),p=f-(v=f-this._lo);var m=(h=d+(y=(g=l-y+(this._hi-g))+f))+(y=(p=c-v+(this._lo-p))+(y+(d-h))),_=y+(h-m);return this._hi=m,this._lo=_,this}}},{key:"selfMultiply",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfMultiply(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,a=null,s=null,u=null,l=null,c=null;o=(l=e.SPLIT*this._hi)-this._hi,c=e.SPLIT*r,o=l-o,a=this._hi-o,s=c-r;var h=(l=this._hi*r)+(c=o*(s=c-s)-l+o*(u=r-s)+a*s+a*u+(this._hi*i+this._lo*r)),f=c+(o=l-h);return this._hi=h,this._lo=f,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return e.NaN;var t=Math.floor(this._hi),n=0;return t===this._hi&&(n=Math.floor(this._lo)),new e(t,n)}},{key:"negate",value:function(){return this.isNaN()?this:new e(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}}},{key:"multiply",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return t.isNaN()?e.createNaN():e.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var n=arguments[0];return A.isNaN(n)?e.createNaN():e.copy(this).selfMultiply(n,0)}}},{key:"isNaN",value:function(){return A.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var t=e.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!0,n),i=n[0]+1,o=r;if("."===r.charAt(0))o="0"+r;else if(i<0)o="0."+e.stringOfChar("0",-i)+r;else if(-1===r.indexOf(".")){var a=i-r.length;o=r+e.stringOfChar("0",a)+".0"}return this.isNegative()?"-"+o:o}},{key:"reciprocal",value:function(){var t,n,r,i,o=null,a=null,s=null,u=null;t=(r=1/this._hi)-(o=(s=e.SPLIT*r)-(o=s-r)),a=(u=e.SPLIT*this._hi)-this._hi;var l=r+(s=(1-(i=r*this._hi)-(u=o*(a=u-a)-i+o*(n=this._hi-a)+t*a+t*n)-r*this._lo)/this._hi);return new e(l,r-l+s)}},{key:"toSciNotation",value:function(){if(this.isZero())return e.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!1,n),i=e.SCI_NOT_EXPONENT_CHAR+n[0];if("0"===r.charAt(0))throw new IllegalStateException("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var a=r.charAt(0)+"."+o;return this.isNegative()?"-"+a+i:a+i}},{key:"abs",value:function(){return this.isNaN()?e.NaN:this.isNegative()?this.negate():new e(this)}},{key:"isPositive",value:function(){return this._hi>0||0===this._hi&&this._lo>0}},{key:"lt",value:function(t){return this._hit._hi||this._hi===t._hi&&this._lo>t._lo}},{key:"isNegative",value:function(){return this._hi<0||0===this._hi&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?e.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[E,x,O]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];e.constructor_.call(this,e.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}},{key:"determinant",value:function(){if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];return e.determinant(e.valueOf(t),e.valueOf(n),e.valueOf(r),e.valueOf(i))}if(arguments[3]instanceof e&&arguments[2]instanceof e&&arguments[0]instanceof e&&arguments[1]instanceof e){var o=arguments[1],a=arguments[2],s=arguments[3];return arguments[0].multiply(s).selfSubtract(o.multiply(a))}}},{key:"sqr",value:function(t){return e.valueOf(t).selfMultiply(t)}},{key:"valueOf",value:function(){if("string"==typeof arguments[0]){var t=arguments[0];return e.parse(t)}if("number"==typeof arguments[0])return new e(arguments[0])}},{key:"sqrt",value:function(t){return e.valueOf(t).sqrt()}},{key:"parse",value:function(t){for(var n=0,r=t.length;st.isWhitespace(t.charAt(n));)n++;var i=!1;if(n=r);){var h=t.charAt(n);if(n++,st.isDigit(h)){var f=h-"0";a.selfMultiply(e.TEN),a.selfAdd(f),s++}else{if("."!==h){if("e"===h||"E"===h){var p=t.substring(n);try{l=at.parseInt(p)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+p+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+h+"' at position "+n+" in string "+t)}u=s,c=!0}}var d=a;c||(u=s);var g=s-u-l;if(0===g)d=a;else if(g>0){var y=e.TEN.pow(g);d=a.divide(y)}else if(g<0){var v=e.TEN.pow(-g);d=a.multiply(v)}return i?d.negate():d}},{key:"createNaN",value:function(){return new e(A.NaN,A.NaN)}},{key:"copy",value:function(t){return new e(t)}},{key:"magnitude",value:function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r}},{key:"stringOfChar",value:function(t,e){for(var n=new ot,r=0;r0){if(a<=0)return e.signum(s);i=o+a}else{if(!(o<0))return e.signum(s);if(a>=0)return e.signum(s);i=-o-a}var u=e.DP_SAFE_EPSILON*i;return s>=u||-s>=u?e.signum(s):2}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}}]),e}();lt.DP_SAFE_EPSILON=1e-15;var ct=function(){function e(){t(this,e)}return n(e,[{key:"getM",value:function(t){if(this.hasM()){var e=this.getDimension()-this.getMeasures();return this.getOrdinate(t,e)}return A.NaN}},{key:"setOrdinate",value:function(t,e,n){}},{key:"getZ",value:function(t){return this.hasZ()?this.getOrdinate(t,2):A.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(t,e){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(t){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(t){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(t){}},{key:"copy",value:function(){}},{key:"getY",value:function(t){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[O]}}]),e}();ct.X=0,ct.Y=1,ct.Z=2,ct.M=3;var ht=function(){function e(){t(this,e)}return n(e,null,[{key:"index",value:function(t,e,n){return lt.orientationIndex(t,e,n)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var t=arguments[0],n=t.length-1;if(n<3)throw new b("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,o=1;o<=n;o++){var a=t[o];a.y>r.y&&(r=a,i=o)}var s=i;do{(s-=1)<0&&(s=n)}while(t[s].equals2D(r)&&s!==i);var u=i;do{u=(u+1)%n}while(t[u].equals2D(r)&&u!==i);var l=t[s],c=t[u];if(l.equals2D(r)||c.equals2D(r)||l.equals2D(c))return!1;var h=e.index(l,r,c);return 0===h?l.x>c.x:h>0}if(it(arguments[0],ct)){var f=arguments[0],p=f.size()-1;if(p<3)throw new b("Ring has fewer than 4 points, so orientation cannot be determined");for(var d=f.getCoordinate(0),g=0,y=1;y<=p;y++){var v=f.getCoordinate(y);v.y>d.y&&(d=v,g=y)}var m=null,_=g;do{(_-=1)<0&&(_=p),m=f.getCoordinate(_)}while(m.equals2D(d)&&_!==g);var w=null,x=g;do{x=(x+1)%p,w=f.getCoordinate(x)}while(w.equals2D(d)&&x!==g);if(m.equals2D(d)||w.equals2D(d)||m.equals2D(w))return!1;var O=e.index(m,d,w);return 0===O?m.x>w.x:O>0}}}]),e}();ht.CLOCKWISE=-1,ht.RIGHT=ht.CLOCKWISE,ht.COUNTERCLOCKWISE=1,ht.LEFT=ht.COUNTERCLOCKWISE,ht.COLLINEAR=0,ht.STRAIGHT=ht.COLLINEAR;var ft=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value:function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n}},{key:"findRightmostEdgeAtVertex",value:function(){var t=this._minDe.getEdge().getCoordinates();D.isTrue(this._minIndex>0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===ht.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value:function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=$.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])}},{key:"findRightmostEdgeAtNode",value:function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}},{key:"findEdge",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}D.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===$.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),e}(),pt=function(e){i(o,e);var r=f(o);function o(e,n){var i;return t(this,o),(i=r.call(this,n?e+" [ "+n+" ]":e)).pt=n?new z(n):void 0,i.name=Object.keys({TopologyException:o})[0],i}return n(o,[{key:"getCoordinate",value:function(){return this.pt}}]),o}(T),dt=function(){function e(){t(this,e),this.array=[]}return n(e,[{key:"addLast",value:function(t){this.array.push(t)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return 0===this.array.length}}]),e}(),gt=function(e,r){i(a,e);var o=f(a);function a(e){var n;return t(this,a),(n=o.call(this)).array=[],e instanceof X&&n.addAll(e),n}return n(a,[{key:"interfaces_",get:function(){return[nt,X]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(t){return 1===arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(t){var e,n=v(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.array.push(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"set",value:function(t,e){var n=this.array[t];return this.array[t]=e,n}},{key:"iterator",value:function(){return new yt(this)}},{key:"get",value:function(t){if(t<0||t>=this.size())throw new et;return this.array[t]}},{key:"isEmpty",value:function(){return 0===this.array.length}},{key:"sort",value:function(t){t?this.array.sort((function(e,n){return t.compare(e,n)})):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(t){for(var e=0,n=this.array.length;e=1&&e.getDepth($.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}},{key:"computeDepths",value:function(t){var e=new J,n=new dt,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}}},{key:"compareTo",value:function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(null===this._env){for(var t=new V,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;re.x?t.x:e.x,s=t.y>e.y?t.y:e.y,u=n.xr.x?n.x:r.x,h=n.y>r.y?n.y:r.y,f=((i>u?i:u)+(al?o:l)+(sn?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}}},{key:"wrap",value:function(t,e){return t<0?e- -t%e:t%e}},{key:"max",value:function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],a=arguments[0];return r>a&&(a=r),i>a&&(a=i),o>a&&(a=o),a}}},{key:"average",value:function(t,e){return(t+e)/2}}]),e}();bt.LOG_10=Math.log(10);var wt=function(){function e(){t(this,e)}return n(e,null,[{key:"segmentToSegment",value:function(t,n,r,i){if(t.equals(n))return e.pointToSegment(t,r,i);if(r.equals(i))return e.pointToSegment(i,t,n);var o=!1;if(V.intersects(t,n,r,i)){var a=(n.x-t.x)*(i.y-r.y)-(n.y-t.y)*(i.x-r.x);if(0===a)o=!0;else{var s=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=((t.y-r.y)*(n.x-t.x)-(t.x-r.x)*(n.y-t.y))/a,l=s/a;(l<0||l>1||u<0||u>1)&&(o=!0)}}else o=!0;return o?bt.min(e.pointToSegment(t,r,i),e.pointToSegment(n,r,i),e.pointToSegment(r,t,n),e.pointToSegment(i,t,n)):0}},{key:"pointToSegment",value:function(t,e,n){if(e.x===n.x&&e.y===n.y)return t.distance(e);var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;if(i<=0)return t.distance(e);if(i>=1)return t.distance(n);var o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(o)*Math.sqrt(r)}},{key:"pointToLinePerpendicular",value:function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)}},{key:"pointToSegmentString",value:function(t,n){if(0===n.length)throw new b("Line array must contain at least one vertex");for(var r=t.distance(n[0]),i=0;i0)&&(o=s,i=a)}return i}}},{key:"extend",value:function(t,n,r){var i=t.create(r,n.getDimension()),o=n.size();if(e.copy(n,0,i,0,o),o>0)for(var a=o;a0)&&(e=r)}return e}}]),e}(),Ct=function(){function e(){t(this,e)}return n(e,null,[{key:"toDimensionSymbol",value:function(t){switch(t){case e.FALSE:return e.SYM_FALSE;case e.TRUE:return e.SYM_TRUE;case e.DONTCARE:return e.SYM_DONTCARE;case e.P:return e.SYM_P;case e.L:return e.SYM_L;case e.A:return e.SYM_A}throw new b("Unknown dimension value: "+t)}},{key:"toDimensionValue",value:function(t){switch(st.toUpperCase(t)){case e.SYM_FALSE:return e.FALSE;case e.SYM_TRUE:return e.TRUE;case e.SYM_DONTCARE:return e.DONTCARE;case e.SYM_P:return e.P;case e.SYM_L:return e.L;case e.SYM_A:return e.A}throw new b("Unknown dimension symbol: "+t)}}]),e}();Ct.P=0,Ct.L=1,Ct.A=2,Ct.FALSE=-1,Ct.TRUE=-2,Ct.DONTCARE=-3,Ct.SYM_FALSE="F",Ct.SYM_TRUE="T",Ct.SYM_DONTCARE="*",Ct.SYM_P="0",Ct.SYM_L="1",Ct.SYM_A="2";var kt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}(),Nt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t,e){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}]),e}(),jt=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new V:this._points.expandEnvelope(new V)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new a(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof Y){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._points.size()!==n._points.size())return!1;for(var r=0;r0){var n=this._points.copy();Mt.reverse(n),this._points=n}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?Ct.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var t=this._points.copy();return Mt.reverse(t),this.getFactory().createLineString(t)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return Y.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return Et.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value:function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t}},{key:"isCoordinate",value:function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")}},{key:"getGeometryType",value:function(){return Y.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];jt.constructor_.call(this,t,e),this.validateConstruction()}}]),a}(jt);qt.MINIMUM_VALID_SIZE=4;var zt=function(e){i(o,e);var r=f(o);function o(){var e;return t(this,o),e=r.call(this),o.constructor_.apply(c(e),arguments),e}return n(o,[{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"getZ",value:function(){return z.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y}throw new b("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new b("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}],[{key:"constructor_",value:function(){if(0===arguments.length)z.constructor_.call(this);else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];z.constructor_.call(this,t.x,t.y)}else if(arguments[0]instanceof z){var e=arguments[0];z.constructor_.call(this,e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];z.constructor_.call(this,n,r,z.NULL_ORDINATE)}}}]),o}(z);zt.X=0,zt.Y=1,zt.Z=-1,zt.M=-1;var Ut=function(e){i(o,e);var r=f(o);function o(){var e;return t(this,o),e=r.call(this),o.constructor_.apply(c(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;case o.M:this._m=e;break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getZ",value:function(){return z.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y;case o.M:return this._m}throw new b("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new b("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)z.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];z.constructor_.call(this,t.x,t.y),this._m=t._m}else if(arguments[0]instanceof z){var e=arguments[0];z.constructor_.call(this,e.x,e.y),this._m=this.getM()}}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];z.constructor_.call(this,n,r,z.NULL_ORDINATE),this._m=i}}}]),o}(z);Ut.X=0,Ut.Y=1,Ut.Z=-1,Ut.M=2;var Vt=function(e){i(o,e);var r=f(o);function o(){var e;return t(this,o),e=r.call(this),o.constructor_.apply(c(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case z.X:this.x=e;break;case z.Y:this.y=e;break;case z.Z:this.z=e;break;case z.M:this._m=e;break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getOrdinate",value:function(t){switch(t){case z.X:return this.x;case z.Y:return this.y;case z.Z:return this.getZ();case z.M:return this.getM()}throw new b("Invalid ordinate index: "+t)}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)z.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];z.constructor_.call(this,t),this._m=t._m}else if(arguments[0]instanceof z){var e=arguments[0];z.constructor_.call(this,e),this._m=this.getM()}}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],a=arguments[3];z.constructor_.call(this,n,r,i),this._m=a}}}]),o}(z),Yt=function(){function e(){t(this,e)}return n(e,null,[{key:"measures",value:function(t){return t instanceof zt?0:t instanceof Ut||t instanceof Vt?1:0}},{key:"dimension",value:function(t){return t instanceof zt?2:t instanceof Ut?3:t instanceof Vt?4:3}},{key:"create",value:function(){if(1===arguments.length){var t=arguments[0];return e.create(t,0)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return 2===n?new zt:3===n&&0===r?new z:3===n&&1===r?new Ut:4===n&&1===r?new Vt:new z}}}]),e}(),Wt=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"getCoordinate",value:function(t){return this.get(t)}},{key:"addAll",value:function(){if(2===arguments.length&&"boolean"==typeof arguments[1]&&it(arguments[0],X)){for(var t=arguments[1],e=!1,n=arguments[0].iterator();n.hasNext();)this.add(n.next(),t),e=!0;return e}return p(o(a.prototype),"addAll",this).apply(this,arguments)}},{key:"clone",value:function(){for(var t=p(o(a.prototype),"clone",this).call(this),e=0;e=1&&this.get(this.size()-1).equals2D(r))return null;p(o(a.prototype),"add",this).call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var i=arguments[0],s=arguments[1];return this.add(i,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1];if(arguments[2])for(var c=0;c=0;h--)this.add(u[h],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof z){var f=arguments[0],d=arguments[1];if(!arguments[2]){var g=this.size();if(g>0){if(f>0&&this.get(f-1).equals2D(d))return null;if(f_&&(b=-1);for(var w=m;w!==_;w+=b)this.add(y[w],v);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var t=this.get(0).copy();this.add(t,!1)}}}],[{key:"constructor_",value:function(){if(0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}}]),a}(gt);Wt.coordArrayType=new Array(0).fill(null);var Xt=function(){function e(){t(this,e)}return n(e,null,[{key:"isRing",value:function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))}},{key:"ptNotInList",value:function(t,n){for(var r=0;r=t?e:[]}},{key:"indexOf",value:function(t,e){for(var n=0;n0)&&(e=t[n]);return e}},{key:"extract",value:function(t,e,n){e=bt.clamp(e,0,t.length);var r=(n=bt.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=Xt.compare(n,r);return Xt.isEqualReversed(n,r)?0:i}},{key:"OLDcompare",value:function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=Xt.increasingDirection(n),o=Xt.increasingDirection(r),a=i>0?0:n.length-1,s=o>0?0:n.length-1,u=0;u0){var t=new Kt(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(t=3),t<2&&(t=2),new Jt(arguments[0],t)}if(3===arguments.length){var e=arguments[2],n=arguments[1]-e;return e>1&&(e=1),n>3&&(n=3),n<2&&(n=2),new Jt(arguments[0],n+e,e)}}}},{key:"interfaces_",get:function(){return[xt,E]}}],[{key:"instance",value:function(){return e.instanceObject}}]),e}();Qt.instanceObject=new Qt;var $t=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e=0?t:e}}]),e}(),re=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"readResolve",value:function(){return e.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[E]}}],[{key:"constructor_",value:function(){this._name=null;var t=arguments[0];this._name=t,e.nameToTypeMap.put(t,this)}}]),e}();re.nameToTypeMap=new ee,ne.Type=re,ne.FIXED=new re("FIXED"),ne.FLOATING=new re("FLOATING"),ne.FLOATING_SINGLE=new re("FLOATING SINGLE"),ne.maximumPreciseValue=9007199254740992;var ie=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e1){if(u instanceof Tt)return this.createMultiPolygon(e.toPolygonArray(t));if(u instanceof jt)return this.createMultiLineString(e.toLineStringArray(t));if(u instanceof Pt)return this.createMultiPoint(e.toPointArray(t));D.shouldNeverReachHere("Unhandled geometry type: "+u.getGeometryType())}return u}},{key:"createMultiPointFromCoords",value:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}},{key:"createPoint",value:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(it(arguments[0],ct))return new Pt(arguments[0],this)}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(0===arguments.length)return this.createPolygon(null,null);if(1===arguments.length){if(it(arguments[0],ct)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof qt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Tt(arguments[0],arguments[1],this)}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){return 0===arguments.length?new Bt(null,this):1===arguments.length?new Bt(arguments[0],this):void 0}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(it(arguments[0],ct))return new qt(arguments[0],this)}}},{key:"createMultiPolygon",value:function(){return 0===arguments.length?new $t(null,this):1===arguments.length?new $t(arguments[0],this):void 0}},{key:"createMultiPoint",value:function(){if(0===arguments.length)return new Gt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Gt(arguments[0],this);if(it(arguments[0],ct)){var t=arguments[0];if(null===t)return this.createMultiPoint(new Array(0).fill(null));for(var e=new Array(t.size()).fill(null),n=0;n="a"&&t<="z"||t>="A"&&t<="Z"}},{key:"isNumeric_",value:function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)}},{key:"isWhiteSpace_",value:function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t}},{key:"nextChar_",value:function(){return this.wkt.charAt(++this.index_)}},{key:"nextToken",value:function(){var t,e=this.nextChar_(),n=this.index_,r=e;if("("==e)t=2;else if(","==e)t=5;else if(")"==e)t=3;else if(this.isNumeric_(e)||"-"==e)t=4,r=this.readNumber_();else if(this.isAlpha_(e))t=1,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=6}return{position:n,value:r,type:t}}},{key:"readNumber_",value:function(){var t,e=this.index_,n=!1,r=!1;do{"."==t?n=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_()}while(this.isNumeric_(t,n)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))}},{key:"readText_",value:function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}]),e}(),le=function(){function e(n,r){t(this,e),this.lexer_=n,this.token_,this.layout_="XY",this.factory=r}return n(e,[{key:"consume_",value:function(){this.token_=this.lexer_.nextToken()}},{key:"isTokenType",value:function(t){return this.token_.type==t}},{key:"match",value:function(t){var e=this.isTokenType(t);return e&&this.consume_(),e}},{key:"parse",value:function(){return this.consume_(),this.parseGeometry_()}},{key:"parseGeometryLayout_",value:function(){var t="XY",e=this.token_;if(this.isTokenType(1)){var n=e.value;"Z"===n?t="XYZ":"M"===n?t="XYM":"ZM"===n&&(t="XYZM"),"XY"!==t&&this.consume_()}return t}},{key:"parseGeometryCollectionText_",value:function(){if(this.match(2)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(5));if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePointText_",value:function(){if(this.match(2)){var t=this.parsePoint_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}},{key:"parseLineStringText_",value:function(){if(this.match(2)){var t=this.parsePointList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePolygonText_",value:function(){if(this.match(2)){var t=this.parseLineStringTextList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPointText_",value:function(){var t;if(this.match(2)){if(t=2==this.token_.type?this.parsePointTextList_():this.parsePointList_(),this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiLineStringText_",value:function(){if(this.match(2)){var t=this.parseLineStringTextList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPolygonText_",value:function(){if(this.match(2)){var t=this.parsePolygonTextList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePoint_",value:function(){for(var t=[],e=this.layout_.length,n=0;n1?t.createPolygon(r[0],r.slice(1)):t.createPolygon(r[0])},r=this.token_;if(this.match(1)){var i=r.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==i){var o=this.parseGeometryCollectionText_();return t.createGeometryCollection(o)}switch(i){case"POINT":var a=this.parsePointText_();return a?t.createPoint(u(z,d(a))):t.createPoint();case"LINESTRING":var s=this.parseLineStringText_().map(e);return t.createLineString(s);case"LINEARRING":var l=this.parseLineStringText_().map(e);return t.createLinearRing(l);case"POLYGON":var c=this.parsePolygonText_();return c&&0!==c.length?n(c):t.createPolygon();case"MULTIPOINT":var h=this.parseMultiPointText_();if(!h||0===h.length)return t.createMultiPoint();var f=h.map(e).map((function(e){return t.createPoint(e)}));return t.createMultiPoint(f);case"MULTILINESTRING":var p=this.parseMultiLineStringText_().map((function(n){return t.createLineString(n.map(e))}));return t.createMultiLineString(p);case"MULTIPOLYGON":var g=this.parseMultiPolygonText_();if(!g||0===g.length)return t.createMultiPolygon();var y=g.map(n);return t.createMultiPolygon(y);default:throw new Error("Invalid geometry type: "+i)}}throw new Error(this.formatErrorMessage_())}}]),e}();function ce(t){if(t.isEmpty())return"";var e=t.getCoordinate(),n=[e.x,e.y];return void 0===e.z||Number.isNaN(e.z)||n.push(e.z),void 0===e.m||Number.isNaN(e.m)||n.push(e.m),n.join(" ")}function he(t){for(var e=t.getCoordinates().map((function(t){var e=[t.x,t.y];return void 0===t.z||Number.isNaN(t.z)||e.push(t.z),void 0===t.m||Number.isNaN(t.m)||e.push(t.m),e})),n=[],r=0,i=e.length;r0&&(e+=" "+r),t.isEmpty()?e+" EMPTY":e+" ("+n(t)+")"}var ge=function(){function e(n){t(this,e),this.geometryFactory=n||new oe,this.precisionModel=this.geometryFactory.getPrecisionModel()}return n(e,[{key:"read",value:function(t){var e=new ue(t);return new le(e,this.geometryFactory).parse()}},{key:"write",value:function(t){return de(t)}}]),e}(),ye=function(){function e(n){t(this,e),this.parser=new ge(n)}return n(e,[{key:"write",value:function(t){return this.parser.write(t)}}],[{key:"toLineString",value:function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}]),e}(),ve=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getIndexAlongSegment",value:function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]}},{key:"getTopologySummary",value:function(){var t=new Kt;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}},{key:"computeIntersection",value:function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value:function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(t){this._precisionModel=t}},{key:"isInteriorIntersection",value:function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?r:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=r>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return D.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o}},{key:"nonRobustComputeEdgeDistance",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return D.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o}}]),e}();ve.DONT_INTERSECT=0,ve.DO_INTERSECT=1,ve.COLLINEAR=2,ve.NO_INTERSECTION=0,ve.POINT_INTERSECTION=1,ve.COLLINEAR_INTERSECTION=2;var me=function(e){i(a,e);var r=f(a);function a(){return t(this,a),r.call(this)}return n(a,[{key:"isInSegmentEnvelopes",value:function(t){var e=new V(this._inputLines[0][0],this._inputLines[0][1]),n=new V(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)}},{key:"computeIntersection",value:function(){if(3!==arguments.length)return p(o(a.prototype),"computeIntersection",this).apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,V.intersects(e,n,t)&&0===ht.index(e,n,t)&&0===ht.index(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=ve.POINT_INTERSECTION,null;this._result=ve.NO_INTERSECTION}},{key:"intersection",value:function(t,e,n,r){var i=this.intersectionSafe(t,e,n,r);return this.isInSegmentEnvelopes(i)||(i=new z(a.nearestEndpoint(t,e,n,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i}},{key:"checkDD",value:function(t,e,n,r,i){var o=lt.intersection(t,e,n,r),a=this.isInSegmentEnvelopes(o);_t.out.println("DD in env = "+a+" --------------------- "+o),i.distance(o)>1e-4&&_t.out.println("Distance = "+i.distance(o))}},{key:"intersectionSafe",value:function(t,e,n,r){var i=mt.intersection(t,e,n,r);return null===i&&(i=a.nearestEndpoint(t,e,n,r)),i}},{key:"computeCollinearIntersection",value:function(t,e,n,r){var i=V.intersects(t,e,n),o=V.intersects(t,e,r),a=V.intersects(n,r,t),s=V.intersects(n,r,e);return i&&o?(this._intPt[0]=n,this._intPt[1]=r,ve.COLLINEAR_INTERSECTION):a&&s?(this._intPt[0]=t,this._intPt[1]=e,ve.COLLINEAR_INTERSECTION):i&&a?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||s?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):i&&s?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||a?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||i||s?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||i||a?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):ve.NO_INTERSECTION}},{key:"computeIntersect",value:function(t,e,n,r){if(this._isProper=!1,!V.intersects(t,e,n,r))return ve.NO_INTERSECTION;var i=ht.index(t,e,n),o=ht.index(t,e,r);if(i>0&&o>0||i<0&&o<0)return ve.NO_INTERSECTION;var a=ht.index(n,r,t),s=ht.index(n,r,e);return a>0&&s>0||a<0&&s<0?ve.NO_INTERSECTION:0===i&&0===o&&0===a&&0===s?this.computeCollinearIntersection(t,e,n,r):(0===i||0===o||0===a||0===s?(this._isProper=!1,t.equals2D(n)||t.equals2D(r)?this._intPt[0]=t:e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:0===i?this._intPt[0]=new z(n):0===o?this._intPt[0]=new z(r):0===a?this._intPt[0]=new z(t):0===s&&(this._intPt[0]=new z(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,n,r)),ve.POINT_INTERSECTION)}}],[{key:"nearestEndpoint",value:function(t,e,n,r){var i=t,o=wt.pointToSegment(t,n,r),a=wt.pointToSegment(e,n,r);return ar&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=ht.index(t,e,this._p);if(i===ht.COLLINEAR)return this._isPointOnSegment=!0,null;e.ythis.location.length){var e=new Array(3).fill(null);e[$.ON]=this.location[$.ON],e[$.LEFT]=W.NONE,e[$.RIGHT]=W.NONE,this.location=e}for(var n=0;n1&&t.append(W.toLocationSymbol(this.location[$.LEFT])),t.append(W.toLocationSymbol(this.location[$.ON])),this.location.length>1&&t.append(W.toLocationSymbol(this.location[$.RIGHT])),t.toString()}},{key:"setLocations",value:function(t,e,n){this.location[$.ON]=t,this.location[$.LEFT]=e,this.location[$.RIGHT]=n}},{key:"get",value:function(t){return t1}},{key:"isAnyNull",value:function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2}},{key:"addPoints",value:function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=0;s--)this._pts.add(r[s])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)}},{key:"containsPoint",value:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!be.isInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0}},{key:"addHole",value:function(t){this._holes.add(t)}},{key:"isShell",value:function(){return null===this._shell}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}},{key:"getShell",value:function(){return this._shell}},{key:"mergeLabel",value:function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,$.RIGHT);if(n===W.NONE)return null;if(this._label.getLocation(e)===W.NONE)return this._label.setLocation(e,n),null}}},{key:"setShell",value:function(t){this._shell=t,null!==t&&t.addHole(this)}},{key:"toPolygon",value:function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}}}]),e}(),Ce=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"isIncidentEdgeInResult",value:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return 1===this._label.getGeometryCount()}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(t){t.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(t){}},{key:"computeMergedLocation",value:function(t,e){var n=W.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==W.BOUNDARY&&(n=r)}return n}},{key:"setLabel",value:function(){if(2!==arguments.length||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return p(o(a.prototype),"setLabel",this).apply(this,arguments);var t=arguments[0],e=arguments[1];null===this._label?this._label=new xe(t,e):this._label.setLocation(t,e)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof a){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof xe)for(var e=arguments[0],n=0;n<2;n++){var r=this.computeMergedLocation(e,n);this._label.getLocation(n)===W.NONE&&this._label.setLocation(n,r)}}},{key:"add",value:function(t){this._edges.insert(t),t.setNode(this)}},{key:"setLabelBoundary",value:function(t){if(null===this._label)return null;var e=W.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case W.BOUNDARY:n=W.INTERIOR;break;case W.INTERIOR:default:n=W.BOUNDARY}this._label.setLocation(t,n)}}],[{key:"constructor_",value:function(){this._coord=null,this._edges=null;var t=arguments[0],e=arguments[1];this._coord=t,this._edges=e,this._label=new xe(0,W.NONE)}}]),a}(Me);function ke(t){return null==t?0:t.color}function Ne(t){return null==t?null:t.parent}function je(t,e){null!==t&&(t.color=e)}function Le(t){return null==t?null:t.left}function Pe(t){return null==t?null:t.right}var Ie=function(e){i(o,e);var r=f(o);function o(){var e;return t(this,o),(e=r.call(this)).root_=null,e.size_=0,e}return n(o,[{key:"get",value:function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null}},{key:"put",value:function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:n,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null}},{key:"fixAfterInsertion",value:function(t){var e;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)Ne(t)===Le(Ne(Ne(t)))?1===ke(e=Pe(Ne(Ne(t))))?(je(Ne(t),0),je(e,0),je(Ne(Ne(t)),1),t=Ne(Ne(t))):(t===Pe(Ne(t))&&(t=Ne(t),this.rotateLeft(t)),je(Ne(t),0),je(Ne(Ne(t)),1),this.rotateRight(Ne(Ne(t)))):1===ke(e=Le(Ne(Ne(t))))?(je(Ne(t),0),je(e,0),je(Ne(Ne(t)),1),t=Ne(Ne(t))):(t===Le(Ne(t))&&(t=Ne(t),this.rotateRight(t)),je(Ne(t),0),je(Ne(Ne(t)),1),this.rotateLeft(Ne(Ne(t))));this.root_.color=0}},{key:"values",value:function(){var t=new gt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=o.successor(e));)t.add(e.value);return t}},{key:"entrySet",value:function(){var t=new J,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=o.successor(e));)t.add(e);return t}},{key:"rotateLeft",value:function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}}},{key:"rotateRight",value:function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}}},{key:"getFirstEntry",value:function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t}},{key:"size",value:function(){return this.size_}},{key:"containsKey",value:function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return!0;e=e.right}}return!1}}],[{key:"successor",value:function(t){var e;if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}e=t.parent;for(var n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e}}]),o}(function(e){i(r,e);var n=f(r);function r(){return t(this,r),n.apply(this,arguments)}return r}(te)),Ae=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"find",value:function(t){return this.nodeMap.get(t)}},{key:"addNode",value:function(){if(arguments[0]instanceof z){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Ce){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}}},{key:"print",value:function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(t){for(var e=new gt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===W.BOUNDARY&&e.add(r)}return e}},{key:"add",value:function(t){var e=t.getCoordinate();this.addNode(e).add(t)}}],[{key:"constructor_",value:function(){this.nodeMap=new Ie,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}}]),e}(),Re=function(){function e(){t(this,e)}return n(e,null,[{key:"isNorthern",value:function(t){return t===e.NE||t===e.NW}},{key:"isOpposite",value:function(t,e){return t!==e&&2==(t-e+4)%4}},{key:"commonHalfPlane",value:function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=te?t:e)?3:n}},{key:"isInHalfPlane",value:function(t,n){return n===e.SE?t===e.SE||t===e.SW:t===n||t===n+1}},{key:"quadrant",value:function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1];if(0===t&&0===n)throw new b("Cannot compute the quadrant for point ( "+t+", "+n+" )");return t>=0?n>=0?e.NE:e.SE:n>=0?e.NW:e.SW}if(arguments[0]instanceof z&&arguments[1]instanceof z){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new b("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?e.NE:e.SE:i.y>=r.y?e.NW:e.SW}}}]),e}();Re.NE=0,Re.NW=1,Re.SW=2,Re.SE=3;var Te=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareDirection",value:function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):n.addAll(a)}else r.add(o)}return r}},{key:"buildMaximalEdgeRings",value:function(t){for(var e=new gt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Se(r,this._geometryFactory);e.add(i),i.setInResult()}}return e}},{key:"placePolygonHoles",value:function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return D.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n}},{key:"add",value:function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Be.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new gt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}}}],[{key:"constructor_",value:function(){this._geometryFactory=null,this._shellList=new gt;var t=arguments[0];this._geometryFactory=t}},{key:"findEdgeRingContaining",value:function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();if(!c.equals(r)&&c.contains(r)){i=Xt.ptNotInList(n.getCoordinates(),l.getCoordinates());var h=!1;be.isInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(a=(o=u).getLinearRing().getEnvelopeInternal())}}return o}}]),e}(),qe=function(){function e(){t(this,e)}return n(e,[{key:"getBounds",value:function(){}}]),e}(),ze=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getItem",value:function(){return this._item}},{key:"getBounds",value:function(){return this._bounds}},{key:"interfaces_",get:function(){return[qe,E]}}],[{key:"constructor_",value:function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}}]),e}(),Ue=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"poll",value:function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t}},{key:"size",value:function(){return this._size}},{key:"reorder",value:function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return 0===this._size}},{key:"add",value:function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new gt,this._items.add(null)}}]),e}(),Ve=function(){function e(){t(this,e)}return n(e,[{key:"insert",value:function(t,e){}},{key:"remove",value:function(t,e){}},{key:"query",value:function(){}}]),e}(),Ye=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(t){D.isTrue(null===this._bounds),this._childBoundables.add(t)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[qe,E]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new gt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}}}]),e}(),We={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return We.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?At.sort(n,e):At.sort(n);for(var r=t.iterator(),i=0,o=n.length;ie.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,t,n),null):(this.expand(this._boundable2,this._boundable1,!0,t,n),null);if(r)return this.expand(this._boundable1,this._boundable2,!1,t,n),null;if(i)return this.expand(this._boundable2,this._boundable1,!0,t,n),null;throw new b("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(e.isComposite(this._boundable1)||e.isComposite(this._boundable2))}},{key:"compareTo",value:function(t){var e=t;return this._distancee._distance?1:0}},{key:"expand",value:function(t,n,r,i,o){for(var a=t.getChildBoundables().iterator();a.hasNext();){var s=a.next(),u=null;(u=r?new e(n,s,this._itemDistance):new e(s,n,this._itemDistance)).getDistance()-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Ye?this.boundablesAtLevel(n,a,i):(D.isTrue(a instanceof ze),-1===n&&i.add(a))}return null}}},{key:"query",value:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new gt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.queryInternal(n,this._root,r)}}},{key:"build",value:function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var a=null,s=r.getChildBoundables().iterator();s.hasNext();){var u=s.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Ye&&(o=this.remove(n,u,i))){a=u;break}}return null!==a&&a.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(a),o}}},{key:"createHigherLevels",value:function(t,e){D.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)}},{key:"depth",value:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ye){var r=this.depth(n);r>t&&(t=r)}}return t+1}}},{key:"createParentBoundables",value:function(t,e){D.isTrue(!t.isEmpty());var n=new gt;n.add(this.createNode(e));var r=new gt(t);We.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[E]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new gt,this._nodeCapacity=null,0===arguments.length)e.constructor_.call(this,e.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];D.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}},{key:"compareDoubles",value:function(t,e){return t>e?1:t0);for(var n=new gt,r=0;r=0;){var u=o.poll(),l=u.getDistance();if(l>=i)break;u.isLeaves()?s.size()l&&(s.poll(),s.add(u)),i=s.peek().getDistance()):u.expandToQueue(o,i)}return a.getItems(s)}}},{key:"createNode",value:function(t){return new $e(t)}},{key:"size",value:function(){return 0===arguments.length?p(o(a.prototype),"size",this).call(this):p(o(a.prototype),"size",this).apply(this,arguments)}},{key:"insert",value:function(){if(!(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof V))return p(o(a.prototype),"insert",this).apply(this,arguments);var t=arguments[0],e=arguments[1];if(t.isNull())return null;p(o(a.prototype),"insert",this).call(this,t,e)}},{key:"getIntersectsOp",value:function(){return a.intersectsOp}},{key:"verticalSlices",value:function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o0;){var a=o.poll(),s=a.getDistance();if(s>=r)break;a.isLeaves()?(r=s,i=a):a.expandToQueue(o,r)}return null===i?null:[i.getBoundable(0).getItem(),i.getBoundable(1).getItem()]}}else{if(2===arguments.length){var u=arguments[0],l=arguments[1];if(this.isEmpty()||u.isEmpty())return null;var c=new He(this.getRoot(),u.getRoot(),l);return this.nearestNeighbour(c)}if(3===arguments.length){var h=arguments[2],f=new ze(arguments[0],arguments[1]),p=new He(this.getRoot(),f,h);return this.nearestNeighbour(p)[0]}if(4===arguments.length){var d=arguments[2],g=arguments[3],y=new ze(arguments[0],arguments[1]),v=new He(this.getRoot(),y,d);return this.nearestNeighbourK(v,g)}}}},{key:"isWithinDistance",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=A.POSITIVE_INFINITY,r=new Ue;for(r.add(t);!r.isEmpty();){var i=r.poll(),o=i.getDistance();if(o>e)return!1;if(i.maximumDistance()<=e)return!0;if(i.isLeaves()){if((n=o)<=e)return!0}else i.expandToQueue(r,n)}return!1}if(3===arguments.length){var a=arguments[0],s=arguments[1],u=arguments[2],l=new He(this.getRoot(),a.getRoot(),s);return this.isWithinDistance(l,u)}}},{key:"interfaces_",get:function(){return[Ve,E]}}],[{key:"constructor_",value:function(){if(0===arguments.length)a.constructor_.call(this,a.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];Ke.constructor_.call(this,t)}}},{key:"centreX",value:function(t){return a.avg(t.getMinX(),t.getMaxX())}},{key:"avg",value:function(t,e){return(t+e)/2}},{key:"getItems",value:function(t){for(var e=new Array(t.size()).fill(null),n=0;!t.isEmpty();){var r=t.poll();e[n]=r.getBoundable(0).getItem(),n++}return e}},{key:"centreY",value:function(t){return a.avg(t.getMinY(),t.getMaxY())}}]),a}(Ke),$e=function(e){i(o,e);var r=f(o);function o(){var e;return t(this,o),e=r.call(this),o.constructor_.apply(c(e),arguments),e}return n(o,[{key:"computeBounds",value:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new V(n.getBounds()):t.expandToInclude(n.getBounds())}return t}}],[{key:"constructor_",value:function(){var t=arguments[0];Ye.constructor_.call(this,t)}}]),o}(Ye);Qe.STRtreeNode=$e,Qe.xComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[R]}},{key:"compare",value:function(t,e){return Ke.compareDoubles(Qe.centreX(t.getBounds()),Qe.centreX(e.getBounds()))}}]),e}()),Qe.yComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[R]}},{key:"compare",value:function(t,e){return Ke.compareDoubles(Qe.centreY(t.getBounds()),Qe.centreY(e.getBounds()))}}]),e}()),Qe.intersectsOp=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[IntersectsOp]}},{key:"intersects",value:function(t,e){return t.intersects(e)}}]),e}()),Qe.DEFAULT_NODE_CAPACITY=10;var tn=function(){function e(){t(this,e)}return n(e,null,[{key:"relativeSign",value:function(t,e){return te?1:0}},{key:"compare",value:function(t,n,r){if(n.equals2D(r))return 0;var i=e.relativeSign(n.x,r.x),o=e.relativeSign(n.y,r.y);switch(t){case 0:return e.compareValue(i,o);case 1:return e.compareValue(o,i);case 2:return e.compareValue(o,-i);case 3:return e.compareValue(-i,o);case 4:return e.compareValue(-i,-o);case 5:return e.compareValue(-o,-i);case 6:return e.compareValue(-o,i);case 7:return e.compareValue(i,-o)}return D.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0}}]),e}(),en=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:this._isInterior?e._isInterior?tn.compare(this._segmentOctant,this.coord,e.coord):1:-1}},{key:"isEndPoint",value:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new z(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}}]),e}(),nn=function(){function e(){t(this,e)}return n(e,[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}]),e}(),rn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getSplitCoordinates",value:function(){var t=new Wt;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()}},{key:"addCollapsedNodes",value:function(){var t=new gt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}}},{key:"createSplitEdgePts",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2;if(2===n)return[new z(t.coord),new z(e.coord)];var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new z(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this._edge.getCoordinate(s);return i&&(o[a]=new z(e.coord)),o}},{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"findCollapsesFromExistingVertices",value:function(t){for(var e=0;e=0?n>=0?r>=i?0:1:r>=i?7:6:n>=0?r>=i?3:2:r>=i?4:5}if(arguments[0]instanceof z&&arguments[1]instanceof z){var o=arguments[0],a=arguments[1],s=a.x-o.x,u=a.y-o.y;if(0===s&&0===u)throw new b("Cannot compute the octant for two identical points "+o);return e.octant(s,u)}}}]),e}(),an=function(){function e(){t(this,e)}return n(e,[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(t){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(t){}},{key:"getData",value:function(){}}]),e}(),sn=function(){function e(){t(this,e)}return n(e,[{key:"addIntersection",value:function(t,e){}},{key:"interfaces_",get:function(){return[an]}}]),e}(),un=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(t){return this._pts[t]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}},{key:"setData",value:function(t){this._data=t}},{key:"safeOctant",value:function(t,e){return t.equals2D(e)?0:on.octant(t,e)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new z(arguments[0].getIntersection(r));this.addIntersection(i,n)}}},{key:"toString",value:function(){return ye.toLineString(new Jt(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value:function(t,e){var n=e,r=n+1;if(r=0&&r>=0||n<=0&&r<=0?Math.max(n,r):0}if(arguments[0]instanceof z){var i=arguments[0];return ht.index(this.p0,this.p1,i)}}},{key:"toGeometry",value:function(t){return t.createLineString([this.p0,this.p1])}},{key:"isVertical",value:function(){return this.p0.x===this.p1.x}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.p0.equals(n.p0)&&this.p1.equals(n.p1)}},{key:"intersection",value:function(t){var e=new me;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null}},{key:"project",value:function(){if(arguments[0]instanceof z){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new z(t);var n=this.projectionFactor(t),r=new z;return r.x=this.p0.x+n*(this.p1.x-this.p0.x),r.y=this.p0.y+n*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof e){var i=arguments[0],o=this.projectionFactor(i.p0),a=this.projectionFactor(i.p1);if(o>=1&&a>=1)return null;if(o<=0&&a<=0)return null;var s=this.project(i.p0);o<0&&(s=this.p0),o>1&&(s=this.p1);var u=this.project(i.p1);return a<0&&(u=this.p0),a>1&&(u=this.p1),new e(s,u)}}},{key:"normalize",value:function(){this.p1.compareTo(this.p0)<0&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(t){return 0===t?this.p0:this.p1}},{key:"distancePerpendicular",value:function(t){return wt.pointToLinePerpendicular(t,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return e.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value:function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?A.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r}},{key:"closestPoints",value:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=A.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||A.isNaN(e))&&(e=1),e}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(t){var e=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),r=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),i=e*e+n*n,o=e*e-n*n,a=t.getX(),s=t.getY();return new z((-o*a-2*e*n*s-2*e*r)/i,(o*s-2*e*n*a-2*n*r)/i)}},{key:"distance",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return wt.segmentToSegment(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof z){var n=arguments[0];return wt.pointToSegment(n,this.p0,this.p1)}}},{key:"pointAlong",value:function(t){var e=new z;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e}},{key:"hashCode",value:function(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=A.doubleToLongBits(this.p1.x);return n^=31*A.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)}},{key:"interfaces_",get:function(){return[x,E]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,0===arguments.length)e.constructor_.call(this,new z,new z);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.p0,t.p1)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.p0=n,this.p1=r}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];e.constructor_.call(this,new z(i,o),new z(a,s))}}},{key:"midPoint",value:function(t,e){return new z((t.x+e.x)/2,(t.y+e.y)/2)}}]),e}(),cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"overlap",value:function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new ln,this._overlapSeg2=new ln}}]),e}(),hn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLineSegment",value:function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}},{key:"computeSelect",value:function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(n-e==1)return r.select(this,e),null;if(!t.intersects(i,o))return null;var a=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=Re.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}}}],[{key:"constructor_",value:function(){if(this._monoChains=new gt,this._index=new Qe,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];dn.constructor_.call(this,t)}}}]),o}(dn),yn=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"overlap",value:function(){if(4!==arguments.length)return p(o(a.prototype),"overlap",this).apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(),i=e.getContext();this._si.processIntersections(r,t,i,n)}}],[{key:"constructor_",value:function(){this._si=null;var t=arguments[0];this._si=t}}]),a}(cn);gn.SegmentOverlapAction=yn;var vn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isDeletable",value:function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,r)&&this.isShallowSampled(i,o,t,n,r)}},{key:"deleteShallowConcavities",value:function(){for(var t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),i=!1;r=0;r--)this.addPt(t[r])}},{key:"isRedundant",value:function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=e.PI_TIMES_2;for(;t<=-Math.PI;)t+=e.PI_TIMES_2;return t}},{key:"angle",value:function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}}},{key:"isAcute",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0}},{key:"isObtuse",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0}},{key:"interiorAngle",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return Math.abs(o-i)}},{key:"normalizePositive",value:function(t){if(t<0){for(;t<0;)t+=e.PI_TIMES_2;t>=e.PI_TIMES_2&&(t=0)}else{for(;t>=e.PI_TIMES_2;)t-=e.PI_TIMES_2;t<0&&(t=0)}return t}},{key:"angleBetween",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return e.diff(i,o)}},{key:"diff",value:function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n}},{key:"toRadians",value:function(t){return t*Math.PI/180}},{key:"getTurn",value:function(t,n){var r=Math.sin(n-t);return r>0?e.COUNTERCLOCKWISE:r<0?e.CLOCKWISE:e.NONE}},{key:"angleBetweenOriented",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r)-i;return o<=-Math.PI?o+e.PI_TIMES_2:o>Math.PI?o-e.PI_TIMES_2:o}}]),e}();_n.PI_TIMES_2=2*Math.PI,_n.PI_OVER_2=Math.PI/2,_n.PI_OVER_4=Math.PI/4,_n.COUNTERCLOCKWISE=ht.COUNTERCLOCKWISE,_n.CLOCKWISE=ht.CLOCKWISE,_n.NONE=ht.COLLINEAR;var bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addNextSegment",value:function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=ht.index(this._s0,this._s1,this._s2),r=n===ht.CLOCKWISE&&this._side===$.LEFT||n===ht.COUNTERCLOCKWISE&&this._side===$.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)}},{key:"addLineEndCap",value:function(t,e){var n=new ln(t,e),r=new ln;this.computeOffsetSegment(n,$.LEFT,this._distance,r);var i=new ln;this.computeOffsetSegment(n,$.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case m.CAP_ROUND:this._segList.addPt(r.p1),this.addDirectedFillet(e,s+Math.PI/2,s-Math.PI/2,ht.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case m.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case m.CAP_SQUARE:var u=new z;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var l=new z(r.p1.x+u.x,r.p1.y+u.y),c=new z(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(t,e,n,r){var i=mt.intersection(e.p0,e.p1,n.p0,n.p1);if(null!==i&&(r<=0?1:i.distance(t)/Math.abs(r))<=this._bufParams.getMitreLimit())return this._segList.addPt(i),null;this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())}},{key:"addOutsideTurn",value:function(t,n){if(this._offset0.p1.distance(this._offset1.p0)=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addDirectedFillet(t,s,c,r,i),this._segList.addPt(n)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value:function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)}},{key:"addLimitedMitreJoin",value:function(t,e,n,r){var i=this._seg0.p1,o=_n.angle(i,this._seg0.p0),a=_n.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,s=_n.normalize(o+a),u=_n.normalize(s+Math.PI),l=r*n,c=n-l*Math.abs(Math.sin(a)),h=i.x+l*Math.cos(u),f=i.y+l*Math.sin(u),p=new z(h,f),d=new ln(i,p),g=d.pointAlongOffset(1,c),y=d.pointAlongOffset(1,-c);this._side===$.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))}},{key:"addDirectedFillet",value:function(t,e,n,r,i){var o=r===ht.CLOCKWISE?-1:1,a=Math.abs(e-n),s=Math.trunc(a/this._filletAngleQuantum+.5);if(s<1)return null;for(var u=a/s,l=new z,c=0;c0){var r=new z((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(r);var i=new z((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(t){var e=new z(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}},{key:"init",value:function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new mn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*e.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===m.JOIN_BEVEL||this._bufParams.getJoinStyle()===m.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,ht.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ln,this._seg1=new ln,this._offset0=new ln,this._offset1=new ln,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new me,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===m.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}}]),e}();bn.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,bn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,bn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,bn.MAX_CLOSING_SEG_LEN_FACTOR=80;var wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getOffsetCurve",value:function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Xt.reverse(o),o}},{key:"computeSingleSidedBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=vn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],$.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{n.addSegments(t,!1);var s=vn.simplify(t,r),u=s.length-1;n.initSideSegments(s[0],s[1],$.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(s[l],!0)}n.addLastSegment(),n.closeRing()}},{key:"computeRingBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);e===$.RIGHT&&(r=-r);var i=vn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;n.addNextSegment(i[a],s)}n.closeRing()}},{key:"computeLineBufferCurve",value:function(t,e){var n=this.simplifyTolerance(this._distance),r=vn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],$.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var a=vn.simplify(t,-n),s=a.length-1;e.initSideSegments(a[s],a[s-1],$.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()}},{key:"computePointCurve",value:function(t,e){switch(this._bufParams.getEndCapStyle()){case m.CAP_ROUND:e.createCircle(t);break;case m.CAP_SQUARE:e.createSquare(t)}}},{key:"getLineCurve",value:function(t,e){if(this._distance=e,this.isLineOffsetEmpty(e))return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()}},{key:"getBufferParameters",value:function(){return this._bufParams}},{key:"simplifyTolerance",value:function(t){return t*this._bufParams.getSimplifyFactor()}},{key:"getRingCurve",value:function(t,n,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return e.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,n,i),i.getCoordinates()}},{key:"computeOffsetCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=vn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],$.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{var s=vn.simplify(t,r),u=s.length-1;n.initSideSegments(s[0],s[1],$.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(s[l],!0)}n.addLastSegment()}},{key:"isLineOffsetEmpty",value:function(t){return 0===t||t<0&&!this._bufParams.isSingleSided()}},{key:"getSegGen",value:function(t){return new bn(this._precisionModel,this._bufParams,t)}}],[{key:"constructor_",value:function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}},{key:"copyCoordinates",value:function(t){for(var e=new Array(t.length).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(it(arguments[2],nt)&&arguments[0]instanceof z&&arguments[1]instanceof Fe){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||ht.index(this._seg.p0,this._seg.p1,o)===ht.RIGHT)){var c=a.getDepth($.LEFT);this._seg.p0.equals(u[l])||(c=a.getDepth($.RIGHT));var h=new On(this._seg,c);s.add(h)}}else if(it(arguments[2],nt)&&arguments[0]instanceof z&&it(arguments[1],nt))for(var f=arguments[0],p=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(f,g,p)}}},{key:"getDepth",value:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:We.min(e)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new ln;var t=arguments[0];this._subgraphs=t}}]),e}(),On=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareTo",value:function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)}},{key:"compareX",value:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)}},{key:"toString",value:function(){return this._upwardSeg.toString()}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new ln(t),this._leftDepth=e}}]),e}();xn.DepthSegment=On;var En=function(e){i(o,e);var r=f(o);function o(){var e;return t(this,o),e=r.call(this),o.constructor_.apply(c(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){_.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}]),o}(_),Sn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getY",value:function(){var t=this.y/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new En;return t}},{key:"getX",value:function(){var t=this.x/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new En;return t}},{key:"getCoordinate",value:function(){var t=new z;return t.x=this.getX(),t.y=this.getY(),t}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof z&&arguments[1]instanceof z){var a=arguments[0],s=arguments[1];this.x=a.y-s.y,this.y=s.x-a.x,this.w=a.x*s.y-s.x*a.y}}else if(3===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(4===arguments.length){var h=arguments[0],f=arguments[1],p=arguments[2],d=arguments[3],g=h.y-f.y,y=f.x-h.x,v=h.x*f.y-f.x*h.y,m=p.y-d.y,_=d.x-p.x,b=p.x*d.y-d.x*p.y;this.x=y*b-_*v,this.y=m*v-g*b,this.w=g*_-m*y}}}]),e}(),Mn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"area",value:function(){return e.area(this.p0,this.p1,this.p2)}},{key:"signedArea",value:function(){return e.signedArea(this.p0,this.p1,this.p2)}},{key:"interpolateZ",value:function(t){if(null===t)throw new b("Supplied point is null.");return e.interpolateZ(t,this.p0,this.p1,this.p2)}},{key:"longestSideLength",value:function(){return e.longestSideLength(this.p0,this.p1,this.p2)}},{key:"isAcute",value:function(){return e.isAcute(this.p0,this.p1,this.p2)}},{key:"circumcentre",value:function(){return e.circumcentre(this.p0,this.p1,this.p2)}},{key:"area3D",value:function(){return e.area3D(this.p0,this.p1,this.p2)}},{key:"centroid",value:function(){return e.centroid(this.p0,this.p1,this.p2)}},{key:"inCentre",value:function(){return e.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_",value:function(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}},{key:"area",value:function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)}},{key:"signedArea",value:function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2}},{key:"det",value:function(t,e,n,r){return t*r-e*n}},{key:"interpolateZ",value:function(t,e,n,r){var i=e.x,o=e.y,a=n.x-i,s=r.x-i,u=n.y-o,l=r.y-o,c=a*l-s*u,h=t.x-i,f=t.y-o,p=(l*h-s*f)/c,d=(-u*h+a*f)/c;return e.getZ()+p*(n.getZ()-e.getZ())+d*(r.getZ()-e.getZ())}},{key:"longestSideLength",value:function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),a=r;return i>a&&(a=i),o>a&&(a=o),a}},{key:"circumcentreDD",value:function(t,e,n){var r=ut.valueOf(t.x).subtract(n.x),i=ut.valueOf(t.y).subtract(n.y),o=ut.valueOf(e.x).subtract(n.x),a=ut.valueOf(e.y).subtract(n.y),s=ut.determinant(r,i,o,a).multiply(2),u=r.sqr().add(i.sqr()),l=o.sqr().add(a.sqr()),c=ut.determinant(i,u,a,l),h=ut.determinant(r,u,o,l),f=ut.valueOf(n.x).subtract(c.divide(s)).doubleValue(),p=ut.valueOf(n.y).add(h.divide(s)).doubleValue();return new z(f,p)}},{key:"isAcute",value:function(t,e,n){return!!_n.isAcute(t,e,n)&&!!_n.isAcute(e,n,t)&&!!_n.isAcute(n,t,e)}},{key:"circumcentre",value:function(t,n,r){var i=r.x,o=r.y,a=t.x-i,s=t.y-o,u=n.x-i,l=n.y-o,c=2*e.det(a,s,u,l),h=e.det(s,a*a+s*s,l,u*u+l*l),f=e.det(a,a*a+s*s,u,u*u+l*l);return new z(i-h/c,o+f/c)}},{key:"perpendicularBisector",value:function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Sn(t.x+n/2,t.y+r/2,1),o=new Sn(t.x-r+n/2,t.y+n+r/2,1);return new Sn(i,o)}},{key:"angleBisector",value:function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,a=n.y-t.y;return new z(t.x+i*o,t.y+i*a)}},{key:"area3D",value:function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.getZ()-t.getZ(),a=n.x-t.x,s=n.y-t.y,u=n.getZ()-t.getZ(),l=i*u-o*s,c=o*a-r*u,h=r*s-i*a,f=l*l+c*c+h*h;return Math.sqrt(f)/2}},{key:"centroid",value:function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new z(r,i)}},{key:"inCentre",value:function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),a=r+i+o,s=(r*t.x+i*e.x+o*n.x)/a,u=(r*t.y+i*e.y+o*n.y)/a;return new z(s,u)}}]),e}(),Cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addRingSide",value:function(t,e,n,r,i){if(0===e&&t.length=qt.MINIMUM_VALID_SIZE&&ht.isCCW(t)&&(o=i,a=r,n=$.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,o,a)}},{key:"addRingBothSides",value:function(t,e){this.addRingSide(t,e,$.LEFT,W.EXTERIOR,W.INTERIOR),this.addRingSide(t,e,$.RIGHT,W.INTERIOR,W.EXTERIOR)}},{key:"addPoint",value:function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,W.EXTERIOR,W.INTERIOR)}},{key:"addPolygon",value:function(t){var e=this._distance,n=$.LEFT;this._distance<0&&(e=-this._distance,n=$.RIGHT);var r=t.getExteriorRing(),i=Xt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addRingSide(i,e,n,W.EXTERIOR,W.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addRingSide(s,e,$.opposite(n),W.INTERIOR,W.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(t,e){var n=new Mn(t[0],t[1],t[2]),r=n.inCentre();return wt.pointToSegment(r,n.p0,n.p1)i}},{key:"addCollection",value:function(t){for(var e=0;e=this._max)throw new H;var t=this._parent.getGeometryN(this._index++);return t instanceof Bt?(this._subcollectionIterator=new e(t),this._subcollectionIterator.next()):t}},{key:"remove",value:function(){throw new Z(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[nn]}}],[{key:"constructor_",value:function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()}},{key:"isAtomic",value:function(t){return!(t instanceof Bt)}}]),e}(),jn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"locate",value:function(t){return e.locate(t,this._geom)}},{key:"interfaces_",get:function(){return[kn]}}],[{key:"constructor_",value:function(){this._geom=null;var t=arguments[0];this._geom=t}},{key:"locatePointInPolygon",value:function(t,n){if(n.isEmpty())return W.EXTERIOR;var r=n.getExteriorRing(),i=e.locatePointInRing(t,r);if(i!==W.INTERIOR)return i;for(var o=0;o=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)}},{key:"computeDepths",value:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth($.LEFT),r=t.getDepth($.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new pt("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],a=arguments[2],s=arguments[0];s=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;n=a,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(D.isTrue(null!==e,"found null for first outgoing dirEdge"),D.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))}},{key:"getOutgoingDegree",value:function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var t=W.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=W.INTERIOR;break}if(r.isInResult()){t=W.EXTERIOR;break}}}if(t===W.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===W.INTERIOR):(a.isInResult()&&(i=W.EXTERIOR),s.isInResult()&&(i=W.INTERIOR))}}},{key:"computeLabelling",value:function(t){p(o(a.prototype),"computeLabelling",this).call(this,t),this._label=new xe(W.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(),r=0;r<2;r++){var i=n.getLocation(r);i!==W.INTERIOR&&i!==W.BOUNDARY||this._label.setLocation(r,W.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}]),a}(function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getNextCW",value:function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)}},{key:"propagateSideLabels",value:function(t){for(var e=W.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,$.LEFT)!==W.NONE&&(e=r.getLocation(t,$.LEFT))}if(e===W.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getLabel();if(s.getLocation(t,$.ON)===W.NONE&&s.setLocation(t,$.ON,i),s.isArea(t)){var u=s.getLocation(t,$.LEFT),l=s.getLocation(t,$.RIGHT);if(l!==W.NONE){if(l!==i)throw new pt("side location conflict",a.getCoordinate());u===W.NONE&&D.shouldNeverReachHere("found single null side (at "+a.getCoordinate()+")"),i=u}else D.isTrue(s.getLocation(t,$.LEFT)===W.NONE,"found single null side"),s.setLocation(t,$.RIGHT,i),s.setLocation(t,$.LEFT,i)}}}},{key:"getCoordinate",value:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null}},{key:"print",value:function(t){_t.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"isAreaLabelsConsistent",value:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}},{key:"checkAreaLabelsConsistent",value:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,$.LEFT);D.isTrue(r!==W.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var a=o.next().getLabel();D.isTrue(a.isArea(t),"Found non-area edge");var s=a.getLocation(t,$.LEFT),u=a.getLocation(t,$.RIGHT);if(s===u)return!1;if(u!==i)return!1;i=s}return!0}},{key:"findIndex",value:function(t){this.iterator();for(var e=0;e0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")}},{key:"addAll",value:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())}},{key:"findEdgeIndex",value:function(t){for(var e=0;et?1:this.diste?1:0}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new z(t),this.segmentIndex=e,this.dist=n}}]),e}(),Dn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}}},{key:"addEndpoints",value:function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)}},{key:"createSplitEdge",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new z(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new Vn(o,new xe(this.edge._label))}},{key:"add",value:function(t,e,n){var r=new Fn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)}},{key:"isIntersection",value:function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new Ie,this.edge=null;var t=arguments[0];this.edge=t}}]),e}(),Bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])||e.isTrue(this._matrix[W.INTERIOR][W.BOUNDARY])||e.isTrue(this._matrix[W.BOUNDARY][W.INTERIOR])||e.isTrue(this._matrix[W.BOUNDARY][W.BOUNDARY]))&&this._matrix[W.EXTERIOR][W.INTERIOR]===Ct.FALSE&&this._matrix[W.EXTERIOR][W.BOUNDARY]===Ct.FALSE}},{key:"isCoveredBy",value:function(){return(e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])||e.isTrue(this._matrix[W.INTERIOR][W.BOUNDARY])||e.isTrue(this._matrix[W.BOUNDARY][W.INTERIOR])||e.isTrue(this._matrix[W.BOUNDARY][W.BOUNDARY]))&&this._matrix[W.INTERIOR][W.EXTERIOR]===Ct.FALSE&&this._matrix[W.BOUNDARY][W.EXTERIOR]===Ct.FALSE}},{key:"set",value:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e=0&&e>=0&&this.setAtLeast(t,e,n)}},{key:"isWithin",value:function(){return e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&this._matrix[W.INTERIOR][W.EXTERIOR]===Ct.FALSE&&this._matrix[W.BOUNDARY][W.EXTERIOR]===Ct.FALSE}},{key:"isTouches",value:function(t,n){return t>n?this.isTouches(n,t):(t===Ct.A&&n===Ct.A||t===Ct.L&&n===Ct.L||t===Ct.L&&n===Ct.A||t===Ct.P&&n===Ct.A||t===Ct.P&&n===Ct.L)&&this._matrix[W.INTERIOR][W.INTERIOR]===Ct.FALSE&&(e.isTrue(this._matrix[W.INTERIOR][W.BOUNDARY])||e.isTrue(this._matrix[W.BOUNDARY][W.INTERIOR])||e.isTrue(this._matrix[W.BOUNDARY][W.BOUNDARY]))}},{key:"isOverlaps",value:function(t,n){return t===Ct.P&&n===Ct.P||t===Ct.A&&n===Ct.A?e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&e.isTrue(this._matrix[W.INTERIOR][W.EXTERIOR])&&e.isTrue(this._matrix[W.EXTERIOR][W.INTERIOR]):t===Ct.L&&n===Ct.L&&1===this._matrix[W.INTERIOR][W.INTERIOR]&&e.isTrue(this._matrix[W.INTERIOR][W.EXTERIOR])&&e.isTrue(this._matrix[W.EXTERIOR][W.INTERIOR])}},{key:"isEquals",value:function(t,n){return t===n&&e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&this._matrix[W.INTERIOR][W.EXTERIOR]===Ct.FALSE&&this._matrix[W.BOUNDARY][W.EXTERIOR]===Ct.FALSE&&this._matrix[W.EXTERIOR][W.INTERIOR]===Ct.FALSE&&this._matrix[W.EXTERIOR][W.BOUNDARY]===Ct.FALSE}},{key:"toString",value:function(){for(var t=new Kt("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,Ct.toDimensionSymbol(this._matrix[e][n]));return t.toString()}},{key:"setAll",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this._matrix[e][n]=t}},{key:"get",value:function(t,e){return this._matrix[t][e]}},{key:"transpose",value:function(){var t=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=t,t=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=t,t=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=t,this}},{key:"matches",value:function(t){if(9!==t.length)throw new b("Should be length 9: "+t);for(var n=0;n<3;n++)for(var r=0;r<3;r++)if(!e.matches(this._matrix[n][r],t.charAt(3*n+r)))return!1;return!0}},{key:"add",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))}},{key:"isDisjoint",value:function(){return this._matrix[W.INTERIOR][W.INTERIOR]===Ct.FALSE&&this._matrix[W.INTERIOR][W.BOUNDARY]===Ct.FALSE&&this._matrix[W.BOUNDARY][W.INTERIOR]===Ct.FALSE&&this._matrix[W.BOUNDARY][W.BOUNDARY]===Ct.FALSE}},{key:"isCrosses",value:function(t,n){return t===Ct.P&&n===Ct.L||t===Ct.P&&n===Ct.A||t===Ct.L&&n===Ct.A?e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&e.isTrue(this._matrix[W.INTERIOR][W.EXTERIOR]):t===Ct.L&&n===Ct.P||t===Ct.A&&n===Ct.P||t===Ct.A&&n===Ct.L?e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&e.isTrue(this._matrix[W.EXTERIOR][W.INTERIOR]):t===Ct.L&&n===Ct.L&&0===this._matrix[W.INTERIOR][W.INTERIOR]}},{key:"interfaces_",get:function(){return[O]}}],[{key:"constructor_",value:function(){if(this._matrix=null,0===arguments.length)this._matrix=Array(3).fill().map((function(){return Array(3)})),this.setAll(Ct.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];e.constructor_.call(this),this.set(t)}else if(arguments[0]instanceof e){var n=arguments[0];e.constructor_.call(this),this._matrix[W.INTERIOR][W.INTERIOR]=n._matrix[W.INTERIOR][W.INTERIOR],this._matrix[W.INTERIOR][W.BOUNDARY]=n._matrix[W.INTERIOR][W.BOUNDARY],this._matrix[W.INTERIOR][W.EXTERIOR]=n._matrix[W.INTERIOR][W.EXTERIOR],this._matrix[W.BOUNDARY][W.INTERIOR]=n._matrix[W.BOUNDARY][W.INTERIOR],this._matrix[W.BOUNDARY][W.BOUNDARY]=n._matrix[W.BOUNDARY][W.BOUNDARY],this._matrix[W.BOUNDARY][W.EXTERIOR]=n._matrix[W.BOUNDARY][W.EXTERIOR],this._matrix[W.EXTERIOR][W.INTERIOR]=n._matrix[W.EXTERIOR][W.INTERIOR],this._matrix[W.EXTERIOR][W.BOUNDARY]=n._matrix[W.EXTERIOR][W.BOUNDARY],this._matrix[W.EXTERIOR][W.EXTERIOR]=n._matrix[W.EXTERIOR][W.EXTERIOR]}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],n=arguments[1];return n===Ct.SYM_DONTCARE||n===Ct.SYM_TRUE&&(t>=0||t===Ct.TRUE)||n===Ct.SYM_FALSE&&t===Ct.FALSE||n===Ct.SYM_P&&t===Ct.P||n===Ct.SYM_L&&t===Ct.L||n===Ct.SYM_A&&t===Ct.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var r=arguments[1];return new e(arguments[0]).matches(r)}}},{key:"isTrue",value:function(t){return t>=0||t===Ct.TRUE}}]),e}(),Gn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(t){return null===t||0===t.length?null:(this.ensureCapacity(this._size+t.length),_t.arraycopy(t,0,this._data,this._size,t.length),void(this._size+=t.length))}},{key:"ensureCapacity",value:function(t){if(t<=this._data.length)return null;var e=Math.max(t,2*this._data.length);this._data=At.copyOf(this._data,e)}},{key:"toArray",value:function(){var t=new Array(this._size).fill(null);return _t.arraycopy(this._data,0,t,0,this._size),t}},{key:"add",value:function(t){this.ensureCapacity(this._size+1),this._data[this._size]=t,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,0===arguments.length)e.constructor_.call(this,10);else if(1===arguments.length){var t=arguments[0];this._data=new Array(t).fill(null)}}}]),e}(),qn=function(){function e(){t(this,e)}return n(e,[{key:"getChainStartIndices",value:function(t){var e=0,n=new Gn(Math.trunc(t.length/2));n.add(e);do{var r=this.findChainEnd(t,e);n.add(r),e=r}while(en?e:n}},{key:"getMinX",value:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(r=1),this._depth[t][n]=r}}}},{key:"getDelta",value:function(t){return this._depth[t][$.RIGHT]-this._depth[t][$.LEFT]}},{key:"getLocation",value:function(t,e){return this._depth[t][e]<=0?W.EXTERIOR:W.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(1===arguments.length)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=t.getLocation(n,r);i!==W.EXTERIOR&&i!==W.INTERIOR||(this.isNull(n,r)?this._depth[n][r]=e.depthAtLocation(i):this._depth[n][r]+=e.depthAtLocation(i))}else if(3===arguments.length){var o=arguments[0],a=arguments[1];arguments[2]===W.INTERIOR&&this._depth[o][a]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var t=0;t<2;t++)for(var n=0;n<3;n++)this._depth[t][n]=e.NULL_VALUE}},{key:"depthAtLocation",value:function(t){return t===W.EXTERIOR?0:t===W.INTERIOR?1:e.NULL_VALUE}}]),e}();Un.NULL_VALUE=-1;var Vn=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new a(t,xe.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(t){this._isIsolated=t}},{key:"setName",value:function(t){this._name=t}},{key:"equals",value:function(t){if(!(t instanceof a))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;o0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}}},{key:"print",value:function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)}},{key:"computeIM",value:function(t){a.updateIM(this._label,t)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")}},{key:"getMonotoneChainEdge",value:function(){return null===this._mce&&(this._mce=new zn(this)),this._mce}},{key:"getEnvelope",value:function(){if(null===this._env){this._env=new V;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()}},{key:"isPointwiseEqual",value:function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;er||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return D.isTrue(!(a&&s),"Found bad envelope test"),s}},{key:"initCorners",value:function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new z(this._maxx,this._maxy),this._corner[1]=new z(this._minx,this._maxy),this._corner[2]=new z(this._minx,this._miny),this._corner[3]=new z(this._maxx,this._miny)}},{key:"intersects",value:function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}},{key:"scale",value:function(t){return Math.round(t*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}},{key:"getSafeEnvelope",value:function(){if(null===this._safeEnv){var t=e.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new V(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv}},{key:"intersectsPixelClosure",value:function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))}},{key:"intersectsToleranceSquare",value:function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))}},{key:"addSnappedNode",value:function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)}}],[{key:"constructor_",value:function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new b("Scale factor must be non-zero");1!==e&&(this._pt=new z(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new z,this._p1Scaled=new z),this.initCorners(this._pt)}}]),e}();Hn.SAFE_ENV_EXPANSION_FACTOR=.75;var Zn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"select",value:function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}],[{key:"constructor_",value:function(){this.selectedSegment=new ln}}]),e}(),Kn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"snap",value:function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=r.getSafeEnvelope(),s=new Jn(r,i,o);return this._index.query(a,new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[Ze]}},{key:"visitItem",value:function(t){t.select(a,s)}}]),e}())),s.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var t=arguments[0];this._index=t}}]),e}(),Jn=function(e){i(a,e);var r=f(a);function a(){var e;return t(this,a),e=r.call(this),a.constructor_.apply(c(e),arguments),e}return n(a,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(2===arguments.length&&Number.isInteger(arguments[1])&&arguments[0]instanceof hn))return p(o(a.prototype),"select",this).apply(this,arguments);var t=arguments[1],e=arguments[0].getContext();if(this._parentEdge===e&&(t===this._hotPixelVertexIndex||t+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(e,t)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=n}}]),a}(Zn);Kn.HotPixelSnapAction=Jn;var Qn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"processIntersections",value:function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof pt))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=e.precisionScaleFactor(this._argGeom,this._distance,n),i=new ne(r);this.bufferFixedPrecision(i)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ne.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(t){this._bufParams.setQuadrantSegments(t)}},{key:"bufferOriginalPrecision",value:function(){try{var t=new Yn(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof T))throw t;this._saveException=t}}},{key:"getResultGeometry",value:function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(t){this._bufParams.setEndCapStyle(t)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new m,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}}},{key:"bufferOp",value:function(){if(2===arguments.length){var t=arguments[1];return new e(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Y&&"number"==typeof arguments[1]){var n=arguments[1],r=arguments[2],i=new e(arguments[0]);return i.setQuadrantSegments(r),i.getResultGeometry(n)}if(arguments[2]instanceof m&&arguments[0]instanceof Y&&"number"==typeof arguments[1]){var o=arguments[1];return new e(arguments[0],arguments[2]).getResultGeometry(o)}}else if(4===arguments.length){var a=arguments[1],s=arguments[2],u=arguments[3],l=new e(arguments[0]);return l.setQuadrantSegments(s),l.setEndCapStyle(u),l.getResultGeometry(a)}}},{key:"precisionScaleFactor",value:function(t,e,n){var r=t.getEnvelopeInternal(),i=bt.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)}}]),e}();tr.CAP_ROUND=m.CAP_ROUND,tr.CAP_BUTT=m.CAP_FLAT,tr.CAP_FLAT=m.CAP_FLAT,tr.CAP_SQUARE=m.CAP_SQUARE,tr.MAX_PRECISION_DIGITS=12;var er=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],nr=function(){function e(n){t(this,e),this.geometryFactory=n||new oe}return n(e,[{key:"read",value:function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!rr[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==er.indexOf(n)?rr[n].call(this,e.coordinates):"GeometryCollection"===n?rr[n].call(this,e.geometries):rr[n].call(this,e)}},{key:"write",value:function(t){var e=t.getGeometryType();if(!ir[e])throw new Error("Geometry is not supported");return ir[e].call(this,t)}}]),e}(),rr={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!rr[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=rr.bbox.call(this,t.bbox)),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n1?0:t<-1?Cn:Math.acos(t)}function Gn(t){return t>1?kn:t<-1?-kn:Math.asin(t)}function qn(){}function zn(t,e){t&&Wn.hasOwnProperty(t.type)&&Wn[t.type](t,e)}var Un,Vn,Yn={Feature:function(t,e){zn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rCn?t-jn:t<-Cn?t+jn:t,e]}function ir(t){return function(e,n){return[(e+=t)>Cn?e-jn:e<-Cn?e+jn:e,n]}}function or(t){var e=ir(t);return e.invert=ir(-t),e}function ar(t,e){var n=Tn(t),r=Fn(t),i=Tn(e),o=Fn(e);function a(t,e){var a=Tn(e),s=Tn(t)*a,u=Fn(t)*a,l=Fn(e),c=l*n+s*r;return[Rn(u*i-c*o,s*n-l*r),Gn(c*i+u*o)]}return a.invert=function(t,e){var a=Tn(e),s=Tn(t)*a,u=Fn(t)*a,l=Fn(e),c=l*i-u*o;return[Rn(u*i+l*o,s*n+c*r),Gn(c*n-s*r)]},a}function sr(t,e){(e=Kn(e))[0]-=t,er(e);var n=Bn(-e[1]);return((-e[2]<0?-n:n)+jn-Mn)%jn}function ur(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:qn,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function lr(t,e){return In(t[0]-e[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function fr(t){if(e=t.length){for(var e,n,r=0,i=t[0];++re?1:t>=e?0:NaN}function dr(t){for(var e,n,r,i=t.length,o=-1,a=0;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n}xn(),xn(),xn(),rr.invert=rr,1===(Un=pr).length&&(Vn=Un,Un=function(t,e){return pr(Vn(t),e)});var gr=1e9,yr=-gr;function vr(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var c=0,h=0;if(null==i||(c=a(i,s))!==(h=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==h);else l.point(o[0],o[1])}function a(r,i){return In(r[0]-t)0?0:3:In(r[0]-n)0?2:1:In(r[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,h,f,p,d,g,y,v,m,_=a,b=ur(),w={point:x,lineStart:function(){w.point=O,l&&l.push(c=[]),v=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(O(h,f),p&&y&&b.rejoin(),u.push(b.result())),w.point=x,y&&_.lineEnd()},polygonStart:function(){_=b,u=[],l=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(f-o)*(r-a)>(p-a)*(t-o)&&++e:p<=r&&(f-o)*(r-a)<(p-a)*(t-o)&&--e;return e}(),n=m&&e,i=(u=dr(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&hr(u,s,e,o,a),a.polygonEnd()),_=a,u=l=c=null}};function x(t,e){i(t,e)&&_.point(t,e)}function O(o,a){var s=i(o,a);if(l&&c.push([o,a]),v)h=o,f=a,p=s,v=!1,s&&(_.lineStart(),_.point(o,a));else if(s&&y)_.point(o,a);else{var u=[d=Math.max(yr,Math.min(gr,d)),g=Math.max(yr,Math.min(gr,g))],b=[o=Math.max(yr,Math.min(gr,o)),a=Math.max(yr,Math.min(gr,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],l=0,c=1,h=e[0]-s,f=e[1]-u;if(a=n-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0&&(t[0]=s+l*h,t[1]=u+l*f),c<1&&(e[0]=s+c*h,e[1]=u+c*f),!0}}}}}(u,b,t,e,n,r)?s&&(_.lineStart(),_.point(o,a),m=!1):(y||(_.lineStart(),_.point(u[0],u[1])),_.point(b[0],b[1]),s||_.lineEnd(),m=!1)}d=o,g=a,y=s}return w}}var mr=xn();function _r(t){return t}xn(),xn(),xn();var br=1/0,wr=br,xr=-br,Or=xr,Er={point:function(t,e){txr&&(xr=t),eOr&&(Or=e)},lineStart:qn,lineEnd:qn,polygonStart:qn,polygonEnd:qn,result:function(){var t=[[br,wr],[xr,Or]];return xr=Or=-(wr=br=1/0),t}};function Sr(t,e,n,r){return function(i,o){var a,s,u,l=e(o),c=i.invert(r[0],r[1]),h=ur(),f=e(h),p=!1,d={point:g,lineStart:v,lineEnd:m,polygonStart:function(){d.point=_,d.lineStart=b,d.lineEnd=w,s=[],a=[]},polygonEnd:function(){d.point=g,d.lineStart=v,d.lineEnd=m,s=dr(s);var t=function(t,e){var n=e[0],r=e[1],i=[Fn(n),-Tn(n),0],o=0,a=0;mr.reset();for(var s=0,u=t.length;s=0?1:-1,E=O*x,S=E>Cn,M=d*b;if(mr.add(Rn(M*O*Fn(E),g*w+M*Tn(E))),o+=S?x+O*jn:x,S^f>=n^m>=n){var C=Qn(Kn(h),Kn(v));er(C);var k=Qn(i,C);er(k);var N=(S^x>=0?-1:1)*Gn(k[2]);(r>N||r===N&&(C[0]||C[1]))&&(a+=S^x>=0?1:-1)}}return(o<-Mn||o0){for(p||(o.polygonStart(),p=!0),o.lineStart(),t=0;t1&&2&i&&l.push(l.pop().concat(l.shift())),s.push(l.filter(Mr))}return d}}function Mr(t){return t.length>1}function Cr(t,e){return((t=t.x)[0]<0?t[1]-kn-Mn:kn-t[1])-((e=e.x)[0]<0?e[1]-kn-Mn:kn-e[1])}xn();var kr=Sr((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Cn:-Cn,u=In(o-n);In(u-Cn)0?kn:-kn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=Cn&&(In(n-i)Mn?An((Fn(e)*(o=Tn(r))*Fn(n)-Fn(r)*(i=Tn(e))*Fn(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*kn,r.point(-Cn,i),r.point(0,i),r.point(Cn,i),r.point(Cn,0),r.point(Cn,-i),r.point(0,-i),r.point(-Cn,-i),r.point(-Cn,0),r.point(-Cn,i);else if(In(t[0]-e[0])>Mn){var o=t[0]0,i=In(n)>Mn;function o(t,e){return Tn(t)*Tn(e)>n}function a(t,e,r){var i=[1,0,0],o=Qn(Kn(t),Kn(e)),a=Jn(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var l=n*a/u,c=-n*s/u,h=Qn(i,o),f=tr(i,l);$n(f,tr(o,c));var p=h,d=Jn(f,p),g=Jn(p,p),y=d*d-g*(Jn(f,f)-1);if(!(y<0)){var v=Dn(y),m=tr(p,(-d-v)/g);if($n(m,f),m=Zn(m),!r)return m;var _,b=t[0],w=e[0],x=t[1],O=e[1];w0^m[1]<(In(m[0]-b)Cn^(b<=m[0]&&m[0]<=w)){var M=tr(p,(-d+v)/g);return $n(M,f),[m,Zn(M)]}}}function s(e,n){var i=r?t:Cn-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Sr(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var p,d=[h,f],g=o(h,f),y=r?g?0:s(h,f):g?s(h+(h<0?Cn:-Cn),f):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(p=a(e,d))||lr(e,p)||lr(d,p))&&(d[0]+=Mn,d[1]+=Mn,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(i&&e&&r^g){var v;y&n||!(v=a(d,e,!0))||(c=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&lr(e,d)||t.point(d[0],d[1]),e=d,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var a=Tn(e),s=Fn(e),u=r*n;null==i?(i=e+r*jn,o=e-u/2):(i=sr(a,i),o=sr(a,o),(r>0?io)&&(i+=r*jn));for(var l,c=i;r>0?c>o:c4*e&&g--){var b=a+f,w=s+p,x=u+d,O=Dn(b*b+w*w+x*x),E=Gn(x/=O),S=In(In(x)-1)e||In((v*N+m*j)/_-.5)>.3||a*f+s*p+u*d2?t[2]%360*Pn:0,k()):[y*Ln,v*Ln,m*Ln]},S.precision=function(t){return arguments.length?(E=Ar(C,O=t*t),N()):Dn(O)},S.fitExtent=function(t,e){return Pr(S,t,e)},S.fitSize=function(t,e){return function(t,e,n){return Pr(t,[[0,0],e],n)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&M,k()}}((function(){return t}))()}(Dr).scale(79.4188).clipAngle(179.999)}function Gr(t,e){return[t,e]}Dr.invert=Fr((function(t){return t})),Gr.invert=Gr;var qr=wn.BufferOp,zr=wn.GeoJSONReader,Ur=wn.GeoJSONWriter;function Vr(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var a=[];return ft(t,(function(t){var i=Vr(t,e,n,r);i&&a.push(i)})),S(a)}var s=function(t){var e=_n(t).geometry.coordinates,n=[-e[0],-e[1]];return Br().rotate(n).scale(d)}(o),u={type:o.type,coordinates:Yr(o.coordinates,s)},l=(new zr).read(u),c=L(P(e,n),"meters"),h=qr.bufferOp(l,c,r);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((h=(new Ur).write(h)).coordinates))return v({type:h.type,coordinates:Wr(h.coordinates,s)},i)}function Yr(t,e){return"object"!==r(t[0])?e(t):t.map((function(t){return Yr(t,e)}))}function Wr(t,e){return"object"!==r(t[0])?e.invert(t):t.map((function(t){return Wr(t,e)}))}function Xr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return ft(t,(function(t,o,a){var s=e.weight?null==a?void 0:a[e.weight]:void 0;if(!G(s=null==s?1:s))throw new Error("weight value must be a number for feature index "+o);(s=Number(s))>0&&ot(t,(function(t){n+=t[0]*s,r+=t[1]*s,i+=s}))})),_([n/i,r/i],e.properties,e)}function Hr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return ot(t,(function(t){n+=t[0],r+=t[1],i++}),!0),_([n/i,r/i],e.properties)}function Zr(t,e,n,r,i){var o=r.tolerance||.001,a=0,s=0,u=0,l=0;if(lt(n,(function(e){var n,r=null==(n=e.properties)?void 0:n.weight,i=null==r?1:r;if(!G(i=Number(i)))throw new Error("weight value must be a number");if(i>0){l+=1;var o=i*nt(e,t);0===o&&(o=1);var c=i/o;a+=e.geometry.coordinates[0]*c,s+=e.geometry.coordinates[1]*c,u+=c}})),l<1)throw new Error("no features to measure");var c=a/u,h=s/u;return 1===l||0===i||Math.abs(c-e[0])0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$r;if(i(this,t),this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}return a(t,[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}},{key:"_down",value:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}}]),t}();function $r(t,e){return te?1:0}var ti=rn(Object.freeze({__proto__:null,default:Qr})),ei={exports:{}},ni=function(t,e,n,r){var i=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var s=(r-n)/2,u=0,l=s-1;uo!=p>o&&i<(f-c)*(o-h)/(p-h)+c&&(a=!a)}return a},ri=function(t,e,n,r){var i=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var s=r-n,u=0,l=s-1;uo!=p>o&&i<(f-c)*(o-h)/(p-h)+c&&(a=!a)}return a};ei.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?ri(t,e,n,r):ni(t,e,n,r)},ei.exports.nested=ri,ei.exports.flat=ni;var ii=ei.exports,oi={exports:{}};!function(t,e){!function(t){var e=134217729;function n(t,e,n,r,i){var o,a,s,u,l=e[0],c=r[0],h=0,f=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++f]);var p=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=e[++h]):(s=o-((a=c+o)-c),c=r[++f]),o=a,0!==s&&(i[p++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=e[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=r[++f]),o=a,0!==s&&(i[p++]=s);for(;h0!=d>0)return g;var y=Math.abs(p+d);return Math.abs(g)>=33306690738754716e-32*y?g:-function(t,r,l,c,h,f,p){var d,g,y,v,m,_,b,w,x,O,E,S,M,C,k,N,j,L,P=t-h,I=l-h,A=r-f,R=c-f;m=(k=(w=P-(b=(_=e*P)-(_-P)))*(O=R-(x=(_=e*R)-(_-R)))-((C=P*R)-b*x-w*x-b*O))-(E=k-(j=(w=A-(b=(_=e*A)-(_-A)))*(O=I-(x=(_=e*I)-(_-I)))-((N=A*I)-b*x-w*x-b*O))),i[0]=k-(E+m)+(m-j),m=(M=C-((S=C+E)-(m=S-C))+(E-m))-(E=M-N),i[1]=M-(E+m)+(m-N),m=(L=S+E)-S,i[2]=S-(L-m)+(E-m),i[3]=L;var T=function(t,e){for(var n=e[0],r=1;r<4;r++)n+=e[r];return n}(0,i),F=22204460492503146e-32*p;if(T>=F||-T>=F)return T;if(d=t-(P+(m=t-P))+(m-h),y=l-(I+(m=l-I))+(m-h),g=r-(A+(m=r-A))+(m-f),v=c-(R+(m=c-R))+(m-f),0===d&&0===g&&0===y&&0===v)return T;if(F=11093356479670487e-47*p+33306690738754706e-32*Math.abs(T),(T+=P*v+R*d-(A*y+I*g))>=F||-T>=F)return T;m=(k=(w=d-(b=(_=e*d)-(_-d)))*(O=R-(x=(_=e*R)-(_-R)))-((C=d*R)-b*x-w*x-b*O))-(E=k-(j=(w=g-(b=(_=e*g)-(_-g)))*(O=I-(x=(_=e*I)-(_-I)))-((N=g*I)-b*x-w*x-b*O))),u[0]=k-(E+m)+(m-j),m=(M=C-((S=C+E)-(m=S-C))+(E-m))-(E=M-N),u[1]=M-(E+m)+(m-N),m=(L=S+E)-S,u[2]=S-(L-m)+(E-m),u[3]=L;var D=n(4,i,4,u,o);m=(k=(w=P-(b=(_=e*P)-(_-P)))*(O=v-(x=(_=e*v)-(_-v)))-((C=P*v)-b*x-w*x-b*O))-(E=k-(j=(w=A-(b=(_=e*A)-(_-A)))*(O=y-(x=(_=e*y)-(_-y)))-((N=A*y)-b*x-w*x-b*O))),u[0]=k-(E+m)+(m-j),m=(M=C-((S=C+E)-(m=S-C))+(E-m))-(E=M-N),u[1]=M-(E+m)+(m-N),m=(L=S+E)-S,u[2]=S-(L-m)+(E-m),u[3]=L;var B=n(D,o,4,u,a);m=(k=(w=d-(b=(_=e*d)-(_-d)))*(O=v-(x=(_=e*v)-(_-v)))-((C=d*v)-b*x-w*x-b*O))-(E=k-(j=(w=g-(b=(_=e*g)-(_-g)))*(O=y-(x=(_=e*y)-(_-y)))-((N=g*y)-b*x-w*x-b*O))),u[0]=k-(E+m)+(m-j),m=(M=C-((S=C+E)-(m=S-C))+(E-m))-(E=M-N),u[1]=M-(E+m)+(m-N),m=(L=S+E)-S,u[2]=S-(L-m)+(E-m),u[3]=L;var G=n(B,a,4,u,s);return s[G-1]}(t,r,l,c,h,f,y)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,oi.exports);var ai=Jr,si=ti,ui=ii,li=oi.exports.orient2d;function ci(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;or[0]&&(r=a),a[1]i[1]&&(i=a)}var s=[e,n,r,i],u=s.slice();for(o=0;o=2&&yi(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&yi(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(u)}(t),i=new ai(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,e){return t[0]-e[0]},i.compareMinY=function(t,e){return t[1]-e[1]},i.load(t);for(var o,a=[],s=0;so||s.push({node:c,dist:h})}for(;s.length&&!s.peek().node.children;){var f=s.pop(),p=f.node,d=bi(p,e,n),g=bi(p,r,i);if(f.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function gi(t,e,n){for(var r,i,o,a,s=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),l=Math.max(t[0],e[0]),c=Math.max(t[1],e[1]),h=n.search({minX:s,minY:u,maxX:l,maxY:c}),f=0;f0!=yi(r,i,a)>0&&yi(o,a,r)>0!=yi(o,a,i)>0)return!1;return!0}function yi(t,e,n){return li(t[0],t[1],e[0],e[1],n[0],n[1])}function vi(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function mi(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function _i(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function bi(t,e,n){var r=e[0],i=e[1],o=n[0]-r,a=n[1]-i;if(0!==o||0!==a){var s=((t[0]-r)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(r=n[0],i=n[1]):s>0&&(r+=o*s,i+=a*s)}return(o=t[0]-r)*o+(a=t[1]-i)*a}function wi(t,e,n,r,i,o,a,s){var u,l,c,h,f=n-t,p=r-e,d=a-i,g=s-o,y=t-i,v=e-o,m=f*f+p*p,_=f*d+p*g,b=d*d+g*g,w=f*y+p*v,x=d*y+g*v,O=m*b-_*_,E=O,S=O;0===O?(l=0,E=1,h=x,S=b):(h=m*x-_*w,(l=_*x-b*w)<0?(l=0,h=x,S=b):l>E&&(l=E,h=x+_,S=b)),h<0?(h=0,-w<0?l=0:-w>m?l=E:(l=-w,E=m)):h>S&&(h=S,-w+_<0?l=0:-w+_>m?l=E:(l=-w+_,E=m));var M=(1-(c=0===h?0:h/S))*i+c*a-((1-(u=0===l?0:l/E))*t+u*n),C=(1-c)*o+c*s-((1-u)*e+u*r);return M*M+C*C}function xi(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}si.default&&(si=si.default),Kr.exports=ci,Kr.exports.default=ci;var Oi=nn(Kr.exports);function Ei(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.concavity=e.concavity||1/0;var n=[];if(ot(t,(function(t){n.push([t[0],t[1]])})),!n.length)return null;var r=Oi(n,e.concavity);return r.length>3?w([r]):null}function Si(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.steps||64,i=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],a=0;a0;r.length0;){var s=t[Math.floor(Math.random()*o)],u=a?s.join("_"):""+s;n[u]||(n[u]=!0,r.push(s))}if(r.length0,a=t[Math.floor(Math.random()*i)];for(o&&a.join("_"),r.push(a);r.length0,p=[];if(n)i="kmrand"==n?Wi(t,e):"kmpp"==n?Xi(t,e):n;else for(var d={};i.lengthh&&(h=t[s].y);var f,p=l-u,d=h-c,g=p>d?p:d,y=.5*(l+u),v=.5*(h+c),m=[new Qi({__sentinel:!0,x:y-20*g,y:v-g},{__sentinel:!0,x:y,y:v+20*g},{__sentinel:!0,x:y+20*g,y:v-g})],_=[],b=[];for(s=t.length;s--;){for(b.length=0,f=m.length;f--;)(p=t[s].x-m[f].x)>0&&p*p>m[f].r?(_.push(m[f]),m.splice(f,1)):p*p+(d=t[s].y-m[f].y)*d>m[f].r||(b.push(m[f].a,m[f].b,m[f].b,m[f].c,m[f].c,m[f].a),m.splice(f,1));for(to(b),f=b.length;f;)n=b[--f],e=b[--f],r=t[s],i=n.x-e.x,o=n.y-e.y,a=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(a)>1e-12&&m.push(new Qi(e,n,r))}for(Array.prototype.push.apply(_,m),s=_.length;s--;)(_[s].a.__sentinel||_[s].b.__sentinel||_[s].c.__sentinel)&&_.splice(s,1);return _}(t.features.map((function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r}))).map((function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},w([[e,r,i,e]],o)})))}var Qi=a((function t(e,n,r){i(this,t),this.a=e,this.b=n,this.c=r;var o,a,s=n.x-e.x,u=n.y-e.y,l=r.x-e.x,c=r.y-e.y,h=s*(e.x+n.x)+u*(e.y+n.y),f=l*(e.x+r.x)+c*(e.y+r.y),p=2*(s*(r.y-n.y)-u*(r.x-n.x));this.x=(c*h-u*f)/p,this.y=(s*f-l*h)/p,o=this.x-e.x,a=this.y-e.y,this.r=o*o+a*a}));function $i(t,e){return e.x-t.x}function to(t){var e,n,r,i,o,a=t.length;t:for(;a;)for(n=t[--a],e=t[--a],r=a;r;)if(o=t[--r],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(a,2),t.splice(r,2),a-=2;continue t}}function eo(t){return t}function no(t,e){var n=function(t){if(null==t)return eo;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*r+o,c[1]=(n+=t[1])*i+a;u1)for(var o,s,u=1,l=a(i[0]);ul&&(s=i[0],i[0]=i[u],i[u]=s,l=o);return i})).filter((function(t){return t.length>0}))}}var oo=Object.prototype.hasOwnProperty;function ao(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var a=new r(t=1<=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=r,s[l]=o,o},maybeSet:function(r,o){for(var l=e(r)&u,c=a[l],h=0;c!=i;){if(n(c,r))return s[l];if(++h>=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=r,s[l]=o,o},get:function(r,o){for(var l=e(r)&u,c=a[l],h=0;c!=i;){if(n(c,r))return s[l];if(++h>=t)break;c=a[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,n=a.length;e>7^co[2]^co[3])}function fo(t,e,n,r){po(t,e,n),po(t,e,e+r),po(t,e+r,n)}function po(t,e,n){for(var r,i=e+(n---e>>1);er&&(r=o),ai&&(i=a)}function u(t){t.forEach(s)}function l(t){t.forEach(u)}for(var c in t)o(t[c]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=function(t){var e,n,r={};for(e in t)r[e]=null==(n=t[e])?{type:null}:("FeatureCollection"===n.type?go:"Feature"===n.type?yo:vo)(n);return r}(t)),r=e>0&&n&&function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=o-r?(n-1)/(o-r):1,u=a-i?(n-1)/(a-i):1;function l(t){return[Math.round((t[0]-r)*s),Math.round((t[1]-i)*u)]}function c(t,e){for(var n,o,a,l,c,h=-1,f=0,p=t.length,d=new Array(p);++h=0){var o=h[n];i===e&&o===r||i===r&&o===e||(++p,f[n]=1)}else c[n]=e,h[n]=r}}function w(t){return ho(o[t])}function x(t,e){return so(o[t],o[e])}l=c=h=null;var O,E=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<=t)throw new Error("full hashset");u=o[s=s+1&a]}return o[s]=r,!0},has:function(r){for(var s=e(r)&a,u=o[s],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)break;u=o[s=s+1&a]}return!1},values:function(){for(var t=[],e=0,n=o.length;e1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==Q(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Mi(t));var r=[],i=_t(t,(function(t,e){return function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=xo(r[0]),a=xo(r[r.length-1]),s=xo(i[0]),u=xo(i[i.length-1]);if(o===u)n=i.concat(r.slice(1));else if(s===a)n=r.concat(i.slice(1));else if(o===s)n=r.slice(1).reverse().concat(i);else{if(a!==u)return null;n=r.concat(i.reverse().slice(1))}return O(n)}(t,e)||(r.push(t),e)}));return i&&r.push(i),r.length?1===r.length?r[0]:M(r.map((function(t){return t.coordinates}))):null}function xo(t){return t[0].toString()+","+t[1].toString()}function Oo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==Q(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Mi(t));var r=function(t){var e={};dt(t,(function(t){e[t.geometry.type]=!0}));var n=Object.keys(e);return 1===n.length?n[0]:null}(t);if(!r)throw new Error("geojson must be homogenous");var i=t;switch(r){case"LineString":return wo(i,e);case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("FeatureCollection"!==Q(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==e.mutate&&void 0!==e.mutate||(t=Mi(t));var n=[];dt(t,(function(t){n.push(t.geometry)}));var r=mo({geoms:N(n).geometry});return ro(r,r.objects.geoms.geometries)}(i,e);default:throw new Error(r+" is not supported")}}var Eo=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function So(t,e){return t>e?1:t0))break;if(null===e.right)break;if(n(t,e.right.key)>0&&(s=e.right,e.right=s.left,s.left=e,null===(e=s).right))break;i.right=e,i=e,e=e.right}}return i.right=e.left,o.left=e.right,e.left=r.right,e.right=r.left,e}function Co(t,e,n,r){var i=new Eo(t,e);if(null===n)return i.left=i.right=null,i;var o=r(t,(n=Mo(t,n,r)).key);return o<0?(i.left=n.left,i.right=n,n.left=null):o>=0&&(i.right=n.right,i.left=n,n.right=null),i}function ko(t,e,n){var r=null,i=null;if(e){var o=n((e=Mo(t,e,n)).key,t);0===o?(r=e.left,i=e.right):o<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}var No=function(){function t(t){void 0===t&&(t=So),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Co(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new Eo(t,e);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,i=Mo(t,this._root,r),o=r(t,i.key);return 0===o?this._root=i:(o<0?(n.left=i.left,n.right=i,i.left=null):o>0&&(n.right=i.right,n.left=i,i.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r;return null===e?null:0===n(t,(e=Mo(t,e,n)).key)?(null===e.left?r=e.right:(r=Mo(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Mo(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Mo(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&n.call(r,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,n=[],r=!1,i=new Eo(null,null),o=i;!r;)e?(n.push(e),e=e.left):n.length>0?e=(e=o=o.next=n.pop()).right:r=!0;return o.next=null,i.next}(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,i=this._comparator;if(n&&function t(e,n,r,i,o){if(!(r>=i)){for(var a=e[r+i>>1],s=r-1,u=i+1;;){do{s++}while(o(e[s],a)<0);do{u--}while(o(e[u],a)>0);if(s>=u)break;var l=e[s];e[s]=e[u],e[u]=l,l=n[s],n[s]=n[u],n[u]=l}t(e,n,r,u,o),t(e,n,u+1,i,o)}}(t,e,0,r-1,i),null===this._root)this._root=function t(e,n,r,i){var o=i-r;if(o>0){var a=r+Math.floor(o/2),s=e[a],u=n[a],l=new Eo(s,u);return l.left=t(e,n,r,a),l.right=t(e,n,a+1,i),l}return null}(t,e,0,r),this._size=r;else{var o=function(t,e,n){for(var r=new Eo(null,null),i=r,o=t,a=e;null!==o&&null!==a;)n(o.key,a.key)<0?(i.next=o,o=o.next):(i.next=a,a=a.next),i=i.next;return null!==o?i.next=o:null!==a&&(i.next=a),r.next}(this.toList(),function(t,e){for(var n=new Eo(null,null),r=n,i=0;i0){var o=n+Math.floor(i/2),a=t(e,n,o),s=e.head;return s.left=a,e.head=e.head.next,s.right=t(e,o+1,r),s}return null}({head:o},0,r)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return function t(e,n,r,i,o){if(e){i(n+(r?"└── ":"├── ")+o(e)+"\n");var a=n+(r?" ":"│ ");e.left&&t(e.left,a,!1,i,o),e.right&&t(e.right,a,!0,i,o)}}(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,n){var r=this._comparator,i=ko(t,this._root,r),o=i.left,a=i.right;r(t,e)<0?a=Co(e,n,a,r):o=Co(e,n,o,r),this._root=function(t,e,n){return null===e?t:(null===t||((e=Mo(t.key,e,n)).left=t),e)}(o,a,r)},t.prototype.split=function(t){return ko(t,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var t,e,n;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.x?1:t.ye.y?1:0}}]),Po(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n=0&&u>=0?al?-1:0:o<0&&u<0?al?1:0:uo?1:0}}}]),t}(),Zo=0,Ko=function(){function t(e,n,r,i){jo(this,t),this.id=++Zo,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=r,this.windings=i}return Po(t,null,[{key:"compare",value:function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(oa&&s>u)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n>r){if(as&&a>l)return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var p=t.comparePoint(e.rightSE.point);return p<0?1:p>0?-1:1}if(as)return 1;if(io){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(i!==o){var y=u-a,v=i-n,m=l-s,_=o-r;if(y>v&&m<_)return 1;if(y_)return-1}return i>o?1:il?1:t.ide.id?1:0}}]),Po(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x0&&s.swapEvents(),Ho.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e0){var o=n;n=r,r=o}if(n.prev===r){var a=n;n=r,r=a}for(var s=0,u=r.rings.length;s0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,a=-1}return new t(new Ho(i,!0),new Ho(o,!1),[r],[a])}}]),t}(),Jo=function(){function t(e,n,r){if(jo(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=Go.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,a=1,s=e.length;athis.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}i.x===o.x&&i.y===o.y||this.segments.push(Ko.fromRing(o,i,this))}return Po(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=n}return Po(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=n}return Po(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.polys.length;e0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),t}(),ea=function(){function t(e){jo(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Po(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:Ko.compare;jo(this,t),this.queue=e,this.tree=new No(n),this.segments=[]}return Po(t,[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var l=a.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!a.isAnEndpoint(l)))for(var c=this._splitSafely(a,l),h=0,f=c.length;h0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var x=a.getIntersection(s);if(null!==x){if(!a.isAnEndpoint(x))for(var O=this._splitSafely(a,x),E=0,S=O.length;Eia)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new ra(p),b=p.size,w=p.pop();w;){var x=w.key;if(p.size===b){var O=x.segment;throw new Error("Unable to pop() ".concat(x.isLeft?"left":"right"," SweepEvent ")+"[".concat(x.point.x,", ").concat(x.point.y,"] from segment #").concat(O.id," ")+"[".concat(O.leftSE.point.x,", ").concat(O.leftSE.point.y,"] -> ")+"[".concat(O.rightSE.point.x,", ").concat(O.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(p.size>ia)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>oa)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var E=_.process(x),S=0,M=E.length;S1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:2,r=Y(t),i=Y(e),o=r[0]-i[0],a=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(a):Math.pow(Math.pow(o,n)+Math.pow(a,n),1/n)}function ca(t,e){var n,r,i=(e=e||{}).threshold||1e4,o=e.p||2,a=null!=(n=e.binary)&&n,s=e.alpha||-1,u=null!=(r=e.standardization)&&r,l=[];lt(t,(function(t){l.push(Hr(t))}));for(var c=[],h=0;h3&&void 0!==arguments[3]?arguments[3]:{},i=e<0,o=D(Math.abs(e),r.units,"meters");i&&(o=-Math.abs(o));var a=Y(t),s=function(t,e,n,r){var i=e/(r=void 0===r?d:Number(r)),o=t[0]*Math.PI/180,a=F(t[1]),s=F(n),u=i*Math.cos(s),l=a+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(a);return[(180*(o+i*Math.sin(s)/h)/Math.PI+540)%360-180,180*l/Math.PI]}(a,o,n);return s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0,_(s,r.properties)}function fa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Y(t),i=Y(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var o=function(t,e,n){var r=n=void 0===n?d:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*r}(r,i);return D(o,"meters",n.units)}function pa(t,e,n){if(!q(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");if(0===e)return t;var o=null!=r?r:Hr(t);return!1!==i&&void 0!==i||(t=Mi(t)),ot(t,(function(t){var n=rt(o,t)+e,r=fa(o,t),i=W(ha(o,r,n));t[0]=i[0],t[1]=i[1]})),t}function da(t,e,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",a=r.angle||0,s=r.pivot||t,u=r.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!q(r))throw new Error("options must be an object");if(!G(i))throw new Error("steps must be a number");if(!G(a))throw new Error("angle must be a number");var l=Y(t);if("degrees"!==o){var c=ha(t,e,90,{units:o}),h=ha(t,n,0,{units:o});e=Y(c)[0]-l[0],n=Y(h)[1]-l[1]}for(var f=[],p=0;p=-270&&(g=-g),d<-180&&d>=-360&&(y=-y),"degrees"===o){var v=F(a),m=g*Math.cos(v)+y*Math.sin(v),_=y*Math.cos(v)-g*Math.sin(v);g=m,y=_}f.push([g+l[0],y+l[1]])}return f.push(f[0]),"degrees"===o?w([f],u):pa(w([f],u),a,{pivot:s})}function ga(t){var e=t*Math.PI/180;return Math.tan(e)}function ya(t){return Pt(Ct(t))}function va(t){var e=[];return"FeatureCollection"===t.type?lt(t,(function(t){ot(t,(function(n){e.push(_(n,t.properties))}))})):"Feature"===t.type?ot(t,(function(n){e.push(_(n,t.properties))})):ot(t,(function(t){e.push(_(t))})),S(e)}var ma=Math.PI/180,_a=180/Math.PI,ba=function(t,e){this.lon=t,this.lat=e,this.x=ma*t,this.y=ma*e};ba.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},ba.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new ba(e,t)};var wa=function(){this.coords=[],this.length=0};wa.prototype.move_to=function(t){this.length++,this.coords.push(t)};var xa=function(t){this.properties=t||{},this.geometries=[]};xa.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(ft(t,(function(t){n.push(t.coordinates)})),n.length<2)throw new Error("Must specify at least 2 geometries");var r=sa.intersection.apply(sa,[n[0]].concat(l(n.slice(1))));return 0===r.length?null:1===r.length?w(r[0],e.properties):k(r,e.properties)}function Sa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=JSON.stringify(n.properties||{}),i=u(t,4),o=i[0],a=i[1],s=i[2],l=i[3],c=(a+l)/2,h=(o+s)/2,f=2*e/nt([o,c],[s,c],n)*(s-o),p=2*e/nt([h,a],[h,l],n)*(l-a),d=f/2,g=2*d,y=Math.sqrt(3)/2*p,v=s-o,m=l-a,_=3/4*g,b=y,w=(v-g)/(g-d/2),x=Math.floor(w),O=(x*_-d/2-v)/2-d/2+_/2,E=Math.floor((m-y)/y),M=(m-E*y)/2,C=E*y-m>y/2;C&&(M-=y/4);for(var k=[],N=[],j=0;j<6;j++){var L=2*Math.PI/6*j;k.push(Math.cos(L)),N.push(Math.sin(L))}for(var P=[],I=0;I<=x;I++)for(var A=0;A<=E;A++){var R=I%2==1;if(!(0===A&&R||0===A&&C)){var T=I*_+o-O,F=A*b+a+M;if(R&&(F-=y/2),!0===n.triangles)Ca([T,F],f/2,p/2,JSON.parse(r),k,N).forEach((function(t){n.mask?Ea(S([n.mask,t]))&&P.push(t):P.push(t)}));else{var D=Ma([T,F],f/2,p/2,JSON.parse(r),k,N);n.mask?Ea(S([n.mask,D]))&&P.push(D):P.push(D)}}}return S(P)}function Ma(t,e,n,r,i,o){for(var a=[],s=0;s<6;s++){var u=t[0]+e*i[s],l=t[1]+n*o[s];a.push([u,l])}return a.push(a[0].slice()),w([a],r)}function Ca(t,e,n,r,i,o){for(var a=[],s=0;s<6;s++){var u=[];u.push(t),u.push([t[0]+e*i[s],t[1]+n*o[s]]),u.push([t[0]+e*i[(s+1)%6],t[1]+n*o[(s+1)%6]]),u.push(t),a.push(w([u],r))}return a}function ka(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.mask&&!n.units&&(n.units="kilometers");for(var r=[],i=t[0],o=t[1],a=t[2],s=t[3],u=e/nt([i,o],[a,o],n)*(a-i),l=e/nt([i,o],[i,s],n)*(s-o),c=a-i,h=s-o,f=Math.floor(c/u),p=(h-Math.floor(h/l)*l)/2,d=i+(c-f*u)/2;d<=a;){for(var g=o+p;g<=s;){var y=_([d,g],n.properties);n.mask?gn(y,n.mask)&&r.push(y):r.push(y),g+=l}d+=u}return S(r)}function Na(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o=t[0],a=t[1],s=t[2],u=t[3],l=s-o,c=D(e,r.units,"degrees"),h=u-a,f=D(n,r.units,"degrees"),p=Math.floor(Math.abs(l)/c),d=Math.floor(Math.abs(h)/f),g=(h-d*f)/2,y=o+(l-p*c)/2,v=0;v2&&void 0!==arguments[2]?arguments[2]:{})}function La(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=e/nt([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),o=e/nt([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),a=0,s=t[0];s<=t[2];){for(var u=0,l=t[1];l<=t[3];){var c=null,h=null;a%2==0&&u%2==0?(c=w([[[s,l],[s,l+o],[s+i,l],[s,l]]],n.properties),h=w([[[s,l+o],[s+i,l+o],[s+i,l],[s,l+o]]],n.properties)):a%2==0&&u%2==1?(c=w([[[s,l],[s+i,l+o],[s+i,l],[s,l]]],n.properties),h=w([[[s,l],[s,l+o],[s+i,l+o],[s,l]]],n.properties)):u%2==0&&a%2==1?(c=w([[[s,l],[s,l+o],[s+i,l+o],[s,l]]],n.properties),h=w([[[s,l],[s+i,l+o],[s+i,l],[s,l]]],n.properties)):u%2==1&&a%2==1&&(c=w([[[s,l],[s,l+o],[s+i,l],[s,l]]],n.properties),h=w([[[s,l+o],[s+i,l+o],[s+i,l],[s,l+o]]],n.properties)),n.mask?(Ea(S([n.mask,c]))&&r.push(c),Ea(S([n.mask,h]))&&r.push(h)):(r.push(c),r.push(h)),l+=o,u++}a++,s+=i}return S(r)}function Pa(t,e,n){return tr&&(i=n,n=r,r=i),tr?(t-r)/(t-e):(t-n)/(t-e)}function Aa(t,e,n,r){return t1){for(;0!==o;)o>>=1,s++;r===1<1){for(;0!==a;)a>>=1,u++;i===1<0&&(this.childB=new Ga(t,e+o,n,r-o,a),this.lowerBound=Math.min(this.lowerBound,this.childB.lowerBound),this.upperBound=Math.max(this.upperBound,this.childB.upperBound),i-a>0&&(this.childC=new Ga(t,e+o,n+a,r-o,i-a),this.lowerBound=Math.min(this.lowerBound,this.childC.lowerBound),this.upperBound=Math.max(this.upperBound,this.childC.upperBound))),i-a>0&&(this.childD=new Ga(t,e,n+a,o,i-a),this.lowerBound=Math.min(this.lowerBound,this.childD.lowerBound),this.upperBound=Math.max(this.upperBound,this.childD.upperBound))}}function qa(t){var e,n;if(!t)throw new Error("data is required");if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Error("data must be scalar field, i.e. array of arrays");if(t.length<2)throw new Error("data must contain at least two rows");if((n=t[0].length)<2)throw new Error("data must contain at least two columns");for(e=1;e=e||t[a][r-1]>=e){n=!1;break}if(n&&(t[i-1][0]>=e||t[i-1][r-1]>=e)&&(n=!1),n)for(o=0;o=e||t[i-1][o]>e){n=!1;break}return n}(t,n.threshold)&&(n.linearRing?_.push([[0,0],[0,b],[w,b],[w,0],[0,0]]):_.push([[0,0],[0,b],[w,b],[w,0]])),e.forEach((function(t,M){t.forEach((function(t,C){for(i=null,o=0;o<4;o++)if(i=x[o],"object"===r(t.edges[i])){for(u=[],a=t.edges[i],l=i,c=M,h=C,f=!1,p=[M+a.path[0][0],C+a.path[0][1]],u.push(p);!f&&"object"===r((s=e[c][h]).edges[l]);)if(a=s.edges[l],delete s.edges[l],(d=a.path[1])[0]+=c,d[1]+=h,u.push(d),l=a.move.enter,c+=a.move.x,h+=a.move.y,void 0===e[c]||void 0===e[c][h]){if(!n.linearRing)break;if(g=0,y=0,c===w?(c--,g=0):c<0?(c++,g=2):h===b?(h--,g=3):h<0&&(h++,g=1),c===M&&h===C&&g===S[i]){f=!0,l=i;break}for(;;){if(v=!1,y>4)throw new Error("Direction change counter overflow! This should never happen!");if(void 0!==e[c]&&void 0!==e[c][h]&&(s=e[c][h],m=x[g],"object"===r(s.edges[m]))){a=s.edges[m],u.push(Da(c,h,g,a.path)),l=m,v=!0;break}if(v)break;if(u.push(Ba(c,h,g)),h+=E[g],void 0!==e[c+=O[g]]&&void 0!==e[c][h]||(0===g&&h<0||1===g&&c<0||2===g&&h===b||3===g&&c===w)&&(c-=O[g],h-=E[g],g=(g+1)%4,y++),c===M&&h===C&&g===S[i]){f=!0,l=i;break}}}!n.linearRing||u[u.length-1][0]===p[0]&&u[u.length-1][1]===p[1]||u.push(p),_.push(u)}}))})),_}(h,f,i)}u?d.push(p):d=p,"function"==typeof i.successCallback&&i.successCallback(d,t)})),d}function Ua(t,e,n,r){var i,o,a,s,u,l,c=0,h=t[n+1][e],f=t[n+1][e+1],p=t[n][e+1],d=t[n][e],g=r.threshold;if(!(isNaN(d)||isNaN(p)||isNaN(f)||isNaN(h))){switch(c|=h>=g?8:0,c|=f>=g?4:0,c|=p>=g?2:0,l={cval:c=+(c|=d>=g?1:0),polygons:[],edges:{},x0:d,x1:p,x2:f,x3:h},c){case 0:r.polygons&&l.polygons.push([[0,0],[0,1],[1,1],[1,0]]);break;case 15:break;case 14:i=r.interpolate(d,h,g),s=r.interpolate(d,p,g),r.polygons_full&&(l.edges.left={path:[[0,i],[s,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,i],[s,0]]);break;case 13:s=r.interpolate(d,p,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.bottom={path:[[s,0],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&&l.polygons.push([[s,0],[1,o],[1,0]]);break;case 11:o=r.interpolate(p,f,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.right={path:[[1,o],[a,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[1,o],[a,1],[1,1]]);break;case 7:i=r.interpolate(d,h,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.top={path:[[a,1],[0,i]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&l.polygons.push([[a,1],[0,i],[0,1]]);break;case 1:i=r.interpolate(d,h,g),s=r.interpolate(d,p,g),r.polygons_full&&(l.edges.bottom={path:[[s,0],[0,i]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&l.polygons.push([[s,0],[0,i],[0,1],[1,1],[1,0]]);break;case 2:s=r.interpolate(d,p,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.right={path:[[1,o],[s,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,1],[1,1],[1,o],[s,0]]);break;case 4:o=r.interpolate(p,f,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.top={path:[[a,1],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&&l.polygons.push([[0,0],[0,1],[a,1],[1,o],[1,0]]);break;case 8:i=r.interpolate(d,h,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.left={path:[[0,i],[a,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[0,0],[0,i],[a,1],[1,1],[1,0]]);break;case 12:i=r.interpolate(d,h,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.left={path:[[0,i],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&&l.polygons.push([[0,0],[0,i],[1,o],[1,0]]);break;case 9:s=r.interpolate(d,p,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.bottom={path:[[s,0],[a,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[s,0],[a,1],[1,1],[1,0]]);break;case 3:i=r.interpolate(d,h,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.right={path:[[1,o],[0,i]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&l.polygons.push([[0,i],[0,1],[1,1],[1,o]]);break;case 6:s=r.interpolate(d,p,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.top={path:[[a,1],[s,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,1],[a,1],[s,0]]);break;case 10:i=r.interpolate(d,h,g),o=r.interpolate(p,f,g),s=r.interpolate(d,p,g),a=r.interpolate(h,f,g),u=(d+p+f+h)/4,r.polygons_full&&(uf&&(g>c&&dc&&gu&&(u=y)}var v=[];if(s&&u0&&Math.abs(b-n[_-1][0])>f){var w=parseFloat(n[_-1][0]),x=parseFloat(n[_-1][1]),O=parseFloat(n[_][0]),E=parseFloat(n[_][1]);if(w>-180&&w-180&&n[_-1][0]c&&w<180&&-180===O&&_+1c&&n[_-1][0]<180){m.push([180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(wc){var S=w;w=O,O=S;var M=x;x=E,E=M}if(w>c&&O=180&&wc?180:-180,k]),(m=[]).push([n[_-1][0]>c?-180:180,k]),v.push(m)}else m=[],v.push(m);m.push([b,n[_][1]])}else m.push([n[_][0],n[_][1]])}}else{var N=[];v.push(N);for(var j=0;je||this.upperBound=e)&&r.push({x:this.x,y:this.y})),r},Ga.prototype.cellsBelowThreshold=function(t,e){var n=[];return e=void 0===e||e,this.lowerBound>t||(this.childA||this.childB||this.childC||this.childD?(this.childA&&(n=n.concat(this.childA.cellsBelowThreshold(t,e))),this.childB&&(n=n.concat(this.childB.cellsBelowThreshold(t,e))),this.childD&&(n=n.concat(this.childD.cellsBelowThreshold(t,e))),this.childC&&(n=n.concat(this.childC.cellsBelowThreshold(t,e)))):(e||this.upperBound>=t)&&n.push({x:this.x,y:this.y})),n};var Va=function(t,e,n,r,i,o){o.polygons&&t.polygons.push([[0,0],[0,1],[1,1],[1,0]])},Ya=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,s],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,s],[a,0],[0,0]])},Wa=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[1,s]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[1,s],[1,0]])},Xa=function(t,e,n,r,i,o){var a=o.interpolate(n,r,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,a],[s,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[1,a],[s,1],[1,1]])},Ha=function(t,e,n,r,i,o){var a=o.interpolate(i,r,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[a,1],[0,s]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,s],[0,1],[a,1]])},Za=function(t,e,n,r,i,o){var a=o.interpolate(n,r,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,a],[0,s]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,s],[0,1],[1,1],[1,a]])},Ka=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[s,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[a,0],[s,1],[1,1],[1,0]])},Ja=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[1,s]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[1,s],[1,0]])},Qa=function(t,e,n,r,i,o){var a=o.interpolate(i,r,o.minV,o.maxV),s=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[a,1],[s,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[a,1],[s,0]])},$a=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,l],[s,0]])},ts=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(n,r,o.minV,o.maxV),l=o.interpolate_b(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[1,l]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,u],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[1,l],[1,u],[s,0]])},es=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rb={path:[[1,l],[a,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lt"}}),o.polygons&&t.polygons.push([[1,l],[a,1],[s,1],[1,u]])},ns=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate_a(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.tr={path:[[s,1],[0,l]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[a,1]],move:{x:0,y:1,enter:"bl"}}),o.polygons&&t.polygons.push([[s,1],[0,l],[0,u],[a,1]])},rs=function(t,e,n,r,i,o){var a=o.interpolate_a(e,i,o.minV,o.maxV),s=o.interpolate_b(e,i,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lt={path:[[0,s],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[0,a]],move:{x:-1,y:0,enter:"rb"}}),o.polygons&&t.polygons.push([[0,a],[0,s],[1,u],[1,l]])},is=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(e,n,o.minV,o.maxV),l=o.interpolate_a(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.tr={path:[[s,1],[u,0]],move:{x:0,y:-1,enter:"tr"}},t.edges.bl={path:[[l,0],[a,1]],move:{x:0,y:1,enter:"bl"}}),o.polygons&&t.polygons.push([[l,0],[a,1],[s,1],[u,0]])},os=function(t,e,n,r,i,o){var a=o.interpolate(i,r,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[a,1],[1,s]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[a,1],[1,s],[1,0]])},as=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[1,1],[1,0]])},ss=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,s],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[1,1],[1,s],[a,0]])},us=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[s,0],[0,a]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,a],[0,1],[1,1],[1,0],[s,0]])},ls=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[0,a]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,a],[0,1],[s,1],[1,u],[1,l]])},cs=function(t,e,n,r,i,o){var a=o.interpolate(n,r,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,n,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,a],[s,0]],move:{x:0,y:-1,enter:"tr"}},t.edges.bl={path:[[u,0],[l,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[l,1],[1,1],[1,a],[s,0],[u,0]])},hs=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,u],[1,l],[1,0]])},fs=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate_a(i,r,o.minV,o.maxV),u=o.interpolate_b(i,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[u,1],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[u,1],[l,0]])},ps=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(e,n,o.minV,o.maxV),l=o.interpolate_a(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[l,0],[0,a]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[s,1],[u,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[0,a],[0,1],[s,1],[u,0],[l,0]])},ds=function(t,e,n,r,i,o){var a=o.interpolate_a(e,i,o.minV,o.maxV),s=o.interpolate_b(e,i,o.minV,o.maxV),u=o.interpolate(i,r,o.minV,o.maxV),l=o.interpolate(n,i,o.minV,o.maxV);o.polygons_full&&(t.edges.lt={path:[[0,s],[u,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,l],[0,a]],move:{x:-1,y:0,enter:"rb"}}),o.polygons&&t.polygons.push([[0,a],[0,s],[u,1],[1,1],[1,l]])},gs=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[l,0],[a,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,1],[s,1],[1,u],[1,0],[l,0]])},ys=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate_b(n,r,o.minV,o.maxV),u=o.interpolate_a(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[1,s]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,u],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[1,s],[1,u],[l,0]])},vs=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate_a(i,r,o.minV,o.maxV),u=o.interpolate_b(i,r,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[u,1],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[u,1],[1,l],[1,0]])},ms=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[l,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,u],[l,1],[1,1],[1,0]])},_s=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate(e,i,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rt"}},t.edges.rt={path:[[1,l],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,1],[1,1],[1,l],[s,0]])},bs=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[s,1],[1,u],[1,l],[a,0]])},ws=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,u],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[1,1],[1,u],[l,0]])},xs=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV),u=o.interpolate(i,r,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[u,1],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,1],[u,1],[1,l],[1,0]])},Os=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV),c=o.interpolate(i,r,o.minV,o.maxV),h=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[c,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,h],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,l],[c,1],[1,1],[1,h],[s,0]])},Es=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV),u=o.interpolate_a(i,r,o.minV,o.maxV),l=o.interpolate_b(i,r,o.minV,o.maxV),c=o.interpolate_b(n,r,o.minV,o.maxV),h=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,s],[u,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[l,1],[1,c]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,h],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,s],[u,1],[l,1],[1,c],[1,h],[a,0]])},Ss=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate(e,i,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV),c=o.interpolate_b(n,r,o.minV,o.maxV),h=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[l,1],[1,c]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,h],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,1],[l,1],[1,c],[1,h],[s,0]])},Ms=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate_a(i,r,o.minV,o.maxV),c=o.interpolate_b(i,r,o.minV,o.maxV),h=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[l,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[c,1],[1,h]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,u],[l,1],[c,1],[1,h],[1,0]])},Cs=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV),c=o.interpolate_a(i,r,o.minV,o.maxV),h=o.interpolate_b(i,r,o.minV,o.maxV),f=o.interpolate_b(n,r,o.minV,o.maxV),p=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[c,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[h,1],[1,f]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,p],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,l],[c,1],[h,1],[1,f],[1,p],[s,0]])};function ks(t,e,n,i){var o,a,s,u=!1,l=null,c=null,h=null,f=null,p=!1,d=[],g=[],y=[];if(!t)throw new Error("data is required");if(null==e)throw new Error("lowerBound is required");if(null==n)throw new Error("bandWidth is required");if(i&&"object"!==r(i))throw new Error("options must be an object");if(s=function(t){var e,n,r,i,o;for(i=new Ta,t=t||{},o=Object.keys(i),e=0;en||t[s][i-1]n){r=!1;break}if(r&&(t[o-1][0]n||t[o-1][i-1]n)&&(r=!1),r)for(a=0;an||t[o-1][a]n){r=!1;break}return r}(t,n.minV,n.maxV)&&(n.linearRing?b.push([[0,0],[0,w],[x,w],[x,0],[0,0]]):b.push([[0,0],[0,w],[x,w],[x,0]])),e.forEach((function(t,k){t.forEach((function(t,N){for(i=null,a=0;a<8;a++)if(i=M[a],"object"===r(t.edges[i])){for(o=[],s=t.edges[i],c=i,h=k,f=N,p=!1,d=[k+s.path[0][0],N+s.path[0][1]],o.push(d);!p&&"object"===r((g=e[h][f]).edges[c]);)if(s=g.edges[c],delete g.edges[c],(m=s.path[1])[0]+=h,m[1]+=f,o.push(m),c=s.move.enter,h+=s.move.x,f+=s.move.y,void 0===e[h]||void 0===e[h][f]){if(y=0,v=0,h===x)h--,y=0;else if(h<0)h++,y=2;else if(f===w)f--,y=3;else{if(!(f<0))throw new Error("Left the grid somewhere in the interior!");f++,y=1}if(h===k&&f===N&&y===C[i]){p=!0,c=i;break}for(;;){if(_=!1,v>4)throw new Error("Direction change counter overflow! This should never happen!");if(void 0!==e[h]&&void 0!==e[h][f])for(g=e[h][f],u=0;uo?2:af?128:64,a|=uf?32:16,a|=lf?8:4,o=0,i={cval:a=+(a|=cf?2:1),polygons:[],edges:{},x0:c,x1:l,x2:u,x3:s,x:e,y:n},a){case 85:Va(i,c,l,u,s,r);case 0:case 170:break;case 169:Ya(i,c,l,u,s,r);break;case 166:Wa(i,c,l,u,s,r);break;case 154:Xa(i,c,l,u,s,r);break;case 106:Ha(i,c,l,u,s,r);break;case 1:Ya(i,c,l,u,s,r);break;case 4:Wa(i,c,l,u,s,r);break;case 16:Xa(i,c,l,u,s,r);break;case 64:Ha(i,c,l,u,s,r);break;case 168:$a(i,c,l,u,s,r);break;case 162:ts(i,c,l,u,s,r);break;case 138:es(i,c,l,u,s,r);break;case 42:ns(i,c,l,u,s,r);break;case 2:$a(i,c,l,u,s,r);break;case 8:ts(i,c,l,u,s,r);break;case 32:es(i,c,l,u,s,r);break;case 128:ns(i,c,l,u,s,r);break;case 5:Ja(i,c,l,u,s,r);break;case 20:Ka(i,c,l,u,s,r);break;case 80:Za(i,c,l,u,s,r);break;case 65:Qa(i,c,l,u,s,r);break;case 165:Ja(i,c,l,u,s,r);break;case 150:Ka(i,c,l,u,s,r);break;case 90:Za(i,c,l,u,s,r);break;case 105:Qa(i,c,l,u,s,r);break;case 160:rs(i,c,l,u,s,r);break;case 130:is(i,c,l,u,s,r);break;case 10:rs(i,c,l,u,s,r);break;case 40:is(i,c,l,u,s,r);break;case 101:os(i,c,l,u,s,r);break;case 149:as(i,c,l,u,s,r);break;case 86:us(i,c,l,u,s,r);break;case 89:ss(i,c,l,u,s,r);break;case 69:os(i,c,l,u,s,r);break;case 21:as(i,c,l,u,s,r);break;case 84:us(i,c,l,u,s,r);break;case 81:ss(i,c,l,u,s,r);break;case 96:ls(i,c,l,u,s,r);break;case 24:cs(i,c,l,u,s,r);break;case 6:hs(i,c,l,u,s,r);break;case 129:fs(i,c,l,u,s,r);break;case 74:ls(i,c,l,u,s,r);break;case 146:cs(i,c,l,u,s,r);break;case 164:hs(i,c,l,u,s,r);break;case 41:fs(i,c,l,u,s,r);break;case 66:ps(i,c,l,u,s,r);break;case 144:ds(i,c,l,u,s,r);break;case 36:gs(i,c,l,u,s,r);break;case 9:ys(i,c,l,u,s,r);break;case 104:ps(i,c,l,u,s,r);break;case 26:ds(i,c,l,u,s,r);break;case 134:gs(i,c,l,u,s,r);break;case 161:ys(i,c,l,u,s,r);break;case 37:vs(i,c,l,u,s,r);break;case 148:ms(i,c,l,u,s,r);break;case 82:_s(i,c,l,u,s,r);break;case 73:bs(i,c,l,u,s,r);break;case 133:vs(i,c,l,u,s,r);break;case 22:ms(i,c,l,u,s,r);break;case 88:_s(i,c,l,u,s,r);break;case 97:bs(i,c,l,u,s,r);break;case 145:case 25:ws(i,c,l,u,s,r);break;case 70:case 100:xs(i,c,l,u,s,r);break;case 17:0===(o=Ns(c,l,u,s,h,f))?(Ya(i,c,l,u,s,r),Xa(i,c,l,u,s,r)):ws(i,c,l,u,s,r);break;case 68:0===(o=Ns(c,l,u,s,h,f))?(Ha(i,c,l,u,s,r),Wa(i,c,l,u,s,r)):xs(i,c,l,u,s,r);break;case 153:2===(o=Ns(c,l,u,s,h,f))?(Ya(i,c,l,u,s,r),Xa(i,c,l,u,s,r)):ws(i,c,l,u,s,r);break;case 102:2===(o=Ns(c,l,u,s,h,f))?(Ha(i,c,l,u,s,r),Wa(i,c,l,u,s,r)):xs(i,c,l,u,s,r);break;case 152:2===(o=Ns(c,l,u,s,h,f))?(Xa(i,c,l,u,s,r),$a(i,c,l,u,s,r)):Os(i,c,l,u,s,r);break;case 137:2===(o=Ns(c,l,u,s,h,f))?(Ya(i,c,l,u,s,r),es(i,c,l,u,s,r)):Es(i,c,l,u,s,r);break;case 98:2===(o=Ns(c,l,u,s,h,f))?(Ha(i,c,l,u,s,r),ts(i,c,l,u,s,r)):Ss(i,c,l,u,s,r);break;case 38:2===(o=Ns(c,l,u,s,h,f))?(Wa(i,c,l,u,s,r),ns(i,c,l,u,s,r)):Ms(i,c,l,u,s,r);break;case 18:0===(o=Ns(c,l,u,s,h,f))?(Xa(i,c,l,u,s,r),$a(i,c,l,u,s,r)):Os(i,c,l,u,s,r);break;case 33:0===(o=Ns(c,l,u,s,h,f))?(Ya(i,c,l,u,s,r),es(i,c,l,u,s,r)):Es(i,c,l,u,s,r);break;case 72:0===(o=Ns(c,l,u,s,h,f))?(Ha(i,c,l,u,s,r),ts(i,c,l,u,s,r)):Ss(i,c,l,u,s,r);break;case 132:0===(o=Ns(c,l,u,s,h,f))?(Wa(i,c,l,u,s,r),ns(i,c,l,u,s,r)):Ms(i,c,l,u,s,r);break;case 136:0===(o=Ns(c,l,u,s,h,f))?(ns(i,c,l,u,s,r),ts(i,c,l,u,s,r)):1===o?Cs(i,c,l,u,s,r):($a(i,c,l,u,s,r),es(i,c,l,u,s,r));break;case 34:0===(o=Ns(c,l,u,s,h,f))?($a(i,c,l,u,s,r),es(i,c,l,u,s,r)):1===o?Cs(i,c,l,u,s,r):(ns(i,c,l,u,s,r),ts(i,c,l,u,s,r))}return i}}var Ls=Object.defineProperty,Ps=Object.getOwnPropertySymbols,Is=Object.prototype.hasOwnProperty,As=Object.prototype.propertyIsEnumerable,Rs=function(t,e,n){return e in t?Ls(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Ts=function(t,e){for(var n in e||(e={}))Is.call(e,n)&&Rs(t,n,e[n]);if(Ps){var r,i=f(Ps(e));try{for(i.s();!(r=i.n()).done;)n=r.value,As.call(e,n)&&Rs(t,n,e[n])}catch(t){i.e(t)}finally{i.f()}}return t};function Fs(t){var e=t.map((function(t){return{ring:t,area:Ot(w([t]))}}));return e.sort((function(t,e){return e.area-t.area})),e.map((function(t){return t.ring}))}function Ds(t){for(var e=t.map((function(t){return{lrCoordinates:t,grouped:!1}})),n=[];!Gs(e);)for(var r=0;r=0&&l<=1&&(f.onLine1=!0),c>=0&&c<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}function Hs(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vt(t,(function(t,n){var r=n.geometry.coordinates;return t+nt(r[0],r[1],e)}),0)}function Zs(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.steps||64,a=Ks(n),s=Ks(r),u=Array.isArray(t)||"Feature"!==t.type?{}:t.properties;if(a===s)return O(Si(t,e,i).geometry.coordinates[0],u);for(var l=a,c=a=c&&h===i.length-1);h++){if(c>e&&0===o.length){if(!(a=e-c))return o.push(i[h]),O(o);s=tt(i[h],i[h-1])-180,u=et(i[h],a,s,r),o.push(u.geometry.coordinates)}if(c>=n)return(a=n-c)?(s=tt(i[h],i[h-1])-180,u=et(i[h],a,s,r),o.push(u.geometry.coordinates),O(o)):(o.push(i[h]),O(o));if(c>=e&&o.push(i[h]),h===i.length-1)return O(o);c+=nt(i[h],i[h+1],r)}if(c0){var s=r[e-1],u=function(t,e){return!function(t,e){return 0===$s(Qs(t),Qs(e))}(t,e)&&function(t,e){var n,r,i=t[0],o=Qs(t),a=e[0],s=Qs(e),u=$s(o,s);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}($s((r=i,[(n=a)[0]-r[0],n[1]-r[1]]),s)/u,o))}(t,e)}(n,s);!1!==u&&(s[1]=u,n[0]=u),a.push(s[0]),e===o.length-2&&(a.push(n[0]),a.push(n[1]))}2===o.length&&(a.push(n[0]),a.push(n[1]))}var l,c,h,f,p,d})),O(a,t.properties)}function eu(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(nt(t.slice(0,2),[r,n])>=nt(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var a=(e+r)/2;return[a-(i-n)/2,n,a+(i-n)/2,i]}function nu(t,e){if(!q(e=null!=e?e:{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw new Error(" is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof r)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return ot(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r1&&n.push(O(l)),S(n)}function ou(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return lt(e,(function(e){var i=en(e,t).properties.dist;iu?(s.unshift(t),u=e):s.push(t)}else s.push(t)})),w(s,e);default:throw new Error("geometry type "+a+" is not supported")}}function uu(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],a=i[1];return n===o&&r===a||t.push(e),t}function lu(t){return k(t)}function cu(t){var e,n=0,r=f(t);try{for(r.s();!(e=r.n()).done;)n+=e.value}catch(t){r.e(t)}finally{r.f()}return n/t.length}var hu=Object.defineProperty,fu=Object.defineProperties,pu=Object.getOwnPropertyDescriptors,du=Object.getOwnPropertySymbols,gu=Object.prototype.hasOwnProperty,yu=Object.prototype.propertyIsEnumerable,vu=function(t,e,n){return e in t?hu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},mu=function(t,e){for(var n in e||(e={}))gu.call(e,n)&&vu(t,n,e[n]);if(du){var r,i=f(du(e));try{for(i.s();!(r=i.n()).done;)n=r.value,yu.call(e,n)&&vu(t,n,e[n])}catch(t){i.e(t)}finally{i.f()}}return t},_u=function(t,e){return fu(t,pu(e))};function bu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var r=1/0,i=0;lt(e,(function(e,o){var a=nt(t,e,n);a2&&void 0!==arguments[2]?arguments[2]:{};if(n.method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=_(t):"Point"===t.type?t=v(t):Z(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=O(e):"LineString"===e.type?e=v(e):Z(e,"LineString","line");var r=1/0,i=t.geometry.coordinates;return yt(e,(function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],a=function(t,e,n,r){var i=[n[0]-e[0],n[1]-e[1]],o=xu([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return Ou(t,e,{method:r.method,units:"degrees"});var a=xu(i,i);if(a<=o)return Ou(t,n,{method:r.method,units:"degrees"});var s=o/a;return Ou(t,[e[0]+s*i[0],e[1]+s*i[1]],{method:r.method,units:"degrees"})}(i,e,o,n);a0)-(t<0)||+t}(r*(n[1]-e[1])-o*i)}function Iu(t,e){return e.geometry.coordinates[0].every((function(e){return Tt(_(e),t)}))}var Au=function(){function t(e){i(this,t),this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return a(t,[{key:"removeInnerEdge",value:function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))}},{key:"removeOuterEdge",value:function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))}},{key:"addOuterEdge",value:function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1}},{key:"sortOuterEdges",value:function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=Pu(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(t){return this.sortOuterEdges(),this.outerEdges[t]}},{key:"addInnerEdge",value:function(t){this.innerEdges.push(t)}}],[{key:"buildId",value:function(t){return t.join(",")}}]),t}(),Ru=function(){function t(e,n){i(this,t),this.from=e,this.to=n,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return a(t,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}},{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(t){return this.from.id===t.from.id&&this.to.id===t.to.id}},{key:"toString",value:function(){return"Edge { ".concat(this.from.id," -> ").concat(this.to.id," }")}},{key:"toLineString",value:function(){return O([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return Pu(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}]),t}(),Tu=function(){function t(){i(this,t),this.edges=[],this.polygon=void 0,this.envelope=void 0}return a(t,[{key:"push",value:function(t){this.edges.push(t),this.polygon=this.envelope=void 0}},{key:"get",value:function(t){return this.edges[t]}},{key:"length",get:function(){return this.edges.length}},{key:"forEach",value:function(t){this.edges.forEach(t)}},{key:"map",value:function(t){return this.edges.map(t)}},{key:"some",value:function(t){return this.edges.some(t)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value:function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=Pu(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0}},{key:"toMultiPoint",value:function(){return C(this.edges.map((function(t){return t.from.coordinates})))}},{key:"toPolygon",value:function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=w([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=ya(this.toPolygon())}},{key:"inside",value:function(t){return Tt(t,this.toPolygon())}}],[{key:"findEdgeRingContaining",value:function(t,e){var n,r,i=t.getEnvelope();return e.forEach((function(e){var o,a,s,u,l,c,h=e.getEnvelope();if(r&&(n=r.getEnvelope()),a=i,s=(o=h).geometry.coordinates[0].map((function(t){return t[0]})),u=o.geometry.coordinates[0].map((function(t){return t[1]})),l=a.geometry.coordinates[0].map((function(t){return t[0]})),c=a.geometry.coordinates[0].map((function(t){return t[1]})),(Math.max.apply(null,s)!==Math.max.apply(null,l)||Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.min.apply(null,s)!==Math.min.apply(null,l)||Math.min.apply(null,u)!==Math.min.apply(null,c))&&Iu(h,i)){var p,d,g=f(t.map((function(t){return t.from.coordinates})));try{var y=function(){var t=d.value;e.some((function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r}))||(p=t)};for(g.s();!(d=g.n()).done;)y()}catch(t){g.e(t)}finally{g.f()}p&&e.inside(_(p))&&(r&&!Iu(n,h)||(r=e))}})),r}}]),t}(),Fu=function(){function t(){i(this,t),this.edges=[],this.nodes={}}return a(t,[{key:"getNode",value:function(t){var e=Au.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Au(t)),n}},{key:"addEdge",value:function(t,e){var n=new Ru(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)}},{key:"deleteDangles",value:function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))}},{key:"_removeIfDangle",value:function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),n.forEach((function(t){return e._removeIfDangle(t)}))}}},{key:"deleteCutEdges",value:function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))}},{key:"_computeNextCWEdges",value:function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e}))}},{key:"_computeNextCCWEdges",value:function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var a=i[o],s=a.symetric,u=void 0,l=void 0;a.label===e&&(u=a),s.label===e&&(l=s),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)}},{key:"_findLabeledEdgeRings",value:function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t}},{key:"getEdgeRings",value:function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e}},{key:"_findIntersectionNodes",value:function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e}},{key:"_findEdgeRing",value:function(t){var e=t,n=new Tu;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n}},{key:"removeNode",value:function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]}},{key:"removeEdge",value:function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()}}],[{key:"fromGeoJson",value:function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '".concat(t.type,"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature"))}(e);var n=new t;return dt(e,(function(t){Z(t,"LineString","Graph::fromGeoJson"),at(t,(function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e}))})),n}}]),t}();function Du(t,e){var n,r;ot(t,(function(t,i,o,a,s){if(r!==s)e.push([]);else{var u=n[0],l=n[1],c=t[0],h=t[1];e[s].push([.75*u+.25*c,.75*l+.25*h]),e[s].push([.25*u+.75*c,.25*l+.75*h])}n=t,r=s}),!1),e.forEach((function(t){t.push(t[0])}))}function Bu(t,e){var n,r,i;ot(t,(function(t,o,a,s,u){if(r!==s)e.push([[]]);else if(i!==u)e[s].push([]);else{var l=n[0],c=n[1],h=t[0],f=t[1];e[s][u].push([.75*l+.25*h,.75*c+.25*f]),e[s][u].push([.25*l+.75*h,.25*c+.75*f])}n=t,r=s,i=u}),!1),e.forEach((function(t){t.forEach((function(t){t.push(t[0])}))}))}function Gu(t,e,n,r,i){for(var o=0;o0?zu(e,a,r)<0||(r=a):n>0&&u<=0&&(qu(e,a,i)||(i=a)),n=u}return[r,i]}function qu(t,e,n){return zu(t,e,n)>0}function zu(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function Uu(t){return Yu(t,"mercator",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function Vu(t){return Yu(t,"wgs84",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function Yu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&G(t[0])?t="mercator"===e?Wu(t):Xu(t):(!0!==r&&(t=Mi(t)),ot(t,(function(t){var n="mercator"===e?Wu(t):Xu(t);t[0]=n[0],t[1]=n[1]}))),t}function Wu(t){var e=Math.PI/180,n=6378137,r=20037508.342789244,i=[n*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return i[0]>r&&(i[0]=r),i[0]<-r&&(i[0]=-r),i[1]>r&&(i[1]=r),i[1]<-r&&(i[1]=-r),i}function Xu(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}var Hu=Object.freeze({__proto__:null,toMercator:Uu,toWgs84:Vu}),Zu={20:1.07275,15:1.13795,10:1.22385,5:1.3581,2:1.51743,1:1.62762};function Ku(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function Ju(t){var e=[];return function t(n){return 0===n||1===n?1:e[n]>0?e[n]:e[n]=t(n-1)*n}(t)}function Qu(t){return tl(t),$u(t)}function $u(t){return Array.isArray(t)?ol(t):t&&t.bbox?ol(t.bbox):[360*il(),180*il()]}function tl(t){null!=t&&(Array.isArray(t)?z(t):null!=t.bbox&&z(t.bbox))}function el(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tl(e.bbox),null==t&&(t=1);for(var n=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:{};tl(e.bbox),null==t&&(t=1),void 0!==e.bbox&&null!==e.bbox||(e.bbox=[-180,-90,180,90]),G(e.num_vertices)&&void 0!==e.num_vertices||(e.num_vertices=10),G(e.max_radial_length)&&void 0!==e.max_radial_length||(e.max_radial_length=10);var n=Math.abs(e.bbox[0]-e.bbox[2]),r=Math.abs(e.bbox[1]-e.bbox[3]),i=Math.min(n/2,r/2);if(e.max_radial_length>i)throw new Error("max_radial_length is greater than the radius of the bbox");for(var o=[e.bbox[0]+e.max_radial_length,e.bbox[1]+e.max_radial_length,e.bbox[2]-e.max_radial_length,e.bbox[3]-e.max_radial_length],a=[],s=function(){var t,n=[],r=l(Array(e.num_vertices+1)).map(Math.random);r.forEach((function(t,e,n){n[e]=e>0?t+n[e-1]:t})),r.forEach((function(t){t=2*t*Math.PI/r[r.length-1];var i=Math.random();n.push([i*(e.max_radial_length||10)*Math.sin(t),i*(e.max_radial_length||10)*Math.cos(t)])})),n[n.length-1]=n[0],n=n.map((t=$u(o),function(e){return[e[0]+t[0],e[1]+t[1]]})),a.push(w([n]))},u=0;u1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.bbox;tl(n);var r=e.num_vertices,i=e.max_length,o=e.max_rotation;null==t&&(t=1),(!G(r)||void 0===r||r<2)&&(r=10),G(i)&&void 0!==i||(i=1e-4),G(o)&&void 0!==o||(o=Math.PI/8);for(var a=[],s=0;s0;){var l=s.pop();if(l===n)return pl(l);l.closed=!0;for(var c=t.neighbors(l),h=0,f=c.length;h1?(r=n[0],i=n[1]):s>0&&(r+=o*s,i+=a*s)}return(o=t[0]-r)*o+(a=t[1]-i)*a}function bl(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,i,o){for(var a,s=i,u=n+1;us&&(a=u,s=l)}s>i&&(a-n>1&&t(e,n,a,i,o),o.push(e[a]),r-a>1&&t(e,a,r,i,o))}(t,0,n,e,r),r.push(t[n]),r}function wl(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return bl(t=n?t:function(t,e){for(var n,r,i,o,a,s=t[0],u=[s],l=1,c=t.length;le&&(u.push(n),s=n);return s!==n&&u.push(n),u}(t,r),r)}function xl(t,e,n){return t.map((function(t){if(t.length<4)throw new Error("invalid polygon");for(var r=e,i=wl(t,r,n);!Ol(i);)i=wl(t,r-=.01*r,n);return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function Ol(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}function El(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}gl.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)80*n){r=o=t[0],i=a=t[1];for(var d=n;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-r,a-i))?32767/l:0}return Nl(f,p,n,r,i,l,0),p}function Cl(t,e,n,r,i){var o,a;if(i===Jl(t,e,n,r)>0)for(o=e;o=e;o-=r)a=Hl(o,t[o],t[o+1],a);return a&&zl(a,a.next)&&(Zl(a),a=a.next),a}function kl(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!zl(r,r.next)&&0!==ql(r.prev,r,r.next))r=r.next;else{if(Zl(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function Nl(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=Fl(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Ll(t,r,i,o):jl(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Zl(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?Nl(t=Pl(kl(t),e,n),e,n,r,i,o,2):2===a&&Il(t,e,n,r,i,o):Nl(kl(t),e,n,r,i,o,1);break}}}function jl(t){var e=t.prev,n=t,r=t.next;if(ql(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,a=r.x,s=e.y,u=n.y,l=r.y,c=io?i>a?i:a:o>a?o:a,p=s>u?s>l?s:l:u>l?u:l,d=r.next;d!==e;){if(d.x>=c&&d.x<=f&&d.y>=h&&d.y<=p&&Bl(i,s,o,u,a,l,d.x,d.y)&&ql(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ll(t,e,n,r){var i=t.prev,o=t,a=t.next;if(ql(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,h=o.y,f=a.y,p=su?s>l?s:l:u>l?u:l,y=c>h?c>f?c:f:h>f?h:f,v=Fl(p,d,e,n,r),m=Fl(g,y,e,n,r),_=t.prevZ,b=t.nextZ;_&&_.z>=v&&b&&b.z<=m;){if(_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==a&&Bl(s,c,u,h,l,f,_.x,_.y)&&ql(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,b.x>=p&&b.x<=g&&b.y>=d&&b.y<=y&&b!==i&&b!==a&&Bl(s,c,u,h,l,f,b.x,b.y)&&ql(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;_&&_.z>=v;){if(_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==a&&Bl(s,c,u,h,l,f,_.x,_.y)&&ql(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;b&&b.z<=m;){if(b.x>=p&&b.x<=g&&b.y>=d&&b.y<=y&&b!==i&&b!==a&&Bl(s,c,u,h,l,f,b.x,b.y)&&ql(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Pl(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!zl(i,o)&&Ul(i,r,r.next,o)&&Wl(i,o)&&Wl(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Zl(r),Zl(r.next),r=t=o),r=r.next}while(r!==t);return kl(r)}function Il(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Gl(a,s)){var u=Xl(a,s);return a=kl(a,a.next),u=kl(u,u.next),Nl(a,e,n,r,i,o,0),void Nl(u,e,n,r,i,o,0)}s=s.next}a=a.next}while(a!==t)}function Al(t,e){return t.x-e.x}function Rl(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x=r.x&&r.x>=c&&i!==r.x&&Bl(on.x||r.x===n.x&&Tl(n,r)))&&(n=r,f=u)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var r=Xl(n,t);return kl(r,r.next),kl(n,n.next)}function Tl(t,e){return ql(t.prev,t,e.prev)<0&&ql(e.next,t,t.next)<0}function Fl(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Dl(t){var e=t,n=t;do{(e.x=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function Gl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ul(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Wl(t,e)&&Wl(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(ql(t.prev,t,e.prev)||ql(t,e.prev,e))||zl(t,e)&&ql(t.prev,t,t.next)>0&&ql(e.prev,e,e.next)>0)}function ql(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function zl(t,e){return t.x===e.x&&t.y===e.y}function Ul(t,e,n,r){var i=Yl(ql(t,e,n)),o=Yl(ql(t,e,r)),a=Yl(ql(n,r,t)),s=Yl(ql(n,r,e));return i!==o&&a!==s||!(0!==i||!Vl(t,n,e))||!(0!==o||!Vl(t,r,e))||!(0!==a||!Vl(n,t,r))||!(0!==s||!Vl(n,e,r))}function Vl(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Yl(t){return t>0?1:t<0?-1:0}function Wl(t,e){return ql(t.prev,t,t.next)<0?ql(t,e,t.next)>=0&&ql(t,t.prev,e)>=0:ql(t,e,t.prev)<0||ql(t,t.next,e)<0}function Xl(t,e){var n=new Kl(t.i,t.x,t.y),r=new Kl(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Hl(t,e,n,r){var i=new Kl(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Zl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Kl(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Jl(t,e,n,r){for(var i=0,o=e,a=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n};var Ql=nn(Sl.exports);function $l(t){var e=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Ql(e.vertices,e.holes,2),r=[],i=[];n.forEach((function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var o=0;o=1||u<=0||l>=1||l<=0))){var g=d,y=!o[g];y&&(o[g]=!0),e?i.push(e(d,t,n,c,h,u,a,s,f,p,l,y)):i.push(d)}}function g(t,e){var n,i,o,a,s=r[t][e],u=r[t][e+1];return s[0]f[e.isect].coord?-1:1})),l=[];b.length>0;){var C=b.pop(),k=C.isect,N=C.parent,j=C.winding,L=l.length,P=[f[k].coord],I=k;if(f[k].ringAndEdge1Walkable)var A=f[k].ringAndEdge1,R=f[k].nxtIsectAlongRingAndEdge1;else A=f[k].ringAndEdge2,R=f[k].nxtIsectAlongRingAndEdge2;for(;!ac(f[k].coord,f[R].coord);){P.push(f[R].coord);var T=void 0;for(r=0;r1)for(e=0;e=0==e}function oc(t){for(var e=0,n=0;n0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=p,p<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*p]),h<1&&(t[1]=[u+h*f,l+h*p]),!0)}}}}}function bc(t,e,n,r,i){var o=t[1];if(o)return!0;var a,s,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],p=c[0],d=c[1],g=(h+p)/2,y=(f+d)/2;if(d===f){if(g=r)return;if(h>p){if(u){if(u[1]>=i)return}else u=[g,n];o=[g,i]}else{if(u){if(u[1]1)if(h>p){if(u){if(u[1]>=i)return}else u=[(n-s)/a,n];o=[(i-s)/a,i]}else{if(u){if(u[1]=r)return}else u=[e,a*e+s];o=[r,a*r+s]}else{if(u){if(u[0]=-zc)){var p=u*u+l*l,d=c*c+h*h,g=(h*p-l*d)/f,y=(u*d-c*p)/f,v=Sc.pop()||new Mc;v.arc=t,v.site=i,v.x=g+a,v.y=(v.cy=y+s)+Math.sqrt(g*g+y*y),t.circle=v;for(var m=null,_=Bc._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Bc.insert(m,v),m||(Ec=v)}}}}function kc(t){var e=t.circle;e&&(e.P||(Ec=e.N),Bc.remove(e),Sc.push(e),fc(e),t.circle=null)}var Nc=[];function jc(){fc(this),this.edge=this.site=this.circle=null}function Lc(t){var e=Nc.pop()||new jc;return e.site=t,e}function Pc(t){kc(t),Fc.remove(t),Nc.push(t),fc(t)}function Ic(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,a=t.N,s=[t];Pc(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)qc)s=s.L;else{if(!((i=o-Tc(s,a))>qc)){r>-qc?(e=s.P,n=s):i>-qc?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){Dc[t.index]={site:t,halfedges:[]}}(t);var u=Lc(t);if(Fc.insert(e,u),e||n){if(e===n)return kc(e),n=Lc(e.site),Fc.insert(u,n),u.edge=n.edge=yc(e.site,u.site),Cc(e),void Cc(n);if(n){kc(e),kc(n);var l=e.site,c=l[0],h=l[1],f=t[0]-c,p=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(f*y-p*g),m=f*f+p*p,_=g*g+y*y,b=[(y*m-p*_)/v+c,(f*_-g*m)/v+h];mc(n.edge,l,d,b),u.edge=yc(l,t,null,b),n.edge=yc(t,d,null,b),Cc(e),Cc(n)}else u.edge=yc(e.site,u.site)}}function Rc(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var s=(n=a.site)[0],u=n[1],l=u-e;if(!l)return s;var c=s-r,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+r:(r+s)/2}function Tc(t,e){var n=t.N;if(n)return Rc(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var Fc,Dc,Bc,Gc,qc=1e-6,zc=1e-12;function Uc(t,e){return e[1]-t[1]||e[0]-t[0]}function Vc(t,e){var n,r,i,o=t.sort(Uc).pop();for(Gc=[],Dc=new Array(t.length),Fc=new hc,Bc=new hc;;)if(i=Ec,o&&(!i||o[1]qc||Math.abs(i[0][1]-i[1][1])>qc)||delete Gc[o]}(a,s,u,l),function(t,e,n,r){var i,o,a,s,u,l,c,h,f,p,d,g,y=Dc.length,v=!0;for(i=0;iqc||Math.abs(g-f)>qc)&&(u.splice(s,0,Gc.push(vc(a,p,Math.abs(d-t)qc?[t,Math.abs(h-t)qc?[Math.abs(f-r)qc?[n,Math.abs(h-n)qc?[Math.abs(f-e)=s)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[r=a],a=null,i.halfedges.forEach((function(n){var r=o.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=t-s[0],l=e-s[1],h=u*u+l*l;h2&&void 0!==arguments[2]?arguments[2]:{},r=J(t).coordinates,i=0,o=0;o=i&&o===r.length-1);o++){if(i>=e){var a=e-i;if(a){var s=tt(r[o],r[o-1])-180;return et(r[o],a,s,n)}return _(r[o])}i+=nt(r[o],r[o+1],n)}return _(r[r.length-1])},e.angle=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!q(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,a=n,s=A(!0!==r.mercator?tt(i,o):rt(i,o)),u=A(!0!==r.mercator?tt(a,o):rt(a,o)),l=Math.abs(s-u);return!0===r.explementary?360-l:l},e.applyFilter=Ri,e.area=Ot,e.areaFactors=y,e.azimuthToBearing=R,e.bbox=Ct,e.bboxClip=function(t,e){var n=J(t),r=n.type,i="Feature"===t.type?t.properties:{},o=n.coordinates;switch(r){case"LineString":case"MultiLineString":var a=[];return"LineString"===r&&(o=[o]),o.forEach((function(t){!function(t,e,n){var r,i,o,a,s,u=t.length,l=jt(t[0],e),c=[];for(n||(n=[]),r=1;r1&&void 0!==arguments[1]?arguments[1]:{},n=e.resolution||1e4,r=e.sharpness||.85,i=[],o=J(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),a=new It({duration:n,points:o,sharpness:r}),s=function(t){var e=a.pos(t);Math.floor(t/100)%2==0&&i.push([e.x,e.y])},u=0;u0;else if(n!==u>0)return!0}return!1},e.booleanContains=function(t,e){var n=J(t),r=J(e),i=n.type,o=r.type,a=n.coordinates,s=r.coordinates;switch(i){case"Point":if("Point"===o)return qt(a,s);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:{}).precision;if("number"!=typeof(n=null==n||isNaN(n)?6:n)||!(n>=0))throw new Error("precision must be a positive number");return J(t).type===J(e).type&&_e(xe(t),xe(e),{precision:n})},e.booleanIntersects=Me,e.booleanOverlap=function(t,e){var n=J(t),r=J(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(_e(t,e,{precision:6}))return!1;var a=0;switch(i){case"MultiPoint":for(var s=0;s0},e.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==ln(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==ln(e,"line2"))throw new Error("line2 must be a LineString");for(var n=Ye(xe(t)).features,r=Ye(xe(e)).features,i=0;i1;case"MultiPoint":for(var i=0;i0&&ee(w([r[0]]),w([r[i]])).features.length>1)return!1}return!0;case"MultiPolygon":for(i=0;i0&&ee(w([o[0]]),w([o[a]])).features.length>1)return!1}return!0;default:return!1}},e.booleanWithin=gn,e.buffer=function(t,e,n){var i=(n=n||{}).units||"kilometers",o=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!==r(n))throw new Error("options must be an object");if("number"!=typeof o)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(o<=0)throw new Error("steps must be greater than 0");var a=[];switch(t.type){case"GeometryCollection":return ft(t,(function(t){var n=Vr(t,e,i,o);n&&a.push(n)})),S(a);case"FeatureCollection":return lt(t,(function(t){var n=Vr(t,e,i,o);n&<(n,(function(t){t&&a.push(t)}))})),S(a)}return Vr(t,e,i,o)},e.center=_n,e.centerMean=Xr,e.centerMedian=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!G(n))throw new Error("counter must be a number");var r=e.weight,i=Xr(t,{weight:e.weight}),o=S([]);lt(t,(function(t){var e;o.features.push(Hr(t,{properties:{weight:null==(e=t.properties)?void 0:e[r]}}))}));var a={tolerance:e.tolerance,medianCandidates:[]};return Zr(i.geometry.coordinates,[0,0],o,a,n)},e.centerOfMass=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(Q(e)){case"Point":return _(Y(e),n.properties);case"Polygon":var r=[];ot(e,(function(t){r.push(t)}));var i,o,a,s,u,l,c,h,f=Hr(e,{properties:n.properties}),p=f.geometry.coordinates,d=0,g=0,y=0,v=r.map((function(t){return[t[0]-p[0],t[1]-p[1]]}));for(i=0;i2&&void 0!==arguments[2]?arguments[2]:{};!0!==n.mutate&&(t=Mi(t));var r=n.minPoints||3,i=I(e,n.units),o=new Bi(t.features.length),a=t.features.map((function(t){return!1})),s=t.features.map((function(t){return!1})),c=t.features.map((function(t){return!1})),h=t.features.map((function(t){return-1}));o.load(t.features.map((function(t,e){var n=u(t.geometry.coordinates,2),r=n[0],i=n[1];return{minX:r,minY:i,maxX:r,maxY:i,index:e}})));var f=function(n){var r=t.features[n],a=u(r.geometry.coordinates,2),s=a[0],l=a[1],c=Math.max(l-i,-90),h=Math.min(l+i,90),f=c<0&&h>0?i:Math.abs(c)=r){var i=p;p++,a[e]=!0,function(t,e){for(var n=0;n=r&&e.push.apply(e,l(o))}s[i]||(s[i]=!0,h[i]=t)}}(i,n)}else c[e]=!0}})),t.features.forEach((function(e,n){var r=t.features[n];r.properties||(r.properties={}),h[n]>=0?(r.properties.dbscan=c[n]?"edge":"core",r.properties.cluster=h[n]):r.properties.dbscan="noise"})),t},e.clustersKmeans=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(n/2)),e.numberOfClusters>n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=Mi(t));var r=ht(t),i=r.slice(0,e.numberOfClusters),o=Zi(r,e.numberOfClusters,i),a={};return o.centroids.forEach((function(t,e){a[e]=t})),lt(t,(function(t,e){var n=o.idxs[e];t.properties.cluster=n,t.properties.centroid=a[n]})),t},e.collect=function(t,e,n,r){var i=new Ki(6),o=e.features.map((function(t){var e;return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:null==(e=t.properties)?void 0:e[n]}}));return i.load(o),t.features.forEach((function(t){t.properties||(t.properties={});var e=Ct(t),n=i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),o=[];n.forEach((function(e){Tt([e.minX,e.minY],t)&&o.push(e.property)})),t.properties[r]=o})),t},e.collectionOf=K,e.combine=function(t){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return lt(t,(function(t){var n,r,i,o;switch(null==(o=t.geometry)?void 0:o.type){case"Point":e.MultiPoint.coordinates.push(t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"MultiPoint":(n=e.MultiPoint.coordinates).push.apply(n,l(t.geometry.coordinates)),e.MultiPoint.properties.push(t.properties);break;case"LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"MultiLineString":(r=e.MultiLineString.coordinates).push.apply(r,l(t.geometry.coordinates)),e.MultiLineString.properties.push(t.properties);break;case"Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case"MultiPolygon":(i=e.MultiPolygon.coordinates).push.apply(i,l(t.geometry.coordinates)),e.MultiPolygon.properties.push(t.properties)}})),S(Object.keys(e).filter((function(t){return e[t].coordinates.length})).sort().map((function(t){return v({type:t,coordinates:e[t].coordinates},{collectedProperties:e[t].properties})})))},e.concave=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxEdge||1/0,r=function(t){var e=[],n={};return lt(t,(function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");Object.prototype.hasOwnProperty.call(n,r)||(e.push(t),n[r]=!0)}})),S(e)}(t),i=Ji(r);if(i.features=i.features.filter((function(t){var r=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],a=nt(r,i,e),s=nt(i,o,e),u=nt(r,o,e);return a<=n&&s<=n&&u<=n})),i.features.length<1)return null;var o=Oo(i);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),v(o)},e.containsNumber=X,e.convertArea=B,e.convertLength=D,e.convex=Ei,e.coordAll=ht,e.coordEach=ot,e.coordReduce=at,e.createBins=Ai,e.degreesToRadians=F,e.destination=et,e.difference=function(t){var e=[];if(ft(t,(function(t){e.push(t.coordinates)})),e.length<2)throw new Error("Must have at least two features");var n=t.features[0].properties||{},r=sa.difference.apply(sa,[e[0]].concat(l(e.slice(1))));return 0===r.length?null:1===r.length?w(r[0],n):k(r,n)},e.dissolve=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!q(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;K(t,"Polygon","dissolve");var r=[];if(!n)return ua(k(sa.union.apply(null,t.features.map((function(t){return t.geometry.coordinates})))));var i={};lt(t,(function(t){t.properties&&(Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t))}));for(var o=Object.keys(i),a=0;a1&&void 0!==arguments[1]?arguments[1]:{},o=i.properties,a=null==(e=i.autoComplete)||e,s=null==(n=i.orderCoords)||n;if(null!=(r=i.mutate)&&r||(t=Mi(t)),"FeatureCollection"===t.type){var u=[];return t.features.forEach((function(t){u.push(W(su(t,{},a,s)))})),k(u,o)}return su(t,o,a,s)},e.mask=function(t,e,n){var r,i=null!=(r=null==n?void 0:n.mutate)&&r,o=e;e&&!1===i&&(o=Mi(e));var a,s=function(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return t&&(e="Feature"===t.type?t.geometry.coordinates:t.coordinates),w(e)}(o);return("FeatureCollection"===t.type?lu(2===(a=t).features.length?sa.union(a.features[0].geometry.coordinates,a.features[1].geometry.coordinates):sa.union.apply(sa,a.features.map((function(t){return t.geometry.coordinates})))):"Feature"===t.type?lu(sa.union(t.geometry.coordinates)):lu(sa.union(t.coordinates))).geometry.coordinates.forEach((function(t){s.geometry.coordinates.push(t[0])})),s},e.meta=xt,e.midpoint=function(t,e){return et(t,nt(t,e)/2,tt(t,e))},e.moranIndex=function(t,e){var n,r,i=e.inputField,o=e.threshold||1e5,a=e.p||2,s=null!=(n=e.binary)&&n,u=ca(t,{alpha:e.alpha||-1,binary:s,p:a,standardization:null==(r=e.standardization)||r,threshold:o}),l=[];lt(t,(function(t){var e=t.properties||{};l.push(e[i])}));for(var c=cu(l),h=function(t){var e,n=cu(t),r=0,i=f(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r+=Math.pow(o-n,2)}}catch(t){i.e(t)}finally{i.f()}return r/t.length}(l),p=0,d=0,g=0,y=0,v=u.length,m=0;m2&&void 0!==arguments[2]?arguments[2]:{},r=n.units,i=n.properties||{},o=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return ft(t,(function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})})),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter((function(t){return"Point"===t.geometry.type})),t;default:throw new Error("points must be a Point Collection")}}(t);if(!o.features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==Q(e))throw new Error("line must be a LineString");var a=1/0,s=null;return lt(o,(function(t){var n=wu(t,e,{units:r});n0&&(u=w(o).geometry),Du(u,s),o=s.slice(0)}r.push(w(o,i))}else{if("MultiPolygon"!==t.type)throw new Error("geometry is invalid, must be Polygon or MultiPolygon");for(var l=[[[]]],c=0;c0&&(f=k(l).geometry),Bu(f,h),l=h.slice(0)}r.push(k(l,i))}})),S(r)},e.polygonTangents=function(t,e){var n,r=W(t),i=W(e),o=[],a=[],s=Ct(e),l=0,c=null;switch(r[0]>s[0]&&r[0]s[1]&&r[1]_&&(_=x)}for(var O=[],E=Object.keys(u).length,S=h/E,M=0,C=0;C<_+1;C++)M+=Math.exp(-S)*Math.pow(S,C)/Ju(C),O.push(M);for(var k=[],N=0,j=0;j<_+1;j++){for(var L=0,P=Object.keys(u);LA&&(A=T)}var F=Zu[r]/Math.sqrt(E),D={criticalValue:F,isRandom:!0,maxAbsoluteDifference:A,observedDistribution:k};return A>F&&(D.isRandom=!1),D},e.radiansToDegrees=T,e.radiansToLength=L,e.random=al,e.randomLineString=rl,e.randomPoint=el,e.randomPolygon=nl,e.randomPosition=Qu,e.rectangleGrid=Na,e.rewind=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!q(r=r||{}))throw new Error("options is invalid");var i=null!=(e=r.mutate)&&e,o=null!=(n=r.reverse)&&n;if(!t)throw new Error(" is required");if("boolean"!=typeof o)throw new Error(" must be a boolean");if("boolean"!=typeof i)throw new Error(" must be a boolean");i||"Point"===t.type||"MultiPoint"===t.type||(t=Mi(t));var a=[];switch(t.type){case"GeometryCollection":return ft(t,(function(t){sl(t,o)})),t;case"FeatureCollection":return lt(t,(function(t){lt(sl(t,o),(function(t){a.push(t)}))})),S(a)}return sl(t,o)},e.rhumbBearing=rt,e.rhumbDestination=ha,e.rhumbDistance=fa,e.round=j,e.sample=function(t,e){if(!t)throw new Error("fc is required");if(null==e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return S(function(t,e){for(var n,r,i=t.slice(0),o=t.length,a=o-e;o-- >a;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(a)}(t.features,e))},e.sector=function(t,e,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!q(o=o||{}))throw new Error("options is invalid");var a=o.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==i)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!==r(o))throw new Error("options must be an object");if(cl(n)===cl(i))return Si(t,e,o);var s=W(t),u=Zs(t,e,n,i,o),l=[[s]];return ot(u,(function(t){l[0].push(t)})),l[0].push(s),w(l,a)},e.segmentEach=yt,e.segmentReduce=vt,e.shortestPath=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!q(n=n||{}))throw new Error("options is invalid");var r=n.obstacles||S([]),i=n.resolution||100;if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(i&&(!G(i)||i<=0))throw new Error("options.resolution must be a number, greater than 0");var o=Y(t),a=Y(e);if(t=_(o),e=_(a),"FeatureCollection"===r.type){if(0===r.features.length)return O([o,a])}else{if("Polygon"!==r.type)throw new Error("invalid obstacles");r=S([v(J(r))])}var s=r;s.features.push(t),s.features.push(e);var l=u(Ct(hl(Pt(Ct(s)),1.15)),4),c=l[0],h=l[1],f=l[2],p=l[3],d=nt([c,h],[f,h],n)/i;s.features.pop(),s.features.pop();for(var g,y,m=d/nt([c,h],[f,h],n)*(f-c),b=d/nt([c,h],[c,p],n)*(p-h),w=f-c,x=p-h,E=Math.floor(w/m),M=Math.floor(x/b),C=(w-E*m)/2,k=[],N=[],j=1/0,L=1/0,P=p-(x-M*b)/2,I=0;P>=h;){for(var A=[],R=[],T=c+C,F=0;T<=f;){var D=_([T,P]),B=ml(D,r);A.push(B?0:1),R.push(T+"|"+P);var z=nt(D,t);!B&&z1&&void 0!==arguments[1]?arguments[1]:{};if(!q(i=null!=i?i:{}))throw new Error("options is invalid");var o=null!=(e=i.tolerance)?e:1,a=null!=(n=i.highQuality)&&n,s=null!=(r=i.mutate)&&r;if(!t)throw new Error("geojson is required");if(o&&o<0)throw new Error("invalid tolerance");return!0!==s&&(t=Mi(t)),ft(t,(function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;if(xe(t,{mutate:!0}),"GeometryCollection"!==r)switch(r){case"LineString":t.coordinates=wl(t.coordinates,e,n);break;case"MultiLineString":t.coordinates=t.coordinates.map((function(t){return wl(t,e,n)}));break;case"Polygon":t.coordinates=xl(t.coordinates,e,n);break;case"MultiPolygon":t.coordinates=t.coordinates.map((function(t){return xl(t,e,n)}))}}(t,o,a)})),t},e.square=eu,e.squareGrid=ja,e.standardDeviationalEllipse=function(t,e){var n;if(!q(e=e||{}))throw new Error("options is invalid");var r=e.steps||64,i=e.weight,o=e.properties||{};if(!G(r))throw new Error("steps must be a number");if(!q(o))throw new Error("properties must be a number");var a=ht(t).length,s=Xr(t,{weight:i}),u=0,l=0,c=0;lt(t,(function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=El(W(t),W(s));u+=Math.pow(r.x,2)*n,l+=Math.pow(r.y,2)*n,c+=r.x*r.y*n}));var h=u-l,f=Math.sqrt(Math.pow(h,2)+4*Math.pow(c,2)),p=2*c,d=Math.atan((h+f)/p),g=180*d/Math.PI,y=0,v=0,m=0;lt(t,(function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=El(W(t),W(s));y+=Math.pow(r.x*Math.cos(d)-r.y*Math.sin(d),2)*n,v+=Math.pow(r.x*Math.sin(d)+r.y*Math.cos(d),2)*n,m+=n}));var _=Math.sqrt(2*y/m),b=Math.sqrt(2*v/m),w=da(s,_,b,{units:"degrees",angle:g,steps:r,properties:o}),x=Lu(t,S([w])),O={meanCenterCoordinates:W(s),semiMajorAxis:_,semiMinorAxis:b,numberOfFeatures:a,angle:g,percentageWithinEllipse:100*ht(x).length/a};return w.properties=null!=(n=w.properties)?n:{},w.properties.standardDeviationalEllipse=O,w},e.tag=function(t,e,n,r){return t=Mi(t),e=Mi(e),lt(t,(function(t){t.properties||(t.properties={}),lt(e,(function(e){t.properties&&e.properties&&void 0===t.properties[r]&&Tt(t,e)&&(t.properties[r]=e.properties[n])}))})),t},e.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=$l(t.geometry.coordinates):t.geometry.coordinates.forEach((function(t){e.features=e.features.concat($l(t))})),e},e.tin=Ji,e.toMercator=Uu,e.toWgs84=Vu,e.transformRotate=pa,e.transformScale=hl,e.transformTranslate=function(t,e,n,r){if(!q(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,a=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(null==n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n+=180),!1!==a&&void 0!==a||(t=Mi(t)),ot(t,(function(t){var r=W(ha(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)})),t},e.triangleGrid=La,e.truncate=nu,e.union=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(ft(t,(function(t){n.push(t.coordinates)})),n.length<2)throw new Error("Must have at least 2 geometries");var r=sa.union.apply(sa,[n[0]].concat(l(n.slice(1))));return 0===r.length?null:1===r.length?w(r[0],e.properties):k(r,e.properties)},e.unkinkPolygon=function(t){var e=[];return dt(t,(function(t){"Polygon"===t.geometry.type&<(ec(t),(function(n){e.push(w(n.geometry.coordinates,t.properties))}))})),S(e)},e.validateBBox=z,e.validateId=U,e.voronoi=function(t,e){if(!q(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return K(t,"Point","points"),S(function(){var t=lc,e=cc,n=null;function r(r){return new Vc(r.map((function(n,i){var o=[Math.round(t(n,i,r)/qc)*qc,Math.round(e(n,i,r)/qc)*qc];return o.index=i,o.data=n,o})),n)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e?e:uc(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:uc(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x((function(t){return t.geometry.coordinates[0]})).y((function(t){return t.geometry.coordinates[1]})).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map((function(e,n){return Object.assign(function(t){return(t=t.slice()).push(t[0]),w([t])}(e),{properties:ki(t.features[n].properties)})})))},Object.defineProperty(e,"__esModule",{value:!0})}(e)}).call(this,n(131),n(226))},,function(t,e,n){"use strict";e.a={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"}},,,function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(u," */")),o=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([i]).join("\n")}var a,s,u;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o=1024){var n=0;for(var i in l)0==(3&n++)&&(delete l[i],--c)}e=function(t){var e,n,i,s,l;if(a.exec(t)&&(t=u(t)),o.exec(t)){var c=t.length-1,h=void 0;h=c<=4?1:2;var f=4===c||8===c;e=parseInt(t.substr(1+0*h,h),16),n=parseInt(t.substr(1+1*h,h),16),i=parseInt(t.substr(1+2*h,h),16),s=f?parseInt(t.substr(1+3*h,h),16):255,1==h&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,f&&(s=(s<<4)+s)),l=[e,n,i,s/255]}else 0==t.indexOf("rgba(")?p(l=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((l=t.slice(4,-1).split(",").map(Number)).push(1),p(l)):Object(r.a)(!1,14);return l}(t),l[t]=e,++c}return e});function f(t){return Array.isArray(t)?t:h(t)}function p(t){return t[0]=Object(i.a)(t[0]+.5|0,0,255),t[1]=Object(i.a)(t[1]+.5|0,0,255),t[2]=Object(i.a)(t[2]+.5|0,0,255),t[3]=Object(i.a)(t[3],0,1),t}function d(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+n+","+r+","+(void 0===t[3]?1:t[3])+")"}},,function(t,e,n){"use strict";e.a={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return p})),n.d(e,"c",(function(){return d}));var r,i=n(117),o=n(25),a=n(8),s=n(59),u=n(13),l=n(26);function c(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function h(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function f(t,e,n,r){var i=Object(u.p)(n,e,t),o=Object(u.h)(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var l=t.getMetersPerUnit();void 0!==l&&(o/=l);var c=t.getExtent();if(!c||Object(a.f)(c,i)){var h=Object(u.h)(t,o,i)/o;isFinite(h)&&h>0&&(o/=h)}return o}function p(t,e,n,r){var i=Object(a.w)(n),o=f(t,e,i,r);return(!isFinite(o)||o<=0)&&Object(a.s)(n,(function(n){return o=f(t,e,n,r),isFinite(o)&&o>0})),o}function d(t,e,n,u,f,p,d,g,y,v,m,_){var b=Object(s.a)(Math.round(n*t),Math.round(n*e));if(Object(o.a)(b,_),0===y.length)return b.canvas;function w(t){return Math.round(t*n)/n}b.scale(n,n),b.globalCompositeOperation="lighter";var x=Object(a.j)();y.forEach((function(t,e,n){Object(a.p)(x,t.extent)}));var O=Object(a.D)(x),E=Object(a.z)(x),S=Object(s.a)(Math.round(n*O/u),Math.round(n*E/u));Object(o.a)(S,_);var M=n/u;y.forEach((function(t,e,n){var r=t.extent[0]-x[0],i=-(t.extent[3]-x[3]),o=Object(a.D)(t.extent),s=Object(a.z)(t.extent);t.image.width>0&&t.image.height>0&&S.drawImage(t.image,v,v,t.image.width-2*v,t.image.height-2*v,r*M,i*M,o*M,s*M)}));var C=Object(a.B)(d);return g.getTriangles().forEach((function(t,e,o){var a=t.source,s=t.target,f=a[0][0],d=a[0][1],g=a[1][0],y=a[1][1],v=a[2][0],m=a[2][1],O=w((s[0][0]-C[0])/p),E=w(-(s[0][1]-C[1])/p),M=w((s[1][0]-C[0])/p),k=w(-(s[1][1]-C[1])/p),N=w((s[2][0]-C[0])/p),j=w(-(s[2][1]-C[1])/p),L=f,P=d;f=0,d=0;var I=[[g-=L,y-=P,0,0,M-O],[v-=L,m-=P,0,0,N-O],[0,0,g,y,k-E],[0,0,v,m,j-E]],A=Object(l.f)(I);if(A){if(b.save(),b.beginPath(),function(){if(void 0===r){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",c(t,4,5,4,0),c(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;r=h(e,0)||h(e,4)||h(e,8)}return r}()||_===i.b){b.moveTo(M,k);for(var R=O-M,T=E-k,F=0;F<4;F++)b.lineTo(M+w((F+1)*R/4),k+w(F*T/3)),3!=F&&b.lineTo(M+w((F+1)*R/4),k+w((F+1)*T/3));b.lineTo(N,j)}else b.moveTo(M,k),b.lineTo(O,E),b.lineTo(N,j);b.clip(),b.transform(A[0],A[2],A[1],A[3],O,E),b.translate(x[0]-L,x[3]-P),b.scale(u/n,-u/n),b.drawImage(S.canvas,0,0),b.restore()}})),m&&(b.save(),b.globalCompositeOperation="source-over",b.strokeStyle="black",b.lineWidth=1,g.getTriangles().forEach((function(t,e,n){var r=t.target,i=(r[0][0]-C[0])/p,o=-(r[0][1]-C[1])/p,a=(r[1][0]-C[0])/p,s=-(r[1][1]-C[1])/p,u=(r[2][0]-C[0])/p,l=-(r[2][1]-C[1])/p;b.beginPath(),b.moveTo(a,s),b.lineTo(i,o),b.lineTo(u,l),b.closePath(),b.stroke()})),b.restore()),b.canvas}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(26);function i(t){return void 0!==t?0:void 0}function o(t){return void 0!==t?t:void 0}function a(t){var e=2*Math.PI/t;return function(t,n){return n?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}function s(t){var e=t||Object(r.j)(5);return function(t,n){return n?t:void 0!==t?Math.abs(t)<=e?0:t:void 0}}},function(t,e,n){"use strict";e.a={FRACTION:"fraction",PIXELS:"pixels"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function i(t,e,n,i,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=n,o.maxY=i,o):new r(t,e,n,i)}e.b=r},function(t,e,n){"use strict";e.a={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return q}));var r,i=n(75),o=n(116),a=n(50),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:250,n}return s(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==a.a.DBLCLICK){var n=t.originalEvent,r=t.map,i=t.coordinate,s=n.shiftKey?-this.delta_:this.delta_,u=r.getView();Object(o.c)(u,s,i,this.duration_),n.preventDefault(),e=!0}return!e},e}(o.a),l=n(229),c=n(79),h=n(51),f=n(53),p=n(161),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{stopDown:h.a})||this).condition_=r.condition?r.condition:f.c,n.lastAngle_=void 0,n.duration_=void 0!==r.duration?r.duration:250,n}return d(e,t),e.prototype.handleDragEvent=function(t){if(Object(f.g)(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==p.c){var r=e.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Object(f.g)(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Object(f.g)(t)&&(!(!Object(f.f)(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(c.b),y=n(255),v=n(104),m=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e){var n=this,r=e||{},i=r.condition?r.condition:f.k;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return m(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var r=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(r),o=e.getResolution()/i;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:v.b})},e}(y.a),b=n(28),w=37,x=38,O=39,E=40,S=n(47),M=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.defaultCondition_=function(t){return Object(f.i)(t)&&Object(f.m)(t)},n.condition_=void 0!==r.condition?r.condition:n.defaultCondition_,n.duration_=void 0!==r.duration?r.duration:100,n.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,n}return M(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==b.a.KEYDOWN){var n=t.originalEvent,r=n.keyCode;if(this.condition_(t)&&(r==E||r==w||r==O||r==x)){var i=t.map.getView(),a=i.getResolution()*this.pixelDelta_,s=0,u=0;r==E?u=-a:r==w?s=-a:r==O?s=a:u=a;var l=[s,u];Object(S.g)(l,i.getRotation()),Object(o.b)(i,l,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),k=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.condition_=r.condition?r.condition:f.m,n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:100,n}return k(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==b.a.KEYDOWN||t.type==b.a.KEYPRESS){var n=t.originalEvent,r=n.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,a=r=="+".charCodeAt(0)?this.delta_:-this.delta_,s=i.getView();Object(o.c)(s,a,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),j=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[n+2]>t;)n-=3;var r=this.points_[e+2]-this.points_[n+2];if(r<1e3/60)return!1;var i=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),L=n(81),P=n(26),I=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),A="trackpad",R="wheel",T=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,r)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,n.duration_=void 0!==r.duration?r.duration:250,n.timeout_=void 0!==r.timeout?r.timeout:80,n.useAnchor_=void 0===r.useAnchor||r.useAnchor,n.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:f.d;return n.condition_=r.onFocusOnly?Object(f.a)(f.e,i):i,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return I(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==b.a.WHEEL)return!0;var e,n=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==b.a.WHEEL&&(e=r.deltaY,L.b&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=L.a),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?A:R);var o=n.getView();if(this.mode_===A&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-Object(P.a)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Object(o.c)(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(o.a),F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==r.threshold?r.threshold:.3,n.duration_=void 0!==r.duration?r.duration:250,n}return F(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==p.c){var u=a.getViewport().getBoundingClientRect(),l=Object(c.a)(this.targetPointers);l[0]-=u.left,l[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(l),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(c.b),B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),G=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.duration_=void 0!==r.duration?r.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return B(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,o=n.clientY-r.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,u=s.getView();1!=e&&(this.lastScaleDelta_=e);var l=s.getViewport().getBoundingClientRect(),h=Object(c.a)(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(c.b);function q(t){var e=t||{},n=new i.a,r=new j(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new g),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new u({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new l.a({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new D),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new G({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new C),n.push(new N({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new T({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new _({duration:e.zoomDuration})),n}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(256);function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Object(r.a)(t,e)}},function(t,e,n){"use strict";function r(t,e,n,r){var i=n?n.call(r,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Object(a.s)(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===m.a.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===m.a.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===m.a.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===m.a.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===m.a.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new v.a(m.a.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==I||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===I)e=!0;else if(i===T)e=2===this.sketchCoords_.length;else if(i===A)n=this.sketchCoords_.length>this.minPoints_;else if(i===R){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var a=this.getMap(),s=0,u=r.length;s=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===R&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===A||r===T){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var o=this.finishCoordinate_.slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(t,e,n),e.getType()===i.a.POLYGON&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===R){(t=this.sketchCoords_[0]).splice(-2,1);var a=this.sketchLine_.getGeometry();if(t.length>=2){o=t[t.length-2].slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}a.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===A?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===R&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),this.type_===i.a.MULTI_POINT?t.setGeometry(new b.a([e])):this.type_===i.a.MULTI_LINE_STRING?t.setGeometry(new _.a([e])):this.type_===i.a.MULTI_POLYGON&&t.setGeometry(new w.a([e])),this.dispatchEvent(new G(D,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new G(B,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===A||n===T)e=this.sketchCoords_;else{if(n!==R)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(t,n,a){var s=o.URL||o.webkitURL,u=document.createElement("a");n=n||t.name||"download",u.download=n,u.rel="noopener","string"==typeof t?(u.href=t,u.origin===location.origin?i(u):r(u.href)?e(t,n,a):i(u,u.target="_blank")):(u.href=s.createObjectURL(t),setTimeout((function(){s.revokeObjectURL(u.href)}),4e4),setTimeout((function(){i(u)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,o){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,o),n);else if(r(t))e(t,n,o);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout((function(){i(a)}))}}:function(t,n,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,r);var s="application/octet-stream"===t.type,u=/constructor/i.test(o.HTMLElement)||o.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&u||a)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var t=c.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},c.readAsDataURL(t)}else{var h=o.URL||o.webkitURL,f=h.createObjectURL(t);i?i.location=f:location.href=f,i=null,setTimeout((function(){h.revokeObjectURL(f)}),4e4)}});o.saveAs=s.saveAs=s,t.exports=s})?r.apply(e,i):r)||(t.exports=o)}).call(this,n(131))},,function(t,e,n){"use strict";var r,i=n(181),o=n(52),a=n(234),s=n(45),u=n(272),l=n(2),c=function(){function t(t){this.tagName_=t}return t.prototype.getTagName=function(){return this.tagName_},t}(),h=n(32),f=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e,n){var r=t.call(this,e)||this;return r.conditions=n,Object(h.a)(r.conditions.length>=2,57),r}return f(e,t),e}(c),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return d(e,t),e}(p),y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e,n,r){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=n,4!==n.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=r,i}return y(e,t),e}(c),m=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.geometryName=n||"the_geom",o.geometry=r,o.srsName=i,o}return m(e,t),e}(c),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=(function(t){function e(e,n,r){return t.call(this,"Contains",e,n,r)||this}b(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),x=(function(t){function e(e,n,r,i,o){var a=t.call(this,"DWithin",e,n,o)||this;return a.distance=r,a.unit=i,a}w(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),O=(function(t){function e(e,n,r){return t.call(this,"Disjoint",e,n,r)||this}x(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),E=function(t){function e(e,n){var r=t.call(this,e)||this;return r.propertyName=n,r}return O(e,t),e}(c),S=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=(function(t){function e(e,n,r){var i=t.call(this,"During",e)||this;return i.begin=n,i.end=r,i}S(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),C=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.expression=r,o.matchCase=i,o}return M(e,t),e}(E),k=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=(function(t){function e(e,n,r){return t.call(this,"PropertyIsEqualTo",e,n,r)||this}k(e,t)}(C),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),j=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThan",e,n)||this}N(e,t)}(C),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),L=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,n)||this}j(e,t)}(C),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),P=(function(t){function e(e,n,r){return t.call(this,"Intersects",e,n,r)||this}L(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),I=(function(t){function e(e,n,r){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=n,i.upperBoundary=r,i}P(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),A=(function(t){function e(e,n,r,i,o,a){var s=t.call(this,"PropertyIsLike",e)||this;return s.pattern=n,s.wildCard=void 0!==r?r:"*",s.singleChar=void 0!==i?i:".",s.escapeChar=void 0!==o?o:"!",s.matchCase=a,s}I(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),R=(function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}A(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),T=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThan",e,n)||this}R(e,t)}(C),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),F=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThanOrEqualTo",e,n)||this}T(e,t)}(C),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),D=(function(t){function e(e){var n=t.call(this,"Not")||this;return n.condition=e,n}F(e,t)}(c),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),B=(function(t){function e(e,n,r){return t.call(this,"PropertyIsNotEqualTo",e,n,r)||this}D(e,t)}(C),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),G=(function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}B(e,t)}(p),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),q=(function(t){function e(e){var n=t.call(this,"ResourceId")||this;return n.rid=e,n}G(e,t)}(c),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}());!function(t){function e(e,n,r){return t.call(this,"Within",e,n,r)||this}q(e,t)}(_);var z=n(25),U=n(13),V=n(19),Y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),W={"http://www.opengis.net/gml":{boundedBy:Object(l.l)(s.b.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Object(l.i)(s.b.prototype.readFeaturesInternal)}},X={"http://www.opengis.net/wfs":{totalInserted:Object(l.l)(V.e),totalUpdated:Object(l.l)(V.e),totalDeleted:Object(l.l)(V.e)},"http://www.opengis.net/wfs/2.0":{totalInserted:Object(l.l)(V.e),totalUpdated:Object(l.l)(V.e),totalDeleted:Object(l.l)(V.e)}},H={"http://www.opengis.net/wfs":{TransactionSummary:Object(l.l)(ot,"transactionSummary"),InsertResults:Object(l.l)(lt,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:Object(l.l)(ot,"transactionSummary"),InsertResults:Object(l.l)(lt,"insertIds")}},Z={"http://www.opengis.net/wfs":{PropertyName:Object(l.j)(V.g)},"http://www.opengis.net/wfs/2.0":{PropertyName:Object(l.j)(V.g)}},K={"http://www.opengis.net/wfs":{Insert:Object(l.j)(ct),Update:Object(l.j)(dt),Delete:Object(l.j)(pt),Property:Object(l.j)(gt),Native:Object(l.j)(yt)},"http://www.opengis.net/wfs/2.0":{Insert:Object(l.j)(ct),Update:Object(l.j)(dt),Delete:Object(l.j)(pt),Property:Object(l.j)(gt),Native:Object(l.j)(yt)}},J="http://www.w3.org/2000/xmlns/",Q={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},$={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},tt={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},et={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},nt={"2.0.0":a.a,"1.1.0":o.a,"1.0.0":i.a},rt=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.version_=r.version?r.version:"1.1.0",n.featureType_=r.featureType,n.featureNS_=r.featureNS,n.gmlFormat_=r.gmlFormat?r.gmlFormat:new nt[n.version_],n.schemaLocation_=r.schemaLocation?r.schemaLocation:et[n.version_],n}return Y(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var n={node:t};Object(z.a)(n,{featureType:this.featureType_,featureNS:this.featureNS_}),Object(z.a)(n,this.getReadOptions(t,e||{}));var r,i=[n];r="2.0.0"===this.version_?W:this.gmlFormat_.FEATURE_COLLECTION_PARSERS;var o=Object(l.r)([],r,t,i,this.gmlFormat_);return o||(o=[]),o},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=Object(l.p)(t);return this.readTransactionResponseFromDocument(e)}return Object(l.h)(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=Object(l.p)(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Object(l.h)(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},n=Object(V.d)(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=n,Object(l.r)(e,W,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return Object(l.r)({},H,t,[])},e.prototype.writeGetFeature=function(t){var e=this,n=Object(l.c)($[this.version_],"GetFeature");n.setAttribute("service","WFS"),n.setAttribute("version",this.version_),t.handle&&n.setAttribute("handle",t.handle),t.outputFormat&&n.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&n.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&n.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&n.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&n.setAttribute("count",String(t.count)),void 0!==t.viewParams&&n.setAttribute("viewParams",t.viewParams),n.setAttributeNS(l.b,"xsi:schemaLocation",this.schemaLocation_);var r={node:n};if(Object(z.a)(r,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Object(h.a)(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var i=t.filter;t.bbox&&(Object(h.a)(t.geometryName,12),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),Object(z.a)(r,{geometryName:t.geometryName,filter:i}),At(n,t.featureTypes,[r])}else t.featureTypes.forEach((function(i){var o=e.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);Object(z.a)(r,{geometryName:i.geometryName,filter:o}),At(n,[i.name],[r])}));return n},e.prototype.combineBboxAndFilter=function(t,e,n,r){var i=function(t,e,n){return new v(t,e,n)}(t,e,n);return r?function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(g,e))}(r,i):i},e.prototype.writeTransaction=function(t,e,n,r){var i,o=[],a=r.version?r.version:this.version_,s=Object(l.c)($[a],"Transaction");s.setAttribute("service","WFS"),s.setAttribute("version",a),r&&(i=r.gmlOptions?r.gmlOptions:{},r.handle&&s.setAttribute("handle",r.handle)),s.setAttributeNS(l.b,"xsi:schemaLocation",et[a]);var u=function(t,e,n,r){var i,o=r.featurePrefix?r.featurePrefix:"feature";"1.0.0"===n?i=2:"1.1.0"===n?i=3:"2.0.0"===n&&(i=3.2);return Object(z.a)({node:t},{version:n,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:i,hasZ:r.hasZ,srsName:r.srsName},e)}(s,i,a,r);return t&&it("Insert",t,o,u),e&&it("Update",e,o,u),n&&it("Delete",n,o,u),r.nativeElements&&it("Native",r.nativeElements,o,u),s},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var n=[{}];return this.gmlFormat_.readGeometryElement(e,n),Object(U.g)(n.pop().srsName)}return null},e}(u.a);function it(t,e,n,r){Object(l.s)(r,K,Object(l.n)(t),e,n)}function ot(t,e){return Object(l.r)({},X,t,e)}var at={"http://www.opengis.net/ogc":{FeatureId:Object(l.i)((function(t,e){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Object(l.i)((function(t,e){return t.getAttribute("fid")}))}};function st(t,e){Object(l.q)(at,t,e)}var ut={"http://www.opengis.net/wfs":{Feature:st},"http://www.opengis.net/wfs/2.0":{Feature:st}};function lt(t,e){return Object(l.r)([],ut,t,e)}function ct(t,e,n){var r=n[n.length-1],s=r.featureType,u=r.featureNS,c=r.gmlVersion,h=Object(l.c)(u,s);t.appendChild(h),2===c?i.a.prototype.writeFeatureElement(h,e,n):3===c?o.a.prototype.writeFeatureElement(h,e,n):a.a.prototype.writeFeatureElement(h,e,n)}function ht(t,e,n){var r=n[n.length-1].version,i=Q[r],o=Object(l.c)(i,"Filter"),a=Object(l.c)(i,"FeatureId");o.appendChild(a),a.setAttribute("fid",e),t.appendChild(o)}function ft(t,e){var n=(t=t||"feature")+":";return 0===e.indexOf(n)?e:n+e}function pt(t,e,n){var r=n[n.length-1];Object(h.a)(void 0!==e.getId(),26);var i=r.featureType,o=r.featurePrefix,a=r.featureNS,s=ft(o,i);t.setAttribute("typeName",s),t.setAttributeNS(J,"xmlns:"+o,a);var u=e.getId();void 0!==u&&ht(t,u,n)}function dt(t,e,n){var r=n[n.length-1];Object(h.a)(void 0!==e.getId(),27);var i=r.version,o=r.featureType,a=r.featurePrefix,s=r.featureNS,u=ft(a,o),c=e.getGeometryName();t.setAttribute("typeName",u),t.setAttributeNS(J,"xmlns:"+a,s);var f=e.getId();if(void 0!==f){for(var p=e.getKeys(),d=[],g=0,y=p.length;g=a[0]&&s[2]<=a[2]||(s[1]>=a[1]&&s[3]<=a[3]||Object(i.a)(t,e,n,o,(function(t,e){return Object(r.F)(a,t,e)})))))}function s(t,e,n,r,i){for(var o=0,s=n.length;o0?r:Math.max(s/c[0],o/c[1]),f=i+1,p=new Array(f),d=0;d0}function o(t,e,n,r,o){for(var a=void 0!==o&&o,s=0,u=n.length;s1?u:2,x=s||new Array(w);for(y=0;y>1;othis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var n=this.cache_[e];0!=(3&t++)||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var r=o(t,e,n);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,n,r){var i=o(t,e,n);this.cache_[i]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function o(t,e,n){return e+":"+t+":"+(n?Object(r.b)(n):"null")}var a=new i},,function(t,e,n){"use strict";function r(t,e){var n=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))}));var r=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r,i=n(73),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.map=n,i.frameState=void 0!==r?r:null,i}return o(e,t),e}(i.a);e.a=a},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));var r=n(0),i="undefined"!=typeof document,o=function(t){return t()},a=!!r.useInsertionEffect&&r.useInsertionEffect,s=i&&a||o,u=a||r.useLayoutEffect},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=n(281),o=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(t){return 45===t.charCodeAt(1)},u=function(t){return null!=t&&"boolean"!=typeof t},l=Object(i.a)((function(t){return s(t)?t:t.replace(o,"-$&").toLowerCase()})),c=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(a,(function(t,e,n){return f={name:e,styles:n,next:f},e}))}return 1===r[t]||s(t)||"number"!=typeof e||0===e?e:e+"px"};function h(t,e,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return f={name:i.name,styles:i.styles,next:f},i.name;var o=n;if(void 0!==o.styles){var a=o.next;if(void 0!==a)for(;void 0!==a;)f={name:a.name,styles:a.styles,next:f},a=a.next;return o.styles+";"}return function(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i=4;++r,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+u,styles:i,next:f}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return M}));var r,i=n(73),o=n(38),a=n(101),s=n(28),u=n(208),l=n(276),c=n(160),h=n(8),f=n(27),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,r,i,s,u,f){var p=this,d=e.getExtent(),g=n.getExtent(),y=g?Object(h.A)(r,g):r,v=Object(h.w)(y),m=Object(c.b)(e,n,v,i),_=a.b,b=new l.a(e,n,y,d,m*_,i),w=u(b.calculateSourceExtent(),m,s),x=w?o.a.IDLE:o.a.EMPTY,O=w?w.getPixelRatio():1;return(p=t.call(this,r,i,O,x)||this).targetProj_=n,p.maxSourceExtent_=d,p.triangulation_=b,p.targetResolution_=i,p.targetExtent_=r,p.sourceImage_=w,p.sourcePixelRatio_=O,p.contextOptions_=f,p.canvas_=null,p.sourceListenerKey_=null,p}return p(e,t),e.prototype.disposeInternal=function(){this.state==o.a.LOADING&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==o.a.LOADED){var e=Object(h.D)(this.targetExtent_)/this.targetResolution_,n=Object(h.z)(this.targetExtent_)/this.targetResolution_;this.canvas_=Object(c.c)(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==o.a.IDLE){this.state=o.a.LOADING,this.changed();var t=this.sourceImage_.getState();t==o.a.LOADED||t==o.a.ERROR?this.reproject_():(this.sourceListenerKey_=Object(f.a)(this.sourceImage_,s.a.CHANGE,(function(t){var e=this.sourceImage_.getState();e!=o.a.LOADED&&e!=o.a.ERROR||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){Object(f.c)(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(u.a),g=n(207),y=n(117),v=n(21),m=n(13),_=n(36),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w="imageloadstart",x="imageloadend",O="imageloaderror",E=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return b(e,t),e}(i.a),S=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return n.on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n.contextOptions_=!1===e.imageSmoothing?y.b:void 0,n}return b(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=Object(_.f)(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(a.a&&i&&r&&!Object(m.c)(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Object(m.c)(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&Object(h.o)(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new d(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return Object(v.b)()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case o.a.LOADING:this.loading=!0,this.dispatchEvent(new E(w,e));break;case o.a.LOADED:this.loading=!1,this.dispatchEvent(new E(x,e));break;case o.a.ERROR:this.loading=!1,this.dispatchEvent(new E(O,e))}},e}(g.a);function M(t,e){t.getImage().src=e}e.a=S},,,function(t,e){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,l=[],c=!1,h=-1;function f(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&p())}function p(){if(!c){var t=s(f);c=!0;for(var e=l.length;e;){for(u=l,l=[];++h1)for(var n=1;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(i.b);e.a=c},,,function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return o}));var r,i=!("undefined"==typeof window||!window.document||!window.document.createElement);function o(t){if((!r&&0!==r||t)&&i){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),r=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return r}},function(t,e,n){"use strict";var r,i=n(55),o=n(16),a=n(96),s=n(122),u=n(8),l=n(114),c=n(141),h=n(84),f=n(205),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return p(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,r){return r=this.minZoom;){if(2===this.zoomFactor_?(a=Math.floor(a/2),s=Math.floor(s/2),o=Object(r.a)(a,a,s,s,n)):o=this.getTileRangeForExtentAndZ(u,l,n),e(l,o))return!0;--l}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]this.maxZoom||et.length)&&(e=t.length);for(var n=0,r=Array(e);n-1}))}(t)){var e=Object(g.a)(t);if(function(t){var e=p(t,"authority");if(e){var n=p(e,"epsg");return n&&_.indexOf(n)>-1}}(e))return v["EPSG:3857"];var n=function(t){var e=p(t,"extension");if(e)return p(e,"proj4")}(e);return n?d(n):e}return function(t){return"+"===t[0]}(t)?d(t):void 0},w=function(t,e){var n,r;if(t=t||{},!e)return t;for(r in e)void 0!==(n=e[r])&&(t[r]=n);return t},x=function(t,e,n){var r=t*e;return n/Math.sqrt(1-r*r)},O=function(t){return t<0?-1:1},E=function(t){return Math.abs(t)<=l?t:t-O(t)*u},S=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r},M=function(t,e){for(var n,r,o=.5*t,a=i-2*Math.atan(e),s=0;s<=15;s++)if(n=t*Math.sin(a),a+=r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-a,Math.abs(r)<=1e-10)return a;return-9999};function C(t){return t}var k=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,n,r=t.x,o=t.y;if(o*a>90&&o*a<-90&&r*a>180&&r*a<-180)return null;if(Math.abs(Math.abs(o)-i)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*E(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(s+.5*o));else{var u=Math.sin(o),l=S(this.e,o,u);e=this.x0+this.a*this.k0*E(r-this.long0),n=this.y0-this.a*this.k0*Math.log(l)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=i-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var a=Math.exp(-o/(this.a*this.k0));if(-9999===(n=M(this.e,a)))return null}return e=E(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:C,inverse:C,names:["longlat","identity"]}],N={},j=[];function L(t,e){var n=j.length;return t.names?(j[n]=t,t.names.forEach((function(t){N[t.toLowerCase()]=n})),this):(console.log(e),!0)}var P={start:function(){k.forEach(L)},add:L,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==N[e]&&j[N[e]]?j[N[e]]:void 0}},I={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},A=I.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};I.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var R={};R.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},R.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},R.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},R.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},R.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},R.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},R.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},R.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},R.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},R.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},R.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},R.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},R.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},R.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},R.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},R.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},R.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},R.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var T=function(t,e,n,i,o,a,s){var u={};return u.datum_type=void 0===t||"none"===t?5:4,e&&(u.datum_params=e.map(parseFloat),0===u.datum_params[0]&&0===u.datum_params[1]&&0===u.datum_params[2]||(u.datum_type=1),u.datum_params.length>3&&(0===u.datum_params[3]&&0===u.datum_params[4]&&0===u.datum_params[5]&&0===u.datum_params[6]||(u.datum_type=2,u.datum_params[3]*=r,u.datum_params[4]*=r,u.datum_params[5]*=r,u.datum_params[6]=u.datum_params[6]/1e6+1))),s&&(u.datum_type=3,u.grids=s),u.a=n,u.b=i,u.es=o,u.ep2=a,u},F={};function D(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:F[t]||null,isNull:!1}}function B(t){return t/3600*Math.PI/180}function G(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function q(t){return t.map((function(t){return[B(t.longitudeShift),B(t.latitudeShift)]}))}function z(t,e,n){return{name:G(t,e+8,e+16).trim(),parent:G(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function U(t,e,n,r){for(var i=e+176,o=[],a=0;a-1.001*i)l=-i;else if(l>i&&l<1.001*i)l=i;else{if(l<-i)return{x:-1/0,y:-1/0,z:t.z};if(l>i)return{x:1/0,y:1/0,z:t.z}}return u>Math.PI&&(u-=2*Math.PI),o=Math.sin(l),s=Math.cos(l),a=o*o,{x:((r=n/Math.sqrt(1-e*a))+c)*s*Math.cos(u),y:(r+c)*s*Math.sin(u),z:(r*(1-e)+c)*o}}function X(t,e,n,r){var o,a,s,u,l,c,h,f,p,d,g,y,v,m,_,b=t.x,w=t.y,x=t.z?t.z:0;if(o=Math.sqrt(b*b+w*w),a=Math.sqrt(b*b+w*w+x*x),o/n<1e-12){if(m=0,a/n<1e-12)return i,_=-r,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(w,b);s=x/a,f=(u=o/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*u*u)),p=s*l,v=0;do{v++,c=e*(h=n/Math.sqrt(1-e*p*p))/(h+(_=o*f+x*p-h*(1-e*p*p))),y=(g=s*(l=1/Math.sqrt(1-c*(2-c)*u*u)))*f-(d=u*(1-c)*l)*p,f=d,p=g}while(y*y>1e-24&&v<30);return{x:m,y:Math.atan(g/Math.abs(d)),z:_}}function H(t){return 1===t||2===t}var Z=function(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var r=t.a,i=t.es;if(3===t.datum_type){if(0!==K(t,!1,n))return;r=6378137,i=.0066943799901413165}var o=e.a,a=e.b,s=e.es;if(3===e.datum_type&&(o=6378137,a=6356752.314,s=.0066943799901413165),i===s&&r===o&&!H(t.datum_type)&&!H(e.datum_type))return n;if((n=W(n,i,r),H(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6];return{x:l*(t.x-u*t.y+s*t.z)+r,y:l*(u*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(n,t.datum_type,t.datum_params)),H(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=(t.x-r)/l,h=(t.y-i)/l,f=(t.z-o)/l;return{x:c+u*h-s*f,y:-u*c+h+a*f,z:s*c-a*h+f}}}(n,e.datum_type,e.datum_params)),n=X(n,s,o,a),3===e.datum_type)&&0!==K(e,!0,n))return;return n};function K(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},o=[];t:for(var s=0;sr.y||d>r.x||v1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=E(o.x+n.ll[0]),r.y=o.y+n.ll[1]}else isNaN(o.x)||(r.x=t.x+o.x,r.y=t.y+o.y);return r}function Q(t,e){var n,r={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(r.x),o=Math.floor(r.y),a=r.x-1*i,s=r.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;n=o*e.lim[0]+i;var l=e.cvs[n][0],c=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],d=e.cvs[n][1];n--;var g=e.cvs[n][0],y=e.cvs[n][1],v=a*s,m=a*(1-s),_=(1-a)*(1-s),b=(1-a)*s;return u.x=_*l+m*h+b*g+v*p,u.y=_*c+m*f+b*y+v*d,u}var $=function(t,e,n){var r,i,o,a=n.x,s=n.y,u=n.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(r=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(r=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(r=u,i="z"),t.axis[o]){case"e":l[i]=r;break;case"w":l[i]=-r;break;case"n":l[i]=r;break;case"s":l[i]=-r;break;case"u":void 0!==n[i]&&(l.z=r);break;case"d":void 0!==n[i]&&(l.z=-r);break;default:return null}return l},tt=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function et(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function nt(t,e,n,r){var i,s=void 0!==(n=Array.isArray(n)?tt(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(function(t){et(t.x),et(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=nt(t,i=new Y("WGS84"),n,r),t=i),r&&"enu"!==t.axis&&(n=$(t,!1,n)),"longlat"===t.projName)n={x:n.x*o,y:n.y*o,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=Z(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*a,y:n.y*a,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),r&&"enu"!==e.axis?$(e,!0,n):(n&&!s&&delete n.z,n)}var rt=Y("WGS84");function it(t,e,n,r){var i,o,a;return Array.isArray(n)?(i=nt(t,e,n,r)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(n.splice(3)):[i.x,i.y,n[2]].concat(n.splice(3)):[i.x,i.y].concat(n.splice(2)):[i.x,i.y]):(o=nt(t,e,n,r),2===(a=Object.keys(n)).length||a.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;o[r]=n[r]})),o)}function ot(t){return t instanceof Y?t:t.oProj?t.oProj:Y(t)}var at=function(t,e,n){t=ot(t);var r,i=!1;return void 0===e?(e=t,t=rt,i=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=rt,i=!0),e=ot(e),n?it(t,e,n):(r={forward:function(n,r){return it(t,e,n,r)},inverse:function(n,r){return it(e,t,n,r)}},i&&(r.oProj=e),r)},st=73,ut=79,lt={forward:ct,inverse:function(t){var e=dt(vt(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:ht};function ct(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(p=t.easting,d=t.northing,g=t.zoneNumber,y=yt(g),v=Math.floor(p/1e5),m=Math.floor(d/1e5)%20,i=v,o=m,a=y,s=a-1,u="AJSAJS".charCodeAt(s),l="AFAFAF".charCodeAt(s),c=u+i-1,h=l+o,f=!1,c>90&&(c=c-90+65-1,f=!0),(c===st||ust||(c>st||uut||(c>ut||u90&&(c=c-90+65-1),h>86?(h=h-86+65-1,f=!0):f=!1,(h===st||lst||(h>st||lut||(h>ut||l86&&(h=h-86+65-1),String.fromCharCode(c)+String.fromCharCode(h))+n.substr(n.length-5,e)+r.substr(r.length-5,e);var i,o,a,s,u,l,c,h,f;var p,d,g,y,v,m}(function(t){var e,n,r,i,o,a,s,u=t.lat,l=t.lon,c=6378137,h=ft(u),f=ft(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60);u>=56&&u<64&&l>=3&&l<12&&(s=32);u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37));a=ft(6*(s-1)-180+3),.006739496752268451,e=c/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),n=Math.tan(h)*Math.tan(h),r=.006739496752268451*Math.cos(h)*Math.cos(h),i=Math.cos(h)*(f-a),o=c*(.9983242984503243*h-.002514607064228144*Math.sin(2*h)+2639046602129982e-21*Math.sin(4*h)-3.418046101696858e-9*Math.sin(6*h));var p=.9996*e*(i+(1-n+r)*i*i*i/6+(5-18*n+n*n+72*r-.39089081163157013)*i*i*i*i*i/120)+5e5,d=.9996*(o+e*Math.tan(h)*(i*i/2+(5-n+9*r+4*r*r)*i*i*i*i/24+(61-58*n+n*n+600*r-2.2240339282485886)*i*i*i*i*i*i/720));u<0&&(d+=1e7);return{northing:Math.round(d),easting:Math.round(p),zoneNumber:s,zoneLetter:gt(u)}}({lat:t[1],lon:t[0]}),e)}function ht(t){var e=dt(vt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function ft(t){return t*(Math.PI/180)}function pt(t){return t/Math.PI*180}function dt(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,l,c,h,f,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=n-5e5,y=e;r<"N"&&(y-=1e7),c=6*(i-1)-180+3,f=(h=y/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*h)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*h)+151*d*d*d/96*Math.sin(6*h),o=p/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),a=Math.tan(f)*Math.tan(f),s=.006739496752268451*Math.cos(f)*Math.cos(f),u=.99330562*p/Math.pow(1-.00669438*Math.sin(f)*Math.sin(f),1.5),l=g/(.9996*o);var v=f-o*Math.tan(f)/u*(l*l/2-(5+3*a+10*s-4*s*s-.06065547077041606)*l*l*l*l/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*l*l*l*l*l*l/720);v=pt(v);var m,_=(l-(1+2*a+s)*l*l*l/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(f);if(_=c+pt(_),t.accuracy){var b=dt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});m={top:b.lat,right:b.lon,bottom:v,left:_}}else m={lat:v,lon:_};return m}function gt(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function yt(t){var e=t%6;return 0===e&&(e=6),e}function vt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;r=t.substring(o,o+=2);for(var u=yt(a),l=function(t,e){var n="AJSAJS".charCodeAt(e-1),r=1e5,i=!1;for(;n!==t.charCodeAt(0);){if(++n===st&&n++,n===ut&&n++,n>90){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n="AFAFAF".charCodeAt(e-1),r=0,i=!1;for(;n!==t.charCodeAt(0);){if(++n===st&&n++,n===ut&&n++,n>86){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(1),u);c0&&(f=1e5/Math.pow(10,g),p=t.substring(o,o+g),y=parseFloat(p)*f,d=t.substring(o+g),v=parseFloat(d)*f),{easting:y+l,northing:v+c,zoneLetter:s,zoneNumber:a,accuracy:f}}function mt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function _t(t,e,n){if(!(this instanceof _t))return new _t(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}_t.fromMGRS=function(t){return new _t(ht(t))},_t.prototype.toMGRS=function(t){return ct([this.x,this.y],t)};var bt=_t,wt=.01068115234375,xt=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*wt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*wt)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e},Ot=function(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},Et=function(t,e,n){for(var r=1/(1-e),i=t,o=20;o;--o){var a=Math.sin(i),s=1-e*a*a;if(i-=s=(Ot(i,a,Math.cos(i),n)-t)*(s*Math.sqrt(s))*r,Math.abs(s)<1e-10)return i}return i};var St={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=xt(this.es),this.ml0=Ot(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,r,i=t.x,o=t.y,a=E(i-this.long0),s=Math.sin(o),u=Math.cos(o);if(this.es){var l=u*a,c=Math.pow(l,2),h=this.ep2*Math.pow(u,2),f=Math.pow(h,2),p=Math.abs(u)>1e-10?Math.tan(o):0,d=Math.pow(p,2),g=Math.pow(d,2);e=1-this.es*Math.pow(s,2),l/=Math.sqrt(e);var y=Ot(o,s,u,this.en);n=this.a*(this.k0*l*(1+c/6*(1-d+h+c/20*(5-18*d+g+14*h-58*d*h+c/42*(61+179*g-g*d-479*d)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+s*a*l/2*(1+c/12*(5-d+9*h+4*f+c/30*(61+g-58*d+270*h-330*d*h+c/56*(1385+543*g-g*d-3111*d))))))+this.y0}else{var v=u*Math.sin(a);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=u*Math.cos(a)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>1e-10)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,o,a=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+s/this.k0,n=Et(e,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,h=this.ep2*Math.pow(l,2),f=Math.pow(h,2),p=Math.pow(c,2),d=Math.pow(p,2);e=1-this.es*Math.pow(u,2);var g=a*Math.sqrt(e)/this.k0,y=Math.pow(g,2);r=n-(e*=c)*y/(1-this.es)*.5*(1-y/12*(5+3*p-9*h*p+h-4*f-y/30*(61+90*p-252*h*p+45*d+46*h-y/56*(1385+3633*p+4095*d+1574*d*p)))),o=E(this.long0+g*(1-y/6*(1+2*p+h-y/20*(5+28*p+24*d+8*h*p+6*h-y/42*(61+662*p+1320*d+720*d*p))))/l)}else r=i*O(s),o=0;else{var v=Math.exp(a/this.k0),m=.5*(v-1/v),_=this.lat0+s/this.k0,b=Math.cos(_);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(m,2))),r=Math.asin(e),s<0&&(r=-r),o=0===m&&0===b?0:E(Math.atan2(m,b)+this.long0)}return t.x=o,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Mt=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Ct=function(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))},kt=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(Ct(1,e)+1))),t<0?-e:e},Nt=function(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return e+n*Math.sin(2*e)},jt=function(t,e,n){for(var r,i,o=Math.sin(e),a=Math.cos(e),s=Mt(n),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(n),l=2*a*u,c=-2*o*s,h=t.length-1,f=t[h],p=0,d=0,g=0;--h>=0;)r=d,i=p,f=l*(d=f)-r-c*(p=g)+t[h],g=c*d-i+l*p;return[(l=o*u)*f-(c=a*s)*g,l*g+c*f]};var Lt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(St.init.apply(this),this.forward=St.forward,this.inverse=St.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=Nt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=E(t.x-this.long0),n=t.y;n=Nt(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),o=Math.sin(e),a=Math.cos(e);n=Math.atan2(r,a*i),e=Math.atan2(o*i,Ct(r,i*a)),e=kt(Math.tan(e));var s,u,l=jt(this.gtu,2*n,2*e);return n+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=jt(this.utg,2*i,2*r);i+=o[0],r+=o[1],r=Math.atan(Mt(r));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(r),l=Math.cos(r);i=Math.atan2(a*l,Ct(u,l*s)),r=Math.atan2(u,l*s),e=E(r+this.long0),n=Nt(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var Pt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(E(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*o,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Lt.init.apply(this),this.forward=Lt.forward,this.inverse=Lt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},It=function(t,e){return Math.pow((1-t)/(1+t),e)};var At={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+s)/(Math.pow(Math.tan(.5*this.lat0+s),this.C)*It(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+s),this.C)*It(this.e*Math.sin(n),this.ratexp))-i,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+s)/this.K,1/this.C),o=20;o>0&&(n=2*Math.atan(r*It(this.e*Math.sin(t.y),-.5*this.e))-i,!(Math.abs(n-t.y)<1e-14));--o)t.y=n;return o?(t.x=e,t.y=n,t):null},names:["gauss"]};var Rt={init:function(){At.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,r,i;return t.x=E(t.x-this.long0),At.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Ct(t.x,t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),n=Math.cos(a),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,At.inverse.apply(this,[t]),t.x=E(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var Tt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+O(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/S(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=x(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-i,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,o,a,s,u=t.x,l=t.y,c=Math.sin(l),h=Math.cos(l),f=E(u-this.long0);return Math.abs(Math.abs(u-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(f)),t.x=this.a*e*h*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*h*Math.cos(f))+this.y0,t):(n=2*Math.atan(this.ssfn_(l,c,this.e))-i,o=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(a=S(this.e,l*this.con,this.con*c),s=2*this.a*this.k0*a/this.cons,t.x=this.x0+s*Math.sin(u-this.long0),t.y=this.y0-this.con*s*Math.cos(u-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+o*Math.cos(f)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*o*Math.cos(f))),t.y=e*(this.cosX0*r-this.sinX0*o*Math.cos(f))+this.y0),t.x=e*o*Math.sin(f)+this.x0,t))},inverse:function(t){var e,n,r,o,a;t.x-=this.x0,t.y-=this.y0;var s=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var u=2*Math.atan(s/(2*this.a*this.k0));return e=this.long0,n=this.lat0,s<=1e-10?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(u)*this.sinlat0+t.y*Math.sin(u)*this.coslat0/s),e=Math.abs(this.coslat0)<1e-10?this.lat0>0?E(this.long0+Math.atan2(t.x,-1*t.y)):E(this.long0+Math.atan2(t.x,t.y)):E(this.long0+Math.atan2(t.x*Math.sin(u),s*this.coslat0*Math.cos(u)-t.y*this.sinlat0*Math.sin(u))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(s<=1e-10)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=s*this.cons/(2*this.a*this.k0),n=this.con*M(this.e,r),e=this.con*E(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else o=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=1e-10?a=this.X0:(a=Math.asin(Math.cos(o)*this.sinX0+t.y*Math.sin(o)*this.cosX0/s),e=E(this.long0+Math.atan2(t.x*Math.sin(o),s*this.cosX0*Math.cos(o)-t.y*this.sinX0*Math.sin(o)))),n=-1*M(this.e,Math.tan(.5*(i+a)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(i+t))*Math.pow((1-e)/(1+e),.5*n)}};var Ft={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),o=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,l=o,c=-1e3,h=0;Math.abs(l-c)>1e-7;){if(++h>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]};var Dt={init:function(){var t,e,n,r,a,l,c,h,f,p,d,g,y,v=0,m=0,_=0,b=0,w=0,x=0,O=0;this.no_off=(y="object"==typeof(g=this).PROJECTION?Object.keys(g.PROJECTION)[0]:g.PROJECTION,"no_uoff"in g||"no_off"in g||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(y)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var C=!1;if("rectified_grid_angle"in this&&(C=!0),M&&(O=this.alpha),C&&(v=this.rectified_grid_angle*o),M||C)m=this.longc;else if(_=this.long1,w=this.lat1,b=this.long2,x=this.lat2,Math.abs(w-x)<=1e-7||(t=Math.abs(w))<=1e-7||Math.abs(t-i)<=1e-7||Math.abs(Math.abs(this.lat0)-i)<=1e-7||Math.abs(Math.abs(x)-i)<=1e-7)throw new Error;var k=1-this.es;e=Math.sqrt(k),Math.abs(this.lat0)>1e-10?(h=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*h*h,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/k),this.A=this.B*this.k0*e/t,(a=(r=this.B*e/(n*Math.sqrt(t)))*r-1)<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=r,this.E*=Math.pow(S(this.e,this.lat0,h),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=a=1),M||C?(M?(d=Math.asin(Math.sin(O)/r),C||(v=O)):(d=v,O=Math.asin(r*Math.sin(d))),this.lam0=m-Math.asin(.5*(a-1/a)*Math.tan(d))/this.B):(l=Math.pow(S(this.e,w,Math.sin(w)),this.B),c=Math.pow(S(this.e,x,Math.sin(x)),this.B),a=this.E/l,f=(c-l)/(c+l),p=((p=this.E*this.E)-c*l)/(p+c*l),(t=_-b)<-Math.pi?b-=u:t>Math.pi&&(b+=u),this.lam0=E(.5*(_+b)-Math.atan(p*Math.tan(.5*this.B*(_-b))/f)/this.B),d=Math.atan(2*Math.sin(this.B*E(_-this.lam0))/(a-1/a)),v=O=Math.asin(r*Math.sin(d))),this.singam=Math.sin(d),this.cosgam=Math.cos(d),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(O))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*d,this.v_pole_n=this.ArB*Math.log(Math.tan(s-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(s+a))},forward:function(t){var e,n,r,o,a,s,u,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-i)>1e-10){if(e=.5*((a=this.E/Math.pow(S(this.e,t.y,Math.sin(t.y)),this.B))-(s=1/a)),n=.5*(a+s),o=Math.sin(this.B*t.x),r=(e*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),s=Math.cos(this.B*t.x),u=Math.abs(s)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+o*this.singam,s)}else l=t.y>0?this.v_pole_n:this.v_pole_s,u=this.ArB*t.y;return this.no_rot?(c.x=u,c.y=l):(u-=this.u_0,c.x=l*this.cosrot+u*this.sinrot,c.y=u*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,n,r,o,a,s,u,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),o=.5*((r=Math.exp(-this.BrA*n))-1/r),a=.5*(r+1/r),u=((s=Math.sin(this.BrA*e))*this.cosgam+o*this.singam)/a,Math.abs(Math.abs(u)-1)<1e-10)l.x=0,l.y=u<0?-i:i;else{if(l.y=this.E/Math.sqrt((1+u)/(1-u)),l.y=M(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(o*this.cosgam-s*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var Bt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),r=x(this.e,e,n),i=S(this.e,this.lat1,e),o=Math.sin(this.lat2),a=Math.cos(this.lat2),s=x(this.e,o,a),u=S(this.e,this.lat2,o),l=S(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(r/s)/Math.log(i/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=O(n)*(i-2e-10));var r,o,a=Math.abs(Math.abs(n)-i);if(a>1e-10)r=S(this.e,n,Math.sin(n)),o=this.a*this.f0*Math.pow(r,this.ns);else{if((a=n*this.ns)<=0)return null;o=0}var s=this.ns*E(e-this.long0);return t.x=this.k0*(o*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-o*Math.cos(s))+this.y0,t},inverse:function(t){var e,n,r,o,a,s=(t.x-this.x0)/this.k0,u=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+u*u),n=1):(e=-Math.sqrt(s*s+u*u),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*s,n*u)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(o=M(this.e,r)))return null}else o=-i;return a=E(l/this.ns+this.long0),t.x=a,t.y=o,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Gt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y,c=E(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),r=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]},qt=function(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)},zt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},Ut=function(t){return.375*t*(1+.25*t*(1+.46875*t))},Vt=function(t){return.05859375*t*t*(1+.75*t)},Yt=function(t){return t*t*t*(35/3072)},Wt=function(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)},Xt=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e};var Jt={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-i)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Kt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=.3333333333333333*t,e=t*t,n[0]+=.17222222222222222*e,n[1]=.06388888888888888*e,e*=t,n[0]+=.10257936507936508*e,n[1]+=.0664021164021164*e,n[2]=.016415012942191543*e,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Kt(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,r,o,a,u,l,c,h,f,p=t.x,d=t.y;if(p=E(p-this.long0),this.sphere){if(a=Math.sin(d),f=Math.cos(d),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+f*r:1+this.sinph0*a+this.cosph0*f*r)<=1e-10)return null;e=(n=Math.sqrt(2/n))*f*Math.sin(p),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*f*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.lat0)<1e-10)return null;n=s-.5*d,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(p),n*=r}}else{switch(l=0,c=0,h=0,r=Math.cos(p),o=Math.sin(p),a=Math.sin(d),u=Kt(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(l=u/this.qp,c=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:h=1+this.sinb1*l+this.cosb1*c*r;break;case this.EQUIT:h=1+c*r;break;case this.N_POLE:h=i+d,u=this.qp-u;break;case this.S_POLE:h=d-i,u=this.qp+u}if(Math.abs(h)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),n=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*l-this.sinb1*c*r):(h=Math.sqrt(2/(1+c*r)))*l*this.ymf,e=this.xmf*h*c*o;break;case this.N_POLE:case this.S_POLE:u>=0?(e=(h=Math.sqrt(u))*o,n=r*(this.mode===this.S_POLE?h:-h)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,o,a,s,u,l,c,h,f=t.x/this.a,p=t.y/this.a;if(this.sphere){var d,g=0,y=0;if((n=.5*(d=Math.sqrt(f*f+p*p)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(n),g=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(d)<=1e-10?0:Math.asin(p*y/d),f*=y,p=g*d;break;case this.OBLIQ:n=Math.abs(d)<=1e-10?this.lat0:Math.asin(g*this.sinph0+p*y*this.cosph0/d),f*=y*this.cosph0,p=(g-Math.sin(n)*this.sinph0)*d;break;case this.N_POLE:p=-p,n=i-n;break;case this.S_POLE:n-=i}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,p):0}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,p*=this.dd,(s=Math.sqrt(f*f+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*s/this.rq),r=Math.cos(o),f*=o=Math.sin(o),this.mode===this.OBLIQ?(u=r*this.sinb1+p*o*this.cosb1/s,a=this.qp*u,p=s*this.cosb1*r-p*this.sinb1*o):(u=p*o/s,a=this.qp*u,p=s*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(a=f*f+p*p))return t.x=this.long0,t.y=this.lat0,t;u=1-a/this.qp,this.mode===this.S_POLE&&(u=-u)}e=Math.atan2(f,p),l=Math.asin(u),c=this.apa,h=l+l,n=l+c[0]*Math.sin(h)+c[1]*Math.sin(h+h)+c[2]*Math.sin(h+h+h)}return t.x=E(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Qt=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var $t={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=x(this.e3,this.sin_po,this.cos_po),this.qs1=Kt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=x(this.e3,this.sin_po,this.cos_po),this.qs2=Kt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Kt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=Kt(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*E(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,n)),o=E(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,o,a=Qt(.5*e);if(t<1e-10)return a;for(var s=t*t,u=1;u<=25;u++)if(a+=o=.5*(i=1-(r=t*(n=Math.sin(a)))*r)*i/Math.cos(a)*(e/(1-s)-n/i+.5/t*Math.log((1-r)/(1+r))),Math.abs(o)<=1e-7)return a;return null}};var te={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y;return r=E(u-this.long0),e=Math.sin(l),n=Math.cos(l),i=Math.cos(r),1,(o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10?(a=this.x0+1*this.a*n*Math.sin(r)/o,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/o):(a=this.x0+this.infinity_dist*n*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),n=Math.sin(i),r=Math.cos(i),a=Qt(r*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),o=E(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]};var ee={init:function(){this.sphere||(this.k0=x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,o=E(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=Kt(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,n=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=E(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*i:i;for(var r,o,a,s,u=Math.asin(.5*e),l=0;l<30;l++)if(o=Math.sin(u),a=Math.cos(u),s=t*o,u+=r=Math.pow(1-s*s,2)/(2*a)*(e/(1-t*t)-o/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(r)<=1e-10)return u;return NaN}(this.e,2*t.y*this.k0/this.a),e=E(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};var ne={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,r=E(e-this.long0),i=Xt(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=E(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Xt(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var re={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=zt(this.es),this.e1=Ut(this.es),this.e2=Vt(this.es),this.e3=Yt(this.es),this.ml0=this.a*qt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,o=t.y,a=E(i-this.long0);if(r=a*Math.sin(o),this.sphere)Math.abs(o)<=1e-10?(e=this.a*a,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),n=this.a*(Xt(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=1e-10)e=this.a*a,n=-1*this.ml0;else{var s=Wt(this.a,this.e,Math.sin(o))/Math.tan(o);e=s*Math.sin(r),n=this.a*qt(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,o,a,s,u,l;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=1e-10)e=E(r/this.a+this.long0),n=0;else{var c;for(a=this.lat0+i/this.a,s=r*r/this.a/this.a+a*a,u=a,o=20;o;--o)if(u+=l=-1*(a*(u*(c=Math.tan(u))+1)-u-.5*(u*u+s)*c)/((u-a)/c-1),Math.abs(l)<=1e-10){n=u;break}e=E(this.long0+Math.asin(r*Math.tan(u)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=1e-10)n=0,e=E(this.long0+r/this.a);else{var h,f,p,d,g;for(a=(this.ml0+i)/this.a,s=r*r/this.a/this.a+a*a,u=a,o=20;o;--o)if(g=this.e*Math.sin(u),h=Math.sqrt(1-g*g)*Math.tan(u),f=this.a*qt(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=l=(a*(h*(d=f/this.a)+1)-d-.5*h*(d*d+s))/(this.es*Math.sin(2*u)*(d*d+s-2*a*d)/(4*h)+(a-d)*(h*p-2/Math.sin(2*u))-p),Math.abs(l)<=1e-10){n=u;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=E(this.long0+Math.asin(r*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","poly"]};var ie={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,i=t.y-this.lat0,o=n-this.long0,a=i/r*1e-5,s=o,u=1,l=0;for(e=1;e<=10;e++)u*=a,l+=this.A[e]*u;var c,h=l,f=s,p=1,d=0,g=0,y=0;for(e=1;e<=6;e++)c=d*h+p*f,p=p*h-d*f,d=c,g=g+this.B_re[e]*p-this.B_im[e]*d,y=y+this.B_im[e]*p+this.B_re[e]*d;return t.x=y*this.a+this.x0,t.y=g*this.a+this.y0,t},inverse:function(t){var e,n,i=t.x,o=t.y,a=i-this.x0,s=(o-this.y0)/this.a,u=a/this.a,l=1,c=0,h=0,f=0;for(e=1;e<=6;e++)n=c*s+l*u,l=l*s-c*u,c=n,h=h+this.C_re[e]*l-this.C_im[e]*c,f=f+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p.999999999999&&(n=.999999999999),e=Math.asin(n);var r=E(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]};var ue={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=zt(this.es),this.e1=Ut(this.es),this.e2=Vt(this.es),this.e3=Yt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=x(this.e,this.sinphi,this.cosphi),this.ml1=qt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=x(this.e,this.sinphi,this.cosphi),this.ml2=qt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=qt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var i=qt(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-i)}var o=this.ns*E(n-this.long0),a=this.x0+e*Math.sin(o),s=this.y0+this.rh-e*Math.cos(o);return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=E(this.long0+o/this.ns),r=Xt(this.g-n/this.a),t.x=i,t.y=r,t;var a=this.g-n/this.a;return r=Ht(a,this.e0,this.e1,this.e2,this.e3),i=E(this.long0+o/this.ns),t.x=i,t.y=r,t},names:["Equidistant_Conic","eqdc"]};var le={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,o=t.y,a=E(r-this.long0);Math.abs(o)<=1e-10&&(e=this.x0+this.R*a,n=this.y0);var s=Qt(2*Math.abs(o/Math.PI));(Math.abs(a)<=1e-10||Math.abs(Math.abs(o)-i)<=1e-10)&&(e=this.x0,n=o>=0?this.y0+Math.PI*this.R*Math.tan(.5*s):this.y0+Math.PI*this.R*-Math.tan(.5*s));var u=.5*Math.abs(Math.PI/a-a/Math.PI),l=u*u,c=Math.sin(s),h=Math.cos(s),f=h/(c+h-1),p=f*f,d=f*(2/c-1),g=d*d,y=Math.PI*this.R*(u*(f-g)+Math.sqrt(l*(f-g)*(f-g)-(g+l)*(p-g)))/(g+l);a<0&&(y=-y),e=this.x0+y;var v=l+f;return y=Math.PI*this.R*(d*v-u*Math.sqrt((g+l)*(l+1)-v*v))/(g+l),n=o>=0?this.y0+y:this.y0-y,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,o,a,s,u,l,c,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,o=(r=t.x/h)*r+(i=t.y/h)*i,h=3*(i*i/(u=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+r*r)*s*s/u/u/u-9*a*s/u/u)/27)/(l=(a-s*s/3/u)/u)/(c=2*Math.sqrt(-l/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-c*Math.cos(f+Math.PI/3)-s/3/u)*Math.PI:-(-c*Math.cos(f+Math.PI/3)-s/3/u)*Math.PI,e=Math.abs(r)<1e-10?this.long0:E(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-i*i)+o*o))/2/r),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var ce={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,n,r,o,a,s,u,l,c,h,f,p,d,g,y,v,m,_,b,w,x,O,S=t.x,M=t.y,C=Math.sin(t.y),k=Math.cos(t.y),N=E(S-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(i-M)*Math.sin(N),t.y=this.y0-this.a*(i-M)*Math.cos(N),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(i+M)*Math.sin(N),t.y=this.y0+this.a*(i+M)*Math.cos(N),t):(_=this.sin_p12*C+this.cos_p12*k*Math.cos(N),m=(v=Math.acos(_))?v/Math.sin(v):1,t.x=this.x0+this.a*m*k*Math.sin(N),t.y=this.y0+this.a*m*(this.cos_p12*C-this.sin_p12*k*Math.cos(N)),t):(e=zt(this.es),n=Ut(this.es),r=Vt(this.es),o=Yt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(a=this.a*qt(e,n,r,o,i),s=this.a*qt(e,n,r,o,M),t.x=this.x0+(a-s)*Math.sin(N),t.y=this.y0-(a-s)*Math.cos(N),t):Math.abs(this.sin_p12+1)<=1e-10?(a=this.a*qt(e,n,r,o,i),s=this.a*qt(e,n,r,o,M),t.x=this.x0+(a+s)*Math.sin(N),t.y=this.y0+(a+s)*Math.cos(N),t):(u=C/k,l=Wt(this.a,this.e,this.sin_p12),c=Wt(this.a,this.e,C),h=Math.atan((1-this.es)*u+this.es*l*this.sin_p12/(c*k)),b=0===(f=Math.atan2(Math.sin(N),this.cos_p12*Math.tan(h)-this.sin_p12*Math.cos(N)))?Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.abs(Math.abs(f)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.asin(Math.sin(N)*Math.cos(h)/Math.sin(f)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),v=l*b*(1-(w=b*b)*(y=(d=this.e*this.cos_p12*Math.cos(f)/Math.sqrt(1-this.es))*d)*(1-y)/6+(x=w*b)/8*(g=p*d)*(1-2*y)+(O=x*b)/120*(y*(4-7*y)-3*p*p*(1-7*y))-O*b/48*g),t.x=this.x0+v*Math.sin(f),t.y=this.y0+v*Math.cos(f),t))},inverse:function(t){var e,n,r,o,a,s,u,l,c,h,f,p,d,g,y,v,m,_,b,w,x,O,S;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*i*this.a)return;return n=e/this.a,r=Math.sin(n),o=Math.cos(n),a=this.long0,Math.abs(e)<=1e-10?s=this.lat0:(s=Qt(o*this.sin_p12+t.y*r*this.cos_p12/e),u=Math.abs(this.lat0)-i,a=Math.abs(u)<=1e-10?this.lat0>=0?E(this.long0+Math.atan2(t.x,-t.y)):E(this.long0-Math.atan2(-t.x,t.y)):E(this.long0+Math.atan2(t.x*r,e*this.cos_p12*o-t.y*this.sin_p12*r))),t.x=a,t.y=s,t}return l=zt(this.es),c=Ut(this.es),h=Vt(this.es),f=Yt(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*qt(l,c,h,f,i),e=Math.sqrt(t.x*t.x+t.y*t.y),s=Ht((p-e)/this.a,l,c,h,f),a=E(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=s,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*qt(l,c,h,f,i),e=Math.sqrt(t.x*t.x+t.y*t.y),s=Ht((e-p)/this.a,l,c,h,f),a=E(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=s,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),d=Wt(this.a,this.e,this.sin_p12),v=Math.cos(y),_=-(m=this.e*this.cos_p12*v)*m/(1-this.es),b=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),O=1-_*(x=(w=e/d)-_*(1+_)*Math.pow(w,3)/6-b*(1+3*_)*Math.pow(w,4)/24)*x/2-w*x*x*x/6,g=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*v),a=E(this.long0+Math.asin(Math.sin(y)*Math.sin(x)/Math.cos(g))),S=Math.sin(g),s=Math.atan2((S-this.es*O*this.sin_p12)*Math.tan(g),S*(1-this.es)),t.x=a,t.y=s,t)},names:["Azimuthal_Equidistant","aeqd"]};var he={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y;return r=E(u-this.long0),e=Math.sin(l),n=Math.cos(l),i=Math.cos(r),1,((o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10)&&(a=1*this.a*n*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=s,t},inverse:function(t){var e,n,r,o,a,s,u;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),n=Qt(e/this.a),r=Math.sin(n),o=Math.cos(n),s=this.long0,Math.abs(e)<=1e-10?(u=this.lat0,t.x=s,t.y=u,t):(u=Qt(o*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.abs(this.lat0)-i,Math.abs(a)<=1e-10?(s=this.lat0>=0?E(this.long0+Math.atan2(t.x,-t.y)):E(this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=u,t):(s=E(this.long0+Math.atan2(t.x*r,e*this.cos_p14*o-t.y*this.sin_p14*r)),t.x=s,t.y=u,t))},names:["ortho"]},fe=1,pe=2,de=3,ge=4,ye=5,ve=6,me=1,_e=2,be=3,we=4;function xe(t,e,n,r){var o;return t<1e-10?(r.value=me,o=0):(o=Math.atan2(e,n),Math.abs(o)<=s?r.value=me:o>s&&o<=i+s?(r.value=_e,o-=i):o>i+s||o<=-(i+s)?(r.value=be,o=o>=0?o-l:o+l):(r.value=we,o+=i)),o}function Oe(t,e){var n=t+e;return n<-l?n+=u:n>+l&&(n-=u),n}var Ee={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=i-s/2?this.face=ye:this.lat0<=-(i-s/2)?this.face=ve:Math.abs(this.long0)<=s?this.face=fe:Math.abs(this.long0)<=i+s?this.face=this.long0>0?pe:ge:this.face=de,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,r,o,a,u,c={x:0,y:0},h={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===ye)o=i-e,n>=s&&n<=i+s?(h.value=me,r=n-i):n>i+s||n<=-(i+s)?(h.value=_e,r=n>0?n-l:n+l):n>-(i+s)&&n<=-s?(h.value=be,r=n+i):(h.value=we,r=n);else if(this.face===ve)o=i+e,n>=s&&n<=i+s?(h.value=me,r=-n+i):n=-s?(h.value=_e,r=-n):n<-s&&n>=-(i+s)?(h.value=be,r=-n-i):(h.value=we,r=n>0?-n+l:-n-l);else{var f,p,d,g,y,v;this.face===pe?n=Oe(n,+i):this.face===de?n=Oe(n,+l):this.face===ge&&(n=Oe(n,-i)),g=Math.sin(e),y=Math.cos(e),v=Math.sin(n),f=y*Math.cos(n),p=y*v,d=g,this.face===fe?r=xe(o=Math.acos(f),d,p,h):this.face===pe?r=xe(o=Math.acos(p),d,-f,h):this.face===de?r=xe(o=Math.acos(-f),d,-p,h):this.face===ge?r=xe(o=Math.acos(-p),d,f,h):(o=r=0,h.value=me)}return u=Math.atan(12/l*(r+Math.acos(Math.sin(r)*Math.cos(s))-i)),a=Math.sqrt((1-Math.cos(o))/(Math.cos(u)*Math.cos(u))/(1-Math.cos(Math.atan(1/Math.cos(r))))),h.value===_e?u+=i:h.value===be?u+=l:h.value===we&&(u+=1.5*l),c.x=a*Math.cos(u),c.y=a*Math.sin(u),c.x=c.x*this.a+this.x0,c.y=c.y*this.a+this.y0,t.x=c.x,t.y=c.y,t},inverse:function(t){var e,n,r,o,a,s,u,c,h,f,p,d,g={lam:0,phi:0},y={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?y.value=me:t.y>=0&&t.y>=Math.abs(t.x)?(y.value=_e,e-=i):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=be,e=e<0?e+l:e-l):(y.value=we,e+=i),h=l/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),s=Math.atan(a),(u=1-(r=Math.cos(e))*r*(o=Math.tan(n))*o*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?u=-1:u>1&&(u=1),this.face===ye)c=Math.acos(u),g.phi=i-c,y.value===me?g.lam=s+i:y.value===_e?g.lam=s<0?s+l:s-l:y.value===be?g.lam=s-i:g.lam=s;else if(this.face===ve)c=Math.acos(u),g.phi=c-i,y.value===me?g.lam=-s+i:y.value===_e?g.lam=-s:y.value===be?g.lam=-s-i:g.lam=s<0?-s-l:-s+l;else{var v,m,_;h=(v=u)*v,m=(h+=(_=h>=1?0:Math.sqrt(1-h)*Math.sin(s))*_)>=1?0:Math.sqrt(1-h),y.value===_e?(h=m,m=-_,_=h):y.value===be?(m=-m,_=-_):y.value===we&&(h=m,m=_,_=-h),this.face===pe?(h=v,v=-m,m=h):this.face===de?(v=-v,m=-m):this.face===ge&&(h=v,v=m,m=-h),g.phi=Math.acos(-_)-i,g.lam=Math.atan2(m,v),this.face===pe?g.lam=Oe(g.lam,-i):this.face===de?g.lam=Oe(g.lam,-l):this.face===ge&&(g.lam=Oe(g.lam,+i))}return 0!==this.es&&(f=g.phi<0?1:0,p=Math.tan(g.phi),d=this.b/Math.sqrt(p*p+this.one_minus_f_squared),g.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),f&&(g.phi=-g.phi)),g.lam+=this.long0,t.x=g.lam,t.y=g.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Se=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Me=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ce=a/5,ke=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var Ne={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=E(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(n*Ce);r<0?r=0:r>=18&&(r=17);var i={x:ke(Se[r],n=a*(n-.08726646259971647*r))*e,y:ke(Me[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*.8487+this.x0,i.y=i.y*this.a*1.3523+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=Se[18][0],e.y=t.y<0?-i:i;else{var n=Math.floor(18*e.y);for(n<0?n=0:n>=18&&(n=17);;)if(Me[n][0]>e.y)--n;else{if(!(Me[n+1][0]<=e.y))break;++n}var r=Me[n],a=5*(e.y-r[0])/(Me[n+1][0]-r[0]);a=function(t,e,n,r){for(var i=e;r;--r){var o=t(i);if(i-=o,Math.abs(o)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,n,r,i,o=t.x,a=t.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/Ct(this.radius_p*Math.cos(a),Math.sin(a));if(n=s*Math.cos(o)*Math.cos(a),r=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-n)*n-r*r-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Ct(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Ct(r,e)))}else"sphere"===this.shape&&(e=Math.cos(a),n=Math.cos(o)*e,r=Math.sin(o)*e,i=Math.sin(a),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Ct(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Ct(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,r,i,o=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Ct(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Ct(1,a));var u=s/this.radius_p;if(e=a*a+u*u+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},De=1.340264,Be=-.081106,Ge=893e-6,qe=.003796,ze=Math.sqrt(3)/2;var Ue={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=E(t.x-this.long0),n=t.y,r=Math.asin(ze*Math.sin(n)),i=r*r,o=i*i*i;return t.x=e*Math.cos(r)/(ze*(De+3*Be*i+o*(7*Ge+9*qe*i))),t.y=r*(De+Be*i+o*(Ge+qe*i)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,n,r,i,o=t.y;for(i=0;i<12&&(o-=r=(o*(De+Be*(e=o*o)+(n=e*e*e)*(Ge+qe*e))-t.y)/(De+3*Be*e+n*(7*Ge+9*qe*e)),!(Math.abs(r)<1e-9));++i);return n=(e=o*o)*e*e,t.x=ze*t.x*(De+3*Be*e+n*(7*Ge+9*qe*e))/Math.cos(o),t.y=Math.asin(Math.sin(o)/ze),t.x=E(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};function Ve(t){var e,n,r,i=E(t.x-(this.long0||0)),o=t.y;return e=this.am1+this.m1-Ot(o,n=Math.sin(o),r=Math.cos(o),this.en),n=r*i/(e*Math.sqrt(1-this.es*n*n)),t.x=e*Math.sin(n),t.y=this.am1-e*Math.cos(n),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Ye(t){var e,n,r,o;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,n=Ct(t.x,t.y=this.am1-t.y),o=Et(this.am1+this.m1-n,this.es,this.en),(e=Math.abs(o))1e-10?(t.x=n*Math.sin(e=r*Math.cos(i)/n),t.y=this.cphi1-n*Math.cos(e)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Xe(t){var e,n;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var r=Ct(t.x,t.y=this.cphi1-t.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>i)throw new Error;return e=Math.abs(Math.abs(n)-i)<=1e-10?0:r*Math.atan2(t.x,t.y)/Math.cos(n),t.x=E(e+(this.long0||0)),t.y=Xt(n),t}var He,Ze={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<1e-10)throw new Error;this.es?(this.en=xt(this.es),this.m1=Ot(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Ye,this.forward=Ve):(Math.abs(this.phi1)+1e-10>=i?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Xe,this.forward=We)},names:["bonne","Bonne (Werner lat_1=90)"]};at.defaultDatum="WGS84",at.Proj=Y,at.WGS84=new at.Proj("WGS84"),at.Point=bt,at.toPoint=tt,at.defs=v,at.nadgrid=function(t,e){var n=new DataView(e),r=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(n),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:G(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(n,r),o={header:i,subgrids:function(t,e,n){for(var r=176,i=[],o=0;o=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function y(t,e){for(var n=0;n=r&&n.x<=r+i&&n.y>=o&&n.y<=o+a){if(n.xr+i-s)return-(r+i-n.x-s)/s}return 0}}function x(t){return function(e,n){var r=e.y,i=e.h,o=e.x,a=e.w,s=Math.min(i/2,t);if(n.y>=r&&n.y<=r+i&&n.x>=o&&n.x<=o+a){if(n.yr+i-s)return-(r+i-n.y-s)/s}return 0}}var O=w(150);e.defaultHorizontalStrength=O;var E=x(150);function S(t){var e=function(e){function n(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i=function(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?_(t):e}(this,v(n).call(this,t,e)),b(_(_(i)),"updateScrolling",(0,a.default)((function(t){var e=i.container.getBoundingClientRect(),n={x:e.left,y:e.top,w:e.width,h:e.height},r=(0,h.getCoords)(t),o=i.props,a=o.horizontalStrength,s=o.verticalStrength;i.scaleX=a(n,r),i.scaleY=s(n,r),i.frame||!i.scaleX&&!i.scaleY||i.startScrolling()}),100,{trailing:!1})),b(_(_(i)),"handleEvent",(function(t){i.dragging&&!i.attached&&(i.attach(),i.updateScrolling(t))})),i.wrappedInstance=r.default.createRef(),i.scaleX=0,i.scaleY=0,i.frame=null,i.attached=!1,i.dragging=!1,i}var i,u,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m(t,e)}(n,e),i=n,(u=[{key:"componentDidMount",value:function(){var t=this;this.container=(0,o.findDOMNode)(this.wrappedInstance.current),this.container&&"function"==typeof this.container.addEventListener&&this.container.addEventListener("dragover",this.handleEvent),window.document.body.addEventListener("touchmove",this.handleEvent);var e=this.props.dragDropManager;this.clearMonitorSubscription=e.getMonitor().subscribeToStateChange((function(){return t.handleMonitorChange()}))}},{key:"componentWillUnmount",value:function(){this.container&&"function"==typeof this.container.removeEventListener&&this.container.removeEventListener("dragover",this.handleEvent),window.document.body.removeEventListener("touchmove",this.handleEvent),this.clearMonitorSubscription(),this.stopScrolling()}},{key:"handleMonitorChange",value:function(){var t=this.props.dragDropManager.getMonitor().isDragging();!this.dragging&&t?this.dragging=!0:this.dragging&&!t&&(this.dragging=!1,this.stopScrolling())}},{key:"attach",value:function(){this.attached=!0,window.document.body.addEventListener("dragover",this.updateScrolling),window.document.body.addEventListener("touchmove",this.updateScrolling)}},{key:"detach",value:function(){this.attached=!1,window.document.body.removeEventListener("dragover",this.updateScrolling),window.document.body.removeEventListener("touchmove",this.updateScrolling)}},{key:"startScrolling",value:function(){var t=this,e=0;!function n(){var r=t.scaleX,i=t.scaleY,o=t.container,a=t.props,u=a.strengthMultiplier,l=a.onScrollChange;if(0!==u&&r+i!==0){if((e+=1)%2){var c=o.scrollLeft,f=o.scrollTop,p=o.scrollWidth,d=o.scrollHeight,g=o.clientWidth,y=o.clientHeight;l(r?o.scrollLeft=(0,h.intBetween)(0,p-g,c+r*u):c,i?o.scrollTop=(0,h.intBetween)(0,d-y,f+i*u):f)}t.frame=(0,s.default)(n)}else t.stopScrolling()}()}},{key:"stopScrolling",value:function(){this.detach(),this.scaleX=0,this.scaleY=0,this.frame&&(s.default.cancel(this.frame),this.frame=null)}},{key:"render",value:function(){var e=this.props,n=(e.strengthMultiplier,e.verticalStrength,e.horizontalStrength,e.onScrollChange,g(e,["strengthMultiplier","verticalStrength","horizontalStrength","onScrollChange"]));return r.default.createElement(t,d({ref:this.wrappedInstance},n))}}])&&y(i.prototype,u),l&&y(i,l),n}(r.Component);return b(e,"displayName","Scrolling(".concat((0,u.default)(t),")")),b(e,"propTypes",{dragDropManager:i.default.object.isRequired,onScrollChange:i.default.func,verticalStrength:i.default.func,horizontalStrength:i.default.func,strengthMultiplier:i.default.number}),b(e,"defaultProps",{onScrollChange:h.noop,verticalStrength:E,horizontalStrength:O,strengthMultiplier:30}),(0,c.default)(e,t)}e.defaultVerticalStrength=E},,,,,,,,,,,,function(t,e,n){"use strict";var r,i=n(75),o=n(73),a=n(192),s=n(79),u=n(51),l=n(53),c=n(36),h=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f="translatestart",p="translating",d="translateend",g=function(t){function e(e,n,r,i,o){var a=t.call(this,e)||this;return a.features=n,a.coordinate=r,a.startCoordinate=i,a.mapBrowserEvent=o,a}return h(e,t),e}(o.a),y=function(t){function e(e){var n,r=this,i=e||{};if((r=t.call(this,i)||this).on,r.once,r.un,r.lastCoordinate_=null,r.startCoordinate_=null,r.features_=void 0!==i.features?i.features:null,i.layers&&!r.features_)if("function"==typeof i.layers)n=i.layers;else{var o=i.layers;n=function(t){return Object(c.d)(o,t)}}else n=u.b;return r.layerFilter_=n,r.filter_=i.filter&&!r.features_?i.filter:u.b,r.hitTolerance_=i.hitTolerance?i.hitTolerance:0,r.condition_=i.condition?i.condition:l.d,r.lastFeature_=null,r.addChangeListener(a.a.ACTIVE,r.handleActiveChanged_),r}return h(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new i.a([this.lastFeature_]);return this.dispatchEvent(new g(f,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new i.a([this.lastFeature_]);return this.dispatchEvent(new g(d,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,n=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],o=this.features_||new i.a([this.lastFeature_]);o.forEach((function(t){var e=t.getGeometry();e.translate(n,r),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new g(p,o,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||Object(c.d)(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var n=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(n)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),n=this.getActive();e&&n||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(s.b);e.a=y},,function(t,e,n){"use strict";n.d(e,"b",(function(){return l}));var r,i=n(140),o=n(28),a=n(27),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return s(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(o.a.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,r=new Array(n),i=0;i=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new y(p,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new y(e?d:g,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new y(f,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(o.b);e.a=v},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},,function(t,e,n){"use strict";e.a=function(t){function e(t,e,r){var i=e.trim().split(d);e=i;var o=i.length,a=t.length;switch(a){case 0:case 1:var s=0;for(t=0===a?"":t[0]+" ";sr&&(r=(e=e.trim()).charCodeAt(0)),r){case 38:return e.replace(g,"$1"+t.trim());case 58:return t.trim()+e.replace(g,"$1"+t.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0p)&&(B=(z=z.replace(" ",":")).length),0x&&(h=(f+p)/2,Object(r.c)(t,e,n,o,h,y)&&(w=h,x=O)),f=p}return isNaN(w)&&(w=a[s]),u?(u.push(w,y,x),u):[w,y,x]}function a(t,e,n,r,i){for(var a=[],s=0,u=n.length;s=.5&&j>=.5){var L=k[4],P=k[5],I=a.opacity,A=void 0;1!==I&&(A=x.globalAlpha,x.globalAlpha=I),x.drawImage(C,0,0,+C.width,+C.height,Math.round(L),Math.round(P),Math.round(N),Math.round(j)),1!==I&&(x.globalAlpha=A)}return this.postRender(x,t),E&&x.restore(),w!==O.style.transform&&(O.style.transform=w),this.container},e}(i.a);e.a=f},function(t,e,n){"use strict";var r,i=n(135),o=n(206),a=n.n(o),s=n(25),u=n(69),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c="renderOrder",h=function(t){function e(e){var n=this,r=e||{},i=Object(s.a)({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return l(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(c)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new a.a(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(c,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:u.a,this.styleFunction_=null===t?void 0:Object(u.d)(this.style_),this.changed()},e}(i.a);e.a=h},function(t,e,n){"use strict";var r,i=n(86),o=n(65),a=n(21),s=n(32),u=n(25),l=n(26),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(u.a)({},e);return"object"==typeof e.properties&&(delete r.properties,Object(u.a)(r,e.properties)),r[o.a.OPACITY]=void 0!==e.opacity?e.opacity:1,Object(s.a)("number"==typeof r[o.a.OPACITY],64),r[o.a.VISIBLE]=void 0===e.visible||e.visible,r[o.a.Z_INDEX]=e.zIndex,r[o.a.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,r[o.a.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,r[o.a.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,r[o.a.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==r.className?e.className:"ol-layer",delete r.className,n.setProperties(r),n.state_=null,n}return c(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=Object(l.a)(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Object(a.b)()},e.prototype.getLayerStatesArray=function(t){return Object(a.b)()},e.prototype.getExtent=function(){return this.get(o.a.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(o.a.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(o.a.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(o.a.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(o.a.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(o.a.OPACITY)},e.prototype.getSourceState=function(){return Object(a.b)()},e.prototype.getVisible=function(){return this.get(o.a.VISIBLE)},e.prototype.getZIndex=function(){return this.get(o.a.Z_INDEX)},e.prototype.setExtent=function(t){this.set(o.a.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(o.a.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(o.a.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(o.a.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(o.a.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){Object(s.a)("number"==typeof t,64),this.set(o.a.OPACITY,t)},e.prototype.setVisible=function(t){this.set(o.a.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(o.a.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(i.a);e.a=h},function(t,e,n){"use strict";var r,i=n(115),o=n(159),a=n(21),s=n(36),u=n(2),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=Object(u.g)(),e}return l(e,t),e.prototype.getType=function(){return o.a.XML},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var n=Object(u.p)(t);return this.readFeatureFromDocument(n,e)}return Object(u.h)(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var n=this.readFeaturesFromDocument(t,e);return n.length>0?n[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var n=Object(u.p)(t);return this.readFeaturesFromDocument(n,e)}return Object(u.h)(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&Object(s.c)(n,this.readFeaturesFromNode(r,e));return n},e.prototype.readFeaturesFromNode=function(t,e){return Object(a.b)()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var n=Object(u.p)(t);return this.readGeometryFromDocument(n,e)}return Object(u.h)(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Object(u.p)(t);return this.readProjectionFromDocument(e)}return Object(u.h)(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeGeometryNode=function(t,e){return null},e}(i.a);e.a=c},,function(t,e,n){"use strict";var r,i=n(271),o=n(75),a=n(76),s=n(28),u=n(142),l=n(134),c=n(32),h=n(25),f=n(8),p=n(21),d=n(27),g=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y="layers",v=function(t){function e(e){var n=this,r=e||{},i=Object(h.a)({},r);delete i.layers;var a=r.layers;return(n=t.call(this,i)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(y,n.handleLayersChanged_),a?Array.isArray(a)?a=new o.a(a.slice(),{unique:!0}):Object(c.a)("function"==typeof a.getArray,43):a=new o.a(void 0,{unique:!0}),n.setLayers(a),n}return g(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(d.c),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Object(d.a)(t,a.a.ADD,this.handleLayersAdd_,this),Object(d.a)(t,a.a.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(d.c);Object(h.b)(this.listenerKeys_);for(var n=t.getArray(),r=0,i=n.length;r=0},e}(a.a);e.a=m},function(t,e,n){"use strict";var r=n(8),i=n(13),o=n(26),a=function(){function t(t,e,n,a,s,u){this.sourceProj_=t,this.targetProj_=e;var l={},c=Object(i.i)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return l[e]||(l[e]=c(t)),l[e]},this.maxSourceExtent_=a,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!a&&!!this.sourceProj_.getExtent()&&Object(r.D)(a)==Object(r.D)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Object(r.D)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Object(r.D)(this.targetProj_.getExtent()):null;var h=Object(r.B)(n),f=Object(r.C)(n),p=Object(r.v)(n),d=Object(r.u)(n),g=this.transformInv_(h),y=this.transformInv_(f),v=this.transformInv_(p),m=this.transformInv_(d),_=10+(u?Math.max(0,Math.ceil(Object(o.d)(Object(r.t)(n)/(u*u*256*256)))):0);if(this.addQuad_(h,f,p,d,g,y,v,m,_),this.wrapsXInSource_){var b=1/0;this.triangles_.forEach((function(t,e,n){b=Math.min(b,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-b>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-b>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-b>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-b>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n.5&&f<1,g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var y=Object(r.b)([t,e,n,i]);g=Object(r.D)(y)/this.targetWorldWidth_>.25||g}!d&&this.sourceProj_.isGlobal()&&f&&(g=f>.25||g)}if(!(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Object(r.E)(h,this.maxSourceExtent_)){var v=0;if(!(g||isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(u[0])&&isFinite(u[1])&&isFinite(l[0])&&isFinite(l[1])))if(c>0)g=!0;else if(1!=(v=(isFinite(a[0])&&isFinite(a[1])?0:8)+(isFinite(s[0])&&isFinite(s[1])?0:4)+(isFinite(u[0])&&isFinite(u[1])?0:2)+(isFinite(l[0])&&isFinite(l[1])?0:1))&&2!=v&&4!=v&&8!=v)return;if(c>0){if(!g){var m=[(t[0]+n[0])/2,(t[1]+n[1])/2],_=this.transformInv_(m),b=void 0;if(d)b=(Object(o.e)(a[0],p)+Object(o.e)(u[0],p))/2-Object(o.e)(_[0],p);else b=(a[0]+u[0])/2-_[0];var w=(a[1]+u[1])/2-_[1];g=b*b+w*w>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var x=[(e[0]+n[0])/2,(e[1]+n[1])/2],O=this.transformInv_(x),E=[(i[0]+t[0])/2,(i[1]+t[1])/2],S=this.transformInv_(E);this.addQuad_(t,e,x,E,a,s,O,S,c-1),this.addQuad_(E,x,n,i,S,O,u,l,c-1)}else{var M=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(M),k=[(n[0]+i[0])/2,(n[1]+i[1])/2],N=this.transformInv_(k);this.addQuad_(t,M,k,i,a,C,N,l,c-1),this.addQuad_(M,e,n,k,C,s,u,N,c-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&v)&&this.addTriangle_(t,n,i,a,u,l),0==(14&v)&&this.addTriangle_(t,n,e,a,u,s),v&&(0==(13&v)&&this.addTriangle_(e,i,t,s,l,a),0==(7&v)&&this.addTriangle_(e,i,n,s,l,u))}},t.prototype.calculateSourceExtent=function(){var t=Object(r.j)();return this.triangles_.forEach((function(e,n,i){var o=e.source;Object(r.q)(t,o[0]),Object(r.q)(t,o[1]),Object(r.q)(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();e.a=a},function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(2),i=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Object(r.p)(t);return this.readFromDocument(e)}return Object(r.h)(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},t.prototype.readFromNode=function(t){},t}();e.a=i},function(t,e,n){"use strict";function r(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}))},,,,function(t,e,n){"use strict";var r,i={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},o=[i.FILL],a=[i.STROKE],s=[i.BEGIN_PATH],u=[i.CLOSE_PATH],l=i,c=n(16),h=n(88),f=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),p=n(127),d=n(8),g=n(31),y=n(36),v=n(84),m=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return m(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=t.length;ap&&(this.instructions.push([l.CUSTOM,p,o,t,n,v.a]),this.hitDetectionInstructions.push([l.CUSTOM,p,o,t,r||n,v.a]));break;case c.a.POINT:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([l.CUSTOM,p,o,t,n]),this.hitDetectionInstructions.push([l.CUSTOM,p,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[l.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[l.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,i=e.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[l.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[l.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!Object(y.b)(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=u)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[l.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Object(d.d)(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Object(d.c)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(f),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return b(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([l.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([l.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([l.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([l.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=i,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=e},e}(_),x=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return x(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),a=[l.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([l.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,g.e,g.f],s);var o=t.getFlatCoordinates(),u=t.getStride();this.drawFlatCoordinates_(o,0,o.length,u),this.hitDetectionInstructions.push(a),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([l.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],s);for(var o=t.getEnds(),u=t.getFlatCoordinates(),c=t.getStride(),h=0,f=0,p=o.length;ft&&(v>y&&(y=v,d=m,g=o),v=0,m=o-i)),a=s,c=f,h=p),u=_,l=b}return(v+=s)>y?[m,o]:[d,g]}var j=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),L={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},P={Circle:M,Default:_,Image:w,LineString:O,Polygon:M,Text:function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return j(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,a=o.length,s=t.getType(),u=null,h=t.getStride();if(i.placement!==C.a.LINE||s!=c.a.LINE_STRING&&s!=c.a.MULTI_LINE_STRING&&s!=c.a.POLYGON&&s!=c.a.MULTI_POLYGON){var f=i.overflow?null:[];switch(s){case c.a.POINT:case c.a.MULTI_POINT:u=t.getFlatCoordinates();break;case c.a.LINE_STRING:u=t.getFlatMidpoint();break;case c.a.CIRCLE:u=t.getCenter();break;case c.a.MULTI_LINE_STRING:u=t.getFlatMidpoints(),h=2;break;case c.a.POLYGON:u=t.getFlatInteriorPoint(),i.overflow||f.push(u[2]/this.resolution),h=3;break;case c.a.MULTI_POLYGON:var p=t.getFlatInteriorPoints();u=[];for(M=0,k=p.length;Mk[2]}else S=b>M;var N,j=Math.PI,L=[],P=x+r===e;if(y=0,v=O,f=t[e=x],p=t[e+1],P){m(),N=Math.atan2(p-g,f-d),S&&(N+=N>0?-j:j);var I=(M+b)/2,A=(C+w)/2;return L[0]=[I,A,(E-o)/2,N,i],L}for(var R=0,T=i.length;R0?-j:j),void 0!==N){var D=F-N;if(D+=D>j?-2*j:D<-j?2*j:0,Math.abs(D)>a)return null}N=F;for(var B=R,G=0;Rt?t-u:i,w=o+l>e?e-l:o,x=p[3]+b*h[0]+p[1],O=p[0]+w*h[1]+p[2],E=m-p[3],S=_-p[0];return(g||0!==c)&&(H[0]=E,J[0]=E,H[1]=S,Z[1]=S,Z[0]=E+x,K[0]=Z[0],K[1]=S+O,J[1]=K[1]),0!==c?(v=Object(z.b)(Object(z.c)(),n,r,1,1,c,-n,-r),Object(z.a)(v,H),Object(z.a)(v,Z),Object(z.a)(v,K),Object(z.a)(v,J),Object(d.k)(Math.min(H[0],Z[0],K[0],J[0]),Math.min(H[1],Z[1],K[1],J[1]),Math.max(H[0],Z[0],K[0],J[0]),Math.max(H[1],Z[1],K[1],J[1]),X)):Object(d.k)(Math.min(E,E+x),Math.min(S,S+O),Math.max(E,E+x),Math.max(S,S+O),X),f&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:b,drawImageH:w,originX:u,originY:l,declutterBox:{minX:X[0],minY:X[1],maxX:X[2],maxY:X[3],value:y},canvasTransform:v,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,a){var s=!(!o&&!a),u=r.declutterBox,l=t.canvas,c=a?a[2]*r.scale[0]/2:0;return u.minX-c<=l.width/e&&u.maxX+c>=0&&u.minY-c<=l.height/e&&u.maxY+c>=0&&(s&&this.replayTextBackground_(t,H,Z,K,J,o,a),Object(g.n)(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Object(z.a)(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),a=this.strokeStates[n],s=this.pixelRatio,u=tt(t,i.textAlign||g.l),l=L[i.textBaseline||g.m],c=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:u*(o.width/s-2*i.scale[0])+2*(.5-u)*c,anchorY:l*o.height/s+2*(.5-l)*c}},t.prototype.execute_=function(t,e,n,r,i,o,a,s){var u;this.pixelCoordinates_&&Object(y.b)(n,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=Object(V.c)(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Object(z.f)(this.renderedTransform_,n));for(var c,h,f,p,v,m,_,b,w,x,O,E,S,M,C,k,N=0,j=r.length,P=0,I=0,A=0,R=null,T=null,F=this.coordinateCache_,D=this.viewRotation_,B=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},q=this.instructions!=r||this.overlaps?0:200;Nq&&(this.fill_(t),I=0),A>q&&(t.stroke(),A=0),I||A||(t.beginPath(),p=NaN,v=NaN),++N;break;case l.CIRCLE:var X=u[P=U[1]],H=u[P+1],Z=u[P+2]-X,K=u[P+3]-H,J=Math.sqrt(Z*Z+K*K);t.moveTo(X+J,H),t.arc(X,H,J,0,2*Math.PI,!0),++N;break;case l.CLOSE_PATH:t.closePath(),++N;break;case l.CUSTOM:P=U[1],c=U[2];var $=U[3],tt=U[4],et=6==U.length?U[5]:void 0;G.geometry=$,G.feature=S,N in F||(F[N]=[]);var nt=F[N];et?et(u,P,c,2,nt):(nt[0]=u[P],nt[1]=u[P+1],nt.length=2),tt(nt,G),++N;break;case l.DRAW_IMAGE:P=U[1],c=U[2],b=U[3],h=U[4],f=U[5];var rt=U[6],it=U[7],ot=U[8],at=U[9],st=U[10],ut=U[11],lt=U[12],ct=U[13],ht=U[14];if(!b&&U.length>=19){w=U[18],x=U[19],O=U[20],E=U[21];var ft=this.drawLabelWithPointPlacement_(w,x,O,E);b=ft.label,U[3]=b;var pt=U[22];h=(ft.anchorX-pt)*this.pixelRatio,U[4]=h;var dt=U[23];f=(ft.anchorY-dt)*this.pixelRatio,U[5]=f,rt=b.height,U[6]=rt,ct=b.width,U[13]=ct}var gt=void 0;U.length>24&&(gt=U[24]);var yt=void 0,vt=void 0,mt=void 0;U.length>16?(yt=U[15],vt=U[16],mt=U[17]):(yt=g.j,vt=!1,mt=!1),st&&B?ut+=D:st||B||(ut-=D);for(var _t=0;Pn)break;var s=r[a];s||(s=[],r[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var u=[],l=(i=0,r.length);i0){if(!o||h!==F&&h!==G||-1!==o.indexOf(t)){var l=(f[s]-3)/4,p=r-l%a,d=r-(l/a|0),g=i(t,e,p*p+d*d);if(g)return g}c.clearRect(0,0,a,a);break}}var g,v,m,_,b,w=Object.keys(this.executorsByZIndex_).map(Number);for(w.sort(y.g),g=w.length-1;g>=0;--g){var x=w[g].toString();for(m=this.executorsByZIndex_[x],v=it.length-1;v>=0;--v)if(void 0!==(_=m[h=it[v]])&&(b=_.executeHitDetection(c,s,n,p,l)))return b}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],a=[n,r,n,o,i,o,i,r];return Object(V.c)(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return Object(rt.d)(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,r,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(y.g),this.maxExtent_&&(t.save(),this.clip(t,n));var u,l,c,h,f,p,d=o||it;for(a&&s.reverse(),u=0,l=s.length;ug[2];)b=m*++_,l.push(this.getRenderTransform(r,i,o,.5,h,f,b).slice()),v-=m}this.hitDetectionImageData_=function(t,e,n,r,i,o,a){var s=.5*t[0],u=.5*t[1],l=Object(nt.a)(s,u);l.imageSmoothingEnabled=!1;for(var h=l.canvas,f=new ht(l,.5,i,null,a),p=n.length,g=Math.floor(16777215/p),v={},m=1;m<=p;++m){var _=n[m-1],b=_.getStyleFunction()||r;if(r){var w=b(_,o);if(w){Array.isArray(w)||(w=[w]);for(var x="#"+("000000"+(m*g).toString(16)).slice(-6),O=0,E=w.length;Ow[0]&&E[2]>w[2]&&b.push([E[0]-x,E[1],E[2]-x,E[3]])}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&Object(d.g)(this.wrappedRenderedExtent_,m))return Object(y.b)(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,M=new I(mt(c,h),m,c,h);this.getLayer().getDeclutter()&&(S=new I(mt(c,h),m,c,h));var C,k=Object(bt.k)();if(k){for(var N=0,j=b.length;Nt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Object(s.b)()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:Object(u.a)(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(o.a),h=n(59),f=n(178),p=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var d=function(t){function e(e,n,r,i,o,a){var s=t.call(this,e,n,a)||this;return s.crossOrigin_=i,s.src_=r,s.key=r,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return p(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=a.a.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=a.a.ERROR,this.unlistenImage_(),this.image_=((t=Object(h.a)(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=a.a.LOADED:this.state=a.a.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==a.a.ERROR&&(this.state=a.a.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==a.a.IDLE&&(this.state=a.a.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Object(f.b)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(c),g=n(101),y=n(276),v=n(160),m=n(26),_=n(8),b=n(27),w=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x=function(t){function e(e,n,r,i,o,s,u,l,c,h,f,p){var d=t.call(this,o,a.a.IDLE)||this;d.renderEdges_=void 0!==f&&f,d.contextOptions_=p,d.pixelRatio_=u,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=n,d.targetTileGrid_=i,d.wrappedTileCoord_=s||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var b=i.getTileCoordExtent(d.wrappedTileCoord_),w=d.targetTileGrid_.getExtent(),x=d.sourceTileGrid_.getExtent(),O=w?Object(_.A)(b,w):b;if(0===Object(_.t)(O))return d.state=a.a.EMPTY,d;var E=e.getExtent();E&&(x=x?Object(_.A)(x,E):E);var S=i.getResolution(d.wrappedTileCoord_[0]),M=Object(v.a)(e,r,O,S);if(!isFinite(M)||M<=0)return d.state=a.a.EMPTY,d;var C=void 0!==h?h:g.b;if(d.triangulation_=new y.a(e,r,O,x,M*C,S),0===d.triangulation_.getTriangles().length)return d.state=a.a.EMPTY,d;d.sourceZ_=n.getZForResolution(M);var k=d.triangulation_.calculateSourceExtent();if(x&&(e.canWrapX()?(k[1]=Object(m.a)(k[1],x[1],x[3]),k[3]=Object(m.a)(k[3],x[1],x[3])):k=Object(_.A)(k,x)),Object(_.t)(k)){for(var N=n.getTileRangeForExtentAndZ(k,d.sourceZ_),j=N.minX;j<=N.maxX;j++)for(var L=N.minY;L<=N.maxY;L++){var P=c(d.sourceZ_,j,L,u);P&&d.sourceTiles_.push(P)}0===d.sourceTiles_.length&&(d.state=a.a.EMPTY)}else d.state=a.a.EMPTY;return d}return w(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==a.a.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=a.a.ERROR;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Object(v.c)(r,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=a.a.LOADED}this.changed()},e.prototype.load=function(){if(this.state==a.a.IDLE){this.state=a.a.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var o=e.getState();if(o==a.a.IDLE||o==a.a.LOADING){t++;var s=Object(b.a)(e,i.a.CHANGE,(function(n){var r=e.getState();r!=a.a.LOADED&&r!=a.a.ERROR&&r!=a.a.EMPTY||(Object(b.c)(s),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(s)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,n){t.getState()==a.a.IDLE&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(b.c),this.sourcesListenerKeys_=null},e}(c),O=n(32),E=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return Object(O.a)(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Object(O.a)(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Object(O.a)(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),S=n(98),M=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return M(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),e=Object(S.b)(t)[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(Object(S.c)(t.tileCoord)),t.release())}.bind(this))}},e}(E),k="tileloadstart",N="tileloadend",j="tileloaderror",L=n(73),P=n(207),I=n(13),A=n(182),R=n(68),T=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),F=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var r=e.tileGrid;return r&&Object(R.d)(r.getTileSize(r.getMinZoom()),[256,256]),n.tileCache=new C(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition},n.zDirection=e.zDirection?e.zDirection:0,n}return T(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,u,l=!0,c=n.minX;c<=n.maxX;++c)for(var h=n.minY;h<=n.maxY;++h)s=Object(S.d)(e,c,h),u=!1,i.containsKey(s)&&(u=(o=i.get(s)).getState()===a.a.LOADED)&&(u=!1!==r(o)),u||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,n,r,i){return Object(s.b)()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Object(A.c)(t)},e.prototype.getTileCacheForProjection=function(t){return Object(O.a)(Object(I.c)(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(e),o=Object(R.d)(r.getTileSize(t),this.tmpSize);return 1==i?o:Object(R.c)(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=Object(A.d)(r,t,n)),Object(S.f)(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(P.a),D=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return T(e,t),e}(L.a),B=F;function G(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,u){return a?t.replace(n,a[0].toString()).replace(r,a[1].toString()).replace(i,a[2].toString()).replace(o,(function(){var t=a[0],n=e.getFullTileRange(t);return Object(O.a)(n,55),(n.getHeight()-a[2]-1).toString()})):void 0}}function q(t,e){for(var n=t.length,r=new Array(n),i=0;i=0;--E){var S=_[E],M=S.layer;if(M.hasRenderer()&&Object(c.b)(S,f)&&a.call(s,M)){var C=M.getRenderer(),k=M.getSource();if(C&&k){var N=k.getWrapX()?g:t,j=p.bind(null,S.managed);x[0]=N[0]+y[O][0],x[1]=N[1]+y[O][1],l=C.forEachFeatureAtCoordinate(x,e,n,j,w)}if(l)return l}}if(0!==w.length){var L=1/w.length;return w.forEach((function(t,e){return t.distanceSq+=e*L})),w.sort((function(t,e){return t.distanceSq-e.distanceSq})),w.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){return Object(a.b)()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,r,i,a){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,r,o.b,this,i,a)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Object(a.b)()},e.prototype.scheduleExpireIconCache=function(t){l.a.canExpireCache()&&t.postRenderFunctions.push(p)},e}(i.a),g=n(142),y=n(268),v=n(147),m=n(134),_=n(66),b=n(31),w=n(27),x=n(59),O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=Object(w.a)(b.a,g.a.PROPERTYCHANGE,e.redrawText.bind(e)),n.element_=document.createElement("div");var r=n.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",n.element_.className=_.e+" ol-layers";var i=e.getViewport();return i.insertBefore(n.element_,i.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return O(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var r=new y.a(t,void 0,e);n.dispatchEvent(r)}},e.prototype.disposeInternal=function(){Object(w.c)(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(v.a.PRECOMPOSE,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var r=[],i=null,o=0,a=e.length;o=0;--o)r[o].renderDeclutter(t);Object(x.f)(this.element_,this.children_),this.dispatchRenderEvent(v.a.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var u=a[s],l=u.layer;if(l.hasRenderer()&&Object(c.b)(u,o)&&i(l)){var h=l.getRenderer().getDataAtPixel(t,e,n);if(h){var f=r(l,h);if(f)return f}}}},e}(d),S=n(86),M=n(75),C=n(76),k=n(28),N=n(274),j=n(144),L=n(50),P=n(183),I=n(140),A=n(81),R=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(t){function e(e,n){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=void 0===n?1:n,r.down_=null;var i=r.map_.getViewport();return r.activePointers_=0,r.trackedTouches_={},r.element_=i,r.pointerdownListenerKey_=Object(w.a)(i,P.a.POINTERDOWN,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=Object(w.a)(i,P.a.POINTERMOVE,r.relayEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(k.a.TOUCHMOVE,r.boundHandleTouchMove_,!!A.e&&{passive:!1}),r}return R(e,t),e.prototype.emulateClick_=function(t){var e=new j.a(L.a.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new j.a(L.a.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new j.a(L.a.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==L.a.POINTERUP||e.type==L.a.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==L.a.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new j.a(L.a.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(w.c),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new j.a(L.a.POINTERDOWN,this.map_,t);for(var n in this.dispatchEvent(e),this.down_={},t){var r=t[n];this.down_[n]="function"==typeof r?o.c:r}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Object(w.a)(i,L.a.POINTERMOVE,this.handlePointerMove_,this),Object(w.a)(i,L.a.POINTERUP,this.handlePointerUp_,this),Object(w.a)(this.element_,L.a.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Object(w.a)(this.element_.getRootNode(),L.a.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new j.a(L.a.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new j.a(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Object(w.c)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(k.a.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Object(w.c)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(w.c),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(I.a),F=n(219),D=n(209),B="layergroup",G="size",q="target",z="view",U=n(32),V=n(25),Y=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Object(V.b)(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(n);return delete this.queuedElements_[r],n},t.prototype.enqueue=function(t){Object(U.a)(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,n=this.priorities_,r=e.length,i=e[t],o=n[t],a=t;t>1;){var s=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),l=ut;){var a=this.getParentIndex_(e);if(!(r[a]>o))break;n[e]=n[a],r[e]=r[a],e=a}n[e]=i,r[e]=o},t.prototype.reprioritize=function(){var t,e,n,r=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e0;)r=(n=this.dequeue()[0]).getKey(),n.getState()!==W.a.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,n.load())},e}(Y);var Z=n(128),K=n(72),J=n(13),Q=n(68),$=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var tt=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,r,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new N.a({layers:t.layers});o[B]=a,o[q]=t.target,o[z]=t.view instanceof Z.a?t.view:new Z.a,void 0!==t.controls&&(Array.isArray(t.controls)?n=new M.a(t.controls.slice()):(Object(U.a)("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new M.a(t.interactions.slice()):(Object(U.a)("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new M.a(t.overlays.slice()):(Object(U.a)("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new M.a;return{controls:n,interactions:r,keyboardEventTarget:e,overlays:i,values:o}}(e);n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:A.a,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=Object(s.c)(),n.pixelToCoordinateTransform_=Object(s.c)(),n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=r.keyboardEventTarget,n.keyHandlerKeys_=null,n.controls=r.controls||new M.a,n.interactions=r.interactions||new M.a,n.overlays_=r.overlays,n.overlayIdIndex_={},n.renderer_=null,n.handleResize_,n.postRenderFunctions_=[],n.tileQueue_=new H(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(B,n.handleLayerGroupChanged_),n.addChangeListener(z,n.handleViewChanged_),n.addChangeListener(G,n.handleSizeChanged_),n.addChangeListener(q,n.handleTargetChanged_),n.setProperties(r.values);var i=n;return!e.view||e.view instanceof Z.a||e.view.then((function(t){i.setView(new Z.a(t))})),n.controls.addEventListener(C.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(C.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(C.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(C.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(C.a.ADD,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(C.a.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n}return $(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_){var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,a=void 0!==n.layerFilter?n.layerFilter:o.b,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,s,e,null,a,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_){var r=n||{},i=void 0!==r.hitTolerance?r.hitTolerance:0,a=r.layerFilter||o.b;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,a)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:o.b,i=void 0!==e.hitTolerance?e.hitTolerance:0,a=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(q)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Object(J.m)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Object(s.a)(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(B)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof M.a)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e=0;s--){var u=a[s];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,r=n;if(t){var i=t.viewHints;if(i[K.a.ANIMATING]||i[K.a.INTERACTING]){var o=Date.now()-t.time>8;n=o?0:8,r=o?0:2}}e.getTilesLoading()0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!Object(s.b)(e,this.renderedAttributions_)){Object(l.d)(this.ulElement_);for(var r=0,i=e.length;r0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:p.b}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var r="rotate("+n+"rad)";if(this.autoHide_){var i=this.element.classList.contains(a.c);i||0!==n?i&&0!==n&&this.element.classList.remove(a.c):this.element.classList.add(a.c)}this.label_.style.transform=r}this.rotation_=n}},e}(i.a),y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",s=void 0!==r.delta?r.delta:1,u=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",l=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",c=void 0!==r.zoomInLabel?r.zoomInLabel:"+",h=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",f=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",p=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=u,d.setAttribute("type","button"),d.title=f,d.appendChild("string"==typeof c?document.createTextNode(c):c),d.addEventListener(o.a.CLICK,n.handleClick_.bind(n,s),!1);var g=document.createElement("button");g.className=l,g.setAttribute("type","button"),g.title=p,g.appendChild("string"==typeof h?document.createTextNode(h):h),g.addEventListener(o.a.CLICK,n.handleClick_.bind(n,-s),!1);var y=i+" "+a.e+" "+a.b,v=n.element;return v.className=y,v.appendChild(d),v.appendChild(g),n.duration_=void 0!==r.duration?r.duration:250,n}return y(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var n=e.getZoom();if(void 0!==n){var r=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:p.b})):e.setZoom(r)}}},e}(i.a);function m(t){var e=t||{},n=new f.a;return(void 0===e.zoom||e.zoom)&&n.push(new v(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new g(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new h(e.attributionOptions)),n}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(39);function i(t){var e=function(t,e){if("object"!=Object(r.a)(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=Object(r.a)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Object(r.a)(e)?e:e+""}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=function(){function t(t){var e=this;this._insertTag=function(t){var n;n=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,n),e.tags.push(t)},this.isSpeedy=void 0===t.speedy||t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),void 0!==t.nonce&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}(this));var e=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(t){if(t.sheet)return t.sheet;for(var e=0;e-1&&!t.return)switch(t.type){case i.a:t.return=function t(e,n){switch(Object(i.o)(e,n)){case 5103:return i.f+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return i.f+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return i.f+e+i.c+e+i.d+e+e;case 6828:case 4268:return i.f+e+i.d+e+e;case 6165:return i.f+e+i.d+"flex-"+e+e;case 5187:return i.f+e+Object(i.v)(e,/(\w+).+(:[^]+)/,i.f+"box-$1$2"+i.d+"flex-$1$2")+e;case 5443:return i.f+e+i.d+"flex-item-"+Object(i.v)(e,/flex-|-self/,"")+e;case 4675:return i.f+e+i.d+"flex-line-pack"+Object(i.v)(e,/align-content|flex-|-self/,"")+e;case 5548:return i.f+e+i.d+Object(i.v)(e,"shrink","negative")+e;case 5292:return i.f+e+i.d+Object(i.v)(e,"basis","preferred-size")+e;case 6060:return i.f+"box-"+Object(i.v)(e,"-grow","")+i.f+e+i.d+Object(i.v)(e,"grow","positive")+e;case 4554:return i.f+Object(i.v)(e,/([^-])(transform)/g,"$1"+i.f+"$2")+e;case 6187:return Object(i.v)(Object(i.v)(Object(i.v)(e,/(zoom-|grab)/,i.f+"$1"),/(image-set)/,i.f+"$1"),e,"")+e;case 5495:case 3959:return Object(i.v)(e,/(image-set\([^]*)/,i.f+"$1$`$1");case 4968:return Object(i.v)(Object(i.v)(e,/(.+:)(flex-)?(.*)/,i.f+"box-pack:$3"+i.d+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+i.f+e+e;case 4095:case 3583:case 4068:case 2532:return Object(i.v)(e,/(.+)-inline(.+)/,i.f+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Object(i.A)(e)-1-n>6)switch(Object(i.h)(e,n+1)){case 109:if(45!==Object(i.h)(e,n+4))break;case 102:return Object(i.v)(e,/(.+:)(.+)-([^]+)/,"$1"+i.f+"$2-$3$1"+i.c+(108==Object(i.h)(e,n+3)?"$3":"$2-$3"))+e;case 115:return~Object(i.p)(e,"stretch")?t(Object(i.v)(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(115!==Object(i.h)(e,n+1))break;case 6444:switch(Object(i.h)(e,Object(i.A)(e)-3-(~Object(i.p)(e,"!important")&&10))){case 107:return Object(i.v)(e,":",":"+i.f)+e;case 101:return Object(i.v)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+i.f+(45===Object(i.h)(e,14)?"inline-":"")+"box$3$1"+i.f+"$2$3$1"+i.d+"$2box$3")+e}break;case 5936:switch(Object(i.h)(e,n+11)){case 114:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return i.f+e+i.d+e+e}return e}(t.value,t.length);break;case i.b:return Object(i.x)([Object(i.k)(t,{value:Object(i.v)(t.value,"@","@"+i.f)})],r);case i.e:if(t.length)return Object(i.i)(t.props,(function(e){switch(Object(i.q)(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Object(i.x)([Object(i.k)(t,{props:[Object(i.v)(e,/:(read-\w+)/,":"+i.c+"$1")]})],r);case"::placeholder":return Object(i.x)([Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,":"+i.f+"input-$1")]}),Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,":"+i.c+"$1")]}),Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,i.d+"input-$1")]})],r)}return""}))}}],g=function(t){var e=t.key;if(s&&"css"===e){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var o,a,u=t.stylisPlugins||d,l={},c=[];s&&(o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),n=1;np?d=Math.round(s/p):g=Math.round(h/f),d!==i||g!==o){var y=Object(l.a)(d,g);Object(u.a)(y,this.getContextOptions());var v=y.canvas;y.drawImage(r,0,0,i,o,0,0,v.width,v.height),this.image_.setImage(v)}}t.prototype.handleImageChange.call(this,e)},e}(o.a);e.a=p},function(t,e,n){"use strict";var r,i=n(137),o=n(210),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=['Map tiles by Stamen Design, under CC BY 3.0.',o.a],u={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},l={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},c=function(t){function e(e){var n=e.layer.indexOf("-"),r=-1==n?e.layer:e.layer.slice(0,n),i=l[r],o=u[e.layer],a=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:s,cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,maxZoom:null!=e.maxZoom?e.maxZoom:i.maxZoom,minZoom:null!=e.minZoom?e.minZoom:i.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:a,wrapX:e.wrapX,zDirection:e.zDirection})||this}return a(e,t),e}(i.a);e.a=c},function(t,e,n){"use strict";var r,i=n(135),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return o(e,t),e}(i.a),s=n(269),u=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),l=function(t){function e(e){return t.call(this,e)||this}return u(e,t),e.prototype.createRenderer=function(){return new s.a(this)},e}(a);e.a=l},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(126);function i(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}function o(){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=i(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(null,arguments)}},,function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,s,u=a(t),l=1;l({x:t,y:t});function u(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function l(t){return f(t)?(t.nodeName||"").toLowerCase():"#document"}function c(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function h(t){var e;return null==(e=(f(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function f(t){return t instanceof Node||t instanceof c(t).Node}function p(t){return t instanceof Element||t instanceof c(t).Element}function d(t){return t instanceof HTMLElement||t instanceof c(t).HTMLElement}function g(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof c(t).ShadowRoot)}function y(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=_(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function v(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function m(t){return["html","body","#document"].includes(l(t))}function _(t){return c(t).getComputedStyle(t)}function b(t){if("html"===l(t))return t;const e=t.assignedSlot||t.parentNode||g(t)&&t.host||h(t);return g(e)?e.host:e}function w(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=function t(e){const n=b(e);return m(n)?e.ownerDocument?e.ownerDocument.body:e.body:d(n)&&y(n)?n:t(n)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=c(i);if(o){const t=x(a);return e.concat(a,a.visualViewport||[],y(i)?i:[],t&&n?w(t):[])}return e.concat(i,w(i,[],n))}function x(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function O(t){const e=_(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=d(t),a=i?t.offsetWidth:n,s=i?t.offsetHeight:r,u=o(n)!==a||o(r)!==s;return u&&(n=a,r=s),{width:n,height:r,$:u}}function E(t){return p(t)?t:t.contextElement}function S(t){const e=E(t);if(!d(e))return s(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=O(e);let u=(a?o(n.width):n.width)/r,l=(a?o(n.height):n.height)/i;return u&&Number.isFinite(u)||(u=1),l&&Number.isFinite(l)||(l=1),{x:u,y:l}}const M=s(0);function C(t){const e=c(t);return v()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:M}function k(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),o=E(t);let a=s(1);e&&(r?p(r)&&(a=S(r)):a=S(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==c(t))&&e}(o,n,r)?C(o):s(0);let h=(i.left+l.x)/a.x,f=(i.top+l.y)/a.y,d=i.width/a.x,g=i.height/a.y;if(o){const t=c(o),e=r&&p(r)?c(r):r;let n=t,i=x(n);for(;i&&r&&e!==n;){const t=S(i),e=i.getBoundingClientRect(),r=_(i),o=e.left+(i.clientLeft+parseFloat(r.paddingLeft))*t.x,a=e.top+(i.clientTop+parseFloat(r.paddingTop))*t.y;h*=t.x,f*=t.y,d*=t.x,g*=t.y,h+=o,f+=a,n=c(i),i=x(n)}}return u({width:d,height:g,x:h,y:f})}function N(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:s=!0,ancestorResize:u=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,p=E(t),d=s||u?[...p?w(p):[],...w(e)]:[];d.forEach(t=>{s&&t.addEventListener("scroll",n,{passive:!0}),u&&t.addEventListener("resize",n)});const g=p&&c?function(t,e){let n,o=null;const s=h(t);function u(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(c,h){void 0===c&&(c=!1),void 0===h&&(h=1),u();const{left:f,top:p,width:d,height:g}=t.getBoundingClientRect();if(c||e(),!d||!g)return;const y={rootMargin:-a(p)+"px "+-a(s.clientWidth-(f+d))+"px "+-a(s.clientHeight-(p+g))+"px "+-a(f)+"px",threshold:i(0,r(1,h))||1};let v=!0;function m(t){const e=t[0].intersectionRatio;if(e!==h){if(!v)return l();e?l(!1,e):n=setTimeout(()=>{l(!1,1e-7)},1e3)}v=!1}try{o=new IntersectionObserver(m,{...y,root:s.ownerDocument})}catch(t){o=new IntersectionObserver(m,y)}o.observe(t)}(!0),u}(p,n):null;let y,v=-1,m=null;l&&(m=new ResizeObserver(t=>{let[r]=t;r&&r.target===p&&m&&(m.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var t;null==(t=m)||t.observe(e)})),n()}),p&&!f&&m.observe(p),m.observe(e));let _=f?k(t):null;return f&&function e(){const r=k(t);!_||r.x===_.x&&r.y===_.y&&r.width===_.width&&r.height===_.height||n();_=r,y=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{s&&t.removeEventListener("scroll",n),u&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=m)||t.disconnect(),m=null,f&&cancelAnimationFrame(y)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n(13);function r(t,e){return[[-1/0,-1/0,1/0,1/0]]}},,function(t,e,n){"use strict";var r,i=n(139),o=n(64),a=n(66),s=n(13),u=n(32),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c="degrees",h="imperial",f="nautical",p="metric",d="us",g=[1,2,5],y=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=i+"-inner",n.element.className=i+" "+a.e,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==r.minWidth?r.minWidth:64,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener("units",n.handleUnitsChanged_),n.setUnits(r.units||p),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return l(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,r=this.getUnits(),i=r==c?o.b.DEGREES:o.b.METERS,a=Object(s.h)(n,t.resolution,e,i),l=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),y=l*a,v="";if(r==c){var m=s.a[o.b.DEGREES];(y*=m)=l)break;++O}x=this.scaleBar_?this.createScaleBar(b,_,v):_.toFixed(w<0?-w:0)+" "+v,this.renderedHTML_!=x&&(this.innerElement_.innerHTML=x,this.renderedHTML_=x),this.renderedWidth_!=b&&(this.innerElement_.style.width=b+"px",this.renderedWidth_=b),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,n){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s
'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,n):"")+""),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,n)),a="#ffffff"===a?"#000000":"#ffffff";return'
'+(this.scaleBarText_?'
'+r+"
":"")+i.join("")+"
"},e.prototype.createMarker=function(t,e){return'
'},e.prototype.createStepText=function(t,e,n,r,i){var o=(0===t?0:Math.round(r/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'
'+o+"
"},e.prototype.getScaleForResolution=function(){var t=Object(s.h)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,n=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*n*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(i.a);e.a=y},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(113),i=n.n(r),o=function(t,e){return i()(t,e)}},,,,,,function(t,e,n){(function(r){var i,o;i=function(){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){if("object"!==i(t.console)){t.console={};for(var e,n,r=t.console,o=function(){},a=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=a.pop();)r[e]||(r[e]={});for(;n=s.pop();)r[n]||(r[n]=o)}var u,l,c,h,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,u="",l=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[s++]=f.charAt(e)+f.charAt(n)+f.charAt(r)+f.charAt(i),a>16&255,n=a>>8&255,r=255&a,l[u++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s>>0,r=new Array(n),i=1>>0,i=0;i>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i>16&255,r=l>>8&255,o=255&l}if(void 0===r||void 0===a&&n===r&&r===o)if("string"==typeof n)e=n+" "+s[0];else switch(t.precision){case 2:e=_(n/255)+" "+s[0];break;case 3:default:e=b(n/255)+" "+s[0]}else if(void 0===a||"object"===i(a)){if(a&&!isNaN(a.a)&&0===a.a)return["1.000","1.000","1.000",s[1]].join(" ");if("string"==typeof n)e=[n,r,o,s[1]].join(" ");else switch(t.precision){case 2:e=[_(n/255),_(r/255),_(o/255),s[1]].join(" ");break;default:case 3:e=[b(n/255),b(r/255),b(o/255),s[1]].join(" ")}}else if("string"==typeof n)e=[n,r,o,a,s[2]].join(" ");else switch(t.precision){case 2:e=[_(n/255),_(r/255),_(o/255),_(a/255),s[2]].join(" ");break;case 3:default:e=[b(n/255),b(r/255),b(o/255),b(a/255),s[2]].join(" ")}return e},gt=p.__private__.getFilters=function(){return l},yt=p.__private__.putStream=function(t){var e,n=(t=t||{}).data||"",r=t.filters||gt(),i=t.alreadyAppliedFilters||[],o=t.addLength1||!1,a=n.length;!0===r&&(r=["FlateEncode"]);var u=t.additionalKeyValues||[],l=(e=void 0!==s.API.processDataByFilters?s.API.processDataByFilters(n,r):{data:n,reverseChain:[]}).reverseChain+(Array.isArray(i)?i.join(" "):i.toString());0!==e.data.length&&(u.push({key:"Length",value:e.data.length}),!0===o&&u.push({key:"Length1",value:a})),0!=l.length&&(l.split("/").length-1==1?u.push({key:"Filter",value:l}):u.push({key:"Filter",value:"["+l+"]"})),q("<<");for(var c=0;c>"),0!==e.data.length&&(q("stream"),q(e.data),q("endstream"))},vt=p.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;lt(r,!0),rt[k].mediaBox.topRightX,rt[k].mediaBox.bottomLeftX,rt[k].mediaBox.topRightY,rt[k].mediaBox.bottomLeftY,q("<>"),q("endobj");var o=n.join("\n");return lt(i,!0),yt({data:o,filters:gt()}),q("endobj"),r},mt=p.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=nt;t++)rt[t].objId=ut(),rt[t].contentsObjId=ut();for(t=1;t<=nt;t++)n.push(vt({number:t,data:D[t],objId:rt[t].objId,contentsObjId:rt[t].contentsObjId,mediaBox:rt[t].mediaBox,cropBox:rt[t].cropBox,bleedBox:rt[t].bleedBox,trimBox:rt[t].trimBox,artBox:rt[t].artBox,userUnit:rt[t].userUnit,rootDictionaryObjId:ht,resourceDictionaryObjId:ft}));lt(ht,!0),q("<>"),q("endobj"),ot.publish("postPutPages")},_t=function(t,e,n){et.hasOwnProperty(e)||(et[e]={}),et[e][n]=t},bt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(tt).length+1).toString(10),a={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return ot.publish("addFont",{font:a,instance:this}),void 0!==o&&(tt[o]=a,_t(o,e,n)),o},wt=p.__private__.pdfEscape=p.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,a,s,u,l,c;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&tt[I].metadata&&tt[I].metadata[i]&&tt[I].metadata[i].encoding&&(o=tt[I].metadata[i].encoding,!a&&tt[I].encoding&&(a=tt[I].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(u=!1,s=[],n=0,r=t.length;n>8&&(u=!0);t=s.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(c),s.push(l-(c<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},xt=p.__private__.beginPage=function(t,e){var r,i="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&(r=v(t.toLowerCase()))&&(t=r[0],e=r[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=n[0],e=n[1]),i){switch(i.substr(0,1)){case"l":t>"),q("endobj")},kt=p.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||ht;switch(st(),q("<<"),q("/Type /Catalog"),q("/Pages "+e+" 0 R"),j||(j="fullwidth"),j){case"fullwidth":q("/OpenAction [3 0 R /FitH null]");break;case"fullheight":q("/OpenAction [3 0 R /FitV null]");break;case"fullpage":q("/OpenAction [3 0 R /Fit]");break;case"original":q("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+j;"%"===n.substr(n.length-1)&&(j=parseInt(j)/100),"number"==typeof j&&q("/OpenAction [3 0 R /XYZ null null "+_(j)+"]")}switch(P||(P="continuous"),P){case"continuous":q("/PageLayout /OneColumn");break;case"single":q("/PageLayout /SinglePage");break;case"two":case"twoleft":q("/PageLayout /TwoColumnLeft");break;case"tworight":q("/PageLayout /TwoColumnRight")}L&&q("/PageMode /"+L),ot.publish("putCatalog"),q(">>"),q("endobj")},Nt=p.__private__.putTrailer=function(){q("trailer"),q("<<"),q("/Size "+(Q+1)),q("/Root "+Q+" 0 R"),q("/Info "+(Q-1)+" 0 R"),q("/ID [ <"+w+"> <"+w+"> ]"),q(">>")},Lt=p.__private__.putHeader=function(){q("%PDF-"+d),q("%ºß¬à")},Pt=p.__private__.putXRef=function(){var t=1,e="0000000000";for(q("xref"),q("0 "+(Q+1)),q("0000000000 65535 f "),t=1;t<=Q;t++)"function"==typeof $[t]?q((e+$[t]()).slice(-10)+" 00000 n "):void 0!==$[t]?q((e+$[t]).slice(-10)+" 00000 n "):q("0000000000 00000 n ")},It=p.__private__.buildDocument=function(){F=!1,G=Q=0,B=[],$=[],it=[],ht=ut(),ft=ut(),ot.publish("buildDocument"),Lt(),mt(),function(){ot.publish("putAdditionalObjects");for(var t=0;t>"),q("endobj")));var e}(),ot.publish("putResources"),lt(ft,!0),q("<<"),function(){for(var t in q("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),q("/Font <<"),tt)tt.hasOwnProperty(t)&&(!1===h||!0===h&&f.hasOwnProperty(t))&&q("/"+t+" "+tt[t].objectNumber+" 0 R");q(">>"),q("/XObject <<"),ot.publish("putXobjectDict"),q(">>")}(),q(">>"),q("endobj"),ot.publish("postPutResources"),Ct(),kt();var t=G;return Pt(),Nt(),q("startxref"),q(""+t),q("%%EOF"),F=!0,B.join("\n")},At=p.__private__.getBlob=function(t){return new Blob([U(t)],{type:"application/pdf"})},Rt=p.output=p.__private__.output=((R=function(t,e){e=e||{};var n=It();switch("string"==typeof e?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return n;case"save":p.save(e.filename);break;case"arraybuffer":return U(n);case"blob":return At(n);case"bloburi":case"bloburl":if(void 0!==r.URL&&"function"==typeof r.URL.createObjectURL)return r.URL&&r.URL.createObjectURL(At(n))||void 0;console.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":return"data:application/pdf;filename="+e.filename+";base64,"+btoa(n);case"dataurlnewwindow":var i='',o=r.open();if(null!==o&&o.document.write(i),o||"undefined"==typeof safari)return o;case"datauri":case"dataurl":return r.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return R.apply(this,arguments)}catch(n){var t=n.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var e="Error in function "+t.split("\n")[0].split("<")[0]+": "+n.message;if(!r.console)throw new Error(e);r.console.error(e,n),r.alert&&alert(e)}},(R.foo.bar=R).foo),Tt=function(t){return!0===Array.isArray(at)&&-1":")"),et=1):(J=Ht(e),Q=Zt(n),$=(l?"<":"(")+x[K]+(l?">":")")),void 0!==U&&void 0!==U[K]&&(nt=U[K]+" Tw\n"),0!==N.length&&0===K?t.push(nt+N.join(" ")+" "+J.toFixed(2)+" "+Q.toFixed(2)+" Tm\n"+$):1===et||0===et&&0===K?t.push(nt+J.toFixed(2)+" "+Q.toFixed(2)+" Td\n"+$):t.push(nt+$);t=0===et?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var rt="BT\n/"+I+" "+Y+" Tf\n"+(Y*h).toFixed(2)+" TL\n"+te+"\n";return rt+=c,rt+=t,q(rt+="ET"),f[I]=!0,p},p.__private__.lstext=p.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},p.__private__.clip=p.clip=function(t){q("evenodd"===t?"W*":"W"),q("n")},p.__private__.clip_fixed=p.clip_fixed=function(t){console.log("clip_fixed is deprecated"),p.clip(t)};var Gt=p.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},qt=p.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};p.__private__.line=p.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},p.__private__.lines=p.lines=function(t,e,n,r,i,o){var a,s,u,l,c,h,f,p,d,g,y,v;if("number"==typeof t&&(v=n,n=e,e=t,t=v),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Gt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(q(b(Ht(e))+" "+b(Zt(n))+" m "),a=r[0],s=r[1],l=t.length,g=e,y=n,u=0;u=a.length-1;if(E&&!S){_+=" ";continue}if(E||S){if(S)v=O;else if(t.multiline&&l<(f+2)*(b+2)+2)continue t}else{if(!t.multiline)continue t;if(l<(f+2)*(b+2)+2)continue t;v=O}for(var M="",C=y;C<=v;C++)M+=a[C]+" ";switch(M=" "==M.substr(M.length-1)?M.substr(0,M.length-1):M,m=x(M,t,u).width,t.textAlign){case"right":d=c-m-2;break;case"center":d=(c-m)/2;break;case"left":default:d=2}e+=s(d)+" "+s(g)+" Td\n",e+="("+o(M)+") Tj\n",e+=-s(d)+" 0 Td\n",g=-(u+2),m=0,y=v+1,b++,_=""}break}return i.text=e,i.fontSize=u,i},x=function(t,e,r){var i=n.internal.getFont(e.fontName,e.fontStyle),o=n.getStringUnitWidth(t,{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:n.getStringUnitWidth("3",{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:o}},O={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},E=function(){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var r=t[e];r.objId=void 0,r.hasAnnotation&&S.call(n,r)}},S=function(t){var e={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===e.type&&t.object===e.object}))&&n.internal.getPageInfo(t.page).pageContext.annotations.push(e)},M=function(){if(void 0===n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},C=function(){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0},k=function(t){var e=!t;for(var r in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var o=t[r],a=[],s=o.Rect;if(o.Rect&&(o.Rect=_.call(this,o.Rect)),n.internal.newObjectDeferredBegin(o.objId,!0),o.DA=H.createDefaultAppearanceStream(o),"object"===i(o)&&"function"==typeof o.getKeyValueListForStream&&(a=o.getKeyValueListForStream()),o.Rect=s,o.hasAppearanceStream&&!o.appearanceStreamContent){var u=b.call(this,o);a.push({key:"AP",value:"<>"}),n.internal.acroformPlugin.xForms.push(u)}if(o.appearanceStreamContent){var l="";for(var c in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(c)){var h=o.appearanceStreamContent[c];if(l+="/"+c+" ",l+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var r in h){var f;h.hasOwnProperty(r)&&("function"==typeof(f=h[r])&&(f=f.call(this,o)),l+="/"+r+" "+f+" ",0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f))}else"function"==typeof(f=h)&&(f=f.call(this,o)),l+="/"+r+" "+f,0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f);l+=">>"}a.push({key:"AP",value:"<<\n"+l+">>"})}n.internal.putStream({additionalKeyValues:a}),n.internal.out("endobj")}e&&N.call(this,n.internal.acroformPlugin.xForms)},N=function(t){for(var e in t)if(t.hasOwnProperty(e)){var r=e,o=t[e];n.internal.newObjectDeferredBegin(o&&o.objId,!0),"object"===i(o)&&"function"==typeof o.putStream&&o.putStream(),delete t[r]}},j=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(n=this,T.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(O)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");r=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new R,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",C),n.internal.events.subscribe("buildDocument",E),n.internal.events.subscribe("putCatalog",M),n.internal.events.subscribe("postPutPages",k),n.internal.acroformPlugin.isInitialized=!0}},L=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),n.join("\n")}},set:function(t){"object"===i(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};l(q,T);var z=function(){q.call(this),this.pushButton=!0};l(z,q);var U=function(){q.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};l(U,q);var V=function(){var t,e;T.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),r)e.push("/"+t+" ("+r[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===i(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=H.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};l(V,T),U.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},U.prototype.createOption=function(t){this.Kids.length;var e=new V;return e.Parent=this,e.optionName=t,this.Kids.push(e),Z.call(this,e),e};var Y=function(){q.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=H.CheckBox.createAppearanceStream()};l(Y,q);var W=function(){T.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,13):this.Ff=m(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,21):this.Ff=m(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=m(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,24):this.Ff=m(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,25):this.Ff=m(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=m(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};l(W,T);var X=function(){W.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,14):this.Ff=m(this.Ff,14)}}),this.password=!0};l(X,W);var H={CheckBox:{createAppearanceStream:function(){return{N:{On:H.CheckBox.YesNormal},D:{On:H.CheckBox.YesPushDown,Off:H.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=f(t),r=[],i=n.internal.getFont(t.fontName,t.fontStyle).id,o=n.__private__.encodeColorString(t.color),a=w(t,t.caption);return r.push("0.749023 g"),r.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+i+" "+s(a.fontSize)+" Tf "+o),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join("\n"),e},YesNormal:function(t){var e=f(t),r=n.internal.getFont(t.fontName,t.fontStyle).id,i=n.__private__.encodeColorString(t.color),o=[],a=H.internal.getHeight(t),u=H.internal.getWidth(t),l=w(t,t.caption);return o.push("1 g"),o.push("0 0 "+s(u)+" "+s(a)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+s(u-1)+" "+s(a-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+r+" "+s(l.fontSize)+" Tf "+i),o.push(l.text),o.push("ET"),o.push("Q"),e.stream=o.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:H.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=H.RadioButton.Circle.YesNormal,e.D[t]=H.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=H.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*H.internal.Bezier_C).toFixed(5)),a=Number((r*H.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*H.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:H.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=H.RadioButton.Cross.YesNormal,e.D[t]=H.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=f(t),n=[],r=H.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+s(H.internal.getWidth(t)-2)+" "+s(H.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(s(r.x1.x)+" "+s(r.x1.y)+" m"),n.push(s(r.x2.x)+" "+s(r.x2.y)+" l"),n.push(s(r.x4.x)+" "+s(r.x4.y)+" m"),n.push(s(r.x3.x)+" "+s(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=H.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+s(H.internal.getWidth(t)-2)+" "+s(H.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(s(n.x1.x)+" "+s(n.x1.y)+" m"),r.push(s(n.x2.x)+" "+s(n.x2.y)+" l"),r.push(s(n.x4.x)+" "+s(n.x4.y)+" m"),r.push(s(n.x3.x)+" "+s(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=n.internal.getFont(t.fontName,t.fontStyle).id,r=n.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+r}};H.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=H.internal.getWidth(t),n=H.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},H.internal.getWidth=function(t){var e=0;return"object"===i(t)&&(e=c(t.Rect[2])),e},H.internal.getHeight=function(t){var e=0;return"object"===i(t)&&(e=c(t.Rect[3])),e};var Z=t.addField=function(t){if(j.call(this),!(t instanceof T))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){n.internal.acroformPlugin.printedOut&&(n.internal.acroformPlugin.printedOut=!1,n.internal.acroformPlugin.acroFormDictionaryRoot=null),n.internal.acroformPlugin.acroFormDictionaryRoot||j.call(n),n.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=n.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof q==0)throw new Error("Invalid argument passed to jsPDF.addButton.");return Z.call(this,t)},t.addTextField=function(t){if(t instanceof W==0)throw new Error("Invalid argument passed to jsPDF.addTextField.");return Z.call(this,t)},t.addChoiceField=function(t){if(t instanceof F==0)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return Z.call(this,t)},"object"==i(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=F,e.ListBox=D,e.ComboBox=B,e.EditBox=G,e.Button=q,e.PushButton=z,e.RadioButton=U,e.CheckBox=Y,e.TextField=W,e.PasswordField=X,e.AcroForm={Appearance:H}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=F,t.AcroFormListBox=D,t.AcroFormComboBox=B,t.AcroFormEditBox=G,t.AcroFormButton=q,t.AcroFormPushButton=z,t.AcroFormRadioButton=U,t.AcroFormCheckBox=Y,t.AcroFormTextField=W,t.AcroFormPasswordField=X,t.AcroFormAppearance=H,t.AcroForm={ChoiceField:F,ListBox:D,ComboBox:B,EditBox:G,Button:q,PushButton:z,RadioButton:U,CheckBox:Y,TextField:W,PasswordField:X,Appearance:H}})((window.tmp=dt).API,"undefined"!=typeof window&&window||void 0!==r&&r),function(t){var e="addImage_",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.getImageFileTypeByImageData=function(e,r){var i,o;r=r||"UNKNOWN";var a,s,u,l="UNKNOWN";for(u in t.isArrayBufferView(e)&&(e=t.arrayBufferToBinaryString(e)),n)for(a=n[u],i=0;i>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",u=0,l=e.trns.length;u>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},t.createImageInfo=function(t,e,n,r,i,o,a,s,u,l,c,h,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),u&&(p.dp=u),l&&(p.trns=l),c&&(p.pal=c),h&&(p.smask=h),f&&(p.p=f),p},t.addImage=function(n,r,o,f,p,d,g,y,v){var m="";if("string"!=typeof r){var _=d;d=p,p=f,f=o,o=r,r=_}if("object"===i(n)&&!l(n)&&"imageData"in n){var b=n;n=b.imageData,r=b.format||r||"UNKNOWN",o=b.x||o||0,f=b.y||f||0,p=b.w||p,d=b.h||d,g=b.alias||g,y=b.compression||y,v=b.rotation||b.angle||v}var w=this.internal.getFilters();if(void 0===y&&-1!==w.indexOf("FlateEncode")&&(y="SLOW"),"string"==typeof n&&(n=unescape(n)),isNaN(o)||isNaN(f))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var x,O,E,S,M,C,k,N=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",s)),t}.call(this);if(!((x=h(n,N))||(l(n)&&(n=c(n,r)),(null==(k=g)||0===k.length)&&(g="string"==typeof(C=n)?t.sHashCode(C):t.isArrayBufferView(C)?t.sHashCode(t.arrayBufferToBinaryString(C)):null),x=h(g,N)))){if(this.isString(n)&&(""!==(m=this.convertStringToImageData(n))||void 0!==(m=t.loadFile(n)))&&(n=m),r=this.getImageFileTypeByImageData(n,r),!u(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if(this.supportsArrayBuffer()&&(n instanceof Uint8Array||(O=n,n=this.binaryStringToUint8Array(n))),!(x=this["process"+r.toUpperCase()](n,(M=0,(S=N)&&(M=Object.keys?Object.keys(S).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(S)),M),g,((E=y)&&"string"==typeof E&&(E=E.toUpperCase()),E in t.image_compression?E:t.image_compression.NONE),O)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var u=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),l=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;if(n=u[0],r=u[1],a[o]=i,s){s*=Math.PI/180;var h=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(h),p(f),p(-1*f),p(h),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,l(t),c(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([l(n),"0","0",l(r),"0","0","cm"].join(" "))):this.internal.write([l(n),"0","0",l(r),l(t),c(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,o,f,p,d,x,x.i,N,v),this},t.convertStringToImageData=function(e){var n,r="";if(this.isString(e)){var i;n=null!==(i=this.extractImageFromDataUrl(e))?i.data:e;try{r=atob(n)}catch(e){throw t.validateStringAsBase64(n)?new Error("atob-Error in jsPDF.convertStringToImageData "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return r};var f=function(t,e){return t.subarray(e,e+5)};t.processJPEG=function(t,e,n,i,o,a){var s,u=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(s=function(t){var e;if("JPEG"!==r(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),i=4,o=t.length;i>",l.content=y;var f=l.objId+" 0 R";y="<>";else if(u.options.pageNumber)switch(y="<>",this.internal.write(y))}}this.internal.write("]")}}]),a.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},a.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},a.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},a.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var o=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==e[t.charCodeAt(0)]},a=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},s=t.__arabicParser__.isArabicEndLetter=function(t){return a(t)&&o(t)&&e[t.charCodeAt(0)].length<=2},u=t.__arabicParser__.isArabicAlfLetter=function(t){return a(t)&&0<=i.indexOf(t.charCodeAt(0))},l=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return a(t)&&o(t)&&1<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return a(t)&&o(t)&&2<=e[t.charCodeAt(0)].length}),c=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return a(t)&&o(t)&&3<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return a(t)&&o(t)&&4==e[t.charCodeAt(0)].length}),h=t.__arabicParser__.resolveLigatures=function(t){var e=0,r=n,i=0,o="",a=0;for(e=0;e>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){this.internal.out("/OpenAction "+e+" 0 R")}))}return this},s=dt.API,(u=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(e){t=e}});var e=150;Object.defineProperty(this,"width",{get:function(){return e},set:function(t){e=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(t){r=t}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},u.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},s.events.push(["initialized",function(){this.canvas=new u,this.canvas.pdf=this}]),l=dt.API,h={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},f=1,p=function(t,e,n,r,i){h={x:t,y:e,w:n,h:r,ln:i}},d=function(){return h},g={left:0,top:0,bottom:0},l.setHeaderFunction=function(t){c=t},l.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var s=0;s=this.internal.pageSize.getHeight()-l.bottom&&(this.cellAddPage(),u=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,u&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var c=0;c=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},l.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},l.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},l.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},l.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");f.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},l.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},l.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n"},m=function(t){var e,n,r,i,o,a=String,s="length",u="charCodeAt",l="slice",c="replace";for(t[l](-2),t=t[l](0,-2)[c](/\s/g,"")[c]("z","!!!!!"),r=[],i=0,o=(t+=e="uuuuu"[l](t[s]%5||5))[s];i>24,255&n>>16,255&n>>8,255&n);return function(t,n){for(var r=e[s];0"},b=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),String.fromCharCode.apply(null,i)},y.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n>"),this.internal.out("endobj"),N=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+j+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==k&&void 0!==N&&this.internal.out("/Names <>")})),this},(L=dt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0> endobj")}var h=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),L.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},t.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[h++]=s>>>16&255,f[h++]=s>>>8&255,f[h++]=255&s,P.arrayBufferToBinaryString(f)},R=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},T=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},F=function(t,e,n,r){for(var i,o,a,s=t.length/e,u=new Uint8Array(t.length+s),l=V(),c=0;c>>1)&255;return o},z=function(t,e,n){var r,i,o,a,s=[],u=0,l=t.length;for(s[0]=4;u>>d&255,d+=o.bits;v[_]=w>>>d&255}if(16===o.bits){g=(M=new Uint32Array(o.decodePixels().buffer)).length,y=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),v=new Uint8Array(g*(32/o.pixelBitlength));for(var w,x=1>>0&255,x&&(y[b++]=w>>>16&255,w=M[_++],y[b++]=w>>>0&255),v[O++]=w>>>16&255;p=8}r!==P.image_compression.NONE&&I()?(t=A(y,o.width*o.colors,o.colors,r),c=A(v,o.width,1,r)):(t=y,c=v,f=null)}if(3===o.colorType&&(h=this.color_spaces.INDEXED,l=o.palette,o.transparency.indexed)){var E=o.transparency.indexed,S=0;for(_=0,g=E.length;_r&&(i.push(t.slice(u,o)),s=0,u=o),s+=e[o],o++;return u!==o&&i.push(t.slice(u,o)),i},tt=function(t,e,n){n||(n={});var r,i,o,a,s,u,l=[],c=[l],h=n.textIndent||0,f=0,p=0,d=t.split(" "),g=K.apply(this,[" ",n])[0];if(u=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var y=Array(u).join(" "),v=[];d.map((function(t){1<(t=t.split(/\s*\n/)).length?v=v.concat(t.map((function(t,e){return(e&&t.length?"\n":"")+t}))):v.push(t[0])})),d=v,u=Q.apply(this,[y,n])}for(o=0,a=d.length;o>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},ut=dt.API,ht=ct=lt="",ut.addMetadata=function(t,e){return ct=e||"http://jspdf.default.namespaceuri/",lt=t,this.internal.events.subscribe("postPutResources",(function(){if(lt){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(lt)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),a=n.length+r.length+i.length+e.length+o.length;ht=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ht=""})),this.internal.events.subscribe("putCatalog",(function(){ht&&this.internal.write("/Metadata "+ht+" 0 R")})),this},function(t,e){var n=t.API,r=n.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"Identity-H"===e.encoding){for(var a=e.metadata.Unicode.widths,s=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),u="",l=0;l>"),n("endobj");var p=r();n("<<"),n("/Type /Font"),n("/BaseFont /"+e.fontName),n("/FontDescriptor "+f+" 0 R"),n("/W "+t.API.PDFObject.convert(a)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=r(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+e.fontName),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+p+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]),n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"WinAnsiEncoding"===e.encoding){e.metadata.Unicode.widths;for(var a=e.metadata.rawData,s="",u=0;u>"),n("endobj"),e.objectNumber=r(),u=0;u>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]);var o=function(t){var e,n,i=t.text||"",o=t.x,a=t.y,s=t.options||{},u=t.mutex||{},l=u.pdfEscape,c=u.activeFontKey,h=u.fonts,f=(u.activeFontSize,""),p=0,d="",g=h[n=c].encoding;if("Identity-H"!==h[n].encoding)return{text:i,x:o,y:a,options:s,mutex:u};for(d=i,n=c,"[object Array]"===Object.prototype.toString.call(i)&&(d=i[0]),p=0;pu-l.top-l.bottom&&r.pagesplit){var d=function(t,e,n,i,o){var a=document.createElement("canvas");a.height=o,a.width=i;var s=a.getContext("2d");return s.mozImageSmoothingEnabled=!1,s.webkitImageSmoothingEnabled=!1,s.msImageSmoothingEnabled=!1,s.imageSmoothingEnabled=!1,s.fillStyle=r.backgroundColor||"#ffffff",s.fillRect(0,0,i,o),s.drawImage(t,e,n,i,o,0,0,i,o),a},g=function(){for(var r,o,c=0,g=0,y={},v=!1;;){var m;if(g=0,y.top=0!==c?l.top:n,y.left=0!==c?l.left:e,v=(s-l.left-l.right)*a=t.width)break;this.addPage()}else _=[m=d(t,0,c,r,o),y.left,y.top,m.width/a,m.height/a,f,null,p],this.addImage.apply(this,_);if((c+=o)>=t.height)break;this.addPage()}i(h,c,null,_)}.bind(this);if("CANVAS"===t.nodeName){var y=new Image;y.onload=g,y.src=t.toDataURL("image/png"),t=y}else g()}else{var v=Math.random().toString(35),m=[t,e,n,h,c,f,v,p];this.addImage.apply(this,m),i(h,c,v,m)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"==typeof rasterizeHTML)return null;var l="drawDocument";return"string"==typeof t&&(l=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||s*a,rasterizeHTML[l](t,void 0,r).then((function(t){r.onrendered(t.image)}),(function(t){i(null,t)}))},function(t){var e,n,r,o,a,s,u,l,c,h,f,p,d,g,y,v,m,_,b,w;e=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},p=function(t){var e,n,i;for(e=void 0,n=(i=t.split(",")).shift();!e&&n;)e=r[n.trim().toLowerCase()],n=i.shift();return e},d=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1r.pdf.margins_doc.top&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top,r.executeWatchFunctions(a));var N=c(a),j=r.x,L=12/r.pdf.internal.scaleFactor,P=(N["margin-left"]+N["padding-left"])*L,I=(N["margin-right"]+N["padding-right"])*L,A=(N["margin-top"]+N["padding-top"])*L,R=(N["margin-bottom"]+N["padding-bottom"])*L;void 0!==N.float&&"right"===N.float?j+=r.settings.width-a.width-I:j+=P,r.pdf.addImage(C,j,r.y+A,a.width,a.height),C=void 0,"right"===N.float||"left"===N.float?(r.watchFunctions.push(function(t,e,n,i){return r.y>=e?(r.x+=t,r.settings.width+=n,!0):!!(i&&1===i.nodeType&&!x[i.nodeName]&&r.x+i.width>r.pdf.margins_doc.left+r.pdf.margins_doc.width)&&(r.x+=t,r.y=e,r.settings.width+=n,!0)}.bind(this,"left"===N.float?-a.width-P-I:0,r.y+a.height+A+R,a.width)),r.watchFunctions.push(function(t,e,n){return!(r.y]*?>/gi,""),c="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",l.innerHTML='