@maptiler/geocoding-control 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(ht,mt){typeof exports=="object"&&typeof module<"u"?mt(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],mt):(ht=typeof globalThis<"u"?globalThis:ht||self,mt(ht.maptilersdkMaptilerGeocoder={},ht.maptilersdk))})(this,function(ht,mt){"use strict";var mh=Object.defineProperty;var yh=(ht,mt,ne)=>mt in ht?mh(ht,mt,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ht[mt]=ne;var ha=(ht,mt,ne)=>(yh(ht,typeof mt!="symbol"?mt+"":mt,ne),ne),El=(ht,mt,ne)=>{if(!mt.has(ht))throw TypeError("Cannot "+ne)};var wr=(ht,mt,ne)=>(El(ht,mt,"read from private field"),ne?ne.call(ht):mt.get(ht)),ga=(ht,mt,ne)=>{if(mt.has(ht))throw TypeError("Cannot add the same private member more than once");mt instanceof WeakSet?mt.add(ht):mt.set(ht,ne)},ms=(ht,mt,ne,wo)=>(El(ht,mt,"write to private field"),wo?wo.call(ht,ne):mt.set(ht,ne),ne);var nr,di;function ne(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const wo=ne(mt);function Ct(){}function Cl(n,t){for(const e in t)n[e]=t[e];return n}function pa(n){return n()}function da(){return Object.create(null)}function ln(n){n.forEach(pa)}function va(n){return typeof n=="function"}function xn(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}let Po;function _e(n,t){return n===t?!0:(Po||(Po=document.createElement("a")),Po.href=t,n===Po.href)}function Il(n){return Object.keys(n).length===0}function Nl(n,t,e,r){if(n){const i=ma(n,t,e,r);return n[0](i)}}function ma(n,t,e,r){return n[1]&&r?Cl(e.ctx.slice(),n[1](r(t))):e.ctx}function Sl(n,t,e,r){if(n[2]&&r){const i=n[2](r(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(t.dirty.length,i.length);for(let a=0;a<s;a+=1)o[a]=t.dirty[a]|i[a];return o}return t.dirty|i}return t.dirty}function xl(n,t,e,r,i,o){if(i){const s=ma(t,e,r,o);n.p(s,i)}}function Ll(n){if(n.ctx.length>32){const t=[],e=n.ctx.length/32;for(let r=0;r<e;r++)t[r]=-1;return t}return-1}function ya(n){return n??""}function rt(n,t){n.appendChild(t)}function wt(n,t,e){n.insertBefore(t,e||null)}function It(n){n.parentNode&&n.parentNode.removeChild(n)}function gt(n){return document.createElement(n)}function Pr(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ln(n){return document.createTextNode(n)}function Ye(){return Ln(" ")}function bl(){return Ln("")}function xe(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function wl(n){return function(t){return t.preventDefault(),n.call(this,t)}}function w(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function Pl(n){return Array.from(n.childNodes)}function Ki(n,t){t=""+t,n.data!==t&&(n.data=t)}function _a(n,t){n.value=t??""}function Oo(n,t,e,r){e==null?n.style.removeProperty(t):n.style.setProperty(t,e,"")}function sr(n,t,e){n.classList.toggle(t,!!e)}function Ol(n,t,{bubbles:e=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:t,bubbles:e,cancelable:r})}let Qi;function Zi(n){Qi=n}function Ea(){if(!Qi)throw new Error("Function called outside component initialization");return Qi}function Rl(n){Ea().$$.on_destroy.push(n)}function Tl(){const n=Ea();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=Ol(t,e,{cancelable:r});return i.slice().forEach(s=>{s.call(n,o)}),!o.defaultPrevented}return!0}}function Ca(n,t){const e=n.$$.callbacks[t.type];e&&e.slice().forEach(r=>r.call(this,t))}const mi=[],ys=[];let yi=[];const Ia=[],Dl=Promise.resolve();let _s=!1;function Ml(){_s||(_s=!0,Dl.then(Na))}function Es(n){yi.push(n)}const Cs=new Set;let _i=0;function Na(){if(_i!==0)return;const n=Qi;do{try{for(;_i<mi.length;){const t=mi[_i];_i++,Zi(t),Al(t.$$)}}catch(t){throw mi.length=0,_i=0,t}for(Zi(null),mi.length=0,_i=0;ys.length;)ys.pop()();for(let t=0;t<yi.length;t+=1){const e=yi[t];Cs.has(e)||(Cs.add(e),e())}yi.length=0}while(mi.length);for(;Ia.length;)Ia.pop()();_s=!1,Cs.clear(),Zi(n)}function Al(n){if(n.fragment!==null){n.update(),ln(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(Es)}}function Fl(n){const t=[],e=[];yi.forEach(r=>n.indexOf(r)===-1?t.push(r):e.push(r)),e.forEach(r=>r()),yi=t}const Ro=new Set;let Qn;function To(){Qn={r:0,c:[],p:Qn}}function Do(){Qn.r||ln(Qn.c),Qn=Qn.p}function Bt(n,t){n&&n.i&&(Ro.delete(n),n.i(t))}function ie(n,t,e,r){if(n&&n.o){if(Ro.has(n))return;Ro.add(n),Qn.c.push(()=>{Ro.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function Sa(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function kl(n,t){ie(n,1,1,()=>{t.delete(n.key)})}function Bl(n,t,e,r,i,o,s,a,u,l,c,f){let h=n.length,g=o.length,p=h;const v={};for(;p--;)v[n[p].key]=p;const d=[],y=new Map,I=new Map,C=[];for(p=g;p--;){const O=f(i,o,p),D=e(O);let b=s.get(D);b?C.push(()=>b.p(O,t)):(b=l(D,O),b.c()),y.set(D,d[p]=b),D in v&&I.set(D,Math.abs(p-v[D]))}const N=new Set,L=new Set;function T(O){Bt(O,1),O.m(a,c),s.set(O.key,O),c=O.first,g--}for(;h&&g;){const O=d[g-1],D=n[h-1],b=O.key,A=D.key;O===D?(c=O.first,h--,g--):y.has(A)?!s.has(b)||N.has(b)?T(O):L.has(A)?h--:I.get(b)>I.get(A)?(L.add(b),T(O)):(N.add(A),h--):(u(D,s),h--)}for(;h--;){const O=n[h];y.has(O.key)||u(O,s)}for(;g;)T(d[g-1]);return ln(C),d}function bn(n){n&&n.c()}function cn(n,t,e){const{fragment:r,after_update:i}=n.$$;r&&r.m(t,e),Es(()=>{const o=n.$$.on_mount.map(pa).filter(va);n.$$.on_destroy?n.$$.on_destroy.push(...o):ln(o),n.$$.on_mount=[]}),i.forEach(Es)}function fn(n,t){const e=n.$$;e.fragment!==null&&(Fl(e.after_update),ln(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Gl(n,t){n.$$.dirty[0]===-1&&(mi.push(n),Ml(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function wn(n,t,e,r,i,o,s=null,a=[-1]){const u=Qi;Zi(n);const l=n.$$={fragment:null,ctx:[],props:o,update:Ct,not_equal:i,bound:da(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:da(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};s&&s(l.root);let c=!1;if(l.ctx=e?e(n,t.props||{},(f,h,...g)=>{const p=g.length?g[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&Gl(n,f)),h}):[],l.update(),c=!0,ln(l.before_update),l.fragment=r?r(l.ctx):!1,t.target){if(t.hydrate){const f=Pl(t.target);l.fragment&&l.fragment.l(f),f.forEach(It)}else l.fragment&&l.fragment.c();t.intro&&Bt(n.$$.fragment),cn(n,t.target,t.anchor),Na()}Zi(u)}class Pn{constructor(){ha(this,"$$");ha(this,"$$set")}$destroy(){fn(this,1),this.$destroy=Ct}$on(t,e){if(!va(e))return Ct;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Il(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const zl="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(zl);function Vl(n){let t,e;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),w(t,"viewBox","0 0 14 14"),w(t,"width","13"),w(t,"height","13"),w(t,"class","svelte-en2qvf")},m(r,i){wt(r,t,i),rt(t,e)},p:Ct,i:Ct,o:Ct,d(r){r&&It(t)}}}class xa extends Pn{constructor(t){super(),wn(this,t,null,Vl,xn,{})}}function Ul(n){let t,e;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),w(t,"viewBox","0 0 30 30"),w(t,"fill","none"),w(t,"xmlns","http://www.w3.org/2000/svg"),w(t,"class","svelte-d2loi5")},m(r,i){wt(r,t,i),rt(t,e)},p:Ct,i:Ct,o:Ct,d(r){r&&It(t)}}}class La extends Pn{constructor(t){super(),wn(this,t,null,Ul,xn,{})}}function ql(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"area.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"area.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Xl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"reverse.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"reverse.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Yl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"poi.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"poi.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Wl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"postal_code.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"postal_code.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Hl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"street.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"street.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function jl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"road.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"road.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Kl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"housenumber.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"housenumber.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Ql(n){let t,e,r,i;return{c(){t=gt("img"),_e(t.src,e=n[5])||w(t,"src",e),w(t,"alt",n[4]),w(t,"class","svelte-ltkwvy")},m(o,s){wt(o,t,s),r||(i=xe(t,"error",n[14]),r=!0)},p(o,s){s&32&&!_e(t.src,e=o[5])&&w(t,"src",e),s&16&&w(t,"alt",o[4])},d(o){o&&It(t),r=!1,i()}}}function ba(n){let t,e;return{c(){t=gt("span"),e=Ln(n[6]),w(t,"class","secondary svelte-ltkwvy")},m(r,i){wt(r,t,i),rt(t,e)},p(r,i){i&64&&Ki(e,r[6])},d(r){r&&It(t)}}}function Zl(n){var O,D;let t,e,r,i,o,s,a,u,l=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",c,f,h=n[2]==="always"||n[2]&&!n[0].address&&((O=n[0].properties)==null?void 0:O.kind)!=="road"&&((D=n[0].properties)==null?void 0:D.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],g,p,v=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",d,y,I;function C(b,A){var Y,G;return A&1&&(e=null),A&1&&(r=null),A&1&&(i=null),b[5]?Ql:b[0].address?Kl:((Y=b[0].properties)==null?void 0:Y.kind)==="road"||((G=b[0].properties)==null?void 0:G.kind)==="road_relation"?jl:(e==null&&(e=!!b[0].id.startsWith("address.")),e?Hl:(r==null&&(r=!!b[0].id.startsWith("postal_code.")),r?Wl:(i==null&&(i=!!b[0].id.startsWith("poi.")),i?Yl:b[7]?Xl:ql)))}let N=C(n,-1),L=N(n),T=h&&ba(n);return{c(){t=gt("li"),L.c(),o=Ye(),s=gt("span"),a=gt("span"),u=gt("span"),c=Ln(l),f=Ye(),T&&T.c(),g=Ye(),p=gt("span"),d=Ln(v),w(u,"class","primary svelte-ltkwvy"),w(a,"class","svelte-ltkwvy"),w(p,"class","line2 svelte-ltkwvy"),w(s,"class","texts svelte-ltkwvy"),w(t,"tabindex","0"),w(t,"data-selected",n[1]),w(t,"class","svelte-ltkwvy"),sr(t,"selected",n[1])},m(b,A){wt(b,t,A),L.m(t,null),rt(t,o),rt(t,s),rt(s,a),rt(a,u),rt(u,c),rt(a,f),T&&T.m(a,null),rt(s,g),rt(s,p),rt(p,d),y||(I=[xe(t,"mouseenter",n[12]),xe(t,"focus",n[13])],y=!0)},p(b,[A]){var Y,G;N===(N=C(b,A))&&L?L.p(b,A):(L.d(1),L=N(b),L&&(L.c(),L.m(t,o))),A&1&&l!==(l=(b[7]?b[0].place_name:b[0].place_name.replace(/,.*/,""))+"")&&Ki(c,l),A&37&&(h=b[2]==="always"||b[2]&&!b[0].address&&((Y=b[0].properties)==null?void 0:Y.kind)!=="road"&&((G=b[0].properties)==null?void 0:G.kind)!=="road_relation"&&!b[0].id.startsWith("address.")&&!b[0].id.startsWith("postal_code.")&&(!b[0].id.startsWith("poi.")||!b[5])&&!b[7]),h?T?T.p(b,A):(T=ba(b),T.c(),T.m(a,null)):T&&(T.d(1),T=null),A&1&&v!==(v=(b[7]?"":b[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ki(d,v),A&2&&w(t,"data-selected",b[1]),A&2&&sr(t,"selected",b[1])},i:Ct,o:Ct,d(b){b&&It(t),L.d(),T&&T.d(),y=!1,ln(I)}}}function Jl(n,t,e){var C;let r,i,{feature:o}=t,{selected:s=!1}=t,{showPlaceType:a}=t,{missingIconsCache:u}=t,{iconsBaseUrl:l}=t;const c=(C=o.properties)==null?void 0:C.categories;let f,h,g=0,p=o.place_type[0]==="reverse";function v(N){h&&u.add(h),e(10,g++,g)}function d(N){Ca.call(this,n,N)}function y(N){Ca.call(this,n,N)}const I=N=>v(N.currentTarget);return n.$$set=N=>{"feature"in N&&e(0,o=N.feature),"selected"in N&&e(1,s=N.selected),"showPlaceType"in N&&e(2,a=N.showPlaceType),"missingIconsCache"in N&&e(9,u=N.missingIconsCache),"iconsBaseUrl"in N&&e(3,l=N.iconsBaseUrl)},n.$$.update=()=>{var N,L,T,O;if(n.$$.dirty&3640)do e(11,r--,r),e(4,f=c==null?void 0:c[r]),e(5,h=f?l+f.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!h||u.has(h)));n.$$.dirty&1&&e(6,i=o.id.startsWith("poi.")?(L=(N=o.properties)==null?void 0:N.categories)==null?void 0:L.join(", "):((O=(T=o.properties)==null?void 0:T.place_type_name)==null?void 0:O[0])??o.place_type[0])},e(11,r=(c==null?void 0:c.length)??0),[o,s,a,l,f,h,i,p,v,u,g,r,d,y,I]}class $l extends Pn{constructor(t){super(),wn(this,t,Jl,Zl,xn,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function tc(n){let t;return{c(){t=gt("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',w(t,"class","svelte-7cmwmc")},m(e,r){wt(e,t,r)},p:Ct,i:Ct,o:Ct,d(e){e&&It(t)}}}class ec extends Pn{constructor(t){super(),wn(this,t,null,tc,xn,{})}}function rc(n){let t,e,r;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"stroke-width","4"),w(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),w(e,"class","svelte-gzo3ar"),w(t,"width",r=n[0]==="list"?20:void 0),w(t,"viewBox","0 0 70 85"),w(t,"fill","none"),w(t,"class","svelte-gzo3ar"),sr(t,"in-map",n[0]!=="list"),sr(t,"list-icon",n[0]==="list")},m(i,o){wt(i,t,o),rt(t,e)},p(i,[o]){o&1&&r!==(r=i[0]==="list"?20:void 0)&&w(t,"width",r),o&1&&sr(t,"in-map",i[0]!=="list"),o&1&&sr(t,"list-icon",i[0]==="list")},i:Ct,o:Ct,d(i){i&&It(t)}}}function nc(n,t,e){let{displayIn:r}=t;return n.$$set=i=>{"displayIn"in i&&e(0,r=i.displayIn)},[r]}class ic extends Pn{constructor(t){super(),wn(this,t,nc,rc,xn,{displayIn:0})}}function oc(n){let t,e;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),w(t,"viewBox","0 0 60.006 21.412"),w(t,"width","14"),w(t,"height","20"),w(t,"class","svelte-en2qvf")},m(r,i){wt(r,t,i),rt(t,e)},p:Ct,i:Ct,o:Ct,d(r){r&&It(t)}}}class sc extends Pn{constructor(t){super(),wn(this,t,null,oc,xn,{})}}function ac(n){let t,e,r;return{c(){t=Pr("svg"),e=Pr("circle"),r=Pr("path"),w(e,"cx","4.789"),w(e,"cy","4.787"),w(e,"r","3.85"),Oo(e,"stroke-width","1.875"),Oo(e,"fill","none"),w(r,"d","M12.063 12.063 7.635 7.635"),Oo(r,"stroke-width","1.875"),Oo(r,"stroke-linecap","round"),w(t,"xmlns","http://www.w3.org/2000/svg"),w(t,"width","13"),w(t,"height","13"),w(t,"viewBox","0 0 13 13"),w(t,"class","svelte-1bpbt60")},m(i,o){wt(i,t,o),rt(t,e),rt(t,r)},p:Ct,i:Ct,o:Ct,d(i){i&&It(t)}}}class uc extends Pn{constructor(t){super(),wn(this,t,null,ac,xn,{})}}function lc(n,t,e){const r=t[1],i=t[0],o=r-i;return n===r&&e?n:((n-i)%o+o)%o+i}function wa(n){const t=[...n];return t[2]<t[0]&&(t[2]+=360),t}let Ji;async function cc(n,t,e){const r=n==null?void 0:n.getCenterAndZoom();for(const i of t??[])if(!(r&&(i.minZoom!=null&&i.minZoom>r[0]||i.maxZoom!=null&&i.maxZoom<r[0]))){if(i.type==="fixed")return i.coordinates.join(",");t:if(i.type==="client-geolocation"){if(Ji&&i.cachedLocationExpiry&&Ji.time+i.cachedLocationExpiry>Date.now()){if(!Ji.coords)break t;return Ji.coords}let o;try{return o=await new Promise((s,a)=>{e.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(u=>{s([u.coords.longitude,u.coords.latitude].map(l=>l.toFixed(6)).join(","))},u=>{a(u)},i)}),o}catch{}finally{i.cachedLocationExpiry&&(Ji={time:Date.now(),coords:o})}if(e.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const Pa=/([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})/,Oa=/(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i,Ra=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i,Ta=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i,Da=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;function fc(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(n=="DD")return this.decimalCoordinates;const t=this.decimalCoordinates.split(",").map(s=>Number(s.trim()));let e=Ma(t[0],n),r=Ma(t[1],n);e.endsWith('.0"')&&r.endsWith('.0"')&&(e=e.replace(/\.0"$/,'"'),r=r.replace(/\.0"$/,'"'));const i=t[0]>=0?" N":" S",o=t[1]>=0?" E":" W";return`${e+i}, ${r+o}`}else throw new Error("no decimal coordinates to convert")}function Ma(n,t){const e=Math.abs(n),r=Math.floor(e),i=(e-r)*60;if(t=="DM"){let a=hc(i,3).toFixed(3).padStart(6,"0");return`${r}° ${a}'`}let o=Math.floor(i),s=((i-o)*60).toFixed(1).padStart(4,"0");return o=o.toString().padStart(2,"0"),`${r}° ${o}' ${s}"`}function hc(n,t){const e=Math.pow(10,t);return Math.round((n+Number.EPSILON)*e)/e}function Is(n,t){t||(t=5),n=n.replace(/\s+/g," ").trim();let e=null,r=null,i="",o="",s=[],a=!1;if(Pa.test(n))if(s=Pa.exec(n),a=$i(s),a)e=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(e*=-1),r=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(r*=-1);else throw new Error("invalid coordinate format");else if(Oa.test(n))if(s=Oa.exec(n),a=$i(s),a){if(e=s[2],r=s[6],e.includes(",")&&(e=e.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),Number(Math.round(e))==Number(e))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");s[1]?(i=s[1],o=s[5]):s[4]&&(i=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(Ra.test(n))if(s=Ra.exec(n),a=$i(s),a)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4]/60),s[6]&&(e+=s[6].replace(",",".")/3600),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[9])),s[11]&&(r+=s[11]/60),s[13]&&(r+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(r=-1*r),s[1]?(i=s[1],o=s[8]):s[7]&&(i=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(Ta.test(n))if(s=Ta.exec(n),a=$i(s),a)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4]/60),s[6]&&(e+=s[6]/3600),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12]/60),s[14]&&(r+=s[14]/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(i=s[1],o=s[9]):s[8]&&(i=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(Da.test(n))if(s=Da.exec(n),a=$i(s),a)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4].replace(",",".")/60),s[6]&&(e+=s[6].replace(",",".")/3600),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12].replace(",",".")/60),s[14]&&(r+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(i=s[1],o=s[9]):s[8]&&(i=s[8],o=s[16]);else throw new Error("invalid coordinates format");if(a){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(e)>=90)throw new Error("invalid latitude value");if((i||o)&&(!i||!o))throw new Error("invalid coordinates format");if(i&&i==o)throw new Error("invalid coordinates format");let u=/S|SOUTH/i;u.test(i)&&e>0&&(e=-1*e),u=/W|WEST/i,u.test(o)&&r>0&&(r=-1*r);const l=s[0].trim();let c,f;const h=/[,/;\u0020]/g,g=l.match(h);if(g==null){const d=Math.floor(n.length/2);c=l.substring(0,d).trim(),f=l.substring(d).trim()}else{let d;g.length%2==1?d=Math.floor(g.length/2):d=g.length/2-1;let y=0;if(d==0)y=l.indexOf(g[0]),c=l.substring(0,y).trim(),f=l.substring(y+1).trim();else{let I=0,C=0;for(;I<=d;)y=l.indexOf(g[I],C),C=y+1,I++;c=l.substring(0,y).trim(),f=l.substring(y+1).trim()}}const p=c.split(".");if(p.length==2&&p[1]==0&&p[1].length!=2)throw new Error("invalid coordinates format");const v=f.split(".");if(v.length==2&&v[1]==0&&v[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(c)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return isNaN(e)&&e.includes(",")&&(e=e.replace(",",".")),e=Number(Number(e).toFixed(t)),isNaN(r)&&r.includes(",")&&(r=r.replace(",",".")),r=Number(Number(r).toFixed(t)),Object.freeze({verbatimCoordinates:l,verbatimLatitude:c,verbatimLongitude:f,decimalLatitude:e,decimalLongitude:r,decimalCoordinates:`${e},${r}`,closeEnough:gc,toCoordinateFormat:fc})}else throw new Error("coordinates pattern match failed")}function $i(n){if(!isNaN(n[0]))return!1;const t=[...n];if(t.shift(),t.length%2>0)return!1;const e=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,i=t.length/2;for(let o=0;o<i;o++){const s=t[o],a=t[o+i],u=e.test(s)&&e.test(a),l=r.test(s)&&r.test(a),c=s==a;if(!(s==null&&a==null)){if(s==null||a==null)return!1;if(u||l||c)continue;return!1}}return!0}function Aa(n,t){const e=Math.abs(n-t);return Number(e.toFixed(6))<=1e-5}function gc(n){if(n.includes(",")){const t=n.split(",");if(Number(t[0])==NaN||Number(t[1])==NaN)throw new Error("coords are not valid decimals");return Aa(this.decimalLatitude,Number(t[0]))&&Aa(this.decimalLongitude,t[1])}else throw new Error("coords being tested must be separated by a comma")}const pc=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Is.to=pc;const dc=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],vc={decimalLatitude:40.123,decimalLongitude:-74.123},mc=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],yc=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764}];function _c(){const n=[];return dc.forEach(t=>{t.decimalLatitude?n.push(t):n.push({...t,...vc})}),[...n,...mc,...yc]}const Ec=_c();Is.formats=Ec.map(n=>n.verbatimCoordinates);const Cc=Is;function Fa(n,t,e){const r=n.slice();return r[81]=t[e],r[83]=e,r}function ka(n){let t,e;return t=new ec({}),{c(){bn(t.$$.fragment)},m(r,i){cn(t,r,i),e=!0},i(r){e||(Bt(t.$$.fragment,r),e=!0)},o(r){ie(t.$$.fragment,r),e=!1},d(r){fn(t,r)}}}function Ba(n){let t,e,r,i,o;return e=new sc({}),{c(){t=gt("button"),bn(e.$$.fragment),w(t,"type","button"),w(t,"title",n[9]),w(t,"class","svelte-zh3kmv"),sr(t,"active",n[0])},m(s,a){wt(s,t,a),cn(e,t,null),r=!0,i||(o=xe(t,"click",n[67]),i=!0)},p(s,a){(!r||a[0]&512)&&w(t,"title",s[9]),(!r||a[0]&1)&&sr(t,"active",s[0])},i(s){r||(Bt(e.$$.fragment,s),r=!0)},o(s){ie(e.$$.fragment,s),r=!1},d(s){s&&It(t),fn(e),i=!1,o()}}}function Ic(n){let t,e=[],r=new Map,i,o,s,a=Sa(n[14]);const u=l=>l[81].id+(l[81].address?","+l[81].address:"");for(let l=0;l<a.length;l+=1){let c=Fa(n,a,l),f=u(c);r.set(f,e[l]=Ga(f,c))}return{c(){t=gt("ul");for(let l=0;l<e.length;l+=1)e[l].c();w(t,"class","svelte-zh3kmv")},m(l,c){wt(l,t,c);for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(t,null);i=!0,o||(s=[xe(t,"mouseleave",n[71]),xe(t,"blur",n[72])],o=!0)},p(l,c){c[0]&17880064&&(a=Sa(l[14]),To(),e=Bl(e,c,u,1,l,a,r,t,kl,Ga,null,Fa),Do())},i(l){if(!i){for(let c=0;c<a.length;c+=1)Bt(e[c]);i=!0}},o(l){for(let c=0;c<e.length;c+=1)ie(e[c]);i=!1},d(l){l&&It(t);for(let c=0;c<e.length;c+=1)e[c].d();o=!1,ln(s)}}}function Nc(n){let t,e,r,i,o,s;return e=new La({}),{c(){t=gt("div"),bn(e.$$.fragment),r=Ye(),i=gt("div"),o=Ln(n[7]),w(i,"class","svelte-zh3kmv"),w(t,"class","no-results svelte-zh3kmv")},m(a,u){wt(a,t,u),cn(e,t,null),rt(t,r),rt(t,i),rt(i,o),s=!0},p(a,u){(!s||u[0]&128)&&Ki(o,a[7])},i(a){s||(Bt(e.$$.fragment,a),s=!0)},o(a){ie(e.$$.fragment,a),s=!1},d(a){a&&It(t),fn(e)}}}function Sc(n){let t="",e;return{c(){e=Ln(t)},m(r,i){wt(r,e,i)},p:Ct,i:Ct,o:Ct,d(r){r&&It(e)}}}function xc(n){let t,e,r,i,o,s,a,u,l,c,f;return e=new La({}),u=new xa({}),{c(){t=gt("div"),bn(e.$$.fragment),r=Ye(),i=gt("div"),o=Ln(n[6]),s=Ye(),a=gt("button"),bn(u.$$.fragment),w(i,"class","svelte-zh3kmv"),w(a,"class","svelte-zh3kmv"),w(t,"class","error svelte-zh3kmv")},m(h,g){wt(h,t,g),cn(e,t,null),rt(t,r),rt(t,i),rt(i,o),rt(t,s),rt(t,a),cn(u,a,null),l=!0,c||(f=xe(a,"click",n[68]),c=!0)},p(h,g){(!l||g[0]&64)&&Ki(o,h[6])},i(h){l||(Bt(e.$$.fragment,h),Bt(u.$$.fragment,h),l=!0)},o(h){ie(e.$$.fragment,h),ie(u.$$.fragment,h),l=!1},d(h){h&&It(t),fn(e),fn(u),c=!1,f()}}}function Ga(n,t){let e,r,i;function o(){return t[69](t[83])}function s(){return t[70](t[81])}return r=new $l({props:{feature:t[81],showPlaceType:t[10],selected:t[15]===t[83],missingIconsCache:t[20],iconsBaseUrl:t[12]}}),r.$on("mouseenter",o),r.$on("focus",s),{key:n,first:null,c(){e=bl(),bn(r.$$.fragment),this.first=e},m(a,u){wt(a,e,u),cn(r,a,u),i=!0},p(a,u){t=a;const l={};u[0]&16384&&(l.feature=t[81]),u[0]&1024&&(l.showPlaceType=t[10]),u[0]&49152&&(l.selected=t[15]===t[83]),u[0]&4096&&(l.iconsBaseUrl=t[12]),r.$set(l)},i(a){i||(Bt(r.$$.fragment,a),i=!0)},o(a){ie(r.$$.fragment,a),i=!1},d(a){a&&It(e),fn(r,a)}}}function Lc(n){let t,e,r,i,o,s,a,u,l,c,f,h,g,p,v,d,y,I,C,N,L,T=!1;o=new uc({}),f=new xa({});let O=n[19]&&ka(),D=n[5]===!0&&Ba(n);const b=n[59].default,A=Nl(b,n,n[58],null),Y=[xc,Sc,Nc,Ic],G=[];function ut(x,B){var Q,bt;return x[18]?0:x[16]?((Q=x[14])==null?void 0:Q.length)===0?2:x[16]&&((bt=x[14])!=null&&bt.length)?3:-1:1}return~(d=ut(n))&&(y=G[d]=Y[d](n)),{c(){t=Ye(),e=gt("form"),r=gt("div"),i=gt("button"),bn(o.$$.fragment),s=Ye(),a=gt("input"),u=Ye(),l=gt("div"),c=gt("button"),bn(f.$$.fragment),h=Ye(),O&&O.c(),g=Ye(),D&&D.c(),p=Ye(),A&&A.c(),v=Ye(),y&&y.c(),w(i,"class","search-button svelte-zh3kmv"),w(i,"type","button"),w(a,"placeholder",n[8]),w(a,"aria-label",n[8]),w(a,"class","svelte-zh3kmv"),w(c,"type","button"),w(c,"title",n[3]),w(c,"class","svelte-zh3kmv"),w(l,"class","clear-button-container svelte-zh3kmv"),sr(l,"displayable",n[1]!==""),w(r,"class","input-group svelte-zh3kmv"),w(e,"tabindex","0"),w(e,"class",I=ya(n[2])+" svelte-zh3kmv"),sr(e,"can-collapse",n[4]&&n[1]==="")},m(x,B){wt(x,t,B),wt(x,e,B),rt(e,r),rt(r,i),cn(o,i,null),rt(r,s),rt(r,a),n[61](a),_a(a,n[1]),rt(r,u),rt(r,l),rt(l,c),cn(f,c,null),rt(l,h),O&&O.m(l,null),rt(r,g),D&&D.m(r,null),rt(r,p),A&&A.m(r,null),rt(e,v),~d&&G[d].m(e,null),C=!0,N||(L=[xe(i,"click",n[60]),xe(a,"input",n[62]),xe(a,"focus",n[63]),xe(a,"blur",n[64]),xe(a,"keydown",n[22]),xe(a,"input",n[65]),xe(c,"click",n[66]),xe(e,"submit",wl(n[21]))],N=!0)},p(x,B){(!C||B[0]&256)&&w(a,"placeholder",x[8]),(!C||B[0]&256)&&w(a,"aria-label",x[8]),B[0]&2&&a.value!==x[1]&&_a(a,x[1]),(!C||B[0]&8)&&w(c,"title",x[3]),x[19]?O?B[0]&524288&&Bt(O,1):(O=ka(),O.c(),Bt(O,1),O.m(l,null)):O&&(To(),ie(O,1,1,()=>{O=null}),Do()),(!C||B[0]&2)&&sr(l,"displayable",x[1]!==""),x[5]===!0?D?(D.p(x,B),B[0]&32&&Bt(D,1)):(D=Ba(x),D.c(),Bt(D,1),D.m(r,p)):D&&(To(),ie(D,1,1,()=>{D=null}),Do()),A&&A.p&&(!C||B[1]&134217728)&&xl(A,b,x,x[58],C?Sl(b,x[58],B,null):Ll(x[58]),null);let Q=d;d=ut(x),d===Q?~d&&G[d].p(x,B):(y&&(To(),ie(G[Q],1,1,()=>{G[Q]=null}),Do()),~d?(y=G[d],y?y.p(x,B):(y=G[d]=Y[d](x),y.c()),Bt(y,1),y.m(e,null)):y=null),(!C||B[0]&4&&I!==(I=ya(x[2])+" svelte-zh3kmv"))&&w(e,"class",I),(!C||B[0]&22)&&sr(e,"can-collapse",x[4]&&x[1]==="")},i(x){C||(Bt(T),Bt(o.$$.fragment,x),Bt(f.$$.fragment,x),Bt(O),Bt(D),Bt(A,x),Bt(y),C=!0)},o(x){ie(T),ie(o.$$.fragment,x),ie(f.$$.fragment,x),ie(O),ie(D),ie(A,x),ie(y),C=!1},d(x){x&&(It(t),It(e)),fn(o),n[61](null),fn(f),O&&O.d(),D&&D.d(),A&&A.d(x),~d&&G[d].d(),N=!1,ln(L)}}}function bc(n,t,e){let r,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:f=!1}=t,{country:h=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:p=!1}=t,{errorMessage:v="Something went wrong…"}=t,{filter:d=()=>!0}=t,{flyTo:y=!0}=t,{fuzzyMatch:I=!0}=t,{language:C=void 0}=t,{limit:N=void 0}=t,{mapController:L=void 0}=t,{minLength:T=2}=t,{noResultsMessage:O="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:D="Search"}=t,{proximity:b=[{type:"server-geolocation"}]}=t,{reverseActive:A=p==="always"}=t,{reverseButtonTitle:Y="toggle reverse geocoding"}=t,{searchValue:G=""}=t,{showFullGeometry:ut=!0}=t,{showPlaceType:x="ifNeeded"}=t,{showResultsWhileTyping:B=!0}=t,{selectFirst:Q=!0}=t,{flyToSelected:bt=!1}=t,{markerOnSelected:re=!0}=t,{types:Kt=void 0}=t,{excludeTypes:sn=!1}=t,{zoom:Ae=16}=t,{maxZoom:Xe=18}=t,{apiUrl:ir="https://api.maptiler.com/geocoding"}=t,{fetchParameters:jn={}}=t,{iconsBaseUrl:Sn="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.3/icons/"}=t,{adjustUrlQuery:ia=S=>{}}=t;function Qf(){an.focus()}function Zf(){an.blur()}function ml(S,Zt=!0,or=!1){e(1,G=S),Zt?(e(15,Tt=-1),_l()):(ua(!or,or),setTimeout(()=>{an.focus(),an.select()}))}function Jf(){e(14,it=void 0),e(55,et=void 0),e(15,Tt=-1)}function $f(){e(54,Qt=[]),e(55,et=void 0)}let Hi=!1,it,Qt,et,yl="",an,Tt=-1,un,gs=[],vi,ji,ps,oa;const th=new Set,Kn=Tl();Rl(()=>{L&&(L.setEventHandler(void 0),L.indicateReverse(!1),L.setSelectedMarker(-1),L.setMarkers(void 0,void 0))});function _l(S){if(ji&&(clearTimeout(ji),ji=void 0),Tt>-1&&it)e(55,et=it[Tt]),e(1,G=et.place_type[0]==="reverse"?et.place_name:et.place_name.replace(/,.*/,"")),e(18,un=void 0),e(54,Qt=void 0),e(15,Tt=-1);else if(G){const Zt=S||!sa(G);aa(G,{exact:!0}).then(()=>{e(54,Qt=it),e(55,et=void 0),Zt&&eh()}).catch(or=>e(18,un=or))}}function sa(S){try{return Cc(S,6)}catch{return!1}}async function aa(S,{byId:Zt=!1,exact:or=!1}={}){e(18,un=void 0),vi==null||vi.abort();const Lr=new AbortController;e(19,vi=Lr);try{const st=sa(S),br=new URLSearchParams;if(C!==void 0&&br.set("language",Array.isArray(C)?C.join(","):C??""),Kt&&br.set("types",Kt.join(",")),sn&&br.set("excludeTypes",String(sn)),u&&br.set("bbox",u.map(vs=>vs.toFixed(6)).join(",")),h&&br.set("country",Array.isArray(h)?h.join(","):h),!Zt&&!st){const vs=await cc(L,b,Lr);vs&&br.set("proximity",vs),(or||!B)&&br.set("autocomplete","false"),br.set("fuzzyMatch",String(I))}N!==void 0&&(!st||(Kt==null?void 0:Kt.length)===1)&&br.set("limit",String(N)),br.set("key",a),ia(br);const ds=ir+"/"+encodeURIComponent(st?st.decimalLongitude+","+st.decimalLatitude:S)+".json?"+br.toString();if(ds===yl){Zt?(e(14,it=void 0),e(55,et=gs[0])):e(14,it=gs);return}yl=ds;const ca=await fetch(ds,{signal:Lr.signal,...jn});if(!ca.ok)throw new Error(await ca.text());const fa=await ca.json();Kn("response",{url:ds,featureCollection:fa}),Zt?(e(14,it=void 0),e(55,et=fa.features[0]),gs=[et]):(e(14,it=fa.features.filter(d)),st&&it.unshift({type:"Feature",properties:{},id:"reverse_"+st.decimalLongitude+"_"+st.decimalLatitude,text:st.decimalLatitude+", "+st.decimalLongitude,place_name:st.decimalLatitude+", "+st.decimalLongitude,place_type:["reverse"],center:[st.decimalLongitude,st.decimalLatitude],bbox:[st.decimalLongitude,st.decimalLatitude,st.decimalLongitude,st.decimalLatitude],geometry:{type:"Point",coordinates:[st.decimalLongitude,st.decimalLatitude]}}),gs=it,st&&an.focus())}catch(st){if(st&&typeof st=="object"&&"name"in st&&st.name==="AbortError")return;throw st}finally{Lr===vi&&e(19,vi=void 0)}}function eh(){var or;if(!(Qt!=null&&Qt.length)||!y)return;const S=[180,90,-180,-90],Zt=!Qt.some(Lr=>!Lr.matching_text);for(const Lr of Qt)if(Zt||!Lr.matching_text)for(const st of[0,1,2,3])S[st]=Math[st<2?"min":"max"](S[st],((or=Lr.bbox)==null?void 0:or[st])??Lr.center[st%2]);L&&Qt.length>0&&(et&&S[0]===S[2]&&S[1]===S[3]?L.flyTo(et.center,Ae):L.fitBounds(wa(S),50,Xe))}function rh(S){e(0,A=p==="always"),e(14,it=void 0),e(55,et=void 0),e(15,Tt=-1),ml(S[1].toFixed(6)+", "+lc(S[0],[-180,180],!0).toFixed(6),!1,!0)}function nh(S){if(!it)return;let Zt=S.key==="ArrowDown"?1:S.key==="ArrowUp"?-1:0;Zt&&(Tt===(Q?0:-1)&&Zt===-1&&e(15,Tt=it.length),e(15,Tt+=Zt),Tt>=it.length&&e(15,Tt=-1),Tt<0&&Q&&e(15,Tt=0),S.preventDefault())}function ua(S=!0,Zt=!1){if(e(18,un=void 0),B||Zt){if(ji&&clearTimeout(ji),G.length<T)return;const or=G;ji=window.setTimeout(()=>{aa(or).catch(Lr=>e(18,un=Lr))},S?g:0)}else e(14,it=void 0),e(18,un=void 0)}function la(S){e(55,et=S),e(1,G=S.place_name),e(15,Tt=-1)}const ih=()=>an.focus();function oh(S){ys[S?"unshift":"push"](()=>{an=S,e(17,an)})}function sh(){G=this.value,e(1,G),e(13,Hi),e(27,c)}const ah=()=>e(13,Hi=!0),uh=()=>e(13,Hi=!1),lh=()=>ua(),ch=()=>{e(1,G=""),an.focus()},fh=()=>e(0,A=!A),hh=()=>e(18,un=void 0),gh=S=>e(15,Tt=S),ph=S=>la(S),dh=()=>{Q||e(15,Tt=-1)},vh=()=>{};return n.$$set=S=>{"class"in S&&e(2,s=S.class),"apiKey"in S&&e(25,a=S.apiKey),"bbox"in S&&e(26,u=S.bbox),"clearButtonTitle"in S&&e(3,l=S.clearButtonTitle),"clearOnBlur"in S&&e(27,c=S.clearOnBlur),"collapsed"in S&&e(4,f=S.collapsed),"country"in S&&e(28,h=S.country),"debounceSearch"in S&&e(29,g=S.debounceSearch),"enableReverse"in S&&e(5,p=S.enableReverse),"errorMessage"in S&&e(6,v=S.errorMessage),"filter"in S&&e(30,d=S.filter),"flyTo"in S&&e(31,y=S.flyTo),"fuzzyMatch"in S&&e(32,I=S.fuzzyMatch),"language"in S&&e(33,C=S.language),"limit"in S&&e(34,N=S.limit),"mapController"in S&&e(35,L=S.mapController),"minLength"in S&&e(36,T=S.minLength),"noResultsMessage"in S&&e(7,O=S.noResultsMessage),"placeholder"in S&&e(8,D=S.placeholder),"proximity"in S&&e(37,b=S.proximity),"reverseActive"in S&&e(0,A=S.reverseActive),"reverseButtonTitle"in S&&e(9,Y=S.reverseButtonTitle),"searchValue"in S&&e(1,G=S.searchValue),"showFullGeometry"in S&&e(38,ut=S.showFullGeometry),"showPlaceType"in S&&e(10,x=S.showPlaceType),"showResultsWhileTyping"in S&&e(39,B=S.showResultsWhileTyping),"selectFirst"in S&&e(11,Q=S.selectFirst),"flyToSelected"in S&&e(40,bt=S.flyToSelected),"markerOnSelected"in S&&e(41,re=S.markerOnSelected),"types"in S&&e(42,Kt=S.types),"excludeTypes"in S&&e(43,sn=S.excludeTypes),"zoom"in S&&e(44,Ae=S.zoom),"maxZoom"in S&&e(45,Xe=S.maxZoom),"apiUrl"in S&&e(46,ir=S.apiUrl),"fetchParameters"in S&&e(47,jn=S.fetchParameters),"iconsBaseUrl"in S&&e(12,Sn=S.iconsBaseUrl),"adjustUrlQuery"in S&&e(48,ia=S.adjustUrlQuery),"$$scope"in S&&e(58,o=S.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&134225920&&setTimeout(()=>{e(16,ps=Hi),c&&!Hi&&e(1,G="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&32&&G.length<T&&(e(55,et=void 0),e(14,it=void 0),e(18,un=void 0),e(54,Qt=it)),n.$$.dirty[1]&16777344&&ut&&et&&!et.address&&et.geometry.type==="Point"&&et.place_type[0]!=="reverse"&&aa(et.id,{byId:!0}).catch(S=>e(18,un=S)),n.$$.dirty[1]&50356241&&(L&&et&&et.id!==oa&&y&&(!et.bbox||et.bbox[0]===et.bbox[2]&&et.bbox[1]===et.bbox[3]?L.flyTo(et.center,et.id.startsWith("poi.")||et.id.startsWith("address.")?Xe:Ae):L.fitBounds(wa(et.bbox),50,Xe),e(14,it=void 0),e(54,Qt=void 0),e(15,Tt=-1)),e(56,oa=et==null?void 0:et.id)),n.$$.dirty[0]&18432&&Q&&it!=null&&it.length&&e(15,Tt=0),n.$$.dirty[0]&2050&&(Q||e(15,Tt=-1)),n.$$.dirty[0]&16384|n.$$.dirty[1]&8388608&&Qt!==it&&e(54,Qt=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&8388624&&L&&L.setEventHandler(S=>{switch(S.type){case"mapClick":A&&rh(S.coordinates);break;case"markerClick":{const Zt=it==null?void 0:it.find(or=>or.id===S.id);Zt&&la(Zt)}break;case"markerMouseEnter":Qt&&e(15,Tt=ps?(it==null?void 0:it.findIndex(Zt=>Zt.id===S.id))??-1:-1);break;case"markerMouseLeave":Qt&&e(15,Tt=-1);break}}),n.$$.dirty[0]&49152&&e(57,r=it==null?void 0:it[Tt]),n.$$.dirty[1]&67133969&&L&&r&&y&&bt&&L.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Xe:Ae),n.$$.dirty[1]&1040&&(re||L==null||L.setMarkers(void 0,void 0)),n.$$.dirty[1]&75498512&&L&&re&&!Qt&&(L.setMarkers(r?[r]:void 0,void 0),L.setSelectedMarker(r?0:-1)),n.$$.dirty[1]&25165840&&L&&L.setMarkers(Qt,et),n.$$.dirty[0]&32768|n.$$.dirty[1]&8388624&&Qt&&L&&L.setSelectedMarker(Tt),n.$$.dirty[0]&2|n.$$.dirty[1]&16&&L){const S=sa(G);L.setReverseMarker(S?[S.decimalLongitude,S.decimalLatitude]:void 0)}n.$$.dirty[1]&67108864&&Kn("select",r),n.$$.dirty[1]&16777216&&Kn("pick",et),n.$$.dirty[0]&81920&&Kn("optionsVisibilityChange",ps&&!!it),n.$$.dirty[0]&16384&&Kn("featuresListed",it),n.$$.dirty[1]&8388608&&Kn("featuresMarked",Qt),n.$$.dirty[0]&1&&Kn("reverseToggle",A),n.$$.dirty[0]&2&&Kn("queryChange",G),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&L&&L.indicateReverse(A)},[A,G,s,l,f,p,v,O,D,Y,x,Q,Sn,Hi,it,Tt,ps,an,un,vi,th,_l,nh,ua,la,a,u,c,h,g,d,y,I,C,N,L,T,b,ut,B,bt,re,Kt,sn,Ae,Xe,ir,jn,ia,Qf,Zf,ml,Jf,$f,Qt,et,oa,r,o,i,ih,oh,sh,ah,uh,lh,ch,fh,hh,gh,ph,dh,vh]}let wc=class extends Pn{constructor(t){super(),wn(this,t,bc,Lc,xn,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}};/**
1
+ (function(ht,mt){typeof exports=="object"&&typeof module<"u"?mt(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],mt):(ht=typeof globalThis<"u"?globalThis:ht||self,mt(ht.maptilersdkMaptilerGeocoder={},ht.maptilersdk))})(this,function(ht,mt){"use strict";var mh=Object.defineProperty;var yh=(ht,mt,ne)=>mt in ht?mh(ht,mt,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ht[mt]=ne;var ha=(ht,mt,ne)=>(yh(ht,typeof mt!="symbol"?mt+"":mt,ne),ne),El=(ht,mt,ne)=>{if(!mt.has(ht))throw TypeError("Cannot "+ne)};var wr=(ht,mt,ne)=>(El(ht,mt,"read from private field"),ne?ne.call(ht):mt.get(ht)),ga=(ht,mt,ne)=>{if(mt.has(ht))throw TypeError("Cannot add the same private member more than once");mt instanceof WeakSet?mt.add(ht):mt.set(ht,ne)},ms=(ht,mt,ne,wo)=>(El(ht,mt,"write to private field"),wo?wo.call(ht,ne):mt.set(ht,ne),ne);var nr,di;function ne(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const wo=ne(mt);function Ct(){}function Cl(n,t){for(const e in t)n[e]=t[e];return n}function pa(n){return n()}function da(){return Object.create(null)}function ln(n){n.forEach(pa)}function va(n){return typeof n=="function"}function xn(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}let Po;function _e(n,t){return n===t?!0:(Po||(Po=document.createElement("a")),Po.href=t,n===Po.href)}function Il(n){return Object.keys(n).length===0}function Nl(n,t,e,r){if(n){const i=ma(n,t,e,r);return n[0](i)}}function ma(n,t,e,r){return n[1]&&r?Cl(e.ctx.slice(),n[1](r(t))):e.ctx}function Sl(n,t,e,r){if(n[2]&&r){const i=n[2](r(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(t.dirty.length,i.length);for(let a=0;a<s;a+=1)o[a]=t.dirty[a]|i[a];return o}return t.dirty|i}return t.dirty}function xl(n,t,e,r,i,o){if(i){const s=ma(t,e,r,o);n.p(s,i)}}function Ll(n){if(n.ctx.length>32){const t=[],e=n.ctx.length/32;for(let r=0;r<e;r++)t[r]=-1;return t}return-1}function ya(n){return n??""}function rt(n,t){n.appendChild(t)}function wt(n,t,e){n.insertBefore(t,e||null)}function It(n){n.parentNode&&n.parentNode.removeChild(n)}function gt(n){return document.createElement(n)}function Pr(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ln(n){return document.createTextNode(n)}function Ye(){return Ln(" ")}function bl(){return Ln("")}function xe(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function wl(n){return function(t){return t.preventDefault(),n.call(this,t)}}function w(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function Pl(n){return Array.from(n.childNodes)}function Ki(n,t){t=""+t,n.data!==t&&(n.data=t)}function _a(n,t){n.value=t??""}function Oo(n,t,e,r){e==null?n.style.removeProperty(t):n.style.setProperty(t,e,"")}function sr(n,t,e){n.classList.toggle(t,!!e)}function Ol(n,t,{bubbles:e=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:t,bubbles:e,cancelable:r})}let Qi;function Zi(n){Qi=n}function Ea(){if(!Qi)throw new Error("Function called outside component initialization");return Qi}function Rl(n){Ea().$$.on_destroy.push(n)}function Tl(){const n=Ea();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=Ol(t,e,{cancelable:r});return i.slice().forEach(s=>{s.call(n,o)}),!o.defaultPrevented}return!0}}function Ca(n,t){const e=n.$$.callbacks[t.type];e&&e.slice().forEach(r=>r.call(this,t))}const mi=[],ys=[];let yi=[];const Ia=[],Dl=Promise.resolve();let _s=!1;function Ml(){_s||(_s=!0,Dl.then(Na))}function Es(n){yi.push(n)}const Cs=new Set;let _i=0;function Na(){if(_i!==0)return;const n=Qi;do{try{for(;_i<mi.length;){const t=mi[_i];_i++,Zi(t),Al(t.$$)}}catch(t){throw mi.length=0,_i=0,t}for(Zi(null),mi.length=0,_i=0;ys.length;)ys.pop()();for(let t=0;t<yi.length;t+=1){const e=yi[t];Cs.has(e)||(Cs.add(e),e())}yi.length=0}while(mi.length);for(;Ia.length;)Ia.pop()();_s=!1,Cs.clear(),Zi(n)}function Al(n){if(n.fragment!==null){n.update(),ln(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(Es)}}function Fl(n){const t=[],e=[];yi.forEach(r=>n.indexOf(r)===-1?t.push(r):e.push(r)),e.forEach(r=>r()),yi=t}const Ro=new Set;let Qn;function To(){Qn={r:0,c:[],p:Qn}}function Do(){Qn.r||ln(Qn.c),Qn=Qn.p}function Bt(n,t){n&&n.i&&(Ro.delete(n),n.i(t))}function ie(n,t,e,r){if(n&&n.o){if(Ro.has(n))return;Ro.add(n),Qn.c.push(()=>{Ro.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function Sa(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function kl(n,t){ie(n,1,1,()=>{t.delete(n.key)})}function Bl(n,t,e,r,i,o,s,a,u,l,c,f){let h=n.length,g=o.length,p=h;const y={};for(;p--;)y[n[p].key]=p;const d=[],v=new Map,C=new Map,I=[];for(p=g;p--;){const O=f(i,o,p),D=e(O);let b=s.get(D);b?I.push(()=>b.p(O,t)):(b=l(D,O),b.c()),v.set(D,d[p]=b),D in y&&C.set(D,Math.abs(p-y[D]))}const N=new Set,L=new Set;function T(O){Bt(O,1),O.m(a,c),s.set(O.key,O),c=O.first,g--}for(;h&&g;){const O=d[g-1],D=n[h-1],b=O.key,A=D.key;O===D?(c=O.first,h--,g--):v.has(A)?!s.has(b)||N.has(b)?T(O):L.has(A)?h--:C.get(b)>C.get(A)?(L.add(b),T(O)):(N.add(A),h--):(u(D,s),h--)}for(;h--;){const O=n[h];v.has(O.key)||u(O,s)}for(;g;)T(d[g-1]);return ln(I),d}function bn(n){n&&n.c()}function cn(n,t,e){const{fragment:r,after_update:i}=n.$$;r&&r.m(t,e),Es(()=>{const o=n.$$.on_mount.map(pa).filter(va);n.$$.on_destroy?n.$$.on_destroy.push(...o):ln(o),n.$$.on_mount=[]}),i.forEach(Es)}function fn(n,t){const e=n.$$;e.fragment!==null&&(Fl(e.after_update),ln(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Gl(n,t){n.$$.dirty[0]===-1&&(mi.push(n),Ml(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function wn(n,t,e,r,i,o,s=null,a=[-1]){const u=Qi;Zi(n);const l=n.$$={fragment:null,ctx:[],props:o,update:Ct,not_equal:i,bound:da(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:da(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};s&&s(l.root);let c=!1;if(l.ctx=e?e(n,t.props||{},(f,h,...g)=>{const p=g.length?g[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&Gl(n,f)),h}):[],l.update(),c=!0,ln(l.before_update),l.fragment=r?r(l.ctx):!1,t.target){if(t.hydrate){const f=Pl(t.target);l.fragment&&l.fragment.l(f),f.forEach(It)}else l.fragment&&l.fragment.c();t.intro&&Bt(n.$$.fragment),cn(n,t.target,t.anchor),Na()}Zi(u)}class Pn{constructor(){ha(this,"$$");ha(this,"$$set")}$destroy(){fn(this,1),this.$destroy=Ct}$on(t,e){if(!va(e))return Ct;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Il(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const zl="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(zl);function Vl(n){let t,e;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),w(t,"viewBox","0 0 14 14"),w(t,"width","13"),w(t,"height","13"),w(t,"class","svelte-en2qvf")},m(r,i){wt(r,t,i),rt(t,e)},p:Ct,i:Ct,o:Ct,d(r){r&&It(t)}}}class xa extends Pn{constructor(t){super(),wn(this,t,null,Vl,xn,{})}}function Ul(n){let t,e;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),w(t,"viewBox","0 0 30 30"),w(t,"fill","none"),w(t,"xmlns","http://www.w3.org/2000/svg"),w(t,"class","svelte-d2loi5")},m(r,i){wt(r,t,i),rt(t,e)},p:Ct,i:Ct,o:Ct,d(r){r&&It(t)}}}class La extends Pn{constructor(t){super(),wn(this,t,null,Ul,xn,{})}}function ql(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"area.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"area.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Xl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"reverse.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"reverse.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Yl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"poi.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"poi.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Wl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"postal_code.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"postal_code.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Hl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"street.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"street.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function jl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"road.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"road.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Kl(n){let t,e;return{c(){t=gt("img"),_e(t.src,e=n[3]+"housenumber.svg")||w(t,"src",e),w(t,"alt",n[6]),w(t,"class","svelte-ltkwvy")},m(r,i){wt(r,t,i)},p(r,i){i&8&&!_e(t.src,e=r[3]+"housenumber.svg")&&w(t,"src",e),i&64&&w(t,"alt",r[6])},d(r){r&&It(t)}}}function Ql(n){let t,e,r,i;return{c(){t=gt("img"),_e(t.src,e=n[5])||w(t,"src",e),w(t,"alt",n[4]),w(t,"class","svelte-ltkwvy")},m(o,s){wt(o,t,s),r||(i=xe(t,"error",n[14]),r=!0)},p(o,s){s&32&&!_e(t.src,e=o[5])&&w(t,"src",e),s&16&&w(t,"alt",o[4])},d(o){o&&It(t),r=!1,i()}}}function ba(n){let t,e;return{c(){t=gt("span"),e=Ln(n[6]),w(t,"class","secondary svelte-ltkwvy")},m(r,i){wt(r,t,i),rt(t,e)},p(r,i){i&64&&Ki(e,r[6])},d(r){r&&It(t)}}}function Zl(n){var O,D;let t,e,r,i,o,s,a,u,l=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",c,f,h=n[2]==="always"||n[2]&&!n[0].address&&((O=n[0].properties)==null?void 0:O.kind)!=="road"&&((D=n[0].properties)==null?void 0:D.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],g,p,y=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",d,v,C;function I(b,A){var Y,G;return A&1&&(e=null),A&1&&(r=null),A&1&&(i=null),b[5]?Ql:b[0].address?Kl:((Y=b[0].properties)==null?void 0:Y.kind)==="road"||((G=b[0].properties)==null?void 0:G.kind)==="road_relation"?jl:(e==null&&(e=!!b[0].id.startsWith("address.")),e?Hl:(r==null&&(r=!!b[0].id.startsWith("postal_code.")),r?Wl:(i==null&&(i=!!b[0].id.startsWith("poi.")),i?Yl:b[7]?Xl:ql)))}let N=I(n,-1),L=N(n),T=h&&ba(n);return{c(){t=gt("li"),L.c(),o=Ye(),s=gt("span"),a=gt("span"),u=gt("span"),c=Ln(l),f=Ye(),T&&T.c(),g=Ye(),p=gt("span"),d=Ln(y),w(u,"class","primary svelte-ltkwvy"),w(a,"class","svelte-ltkwvy"),w(p,"class","line2 svelte-ltkwvy"),w(s,"class","texts svelte-ltkwvy"),w(t,"tabindex","0"),w(t,"data-selected",n[1]),w(t,"class","svelte-ltkwvy"),sr(t,"selected",n[1])},m(b,A){wt(b,t,A),L.m(t,null),rt(t,o),rt(t,s),rt(s,a),rt(a,u),rt(u,c),rt(a,f),T&&T.m(a,null),rt(s,g),rt(s,p),rt(p,d),v||(C=[xe(t,"mouseenter",n[12]),xe(t,"focus",n[13])],v=!0)},p(b,[A]){var Y,G;N===(N=I(b,A))&&L?L.p(b,A):(L.d(1),L=N(b),L&&(L.c(),L.m(t,o))),A&1&&l!==(l=(b[7]?b[0].place_name:b[0].place_name.replace(/,.*/,""))+"")&&Ki(c,l),A&37&&(h=b[2]==="always"||b[2]&&!b[0].address&&((Y=b[0].properties)==null?void 0:Y.kind)!=="road"&&((G=b[0].properties)==null?void 0:G.kind)!=="road_relation"&&!b[0].id.startsWith("address.")&&!b[0].id.startsWith("postal_code.")&&(!b[0].id.startsWith("poi.")||!b[5])&&!b[7]),h?T?T.p(b,A):(T=ba(b),T.c(),T.m(a,null)):T&&(T.d(1),T=null),A&1&&y!==(y=(b[7]?"":b[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ki(d,y),A&2&&w(t,"data-selected",b[1]),A&2&&sr(t,"selected",b[1])},i:Ct,o:Ct,d(b){b&&It(t),L.d(),T&&T.d(),v=!1,ln(C)}}}function Jl(n,t,e){var I;let r,i,{feature:o}=t,{selected:s=!1}=t,{showPlaceType:a}=t,{missingIconsCache:u}=t,{iconsBaseUrl:l}=t;const c=(I=o.properties)==null?void 0:I.categories;let f,h,g=0,p=o.place_type[0]==="reverse";function y(N){h&&u.add(h),e(10,g++,g)}function d(N){Ca.call(this,n,N)}function v(N){Ca.call(this,n,N)}const C=N=>y(N.currentTarget);return n.$$set=N=>{"feature"in N&&e(0,o=N.feature),"selected"in N&&e(1,s=N.selected),"showPlaceType"in N&&e(2,a=N.showPlaceType),"missingIconsCache"in N&&e(9,u=N.missingIconsCache),"iconsBaseUrl"in N&&e(3,l=N.iconsBaseUrl)},n.$$.update=()=>{var N,L,T,O;if(n.$$.dirty&3640)do e(11,r--,r),e(4,f=c==null?void 0:c[r]),e(5,h=f?l+f.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!h||u.has(h)));n.$$.dirty&1&&e(6,i=o.id.startsWith("poi.")?(L=(N=o.properties)==null?void 0:N.categories)==null?void 0:L.join(", "):((O=(T=o.properties)==null?void 0:T.place_type_name)==null?void 0:O[0])??o.place_type[0])},e(11,r=(c==null?void 0:c.length)??0),[o,s,a,l,f,h,i,p,y,u,g,r,d,v,C]}class $l extends Pn{constructor(t){super(),wn(this,t,Jl,Zl,xn,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function tc(n){let t;return{c(){t=gt("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',w(t,"class","svelte-7cmwmc")},m(e,r){wt(e,t,r)},p:Ct,i:Ct,o:Ct,d(e){e&&It(t)}}}class ec extends Pn{constructor(t){super(),wn(this,t,null,tc,xn,{})}}function rc(n){let t,e,r;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"stroke-width","4"),w(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),w(e,"class","svelte-gzo3ar"),w(t,"width",r=n[0]==="list"?20:void 0),w(t,"viewBox","0 0 70 85"),w(t,"fill","none"),w(t,"class","svelte-gzo3ar"),sr(t,"in-map",n[0]!=="list"),sr(t,"list-icon",n[0]==="list")},m(i,o){wt(i,t,o),rt(t,e)},p(i,[o]){o&1&&r!==(r=i[0]==="list"?20:void 0)&&w(t,"width",r),o&1&&sr(t,"in-map",i[0]!=="list"),o&1&&sr(t,"list-icon",i[0]==="list")},i:Ct,o:Ct,d(i){i&&It(t)}}}function nc(n,t,e){let{displayIn:r}=t;return n.$$set=i=>{"displayIn"in i&&e(0,r=i.displayIn)},[r]}class ic extends Pn{constructor(t){super(),wn(this,t,nc,rc,xn,{displayIn:0})}}function oc(n){let t,e;return{c(){t=Pr("svg"),e=Pr("path"),w(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),w(t,"viewBox","0 0 60.006 21.412"),w(t,"width","14"),w(t,"height","20"),w(t,"class","svelte-en2qvf")},m(r,i){wt(r,t,i),rt(t,e)},p:Ct,i:Ct,o:Ct,d(r){r&&It(t)}}}class sc extends Pn{constructor(t){super(),wn(this,t,null,oc,xn,{})}}function ac(n){let t,e,r;return{c(){t=Pr("svg"),e=Pr("circle"),r=Pr("path"),w(e,"cx","4.789"),w(e,"cy","4.787"),w(e,"r","3.85"),Oo(e,"stroke-width","1.875"),Oo(e,"fill","none"),w(r,"d","M12.063 12.063 7.635 7.635"),Oo(r,"stroke-width","1.875"),Oo(r,"stroke-linecap","round"),w(t,"xmlns","http://www.w3.org/2000/svg"),w(t,"width","13"),w(t,"height","13"),w(t,"viewBox","0 0 13 13"),w(t,"class","svelte-1bpbt60")},m(i,o){wt(i,t,o),rt(t,e),rt(t,r)},p:Ct,i:Ct,o:Ct,d(i){i&&It(t)}}}class uc extends Pn{constructor(t){super(),wn(this,t,null,ac,xn,{})}}function lc(n,t,e){const r=t[1],i=t[0],o=r-i;return n===r&&e?n:((n-i)%o+o)%o+i}function wa(n){const t=[...n];return t[2]<t[0]&&(t[2]+=360),t}let Ji;async function cc(n,t,e){const r=n==null?void 0:n.getCenterAndZoom();for(const i of t??[])if(!(r&&(i.minZoom!=null&&i.minZoom>r[0]||i.maxZoom!=null&&i.maxZoom<r[0]))){if(i.type==="fixed")return i.coordinates.join(",");t:if(i.type==="client-geolocation"){if(Ji&&i.cachedLocationExpiry&&Ji.time+i.cachedLocationExpiry>Date.now()){if(!Ji.coords)break t;return Ji.coords}let o;try{return o=await new Promise((s,a)=>{e.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(u=>{s([u.coords.longitude,u.coords.latitude].map(l=>l.toFixed(6)).join(","))},u=>{a(u)},i)}),o}catch{}finally{i.cachedLocationExpiry&&(Ji={time:Date.now(),coords:o})}if(e.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const Pa=/([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})/,Oa=/(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i,Ra=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i,Ta=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i,Da=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;function fc(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(n=="DD")return this.decimalCoordinates;const t=this.decimalCoordinates.split(",").map(s=>Number(s.trim()));let e=Ma(t[0],n),r=Ma(t[1],n);e.endsWith('.0"')&&r.endsWith('.0"')&&(e=e.replace(/\.0"$/,'"'),r=r.replace(/\.0"$/,'"'));const i=t[0]>=0?" N":" S",o=t[1]>=0?" E":" W";return`${e+i}, ${r+o}`}else throw new Error("no decimal coordinates to convert")}function Ma(n,t){const e=Math.abs(n),r=Math.floor(e),i=(e-r)*60;if(t=="DM"){let a=hc(i,3).toFixed(3).padStart(6,"0");return`${r}° ${a}'`}let o=Math.floor(i),s=((i-o)*60).toFixed(1).padStart(4,"0");return o=o.toString().padStart(2,"0"),`${r}° ${o}' ${s}"`}function hc(n,t){const e=Math.pow(10,t);return Math.round((n+Number.EPSILON)*e)/e}function Is(n,t){t||(t=5),n=n.replace(/\s+/g," ").trim();let e=null,r=null,i="",o="",s=[],a=!1;if(Pa.test(n))if(s=Pa.exec(n),a=$i(s),a)e=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(e*=-1),r=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(r*=-1);else throw new Error("invalid coordinate format");else if(Oa.test(n))if(s=Oa.exec(n),a=$i(s),a){if(e=s[2],r=s[6],e.includes(",")&&(e=e.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),Number(Math.round(e))==Number(e))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");s[1]?(i=s[1],o=s[5]):s[4]&&(i=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(Ra.test(n))if(s=Ra.exec(n),a=$i(s),a)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4]/60),s[6]&&(e+=s[6].replace(",",".")/3600),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[9])),s[11]&&(r+=s[11]/60),s[13]&&(r+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(r=-1*r),s[1]?(i=s[1],o=s[8]):s[7]&&(i=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(Ta.test(n))if(s=Ta.exec(n),a=$i(s),a)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4]/60),s[6]&&(e+=s[6]/3600),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12]/60),s[14]&&(r+=s[14]/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(i=s[1],o=s[9]):s[8]&&(i=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(Da.test(n))if(s=Da.exec(n),a=$i(s),a)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4].replace(",",".")/60),s[6]&&(e+=s[6].replace(",",".")/3600),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12].replace(",",".")/60),s[14]&&(r+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(i=s[1],o=s[9]):s[8]&&(i=s[8],o=s[16]);else throw new Error("invalid coordinates format");if(a){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(e)>=90)throw new Error("invalid latitude value");if((i||o)&&(!i||!o))throw new Error("invalid coordinates format");if(i&&i==o)throw new Error("invalid coordinates format");let u=/S|SOUTH/i;u.test(i)&&e>0&&(e=-1*e),u=/W|WEST/i,u.test(o)&&r>0&&(r=-1*r);const l=s[0].trim();let c,f;const h=/[,/;\u0020]/g,g=l.match(h);if(g==null){const d=Math.floor(n.length/2);c=l.substring(0,d).trim(),f=l.substring(d).trim()}else{let d;g.length%2==1?d=Math.floor(g.length/2):d=g.length/2-1;let v=0;if(d==0)v=l.indexOf(g[0]),c=l.substring(0,v).trim(),f=l.substring(v+1).trim();else{let C=0,I=0;for(;C<=d;)v=l.indexOf(g[C],I),I=v+1,C++;c=l.substring(0,v).trim(),f=l.substring(v+1).trim()}}const p=c.split(".");if(p.length==2&&p[1]==0&&p[1].length!=2)throw new Error("invalid coordinates format");const y=f.split(".");if(y.length==2&&y[1]==0&&y[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(c)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return isNaN(e)&&e.includes(",")&&(e=e.replace(",",".")),e=Number(Number(e).toFixed(t)),isNaN(r)&&r.includes(",")&&(r=r.replace(",",".")),r=Number(Number(r).toFixed(t)),Object.freeze({verbatimCoordinates:l,verbatimLatitude:c,verbatimLongitude:f,decimalLatitude:e,decimalLongitude:r,decimalCoordinates:`${e},${r}`,closeEnough:gc,toCoordinateFormat:fc})}else throw new Error("coordinates pattern match failed")}function $i(n){if(!isNaN(n[0]))return!1;const t=[...n];if(t.shift(),t.length%2>0)return!1;const e=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,i=t.length/2;for(let o=0;o<i;o++){const s=t[o],a=t[o+i],u=e.test(s)&&e.test(a),l=r.test(s)&&r.test(a),c=s==a;if(!(s==null&&a==null)){if(s==null||a==null)return!1;if(u||l||c)continue;return!1}}return!0}function Aa(n,t){const e=Math.abs(n-t);return Number(e.toFixed(6))<=1e-5}function gc(n){if(n.includes(",")){const t=n.split(",");if(Number(t[0])==NaN||Number(t[1])==NaN)throw new Error("coords are not valid decimals");return Aa(this.decimalLatitude,Number(t[0]))&&Aa(this.decimalLongitude,t[1])}else throw new Error("coords being tested must be separated by a comma")}const pc=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Is.to=pc;const dc=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],vc={decimalLatitude:40.123,decimalLongitude:-74.123},mc=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],yc=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764}];function _c(){const n=[];return dc.forEach(t=>{t.decimalLatitude?n.push(t):n.push({...t,...vc})}),[...n,...mc,...yc]}const Ec=_c();Is.formats=Ec.map(n=>n.verbatimCoordinates);const Cc=Is;function Fa(n,t,e){const r=n.slice();return r[81]=t[e],r[83]=e,r}function ka(n){let t,e;return t=new ec({}),{c(){bn(t.$$.fragment)},m(r,i){cn(t,r,i),e=!0},i(r){e||(Bt(t.$$.fragment,r),e=!0)},o(r){ie(t.$$.fragment,r),e=!1},d(r){fn(t,r)}}}function Ba(n){let t,e,r,i,o;return e=new sc({}),{c(){t=gt("button"),bn(e.$$.fragment),w(t,"type","button"),w(t,"title",n[9]),w(t,"class","svelte-zh3kmv"),sr(t,"active",n[0])},m(s,a){wt(s,t,a),cn(e,t,null),r=!0,i||(o=xe(t,"click",n[67]),i=!0)},p(s,a){(!r||a[0]&512)&&w(t,"title",s[9]),(!r||a[0]&1)&&sr(t,"active",s[0])},i(s){r||(Bt(e.$$.fragment,s),r=!0)},o(s){ie(e.$$.fragment,s),r=!1},d(s){s&&It(t),fn(e),i=!1,o()}}}function Ic(n){let t,e=[],r=new Map,i,o,s,a=Sa(n[14]);const u=l=>l[81].id+(l[81].address?","+l[81].address:"");for(let l=0;l<a.length;l+=1){let c=Fa(n,a,l),f=u(c);r.set(f,e[l]=Ga(f,c))}return{c(){t=gt("ul");for(let l=0;l<e.length;l+=1)e[l].c();w(t,"class","svelte-zh3kmv")},m(l,c){wt(l,t,c);for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(t,null);i=!0,o||(s=[xe(t,"mouseleave",n[71]),xe(t,"blur",n[72])],o=!0)},p(l,c){c[0]&17880064&&(a=Sa(l[14]),To(),e=Bl(e,c,u,1,l,a,r,t,kl,Ga,null,Fa),Do())},i(l){if(!i){for(let c=0;c<a.length;c+=1)Bt(e[c]);i=!0}},o(l){for(let c=0;c<e.length;c+=1)ie(e[c]);i=!1},d(l){l&&It(t);for(let c=0;c<e.length;c+=1)e[c].d();o=!1,ln(s)}}}function Nc(n){let t,e,r,i,o,s;return e=new La({}),{c(){t=gt("div"),bn(e.$$.fragment),r=Ye(),i=gt("div"),o=Ln(n[7]),w(i,"class","svelte-zh3kmv"),w(t,"class","no-results svelte-zh3kmv")},m(a,u){wt(a,t,u),cn(e,t,null),rt(t,r),rt(t,i),rt(i,o),s=!0},p(a,u){(!s||u[0]&128)&&Ki(o,a[7])},i(a){s||(Bt(e.$$.fragment,a),s=!0)},o(a){ie(e.$$.fragment,a),s=!1},d(a){a&&It(t),fn(e)}}}function Sc(n){let t="",e;return{c(){e=Ln(t)},m(r,i){wt(r,e,i)},p:Ct,i:Ct,o:Ct,d(r){r&&It(e)}}}function xc(n){let t,e,r,i,o,s,a,u,l,c,f;return e=new La({}),u=new xa({}),{c(){t=gt("div"),bn(e.$$.fragment),r=Ye(),i=gt("div"),o=Ln(n[6]),s=Ye(),a=gt("button"),bn(u.$$.fragment),w(i,"class","svelte-zh3kmv"),w(a,"class","svelte-zh3kmv"),w(t,"class","error svelte-zh3kmv")},m(h,g){wt(h,t,g),cn(e,t,null),rt(t,r),rt(t,i),rt(i,o),rt(t,s),rt(t,a),cn(u,a,null),l=!0,c||(f=xe(a,"click",n[68]),c=!0)},p(h,g){(!l||g[0]&64)&&Ki(o,h[6])},i(h){l||(Bt(e.$$.fragment,h),Bt(u.$$.fragment,h),l=!0)},o(h){ie(e.$$.fragment,h),ie(u.$$.fragment,h),l=!1},d(h){h&&It(t),fn(e),fn(u),c=!1,f()}}}function Ga(n,t){let e,r,i;function o(){return t[69](t[83])}function s(){return t[70](t[81])}return r=new $l({props:{feature:t[81],showPlaceType:t[10],selected:t[15]===t[83],missingIconsCache:t[20],iconsBaseUrl:t[12]}}),r.$on("mouseenter",o),r.$on("focus",s),{key:n,first:null,c(){e=bl(),bn(r.$$.fragment),this.first=e},m(a,u){wt(a,e,u),cn(r,a,u),i=!0},p(a,u){t=a;const l={};u[0]&16384&&(l.feature=t[81]),u[0]&1024&&(l.showPlaceType=t[10]),u[0]&49152&&(l.selected=t[15]===t[83]),u[0]&4096&&(l.iconsBaseUrl=t[12]),r.$set(l)},i(a){i||(Bt(r.$$.fragment,a),i=!0)},o(a){ie(r.$$.fragment,a),i=!1},d(a){a&&It(e),fn(r,a)}}}function Lc(n){let t,e,r,i,o,s,a,u,l,c,f,h,g,p,y,d,v,C,I,N,L,T=!1;o=new uc({}),f=new xa({});let O=n[19]&&ka(),D=n[5]===!0&&Ba(n);const b=n[59].default,A=Nl(b,n,n[58],null),Y=[xc,Sc,Nc,Ic],G=[];function ut(x,B){var Q,bt;return x[18]?0:x[16]?((Q=x[14])==null?void 0:Q.length)===0?2:x[16]&&((bt=x[14])!=null&&bt.length)?3:-1:1}return~(d=ut(n))&&(v=G[d]=Y[d](n)),{c(){t=Ye(),e=gt("form"),r=gt("div"),i=gt("button"),bn(o.$$.fragment),s=Ye(),a=gt("input"),u=Ye(),l=gt("div"),c=gt("button"),bn(f.$$.fragment),h=Ye(),O&&O.c(),g=Ye(),D&&D.c(),p=Ye(),A&&A.c(),y=Ye(),v&&v.c(),w(i,"class","search-button svelte-zh3kmv"),w(i,"type","button"),w(a,"placeholder",n[8]),w(a,"aria-label",n[8]),w(a,"class","svelte-zh3kmv"),w(c,"type","button"),w(c,"title",n[3]),w(c,"class","svelte-zh3kmv"),w(l,"class","clear-button-container svelte-zh3kmv"),sr(l,"displayable",n[1]!==""),w(r,"class","input-group svelte-zh3kmv"),w(e,"tabindex","0"),w(e,"class",C=ya(n[2])+" svelte-zh3kmv"),sr(e,"can-collapse",n[4]&&n[1]==="")},m(x,B){wt(x,t,B),wt(x,e,B),rt(e,r),rt(r,i),cn(o,i,null),rt(r,s),rt(r,a),n[61](a),_a(a,n[1]),rt(r,u),rt(r,l),rt(l,c),cn(f,c,null),rt(l,h),O&&O.m(l,null),rt(r,g),D&&D.m(r,null),rt(r,p),A&&A.m(r,null),rt(e,y),~d&&G[d].m(e,null),I=!0,N||(L=[xe(i,"click",n[60]),xe(a,"input",n[62]),xe(a,"focus",n[63]),xe(a,"blur",n[64]),xe(a,"keydown",n[22]),xe(a,"input",n[65]),xe(c,"click",n[66]),xe(e,"submit",wl(n[21]))],N=!0)},p(x,B){(!I||B[0]&256)&&w(a,"placeholder",x[8]),(!I||B[0]&256)&&w(a,"aria-label",x[8]),B[0]&2&&a.value!==x[1]&&_a(a,x[1]),(!I||B[0]&8)&&w(c,"title",x[3]),x[19]?O?B[0]&524288&&Bt(O,1):(O=ka(),O.c(),Bt(O,1),O.m(l,null)):O&&(To(),ie(O,1,1,()=>{O=null}),Do()),(!I||B[0]&2)&&sr(l,"displayable",x[1]!==""),x[5]===!0?D?(D.p(x,B),B[0]&32&&Bt(D,1)):(D=Ba(x),D.c(),Bt(D,1),D.m(r,p)):D&&(To(),ie(D,1,1,()=>{D=null}),Do()),A&&A.p&&(!I||B[1]&134217728)&&xl(A,b,x,x[58],I?Sl(b,x[58],B,null):Ll(x[58]),null);let Q=d;d=ut(x),d===Q?~d&&G[d].p(x,B):(v&&(To(),ie(G[Q],1,1,()=>{G[Q]=null}),Do()),~d?(v=G[d],v?v.p(x,B):(v=G[d]=Y[d](x),v.c()),Bt(v,1),v.m(e,null)):v=null),(!I||B[0]&4&&C!==(C=ya(x[2])+" svelte-zh3kmv"))&&w(e,"class",C),(!I||B[0]&22)&&sr(e,"can-collapse",x[4]&&x[1]==="")},i(x){I||(Bt(T),Bt(o.$$.fragment,x),Bt(f.$$.fragment,x),Bt(O),Bt(D),Bt(A,x),Bt(v),I=!0)},o(x){ie(T),ie(o.$$.fragment,x),ie(f.$$.fragment,x),ie(O),ie(D),ie(A,x),ie(v),I=!1},d(x){x&&(It(t),It(e)),fn(o),n[61](null),fn(f),O&&O.d(),D&&D.d(),A&&A.d(x),~d&&G[d].d(),N=!1,ln(L)}}}function bc(n,t,e){let r,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:f=!1}=t,{country:h=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:p=!1}=t,{errorMessage:y="Something went wrong…"}=t,{filter:d=()=>!0}=t,{flyTo:v=!0}=t,{fuzzyMatch:C=!0}=t,{language:I=void 0}=t,{limit:N=void 0}=t,{mapController:L=void 0}=t,{minLength:T=2}=t,{noResultsMessage:O="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:D="Search"}=t,{proximity:b=[{type:"server-geolocation"}]}=t,{reverseActive:A=p==="always"}=t,{reverseButtonTitle:Y="toggle reverse geocoding"}=t,{searchValue:G=""}=t,{showFullGeometry:ut=!0}=t,{showPlaceType:x="ifNeeded"}=t,{showResultsWhileTyping:B=!0}=t,{selectFirst:Q=!0}=t,{flyToSelected:bt=!1}=t,{markerOnSelected:re=!0}=t,{types:Kt=void 0}=t,{excludeTypes:sn=!1}=t,{zoom:Ae=16}=t,{maxZoom:Xe=18}=t,{apiUrl:ir="https://api.maptiler.com/geocoding"}=t,{fetchParameters:jn={}}=t,{iconsBaseUrl:Sn="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.4/icons/"}=t,{adjustUrlQuery:ia=S=>{}}=t;function Qf(){an.focus()}function Zf(){an.blur()}function ml(S,Zt=!0,or=!1){e(1,G=S),Zt?(e(15,Tt=-1),_l()):(ua(!or,or),setTimeout(()=>{an.focus(),an.select()}))}function Jf(){e(14,it=void 0),e(55,et=void 0),e(15,Tt=-1)}function $f(){e(54,Qt=[]),e(55,et=void 0)}let Hi=!1,it,Qt,et,yl="",an,Tt=-1,un,gs=[],vi,ji,ps,oa;const th=new Set,Kn=Tl();Rl(()=>{L&&(L.setEventHandler(void 0),L.indicateReverse(!1),L.setSelectedMarker(-1),L.setMarkers(void 0,void 0))});function _l(S){if(ji&&(clearTimeout(ji),ji=void 0),Tt>-1&&it)e(55,et=it[Tt]),e(1,G=et.place_type[0]==="reverse"?et.place_name:et.place_name.replace(/,.*/,"")),e(18,un=void 0),e(54,Qt=void 0),e(15,Tt=-1);else if(G){const Zt=S||!sa(G);aa(G,{exact:!0}).then(()=>{e(54,Qt=it),e(55,et=void 0),Zt&&eh()}).catch(or=>e(18,un=or))}}function sa(S){try{return Cc(S,6)}catch{return!1}}async function aa(S,{byId:Zt=!1,exact:or=!1}={}){e(18,un=void 0),vi==null||vi.abort();const Lr=new AbortController;e(19,vi=Lr);try{const st=sa(S),br=new URLSearchParams;if(I!==void 0&&br.set("language",Array.isArray(I)?I.join(","):I??""),Kt&&br.set("types",Kt.join(",")),sn&&br.set("excludeTypes",String(sn)),u&&br.set("bbox",u.map(vs=>vs.toFixed(6)).join(",")),h&&br.set("country",Array.isArray(h)?h.join(","):h),!Zt&&!st){const vs=await cc(L,b,Lr);vs&&br.set("proximity",vs),(or||!B)&&br.set("autocomplete","false"),br.set("fuzzyMatch",String(C))}N!==void 0&&(!st||(Kt==null?void 0:Kt.length)===1)&&br.set("limit",String(N)),br.set("key",a),ia(br);const ds=ir+"/"+encodeURIComponent(st?st.decimalLongitude+","+st.decimalLatitude:S)+".json?"+br.toString();if(ds===yl){Zt?(e(14,it=void 0),e(55,et=gs[0])):e(14,it=gs);return}yl=ds;const ca=await fetch(ds,{signal:Lr.signal,...jn});if(!ca.ok)throw new Error(await ca.text());const fa=await ca.json();Kn("response",{url:ds,featureCollection:fa}),Zt?(e(14,it=void 0),e(55,et=fa.features[0]),gs=[et]):(e(14,it=fa.features.filter(d)),st&&it.unshift({type:"Feature",properties:{},id:"reverse_"+st.decimalLongitude+"_"+st.decimalLatitude,text:st.decimalLatitude+", "+st.decimalLongitude,place_name:st.decimalLatitude+", "+st.decimalLongitude,place_type:["reverse"],center:[st.decimalLongitude,st.decimalLatitude],bbox:[st.decimalLongitude,st.decimalLatitude,st.decimalLongitude,st.decimalLatitude],geometry:{type:"Point",coordinates:[st.decimalLongitude,st.decimalLatitude]}}),gs=it,st&&an.focus())}catch(st){if(st&&typeof st=="object"&&"name"in st&&st.name==="AbortError")return;throw st}finally{Lr===vi&&e(19,vi=void 0)}}function eh(){var or;if(!(Qt!=null&&Qt.length)||!v)return;const S=[180,90,-180,-90],Zt=!Qt.some(Lr=>!Lr.matching_text);for(const Lr of Qt)if(Zt||!Lr.matching_text)for(const st of[0,1,2,3])S[st]=Math[st<2?"min":"max"](S[st],((or=Lr.bbox)==null?void 0:or[st])??Lr.center[st%2]);L&&Qt.length>0&&(et&&S[0]===S[2]&&S[1]===S[3]?L.flyTo(et.center,Ae):L.fitBounds(wa(S),50,Xe))}function rh(S){e(0,A=p==="always"),e(14,it=void 0),e(55,et=void 0),e(15,Tt=-1),ml(S[1].toFixed(6)+", "+lc(S[0],[-180,180],!0).toFixed(6),!1,!0)}function nh(S){if(!it)return;let Zt=S.key==="ArrowDown"?1:S.key==="ArrowUp"?-1:0;Zt&&(Tt===(Q?0:-1)&&Zt===-1&&e(15,Tt=it.length),e(15,Tt+=Zt),Tt>=it.length&&e(15,Tt=-1),Tt<0&&Q&&e(15,Tt=0),S.preventDefault())}function ua(S=!0,Zt=!1){if(e(18,un=void 0),B||Zt){if(ji&&clearTimeout(ji),G.length<T)return;const or=G;ji=window.setTimeout(()=>{aa(or).catch(Lr=>e(18,un=Lr))},S?g:0)}else e(14,it=void 0),e(18,un=void 0)}function la(S){e(55,et=S),e(1,G=S.place_name),e(15,Tt=-1)}const ih=()=>an.focus();function oh(S){ys[S?"unshift":"push"](()=>{an=S,e(17,an)})}function sh(){G=this.value,e(1,G),e(13,Hi),e(27,c)}const ah=()=>e(13,Hi=!0),uh=()=>e(13,Hi=!1),lh=()=>ua(),ch=()=>{e(1,G=""),an.focus()},fh=()=>e(0,A=!A),hh=()=>e(18,un=void 0),gh=S=>e(15,Tt=S),ph=S=>la(S),dh=()=>{Q||e(15,Tt=-1)},vh=()=>{};return n.$$set=S=>{"class"in S&&e(2,s=S.class),"apiKey"in S&&e(25,a=S.apiKey),"bbox"in S&&e(26,u=S.bbox),"clearButtonTitle"in S&&e(3,l=S.clearButtonTitle),"clearOnBlur"in S&&e(27,c=S.clearOnBlur),"collapsed"in S&&e(4,f=S.collapsed),"country"in S&&e(28,h=S.country),"debounceSearch"in S&&e(29,g=S.debounceSearch),"enableReverse"in S&&e(5,p=S.enableReverse),"errorMessage"in S&&e(6,y=S.errorMessage),"filter"in S&&e(30,d=S.filter),"flyTo"in S&&e(31,v=S.flyTo),"fuzzyMatch"in S&&e(32,C=S.fuzzyMatch),"language"in S&&e(33,I=S.language),"limit"in S&&e(34,N=S.limit),"mapController"in S&&e(35,L=S.mapController),"minLength"in S&&e(36,T=S.minLength),"noResultsMessage"in S&&e(7,O=S.noResultsMessage),"placeholder"in S&&e(8,D=S.placeholder),"proximity"in S&&e(37,b=S.proximity),"reverseActive"in S&&e(0,A=S.reverseActive),"reverseButtonTitle"in S&&e(9,Y=S.reverseButtonTitle),"searchValue"in S&&e(1,G=S.searchValue),"showFullGeometry"in S&&e(38,ut=S.showFullGeometry),"showPlaceType"in S&&e(10,x=S.showPlaceType),"showResultsWhileTyping"in S&&e(39,B=S.showResultsWhileTyping),"selectFirst"in S&&e(11,Q=S.selectFirst),"flyToSelected"in S&&e(40,bt=S.flyToSelected),"markerOnSelected"in S&&e(41,re=S.markerOnSelected),"types"in S&&e(42,Kt=S.types),"excludeTypes"in S&&e(43,sn=S.excludeTypes),"zoom"in S&&e(44,Ae=S.zoom),"maxZoom"in S&&e(45,Xe=S.maxZoom),"apiUrl"in S&&e(46,ir=S.apiUrl),"fetchParameters"in S&&e(47,jn=S.fetchParameters),"iconsBaseUrl"in S&&e(12,Sn=S.iconsBaseUrl),"adjustUrlQuery"in S&&e(48,ia=S.adjustUrlQuery),"$$scope"in S&&e(58,o=S.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&134225920&&setTimeout(()=>{e(16,ps=Hi),c&&!Hi&&e(1,G="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&32&&G.length<T&&(e(55,et=void 0),e(14,it=void 0),e(18,un=void 0),e(54,Qt=it)),n.$$.dirty[1]&16777344&&ut&&et&&!et.address&&et.geometry.type==="Point"&&et.place_type[0]!=="reverse"&&aa(et.id,{byId:!0}).catch(S=>e(18,un=S)),n.$$.dirty[1]&50356241&&(L&&et&&et.id!==oa&&v&&(!et.bbox||et.bbox[0]===et.bbox[2]&&et.bbox[1]===et.bbox[3]?L.flyTo(et.center,et.id.startsWith("poi.")||et.id.startsWith("address.")?Xe:Ae):L.fitBounds(wa(et.bbox),50,Xe),e(14,it=void 0),e(54,Qt=void 0),e(15,Tt=-1)),e(56,oa=et==null?void 0:et.id)),n.$$.dirty[0]&18432&&Q&&it!=null&&it.length&&e(15,Tt=0),n.$$.dirty[0]&2050&&(Q||e(15,Tt=-1)),n.$$.dirty[0]&16384|n.$$.dirty[1]&8388608&&Qt!==it&&e(54,Qt=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&8388624&&L&&L.setEventHandler(S=>{switch(S.type){case"mapClick":A&&rh(S.coordinates);break;case"markerClick":{const Zt=it==null?void 0:it.find(or=>or.id===S.id);Zt&&la(Zt)}break;case"markerMouseEnter":Qt&&e(15,Tt=ps?(it==null?void 0:it.findIndex(Zt=>Zt.id===S.id))??-1:-1);break;case"markerMouseLeave":Qt&&e(15,Tt=-1);break}}),n.$$.dirty[0]&49152&&e(57,r=it==null?void 0:it[Tt]),n.$$.dirty[1]&67133969&&L&&r&&v&&bt&&L.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Xe:Ae),n.$$.dirty[1]&1040&&(re||L==null||L.setMarkers(void 0,void 0)),n.$$.dirty[1]&75498512&&L&&re&&!Qt&&(L.setMarkers(r?[r]:void 0,void 0),L.setSelectedMarker(r?0:-1)),n.$$.dirty[1]&25165840&&L&&L.setMarkers(Qt,et),n.$$.dirty[0]&32768|n.$$.dirty[1]&8388624&&Qt&&L&&L.setSelectedMarker(Tt),n.$$.dirty[0]&2|n.$$.dirty[1]&16&&L){const S=sa(G);L.setReverseMarker(S?[S.decimalLongitude,S.decimalLatitude]:void 0)}n.$$.dirty[1]&67108864&&Kn("select",r),n.$$.dirty[1]&16777216&&Kn("pick",et),n.$$.dirty[0]&81920&&Kn("optionsVisibilityChange",ps&&!!it),n.$$.dirty[0]&16384&&Kn("featuresListed",it),n.$$.dirty[1]&8388608&&Kn("featuresMarked",Qt),n.$$.dirty[0]&1&&Kn("reverseToggle",A),n.$$.dirty[0]&2&&Kn("queryChange",G),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&L&&L.indicateReverse(A)},[A,G,s,l,f,p,y,O,D,Y,x,Q,Sn,Hi,it,Tt,ps,an,un,vi,th,_l,nh,ua,la,a,u,c,h,g,d,v,C,I,N,L,T,b,ut,B,bt,re,Kt,sn,Ae,Xe,ir,jn,ia,Qf,Zf,ml,Jf,$f,Qt,et,oa,r,o,i,ih,oh,sh,ah,uh,lh,ch,fh,hh,gh,ph,dh,vh]}let wc=class extends Pn{constructor(t){super(),wn(this,t,bc,Lc,xn,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}};/**
2
2
  * splaytree v3.1.2
3
3
  * Fast Splay tree for Node and browser
4
4
  *
@@ -19,8 +19,8 @@
19
19
  See the Apache Version 2.0 License for specific language governing permissions
20
20
  and limitations under the License.
21
21
  ***************************************************************************** */function Pc(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;e;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){e.label=l[1];break}if(l[0]===6&&e.label<o[1]){e.label=o[1],o=l;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(l);break}o[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var On=function(){function n(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return n}();function Oc(n,t){return n>t?1:n<t?-1:0}function Rn(n,t,e){for(var r=new On(null,null),i=r,o=r;;){var s=e(n,t.key);if(s<0){if(t.left===null)break;if(e(n,t.left.key)<0){var a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}o.left=t,o=t,t=t.left}else if(s>0){if(t.right===null)break;if(e(n,t.right.key)>0){var a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=r.right,t.right=r.left,t}function Ns(n,t,e,r){var i=new On(n,t);if(e===null)return i.left=i.right=null,i;e=Rn(n,e,r);var o=r(n,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function za(n,t,e){var r=null,i=null;if(t){t=Rn(n,t,e);var o=e(t.key,n);o===0?(r=t.left,i=t.right):o<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function Rc(n,t,e){return t===null?n:(n===null||(t=Rn(n.key,t,e),t.left=n),t)}function Ss(n,t,e,r,i){if(n){r(""+t+(e?"└── ":"├── ")+i(n)+`
22
- `);var o=t+(e?" ":"│ ");n.left&&Ss(n.left,o,!1,r,i),n.right&&Ss(n.right,o,!0,r,i)}}var xs=function(){function n(t){t===void 0&&(t=Oc),this._root=null,this._size=0,this._comparator=t}return n.prototype.insert=function(t,e){return this._size++,this._root=Ns(t,e,this._root,this._comparator)},n.prototype.add=function(t,e){var r=new On(t,e);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,o=Rn(t,this._root,i),s=i(t,o.key);return s===0?this._root=o:(s<0?(r.left=o.left,r.right=o,o.left=null):s>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},n.prototype._remove=function(t,e,r){var i;if(e===null)return null;e=Rn(t,e,r);var o=r(t,e.key);return o===0?(e.left===null?i=e.right:(i=Rn(t,e.left,r),i.right=e.right),this._size--,i):e},n.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Rn(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},n.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},n.prototype.find=function(t){return this._root&&(this._root=Rn(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},n.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},n.prototype.forEach=function(t,e){for(var r=this._root,i=[],o=!1;!o;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),t.call(e,r),r=r.right):o=!0;return this},n.prototype.range=function(t,e,r,i){for(var o=[],s=this._comparator,a=this._root,u;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),u=s(a.key,e),u>0)break;if(s(a.key,t)>=0&&r.call(i,a))return this;a=a.right}return this},n.prototype.keys=function(){var t=[];return this.forEach(function(e){var r=e.key;return t.push(r)}),t},n.prototype.values=function(){var t=[];return this.forEach(function(e){var r=e.data;return t.push(r)}),t},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},n.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},n.prototype.at=function(t){for(var e=this._root,r=!1,i=0,o=[];!r;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(r=e,e=e.left):e=e.right}return r},n.prototype.prev=function(t){var e=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(r=e,e=e.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return Dc(this._root)},n.prototype.load=function(t,e,r){e===void 0&&(e=[]),r===void 0&&(r=!1);var i=t.length,o=this._comparator;if(r&&ws(t,e,0,i-1,o),this._root===null)this._root=Ls(t,e,0,i),this._size=i;else{var s=Mc(this.toList(),Tc(t,e),o);i=this._size+i,this._root=bs({head:s},0,i)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var e=[];return Ss(this._root,"",!0,function(r){return e.push(r)},t),e.join("")},n.prototype.update=function(t,e,r){var i=this._comparator,o=za(t,this._root,i),s=o.left,a=o.right;i(t,e)<0?a=Ns(e,r,a,i):s=Ns(e,r,s,i),this._root=Rc(s,a,i)},n.prototype.split=function(t){return za(t,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var t,e,r;return Pc(this,function(i){switch(i.label){case 0:t=this._root,e=[],r=!1,i.label=1;case 1:return r?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:r=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Ls(n,t,e,r){var i=r-e;if(i>0){var o=e+Math.floor(i/2),s=n[o],a=t[o],u=new On(s,a);return u.left=Ls(n,t,e,o),u.right=Ls(n,t,o+1,r),u}return null}function Tc(n,t){for(var e=new On(null,null),r=e,i=0;i<n.length;i++)r=r.next=new On(n[i],t[i]);return r.next=null,e.next}function Dc(n){for(var t=n,e=[],r=!1,i=new On(null,null),o=i;!r;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):r=!0;return o.next=null,i.next}function bs(n,t,e){var r=e-t;if(r>0){var i=t+Math.floor(r/2),o=bs(n,t,i),s=n.head;return s.left=o,n.head=n.head.next,s.right=bs(n,i+1,e),s}return null}function Mc(n,t,e){for(var r=new On(null,null),i=r,o=n,s=t;o!==null&&s!==null;)e(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),r.next}function ws(n,t,e,r,i){if(!(e>=r)){for(var o=n[e+r>>1],s=e-1,a=r+1;;){do s++;while(i(n[s],o)<0);do a--;while(i(n[a],o)>0);if(s>=a)break;var u=n[s];n[s]=n[a],n[a]=u,u=t[s],t[s]=t[a],t[a]=u}ws(n,t,e,a,i),ws(n,t,a+1,r,i)}}function ar(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Va(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function Le(n,t,e){return t&&Va(n.prototype,t),e&&Va(n,e),n}var to=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Ps=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var r=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,s=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:r,y:o},ur:{x:i,y:s}}},Tn=Number.EPSILON;Tn===void 0&&(Tn=Math.pow(2,-52));var Ac=Tn*Tn,Os=function(t,e){if(-Tn<t&&t<Tn&&-Tn<e&&e<Tn)return 0;var r=t-e;return r*r<Ac*t*e?0:t<e?-1:1},Fc=function(){function n(){ar(this,n),this.reset()}return Le(n,[{key:"reset",value:function(){this.xRounder=new Ua,this.yRounder=new Ua}},{key:"round",value:function(e,r){return{x:this.xRounder.round(e),y:this.yRounder.round(r)}}}]),n}(),Ua=function(){function n(){ar(this,n),this.tree=new xs,this.round(0)}return Le(n,[{key:"round",value:function(e){var r=this.tree.add(e),i=this.tree.prev(r);if(i!==null&&Os(r.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(r);return o!==null&&Os(r.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),n}(),eo=new Fc,ro=function(t,e){return t.x*e.y-t.y*e.x},qa=function(t,e){return t.x*e.x+t.y*e.y},Xa=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y},s=ro(i,o);return Os(s,0)},Mo=function(t){return Math.sqrt(qa(t,t))},kc=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return ro(o,i)/Mo(o)/Mo(i)},Bc=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return qa(o,i)/Mo(o)/Mo(i)},Ya=function(t,e,r){return e.y===0?null:{x:t.x+e.x/e.y*(r-t.y),y:r}},Wa=function(t,e,r){return e.x===0?null:{x:r,y:t.y+e.y/e.x*(r-t.x)}},Gc=function(t,e,r,i){if(e.x===0)return Wa(r,i,t.x);if(i.x===0)return Wa(t,e,r.x);if(e.y===0)return Ya(r,i,t.y);if(i.y===0)return Ya(t,e,r.y);var o=ro(e,i);if(o==0)return null;var s={x:r.x-t.x,y:r.y-t.y},a=ro(s,e)/o,u=ro(s,i)/o,l=t.x+u*e.x,c=r.x+a*i.x,f=t.y+u*e.y,h=r.y+a*i.y,g=(l+c)/2,p=(f+h)/2;return{x:g,y:p}},Xr=function(){Le(n,null,[{key:"compare",value:function(e,r){var i=n.comparePoints(e.point,r.point);return i!==0?i:(e.point!==r.point&&e.link(r),e.isLeft!==r.isLeft?e.isLeft?1:-1:Ao.compare(e.segment,r.segment))}},{key:"comparePoints",value:function(e,r){return e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0}}]);function n(t,e){ar(this,n),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return Le(n,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var r=e.point.events,i=0,o=r.length;i<o;i++){var s=r[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,r=0;r<e;r++){var i=this.point.events[r];if(i.segment.consumedBy===void 0)for(var o=r+1;o<e;o++){var s=this.point.events[o];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],r=0,i=this.point.events.length;r<i;r++){var o=this.point.events[r];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var r=this,i=new Map,o=function(a){var u=a.otherSE;i.set(a,{sine:kc(r.point,e.point,u.point),cosine:Bc(r.point,e.point,u.point)})};return function(s,a){i.has(s)||o(s),i.has(a)||o(a);var u=i.get(s),l=u.sine,c=u.cosine,f=i.get(a),h=f.sine,g=f.cosine;return l>=0&&h>=0?c<g?1:c>g?-1:0:l<0&&h<0?c<g?-1:c>g?1:0:h<l?-1:h>l?1:0}}}]),n}(),zc=0,Ao=function(){Le(n,null,[{key:"compare",value:function(e,r){var i=e.leftSE.point.x,o=r.leftSE.point.x,s=e.rightSE.point.x,a=r.rightSE.point.x;if(a<i)return 1;if(s<o)return-1;var u=e.leftSE.point.y,l=r.leftSE.point.y,c=e.rightSE.point.y,f=r.rightSE.point.y;if(i<o){if(l<u&&l<c)return 1;if(l>u&&l>c)return-1;var h=e.comparePoint(r.leftSE.point);if(h<0)return 1;if(h>0)return-1;var g=r.comparePoint(e.rightSE.point);return g!==0?g:-1}if(i>o){if(u<l&&u<f)return-1;if(u>l&&u>f)return 1;var p=r.comparePoint(e.leftSE.point);if(p!==0)return p;var v=e.comparePoint(r.rightSE.point);return v<0?1:v>0?-1:1}if(u<l)return-1;if(u>l)return 1;if(s<a){var d=r.comparePoint(e.rightSE.point);if(d!==0)return d}if(s>a){var y=e.comparePoint(r.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(s!==a){var I=c-u,C=s-i,N=f-l,L=a-o;if(I>C&&N<L)return 1;if(I<C&&N>L)return-1}return s>a?1:s<a||c<f?-1:c>f?1:e.id<r.id?-1:e.id>r.id?1:0}}]);function n(t,e,r,i){ar(this,n),this.id=++zc,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=r,this.windings=i}return Le(n,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<r?e:r},ur:{x:this.rightSE.point.x,y:e>r?e:r}}}},{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(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var r=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(r.x===i.x)return e.x===r.x?0:e.x<r.x?1:-1;var s=(e.y-r.y)/o.y,a=r.x+s*o.x;if(e.x===a)return 0;var u=(e.x-r.x)/o.x,l=r.y+u*o.y;return e.y===l?0:e.y<l?-1:1}},{key:"getIntersection",value:function(e){var r=this.bbox(),i=e.bbox(),o=Ps(r,i);if(o===null)return null;var s=this.leftSE.point,a=this.rightSE.point,u=e.leftSE.point,l=e.rightSE.point,c=to(r,u)&&this.comparePoint(u)===0,f=to(i,s)&&e.comparePoint(s)===0,h=to(r,l)&&this.comparePoint(l)===0,g=to(i,a)&&e.comparePoint(a)===0;if(f&&c)return g&&!h?a:!g&&h?l:null;if(f)return h&&s.x===l.x&&s.y===l.y?null:s;if(c)return g&&a.x===u.x&&a.y===u.y?null:u;if(g&&h)return null;if(g)return a;if(h)return l;var p=Gc(s,this.vector(),u,e.vector());return p===null||!to(o,p)?null:eo.round(p.x,p.y)}},{key:"split",value:function(e){var r=[],i=e.events!==void 0,o=new Xr(e,!0),s=new Xr(e,!1),a=this.rightSE;this.replaceRightSE(s),r.push(s),r.push(o);var u=new n(o,a,this.rings.slice(),this.windings.slice());return Xr.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Xr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),r}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var r=0,i=this.windings.length;r<i;r++)this.windings[r]*=-1}},{key:"consume",value:function(e){for(var r=this,i=e;r.consumedBy;)r=r.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=n.compare(r,i);if(o!==0){if(o>0){var s=r;r=i,i=s}if(r.prev===i){var a=r;r=i,i=a}for(var u=0,l=i.rings.length;u<l;u++){var c=i.rings[u],f=i.windings[u],h=r.rings.indexOf(c);h===-1?(r.rings.push(c),r.windings.push(f)):r.windings[h]+=f}i.rings=null,i.windings=null,i.consumedBy=r,i.leftSE.consumedBy=r.leftSE,i.rightSE.consumedBy=r.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var r=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,s=0,a=this.rings.length;s<a;s++){var u=this.rings[s],l=this.windings[s],c=r.indexOf(u);c===-1?(r.push(u),i.push(l)):i[c]+=l}for(var f=[],h=[],g=0,p=r.length;g<p;g++)if(i[g]!==0){var v=r[g],d=v.poly;if(h.indexOf(d)===-1)if(v.isExterior)f.push(d);else{h.indexOf(d)===-1&&h.push(d);var y=f.indexOf(v.poly);y!==-1&&f.splice(y,1)}}for(var I=0,C=f.length;I<C;I++){var N=f[I].multiPoly;o.indexOf(N)===-1&&o.push(N)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(Or.type){case"union":{var i=e.length===0,o=r.length===0;this._isInResult=i!==o;break}case"intersection":{var s,a;e.length<r.length?(s=e.length,a=r.length):(s=r.length,a=e.length),this._isInResult=a===Or.numMultiPolys&&s<a;break}case"xor":{var u=Math.abs(e.length-r.length);this._isInResult=u%2===1;break}case"difference":{var l=function(f){return f.length===1&&f[0].isSubject};this._isInResult=l(e)!==l(r);break}default:throw new Error("Unrecognized operation type found ".concat(Or.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,r,i){var o,s,a,u=Xr.comparePoints(e,r);if(u<0)o=e,s=r,a=1;else if(u>0)o=r,s=e,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new Xr(o,!0),c=new Xr(s,!1);return new n(l,c,[i],[a])}}]),n}(),Ha=function(){function n(t,e,r){if(ar(this,n),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=eo.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=t.length;s<a;s++){if(typeof t[s][0]!="number"||typeof t[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=eo.round(t[s][0],t[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Ao.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.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(Ao.fromRing(o,i,this))}return Le(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.segments.length;r<i;r++){var o=this.segments[r];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),n}(),Vc=function(){function n(t,e){if(ar(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ha(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,i=t.length;r<i;r++){var o=new Ha(t[r],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.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=e}return Le(n,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),r=0,i=this.interiorRings.length;r<i;r++)for(var o=this.interiorRings[r].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),n}(),ja=function(){function n(t,e){if(ar(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,i=t.length;r<i;r++){var o=new Vc(t[r],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.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=e}return Le(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++)for(var o=this.polys[r].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),n}(),Uc=function(){Le(n,null,[{key:"factory",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!(!s.isInResult()||s.ringOut)){for(var a=null,u=s.leftSE,l=s.rightSE,c=[u],f=u.point,h=[];a=u,u=l,c.push(u),u.point!==f;)for(;;){var g=u.getAvailableLinkedEvents();if(g.length===0){var p=c[0].point,v=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(v.x,", ").concat(v.y,"]."))}if(g.length===1){l=g[0].otherSE;break}for(var d=null,y=0,I=h.length;y<I;y++)if(h[y].point===u.point){d=y;break}if(d!==null){var C=h.splice(d)[0],N=c.splice(C.index);N.unshift(N[0].otherSE),r.push(new n(N.reverse()));continue}h.push({index:c.length,point:u.point});var L=u.getLeftmostComparator(a);l=g.sort(L)[0].otherSE;break}r.push(new n(c))}}return r}}]);function n(t){ar(this,n),this.events=t;for(var e=0,r=t.length;e<r;e++)t[e].segment.ringOut=this;this.poly=null}return Le(n,[{key:"getGeom",value:function(){for(var e=this.events[0].point,r=[e],i=1,o=this.events.length-1;i<o;i++){var s=this.events[i].point,a=this.events[i+1].point;Xa(s,e,a)!==0&&(r.push(s),e=s)}if(r.length===1)return null;var u=r[0],l=r[1];Xa(u,e,l)===0&&r.shift(),r.push(r[0]);for(var c=this.isExteriorRing()?1:-1,f=this.isExteriorRing()?0:r.length-1,h=this.isExteriorRing()?r.length:-1,g=[],p=f;p!=h;p+=c)g.push([r[p].x,r[p].y]);return g}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],r=1,i=this.events.length;r<i;r++){var o=this.events[r];Xr.compare(e,o)>0&&(e=o)}for(var s=e.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),n}(),Ka=function(){function n(t){ar(this,n),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Le(n,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var r=0,i=this.interiorRings.length;r<i;r++){var o=this.interiorRings[r].getGeom();o!==null&&e.push(o)}return e}}]),n}(),qc=function(){function n(t){ar(this,n),this.rings=t,this.polys=this._composePolys(t)}return Le(n,[{key:"getGeom",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++){var o=this.polys[r].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!s.poly)if(s.isExteriorRing())r.push(new Ka(s));else{var a=s.enclosingRing();a.poly||r.push(new Ka(a)),a.poly.addInterior(s)}}return r}}]),n}(),Xc=function(){function n(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ao.compare;ar(this,n),this.queue=t,this.tree=new xs(e),this.segments=[]}return Le(n,[{key:"process",value:function(e){var r=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(r),i;var o=e.isLeft?this.tree.insert(r):this.tree.find(r);if(!o)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,u=void 0,l=void 0;u===void 0;)s=this.tree.prev(s),s===null?u=null:s.key.consumedBy===void 0&&(u=s.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){var c=null;if(u){var f=u.getIntersection(r);if(f!==null&&(r.isAnEndpoint(f)||(c=f),!u.isAnEndpoint(f)))for(var h=this._splitSafely(u,f),g=0,p=h.length;g<p;g++)i.push(h[g])}var v=null;if(l){var d=l.getIntersection(r);if(d!==null&&(r.isAnEndpoint(d)||(v=d),!l.isAnEndpoint(d)))for(var y=this._splitSafely(l,d),I=0,C=y.length;I<C;I++)i.push(y[I])}if(c!==null||v!==null){var N=null;if(c===null)N=v;else if(v===null)N=c;else{var L=Xr.comparePoints(c,v);N=L<=0?c:v}this.queue.remove(r.rightSE),i.push(r.rightSE);for(var T=r.split(N),O=0,D=T.length;O<D;O++)i.push(T[O])}i.length>0?(this.tree.remove(r),i.push(e)):(this.segments.push(r),r.prev=u)}else{if(u&&l){var b=u.getIntersection(l);if(b!==null){if(!u.isAnEndpoint(b))for(var A=this._splitSafely(u,b),Y=0,G=A.length;Y<G;Y++)i.push(A[Y]);if(!l.isAnEndpoint(b))for(var ut=this._splitSafely(l,b),x=0,B=ut.length;x<B;x++)i.push(ut[x])}}this.tree.remove(r)}return i}},{key:"_splitSafely",value:function(e,r){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(r);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),n}(),Qa=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Yc=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Wc=function(){function n(){ar(this,n)}return Le(n,[{key:"run",value:function(e,r,i){Or.type=e,eo.reset();for(var o=[new ja(r,!0)],s=0,a=i.length;s<a;s++)o.push(new ja(i[s],!1));if(Or.numMultiPolys=o.length,Or.type==="difference")for(var u=o[0],l=1;l<o.length;)Ps(o[l].bbox,u.bbox)!==null?l++:o.splice(l,1);if(Or.type==="intersection"){for(var c=0,f=o.length;c<f;c++)for(var h=o[c],g=c+1,p=o.length;g<p;g++)if(Ps(h.bbox,o[g].bbox)===null)return[]}for(var v=new xs(Xr.compare),d=0,y=o.length;d<y;d++)for(var I=o[d].getSweepEvents(),C=0,N=I.length;C<N;C++)if(v.insert(I[C]),v.size>Qa)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var L=new Xc(v),T=v.size,O=v.pop();O;){var D=O.key;if(v.size===T){var b=D.segment;throw new Error("Unable to pop() ".concat(D.isLeft?"left":"right"," SweepEvent ")+"[".concat(D.point.x,", ").concat(D.point.y,"] from segment #").concat(b.id," ")+"[".concat(b.leftSE.point.x,", ").concat(b.leftSE.point.y,"] -> ")+"[".concat(b.rightSE.point.x,", ").concat(b.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(v.size>Qa)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(L.segments.length>Yc)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var A=L.process(D),Y=0,G=A.length;Y<G;Y++){var ut=A[Y];ut.consumedBy===void 0&&v.insert(ut)}T=v.size,O=v.pop()}eo.reset();var x=Uc.factory(L.segments),B=new qc(x);return B.getGeom()}}]),n}(),Or=new Wc,Hc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("union",t,r)},jc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("intersection",t,r)},Kc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("xor",t,r)},Qc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("difference",t,r)},Za={union:Hc,intersection:jc,xor:Kc,difference:Qc},be=63710088e-1,Ja={centimeters:be*100,centimetres:be*100,degrees:be/111325,feet:be*3.28084,inches:be*39.37,kilometers:be/1e3,kilometres:be/1e3,meters:be,metres:be,miles:be/1609.344,millimeters:be*1e3,millimetres:be*1e3,nauticalmiles:be/1852,radians:1,yards:be*1.0936};function Fo(n,t,e){e===void 0&&(e={});var r={type:"Feature"};return(e.id===0||e.id)&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.properties=t||{},r.geometry=n,r}function Zc(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!eu(n[0])||!eu(n[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:n};return Fo(r,t,e)}function $a(n,t,e){e===void 0&&(e={});for(var r=0,i=n;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:n};return Fo(a,t,e)}function Rs(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}function tu(n,t,e){e===void 0&&(e={});var r={type:"MultiPolygon",coordinates:n};return Fo(r,t,e)}function Jc(n,t){var e=Ja[t];return n*e}function $c(n,t){t===void 0&&(t="kilometers");var e=Ja[t];if(!e)throw new Error(t+" units is invalid");return n/e}function eu(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function ko(n){return n.type==="Feature"?n.geometry:n}function tf(n,t,e){e===void 0&&(e={});var r=ko(n),i=ko(t),o=Za.union(r.coordinates,i.coordinates);return o.length===0?null:o.length===1?$a(o[0],e.properties):tu(o,e.properties)}function ru(n,t,e){if(n!==null)for(var r,i,o,s,a,u,l,c=0,f=0,h,g=n.type,p=g==="FeatureCollection",v=g==="Feature",d=p?n.features.length:1,y=0;y<d;y++){l=p?n.features[y].geometry:v?n.geometry:n,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var I=0;I<a;I++){var C=0,N=0;if(s=h?l.geometries[I]:l,s!==null){u=s.coordinates;var L=s.type;switch(c=0,L){case null:break;case"Point":if(t(u,f,y,C,N)===!1)return!1;f++,C++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(t(u[r],f,y,C,N)===!1)return!1;f++,L==="MultiPoint"&&C++}L==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-c;i++){if(t(u[r][i],f,y,C,N)===!1)return!1;f++}L==="MultiLineString"&&C++,L==="Polygon"&&N++}L==="Polygon"&&C++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(N=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-c;o++){if(t(u[r][i][o],f,y,C,N)===!1)return!1;f++}N++}C++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(ru(s.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function nu(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function iu(n,t){var e,r,i,o,s,a,u,l,c,f,h=0,g=n.type==="FeatureCollection",p=n.type==="Feature",v=g?n.features.length:1;for(e=0;e<v;e++){for(a=g?n.features[e].geometry:p?n.geometry:n,l=g?n.features[e].properties:p?n.properties:{},c=g?n.features[e].bbox:p?n.bbox:void 0,f=g?n.features[e].id:p?n.id:void 0,u=a?a.type==="GeometryCollection":!1,s=u?a.geometries.length:1,i=0;i<s;i++){if(o=u?a.geometries[i]:a,o===null){if(t(null,h,l,c,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,h,l,c,f)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<o.geometries.length;r++)if(t(o.geometries[r],h,l,c,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Ts(n){var t=[1/0,1/0,-1/0,-1/0];return ru(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Ts.default=Ts;function ef(n,t){t===void 0&&(t={});var e=Ts(n),r=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return Zc([r,i],t.properties,t)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),r=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(o=o<0?Math.max(r+arguments[2],0):Math.min(o,r);i<o;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!==n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var Zn=function(){};Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.prototype.equalsWithTolerance=function(t,e,r){return Math.abs(t-e)<=r};var pt=function(n){function t(e){n.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),U=function(){},ou={MAX_VALUE:{configurable:!0}};U.isNaN=function(t){return Number.isNaN(t)},U.doubleToLongBits=function(t){return t},U.longBitsToDouble=function(t){return t},U.isInfinite=function(t){return!Number.isFinite(t)},ou.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(U,ou);var Fe=function(){},Bo=function(){},Ei=function(){};function ke(){}var m=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Jn={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};m.prototype.setOrdinate=function(t,e){switch(t){case m.X:this.x=e;break;case m.Y:this.y=e;break;case m.Z:this.z=e;break;default:throw new pt("Invalid ordinate index: "+t)}},m.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return!(!Zn.equalsWithTolerance(this.x,e.x,r)||!Zn.equalsWithTolerance(this.y,e.y,r))}},m.prototype.getOrdinate=function(t){switch(t){case m.X:return this.x;case m.Y:return this.y;case m.Z:return this.z}throw new pt("Invalid ordinate index: "+t)},m.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||U.isNaN(this.z))&&U.isNaN(t.z)},m.prototype.equals=function(t){return t instanceof m?this.equals2D(t):!1},m.prototype.equalInZ=function(t,e){return Zn.equalsWithTolerance(this.z,t.z,e)},m.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},m.prototype.clone=function(){},m.prototype.copy=function(){return new m(this)},m.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},m.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+r*r+i*i)},m.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},m.prototype.hashCode=function(){var t=17;return t=37*t+m.hashCode(this.x),t=37*t+m.hashCode(this.y),t},m.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},m.prototype.interfaces_=function(){return[Fe,Bo,ke]},m.prototype.getClass=function(){return m},m.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=U.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Jn.DimensionalComparator.get=function(){return hn},Jn.serialVersionUID.get=function(){return 6683108902428367e3},Jn.NULL_ORDINATE.get=function(){return U.NaN},Jn.X.get=function(){return 0},Jn.Y.get=function(){return 1},Jn.Z.get=function(){return 2},Object.defineProperties(m,Jn);var hn=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new pt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};hn.prototype.compare=function(t,e){var r=t,i=e,o=hn.compare(r.x,i.x);if(o!==0)return o;var s=hn.compare(r.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=hn.compare(r.z,i.z);return a},hn.prototype.interfaces_=function(){return[Ei]},hn.prototype.getClass=function(){return hn},hn.compare=function(t,e){return t<e?-1:t>e?1:U.isNaN(t)?U.isNaN(e)?0:-1:U.isNaN(e)?1:0};var Ci=function(){};Ci.prototype.create=function(){},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var _=function(){},no={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.toLocationSymbol=function(t){switch(t){case _.EXTERIOR:return"e";case _.BOUNDARY:return"b";case _.INTERIOR:return"i";case _.NONE:return"-"}throw new pt("Unknown location value: "+t)},no.INTERIOR.get=function(){return 0},no.BOUNDARY.get=function(){return 1},no.EXTERIOR.get=function(){return 2},no.NONE.get=function(){return-1},Object.defineProperties(_,no);var V=function(n,t){return n.interfaces_&&n.interfaces_().indexOf(t)>-1},we=function(){},su={LOG_10:{configurable:!0}};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.log10=function(t){var e=Math.log(t);return U.isInfinite(e)||U.isNaN(e)?e:e/we.LOG_10},we.min=function(t,e,r,i){var o=t;return e<o&&(o=e),r<o&&(o=r),i<o&&(o=i),o},we.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],r=arguments[2];return t<e?e:t>r?r:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],s=arguments[2];return i<o?o:i>s?s:i}},we.wrap=function(t,e){return t<0?e- -t%e:t%e},we.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2],i=t;return e>i&&(i=e),r>i&&(i=r),i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=o;return s>l&&(l=s),a>l&&(l=a),u>l&&(l=u),l}},we.average=function(t,e){return(t+e)/2},su.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(we,su);var ur=function(t){this.str=t};ur.prototype.append=function(t){this.str+=t},ur.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},ur.prototype.toString=function(t){return this.str};var lr=function(t){this.value=t};lr.prototype.intValue=function(){return this.value},lr.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},lr.isNaN=function(t){return Number.isNaN(t)};var io=function(){};io.isWhitespace=function(t){return t<=32&&t>=0||t===127},io.toUpperCase=function(t){return t.toUpperCase()};var E=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},We={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};E.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},E.prototype.extractSignificantDigits=function(t,e){var r=this.abs(),i=E.magnitude(r._hi),o=E.TEN.pow(i);r=r.divide(o),r.gt(E.TEN)?(r=r.divide(E.TEN),i+=1):r.lt(E.ONE)&&(r=r.multiply(E.TEN),i-=1);for(var s=i+1,a=new ur,u=E.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var c=Math.trunc(r._hi);if(c<0)break;var f=!1,h=0;c>9?(f=!0,h="9"):h="0"+c,a.append(h),r=r.subtract(E.valueOf(c)).multiply(E.TEN),f&&r.selfAdd(E.TEN);var g=!0,p=E.magnitude(r._hi);if(p<0&&Math.abs(p)>=u-l&&(g=!1),!g)break}return e[0]=i,a.toString()},E.prototype.sqr=function(){return this.multiply(this)},E.prototype.doubleValue=function(){return this._hi+this._lo},E.prototype.subtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},E.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},E.prototype.isZero=function(){return this._hi===0&&this._lo===0},E.prototype.selfSubtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},E.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},E.prototype.min=function(t){return this.le(t)?this:t},E.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null,f=null,h=null;return l=this._hi/r,c=E.SPLIT*l,o=c-l,h=E.SPLIT*r,o=c-o,s=l-o,a=h-r,f=l*r,a=h-a,u=r-a,h=o*a-f+o*u+s*a+s*u,c=(this._hi-f-h+this._lo-l*i)/r,h=l+c,this._hi=h,this._lo=l-h+c,this}},E.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},E.prototype.divide=function(){if(arguments[0]instanceof E){var t=arguments[0],e=null,r=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this._hi/t._hi,a=E.SPLIT*s,e=a-s,l=E.SPLIT*t._hi,e=a-e,r=s-e,i=l-t._hi,u=s*t._hi,i=l-i,o=t._hi-i,l=e*i-u+e*o+r*i+r*o,a=(this._hi-u-l+this._lo-s*t._lo)/t._hi,l=s+a;var c=l,f=s-l+a;return new E(c,f)}else if(typeof arguments[0]=="number"){var h=arguments[0];return U.isNaN(h)?E.createNaN():E.copy(this).selfDivide(h,0)}},E.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},E.prototype.pow=function(t){if(t===0)return E.valueOf(1);var e=new E(this),r=E.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},E.prototype.ceil=function(){if(this.isNaN())return E.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new E(t,e)},E.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},E.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},E.prototype.setValue=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},E.prototype.max=function(t){return this.ge(t)?this:t},E.prototype.sqrt=function(){if(this.isZero())return E.valueOf(0);if(this.isNegative())return E.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=E.valueOf(e),i=this.subtract(r.sqr()),o=i._hi*(t*.5);return r.add(o)},E.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],r=null,i=null,o=null,s=null,a=null,u=null;return o=this._hi+e,a=o-this._hi,s=o-a,s=e-a+(this._hi-s),u=s+this._lo,r=o+u,i=u+(o-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],f=null,h=null,g=null,p=null,v=null,d=null,y=null,I=null;v=this._hi+l,g=this._lo+c,y=v-this._hi,I=g-this._lo,d=v-y,p=g-I,d=l-y+(this._hi-d),p=c-I+(this._lo-p),y=d+g,f=v+y,h=y+(v-f),y=p+h;var C=f+y,N=y+(f-C);return this._hi=C,this._lo=N,this}},E.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null;l=E.SPLIT*this._hi,o=l-this._hi,c=E.SPLIT*r,o=l-o,s=this._hi-o,a=c-r,l=this._hi*r,a=c-a,u=r-a,c=o*a-l+o*u+s*a+s*u+(this._hi*i+this._lo*r);var f=l+c;o=l-f;var h=c+o;return this._hi=f,this._lo=h,this}},E.prototype.selfSqr=function(){return this.selfMultiply(this)},E.prototype.floor=function(){if(this.isNaN())return E.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new E(t,e)},E.prototype.negate=function(){return this.isNaN()?this:new E(-this._hi,-this._lo)},E.prototype.clone=function(){},E.prototype.multiply=function(){if(arguments[0]instanceof E){var t=arguments[0];return t.isNaN()?E.createNaN():E.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return U.isNaN(e)?E.createNaN():E.copy(this).selfMultiply(e,0)}},E.prototype.isNaN=function(){return U.isNaN(this._hi)},E.prototype.intValue=function(){return Math.trunc(this._hi)},E.prototype.toString=function(){var t=E.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},E.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),i=e[0]+1,o=r;if(r.charAt(0)===".")o="0"+r;else if(i<0)o="0."+E.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var s=i-r.length,a=E.stringOfChar("0",s);o=r+a+".0"}return this.isNegative()?"-"+o:o},E.prototype.reciprocal=function(){var t=null,e=null,r=null,i=null,o=null,s=null,a=null,u=null;o=1/this._hi,s=E.SPLIT*o,t=s-o,u=E.SPLIT*this._hi,t=s-t,e=o-t,r=u-this._hi,a=o*this._hi,r=u-r,i=this._hi-r,u=t*r-a+t*i+e*r+e*i,s=(1-a-u-o*this._lo)/this._hi;var l=o+s,c=o-l+s;return new E(l,c)},E.prototype.toSciNotation=function(){if(this.isZero())return E.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),i=E.SCI_NOT_EXPONENT_CHAR+e[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var s=r.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i},E.prototype.abs=function(){return this.isNaN()?E.NaN:this.isNegative()?this.negate():new E(this)},E.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},E.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},E.prototype.add=function(){if(arguments[0]instanceof E){var t=arguments[0];return E.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return E.copy(this).selfAdd(e)}},E.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof E){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}},E.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},E.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},E.prototype.trunc=function(){return this.isNaN()?E.NaN:this.isPositive()?this.floor():this.ceil()},E.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},E.prototype.interfaces_=function(){return[ke,Fe,Bo]},E.prototype.getClass=function(){return E},E.sqr=function(t){return E.valueOf(t).selfMultiply(t)},E.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return E.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new E(e)}},E.sqrt=function(t){return E.valueOf(t).sqrt()},E.parse=function(t){for(var e=0,r=t.length;io.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<r){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var s=new E,a=0,u=0,l=0;!(e>=r);){var c=t.charAt(e);if(e++,io.isDigit(c)){var f=c-"0";s.selfMultiply(E.TEN),s.selfAdd(f),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var h=t.substring(e);try{l=lr.parseInt(h)}catch(y){throw y instanceof Error?new Error("Invalid exponent "+h+" in string "+t):y}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=s,p=a-u-l;if(p===0)g=s;else if(p>0){var v=E.TEN.pow(p);g=s.divide(v)}else if(p<0){var d=E.TEN.pow(-p);g=s.multiply(d)}return i?g.negate():g},E.createNaN=function(){return new E(U.NaN,U.NaN)},E.copy=function(t){return new E(t)},E.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(r)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i},E.stringOfChar=function(t,e){for(var r=new ur,i=0;i<e;i++)r.append(t);return r.toString()},We.PI.get=function(){return new E(3.141592653589793,12246467991473532e-32)},We.TWO_PI.get=function(){return new E(6.283185307179586,24492935982947064e-32)},We.PI_2.get=function(){return new E(1.5707963267948966,6123233995736766e-32)},We.E.get=function(){return new E(2.718281828459045,14456468917292502e-32)},We.NaN.get=function(){return new E(U.NaN,U.NaN)},We.EPS.get=function(){return 123259516440783e-46},We.SPLIT.get=function(){return 134217729},We.MAX_PRINT_DIGITS.get=function(){return 32},We.TEN.get=function(){return E.valueOf(10)},We.ONE.get=function(){return E.valueOf(1)},We.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},We.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(E,We);var pe=function(){},au={DP_SAFE_EPSILON:{configurable:!0}};pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.orientationIndex=function(t,e,r){var i=pe.orientationIndexFilter(t,e,r);if(i<=1)return i;var o=E.valueOf(e.x).selfAdd(-t.x),s=E.valueOf(e.y).selfAdd(-t.y),a=E.valueOf(r.x).selfAdd(-e.x),u=E.valueOf(r.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()},pe.signOfDet2x2=function(t,e,r,i){var o=t.multiply(i).selfSubtract(e.multiply(r));return o.signum()},pe.intersection=function(t,e,r,i){var o=E.valueOf(i.y).selfSubtract(r.y).selfMultiply(E.valueOf(e.x).selfSubtract(t.x)),s=E.valueOf(i.x).selfSubtract(r.x).selfMultiply(E.valueOf(e.y).selfSubtract(t.y)),a=o.subtract(s),u=E.valueOf(i.x).selfSubtract(r.x).selfMultiply(E.valueOf(t.y).selfSubtract(r.y)),l=E.valueOf(i.y).selfSubtract(r.y).selfMultiply(E.valueOf(t.x).selfSubtract(r.x)),c=u.subtract(l),f=c.selfDivide(a).doubleValue(),h=E.valueOf(t.x).selfAdd(E.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),g=E.valueOf(e.x).selfSubtract(t.x).selfMultiply(E.valueOf(t.y).selfSubtract(r.y)),p=E.valueOf(e.y).selfSubtract(t.y).selfMultiply(E.valueOf(t.x).selfSubtract(r.x)),v=g.subtract(p),d=v.selfDivide(a).doubleValue(),y=E.valueOf(r.y).selfAdd(E.valueOf(i.y).selfSubtract(r.y).selfMultiply(d)).doubleValue();return new m(h,y)},pe.orientationIndexFilter=function(t,e,r){var i=null,o=(t.x-r.x)*(e.y-r.y),s=(t.y-r.y)*(e.x-r.x),a=o-s;if(o>0){if(s<=0)return pe.signum(a);i=o+s}else if(o<0){if(s>=0)return pe.signum(a);i=-o-s}else return pe.signum(a);var u=pe.DP_SAFE_EPSILON*i;return a>=u||-a>=u?pe.signum(a):2},pe.signum=function(t){return t>0?1:t<0?-1:0},au.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(pe,au);var K=function(){},oo={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};oo.X.get=function(){return 0},oo.Y.get=function(){return 1},oo.Z.get=function(){return 2},oo.M.get=function(){return 3},K.prototype.setOrdinate=function(t,e,r){},K.prototype.size=function(){},K.prototype.getOrdinate=function(t,e){},K.prototype.getCoordinate=function(){},K.prototype.getCoordinateCopy=function(t){},K.prototype.getDimension=function(){},K.prototype.getX=function(t){},K.prototype.clone=function(){},K.prototype.expandEnvelope=function(t){},K.prototype.copy=function(){},K.prototype.getY=function(t){},K.prototype.toCoordinateArray=function(){},K.prototype.interfaces_=function(){return[Bo]},K.prototype.getClass=function(){return K},Object.defineProperties(K,oo);var uu=function(){},Ii=function(n){function t(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(uu),Ut=function(){};Ut.arraycopy=function(t,e,r,i,o){for(var s=0,a=e;a<e+o;a++)r[i+s]=t[a],s++},Ut.getProperty=function(t){return{"line.separator":`
23
- `}[t]};var He=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],r=arguments[1];this.x=e,this.y=r,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){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 m&&arguments[1]instanceof m){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var f=arguments[0],h=arguments[1],g=arguments[2],p=arguments[3],v=f.y-h.y,d=h.x-f.x,y=f.x*h.y-h.x*f.y,I=g.y-p.y,C=p.x-g.x,N=g.x*p.y-p.x*g.y;this.x=d*N-C*y,this.y=I*y-v*N,this.w=v*C-I*d}};He.prototype.getY=function(){var t=this.y/this.w;if(U.isNaN(t)||U.isInfinite(t))throw new Ii;return t},He.prototype.getX=function(){var t=this.x/this.w;if(U.isNaN(t)||U.isInfinite(t))throw new Ii;return t},He.prototype.getCoordinate=function(){var t=new m;return t.x=this.getX(),t.y=this.getY(),t},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He},He.intersection=function(t,e,r,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=r.y-i.y,l=i.x-r.x,c=r.x*i.y-i.x*r.y,f=s*c-l*a,h=u*a-o*c,g=o*l-u*s,p=f/g,v=h/g;if(U.isNaN(p)||U.isInfinite(p)||U.isNaN(v)||U.isInfinite(v))throw new Ii;return new m(p,v)};var F=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof n){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},lu={serialVersionUID:{configurable:!0}};F.prototype.getArea=function(){return this.getWidth()*this.getHeight()},F.prototype.equals=function(t){if(!(t instanceof F))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},F.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new F;var e=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new F(e,i,r,o)},F.prototype.isNull=function(){return this._maxx<this._minx},F.prototype.getMaxX=function(){return this._maxx},F.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}},F.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof F){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof m){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}},F.prototype.getMinY=function(){return this._miny},F.prototype.getMinX=function(){return this._minx},F.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},F.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},F.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},F.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},F.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},F.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},F.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},F.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},F.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},F.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},F.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof F){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof m){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}},F.prototype.centre=function(){return this.isNull()?null:new m((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},F.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},F.prototype.getMaxY=function(){return this._maxy},F.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxy<t._miny?r=t._miny-this._maxy:this._miny>t._maxy&&(r=this._miny-t._maxy),e===0?r:r===0?e:Math.sqrt(e*e+r*r)},F.prototype.hashCode=function(){var t=17;return t=37*t+m.hashCode(this._minx),t=37*t+m.hashCode(this._maxx),t=37*t+m.hashCode(this._miny),t=37*t+m.hashCode(this._maxy),t},F.prototype.interfaces_=function(){return[Fe,ke]},F.prototype.getClass=function(){return F},F.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.x<e.x?t.x:e.x)&&r.x<=(t.x>e.x?t.x:e.x)&&r.y>=(t.y<e.y?t.y:e.y)&&r.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=Math.min(s.x,a.x),l=Math.max(s.x,a.x),c=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(c>l||f<u||(u=Math.min(s.y,a.y),l=Math.max(s.y,a.y),c=Math.min(i.y,o.y),f=Math.max(i.y,o.y),c>l)||f<u)}},lu.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(F,lu);var cr={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Go=function(t){this.geometryFactory=t||new H};Go.prototype.read=function(t){var e,r,i;t=t.replace(/[\n\r]/g," ");var o=cr.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=cr.emptyTypeStr.exec(t),o[2]=void 0),o&&(r=o[1].toLowerCase(),i=o[2],Ni[r]&&(e=Ni[r].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Go.prototype.write=function(t){return this.extractGeometry(t)},Go.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Yr[e])return null;var r=e.toUpperCase(),i;return t.isEmpty()?i=r+" EMPTY":i=r+"("+Yr[e].apply(this,[t])+")",i};var Yr={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Yr.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Yr.point.apply(e,[t._geometries[i]])+")");return r.join(",")},linestring:function(t){for(var e=this,r=[],i=0,o=t._points._coordinates.length;i<o;++i)r.push(Yr.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},linearring:function(t){for(var e=this,r=[],i=0,o=t._points._coordinates.length;i<o;++i)r.push(Yr.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},multilinestring:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Yr.linestring.apply(e,[t._geometries[i]])+")");return r.join(",")},polygon:function(t){var e=this,r=[];r.push("("+Yr.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)r.push("("+Yr.linestring.apply(e,[t._holes[i]])+")");return r.join(",")},multipolygon:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Yr.polygon.apply(e,[t._geometries[i]])+")");return r.join(",")},geometrycollection:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push(e.extractGeometry(t._geometries[i]));return r.join(",")}},Ni={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(cr.spaces);return this.geometryFactory.createPoint(new m(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var r,i=t.trim().split(","),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(cr.trimParens,"$1"),o.push(Ni.point.apply(e,[r]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),r=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(cr.spaces),r.push(new m(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),r=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(cr.spaces),r.push(new m(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=t.trim().split(cr.parenComma),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(cr.trimParens,"$1"),o.push(Ni.linestring.apply(e,[r]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var r,i,o,s=t.trim().split(cr.parenComma),a,u=[],l=0,c=s.length;l<c;++l)r=s[l].replace(cr.trimParens,"$1"),i=Ni.linestring.apply(e,[r]),o=e.geometryFactory.createLinearRing(i._points),l===0?a=o:u.push(o);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=t.trim().split(cr.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(cr.trimParens,"$1"),o.push(Ni.polygon.apply(e,[r]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var r=t.trim().split("|"),i=[],o=0,s=r.length;o<s;++o)i.push(e.read(r[o]));return this.geometryFactory.createGeometryCollection(i)}},je=function(t){this.parser=new Go(t)};je.prototype.write=function(t){return this.parser.write(t)},je.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Wr=function(n){function t(e){n.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),zo=function(n){function t(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var e=arguments[0];n.call(this,e)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Wr),X=function(){};X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.shouldNeverReachHere=function(){if(arguments.length===0)X.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new zo("Should never reach here"+(t!==null?": "+t:""))}},X.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],X.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new zo:new zo(e)},X.equals=function(){var t,e,r;if(arguments.length===2)t=arguments[0],e=arguments[1],X.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],r=arguments[2],!e.equals(t)))throw new zo("Expected "+t+" but encountered "+e+(r!==null?": "+r:""))};var dt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new m,this._intPt[1]=new m,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},$n={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};dt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},dt.prototype.getTopologySummary=function(){var t=new ur;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},dt.prototype.computeIntersection=function(t,e,r,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,r,i)},dt.prototype.getIntersectionNum=function(){return this._result},dt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),r=this.getEdgeDistance(t,1);e>r?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},dt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},dt.prototype.setPrecisionModel=function(t){this._precisionModel=t},dt.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],r=0;r<this._result;r++)if(!(t._intPt[r].equals2D(t._inputLines[e][0])||t._intPt[r].equals2D(t._inputLines[e][1])))return!0;return!1}},dt.prototype.getIntersection=function(t){return this._intPt[t]},dt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},dt.prototype.hasIntersection=function(){return this._result!==dt.NO_INTERSECTION},dt.prototype.getEdgeDistance=function(t,e){var r=dt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return r},dt.prototype.isCollinear=function(){return this._result===dt.COLLINEAR_INTERSECTION},dt.prototype.toString=function(){return je.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+je.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},dt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},dt.prototype.isIntersection=function(t){for(var e=this,r=0;r<this._result;r++)if(e._intPt[r].equals2D(t))return!0;return!1},dt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},dt.computeEdgeDistance=function(t,e,r){var i=Math.abs(r.x-e.x),o=Math.abs(r.y-e.y),s=-1;if(t.equals(e))s=0;else if(t.equals(r))i>o?s=i:s=o;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?s=a:s=u,s===0&&!t.equals(e)&&(s=Math.max(a,u))}return X.isTrue(!(s===0&&!t.equals(e)),"Bad distance calculation"),s},dt.nonRobustComputeEdgeDistance=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o);return X.isTrue(!(s===0&&!t.equals(e)),"Invalid distance calculation"),s},$n.DONT_INTERSECT.get=function(){return 0},$n.DO_INTERSECT.get=function(){return 1},$n.COLLINEAR.get=function(){return 2},$n.NO_INTERSECTION.get=function(){return 0},$n.POINT_INTERSECTION.get=function(){return 1},$n.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(dt,$n);var Dn=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(r){var i=new F(this._inputLines[0][0],this._inputLines[0][1]),o=new F(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&o.contains(r)},t.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,F.intersects(i,o,r)&&M.orientationIndex(i,o,r)===0&&M.orientationIndex(o,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(o))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION}else return n.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(r,i,o,s,a){a.x=this.smallestInAbsValue(r.x,i.x,o.x,s.x),a.y=this.smallestInAbsValue(r.y,i.y,o.y,s.y),r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.safeHCoordinateIntersection=function(r,i,o,s){var a=null;try{a=He.intersection(r,i,o,s)}catch(u){if(u instanceof Ii)a=t.nearestEndpoint(r,i,o,s);else throw u}finally{}return a},t.prototype.intersection=function(r,i,o,s){var a=this.intersectionWithNormalization(r,i,o,s);return this.isInSegmentEnvelopes(a)||(a=new m(t.nearestEndpoint(r,i,o,s))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(r,i,o,s){var a=r,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(o)<u&&(a=o,u=Math.abs(o)),Math.abs(s)<u&&(a=s),a},t.prototype.checkDD=function(r,i,o,s,a){var u=pe.intersection(r,i,o,s),l=this.isInSegmentEnvelopes(u);Ut.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Ut.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(r,i,o,s){var a=new m(r),u=new m(i),l=new m(o),c=new m(s),f=new m;this.normalizeToEnvCentre(a,u,l,c,f);var h=this.safeHCoordinateIntersection(a,u,l,c);return h.x+=f.x,h.y+=f.y,h},t.prototype.computeCollinearIntersection=function(r,i,o,s){var a=F.intersects(r,i,o),u=F.intersects(r,i,s),l=F.intersects(o,s,r),c=F.intersects(o,s,i);return a&&u?(this._intPt[0]=o,this._intPt[1]=s,n.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=r,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!u&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!a&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!a&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(r,i,o,s,a){var u=r.x<i.x?r.x:i.x,l=r.y<i.y?r.y:i.y,c=r.x>i.x?r.x:i.x,f=r.y>i.y?r.y:i.y,h=o.x<s.x?o.x:s.x,g=o.y<s.y?o.y:s.y,p=o.x>s.x?o.x:s.x,v=o.y>s.y?o.y:s.y,d=u>h?u:h,y=c<p?c:p,I=l>g?l:g,C=f<v?f:v,N=(d+y)/2,L=(I+C)/2;a.x=N,a.y=L,r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.computeIntersect=function(r,i,o,s){if(this._isProper=!1,!F.intersects(r,i,o,s))return n.NO_INTERSECTION;var a=M.orientationIndex(r,i,o),u=M.orientationIndex(r,i,s);if(a>0&&u>0||a<0&&u<0)return n.NO_INTERSECTION;var l=M.orientationIndex(o,s,r),c=M.orientationIndex(o,s,i);if(l>0&&c>0||l<0&&c<0)return n.NO_INTERSECTION;var f=a===0&&u===0&&l===0&&c===0;return f?this.computeCollinearIntersection(r,i,o,s):(a===0||u===0||l===0||c===0?(this._isProper=!1,r.equals2D(o)||r.equals2D(s)?this._intPt[0]=r:i.equals2D(o)||i.equals2D(s)?this._intPt[0]=i:a===0?this._intPt[0]=new m(o):u===0?this._intPt[0]=new m(s):l===0?this._intPt[0]=new m(r):c===0&&(this._intPt[0]=new m(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,o,s)),n.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(r,i,o,s){var a=r,u=M.distancePointLine(r,o,s),l=M.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=M.distancePointLine(o,r,i),l<u&&(u=l,a=o),l=M.distancePointLine(s,r,i),l<u&&(u=l,a=s),a},t}(dt),ti=function(){};ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.orientationIndex=function(t,e,r){var i=e.x-t.x,o=e.y-t.y,s=r.x-e.x,a=r.y-e.y;return ti.signOfDet2x2(i,o,s,a)},ti.signOfDet2x2=function(t,e,r,i){var o=null,s=null,a=null;if(o=1,t===0||i===0)return e===0||r===0?0:e>0?r>0?-o:o:r>0?o:-o;if(e===0||r===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,s=t,t=r,r=s,s=e,e=i,i=s):e<=-i?(o=-o,r=-r,i=-i):(s=t,t=-r,r=s,s=e,e=-i,i=s):i>0?-e<=i?(o=-o,t=-t,e=-e):(s=-t,t=r,r=s,s=-e,e=i,i=s):e>=i?(t=-t,e=-e,r=-r,i=-i):(o=-o,s=-t,t=-r,r=s,s=-e,e=-i,i=s),t>0)if(r>0){if(!(t<=r))return o}else return o;else{if(r>0)return-o;if(t>=r)o=-o,t=-t,r=-r;else return-o}for(;;){if(a=Math.floor(r/t),r=r-a*t,i=i-a*e,i<0)return-o;if(i>e)return o;if(t>r+r){if(e<i+i)return o}else{if(e>i+i)return-o;r=t-r,i=e-i,o=-o}if(i===0)return r===0?0:-o;if(r===0||(a=Math.floor(t/r),t=t-a*r,e=e-a*i,e<0))return o;if(e>i)return-o;if(r>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=r-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var fr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};fr.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var r=t.x,i=e.x;return r>i&&(r=e.x,i=t.x),this._p.x>=r&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var o=t.x-this._p.x,s=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=ti.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}},fr.prototype.isPointInPolygon=function(){return this.getLocation()!==_.EXTERIOR},fr.prototype.getLocation=function(){return this._isPointOnSegment?_.BOUNDARY:this._crossingCount%2===1?_.INTERIOR:_.EXTERIOR},fr.prototype.isOnSegment=function(){return this._isPointOnSegment},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr},fr.locatePointInRing=function(){if(arguments[0]instanceof m&&V(arguments[1],K)){for(var t=arguments[0],e=arguments[1],r=new fr(t),i=new m,o=new m,s=1;s<e.size();s++)if(e.getCoordinate(s,i),e.getCoordinate(s-1,o),r.countSegment(i,o),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof m&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new fr(a),c=1;c<u.length;c++){var f=u[c],h=u[c-1];if(l.countSegment(f,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var M=function(){},ei={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.orientationIndex=function(t,e,r){return pe.orientationIndex(t,e,r)},M.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,r=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-r,s=t[i+1].y,a=t[i-1].y;e+=o*(a-s)}return e/2}else if(V(arguments[0],K)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new m,f=new m,h=new m;u.getCoordinate(0,f),u.getCoordinate(1,h);var g=f.x;h.x-=g;for(var p=0,v=1;v<l-1;v++)c.y=f.y,f.x=h.x,f.y=h.y,u.getCoordinate(v+1,h),h.x-=g,p+=f.x*(c.y-h.y);return p/2}},M.distanceLineLine=function(t,e,r,i){if(t.equals(e))return M.distancePointLine(t,r,i);if(r.equals(i))return M.distancePointLine(i,t,e);var o=!1;if(!F.intersects(t,e,r,i))o=!0;else{var s=(e.x-t.x)*(i.y-r.y)-(e.y-t.y)*(i.x-r.x);if(s===0)o=!0;else{var a=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y),l=u/s,c=a/s;(c<0||c>1||l<0||l>1)&&(o=!0)}}return o?we.min(M.distancePointLine(t,r,i),M.distancePointLine(e,r,i),M.distancePointLine(r,t,e),M.distancePointLine(i,t,e)):0},M.isPointInRing=function(t,e){return M.locatePointInRing(t,e)!==_.EXTERIOR},M.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,i=new m;t.getCoordinate(0,i);for(var o=i.x,s=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-o,f=l-s;r+=Math.sqrt(c*c+f*f),o=u,s=l}return r},M.isCCW=function(t){var e=t.length-1;if(e<3)throw new pt("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>r.y&&(r=s,i=o)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(r)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(r)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(r)||c.equals2D(r)||l.equals2D(c))return!1;var f=M.computeOrientation(l,r,c),h=!1;return f===0?h=l.x>c.x:h=f>0,h},M.locatePointInRing=function(t,e){return fr.locatePointInRing(t,e)},M.distancePointLinePerpendicular=function(t,e,r){var i=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),o=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)},M.computeOrientation=function(t,e,r){return M.orientationIndex(t,e,r)},M.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new pt("Line array must contain at least one vertex");for(var r=t.distance(e[0]),i=0;i<e.length-1;i++){var o=M.distancePointLine(t,e[i],e[i+1]);o<r&&(r=o)}return r}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var f=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(f)*Math.sqrt(l)}},M.isOnLine=function(t,e){for(var r=new Dn,i=1;i<e.length;i++){var o=e[i-1],s=e[i];if(r.computeIntersection(t,o,s),r.hasIntersection())return!0}return!1},ei.CLOCKWISE.get=function(){return-1},ei.RIGHT.get=function(){return M.CLOCKWISE},ei.COUNTERCLOCKWISE.get=function(){return 1},ei.LEFT.get=function(){return M.COUNTERCLOCKWISE},ei.COLLINEAR.get=function(){return 0},ei.STRAIGHT.get=function(){return M.COLLINEAR},Object.defineProperties(M,ei);var Hr=function(){};Hr.prototype.filter=function(t){},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var z=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Rr={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};z.prototype.isGeometryCollection=function(){return this.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION},z.prototype.getFactory=function(){return this._factory},z.prototype.getGeometryN=function(t){return this},z.prototype.getArea=function(){return 0},z.prototype.isRectangle=function(){return!1},z.prototype.equals=function(){if(arguments[0]instanceof z){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof z))return!1;var r=e;return this.equalsExact(r)}},z.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},z.prototype.geometryChanged=function(){this.apply(z.geometryChangedFilter)},z.prototype.geometryChangedAction=function(){this._envelope=null},z.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},z.prototype.getLength=function(){return 0},z.prototype.getNumGeometries=function(){return 1},z.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}},z.prototype.getUserData=function(){return this._userData},z.prototype.getSRID=function(){return this._SRID},z.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},z.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION)throw new pt("This method does not support GeometryCollection arguments")},z.prototype.equal=function(t,e,r){return r===0?t.equals(e):t.distance(e)<=r},z.prototype.norm=function(){var t=this.copy();return t.normalize(),t},z.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},z.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new F(this._envelope)},z.prototype.setSRID=function(t){this._SRID=t},z.prototype.setUserData=function(t){this._userData=t},z.prototype.compare=function(t,e){for(var r=t.iterator(),i=e.iterator();r.hasNext()&&i.hasNext();){var o=r.next(),s=i.next(),a=o.compareTo(s);if(a!==0)return a}return r.hasNext()?1:i.hasNext()?-1:0},z.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},z.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===z.SORTINDEX_MULTIPOINT||this.getSortIndex()===z.SORTINDEX_MULTILINESTRING||this.getSortIndex()===z.SORTINDEX_MULTIPOLYGON},z.prototype.interfaces_=function(){return[Bo,Fe,ke]},z.prototype.getClass=function(){return z},z.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},z.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},Rr.serialVersionUID.get=function(){return 8763622679187377e3},Rr.SORTINDEX_POINT.get=function(){return 0},Rr.SORTINDEX_MULTIPOINT.get=function(){return 1},Rr.SORTINDEX_LINESTRING.get=function(){return 2},Rr.SORTINDEX_LINEARRING.get=function(){return 3},Rr.SORTINDEX_MULTILINESTRING.get=function(){return 4},Rr.SORTINDEX_POLYGON.get=function(){return 5},Rr.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Rr.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Rr.geometryChangedFilter.get=function(){return Ds},Object.defineProperties(z,Rr);var Ds=function(){};Ds.interfaces_=function(){return[Hr]},Ds.filter=function(t){t.geometryChangedAction()};var Tr=function(){};Tr.prototype.filter=function(t){},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Be=function(){},jr={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Be.prototype.isInBoundary=function(t){},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},jr.Mod2BoundaryNodeRule.get=function(){return Si},jr.EndPointBoundaryNodeRule.get=function(){return xi},jr.MultiValentEndPointBoundaryNodeRule.get=function(){return Li},jr.MonoValentEndPointBoundaryNodeRule.get=function(){return bi},jr.MOD2_BOUNDARY_RULE.get=function(){return new Si},jr.ENDPOINT_BOUNDARY_RULE.get=function(){return new xi},jr.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Li},jr.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new bi},jr.OGC_SFS_BOUNDARY_RULE.get=function(){return Be.MOD2_BOUNDARY_RULE},Object.defineProperties(Be,jr);var Si=function(){};Si.prototype.isInBoundary=function(t){return t%2===1},Si.prototype.interfaces_=function(){return[Be]},Si.prototype.getClass=function(){return Si};var xi=function(){};xi.prototype.isInBoundary=function(t){return t>0},xi.prototype.interfaces_=function(){return[Be]},xi.prototype.getClass=function(){return xi};var Li=function(){};Li.prototype.isInBoundary=function(t){return t>1},Li.prototype.interfaces_=function(){return[Be]},Li.prototype.getClass=function(){return Li};var bi=function(){};bi.prototype.isInBoundary=function(t){return t===1},bi.prototype.interfaces_=function(){return[Be]},bi.prototype.getClass=function(){return bi};var Dt=function(){};Dt.prototype.add=function(){},Dt.prototype.addAll=function(){},Dt.prototype.isEmpty=function(){},Dt.prototype.iterator=function(){},Dt.prototype.size=function(){},Dt.prototype.toArray=function(){},Dt.prototype.remove=function(){};function Ms(n){this.message=n||""}Ms.prototype=new Error,Ms.prototype.name="IndexOutOfBoundsException";var wi=function(){};wi.prototype.hasNext=function(){},wi.prototype.next=function(){},wi.prototype.remove=function(){};var Ke=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Dt);function Pi(n){this.message=n||""}Pi.prototype=new Error,Pi.prototype.name="NoSuchElementException";var R=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[n,Dt]},t.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(r){for(var i=this,o=r.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(r,i){var o=this.array_[r];return this.array_[r]=i,o},t.prototype.iterator=function(){return new rf(this)},t.prototype.get=function(r){if(r<0||r>=this.size())throw new Ms;return this.array_[r]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var r=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(r.array_[o]);return i},t.prototype.remove=function(r){for(var i=this,o=!1,s=0,a=this.array_.length;s<a;s++)if(i.array_[s]===r){i.array_.splice(s,1),o=!0;break}return o},t}(Ke),rf=function(n){function t(e){n.call(this),this.arrayList_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Pi;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(wi),so=function(n){function t(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=!1,u=o.iterator();u.hasNext();)i.add(u.next(),s),a=!0;return a}else return n.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=n.prototype.clone.call(this),s=0;s<this.size();s++)o.add(s,i.get(s).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];n.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1];return this.add(s,a,!0),!0}else if(arguments[0]instanceof m&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}n.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],h=arguments[1];return this.add(f,h),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],v=arguments[2];if(v)for(var d=0;d<g.length;d++)i.add(g[d],p);else for(var y=g.length-1;y>=0;y--)i.add(g[y],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof m){var I=arguments[0],C=arguments[1],N=arguments[2];if(!N){var L=this.size();if(L>0){if(I>0){var T=this.get(I-1);if(T.equals2D(C))return null}if(I<L){var O=this.get(I);if(O.equals2D(C))return null}}}n.prototype.add.call(this,I,C)}}else if(arguments.length===4){var D=arguments[0],b=arguments[1],A=arguments[2],Y=arguments[3],G=1;A>Y&&(G=-1);for(var ut=A;ut!==Y;ut+=G)i.add(D[ut],b);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new m(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(R),W=function(){},Vo={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Vo.ForwardComparator.get=function(){return ao},Vo.BidirectionalComparator.get=function(){return Oi},Vo.coordArrayType.get=function(){return new Array(0).fill(null)},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W},W.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},W.ptNotInList=function(t,e){for(var r=0;r<t.length;r++){var i=t[r];if(W.indexOf(i,e)<0)return i}return null},W.scroll=function(t,e){var r=W.indexOf(e,t);if(r<0)return null;var i=new Array(t.length).fill(null);Ut.arraycopy(t,r,i,0,t.length-r),Ut.arraycopy(t,0,i,t.length-r,r),Ut.arraycopy(i,0,t,0,t.length)},W.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(e[r]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(s.compare(i[a],o[a])!==0)return!1;return!0}},W.intersection=function(t,e){for(var r=new so,i=0;i<t.length;i++)e.intersects(t[i])&&r.add(t[i],!0);return r.toCoordinateArray()},W.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},W.removeRepeatedPoints=function(t){if(!W.hasRepeatedPoints(t))return t;var e=new so(t,!1);return e.toCoordinateArray()},W.reverse=function(t){for(var e=t.length-1,r=Math.trunc(e/2),i=0;i<=r;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}},W.removeNull=function(t){for(var e=0,r=0;r<t.length;r++)t[r]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,s=0;s<t.length;s++)t[s]!==null&&(i[o++]=t[s]);return i},W.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),r=0;r<t.length;r++)e[r]=new m(t[r]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)s[a+l]=new m(i[o+l])},W.isEqualReversed=function(t,e){for(var r=0;r<t.length;r++){var i=t[r],o=e[t.length-r-1];if(i.compareTo(o)!==0)return!1}return!0},W.envelope=function(t){for(var e=new F,r=0;r<t.length;r++)e.expandToInclude(t[r]);return e},W.toCoordinateArray=function(t){return t.toArray(W.coordArrayType)},W.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},W.indexOf=function(t,e){for(var r=0;r<e.length;r++)if(t.equals(e[r]))return r;return-1},W.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var r=t.length-1-e,i=t[e].compareTo(t[r]);if(i!==0)return i}return 1},W.compare=function(t,e){for(var r=0;r<t.length&&r<e.length;){var i=t[r].compareTo(e[r]);if(i!==0)return i;r++}return r<e.length?-1:r<t.length?1:0},W.minCoordinate=function(t){for(var e=null,r=0;r<t.length;r++)(e===null||e.compareTo(t[r])>0)&&(e=t[r]);return e},W.extract=function(t,e,r){e=we.clamp(e,0,t.length),r=we.clamp(r,-1,t.length);var i=r-e+1;r<0&&(i=0),e>=t.length&&(i=0),r<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var s=0,a=e;a<=r;a++)o[s++]=t[a];return o},Object.defineProperties(W,Vo);var ao=function(){};ao.prototype.compare=function(t,e){var r=t,i=e;return W.compare(r,i)},ao.prototype.interfaces_=function(){return[Ei]},ao.prototype.getClass=function(){return ao};var Oi=function(){};Oi.prototype.compare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var o=W.compare(r,i),s=W.isEqualReversed(r,i);return s?0:o},Oi.prototype.OLDcompare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var o=W.increasingDirection(r),s=W.increasingDirection(i),a=o>0?0:r.length-1,u=s>0?0:r.length-1,l=0;l<r.length;l++){var c=r[a].compareTo(i[u]);if(c!==0)return c;a+=o,u+=s}return 0},Oi.prototype.interfaces_=function(){return[Ei]},Oi.prototype.getClass=function(){return Oi};var ri=function(){};ri.prototype.get=function(){},ri.prototype.put=function(){},ri.prototype.size=function(){},ri.prototype.values=function(){},ri.prototype.entrySet=function(){};var nf=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ri);function uo(n){this.message=n||""}uo.prototype=new Error,uo.prototype.name="OperationNotSupported";function Uo(){}Uo.prototype=new Dt,Uo.prototype.contains=function(){};var As=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.contains=function(r){for(var i=this,o=0,s=this.array_.length;o<s;o++){var a=i.array_[o];if(a===r)return!0}return!1},t.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},t.prototype.addAll=function(r){for(var i=this,o=r.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(r){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var r=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(r.array_[o]);return i},t.prototype.iterator=function(){return new of(this)},t}(Uo),of=function(n){function t(e){n.call(this),this.hashSet_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Pi;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new uo},t}(wi),Kr=0,Mn=1;function cu(n){return n===null?Kr:n.color}function lt(n){return n===null?null:n.parent}function Qr(n,t){n!==null&&(n.color=t)}function Fs(n){return n===null?null:n.left}function fu(n){return n===null?null:n.right}function Jt(){this.root_=null,this.size_=0}Jt.prototype=new nf,Jt.prototype.get=function(n){for(var t=this.root_;t!==null;){var e=n.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Jt.prototype.put=function(n,t){if(this.root_===null)return this.root_={key:n,value:t,left:null,right:null,parent:null,color:Kr,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,r,i;do if(r=e,i=n.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var s={key:n,left:null,right:null,value:t,parent:r,color:Kr,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=s:r.right=s,this.fixAfterInsertion(s),this.size_++,null},Jt.prototype.fixAfterInsertion=function(n){var t=this;for(n.color=Mn;n!=null&&n!==this.root_&&n.parent.color===Mn;)if(lt(n)===Fs(lt(lt(n)))){var e=fu(lt(lt(n)));cu(e)===Mn?(Qr(lt(n),Kr),Qr(e,Kr),Qr(lt(lt(n)),Mn),n=lt(lt(n))):(n===fu(lt(n))&&(n=lt(n),t.rotateLeft(n)),Qr(lt(n),Kr),Qr(lt(lt(n)),Mn),t.rotateRight(lt(lt(n))))}else{var r=Fs(lt(lt(n)));cu(r)===Mn?(Qr(lt(n),Kr),Qr(r,Kr),Qr(lt(lt(n)),Mn),n=lt(lt(n))):(n===Fs(lt(n))&&(n=lt(n),t.rotateRight(n)),Qr(lt(n),Kr),Qr(lt(lt(n)),Mn),t.rotateLeft(lt(lt(n))))}this.root_.color=Kr},Jt.prototype.values=function(){var n=new R,t=this.getFirstEntry();if(t!==null)for(n.add(t.value);(t=Jt.successor(t))!==null;)n.add(t.value);return n},Jt.prototype.entrySet=function(){var n=new As,t=this.getFirstEntry();if(t!==null)for(n.add(t);(t=Jt.successor(t))!==null;)n.add(t);return n},Jt.prototype.rotateLeft=function(n){if(n!=null){var t=n.right;n.right=t.left,t.left!=null&&(t.left.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.left===n?n.parent.left=t:n.parent.right=t,t.left=n,n.parent=t}},Jt.prototype.rotateRight=function(n){if(n!=null){var t=n.left;n.left=t.right,t.right!=null&&(t.right.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.right===n?n.parent.right=t:n.parent.left=t,t.right=n,n.parent=t}},Jt.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},Jt.successor=function(n){if(n===null)return null;if(n.right!==null){for(var t=n.right;t.left!==null;)t=t.left;return t}else{for(var e=n.parent,r=n;e!==null&&r===e.right;)r=e,e=e.parent;return e}},Jt.prototype.size=function(){return this.size_};var lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};function hu(){}hu.prototype=new Uo;function hr(){this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}hr.prototype=new hu,hr.prototype.contains=function(n){for(var t=this,e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===0)return!0}return!1},hr.prototype.add=function(n){var t=this;if(this.contains(n))return!1;for(var e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===1)return t.array_.splice(e,0,n),!0}return this.array_.push(n),!0},hr.prototype.addAll=function(n){for(var t=this,e=n.iterator();e.hasNext();)t.add(e.next());return!0},hr.prototype.remove=function(n){throw new uo},hr.prototype.size=function(){return this.array_.length},hr.prototype.isEmpty=function(){return this.array_.length===0},hr.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t},hr.prototype.iterator=function(){return new qo(this)};var qo=function(n){this.treeSet_=n,this.position_=0};qo.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Pi;return this.treeSet_.array_[this.position_++]},qo.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},qo.prototype.remove=function(){throw new uo};var An=function(){};An.sort=function(){var t=arguments[0],e,r,i,o;if(arguments.length===1)o=function(a,u){return a.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(a,u){return i.compare(a,u)},t.sort(o);else if(arguments.length===3){r=t.slice(arguments[1],arguments[2]),r.sort();var s=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])}else if(arguments.length===4)for(r=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(a,u){return i.compare(a,u)},r.sort(o),s=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])},An.asList=function(t){for(var e=new R,r=0,i=t.length;r<i;r++)e.add(t[r]);return e};var Z=function(){},Qe={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Qe.P.get=function(){return 0},Qe.L.get=function(){return 1},Qe.A.get=function(){return 2},Qe.FALSE.get=function(){return-1},Qe.TRUE.get=function(){return-2},Qe.DONTCARE.get=function(){return-3},Qe.SYM_FALSE.get=function(){return"F"},Qe.SYM_TRUE.get=function(){return"T"},Qe.SYM_DONTCARE.get=function(){return"*"},Qe.SYM_P.get=function(){return"0"},Qe.SYM_L.get=function(){return"1"},Qe.SYM_A.get=function(){return"2"},Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z},Z.toDimensionSymbol=function(t){switch(t){case Z.FALSE:return Z.SYM_FALSE;case Z.TRUE:return Z.SYM_TRUE;case Z.DONTCARE:return Z.SYM_DONTCARE;case Z.P:return Z.SYM_P;case Z.L:return Z.SYM_L;case Z.A:return Z.SYM_A}throw new pt("Unknown dimension value: "+t)},Z.toDimensionValue=function(t){switch(io.toUpperCase(t)){case Z.SYM_FALSE:return Z.FALSE;case Z.SYM_TRUE:return Z.TRUE;case Z.SYM_DONTCARE:return Z.DONTCARE;case Z.SYM_P:return Z.P;case Z.SYM_L:return Z.L;case Z.SYM_A:return Z.A}throw new pt("Unknown dimension symbol: "+t)},Object.defineProperties(Z,Qe);var gr=function(){};gr.prototype.filter=function(t){},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var Ze=function(){};Ze.prototype.filter=function(t,e){},Ze.prototype.isDone=function(){},Ze.prototype.isGeometryChanged=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var oe=function(n){function t(r,i){if(n.call(this,i),this._geometries=r||[],n.hasNullElements(this._geometries))throw new pt("geometries must not contain null elements")}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new F,s=0;s<this._geometries.length;s++)o.expandToInclude(i._geometries[s].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),s=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)s++,o[s]=u[l];return o},t.prototype.getArea=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();An.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(s)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=new hr(An.asList(this._geometries)),a=new hr(An.asList(o._geometries));return this.compare(s,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,f=this.getNumGeometries(),h=c.getNumGeometries(),g=0;g<f&&g<h;){var p=i.getGeometryN(g),v=c.getGeometryN(g),d=p.compareToSameClass(v,l);if(d!==0)return d;g++}return g<f?1:g<h?-1:0}},t.prototype.apply=function(){var i=this;if(V(arguments[0],Tr))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(V(arguments[0],Ze)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(V(arguments[0],gr)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(V(arguments[0],Hr)){var f=arguments[0];f.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),X.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=n.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var s=0;s<this._geometries.length;s++)o._geometries[s]=i._geometries[s].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(z),Fn=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[o-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(s)},t.prototype.getBoundary=function(){return new Ge(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(oe),Ge=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Be.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};Ge.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Ge.prototype.getBoundary=function(){return this._geom instanceof yt?this.boundaryLineString(this._geom):this._geom instanceof Fn?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Ge.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Ge.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Ge.prototype.computeBoundaryCoordinates=function(t){var e=this,r=new R;this._endpointMap=new Jt;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var s=this._endpointMap.entrySet().iterator();s.hasNext();){var a=s.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&r.add(a.getKey())}return W.toCoordinateArray(r)},Ge.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Xo,this._endpointMap.put(t,e)),e.count++},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Ge(t);return e.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=new Ge(r,i);return o.getBoundary()}};var Xo=function(){this.count=null};Xo.prototype.interfaces_=function(){return[]},Xo.prototype.getClass=function(){return Xo};function sf(){}function af(){}var uf=function(){};function lf(){}function cf(){}function ff(){}var ze=function(){},ks={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.chars=function(t,e){for(var r=new Array(e).fill(null),i=0;i<e;i++)r[i]=t;return String(r)},ze.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new lf,r=new sf;return t.printStackTrace(r),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new af(ze.getStackTrace(i));for(var a=new ff,u=0;u<o;u++)try{s+=a.readLine()+ze.NEWLINE}catch(l){if(l instanceof cf)X.shouldNeverReachHere();else throw l}finally{}return s}},ze.split=function(t,e){for(var r=e.length,i=new R,o=""+t,s=o.indexOf(e);s>=0;){var a=o.substring(0,s);i.add(a),o=o.substring(s+r),s=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},ze.toString=function(){if(arguments.length===1){var t=arguments[0];return ze.SIMPLE_ORDINATE_FORMAT.format(t)}},ze.spaces=function(t){return ze.chars(" ",t)},ks.NEWLINE.get=function(){return Ut.getProperty("line.separator")},ks.SIMPLE_ORDINATE_FORMAT.get=function(){return new uf},Object.defineProperties(ze,ks);var Nt=function(){};Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.copyCoord=function(t,e,r,i){for(var o=Math.min(t.getDimension(),r.getDimension()),s=0;s<o;s++)r.setOrdinate(i,s,t.getOrdinate(e,s))},Nt.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,K.X)===t.getOrdinate(e-1,K.X)&&t.getOrdinate(0,K.Y)===t.getOrdinate(e-1,K.Y)},Nt.isEqual=function(t,e){var r=t.size(),i=e.size();if(r!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),s=0;s<r;s++)for(var a=0;a<o;a++){var u=t.getOrdinate(s,a),l=e.getOrdinate(s,a);if(t.getOrdinate(s,a)!==e.getOrdinate(s,a)&&!(U.isNaN(u)&&U.isNaN(l)))return!1}return!0},Nt.extend=function(t,e,r){var i=t.create(r,e.getDimension()),o=e.size();if(Nt.copy(e,0,i,0,o),o>0)for(var s=o;s<r;s++)Nt.copy(e,o-1,i,s,1);return i},Nt.reverse=function(t){for(var e=t.size()-1,r=Math.trunc(e/2),i=0;i<=r;i++)Nt.swap(t,i,e-i)},Nt.swap=function(t,e,r){if(e===r)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(r,i)),t.setOrdinate(r,i,o)}},Nt.copy=function(t,e,r,i,o){for(var s=0;s<o;s++)Nt.copyCoord(t,e+s,r,i+s)},Nt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var r=t.getDimension(),i=new ur;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var s=0;s<r;s++)s>0&&i.append(","),i.append(ze.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}},Nt.ensureValidRing=function(t,e){var r=e.size();if(r===0)return e;if(r<=3)return Nt.createClosedRing(t,e,4);var i=e.getOrdinate(0,K.X)===e.getOrdinate(r-1,K.X)&&e.getOrdinate(0,K.Y)===e.getOrdinate(r-1,K.Y);return i?e:Nt.createClosedRing(t,e,r+1)},Nt.createClosedRing=function(t,e,r){var i=t.create(r,e.getDimension()),o=e.size();Nt.copy(e,0,i,0,o);for(var s=o;s<r;s++)Nt.copy(e,0,i,s,1);return i};var yt=function(n){function t(r,i){n.call(this,i),this._points=null,this.init(r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new F:this._points.expandEnvelope(new F)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var s=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(s)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(s))>0&&Nt.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return M.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();Nt.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],s=o,a=0,u=0;a<this._points.size()&&u<s._points.size();){var l=i._points.getCoordinate(a).compareTo(s._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<s._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],f=arguments[1],h=c;return f.compare(this._points,h._points)}},t.prototype.apply=function(){var i=this;if(V(arguments[0],Tr))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(V(arguments[0],Ze)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(V(arguments[0],gr)){var l=arguments[0];l.filter(this)}else if(V(arguments[0],Hr)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new Ge(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new pt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,s=0;s<this._points.size();s++)if(o._points.getCoordinate(s).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(z),co=function(){};co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var Ee=function(n){function t(r,i){n.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new F;var i=new F;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var s=arguments[0],a=arguments[1],u=s;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(V(arguments[0],Tr)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(V(arguments[0],Ze)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(V(arguments[0],gr)){var s=arguments[0];s.filter(this)}else if(V(arguments[0],Hr)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),X.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[co]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(z),gn=function(){};gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var Mt=function(n){function t(r,i,o){if(n.call(this,o),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),n.hasNullElements(i))throw new pt("holes must not contain null elements");if(r.isEmpty()&&n.hasNonEmptyElements(i))throw new pt("shell is empty but holes are not");this._shell=r,this._holes=i}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),s=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)s++,o[s]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),f=0;f<c.length;f++)s++,o[s]=c[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(M.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(M.signedArea(i._holes[s].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),s=0;s<5;s++){var a=i.getX(s);if(!(a===o.getMinX()||a===o.getMaxX()))return!1;var u=i.getY(s);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),f=1;f<=4;f++){var h=i.getX(f),g=i.getY(f),p=h!==l,v=g!==c;if(p===v)return!1;l=h,c=g}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o,u=this._shell,l=a._shell;if(!u.equalsExact(l,s)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);An.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];if(s.isEmpty())return null;var u=new Array(s.getCoordinates().length-1).fill(null);Ut.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=W.minCoordinate(s.getCoordinates());W.scroll(u,l),Ut.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],M.isCCW(s.getCoordinates())===a&&W.reverse(s.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)o+=i._holes[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)o+=i._holes[s].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=this._shell,a=o._shell;return s.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,f=this._shell,h=c._shell,g=f.compareToSameClass(h,l);if(g!==0)return g;for(var p=this.getNumInteriorRing(),v=c.getNumInteriorRing(),d=0;d<p&&d<v;){var y=i.getInteriorRingN(d),I=c.getInteriorRingN(d),C=y.compareToSameClass(I,l);if(C!==0)return C;d++}return d<p?1:d<v?-1:0}},t.prototype.apply=function(i){var o=this;if(V(i,Tr)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(V(i,Ze)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(o._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(V(i,gr))i.filter(this);else if(V(i,Hr)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var s=0;s<this._holes.length;s++)o[s+1]=i._holes[s];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=n.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),s=new Array(this._holes.length).fill(null),a=0;a<s.length;a++)s[a]=i._holes[a].copy();return new t(o,s,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[gn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(z),Ri=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[co]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(oe),Dr=function(n){function t(r,i){r instanceof m&&i instanceof H&&(r=i.getCoordinateSequenceFactory().create(r)),n.call(this,r,i),this.validateConstruction()}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Nt.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new pt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new pt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(yt),Mr=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(s)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new R,s=0;s<this._geometries.length;s++)for(var a=i._geometries[s],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)o.add(u.getGeometryN(l));var c=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[gn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(oe),Ve=function(t){this._factory=t||null,this._isUserDataCopied=!1},Yo={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Ve.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Ve.prototype.edit=function(t,e){if(t===null)return null;var r=this.editInternal(t,e);return this._isUserDataCopied&&r.setUserData(t.getUserData()),r},Ve.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof oe?this.editGeometryCollection(t,e):t instanceof Mt?this.editPolygon(t,e):t instanceof Ee?e.edit(t,this._factory):t instanceof yt?e.edit(t,this._factory):(X.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Ve.prototype.editGeometryCollection=function(t,e){for(var r=this,i=e.edit(t,this._factory),o=new R,s=0;s<i.getNumGeometries();s++){var a=r.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===Ri?this._factory.createMultiPoint(o.toArray([])):i.getClass()===Fn?this._factory.createMultiLineString(o.toArray([])):i.getClass()===Mr?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},Ve.prototype.editPolygon=function(t,e){var r=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var s=new R,a=0;a<i.getNumInteriorRing();a++){var u=r.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||s.add(u)}return this._factory.createPolygon(o,s.toArray([]))},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.GeometryEditorOperation=function(){},Yo.NoOpGeometryOperation.get=function(){return fo},Yo.CoordinateOperation.get=function(){return ho},Yo.CoordinateSequenceOperation.get=function(){return go},Object.defineProperties(Ve,Yo);var fo=function(){};fo.prototype.edit=function(t,e){return t},fo.prototype.interfaces_=function(){return[Ve.GeometryEditorOperation]},fo.prototype.getClass=function(){return fo};var ho=function(){};ho.prototype.edit=function(t,e){var r=this.editCoordinates(t.getCoordinates(),t);return r===null?t:t instanceof Dr?e.createLinearRing(r):t instanceof yt?e.createLineString(r):t instanceof Ee?r.length>0?e.createPoint(r[0]):e.createPoint():t},ho.prototype.interfaces_=function(){return[Ve.GeometryEditorOperation]},ho.prototype.getClass=function(){return ho};var go=function(){};go.prototype.edit=function(t,e){return t instanceof Dr?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof yt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ee?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},go.prototype.interfaces_=function(){return[Ve.GeometryEditorOperation]},go.prototype.getClass=function(){return go};var St=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var r=0;r<e;r++)t._coordinates[r]=new m}else if(V(arguments[0],K)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=s,this._dimension=a,s===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)t._coordinates[c]=new m}}},gu={serialVersionUID:{configurable:!0}};St.prototype.setOrdinate=function(t,e,r){switch(e){case K.X:this._coordinates[t].x=r;break;case K.Y:this._coordinates[t].y=r;break;case K.Z:this._coordinates[t].z=r;break;default:throw new pt("invalid ordinateIndex")}},St.prototype.size=function(){return this._coordinates.length},St.prototype.getOrdinate=function(t,e){switch(e){case K.X:return this._coordinates[t].x;case K.Y:return this._coordinates[t].y;case K.Z:return this._coordinates[t].z}return U.NaN},St.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],r=arguments[1];r.x=this._coordinates[e].x,r.y=this._coordinates[e].y,r.z=this._coordinates[e].z}},St.prototype.getCoordinateCopy=function(t){return new m(this._coordinates[t])},St.prototype.getDimension=function(){return this._dimension},St.prototype.getX=function(t){return this._coordinates[t].x},St.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].clone();return new St(e,this._dimension)},St.prototype.expandEnvelope=function(t){for(var e=this,r=0;r<this._coordinates.length;r++)t.expandToInclude(e._coordinates[r]);return t},St.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].copy();return new St(e,this._dimension)},St.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new ur(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)e.append(", "),e.append(t._coordinates[r]);return e.append(")"),e.toString()}else return"()"},St.prototype.getY=function(t){return this._coordinates[t].y},St.prototype.toCoordinateArray=function(){return this._coordinates},St.prototype.interfaces_=function(){return[K,ke]},St.prototype.getClass=function(){return St},gu.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(St,gu);var Ar=function(){},Bs={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ar.prototype.readResolve=function(){return Ar.instance()},Ar.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new St(t)}else if(V(arguments[0],K)){var e=arguments[0];return new St(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new St(r):new St(r,i)}},Ar.prototype.interfaces_=function(){return[Ci,ke]},Ar.prototype.getClass=function(){return Ar},Ar.instance=function(){return Ar.instanceObject},Bs.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Bs.instanceObject.get=function(){return new Ar},Object.defineProperties(Ar,Bs);var pu=function(n){function t(){n.call(this),this.map_=new Map}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(r){return this.map_.get(r)||null},t.prototype.put=function(r,i){return this.map_.set(r,i),i},t.prototype.values=function(){for(var r=new R,i=this.map_.values(),o=i.next();!o.done;)r.add(o.value),o=i.next();return r},t.prototype.entrySet=function(){var r=new As;return this.map_.entries().forEach(function(i){return r.add(i)}),r},t.prototype.size=function(){return this.map_.size()},t}(ri),J=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof pr){var t=arguments[0];this._modelType=t,t===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=n.FIXED,this.setScale(e)}else if(arguments[0]instanceof n){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Gs={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},J.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new lr(r).compareTo(new lr(i))},J.prototype.getScale=function(){return this._scale},J.prototype.isFloating=function(){return this._modelType===J.FLOATING||this._modelType===J.FLOATING_SINGLE},J.prototype.getType=function(){return this._modelType},J.prototype.toString=function(){var t="UNKNOWN";return this._modelType===J.FLOATING?t="Floating":this._modelType===J.FLOATING_SINGLE?t="Floating-Single":this._modelType===J.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},J.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(U.isNaN(t))return t;if(this._modelType===J.FLOATING_SINGLE){var e=t;return e}return this._modelType===J.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof m){var r=arguments[0];if(this._modelType===J.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}},J.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===J.FLOATING?t=16:this._modelType===J.FLOATING_SINGLE?t=6:this._modelType===J.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},J.prototype.setScale=function(t){this._scale=Math.abs(t)},J.prototype.interfaces_=function(){return[ke,Fe]},J.prototype.getClass=function(){return J},J.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Gs.serialVersionUID.get=function(){return 7777263578777804e3},Gs.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(J,Gs);var pr=function n(t){this._name=t||null,n.nameToTypeMap.put(t,this)},zs={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};pr.prototype.readResolve=function(){return pr.nameToTypeMap.get(this._name)},pr.prototype.toString=function(){return this._name},pr.prototype.interfaces_=function(){return[ke]},pr.prototype.getClass=function(){return pr},zs.serialVersionUID.get=function(){return-552860263173159e4},zs.nameToTypeMap.get=function(){return new pu},Object.defineProperties(pr,zs),J.Type=pr,J.FIXED=new pr("FIXED"),J.FLOATING=new pr("FLOATING"),J.FLOATING_SINGLE=new pr("FLOATING SINGLE");var H=function n(){this._precisionModel=new J,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?V(arguments[0],Ci)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof J&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},du={serialVersionUID:{configurable:!0}};H.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new m(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new m(t.getMinX(),t.getMinY()),new m(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new m(t.getMinX(),t.getMinY()),new m(t.getMinX(),t.getMaxY()),new m(t.getMaxX(),t.getMaxY()),new m(t.getMaxX(),t.getMinY()),new m(t.getMinX(),t.getMinY())]),null)},H.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new yt(this.getCoordinateSequenceFactory().create(t),this);if(V(t,K))return new yt(t,this)}else return new yt(this.getCoordinateSequenceFactory().create([]),this)},H.prototype.createMultiLineString=function(){if(arguments.length===0)return new Fn(null,this);if(arguments.length===1){var t=arguments[0];return new Fn(t,this)}},H.prototype.buildGeometry=function(t){for(var e=null,r=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getClass();e===null&&(e=a),a!==e&&(r=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(H.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Mt)return this.createMultiPolygon(H.toPolygonArray(t));if(u instanceof yt)return this.createMultiLineString(H.toLineStringArray(t));if(u instanceof Ee)return this.createMultiPoint(H.toPointArray(t));X.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},H.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},H.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(V(arguments[0],K)){var e=arguments[0];return new Ee(e,this)}}},H.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},H.prototype.createPolygon=function(){if(arguments.length===0)return new Mt(null,null,this);if(arguments.length===1){if(V(arguments[0],K)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Dr){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new Mt(i,o,this)}},H.prototype.getSRID=function(){return this._SRID},H.prototype.createGeometryCollection=function(){if(arguments.length===0)return new oe(null,this);if(arguments.length===1){var t=arguments[0];return new oe(t,this)}},H.prototype.createGeometry=function(t){var e=new Ve(this);return e.edit(t,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})},H.prototype.getPrecisionModel=function(){return this._precisionModel},H.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(V(arguments[0],K)){var e=arguments[0];return new Dr(e,this)}}},H.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Mr(null,this);if(arguments.length===1){var t=arguments[0];return new Mr(t,this)}},H.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Ri(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Ri(e,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(V(arguments[0],K)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),s=0;s<i.size();s++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());Nt.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}},H.prototype.interfaces_=function(){return[ke]},H.prototype.getClass=function(){return H},H.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},H.getDefaultCoordinateSequenceFactory=function(){return Ar.instance()},H.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},du.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(H,du);var hf=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Wo=function(t){this.geometryFactory=t||new H};Wo.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var r=e.type;if(!dr[r])throw new Error("Unknown GeoJSON type: "+e.type);return hf.indexOf(r)!==-1?dr[r].apply(this,[e.coordinates]):r==="GeometryCollection"?dr[r].apply(this,[e.geometries]):dr[r].apply(this,[e])},Wo.prototype.write=function(t){var e=t.getGeometryType();if(!Zr[e])throw new Error("Geometry is not supported");return Zr[e].apply(this,[t])};var dr={Feature:function(n){var t={};for(var e in n)t[e]=n[e];if(n.geometry){var r=n.geometry.type;if(!dr[r])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=dr.bbox.apply(this,[n.bbox])),t},FeatureCollection:function(n){var t=this,e={};if(n.features){e.features=[];for(var r=0;r<n.features.length;++r)e.features.push(t.read(n.features[r]))}return n.bbox&&(e.bbox=this.parse.bbox.apply(this,[n.bbox])),e},coordinates:function(n){for(var t=[],e=0;e<n.length;++e){var r=n[e];t.push(new m(r[0],r[1]))}return t},bbox:function(n){return this.geometryFactory.createLinearRing([new m(n[0],n[1]),new m(n[2],n[1]),new m(n[2],n[3]),new m(n[0],n[3]),new m(n[0],n[1])])},Point:function(n){var t=new m(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(dr.Point.apply(t,[n[r]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(n){var t=dr.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(dr.LineString.apply(t,[n[r]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(n){for(var t=this,e=dr.coordinates.apply(this,[n[0]]),r=this.geometryFactory.createLinearRing(e),i=[],o=1;o<n.length;++o){var s=n[o],a=dr.coordinates.apply(t,[s]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(dr.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Zr={coordinate:function(n){return[n.x,n.y]},Point:function(n){var t=Zr.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Zr.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(n){for(var t=this,e=[],r=n.getCoordinates(),i=0;i<r.length;++i){var o=r[i];e.push(Zr.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Zr.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(n){var t=this,e=[],r=Zr.LineString.apply(this,[n._shell]);e.push(r.coordinates);for(var i=0;i<n._holes.length;++i){var o=n._holes[i],s=Zr.LineString.apply(t,[o]);e.push(s.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Zr.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=i.getGeometryType();e.push(Zr[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Vs=function(t){this.geometryFactory=t||new H,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Wo(this.geometryFactory)};Vs.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===J.FIXED&&this.reducePrecision(e),e},Vs.prototype.reducePrecision=function(t){var e=this,r,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(r=0,i=t.points.length;r<i;r++)e.precisionModel.makePrecise(t.points[r]);else if(t.geometries)for(r=0,i=t.geometries.length;r<i;r++)e.reducePrecision(t.geometries[r])};var vu=function(){this.parser=new Wo(this.geometryFactory)};vu.prototype.write=function(t){return this.parser.write(t)};var P=function(){},Ho={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.opposite=function(t){return t===P.LEFT?P.RIGHT:t===P.RIGHT?P.LEFT:t},Ho.ON.get=function(){return 0},Ho.LEFT.get=function(){return 1},Ho.RIGHT.get=function(){return 2},Object.defineProperties(P,Ho);function jo(n){this.message=n||""}jo.prototype=new Error,jo.prototype.name="EmptyStackException";function vr(){this.array_=[]}vr.prototype=new Ke,vr.prototype.add=function(n){return this.array_.push(n),!0},vr.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},vr.prototype.push=function(n){return this.array_.push(n),n},vr.prototype.pop=function(n){if(this.array_.length===0)throw new jo;return this.array_.pop()},vr.prototype.peek=function(){if(this.array_.length===0)throw new jo;return this.array_[this.array_.length-1]},vr.prototype.empty=function(){return this.array_.length===0},vr.prototype.isEmpty=function(){return this.empty()},vr.prototype.search=function(n){return this.array_.indexOf(n)},vr.prototype.size=function(){return this.array_.length},vr.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t};var mr=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};mr.prototype.getCoordinate=function(){return this._minCoord},mr.prototype.getRightmostSide=function(t,e){var r=this.getRightmostSideOfSegment(t,e);return r<0&&(r=this.getRightmostSideOfSegment(t,e-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),r},mr.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();X.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],r=t[this._minIndex+1],i=M.computeOrientation(this._minCoord,r,e),o=!1;(e.y<this._minCoord.y&&r.y<this._minCoord.y&&i===M.COUNTERCLOCKWISE||e.y>this._minCoord.y&&r.y>this._minCoord.y&&i===M.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},mr.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge(),i=r.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=P.LEFT;return i[e].y<i[e+1].y&&(o=P.RIGHT),o},mr.prototype.getEdge=function(){return this._orientedDe},mr.prototype.checkForRightmostCoordinate=function(t){for(var e=this,r=t.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(e._minCoord===null||r[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=r[i])},mr.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},mr.prototype.findEdge=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();i.isForward()&&e.checkForRightmostCoordinate(i)}X.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var o=this.getRightmostSide(this._minDe,this._minIndex);o===P.LEFT&&(this._orientedDe=this._minDe.getSym())},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var Jr=function(n){function t(e,r){n.call(this,t.msgWithCoord(e,r)),this.pt=r?new m(r):null,this.name="TopologyException"}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(r,i){return i?r:r+" [ "+i+" ]"},t}(Wr),Ko=function(){this.array_=[]};Ko.prototype.addLast=function(t){this.array_.push(t)},Ko.prototype.removeFirst=function(){return this.array_.shift()},Ko.prototype.isEmpty=function(){return this.array_.length===0};var se=function(){this._finder=null,this._dirEdgeList=new R,this._nodes=new R,this._rightMostCoord=null,this._env=null,this._finder=new mr};se.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},se.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},se.prototype.computeNodeDepth=function(t){for(var e=this,r=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){r=o;break}}if(r===null)throw new Jr("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(r);for(var s=t.getEdges().iterator();s.hasNext();){var a=s.next();a.setVisited(!0),e.copySymDepths(a)}},se.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(P.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},se.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},se.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(P.RIGHT)>=1&&e.getDepth(P.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},se.prototype.computeDepths=function(t){var e=this,r=new As,i=new Ko,o=t.getNode();for(i.addLast(o),r.add(o),t.setVisited(!0);!i.isEmpty();){var s=i.removeFirst();r.add(s),e.computeNodeDepth(s);for(var a=s.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();r.contains(c)||(i.addLast(c),r.add(c))}}}},se.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},se.prototype.getEnvelope=function(){if(this._env===null){for(var t=new F,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next(),i=r.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env},se.prototype.addReachable=function(t){var e=this,r=new vr;for(r.add(t);!r.empty();){var i=r.pop();e.add(i,r)}},se.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(P.LEFT,t.getDepth(P.RIGHT)),e.setDepth(P.RIGHT,t.getDepth(P.LEFT))},se.prototype.add=function(t,e){var r=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();r._dirEdgeList.add(o);var s=o.getSym(),a=s.getNode();a.isVisited()||e.push(a)}},se.prototype.getNodes=function(){return this._nodes},se.prototype.getDirectedEdges=function(){return this._dirEdgeList},se.prototype.interfaces_=function(){return[Fe]},se.prototype.getClass=function(){return se};var ct=function n(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var r=arguments[0];this.init(1),this.location[P.ON]=r}else if(arguments[0]instanceof n){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[P.ON]=s,this.location[P.LEFT]=a,this.location[P.RIGHT]=u}};ct.prototype.setAllLocations=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]=t},ct.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==_.NONE)return!1;return!0},ct.prototype.setAllLocationsIfNull=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]===_.NONE&&(e.location[r]=t)},ct.prototype.isLine=function(){return this.location.length===1},ct.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var r=new Array(3).fill(null);r[P.ON]=this.location[P.ON],r[P.LEFT]=_.NONE,r[P.RIGHT]=_.NONE,this.location=r}for(var i=0;i<this.location.length;i++)e.location[i]===_.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},ct.prototype.getLocations=function(){return this.location},ct.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[P.LEFT];this.location[P.LEFT]=this.location[P.RIGHT],this.location[P.RIGHT]=t},ct.prototype.toString=function(){var t=new ur;return this.location.length>1&&t.append(_.toLocationSymbol(this.location[P.LEFT])),t.append(_.toLocationSymbol(this.location[P.ON])),this.location.length>1&&t.append(_.toLocationSymbol(this.location[P.RIGHT])),t.toString()},ct.prototype.setLocations=function(t,e,r){this.location[P.ON]=t,this.location[P.LEFT]=e,this.location[P.RIGHT]=r},ct.prototype.get=function(t){return t<this.location.length?this.location[t]:_.NONE},ct.prototype.isArea=function(){return this.location.length>1},ct.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===_.NONE)return!0;return!1},ct.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(P.ON,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.location[e]=r}},ct.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(_.NONE)},ct.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},ct.prototype.allPositionsEqual=function(t){for(var e=this,r=0;r<this.location.length;r++)if(e.location[r]!==t)return!1;return!0},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var nt=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new ct(t),this.elt[1]=new ct(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.elt[0]=new ct(e.elt[0]),this.elt[1]=new ct(e.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new ct(_.NONE),this.elt[1]=new ct(_.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new ct(o,s,a),this.elt[1]=new ct(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this.elt[0]=new ct(_.NONE,_.NONE,_.NONE),this.elt[1]=new ct(_.NONE,_.NONE,_.NONE),this.elt[u].setLocations(l,c,f)}};nt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},nt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},nt.prototype.isNull=function(t){return this.elt[t].isNull()},nt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.elt[e].setAllLocationsIfNull(r)}},nt.prototype.isLine=function(t){return this.elt[t].isLine()},nt.prototype.merge=function(t){for(var e=this,r=0;r<2;r++)e.elt[r]===null&&t.elt[r]!==null?e.elt[r]=new ct(t.elt[r]):e.elt[r].merge(t.elt[r])},nt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},nt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(P.ON)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.elt[e].get(r)}},nt.prototype.toString=function(){var t=new ur;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},nt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},nt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},nt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(P.ON,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this.elt[r].setLocation(i,o)}},nt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},nt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},nt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new ct(this.elt[t].location[0]))},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.toLineLabel=function(t){for(var e=new nt(_.NONE),r=0;r<2;r++)e.setLocation(r,t.getLocation(r));return e};var Pt=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new R,this._pts=new R,this._label=new nt(_.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new R,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Pt.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)e[r]=t._pts.get(r);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=M.isCCW(this._ring.getCoordinates())},Pt.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Pt.prototype.computePoints=function(t){var e=this;this._startDe=t;var r=t,i=!0;do{if(r===null)throw new Jr("Found null DirectedEdge");if(r.getEdgeRing()===e)throw new Jr("Directed Edge visited twice during ring-building at "+r.getCoordinate());e._edges.add(r);var o=r.getLabel();X.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(r.getEdge(),r.isForward(),i),i=!1,e.setEdgeRing(r,e),r=e.getNext(r)}while(r!==this._startDe)},Pt.prototype.getLinearRing=function(){return this._ring},Pt.prototype.getCoordinate=function(t){return this._pts.get(t)},Pt.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var r=e.getNode(),i=r.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Pt.prototype.addPoints=function(t,e,r){var i=this,o=t.getCoordinates();if(e){var s=1;r&&(s=0);for(var a=s;a<o.length;a++)i._pts.add(o[a])}else{var u=o.length-2;r&&(u=o.length-1);for(var l=u;l>=0;l--)i._pts.add(o[l])}},Pt.prototype.isHole=function(){return this._isHole},Pt.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Pt.prototype.containsPoint=function(t){var e=this.getLinearRing(),r=e.getEnvelopeInternal();if(!r.contains(t)||!M.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0},Pt.prototype.addHole=function(t){this._holes.add(t)},Pt.prototype.isShell=function(){return this._shell===null},Pt.prototype.getLabel=function(){return this._label},Pt.prototype.getEdges=function(){return this._edges},Pt.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Pt.prototype.getShell=function(){return this._shell},Pt.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=e.getLocation(r,P.RIGHT);if(i===_.NONE)return null;if(this._label.getLocation(r)===_.NONE)return this._label.setLocation(r,i),null}},Pt.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Pt.prototype.toPolygon=function(t){for(var e=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),r);return o},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt};var gf=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},t.prototype.getNext=function(r){return r.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Pt),pf=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var r=this,i=new R,o=this._startDe;do{if(o.getMinEdgeRing()===null){var s=new gf(o,r._geometryFactory);i.add(s)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(r){return r.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Pt),Pe=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};Pe.prototype.setVisited=function(t){this._isVisited=t},Pe.prototype.setInResult=function(t){this._isInResult=t},Pe.prototype.isCovered=function(){return this._isCovered},Pe.prototype.isCoveredSet=function(){return this._isCoveredSet},Pe.prototype.setLabel=function(t){this._label=t},Pe.prototype.getLabel=function(){return this._label},Pe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Pe.prototype.updateIM=function(t){X.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Pe.prototype.isInResult=function(){return this._isInResult},Pe.prototype.isVisited=function(){return this._isVisited},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe};var Qo=function(n){function t(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new nt(0,_.NONE)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(r){r.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(r){},t.prototype.computeMergedLocation=function(r,i){var o=_.NONE;if(o=this._label.getLocation(i),!r.isNull(i)){var s=r.getLocation(i);o!==_.BOUNDARY&&(o=s)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new nt(r,i):this._label.setLocation(r,i)}else return n.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof nt)for(var o=arguments[0],s=0;s<2;s++){var a=r.computeMergedLocation(o,s),u=r._label.getLocation(s);u===_.NONE&&r._label.setLocation(s,a)}},t.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},t.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=_.NONE;this._label!==null&&(i=this._label.getLocation(r));var o=null;switch(i){case _.BOUNDARY:o=_.INTERIOR;break;case _.INTERIOR:o=_.BOUNDARY;break;default:o=_.BOUNDARY;break}this._label.setLocation(r,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Pe),yr=function(){this.nodeMap=new Jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};yr.prototype.find=function(t){return this.nodeMap.get(t)},yr.prototype.addNode=function(){if(arguments[0]instanceof m){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Qo){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}},yr.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},yr.prototype.iterator=function(){return this.nodeMap.values().iterator()},yr.prototype.values=function(){return this.nodeMap.values()},yr.prototype.getBoundaryNodes=function(t){for(var e=new R,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(t)===_.BOUNDARY&&e.add(i)}return e},yr.prototype.add=function(t){var e=t.getCoordinate(),r=this.addNode(e);r.add(t)},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var ot=function(){},po={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.isNorthern=function(t){return t===ot.NE||t===ot.NW},ot.isOpposite=function(t,e){if(t===e)return!1;var r=(t-e+4)%4;return r===2},ot.commonHalfPlane=function(t,e){if(t===e)return t;var r=(t-e+4)%4;if(r===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i},ot.isInHalfPlane=function(t,e){return e===ot.SE?t===ot.SE||t===ot.SW:t===e||t===e+1},ot.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new pt("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ot.NE:ot.SE:e>=0?ot.NW:ot.SW}else if(arguments[0]instanceof m&&arguments[1]instanceof m){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new pt("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?ot.NE:ot.SE:i.y>=r.y?ot.NW:ot.SW}},po.NE.get=function(){return 0},po.NW.get=function(){return 1},po.SW.get=function(){return 2},po.SE.get=function(){return 3},Object.defineProperties(ot,po);var $t=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(r,i),this._label=o}else if(arguments.length===4){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=s,this.init(a,u),this._label=l}};$t.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:M.computeOrientation(t._p0,t._p1,this._p1)},$t.prototype.getDy=function(){return this._dy},$t.prototype.getCoordinate=function(){return this._p0},$t.prototype.setNode=function(t){this._node=t},$t.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),o=r.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},$t.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},$t.prototype.getDirectedCoordinate=function(){return this._p1},$t.prototype.getDx=function(){return this._dx},$t.prototype.getLabel=function(){return this._label},$t.prototype.getEdge=function(){return this._edge},$t.prototype.getQuadrant=function(){return this._quadrant},$t.prototype.getNode=function(){return this._node},$t.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),r=e.lastIndexOf("."),i=e.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},$t.prototype.computeLabel=function(t){},$t.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=ot.quadrant(this._dx,this._dy),X.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},$t.prototype.interfaces_=function(){return[Fe]},$t.prototype.getClass=function(){return $t};var Us=function(n){function t(){var e=arguments[0],r=arguments[1];if(n.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=r,r)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(r){return this._depth[r]},t.prototype.setVisited=function(r){this._isVisited=r},t.prototype.computeDirectedLabel=function(){this._label=new nt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new Jr("assigned depths do not match",this.getCoordinate());this._depth[r]=i},t.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,o=0;o<2;o++)r._label.isArea(o)&&r._label.getLocation(o,P.LEFT)===_.INTERIOR&&r._label.getLocation(o,P.RIGHT)===_.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(r){this._nextMin=r},t.prototype.print=function(r){n.prototype.print.call(this,r),r.print(" "+this._depth[P.LEFT]+"/"+this._depth[P.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},t.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},t.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,_.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,_.EXTERIOR);return r&&i&&o},t.prototype.setEdgeRing=function(r){this._edgeRing=r},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},t.prototype.setInResult=function(r){this._isInResult=r},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},t.prototype.setSym=function(r){this._sym=r},t.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},t.prototype.setEdgeDepths=function(r,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var s=1;r===P.LEFT&&(s=-1);var a=P.opposite(r),u=o*s,l=i+u;this.setDepth(r,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(r){this._next=r},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(r,i){return r===_.EXTERIOR&&i===_.INTERIOR?1:r===_.INTERIOR&&i===_.EXTERIOR?-1:0},t}($t),Ti=function(){};Ti.prototype.createNode=function(t){return new Qo(t,null)},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var vt=function(){if(this._edges=new R,this._nodes=null,this._edgeEndList=new R,arguments.length===0)this._nodes=new yr(new Ti);else if(arguments.length===1){var t=arguments[0];this._nodes=new yr(t)}};vt.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var r=0;r<this._edges.size();r++){t.println("edge "+r+":");var i=e._edges.get(r);i.print(t),i.eiList.print(t)}},vt.prototype.find=function(t){return this._nodes.find(t)},vt.prototype.addNode=function(){if(arguments[0]instanceof Qo){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof m){var e=arguments[0];return this._nodes.addNode(e)}},vt.prototype.getNodeIterator=function(){return this._nodes.iterator()},vt.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},vt.prototype.debugPrintln=function(t){Ut.out.println(t)},vt.prototype.isBoundaryNode=function(t,e){var r=this._nodes.find(e);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(t)===_.BOUNDARY},vt.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},vt.prototype.matchInSameDirection=function(t,e,r,i){return t.equals(r)?M.computeOrientation(t,e,i)===M.COLLINEAR&&ot.quadrant(t,e)===ot.quadrant(r,i):!1},vt.prototype.getEdgeEnds=function(){return this._edgeEndList},vt.prototype.debugPrint=function(t){Ut.out.print(t)},vt.prototype.getEdgeIterator=function(){return this._edges.iterator()},vt.prototype.findEdgeInSameDirection=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var o=r._edges.get(i),s=o.getCoordinates();if(r.matchInSameDirection(t,e,s[0],s[1])||r.matchInSameDirection(t,e,s[s.length-1],s[s.length-2]))return o}return null},vt.prototype.insertEdge=function(t){this._edges.add(t)},vt.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var r=e.next();if(r.getEdge()===t)return r}return null},vt.prototype.addEdges=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();e._edges.add(i);var o=new Us(i,!0),s=new Us(i,!1);o.setSym(s),s.setSym(o),e.add(o),e.add(s)}},vt.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},vt.prototype.getNodes=function(){return this._nodes.values()},vt.prototype.findEdge=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var o=r._edges.get(i),s=o.getCoordinates();if(t.equals(s[0])&&e.equals(s[1]))return o}return null},vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.getEdges().linkResultDirectedEdges()}};var Ce=function(){this._geometryFactory=null,this._shellList=new R;var t=arguments[0];this._geometryFactory=t};Ce.prototype.sortShellsAndHoles=function(t,e,r){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?r.add(o):e.add(o)}},Ce.prototype.computePolygons=function(t){for(var e=this,r=new R,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);r.add(s)}return r},Ce.prototype.placeFreeHoles=function(t,e){for(var r=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var s=r.findEdgeRingContaining(o,t);if(s===null)throw new Jr("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}},Ce.prototype.buildMinimalEdgeRings=function(t,e,r){for(var i=this,o=new R,s=t.iterator();s.hasNext();){var a=s.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):r.addAll(u)}else o.add(a)}return o},Ce.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var r=e.next();if(r.containsPoint(t))return!0}return!1},Ce.prototype.buildMaximalEdgeRings=function(t){for(var e=this,r=new R,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new pf(o,e._geometryFactory);r.add(s),s.setInResult()}}return r},Ce.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(t)}},Ce.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},Ce.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),i=r.getEnvelopeInternal(),o=r.getCoordinateN(0),s=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),f=c.getEnvelopeInternal();s!==null&&(a=s.getLinearRing().getEnvelopeInternal());var h=!1;f.contains(i)&&M.isPointInRing(o,c.getCoordinates())&&(h=!0),h&&(s===null||a.contains(f))&&(s=l)}return s},Ce.prototype.findShell=function(t){for(var e=0,r=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(r=o,e++)}return X.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Ce.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],r=arguments[1];vt.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(e),o=new R,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Di=function(){};Di.prototype.getBounds=function(){},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di};var Je=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Je.prototype.getItem=function(){return this._item},Je.prototype.getBounds=function(){return this._bounds},Je.prototype.interfaces_=function(){return[Di,ke]},Je.prototype.getClass=function(){return Je};var $r=function(){this._size=null,this._items=null,this._size=0,this._items=new R,this._items.add(null)};$r.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},$r.prototype.size=function(){return this._size},$r.prototype.reorder=function(t){for(var e=this,r=null,i=this._items.get(t);t*2<=this._size&&(r=t*2,r!==e._size&&e._items.get(r+1).compareTo(e._items.get(r))<0&&r++,e._items.get(r).compareTo(i)<0);t=r)e._items.set(t,e._items.get(r));this._items.set(t,i)},$r.prototype.clear=function(){this._size=0,this._items.clear()},$r.prototype.isEmpty=function(){return this._size===0},$r.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)e._items.set(r,e._items.get(Math.trunc(r/2)));this._items.set(r,t)},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var pn=function(){};pn.prototype.visitItem=function(t){},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var ni=function(){};ni.prototype.insert=function(t,e){},ni.prototype.remove=function(t,e){},ni.prototype.query=function(){},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni};var At=function(){if(this._childBoundables=new R,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},mu={serialVersionUID:{configurable:!0}};At.prototype.getLevel=function(){return this._level},At.prototype.size=function(){return this._childBoundables.size()},At.prototype.getChildBoundables=function(){return this._childBoundables},At.prototype.addChildBoundable=function(t){X.isTrue(this._bounds===null),this._childBoundables.add(t)},At.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},At.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},At.prototype.interfaces_=function(){return[Di,ke]},At.prototype.getClass=function(){return At},mu.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(At,mu);var $e=function(){};$e.reverseOrder=function(){return{compare:function(e,r){return r.compareTo(e)}}},$e.min=function(t){return $e.sort(t),t.get(0)},$e.sort=function(t,e){var r=t.toArray();e?An.sort(r,e):An.sort(r);for(var i=t.iterator(),o=0,s=r.length;o<s;o++)i.next(),i.set(r[o])},$e.singletonList=function(t){var e=new R;return e.add(t),e};var Ot=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=r,this._distance=this.distance()};Ot.prototype.expandToQueue=function(t,e){var r=Ot.isComposite(this._boundable1),i=Ot.isComposite(this._boundable2);if(r&&i)return Ot.area(this._boundable1)>Ot.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new pt("neither boundable is composite")},Ot.prototype.isLeaves=function(){return!(Ot.isComposite(this._boundable1)||Ot.isComposite(this._boundable2))},Ot.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Ot.prototype.expand=function(t,e,r,i){for(var o=this,s=t.getChildBoundables(),a=s.iterator();a.hasNext();){var u=a.next(),l=new Ot(u,e,o._itemDistance);l.getDistance()<i&&r.add(l)}},Ot.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Ot.prototype.getDistance=function(){return this._distance},Ot.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Ot.prototype.interfaces_=function(){return[Fe]},Ot.prototype.getClass=function(){return Ot},Ot.area=function(t){return t.getBounds().getArea()},Ot.isComposite=function(t){return t instanceof At};var Gt=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new R,this._nodeCapacity=null,arguments.length===0){var t=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];X.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Zo={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Gt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Gt.prototype.lastNode=function(t){return t.get(t.size()-1)},Gt.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof At?r+=t.size(o):o instanceof Je&&(r+=1)}return r}},Gt.prototype.removeItem=function(t,e){for(var r=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Je&&o.getItem()===e&&(r=o)}return r!==null?(t.getChildBoundables().remove(r),!0):!1},Gt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new R:e}else if(arguments.length===1){for(var r=arguments[0],i=new R,o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof At){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof Je?i.add(s.getItem()):X.shouldNeverReachHere()}return i.size()<=0?null:i}},Gt.prototype.insert=function(t,e){X.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Je(t,e))},Gt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],r=new R;return this.boundablesAtLevel(e,this._root,r),r}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(X.isTrue(i>-2),o.getLevel()===i)return s.add(o),null;for(var a=o.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof At?t.boundablesAtLevel(i,u,s):(X.isTrue(u instanceof Je),i===-1&&s.add(u))}return null}},Gt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var r=new R;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,r),r}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(V(arguments[2],pn)&&arguments[0]instanceof Object&&arguments[1]instanceof At)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var f=l.get(c);t.getIntersectsOp().intersects(f.getBounds(),s)&&(f instanceof At?t.query(s,f,u):f instanceof Je?u.visitItem(f.getItem()):X.shouldNeverReachHere())}else if(V(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof At)for(var h=arguments[0],g=arguments[1],p=arguments[2],v=g.getChildBoundables(),d=0;d<v.size();d++){var y=v.get(d);t.getIntersectsOp().intersects(y.getBounds(),h)&&(y instanceof At?t.query(h,y,p):y instanceof Je?p.add(y.getItem()):X.shouldNeverReachHere())}}},Gt.prototype.build=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},Gt.prototype.getRoot=function(){return this.build(),this._root},Gt.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,r):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=this.removeItem(o,s);if(a)return!0;for(var u=null,l=o.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof At&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}},Gt.prototype.createHigherLevels=function(t,e){X.isTrue(!t.isEmpty());var r=this.createParentBoundables(t,e+1);return r.size()===1?r.get(0):this.createHigherLevels(r,e+1)},Gt.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof At){var s=t.depth(o);s>r&&(r=s)}}return r+1}},Gt.prototype.createParentBoundables=function(t,e){var r=this;X.isTrue(!t.isEmpty());var i=new R;i.add(this.createNode(e));var o=new R(t);$e.sort(o,this.getComparator());for(var s=o.iterator();s.hasNext();){var a=s.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(e)),r.lastNode(i).addChildBoundable(a)}return i},Gt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Gt.prototype.interfaces_=function(){return[ke]},Gt.prototype.getClass=function(){return Gt},Gt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Zo.IntersectsOp.get=function(){return df},Zo.serialVersionUID.get=function(){return-3886435814360241e3},Zo.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Gt,Zo);var df=function(){},Mi=function(){};Mi.prototype.distance=function(t,e){},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var yu=function(n){function t(r){r=r||t.DEFAULT_NODE_CAPACITY,n.call(this,r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var s=this;X.isTrue(i.length>0);for(var a=new R,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new _u(i)},t.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;n.prototype.insert.call(this,i,o)}else return n.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var s=Math.trunc(Math.ceil(i.size()/o)),a=new Array(o).fill(null),u=i.iterator(),l=0;l<o;l++){a[l]=new R;for(var c=0;u.hasNext()&&c<s;){var f=u.next();a[l].add(f),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return n.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];n.prototype.query.call(this,o,s)}else if(arguments.length===3){if(V(arguments[2],pn)&&arguments[0]instanceof Object&&arguments[1]instanceof At){var a=arguments[0],u=arguments[1],l=arguments[2];n.prototype.query.call(this,a,u,l)}else if(V(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof At){var c=arguments[0],f=arguments[1],h=arguments[2];n.prototype.query.call(this,c,f,h)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return n.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return n.prototype.remove.call(this,i,o)}else return n.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){X.isTrue(!i.isEmpty());var s=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new R(i);$e.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(s))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(V(arguments[0],Mi)){var i=arguments[0],o=new Ot(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof Ot){var s=arguments[0];return this.nearestNeighbour(s,U.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&V(arguments[1],Mi)){var a=arguments[0],u=arguments[1],l=new Ot(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof Ot&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=f,g=null,p=new $r;for(p.add(c);!p.isEmpty()&&h>0;){var v=p.poll(),d=v.getDistance();if(d>=h)break;v.isLeaves()?(h=d,g=v):v.expandToQueue(p,h)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var y=arguments[0],I=arguments[1],C=arguments[2],N=new Je(y,I),L=new Ot(this.getRoot(),N,C);return this.nearestNeighbour(L)[0]}},t.prototype.interfaces_=function(){return[ni,ke]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return _u},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[Ei]},compare:function(r,i){return n.compareDoubles(t.centreX(r.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[Ei]},compare:function(r,i){return n.compareDoubles(t.centreY(r.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Gt),_u=function(n){function t(){var e=arguments[0];n.call(this,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();r===null?r=new F(o.getBounds()):r.expandToInclude(o.getBounds())}return r},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(At),de=function(){};de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de},de.relativeSign=function(t,e){return t<e?-1:t>e?1:0},de.compare=function(t,e,r){if(e.equals2D(r))return 0;var i=de.relativeSign(e.x,r.x),o=de.relativeSign(e.y,r.y);switch(t){case 0:return de.compareValue(i,o);case 1:return de.compareValue(o,i);case 2:return de.compareValue(o,-i);case 3:return de.compareValue(-i,o);case 4:return de.compareValue(-i,-o);case 5:return de.compareValue(-o,-i);case 6:return de.compareValue(-o,i);case 7:return de.compareValue(i,-o)}return X.shouldNeverReachHere("invalid octant value"),0},de.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var dn=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._segString=t,this.coord=new m(e),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(r))};dn.prototype.getCoordinate=function(){return this.coord},dn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},dn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:de.compare(this._segmentOctant,this.coord,e.coord)},dn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},dn.prototype.isInterior=function(){return this._isInterior},dn.prototype.interfaces_=function(){return[Fe]},dn.prototype.getClass=function(){return dn};var ae=function(){this._nodeMap=new Jt,this._edge=null;var t=arguments[0];this._edge=t};ae.prototype.getSplitCoordinates=function(){var t=this,e=new so;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()},ae.prototype.addCollapsedNodes=function(){var t=this,e=new R;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var r=e.iterator();r.hasNext();){var i=r.next().intValue();t.add(t._edge.getCoordinate(i),i)}},ae.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},ae.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,r=0;r<this._edge.size()-2;r++){var i=e._edge.getCoordinate(r),o=e._edge.getCoordinate(r+2);i.equals2D(o)&&t.add(new lr(r+1))}},ae.prototype.addEdgeCoordinates=function(t,e,r){var i=this,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);r.add(new m(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)r.add(i._edge.getCoordinate(a));s&&r.add(new m(e.coord))},ae.prototype.iterator=function(){return this._nodeMap.values().iterator()},ae.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},ae.prototype.findCollapseIndex=function(t,e,r){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(r[0]=t.segmentIndex+1,!0):!1},ae.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,r=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var s=i.next(),a=e.findCollapseIndex(o,s,r);a&&t.add(new lr(r[0])),o=s}},ae.prototype.getEdge=function(){return this._edge},ae.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ae.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new m(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r._edge.getCoordinate(l);return s&&(a[u]=new m(e.coord)),new xt(a,this._edge.getData())},ae.prototype.add=function(t,e){var r=new dn(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(r);return i!==null?(X.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)},ae.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),r=t.get(0),i=r.getCoordinate(0);if(!i.equals2D(e[0]))throw new Wr("bad split edge start point at "+i);var o=t.get(t.size()-1),s=o.getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new Wr("bad split edge end point at "+a)},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae};var ii=function(){};ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new pt("Cannot compute the octant for point ( "+t+", "+e+" )");var r=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?r>=i?0:1:r>=i?7:6:e>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof m&&arguments[1]instanceof m){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new pt("Cannot compute the octant for two identical points "+o);return ii.octant(a,u)}};var Fr=function(){};Fr.prototype.getCoordinates=function(){},Fr.prototype.size=function(){},Fr.prototype.getCoordinate=function(t){},Fr.prototype.isClosed=function(){},Fr.prototype.setData=function(t){},Fr.prototype.getData=function(){},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr};var vo=function(){};vo.prototype.addIntersection=function(t,e){},vo.prototype.interfaces_=function(){return[Fr]},vo.prototype.getClass=function(){return vo};var xt=function(){this._nodeList=new ae(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};xt.prototype.getCoordinates=function(){return this._pts},xt.prototype.size=function(){return this._pts.length},xt.prototype.getCoordinate=function(t){return this._pts[t]},xt.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},xt.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},xt.prototype.setData=function(t){this._data=t},xt.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ii.octant(t,e)},xt.prototype.getData=function(){return this._data},xt.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[3],s=new m(r.getIntersection(o));this.addIntersection(s,i)}},xt.prototype.toString=function(){return je.toLineString(new St(this._pts))},xt.prototype.getNodeList=function(){return this._nodeList},xt.prototype.addIntersectionNode=function(t,e){var r=e,i=r+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(r=i)}var s=this._nodeList.add(t,r);return s},xt.prototype.addIntersections=function(t,e,r){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,r,o)},xt.prototype.interfaces_=function(){return[vo]},xt.prototype.getClass=function(){return xt},xt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new R;return xt.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],o=r.iterator();o.hasNext();){var s=o.next();s.getNodeList().addSplitEdges(i)}};var k=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new m,this.p1=new m;else if(arguments.length===1){var t=arguments[0];this.p0=new m(t.p0),this.p1=new m(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this.p0=new m(e,r),this.p1=new m(i,o)}},Eu={serialVersionUID:{configurable:!0}};k.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},k.prototype.orientationIndex=function(){if(arguments[0]instanceof k){var t=arguments[0],e=M.orientationIndex(this.p0,this.p1,t.p0),r=M.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}else if(arguments[0]instanceof m){var i=arguments[0];return M.orientationIndex(this.p0,this.p1,i)}},k.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},k.prototype.isVertical=function(){return this.p0.x===this.p1.x},k.prototype.equals=function(t){if(!(t instanceof k))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},k.prototype.intersection=function(t){var e=new Dn;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},k.prototype.project=function(){if(arguments[0]instanceof m){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new m(t);var e=this.projectionFactor(t),r=new m;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof k){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1||o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new k(a,u)}},k.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},k.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},k.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},k.prototype.distancePerpendicular=function(t){return M.distancePointLinePerpendicular(t,this.p0,this.p1)},k.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},k.prototype.midPoint=function(){return k.midPoint(this.p0,this.p1)},k.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,i=e*e+r*r;if(i<=0)return U.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/i;return o},k.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var r=new Array(2).fill(null),i=U.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),r[0]=s,r[1]=t.p0;var a=this.closestPoint(t.p1);o=a.distance(t.p1),o<i&&(i=o,r[0]=a,r[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,r[0]=this.p0,r[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,r[0]=this.p1,r[1]=l),r},k.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var r=this.p0.distance(t),i=this.p1.distance(t);return r<i?this.p0:this.p1},k.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},k.prototype.getLength=function(){return this.p0.distance(this.p1)},k.prototype.compareTo=function(t){var e=t,r=this.p0.compareTo(e.p0);return r!==0?r:this.p1.compareTo(e.p1)},k.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},k.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},k.prototype.lineIntersection=function(t){try{var e=He.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(r){if(!(r instanceof Ii))throw r}finally{}return null},k.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},k.prototype.pointAlongOffset=function(t,e){var r=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,a=Math.sqrt(o*o+s*s),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/a,l=e*s/a}var c=r-l,f=i+u,h=new m(c,f);return h},k.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=r.x,this.p1.y=r.y}},k.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||U.isNaN(e))&&(e=1),e},k.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},k.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},k.prototype.distance=function(){if(arguments[0]instanceof k){var t=arguments[0];return M.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof m){var e=arguments[0];return M.distancePointLine(e,this.p0,this.p1)}},k.prototype.pointAlong=function(t){var e=new m;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},k.prototype.hashCode=function(){var t=U.doubleToLongBits(this.p0.x);t^=U.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),r=U.doubleToLongBits(this.p1.x);r^=U.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return e^i},k.prototype.interfaces_=function(){return[Fe,ke]},k.prototype.getClass=function(){return k},k.midPoint=function(t,e){return new m((t.x+e.x)/2,(t.y+e.y)/2)},Eu.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(k,Eu);var mo=function(){this.tempEnv1=new F,this.tempEnv2=new F,this._overlapSeg1=new k,this._overlapSeg2=new k};mo.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo};var Ie=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=i};Ie.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Ie.prototype.computeSelect=function(t,e,r,i){var o=this._pts[e],s=this._pts[r];if(i.tempEnv1.init(o,s),r-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+r)/2);e<a&&this.computeSelect(t,e,a,i),a<r&&this.computeSelect(t,a,r,i)},Ie.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)e[r++]=t._pts[i];return e},Ie.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Ie.prototype.setId=function(t){this._id=t},Ie.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Ie.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new F(t,e)}return this._env},Ie.prototype.getEndIndex=function(){return this._end},Ie.prototype.getStartIndex=function(){return this._start},Ie.prototype.getContext=function(){return this._context},Ie.prototype.getId=function(){return this._id},Ie.prototype.computeOverlapsInternal=function(t,e,r,i,o,s){var a=this._pts[t],u=this._pts[e],l=r._pts[i],c=r._pts[o];if(e-t===1&&o-i===1)return s.overlap(this,t,r,i),null;if(s.tempEnv1.init(a,u),s.tempEnv2.init(l,c),!s.tempEnv1.intersects(s.tempEnv2))return null;var f=Math.trunc((t+e)/2),h=Math.trunc((i+o)/2);t<f&&(i<h&&this.computeOverlapsInternal(t,f,r,i,h,s),h<o&&this.computeOverlapsInternal(t,f,r,h,o,s)),f<e&&(i<h&&this.computeOverlapsInternal(f,e,r,i,h,s),h<o&&this.computeOverlapsInternal(f,e,r,h,o,s))},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.getChainStartIndices=function(t){var e=0,r=new R;r.add(new lr(e));do{var i=_r.findChainEnd(t,e);r.add(new lr(i)),e=i}while(e<t.length-1);var o=_r.toIntArray(r);return o},_r.findChainEnd=function(t,e){for(var r=e;r<t.length-1&&t[r].equals2D(t[r+1]);)r++;if(r>=t.length-1)return t.length-1;for(var i=ot.quadrant(t[r],t[r+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var s=ot.quadrant(t[o-1],t[o]);if(s!==i)break}o++}return o-1},_r.getChains=function(){if(arguments.length===1){var t=arguments[0];return _r.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],r=arguments[1],i=new R,o=_r.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new Ie(e,o[s],o[s+1],r);i.add(a)}return i}},_r.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var kn=function(){};kn.prototype.computeNodes=function(t){},kn.prototype.getNodedSubstrings=function(){},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn};var yo=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};yo.prototype.setSegmentIntersector=function(t){this._segInt=t},yo.prototype.interfaces_=function(){return[kn]},yo.prototype.getClass=function(){return yo};var qs=function(n){function t(r){r?n.call(this,r):n.call(this),this._monoChains=new R,this._index=new yu,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return xt.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=_r.getChains(i.getCoordinates(),i),a=s.iterator();a.hasNext();){var u=a.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var s=i.iterator();s.hasNext();)o.add(s.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new Cu(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var a=s.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Cu},Object.defineProperties(t,e),t}(yo),Cu=function(n){function t(){n.call(this),this._si=null;var e=arguments[0];this._si=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=r.getContext(),u=o.getContext();this._si.processIntersections(a,i,u,s)}else return n.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(mo),$=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},tn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};$.prototype.getEndCapStyle=function(){return this._endCapStyle},$.prototype.isSingleSided=function(){return this._isSingleSided},$.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=$.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=$.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==$.JOIN_ROUND&&(this._quadrantSegments=$.DEFAULT_QUADRANT_SEGMENTS)},$.prototype.getJoinStyle=function(){return this._joinStyle},$.prototype.setJoinStyle=function(t){this._joinStyle=t},$.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},$.prototype.getSimplifyFactor=function(){return this._simplifyFactor},$.prototype.getQuadrantSegments=function(){return this._quadrantSegments},$.prototype.setEndCapStyle=function(t){this._endCapStyle=t},$.prototype.getMitreLimit=function(){return this._mitreLimit},$.prototype.setMitreLimit=function(t){this._mitreLimit=t},$.prototype.setSingleSided=function(t){this._isSingleSided=t},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},tn.CAP_ROUND.get=function(){return 1},tn.CAP_FLAT.get=function(){return 2},tn.CAP_SQUARE.get=function(){return 3},tn.JOIN_ROUND.get=function(){return 1},tn.JOIN_MITRE.get=function(){return 2},tn.JOIN_BEVEL.get=function(){return 3},tn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},tn.DEFAULT_MITRE_LIMIT.get=function(){return 5},tn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties($,tn);var _t=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=M.COUNTERCLOCKWISE,this._inputLine=t||null},_o={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};_t.prototype.isDeletable=function(t,e,r,i){var o=this._inputLine[t],s=this._inputLine[e],a=this._inputLine[r];return!this.isConcave(o,s,a)||!this.isShallow(o,s,a,i)?!1:this.isShallowSampled(o,s,t,r,i)},_t.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,r=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(r),o=!1;i<this._inputLine.length;){var s=!1;t.isDeletable(e,r,i,t._distanceTol)&&(t._isDeleted[r]=_t.DELETE,s=!0,o=!0),s?e=i:e=r,r=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(r)}return o},_t.prototype.isShallowConcavity=function(t,e,r,i){var o=M.computeOrientation(t,e,r),s=o===this._angleOrientation;if(!s)return!1;var a=M.distancePointLine(e,t,r);return a<i},_t.prototype.isShallowSampled=function(t,e,r,i,o){var s=this,a=Math.trunc((i-r)/_t.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=r;u<i;u+=a)if(!s.isShallow(t,e,s._inputLine[u],o))return!1;return!0},_t.prototype.isConcave=function(t,e,r){var i=M.computeOrientation(t,e,r),o=i===this._angleOrientation;return o},_t.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=M.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var r=!1;do r=e.deleteShallowConcavities();while(r);return this.collapseLine()},_t.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===_t.DELETE;)e++;return e},_t.prototype.isShallow=function(t,e,r,i){var o=M.distancePointLine(e,t,r);return o<i},_t.prototype.collapseLine=function(){for(var t=this,e=new so,r=0;r<this._inputLine.length;r++)t._isDeleted[r]!==_t.DELETE&&e.add(t._inputLine[r]);return e.toCoordinateArray()},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t},_t.simplify=function(t,e){var r=new _t(t);return r.simplify(e)},_o.INIT.get=function(){return 0},_o.DELETE.get=function(){return 1},_o.KEEP.get=function(){return 1},_o.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(_t,_o);var Oe=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new R},Iu={COORDINATE_ARRAY_TYPE:{configurable:!0}};Oe.prototype.getCoordinates=function(){var t=this._ptList.toArray(Oe.COORDINATE_ARRAY_TYPE);return t},Oe.prototype.setPrecisionModel=function(t){this._precisionModel=t},Oe.prototype.addPt=function(t){var e=new m(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Oe.prototype.revere=function(){},Oe.prototype.addPts=function(t,e){var r=this;if(e)for(var i=0;i<t.length;i++)r.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)r.addPt(t[o])},Oe.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),r=t.distance(e);return r<this._minimimVertexDistance},Oe.prototype.toString=function(){var t=new H,e=t.createLineString(this.getCoordinates());return e.toString()},Oe.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new m(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Oe.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Iu.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Oe,Iu);var j=function(){},oi={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.toDegrees=function(t){return t*180/Math.PI},j.normalize=function(t){for(;t>Math.PI;)t-=j.PI_TIMES_2;for(;t<=-Math.PI;)t+=j.PI_TIMES_2;return t},j.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=r.x-e.x,o=r.y-e.y;return Math.atan2(o,i)}},j.isAcute=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=r.x-e.x,a=r.y-e.y,u=i*s+o*a;return u>0},j.isObtuse=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=r.x-e.x,a=r.y-e.y,u=i*s+o*a;return u<0},j.interiorAngle=function(t,e,r){var i=j.angle(e,t),o=j.angle(e,r);return Math.abs(o-i)},j.normalizePositive=function(t){if(t<0){for(;t<0;)t+=j.PI_TIMES_2;t>=j.PI_TIMES_2&&(t=0)}else{for(;t>=j.PI_TIMES_2;)t-=j.PI_TIMES_2;t<0&&(t=0)}return t},j.angleBetween=function(t,e,r){var i=j.angle(e,t),o=j.angle(e,r);return j.diff(i,o)},j.diff=function(t,e){var r=null;return t<e?r=e-t:r=t-e,r>Math.PI&&(r=2*Math.PI-r),r},j.toRadians=function(t){return t*Math.PI/180},j.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?j.COUNTERCLOCKWISE:r<0?j.CLOCKWISE:j.NONE},j.angleBetweenOriented=function(t,e,r){var i=j.angle(e,t),o=j.angle(e,r),s=o-i;return s<=-Math.PI?s+j.PI_TIMES_2:s>Math.PI?s-j.PI_TIMES_2:s},oi.PI_TIMES_2.get=function(){return 2*Math.PI},oi.PI_OVER_2.get=function(){return Math.PI/2},oi.PI_OVER_4.get=function(){return Math.PI/4},oi.COUNTERCLOCKWISE.get=function(){return M.COUNTERCLOCKWISE},oi.CLOCKWISE.get=function(){return M.CLOCKWISE},oi.NONE.get=function(){return M.COLLINEAR},Object.defineProperties(j,oi);var ft=function n(){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 k,this._seg1=new k,this._offset0=new k,this._offset1=new k,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Dn,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===$.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Eo={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};ft.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=M.computeOrientation(this._s0,this._s1,this._s2),i=r===M.CLOCKWISE&&this._side===P.LEFT||r===M.COUNTERCLOCKWISE&&this._side===P.RIGHT;r===0?this.addCollinear(e):i?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},ft.prototype.addLineEndCap=function(t,e){var r=new k(t,e),i=new k;this.computeOffsetSegment(r,P.LEFT,this._distance,i);var o=new k;this.computeOffsetSegment(r,P.RIGHT,this._distance,o);var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s);switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,M.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case $.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case $.CAP_SQUARE:var l=new m;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new m(i.p1.x+l.x,i.p1.y+l.y),f=new m(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}},ft.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},ft.prototype.addMitreJoin=function(t,e,r,i){var o=!0,s=null;try{s=He.intersection(e.p0,e.p1,r.p0,r.p1);var a=i<=0?1:s.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof Ii)s=new m(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,r,i,this._bufParams.getMitreLimit())},ft.prototype.addFilletCorner=function(t,e,r,i,o){var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s),l=r.x-t.x,c=r.y-t.y,f=Math.atan2(c,l);i===M.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(r)},ft.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ft.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===$.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===$.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},ft.prototype.createSquare=function(t){this._segList.addPt(new m(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new m(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new m(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new m(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ft.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ft.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ft.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ft.prototype.initSideSegments=function(t,e,r){this._s1=t,this._s2=e,this._side=r,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)},ft.prototype.addLimitedMitreJoin=function(t,e,r,i){var o=this._seg0.p1,s=j.angle(o,this._seg0.p0),a=j.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=j.normalize(s+u),c=j.normalize(l+Math.PI),f=i*r,h=f*Math.abs(Math.sin(u)),g=r-h,p=o.x+f*Math.cos(c),v=o.y+f*Math.sin(c),d=new m(p,v),y=new k(o,d),I=y.pointAlongOffset(1,g),C=y.pointAlongOffset(1,-g);this._side===P.LEFT?(this._segList.addPt(I),this._segList.addPt(C)):(this._segList.addPt(C),this._segList.addPt(I))},ft.prototype.computeOffsetSegment=function(t,e,r,i){var o=e===P.LEFT?1:-1,s=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(s*s+a*a),l=o*r*s/u,c=o*r*a/u;i.p0.x=t.p0.x-c,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-c,i.p1.y=t.p1.y+l},ft.prototype.addFilletArc=function(t,e,r,i,o){var s=this,a=i===M.CLOCKWISE?-1:1,u=Math.abs(e-r),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,f=u/l,h=c,g=new m;h<u;){var p=e+a*h;g.x=t.x+o*Math.cos(p),g.y=t.y+o*Math.sin(p),s._segList.addPt(g),h+=f}},ft.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*ft.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new m((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 m((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)}},ft.prototype.createCircle=function(t){var e=new m(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ft.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ft.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Oe,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ft.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ft.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===$.JOIN_BEVEL||this._bufParams.getJoinStyle()===$.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,M.CLOCKWISE,this._distance))},ft.prototype.closeRing=function(){this._segList.closeRing()},ft.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},Eo.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Eo.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Eo.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Eo.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ft,Eo);var ve=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};ve.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var r=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,r,o);var s=o.getCoordinates();return r&&W.reverse(s),s},ve.prototype.computeSingleSidedBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var o=_t.simplify(t,-i),s=o.length-1;r.initSideSegments(o[s],o[s-1],P.LEFT),r.addFirstSegment();for(var a=s-2;a>=0;a--)r.addNextSegment(o[a],!0)}else{r.addSegments(t,!1);var u=_t.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],P.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment(),r.closeRing()},ve.prototype.computeRingBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);e===P.RIGHT&&(i=-i);var o=_t.simplify(t,i),s=o.length-1;r.initSideSegments(o[s-1],o[0],e);for(var a=1;a<=s;a++){var u=a!==1;r.addNextSegment(o[a],u)}r.closeRing()},ve.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),i=_t.simplify(t,r),o=i.length-1;e.initSideSegments(i[0],i[1],P.LEFT);for(var s=2;s<=o;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var a=_t.simplify(t,-r),u=a.length-1;e.initSideSegments(a[u],a[u-1],P.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},ve.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:e.createCircle(t);break;case $.CAP_SQUARE:e.createSquare(t);break}},ve.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var r=Math.abs(e),i=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var s=i.getCoordinates();return s},ve.prototype.getBufferParameters=function(){return this._bufParams},ve.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},ve.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(r===0)return ve.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},ve.prototype.computeOffsetCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){var o=_t.simplify(t,-i),s=o.length-1;r.initSideSegments(o[s],o[s-1],P.LEFT),r.addFirstSegment();for(var a=s-2;a>=0;a--)r.addNextSegment(o[a],!0)}else{var u=_t.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],P.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment()},ve.prototype.getSegGen=function(t){return new ft(this._precisionModel,this._bufParams,t)},ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve},ve.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;r<e.length;r++)e[r]=new m(t[r]);return e};var si=function(){this._subgraphs=null,this._seg=new k,this._cga=new M;var t=arguments[0];this._subgraphs=t},Nu={DepthSegment:{configurable:!0}};si.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=new R,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),s=o.getEnvelope();e.y<s.getMinY()||e.y>s.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(V(arguments[2],Ke)&&arguments[0]instanceof m&&arguments[1]instanceof Us)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),f=0;f<c.length-1;f++){t._seg.p0=c[f],t._seg.p1=c[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var h=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(h<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&M.computeOrientation(t._seg.p0,t._seg.p1,a)!==M.RIGHT){var g=u.getDepth(P.LEFT);t._seg.p0.equals(c[f])||(g=u.getDepth(P.RIGHT));var p=new Bn(t._seg,g);l.add(p)}}else if(V(arguments[2],Ke)&&arguments[0]instanceof m&&V(arguments[1],Ke))for(var v=arguments[0],d=arguments[1],y=arguments[2],I=d.iterator();I.hasNext();){var C=I.next();C.isForward()&&t.findStabbedSegments(v,C,y)}}},si.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var r=$e.min(e);return r._leftDepth},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},Nu.DepthSegment.get=function(){return Bn},Object.defineProperties(si,Nu);var Bn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new k(t),this._leftDepth=e};Bn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return r!==0||(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(e._upwardSeg)},Bn.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return r!==0?r:t.p1.compareTo(e.p1)},Bn.prototype.toString=function(){return this._upwardSeg.toString()},Bn.prototype.interfaces_=function(){return[Fe]},Bn.prototype.getClass=function(){return Bn};var tt=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};tt.prototype.area=function(){return tt.area(this.p0,this.p1,this.p2)},tt.prototype.signedArea=function(){return tt.signedArea(this.p0,this.p1,this.p2)},tt.prototype.interpolateZ=function(t){if(t===null)throw new pt("Supplied point is null.");return tt.interpolateZ(t,this.p0,this.p1,this.p2)},tt.prototype.longestSideLength=function(){return tt.longestSideLength(this.p0,this.p1,this.p2)},tt.prototype.isAcute=function(){return tt.isAcute(this.p0,this.p1,this.p2)},tt.prototype.circumcentre=function(){return tt.circumcentre(this.p0,this.p1,this.p2)},tt.prototype.area3D=function(){return tt.area3D(this.p0,this.p1,this.p2)},tt.prototype.centroid=function(){return tt.centroid(this.p0,this.p1,this.p2)},tt.prototype.inCentre=function(){return tt.inCentre(this.p0,this.p1,this.p2)},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},tt.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},tt.det=function(t,e,r,i){return t*i-e*r},tt.interpolateZ=function(t,e,r,i){var o=e.x,s=e.y,a=r.x-o,u=i.x-o,l=r.y-s,c=i.y-s,f=a*c-u*l,h=t.x-o,g=t.y-s,p=(c*h-u*g)/f,v=(-l*h+a*g)/f,d=e.z+p*(r.z-e.z)+v*(i.z-e.z);return d},tt.longestSideLength=function(t,e,r){var i=t.distance(e),o=e.distance(r),s=r.distance(t),a=i;return o>a&&(a=o),s>a&&(a=s),a},tt.isAcute=function(t,e,r){return!(!j.isAcute(t,e,r)||!j.isAcute(e,r,t)||!j.isAcute(r,t,e))},tt.circumcentre=function(t,e,r){var i=r.x,o=r.y,s=t.x-i,a=t.y-o,u=e.x-i,l=e.y-o,c=2*tt.det(s,a,u,l),f=tt.det(a,s*s+a*a,l,u*u+l*l),h=tt.det(s,s*s+a*a,u,u*u+l*l),g=i-f/c,p=o+h/c;return new m(g,p)},tt.perpendicularBisector=function(t,e){var r=e.x-t.x,i=e.y-t.y,o=new He(t.x+r/2,t.y+i/2,1),s=new He(t.x-i+r/2,t.y+r+i/2,1);return new He(o,s)},tt.angleBisector=function(t,e,r){var i=e.distance(t),o=e.distance(r),s=i/(i+o),a=r.x-t.x,u=r.y-t.y,l=new m(t.x+s*a,t.y+s*u);return l},tt.area3D=function(t,e,r){var i=e.x-t.x,o=e.y-t.y,s=e.z-t.z,a=r.x-t.x,u=r.y-t.y,l=r.z-t.z,c=o*l-s*u,f=s*a-i*l,h=i*u-o*a,g=c*c+f*f+h*h,p=Math.sqrt(g)/2;return p},tt.centroid=function(t,e,r){var i=(t.x+e.x+r.x)/3,o=(t.y+e.y+r.y)/3;return new m(i,o)},tt.inCentre=function(t,e,r){var i=e.distance(r),o=t.distance(r),s=t.distance(e),a=i+o+s,u=(i*t.x+o*e.x+s*r.x)/a,l=(i*t.y+o*e.y+s*r.y)/a;return new m(u,l)};var Ue=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new R;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Ue.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,_.EXTERIOR,_.INTERIOR)},Ue.prototype.addPolygon=function(t){var e=this,r=this._distance,i=P.LEFT;this._distance<0&&(r=-this._distance,i=P.RIGHT);var o=t.getExteriorRing(),s=W.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&s.length<3)return null;this.addPolygonRing(s,r,i,_.EXTERIOR,_.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=W.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,r,P.opposite(i),_.INTERIOR,_.EXTERIOR)}},Ue.prototype.isTriangleErodedCompletely=function(t,e){var r=new tt(t[0],t[1],t[2]),i=r.inCentre(),o=M.distancePointLine(i,r.p0,r.p1);return o<Math.abs(e)},Ue.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=W.removeRepeatedPoints(t.getCoordinates()),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,_.EXTERIOR,_.INTERIOR)},Ue.prototype.addCurve=function(t,e,r){if(t===null||t.length<2)return null;var i=new xt(t,new nt(0,_.BOUNDARY,e,r));this._curveList.add(i)},Ue.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ue.prototype.addPolygonRing=function(t,e,r,i,o){if(e===0&&t.length<Dr.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=Dr.MINIMUM_VALID_SIZE&&M.isCCW(t)&&(s=o,a=i,r=P.opposite(r));var u=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(u,s,a)},Ue.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Mt?this.addPolygon(t):t instanceof yt?this.addLineString(t):t instanceof Ee?this.addPoint(t):t instanceof Ri?this.addCollection(t):t instanceof Fn?this.addCollection(t):t instanceof Mr?this.addCollection(t):t instanceof oe&&this.addCollection(t)},Ue.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(r.length===4)return this.isTriangleErodedCompletely(r,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o},Ue.prototype.addCollection=function(t){for(var e=this,r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);e.add(i)}},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue};var Ai=function(){};Ai.prototype.locate=function(t){},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var kr=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()};kr.prototype.next=function(){if(this._atStart)return this._atStart=!1,kr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Pi;var t=this._parent.getGeometryN(this._index++);return t instanceof oe?(this._subcollectionIterator=new kr(t),this._subcollectionIterator.next()):t},kr.prototype.remove=function(){throw new Error(this.getClass().getName())},kr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},kr.prototype.interfaces_=function(){return[wi]},kr.prototype.getClass=function(){return kr},kr.isAtomic=function(t){return!(t instanceof oe)};var Re=function(){this._geom=null;var t=arguments[0];this._geom=t};Re.prototype.locate=function(t){return Re.locate(t,this._geom)},Re.prototype.interfaces_=function(){return[Ai]},Re.prototype.getClass=function(){return Re},Re.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.isPointInRing(t,e.getCoordinates()):!1},Re.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Re.isPointInRing(t,r))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(Re.isPointInRing(t,o))return!1}return!0},Re.containsPoint=function(t,e){if(e instanceof Mt)return Re.containsPointInPolygon(t,e);if(e instanceof oe)for(var r=new kr(e);r.hasNext();){var i=r.next();if(i!==e&&Re.containsPoint(t,i))return!0}return!1},Re.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:Re.containsPoint(t,e)?_.INTERIOR:_.EXTERIOR};var te=function(){this._edgeMap=new Jt,this._edgeList=null,this._ptInAreaLocation=[_.NONE,_.NONE]};te.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),r=e-1;return e===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)},te.prototype.propagateSideLabels=function(t){for(var e=_.NONE,r=this.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,P.LEFT)!==_.NONE&&(e=o.getLocation(t,P.LEFT))}if(e===_.NONE)return null;for(var s=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,P.ON)===_.NONE&&l.setLocation(t,P.ON,s),l.isArea(t)){var c=l.getLocation(t,P.LEFT),f=l.getLocation(t,P.RIGHT);if(f!==_.NONE){if(f!==s)throw new Jr("side location conflict",u.getCoordinate());c===_.NONE&&X.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else X.isTrue(l.getLocation(t,P.LEFT)===_.NONE,"found single null side"),l.setLocation(t,P.RIGHT,s),l.setLocation(t,P.LEFT,s)}}},te.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},te.prototype.print=function(t){Ut.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},te.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},te.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var r=e.size()-1,i=e.get(r).getLabel(),o=i.getLocation(t,P.LEFT);X.isTrue(o!==_.NONE,"Found unlabelled area edge");for(var s=o,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();X.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,P.LEFT),f=l.getLocation(t,P.RIGHT);if(c===f||f!==s)return!1;s=c}return!0},te.prototype.findIndex=function(t){var e=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=e._edgeList.get(r);if(i===t)return r}return-1},te.prototype.iterator=function(){return this.getEdges().iterator()},te.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new R(this._edgeMap.values())),this._edgeList},te.prototype.getLocation=function(t,e,r){return this._ptInAreaLocation[t]===_.NONE&&(this._ptInAreaLocation[t]=Re.locate(e,r[t].getGeometry())),this._ptInAreaLocation[t]},te.prototype.toString=function(){var t=new ur;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
22
+ `);var o=t+(e?" ":"│ ");n.left&&Ss(n.left,o,!1,r,i),n.right&&Ss(n.right,o,!0,r,i)}}var xs=function(){function n(t){t===void 0&&(t=Oc),this._root=null,this._size=0,this._comparator=t}return n.prototype.insert=function(t,e){return this._size++,this._root=Ns(t,e,this._root,this._comparator)},n.prototype.add=function(t,e){var r=new On(t,e);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,o=Rn(t,this._root,i),s=i(t,o.key);return s===0?this._root=o:(s<0?(r.left=o.left,r.right=o,o.left=null):s>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},n.prototype._remove=function(t,e,r){var i;if(e===null)return null;e=Rn(t,e,r);var o=r(t,e.key);return o===0?(e.left===null?i=e.right:(i=Rn(t,e.left,r),i.right=e.right),this._size--,i):e},n.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Rn(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},n.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},n.prototype.find=function(t){return this._root&&(this._root=Rn(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},n.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},n.prototype.forEach=function(t,e){for(var r=this._root,i=[],o=!1;!o;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),t.call(e,r),r=r.right):o=!0;return this},n.prototype.range=function(t,e,r,i){for(var o=[],s=this._comparator,a=this._root,u;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),u=s(a.key,e),u>0)break;if(s(a.key,t)>=0&&r.call(i,a))return this;a=a.right}return this},n.prototype.keys=function(){var t=[];return this.forEach(function(e){var r=e.key;return t.push(r)}),t},n.prototype.values=function(){var t=[];return this.forEach(function(e){var r=e.data;return t.push(r)}),t},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},n.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},n.prototype.at=function(t){for(var e=this._root,r=!1,i=0,o=[];!r;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(r=e,e=e.left):e=e.right}return r},n.prototype.prev=function(t){var e=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(r=e,e=e.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return Dc(this._root)},n.prototype.load=function(t,e,r){e===void 0&&(e=[]),r===void 0&&(r=!1);var i=t.length,o=this._comparator;if(r&&ws(t,e,0,i-1,o),this._root===null)this._root=Ls(t,e,0,i),this._size=i;else{var s=Mc(this.toList(),Tc(t,e),o);i=this._size+i,this._root=bs({head:s},0,i)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var e=[];return Ss(this._root,"",!0,function(r){return e.push(r)},t),e.join("")},n.prototype.update=function(t,e,r){var i=this._comparator,o=za(t,this._root,i),s=o.left,a=o.right;i(t,e)<0?a=Ns(e,r,a,i):s=Ns(e,r,s,i),this._root=Rc(s,a,i)},n.prototype.split=function(t){return za(t,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var t,e,r;return Pc(this,function(i){switch(i.label){case 0:t=this._root,e=[],r=!1,i.label=1;case 1:return r?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:r=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Ls(n,t,e,r){var i=r-e;if(i>0){var o=e+Math.floor(i/2),s=n[o],a=t[o],u=new On(s,a);return u.left=Ls(n,t,e,o),u.right=Ls(n,t,o+1,r),u}return null}function Tc(n,t){for(var e=new On(null,null),r=e,i=0;i<n.length;i++)r=r.next=new On(n[i],t[i]);return r.next=null,e.next}function Dc(n){for(var t=n,e=[],r=!1,i=new On(null,null),o=i;!r;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):r=!0;return o.next=null,i.next}function bs(n,t,e){var r=e-t;if(r>0){var i=t+Math.floor(r/2),o=bs(n,t,i),s=n.head;return s.left=o,n.head=n.head.next,s.right=bs(n,i+1,e),s}return null}function Mc(n,t,e){for(var r=new On(null,null),i=r,o=n,s=t;o!==null&&s!==null;)e(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),r.next}function ws(n,t,e,r,i){if(!(e>=r)){for(var o=n[e+r>>1],s=e-1,a=r+1;;){do s++;while(i(n[s],o)<0);do a--;while(i(n[a],o)>0);if(s>=a)break;var u=n[s];n[s]=n[a],n[a]=u,u=t[s],t[s]=t[a],t[a]=u}ws(n,t,e,a,i),ws(n,t,a+1,r,i)}}function ar(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Va(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function Le(n,t,e){return t&&Va(n.prototype,t),e&&Va(n,e),n}var to=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Ps=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var r=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,s=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:r,y:o},ur:{x:i,y:s}}},Tn=Number.EPSILON;Tn===void 0&&(Tn=Math.pow(2,-52));var Ac=Tn*Tn,Os=function(t,e){if(-Tn<t&&t<Tn&&-Tn<e&&e<Tn)return 0;var r=t-e;return r*r<Ac*t*e?0:t<e?-1:1},Fc=function(){function n(){ar(this,n),this.reset()}return Le(n,[{key:"reset",value:function(){this.xRounder=new Ua,this.yRounder=new Ua}},{key:"round",value:function(e,r){return{x:this.xRounder.round(e),y:this.yRounder.round(r)}}}]),n}(),Ua=function(){function n(){ar(this,n),this.tree=new xs,this.round(0)}return Le(n,[{key:"round",value:function(e){var r=this.tree.add(e),i=this.tree.prev(r);if(i!==null&&Os(r.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(r);return o!==null&&Os(r.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),n}(),eo=new Fc,ro=function(t,e){return t.x*e.y-t.y*e.x},qa=function(t,e){return t.x*e.x+t.y*e.y},Xa=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y},s=ro(i,o);return Os(s,0)},Mo=function(t){return Math.sqrt(qa(t,t))},kc=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return ro(o,i)/Mo(o)/Mo(i)},Bc=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return qa(o,i)/Mo(o)/Mo(i)},Ya=function(t,e,r){return e.y===0?null:{x:t.x+e.x/e.y*(r-t.y),y:r}},Wa=function(t,e,r){return e.x===0?null:{x:r,y:t.y+e.y/e.x*(r-t.x)}},Gc=function(t,e,r,i){if(e.x===0)return Wa(r,i,t.x);if(i.x===0)return Wa(t,e,r.x);if(e.y===0)return Ya(r,i,t.y);if(i.y===0)return Ya(t,e,r.y);var o=ro(e,i);if(o==0)return null;var s={x:r.x-t.x,y:r.y-t.y},a=ro(s,e)/o,u=ro(s,i)/o,l=t.x+u*e.x,c=r.x+a*i.x,f=t.y+u*e.y,h=r.y+a*i.y,g=(l+c)/2,p=(f+h)/2;return{x:g,y:p}},Xr=function(){Le(n,null,[{key:"compare",value:function(e,r){var i=n.comparePoints(e.point,r.point);return i!==0?i:(e.point!==r.point&&e.link(r),e.isLeft!==r.isLeft?e.isLeft?1:-1:Ao.compare(e.segment,r.segment))}},{key:"comparePoints",value:function(e,r){return e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0}}]);function n(t,e){ar(this,n),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return Le(n,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var r=e.point.events,i=0,o=r.length;i<o;i++){var s=r[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,r=0;r<e;r++){var i=this.point.events[r];if(i.segment.consumedBy===void 0)for(var o=r+1;o<e;o++){var s=this.point.events[o];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],r=0,i=this.point.events.length;r<i;r++){var o=this.point.events[r];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var r=this,i=new Map,o=function(a){var u=a.otherSE;i.set(a,{sine:kc(r.point,e.point,u.point),cosine:Bc(r.point,e.point,u.point)})};return function(s,a){i.has(s)||o(s),i.has(a)||o(a);var u=i.get(s),l=u.sine,c=u.cosine,f=i.get(a),h=f.sine,g=f.cosine;return l>=0&&h>=0?c<g?1:c>g?-1:0:l<0&&h<0?c<g?-1:c>g?1:0:h<l?-1:h>l?1:0}}}]),n}(),zc=0,Ao=function(){Le(n,null,[{key:"compare",value:function(e,r){var i=e.leftSE.point.x,o=r.leftSE.point.x,s=e.rightSE.point.x,a=r.rightSE.point.x;if(a<i)return 1;if(s<o)return-1;var u=e.leftSE.point.y,l=r.leftSE.point.y,c=e.rightSE.point.y,f=r.rightSE.point.y;if(i<o){if(l<u&&l<c)return 1;if(l>u&&l>c)return-1;var h=e.comparePoint(r.leftSE.point);if(h<0)return 1;if(h>0)return-1;var g=r.comparePoint(e.rightSE.point);return g!==0?g:-1}if(i>o){if(u<l&&u<f)return-1;if(u>l&&u>f)return 1;var p=r.comparePoint(e.leftSE.point);if(p!==0)return p;var y=e.comparePoint(r.rightSE.point);return y<0?1:y>0?-1:1}if(u<l)return-1;if(u>l)return 1;if(s<a){var d=r.comparePoint(e.rightSE.point);if(d!==0)return d}if(s>a){var v=e.comparePoint(r.rightSE.point);if(v<0)return 1;if(v>0)return-1}if(s!==a){var C=c-u,I=s-i,N=f-l,L=a-o;if(C>I&&N<L)return 1;if(C<I&&N>L)return-1}return s>a?1:s<a||c<f?-1:c>f?1:e.id<r.id?-1:e.id>r.id?1:0}}]);function n(t,e,r,i){ar(this,n),this.id=++zc,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=r,this.windings=i}return Le(n,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<r?e:r},ur:{x:this.rightSE.point.x,y:e>r?e:r}}}},{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(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var r=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(r.x===i.x)return e.x===r.x?0:e.x<r.x?1:-1;var s=(e.y-r.y)/o.y,a=r.x+s*o.x;if(e.x===a)return 0;var u=(e.x-r.x)/o.x,l=r.y+u*o.y;return e.y===l?0:e.y<l?-1:1}},{key:"getIntersection",value:function(e){var r=this.bbox(),i=e.bbox(),o=Ps(r,i);if(o===null)return null;var s=this.leftSE.point,a=this.rightSE.point,u=e.leftSE.point,l=e.rightSE.point,c=to(r,u)&&this.comparePoint(u)===0,f=to(i,s)&&e.comparePoint(s)===0,h=to(r,l)&&this.comparePoint(l)===0,g=to(i,a)&&e.comparePoint(a)===0;if(f&&c)return g&&!h?a:!g&&h?l:null;if(f)return h&&s.x===l.x&&s.y===l.y?null:s;if(c)return g&&a.x===u.x&&a.y===u.y?null:u;if(g&&h)return null;if(g)return a;if(h)return l;var p=Gc(s,this.vector(),u,e.vector());return p===null||!to(o,p)?null:eo.round(p.x,p.y)}},{key:"split",value:function(e){var r=[],i=e.events!==void 0,o=new Xr(e,!0),s=new Xr(e,!1),a=this.rightSE;this.replaceRightSE(s),r.push(s),r.push(o);var u=new n(o,a,this.rings.slice(),this.windings.slice());return Xr.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Xr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),r}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var r=0,i=this.windings.length;r<i;r++)this.windings[r]*=-1}},{key:"consume",value:function(e){for(var r=this,i=e;r.consumedBy;)r=r.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=n.compare(r,i);if(o!==0){if(o>0){var s=r;r=i,i=s}if(r.prev===i){var a=r;r=i,i=a}for(var u=0,l=i.rings.length;u<l;u++){var c=i.rings[u],f=i.windings[u],h=r.rings.indexOf(c);h===-1?(r.rings.push(c),r.windings.push(f)):r.windings[h]+=f}i.rings=null,i.windings=null,i.consumedBy=r,i.leftSE.consumedBy=r.leftSE,i.rightSE.consumedBy=r.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var r=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,s=0,a=this.rings.length;s<a;s++){var u=this.rings[s],l=this.windings[s],c=r.indexOf(u);c===-1?(r.push(u),i.push(l)):i[c]+=l}for(var f=[],h=[],g=0,p=r.length;g<p;g++)if(i[g]!==0){var y=r[g],d=y.poly;if(h.indexOf(d)===-1)if(y.isExterior)f.push(d);else{h.indexOf(d)===-1&&h.push(d);var v=f.indexOf(y.poly);v!==-1&&f.splice(v,1)}}for(var C=0,I=f.length;C<I;C++){var N=f[C].multiPoly;o.indexOf(N)===-1&&o.push(N)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(Or.type){case"union":{var i=e.length===0,o=r.length===0;this._isInResult=i!==o;break}case"intersection":{var s,a;e.length<r.length?(s=e.length,a=r.length):(s=r.length,a=e.length),this._isInResult=a===Or.numMultiPolys&&s<a;break}case"xor":{var u=Math.abs(e.length-r.length);this._isInResult=u%2===1;break}case"difference":{var l=function(f){return f.length===1&&f[0].isSubject};this._isInResult=l(e)!==l(r);break}default:throw new Error("Unrecognized operation type found ".concat(Or.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,r,i){var o,s,a,u=Xr.comparePoints(e,r);if(u<0)o=e,s=r,a=1;else if(u>0)o=r,s=e,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new Xr(o,!0),c=new Xr(s,!1);return new n(l,c,[i],[a])}}]),n}(),Ha=function(){function n(t,e,r){if(ar(this,n),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=eo.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=t.length;s<a;s++){if(typeof t[s][0]!="number"||typeof t[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=eo.round(t[s][0],t[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Ao.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.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(Ao.fromRing(o,i,this))}return Le(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.segments.length;r<i;r++){var o=this.segments[r];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),n}(),Vc=function(){function n(t,e){if(ar(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ha(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,i=t.length;r<i;r++){var o=new Ha(t[r],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.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=e}return Le(n,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),r=0,i=this.interiorRings.length;r<i;r++)for(var o=this.interiorRings[r].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),n}(),ja=function(){function n(t,e){if(ar(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,i=t.length;r<i;r++){var o=new Vc(t[r],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.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=e}return Le(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++)for(var o=this.polys[r].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),n}(),Uc=function(){Le(n,null,[{key:"factory",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!(!s.isInResult()||s.ringOut)){for(var a=null,u=s.leftSE,l=s.rightSE,c=[u],f=u.point,h=[];a=u,u=l,c.push(u),u.point!==f;)for(;;){var g=u.getAvailableLinkedEvents();if(g.length===0){var p=c[0].point,y=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(y.x,", ").concat(y.y,"]."))}if(g.length===1){l=g[0].otherSE;break}for(var d=null,v=0,C=h.length;v<C;v++)if(h[v].point===u.point){d=v;break}if(d!==null){var I=h.splice(d)[0],N=c.splice(I.index);N.unshift(N[0].otherSE),r.push(new n(N.reverse()));continue}h.push({index:c.length,point:u.point});var L=u.getLeftmostComparator(a);l=g.sort(L)[0].otherSE;break}r.push(new n(c))}}return r}}]);function n(t){ar(this,n),this.events=t;for(var e=0,r=t.length;e<r;e++)t[e].segment.ringOut=this;this.poly=null}return Le(n,[{key:"getGeom",value:function(){for(var e=this.events[0].point,r=[e],i=1,o=this.events.length-1;i<o;i++){var s=this.events[i].point,a=this.events[i+1].point;Xa(s,e,a)!==0&&(r.push(s),e=s)}if(r.length===1)return null;var u=r[0],l=r[1];Xa(u,e,l)===0&&r.shift(),r.push(r[0]);for(var c=this.isExteriorRing()?1:-1,f=this.isExteriorRing()?0:r.length-1,h=this.isExteriorRing()?r.length:-1,g=[],p=f;p!=h;p+=c)g.push([r[p].x,r[p].y]);return g}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],r=1,i=this.events.length;r<i;r++){var o=this.events[r];Xr.compare(e,o)>0&&(e=o)}for(var s=e.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),n}(),Ka=function(){function n(t){ar(this,n),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Le(n,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var r=0,i=this.interiorRings.length;r<i;r++){var o=this.interiorRings[r].getGeom();o!==null&&e.push(o)}return e}}]),n}(),qc=function(){function n(t){ar(this,n),this.rings=t,this.polys=this._composePolys(t)}return Le(n,[{key:"getGeom",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++){var o=this.polys[r].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!s.poly)if(s.isExteriorRing())r.push(new Ka(s));else{var a=s.enclosingRing();a.poly||r.push(new Ka(a)),a.poly.addInterior(s)}}return r}}]),n}(),Xc=function(){function n(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ao.compare;ar(this,n),this.queue=t,this.tree=new xs(e),this.segments=[]}return Le(n,[{key:"process",value:function(e){var r=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(r),i;var o=e.isLeft?this.tree.insert(r):this.tree.find(r);if(!o)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,u=void 0,l=void 0;u===void 0;)s=this.tree.prev(s),s===null?u=null:s.key.consumedBy===void 0&&(u=s.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){var c=null;if(u){var f=u.getIntersection(r);if(f!==null&&(r.isAnEndpoint(f)||(c=f),!u.isAnEndpoint(f)))for(var h=this._splitSafely(u,f),g=0,p=h.length;g<p;g++)i.push(h[g])}var y=null;if(l){var d=l.getIntersection(r);if(d!==null&&(r.isAnEndpoint(d)||(y=d),!l.isAnEndpoint(d)))for(var v=this._splitSafely(l,d),C=0,I=v.length;C<I;C++)i.push(v[C])}if(c!==null||y!==null){var N=null;if(c===null)N=y;else if(y===null)N=c;else{var L=Xr.comparePoints(c,y);N=L<=0?c:y}this.queue.remove(r.rightSE),i.push(r.rightSE);for(var T=r.split(N),O=0,D=T.length;O<D;O++)i.push(T[O])}i.length>0?(this.tree.remove(r),i.push(e)):(this.segments.push(r),r.prev=u)}else{if(u&&l){var b=u.getIntersection(l);if(b!==null){if(!u.isAnEndpoint(b))for(var A=this._splitSafely(u,b),Y=0,G=A.length;Y<G;Y++)i.push(A[Y]);if(!l.isAnEndpoint(b))for(var ut=this._splitSafely(l,b),x=0,B=ut.length;x<B;x++)i.push(ut[x])}}this.tree.remove(r)}return i}},{key:"_splitSafely",value:function(e,r){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(r);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),n}(),Qa=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Yc=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Wc=function(){function n(){ar(this,n)}return Le(n,[{key:"run",value:function(e,r,i){Or.type=e,eo.reset();for(var o=[new ja(r,!0)],s=0,a=i.length;s<a;s++)o.push(new ja(i[s],!1));if(Or.numMultiPolys=o.length,Or.type==="difference")for(var u=o[0],l=1;l<o.length;)Ps(o[l].bbox,u.bbox)!==null?l++:o.splice(l,1);if(Or.type==="intersection"){for(var c=0,f=o.length;c<f;c++)for(var h=o[c],g=c+1,p=o.length;g<p;g++)if(Ps(h.bbox,o[g].bbox)===null)return[]}for(var y=new xs(Xr.compare),d=0,v=o.length;d<v;d++)for(var C=o[d].getSweepEvents(),I=0,N=C.length;I<N;I++)if(y.insert(C[I]),y.size>Qa)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var L=new Xc(y),T=y.size,O=y.pop();O;){var D=O.key;if(y.size===T){var b=D.segment;throw new Error("Unable to pop() ".concat(D.isLeft?"left":"right"," SweepEvent ")+"[".concat(D.point.x,", ").concat(D.point.y,"] from segment #").concat(b.id," ")+"[".concat(b.leftSE.point.x,", ").concat(b.leftSE.point.y,"] -> ")+"[".concat(b.rightSE.point.x,", ").concat(b.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(y.size>Qa)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(L.segments.length>Yc)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var A=L.process(D),Y=0,G=A.length;Y<G;Y++){var ut=A[Y];ut.consumedBy===void 0&&y.insert(ut)}T=y.size,O=y.pop()}eo.reset();var x=Uc.factory(L.segments),B=new qc(x);return B.getGeom()}}]),n}(),Or=new Wc,Hc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("union",t,r)},jc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("intersection",t,r)},Kc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("xor",t,r)},Qc=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Or.run("difference",t,r)},Za={union:Hc,intersection:jc,xor:Kc,difference:Qc},be=63710088e-1,Ja={centimeters:be*100,centimetres:be*100,degrees:be/111325,feet:be*3.28084,inches:be*39.37,kilometers:be/1e3,kilometres:be/1e3,meters:be,metres:be,miles:be/1609.344,millimeters:be*1e3,millimetres:be*1e3,nauticalmiles:be/1852,radians:1,yards:be*1.0936};function Fo(n,t,e){e===void 0&&(e={});var r={type:"Feature"};return(e.id===0||e.id)&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.properties=t||{},r.geometry=n,r}function Zc(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!eu(n[0])||!eu(n[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:n};return Fo(r,t,e)}function $a(n,t,e){e===void 0&&(e={});for(var r=0,i=n;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:n};return Fo(a,t,e)}function Rs(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}function tu(n,t,e){e===void 0&&(e={});var r={type:"MultiPolygon",coordinates:n};return Fo(r,t,e)}function Jc(n,t){var e=Ja[t];return n*e}function $c(n,t){t===void 0&&(t="kilometers");var e=Ja[t];if(!e)throw new Error(t+" units is invalid");return n/e}function eu(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function ko(n){return n.type==="Feature"?n.geometry:n}function tf(n,t,e){e===void 0&&(e={});var r=ko(n),i=ko(t),o=Za.union(r.coordinates,i.coordinates);return o.length===0?null:o.length===1?$a(o[0],e.properties):tu(o,e.properties)}function ru(n,t,e){if(n!==null)for(var r,i,o,s,a,u,l,c=0,f=0,h,g=n.type,p=g==="FeatureCollection",y=g==="Feature",d=p?n.features.length:1,v=0;v<d;v++){l=p?n.features[v].geometry:y?n.geometry:n,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var C=0;C<a;C++){var I=0,N=0;if(s=h?l.geometries[C]:l,s!==null){u=s.coordinates;var L=s.type;switch(c=0,L){case null:break;case"Point":if(t(u,f,v,I,N)===!1)return!1;f++,I++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(t(u[r],f,v,I,N)===!1)return!1;f++,L==="MultiPoint"&&I++}L==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-c;i++){if(t(u[r][i],f,v,I,N)===!1)return!1;f++}L==="MultiLineString"&&I++,L==="Polygon"&&N++}L==="Polygon"&&I++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(N=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-c;o++){if(t(u[r][i][o],f,v,I,N)===!1)return!1;f++}N++}I++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(ru(s.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function nu(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function iu(n,t){var e,r,i,o,s,a,u,l,c,f,h=0,g=n.type==="FeatureCollection",p=n.type==="Feature",y=g?n.features.length:1;for(e=0;e<y;e++){for(a=g?n.features[e].geometry:p?n.geometry:n,l=g?n.features[e].properties:p?n.properties:{},c=g?n.features[e].bbox:p?n.bbox:void 0,f=g?n.features[e].id:p?n.id:void 0,u=a?a.type==="GeometryCollection":!1,s=u?a.geometries.length:1,i=0;i<s;i++){if(o=u?a.geometries[i]:a,o===null){if(t(null,h,l,c,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,h,l,c,f)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<o.geometries.length;r++)if(t(o.geometries[r],h,l,c,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Ts(n){var t=[1/0,1/0,-1/0,-1/0];return ru(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Ts.default=Ts;function ef(n,t){t===void 0&&(t={});var e=Ts(n),r=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return Zc([r,i],t.properties,t)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),r=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(o=o<0?Math.max(r+arguments[2],0):Math.min(o,r);i<o;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!==n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var Zn=function(){};Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.prototype.equalsWithTolerance=function(t,e,r){return Math.abs(t-e)<=r};var pt=function(n){function t(e){n.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),U=function(){},ou={MAX_VALUE:{configurable:!0}};U.isNaN=function(t){return Number.isNaN(t)},U.doubleToLongBits=function(t){return t},U.longBitsToDouble=function(t){return t},U.isInfinite=function(t){return!Number.isFinite(t)},ou.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(U,ou);var Fe=function(){},Bo=function(){},Ei=function(){};function ke(){}var m=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Jn={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};m.prototype.setOrdinate=function(t,e){switch(t){case m.X:this.x=e;break;case m.Y:this.y=e;break;case m.Z:this.z=e;break;default:throw new pt("Invalid ordinate index: "+t)}},m.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return!(!Zn.equalsWithTolerance(this.x,e.x,r)||!Zn.equalsWithTolerance(this.y,e.y,r))}},m.prototype.getOrdinate=function(t){switch(t){case m.X:return this.x;case m.Y:return this.y;case m.Z:return this.z}throw new pt("Invalid ordinate index: "+t)},m.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||U.isNaN(this.z))&&U.isNaN(t.z)},m.prototype.equals=function(t){return t instanceof m?this.equals2D(t):!1},m.prototype.equalInZ=function(t,e){return Zn.equalsWithTolerance(this.z,t.z,e)},m.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},m.prototype.clone=function(){},m.prototype.copy=function(){return new m(this)},m.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},m.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+r*r+i*i)},m.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},m.prototype.hashCode=function(){var t=17;return t=37*t+m.hashCode(this.x),t=37*t+m.hashCode(this.y),t},m.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},m.prototype.interfaces_=function(){return[Fe,Bo,ke]},m.prototype.getClass=function(){return m},m.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=U.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Jn.DimensionalComparator.get=function(){return hn},Jn.serialVersionUID.get=function(){return 6683108902428367e3},Jn.NULL_ORDINATE.get=function(){return U.NaN},Jn.X.get=function(){return 0},Jn.Y.get=function(){return 1},Jn.Z.get=function(){return 2},Object.defineProperties(m,Jn);var hn=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new pt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};hn.prototype.compare=function(t,e){var r=t,i=e,o=hn.compare(r.x,i.x);if(o!==0)return o;var s=hn.compare(r.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=hn.compare(r.z,i.z);return a},hn.prototype.interfaces_=function(){return[Ei]},hn.prototype.getClass=function(){return hn},hn.compare=function(t,e){return t<e?-1:t>e?1:U.isNaN(t)?U.isNaN(e)?0:-1:U.isNaN(e)?1:0};var Ci=function(){};Ci.prototype.create=function(){},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var _=function(){},no={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.toLocationSymbol=function(t){switch(t){case _.EXTERIOR:return"e";case _.BOUNDARY:return"b";case _.INTERIOR:return"i";case _.NONE:return"-"}throw new pt("Unknown location value: "+t)},no.INTERIOR.get=function(){return 0},no.BOUNDARY.get=function(){return 1},no.EXTERIOR.get=function(){return 2},no.NONE.get=function(){return-1},Object.defineProperties(_,no);var V=function(n,t){return n.interfaces_&&n.interfaces_().indexOf(t)>-1},we=function(){},su={LOG_10:{configurable:!0}};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.log10=function(t){var e=Math.log(t);return U.isInfinite(e)||U.isNaN(e)?e:e/we.LOG_10},we.min=function(t,e,r,i){var o=t;return e<o&&(o=e),r<o&&(o=r),i<o&&(o=i),o},we.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],r=arguments[2];return t<e?e:t>r?r:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],s=arguments[2];return i<o?o:i>s?s:i}},we.wrap=function(t,e){return t<0?e- -t%e:t%e},we.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2],i=t;return e>i&&(i=e),r>i&&(i=r),i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=o;return s>l&&(l=s),a>l&&(l=a),u>l&&(l=u),l}},we.average=function(t,e){return(t+e)/2},su.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(we,su);var ur=function(t){this.str=t};ur.prototype.append=function(t){this.str+=t},ur.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},ur.prototype.toString=function(t){return this.str};var lr=function(t){this.value=t};lr.prototype.intValue=function(){return this.value},lr.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},lr.isNaN=function(t){return Number.isNaN(t)};var io=function(){};io.isWhitespace=function(t){return t<=32&&t>=0||t===127},io.toUpperCase=function(t){return t.toUpperCase()};var E=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},We={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};E.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},E.prototype.extractSignificantDigits=function(t,e){var r=this.abs(),i=E.magnitude(r._hi),o=E.TEN.pow(i);r=r.divide(o),r.gt(E.TEN)?(r=r.divide(E.TEN),i+=1):r.lt(E.ONE)&&(r=r.multiply(E.TEN),i-=1);for(var s=i+1,a=new ur,u=E.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var c=Math.trunc(r._hi);if(c<0)break;var f=!1,h=0;c>9?(f=!0,h="9"):h="0"+c,a.append(h),r=r.subtract(E.valueOf(c)).multiply(E.TEN),f&&r.selfAdd(E.TEN);var g=!0,p=E.magnitude(r._hi);if(p<0&&Math.abs(p)>=u-l&&(g=!1),!g)break}return e[0]=i,a.toString()},E.prototype.sqr=function(){return this.multiply(this)},E.prototype.doubleValue=function(){return this._hi+this._lo},E.prototype.subtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},E.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},E.prototype.isZero=function(){return this._hi===0&&this._lo===0},E.prototype.selfSubtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},E.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},E.prototype.min=function(t){return this.le(t)?this:t},E.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null,f=null,h=null;return l=this._hi/r,c=E.SPLIT*l,o=c-l,h=E.SPLIT*r,o=c-o,s=l-o,a=h-r,f=l*r,a=h-a,u=r-a,h=o*a-f+o*u+s*a+s*u,c=(this._hi-f-h+this._lo-l*i)/r,h=l+c,this._hi=h,this._lo=l-h+c,this}},E.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},E.prototype.divide=function(){if(arguments[0]instanceof E){var t=arguments[0],e=null,r=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this._hi/t._hi,a=E.SPLIT*s,e=a-s,l=E.SPLIT*t._hi,e=a-e,r=s-e,i=l-t._hi,u=s*t._hi,i=l-i,o=t._hi-i,l=e*i-u+e*o+r*i+r*o,a=(this._hi-u-l+this._lo-s*t._lo)/t._hi,l=s+a;var c=l,f=s-l+a;return new E(c,f)}else if(typeof arguments[0]=="number"){var h=arguments[0];return U.isNaN(h)?E.createNaN():E.copy(this).selfDivide(h,0)}},E.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},E.prototype.pow=function(t){if(t===0)return E.valueOf(1);var e=new E(this),r=E.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},E.prototype.ceil=function(){if(this.isNaN())return E.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new E(t,e)},E.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},E.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},E.prototype.setValue=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},E.prototype.max=function(t){return this.ge(t)?this:t},E.prototype.sqrt=function(){if(this.isZero())return E.valueOf(0);if(this.isNegative())return E.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=E.valueOf(e),i=this.subtract(r.sqr()),o=i._hi*(t*.5);return r.add(o)},E.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],r=null,i=null,o=null,s=null,a=null,u=null;return o=this._hi+e,a=o-this._hi,s=o-a,s=e-a+(this._hi-s),u=s+this._lo,r=o+u,i=u+(o-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],f=null,h=null,g=null,p=null,y=null,d=null,v=null,C=null;y=this._hi+l,g=this._lo+c,v=y-this._hi,C=g-this._lo,d=y-v,p=g-C,d=l-v+(this._hi-d),p=c-C+(this._lo-p),v=d+g,f=y+v,h=v+(y-f),v=p+h;var I=f+v,N=v+(f-I);return this._hi=I,this._lo=N,this}},E.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null;l=E.SPLIT*this._hi,o=l-this._hi,c=E.SPLIT*r,o=l-o,s=this._hi-o,a=c-r,l=this._hi*r,a=c-a,u=r-a,c=o*a-l+o*u+s*a+s*u+(this._hi*i+this._lo*r);var f=l+c;o=l-f;var h=c+o;return this._hi=f,this._lo=h,this}},E.prototype.selfSqr=function(){return this.selfMultiply(this)},E.prototype.floor=function(){if(this.isNaN())return E.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new E(t,e)},E.prototype.negate=function(){return this.isNaN()?this:new E(-this._hi,-this._lo)},E.prototype.clone=function(){},E.prototype.multiply=function(){if(arguments[0]instanceof E){var t=arguments[0];return t.isNaN()?E.createNaN():E.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return U.isNaN(e)?E.createNaN():E.copy(this).selfMultiply(e,0)}},E.prototype.isNaN=function(){return U.isNaN(this._hi)},E.prototype.intValue=function(){return Math.trunc(this._hi)},E.prototype.toString=function(){var t=E.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},E.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),i=e[0]+1,o=r;if(r.charAt(0)===".")o="0"+r;else if(i<0)o="0."+E.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var s=i-r.length,a=E.stringOfChar("0",s);o=r+a+".0"}return this.isNegative()?"-"+o:o},E.prototype.reciprocal=function(){var t=null,e=null,r=null,i=null,o=null,s=null,a=null,u=null;o=1/this._hi,s=E.SPLIT*o,t=s-o,u=E.SPLIT*this._hi,t=s-t,e=o-t,r=u-this._hi,a=o*this._hi,r=u-r,i=this._hi-r,u=t*r-a+t*i+e*r+e*i,s=(1-a-u-o*this._lo)/this._hi;var l=o+s,c=o-l+s;return new E(l,c)},E.prototype.toSciNotation=function(){if(this.isZero())return E.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),i=E.SCI_NOT_EXPONENT_CHAR+e[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var s=r.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i},E.prototype.abs=function(){return this.isNaN()?E.NaN:this.isNegative()?this.negate():new E(this)},E.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},E.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},E.prototype.add=function(){if(arguments[0]instanceof E){var t=arguments[0];return E.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return E.copy(this).selfAdd(e)}},E.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof E){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}},E.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},E.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},E.prototype.trunc=function(){return this.isNaN()?E.NaN:this.isPositive()?this.floor():this.ceil()},E.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},E.prototype.interfaces_=function(){return[ke,Fe,Bo]},E.prototype.getClass=function(){return E},E.sqr=function(t){return E.valueOf(t).selfMultiply(t)},E.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return E.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new E(e)}},E.sqrt=function(t){return E.valueOf(t).sqrt()},E.parse=function(t){for(var e=0,r=t.length;io.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<r){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var s=new E,a=0,u=0,l=0;!(e>=r);){var c=t.charAt(e);if(e++,io.isDigit(c)){var f=c-"0";s.selfMultiply(E.TEN),s.selfAdd(f),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var h=t.substring(e);try{l=lr.parseInt(h)}catch(v){throw v instanceof Error?new Error("Invalid exponent "+h+" in string "+t):v}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=s,p=a-u-l;if(p===0)g=s;else if(p>0){var y=E.TEN.pow(p);g=s.divide(y)}else if(p<0){var d=E.TEN.pow(-p);g=s.multiply(d)}return i?g.negate():g},E.createNaN=function(){return new E(U.NaN,U.NaN)},E.copy=function(t){return new E(t)},E.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(r)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i},E.stringOfChar=function(t,e){for(var r=new ur,i=0;i<e;i++)r.append(t);return r.toString()},We.PI.get=function(){return new E(3.141592653589793,12246467991473532e-32)},We.TWO_PI.get=function(){return new E(6.283185307179586,24492935982947064e-32)},We.PI_2.get=function(){return new E(1.5707963267948966,6123233995736766e-32)},We.E.get=function(){return new E(2.718281828459045,14456468917292502e-32)},We.NaN.get=function(){return new E(U.NaN,U.NaN)},We.EPS.get=function(){return 123259516440783e-46},We.SPLIT.get=function(){return 134217729},We.MAX_PRINT_DIGITS.get=function(){return 32},We.TEN.get=function(){return E.valueOf(10)},We.ONE.get=function(){return E.valueOf(1)},We.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},We.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(E,We);var pe=function(){},au={DP_SAFE_EPSILON:{configurable:!0}};pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.orientationIndex=function(t,e,r){var i=pe.orientationIndexFilter(t,e,r);if(i<=1)return i;var o=E.valueOf(e.x).selfAdd(-t.x),s=E.valueOf(e.y).selfAdd(-t.y),a=E.valueOf(r.x).selfAdd(-e.x),u=E.valueOf(r.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()},pe.signOfDet2x2=function(t,e,r,i){var o=t.multiply(i).selfSubtract(e.multiply(r));return o.signum()},pe.intersection=function(t,e,r,i){var o=E.valueOf(i.y).selfSubtract(r.y).selfMultiply(E.valueOf(e.x).selfSubtract(t.x)),s=E.valueOf(i.x).selfSubtract(r.x).selfMultiply(E.valueOf(e.y).selfSubtract(t.y)),a=o.subtract(s),u=E.valueOf(i.x).selfSubtract(r.x).selfMultiply(E.valueOf(t.y).selfSubtract(r.y)),l=E.valueOf(i.y).selfSubtract(r.y).selfMultiply(E.valueOf(t.x).selfSubtract(r.x)),c=u.subtract(l),f=c.selfDivide(a).doubleValue(),h=E.valueOf(t.x).selfAdd(E.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),g=E.valueOf(e.x).selfSubtract(t.x).selfMultiply(E.valueOf(t.y).selfSubtract(r.y)),p=E.valueOf(e.y).selfSubtract(t.y).selfMultiply(E.valueOf(t.x).selfSubtract(r.x)),y=g.subtract(p),d=y.selfDivide(a).doubleValue(),v=E.valueOf(r.y).selfAdd(E.valueOf(i.y).selfSubtract(r.y).selfMultiply(d)).doubleValue();return new m(h,v)},pe.orientationIndexFilter=function(t,e,r){var i=null,o=(t.x-r.x)*(e.y-r.y),s=(t.y-r.y)*(e.x-r.x),a=o-s;if(o>0){if(s<=0)return pe.signum(a);i=o+s}else if(o<0){if(s>=0)return pe.signum(a);i=-o-s}else return pe.signum(a);var u=pe.DP_SAFE_EPSILON*i;return a>=u||-a>=u?pe.signum(a):2},pe.signum=function(t){return t>0?1:t<0?-1:0},au.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(pe,au);var K=function(){},oo={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};oo.X.get=function(){return 0},oo.Y.get=function(){return 1},oo.Z.get=function(){return 2},oo.M.get=function(){return 3},K.prototype.setOrdinate=function(t,e,r){},K.prototype.size=function(){},K.prototype.getOrdinate=function(t,e){},K.prototype.getCoordinate=function(){},K.prototype.getCoordinateCopy=function(t){},K.prototype.getDimension=function(){},K.prototype.getX=function(t){},K.prototype.clone=function(){},K.prototype.expandEnvelope=function(t){},K.prototype.copy=function(){},K.prototype.getY=function(t){},K.prototype.toCoordinateArray=function(){},K.prototype.interfaces_=function(){return[Bo]},K.prototype.getClass=function(){return K},Object.defineProperties(K,oo);var uu=function(){},Ii=function(n){function t(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(uu),Ut=function(){};Ut.arraycopy=function(t,e,r,i,o){for(var s=0,a=e;a<e+o;a++)r[i+s]=t[a],s++},Ut.getProperty=function(t){return{"line.separator":`
23
+ `}[t]};var He=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],r=arguments[1];this.x=e,this.y=r,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){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 m&&arguments[1]instanceof m){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var f=arguments[0],h=arguments[1],g=arguments[2],p=arguments[3],y=f.y-h.y,d=h.x-f.x,v=f.x*h.y-h.x*f.y,C=g.y-p.y,I=p.x-g.x,N=g.x*p.y-p.x*g.y;this.x=d*N-I*v,this.y=C*v-y*N,this.w=y*I-C*d}};He.prototype.getY=function(){var t=this.y/this.w;if(U.isNaN(t)||U.isInfinite(t))throw new Ii;return t},He.prototype.getX=function(){var t=this.x/this.w;if(U.isNaN(t)||U.isInfinite(t))throw new Ii;return t},He.prototype.getCoordinate=function(){var t=new m;return t.x=this.getX(),t.y=this.getY(),t},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He},He.intersection=function(t,e,r,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=r.y-i.y,l=i.x-r.x,c=r.x*i.y-i.x*r.y,f=s*c-l*a,h=u*a-o*c,g=o*l-u*s,p=f/g,y=h/g;if(U.isNaN(p)||U.isInfinite(p)||U.isNaN(y)||U.isInfinite(y))throw new Ii;return new m(p,y)};var F=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof n){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},lu={serialVersionUID:{configurable:!0}};F.prototype.getArea=function(){return this.getWidth()*this.getHeight()},F.prototype.equals=function(t){if(!(t instanceof F))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},F.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new F;var e=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new F(e,i,r,o)},F.prototype.isNull=function(){return this._maxx<this._minx},F.prototype.getMaxX=function(){return this._maxx},F.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}},F.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof F){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof m){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}},F.prototype.getMinY=function(){return this._miny},F.prototype.getMinX=function(){return this._minx},F.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},F.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},F.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},F.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},F.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},F.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},F.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},F.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},F.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},F.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},F.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof F){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof m){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}},F.prototype.centre=function(){return this.isNull()?null:new m((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},F.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},F.prototype.getMaxY=function(){return this._maxy},F.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxy<t._miny?r=t._miny-this._maxy:this._miny>t._maxy&&(r=this._miny-t._maxy),e===0?r:r===0?e:Math.sqrt(e*e+r*r)},F.prototype.hashCode=function(){var t=17;return t=37*t+m.hashCode(this._minx),t=37*t+m.hashCode(this._maxx),t=37*t+m.hashCode(this._miny),t=37*t+m.hashCode(this._maxy),t},F.prototype.interfaces_=function(){return[Fe,ke]},F.prototype.getClass=function(){return F},F.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.x<e.x?t.x:e.x)&&r.x<=(t.x>e.x?t.x:e.x)&&r.y>=(t.y<e.y?t.y:e.y)&&r.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=Math.min(s.x,a.x),l=Math.max(s.x,a.x),c=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(c>l||f<u||(u=Math.min(s.y,a.y),l=Math.max(s.y,a.y),c=Math.min(i.y,o.y),f=Math.max(i.y,o.y),c>l)||f<u)}},lu.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(F,lu);var cr={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Go=function(t){this.geometryFactory=t||new H};Go.prototype.read=function(t){var e,r,i;t=t.replace(/[\n\r]/g," ");var o=cr.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=cr.emptyTypeStr.exec(t),o[2]=void 0),o&&(r=o[1].toLowerCase(),i=o[2],Ni[r]&&(e=Ni[r].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Go.prototype.write=function(t){return this.extractGeometry(t)},Go.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Yr[e])return null;var r=e.toUpperCase(),i;return t.isEmpty()?i=r+" EMPTY":i=r+"("+Yr[e].apply(this,[t])+")",i};var Yr={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Yr.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Yr.point.apply(e,[t._geometries[i]])+")");return r.join(",")},linestring:function(t){for(var e=this,r=[],i=0,o=t._points._coordinates.length;i<o;++i)r.push(Yr.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},linearring:function(t){for(var e=this,r=[],i=0,o=t._points._coordinates.length;i<o;++i)r.push(Yr.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},multilinestring:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Yr.linestring.apply(e,[t._geometries[i]])+")");return r.join(",")},polygon:function(t){var e=this,r=[];r.push("("+Yr.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)r.push("("+Yr.linestring.apply(e,[t._holes[i]])+")");return r.join(",")},multipolygon:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Yr.polygon.apply(e,[t._geometries[i]])+")");return r.join(",")},geometrycollection:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push(e.extractGeometry(t._geometries[i]));return r.join(",")}},Ni={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(cr.spaces);return this.geometryFactory.createPoint(new m(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var r,i=t.trim().split(","),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(cr.trimParens,"$1"),o.push(Ni.point.apply(e,[r]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),r=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(cr.spaces),r.push(new m(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),r=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(cr.spaces),r.push(new m(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=t.trim().split(cr.parenComma),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(cr.trimParens,"$1"),o.push(Ni.linestring.apply(e,[r]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var r,i,o,s=t.trim().split(cr.parenComma),a,u=[],l=0,c=s.length;l<c;++l)r=s[l].replace(cr.trimParens,"$1"),i=Ni.linestring.apply(e,[r]),o=e.geometryFactory.createLinearRing(i._points),l===0?a=o:u.push(o);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=t.trim().split(cr.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(cr.trimParens,"$1"),o.push(Ni.polygon.apply(e,[r]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var r=t.trim().split("|"),i=[],o=0,s=r.length;o<s;++o)i.push(e.read(r[o]));return this.geometryFactory.createGeometryCollection(i)}},je=function(t){this.parser=new Go(t)};je.prototype.write=function(t){return this.parser.write(t)},je.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Wr=function(n){function t(e){n.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),zo=function(n){function t(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var e=arguments[0];n.call(this,e)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Wr),X=function(){};X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.shouldNeverReachHere=function(){if(arguments.length===0)X.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new zo("Should never reach here"+(t!==null?": "+t:""))}},X.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],X.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new zo:new zo(e)},X.equals=function(){var t,e,r;if(arguments.length===2)t=arguments[0],e=arguments[1],X.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],r=arguments[2],!e.equals(t)))throw new zo("Expected "+t+" but encountered "+e+(r!==null?": "+r:""))};var dt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new m,this._intPt[1]=new m,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},$n={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};dt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},dt.prototype.getTopologySummary=function(){var t=new ur;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},dt.prototype.computeIntersection=function(t,e,r,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,r,i)},dt.prototype.getIntersectionNum=function(){return this._result},dt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),r=this.getEdgeDistance(t,1);e>r?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},dt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},dt.prototype.setPrecisionModel=function(t){this._precisionModel=t},dt.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],r=0;r<this._result;r++)if(!(t._intPt[r].equals2D(t._inputLines[e][0])||t._intPt[r].equals2D(t._inputLines[e][1])))return!0;return!1}},dt.prototype.getIntersection=function(t){return this._intPt[t]},dt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},dt.prototype.hasIntersection=function(){return this._result!==dt.NO_INTERSECTION},dt.prototype.getEdgeDistance=function(t,e){var r=dt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return r},dt.prototype.isCollinear=function(){return this._result===dt.COLLINEAR_INTERSECTION},dt.prototype.toString=function(){return je.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+je.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},dt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},dt.prototype.isIntersection=function(t){for(var e=this,r=0;r<this._result;r++)if(e._intPt[r].equals2D(t))return!0;return!1},dt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},dt.computeEdgeDistance=function(t,e,r){var i=Math.abs(r.x-e.x),o=Math.abs(r.y-e.y),s=-1;if(t.equals(e))s=0;else if(t.equals(r))i>o?s=i:s=o;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?s=a:s=u,s===0&&!t.equals(e)&&(s=Math.max(a,u))}return X.isTrue(!(s===0&&!t.equals(e)),"Bad distance calculation"),s},dt.nonRobustComputeEdgeDistance=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o);return X.isTrue(!(s===0&&!t.equals(e)),"Invalid distance calculation"),s},$n.DONT_INTERSECT.get=function(){return 0},$n.DO_INTERSECT.get=function(){return 1},$n.COLLINEAR.get=function(){return 2},$n.NO_INTERSECTION.get=function(){return 0},$n.POINT_INTERSECTION.get=function(){return 1},$n.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(dt,$n);var Dn=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(r){var i=new F(this._inputLines[0][0],this._inputLines[0][1]),o=new F(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&o.contains(r)},t.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,F.intersects(i,o,r)&&M.orientationIndex(i,o,r)===0&&M.orientationIndex(o,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(o))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION}else return n.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(r,i,o,s,a){a.x=this.smallestInAbsValue(r.x,i.x,o.x,s.x),a.y=this.smallestInAbsValue(r.y,i.y,o.y,s.y),r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.safeHCoordinateIntersection=function(r,i,o,s){var a=null;try{a=He.intersection(r,i,o,s)}catch(u){if(u instanceof Ii)a=t.nearestEndpoint(r,i,o,s);else throw u}finally{}return a},t.prototype.intersection=function(r,i,o,s){var a=this.intersectionWithNormalization(r,i,o,s);return this.isInSegmentEnvelopes(a)||(a=new m(t.nearestEndpoint(r,i,o,s))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(r,i,o,s){var a=r,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(o)<u&&(a=o,u=Math.abs(o)),Math.abs(s)<u&&(a=s),a},t.prototype.checkDD=function(r,i,o,s,a){var u=pe.intersection(r,i,o,s),l=this.isInSegmentEnvelopes(u);Ut.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Ut.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(r,i,o,s){var a=new m(r),u=new m(i),l=new m(o),c=new m(s),f=new m;this.normalizeToEnvCentre(a,u,l,c,f);var h=this.safeHCoordinateIntersection(a,u,l,c);return h.x+=f.x,h.y+=f.y,h},t.prototype.computeCollinearIntersection=function(r,i,o,s){var a=F.intersects(r,i,o),u=F.intersects(r,i,s),l=F.intersects(o,s,r),c=F.intersects(o,s,i);return a&&u?(this._intPt[0]=o,this._intPt[1]=s,n.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=r,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!u&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!a&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!a&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(r,i,o,s,a){var u=r.x<i.x?r.x:i.x,l=r.y<i.y?r.y:i.y,c=r.x>i.x?r.x:i.x,f=r.y>i.y?r.y:i.y,h=o.x<s.x?o.x:s.x,g=o.y<s.y?o.y:s.y,p=o.x>s.x?o.x:s.x,y=o.y>s.y?o.y:s.y,d=u>h?u:h,v=c<p?c:p,C=l>g?l:g,I=f<y?f:y,N=(d+v)/2,L=(C+I)/2;a.x=N,a.y=L,r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.computeIntersect=function(r,i,o,s){if(this._isProper=!1,!F.intersects(r,i,o,s))return n.NO_INTERSECTION;var a=M.orientationIndex(r,i,o),u=M.orientationIndex(r,i,s);if(a>0&&u>0||a<0&&u<0)return n.NO_INTERSECTION;var l=M.orientationIndex(o,s,r),c=M.orientationIndex(o,s,i);if(l>0&&c>0||l<0&&c<0)return n.NO_INTERSECTION;var f=a===0&&u===0&&l===0&&c===0;return f?this.computeCollinearIntersection(r,i,o,s):(a===0||u===0||l===0||c===0?(this._isProper=!1,r.equals2D(o)||r.equals2D(s)?this._intPt[0]=r:i.equals2D(o)||i.equals2D(s)?this._intPt[0]=i:a===0?this._intPt[0]=new m(o):u===0?this._intPt[0]=new m(s):l===0?this._intPt[0]=new m(r):c===0&&(this._intPt[0]=new m(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,o,s)),n.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(r,i,o,s){var a=r,u=M.distancePointLine(r,o,s),l=M.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=M.distancePointLine(o,r,i),l<u&&(u=l,a=o),l=M.distancePointLine(s,r,i),l<u&&(u=l,a=s),a},t}(dt),ti=function(){};ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.orientationIndex=function(t,e,r){var i=e.x-t.x,o=e.y-t.y,s=r.x-e.x,a=r.y-e.y;return ti.signOfDet2x2(i,o,s,a)},ti.signOfDet2x2=function(t,e,r,i){var o=null,s=null,a=null;if(o=1,t===0||i===0)return e===0||r===0?0:e>0?r>0?-o:o:r>0?o:-o;if(e===0||r===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,s=t,t=r,r=s,s=e,e=i,i=s):e<=-i?(o=-o,r=-r,i=-i):(s=t,t=-r,r=s,s=e,e=-i,i=s):i>0?-e<=i?(o=-o,t=-t,e=-e):(s=-t,t=r,r=s,s=-e,e=i,i=s):e>=i?(t=-t,e=-e,r=-r,i=-i):(o=-o,s=-t,t=-r,r=s,s=-e,e=-i,i=s),t>0)if(r>0){if(!(t<=r))return o}else return o;else{if(r>0)return-o;if(t>=r)o=-o,t=-t,r=-r;else return-o}for(;;){if(a=Math.floor(r/t),r=r-a*t,i=i-a*e,i<0)return-o;if(i>e)return o;if(t>r+r){if(e<i+i)return o}else{if(e>i+i)return-o;r=t-r,i=e-i,o=-o}if(i===0)return r===0?0:-o;if(r===0||(a=Math.floor(t/r),t=t-a*r,e=e-a*i,e<0))return o;if(e>i)return-o;if(r>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=r-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var fr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};fr.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var r=t.x,i=e.x;return r>i&&(r=e.x,i=t.x),this._p.x>=r&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var o=t.x-this._p.x,s=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=ti.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}},fr.prototype.isPointInPolygon=function(){return this.getLocation()!==_.EXTERIOR},fr.prototype.getLocation=function(){return this._isPointOnSegment?_.BOUNDARY:this._crossingCount%2===1?_.INTERIOR:_.EXTERIOR},fr.prototype.isOnSegment=function(){return this._isPointOnSegment},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr},fr.locatePointInRing=function(){if(arguments[0]instanceof m&&V(arguments[1],K)){for(var t=arguments[0],e=arguments[1],r=new fr(t),i=new m,o=new m,s=1;s<e.size();s++)if(e.getCoordinate(s,i),e.getCoordinate(s-1,o),r.countSegment(i,o),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof m&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new fr(a),c=1;c<u.length;c++){var f=u[c],h=u[c-1];if(l.countSegment(f,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var M=function(){},ei={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.orientationIndex=function(t,e,r){return pe.orientationIndex(t,e,r)},M.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,r=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-r,s=t[i+1].y,a=t[i-1].y;e+=o*(a-s)}return e/2}else if(V(arguments[0],K)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new m,f=new m,h=new m;u.getCoordinate(0,f),u.getCoordinate(1,h);var g=f.x;h.x-=g;for(var p=0,y=1;y<l-1;y++)c.y=f.y,f.x=h.x,f.y=h.y,u.getCoordinate(y+1,h),h.x-=g,p+=f.x*(c.y-h.y);return p/2}},M.distanceLineLine=function(t,e,r,i){if(t.equals(e))return M.distancePointLine(t,r,i);if(r.equals(i))return M.distancePointLine(i,t,e);var o=!1;if(!F.intersects(t,e,r,i))o=!0;else{var s=(e.x-t.x)*(i.y-r.y)-(e.y-t.y)*(i.x-r.x);if(s===0)o=!0;else{var a=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y),l=u/s,c=a/s;(c<0||c>1||l<0||l>1)&&(o=!0)}}return o?we.min(M.distancePointLine(t,r,i),M.distancePointLine(e,r,i),M.distancePointLine(r,t,e),M.distancePointLine(i,t,e)):0},M.isPointInRing=function(t,e){return M.locatePointInRing(t,e)!==_.EXTERIOR},M.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,i=new m;t.getCoordinate(0,i);for(var o=i.x,s=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-o,f=l-s;r+=Math.sqrt(c*c+f*f),o=u,s=l}return r},M.isCCW=function(t){var e=t.length-1;if(e<3)throw new pt("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>r.y&&(r=s,i=o)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(r)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(r)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(r)||c.equals2D(r)||l.equals2D(c))return!1;var f=M.computeOrientation(l,r,c),h=!1;return f===0?h=l.x>c.x:h=f>0,h},M.locatePointInRing=function(t,e){return fr.locatePointInRing(t,e)},M.distancePointLinePerpendicular=function(t,e,r){var i=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),o=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)},M.computeOrientation=function(t,e,r){return M.orientationIndex(t,e,r)},M.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new pt("Line array must contain at least one vertex");for(var r=t.distance(e[0]),i=0;i<e.length-1;i++){var o=M.distancePointLine(t,e[i],e[i+1]);o<r&&(r=o)}return r}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var f=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(f)*Math.sqrt(l)}},M.isOnLine=function(t,e){for(var r=new Dn,i=1;i<e.length;i++){var o=e[i-1],s=e[i];if(r.computeIntersection(t,o,s),r.hasIntersection())return!0}return!1},ei.CLOCKWISE.get=function(){return-1},ei.RIGHT.get=function(){return M.CLOCKWISE},ei.COUNTERCLOCKWISE.get=function(){return 1},ei.LEFT.get=function(){return M.COUNTERCLOCKWISE},ei.COLLINEAR.get=function(){return 0},ei.STRAIGHT.get=function(){return M.COLLINEAR},Object.defineProperties(M,ei);var Hr=function(){};Hr.prototype.filter=function(t){},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var z=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Rr={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};z.prototype.isGeometryCollection=function(){return this.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION},z.prototype.getFactory=function(){return this._factory},z.prototype.getGeometryN=function(t){return this},z.prototype.getArea=function(){return 0},z.prototype.isRectangle=function(){return!1},z.prototype.equals=function(){if(arguments[0]instanceof z){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof z))return!1;var r=e;return this.equalsExact(r)}},z.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},z.prototype.geometryChanged=function(){this.apply(z.geometryChangedFilter)},z.prototype.geometryChangedAction=function(){this._envelope=null},z.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},z.prototype.getLength=function(){return 0},z.prototype.getNumGeometries=function(){return 1},z.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}},z.prototype.getUserData=function(){return this._userData},z.prototype.getSRID=function(){return this._SRID},z.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},z.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION)throw new pt("This method does not support GeometryCollection arguments")},z.prototype.equal=function(t,e,r){return r===0?t.equals(e):t.distance(e)<=r},z.prototype.norm=function(){var t=this.copy();return t.normalize(),t},z.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},z.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new F(this._envelope)},z.prototype.setSRID=function(t){this._SRID=t},z.prototype.setUserData=function(t){this._userData=t},z.prototype.compare=function(t,e){for(var r=t.iterator(),i=e.iterator();r.hasNext()&&i.hasNext();){var o=r.next(),s=i.next(),a=o.compareTo(s);if(a!==0)return a}return r.hasNext()?1:i.hasNext()?-1:0},z.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},z.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===z.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===z.SORTINDEX_MULTIPOINT||this.getSortIndex()===z.SORTINDEX_MULTILINESTRING||this.getSortIndex()===z.SORTINDEX_MULTIPOLYGON},z.prototype.interfaces_=function(){return[Bo,Fe,ke]},z.prototype.getClass=function(){return z},z.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},z.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},Rr.serialVersionUID.get=function(){return 8763622679187377e3},Rr.SORTINDEX_POINT.get=function(){return 0},Rr.SORTINDEX_MULTIPOINT.get=function(){return 1},Rr.SORTINDEX_LINESTRING.get=function(){return 2},Rr.SORTINDEX_LINEARRING.get=function(){return 3},Rr.SORTINDEX_MULTILINESTRING.get=function(){return 4},Rr.SORTINDEX_POLYGON.get=function(){return 5},Rr.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Rr.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Rr.geometryChangedFilter.get=function(){return Ds},Object.defineProperties(z,Rr);var Ds=function(){};Ds.interfaces_=function(){return[Hr]},Ds.filter=function(t){t.geometryChangedAction()};var Tr=function(){};Tr.prototype.filter=function(t){},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Be=function(){},jr={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Be.prototype.isInBoundary=function(t){},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},jr.Mod2BoundaryNodeRule.get=function(){return Si},jr.EndPointBoundaryNodeRule.get=function(){return xi},jr.MultiValentEndPointBoundaryNodeRule.get=function(){return Li},jr.MonoValentEndPointBoundaryNodeRule.get=function(){return bi},jr.MOD2_BOUNDARY_RULE.get=function(){return new Si},jr.ENDPOINT_BOUNDARY_RULE.get=function(){return new xi},jr.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Li},jr.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new bi},jr.OGC_SFS_BOUNDARY_RULE.get=function(){return Be.MOD2_BOUNDARY_RULE},Object.defineProperties(Be,jr);var Si=function(){};Si.prototype.isInBoundary=function(t){return t%2===1},Si.prototype.interfaces_=function(){return[Be]},Si.prototype.getClass=function(){return Si};var xi=function(){};xi.prototype.isInBoundary=function(t){return t>0},xi.prototype.interfaces_=function(){return[Be]},xi.prototype.getClass=function(){return xi};var Li=function(){};Li.prototype.isInBoundary=function(t){return t>1},Li.prototype.interfaces_=function(){return[Be]},Li.prototype.getClass=function(){return Li};var bi=function(){};bi.prototype.isInBoundary=function(t){return t===1},bi.prototype.interfaces_=function(){return[Be]},bi.prototype.getClass=function(){return bi};var Dt=function(){};Dt.prototype.add=function(){},Dt.prototype.addAll=function(){},Dt.prototype.isEmpty=function(){},Dt.prototype.iterator=function(){},Dt.prototype.size=function(){},Dt.prototype.toArray=function(){},Dt.prototype.remove=function(){};function Ms(n){this.message=n||""}Ms.prototype=new Error,Ms.prototype.name="IndexOutOfBoundsException";var wi=function(){};wi.prototype.hasNext=function(){},wi.prototype.next=function(){},wi.prototype.remove=function(){};var Ke=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Dt);function Pi(n){this.message=n||""}Pi.prototype=new Error,Pi.prototype.name="NoSuchElementException";var R=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[n,Dt]},t.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(r){for(var i=this,o=r.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(r,i){var o=this.array_[r];return this.array_[r]=i,o},t.prototype.iterator=function(){return new rf(this)},t.prototype.get=function(r){if(r<0||r>=this.size())throw new Ms;return this.array_[r]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var r=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(r.array_[o]);return i},t.prototype.remove=function(r){for(var i=this,o=!1,s=0,a=this.array_.length;s<a;s++)if(i.array_[s]===r){i.array_.splice(s,1),o=!0;break}return o},t}(Ke),rf=function(n){function t(e){n.call(this),this.arrayList_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Pi;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(wi),so=function(n){function t(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=!1,u=o.iterator();u.hasNext();)i.add(u.next(),s),a=!0;return a}else return n.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=n.prototype.clone.call(this),s=0;s<this.size();s++)o.add(s,i.get(s).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];n.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1];return this.add(s,a,!0),!0}else if(arguments[0]instanceof m&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}n.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],h=arguments[1];return this.add(f,h),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],y=arguments[2];if(y)for(var d=0;d<g.length;d++)i.add(g[d],p);else for(var v=g.length-1;v>=0;v--)i.add(g[v],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof m){var C=arguments[0],I=arguments[1],N=arguments[2];if(!N){var L=this.size();if(L>0){if(C>0){var T=this.get(C-1);if(T.equals2D(I))return null}if(C<L){var O=this.get(C);if(O.equals2D(I))return null}}}n.prototype.add.call(this,C,I)}}else if(arguments.length===4){var D=arguments[0],b=arguments[1],A=arguments[2],Y=arguments[3],G=1;A>Y&&(G=-1);for(var ut=A;ut!==Y;ut+=G)i.add(D[ut],b);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new m(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(R),W=function(){},Vo={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Vo.ForwardComparator.get=function(){return ao},Vo.BidirectionalComparator.get=function(){return Oi},Vo.coordArrayType.get=function(){return new Array(0).fill(null)},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W},W.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},W.ptNotInList=function(t,e){for(var r=0;r<t.length;r++){var i=t[r];if(W.indexOf(i,e)<0)return i}return null},W.scroll=function(t,e){var r=W.indexOf(e,t);if(r<0)return null;var i=new Array(t.length).fill(null);Ut.arraycopy(t,r,i,0,t.length-r),Ut.arraycopy(t,0,i,t.length-r,r),Ut.arraycopy(i,0,t,0,t.length)},W.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(e[r]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(s.compare(i[a],o[a])!==0)return!1;return!0}},W.intersection=function(t,e){for(var r=new so,i=0;i<t.length;i++)e.intersects(t[i])&&r.add(t[i],!0);return r.toCoordinateArray()},W.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},W.removeRepeatedPoints=function(t){if(!W.hasRepeatedPoints(t))return t;var e=new so(t,!1);return e.toCoordinateArray()},W.reverse=function(t){for(var e=t.length-1,r=Math.trunc(e/2),i=0;i<=r;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}},W.removeNull=function(t){for(var e=0,r=0;r<t.length;r++)t[r]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,s=0;s<t.length;s++)t[s]!==null&&(i[o++]=t[s]);return i},W.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),r=0;r<t.length;r++)e[r]=new m(t[r]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)s[a+l]=new m(i[o+l])},W.isEqualReversed=function(t,e){for(var r=0;r<t.length;r++){var i=t[r],o=e[t.length-r-1];if(i.compareTo(o)!==0)return!1}return!0},W.envelope=function(t){for(var e=new F,r=0;r<t.length;r++)e.expandToInclude(t[r]);return e},W.toCoordinateArray=function(t){return t.toArray(W.coordArrayType)},W.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},W.indexOf=function(t,e){for(var r=0;r<e.length;r++)if(t.equals(e[r]))return r;return-1},W.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var r=t.length-1-e,i=t[e].compareTo(t[r]);if(i!==0)return i}return 1},W.compare=function(t,e){for(var r=0;r<t.length&&r<e.length;){var i=t[r].compareTo(e[r]);if(i!==0)return i;r++}return r<e.length?-1:r<t.length?1:0},W.minCoordinate=function(t){for(var e=null,r=0;r<t.length;r++)(e===null||e.compareTo(t[r])>0)&&(e=t[r]);return e},W.extract=function(t,e,r){e=we.clamp(e,0,t.length),r=we.clamp(r,-1,t.length);var i=r-e+1;r<0&&(i=0),e>=t.length&&(i=0),r<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var s=0,a=e;a<=r;a++)o[s++]=t[a];return o},Object.defineProperties(W,Vo);var ao=function(){};ao.prototype.compare=function(t,e){var r=t,i=e;return W.compare(r,i)},ao.prototype.interfaces_=function(){return[Ei]},ao.prototype.getClass=function(){return ao};var Oi=function(){};Oi.prototype.compare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var o=W.compare(r,i),s=W.isEqualReversed(r,i);return s?0:o},Oi.prototype.OLDcompare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var o=W.increasingDirection(r),s=W.increasingDirection(i),a=o>0?0:r.length-1,u=s>0?0:r.length-1,l=0;l<r.length;l++){var c=r[a].compareTo(i[u]);if(c!==0)return c;a+=o,u+=s}return 0},Oi.prototype.interfaces_=function(){return[Ei]},Oi.prototype.getClass=function(){return Oi};var ri=function(){};ri.prototype.get=function(){},ri.prototype.put=function(){},ri.prototype.size=function(){},ri.prototype.values=function(){},ri.prototype.entrySet=function(){};var nf=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ri);function uo(n){this.message=n||""}uo.prototype=new Error,uo.prototype.name="OperationNotSupported";function Uo(){}Uo.prototype=new Dt,Uo.prototype.contains=function(){};var As=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.contains=function(r){for(var i=this,o=0,s=this.array_.length;o<s;o++){var a=i.array_[o];if(a===r)return!0}return!1},t.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},t.prototype.addAll=function(r){for(var i=this,o=r.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(r){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var r=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(r.array_[o]);return i},t.prototype.iterator=function(){return new of(this)},t}(Uo),of=function(n){function t(e){n.call(this),this.hashSet_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Pi;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new uo},t}(wi),Kr=0,Mn=1;function cu(n){return n===null?Kr:n.color}function lt(n){return n===null?null:n.parent}function Qr(n,t){n!==null&&(n.color=t)}function Fs(n){return n===null?null:n.left}function fu(n){return n===null?null:n.right}function Jt(){this.root_=null,this.size_=0}Jt.prototype=new nf,Jt.prototype.get=function(n){for(var t=this.root_;t!==null;){var e=n.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Jt.prototype.put=function(n,t){if(this.root_===null)return this.root_={key:n,value:t,left:null,right:null,parent:null,color:Kr,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,r,i;do if(r=e,i=n.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var s={key:n,left:null,right:null,value:t,parent:r,color:Kr,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=s:r.right=s,this.fixAfterInsertion(s),this.size_++,null},Jt.prototype.fixAfterInsertion=function(n){var t=this;for(n.color=Mn;n!=null&&n!==this.root_&&n.parent.color===Mn;)if(lt(n)===Fs(lt(lt(n)))){var e=fu(lt(lt(n)));cu(e)===Mn?(Qr(lt(n),Kr),Qr(e,Kr),Qr(lt(lt(n)),Mn),n=lt(lt(n))):(n===fu(lt(n))&&(n=lt(n),t.rotateLeft(n)),Qr(lt(n),Kr),Qr(lt(lt(n)),Mn),t.rotateRight(lt(lt(n))))}else{var r=Fs(lt(lt(n)));cu(r)===Mn?(Qr(lt(n),Kr),Qr(r,Kr),Qr(lt(lt(n)),Mn),n=lt(lt(n))):(n===Fs(lt(n))&&(n=lt(n),t.rotateRight(n)),Qr(lt(n),Kr),Qr(lt(lt(n)),Mn),t.rotateLeft(lt(lt(n))))}this.root_.color=Kr},Jt.prototype.values=function(){var n=new R,t=this.getFirstEntry();if(t!==null)for(n.add(t.value);(t=Jt.successor(t))!==null;)n.add(t.value);return n},Jt.prototype.entrySet=function(){var n=new As,t=this.getFirstEntry();if(t!==null)for(n.add(t);(t=Jt.successor(t))!==null;)n.add(t);return n},Jt.prototype.rotateLeft=function(n){if(n!=null){var t=n.right;n.right=t.left,t.left!=null&&(t.left.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.left===n?n.parent.left=t:n.parent.right=t,t.left=n,n.parent=t}},Jt.prototype.rotateRight=function(n){if(n!=null){var t=n.left;n.left=t.right,t.right!=null&&(t.right.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.right===n?n.parent.right=t:n.parent.left=t,t.right=n,n.parent=t}},Jt.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},Jt.successor=function(n){if(n===null)return null;if(n.right!==null){for(var t=n.right;t.left!==null;)t=t.left;return t}else{for(var e=n.parent,r=n;e!==null&&r===e.right;)r=e,e=e.parent;return e}},Jt.prototype.size=function(){return this.size_};var lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};function hu(){}hu.prototype=new Uo;function hr(){this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}hr.prototype=new hu,hr.prototype.contains=function(n){for(var t=this,e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===0)return!0}return!1},hr.prototype.add=function(n){var t=this;if(this.contains(n))return!1;for(var e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===1)return t.array_.splice(e,0,n),!0}return this.array_.push(n),!0},hr.prototype.addAll=function(n){for(var t=this,e=n.iterator();e.hasNext();)t.add(e.next());return!0},hr.prototype.remove=function(n){throw new uo},hr.prototype.size=function(){return this.array_.length},hr.prototype.isEmpty=function(){return this.array_.length===0},hr.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t},hr.prototype.iterator=function(){return new qo(this)};var qo=function(n){this.treeSet_=n,this.position_=0};qo.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Pi;return this.treeSet_.array_[this.position_++]},qo.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},qo.prototype.remove=function(){throw new uo};var An=function(){};An.sort=function(){var t=arguments[0],e,r,i,o;if(arguments.length===1)o=function(a,u){return a.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(a,u){return i.compare(a,u)},t.sort(o);else if(arguments.length===3){r=t.slice(arguments[1],arguments[2]),r.sort();var s=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])}else if(arguments.length===4)for(r=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(a,u){return i.compare(a,u)},r.sort(o),s=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])},An.asList=function(t){for(var e=new R,r=0,i=t.length;r<i;r++)e.add(t[r]);return e};var Z=function(){},Qe={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Qe.P.get=function(){return 0},Qe.L.get=function(){return 1},Qe.A.get=function(){return 2},Qe.FALSE.get=function(){return-1},Qe.TRUE.get=function(){return-2},Qe.DONTCARE.get=function(){return-3},Qe.SYM_FALSE.get=function(){return"F"},Qe.SYM_TRUE.get=function(){return"T"},Qe.SYM_DONTCARE.get=function(){return"*"},Qe.SYM_P.get=function(){return"0"},Qe.SYM_L.get=function(){return"1"},Qe.SYM_A.get=function(){return"2"},Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z},Z.toDimensionSymbol=function(t){switch(t){case Z.FALSE:return Z.SYM_FALSE;case Z.TRUE:return Z.SYM_TRUE;case Z.DONTCARE:return Z.SYM_DONTCARE;case Z.P:return Z.SYM_P;case Z.L:return Z.SYM_L;case Z.A:return Z.SYM_A}throw new pt("Unknown dimension value: "+t)},Z.toDimensionValue=function(t){switch(io.toUpperCase(t)){case Z.SYM_FALSE:return Z.FALSE;case Z.SYM_TRUE:return Z.TRUE;case Z.SYM_DONTCARE:return Z.DONTCARE;case Z.SYM_P:return Z.P;case Z.SYM_L:return Z.L;case Z.SYM_A:return Z.A}throw new pt("Unknown dimension symbol: "+t)},Object.defineProperties(Z,Qe);var gr=function(){};gr.prototype.filter=function(t){},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var Ze=function(){};Ze.prototype.filter=function(t,e){},Ze.prototype.isDone=function(){},Ze.prototype.isGeometryChanged=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var oe=function(n){function t(r,i){if(n.call(this,i),this._geometries=r||[],n.hasNullElements(this._geometries))throw new pt("geometries must not contain null elements")}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new F,s=0;s<this._geometries.length;s++)o.expandToInclude(i._geometries[s].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),s=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)s++,o[s]=u[l];return o},t.prototype.getArea=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();An.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(s)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=new hr(An.asList(this._geometries)),a=new hr(An.asList(o._geometries));return this.compare(s,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,f=this.getNumGeometries(),h=c.getNumGeometries(),g=0;g<f&&g<h;){var p=i.getGeometryN(g),y=c.getGeometryN(g),d=p.compareToSameClass(y,l);if(d!==0)return d;g++}return g<f?1:g<h?-1:0}},t.prototype.apply=function(){var i=this;if(V(arguments[0],Tr))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(V(arguments[0],Ze)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(V(arguments[0],gr)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(V(arguments[0],Hr)){var f=arguments[0];f.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),X.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=n.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var s=0;s<this._geometries.length;s++)o._geometries[s]=i._geometries[s].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(z),Fn=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[o-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(s)},t.prototype.getBoundary=function(){return new Ge(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(oe),Ge=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Be.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};Ge.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Ge.prototype.getBoundary=function(){return this._geom instanceof yt?this.boundaryLineString(this._geom):this._geom instanceof Fn?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Ge.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Ge.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Ge.prototype.computeBoundaryCoordinates=function(t){var e=this,r=new R;this._endpointMap=new Jt;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var s=this._endpointMap.entrySet().iterator();s.hasNext();){var a=s.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&r.add(a.getKey())}return W.toCoordinateArray(r)},Ge.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Xo,this._endpointMap.put(t,e)),e.count++},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Ge(t);return e.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=new Ge(r,i);return o.getBoundary()}};var Xo=function(){this.count=null};Xo.prototype.interfaces_=function(){return[]},Xo.prototype.getClass=function(){return Xo};function sf(){}function af(){}var uf=function(){};function lf(){}function cf(){}function ff(){}var ze=function(){},ks={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.chars=function(t,e){for(var r=new Array(e).fill(null),i=0;i<e;i++)r[i]=t;return String(r)},ze.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new lf,r=new sf;return t.printStackTrace(r),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new af(ze.getStackTrace(i));for(var a=new ff,u=0;u<o;u++)try{s+=a.readLine()+ze.NEWLINE}catch(l){if(l instanceof cf)X.shouldNeverReachHere();else throw l}finally{}return s}},ze.split=function(t,e){for(var r=e.length,i=new R,o=""+t,s=o.indexOf(e);s>=0;){var a=o.substring(0,s);i.add(a),o=o.substring(s+r),s=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},ze.toString=function(){if(arguments.length===1){var t=arguments[0];return ze.SIMPLE_ORDINATE_FORMAT.format(t)}},ze.spaces=function(t){return ze.chars(" ",t)},ks.NEWLINE.get=function(){return Ut.getProperty("line.separator")},ks.SIMPLE_ORDINATE_FORMAT.get=function(){return new uf},Object.defineProperties(ze,ks);var Nt=function(){};Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.copyCoord=function(t,e,r,i){for(var o=Math.min(t.getDimension(),r.getDimension()),s=0;s<o;s++)r.setOrdinate(i,s,t.getOrdinate(e,s))},Nt.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,K.X)===t.getOrdinate(e-1,K.X)&&t.getOrdinate(0,K.Y)===t.getOrdinate(e-1,K.Y)},Nt.isEqual=function(t,e){var r=t.size(),i=e.size();if(r!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),s=0;s<r;s++)for(var a=0;a<o;a++){var u=t.getOrdinate(s,a),l=e.getOrdinate(s,a);if(t.getOrdinate(s,a)!==e.getOrdinate(s,a)&&!(U.isNaN(u)&&U.isNaN(l)))return!1}return!0},Nt.extend=function(t,e,r){var i=t.create(r,e.getDimension()),o=e.size();if(Nt.copy(e,0,i,0,o),o>0)for(var s=o;s<r;s++)Nt.copy(e,o-1,i,s,1);return i},Nt.reverse=function(t){for(var e=t.size()-1,r=Math.trunc(e/2),i=0;i<=r;i++)Nt.swap(t,i,e-i)},Nt.swap=function(t,e,r){if(e===r)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(r,i)),t.setOrdinate(r,i,o)}},Nt.copy=function(t,e,r,i,o){for(var s=0;s<o;s++)Nt.copyCoord(t,e+s,r,i+s)},Nt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var r=t.getDimension(),i=new ur;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var s=0;s<r;s++)s>0&&i.append(","),i.append(ze.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}},Nt.ensureValidRing=function(t,e){var r=e.size();if(r===0)return e;if(r<=3)return Nt.createClosedRing(t,e,4);var i=e.getOrdinate(0,K.X)===e.getOrdinate(r-1,K.X)&&e.getOrdinate(0,K.Y)===e.getOrdinate(r-1,K.Y);return i?e:Nt.createClosedRing(t,e,r+1)},Nt.createClosedRing=function(t,e,r){var i=t.create(r,e.getDimension()),o=e.size();Nt.copy(e,0,i,0,o);for(var s=o;s<r;s++)Nt.copy(e,0,i,s,1);return i};var yt=function(n){function t(r,i){n.call(this,i),this._points=null,this.init(r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new F:this._points.expandEnvelope(new F)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var s=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(s)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(s))>0&&Nt.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return M.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();Nt.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],s=o,a=0,u=0;a<this._points.size()&&u<s._points.size();){var l=i._points.getCoordinate(a).compareTo(s._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<s._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],f=arguments[1],h=c;return f.compare(this._points,h._points)}},t.prototype.apply=function(){var i=this;if(V(arguments[0],Tr))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(V(arguments[0],Ze)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(V(arguments[0],gr)){var l=arguments[0];l.filter(this)}else if(V(arguments[0],Hr)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new Ge(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new pt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,s=0;s<this._points.size();s++)if(o._points.getCoordinate(s).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(z),co=function(){};co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var Ee=function(n){function t(r,i){n.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new F;var i=new F;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var s=arguments[0],a=arguments[1],u=s;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(V(arguments[0],Tr)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(V(arguments[0],Ze)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(V(arguments[0],gr)){var s=arguments[0];s.filter(this)}else if(V(arguments[0],Hr)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),X.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[co]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(z),gn=function(){};gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var Mt=function(n){function t(r,i,o){if(n.call(this,o),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),n.hasNullElements(i))throw new pt("holes must not contain null elements");if(r.isEmpty()&&n.hasNonEmptyElements(i))throw new pt("shell is empty but holes are not");this._shell=r,this._holes=i}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),s=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)s++,o[s]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),f=0;f<c.length;f++)s++,o[s]=c[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(M.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(M.signedArea(i._holes[s].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),s=0;s<5;s++){var a=i.getX(s);if(!(a===o.getMinX()||a===o.getMaxX()))return!1;var u=i.getY(s);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),f=1;f<=4;f++){var h=i.getX(f),g=i.getY(f),p=h!==l,y=g!==c;if(p===y)return!1;l=h,c=g}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o,u=this._shell,l=a._shell;if(!u.equalsExact(l,s)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);An.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];if(s.isEmpty())return null;var u=new Array(s.getCoordinates().length-1).fill(null);Ut.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=W.minCoordinate(s.getCoordinates());W.scroll(u,l),Ut.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],M.isCCW(s.getCoordinates())===a&&W.reverse(s.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)o+=i._holes[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)o+=i._holes[s].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=this._shell,a=o._shell;return s.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,f=this._shell,h=c._shell,g=f.compareToSameClass(h,l);if(g!==0)return g;for(var p=this.getNumInteriorRing(),y=c.getNumInteriorRing(),d=0;d<p&&d<y;){var v=i.getInteriorRingN(d),C=c.getInteriorRingN(d),I=v.compareToSameClass(C,l);if(I!==0)return I;d++}return d<p?1:d<y?-1:0}},t.prototype.apply=function(i){var o=this;if(V(i,Tr)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(V(i,Ze)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(o._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(V(i,gr))i.filter(this);else if(V(i,Hr)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var s=0;s<this._holes.length;s++)o[s+1]=i._holes[s];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=n.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),s=new Array(this._holes.length).fill(null),a=0;a<s.length;a++)s[a]=i._holes[a].copy();return new t(o,s,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[gn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(z),Ri=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[co]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(oe),Dr=function(n){function t(r,i){r instanceof m&&i instanceof H&&(r=i.getCoordinateSequenceFactory().create(r)),n.call(this,r,i),this.validateConstruction()}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Nt.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new pt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new pt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(yt),Mr=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return z.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(s)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new R,s=0;s<this._geometries.length;s++)for(var a=i._geometries[s],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)o.add(u.getGeometryN(l));var c=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[gn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(oe),Ve=function(t){this._factory=t||null,this._isUserDataCopied=!1},Yo={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Ve.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Ve.prototype.edit=function(t,e){if(t===null)return null;var r=this.editInternal(t,e);return this._isUserDataCopied&&r.setUserData(t.getUserData()),r},Ve.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof oe?this.editGeometryCollection(t,e):t instanceof Mt?this.editPolygon(t,e):t instanceof Ee?e.edit(t,this._factory):t instanceof yt?e.edit(t,this._factory):(X.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Ve.prototype.editGeometryCollection=function(t,e){for(var r=this,i=e.edit(t,this._factory),o=new R,s=0;s<i.getNumGeometries();s++){var a=r.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===Ri?this._factory.createMultiPoint(o.toArray([])):i.getClass()===Fn?this._factory.createMultiLineString(o.toArray([])):i.getClass()===Mr?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},Ve.prototype.editPolygon=function(t,e){var r=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var s=new R,a=0;a<i.getNumInteriorRing();a++){var u=r.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||s.add(u)}return this._factory.createPolygon(o,s.toArray([]))},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.GeometryEditorOperation=function(){},Yo.NoOpGeometryOperation.get=function(){return fo},Yo.CoordinateOperation.get=function(){return ho},Yo.CoordinateSequenceOperation.get=function(){return go},Object.defineProperties(Ve,Yo);var fo=function(){};fo.prototype.edit=function(t,e){return t},fo.prototype.interfaces_=function(){return[Ve.GeometryEditorOperation]},fo.prototype.getClass=function(){return fo};var ho=function(){};ho.prototype.edit=function(t,e){var r=this.editCoordinates(t.getCoordinates(),t);return r===null?t:t instanceof Dr?e.createLinearRing(r):t instanceof yt?e.createLineString(r):t instanceof Ee?r.length>0?e.createPoint(r[0]):e.createPoint():t},ho.prototype.interfaces_=function(){return[Ve.GeometryEditorOperation]},ho.prototype.getClass=function(){return ho};var go=function(){};go.prototype.edit=function(t,e){return t instanceof Dr?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof yt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ee?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},go.prototype.interfaces_=function(){return[Ve.GeometryEditorOperation]},go.prototype.getClass=function(){return go};var St=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var r=0;r<e;r++)t._coordinates[r]=new m}else if(V(arguments[0],K)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=s,this._dimension=a,s===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)t._coordinates[c]=new m}}},gu={serialVersionUID:{configurable:!0}};St.prototype.setOrdinate=function(t,e,r){switch(e){case K.X:this._coordinates[t].x=r;break;case K.Y:this._coordinates[t].y=r;break;case K.Z:this._coordinates[t].z=r;break;default:throw new pt("invalid ordinateIndex")}},St.prototype.size=function(){return this._coordinates.length},St.prototype.getOrdinate=function(t,e){switch(e){case K.X:return this._coordinates[t].x;case K.Y:return this._coordinates[t].y;case K.Z:return this._coordinates[t].z}return U.NaN},St.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],r=arguments[1];r.x=this._coordinates[e].x,r.y=this._coordinates[e].y,r.z=this._coordinates[e].z}},St.prototype.getCoordinateCopy=function(t){return new m(this._coordinates[t])},St.prototype.getDimension=function(){return this._dimension},St.prototype.getX=function(t){return this._coordinates[t].x},St.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].clone();return new St(e,this._dimension)},St.prototype.expandEnvelope=function(t){for(var e=this,r=0;r<this._coordinates.length;r++)t.expandToInclude(e._coordinates[r]);return t},St.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].copy();return new St(e,this._dimension)},St.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new ur(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)e.append(", "),e.append(t._coordinates[r]);return e.append(")"),e.toString()}else return"()"},St.prototype.getY=function(t){return this._coordinates[t].y},St.prototype.toCoordinateArray=function(){return this._coordinates},St.prototype.interfaces_=function(){return[K,ke]},St.prototype.getClass=function(){return St},gu.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(St,gu);var Ar=function(){},Bs={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ar.prototype.readResolve=function(){return Ar.instance()},Ar.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new St(t)}else if(V(arguments[0],K)){var e=arguments[0];return new St(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new St(r):new St(r,i)}},Ar.prototype.interfaces_=function(){return[Ci,ke]},Ar.prototype.getClass=function(){return Ar},Ar.instance=function(){return Ar.instanceObject},Bs.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Bs.instanceObject.get=function(){return new Ar},Object.defineProperties(Ar,Bs);var pu=function(n){function t(){n.call(this),this.map_=new Map}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(r){return this.map_.get(r)||null},t.prototype.put=function(r,i){return this.map_.set(r,i),i},t.prototype.values=function(){for(var r=new R,i=this.map_.values(),o=i.next();!o.done;)r.add(o.value),o=i.next();return r},t.prototype.entrySet=function(){var r=new As;return this.map_.entries().forEach(function(i){return r.add(i)}),r},t.prototype.size=function(){return this.map_.size()},t}(ri),J=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof pr){var t=arguments[0];this._modelType=t,t===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=n.FIXED,this.setScale(e)}else if(arguments[0]instanceof n){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Gs={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},J.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new lr(r).compareTo(new lr(i))},J.prototype.getScale=function(){return this._scale},J.prototype.isFloating=function(){return this._modelType===J.FLOATING||this._modelType===J.FLOATING_SINGLE},J.prototype.getType=function(){return this._modelType},J.prototype.toString=function(){var t="UNKNOWN";return this._modelType===J.FLOATING?t="Floating":this._modelType===J.FLOATING_SINGLE?t="Floating-Single":this._modelType===J.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},J.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(U.isNaN(t))return t;if(this._modelType===J.FLOATING_SINGLE){var e=t;return e}return this._modelType===J.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof m){var r=arguments[0];if(this._modelType===J.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}},J.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===J.FLOATING?t=16:this._modelType===J.FLOATING_SINGLE?t=6:this._modelType===J.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},J.prototype.setScale=function(t){this._scale=Math.abs(t)},J.prototype.interfaces_=function(){return[ke,Fe]},J.prototype.getClass=function(){return J},J.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Gs.serialVersionUID.get=function(){return 7777263578777804e3},Gs.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(J,Gs);var pr=function n(t){this._name=t||null,n.nameToTypeMap.put(t,this)},zs={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};pr.prototype.readResolve=function(){return pr.nameToTypeMap.get(this._name)},pr.prototype.toString=function(){return this._name},pr.prototype.interfaces_=function(){return[ke]},pr.prototype.getClass=function(){return pr},zs.serialVersionUID.get=function(){return-552860263173159e4},zs.nameToTypeMap.get=function(){return new pu},Object.defineProperties(pr,zs),J.Type=pr,J.FIXED=new pr("FIXED"),J.FLOATING=new pr("FLOATING"),J.FLOATING_SINGLE=new pr("FLOATING SINGLE");var H=function n(){this._precisionModel=new J,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?V(arguments[0],Ci)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof J&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},du={serialVersionUID:{configurable:!0}};H.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new m(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new m(t.getMinX(),t.getMinY()),new m(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new m(t.getMinX(),t.getMinY()),new m(t.getMinX(),t.getMaxY()),new m(t.getMaxX(),t.getMaxY()),new m(t.getMaxX(),t.getMinY()),new m(t.getMinX(),t.getMinY())]),null)},H.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new yt(this.getCoordinateSequenceFactory().create(t),this);if(V(t,K))return new yt(t,this)}else return new yt(this.getCoordinateSequenceFactory().create([]),this)},H.prototype.createMultiLineString=function(){if(arguments.length===0)return new Fn(null,this);if(arguments.length===1){var t=arguments[0];return new Fn(t,this)}},H.prototype.buildGeometry=function(t){for(var e=null,r=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getClass();e===null&&(e=a),a!==e&&(r=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(H.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Mt)return this.createMultiPolygon(H.toPolygonArray(t));if(u instanceof yt)return this.createMultiLineString(H.toLineStringArray(t));if(u instanceof Ee)return this.createMultiPoint(H.toPointArray(t));X.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},H.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},H.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof m){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(V(arguments[0],K)){var e=arguments[0];return new Ee(e,this)}}},H.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},H.prototype.createPolygon=function(){if(arguments.length===0)return new Mt(null,null,this);if(arguments.length===1){if(V(arguments[0],K)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Dr){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new Mt(i,o,this)}},H.prototype.getSRID=function(){return this._SRID},H.prototype.createGeometryCollection=function(){if(arguments.length===0)return new oe(null,this);if(arguments.length===1){var t=arguments[0];return new oe(t,this)}},H.prototype.createGeometry=function(t){var e=new Ve(this);return e.edit(t,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})},H.prototype.getPrecisionModel=function(){return this._precisionModel},H.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(V(arguments[0],K)){var e=arguments[0];return new Dr(e,this)}}},H.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Mr(null,this);if(arguments.length===1){var t=arguments[0];return new Mr(t,this)}},H.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Ri(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Ri(e,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(V(arguments[0],K)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),s=0;s<i.size();s++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());Nt.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}},H.prototype.interfaces_=function(){return[ke]},H.prototype.getClass=function(){return H},H.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},H.getDefaultCoordinateSequenceFactory=function(){return Ar.instance()},H.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},du.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(H,du);var hf=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Wo=function(t){this.geometryFactory=t||new H};Wo.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var r=e.type;if(!dr[r])throw new Error("Unknown GeoJSON type: "+e.type);return hf.indexOf(r)!==-1?dr[r].apply(this,[e.coordinates]):r==="GeometryCollection"?dr[r].apply(this,[e.geometries]):dr[r].apply(this,[e])},Wo.prototype.write=function(t){var e=t.getGeometryType();if(!Zr[e])throw new Error("Geometry is not supported");return Zr[e].apply(this,[t])};var dr={Feature:function(n){var t={};for(var e in n)t[e]=n[e];if(n.geometry){var r=n.geometry.type;if(!dr[r])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=dr.bbox.apply(this,[n.bbox])),t},FeatureCollection:function(n){var t=this,e={};if(n.features){e.features=[];for(var r=0;r<n.features.length;++r)e.features.push(t.read(n.features[r]))}return n.bbox&&(e.bbox=this.parse.bbox.apply(this,[n.bbox])),e},coordinates:function(n){for(var t=[],e=0;e<n.length;++e){var r=n[e];t.push(new m(r[0],r[1]))}return t},bbox:function(n){return this.geometryFactory.createLinearRing([new m(n[0],n[1]),new m(n[2],n[1]),new m(n[2],n[3]),new m(n[0],n[3]),new m(n[0],n[1])])},Point:function(n){var t=new m(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(dr.Point.apply(t,[n[r]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(n){var t=dr.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(dr.LineString.apply(t,[n[r]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(n){for(var t=this,e=dr.coordinates.apply(this,[n[0]]),r=this.geometryFactory.createLinearRing(e),i=[],o=1;o<n.length;++o){var s=n[o],a=dr.coordinates.apply(t,[s]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(dr.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Zr={coordinate:function(n){return[n.x,n.y]},Point:function(n){var t=Zr.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Zr.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(n){for(var t=this,e=[],r=n.getCoordinates(),i=0;i<r.length;++i){var o=r[i];e.push(Zr.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Zr.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(n){var t=this,e=[],r=Zr.LineString.apply(this,[n._shell]);e.push(r.coordinates);for(var i=0;i<n._holes.length;++i){var o=n._holes[i],s=Zr.LineString.apply(t,[o]);e.push(s.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Zr.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=i.getGeometryType();e.push(Zr[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Vs=function(t){this.geometryFactory=t||new H,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Wo(this.geometryFactory)};Vs.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===J.FIXED&&this.reducePrecision(e),e},Vs.prototype.reducePrecision=function(t){var e=this,r,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(r=0,i=t.points.length;r<i;r++)e.precisionModel.makePrecise(t.points[r]);else if(t.geometries)for(r=0,i=t.geometries.length;r<i;r++)e.reducePrecision(t.geometries[r])};var vu=function(){this.parser=new Wo(this.geometryFactory)};vu.prototype.write=function(t){return this.parser.write(t)};var P=function(){},Ho={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.opposite=function(t){return t===P.LEFT?P.RIGHT:t===P.RIGHT?P.LEFT:t},Ho.ON.get=function(){return 0},Ho.LEFT.get=function(){return 1},Ho.RIGHT.get=function(){return 2},Object.defineProperties(P,Ho);function jo(n){this.message=n||""}jo.prototype=new Error,jo.prototype.name="EmptyStackException";function vr(){this.array_=[]}vr.prototype=new Ke,vr.prototype.add=function(n){return this.array_.push(n),!0},vr.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},vr.prototype.push=function(n){return this.array_.push(n),n},vr.prototype.pop=function(n){if(this.array_.length===0)throw new jo;return this.array_.pop()},vr.prototype.peek=function(){if(this.array_.length===0)throw new jo;return this.array_[this.array_.length-1]},vr.prototype.empty=function(){return this.array_.length===0},vr.prototype.isEmpty=function(){return this.empty()},vr.prototype.search=function(n){return this.array_.indexOf(n)},vr.prototype.size=function(){return this.array_.length},vr.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t};var mr=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};mr.prototype.getCoordinate=function(){return this._minCoord},mr.prototype.getRightmostSide=function(t,e){var r=this.getRightmostSideOfSegment(t,e);return r<0&&(r=this.getRightmostSideOfSegment(t,e-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),r},mr.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();X.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],r=t[this._minIndex+1],i=M.computeOrientation(this._minCoord,r,e),o=!1;(e.y<this._minCoord.y&&r.y<this._minCoord.y&&i===M.COUNTERCLOCKWISE||e.y>this._minCoord.y&&r.y>this._minCoord.y&&i===M.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},mr.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge(),i=r.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=P.LEFT;return i[e].y<i[e+1].y&&(o=P.RIGHT),o},mr.prototype.getEdge=function(){return this._orientedDe},mr.prototype.checkForRightmostCoordinate=function(t){for(var e=this,r=t.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(e._minCoord===null||r[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=r[i])},mr.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},mr.prototype.findEdge=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();i.isForward()&&e.checkForRightmostCoordinate(i)}X.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var o=this.getRightmostSide(this._minDe,this._minIndex);o===P.LEFT&&(this._orientedDe=this._minDe.getSym())},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var Jr=function(n){function t(e,r){n.call(this,t.msgWithCoord(e,r)),this.pt=r?new m(r):null,this.name="TopologyException"}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(r,i){return i?r:r+" [ "+i+" ]"},t}(Wr),Ko=function(){this.array_=[]};Ko.prototype.addLast=function(t){this.array_.push(t)},Ko.prototype.removeFirst=function(){return this.array_.shift()},Ko.prototype.isEmpty=function(){return this.array_.length===0};var se=function(){this._finder=null,this._dirEdgeList=new R,this._nodes=new R,this._rightMostCoord=null,this._env=null,this._finder=new mr};se.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},se.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},se.prototype.computeNodeDepth=function(t){for(var e=this,r=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){r=o;break}}if(r===null)throw new Jr("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(r);for(var s=t.getEdges().iterator();s.hasNext();){var a=s.next();a.setVisited(!0),e.copySymDepths(a)}},se.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(P.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},se.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},se.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(P.RIGHT)>=1&&e.getDepth(P.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},se.prototype.computeDepths=function(t){var e=this,r=new As,i=new Ko,o=t.getNode();for(i.addLast(o),r.add(o),t.setVisited(!0);!i.isEmpty();){var s=i.removeFirst();r.add(s),e.computeNodeDepth(s);for(var a=s.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();r.contains(c)||(i.addLast(c),r.add(c))}}}},se.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},se.prototype.getEnvelope=function(){if(this._env===null){for(var t=new F,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next(),i=r.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env},se.prototype.addReachable=function(t){var e=this,r=new vr;for(r.add(t);!r.empty();){var i=r.pop();e.add(i,r)}},se.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(P.LEFT,t.getDepth(P.RIGHT)),e.setDepth(P.RIGHT,t.getDepth(P.LEFT))},se.prototype.add=function(t,e){var r=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();r._dirEdgeList.add(o);var s=o.getSym(),a=s.getNode();a.isVisited()||e.push(a)}},se.prototype.getNodes=function(){return this._nodes},se.prototype.getDirectedEdges=function(){return this._dirEdgeList},se.prototype.interfaces_=function(){return[Fe]},se.prototype.getClass=function(){return se};var ct=function n(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var r=arguments[0];this.init(1),this.location[P.ON]=r}else if(arguments[0]instanceof n){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[P.ON]=s,this.location[P.LEFT]=a,this.location[P.RIGHT]=u}};ct.prototype.setAllLocations=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]=t},ct.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==_.NONE)return!1;return!0},ct.prototype.setAllLocationsIfNull=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]===_.NONE&&(e.location[r]=t)},ct.prototype.isLine=function(){return this.location.length===1},ct.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var r=new Array(3).fill(null);r[P.ON]=this.location[P.ON],r[P.LEFT]=_.NONE,r[P.RIGHT]=_.NONE,this.location=r}for(var i=0;i<this.location.length;i++)e.location[i]===_.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},ct.prototype.getLocations=function(){return this.location},ct.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[P.LEFT];this.location[P.LEFT]=this.location[P.RIGHT],this.location[P.RIGHT]=t},ct.prototype.toString=function(){var t=new ur;return this.location.length>1&&t.append(_.toLocationSymbol(this.location[P.LEFT])),t.append(_.toLocationSymbol(this.location[P.ON])),this.location.length>1&&t.append(_.toLocationSymbol(this.location[P.RIGHT])),t.toString()},ct.prototype.setLocations=function(t,e,r){this.location[P.ON]=t,this.location[P.LEFT]=e,this.location[P.RIGHT]=r},ct.prototype.get=function(t){return t<this.location.length?this.location[t]:_.NONE},ct.prototype.isArea=function(){return this.location.length>1},ct.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===_.NONE)return!0;return!1},ct.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(P.ON,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.location[e]=r}},ct.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(_.NONE)},ct.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},ct.prototype.allPositionsEqual=function(t){for(var e=this,r=0;r<this.location.length;r++)if(e.location[r]!==t)return!1;return!0},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var nt=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new ct(t),this.elt[1]=new ct(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.elt[0]=new ct(e.elt[0]),this.elt[1]=new ct(e.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new ct(_.NONE),this.elt[1]=new ct(_.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new ct(o,s,a),this.elt[1]=new ct(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this.elt[0]=new ct(_.NONE,_.NONE,_.NONE),this.elt[1]=new ct(_.NONE,_.NONE,_.NONE),this.elt[u].setLocations(l,c,f)}};nt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},nt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},nt.prototype.isNull=function(t){return this.elt[t].isNull()},nt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.elt[e].setAllLocationsIfNull(r)}},nt.prototype.isLine=function(t){return this.elt[t].isLine()},nt.prototype.merge=function(t){for(var e=this,r=0;r<2;r++)e.elt[r]===null&&t.elt[r]!==null?e.elt[r]=new ct(t.elt[r]):e.elt[r].merge(t.elt[r])},nt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},nt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(P.ON)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.elt[e].get(r)}},nt.prototype.toString=function(){var t=new ur;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},nt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},nt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},nt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(P.ON,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this.elt[r].setLocation(i,o)}},nt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},nt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},nt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new ct(this.elt[t].location[0]))},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.toLineLabel=function(t){for(var e=new nt(_.NONE),r=0;r<2;r++)e.setLocation(r,t.getLocation(r));return e};var Pt=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new R,this._pts=new R,this._label=new nt(_.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new R,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Pt.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)e[r]=t._pts.get(r);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=M.isCCW(this._ring.getCoordinates())},Pt.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Pt.prototype.computePoints=function(t){var e=this;this._startDe=t;var r=t,i=!0;do{if(r===null)throw new Jr("Found null DirectedEdge");if(r.getEdgeRing()===e)throw new Jr("Directed Edge visited twice during ring-building at "+r.getCoordinate());e._edges.add(r);var o=r.getLabel();X.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(r.getEdge(),r.isForward(),i),i=!1,e.setEdgeRing(r,e),r=e.getNext(r)}while(r!==this._startDe)},Pt.prototype.getLinearRing=function(){return this._ring},Pt.prototype.getCoordinate=function(t){return this._pts.get(t)},Pt.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var r=e.getNode(),i=r.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Pt.prototype.addPoints=function(t,e,r){var i=this,o=t.getCoordinates();if(e){var s=1;r&&(s=0);for(var a=s;a<o.length;a++)i._pts.add(o[a])}else{var u=o.length-2;r&&(u=o.length-1);for(var l=u;l>=0;l--)i._pts.add(o[l])}},Pt.prototype.isHole=function(){return this._isHole},Pt.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Pt.prototype.containsPoint=function(t){var e=this.getLinearRing(),r=e.getEnvelopeInternal();if(!r.contains(t)||!M.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0},Pt.prototype.addHole=function(t){this._holes.add(t)},Pt.prototype.isShell=function(){return this._shell===null},Pt.prototype.getLabel=function(){return this._label},Pt.prototype.getEdges=function(){return this._edges},Pt.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Pt.prototype.getShell=function(){return this._shell},Pt.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=e.getLocation(r,P.RIGHT);if(i===_.NONE)return null;if(this._label.getLocation(r)===_.NONE)return this._label.setLocation(r,i),null}},Pt.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Pt.prototype.toPolygon=function(t){for(var e=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),r);return o},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt};var gf=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},t.prototype.getNext=function(r){return r.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Pt),pf=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var r=this,i=new R,o=this._startDe;do{if(o.getMinEdgeRing()===null){var s=new gf(o,r._geometryFactory);i.add(s)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(r){return r.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Pt),Pe=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};Pe.prototype.setVisited=function(t){this._isVisited=t},Pe.prototype.setInResult=function(t){this._isInResult=t},Pe.prototype.isCovered=function(){return this._isCovered},Pe.prototype.isCoveredSet=function(){return this._isCoveredSet},Pe.prototype.setLabel=function(t){this._label=t},Pe.prototype.getLabel=function(){return this._label},Pe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Pe.prototype.updateIM=function(t){X.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Pe.prototype.isInResult=function(){return this._isInResult},Pe.prototype.isVisited=function(){return this._isVisited},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe};var Qo=function(n){function t(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new nt(0,_.NONE)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(r){r.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(r){},t.prototype.computeMergedLocation=function(r,i){var o=_.NONE;if(o=this._label.getLocation(i),!r.isNull(i)){var s=r.getLocation(i);o!==_.BOUNDARY&&(o=s)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new nt(r,i):this._label.setLocation(r,i)}else return n.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof nt)for(var o=arguments[0],s=0;s<2;s++){var a=r.computeMergedLocation(o,s),u=r._label.getLocation(s);u===_.NONE&&r._label.setLocation(s,a)}},t.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},t.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=_.NONE;this._label!==null&&(i=this._label.getLocation(r));var o=null;switch(i){case _.BOUNDARY:o=_.INTERIOR;break;case _.INTERIOR:o=_.BOUNDARY;break;default:o=_.BOUNDARY;break}this._label.setLocation(r,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Pe),yr=function(){this.nodeMap=new Jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};yr.prototype.find=function(t){return this.nodeMap.get(t)},yr.prototype.addNode=function(){if(arguments[0]instanceof m){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Qo){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}},yr.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},yr.prototype.iterator=function(){return this.nodeMap.values().iterator()},yr.prototype.values=function(){return this.nodeMap.values()},yr.prototype.getBoundaryNodes=function(t){for(var e=new R,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(t)===_.BOUNDARY&&e.add(i)}return e},yr.prototype.add=function(t){var e=t.getCoordinate(),r=this.addNode(e);r.add(t)},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var ot=function(){},po={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.isNorthern=function(t){return t===ot.NE||t===ot.NW},ot.isOpposite=function(t,e){if(t===e)return!1;var r=(t-e+4)%4;return r===2},ot.commonHalfPlane=function(t,e){if(t===e)return t;var r=(t-e+4)%4;if(r===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i},ot.isInHalfPlane=function(t,e){return e===ot.SE?t===ot.SE||t===ot.SW:t===e||t===e+1},ot.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new pt("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ot.NE:ot.SE:e>=0?ot.NW:ot.SW}else if(arguments[0]instanceof m&&arguments[1]instanceof m){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new pt("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?ot.NE:ot.SE:i.y>=r.y?ot.NW:ot.SW}},po.NE.get=function(){return 0},po.NW.get=function(){return 1},po.SW.get=function(){return 2},po.SE.get=function(){return 3},Object.defineProperties(ot,po);var $t=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(r,i),this._label=o}else if(arguments.length===4){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=s,this.init(a,u),this._label=l}};$t.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:M.computeOrientation(t._p0,t._p1,this._p1)},$t.prototype.getDy=function(){return this._dy},$t.prototype.getCoordinate=function(){return this._p0},$t.prototype.setNode=function(t){this._node=t},$t.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),o=r.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},$t.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},$t.prototype.getDirectedCoordinate=function(){return this._p1},$t.prototype.getDx=function(){return this._dx},$t.prototype.getLabel=function(){return this._label},$t.prototype.getEdge=function(){return this._edge},$t.prototype.getQuadrant=function(){return this._quadrant},$t.prototype.getNode=function(){return this._node},$t.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),r=e.lastIndexOf("."),i=e.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},$t.prototype.computeLabel=function(t){},$t.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=ot.quadrant(this._dx,this._dy),X.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},$t.prototype.interfaces_=function(){return[Fe]},$t.prototype.getClass=function(){return $t};var Us=function(n){function t(){var e=arguments[0],r=arguments[1];if(n.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=r,r)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(r){return this._depth[r]},t.prototype.setVisited=function(r){this._isVisited=r},t.prototype.computeDirectedLabel=function(){this._label=new nt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new Jr("assigned depths do not match",this.getCoordinate());this._depth[r]=i},t.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,o=0;o<2;o++)r._label.isArea(o)&&r._label.getLocation(o,P.LEFT)===_.INTERIOR&&r._label.getLocation(o,P.RIGHT)===_.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(r){this._nextMin=r},t.prototype.print=function(r){n.prototype.print.call(this,r),r.print(" "+this._depth[P.LEFT]+"/"+this._depth[P.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},t.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},t.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,_.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,_.EXTERIOR);return r&&i&&o},t.prototype.setEdgeRing=function(r){this._edgeRing=r},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},t.prototype.setInResult=function(r){this._isInResult=r},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},t.prototype.setSym=function(r){this._sym=r},t.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},t.prototype.setEdgeDepths=function(r,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var s=1;r===P.LEFT&&(s=-1);var a=P.opposite(r),u=o*s,l=i+u;this.setDepth(r,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(r){this._next=r},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(r,i){return r===_.EXTERIOR&&i===_.INTERIOR?1:r===_.INTERIOR&&i===_.EXTERIOR?-1:0},t}($t),Ti=function(){};Ti.prototype.createNode=function(t){return new Qo(t,null)},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var vt=function(){if(this._edges=new R,this._nodes=null,this._edgeEndList=new R,arguments.length===0)this._nodes=new yr(new Ti);else if(arguments.length===1){var t=arguments[0];this._nodes=new yr(t)}};vt.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var r=0;r<this._edges.size();r++){t.println("edge "+r+":");var i=e._edges.get(r);i.print(t),i.eiList.print(t)}},vt.prototype.find=function(t){return this._nodes.find(t)},vt.prototype.addNode=function(){if(arguments[0]instanceof Qo){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof m){var e=arguments[0];return this._nodes.addNode(e)}},vt.prototype.getNodeIterator=function(){return this._nodes.iterator()},vt.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},vt.prototype.debugPrintln=function(t){Ut.out.println(t)},vt.prototype.isBoundaryNode=function(t,e){var r=this._nodes.find(e);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(t)===_.BOUNDARY},vt.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},vt.prototype.matchInSameDirection=function(t,e,r,i){return t.equals(r)?M.computeOrientation(t,e,i)===M.COLLINEAR&&ot.quadrant(t,e)===ot.quadrant(r,i):!1},vt.prototype.getEdgeEnds=function(){return this._edgeEndList},vt.prototype.debugPrint=function(t){Ut.out.print(t)},vt.prototype.getEdgeIterator=function(){return this._edges.iterator()},vt.prototype.findEdgeInSameDirection=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var o=r._edges.get(i),s=o.getCoordinates();if(r.matchInSameDirection(t,e,s[0],s[1])||r.matchInSameDirection(t,e,s[s.length-1],s[s.length-2]))return o}return null},vt.prototype.insertEdge=function(t){this._edges.add(t)},vt.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var r=e.next();if(r.getEdge()===t)return r}return null},vt.prototype.addEdges=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();e._edges.add(i);var o=new Us(i,!0),s=new Us(i,!1);o.setSym(s),s.setSym(o),e.add(o),e.add(s)}},vt.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},vt.prototype.getNodes=function(){return this._nodes.values()},vt.prototype.findEdge=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var o=r._edges.get(i),s=o.getCoordinates();if(t.equals(s[0])&&e.equals(s[1]))return o}return null},vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.getEdges().linkResultDirectedEdges()}};var Ce=function(){this._geometryFactory=null,this._shellList=new R;var t=arguments[0];this._geometryFactory=t};Ce.prototype.sortShellsAndHoles=function(t,e,r){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?r.add(o):e.add(o)}},Ce.prototype.computePolygons=function(t){for(var e=this,r=new R,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);r.add(s)}return r},Ce.prototype.placeFreeHoles=function(t,e){for(var r=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var s=r.findEdgeRingContaining(o,t);if(s===null)throw new Jr("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}},Ce.prototype.buildMinimalEdgeRings=function(t,e,r){for(var i=this,o=new R,s=t.iterator();s.hasNext();){var a=s.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):r.addAll(u)}else o.add(a)}return o},Ce.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var r=e.next();if(r.containsPoint(t))return!0}return!1},Ce.prototype.buildMaximalEdgeRings=function(t){for(var e=this,r=new R,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new pf(o,e._geometryFactory);r.add(s),s.setInResult()}}return r},Ce.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(t)}},Ce.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},Ce.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),i=r.getEnvelopeInternal(),o=r.getCoordinateN(0),s=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),f=c.getEnvelopeInternal();s!==null&&(a=s.getLinearRing().getEnvelopeInternal());var h=!1;f.contains(i)&&M.isPointInRing(o,c.getCoordinates())&&(h=!0),h&&(s===null||a.contains(f))&&(s=l)}return s},Ce.prototype.findShell=function(t){for(var e=0,r=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(r=o,e++)}return X.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Ce.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],r=arguments[1];vt.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(e),o=new R,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Di=function(){};Di.prototype.getBounds=function(){},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di};var Je=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Je.prototype.getItem=function(){return this._item},Je.prototype.getBounds=function(){return this._bounds},Je.prototype.interfaces_=function(){return[Di,ke]},Je.prototype.getClass=function(){return Je};var $r=function(){this._size=null,this._items=null,this._size=0,this._items=new R,this._items.add(null)};$r.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},$r.prototype.size=function(){return this._size},$r.prototype.reorder=function(t){for(var e=this,r=null,i=this._items.get(t);t*2<=this._size&&(r=t*2,r!==e._size&&e._items.get(r+1).compareTo(e._items.get(r))<0&&r++,e._items.get(r).compareTo(i)<0);t=r)e._items.set(t,e._items.get(r));this._items.set(t,i)},$r.prototype.clear=function(){this._size=0,this._items.clear()},$r.prototype.isEmpty=function(){return this._size===0},$r.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)e._items.set(r,e._items.get(Math.trunc(r/2)));this._items.set(r,t)},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var pn=function(){};pn.prototype.visitItem=function(t){},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var ni=function(){};ni.prototype.insert=function(t,e){},ni.prototype.remove=function(t,e){},ni.prototype.query=function(){},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni};var At=function(){if(this._childBoundables=new R,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},mu={serialVersionUID:{configurable:!0}};At.prototype.getLevel=function(){return this._level},At.prototype.size=function(){return this._childBoundables.size()},At.prototype.getChildBoundables=function(){return this._childBoundables},At.prototype.addChildBoundable=function(t){X.isTrue(this._bounds===null),this._childBoundables.add(t)},At.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},At.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},At.prototype.interfaces_=function(){return[Di,ke]},At.prototype.getClass=function(){return At},mu.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(At,mu);var $e=function(){};$e.reverseOrder=function(){return{compare:function(e,r){return r.compareTo(e)}}},$e.min=function(t){return $e.sort(t),t.get(0)},$e.sort=function(t,e){var r=t.toArray();e?An.sort(r,e):An.sort(r);for(var i=t.iterator(),o=0,s=r.length;o<s;o++)i.next(),i.set(r[o])},$e.singletonList=function(t){var e=new R;return e.add(t),e};var Ot=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=r,this._distance=this.distance()};Ot.prototype.expandToQueue=function(t,e){var r=Ot.isComposite(this._boundable1),i=Ot.isComposite(this._boundable2);if(r&&i)return Ot.area(this._boundable1)>Ot.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new pt("neither boundable is composite")},Ot.prototype.isLeaves=function(){return!(Ot.isComposite(this._boundable1)||Ot.isComposite(this._boundable2))},Ot.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Ot.prototype.expand=function(t,e,r,i){for(var o=this,s=t.getChildBoundables(),a=s.iterator();a.hasNext();){var u=a.next(),l=new Ot(u,e,o._itemDistance);l.getDistance()<i&&r.add(l)}},Ot.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Ot.prototype.getDistance=function(){return this._distance},Ot.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Ot.prototype.interfaces_=function(){return[Fe]},Ot.prototype.getClass=function(){return Ot},Ot.area=function(t){return t.getBounds().getArea()},Ot.isComposite=function(t){return t instanceof At};var Gt=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new R,this._nodeCapacity=null,arguments.length===0){var t=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];X.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Zo={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Gt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Gt.prototype.lastNode=function(t){return t.get(t.size()-1)},Gt.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof At?r+=t.size(o):o instanceof Je&&(r+=1)}return r}},Gt.prototype.removeItem=function(t,e){for(var r=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Je&&o.getItem()===e&&(r=o)}return r!==null?(t.getChildBoundables().remove(r),!0):!1},Gt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new R:e}else if(arguments.length===1){for(var r=arguments[0],i=new R,o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof At){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof Je?i.add(s.getItem()):X.shouldNeverReachHere()}return i.size()<=0?null:i}},Gt.prototype.insert=function(t,e){X.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Je(t,e))},Gt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],r=new R;return this.boundablesAtLevel(e,this._root,r),r}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(X.isTrue(i>-2),o.getLevel()===i)return s.add(o),null;for(var a=o.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof At?t.boundablesAtLevel(i,u,s):(X.isTrue(u instanceof Je),i===-1&&s.add(u))}return null}},Gt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var r=new R;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,r),r}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(V(arguments[2],pn)&&arguments[0]instanceof Object&&arguments[1]instanceof At)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var f=l.get(c);t.getIntersectsOp().intersects(f.getBounds(),s)&&(f instanceof At?t.query(s,f,u):f instanceof Je?u.visitItem(f.getItem()):X.shouldNeverReachHere())}else if(V(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof At)for(var h=arguments[0],g=arguments[1],p=arguments[2],y=g.getChildBoundables(),d=0;d<y.size();d++){var v=y.get(d);t.getIntersectsOp().intersects(v.getBounds(),h)&&(v instanceof At?t.query(h,v,p):v instanceof Je?p.add(v.getItem()):X.shouldNeverReachHere())}}},Gt.prototype.build=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},Gt.prototype.getRoot=function(){return this.build(),this._root},Gt.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,r):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=this.removeItem(o,s);if(a)return!0;for(var u=null,l=o.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof At&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}},Gt.prototype.createHigherLevels=function(t,e){X.isTrue(!t.isEmpty());var r=this.createParentBoundables(t,e+1);return r.size()===1?r.get(0):this.createHigherLevels(r,e+1)},Gt.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof At){var s=t.depth(o);s>r&&(r=s)}}return r+1}},Gt.prototype.createParentBoundables=function(t,e){var r=this;X.isTrue(!t.isEmpty());var i=new R;i.add(this.createNode(e));var o=new R(t);$e.sort(o,this.getComparator());for(var s=o.iterator();s.hasNext();){var a=s.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(e)),r.lastNode(i).addChildBoundable(a)}return i},Gt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Gt.prototype.interfaces_=function(){return[ke]},Gt.prototype.getClass=function(){return Gt},Gt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Zo.IntersectsOp.get=function(){return df},Zo.serialVersionUID.get=function(){return-3886435814360241e3},Zo.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Gt,Zo);var df=function(){},Mi=function(){};Mi.prototype.distance=function(t,e){},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var yu=function(n){function t(r){r=r||t.DEFAULT_NODE_CAPACITY,n.call(this,r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var s=this;X.isTrue(i.length>0);for(var a=new R,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new _u(i)},t.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;n.prototype.insert.call(this,i,o)}else return n.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var s=Math.trunc(Math.ceil(i.size()/o)),a=new Array(o).fill(null),u=i.iterator(),l=0;l<o;l++){a[l]=new R;for(var c=0;u.hasNext()&&c<s;){var f=u.next();a[l].add(f),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return n.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];n.prototype.query.call(this,o,s)}else if(arguments.length===3){if(V(arguments[2],pn)&&arguments[0]instanceof Object&&arguments[1]instanceof At){var a=arguments[0],u=arguments[1],l=arguments[2];n.prototype.query.call(this,a,u,l)}else if(V(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof At){var c=arguments[0],f=arguments[1],h=arguments[2];n.prototype.query.call(this,c,f,h)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return n.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return n.prototype.remove.call(this,i,o)}else return n.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){X.isTrue(!i.isEmpty());var s=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new R(i);$e.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(s))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(V(arguments[0],Mi)){var i=arguments[0],o=new Ot(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof Ot){var s=arguments[0];return this.nearestNeighbour(s,U.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&V(arguments[1],Mi)){var a=arguments[0],u=arguments[1],l=new Ot(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof Ot&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=f,g=null,p=new $r;for(p.add(c);!p.isEmpty()&&h>0;){var y=p.poll(),d=y.getDistance();if(d>=h)break;y.isLeaves()?(h=d,g=y):y.expandToQueue(p,h)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var v=arguments[0],C=arguments[1],I=arguments[2],N=new Je(v,C),L=new Ot(this.getRoot(),N,I);return this.nearestNeighbour(L)[0]}},t.prototype.interfaces_=function(){return[ni,ke]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return _u},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[Ei]},compare:function(r,i){return n.compareDoubles(t.centreX(r.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[Ei]},compare:function(r,i){return n.compareDoubles(t.centreY(r.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Gt),_u=function(n){function t(){var e=arguments[0];n.call(this,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();r===null?r=new F(o.getBounds()):r.expandToInclude(o.getBounds())}return r},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(At),de=function(){};de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de},de.relativeSign=function(t,e){return t<e?-1:t>e?1:0},de.compare=function(t,e,r){if(e.equals2D(r))return 0;var i=de.relativeSign(e.x,r.x),o=de.relativeSign(e.y,r.y);switch(t){case 0:return de.compareValue(i,o);case 1:return de.compareValue(o,i);case 2:return de.compareValue(o,-i);case 3:return de.compareValue(-i,o);case 4:return de.compareValue(-i,-o);case 5:return de.compareValue(-o,-i);case 6:return de.compareValue(-o,i);case 7:return de.compareValue(i,-o)}return X.shouldNeverReachHere("invalid octant value"),0},de.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var dn=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._segString=t,this.coord=new m(e),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(r))};dn.prototype.getCoordinate=function(){return this.coord},dn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},dn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:de.compare(this._segmentOctant,this.coord,e.coord)},dn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},dn.prototype.isInterior=function(){return this._isInterior},dn.prototype.interfaces_=function(){return[Fe]},dn.prototype.getClass=function(){return dn};var ae=function(){this._nodeMap=new Jt,this._edge=null;var t=arguments[0];this._edge=t};ae.prototype.getSplitCoordinates=function(){var t=this,e=new so;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()},ae.prototype.addCollapsedNodes=function(){var t=this,e=new R;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var r=e.iterator();r.hasNext();){var i=r.next().intValue();t.add(t._edge.getCoordinate(i),i)}},ae.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},ae.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,r=0;r<this._edge.size()-2;r++){var i=e._edge.getCoordinate(r),o=e._edge.getCoordinate(r+2);i.equals2D(o)&&t.add(new lr(r+1))}},ae.prototype.addEdgeCoordinates=function(t,e,r){var i=this,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);r.add(new m(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)r.add(i._edge.getCoordinate(a));s&&r.add(new m(e.coord))},ae.prototype.iterator=function(){return this._nodeMap.values().iterator()},ae.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},ae.prototype.findCollapseIndex=function(t,e,r){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(r[0]=t.segmentIndex+1,!0):!1},ae.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,r=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var s=i.next(),a=e.findCollapseIndex(o,s,r);a&&t.add(new lr(r[0])),o=s}},ae.prototype.getEdge=function(){return this._edge},ae.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ae.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new m(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r._edge.getCoordinate(l);return s&&(a[u]=new m(e.coord)),new xt(a,this._edge.getData())},ae.prototype.add=function(t,e){var r=new dn(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(r);return i!==null?(X.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)},ae.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),r=t.get(0),i=r.getCoordinate(0);if(!i.equals2D(e[0]))throw new Wr("bad split edge start point at "+i);var o=t.get(t.size()-1),s=o.getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new Wr("bad split edge end point at "+a)},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae};var ii=function(){};ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new pt("Cannot compute the octant for point ( "+t+", "+e+" )");var r=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?r>=i?0:1:r>=i?7:6:e>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof m&&arguments[1]instanceof m){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new pt("Cannot compute the octant for two identical points "+o);return ii.octant(a,u)}};var Fr=function(){};Fr.prototype.getCoordinates=function(){},Fr.prototype.size=function(){},Fr.prototype.getCoordinate=function(t){},Fr.prototype.isClosed=function(){},Fr.prototype.setData=function(t){},Fr.prototype.getData=function(){},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr};var vo=function(){};vo.prototype.addIntersection=function(t,e){},vo.prototype.interfaces_=function(){return[Fr]},vo.prototype.getClass=function(){return vo};var xt=function(){this._nodeList=new ae(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};xt.prototype.getCoordinates=function(){return this._pts},xt.prototype.size=function(){return this._pts.length},xt.prototype.getCoordinate=function(t){return this._pts[t]},xt.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},xt.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},xt.prototype.setData=function(t){this._data=t},xt.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ii.octant(t,e)},xt.prototype.getData=function(){return this._data},xt.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[3],s=new m(r.getIntersection(o));this.addIntersection(s,i)}},xt.prototype.toString=function(){return je.toLineString(new St(this._pts))},xt.prototype.getNodeList=function(){return this._nodeList},xt.prototype.addIntersectionNode=function(t,e){var r=e,i=r+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(r=i)}var s=this._nodeList.add(t,r);return s},xt.prototype.addIntersections=function(t,e,r){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,r,o)},xt.prototype.interfaces_=function(){return[vo]},xt.prototype.getClass=function(){return xt},xt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new R;return xt.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],o=r.iterator();o.hasNext();){var s=o.next();s.getNodeList().addSplitEdges(i)}};var k=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new m,this.p1=new m;else if(arguments.length===1){var t=arguments[0];this.p0=new m(t.p0),this.p1=new m(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this.p0=new m(e,r),this.p1=new m(i,o)}},Eu={serialVersionUID:{configurable:!0}};k.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},k.prototype.orientationIndex=function(){if(arguments[0]instanceof k){var t=arguments[0],e=M.orientationIndex(this.p0,this.p1,t.p0),r=M.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}else if(arguments[0]instanceof m){var i=arguments[0];return M.orientationIndex(this.p0,this.p1,i)}},k.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},k.prototype.isVertical=function(){return this.p0.x===this.p1.x},k.prototype.equals=function(t){if(!(t instanceof k))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},k.prototype.intersection=function(t){var e=new Dn;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},k.prototype.project=function(){if(arguments[0]instanceof m){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new m(t);var e=this.projectionFactor(t),r=new m;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof k){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1||o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new k(a,u)}},k.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},k.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},k.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},k.prototype.distancePerpendicular=function(t){return M.distancePointLinePerpendicular(t,this.p0,this.p1)},k.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},k.prototype.midPoint=function(){return k.midPoint(this.p0,this.p1)},k.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,i=e*e+r*r;if(i<=0)return U.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/i;return o},k.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var r=new Array(2).fill(null),i=U.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),r[0]=s,r[1]=t.p0;var a=this.closestPoint(t.p1);o=a.distance(t.p1),o<i&&(i=o,r[0]=a,r[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,r[0]=this.p0,r[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,r[0]=this.p1,r[1]=l),r},k.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var r=this.p0.distance(t),i=this.p1.distance(t);return r<i?this.p0:this.p1},k.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},k.prototype.getLength=function(){return this.p0.distance(this.p1)},k.prototype.compareTo=function(t){var e=t,r=this.p0.compareTo(e.p0);return r!==0?r:this.p1.compareTo(e.p1)},k.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},k.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},k.prototype.lineIntersection=function(t){try{var e=He.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(r){if(!(r instanceof Ii))throw r}finally{}return null},k.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},k.prototype.pointAlongOffset=function(t,e){var r=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,a=Math.sqrt(o*o+s*s),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/a,l=e*s/a}var c=r-l,f=i+u,h=new m(c,f);return h},k.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=r.x,this.p1.y=r.y}},k.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||U.isNaN(e))&&(e=1),e},k.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},k.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},k.prototype.distance=function(){if(arguments[0]instanceof k){var t=arguments[0];return M.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof m){var e=arguments[0];return M.distancePointLine(e,this.p0,this.p1)}},k.prototype.pointAlong=function(t){var e=new m;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},k.prototype.hashCode=function(){var t=U.doubleToLongBits(this.p0.x);t^=U.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),r=U.doubleToLongBits(this.p1.x);r^=U.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return e^i},k.prototype.interfaces_=function(){return[Fe,ke]},k.prototype.getClass=function(){return k},k.midPoint=function(t,e){return new m((t.x+e.x)/2,(t.y+e.y)/2)},Eu.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(k,Eu);var mo=function(){this.tempEnv1=new F,this.tempEnv2=new F,this._overlapSeg1=new k,this._overlapSeg2=new k};mo.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo};var Ie=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=i};Ie.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Ie.prototype.computeSelect=function(t,e,r,i){var o=this._pts[e],s=this._pts[r];if(i.tempEnv1.init(o,s),r-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+r)/2);e<a&&this.computeSelect(t,e,a,i),a<r&&this.computeSelect(t,a,r,i)},Ie.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)e[r++]=t._pts[i];return e},Ie.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Ie.prototype.setId=function(t){this._id=t},Ie.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Ie.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new F(t,e)}return this._env},Ie.prototype.getEndIndex=function(){return this._end},Ie.prototype.getStartIndex=function(){return this._start},Ie.prototype.getContext=function(){return this._context},Ie.prototype.getId=function(){return this._id},Ie.prototype.computeOverlapsInternal=function(t,e,r,i,o,s){var a=this._pts[t],u=this._pts[e],l=r._pts[i],c=r._pts[o];if(e-t===1&&o-i===1)return s.overlap(this,t,r,i),null;if(s.tempEnv1.init(a,u),s.tempEnv2.init(l,c),!s.tempEnv1.intersects(s.tempEnv2))return null;var f=Math.trunc((t+e)/2),h=Math.trunc((i+o)/2);t<f&&(i<h&&this.computeOverlapsInternal(t,f,r,i,h,s),h<o&&this.computeOverlapsInternal(t,f,r,h,o,s)),f<e&&(i<h&&this.computeOverlapsInternal(f,e,r,i,h,s),h<o&&this.computeOverlapsInternal(f,e,r,h,o,s))},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.getChainStartIndices=function(t){var e=0,r=new R;r.add(new lr(e));do{var i=_r.findChainEnd(t,e);r.add(new lr(i)),e=i}while(e<t.length-1);var o=_r.toIntArray(r);return o},_r.findChainEnd=function(t,e){for(var r=e;r<t.length-1&&t[r].equals2D(t[r+1]);)r++;if(r>=t.length-1)return t.length-1;for(var i=ot.quadrant(t[r],t[r+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var s=ot.quadrant(t[o-1],t[o]);if(s!==i)break}o++}return o-1},_r.getChains=function(){if(arguments.length===1){var t=arguments[0];return _r.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],r=arguments[1],i=new R,o=_r.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new Ie(e,o[s],o[s+1],r);i.add(a)}return i}},_r.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var kn=function(){};kn.prototype.computeNodes=function(t){},kn.prototype.getNodedSubstrings=function(){},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn};var yo=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};yo.prototype.setSegmentIntersector=function(t){this._segInt=t},yo.prototype.interfaces_=function(){return[kn]},yo.prototype.getClass=function(){return yo};var qs=function(n){function t(r){r?n.call(this,r):n.call(this),this._monoChains=new R,this._index=new yu,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return xt.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=_r.getChains(i.getCoordinates(),i),a=s.iterator();a.hasNext();){var u=a.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var s=i.iterator();s.hasNext();)o.add(s.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new Cu(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var a=s.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Cu},Object.defineProperties(t,e),t}(yo),Cu=function(n){function t(){n.call(this),this._si=null;var e=arguments[0];this._si=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=r.getContext(),u=o.getContext();this._si.processIntersections(a,i,u,s)}else return n.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(mo),$=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},tn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};$.prototype.getEndCapStyle=function(){return this._endCapStyle},$.prototype.isSingleSided=function(){return this._isSingleSided},$.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=$.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=$.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==$.JOIN_ROUND&&(this._quadrantSegments=$.DEFAULT_QUADRANT_SEGMENTS)},$.prototype.getJoinStyle=function(){return this._joinStyle},$.prototype.setJoinStyle=function(t){this._joinStyle=t},$.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},$.prototype.getSimplifyFactor=function(){return this._simplifyFactor},$.prototype.getQuadrantSegments=function(){return this._quadrantSegments},$.prototype.setEndCapStyle=function(t){this._endCapStyle=t},$.prototype.getMitreLimit=function(){return this._mitreLimit},$.prototype.setMitreLimit=function(t){this._mitreLimit=t},$.prototype.setSingleSided=function(t){this._isSingleSided=t},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},tn.CAP_ROUND.get=function(){return 1},tn.CAP_FLAT.get=function(){return 2},tn.CAP_SQUARE.get=function(){return 3},tn.JOIN_ROUND.get=function(){return 1},tn.JOIN_MITRE.get=function(){return 2},tn.JOIN_BEVEL.get=function(){return 3},tn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},tn.DEFAULT_MITRE_LIMIT.get=function(){return 5},tn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties($,tn);var _t=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=M.COUNTERCLOCKWISE,this._inputLine=t||null},_o={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};_t.prototype.isDeletable=function(t,e,r,i){var o=this._inputLine[t],s=this._inputLine[e],a=this._inputLine[r];return!this.isConcave(o,s,a)||!this.isShallow(o,s,a,i)?!1:this.isShallowSampled(o,s,t,r,i)},_t.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,r=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(r),o=!1;i<this._inputLine.length;){var s=!1;t.isDeletable(e,r,i,t._distanceTol)&&(t._isDeleted[r]=_t.DELETE,s=!0,o=!0),s?e=i:e=r,r=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(r)}return o},_t.prototype.isShallowConcavity=function(t,e,r,i){var o=M.computeOrientation(t,e,r),s=o===this._angleOrientation;if(!s)return!1;var a=M.distancePointLine(e,t,r);return a<i},_t.prototype.isShallowSampled=function(t,e,r,i,o){var s=this,a=Math.trunc((i-r)/_t.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=r;u<i;u+=a)if(!s.isShallow(t,e,s._inputLine[u],o))return!1;return!0},_t.prototype.isConcave=function(t,e,r){var i=M.computeOrientation(t,e,r),o=i===this._angleOrientation;return o},_t.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=M.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var r=!1;do r=e.deleteShallowConcavities();while(r);return this.collapseLine()},_t.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===_t.DELETE;)e++;return e},_t.prototype.isShallow=function(t,e,r,i){var o=M.distancePointLine(e,t,r);return o<i},_t.prototype.collapseLine=function(){for(var t=this,e=new so,r=0;r<this._inputLine.length;r++)t._isDeleted[r]!==_t.DELETE&&e.add(t._inputLine[r]);return e.toCoordinateArray()},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t},_t.simplify=function(t,e){var r=new _t(t);return r.simplify(e)},_o.INIT.get=function(){return 0},_o.DELETE.get=function(){return 1},_o.KEEP.get=function(){return 1},_o.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(_t,_o);var Oe=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new R},Iu={COORDINATE_ARRAY_TYPE:{configurable:!0}};Oe.prototype.getCoordinates=function(){var t=this._ptList.toArray(Oe.COORDINATE_ARRAY_TYPE);return t},Oe.prototype.setPrecisionModel=function(t){this._precisionModel=t},Oe.prototype.addPt=function(t){var e=new m(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Oe.prototype.revere=function(){},Oe.prototype.addPts=function(t,e){var r=this;if(e)for(var i=0;i<t.length;i++)r.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)r.addPt(t[o])},Oe.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),r=t.distance(e);return r<this._minimimVertexDistance},Oe.prototype.toString=function(){var t=new H,e=t.createLineString(this.getCoordinates());return e.toString()},Oe.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new m(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Oe.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Iu.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Oe,Iu);var j=function(){},oi={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.toDegrees=function(t){return t*180/Math.PI},j.normalize=function(t){for(;t>Math.PI;)t-=j.PI_TIMES_2;for(;t<=-Math.PI;)t+=j.PI_TIMES_2;return t},j.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=r.x-e.x,o=r.y-e.y;return Math.atan2(o,i)}},j.isAcute=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=r.x-e.x,a=r.y-e.y,u=i*s+o*a;return u>0},j.isObtuse=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=r.x-e.x,a=r.y-e.y,u=i*s+o*a;return u<0},j.interiorAngle=function(t,e,r){var i=j.angle(e,t),o=j.angle(e,r);return Math.abs(o-i)},j.normalizePositive=function(t){if(t<0){for(;t<0;)t+=j.PI_TIMES_2;t>=j.PI_TIMES_2&&(t=0)}else{for(;t>=j.PI_TIMES_2;)t-=j.PI_TIMES_2;t<0&&(t=0)}return t},j.angleBetween=function(t,e,r){var i=j.angle(e,t),o=j.angle(e,r);return j.diff(i,o)},j.diff=function(t,e){var r=null;return t<e?r=e-t:r=t-e,r>Math.PI&&(r=2*Math.PI-r),r},j.toRadians=function(t){return t*Math.PI/180},j.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?j.COUNTERCLOCKWISE:r<0?j.CLOCKWISE:j.NONE},j.angleBetweenOriented=function(t,e,r){var i=j.angle(e,t),o=j.angle(e,r),s=o-i;return s<=-Math.PI?s+j.PI_TIMES_2:s>Math.PI?s-j.PI_TIMES_2:s},oi.PI_TIMES_2.get=function(){return 2*Math.PI},oi.PI_OVER_2.get=function(){return Math.PI/2},oi.PI_OVER_4.get=function(){return Math.PI/4},oi.COUNTERCLOCKWISE.get=function(){return M.COUNTERCLOCKWISE},oi.CLOCKWISE.get=function(){return M.CLOCKWISE},oi.NONE.get=function(){return M.COLLINEAR},Object.defineProperties(j,oi);var ft=function n(){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 k,this._seg1=new k,this._offset0=new k,this._offset1=new k,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Dn,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===$.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Eo={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};ft.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=M.computeOrientation(this._s0,this._s1,this._s2),i=r===M.CLOCKWISE&&this._side===P.LEFT||r===M.COUNTERCLOCKWISE&&this._side===P.RIGHT;r===0?this.addCollinear(e):i?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},ft.prototype.addLineEndCap=function(t,e){var r=new k(t,e),i=new k;this.computeOffsetSegment(r,P.LEFT,this._distance,i);var o=new k;this.computeOffsetSegment(r,P.RIGHT,this._distance,o);var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s);switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,M.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case $.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case $.CAP_SQUARE:var l=new m;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new m(i.p1.x+l.x,i.p1.y+l.y),f=new m(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}},ft.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},ft.prototype.addMitreJoin=function(t,e,r,i){var o=!0,s=null;try{s=He.intersection(e.p0,e.p1,r.p0,r.p1);var a=i<=0?1:s.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof Ii)s=new m(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,r,i,this._bufParams.getMitreLimit())},ft.prototype.addFilletCorner=function(t,e,r,i,o){var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s),l=r.x-t.x,c=r.y-t.y,f=Math.atan2(c,l);i===M.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(r)},ft.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ft.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===$.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===$.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},ft.prototype.createSquare=function(t){this._segList.addPt(new m(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new m(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new m(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new m(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ft.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ft.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ft.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ft.prototype.initSideSegments=function(t,e,r){this._s1=t,this._s2=e,this._side=r,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)},ft.prototype.addLimitedMitreJoin=function(t,e,r,i){var o=this._seg0.p1,s=j.angle(o,this._seg0.p0),a=j.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=j.normalize(s+u),c=j.normalize(l+Math.PI),f=i*r,h=f*Math.abs(Math.sin(u)),g=r-h,p=o.x+f*Math.cos(c),y=o.y+f*Math.sin(c),d=new m(p,y),v=new k(o,d),C=v.pointAlongOffset(1,g),I=v.pointAlongOffset(1,-g);this._side===P.LEFT?(this._segList.addPt(C),this._segList.addPt(I)):(this._segList.addPt(I),this._segList.addPt(C))},ft.prototype.computeOffsetSegment=function(t,e,r,i){var o=e===P.LEFT?1:-1,s=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(s*s+a*a),l=o*r*s/u,c=o*r*a/u;i.p0.x=t.p0.x-c,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-c,i.p1.y=t.p1.y+l},ft.prototype.addFilletArc=function(t,e,r,i,o){var s=this,a=i===M.CLOCKWISE?-1:1,u=Math.abs(e-r),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,f=u/l,h=c,g=new m;h<u;){var p=e+a*h;g.x=t.x+o*Math.cos(p),g.y=t.y+o*Math.sin(p),s._segList.addPt(g),h+=f}},ft.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*ft.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new m((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 m((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)}},ft.prototype.createCircle=function(t){var e=new m(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ft.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ft.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Oe,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ft.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ft.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===$.JOIN_BEVEL||this._bufParams.getJoinStyle()===$.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,M.CLOCKWISE,this._distance))},ft.prototype.closeRing=function(){this._segList.closeRing()},ft.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},Eo.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Eo.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Eo.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Eo.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ft,Eo);var ve=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};ve.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var r=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,r,o);var s=o.getCoordinates();return r&&W.reverse(s),s},ve.prototype.computeSingleSidedBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var o=_t.simplify(t,-i),s=o.length-1;r.initSideSegments(o[s],o[s-1],P.LEFT),r.addFirstSegment();for(var a=s-2;a>=0;a--)r.addNextSegment(o[a],!0)}else{r.addSegments(t,!1);var u=_t.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],P.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment(),r.closeRing()},ve.prototype.computeRingBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);e===P.RIGHT&&(i=-i);var o=_t.simplify(t,i),s=o.length-1;r.initSideSegments(o[s-1],o[0],e);for(var a=1;a<=s;a++){var u=a!==1;r.addNextSegment(o[a],u)}r.closeRing()},ve.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),i=_t.simplify(t,r),o=i.length-1;e.initSideSegments(i[0],i[1],P.LEFT);for(var s=2;s<=o;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var a=_t.simplify(t,-r),u=a.length-1;e.initSideSegments(a[u],a[u-1],P.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},ve.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:e.createCircle(t);break;case $.CAP_SQUARE:e.createSquare(t);break}},ve.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var r=Math.abs(e),i=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var s=i.getCoordinates();return s},ve.prototype.getBufferParameters=function(){return this._bufParams},ve.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},ve.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(r===0)return ve.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},ve.prototype.computeOffsetCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){var o=_t.simplify(t,-i),s=o.length-1;r.initSideSegments(o[s],o[s-1],P.LEFT),r.addFirstSegment();for(var a=s-2;a>=0;a--)r.addNextSegment(o[a],!0)}else{var u=_t.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],P.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment()},ve.prototype.getSegGen=function(t){return new ft(this._precisionModel,this._bufParams,t)},ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve},ve.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;r<e.length;r++)e[r]=new m(t[r]);return e};var si=function(){this._subgraphs=null,this._seg=new k,this._cga=new M;var t=arguments[0];this._subgraphs=t},Nu={DepthSegment:{configurable:!0}};si.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=new R,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),s=o.getEnvelope();e.y<s.getMinY()||e.y>s.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(V(arguments[2],Ke)&&arguments[0]instanceof m&&arguments[1]instanceof Us)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),f=0;f<c.length-1;f++){t._seg.p0=c[f],t._seg.p1=c[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var h=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(h<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&M.computeOrientation(t._seg.p0,t._seg.p1,a)!==M.RIGHT){var g=u.getDepth(P.LEFT);t._seg.p0.equals(c[f])||(g=u.getDepth(P.RIGHT));var p=new Bn(t._seg,g);l.add(p)}}else if(V(arguments[2],Ke)&&arguments[0]instanceof m&&V(arguments[1],Ke))for(var y=arguments[0],d=arguments[1],v=arguments[2],C=d.iterator();C.hasNext();){var I=C.next();I.isForward()&&t.findStabbedSegments(y,I,v)}}},si.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var r=$e.min(e);return r._leftDepth},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},Nu.DepthSegment.get=function(){return Bn},Object.defineProperties(si,Nu);var Bn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new k(t),this._leftDepth=e};Bn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return r!==0||(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(e._upwardSeg)},Bn.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return r!==0?r:t.p1.compareTo(e.p1)},Bn.prototype.toString=function(){return this._upwardSeg.toString()},Bn.prototype.interfaces_=function(){return[Fe]},Bn.prototype.getClass=function(){return Bn};var tt=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};tt.prototype.area=function(){return tt.area(this.p0,this.p1,this.p2)},tt.prototype.signedArea=function(){return tt.signedArea(this.p0,this.p1,this.p2)},tt.prototype.interpolateZ=function(t){if(t===null)throw new pt("Supplied point is null.");return tt.interpolateZ(t,this.p0,this.p1,this.p2)},tt.prototype.longestSideLength=function(){return tt.longestSideLength(this.p0,this.p1,this.p2)},tt.prototype.isAcute=function(){return tt.isAcute(this.p0,this.p1,this.p2)},tt.prototype.circumcentre=function(){return tt.circumcentre(this.p0,this.p1,this.p2)},tt.prototype.area3D=function(){return tt.area3D(this.p0,this.p1,this.p2)},tt.prototype.centroid=function(){return tt.centroid(this.p0,this.p1,this.p2)},tt.prototype.inCentre=function(){return tt.inCentre(this.p0,this.p1,this.p2)},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},tt.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},tt.det=function(t,e,r,i){return t*i-e*r},tt.interpolateZ=function(t,e,r,i){var o=e.x,s=e.y,a=r.x-o,u=i.x-o,l=r.y-s,c=i.y-s,f=a*c-u*l,h=t.x-o,g=t.y-s,p=(c*h-u*g)/f,y=(-l*h+a*g)/f,d=e.z+p*(r.z-e.z)+y*(i.z-e.z);return d},tt.longestSideLength=function(t,e,r){var i=t.distance(e),o=e.distance(r),s=r.distance(t),a=i;return o>a&&(a=o),s>a&&(a=s),a},tt.isAcute=function(t,e,r){return!(!j.isAcute(t,e,r)||!j.isAcute(e,r,t)||!j.isAcute(r,t,e))},tt.circumcentre=function(t,e,r){var i=r.x,o=r.y,s=t.x-i,a=t.y-o,u=e.x-i,l=e.y-o,c=2*tt.det(s,a,u,l),f=tt.det(a,s*s+a*a,l,u*u+l*l),h=tt.det(s,s*s+a*a,u,u*u+l*l),g=i-f/c,p=o+h/c;return new m(g,p)},tt.perpendicularBisector=function(t,e){var r=e.x-t.x,i=e.y-t.y,o=new He(t.x+r/2,t.y+i/2,1),s=new He(t.x-i+r/2,t.y+r+i/2,1);return new He(o,s)},tt.angleBisector=function(t,e,r){var i=e.distance(t),o=e.distance(r),s=i/(i+o),a=r.x-t.x,u=r.y-t.y,l=new m(t.x+s*a,t.y+s*u);return l},tt.area3D=function(t,e,r){var i=e.x-t.x,o=e.y-t.y,s=e.z-t.z,a=r.x-t.x,u=r.y-t.y,l=r.z-t.z,c=o*l-s*u,f=s*a-i*l,h=i*u-o*a,g=c*c+f*f+h*h,p=Math.sqrt(g)/2;return p},tt.centroid=function(t,e,r){var i=(t.x+e.x+r.x)/3,o=(t.y+e.y+r.y)/3;return new m(i,o)},tt.inCentre=function(t,e,r){var i=e.distance(r),o=t.distance(r),s=t.distance(e),a=i+o+s,u=(i*t.x+o*e.x+s*r.x)/a,l=(i*t.y+o*e.y+s*r.y)/a;return new m(u,l)};var Ue=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new R;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Ue.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,_.EXTERIOR,_.INTERIOR)},Ue.prototype.addPolygon=function(t){var e=this,r=this._distance,i=P.LEFT;this._distance<0&&(r=-this._distance,i=P.RIGHT);var o=t.getExteriorRing(),s=W.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&s.length<3)return null;this.addPolygonRing(s,r,i,_.EXTERIOR,_.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=W.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,r,P.opposite(i),_.INTERIOR,_.EXTERIOR)}},Ue.prototype.isTriangleErodedCompletely=function(t,e){var r=new tt(t[0],t[1],t[2]),i=r.inCentre(),o=M.distancePointLine(i,r.p0,r.p1);return o<Math.abs(e)},Ue.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=W.removeRepeatedPoints(t.getCoordinates()),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,_.EXTERIOR,_.INTERIOR)},Ue.prototype.addCurve=function(t,e,r){if(t===null||t.length<2)return null;var i=new xt(t,new nt(0,_.BOUNDARY,e,r));this._curveList.add(i)},Ue.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ue.prototype.addPolygonRing=function(t,e,r,i,o){if(e===0&&t.length<Dr.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=Dr.MINIMUM_VALID_SIZE&&M.isCCW(t)&&(s=o,a=i,r=P.opposite(r));var u=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(u,s,a)},Ue.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Mt?this.addPolygon(t):t instanceof yt?this.addLineString(t):t instanceof Ee?this.addPoint(t):t instanceof Ri?this.addCollection(t):t instanceof Fn?this.addCollection(t):t instanceof Mr?this.addCollection(t):t instanceof oe&&this.addCollection(t)},Ue.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(r.length===4)return this.isTriangleErodedCompletely(r,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o},Ue.prototype.addCollection=function(t){for(var e=this,r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);e.add(i)}},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue};var Ai=function(){};Ai.prototype.locate=function(t){},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var kr=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()};kr.prototype.next=function(){if(this._atStart)return this._atStart=!1,kr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Pi;var t=this._parent.getGeometryN(this._index++);return t instanceof oe?(this._subcollectionIterator=new kr(t),this._subcollectionIterator.next()):t},kr.prototype.remove=function(){throw new Error(this.getClass().getName())},kr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},kr.prototype.interfaces_=function(){return[wi]},kr.prototype.getClass=function(){return kr},kr.isAtomic=function(t){return!(t instanceof oe)};var Re=function(){this._geom=null;var t=arguments[0];this._geom=t};Re.prototype.locate=function(t){return Re.locate(t,this._geom)},Re.prototype.interfaces_=function(){return[Ai]},Re.prototype.getClass=function(){return Re},Re.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.isPointInRing(t,e.getCoordinates()):!1},Re.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Re.isPointInRing(t,r))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(Re.isPointInRing(t,o))return!1}return!0},Re.containsPoint=function(t,e){if(e instanceof Mt)return Re.containsPointInPolygon(t,e);if(e instanceof oe)for(var r=new kr(e);r.hasNext();){var i=r.next();if(i!==e&&Re.containsPoint(t,i))return!0}return!1},Re.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:Re.containsPoint(t,e)?_.INTERIOR:_.EXTERIOR};var te=function(){this._edgeMap=new Jt,this._edgeList=null,this._ptInAreaLocation=[_.NONE,_.NONE]};te.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),r=e-1;return e===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)},te.prototype.propagateSideLabels=function(t){for(var e=_.NONE,r=this.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,P.LEFT)!==_.NONE&&(e=o.getLocation(t,P.LEFT))}if(e===_.NONE)return null;for(var s=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,P.ON)===_.NONE&&l.setLocation(t,P.ON,s),l.isArea(t)){var c=l.getLocation(t,P.LEFT),f=l.getLocation(t,P.RIGHT);if(f!==_.NONE){if(f!==s)throw new Jr("side location conflict",u.getCoordinate());c===_.NONE&&X.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else X.isTrue(l.getLocation(t,P.LEFT)===_.NONE,"found single null side"),l.setLocation(t,P.RIGHT,s),l.setLocation(t,P.LEFT,s)}}},te.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},te.prototype.print=function(t){Ut.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},te.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},te.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var r=e.size()-1,i=e.get(r).getLabel(),o=i.getLocation(t,P.LEFT);X.isTrue(o!==_.NONE,"Found unlabelled area edge");for(var s=o,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();X.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,P.LEFT),f=l.getLocation(t,P.RIGHT);if(c===f||f!==s)return!1;s=c}return!0},te.prototype.findIndex=function(t){var e=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=e._edgeList.get(r);if(i===t)return r}return-1},te.prototype.iterator=function(){return this.getEdges().iterator()},te.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new R(this._edgeMap.values())),this._edgeList},te.prototype.getLocation=function(t,e,r){return this._ptInAreaLocation[t]===_.NONE&&(this._ptInAreaLocation[t]=Re.locate(e,r[t].getGeometry())),this._ptInAreaLocation[t]},te.prototype.toString=function(){var t=new ur;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
24
24
  `);for(var e=this.iterator();e.hasNext();){var r=e.next();t.append(r),t.append(`
25
- `)}return t.toString()},te.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},te.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)s.isLine(a)&&s.getLocation(a)===_.BOUNDARY&&(r[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),f=0;f<2;f++)if(c.isAnyNull(f)){var h=_.NONE;if(r[f])h=_.EXTERIOR;else{var g=l.getCoordinate();h=e.getLocation(f,g,t)}c.setAllLocationsIfNull(f,h)}},te.prototype.getDegree=function(){return this._edgeMap.size()},te.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te};var vf=function(n){function t(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=r._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),s){case r._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;o=l,s=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),s=r._SCANNING_FOR_INCOMING;break}}if(s===this._LINKING_TO_OUTGOING){if(i===null)throw new Jr("no outgoing dirEdge found",this.getCoordinate());X.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var o=r.get(0);if(i===1)return o;var s=r.get(i-1),a=o.getQuadrant(),u=s.getQuadrant();return ot.isNorthern(a)&&ot.isNorthern(u)?o:!ot.isNorthern(a)&&!ot.isNorthern(u)?s:o.getDy()!==0?o:s.getDy()!==0?s:(X.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){Ut.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();r.print("out "),o.print(r),r.println(),r.print("in "),o.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new R;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&r._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.setAllLocationsIfNull(0,r.getLocation(0)),s.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,o=null,s=this._edgeList.size()-1;s>=0;s--){var a=r._edgeList.get(s),u=a.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=a}o.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),s=i.getDepth(P.LEFT),a=i.getDepth(P.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),s),l=this.computeDepths(0,o,u);if(l!==a)throw new Jr("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],f=arguments[1],h=arguments[2],g=h,p=c;p<f;p++){var v=r._edgeList.get(p);v.setEdgeDepths(P.RIGHT,g),g=v.getDepth(P.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,o=null,s=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(o===null&&l.getEdgeRing()===r&&(o=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==r)continue;s=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==r)continue;s.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(X.isTrue(o!==null,"found null for first outgoing dirEdge"),X.isTrue(o.getEdgeRing()===r,"unable to link last incoming dirEdge"),s.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&r++}return r}else if(arguments.length===1){for(var s=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===s&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=_.NONE,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){r=_.INTERIOR;break}if(s.isInResult()){r=_.EXTERIOR;break}}}if(r===_.NONE)return null;for(var a=r,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===_.INTERIOR):(l.isInResult()&&(a=_.EXTERIOR),c.isInResult()&&(a=_.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new nt(_.NONE);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===_.INTERIOR||c===_.BOUNDARY)&&i._label.setLocation(l,_.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(te),Su=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new Qo(r,new vf)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ti),vn=function n(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=n.orientation(t)};vn.prototype.compareTo=function(t){var e=t,r=vn.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},vn.prototype.interfaces_=function(){return[Fe]},vn.prototype.getClass=function(){return vn},vn.orientation=function(t){return W.increasingDirection(t)===1},vn.compareOriented=function(t,e,r,i){for(var o=e?1:-1,s=i?1:-1,a=e?t.length:-1,u=i?r.length:-1,l=e?0:t.length-1,c=i?0:r.length-1;;){var f=t[l].compareTo(r[c]);if(f!==0)return f;l+=o,c+=s;var h=l===a,g=c===u;if(h&&!g)return-1;if(!h&&g)return 1;if(h&&g)return 0}};var tr=function(){this._edges=new R,this._ocaMap=new Jt};tr.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=e._edges.get(r);r>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),s=0;s<o.length;s++)s>0&&t.print(","),t.print(o[s].x+" "+o[s].y);t.println(")")}t.print(") ")},tr.prototype.addAll=function(t){for(var e=this,r=t.iterator();r.hasNext();)e.add(r.next())},tr.prototype.findEdgeIndex=function(t){for(var e=this,r=0;r<this._edges.size();r++)if(e._edges.get(r).equals(t))return r;return-1},tr.prototype.iterator=function(){return this._edges.iterator()},tr.prototype.getEdges=function(){return this._edges},tr.prototype.get=function(t){return this._edges.get(t)},tr.prototype.findEqualEdge=function(t){var e=new vn(t.getCoordinates()),r=this._ocaMap.get(e);return r},tr.prototype.add=function(t){this._edges.add(t);var e=new vn(t.getCoordinates());this._ocaMap.put(e,t)},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var Gn=function(){};Gn.prototype.processIntersections=function(t,e,r,i){},Gn.prototype.isDone=function(){},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Te=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Te.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Te.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},Te.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Te.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Te.prototype.getLineIntersector=function(){return this._li},Te.prototype.hasProperIntersection=function(){return this._hasProper},Te.prototype.processIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Te.prototype.hasIntersection=function(){return this._hasIntersection},Te.prototype.isDone=function(){return!1},Te.prototype.hasInteriorIntersection=function(){return this._hasInterior},Te.prototype.interfaces_=function(){return[Gn]},Te.prototype.getClass=function(){return Te},Te.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Er=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],r=arguments[2];this.coord=new m(t),this.segmentIndex=e,this.dist=r};Er.prototype.getSegmentIndex=function(){return this.segmentIndex},Er.prototype.getCoordinate=function(){return this.coord},Er.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Er.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Er.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Er.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Er.prototype.getDistance=function(){return this.dist},Er.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Er.prototype.interfaces_=function(){return[Fe]},Er.prototype.getClass=function(){return Er};var Br=function(){this._nodeMap=new Jt,this.edge=null;var t=arguments[0];this.edge=t};Br.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Br.prototype.iterator=function(){return this._nodeMap.values().iterator()},Br.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},Br.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Br.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],s=e.dist>0||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new m(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r.edge.pts[l];return s&&(a[u]=e.coord),new Jo(a,new nt(this.edge._label))},Br.prototype.add=function(t,e,r){var i=new Er(t,e,r),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)},Br.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br};var zn=function(){};zn.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new R;i.add(new lr(r));do{var o=e.findChainEnd(t,r);i.add(new lr(o)),r=o}while(r<t.length-1);var s=zn.toIntArray(i);return s},zn.prototype.findChainEnd=function(t,e){for(var r=ot.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=ot.quadrant(t[i-1],t[i]);if(o!==r)break;i++}return i-1},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var en=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new F,this.env2=new F;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new zn;this.startIndex=e.getChainStartIndices(this.pts)};en.prototype.getCoordinates=function(){return this.pts},en.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e>r?e:r},en.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e<r?e:r},en.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[r],e.startIndex[r+1],i)}else if(arguments.length===6){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],f=this.pts[o],h=this.pts[s],g=a.pts[u],p=a.pts[l];if(s-o===1&&l-u===1)return c.addIntersections(this.e,o,a.e,u),null;if(this.env1.init(f,h),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var v=Math.trunc((o+s)/2),d=Math.trunc((u+l)/2);o<v&&(u<d&&this.computeIntersectsForChain(o,v,a,u,d,c),d<l&&this.computeIntersectsForChain(o,v,a,d,l,c)),v<s&&(u<d&&this.computeIntersectsForChain(v,s,a,u,d,c),d<l&&this.computeIntersectsForChain(v,s,a,d,l,c))}},en.prototype.getStartIndexes=function(){return this.startIndex},en.prototype.computeIntersects=function(t,e){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)r.computeIntersectsForChain(i,t,o,e)},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en};var qt=function n(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var r=0;r<3;r++)t._depth[e][r]=n.NULL_VALUE},xu={NULL_VALUE:{configurable:!0}};qt.prototype.getDepth=function(t,e){return this._depth[t][e]},qt.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},qt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(t._depth[e][r]!==qt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===qt.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._depth[o][s]===qt.NULL_VALUE}},qt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var r=t._depth[e][1];t._depth[e][2]<r&&(r=t._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>r&&(o=1),t._depth[e][i]=o}}},qt.prototype.getDelta=function(t){return this._depth[t][P.RIGHT]-this._depth[t][P.LEFT]},qt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?_.EXTERIOR:_.INTERIOR},qt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},qt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var o=e.getLocation(r,i);(o===_.EXTERIOR||o===_.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=qt.depthAtLocation(o):t._depth[r][i]+=qt.depthAtLocation(o))}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];u===_.INTERIOR&&this._depth[s][a]++}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.depthAtLocation=function(t){return t===_.EXTERIOR?0:t===_.INTERIOR?1:qt.NULL_VALUE},xu.NULL_VALUE.get=function(){return-1},Object.defineProperties(qt,xu);var Jo=function(n){function t(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new Br(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new qt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,nt.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var o=r;if(this.pts.length!==o.pts.length)return!1;for(var s=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(o.pts[l])||(s=!1),i.pts[l].equals2D(o.pts[--u])||(a=!1),!s&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&r.print(","),r.print(i.pts[o].x+" "+i.pts[o].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)r.print(i.pts[o]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new en(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new F;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,o,s){var a=new m(r.getIntersection(s)),u=i,l=r.getEdgeDistance(o,s),c=u+1;if(c<this.pts.length){var f=this.pts[c];a.equals2D(f)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var r=this,i=new ur;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(r.pts[o].x+" "+r.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(r.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,o){for(var s=this,a=0;a<r.getIntersectionNum();a++)s.addIntersection(r,i,o,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,P.ON),r.getLocation(1,P.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,P.LEFT),r.getLocation(1,P.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,P.RIGHT),r.getLocation(1,P.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},t}(Pe),ue=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new tr,this._bufParams=t||null};ue.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},ue.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new nt(t.getLabel()),i.flip()),r.merge(i);var o=ue.depthDelta(i),s=e.getDepthDelta(),a=s+o;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(ue.depthDelta(t.getLabel()))},ue.prototype.buildSubgraphs=function(t,e){for(var r=new R,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getRightmostCoordinate(),a=new si(r),u=a.getDepth(s);o.computeDepth(u),o.findResultEdges(),r.add(o),e.add(o.getDirectedEdges(),o.getNodes())}},ue.prototype.createSubgraphs=function(t){for(var e=new R,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var o=new se;o.create(i),e.add(o)}}return $e.sort(e,$e.reverseOrder()),e},ue.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},ue.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new qs,r=new Dn;return r.setPrecisionModel(t),e.setSegmentIntersector(new Te(r)),e},ue.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new ve(r,this._bufParams),o=new Ue(t,e,i),s=o.getCurves();if(s.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(s,r),this._graph=new vt(new Su),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new Ce(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},ue.prototype.computeNodedEdges=function(t,e){var r=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),s=o.iterator();s.hasNext();){var a=s.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Jo(a.getCoordinates(),new nt(l));r.insertUniqueEdge(c)}}},ue.prototype.setNoder=function(t){this._workingNoder=t},ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue},ue.depthDelta=function(t){var e=t.getLocation(0,P.LEFT),r=t.getLocation(0,P.RIGHT);return e===_.INTERIOR&&r===_.EXTERIOR?1:e===_.EXTERIOR&&r===_.INTERIOR?-1:0},ue.convertSegStrings=function(t){for(var e=new H,r=new R;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());r.add(o)}return e.buildGeometry(r)};var mn=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=o,this._offsetY=s,this._isScaled=!this.isIntegerPrecision()}};mn.prototype.rescale=function(){var t=this;if(V(arguments[0],Dt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=0;s<o.length;s++)o[s].x=o[s].x/t._scaleFactor+t._offsetX,o[s].y=o[s].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&Ut.out.println(o)}},mn.prototype.scale=function(){var t=this;if(V(arguments[0],Dt)){for(var e=arguments[0],r=new R,i=e.iterator();i.hasNext();){var o=i.next();r.add(new xt(t.scale(o.getCoordinates()),o.getData()))}return r}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=new Array(s.length).fill(null),u=0;u<s.length;u++)a[u]=new m(Math.round((s[u].x-t._offsetX)*t._scaleFactor),Math.round((s[u].y-t._offsetY)*t._scaleFactor),s[u].z);var l=W.removeRepeatedPoints(a);return l}},mn.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},mn.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},mn.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},mn.prototype.interfaces_=function(){return[kn]},mn.prototype.getClass=function(){return mn};var Cr=function(){this._li=new Dn,this._segStrings=null;var t=arguments[0];this._segStrings=t},Lu={fact:{configurable:!0}};Cr.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=s.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(o))throw new Wr("found endpt/interior pt intersection at index "+c+" :pt "+o)}},Cr.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(r,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var f=0;f<l.length-1;f++)t.checkInteriorIntersections(s,c,a,f);else if(arguments.length===4){var h=arguments[0],g=arguments[1],p=arguments[2],v=arguments[3];if(h===p&&g===v)return null;var d=h.getCoordinates()[g],y=h.getCoordinates()[g+1],I=p.getCoordinates()[v],C=p.getCoordinates()[v+1];if(this._li.computeIntersection(d,y,I,C),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,y)||this.hasInteriorIntersection(this._li,I,C)))throw new Wr("found non-noded intersection at "+d+"-"+y+" and "+I+"-"+C)}},Cr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Cr.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length-2;s++)t.checkCollapse(o[s],o[s+1],o[s+2])},Cr.prototype.hasInteriorIntersection=function(t,e,r){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(r)))return!0}return!1},Cr.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new Wr("found non-noded collapse at "+Cr.fact.createLineString([t,e,r]))},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Lu.fact.get=function(){return new H},Object.defineProperties(Cr,Lu);var me=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],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,e<=0)throw new pt("Scale factor must be non-zero");e!==1&&(this._pt=new m(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new m,this._p1Scaled=new m),this.initCorners(this._pt)},bu={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};me.prototype.intersectsScaled=function(t,e){var r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),a=this._maxx<r||this._minx>i||this._maxy<o||this._miny>s;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return X.isTrue(!(a&&u),"Found bad envelope test"),u},me.prototype.initCorners=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 m(this._maxx,this._maxy),this._corner[1]=new m(this._minx,this._maxy),this._corner[2]=new m(this._minx,this._miny),this._corner[3]=new m(this._maxx,this._miny)},me.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},me.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},me.prototype.getCoordinate=function(){return this._originalPt},me.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},me.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=me.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new F(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},me.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},me.prototype.intersectsToleranceSquare=function(t,e){var r=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||r&&i||t.equals(this._pt)||e.equals(this._pt))},me.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},bu.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(me,bu);var Co=function(){this.tempEnv1=new F,this.selectedSegment=new k};Co.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var Fi=function(){this._index=null;var t=arguments[0];this._index=t},wu={HotPixelSnapAction:{configurable:!0}};Fi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),s=new Pu(e,r,i);return this._index.query(o,{interfaces_:function(){return[pn]},visitItem:function(a){var u=a;u.select(o,s)}}),s.isNodeAdded()}},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi},wu.HotPixelSnapAction.get=function(){return Pu},Object.defineProperties(Fi,wu);var Pu=function(n){function t(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],o=r.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return n.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Co),ai=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new R};ai.prototype.processIntersections=function(t,e,r,i){var o=this;if(t===r&&e===i)return null;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];if(this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)o._interiorIntersections.add(o._li.getIntersection(c));t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)}},ai.prototype.isDone=function(){return!1},ai.prototype.getInteriorIntersections=function(){return this._interiorIntersections},ai.prototype.interfaces_=function(){return[Gn]},ai.prototype.getClass=function(){return ai};var Gr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Dn,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Gr.prototype.checkCorrectness=function(t){var e=xt.getNodedSubstrings(t),r=new Cr(e);try{r.checkValid()}catch(i){if(i instanceof uu)i.printStackTrace();else throw i}finally{}},Gr.prototype.getNodedSubstrings=function(){return xt.getNodedSubstrings(this._nodedSegStrings)},Gr.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},Gr.prototype.findInteriorIntersections=function(t,e){var r=new ai(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},Gr.prototype.computeVertexSnaps=function(){var t=this;if(V(arguments[0],Dt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof xt)for(var o=arguments[0],s=o.getCoordinates(),a=0;a<s.length;a++){var u=new me(s[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,o,a);l&&o.addIntersection(s[a],a)}},Gr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new qs,this._pointSnapper=new Fi(this._noder.getIndex()),this.snapRound(t,this._li)},Gr.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),o=new me(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}},Gr.prototype.interfaces_=function(){return[kn]},Gr.prototype.getClass=function(){return Gr};var Xt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new $,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._argGeom=e,this._bufParams=r}},ki={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Xt.prototype.bufferFixedPrecision=function(t){var e=new mn(new Gr(new J(1)),t.getScale()),r=new ue(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.buffer(this._argGeom,this._distance)},Xt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Xt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(s){if(s instanceof Jr)t._saveException=s;else throw s}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Xt.precisionScaleFactor(this._argGeom,this._distance,r),o=new J(i);this.bufferFixedPrecision(o)}},Xt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===J.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Xt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Xt.prototype.bufferOriginalPrecision=function(){try{var t=new ue(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Wr)this._saveException=e;else throw e}finally{}},Xt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Xt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Xt(t),i=r.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof z&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Xt(o);u.setQuadrantSegments(a);var l=u.getResultGeometry(s);return l}else if(arguments[2]instanceof $&&arguments[0]instanceof z&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=arguments[2],g=new Xt(c,h),p=g.getResultGeometry(f);return p}}else if(arguments.length===4){var v=arguments[0],d=arguments[1],y=arguments[2],I=arguments[3],C=new Xt(v);C.setQuadrantSegments(y),C.setEndCapStyle(I);var N=C.getResultGeometry(d);return N}},Xt.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),o=we.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,a=o+2*s,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=r-u,c=Math.pow(10,l);return c},ki.CAP_ROUND.get=function(){return $.CAP_ROUND},ki.CAP_BUTT.get=function(){return $.CAP_FLAT},ki.CAP_FLAT.get=function(){return $.CAP_FLAT},ki.CAP_SQUARE.get=function(){return $.CAP_SQUARE},ki.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Xt,ki);var le=function(){this._pt=[new m,new m],this._distance=U.NaN,this._isNull=!0};le.prototype.getCoordinates=function(){return this._pt},le.prototype.getCoordinate=function(t){return this._pt[t]},le.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},le.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},le.prototype.getDistance=function(){return this._distance},le.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le};var zr=function(){};zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.computeDistance=function(){if(arguments[2]instanceof le&&arguments[0]instanceof yt&&arguments[1]instanceof m)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=t.getCoordinates(),o=new k,s=0;s<i.length-1;s++){o.setCoordinates(i[s],i[s+1]);var a=o.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof le&&arguments[0]instanceof Mt&&arguments[1]instanceof m){var u=arguments[0],l=arguments[1],c=arguments[2];zr.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)zr.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof le&&arguments[0]instanceof z&&arguments[1]instanceof m){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof yt)zr.computeDistance(h,g,p);else if(h instanceof Mt)zr.computeDistance(h,g,p);else if(h instanceof oe)for(var v=h,d=0;d<v.getNumGeometries();d++){var y=v.getGeometryN(d);zr.computeDistance(y,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof le&&arguments[0]instanceof k&&arguments[1]instanceof m){var I=arguments[0],C=arguments[1],N=arguments[2],L=I.closestPoint(C);N.setMinimum(L,C)}};var Vn=function(t){this._maxPtDist=new le,this._inputGeom=t||null},Xs={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Vn.prototype.computeMaxMidpointDistance=function(t){var e=new yn(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vn.prototype.computeMaxVertexDistance=function(t){var e=new ui(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vn.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Vn.prototype.getDistancePoints=function(){return this._maxPtDist},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Xs.MaxPointDistanceFilter.get=function(){return ui},Xs.MaxMidpointDistanceFilter.get=function(){return yn},Object.defineProperties(Vn,Xs);var ui=function(t){this._maxPtDist=new le,this._minPtDist=new le,this._geom=t||null};ui.prototype.filter=function(t){this._minPtDist.initialize(),zr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ui.prototype.getMaxPointDistance=function(){return this._maxPtDist},ui.prototype.interfaces_=function(){return[Tr]},ui.prototype.getClass=function(){return ui};var yn=function(t){this._maxPtDist=new le,this._minPtDist=new le,this._geom=t||null};yn.prototype.filter=function(t,e){if(e===0)return null;var r=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new m((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),zr.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},yn.prototype.isDone=function(){return!1},yn.prototype.isGeometryChanged=function(){return!1},yn.prototype.getMaxPointDistance=function(){return this._maxPtDist},yn.prototype.interfaces_=function(){return[Ze]},yn.prototype.getClass=function(){return yn};var rn=function(t){this._comps=t||null};rn.prototype.filter=function(t){t instanceof Mt&&this._comps.add(t)},rn.prototype.interfaces_=function(){return[gr]},rn.prototype.getClass=function(){return rn},rn.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return rn.getPolygons(t,new R)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Mt?r.add(e):e instanceof oe&&e.apply(new rn(r)),r}};var Yt=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};Yt.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Dr){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof yt&&this._lines.add(t)},Yt.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Yt.prototype.interfaces_=function(){return[Hr]},Yt.prototype.getClass=function(){return Yt},Yt.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Yt.getLines(t))}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e.getFactory().buildGeometry(Yt.getLines(e,r))}},Yt.getLines=function(){if(arguments.length===1){var t=arguments[0];return Yt.getLines(t,!1)}else if(arguments.length===2){if(V(arguments[0],Dt)&&V(arguments[1],Dt)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();Yt.getLines(o,r)}return r}else if(arguments[0]instanceof z&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1],u=new R;return s.apply(new Yt(u,a)),u}else if(arguments[0]instanceof z&&V(arguments[1],Dt)){var l=arguments[0],c=arguments[1];return l instanceof yt?c.add(l):l.apply(new Yt(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&V(arguments[0],Dt)&&V(arguments[1],Dt)){for(var f=arguments[0],h=arguments[1],g=arguments[2],p=f.iterator();p.hasNext();){var v=p.next();Yt.getLines(v,h,g)}return h}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof z&&V(arguments[1],Dt)){var d=arguments[0],y=arguments[1],I=arguments[2];return d.apply(new Yt(y,I)),y}}};var er=function(){if(this._boundaryRule=Be.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new pt("Rule must be non-null");this._boundaryRule=t}}};er.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof m&&arguments[1]instanceof Mt){var e=arguments[0],r=arguments[1];if(r.isEmpty())return _.EXTERIOR;var i=r.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===_.EXTERIOR)return _.EXTERIOR;if(o===_.BOUNDARY)return _.BOUNDARY;for(var s=0;s<r.getNumInteriorRing();s++){var a=r.getInteriorRingN(s),u=t.locateInPolygonRing(e,a);if(u===_.INTERIOR)return _.EXTERIOR;if(u===_.BOUNDARY)return _.BOUNDARY}return _.INTERIOR}else if(arguments[0]instanceof m&&arguments[1]instanceof yt){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return _.EXTERIOR;var f=c.getCoordinates();return!c.isClosed()&&(l.equals(f[0])||l.equals(f[f.length-1]))?_.BOUNDARY:M.isOnLine(l,f)?_.INTERIOR:_.EXTERIOR}else if(arguments[0]instanceof m&&arguments[1]instanceof Ee){var h=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(h)?_.INTERIOR:_.EXTERIOR}},er.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.locatePointInRing(t,e.getCoordinates()):_.EXTERIOR},er.prototype.intersects=function(t,e){return this.locate(t,e)!==_.EXTERIOR},er.prototype.updateLocationInfo=function(t){t===_.INTERIOR&&(this._isIn=!0),t===_.BOUNDARY&&this._numBoundaries++},er.prototype.computeLocation=function(t,e){var r=this;if(e instanceof Ee&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof yt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Mt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Fn)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);r.updateLocationInfo(r.locateInternal(t,s))}else if(e instanceof Mr)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);r.updateLocationInfo(r.locateInternal(t,l))}else if(e instanceof oe)for(var c=new kr(e);c.hasNext();){var f=c.next();f!==e&&r.computeLocation(t,f)}},er.prototype.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:e instanceof yt?this.locateInternal(t,e):e instanceof Mt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?_.BOUNDARY:this._numBoundaries>0||this._isIn?_.INTERIOR:_.EXTERIOR)},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var ce=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];n.call(this,t,n.INSIDE_AREA,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Ou={INSIDE_AREA:{configurable:!0}};ce.prototype.isInsideArea=function(){return this._segIndex===ce.INSIDE_AREA},ce.prototype.getCoordinate=function(){return this._pt},ce.prototype.getGeometryComponent=function(){return this._component},ce.prototype.getSegmentIndex=function(){return this._segIndex},ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},Ou.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ce,Ou);var _n=function(t){this._pts=t||null};_n.prototype.filter=function(t){t instanceof Ee&&this._pts.add(t)},_n.prototype.interfaces_=function(){return[gr]},_n.prototype.getClass=function(){return _n},_n.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof Ee?$e.singletonList(t):_n.getPoints(t,new R)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Ee?r.add(e):e instanceof oe&&e.apply(new _n(r)),r}};var li=function(){this._locations=null;var t=arguments[0];this._locations=t};li.prototype.filter=function(t){(t instanceof Ee||t instanceof yt||t instanceof Mt)&&this._locations.add(new ce(t,0,t.getCoordinate()))},li.prototype.interfaces_=function(){return[gr]},li.prototype.getClass=function(){return li},li.getLocations=function(t){var e=new R;return t.apply(new li(e)),e};var Wt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new er,this._minDistanceLocation=null,this._minDistance=U.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=o}};Wt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=1-r,s=rn.getPolygons(this._geom[r]);if(s.size()>0){var a=li.getLocations(this._geom[o]);if(this.computeContainmentDistance(a,s,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&V(arguments[0],Ke)&&V(arguments[1],Ke)){for(var u=arguments[0],l=arguments[1],c=arguments[2],f=0;f<u.size();f++)for(var h=u.get(f),g=0;g<l.size();g++)if(t.computeContainmentDistance(h,l.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ce&&arguments[1]instanceof Mt){var p=arguments[0],v=arguments[1],d=arguments[2],y=p.getCoordinate();if(_.EXTERIOR!==this._ptLocator.locate(y,v))return this._minDistance=0,d[0]=p,d[1]=new ce(v,y),null}}},Wt.prototype.computeMinDistanceLinesPoints=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,r),i._minDistance<=i._terminateDistance)return null}},Wt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Yt.getLines(this._geom[0]),r=Yt.getLines(this._geom[1]),i=_n.getPoints(this._geom[0]),o=_n.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)},Wt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Wt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Wt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Wt.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof yt&&arguments[1]instanceof Ee){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),s=r.getCoordinate(),a=0;a<o.length-1;a++){var u=M.distancePointLine(s,o[a],o[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new k(o[a],o[a+1]),c=l.closestPoint(s);i[0]=new ce(e,a,c),i[1]=new ce(r,0,s)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof yt&&arguments[1]instanceof yt){var f=arguments[0],h=arguments[1],g=arguments[2];if(f.getEnvelopeInternal().distance(h.getEnvelopeInternal())>this._minDistance)return null;for(var p=f.getCoordinates(),v=h.getCoordinates(),d=0;d<p.length-1;d++)for(var y=0;y<v.length-1;y++){var I=M.distanceLineLine(p[d],p[d+1],v[y],v[y+1]);if(I<t._minDistance){t._minDistance=I;var C=new k(p[d],p[d+1]),N=new k(v[y],v[y+1]),L=C.closestPoints(N);g[0]=new ce(f,d,L[0]),g[1]=new ce(h,y,L[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Wt.prototype.computeMinDistancePoints=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a),l=s.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,r[0]=new ce(s,0,s.getCoordinate()),r[1]=new ce(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Wt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new pt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Wt.prototype.computeMinDistanceLines=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,r),i._minDistance<=i._terminateDistance)return null}},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.distance=function(t,e){var r=new Wt(t,e);return r.distance()},Wt.isWithinDistance=function(t,e,r){var i=new Wt(t,e,r);return i.distance()<=r},Wt.nearestPoints=function(t,e){var r=new Wt(t,e);return r.nearestPoints()};var ee=function(){this._pt=[new m,new m],this._distance=U.NaN,this._isNull=!0};ee.prototype.getCoordinates=function(){return this._pt},ee.prototype.getCoordinate=function(t){return this._pt[t]},ee.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},ee.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},ee.prototype.toString=function(){return je.toLineString(this._pt[0],this._pt[1])},ee.prototype.getDistance=function(){return this._distance},ee.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},ee.prototype.interfaces_=function(){return[]},ee.prototype.getClass=function(){return ee};var Ir=function(){};Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir},Ir.computeDistance=function(){if(arguments[2]instanceof ee&&arguments[0]instanceof yt&&arguments[1]instanceof m)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=new k,o=t.getCoordinates(),s=0;s<o.length-1;s++){i.setCoordinates(o[s],o[s+1]);var a=i.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof ee&&arguments[0]instanceof Mt&&arguments[1]instanceof m){var u=arguments[0],l=arguments[1],c=arguments[2];Ir.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)Ir.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof ee&&arguments[0]instanceof z&&arguments[1]instanceof m){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof yt)Ir.computeDistance(h,g,p);else if(h instanceof Mt)Ir.computeDistance(h,g,p);else if(h instanceof oe)for(var v=h,d=0;d<v.getNumGeometries();d++){var y=v.getGeometryN(d);Ir.computeDistance(y,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof ee&&arguments[0]instanceof k&&arguments[1]instanceof m){var I=arguments[0],C=arguments[1],N=arguments[2],L=I.closestPoint(C);N.setMinimum(L,C)}};var qe=function(){this._g0=null,this._g1=null,this._ptDist=new ee,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Ys={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};qe.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},qe.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new pt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},qe.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},qe.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},qe.prototype.computeOrientedDistance=function(t,e,r){var i=new ci(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new En(e,this._densifyFrac);t.apply(o),r.setMaximum(o.getMaxPointDistance())}},qe.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new qe(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new qe(i,o);return a.setDensifyFraction(s),a.distance()}},Ys.MaxPointDistanceFilter.get=function(){return ci},Ys.MaxDensifiedByFractionDistanceFilter.get=function(){return En},Object.defineProperties(qe,Ys);var ci=function(){this._maxPtDist=new ee,this._minPtDist=new ee,this._euclideanDist=new Ir,this._geom=null;var t=arguments[0];this._geom=t};ci.prototype.filter=function(t){this._minPtDist.initialize(),Ir.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ci.prototype.getMaxPointDistance=function(){return this._maxPtDist},ci.prototype.interfaces_=function(){return[Tr]},ci.prototype.getClass=function(){return ci};var En=function(){this._maxPtDist=new ee,this._minPtDist=new ee,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};En.prototype.filter=function(t,e){var r=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),s=(o.x-i.x)/this._numSubSegs,a=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*s,c=i.y+u*a,f=new m(l,c);r._minPtDist.initialize(),Ir.computeDistance(r._geom,f,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},En.prototype.isDone=function(){return!1},En.prototype.isGeometryChanged=function(){return!1},En.prototype.getMaxPointDistance=function(){return this._maxPtDist},En.prototype.interfaces_=function(){return[Ze]},En.prototype.getClass=function(){return En};var Ne=function(t,e,r){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=r||null},Ws={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Ne.prototype.checkMaximumDistance=function(t,e,r){var i=new qe(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+je.toLineString(o[0],o[1])+")"}},Ne.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Ne.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Ne.VERBOSE&&Ut.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Ne.prototype.checkNegativeValid=function(){if(!(this._input instanceof Mt||this._input instanceof Mr||this._input instanceof oe))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Ne.prototype.getErrorIndicator=function(){return this._errorIndicator},Ne.prototype.checkMinimumDistance=function(t,e,r){var i=new Wt(t,e,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+je.toLineString(o[0],o[1])+" )"}},Ne.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Ne.prototype.getErrorLocation=function(){return this._errorLocation},Ne.prototype.getPolygonLines=function(t){for(var e=new R,r=new Yt(e),i=rn.getPolygons(t),o=i.iterator();o.hasNext();){var s=o.next();s.apply(r)}return t.getFactory().buildGeometry(e)},Ne.prototype.getErrorMessage=function(){return this._errMsg},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ws.VERBOSE.get=function(){return!1},Ws.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ne,Ws);var Ht=function(t,e,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=r||null},Hs={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Ht.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Ht.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Ht.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new F(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new F(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},Ht.prototype.checkDistance=function(){var t=new Ne(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Ht.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Ht.prototype.checkPolygonal=function(){this._result instanceof Mt||this._result instanceof Mr||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Ht.prototype.getErrorIndicator=function(){return this._errorIndicator},Ht.prototype.getErrorLocation=function(){return this._errorLocation},Ht.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Ht.prototype.report=function(t){if(!Ht.VERBOSE)return null;Ut.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ht.prototype.getErrorMessage=function(){return this._errorMsg},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.isValidMsg=function(t,e,r){var i=new Ht(t,e,r);return i.isValid()?null:i.getErrorMessage()},Ht.isValid=function(t,e,r){var i=new Ht(t,e,r);return!!i.isValid()},Hs.VERBOSE.get=function(){return!1},Hs.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ht,Hs);var Nr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Nr.prototype.getCoordinates=function(){return this._pts},Nr.prototype.size=function(){return this._pts.length},Nr.prototype.getCoordinate=function(t){return this._pts[t]},Nr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Nr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ii.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Nr.prototype.setData=function(t){this._data=t},Nr.prototype.getData=function(){return this._data},Nr.prototype.toString=function(){return je.toLineString(new St(this._pts))},Nr.prototype.interfaces_=function(){return[Fr]},Nr.prototype.getClass=function(){return Nr};var zt=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new R,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zt.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zt.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zt.prototype.getIntersectionSegments=function(){return this._intSegments},zt.prototype.count=function(){return this._intersectionCount},zt.prototype.getIntersections=function(){return this._intersections},zt.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zt.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zt.prototype.processIntersections=function(t,e,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(r,i);if(!o)return null}var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=s,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zt.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},zt.prototype.hasIntersection=function(){return this._interiorIntersection!==null},zt.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},zt.prototype.interfaces_=function(){return[Gn]},zt.prototype.getClass=function(){return zt},zt.createAllIntersectionsFinder=function(t){var e=new zt(t);return e.setFindAllIntersections(!0),e},zt.createAnyIntersectionFinder=function(t){return new zt(t)},zt.createIntersectionCounter=function(t){var e=new zt(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var rr=function(){this._li=new Dn,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};rr.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},rr.prototype.getIntersections=function(){return this._segInt.getIntersections()},rr.prototype.isValid=function(){return this.execute(),this._isValid},rr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},rr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new qs;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},rr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Jr(this.getErrorMessage(),this._segInt.getInteriorIntersection())},rr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+je.toLineString(t[0],t[1])+" and "+je.toLineString(t[2],t[3])},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.computeIntersections=function(t){var e=new rr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Un=function n(){this._nv=null;var t=arguments[0];this._nv=new rr(n.toSegmentStrings(t))};Un.prototype.checkValid=function(){this._nv.checkValid()},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},Un.toSegmentStrings=function(t){for(var e=new R,r=t.iterator();r.hasNext();){var i=r.next();e.add(new Nr(i.getCoordinates(),i))}return e},Un.checkValid=function(t){var e=new Un(t);e.checkValid()};var fi=function(t){this._mapOp=t};fi.prototype.map=function(t){for(var e=this,r=new R,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||r.add(o)}return t.getFactory().createGeometryCollection(H.toGeometryArray(r))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},fi.map=function(t,e){var r=new fi(e);return r.map(t)};var Sr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new R,this._resultLineList=new R;var t=arguments[0],e=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=r};Sr.prototype.collectLines=function(t){for(var e=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},Sr.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},Sr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Sr.prototype.collectLineEdge=function(t,e,r){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&q.isResultOfOp(i,e)&&!o.isCovered()&&(r.add(o),t.setVisitedEdge(!0))},Sr.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var r=e.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getEdge();if(o.isLineEdge()&&!s.isCoveredSet()){var a=t._op.isCoveredByA(o.getCoordinate());s.setCovered(a)}}},Sr.prototype.labelIsolatedLines=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},Sr.prototype.buildLines=function(t){for(var e=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}},Sr.prototype.collectBoundaryTouchEdge=function(t,e,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;X.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),q.isResultOfOp(i,e)&&e===q.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var hi=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new R;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};hi.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},hi.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===q.INTERSECTION)){var o=i.getLabel();q.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}},hi.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var ye=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};ye.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},ye.prototype.transformPolygon=function(t,e){var r=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof Dr)||o.isEmpty())&&(i=!1);for(var s=new R,a=0;a<t.getNumInteriorRing();a++){var u=r.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof Dr||(i=!1),s.add(u))}if(i)return this._factory.createPolygon(o,s.toArray([]));var l=new R;return o!==null&&l.add(o),l.addAll(s),this._factory.buildGeometry(l)},ye.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},ye.prototype.getInputGeometry=function(){return this._inputGeom},ye.prototype.transformMultiLineString=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transformLineString(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ye.prototype.transformCoordinates=function(t,e){return this.copy(t)},ye.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},ye.prototype.transformMultiPoint=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transformPoint(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ye.prototype.transformMultiPolygon=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transformPolygon(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ye.prototype.copy=function(t){return t.copy()},ye.prototype.transformGeometryCollection=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transform(t.getGeometryN(o));s!==null&&(r._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(H.toGeometryArray(i)):this._factory.buildGeometry(i)},ye.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Ee)return this.transformPoint(t,null);if(t instanceof Ri)return this.transformMultiPoint(t,null);if(t instanceof Dr)return this.transformLinearRing(t,null);if(t instanceof yt)return this.transformLineString(t,null);if(t instanceof Fn)return this.transformMultiLineString(t,null);if(t instanceof Mt)return this.transformPolygon(t,null);if(t instanceof Mr)return this.transformMultiPolygon(t,null);if(t instanceof oe)return this.transformGeometryCollection(t,null);throw new pt("Unknown Geometry subtype: "+t.getClass().getName())},ye.prototype.transformLinearRing=function(t,e){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye};var Vr=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new k,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof yt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];n.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};Vr.prototype.snapVertices=function(t,e){for(var r=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var s=t.get(o),a=r.findSnapForVertex(s,e);a!==null&&(t.set(o,new m(a)),o===0&&r._isClosed&&t.set(t.size()-1,new m(a)))}},Vr.prototype.findSnapForVertex=function(t,e){for(var r=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<r._snapTolerance)return e[i]}return null},Vr.prototype.snapTo=function(t){var e=new so(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},Vr.prototype.snapSegments=function(t,e){var r=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var s=e[o],a=r.findSegmentIndexToSnap(s,t);a>=0&&t.add(a+1,new m(s),!1)}},Vr.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=U.MAX_VALUE,o=-1,s=0;s<e.size()-1;s++){if(r._seg.p0=e.get(s),r._seg.p1=e.get(s+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var a=r._seg.distance(t);a<r._snapTolerance&&a<i&&(i=a,o=s)}return o},Vr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Lt=function(t){this._srcGeom=t||null},Ru={SNAP_PRECISION_FACTOR:{configurable:!0}};Lt.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Tu(e,r);return i.transform(this._srcGeom)},Lt.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Tu(t,r,!0),o=i.transform(this._srcGeom),s=o;return e&&V(s,gn)&&(s=o.buffer(0)),s},Lt.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},Lt.prototype.extractTargetCoordinates=function(t){for(var e=new hr,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},Lt.prototype.computeMinimumSegmentLength=function(t){for(var e=U.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.snap=function(t,e,r){var i=new Array(2).fill(null),o=new Lt(t);i[0]=o.snapTo(e,r);var s=new Lt(e);return i[1]=s.snapTo(i[0],r),i},Lt.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Lt.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===J.FIXED){var i=1/r.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return Math.min(Lt.computeOverlaySnapTolerance(o),Lt.computeOverlaySnapTolerance(s))}},Lt.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*Lt.SNAP_PRECISION_FACTOR;return i},Lt.snapToSelf=function(t,e,r){var i=new Lt(t);return i.snapToSelf(e,r)},Ru.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Lt,Ru);var Tu=function(n){function t(e,r,i){n.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var o=new Vr(r,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var o=r.toCoordinateArray(),s=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ye),fe=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};fe.prototype.getCommon=function(){return U.longBitsToDouble(this._commonBits)},fe.prototype.add=function(t){var e=U.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=fe.signExpBits(this._commonBits),this._isFirst=!1,null;var r=fe.signExpBits(e);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=fe.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=fe.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},fe.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=U.longBitsToDouble(t),r=U.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,o=i.substring(i.length-64),s=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return s}},fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.getBit=function(t,e){var r=1<<e;return t&r?1:0},fe.signExpBits=function(t){return t>>52},fe.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,o=t&i;return o},fe.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(fe.getBit(t,i)!==fe.getBit(e,i))return r;r++}return 52};var Cn=function(){this._commonCoord=null,this._ccFilter=new gi},js={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Cn.prototype.addCommonBits=function(t){var e=new In(this._commonCoord);t.apply(e),t.geometryChanged()},Cn.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new m(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new In(e);return t.apply(r),t.geometryChanged(),t},Cn.prototype.getCommonCoordinate=function(){return this._commonCoord},Cn.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},js.CommonCoordinateFilter.get=function(){return gi},js.Translater.get=function(){return In},Object.defineProperties(Cn,js);var gi=function(){this._commonBitsX=new fe,this._commonBitsY=new fe};gi.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},gi.prototype.getCommonCoordinate=function(){return new m(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},gi.prototype.interfaces_=function(){return[Tr]},gi.prototype.getClass=function(){return gi};var In=function(){this.trans=null;var t=arguments[0];this.trans=t};In.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,i)},In.prototype.isDone=function(){return!1},In.prototype.isGeometryChanged=function(){return!0},In.prototype.interfaces_=function(){return[Ze]},In.prototype.getClass=function(){return In};var Vt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Vt.prototype.selfSnap=function(t){var e=new Lt(t),r=e.snapTo(t,this._snapTolerance);return r},Vt.prototype.removeCommonBits=function(t){this._cbr=new Cn,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Vt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Vt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=q.overlayOp(e[0],e[1],t);return this.prepareResult(r)},Vt.prototype.checkValid=function(t){t.isValid()||Ut.out.println("Snapped geometry is invalid")},Vt.prototype.computeSnapTolerance=function(){this._snapTolerance=Lt.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Vt.prototype.snap=function(t){var e=this.removeCommonBits(t),r=Lt.snap(e[0],e[1],this._snapTolerance);return r},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.overlayOp=function(t,e,r){var i=new Vt(t,e);return i.getResultGeometry(r)},Vt.union=function(t,e){return Vt.overlayOp(t,e,q.UNION)},Vt.intersection=function(t,e){return Vt.overlayOp(t,e,q.INTERSECTION)},Vt.symDifference=function(t,e){return Vt.overlayOp(t,e,q.SYMDIFFERENCE)},Vt.difference=function(t,e){return Vt.overlayOp(t,e,q.DIFFERENCE)};var he=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};he.prototype.getResultGeometry=function(t){var e=null,r=!1,i=null;try{e=q.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(r=!0)}catch(s){if(s instanceof Wr)i=s;else throw s}finally{}if(!r)try{e=Vt.overlayOp(this._geom[0],this._geom[1],t)}catch(s){throw s instanceof Wr?i:s}finally{}return e},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.overlayOp=function(t,e,r){var i=new he(t,e);return i.getResultGeometry(r)},he.union=function(t,e){return he.overlayOp(t,e,q.UNION)},he.intersection=function(t,e){return he.overlayOp(t,e,q.INTERSECTION)},he.symDifference=function(t,e){return he.overlayOp(t,e,q.SYMDIFFERENCE)},he.difference=function(t,e){return he.overlayOp(t,e,q.DIFFERENCE)};var Io=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Io.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var Se=function n(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=n.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=o}},Ks={INSERT:{configurable:!0},DELETE:{configurable:!0}};Se.prototype.isDelete=function(){return this._eventType===Se.DELETE},Se.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Se.prototype.getObject=function(){return this._obj},Se.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},Se.prototype.getInsertEvent=function(){return this._insertEvent},Se.prototype.isInsert=function(){return this._eventType===Se.INSERT},Se.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Se.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Se.prototype.interfaces_=function(){return[Fe]},Se.prototype.getClass=function(){return Se},Ks.INSERT.get=function(){return 1},Ks.DELETE.get=function(){return 2},Object.defineProperties(Se,Ks);var $o=function(){};$o.prototype.interfaces_=function(){return[]},$o.prototype.getClass=function(){return $o};var jt=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};jt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(jt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},jt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},jt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},jt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},jt.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1},jt.prototype.hasProperIntersection=function(){return this._hasProper},jt.prototype.hasIntersection=function(){return this._hasIntersection},jt.prototype.isDone=function(){return this._isDone},jt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},jt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},jt.prototype.addIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var mf=function(n){function t(){n.call(this),this.events=new R,this.nOverlaps=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;$e.sort(this.events);for(var i=0;i<this.events.size();i++){var o=r.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var s=r.events.get(o);if(s.isInsert()&&r.processOverlaps(o,s.getDeleteEventIndex(),s,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof jt&&V(arguments[0],Ke)&&V(arguments[1],Ke)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&V(arguments[0],Ke)&&arguments[1]instanceof jt){var c=arguments[0],f=arguments[1],h=arguments[2];h?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(f)}}},t.prototype.addEdge=function(r,i){for(var o=this,s=r.getMonotoneChainEdge(),a=s.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Io(s,u),c=new Se(i,s.getMinX(u),l);o.events.add(c),o.events.add(new Se(s.getMaxX(u),c))}},t.prototype.processOverlaps=function(r,i,o,s){for(var a=this,u=o.getObject(),l=r;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var f=c.getObject();o.isSameLabel(c)||(u.computeIntersections(f,s),a.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var s=o.next();r.addEdge(s,s)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();r.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}($o),Ur=function(){this._min=U.POSITIVE_INFINITY,this._max=U.NEGATIVE_INFINITY},Du={NodeComparator:{configurable:!0}};Ur.prototype.getMin=function(){return this._min},Ur.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Ur.prototype.getMax=function(){return this._max},Ur.prototype.toString=function(){return je.toLineString(new m(this._min,0),new m(this._max,0))},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Du.NodeComparator.get=function(){return No},Object.defineProperties(Ur,Du);var No=function(){};No.prototype.compare=function(t,e){var r=t,i=e,o=(r._min+r._max)/2,s=(i._min+i._max)/2;return o<s?-1:o>s?1:0},No.prototype.interfaces_=function(){return[Ei]},No.prototype.getClass=function(){return No};var yf=function(n){function t(){n.call(this),this._item=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._min=e,this._max=r,this._item=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,o){if(!this.intersects(r,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ur),_f=function(n){function t(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,o){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,o),this._node2!==null&&this._node2.query(r,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ur),qr=function(){this._leaves=new R,this._root=null,this._level=0};qr.prototype.buildTree=function(){var t=this;$e.sort(this._leaves,new Ur.NodeComparator);for(var e=this._leaves,r=null,i=new R;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);r=e,e=i,i=r}},qr.prototype.insert=function(t,e,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new yf(t,e,r))},qr.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},qr.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},qr.prototype.printNode=function(t){Ut.out.println(je.toLineString(new m(t._min,this._level),new m(t._max,this._level)))},qr.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},qr.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),o=r+1<t.size()?t.get(r):null;if(o===null)e.add(i);else{var s=new _f(t.get(r),t.get(r+1));e.add(s)}}},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var Bi=function(){this._items=new R};Bi.prototype.visitItem=function(t){this._items.add(t)},Bi.prototype.getItems=function(){return this._items},Bi.prototype.interfaces_=function(){return[pn]},Bi.prototype.getClass=function(){return Bi};var Gi=function(){this._index=null;var t=arguments[0];if(!V(t,gn))throw new pt("Argument must be Polygonal");this._index=new qn(t)},Qs={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Gi.prototype.locate=function(t){var e=new fr(t),r=new zi(e);return this._index.query(t.y,t.y,r),e.getLocation()},Gi.prototype.interfaces_=function(){return[Ai]},Gi.prototype.getClass=function(){return Gi},Qs.SegmentVisitor.get=function(){return zi},Qs.IntervalIndexedGeometry.get=function(){return qn},Object.defineProperties(Gi,Qs);var zi=function(){this._counter=null;var t=arguments[0];this._counter=t};zi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},zi.prototype.interfaces_=function(){return[pn]},zi.prototype.getClass=function(){return zi};var qn=function(){this._index=new qr;var t=arguments[0];this.init(t)};qn.prototype.init=function(t){for(var e=this,r=Yt.getLines(t),i=r.iterator();i.hasNext();){var o=i.next(),s=o.getCoordinates();e.addLine(s)}},qn.prototype.addLine=function(t){for(var e=this,r=1;r<t.length;r++){var i=new k(t[r-1],t[r]),o=Math.min(i.p0.y,i.p1.y),s=Math.max(i.p0.y,i.p1.y);e._index.insert(o,s,i)}},qn.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Bi;return this._index.query(t,e,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];this._index.query(i,o,s)}},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn};var So=function(n){function t(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new pu,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new er,arguments.length===2){var e=arguments[0],r=arguments[1],i=Be.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var o=this._nodes.addNode(i),s=o.getLabel(),a=1,u=_.NONE;u=s.getLocation(r,P.ON),u===_.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);s.setLocation(r,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new jt(o,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Dr||this._parentGeom instanceof Mt||this._parentGeom instanceof Mr,f=s||!c;return l.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,o){var s=new jt(i,o,!0);s.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,r._edges,s),s},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof Ee){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,_.INTERIOR)}else if(arguments[0]instanceof m){var o=arguments[0];this.insertPoint(this._argIndex,o,_.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),_.EXTERIOR,_.INTERIOR);for(var o=0;o<r.getNumInteriorRing();o++){var s=r.getInteriorRingN(o);i.addPolygonRing(s,_.INTERIOR,_.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],_.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],_.BOUNDARY)},t.prototype.addLineString=function(r){var i=W.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Jo(i,new nt(this._argIndex,_.INTERIOR));this._lineEdgeMap.put(r,o),this.insertEdge(o),X.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),o=0,s=r.iterator();s.hasNext();){var a=s.next();i[o++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(r,i,o){if(this.isBoundaryNode(r,i))return null;o===_.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,o)},t.prototype.addPolygonRing=function(r,i,o){if(r.isEmpty())return null;var s=W.removeRepeatedPoints(r.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;var a=i,u=o;M.isCCW(s)&&(a=o,u=i);var l=new Jo(s,new nt(this._argIndex,_.BOUNDARY,a,u));this._lineEdgeMap.put(r,l),this.insertEdge(l),this.insertPoint(this._argIndex,s[0],_.BOUNDARY)},t.prototype.insertPoint=function(r,i,o){var s=this._nodes.addNode(i),a=s.getLabel();a===null?s._label=new nt(r,o):a.setLocation(r,o)},t.prototype.createEdgeSetIntersector=function(){return new mf},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel().getLocation(r),u=s.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(r,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof Mr&&(this._useBoundaryDeterminationRule=!1),r instanceof Mt)this.addPolygon(r);else if(r instanceof yt)this.addLineString(r);else if(r instanceof Ee)this.addPoint(r);else if(r instanceof Ri)this.addCollection(r);else if(r instanceof Fn)this.addCollection(r);else if(r instanceof Mr)this.addCollection(r);else if(r instanceof oe)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,o=0;o<r.getNumGeometries();o++){var s=r.getGeometryN(o);i.add(s)}},t.prototype.locate=function(r){return V(this._parentGeom,gn)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Gi(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?_.BOUNDARY:_.INTERIOR},t}(vt),Vi=function(){if(this._li=new Dn,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new So(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Be.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new So(0,e,i),this._arg[1]=new So(1,r,i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];o.getPrecisionModel().compareTo(s.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new So(0,o,a),this._arg[1]=new So(1,s,a)}};Vi.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Vi.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi};var Xn=function(){};Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn},Xn.map=function(){if(arguments[0]instanceof z&&V(arguments[1],Xn.MapOp)){for(var t=arguments[0],e=arguments[1],r=new R,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&r.add(o)}return t.getFactory().buildGeometry(r)}else if(V(arguments[0],Dt)&&V(arguments[1],Xn.MapOp)){for(var s=arguments[0],a=arguments[1],u=new R,l=s.iterator();l.hasNext();){var c=l.next(),f=a.map(c);f!==null&&u.add(f)}return u}},Xn.MapOp=function(){};var q=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r),this._ptLocator=new er,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new tr,this._resultPolyList=new R,this._resultLineList=new R,this._resultPointList=new R,this._graph=new vt(new Su),this._geomFact=e.getFactory()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var o=i.getLabel(),s=r.getLabel();i.isPointwiseEqual(r)||(s=new nt(r.getLabel()),s.flip());var a=i.getDepth();a.isNull()&&a.add(o),a.add(s),o.merge(s)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,o,s){var a=new R;return a.addAll(r),a.addAll(i),a.addAll(o),a.isEmpty()?t.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var o=this,s=i.iterator();s.hasNext();){var a=s.next(),u=o._ptLocator.locate(r,a);if(u!==_.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new R,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),r.add(o.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,o=r.iterator();o.hasNext();){var s=o.next();i.insertUniqueEdge(s)}},t.prototype.computeOverlay=function(r){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new R;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Un.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var o=new Ce(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var s=new Sr(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(r);var a=new hi(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var o=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(r){for(var i=this,o=this._arg[r].getNodeIterator();o.hasNext();){var s=o.next(),a=i._graph.addNode(s.getCoordinate());a.setLabel(r,s.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(s.getLocation(0,P.RIGHT),s.getLocation(1,P.RIGHT),r)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),o=i.getLabel(),s=i.getDepth();if(!s.isNull()){s.normalize();for(var a=0;a<2;a++)!o.isNull(a)&&o.isArea()&&!s.isNull(a)&&(s.getDelta(a)===0?o.toLine(a):(X.isTrue(!s.isNull(a,P.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(a,P.LEFT,s.getLocation(a,P.LEFT)),X.isTrue(!s.isNull(a,P.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(a,P.RIGHT,s.getLocation(a,P.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();o.isIsolated()&&(s.isNull(0)?r.labelIncompleteNode(o,0):r.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(s)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Vi);q.overlayOp=function(n,t,e){var r=new q(n,t),i=r.getResultGeometry(e);return i},q.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return q.createEmptyResult(q.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var e=t;return fi.map(n,{interfaces_:function(){return[Xn.MapOp]},map:function(r){return r.intersection(e)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),he.overlayOp(n,t,q.INTERSECTION)},q.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return q.createEmptyResult(q.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),he.overlayOp(n,t,q.SYMDIFFERENCE)},q.resultDimension=function(n,t,e){var r=t.getDimension(),i=e.getDimension(),o=-1;switch(n){case q.INTERSECTION:o=Math.min(r,i);break;case q.UNION:o=Math.max(r,i);break;case q.DIFFERENCE:o=r;break;case q.SYMDIFFERENCE:o=Math.max(r,i);break}return o},q.createEmptyResult=function(n,t,e,r){var i=null;switch(q.resultDimension(n,t,e)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},q.difference=function(n,t){return n.isEmpty()?q.createEmptyResult(q.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),he.overlayOp(n,t,q.DIFFERENCE))},q.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],t=arguments[1],e=n.getLocation(0),r=n.getLocation(1);return q.isResultOfOp(e,r,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===_.BOUNDARY&&(i=_.INTERIOR),o===_.BOUNDARY&&(o=_.INTERIOR),s){case q.INTERSECTION:return i===_.INTERIOR&&o===_.INTERIOR;case q.UNION:return i===_.INTERIOR||o===_.INTERIOR;case q.DIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR;case q.SYMDIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR||i!==_.INTERIOR&&o===_.INTERIOR}return!1}},q.INTERSECTION=1,q.UNION=2,q.DIFFERENCE=3,q.SYMDIFFERENCE=4;var Nn=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new er,this._seg=new k;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Nn.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=e._linework.getGeometryN(r),o=i.getCoordinateSequence(),s=0;s<o.size()-1;s++){o.getCoordinate(s,e._seg.p0),o.getCoordinate(s+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},Nn.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?_.BOUNDARY:this._ptLocator.locate(t,this._g)},Nn.prototype.extractLinework=function(t){var e=new Ui;t.apply(e);var r=e.getLinework(),i=H.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn};var Ui=function(){this._linework=null,this._linework=new R};Ui.prototype.getLinework=function(){return this._linework},Ui.prototype.filter=function(t){var e=this;if(t instanceof Mt){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},Ui.prototype.interfaces_=function(){return[gr]},Ui.prototype.getClass=function(){return Ui};var Yn=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Yn.prototype.extractPoints=function(t,e,r){for(var i=this,o=t.getCoordinates(),s=0;s<o.length-1;s++)i.computeOffsetPoints(o[s],o[s+1],e,r)},Yn.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Yn.prototype.getPoints=function(t){for(var e=this,r=new R,i=Yt.getLines(this._g),o=i.iterator();o.hasNext();){var s=o.next();e.extractPoints(s,t,r)}return r},Yn.prototype.computeOffsetPoints=function(t,e,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.sqrt(o*o+s*s),u=r*o/a,l=r*s/a,c=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var h=new m(c-l,f+u);i.add(h)}if(this._doRight){var g=new m(c+l,f-u);i.add(g)}},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var De=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new R;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,r],this._locFinder=[new Nn(this._geom[0],this._boundaryDistanceTolerance),new Nn(this._geom[1],this._boundaryDistanceTolerance),new Nn(this._geom[2],this._boundaryDistanceTolerance)]},Mu={TOLERANCE:{configurable:!0}};De.prototype.reportResult=function(t,e,r){Ut.out.println("Overlay result invalid - A:"+_.toLocationSymbol(e[0])+" B:"+_.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+_.toLocationSymbol(e[2]))},De.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},De.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._location[0]=this._locFinder[0].getLocation(s),this._location[1]=this._locFinder[1].getLocation(s),this._location[2]=this._locFinder[2].getLocation(s),De.hasLocation(this._location,_.BOUNDARY)?!0:this.isValidResult(o,this._location)}},De.prototype.addTestPts=function(t){var e=new Yn(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},De.prototype.isValidResult=function(t,e){var r=q.isResultOfOp(e[0],e[1],t),i=e[2]===_.INTERIOR,o=!(r^i);return o||this.reportResult(t,e,r),o},De.prototype.getInvalidLocation=function(){return this._invalidLocation},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},De.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Lt.computeSizeBasedSnapTolerance(t),Lt.computeSizeBasedSnapTolerance(e))},De.isValid=function(t,e,r,i){var o=new De(t,e,i);return o.isValid(r)},Mu.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(De,Mu);var Me=function n(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(t),this._inputGeoms=t};Me.prototype.extractElements=function(t,e){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);r._skipEmpty&&o.isEmpty()||e.add(o)}},Me.prototype.combine=function(){for(var t=this,e=new R,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Me(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=new Me(Me.createList(r,i));return o.combine()}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2],l=new Me(Me.createList(s,a,u));return l.combine()}},Me.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Me.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new R;return r.add(t),r.add(e),r}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new R;return a.add(i),a.add(o),a.add(s),a}};var Rt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new R)},Au={STRTREE_NODE_CAPACITY:{configurable:!0}};Rt.prototype.reduceToGeometries=function(t){for(var e=this,r=new R,i=t.iterator();i.hasNext();){var o=i.next(),s=null;V(o,Ke)?s=e.unionTree(o):o instanceof z&&(s=o),r.add(s)}return r},Rt.prototype.extractByEnvelope=function(t,e,r){for(var i=new R,o=0;o<e.getNumGeometries();o++){var s=e.getGeometryN(o);s.getEnvelopeInternal().intersects(t)?i.add(s):r.add(s)}return this._geomFactory.buildGeometry(i)},Rt.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var o=Me.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var s=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,s)},Rt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new yu(Rt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var r=e.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o},Rt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2];if(i-r<=1){var o=Rt.getGeometry(e,r);return this.unionSafe(o,null)}else{if(i-r===2)return this.unionSafe(Rt.getGeometry(e,r),Rt.getGeometry(e,r+1));var s=Math.trunc((i+r)/2),a=this.binaryUnion(e,r,s),u=this.binaryUnion(e,s,i);return this.unionSafe(a,u)}}},Rt.prototype.repeatedUnion=function(t){for(var e=null,r=t.iterator();r.hasNext();){var i=r.next();e===null?e=i.copy():e=e.union(i)}return e},Rt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Rt.prototype.unionActual=function(t,e){return Rt.restrictToPolygons(t.union(e))},Rt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),r=this.binaryUnion(e);return r},Rt.prototype.unionUsingEnvelopeIntersection=function(t,e,r){var i=new R,o=this.extractByEnvelope(r,t,i),s=this.extractByEnvelope(r,e,i),a=this.unionActual(o,s);i.add(a);var u=Me.combine(i);return u},Rt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),r=e.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o.getFactory(),u=a.createGeometryCollection([o,s]),l=u.buffer(0);return l}},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},Rt.restrictToPolygons=function(t){if(V(t,gn))return t;var e=rn.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(H.toPolygonArray(e))},Rt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Rt.union=function(t){var e=new Rt(t);return e.union()},Au.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Rt,Au);var ts=function(){};ts.prototype.interfaces_=function(){return[]},ts.prototype.getClass=function(){return ts},ts.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return q.createEmptyResult(q.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),he.overlayOp(t,e,q.UNION)};function Wn(){return new es}function es(){this.reset()}es.prototype={constructor:es,reset:function(){this.s=this.t=0},add:function(n){Fu(rs,n,this.t),Fu(this,rs.s,this.s),this.s?this.t+=rs.t:this.s=rs.t},valueOf:function(){return this.s}};var rs=new es;function Fu(n,t,e){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}var Et=1e-6,at=Math.PI,nn=at/2,ku=at/4,on=at*2,Hn=180/at,xr=at/180,ge=Math.abs,Ef=Math.atan,qi=Math.atan2,Ft=Math.cos,kt=Math.sin,Xi=Math.sqrt;function Bu(n){return n>1?0:n<-1?at:Math.acos(n)}function pi(n){return n>1?nn:n<-1?-nn:Math.asin(n)}function xo(){}function ns(n,t){n&&zu.hasOwnProperty(n.type)&&zu[n.type](n,t)}var Gu={Feature:function(n,t){ns(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)ns(e[r].geometry,t)}},zu={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){Zs(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Zs(e[r],t,0)},Polygon:function(n,t){Vu(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Vu(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)ns(e[r],t)}};function Zs(n,t,e){var r=-1,i=n.length-e,o;for(t.lineStart();++r<i;)o=n[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function Vu(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)Zs(n[e],t,1);t.polygonEnd()}function Cf(n,t){n&&Gu.hasOwnProperty(n.type)?Gu[n.type](n,t):ns(n,t)}Wn(),Wn();function Js(n){return[qi(n[1],n[0]),pi(n[2])]}function Yi(n){var t=n[0],e=n[1],r=Ft(e);return[r*Ft(t),r*kt(t),kt(e)]}function is(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function os(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function $s(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ss(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function ta(n){var t=Xi(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}Wn();function Uu(n,t){function e(r,i){return r=n(r,i),t(r[0],r[1])}return n.invert&&t.invert&&(e.invert=function(r,i){return r=t.invert(r,i),r&&n.invert(r[0],r[1])}),e}function ea(n,t){return[n>at?n-on:n<-at?n+on:n,t]}ea.invert=ea;function If(n,t,e){return(n%=on)?t||e?Uu(Xu(n),Yu(t,e)):Xu(n):t||e?Yu(t,e):ea}function qu(n){return function(t,e){return t+=n,[t>at?t-on:t<-at?t+on:t,e]}}function Xu(n){var t=qu(n);return t.invert=qu(-n),t}function Yu(n,t){var e=Ft(n),r=kt(n),i=Ft(t),o=kt(t);function s(a,u){var l=Ft(u),c=Ft(a)*l,f=kt(a)*l,h=kt(u),g=h*e+c*r;return[qi(f*i-g*o,c*e-h*r),pi(g*i+f*o)]}return s.invert=function(a,u){var l=Ft(u),c=Ft(a)*l,f=kt(a)*l,h=kt(u),g=h*i-f*o;return[qi(f*i+h*o,c*e+g*r),pi(g*e-c*r)]},s}function Nf(n,t,e,r,i,o){if(e){var s=Ft(t),a=kt(t),u=r*e;i==null?(i=t+r*on,o=t-u/2):(i=Wu(s,i),o=Wu(s,o),(r>0?i<o:i>o)&&(i+=r*on));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Js([s,-a*Ft(c),-a*kt(c)]),n.point(l[0],l[1])}}function Wu(n,t){t=Yi(t),t[0]-=n,ta(t);var e=Bu(-t[1]);return((-t[2]<0?-e:e)+on-Et)%on}function Hu(){var n=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){n.push(t=[])},lineEnd:xo,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Sf(n,t,e,r,i,o){var s=n[0],a=n[1],u=t[0],l=t[1],c=0,f=1,h=u-s,g=l-a,p;if(p=e-s,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}if(p=r-a,!(!g&&p>0)){if(p/=g,g<0){if(p<c)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>c&&(c=p)}else if(g>0){if(p<c)return;p<f&&(f=p)}return c>0&&(n[0]=s+c*h,n[1]=a+c*g),f<1&&(t[0]=s+f*h,t[1]=a+f*g),!0}}}}}function as(n,t){return ge(n[0]-t[0])<Et&&ge(n[1]-t[1])<Et}function us(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function ju(n,t,e,r,i){var o=[],s=[],a,u;if(n.forEach(function(p){if(!((v=p.length-1)<=0)){var v,d=p[0],y=p[v],I;if(as(d,y)){for(i.lineStart(),a=0;a<v;++a)i.point((d=p[a])[0],d[1]);i.lineEnd();return}o.push(I=new us(d,p,null,!0)),s.push(I.o=new us(d,null,I,!1)),o.push(I=new us(y,p,null,!1)),s.push(I.o=new us(y,null,I,!0))}}),!!o.length){for(s.sort(t),Ku(o),Ku(s),a=0,u=s.length;a<u;++a)s[a].e=e=!e;for(var l=o[0],c,f;;){for(var h=l,g=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(a=0,u=c.length;a<u;++a)i.point((f=c[a])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(g)for(c=h.p.z,a=c.length-1;a>=0;--a)i.point((f=c[a])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,g=!g}while(!h.v);i.lineEnd()}}}function Ku(n){if(t=n.length){for(var t,e=0,r=n[0],i;++e<t;)r.n=i=n[e],i.p=r,r=i;r.n=i=n[0],i.p=r}}function Qu(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function xf(n){return n.length===1&&(n=Lf(n)),{left:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r},right:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}function Lf(n){return function(t,e){return Qu(n(t),e)}}xf(Qu);function Zu(n){for(var t=n.length,e,r=-1,i=0,o,s;++r<t;)i+=n[r].length;for(o=new Array(i);--t>=0;)for(s=n[t],e=s.length;--e>=0;)o[--i]=s[e];return o}var Lo=1e9,ls=-Lo;function bf(n,t,e,r){function i(l,c){return n<=l&&l<=e&&t<=c&&c<=r}function o(l,c,f,h){var g=0,p=0;if(l==null||(g=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do h.point(g===0||g===3?n:e,g>1?r:t);while((g=(g+f+4)%4)!==p);else h.point(c[0],c[1])}function s(l,c){return ge(l[0]-n)<Et?c>0?0:3:ge(l[0]-e)<Et?c>0?2:1:ge(l[1]-t)<Et?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),h=s(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=Hu(),h,g,p,v,d,y,I,C,N,L,T,O={point:D,lineStart:G,lineEnd:ut,polygonStart:A,polygonEnd:Y};function D(B,Q){i(B,Q)&&c.point(B,Q)}function b(){for(var B=0,Q=0,bt=g.length;Q<bt;++Q)for(var re=g[Q],Kt=1,sn=re.length,Ae=re[0],Xe,ir,jn=Ae[0],Sn=Ae[1];Kt<sn;++Kt)Xe=jn,ir=Sn,Ae=re[Kt],jn=Ae[0],Sn=Ae[1],ir<=r?Sn>r&&(jn-Xe)*(r-ir)>(Sn-ir)*(n-Xe)&&++B:Sn<=r&&(jn-Xe)*(r-ir)<(Sn-ir)*(n-Xe)&&--B;return B}function A(){c=f,h=[],g=[],T=!0}function Y(){var B=b(),Q=T&&B,bt=(h=Zu(h)).length;(Q||bt)&&(l.polygonStart(),Q&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),bt&&ju(h,a,B,o,l),l.polygonEnd()),c=l,h=g=p=null}function G(){O.point=x,g&&g.push(p=[]),L=!0,N=!1,I=C=NaN}function ut(){h&&(x(v,d),y&&N&&f.rejoin(),h.push(f.result())),O.point=D,N&&c.lineEnd()}function x(B,Q){var bt=i(B,Q);if(g&&p.push([B,Q]),L)v=B,d=Q,y=bt,L=!1,bt&&(c.lineStart(),c.point(B,Q));else if(bt&&N)c.point(B,Q);else{var re=[I=Math.max(ls,Math.min(Lo,I)),C=Math.max(ls,Math.min(Lo,C))],Kt=[B=Math.max(ls,Math.min(Lo,B)),Q=Math.max(ls,Math.min(Lo,Q))];Sf(re,Kt,n,t,e,r)?(N||(c.lineStart(),c.point(re[0],re[1])),c.point(Kt[0],Kt[1]),bt||c.lineEnd(),T=!1):bt&&(c.lineStart(),c.point(B,Q),T=!1)}I=B,C=Q,N=bt}return O}}var ra=Wn();function wf(n,t){var e=t[0],r=t[1],i=[kt(e),-Ft(e),0],o=0,s=0;ra.reset();for(var a=0,u=n.length;a<u;++a)if(c=(l=n[a]).length)for(var l,c,f=l[c-1],h=f[0],g=f[1]/2+ku,p=kt(g),v=Ft(g),d=0;d<c;++d,h=I,p=N,v=L,f=y){var y=l[d],I=y[0],C=y[1]/2+ku,N=kt(C),L=Ft(C),T=I-h,O=T>=0?1:-1,D=O*T,b=D>at,A=p*N;if(ra.add(qi(A*O*kt(D),v*L+A*Ft(D))),o+=b?T+O*on:T,b^h>=e^I>=e){var Y=os(Yi(f),Yi(y));ta(Y);var G=os(i,Y);ta(G);var ut=(b^T>=0?-1:1)*pi(G[2]);(r>ut||r===ut&&(Y[0]||Y[1]))&&(s+=b^T>=0?1:-1)}}return(o<-Et||o<Et&&ra<-Et)^s&1}Wn();function Ju(n){return n}Wn(),Wn();var Wi=1/0,cs=Wi,bo=-Wi,fs=bo,$u={point:Pf,lineStart:xo,lineEnd:xo,polygonStart:xo,polygonEnd:xo,result:function(){var n=[[Wi,cs],[bo,fs]];return bo=fs=-(cs=Wi=1/0),n}};function Pf(n,t){n<Wi&&(Wi=n),n>bo&&(bo=n),t<cs&&(cs=t),t>fs&&(fs=t)}Wn();function tl(n,t,e,r){return function(i,o){var s=t(o),a=i.invert(r[0],r[1]),u=Hu(),l=t(u),c=!1,f,h,g,p={point:v,lineStart:y,lineEnd:I,polygonStart:function(){p.point=C,p.lineStart=N,p.lineEnd=L,h=[],f=[]},polygonEnd:function(){p.point=v,p.lineStart=y,p.lineEnd=I,h=Zu(h);var T=wf(f,a);h.length?(c||(o.polygonStart(),c=!0),ju(h,Rf,T,e,o)):T&&(c||(o.polygonStart(),c=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),h=f=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function v(T,O){var D=i(T,O);n(T=D[0],O=D[1])&&o.point(T,O)}function d(T,O){var D=i(T,O);s.point(D[0],D[1])}function y(){p.point=d,s.lineStart()}function I(){p.point=v,s.lineEnd()}function C(T,O){g.push([T,O]);var D=i(T,O);l.point(D[0],D[1])}function N(){l.lineStart(),g=[]}function L(){C(g[0][0],g[0][1]),l.lineEnd();var T=l.clean(),O=u.result(),D,b=O.length,A,Y,G;if(g.pop(),f.push(g),g=null,!!b){if(T&1){if(Y=O[0],(A=Y.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),D=0;D<A;++D)o.point((G=Y[D])[0],G[1]);o.lineEnd()}return}b>1&&T&2&&O.push(O.pop().concat(O.shift())),h.push(O.filter(Of))}}return p}}function Of(n){return n.length>1}function Rf(n,t){return((n=n.x)[0]<0?n[1]-nn-Et:nn-n[1])-((t=t.x)[0]<0?t[1]-nn-Et:nn-t[1])}const el=tl(function(){return!0},Tf,Mf,[-at,-nn]);function Tf(n){var t=NaN,e=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(o,s){var a=o>0?at:-at,u=ge(o-t);ge(u-at)<Et?(n.point(t,e=(e+s)/2>0?nn:-nn),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),n.point(o,e),i=0):r!==a&&u>=at&&(ge(t-r)<Et&&(t-=r*Et),ge(o-a)<Et&&(o-=a*Et),e=Df(t,e,o,s),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),i=0),n.point(t=o,e=s),r=a},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function Df(n,t,e,r){var i,o,s=kt(n-e);return ge(s)>Et?Ef((kt(t)*(o=Ft(r))*kt(e)-kt(r)*(i=Ft(t))*kt(n))/(i*o*s)):(t+r)/2}function Mf(n,t,e,r){var i;if(n==null)i=e*nn,r.point(-at,i),r.point(0,i),r.point(at,i),r.point(at,0),r.point(at,-i),r.point(0,-i),r.point(-at,-i),r.point(-at,0),r.point(-at,i);else if(ge(n[0]-t[0])>Et){var o=n[0]<t[0]?at:-at;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function Af(n,t){var e=Ft(n),r=e>0,i=ge(e)>Et;function o(c,f,h,g){Nf(g,n,t,h,c,f)}function s(c,f){return Ft(c)*Ft(f)>e}function a(c){var f,h,g,p,v;return{lineStart:function(){p=g=!1,v=1},point:function(d,y){var I=[d,y],C,N=s(d,y),L=r?N?0:l(d,y):N?l(d+(d<0?at:-at),y):0;if(!f&&(p=g=N)&&c.lineStart(),N!==g&&(C=u(f,I),(!C||as(f,C)||as(I,C))&&(I[0]+=Et,I[1]+=Et,N=s(I[0],I[1]))),N!==g)v=0,N?(c.lineStart(),C=u(I,f),c.point(C[0],C[1])):(C=u(f,I),c.point(C[0],C[1]),c.lineEnd()),f=C;else if(i&&f&&r^N){var T;!(L&h)&&(T=u(I,f,!0))&&(v=0,r?(c.lineStart(),c.point(T[0][0],T[0][1]),c.point(T[1][0],T[1][1]),c.lineEnd()):(c.point(T[1][0],T[1][1]),c.lineEnd(),c.lineStart(),c.point(T[0][0],T[0][1])))}N&&(!f||!as(f,I))&&c.point(I[0],I[1]),f=I,g=N,h=L},lineEnd:function(){g&&c.lineEnd(),f=null},clean:function(){return v|(p&&g)<<1}}}function u(c,f,h){var g=Yi(c),p=Yi(f),v=[1,0,0],d=os(g,p),y=is(d,d),I=d[0],C=y-I*I;if(!C)return!h&&c;var N=e*y/C,L=-e*I/C,T=os(v,d),O=ss(v,N),D=ss(d,L);$s(O,D);var b=T,A=is(O,b),Y=is(b,b),G=A*A-Y*(is(O,O)-1);if(!(G<0)){var ut=Xi(G),x=ss(b,(-A-ut)/Y);if($s(x,O),x=Js(x),!h)return x;var B=c[0],Q=f[0],bt=c[1],re=f[1],Kt;Q<B&&(Kt=B,B=Q,Q=Kt);var sn=Q-B,Ae=ge(sn-at)<Et,Xe=Ae||sn<Et;if(!Ae&&re<bt&&(Kt=bt,bt=re,re=Kt),Xe?Ae?bt+re>0^x[1]<(ge(x[0]-B)<Et?bt:re):bt<=x[1]&&x[1]<=re:sn>at^(B<=x[0]&&x[0]<=Q)){var ir=ss(b,(-A+ut)/Y);return $s(ir,O),[x,Js(ir)]}}}function l(c,f){var h=r?n:at-n,g=0;return c<-h?g|=1:c>h&&(g|=2),f<-h?g|=4:f>h&&(g|=8),g}return tl(s,a,o,r?[0,-n]:[-at,n-at])}function rl(n){return function(t){var e=new na;for(var r in n)e[r]=n[r];return e.stream=t,e}}function na(){}na.prototype={constructor:na,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function nl(n,t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),o!=null&&n.clipExtent(null),Cf(e,n.stream($u));var s=$u.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+t[0][0]+(r-a*(s[1][0]+s[0][0]))/2,l=+t[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return o!=null&&n.clipExtent(o),n.scale(a*150).translate([u,l])}function Ff(n,t,e){return nl(n,[[0,0],t],e)}var il=16,kf=Ft(30*xr);function ol(n,t){return+t?Gf(n,t):Bf(n)}function Bf(n){return rl({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}})}function Gf(n,t){function e(r,i,o,s,a,u,l,c,f,h,g,p,v,d){var y=l-r,I=c-i,C=y*y+I*I;if(C>4*t&&v--){var N=s+h,L=a+g,T=u+p,O=Xi(N*N+L*L+T*T),D=pi(T/=O),b=ge(ge(T)-1)<Et||ge(o-f)<Et?(o+f)/2:qi(L,N),A=n(b,D),Y=A[0],G=A[1],ut=Y-r,x=G-i,B=I*ut-y*x;(B*B/C>t||ge((y*ut+I*x)/C-.5)>.3||s*h+a*g+u*p<kf)&&(e(r,i,o,s,a,u,Y,G,b,N/=O,L/=O,T,v,d),d.point(Y,G),e(Y,G,b,N,L,T,l,c,f,h,g,p,v,d))}}return function(r){var i,o,s,a,u,l,c,f,h,g,p,v,d={point:y,lineStart:I,lineEnd:N,polygonStart:function(){r.polygonStart(),d.lineStart=L},polygonEnd:function(){r.polygonEnd(),d.lineStart=I}};function y(D,b){D=n(D,b),r.point(D[0],D[1])}function I(){f=NaN,d.point=C,r.lineStart()}function C(D,b){var A=Yi([D,b]),Y=n(D,b);e(f,h,c,g,p,v,f=Y[0],h=Y[1],c=D,g=A[0],p=A[1],v=A[2],il,r),r.point(f,h)}function N(){d.point=y,r.lineEnd()}function L(){I(),d.point=T,d.lineEnd=O}function T(D,b){C(i=D,b),o=f,s=h,a=g,u=p,l=v,d.point=C}function O(){e(f,h,c,g,p,v,o,s,i,a,u,l,il,r),d.lineEnd=N,N()}return d}}var zf=rl({point:function(n,t){this.stream.point(n*xr,t*xr)}});function Vf(n){return Uf(function(){return n})()}function Uf(n){var t,e=150,r=480,i=250,o,s,a=0,u=0,l=0,c=0,f=0,h,g,p=null,v=el,d=null,y,I,C,N=Ju,L=.5,T=ol(Y,L),O,D;function b(x){return x=g(x[0]*xr,x[1]*xr),[x[0]*e+o,s-x[1]*e]}function A(x){return x=g.invert((x[0]-o)/e,(s-x[1])/e),x&&[x[0]*Hn,x[1]*Hn]}function Y(x,B){return x=t(x,B),[x[0]*e+o,s-x[1]*e]}b.stream=function(x){return O&&D===x?O:O=zf(v(h,T(N(D=x))))},b.clipAngle=function(x){return arguments.length?(v=+x?Af(p=x*xr,6*xr):(p=null,el),ut()):p*Hn},b.clipExtent=function(x){return arguments.length?(N=x==null?(d=y=I=C=null,Ju):bf(d=+x[0][0],y=+x[0][1],I=+x[1][0],C=+x[1][1]),ut()):d==null?null:[[d,y],[I,C]]},b.scale=function(x){return arguments.length?(e=+x,G()):e},b.translate=function(x){return arguments.length?(r=+x[0],i=+x[1],G()):[r,i]},b.center=function(x){return arguments.length?(a=x[0]%360*xr,u=x[1]%360*xr,G()):[a*Hn,u*Hn]},b.rotate=function(x){return arguments.length?(l=x[0]%360*xr,c=x[1]%360*xr,f=x.length>2?x[2]%360*xr:0,G()):[l*Hn,c*Hn,f*Hn]},b.precision=function(x){return arguments.length?(T=ol(Y,L=x*x),ut()):Xi(L)},b.fitExtent=function(x,B){return nl(b,x,B)},b.fitSize=function(x,B){return Ff(b,x,B)};function G(){g=Uu(h=If(l,c,f),t);var x=t(a,u);return o=r-x[0]*e,s=i+x[1]*e,ut()}function ut(){return O=D=null,b}return function(){return t=n.apply(this,arguments),b.invert=t.invert&&A,G()}}function sl(n){return function(t,e){var r=Ft(t),i=Ft(e),o=n(r*i);return[o*i*kt(t),o*kt(e)]}}function al(n){return function(t,e){var r=Xi(t*t+e*e),i=n(r),o=kt(i),s=Ft(i);return[qi(t*o,r*s),pi(r&&e*o/r)]}}var qf=sl(function(n){return Xi(2/(1+n))});qf.invert=al(function(n){return 2*pi(n/2)});var ul=sl(function(n){return(n=Bu(n))&&n/kt(n)});ul.invert=al(function(n){return n});function Xf(){return Vf(ul).scale(79.4188).clipAngle(180-.001)}function ll(n,t){return[n,t]}ll.invert=ll;function Yf(n,t,e){e=e||{};var r=e.units||"kilometers",i=e.steps||8;if(!n)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(n.type){case"GeometryCollection":return iu(n,function(s){var a=hs(s,t,r,i);a&&o.push(a)}),Rs(o);case"FeatureCollection":return nu(n,function(s){var a=hs(s,t,r,i);a&&nu(a,function(u){u&&o.push(u)})}),Rs(o)}return hs(n,t,r,i)}function hs(n,t,e,r){var i=n.properties||{},o=n.type==="Feature"?n.geometry:n;if(o.type==="GeometryCollection"){var s=[];return iu(n,function(v){var d=hs(v,t,e,r);d&&s.push(d)}),Rs(s)}var a=Wf(o),u={type:o.type,coordinates:fl(o.coordinates,a)},l=new Vs,c=l.read(u),f=Jc($c(t,e),"meters"),h=Xt.bufferOp(c,f,r),g=new vu;if(h=g.write(h),!cl(h.coordinates)){var p={type:h.type,coordinates:hl(h.coordinates,a)};return Fo(p,i)}}function cl(n){return Array.isArray(n[0])?cl(n[0]):isNaN(n[0])}function fl(n,t){return typeof n[0]!="object"?t(n):n.map(function(e){return fl(e,t)})}function hl(n,t){return typeof n[0]!="object"?t.invert(n):n.map(function(e){return hl(e,t)})}function Wf(n){var t=ef(n).geometry.coordinates,e=[-t[0],-t[1]];return Xf().rotate(e).scale(be)}function Hf(n,t){var e=ko(n),r=ko(t),i=n.properties||{},o=Za.difference(e.coordinates,r.coordinates);return o.length===0?null:o.length===1?$a(o[0],i):tu(o,i)}function gl(n){let t;for(const e of n)t&&e[0]-t[0]>=180?e[0]-=360:t&&e[0]-t[0]<-180&&(e[0]+=360),t=e}function pl(n,t){const e=Hf({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},n);if(!e)return;e.properties={isMask:"y"};const r=Yf(n,0);if(r.geometry.type==="Polygon")for(const i of r.geometry.coordinates)gl(i);else for(const i of r.geometry.coordinates)for(const o of i)gl(o);t({type:"FeatureCollection",features:[r,e]})}let dl={type:"FeatureCollection",features:[]};function vl(n,t,e=!0,r=!0,i={},o={},s={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let a,u=[],l,c;function f(){(s!=null&&s.fill||s!=null&&s.line)&&n.addSource("full-geom",{type:"geojson",data:dl}),s!=null&&s.fill&&n.addLayer({...s==null?void 0:s.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),s!=null&&s.line&&n.addLayer({...s==null?void 0:s.line,id:"full-geom-line",type:"line",source:"full-geom"})}n.loaded()?f():n.once("load",()=>{f()});const h=p=>{a==null||a({type:"mapClick",coordinates:[p.lngLat.lng,p.lngLat.lat]})};function g(p=!1){if(!t)throw new Error;const v=document.createElement("div");return p&&v.classList.add("marker-interactive"),new ic({props:{displayIn:"maplibre"},target:v}),new t.Marker({element:v,offset:[1,-13]})}return{setEventHandler(p){p?(a=p,n.on("click",h)):(a=void 0,n.off("click",h))},flyTo(p,v){n.flyTo({center:p,zoom:v,...i})},fitBounds(p,v,d){n.fitBounds([[p[0],p[1]],[p[2],p[3]]],{padding:v,maxZoom:d,...o})},indicateReverse(p){n.getCanvasContainer().style.cursor=p?"crosshair":""},setReverseMarker(p){!t||!e||(c?p?c.setLngLat(p):(c.remove(),c=void 0):p&&(c=(typeof e=="object"?new t.Marker(e):g()).setLngLat(p).addTo(n),c.getElement().classList.add("marker-reverse")))},setMarkers(p,v){if(!e)return;function d(y){var I;(I=n.getSource("full-geom"))==null||I.setData(y)}for(const y of u)y.remove();if(u.length=0,d(dl),!!t){if(v){let y=!1;if(v.geometry.type==="GeometryCollection"){const I=v.geometry.geometries.filter(C=>C.type==="Polygon"||C.type==="MultiPolygon");if(I.length>0){let C=I.pop();for(const N of I)C=tf(C,N);pl({...v,geometry:C},d),y=!0}else{const C=v.geometry.geometries.filter(N=>N.type==="LineString"||N.type==="MultiLineString");C.length>0&&(d({...v,geometry:{type:"GeometryCollection",geometries:C}}),y=!0)}}if(!y){if(v.geometry.type==="Polygon"||v.geometry.type==="MultiPolygon")pl(v,d);else if(v.geometry.type==="LineString"||v.geometry.type==="MultiLineString"){d(v);return}}e&&u.push((typeof e=="object"?new t.Marker(e):g()).setLngLat(v.center).addTo(n))}if(r)for(const y of p??[]){if(y===v)continue;const I=(typeof r=="object"?new t.Marker(r):g(!0)).setLngLat(y.center).setPopup(new t.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(y.place_type[0]==="reverse"?y.place_name:y.place_name.replace(/,.*/,""))).addTo(n),C=I.getElement();C.addEventListener("click",N=>{N.stopPropagation(),a==null||a({type:"markerClick",id:y.id})}),C.addEventListener("mouseenter",()=>{a==null||a({type:"markerMouseEnter",id:y.id}),I.togglePopup()}),C.addEventListener("mouseleave",()=>{a==null||a({type:"markerMouseLeave",id:y.id}),I.togglePopup()}),u.push(I)}}},setSelectedMarker(p){l&&l.getElement().classList.toggle("marker-selected",!1),l=p>-1?u[p]:void 0,l==null||l.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const p=n.getCenter();return[n.getZoom(),p.lng,p.lat]}}}class jf extends EventTarget{constructor(e={}){super();ga(this,nr,void 0);ga(this,di,void 0);ms(this,di,e)}onAddInt(e){const r=document.createElement("div");r.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:i,showResultMarkers:o,flyTo:s,fullGeometryStyle:a,...u}=wr(this,di),l=typeof s=="boolean"?{}:s,c=this.getExtraProps(e,r),h={mapController:vl(e,this.getMapLibreGl(),i,o,l,l,a),flyTo:s===void 0?!0:!!s,apiKey:"",...c,...u};if(!h.apiKey)throw new Error("no apiKey provided");ms(this,nr,new wc({target:r,props:h}));for(const g of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])wr(this,nr).$on(g,p=>this.dispatchEvent(p));return r}setOptions(e){var u;ms(this,di,e);const{marker:r,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=wr(this,di);(u=wr(this,nr))==null||u.$set(a)}setQuery(e,r=!0){var i;(i=wr(this,nr))==null||i.setQuery(e,r)}clearMap(){var e;(e=wr(this,nr))==null||e.clearMap()}clearList(){var e;(e=wr(this,nr))==null||e.clearList()}setReverseMode(e){var r;(r=wr(this,nr))==null||r.$set({reverseActive:e})}focus(){var e;(e=wr(this,nr))==null||e.focus()}blur(){var e;(e=wr(this,nr))==null||e.blur()}onRemove(){var e;(e=wr(this,nr))==null||e.$destroy()}}nr=new WeakMap,di=new WeakMap;class Kf extends jf{getMapLibreGl(){return wo}onAdd(t){return super.onAddInt(t)}getExtraProps(t,e){const r={};if(!("getSdkConfig"in t&&typeof t.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:i,apiKey:o}=t.getSdkConfig();r.apiKey=o;const s=/^([a-z]{2})($|_|-)/.exec(i);return s&&(r.language=s[1]),e.className+=" maptiler-ctrl",r}}ht.GeocodingControl=Kf,ht.createMapLibreGlMapController=vl,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"})});
25
+ `)}return t.toString()},te.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},te.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)s.isLine(a)&&s.getLocation(a)===_.BOUNDARY&&(r[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),f=0;f<2;f++)if(c.isAnyNull(f)){var h=_.NONE;if(r[f])h=_.EXTERIOR;else{var g=l.getCoordinate();h=e.getLocation(f,g,t)}c.setAllLocationsIfNull(f,h)}},te.prototype.getDegree=function(){return this._edgeMap.size()},te.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te};var vf=function(n){function t(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=r._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),s){case r._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;o=l,s=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),s=r._SCANNING_FOR_INCOMING;break}}if(s===this._LINKING_TO_OUTGOING){if(i===null)throw new Jr("no outgoing dirEdge found",this.getCoordinate());X.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var o=r.get(0);if(i===1)return o;var s=r.get(i-1),a=o.getQuadrant(),u=s.getQuadrant();return ot.isNorthern(a)&&ot.isNorthern(u)?o:!ot.isNorthern(a)&&!ot.isNorthern(u)?s:o.getDy()!==0?o:s.getDy()!==0?s:(X.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){Ut.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();r.print("out "),o.print(r),r.println(),r.print("in "),o.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new R;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&r._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.setAllLocationsIfNull(0,r.getLocation(0)),s.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,o=null,s=this._edgeList.size()-1;s>=0;s--){var a=r._edgeList.get(s),u=a.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=a}o.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),s=i.getDepth(P.LEFT),a=i.getDepth(P.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),s),l=this.computeDepths(0,o,u);if(l!==a)throw new Jr("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],f=arguments[1],h=arguments[2],g=h,p=c;p<f;p++){var y=r._edgeList.get(p);y.setEdgeDepths(P.RIGHT,g),g=y.getDepth(P.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,o=null,s=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(o===null&&l.getEdgeRing()===r&&(o=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==r)continue;s=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==r)continue;s.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(X.isTrue(o!==null,"found null for first outgoing dirEdge"),X.isTrue(o.getEdgeRing()===r,"unable to link last incoming dirEdge"),s.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&r++}return r}else if(arguments.length===1){for(var s=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===s&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=_.NONE,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){r=_.INTERIOR;break}if(s.isInResult()){r=_.EXTERIOR;break}}}if(r===_.NONE)return null;for(var a=r,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===_.INTERIOR):(l.isInResult()&&(a=_.EXTERIOR),c.isInResult()&&(a=_.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new nt(_.NONE);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===_.INTERIOR||c===_.BOUNDARY)&&i._label.setLocation(l,_.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(te),Su=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new Qo(r,new vf)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ti),vn=function n(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=n.orientation(t)};vn.prototype.compareTo=function(t){var e=t,r=vn.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},vn.prototype.interfaces_=function(){return[Fe]},vn.prototype.getClass=function(){return vn},vn.orientation=function(t){return W.increasingDirection(t)===1},vn.compareOriented=function(t,e,r,i){for(var o=e?1:-1,s=i?1:-1,a=e?t.length:-1,u=i?r.length:-1,l=e?0:t.length-1,c=i?0:r.length-1;;){var f=t[l].compareTo(r[c]);if(f!==0)return f;l+=o,c+=s;var h=l===a,g=c===u;if(h&&!g)return-1;if(!h&&g)return 1;if(h&&g)return 0}};var tr=function(){this._edges=new R,this._ocaMap=new Jt};tr.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=e._edges.get(r);r>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),s=0;s<o.length;s++)s>0&&t.print(","),t.print(o[s].x+" "+o[s].y);t.println(")")}t.print(") ")},tr.prototype.addAll=function(t){for(var e=this,r=t.iterator();r.hasNext();)e.add(r.next())},tr.prototype.findEdgeIndex=function(t){for(var e=this,r=0;r<this._edges.size();r++)if(e._edges.get(r).equals(t))return r;return-1},tr.prototype.iterator=function(){return this._edges.iterator()},tr.prototype.getEdges=function(){return this._edges},tr.prototype.get=function(t){return this._edges.get(t)},tr.prototype.findEqualEdge=function(t){var e=new vn(t.getCoordinates()),r=this._ocaMap.get(e);return r},tr.prototype.add=function(t){this._edges.add(t);var e=new vn(t.getCoordinates());this._ocaMap.put(e,t)},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var Gn=function(){};Gn.prototype.processIntersections=function(t,e,r,i){},Gn.prototype.isDone=function(){},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Te=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Te.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Te.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},Te.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Te.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Te.prototype.getLineIntersector=function(){return this._li},Te.prototype.hasProperIntersection=function(){return this._hasProper},Te.prototype.processIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Te.prototype.hasIntersection=function(){return this._hasIntersection},Te.prototype.isDone=function(){return!1},Te.prototype.hasInteriorIntersection=function(){return this._hasInterior},Te.prototype.interfaces_=function(){return[Gn]},Te.prototype.getClass=function(){return Te},Te.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Er=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],r=arguments[2];this.coord=new m(t),this.segmentIndex=e,this.dist=r};Er.prototype.getSegmentIndex=function(){return this.segmentIndex},Er.prototype.getCoordinate=function(){return this.coord},Er.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Er.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Er.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Er.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Er.prototype.getDistance=function(){return this.dist},Er.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Er.prototype.interfaces_=function(){return[Fe]},Er.prototype.getClass=function(){return Er};var Br=function(){this._nodeMap=new Jt,this.edge=null;var t=arguments[0];this.edge=t};Br.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Br.prototype.iterator=function(){return this._nodeMap.values().iterator()},Br.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},Br.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Br.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],s=e.dist>0||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new m(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r.edge.pts[l];return s&&(a[u]=e.coord),new Jo(a,new nt(this.edge._label))},Br.prototype.add=function(t,e,r){var i=new Er(t,e,r),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)},Br.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br};var zn=function(){};zn.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new R;i.add(new lr(r));do{var o=e.findChainEnd(t,r);i.add(new lr(o)),r=o}while(r<t.length-1);var s=zn.toIntArray(i);return s},zn.prototype.findChainEnd=function(t,e){for(var r=ot.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=ot.quadrant(t[i-1],t[i]);if(o!==r)break;i++}return i-1},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var en=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new F,this.env2=new F;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new zn;this.startIndex=e.getChainStartIndices(this.pts)};en.prototype.getCoordinates=function(){return this.pts},en.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e>r?e:r},en.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e<r?e:r},en.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[r],e.startIndex[r+1],i)}else if(arguments.length===6){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],f=this.pts[o],h=this.pts[s],g=a.pts[u],p=a.pts[l];if(s-o===1&&l-u===1)return c.addIntersections(this.e,o,a.e,u),null;if(this.env1.init(f,h),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var y=Math.trunc((o+s)/2),d=Math.trunc((u+l)/2);o<y&&(u<d&&this.computeIntersectsForChain(o,y,a,u,d,c),d<l&&this.computeIntersectsForChain(o,y,a,d,l,c)),y<s&&(u<d&&this.computeIntersectsForChain(y,s,a,u,d,c),d<l&&this.computeIntersectsForChain(y,s,a,d,l,c))}},en.prototype.getStartIndexes=function(){return this.startIndex},en.prototype.computeIntersects=function(t,e){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)r.computeIntersectsForChain(i,t,o,e)},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en};var qt=function n(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var r=0;r<3;r++)t._depth[e][r]=n.NULL_VALUE},xu={NULL_VALUE:{configurable:!0}};qt.prototype.getDepth=function(t,e){return this._depth[t][e]},qt.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},qt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(t._depth[e][r]!==qt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===qt.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._depth[o][s]===qt.NULL_VALUE}},qt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var r=t._depth[e][1];t._depth[e][2]<r&&(r=t._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>r&&(o=1),t._depth[e][i]=o}}},qt.prototype.getDelta=function(t){return this._depth[t][P.RIGHT]-this._depth[t][P.LEFT]},qt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?_.EXTERIOR:_.INTERIOR},qt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},qt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var o=e.getLocation(r,i);(o===_.EXTERIOR||o===_.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=qt.depthAtLocation(o):t._depth[r][i]+=qt.depthAtLocation(o))}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];u===_.INTERIOR&&this._depth[s][a]++}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.depthAtLocation=function(t){return t===_.EXTERIOR?0:t===_.INTERIOR?1:qt.NULL_VALUE},xu.NULL_VALUE.get=function(){return-1},Object.defineProperties(qt,xu);var Jo=function(n){function t(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new Br(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new qt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,nt.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var o=r;if(this.pts.length!==o.pts.length)return!1;for(var s=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(o.pts[l])||(s=!1),i.pts[l].equals2D(o.pts[--u])||(a=!1),!s&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&r.print(","),r.print(i.pts[o].x+" "+i.pts[o].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)r.print(i.pts[o]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new en(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new F;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,o,s){var a=new m(r.getIntersection(s)),u=i,l=r.getEdgeDistance(o,s),c=u+1;if(c<this.pts.length){var f=this.pts[c];a.equals2D(f)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var r=this,i=new ur;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(r.pts[o].x+" "+r.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(r.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,o){for(var s=this,a=0;a<r.getIntersectionNum();a++)s.addIntersection(r,i,o,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,P.ON),r.getLocation(1,P.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,P.LEFT),r.getLocation(1,P.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,P.RIGHT),r.getLocation(1,P.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},t}(Pe),ue=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new tr,this._bufParams=t||null};ue.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},ue.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new nt(t.getLabel()),i.flip()),r.merge(i);var o=ue.depthDelta(i),s=e.getDepthDelta(),a=s+o;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(ue.depthDelta(t.getLabel()))},ue.prototype.buildSubgraphs=function(t,e){for(var r=new R,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getRightmostCoordinate(),a=new si(r),u=a.getDepth(s);o.computeDepth(u),o.findResultEdges(),r.add(o),e.add(o.getDirectedEdges(),o.getNodes())}},ue.prototype.createSubgraphs=function(t){for(var e=new R,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var o=new se;o.create(i),e.add(o)}}return $e.sort(e,$e.reverseOrder()),e},ue.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},ue.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new qs,r=new Dn;return r.setPrecisionModel(t),e.setSegmentIntersector(new Te(r)),e},ue.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new ve(r,this._bufParams),o=new Ue(t,e,i),s=o.getCurves();if(s.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(s,r),this._graph=new vt(new Su),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new Ce(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},ue.prototype.computeNodedEdges=function(t,e){var r=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),s=o.iterator();s.hasNext();){var a=s.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Jo(a.getCoordinates(),new nt(l));r.insertUniqueEdge(c)}}},ue.prototype.setNoder=function(t){this._workingNoder=t},ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue},ue.depthDelta=function(t){var e=t.getLocation(0,P.LEFT),r=t.getLocation(0,P.RIGHT);return e===_.INTERIOR&&r===_.EXTERIOR?1:e===_.EXTERIOR&&r===_.INTERIOR?-1:0},ue.convertSegStrings=function(t){for(var e=new H,r=new R;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());r.add(o)}return e.buildGeometry(r)};var mn=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=o,this._offsetY=s,this._isScaled=!this.isIntegerPrecision()}};mn.prototype.rescale=function(){var t=this;if(V(arguments[0],Dt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=0;s<o.length;s++)o[s].x=o[s].x/t._scaleFactor+t._offsetX,o[s].y=o[s].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&Ut.out.println(o)}},mn.prototype.scale=function(){var t=this;if(V(arguments[0],Dt)){for(var e=arguments[0],r=new R,i=e.iterator();i.hasNext();){var o=i.next();r.add(new xt(t.scale(o.getCoordinates()),o.getData()))}return r}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=new Array(s.length).fill(null),u=0;u<s.length;u++)a[u]=new m(Math.round((s[u].x-t._offsetX)*t._scaleFactor),Math.round((s[u].y-t._offsetY)*t._scaleFactor),s[u].z);var l=W.removeRepeatedPoints(a);return l}},mn.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},mn.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},mn.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},mn.prototype.interfaces_=function(){return[kn]},mn.prototype.getClass=function(){return mn};var Cr=function(){this._li=new Dn,this._segStrings=null;var t=arguments[0];this._segStrings=t},Lu={fact:{configurable:!0}};Cr.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=s.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(o))throw new Wr("found endpt/interior pt intersection at index "+c+" :pt "+o)}},Cr.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(r,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var f=0;f<l.length-1;f++)t.checkInteriorIntersections(s,c,a,f);else if(arguments.length===4){var h=arguments[0],g=arguments[1],p=arguments[2],y=arguments[3];if(h===p&&g===y)return null;var d=h.getCoordinates()[g],v=h.getCoordinates()[g+1],C=p.getCoordinates()[y],I=p.getCoordinates()[y+1];if(this._li.computeIntersection(d,v,C,I),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,v)||this.hasInteriorIntersection(this._li,C,I)))throw new Wr("found non-noded intersection at "+d+"-"+v+" and "+C+"-"+I)}},Cr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Cr.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length-2;s++)t.checkCollapse(o[s],o[s+1],o[s+2])},Cr.prototype.hasInteriorIntersection=function(t,e,r){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(r)))return!0}return!1},Cr.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new Wr("found non-noded collapse at "+Cr.fact.createLineString([t,e,r]))},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Lu.fact.get=function(){return new H},Object.defineProperties(Cr,Lu);var me=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],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,e<=0)throw new pt("Scale factor must be non-zero");e!==1&&(this._pt=new m(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new m,this._p1Scaled=new m),this.initCorners(this._pt)},bu={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};me.prototype.intersectsScaled=function(t,e){var r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),a=this._maxx<r||this._minx>i||this._maxy<o||this._miny>s;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return X.isTrue(!(a&&u),"Found bad envelope test"),u},me.prototype.initCorners=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 m(this._maxx,this._maxy),this._corner[1]=new m(this._minx,this._maxy),this._corner[2]=new m(this._minx,this._miny),this._corner[3]=new m(this._maxx,this._miny)},me.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},me.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},me.prototype.getCoordinate=function(){return this._originalPt},me.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},me.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=me.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new F(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},me.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},me.prototype.intersectsToleranceSquare=function(t,e){var r=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||r&&i||t.equals(this._pt)||e.equals(this._pt))},me.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},bu.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(me,bu);var Co=function(){this.tempEnv1=new F,this.selectedSegment=new k};Co.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var Fi=function(){this._index=null;var t=arguments[0];this._index=t},wu={HotPixelSnapAction:{configurable:!0}};Fi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),s=new Pu(e,r,i);return this._index.query(o,{interfaces_:function(){return[pn]},visitItem:function(a){var u=a;u.select(o,s)}}),s.isNodeAdded()}},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi},wu.HotPixelSnapAction.get=function(){return Pu},Object.defineProperties(Fi,wu);var Pu=function(n){function t(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],o=r.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return n.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Co),ai=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new R};ai.prototype.processIntersections=function(t,e,r,i){var o=this;if(t===r&&e===i)return null;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];if(this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)o._interiorIntersections.add(o._li.getIntersection(c));t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)}},ai.prototype.isDone=function(){return!1},ai.prototype.getInteriorIntersections=function(){return this._interiorIntersections},ai.prototype.interfaces_=function(){return[Gn]},ai.prototype.getClass=function(){return ai};var Gr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Dn,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Gr.prototype.checkCorrectness=function(t){var e=xt.getNodedSubstrings(t),r=new Cr(e);try{r.checkValid()}catch(i){if(i instanceof uu)i.printStackTrace();else throw i}finally{}},Gr.prototype.getNodedSubstrings=function(){return xt.getNodedSubstrings(this._nodedSegStrings)},Gr.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},Gr.prototype.findInteriorIntersections=function(t,e){var r=new ai(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},Gr.prototype.computeVertexSnaps=function(){var t=this;if(V(arguments[0],Dt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof xt)for(var o=arguments[0],s=o.getCoordinates(),a=0;a<s.length;a++){var u=new me(s[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,o,a);l&&o.addIntersection(s[a],a)}},Gr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new qs,this._pointSnapper=new Fi(this._noder.getIndex()),this.snapRound(t,this._li)},Gr.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),o=new me(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}},Gr.prototype.interfaces_=function(){return[kn]},Gr.prototype.getClass=function(){return Gr};var Xt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new $,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._argGeom=e,this._bufParams=r}},ki={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Xt.prototype.bufferFixedPrecision=function(t){var e=new mn(new Gr(new J(1)),t.getScale()),r=new ue(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.buffer(this._argGeom,this._distance)},Xt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Xt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(s){if(s instanceof Jr)t._saveException=s;else throw s}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Xt.precisionScaleFactor(this._argGeom,this._distance,r),o=new J(i);this.bufferFixedPrecision(o)}},Xt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===J.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Xt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Xt.prototype.bufferOriginalPrecision=function(){try{var t=new ue(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Wr)this._saveException=e;else throw e}finally{}},Xt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Xt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Xt(t),i=r.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof z&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Xt(o);u.setQuadrantSegments(a);var l=u.getResultGeometry(s);return l}else if(arguments[2]instanceof $&&arguments[0]instanceof z&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=arguments[2],g=new Xt(c,h),p=g.getResultGeometry(f);return p}}else if(arguments.length===4){var y=arguments[0],d=arguments[1],v=arguments[2],C=arguments[3],I=new Xt(y);I.setQuadrantSegments(v),I.setEndCapStyle(C);var N=I.getResultGeometry(d);return N}},Xt.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),o=we.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,a=o+2*s,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=r-u,c=Math.pow(10,l);return c},ki.CAP_ROUND.get=function(){return $.CAP_ROUND},ki.CAP_BUTT.get=function(){return $.CAP_FLAT},ki.CAP_FLAT.get=function(){return $.CAP_FLAT},ki.CAP_SQUARE.get=function(){return $.CAP_SQUARE},ki.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Xt,ki);var le=function(){this._pt=[new m,new m],this._distance=U.NaN,this._isNull=!0};le.prototype.getCoordinates=function(){return this._pt},le.prototype.getCoordinate=function(t){return this._pt[t]},le.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},le.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},le.prototype.getDistance=function(){return this._distance},le.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le};var zr=function(){};zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.computeDistance=function(){if(arguments[2]instanceof le&&arguments[0]instanceof yt&&arguments[1]instanceof m)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=t.getCoordinates(),o=new k,s=0;s<i.length-1;s++){o.setCoordinates(i[s],i[s+1]);var a=o.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof le&&arguments[0]instanceof Mt&&arguments[1]instanceof m){var u=arguments[0],l=arguments[1],c=arguments[2];zr.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)zr.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof le&&arguments[0]instanceof z&&arguments[1]instanceof m){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof yt)zr.computeDistance(h,g,p);else if(h instanceof Mt)zr.computeDistance(h,g,p);else if(h instanceof oe)for(var y=h,d=0;d<y.getNumGeometries();d++){var v=y.getGeometryN(d);zr.computeDistance(v,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof le&&arguments[0]instanceof k&&arguments[1]instanceof m){var C=arguments[0],I=arguments[1],N=arguments[2],L=C.closestPoint(I);N.setMinimum(L,I)}};var Vn=function(t){this._maxPtDist=new le,this._inputGeom=t||null},Xs={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Vn.prototype.computeMaxMidpointDistance=function(t){var e=new yn(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vn.prototype.computeMaxVertexDistance=function(t){var e=new ui(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vn.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Vn.prototype.getDistancePoints=function(){return this._maxPtDist},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Xs.MaxPointDistanceFilter.get=function(){return ui},Xs.MaxMidpointDistanceFilter.get=function(){return yn},Object.defineProperties(Vn,Xs);var ui=function(t){this._maxPtDist=new le,this._minPtDist=new le,this._geom=t||null};ui.prototype.filter=function(t){this._minPtDist.initialize(),zr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ui.prototype.getMaxPointDistance=function(){return this._maxPtDist},ui.prototype.interfaces_=function(){return[Tr]},ui.prototype.getClass=function(){return ui};var yn=function(t){this._maxPtDist=new le,this._minPtDist=new le,this._geom=t||null};yn.prototype.filter=function(t,e){if(e===0)return null;var r=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new m((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),zr.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},yn.prototype.isDone=function(){return!1},yn.prototype.isGeometryChanged=function(){return!1},yn.prototype.getMaxPointDistance=function(){return this._maxPtDist},yn.prototype.interfaces_=function(){return[Ze]},yn.prototype.getClass=function(){return yn};var rn=function(t){this._comps=t||null};rn.prototype.filter=function(t){t instanceof Mt&&this._comps.add(t)},rn.prototype.interfaces_=function(){return[gr]},rn.prototype.getClass=function(){return rn},rn.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return rn.getPolygons(t,new R)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Mt?r.add(e):e instanceof oe&&e.apply(new rn(r)),r}};var Yt=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};Yt.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Dr){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof yt&&this._lines.add(t)},Yt.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Yt.prototype.interfaces_=function(){return[Hr]},Yt.prototype.getClass=function(){return Yt},Yt.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Yt.getLines(t))}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e.getFactory().buildGeometry(Yt.getLines(e,r))}},Yt.getLines=function(){if(arguments.length===1){var t=arguments[0];return Yt.getLines(t,!1)}else if(arguments.length===2){if(V(arguments[0],Dt)&&V(arguments[1],Dt)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();Yt.getLines(o,r)}return r}else if(arguments[0]instanceof z&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1],u=new R;return s.apply(new Yt(u,a)),u}else if(arguments[0]instanceof z&&V(arguments[1],Dt)){var l=arguments[0],c=arguments[1];return l instanceof yt?c.add(l):l.apply(new Yt(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&V(arguments[0],Dt)&&V(arguments[1],Dt)){for(var f=arguments[0],h=arguments[1],g=arguments[2],p=f.iterator();p.hasNext();){var y=p.next();Yt.getLines(y,h,g)}return h}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof z&&V(arguments[1],Dt)){var d=arguments[0],v=arguments[1],C=arguments[2];return d.apply(new Yt(v,C)),v}}};var er=function(){if(this._boundaryRule=Be.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new pt("Rule must be non-null");this._boundaryRule=t}}};er.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof m&&arguments[1]instanceof Mt){var e=arguments[0],r=arguments[1];if(r.isEmpty())return _.EXTERIOR;var i=r.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===_.EXTERIOR)return _.EXTERIOR;if(o===_.BOUNDARY)return _.BOUNDARY;for(var s=0;s<r.getNumInteriorRing();s++){var a=r.getInteriorRingN(s),u=t.locateInPolygonRing(e,a);if(u===_.INTERIOR)return _.EXTERIOR;if(u===_.BOUNDARY)return _.BOUNDARY}return _.INTERIOR}else if(arguments[0]instanceof m&&arguments[1]instanceof yt){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return _.EXTERIOR;var f=c.getCoordinates();return!c.isClosed()&&(l.equals(f[0])||l.equals(f[f.length-1]))?_.BOUNDARY:M.isOnLine(l,f)?_.INTERIOR:_.EXTERIOR}else if(arguments[0]instanceof m&&arguments[1]instanceof Ee){var h=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(h)?_.INTERIOR:_.EXTERIOR}},er.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.locatePointInRing(t,e.getCoordinates()):_.EXTERIOR},er.prototype.intersects=function(t,e){return this.locate(t,e)!==_.EXTERIOR},er.prototype.updateLocationInfo=function(t){t===_.INTERIOR&&(this._isIn=!0),t===_.BOUNDARY&&this._numBoundaries++},er.prototype.computeLocation=function(t,e){var r=this;if(e instanceof Ee&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof yt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Mt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Fn)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);r.updateLocationInfo(r.locateInternal(t,s))}else if(e instanceof Mr)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);r.updateLocationInfo(r.locateInternal(t,l))}else if(e instanceof oe)for(var c=new kr(e);c.hasNext();){var f=c.next();f!==e&&r.computeLocation(t,f)}},er.prototype.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:e instanceof yt?this.locateInternal(t,e):e instanceof Mt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?_.BOUNDARY:this._numBoundaries>0||this._isIn?_.INTERIOR:_.EXTERIOR)},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var ce=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];n.call(this,t,n.INSIDE_AREA,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Ou={INSIDE_AREA:{configurable:!0}};ce.prototype.isInsideArea=function(){return this._segIndex===ce.INSIDE_AREA},ce.prototype.getCoordinate=function(){return this._pt},ce.prototype.getGeometryComponent=function(){return this._component},ce.prototype.getSegmentIndex=function(){return this._segIndex},ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},Ou.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ce,Ou);var _n=function(t){this._pts=t||null};_n.prototype.filter=function(t){t instanceof Ee&&this._pts.add(t)},_n.prototype.interfaces_=function(){return[gr]},_n.prototype.getClass=function(){return _n},_n.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof Ee?$e.singletonList(t):_n.getPoints(t,new R)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Ee?r.add(e):e instanceof oe&&e.apply(new _n(r)),r}};var li=function(){this._locations=null;var t=arguments[0];this._locations=t};li.prototype.filter=function(t){(t instanceof Ee||t instanceof yt||t instanceof Mt)&&this._locations.add(new ce(t,0,t.getCoordinate()))},li.prototype.interfaces_=function(){return[gr]},li.prototype.getClass=function(){return li},li.getLocations=function(t){var e=new R;return t.apply(new li(e)),e};var Wt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new er,this._minDistanceLocation=null,this._minDistance=U.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=o}};Wt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=1-r,s=rn.getPolygons(this._geom[r]);if(s.size()>0){var a=li.getLocations(this._geom[o]);if(this.computeContainmentDistance(a,s,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&V(arguments[0],Ke)&&V(arguments[1],Ke)){for(var u=arguments[0],l=arguments[1],c=arguments[2],f=0;f<u.size();f++)for(var h=u.get(f),g=0;g<l.size();g++)if(t.computeContainmentDistance(h,l.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ce&&arguments[1]instanceof Mt){var p=arguments[0],y=arguments[1],d=arguments[2],v=p.getCoordinate();if(_.EXTERIOR!==this._ptLocator.locate(v,y))return this._minDistance=0,d[0]=p,d[1]=new ce(y,v),null}}},Wt.prototype.computeMinDistanceLinesPoints=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,r),i._minDistance<=i._terminateDistance)return null}},Wt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Yt.getLines(this._geom[0]),r=Yt.getLines(this._geom[1]),i=_n.getPoints(this._geom[0]),o=_n.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)},Wt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Wt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Wt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Wt.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof yt&&arguments[1]instanceof Ee){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),s=r.getCoordinate(),a=0;a<o.length-1;a++){var u=M.distancePointLine(s,o[a],o[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new k(o[a],o[a+1]),c=l.closestPoint(s);i[0]=new ce(e,a,c),i[1]=new ce(r,0,s)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof yt&&arguments[1]instanceof yt){var f=arguments[0],h=arguments[1],g=arguments[2];if(f.getEnvelopeInternal().distance(h.getEnvelopeInternal())>this._minDistance)return null;for(var p=f.getCoordinates(),y=h.getCoordinates(),d=0;d<p.length-1;d++)for(var v=0;v<y.length-1;v++){var C=M.distanceLineLine(p[d],p[d+1],y[v],y[v+1]);if(C<t._minDistance){t._minDistance=C;var I=new k(p[d],p[d+1]),N=new k(y[v],y[v+1]),L=I.closestPoints(N);g[0]=new ce(f,d,L[0]),g[1]=new ce(h,v,L[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Wt.prototype.computeMinDistancePoints=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a),l=s.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,r[0]=new ce(s,0,s.getCoordinate()),r[1]=new ce(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Wt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new pt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Wt.prototype.computeMinDistanceLines=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,r),i._minDistance<=i._terminateDistance)return null}},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.distance=function(t,e){var r=new Wt(t,e);return r.distance()},Wt.isWithinDistance=function(t,e,r){var i=new Wt(t,e,r);return i.distance()<=r},Wt.nearestPoints=function(t,e){var r=new Wt(t,e);return r.nearestPoints()};var ee=function(){this._pt=[new m,new m],this._distance=U.NaN,this._isNull=!0};ee.prototype.getCoordinates=function(){return this._pt},ee.prototype.getCoordinate=function(t){return this._pt[t]},ee.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},ee.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},ee.prototype.toString=function(){return je.toLineString(this._pt[0],this._pt[1])},ee.prototype.getDistance=function(){return this._distance},ee.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},ee.prototype.interfaces_=function(){return[]},ee.prototype.getClass=function(){return ee};var Ir=function(){};Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir},Ir.computeDistance=function(){if(arguments[2]instanceof ee&&arguments[0]instanceof yt&&arguments[1]instanceof m)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=new k,o=t.getCoordinates(),s=0;s<o.length-1;s++){i.setCoordinates(o[s],o[s+1]);var a=i.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof ee&&arguments[0]instanceof Mt&&arguments[1]instanceof m){var u=arguments[0],l=arguments[1],c=arguments[2];Ir.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)Ir.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof ee&&arguments[0]instanceof z&&arguments[1]instanceof m){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof yt)Ir.computeDistance(h,g,p);else if(h instanceof Mt)Ir.computeDistance(h,g,p);else if(h instanceof oe)for(var y=h,d=0;d<y.getNumGeometries();d++){var v=y.getGeometryN(d);Ir.computeDistance(v,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof ee&&arguments[0]instanceof k&&arguments[1]instanceof m){var C=arguments[0],I=arguments[1],N=arguments[2],L=C.closestPoint(I);N.setMinimum(L,I)}};var qe=function(){this._g0=null,this._g1=null,this._ptDist=new ee,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Ys={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};qe.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},qe.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new pt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},qe.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},qe.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},qe.prototype.computeOrientedDistance=function(t,e,r){var i=new ci(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new En(e,this._densifyFrac);t.apply(o),r.setMaximum(o.getMaxPointDistance())}},qe.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new qe(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new qe(i,o);return a.setDensifyFraction(s),a.distance()}},Ys.MaxPointDistanceFilter.get=function(){return ci},Ys.MaxDensifiedByFractionDistanceFilter.get=function(){return En},Object.defineProperties(qe,Ys);var ci=function(){this._maxPtDist=new ee,this._minPtDist=new ee,this._euclideanDist=new Ir,this._geom=null;var t=arguments[0];this._geom=t};ci.prototype.filter=function(t){this._minPtDist.initialize(),Ir.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ci.prototype.getMaxPointDistance=function(){return this._maxPtDist},ci.prototype.interfaces_=function(){return[Tr]},ci.prototype.getClass=function(){return ci};var En=function(){this._maxPtDist=new ee,this._minPtDist=new ee,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};En.prototype.filter=function(t,e){var r=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),s=(o.x-i.x)/this._numSubSegs,a=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*s,c=i.y+u*a,f=new m(l,c);r._minPtDist.initialize(),Ir.computeDistance(r._geom,f,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},En.prototype.isDone=function(){return!1},En.prototype.isGeometryChanged=function(){return!1},En.prototype.getMaxPointDistance=function(){return this._maxPtDist},En.prototype.interfaces_=function(){return[Ze]},En.prototype.getClass=function(){return En};var Ne=function(t,e,r){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=r||null},Ws={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Ne.prototype.checkMaximumDistance=function(t,e,r){var i=new qe(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+je.toLineString(o[0],o[1])+")"}},Ne.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Ne.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Ne.VERBOSE&&Ut.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Ne.prototype.checkNegativeValid=function(){if(!(this._input instanceof Mt||this._input instanceof Mr||this._input instanceof oe))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Ne.prototype.getErrorIndicator=function(){return this._errorIndicator},Ne.prototype.checkMinimumDistance=function(t,e,r){var i=new Wt(t,e,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+je.toLineString(o[0],o[1])+" )"}},Ne.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Ne.prototype.getErrorLocation=function(){return this._errorLocation},Ne.prototype.getPolygonLines=function(t){for(var e=new R,r=new Yt(e),i=rn.getPolygons(t),o=i.iterator();o.hasNext();){var s=o.next();s.apply(r)}return t.getFactory().buildGeometry(e)},Ne.prototype.getErrorMessage=function(){return this._errMsg},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ws.VERBOSE.get=function(){return!1},Ws.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ne,Ws);var Ht=function(t,e,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=r||null},Hs={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Ht.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Ht.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Ht.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new F(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new F(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},Ht.prototype.checkDistance=function(){var t=new Ne(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Ht.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Ht.prototype.checkPolygonal=function(){this._result instanceof Mt||this._result instanceof Mr||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Ht.prototype.getErrorIndicator=function(){return this._errorIndicator},Ht.prototype.getErrorLocation=function(){return this._errorLocation},Ht.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Ht.prototype.report=function(t){if(!Ht.VERBOSE)return null;Ut.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ht.prototype.getErrorMessage=function(){return this._errorMsg},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.isValidMsg=function(t,e,r){var i=new Ht(t,e,r);return i.isValid()?null:i.getErrorMessage()},Ht.isValid=function(t,e,r){var i=new Ht(t,e,r);return!!i.isValid()},Hs.VERBOSE.get=function(){return!1},Hs.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ht,Hs);var Nr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Nr.prototype.getCoordinates=function(){return this._pts},Nr.prototype.size=function(){return this._pts.length},Nr.prototype.getCoordinate=function(t){return this._pts[t]},Nr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Nr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ii.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Nr.prototype.setData=function(t){this._data=t},Nr.prototype.getData=function(){return this._data},Nr.prototype.toString=function(){return je.toLineString(new St(this._pts))},Nr.prototype.interfaces_=function(){return[Fr]},Nr.prototype.getClass=function(){return Nr};var zt=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new R,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zt.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zt.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zt.prototype.getIntersectionSegments=function(){return this._intSegments},zt.prototype.count=function(){return this._intersectionCount},zt.prototype.getIntersections=function(){return this._intersections},zt.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zt.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zt.prototype.processIntersections=function(t,e,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(r,i);if(!o)return null}var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=s,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zt.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},zt.prototype.hasIntersection=function(){return this._interiorIntersection!==null},zt.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},zt.prototype.interfaces_=function(){return[Gn]},zt.prototype.getClass=function(){return zt},zt.createAllIntersectionsFinder=function(t){var e=new zt(t);return e.setFindAllIntersections(!0),e},zt.createAnyIntersectionFinder=function(t){return new zt(t)},zt.createIntersectionCounter=function(t){var e=new zt(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var rr=function(){this._li=new Dn,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};rr.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},rr.prototype.getIntersections=function(){return this._segInt.getIntersections()},rr.prototype.isValid=function(){return this.execute(),this._isValid},rr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},rr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new qs;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},rr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Jr(this.getErrorMessage(),this._segInt.getInteriorIntersection())},rr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+je.toLineString(t[0],t[1])+" and "+je.toLineString(t[2],t[3])},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.computeIntersections=function(t){var e=new rr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Un=function n(){this._nv=null;var t=arguments[0];this._nv=new rr(n.toSegmentStrings(t))};Un.prototype.checkValid=function(){this._nv.checkValid()},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},Un.toSegmentStrings=function(t){for(var e=new R,r=t.iterator();r.hasNext();){var i=r.next();e.add(new Nr(i.getCoordinates(),i))}return e},Un.checkValid=function(t){var e=new Un(t);e.checkValid()};var fi=function(t){this._mapOp=t};fi.prototype.map=function(t){for(var e=this,r=new R,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||r.add(o)}return t.getFactory().createGeometryCollection(H.toGeometryArray(r))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},fi.map=function(t,e){var r=new fi(e);return r.map(t)};var Sr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new R,this._resultLineList=new R;var t=arguments[0],e=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=r};Sr.prototype.collectLines=function(t){for(var e=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},Sr.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},Sr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Sr.prototype.collectLineEdge=function(t,e,r){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&q.isResultOfOp(i,e)&&!o.isCovered()&&(r.add(o),t.setVisitedEdge(!0))},Sr.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var r=e.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getEdge();if(o.isLineEdge()&&!s.isCoveredSet()){var a=t._op.isCoveredByA(o.getCoordinate());s.setCovered(a)}}},Sr.prototype.labelIsolatedLines=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},Sr.prototype.buildLines=function(t){for(var e=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}},Sr.prototype.collectBoundaryTouchEdge=function(t,e,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;X.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),q.isResultOfOp(i,e)&&e===q.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var hi=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new R;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};hi.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},hi.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===q.INTERSECTION)){var o=i.getLabel();q.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}},hi.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var ye=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};ye.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},ye.prototype.transformPolygon=function(t,e){var r=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof Dr)||o.isEmpty())&&(i=!1);for(var s=new R,a=0;a<t.getNumInteriorRing();a++){var u=r.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof Dr||(i=!1),s.add(u))}if(i)return this._factory.createPolygon(o,s.toArray([]));var l=new R;return o!==null&&l.add(o),l.addAll(s),this._factory.buildGeometry(l)},ye.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},ye.prototype.getInputGeometry=function(){return this._inputGeom},ye.prototype.transformMultiLineString=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transformLineString(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ye.prototype.transformCoordinates=function(t,e){return this.copy(t)},ye.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},ye.prototype.transformMultiPoint=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transformPoint(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ye.prototype.transformMultiPolygon=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transformPolygon(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ye.prototype.copy=function(t){return t.copy()},ye.prototype.transformGeometryCollection=function(t,e){for(var r=this,i=new R,o=0;o<t.getNumGeometries();o++){var s=r.transform(t.getGeometryN(o));s!==null&&(r._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(H.toGeometryArray(i)):this._factory.buildGeometry(i)},ye.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Ee)return this.transformPoint(t,null);if(t instanceof Ri)return this.transformMultiPoint(t,null);if(t instanceof Dr)return this.transformLinearRing(t,null);if(t instanceof yt)return this.transformLineString(t,null);if(t instanceof Fn)return this.transformMultiLineString(t,null);if(t instanceof Mt)return this.transformPolygon(t,null);if(t instanceof Mr)return this.transformMultiPolygon(t,null);if(t instanceof oe)return this.transformGeometryCollection(t,null);throw new pt("Unknown Geometry subtype: "+t.getClass().getName())},ye.prototype.transformLinearRing=function(t,e){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye};var Vr=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new k,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof yt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];n.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};Vr.prototype.snapVertices=function(t,e){for(var r=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var s=t.get(o),a=r.findSnapForVertex(s,e);a!==null&&(t.set(o,new m(a)),o===0&&r._isClosed&&t.set(t.size()-1,new m(a)))}},Vr.prototype.findSnapForVertex=function(t,e){for(var r=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<r._snapTolerance)return e[i]}return null},Vr.prototype.snapTo=function(t){var e=new so(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},Vr.prototype.snapSegments=function(t,e){var r=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var s=e[o],a=r.findSegmentIndexToSnap(s,t);a>=0&&t.add(a+1,new m(s),!1)}},Vr.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=U.MAX_VALUE,o=-1,s=0;s<e.size()-1;s++){if(r._seg.p0=e.get(s),r._seg.p1=e.get(s+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var a=r._seg.distance(t);a<r._snapTolerance&&a<i&&(i=a,o=s)}return o},Vr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Lt=function(t){this._srcGeom=t||null},Ru={SNAP_PRECISION_FACTOR:{configurable:!0}};Lt.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Tu(e,r);return i.transform(this._srcGeom)},Lt.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Tu(t,r,!0),o=i.transform(this._srcGeom),s=o;return e&&V(s,gn)&&(s=o.buffer(0)),s},Lt.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},Lt.prototype.extractTargetCoordinates=function(t){for(var e=new hr,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},Lt.prototype.computeMinimumSegmentLength=function(t){for(var e=U.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.snap=function(t,e,r){var i=new Array(2).fill(null),o=new Lt(t);i[0]=o.snapTo(e,r);var s=new Lt(e);return i[1]=s.snapTo(i[0],r),i},Lt.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Lt.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===J.FIXED){var i=1/r.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return Math.min(Lt.computeOverlaySnapTolerance(o),Lt.computeOverlaySnapTolerance(s))}},Lt.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*Lt.SNAP_PRECISION_FACTOR;return i},Lt.snapToSelf=function(t,e,r){var i=new Lt(t);return i.snapToSelf(e,r)},Ru.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Lt,Ru);var Tu=function(n){function t(e,r,i){n.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var o=new Vr(r,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var o=r.toCoordinateArray(),s=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ye),fe=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};fe.prototype.getCommon=function(){return U.longBitsToDouble(this._commonBits)},fe.prototype.add=function(t){var e=U.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=fe.signExpBits(this._commonBits),this._isFirst=!1,null;var r=fe.signExpBits(e);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=fe.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=fe.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},fe.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=U.longBitsToDouble(t),r=U.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,o=i.substring(i.length-64),s=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return s}},fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.getBit=function(t,e){var r=1<<e;return t&r?1:0},fe.signExpBits=function(t){return t>>52},fe.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,o=t&i;return o},fe.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(fe.getBit(t,i)!==fe.getBit(e,i))return r;r++}return 52};var Cn=function(){this._commonCoord=null,this._ccFilter=new gi},js={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Cn.prototype.addCommonBits=function(t){var e=new In(this._commonCoord);t.apply(e),t.geometryChanged()},Cn.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new m(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new In(e);return t.apply(r),t.geometryChanged(),t},Cn.prototype.getCommonCoordinate=function(){return this._commonCoord},Cn.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},js.CommonCoordinateFilter.get=function(){return gi},js.Translater.get=function(){return In},Object.defineProperties(Cn,js);var gi=function(){this._commonBitsX=new fe,this._commonBitsY=new fe};gi.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},gi.prototype.getCommonCoordinate=function(){return new m(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},gi.prototype.interfaces_=function(){return[Tr]},gi.prototype.getClass=function(){return gi};var In=function(){this.trans=null;var t=arguments[0];this.trans=t};In.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,i)},In.prototype.isDone=function(){return!1},In.prototype.isGeometryChanged=function(){return!0},In.prototype.interfaces_=function(){return[Ze]},In.prototype.getClass=function(){return In};var Vt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Vt.prototype.selfSnap=function(t){var e=new Lt(t),r=e.snapTo(t,this._snapTolerance);return r},Vt.prototype.removeCommonBits=function(t){this._cbr=new Cn,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Vt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Vt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=q.overlayOp(e[0],e[1],t);return this.prepareResult(r)},Vt.prototype.checkValid=function(t){t.isValid()||Ut.out.println("Snapped geometry is invalid")},Vt.prototype.computeSnapTolerance=function(){this._snapTolerance=Lt.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Vt.prototype.snap=function(t){var e=this.removeCommonBits(t),r=Lt.snap(e[0],e[1],this._snapTolerance);return r},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.overlayOp=function(t,e,r){var i=new Vt(t,e);return i.getResultGeometry(r)},Vt.union=function(t,e){return Vt.overlayOp(t,e,q.UNION)},Vt.intersection=function(t,e){return Vt.overlayOp(t,e,q.INTERSECTION)},Vt.symDifference=function(t,e){return Vt.overlayOp(t,e,q.SYMDIFFERENCE)},Vt.difference=function(t,e){return Vt.overlayOp(t,e,q.DIFFERENCE)};var he=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};he.prototype.getResultGeometry=function(t){var e=null,r=!1,i=null;try{e=q.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(r=!0)}catch(s){if(s instanceof Wr)i=s;else throw s}finally{}if(!r)try{e=Vt.overlayOp(this._geom[0],this._geom[1],t)}catch(s){throw s instanceof Wr?i:s}finally{}return e},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.overlayOp=function(t,e,r){var i=new he(t,e);return i.getResultGeometry(r)},he.union=function(t,e){return he.overlayOp(t,e,q.UNION)},he.intersection=function(t,e){return he.overlayOp(t,e,q.INTERSECTION)},he.symDifference=function(t,e){return he.overlayOp(t,e,q.SYMDIFFERENCE)},he.difference=function(t,e){return he.overlayOp(t,e,q.DIFFERENCE)};var Io=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Io.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var Se=function n(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=n.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=o}},Ks={INSERT:{configurable:!0},DELETE:{configurable:!0}};Se.prototype.isDelete=function(){return this._eventType===Se.DELETE},Se.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Se.prototype.getObject=function(){return this._obj},Se.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},Se.prototype.getInsertEvent=function(){return this._insertEvent},Se.prototype.isInsert=function(){return this._eventType===Se.INSERT},Se.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Se.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Se.prototype.interfaces_=function(){return[Fe]},Se.prototype.getClass=function(){return Se},Ks.INSERT.get=function(){return 1},Ks.DELETE.get=function(){return 2},Object.defineProperties(Se,Ks);var $o=function(){};$o.prototype.interfaces_=function(){return[]},$o.prototype.getClass=function(){return $o};var jt=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};jt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(jt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},jt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},jt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},jt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},jt.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1},jt.prototype.hasProperIntersection=function(){return this._hasProper},jt.prototype.hasIntersection=function(){return this._hasIntersection},jt.prototype.isDone=function(){return this._isDone},jt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},jt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},jt.prototype.addIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var mf=function(n){function t(){n.call(this),this.events=new R,this.nOverlaps=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;$e.sort(this.events);for(var i=0;i<this.events.size();i++){var o=r.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var s=r.events.get(o);if(s.isInsert()&&r.processOverlaps(o,s.getDeleteEventIndex(),s,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof jt&&V(arguments[0],Ke)&&V(arguments[1],Ke)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&V(arguments[0],Ke)&&arguments[1]instanceof jt){var c=arguments[0],f=arguments[1],h=arguments[2];h?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(f)}}},t.prototype.addEdge=function(r,i){for(var o=this,s=r.getMonotoneChainEdge(),a=s.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Io(s,u),c=new Se(i,s.getMinX(u),l);o.events.add(c),o.events.add(new Se(s.getMaxX(u),c))}},t.prototype.processOverlaps=function(r,i,o,s){for(var a=this,u=o.getObject(),l=r;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var f=c.getObject();o.isSameLabel(c)||(u.computeIntersections(f,s),a.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var s=o.next();r.addEdge(s,s)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();r.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}($o),Ur=function(){this._min=U.POSITIVE_INFINITY,this._max=U.NEGATIVE_INFINITY},Du={NodeComparator:{configurable:!0}};Ur.prototype.getMin=function(){return this._min},Ur.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Ur.prototype.getMax=function(){return this._max},Ur.prototype.toString=function(){return je.toLineString(new m(this._min,0),new m(this._max,0))},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Du.NodeComparator.get=function(){return No},Object.defineProperties(Ur,Du);var No=function(){};No.prototype.compare=function(t,e){var r=t,i=e,o=(r._min+r._max)/2,s=(i._min+i._max)/2;return o<s?-1:o>s?1:0},No.prototype.interfaces_=function(){return[Ei]},No.prototype.getClass=function(){return No};var yf=function(n){function t(){n.call(this),this._item=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._min=e,this._max=r,this._item=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,o){if(!this.intersects(r,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ur),_f=function(n){function t(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,o){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,o),this._node2!==null&&this._node2.query(r,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ur),qr=function(){this._leaves=new R,this._root=null,this._level=0};qr.prototype.buildTree=function(){var t=this;$e.sort(this._leaves,new Ur.NodeComparator);for(var e=this._leaves,r=null,i=new R;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);r=e,e=i,i=r}},qr.prototype.insert=function(t,e,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new yf(t,e,r))},qr.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},qr.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},qr.prototype.printNode=function(t){Ut.out.println(je.toLineString(new m(t._min,this._level),new m(t._max,this._level)))},qr.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},qr.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),o=r+1<t.size()?t.get(r):null;if(o===null)e.add(i);else{var s=new _f(t.get(r),t.get(r+1));e.add(s)}}},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var Bi=function(){this._items=new R};Bi.prototype.visitItem=function(t){this._items.add(t)},Bi.prototype.getItems=function(){return this._items},Bi.prototype.interfaces_=function(){return[pn]},Bi.prototype.getClass=function(){return Bi};var Gi=function(){this._index=null;var t=arguments[0];if(!V(t,gn))throw new pt("Argument must be Polygonal");this._index=new qn(t)},Qs={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Gi.prototype.locate=function(t){var e=new fr(t),r=new zi(e);return this._index.query(t.y,t.y,r),e.getLocation()},Gi.prototype.interfaces_=function(){return[Ai]},Gi.prototype.getClass=function(){return Gi},Qs.SegmentVisitor.get=function(){return zi},Qs.IntervalIndexedGeometry.get=function(){return qn},Object.defineProperties(Gi,Qs);var zi=function(){this._counter=null;var t=arguments[0];this._counter=t};zi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},zi.prototype.interfaces_=function(){return[pn]},zi.prototype.getClass=function(){return zi};var qn=function(){this._index=new qr;var t=arguments[0];this.init(t)};qn.prototype.init=function(t){for(var e=this,r=Yt.getLines(t),i=r.iterator();i.hasNext();){var o=i.next(),s=o.getCoordinates();e.addLine(s)}},qn.prototype.addLine=function(t){for(var e=this,r=1;r<t.length;r++){var i=new k(t[r-1],t[r]),o=Math.min(i.p0.y,i.p1.y),s=Math.max(i.p0.y,i.p1.y);e._index.insert(o,s,i)}},qn.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Bi;return this._index.query(t,e,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];this._index.query(i,o,s)}},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn};var So=function(n){function t(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new pu,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new er,arguments.length===2){var e=arguments[0],r=arguments[1],i=Be.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var o=this._nodes.addNode(i),s=o.getLabel(),a=1,u=_.NONE;u=s.getLocation(r,P.ON),u===_.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);s.setLocation(r,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new jt(o,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Dr||this._parentGeom instanceof Mt||this._parentGeom instanceof Mr,f=s||!c;return l.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,o){var s=new jt(i,o,!0);s.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,r._edges,s),s},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof Ee){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,_.INTERIOR)}else if(arguments[0]instanceof m){var o=arguments[0];this.insertPoint(this._argIndex,o,_.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),_.EXTERIOR,_.INTERIOR);for(var o=0;o<r.getNumInteriorRing();o++){var s=r.getInteriorRingN(o);i.addPolygonRing(s,_.INTERIOR,_.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],_.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],_.BOUNDARY)},t.prototype.addLineString=function(r){var i=W.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Jo(i,new nt(this._argIndex,_.INTERIOR));this._lineEdgeMap.put(r,o),this.insertEdge(o),X.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),o=0,s=r.iterator();s.hasNext();){var a=s.next();i[o++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(r,i,o){if(this.isBoundaryNode(r,i))return null;o===_.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,o)},t.prototype.addPolygonRing=function(r,i,o){if(r.isEmpty())return null;var s=W.removeRepeatedPoints(r.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;var a=i,u=o;M.isCCW(s)&&(a=o,u=i);var l=new Jo(s,new nt(this._argIndex,_.BOUNDARY,a,u));this._lineEdgeMap.put(r,l),this.insertEdge(l),this.insertPoint(this._argIndex,s[0],_.BOUNDARY)},t.prototype.insertPoint=function(r,i,o){var s=this._nodes.addNode(i),a=s.getLabel();a===null?s._label=new nt(r,o):a.setLocation(r,o)},t.prototype.createEdgeSetIntersector=function(){return new mf},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel().getLocation(r),u=s.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(r,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof Mr&&(this._useBoundaryDeterminationRule=!1),r instanceof Mt)this.addPolygon(r);else if(r instanceof yt)this.addLineString(r);else if(r instanceof Ee)this.addPoint(r);else if(r instanceof Ri)this.addCollection(r);else if(r instanceof Fn)this.addCollection(r);else if(r instanceof Mr)this.addCollection(r);else if(r instanceof oe)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,o=0;o<r.getNumGeometries();o++){var s=r.getGeometryN(o);i.add(s)}},t.prototype.locate=function(r){return V(this._parentGeom,gn)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Gi(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?_.BOUNDARY:_.INTERIOR},t}(vt),Vi=function(){if(this._li=new Dn,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new So(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Be.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new So(0,e,i),this._arg[1]=new So(1,r,i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];o.getPrecisionModel().compareTo(s.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new So(0,o,a),this._arg[1]=new So(1,s,a)}};Vi.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Vi.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi};var Xn=function(){};Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn},Xn.map=function(){if(arguments[0]instanceof z&&V(arguments[1],Xn.MapOp)){for(var t=arguments[0],e=arguments[1],r=new R,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&r.add(o)}return t.getFactory().buildGeometry(r)}else if(V(arguments[0],Dt)&&V(arguments[1],Xn.MapOp)){for(var s=arguments[0],a=arguments[1],u=new R,l=s.iterator();l.hasNext();){var c=l.next(),f=a.map(c);f!==null&&u.add(f)}return u}},Xn.MapOp=function(){};var q=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r),this._ptLocator=new er,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new tr,this._resultPolyList=new R,this._resultLineList=new R,this._resultPointList=new R,this._graph=new vt(new Su),this._geomFact=e.getFactory()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var o=i.getLabel(),s=r.getLabel();i.isPointwiseEqual(r)||(s=new nt(r.getLabel()),s.flip());var a=i.getDepth();a.isNull()&&a.add(o),a.add(s),o.merge(s)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,o,s){var a=new R;return a.addAll(r),a.addAll(i),a.addAll(o),a.isEmpty()?t.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var o=this,s=i.iterator();s.hasNext();){var a=s.next(),u=o._ptLocator.locate(r,a);if(u!==_.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new R,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),r.add(o.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,o=r.iterator();o.hasNext();){var s=o.next();i.insertUniqueEdge(s)}},t.prototype.computeOverlay=function(r){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new R;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Un.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var o=new Ce(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var s=new Sr(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(r);var a=new hi(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var o=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(r){for(var i=this,o=this._arg[r].getNodeIterator();o.hasNext();){var s=o.next(),a=i._graph.addNode(s.getCoordinate());a.setLabel(r,s.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(s.getLocation(0,P.RIGHT),s.getLocation(1,P.RIGHT),r)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),o=i.getLabel(),s=i.getDepth();if(!s.isNull()){s.normalize();for(var a=0;a<2;a++)!o.isNull(a)&&o.isArea()&&!s.isNull(a)&&(s.getDelta(a)===0?o.toLine(a):(X.isTrue(!s.isNull(a,P.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(a,P.LEFT,s.getLocation(a,P.LEFT)),X.isTrue(!s.isNull(a,P.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(a,P.RIGHT,s.getLocation(a,P.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();o.isIsolated()&&(s.isNull(0)?r.labelIncompleteNode(o,0):r.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(s)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Vi);q.overlayOp=function(n,t,e){var r=new q(n,t),i=r.getResultGeometry(e);return i},q.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return q.createEmptyResult(q.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var e=t;return fi.map(n,{interfaces_:function(){return[Xn.MapOp]},map:function(r){return r.intersection(e)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),he.overlayOp(n,t,q.INTERSECTION)},q.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return q.createEmptyResult(q.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),he.overlayOp(n,t,q.SYMDIFFERENCE)},q.resultDimension=function(n,t,e){var r=t.getDimension(),i=e.getDimension(),o=-1;switch(n){case q.INTERSECTION:o=Math.min(r,i);break;case q.UNION:o=Math.max(r,i);break;case q.DIFFERENCE:o=r;break;case q.SYMDIFFERENCE:o=Math.max(r,i);break}return o},q.createEmptyResult=function(n,t,e,r){var i=null;switch(q.resultDimension(n,t,e)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},q.difference=function(n,t){return n.isEmpty()?q.createEmptyResult(q.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),he.overlayOp(n,t,q.DIFFERENCE))},q.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],t=arguments[1],e=n.getLocation(0),r=n.getLocation(1);return q.isResultOfOp(e,r,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===_.BOUNDARY&&(i=_.INTERIOR),o===_.BOUNDARY&&(o=_.INTERIOR),s){case q.INTERSECTION:return i===_.INTERIOR&&o===_.INTERIOR;case q.UNION:return i===_.INTERIOR||o===_.INTERIOR;case q.DIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR;case q.SYMDIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR||i!==_.INTERIOR&&o===_.INTERIOR}return!1}},q.INTERSECTION=1,q.UNION=2,q.DIFFERENCE=3,q.SYMDIFFERENCE=4;var Nn=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new er,this._seg=new k;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Nn.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=e._linework.getGeometryN(r),o=i.getCoordinateSequence(),s=0;s<o.size()-1;s++){o.getCoordinate(s,e._seg.p0),o.getCoordinate(s+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},Nn.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?_.BOUNDARY:this._ptLocator.locate(t,this._g)},Nn.prototype.extractLinework=function(t){var e=new Ui;t.apply(e);var r=e.getLinework(),i=H.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn};var Ui=function(){this._linework=null,this._linework=new R};Ui.prototype.getLinework=function(){return this._linework},Ui.prototype.filter=function(t){var e=this;if(t instanceof Mt){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},Ui.prototype.interfaces_=function(){return[gr]},Ui.prototype.getClass=function(){return Ui};var Yn=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Yn.prototype.extractPoints=function(t,e,r){for(var i=this,o=t.getCoordinates(),s=0;s<o.length-1;s++)i.computeOffsetPoints(o[s],o[s+1],e,r)},Yn.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Yn.prototype.getPoints=function(t){for(var e=this,r=new R,i=Yt.getLines(this._g),o=i.iterator();o.hasNext();){var s=o.next();e.extractPoints(s,t,r)}return r},Yn.prototype.computeOffsetPoints=function(t,e,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.sqrt(o*o+s*s),u=r*o/a,l=r*s/a,c=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var h=new m(c-l,f+u);i.add(h)}if(this._doRight){var g=new m(c+l,f-u);i.add(g)}},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var De=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new R;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,r],this._locFinder=[new Nn(this._geom[0],this._boundaryDistanceTolerance),new Nn(this._geom[1],this._boundaryDistanceTolerance),new Nn(this._geom[2],this._boundaryDistanceTolerance)]},Mu={TOLERANCE:{configurable:!0}};De.prototype.reportResult=function(t,e,r){Ut.out.println("Overlay result invalid - A:"+_.toLocationSymbol(e[0])+" B:"+_.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+_.toLocationSymbol(e[2]))},De.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},De.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._location[0]=this._locFinder[0].getLocation(s),this._location[1]=this._locFinder[1].getLocation(s),this._location[2]=this._locFinder[2].getLocation(s),De.hasLocation(this._location,_.BOUNDARY)?!0:this.isValidResult(o,this._location)}},De.prototype.addTestPts=function(t){var e=new Yn(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},De.prototype.isValidResult=function(t,e){var r=q.isResultOfOp(e[0],e[1],t),i=e[2]===_.INTERIOR,o=!(r^i);return o||this.reportResult(t,e,r),o},De.prototype.getInvalidLocation=function(){return this._invalidLocation},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},De.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Lt.computeSizeBasedSnapTolerance(t),Lt.computeSizeBasedSnapTolerance(e))},De.isValid=function(t,e,r,i){var o=new De(t,e,i);return o.isValid(r)},Mu.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(De,Mu);var Me=function n(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(t),this._inputGeoms=t};Me.prototype.extractElements=function(t,e){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);r._skipEmpty&&o.isEmpty()||e.add(o)}},Me.prototype.combine=function(){for(var t=this,e=new R,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Me(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=new Me(Me.createList(r,i));return o.combine()}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2],l=new Me(Me.createList(s,a,u));return l.combine()}},Me.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Me.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new R;return r.add(t),r.add(e),r}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new R;return a.add(i),a.add(o),a.add(s),a}};var Rt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new R)},Au={STRTREE_NODE_CAPACITY:{configurable:!0}};Rt.prototype.reduceToGeometries=function(t){for(var e=this,r=new R,i=t.iterator();i.hasNext();){var o=i.next(),s=null;V(o,Ke)?s=e.unionTree(o):o instanceof z&&(s=o),r.add(s)}return r},Rt.prototype.extractByEnvelope=function(t,e,r){for(var i=new R,o=0;o<e.getNumGeometries();o++){var s=e.getGeometryN(o);s.getEnvelopeInternal().intersects(t)?i.add(s):r.add(s)}return this._geomFactory.buildGeometry(i)},Rt.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var o=Me.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var s=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,s)},Rt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new yu(Rt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var r=e.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o},Rt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2];if(i-r<=1){var o=Rt.getGeometry(e,r);return this.unionSafe(o,null)}else{if(i-r===2)return this.unionSafe(Rt.getGeometry(e,r),Rt.getGeometry(e,r+1));var s=Math.trunc((i+r)/2),a=this.binaryUnion(e,r,s),u=this.binaryUnion(e,s,i);return this.unionSafe(a,u)}}},Rt.prototype.repeatedUnion=function(t){for(var e=null,r=t.iterator();r.hasNext();){var i=r.next();e===null?e=i.copy():e=e.union(i)}return e},Rt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Rt.prototype.unionActual=function(t,e){return Rt.restrictToPolygons(t.union(e))},Rt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),r=this.binaryUnion(e);return r},Rt.prototype.unionUsingEnvelopeIntersection=function(t,e,r){var i=new R,o=this.extractByEnvelope(r,t,i),s=this.extractByEnvelope(r,e,i),a=this.unionActual(o,s);i.add(a);var u=Me.combine(i);return u},Rt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),r=e.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o.getFactory(),u=a.createGeometryCollection([o,s]),l=u.buffer(0);return l}},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},Rt.restrictToPolygons=function(t){if(V(t,gn))return t;var e=rn.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(H.toPolygonArray(e))},Rt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Rt.union=function(t){var e=new Rt(t);return e.union()},Au.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Rt,Au);var ts=function(){};ts.prototype.interfaces_=function(){return[]},ts.prototype.getClass=function(){return ts},ts.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return q.createEmptyResult(q.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),he.overlayOp(t,e,q.UNION)};function Wn(){return new es}function es(){this.reset()}es.prototype={constructor:es,reset:function(){this.s=this.t=0},add:function(n){Fu(rs,n,this.t),Fu(this,rs.s,this.s),this.s?this.t+=rs.t:this.s=rs.t},valueOf:function(){return this.s}};var rs=new es;function Fu(n,t,e){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}var Et=1e-6,at=Math.PI,nn=at/2,ku=at/4,on=at*2,Hn=180/at,xr=at/180,ge=Math.abs,Ef=Math.atan,qi=Math.atan2,Ft=Math.cos,kt=Math.sin,Xi=Math.sqrt;function Bu(n){return n>1?0:n<-1?at:Math.acos(n)}function pi(n){return n>1?nn:n<-1?-nn:Math.asin(n)}function xo(){}function ns(n,t){n&&zu.hasOwnProperty(n.type)&&zu[n.type](n,t)}var Gu={Feature:function(n,t){ns(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)ns(e[r].geometry,t)}},zu={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){Zs(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Zs(e[r],t,0)},Polygon:function(n,t){Vu(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Vu(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)ns(e[r],t)}};function Zs(n,t,e){var r=-1,i=n.length-e,o;for(t.lineStart();++r<i;)o=n[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function Vu(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)Zs(n[e],t,1);t.polygonEnd()}function Cf(n,t){n&&Gu.hasOwnProperty(n.type)?Gu[n.type](n,t):ns(n,t)}Wn(),Wn();function Js(n){return[qi(n[1],n[0]),pi(n[2])]}function Yi(n){var t=n[0],e=n[1],r=Ft(e);return[r*Ft(t),r*kt(t),kt(e)]}function is(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function os(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function $s(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ss(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function ta(n){var t=Xi(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}Wn();function Uu(n,t){function e(r,i){return r=n(r,i),t(r[0],r[1])}return n.invert&&t.invert&&(e.invert=function(r,i){return r=t.invert(r,i),r&&n.invert(r[0],r[1])}),e}function ea(n,t){return[n>at?n-on:n<-at?n+on:n,t]}ea.invert=ea;function If(n,t,e){return(n%=on)?t||e?Uu(Xu(n),Yu(t,e)):Xu(n):t||e?Yu(t,e):ea}function qu(n){return function(t,e){return t+=n,[t>at?t-on:t<-at?t+on:t,e]}}function Xu(n){var t=qu(n);return t.invert=qu(-n),t}function Yu(n,t){var e=Ft(n),r=kt(n),i=Ft(t),o=kt(t);function s(a,u){var l=Ft(u),c=Ft(a)*l,f=kt(a)*l,h=kt(u),g=h*e+c*r;return[qi(f*i-g*o,c*e-h*r),pi(g*i+f*o)]}return s.invert=function(a,u){var l=Ft(u),c=Ft(a)*l,f=kt(a)*l,h=kt(u),g=h*i-f*o;return[qi(f*i+h*o,c*e+g*r),pi(g*e-c*r)]},s}function Nf(n,t,e,r,i,o){if(e){var s=Ft(t),a=kt(t),u=r*e;i==null?(i=t+r*on,o=t-u/2):(i=Wu(s,i),o=Wu(s,o),(r>0?i<o:i>o)&&(i+=r*on));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Js([s,-a*Ft(c),-a*kt(c)]),n.point(l[0],l[1])}}function Wu(n,t){t=Yi(t),t[0]-=n,ta(t);var e=Bu(-t[1]);return((-t[2]<0?-e:e)+on-Et)%on}function Hu(){var n=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){n.push(t=[])},lineEnd:xo,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Sf(n,t,e,r,i,o){var s=n[0],a=n[1],u=t[0],l=t[1],c=0,f=1,h=u-s,g=l-a,p;if(p=e-s,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}if(p=r-a,!(!g&&p>0)){if(p/=g,g<0){if(p<c)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>c&&(c=p)}else if(g>0){if(p<c)return;p<f&&(f=p)}return c>0&&(n[0]=s+c*h,n[1]=a+c*g),f<1&&(t[0]=s+f*h,t[1]=a+f*g),!0}}}}}function as(n,t){return ge(n[0]-t[0])<Et&&ge(n[1]-t[1])<Et}function us(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function ju(n,t,e,r,i){var o=[],s=[],a,u;if(n.forEach(function(p){if(!((y=p.length-1)<=0)){var y,d=p[0],v=p[y],C;if(as(d,v)){for(i.lineStart(),a=0;a<y;++a)i.point((d=p[a])[0],d[1]);i.lineEnd();return}o.push(C=new us(d,p,null,!0)),s.push(C.o=new us(d,null,C,!1)),o.push(C=new us(v,p,null,!1)),s.push(C.o=new us(v,null,C,!0))}}),!!o.length){for(s.sort(t),Ku(o),Ku(s),a=0,u=s.length;a<u;++a)s[a].e=e=!e;for(var l=o[0],c,f;;){for(var h=l,g=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(a=0,u=c.length;a<u;++a)i.point((f=c[a])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(g)for(c=h.p.z,a=c.length-1;a>=0;--a)i.point((f=c[a])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,g=!g}while(!h.v);i.lineEnd()}}}function Ku(n){if(t=n.length){for(var t,e=0,r=n[0],i;++e<t;)r.n=i=n[e],i.p=r,r=i;r.n=i=n[0],i.p=r}}function Qu(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function xf(n){return n.length===1&&(n=Lf(n)),{left:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r},right:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}function Lf(n){return function(t,e){return Qu(n(t),e)}}xf(Qu);function Zu(n){for(var t=n.length,e,r=-1,i=0,o,s;++r<t;)i+=n[r].length;for(o=new Array(i);--t>=0;)for(s=n[t],e=s.length;--e>=0;)o[--i]=s[e];return o}var Lo=1e9,ls=-Lo;function bf(n,t,e,r){function i(l,c){return n<=l&&l<=e&&t<=c&&c<=r}function o(l,c,f,h){var g=0,p=0;if(l==null||(g=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do h.point(g===0||g===3?n:e,g>1?r:t);while((g=(g+f+4)%4)!==p);else h.point(c[0],c[1])}function s(l,c){return ge(l[0]-n)<Et?c>0?0:3:ge(l[0]-e)<Et?c>0?2:1:ge(l[1]-t)<Et?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),h=s(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=Hu(),h,g,p,y,d,v,C,I,N,L,T,O={point:D,lineStart:G,lineEnd:ut,polygonStart:A,polygonEnd:Y};function D(B,Q){i(B,Q)&&c.point(B,Q)}function b(){for(var B=0,Q=0,bt=g.length;Q<bt;++Q)for(var re=g[Q],Kt=1,sn=re.length,Ae=re[0],Xe,ir,jn=Ae[0],Sn=Ae[1];Kt<sn;++Kt)Xe=jn,ir=Sn,Ae=re[Kt],jn=Ae[0],Sn=Ae[1],ir<=r?Sn>r&&(jn-Xe)*(r-ir)>(Sn-ir)*(n-Xe)&&++B:Sn<=r&&(jn-Xe)*(r-ir)<(Sn-ir)*(n-Xe)&&--B;return B}function A(){c=f,h=[],g=[],T=!0}function Y(){var B=b(),Q=T&&B,bt=(h=Zu(h)).length;(Q||bt)&&(l.polygonStart(),Q&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),bt&&ju(h,a,B,o,l),l.polygonEnd()),c=l,h=g=p=null}function G(){O.point=x,g&&g.push(p=[]),L=!0,N=!1,C=I=NaN}function ut(){h&&(x(y,d),v&&N&&f.rejoin(),h.push(f.result())),O.point=D,N&&c.lineEnd()}function x(B,Q){var bt=i(B,Q);if(g&&p.push([B,Q]),L)y=B,d=Q,v=bt,L=!1,bt&&(c.lineStart(),c.point(B,Q));else if(bt&&N)c.point(B,Q);else{var re=[C=Math.max(ls,Math.min(Lo,C)),I=Math.max(ls,Math.min(Lo,I))],Kt=[B=Math.max(ls,Math.min(Lo,B)),Q=Math.max(ls,Math.min(Lo,Q))];Sf(re,Kt,n,t,e,r)?(N||(c.lineStart(),c.point(re[0],re[1])),c.point(Kt[0],Kt[1]),bt||c.lineEnd(),T=!1):bt&&(c.lineStart(),c.point(B,Q),T=!1)}C=B,I=Q,N=bt}return O}}var ra=Wn();function wf(n,t){var e=t[0],r=t[1],i=[kt(e),-Ft(e),0],o=0,s=0;ra.reset();for(var a=0,u=n.length;a<u;++a)if(c=(l=n[a]).length)for(var l,c,f=l[c-1],h=f[0],g=f[1]/2+ku,p=kt(g),y=Ft(g),d=0;d<c;++d,h=C,p=N,y=L,f=v){var v=l[d],C=v[0],I=v[1]/2+ku,N=kt(I),L=Ft(I),T=C-h,O=T>=0?1:-1,D=O*T,b=D>at,A=p*N;if(ra.add(qi(A*O*kt(D),y*L+A*Ft(D))),o+=b?T+O*on:T,b^h>=e^C>=e){var Y=os(Yi(f),Yi(v));ta(Y);var G=os(i,Y);ta(G);var ut=(b^T>=0?-1:1)*pi(G[2]);(r>ut||r===ut&&(Y[0]||Y[1]))&&(s+=b^T>=0?1:-1)}}return(o<-Et||o<Et&&ra<-Et)^s&1}Wn();function Ju(n){return n}Wn(),Wn();var Wi=1/0,cs=Wi,bo=-Wi,fs=bo,$u={point:Pf,lineStart:xo,lineEnd:xo,polygonStart:xo,polygonEnd:xo,result:function(){var n=[[Wi,cs],[bo,fs]];return bo=fs=-(cs=Wi=1/0),n}};function Pf(n,t){n<Wi&&(Wi=n),n>bo&&(bo=n),t<cs&&(cs=t),t>fs&&(fs=t)}Wn();function tl(n,t,e,r){return function(i,o){var s=t(o),a=i.invert(r[0],r[1]),u=Hu(),l=t(u),c=!1,f,h,g,p={point:y,lineStart:v,lineEnd:C,polygonStart:function(){p.point=I,p.lineStart=N,p.lineEnd=L,h=[],f=[]},polygonEnd:function(){p.point=y,p.lineStart=v,p.lineEnd=C,h=Zu(h);var T=wf(f,a);h.length?(c||(o.polygonStart(),c=!0),ju(h,Rf,T,e,o)):T&&(c||(o.polygonStart(),c=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),h=f=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(T,O){var D=i(T,O);n(T=D[0],O=D[1])&&o.point(T,O)}function d(T,O){var D=i(T,O);s.point(D[0],D[1])}function v(){p.point=d,s.lineStart()}function C(){p.point=y,s.lineEnd()}function I(T,O){g.push([T,O]);var D=i(T,O);l.point(D[0],D[1])}function N(){l.lineStart(),g=[]}function L(){I(g[0][0],g[0][1]),l.lineEnd();var T=l.clean(),O=u.result(),D,b=O.length,A,Y,G;if(g.pop(),f.push(g),g=null,!!b){if(T&1){if(Y=O[0],(A=Y.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),D=0;D<A;++D)o.point((G=Y[D])[0],G[1]);o.lineEnd()}return}b>1&&T&2&&O.push(O.pop().concat(O.shift())),h.push(O.filter(Of))}}return p}}function Of(n){return n.length>1}function Rf(n,t){return((n=n.x)[0]<0?n[1]-nn-Et:nn-n[1])-((t=t.x)[0]<0?t[1]-nn-Et:nn-t[1])}const el=tl(function(){return!0},Tf,Mf,[-at,-nn]);function Tf(n){var t=NaN,e=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(o,s){var a=o>0?at:-at,u=ge(o-t);ge(u-at)<Et?(n.point(t,e=(e+s)/2>0?nn:-nn),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),n.point(o,e),i=0):r!==a&&u>=at&&(ge(t-r)<Et&&(t-=r*Et),ge(o-a)<Et&&(o-=a*Et),e=Df(t,e,o,s),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),i=0),n.point(t=o,e=s),r=a},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function Df(n,t,e,r){var i,o,s=kt(n-e);return ge(s)>Et?Ef((kt(t)*(o=Ft(r))*kt(e)-kt(r)*(i=Ft(t))*kt(n))/(i*o*s)):(t+r)/2}function Mf(n,t,e,r){var i;if(n==null)i=e*nn,r.point(-at,i),r.point(0,i),r.point(at,i),r.point(at,0),r.point(at,-i),r.point(0,-i),r.point(-at,-i),r.point(-at,0),r.point(-at,i);else if(ge(n[0]-t[0])>Et){var o=n[0]<t[0]?at:-at;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function Af(n,t){var e=Ft(n),r=e>0,i=ge(e)>Et;function o(c,f,h,g){Nf(g,n,t,h,c,f)}function s(c,f){return Ft(c)*Ft(f)>e}function a(c){var f,h,g,p,y;return{lineStart:function(){p=g=!1,y=1},point:function(d,v){var C=[d,v],I,N=s(d,v),L=r?N?0:l(d,v):N?l(d+(d<0?at:-at),v):0;if(!f&&(p=g=N)&&c.lineStart(),N!==g&&(I=u(f,C),(!I||as(f,I)||as(C,I))&&(C[0]+=Et,C[1]+=Et,N=s(C[0],C[1]))),N!==g)y=0,N?(c.lineStart(),I=u(C,f),c.point(I[0],I[1])):(I=u(f,C),c.point(I[0],I[1]),c.lineEnd()),f=I;else if(i&&f&&r^N){var T;!(L&h)&&(T=u(C,f,!0))&&(y=0,r?(c.lineStart(),c.point(T[0][0],T[0][1]),c.point(T[1][0],T[1][1]),c.lineEnd()):(c.point(T[1][0],T[1][1]),c.lineEnd(),c.lineStart(),c.point(T[0][0],T[0][1])))}N&&(!f||!as(f,C))&&c.point(C[0],C[1]),f=C,g=N,h=L},lineEnd:function(){g&&c.lineEnd(),f=null},clean:function(){return y|(p&&g)<<1}}}function u(c,f,h){var g=Yi(c),p=Yi(f),y=[1,0,0],d=os(g,p),v=is(d,d),C=d[0],I=v-C*C;if(!I)return!h&&c;var N=e*v/I,L=-e*C/I,T=os(y,d),O=ss(y,N),D=ss(d,L);$s(O,D);var b=T,A=is(O,b),Y=is(b,b),G=A*A-Y*(is(O,O)-1);if(!(G<0)){var ut=Xi(G),x=ss(b,(-A-ut)/Y);if($s(x,O),x=Js(x),!h)return x;var B=c[0],Q=f[0],bt=c[1],re=f[1],Kt;Q<B&&(Kt=B,B=Q,Q=Kt);var sn=Q-B,Ae=ge(sn-at)<Et,Xe=Ae||sn<Et;if(!Ae&&re<bt&&(Kt=bt,bt=re,re=Kt),Xe?Ae?bt+re>0^x[1]<(ge(x[0]-B)<Et?bt:re):bt<=x[1]&&x[1]<=re:sn>at^(B<=x[0]&&x[0]<=Q)){var ir=ss(b,(-A+ut)/Y);return $s(ir,O),[x,Js(ir)]}}}function l(c,f){var h=r?n:at-n,g=0;return c<-h?g|=1:c>h&&(g|=2),f<-h?g|=4:f>h&&(g|=8),g}return tl(s,a,o,r?[0,-n]:[-at,n-at])}function rl(n){return function(t){var e=new na;for(var r in n)e[r]=n[r];return e.stream=t,e}}function na(){}na.prototype={constructor:na,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function nl(n,t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),o!=null&&n.clipExtent(null),Cf(e,n.stream($u));var s=$u.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+t[0][0]+(r-a*(s[1][0]+s[0][0]))/2,l=+t[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return o!=null&&n.clipExtent(o),n.scale(a*150).translate([u,l])}function Ff(n,t,e){return nl(n,[[0,0],t],e)}var il=16,kf=Ft(30*xr);function ol(n,t){return+t?Gf(n,t):Bf(n)}function Bf(n){return rl({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}})}function Gf(n,t){function e(r,i,o,s,a,u,l,c,f,h,g,p,y,d){var v=l-r,C=c-i,I=v*v+C*C;if(I>4*t&&y--){var N=s+h,L=a+g,T=u+p,O=Xi(N*N+L*L+T*T),D=pi(T/=O),b=ge(ge(T)-1)<Et||ge(o-f)<Et?(o+f)/2:qi(L,N),A=n(b,D),Y=A[0],G=A[1],ut=Y-r,x=G-i,B=C*ut-v*x;(B*B/I>t||ge((v*ut+C*x)/I-.5)>.3||s*h+a*g+u*p<kf)&&(e(r,i,o,s,a,u,Y,G,b,N/=O,L/=O,T,y,d),d.point(Y,G),e(Y,G,b,N,L,T,l,c,f,h,g,p,y,d))}}return function(r){var i,o,s,a,u,l,c,f,h,g,p,y,d={point:v,lineStart:C,lineEnd:N,polygonStart:function(){r.polygonStart(),d.lineStart=L},polygonEnd:function(){r.polygonEnd(),d.lineStart=C}};function v(D,b){D=n(D,b),r.point(D[0],D[1])}function C(){f=NaN,d.point=I,r.lineStart()}function I(D,b){var A=Yi([D,b]),Y=n(D,b);e(f,h,c,g,p,y,f=Y[0],h=Y[1],c=D,g=A[0],p=A[1],y=A[2],il,r),r.point(f,h)}function N(){d.point=v,r.lineEnd()}function L(){C(),d.point=T,d.lineEnd=O}function T(D,b){I(i=D,b),o=f,s=h,a=g,u=p,l=y,d.point=I}function O(){e(f,h,c,g,p,y,o,s,i,a,u,l,il,r),d.lineEnd=N,N()}return d}}var zf=rl({point:function(n,t){this.stream.point(n*xr,t*xr)}});function Vf(n){return Uf(function(){return n})()}function Uf(n){var t,e=150,r=480,i=250,o,s,a=0,u=0,l=0,c=0,f=0,h,g,p=null,y=el,d=null,v,C,I,N=Ju,L=.5,T=ol(Y,L),O,D;function b(x){return x=g(x[0]*xr,x[1]*xr),[x[0]*e+o,s-x[1]*e]}function A(x){return x=g.invert((x[0]-o)/e,(s-x[1])/e),x&&[x[0]*Hn,x[1]*Hn]}function Y(x,B){return x=t(x,B),[x[0]*e+o,s-x[1]*e]}b.stream=function(x){return O&&D===x?O:O=zf(y(h,T(N(D=x))))},b.clipAngle=function(x){return arguments.length?(y=+x?Af(p=x*xr,6*xr):(p=null,el),ut()):p*Hn},b.clipExtent=function(x){return arguments.length?(N=x==null?(d=v=C=I=null,Ju):bf(d=+x[0][0],v=+x[0][1],C=+x[1][0],I=+x[1][1]),ut()):d==null?null:[[d,v],[C,I]]},b.scale=function(x){return arguments.length?(e=+x,G()):e},b.translate=function(x){return arguments.length?(r=+x[0],i=+x[1],G()):[r,i]},b.center=function(x){return arguments.length?(a=x[0]%360*xr,u=x[1]%360*xr,G()):[a*Hn,u*Hn]},b.rotate=function(x){return arguments.length?(l=x[0]%360*xr,c=x[1]%360*xr,f=x.length>2?x[2]%360*xr:0,G()):[l*Hn,c*Hn,f*Hn]},b.precision=function(x){return arguments.length?(T=ol(Y,L=x*x),ut()):Xi(L)},b.fitExtent=function(x,B){return nl(b,x,B)},b.fitSize=function(x,B){return Ff(b,x,B)};function G(){g=Uu(h=If(l,c,f),t);var x=t(a,u);return o=r-x[0]*e,s=i+x[1]*e,ut()}function ut(){return O=D=null,b}return function(){return t=n.apply(this,arguments),b.invert=t.invert&&A,G()}}function sl(n){return function(t,e){var r=Ft(t),i=Ft(e),o=n(r*i);return[o*i*kt(t),o*kt(e)]}}function al(n){return function(t,e){var r=Xi(t*t+e*e),i=n(r),o=kt(i),s=Ft(i);return[qi(t*o,r*s),pi(r&&e*o/r)]}}var qf=sl(function(n){return Xi(2/(1+n))});qf.invert=al(function(n){return 2*pi(n/2)});var ul=sl(function(n){return(n=Bu(n))&&n/kt(n)});ul.invert=al(function(n){return n});function Xf(){return Vf(ul).scale(79.4188).clipAngle(180-.001)}function ll(n,t){return[n,t]}ll.invert=ll;function Yf(n,t,e){e=e||{};var r=e.units||"kilometers",i=e.steps||8;if(!n)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(n.type){case"GeometryCollection":return iu(n,function(s){var a=hs(s,t,r,i);a&&o.push(a)}),Rs(o);case"FeatureCollection":return nu(n,function(s){var a=hs(s,t,r,i);a&&nu(a,function(u){u&&o.push(u)})}),Rs(o)}return hs(n,t,r,i)}function hs(n,t,e,r){var i=n.properties||{},o=n.type==="Feature"?n.geometry:n;if(o.type==="GeometryCollection"){var s=[];return iu(n,function(y){var d=hs(y,t,e,r);d&&s.push(d)}),Rs(s)}var a=Wf(o),u={type:o.type,coordinates:fl(o.coordinates,a)},l=new Vs,c=l.read(u),f=Jc($c(t,e),"meters"),h=Xt.bufferOp(c,f,r),g=new vu;if(h=g.write(h),!cl(h.coordinates)){var p={type:h.type,coordinates:hl(h.coordinates,a)};return Fo(p,i)}}function cl(n){return Array.isArray(n[0])?cl(n[0]):isNaN(n[0])}function fl(n,t){return typeof n[0]!="object"?t(n):n.map(function(e){return fl(e,t)})}function hl(n,t){return typeof n[0]!="object"?t.invert(n):n.map(function(e){return hl(e,t)})}function Wf(n){var t=ef(n).geometry.coordinates,e=[-t[0],-t[1]];return Xf().rotate(e).scale(be)}function Hf(n,t){var e=ko(n),r=ko(t),i=n.properties||{},o=Za.difference(e.coordinates,r.coordinates);return o.length===0?null:o.length===1?$a(o[0],i):tu(o,i)}function gl(n){let t;for(const e of n)t&&e[0]-t[0]>=180?e[0]-=360:t&&e[0]-t[0]<-180&&(e[0]+=360),t=e}function pl(n,t){const e=Hf({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},n);if(!e)return;e.properties={isMask:"y"};const r=Yf(n,0);if(r.geometry.type==="Polygon")for(const i of r.geometry.coordinates)gl(i);else for(const i of r.geometry.coordinates)for(const o of i)gl(o);t({type:"FeatureCollection",features:[r,e]})}let dl={type:"FeatureCollection",features:[]};function vl(n,t,e=!0,r=!0,i={},o={},s={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let a,u=[],l,c,f;function h(){!n.getSource("full-geom")&&(s!=null&&s.fill||s!=null&&s.line)&&n.addSource("full-geom",{type:"geojson",data:dl}),!n.getLayer("full-geom-fill")&&(s!=null&&s.fill)&&n.addLayer({...s==null?void 0:s.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),!n.getLayer("full-geom-line")&&(s!=null&&s.line)&&n.addLayer({...s==null?void 0:s.line,id:"full-geom-line",type:"line",source:"full-geom"}),f&&y(f)}n.loaded()?h():n.once("load",()=>{h()}),n.on("styledata",()=>{h()});const g=d=>{a==null||a({type:"mapClick",coordinates:[d.lngLat.lng,d.lngLat.lat]})};function p(d=!1){if(!t)throw new Error;const v=document.createElement("div");return d&&v.classList.add("marker-interactive"),new ic({props:{displayIn:"maplibre"},target:v}),new t.Marker({element:v,offset:[1,-13]})}function y(d){var v;f=d,(v=n.getSource("full-geom"))==null||v.setData(d)}return{setEventHandler(d){d?(a=d,n.on("click",g)):(a=void 0,n.off("click",g))},flyTo(d,v){n.flyTo({center:d,zoom:v,...i})},fitBounds(d,v,C){n.fitBounds([[d[0],d[1]],[d[2],d[3]]],{padding:v,maxZoom:C,...o})},indicateReverse(d){n.getCanvasContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){!t||!e||(c?d?c.setLngLat(d):(c.remove(),c=void 0):d&&(c=(typeof e=="object"?new t.Marker(e):p()).setLngLat(d).addTo(n),c.getElement().classList.add("marker-reverse")))},setMarkers(d,v){if(e){for(const C of u)C.remove();if(u.length=0,y(dl),!!t){if(v){let C=!1;if(v.geometry.type==="GeometryCollection"){const I=v.geometry.geometries.filter(N=>N.type==="Polygon"||N.type==="MultiPolygon");if(I.length>0){let N=I.pop();for(const L of I)N=tf(N,L);pl({...v,geometry:N},y),C=!0}else{const N=v.geometry.geometries.filter(L=>L.type==="LineString"||L.type==="MultiLineString");N.length>0&&(y({...v,geometry:{type:"GeometryCollection",geometries:N}}),C=!0)}}if(!C){if(v.geometry.type==="Polygon"||v.geometry.type==="MultiPolygon")pl(v,y);else if(v.geometry.type==="LineString"||v.geometry.type==="MultiLineString"){y(v);return}}e&&u.push((typeof e=="object"?new t.Marker(e):p()).setLngLat(v.center).addTo(n))}if(r)for(const C of d??[]){if(C===v)continue;const I=(typeof r=="object"?new t.Marker(r):p(!0)).setLngLat(C.center).setPopup(new t.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(C.place_type[0]==="reverse"?C.place_name:C.place_name.replace(/,.*/,""))).addTo(n),N=I.getElement();N.addEventListener("click",L=>{L.stopPropagation(),a==null||a({type:"markerClick",id:C.id})}),N.addEventListener("mouseenter",()=>{a==null||a({type:"markerMouseEnter",id:C.id}),I.togglePopup()}),N.addEventListener("mouseleave",()=>{a==null||a({type:"markerMouseLeave",id:C.id}),I.togglePopup()}),u.push(I)}}}},setSelectedMarker(d){l&&l.getElement().classList.toggle("marker-selected",!1),l=d>-1?u[d]:void 0,l==null||l.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const d=n.getCenter();return[n.getZoom(),d.lng,d.lat]}}}class jf extends EventTarget{constructor(e={}){super();ga(this,nr,void 0);ga(this,di,void 0);ms(this,di,e)}onAddInt(e){const r=document.createElement("div");r.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:i,showResultMarkers:o,flyTo:s,fullGeometryStyle:a,...u}=wr(this,di),l=typeof s=="boolean"?{}:s,c=this.getExtraProps(e,r),h={mapController:vl(e,this.getMapLibreGl(),i,o,l,l,a),flyTo:s===void 0?!0:!!s,apiKey:"",...c,...u};if(!h.apiKey)throw new Error("no apiKey provided");ms(this,nr,new wc({target:r,props:h}));for(const g of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])wr(this,nr).$on(g,p=>this.dispatchEvent(p));return r}setOptions(e){var u;ms(this,di,e);const{marker:r,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=wr(this,di);(u=wr(this,nr))==null||u.$set(a)}setQuery(e,r=!0){var i;(i=wr(this,nr))==null||i.setQuery(e,r)}clearMap(){var e;(e=wr(this,nr))==null||e.clearMap()}clearList(){var e;(e=wr(this,nr))==null||e.clearList()}setReverseMode(e){var r;(r=wr(this,nr))==null||r.$set({reverseActive:e})}focus(){var e;(e=wr(this,nr))==null||e.focus()}blur(){var e;(e=wr(this,nr))==null||e.blur()}onRemove(){var e;(e=wr(this,nr))==null||e.$destroy()}}nr=new WeakMap,di=new WeakMap;class Kf extends jf{getMapLibreGl(){return wo}onAdd(t){return super.onAddInt(t)}getExtraProps(t,e){const r={};if(!("getSdkConfig"in t&&typeof t.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:i,apiKey:o}=t.getSdkConfig();r.apiKey=o;const s=/^([a-z]{2})($|_|-)/.exec(i);return s&&(r.language=s[1]),e.className+=" maptiler-ctrl",r}}ht.GeocodingControl=Kf,ht.createMapLibreGlMapController=vl,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"})});
26
26
  //# sourceMappingURL=maptilersdk.umd.cjs.map