@maptiler/geocoding-control 1.3.2 → 1.4.0
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.
- package/README.md +3 -4
- package/icons/airport.svg +6 -0
- package/icons/animal_shelter.svg +4 -0
- package/icons/art_gallery.svg +4 -0
- package/icons/atm.svg +5 -1
- package/icons/barrier.svg +4 -0
- package/icons/baseball.svg +4 -0
- package/icons/basketball.svg +4 -0
- package/icons/bbq.svg +4 -1
- package/icons/beach.svg +4 -0
- package/icons/beer.svg +4 -1
- package/icons/bench.svg +4 -1
- package/icons/bicycle.svg +4 -1
- package/icons/bicycle_parking.svg +5 -1
- package/icons/bicycle_rental.svg +5 -1
- package/icons/billiards.svg +4 -0
- package/icons/board.svg +4 -1
- package/icons/bollard.svg +4 -0
- package/icons/bowling.svg +4 -1
- package/icons/building.svg +4 -0
- package/icons/bulldozer.svg +4 -0
- package/icons/bus_guided.svg +4 -0
- package/icons/bus_trolley.svg +4 -0
- package/icons/butcher.svg +4 -1
- package/icons/camper_trailer.svg +4 -0
- package/icons/campfire.svg +4 -0
- package/icons/caution.svg +4 -0
- package/icons/cemetery.svg +3 -11
- package/icons/charging_station.svg +4 -1
- package/icons/christian.svg +5 -0
- package/icons/circle-dot.svg +4 -0
- package/icons/circle-stroke.svg +4 -0
- package/icons/circle.svg +4 -0
- package/icons/city.svg +4 -0
- package/icons/communications_tower.svg +4 -1
- package/icons/confectionery.svg +4 -1
- package/icons/construction.svg +4 -0
- package/icons/cricket.svg +4 -0
- package/icons/cross.svg +4 -1
- package/icons/cycle_barrier.svg +4 -0
- package/icons/dam.svg +4 -0
- package/icons/danger.svg +4 -0
- package/icons/diamond.svg +4 -0
- package/icons/diamond_stroked.svg +4 -0
- package/icons/dot.svg +4 -0
- package/icons/drinking_water.svg +4 -1
- package/icons/emergency_phone.svg +4 -1
- package/icons/entrance.svg +4 -0
- package/icons/farm.svg +3 -8
- package/icons/fence.svg +4 -0
- package/icons/florist.svg +4 -1
- package/icons/furniture.svg +4 -1
- package/icons/gaming.svg +4 -0
- package/icons/garden.svg +4 -0
- package/icons/garden_centre.svg +4 -1
- package/icons/gate.svg +4 -1
- package/icons/globe.svg +4 -0
- package/icons/golf_green.svg +4 -0
- package/icons/gondola.svg +4 -0
- package/icons/guidepost.svg +4 -1
- package/icons/hardware.svg +3 -3
- package/icons/heart.svg +4 -0
- package/icons/heliport.svg +4 -0
- package/icons/highway_rest_area.svg +4 -0
- package/icons/home.svg +4 -0
- package/icons/hot_spring.svg +4 -1
- package/icons/hut.svg +4 -0
- package/icons/industry.svg +4 -0
- package/icons/karaoke.svg +4 -0
- package/icons/lift_gate.svg +4 -0
- package/icons/light_rail.svg +4 -0
- package/icons/lighthouse.svg +4 -1
- package/icons/marker.svg +4 -0
- package/icons/marker_stroked.svg +4 -0
- package/icons/monorail.svg +4 -0
- package/icons/motorcycle.svg +4 -1
- package/icons/motorcycle_parking.svg +4 -1
- package/icons/motorcycle_rental.svg +4 -0
- package/icons/motorcycle_repair.svg +4 -0
- package/icons/natural.svg +4 -0
- package/icons/noodle.svg +4 -0
- package/icons/obelisk.svg +4 -1
- package/icons/observation_tower.svg +4 -1
- package/icons/oneway.svg +4 -0
- package/icons/optician.svg +4 -1
- package/icons/park.svg +4 -1
- package/icons/parking_paid.svg +4 -0
- package/icons/pin.svg +4 -0
- package/icons/pipe.svg +4 -0
- package/icons/pizza.svg +4 -0
- package/icons/place_of_worship.svg +4 -1
- package/icons/playground.svg +3 -3
- package/icons/racetrack.svg +4 -0
- package/icons/radiation.svg +4 -0
- package/icons/railway.svg +4 -0
- package/icons/ranger_station.svg +4 -0
- package/icons/recycling.svg +4 -1
- package/icons/road_accident.svg +4 -0
- package/icons/roadblock.svg +4 -0
- package/icons/rocket.svg +4 -0
- package/icons/school_bus.svg +4 -0
- package/icons/sculpture.svg +4 -0
- package/icons/seafood.svg +4 -1
- package/icons/shelter.svg +4 -1
- package/icons/shoes.svg +4 -1
- package/icons/sikh.svg +4 -0
- package/icons/snow.svg +4 -0
- package/icons/soccer.svg +4 -1
- package/icons/spring.svg +4 -1
- package/icons/square.svg +4 -0
- package/icons/square_stroked.svg +4 -0
- package/icons/star.svg +4 -0
- package/icons/star_stroked.svg +4 -0
- package/icons/statue.svg +4 -1
- package/icons/subway.svg +4 -0
- package/icons/sushi.svg +4 -0
- package/icons/swimming.svg +5 -0
- package/icons/swimming_pool.svg +8 -0
- package/icons/tako.svg +4 -0
- package/icons/taxi.svg +4 -1
- package/icons/teahouse.svg +4 -0
- package/icons/terminal.svg +4 -1
- package/icons/theme_park.svg +4 -0
- package/icons/town.svg +4 -0
- package/icons/town_hall.svg +4 -1
- package/icons/townhall.svg +4 -1
- package/icons/tram_stop.svg +4 -0
- package/icons/transit.svg +4 -0
- package/icons/triangle.svg +4 -0
- package/icons/triangle_stroked.svg +4 -0
- package/icons/truck.svg +4 -0
- package/icons/tunnel.svg +4 -0
- package/icons/veterinary.svg +4 -1
- package/icons/viewpoint.svg +4 -1
- package/icons/village.svg +4 -0
- package/icons/volleyball.svg +4 -0
- package/icons/warehouse.svg +4 -0
- package/icons/water.svg +3 -5
- package/icons/water_park.svg +6 -1
- package/icons/water_tower.svg +4 -1
- package/icons/watermill.svg +4 -0
- package/icons/wetland.svg +4 -0
- package/icons/wine.svg +4 -0
- package/leaflet-controller.d.ts +2 -2
- package/leaflet-controller.js +1828 -12736
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +13 -22
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +3052 -13916
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -12
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +2 -2
- package/maplibregl-controller.js +1767 -12761
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +13 -22
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +2950 -13900
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -12
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +2958 -13908
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -12
- package/maptilersdk.umd.js.map +1 -1
- package/mask.d.ts +1 -1
- package/openlayers-controller.js +1177 -12154
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +13 -22
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.js +2667 -13607
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -12
- package/openlayers.umd.js.map +1 -1
- package/package.json +31 -29
- package/react.js +996 -955
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/FeatureItem.svelte +7 -5
- package/svelte/GeocodingControl.svelte +72 -14
- package/svelte/GeocodingControl.svelte.d.ts +4 -2
- package/svelte/geoUtils.js +7 -1
- package/svelte/leaflet-controller.d.ts +2 -2
- package/svelte/leaflet-controller.js +48 -2
- package/svelte/maplibregl-controller.d.ts +2 -2
- package/svelte/maplibregl-controller.js +5 -2
- package/svelte/mask.d.ts +1 -1
- package/svelte/mask.js +32 -29
- package/svelte/openlayers-controller.js +13 -14
- package/svelte/types.d.ts +15 -9
- package/types.d.ts +15 -9
- package/vanilla.js +1016 -975
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/icons/beach_resort.svg +0 -1
- package/icons/drinking-water.svg +0 -1
- package/icons/emergency-phone.svg +0 -1
- package/icons/rental_bicycle.svg +0 -1
- package/icons/rental_car.svg +0 -1
- /package/icons/{camp_site.svg → campsite.svg} +0 -0
- /package/icons/{toll_booth.svg → toll.svg} +0 -0
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
(function(De,Fe){typeof exports=="object"&&typeof module<"u"?Fe(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],Fe):(De=typeof globalThis<"u"?globalThis:De||self,Fe(De.leafletMaptilerGeocodingController={},De.L))})(this,function(De,Fe){"use strict";var Ad=Object.defineProperty;var Md=(De,Fe,Zt)=>Fe in De?Ad(De,Fe,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):De[Fe]=Zt;var ia=(De,Fe,Zt)=>Md(De,typeof Fe!="symbol"?Fe+"":Fe,Zt);function Zt(o){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const a in o)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(r,a,l.get?l:{enumerable:!0,get:()=>o[a]})}}return r.default=o,Object.freeze(r)}const Jt=Zt(Fe);var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sa(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function Cc(o){if(o.__esModule)return o;var r=o.default;if(typeof r=="function"){var a=function l(){return this instanceof l?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};a.prototype=r.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(o).forEach(function(l){var c=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(a,l,c.get?c:{enumerable:!0,get:function(){return o[l]}})}),a}var aa=Object.prototype.toString,oa=function(r){var a=aa.call(r),l=a==="[object Arguments]";return l||(l=a!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&aa.call(r.callee)==="[object Function]"),l},ci,ua;function Pc(){if(ua)return ci;ua=1;var o;if(!Object.keys){var r=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=oa,c=Object.prototype.propertyIsEnumerable,h=!c.call({toString:null},"toString"),v=c.call(function(){},"prototype"),p=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(k){var E=k.constructor;return E&&E.prototype===k},x={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},S=function(){if(typeof window>"u")return!1;for(var k in window)try{if(!x["$"+k]&&r.call(window,k)&&window[k]!==null&&typeof window[k]=="object")try{_(window[k])}catch{return!0}}catch{return!0}return!1}(),m=function(k){if(typeof window>"u"||!S)return _(k);try{return _(k)}catch{return!1}};o=function(E){var N=E!==null&&typeof E=="object",T=a.call(E)==="[object Function]",R=l(E),A=N&&a.call(E)==="[object String]",P=[];if(!N&&!T&&!R)throw new TypeError("Object.keys called on a non-object");var C=v&&T;if(A&&E.length>0&&!r.call(E,0))for(var F=0;F<E.length;++F)P.push(String(F));if(R&&E.length>0)for(var M=0;M<E.length;++M)P.push(String(M));else for(var B in E)!(C&&B==="prototype")&&r.call(E,B)&&P.push(String(B));if(h)for(var Y=m(E),U=0;U<p.length;++U)!(Y&&p[U]==="constructor")&&r.call(E,p[U])&&P.push(p[U]);return P}}return ci=o,ci}var Ac=Array.prototype.slice,Mc=oa,la=Object.keys,ir=la?function(r){return la(r)}:Pc(),ca=Object.keys;ir.shim=function(){if(Object.keys){var r=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);r||(Object.keys=function(l){return Mc(l)?ca(Ac.call(l)):ca(l)})}else Object.keys=ir;return Object.keys||ir};var fi=ir,Dc=Error,Fc=EvalError,$c=RangeError,Gc=ReferenceError,fa=SyntaxError,St=TypeError,Bc=URIError,sr=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},a=Symbol("test"),l=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var c=42;r[a]=c;for(a in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var h=Object.getOwnPropertySymbols(r);if(h.length!==1||h[0]!==a||!Object.prototype.propertyIsEnumerable.call(r,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var v=Object.getOwnPropertyDescriptor(r,a);if(v.value!==c||v.enumerable!==!0)return!1}return!0},ha=typeof Symbol<"u"&&Symbol,qc=sr,hi=function(){return typeof ha!="function"||typeof Symbol!="function"||typeof ha("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qc()},gi={__proto__:null,foo:{}},zc=Object,Yc=function(){return{__proto__:gi}.foo===gi.foo&&!(gi instanceof zc)},Uc="Function.prototype.bind called on incompatible ",Xc=Object.prototype.toString,jc=Math.max,Vc="[object Function]",ga=function(r,a){for(var l=[],c=0;c<r.length;c+=1)l[c]=r[c];for(var h=0;h<a.length;h+=1)l[h+r.length]=a[h];return l},Wc=function(r,a){for(var l=[],c=a,h=0;c<r.length;c+=1,h+=1)l[h]=r[c];return l},Hc=function(o,r){for(var a="",l=0;l<o.length;l+=1)a+=o[l],l+1<o.length&&(a+=r);return a},Zc=function(r){var a=this;if(typeof a!="function"||Xc.apply(a)!==Vc)throw new TypeError(Uc+a);for(var l=Wc(arguments,1),c,h=function(){if(this instanceof c){var S=a.apply(this,ga(l,arguments));return Object(S)===S?S:this}return a.apply(r,ga(l,arguments))},v=jc(0,a.length-l.length),p=[],_=0;_<v;_++)p[_]="$"+_;if(c=Function("binder","return function ("+Hc(p,",")+"){ return binder.apply(this,arguments); }")(h),a.prototype){var x=function(){};x.prototype=a.prototype,c.prototype=new x,x.prototype=null}return c},Jc=Zc,yi=Function.prototype.bind||Jc,Qc=Function.prototype.call,Kc=Object.prototype.hasOwnProperty,ef=yi,ya=ef.call(Qc,Kc),oe,tf=Dc,nf=Fc,rf=$c,sf=Gc,Qt=fa,Kt=St,af=Bc,va=Function,vi=function(o){try{return va('"use strict"; return ('+o+").constructor;")()}catch{}},Dt=Object.getOwnPropertyDescriptor;if(Dt)try{Dt({},"")}catch{Dt=null}var pi=function(){throw new Kt},of=Dt?function(){try{return arguments.callee,pi}catch{try{return Dt(arguments,"callee").get}catch{return pi}}}():pi,en=hi(),uf=Yc(),ke=Object.getPrototypeOf||(uf?function(o){return o.__proto__}:null),tn={},lf=typeof Uint8Array>"u"||!ke?oe:ke(Uint8Array),Ft={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?oe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?oe:ArrayBuffer,"%ArrayIteratorPrototype%":en&&ke?ke([][Symbol.iterator]()):oe,"%AsyncFromSyncIteratorPrototype%":oe,"%AsyncFunction%":tn,"%AsyncGenerator%":tn,"%AsyncGeneratorFunction%":tn,"%AsyncIteratorPrototype%":tn,"%Atomics%":typeof Atomics>"u"?oe:Atomics,"%BigInt%":typeof BigInt>"u"?oe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?oe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?oe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?oe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":tf,"%eval%":eval,"%EvalError%":nf,"%Float32Array%":typeof Float32Array>"u"?oe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?oe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?oe:FinalizationRegistry,"%Function%":va,"%GeneratorFunction%":tn,"%Int8Array%":typeof Int8Array>"u"?oe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?oe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?oe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":en&&ke?ke(ke([][Symbol.iterator]())):oe,"%JSON%":typeof JSON=="object"?JSON:oe,"%Map%":typeof Map>"u"?oe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!en||!ke?oe:ke(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?oe:Promise,"%Proxy%":typeof Proxy>"u"?oe:Proxy,"%RangeError%":rf,"%ReferenceError%":sf,"%Reflect%":typeof Reflect>"u"?oe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?oe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!en||!ke?oe:ke(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?oe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":en&&ke?ke(""[Symbol.iterator]()):oe,"%Symbol%":en?Symbol:oe,"%SyntaxError%":Qt,"%ThrowTypeError%":of,"%TypedArray%":lf,"%TypeError%":Kt,"%Uint8Array%":typeof Uint8Array>"u"?oe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?oe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?oe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?oe:Uint32Array,"%URIError%":af,"%WeakMap%":typeof WeakMap>"u"?oe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?oe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?oe:WeakSet};if(ke)try{null.error}catch(o){var cf=ke(ke(o));Ft["%Error.prototype%"]=cf}var ff=function o(r){var a;if(r==="%AsyncFunction%")a=vi("async function () {}");else if(r==="%GeneratorFunction%")a=vi("function* () {}");else if(r==="%AsyncGeneratorFunction%")a=vi("async function* () {}");else if(r==="%AsyncGenerator%"){var l=o("%AsyncGeneratorFunction%");l&&(a=l.prototype)}else if(r==="%AsyncIteratorPrototype%"){var c=o("%AsyncGenerator%");c&&ke&&(a=ke(c.prototype))}return Ft[r]=a,a},pa={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Tn=yi,ar=ya,hf=Tn.call(Function.call,Array.prototype.concat),gf=Tn.call(Function.apply,Array.prototype.splice),ma=Tn.call(Function.call,String.prototype.replace),or=Tn.call(Function.call,String.prototype.slice),yf=Tn.call(Function.call,RegExp.prototype.exec),vf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pf=/\\(\\)?/g,mf=function(r){var a=or(r,0,1),l=or(r,-1);if(a==="%"&&l!=="%")throw new Qt("invalid intrinsic syntax, expected closing `%`");if(l==="%"&&a!=="%")throw new Qt("invalid intrinsic syntax, expected opening `%`");var c=[];return ma(r,vf,function(h,v,p,_){c[c.length]=p?ma(_,pf,"$1"):v||h}),c},df=function(r,a){var l=r,c;if(ar(pa,l)&&(c=pa[l],l="%"+c[0]+"%"),ar(Ft,l)){var h=Ft[l];if(h===tn&&(h=ff(l)),typeof h>"u"&&!a)throw new Kt("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:c,name:l,value:h}}throw new Qt("intrinsic "+r+" does not exist!")},rt=function(r,a){if(typeof r!="string"||r.length===0)throw new Kt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new Kt('"allowMissing" argument must be a boolean');if(yf(/^%?[^%]*%?$/,r)===null)throw new Qt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var l=mf(r),c=l.length>0?l[0]:"",h=df("%"+c+"%",a),v=h.name,p=h.value,_=!1,x=h.alias;x&&(c=x[0],gf(l,hf([0,1],x)));for(var S=1,m=!0;S<l.length;S+=1){var k=l[S],E=or(k,0,1),N=or(k,-1);if((E==='"'||E==="'"||E==="`"||N==='"'||N==="'"||N==="`")&&E!==N)throw new Qt("property names with quotes must have matching quotes");if((k==="constructor"||!m)&&(_=!0),c+="."+k,v="%"+c+"%",ar(Ft,v))p=Ft[v];else if(p!=null){if(!(k in p)){if(!a)throw new Kt("base intrinsic for "+r+" exists, but the property is not available.");return}if(Dt&&S+1>=l.length){var T=Dt(p,k);m=!!T,m&&"get"in T&&!("originalValue"in T.get)?p=T.get:p=p[k]}else m=ar(p,k),p=p[k];m&&!_&&(Ft[v]=p)}}return p},mi,da;function di(){if(da)return mi;da=1;var o=rt,r=o("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return mi=r,mi}var _f=rt,ur=_f("%Object.getOwnPropertyDescriptor%",!0);if(ur)try{ur([],"length")}catch{ur=null}var _i=ur,_a=di(),xf=fa,nn=St,xa=_i,xi=function(r,a,l){if(!r||typeof r!="object"&&typeof r!="function")throw new nn("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new nn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new nn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new nn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new nn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new nn("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,h=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,_=!!xa&&xa(r,a);if(_a)_a(r,a,{configurable:v===null&&_?_.configurable:!v,enumerable:c===null&&_?_.enumerable:!c,value:l,writable:h===null&&_?_.writable:!h});else if(p||!c&&!h&&!v)r[a]=l;else throw new xf("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ei=di(),Ea=function(){return!!Ei};Ea.hasArrayLengthDefineBug=function(){if(!Ei)return null;try{return Ei([],"length",{value:1}).length!==1}catch{return!0}};var ki=Ea,Ef=fi,kf=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Sf=Object.prototype.toString,If=Array.prototype.concat,ka=xi,Nf=function(o){return typeof o=="function"&&Sf.call(o)==="[object Function]"},Sa=ki(),wf=function(o,r,a,l){if(r in o){if(l===!0){if(o[r]===a)return}else if(!Nf(l)||!l())return}Sa?ka(o,r,a,!0):ka(o,r,a)},Ia=function(o,r){var a=arguments.length>2?arguments[2]:{},l=Ef(r);kf&&(l=If.call(l,Object.getOwnPropertySymbols(r)));for(var c=0;c<l.length;c+=1)wf(o,l[c],r[l[c]],a[l[c]])};Ia.supportsDescriptors=!!Sa;var $t=Ia,Na={exports:{}},bf=rt,wa=xi,Of=ki(),ba=_i,Oa=St,Tf=bf("%Math.floor%"),Lf=function(r,a){if(typeof r!="function")throw new Oa("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||Tf(a)!==a)throw new Oa("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],c=!0,h=!0;if("length"in r&&ba){var v=ba(r,"length");v&&!v.configurable&&(c=!1),v&&!v.writable&&(h=!1)}return(c||h||!l)&&(Of?wa(r,"length",a,!0,!0):wa(r,"length",a)),r};(function(o){var r=yi,a=rt,l=Lf,c=St,h=a("%Function.prototype.apply%"),v=a("%Function.prototype.call%"),p=a("%Reflect.apply%",!0)||r.call(v,h),_=di(),x=a("%Math.max%");o.exports=function(k){if(typeof k!="function")throw new c("a function is required");var E=p(r,v,arguments);return l(E,1+x(0,k.length-(arguments.length-1)),!0)};var S=function(){return p(r,h,arguments)};_?_(o.exports,"apply",{value:S}):o.exports.apply=S})(Na);var rn=Na.exports,Ta=rt,La=rn,Rf=La(Ta("String.prototype.indexOf")),ze=function(r,a){var l=Ta(r,!!a);return typeof l=="function"&&Rf(r,".prototype.")>-1?La(l):l},Cf=fi,Ra=sr(),Ca=ze,Pa=Object,Pf=Ca("Array.prototype.push"),Aa=Ca("Object.prototype.propertyIsEnumerable"),Af=Ra?Object.getOwnPropertySymbols:null,Ma=function(r,a){if(r==null)throw new TypeError("target must be an object");var l=Pa(r);if(arguments.length===1)return l;for(var c=1;c<arguments.length;++c){var h=Pa(arguments[c]),v=Cf(h),p=Ra&&(Object.getOwnPropertySymbols||Af);if(p)for(var _=p(h),x=0;x<_.length;++x){var S=_[x];Aa(h,S)&&Pf(v,S)}for(var m=0;m<v.length;++m){var k=v[m];if(Aa(h,k)){var E=h[k];l[k]=E}}}return l},Si=Ma,Mf=function(){if(!Object.assign)return!1;for(var o="abcdefghijklmnopqrst",r=o.split(""),a={},l=0;l<r.length;++l)a[r[l]]=r[l];var c=Object.assign({},a),h="";for(var v in c)h+=v;return o!==h},Df=function(){if(!Object.assign||!Object.preventExtensions)return!1;var o=Object.preventExtensions({1:2});try{Object.assign(o,"xy")}catch{return o[1]==="y"}return!1},Da=function(){return!Object.assign||Mf()||Df()?Si:Object.assign},Ff=$t,$f=Da,Gf=function(){var r=$f();return Ff(Object,{assign:r},{assign:function(){return Object.assign!==r}}),r},Bf=$t,qf=rn,zf=Ma,Fa=Da,Yf=Gf,Uf=qf.apply(Fa()),$a=function(r,a){return Uf(Object,arguments)};Bf($a,{getPolyfill:Fa,implementation:zf,shim:Yf});var Xf=$a,Ln=function(){return typeof(function(){}).name=="string"},Rn=Object.getOwnPropertyDescriptor;if(Rn)try{Rn([],"length")}catch{Rn=null}Ln.functionsHaveConfigurableNames=function(){if(!Ln()||!Rn)return!1;var r=Rn(function(){},"name");return!!r&&!!r.configurable};var jf=Function.prototype.bind;Ln.boundFunctionsHaveNames=function(){return Ln()&&typeof jf=="function"&&(function(){}).bind().name!==""};var Vf=Ln,Ga=xi,Wf=ki(),Hf=Vf.functionsHaveConfigurableNames(),Zf=St,Jf=function(r,a){if(typeof r!="function")throw new Zf("`fn` is not a function");var l=arguments.length>2&&!!arguments[2];return(!l||Hf)&&(Wf?Ga(r,"name",a,!0,!0):Ga(r,"name",a)),r},Qf=Jf,Kf=St,eh=Object,Ba=Qf(function(){if(this==null||this!==eh(this))throw new Kf("RegExp.prototype.flags getter called on non-object");var r="";return this.hasIndices&&(r+="d"),this.global&&(r+="g"),this.ignoreCase&&(r+="i"),this.multiline&&(r+="m"),this.dotAll&&(r+="s"),this.unicode&&(r+="u"),this.unicodeSets&&(r+="v"),this.sticky&&(r+="y"),r},"get flags",!0),th=Ba,nh=$t.supportsDescriptors,rh=Object.getOwnPropertyDescriptor,qa=function(){if(nh&&/a/mig.flags==="gim"){var r=rh(RegExp.prototype,"flags");if(r&&typeof r.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var a="",l={};if(Object.defineProperty(l,"hasIndices",{get:function(){a+="d"}}),Object.defineProperty(l,"sticky",{get:function(){a+="y"}}),a==="dy")return r.get}}return th},ih=$t.supportsDescriptors,sh=qa,ah=Object.getOwnPropertyDescriptor,oh=Object.defineProperty,uh=TypeError,za=Object.getPrototypeOf,lh=/a/,ch=function(){if(!ih||!za)throw new uh("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var r=sh(),a=za(lh),l=ah(a,"flags");return(!l||l.get!==r)&&oh(a,"flags",{configurable:!0,enumerable:!1,get:r}),r},fh=$t,hh=rn,gh=Ba,Ya=qa,yh=ch,Ua=hh(Ya());fh(Ua,{getPolyfill:Ya,implementation:gh,shim:yh});var vh=Ua,lr={exports:{}},ph=sr,Gt=function(){return ph()&&!!Symbol.toStringTag},mh=Gt(),dh=ze,Ii=dh("Object.prototype.toString"),cr=function(r){return mh&&r&&typeof r=="object"&&Symbol.toStringTag in r?!1:Ii(r)==="[object Arguments]"},Xa=function(r){return cr(r)?!0:r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&Ii(r)!=="[object Array]"&&Ii(r.callee)==="[object Function]"},_h=function(){return cr(arguments)}();cr.isLegacyArguments=Xa;var ja=_h?cr:Xa;const xh=Cc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ni=typeof Map=="function"&&Map.prototype,wi=Object.getOwnPropertyDescriptor&&Ni?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fr=Ni&&wi&&typeof wi.get=="function"?wi.get:null,Va=Ni&&Map.prototype.forEach,bi=typeof Set=="function"&&Set.prototype,Oi=Object.getOwnPropertyDescriptor&&bi?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,hr=bi&&Oi&&typeof Oi.get=="function"?Oi.get:null,Wa=bi&&Set.prototype.forEach,Eh=typeof WeakMap=="function"&&WeakMap.prototype,Cn=Eh?WeakMap.prototype.has:null,kh=typeof WeakSet=="function"&&WeakSet.prototype,Pn=kh?WeakSet.prototype.has:null,Sh=typeof WeakRef=="function"&&WeakRef.prototype,Ha=Sh?WeakRef.prototype.deref:null,Ih=Boolean.prototype.valueOf,Nh=Object.prototype.toString,wh=Function.prototype.toString,bh=String.prototype.match,Ti=String.prototype.slice,It=String.prototype.replace,Oh=String.prototype.toUpperCase,Za=String.prototype.toLowerCase,Ja=RegExp.prototype.test,Qa=Array.prototype.concat,it=Array.prototype.join,Th=Array.prototype.slice,Ka=Math.floor,Li=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ri=Object.getOwnPropertySymbols,Ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,sn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Oe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===sn||!0)?Symbol.toStringTag:null,eo=Object.prototype.propertyIsEnumerable,to=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(o){return o.__proto__}:null);function no(o,r){if(o===1/0||o===-1/0||o!==o||o&&o>-1e3&&o<1e3||Ja.call(/e/,r))return r;var a=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof o=="number"){var l=o<0?-Ka(-o):Ka(o);if(l!==o){var c=String(l),h=Ti.call(r,c.length+1);return It.call(c,a,"$&_")+"."+It.call(It.call(h,/([0-9]{3})/g,"$&_"),/_$/,"")}}return It.call(r,a,"$&_")}var Pi=xh,ro=Pi.custom,io=oo(ro)?ro:null,Lh=function o(r,a,l,c){var h=a||{};if(Nt(h,"quoteStyle")&&h.quoteStyle!=="single"&&h.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Nt(h,"maxStringLength")&&(typeof h.maxStringLength=="number"?h.maxStringLength<0&&h.maxStringLength!==1/0:h.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var v=Nt(h,"customInspect")?h.customInspect:!0;if(typeof v!="boolean"&&v!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Nt(h,"indent")&&h.indent!==null&&h.indent!==" "&&!(parseInt(h.indent,10)===h.indent&&h.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Nt(h,"numericSeparator")&&typeof h.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=h.numericSeparator;if(typeof r>"u")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return lo(r,h);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var _=String(r);return p?no(r,_):_}if(typeof r=="bigint"){var x=String(r)+"n";return p?no(r,x):x}var S=typeof h.depth>"u"?5:h.depth;if(typeof l>"u"&&(l=0),l>=S&&S>0&&typeof r=="object")return Ai(r)?"[Array]":"[Object]";var m=Wh(h,l);if(typeof c>"u")c=[];else if(uo(c,r)>=0)return"[Circular]";function k(ae,q,ne){if(q&&(c=Th.call(c),c.push(q)),ne){var ue={depth:h.depth};return Nt(h,"quoteStyle")&&(ue.quoteStyle=h.quoteStyle),o(ae,ue,l+1,c)}return o(ae,h,l+1,c)}if(typeof r=="function"&&!ao(r)){var E=Gh(r),N=gr(r,k);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(N.length>0?" { "+it.call(N,", ")+" }":"")}if(oo(r)){var T=sn?It.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ci.call(r);return typeof r=="object"&&!sn?An(T):T}if(Xh(r)){for(var R="<"+Za.call(String(r.nodeName)),A=r.attributes||[],P=0;P<A.length;P++)R+=" "+A[P].name+"="+so(Rh(A[P].value),"double",h);return R+=">",r.childNodes&&r.childNodes.length&&(R+="..."),R+="</"+Za.call(String(r.nodeName))+">",R}if(Ai(r)){if(r.length===0)return"[]";var C=gr(r,k);return m&&!Vh(C)?"["+Di(C,m)+"]":"[ "+it.call(C,", ")+" ]"}if(Ph(r)){var F=gr(r,k);return!("cause"in Error.prototype)&&"cause"in r&&!eo.call(r,"cause")?"{ ["+String(r)+"] "+it.call(Qa.call("[cause]: "+k(r.cause),F),", ")+" }":F.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+it.call(F,", ")+" }"}if(typeof r=="object"&&v){if(io&&typeof r[io]=="function"&&Pi)return Pi(r,{depth:S-l});if(v!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(Bh(r)){var M=[];return Va&&Va.call(r,function(ae,q){M.push(k(q,r,!0)+" => "+k(ae,r))}),co("Map",fr.call(r),M,m)}if(Yh(r)){var B=[];return Wa&&Wa.call(r,function(ae){B.push(k(ae,r))}),co("Set",hr.call(r),B,m)}if(qh(r))return Mi("WeakMap");if(Uh(r))return Mi("WeakSet");if(zh(r))return Mi("WeakRef");if(Mh(r))return An(k(Number(r)));if(Fh(r))return An(k(Li.call(r)));if(Dh(r))return An(Ih.call(r));if(Ah(r))return An(k(String(r)));if(typeof window<"u"&&r===window)return"{ [object Window] }";if(typeof globalThis<"u"&&r===globalThis||typeof On<"u"&&r===On)return"{ [object globalThis] }";if(!Ch(r)&&!ao(r)){var Y=gr(r,k),U=to?to(r)===Object.prototype:r instanceof Object||r.constructor===Object,X=r instanceof Object?"":"null prototype",ie=!U&&Oe&&Object(r)===r&&Oe in r?Ti.call(wt(r),8,-1):X?"Object":"",ee=U||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",te=ee+(ie||X?"["+it.call(Qa.call([],ie||[],X||[]),": ")+"] ":"");return Y.length===0?te+"{}":m?te+"{"+Di(Y,m)+"}":te+"{ "+it.call(Y,", ")+" }"}return String(r)};function so(o,r,a){var l=(a.quoteStyle||r)==="double"?'"':"'";return l+o+l}function Rh(o){return It.call(String(o),/"/g,""")}function Ai(o){return wt(o)==="[object Array]"&&(!Oe||!(typeof o=="object"&&Oe in o))}function Ch(o){return wt(o)==="[object Date]"&&(!Oe||!(typeof o=="object"&&Oe in o))}function ao(o){return wt(o)==="[object RegExp]"&&(!Oe||!(typeof o=="object"&&Oe in o))}function Ph(o){return wt(o)==="[object Error]"&&(!Oe||!(typeof o=="object"&&Oe in o))}function Ah(o){return wt(o)==="[object String]"&&(!Oe||!(typeof o=="object"&&Oe in o))}function Mh(o){return wt(o)==="[object Number]"&&(!Oe||!(typeof o=="object"&&Oe in o))}function Dh(o){return wt(o)==="[object Boolean]"&&(!Oe||!(typeof o=="object"&&Oe in o))}function oo(o){if(sn)return o&&typeof o=="object"&&o instanceof Symbol;if(typeof o=="symbol")return!0;if(!o||typeof o!="object"||!Ci)return!1;try{return Ci.call(o),!0}catch{}return!1}function Fh(o){if(!o||typeof o!="object"||!Li)return!1;try{return Li.call(o),!0}catch{}return!1}var $h=Object.prototype.hasOwnProperty||function(o){return o in this};function Nt(o,r){return $h.call(o,r)}function wt(o){return Nh.call(o)}function Gh(o){if(o.name)return o.name;var r=bh.call(wh.call(o),/^function\s*([\w$]+)/);return r?r[1]:null}function uo(o,r){if(o.indexOf)return o.indexOf(r);for(var a=0,l=o.length;a<l;a++)if(o[a]===r)return a;return-1}function Bh(o){if(!fr||!o||typeof o!="object")return!1;try{fr.call(o);try{hr.call(o)}catch{return!0}return o instanceof Map}catch{}return!1}function qh(o){if(!Cn||!o||typeof o!="object")return!1;try{Cn.call(o,Cn);try{Pn.call(o,Pn)}catch{return!0}return o instanceof WeakMap}catch{}return!1}function zh(o){if(!Ha||!o||typeof o!="object")return!1;try{return Ha.call(o),!0}catch{}return!1}function Yh(o){if(!hr||!o||typeof o!="object")return!1;try{hr.call(o);try{fr.call(o)}catch{return!0}return o instanceof Set}catch{}return!1}function Uh(o){if(!Pn||!o||typeof o!="object")return!1;try{Pn.call(o,Pn);try{Cn.call(o,Cn)}catch{return!0}return o instanceof WeakSet}catch{}return!1}function Xh(o){return!o||typeof o!="object"?!1:typeof HTMLElement<"u"&&o instanceof HTMLElement?!0:typeof o.nodeName=="string"&&typeof o.getAttribute=="function"}function lo(o,r){if(o.length>r.maxStringLength){var a=o.length-r.maxStringLength,l="... "+a+" more character"+(a>1?"s":"");return lo(Ti.call(o,0,r.maxStringLength),r)+l}var c=It.call(It.call(o,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,jh);return so(c,"single",r)}function jh(o){var r=o.charCodeAt(0),a={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return a?"\\"+a:"\\x"+(r<16?"0":"")+Oh.call(r.toString(16))}function An(o){return"Object("+o+")"}function Mi(o){return o+" { ? }"}function co(o,r,a,l){var c=l?Di(a,l):it.call(a,", ");return o+" ("+r+") {"+c+"}"}function Vh(o){for(var r=0;r<o.length;r++)if(uo(o[r],`
|
|
2
|
-
`)>=0)return!1;return!0}function Wh(o,r){var a;if(o.indent===" ")a=" ";else if(typeof o.indent=="number"&&o.indent>0)a=it.call(Array(o.indent+1)," ");else return null;return{base:a,prev:it.call(Array(r+1),a)}}function Di(o,r){if(o.length===0)return"";var a=`
|
|
3
|
-
`+r.prev+r.base;return a+it.call(o,","+a)+`
|
|
4
|
-
`+r.prev}function gr(o,r){var a=Ai(o),l=[];if(a){l.length=o.length;for(var c=0;c<o.length;c++)l[c]=Nt(o,c)?r(o[c],o):""}var h=typeof Ri=="function"?Ri(o):[],v;if(sn){v={};for(var p=0;p<h.length;p++)v["$"+h[p]]=h[p]}for(var _ in o)Nt(o,_)&&(a&&String(Number(_))===_&&_<o.length||sn&&v["$"+_]instanceof Symbol||(Ja.call(/[^\w$]/,_)?l.push(r(_,o)+": "+r(o[_],o)):l.push(_+": "+r(o[_],o))));if(typeof Ri=="function")for(var x=0;x<h.length;x++)eo.call(o,h[x])&&l.push("["+r(h[x])+"]: "+r(o[h[x]],o));return l}var fo=rt,an=ze,Hh=Lh,Zh=St,yr=fo("%WeakMap%",!0),vr=fo("%Map%",!0),Jh=an("WeakMap.prototype.get",!0),Qh=an("WeakMap.prototype.set",!0),Kh=an("WeakMap.prototype.has",!0),eg=an("Map.prototype.get",!0),tg=an("Map.prototype.set",!0),ng=an("Map.prototype.has",!0),Fi=function(o,r){for(var a=o,l;(l=a.next)!==null;a=l)if(l.key===r)return a.next=l.next,l.next=o.next,o.next=l,l},rg=function(o,r){var a=Fi(o,r);return a&&a.value},ig=function(o,r,a){var l=Fi(o,r);l?l.value=a:o.next={key:r,next:o.next,value:a}},sg=function(o,r){return!!Fi(o,r)},ho=function(){var r,a,l,c={assert:function(h){if(!c.has(h))throw new Zh("Side channel does not contain "+Hh(h))},get:function(h){if(yr&&h&&(typeof h=="object"||typeof h=="function")){if(r)return Jh(r,h)}else if(vr){if(a)return eg(a,h)}else if(l)return rg(l,h)},has:function(h){if(yr&&h&&(typeof h=="object"||typeof h=="function")){if(r)return Kh(r,h)}else if(vr){if(a)return ng(a,h)}else if(l)return sg(l,h);return!1},set:function(h,v){yr&&h&&(typeof h=="object"||typeof h=="function")?(r||(r=new yr),Qh(r,h,v)):vr?(a||(a=new vr),tg(a,h,v)):(l||(l={key:{},next:null}),ig(l,h,v))}};return c},ag=ya,Mn=ho(),vt=St,$i={assert:function(o,r){if(!o||typeof o!="object"&&typeof o!="function")throw new vt("`O` is not an object");if(typeof r!="string")throw new vt("`slot` must be a string");if(Mn.assert(o),!$i.has(o,r))throw new vt("`"+r+"` is not present on `O`")},get:function(o,r){if(!o||typeof o!="object"&&typeof o!="function")throw new vt("`O` is not an object");if(typeof r!="string")throw new vt("`slot` must be a string");var a=Mn.get(o);return a&&a["$"+r]},has:function(o,r){if(!o||typeof o!="object"&&typeof o!="function")throw new vt("`O` is not an object");if(typeof r!="string")throw new vt("`slot` must be a string");var a=Mn.get(o);return!!a&&ag(a,"$"+r)},set:function(o,r,a){if(!o||typeof o!="object"&&typeof o!="function")throw new vt("`O` is not an object");if(typeof r!="string")throw new vt("`slot` must be a string");var l=Mn.get(o);l||(l={},Mn.set(o,l)),l["$"+r]=a}};Object.freeze&&Object.freeze($i);var og=$i,Dn=og,ug=SyntaxError,go=typeof StopIteration=="object"?StopIteration:null,lg=function(r){if(!go)throw new ug("this environment lacks StopIteration");Dn.set(r,"[[Done]]",!1);var a={next:function(){var c=Dn.get(this,"[[Iterator]]"),h=Dn.get(c,"[[Done]]");try{return{done:h,value:h?void 0:c.next()}}catch(v){if(Dn.set(c,"[[Done]]",!0),v!==go)throw v;return{done:!0,value:void 0}}}};return Dn.set(a,"[[Iterator]]",r),a},cg={}.toString,yo=Array.isArray||function(o){return cg.call(o)=="[object Array]"},fg=String.prototype.valueOf,hg=function(r){try{return fg.call(r),!0}catch{return!1}},gg=Object.prototype.toString,yg="[object String]",vg=Gt(),vo=function(r){return typeof r=="string"?!0:typeof r!="object"?!1:vg?hg(r):gg.call(r)===yg},Gi=typeof Map=="function"&&Map.prototype?Map:null,pg=typeof Set=="function"&&Set.prototype?Set:null,pr;Gi||(pr=function(r){return!1});var po=Gi?Map.prototype.has:null,mo=pg?Set.prototype.has:null;!pr&&!po&&(pr=function(r){return!1});var _o=pr||function(r){if(!r||typeof r!="object")return!1;try{if(po.call(r),mo)try{mo.call(r)}catch{return!0}return r instanceof Gi}catch{}return!1},mg=typeof Map=="function"&&Map.prototype?Map:null,Bi=typeof Set=="function"&&Set.prototype?Set:null,mr;Bi||(mr=function(r){return!1});var xo=mg?Map.prototype.has:null,Eo=Bi?Set.prototype.has:null;!mr&&!Eo&&(mr=function(r){return!1});var ko=mr||function(r){if(!r||typeof r!="object")return!1;try{if(Eo.call(r),xo)try{xo.call(r)}catch{return!0}return r instanceof Bi}catch{}return!1},So=ja,Io=lg;if(hi()||sr()){var qi=Symbol.iterator;lr.exports=function(r){if(r!=null&&typeof r[qi]<"u")return r[qi]();if(So(r))return Array.prototype[qi].call(r)}}else{var dg=yo,_g=vo,No=rt,xg=No("%Map%",!0),Eg=No("%Set%",!0),Je=ze,wo=Je("Array.prototype.push"),bo=Je("String.prototype.charCodeAt"),kg=Je("String.prototype.slice"),Sg=function(r,a){var l=r.length;if(a+1>=l)return a+1;var c=bo(r,a);if(c<55296||c>56319)return a+1;var h=bo(r,a+1);return h<56320||h>57343?a+1:a+2},zi=function(r){var a=0;return{next:function(){var c=a>=r.length,h;return c||(h=r[a],a+=1),{done:c,value:h}}}},Oo=function(r,a){if(dg(r)||So(r))return zi(r);if(_g(r)){var l=0;return{next:function(){var h=Sg(r,l),v=kg(r,l,h);return l=h,{done:h>r.length,value:v}}}}if(a&&typeof r["_es6-shim iterator_"]<"u")return r["_es6-shim iterator_"]()};if(!xg&&!Eg)lr.exports=function(r){if(r!=null)return Oo(r,!0)};else{var Ig=_o,Ng=ko,To=Je("Map.prototype.forEach",!0),Lo=Je("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var Ro=Je("Map.prototype.iterator",!0),Co=Je("Set.prototype.iterator",!0);var Po=Je("Map.prototype.@@iterator",!0)||Je("Map.prototype._es6-shim iterator_",!0),Ao=Je("Set.prototype.@@iterator",!0)||Je("Set.prototype._es6-shim iterator_",!0),wg=function(r){if(Ig(r)){if(Ro)return Io(Ro(r));if(Po)return Po(r);if(To){var a=[];return To(r,function(c,h){wo(a,[h,c])}),zi(a)}}if(Ng(r)){if(Co)return Io(Co(r));if(Ao)return Ao(r);if(Lo){var l=[];return Lo(r,function(c){wo(l,c)}),zi(l)}}};lr.exports=function(r){return wg(r)||Oo(r)}}}var bg=lr.exports,Mo=function(o){return o!==o},Do=function(r,a){return r===0&&a===0?1/r===1/a:!!(r===a||Mo(r)&&Mo(a))},Og=Do,Fo=function(){return typeof Object.is=="function"?Object.is:Og},Tg=Fo,Lg=$t,Rg=function(){var r=Tg();return Lg(Object,{is:r},{is:function(){return Object.is!==r}}),r},Cg=$t,Pg=rn,Ag=Do,$o=Fo,Mg=Rg,Go=Pg($o(),Object);Cg(Go,{getPolyfill:$o,implementation:Ag,shim:Mg});var Dg=Go,Fg=rn,Bo=ze,$g=rt,Yi=$g("%ArrayBuffer%",!0),dr=Bo("ArrayBuffer.prototype.byteLength",!0),Gg=Bo("Object.prototype.toString"),qo=!!Yi&&!dr&&new Yi(0).slice,zo=!!qo&&Fg(qo),Yo=dr||zo?function(r){if(!r||typeof r!="object")return!1;try{return dr?dr(r):zo(r,0),!0}catch{return!1}}:Yi?function(r){return Gg(r)==="[object ArrayBuffer]"}:function(r){return!1},Bg=Date.prototype.getDay,qg=function(r){try{return Bg.call(r),!0}catch{return!1}},zg=Object.prototype.toString,Yg="[object Date]",Ug=Gt(),Xg=function(r){return typeof r!="object"||r===null?!1:Ug?qg(r):zg.call(r)===Yg},Ui=ze,Uo=Gt(),Xo,jo,Xi,ji;if(Uo){Xo=Ui("Object.prototype.hasOwnProperty"),jo=Ui("RegExp.prototype.exec"),Xi={};var Vi=function(){throw Xi};ji={toString:Vi,valueOf:Vi},typeof Symbol.toPrimitive=="symbol"&&(ji[Symbol.toPrimitive]=Vi)}var jg=Ui("Object.prototype.toString"),Vg=Object.getOwnPropertyDescriptor,Wg="[object RegExp]",Hg=Uo?function(r){if(!r||typeof r!="object")return!1;var a=Vg(r,"lastIndex"),l=a&&Xo(a,"value");if(!l)return!1;try{jo(r,ji)}catch(c){return c===Xi}}:function(r){return!r||typeof r!="object"&&typeof r!="function"?!1:jg(r)===Wg},Zg=ze,Vo=Zg("SharedArrayBuffer.prototype.byteLength",!0),Jg=Vo?function(r){if(!r||typeof r!="object")return!1;try{return Vo(r),!0}catch{return!1}}:function(r){return!1},Qg=Number.prototype.toString,Kg=function(r){try{return Qg.call(r),!0}catch{return!1}},ey=Object.prototype.toString,ty="[object Number]",ny=Gt(),ry=function(r){return typeof r=="number"?!0:typeof r!="object"?!1:ny?Kg(r):ey.call(r)===ty},Wo=ze,iy=Wo("Boolean.prototype.toString"),sy=Wo("Object.prototype.toString"),ay=function(r){try{return iy(r),!0}catch{return!1}},oy="[object Boolean]",uy=Gt(),ly=function(r){return typeof r=="boolean"?!0:r===null||typeof r!="object"?!1:uy&&Symbol.toStringTag in r?ay(r):sy(r)===oy},Wi={exports:{}},cy=Object.prototype.toString,fy=hi();if(fy){var hy=Symbol.prototype.toString,gy=/^Symbol\(.*\)$/,yy=function(r){return typeof r.valueOf()!="symbol"?!1:gy.test(hy.call(r))};Wi.exports=function(r){if(typeof r=="symbol")return!0;if(cy.call(r)!=="[object Symbol]")return!1;try{return yy(r)}catch{return!1}}}else Wi.exports=function(r){return!1};var vy=Wi.exports,Hi={exports:{}},Ho=typeof BigInt<"u"&&BigInt,py=function(){return typeof Ho=="function"&&typeof BigInt=="function"&&typeof Ho(42)=="bigint"&&typeof BigInt(42)=="bigint"},my=py();if(my){var dy=BigInt.prototype.valueOf,_y=function(r){try{return dy.call(r),!0}catch{}return!1};Hi.exports=function(r){return r===null||typeof r>"u"||typeof r=="boolean"||typeof r=="string"||typeof r=="number"||typeof r=="symbol"||typeof r=="function"?!1:typeof r=="bigint"?!0:_y(r)}}else Hi.exports=function(r){return!1};var xy=Hi.exports,Ey=vo,ky=ry,Sy=ly,Iy=vy,Ny=xy,wy=function(r){if(r==null||typeof r!="object"&&typeof r!="function")return null;if(Ey(r))return"String";if(ky(r))return"Number";if(Sy(r))return"Boolean";if(Iy(r))return"Symbol";if(Ny(r))return"BigInt"},_r=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Zo=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,xr;_r||(xr=function(r){return!1});var Zi=_r?_r.prototype.has:null,Ji=Zo?Zo.prototype.has:null;!xr&&!Zi&&(xr=function(r){return!1});var by=xr||function(r){if(!r||typeof r!="object")return!1;try{if(Zi.call(r,Zi),Ji)try{Ji.call(r,Ji)}catch{return!0}return r instanceof _r}catch{}return!1},Qi={exports:{}},Oy=rt,Jo=ze,Ty=Oy("%WeakSet%",!0),Ki=Jo("WeakSet.prototype.has",!0);if(Ki){var es=Jo("WeakMap.prototype.has",!0);Qi.exports=function(r){if(!r||typeof r!="object")return!1;try{if(Ki(r,Ki),es)try{es(r,es)}catch{return!0}return r instanceof Ty}catch{}return!1}}else Qi.exports=function(r){return!1};var Ly=Qi.exports,Ry=_o,Cy=ko,Py=by,Ay=Ly,My=function(r){if(r&&typeof r=="object"){if(Ry(r))return"Map";if(Cy(r))return"Set";if(Py(r))return"WeakMap";if(Ay(r))return"WeakSet"}return!1},Qo=Function.prototype.toString,on=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ts,Er;if(typeof on=="function"&&typeof Object.defineProperty=="function")try{ts=Object.defineProperty({},"length",{get:function(){throw Er}}),Er={},on(function(){throw 42},null,ts)}catch(o){o!==Er&&(on=null)}else on=null;var Dy=/^\s*class\b/,ns=function(r){try{var a=Qo.call(r);return Dy.test(a)}catch{return!1}},rs=function(r){try{return ns(r)?!1:(Qo.call(r),!0)}catch{return!1}},kr=Object.prototype.toString,Fy="[object Object]",$y="[object Function]",Gy="[object GeneratorFunction]",By="[object HTMLAllCollection]",qy="[object HTML document.all class]",zy="[object HTMLCollection]",Yy=typeof Symbol=="function"&&!!Symbol.toStringTag,Uy=!(0 in[,]),is=function(){return!1};if(typeof document=="object"){var Xy=document.all;kr.call(Xy)===kr.call(document.all)&&(is=function(r){if((Uy||!r)&&(typeof r>"u"||typeof r=="object"))try{var a=kr.call(r);return(a===By||a===qy||a===zy||a===Fy)&&r("")==null}catch{}return!1})}var jy=on?function(r){if(is(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;try{on(r,null,ts)}catch(a){if(a!==Er)return!1}return!ns(r)&&rs(r)}:function(r){if(is(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;if(Yy)return rs(r);if(ns(r))return!1;var a=kr.call(r);return a!==$y&&a!==Gy&&!/^\[object HTML/.test(a)?!1:rs(r)},Vy=jy,Wy=Object.prototype.toString,Ko=Object.prototype.hasOwnProperty,Hy=function(r,a,l){for(var c=0,h=r.length;c<h;c++)Ko.call(r,c)&&(l==null?a(r[c],c,r):a.call(l,r[c],c,r))},Zy=function(r,a,l){for(var c=0,h=r.length;c<h;c++)l==null?a(r.charAt(c),c,r):a.call(l,r.charAt(c),c,r)},Jy=function(r,a,l){for(var c in r)Ko.call(r,c)&&(l==null?a(r[c],c,r):a.call(l,r[c],c,r))},Qy=function(r,a,l){if(!Vy(a))throw new TypeError("iterator must be a function");var c;arguments.length>=3&&(c=l),Wy.call(r)==="[object Array]"?Hy(r,a,c):typeof r=="string"?Zy(r,a,c):Jy(r,a,c)},Ky=Qy,ev=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ss=ev,tv=typeof globalThis>"u"?On:globalThis,nv=function(){for(var r=[],a=0;a<ss.length;a++)typeof tv[ss[a]]=="function"&&(r[r.length]=ss[a]);return r},Sr=Ky,rv=nv,eu=rn,as=ze,Ir=_i,iv=as("Object.prototype.toString"),tu=Gt(),nu=typeof globalThis>"u"?On:globalThis,os=rv(),us=as("String.prototype.slice"),ls=Object.getPrototypeOf,sv=as("Array.prototype.indexOf",!0)||function(r,a){for(var l=0;l<r.length;l+=1)if(r[l]===a)return l;return-1},Nr={__proto__:null};tu&&Ir&&ls?Sr(os,function(o){var r=new nu[o];if(Symbol.toStringTag in r){var a=ls(r),l=Ir(a,Symbol.toStringTag);if(!l){var c=ls(a);l=Ir(c,Symbol.toStringTag)}Nr["$"+o]=eu(l.get)}}):Sr(os,function(o){var r=new nu[o],a=r.slice||r.set;a&&(Nr["$"+o]=eu(a))});var av=function(r){var a=!1;return Sr(Nr,function(l,c){if(!a)try{"$"+l(r)===c&&(a=us(c,1))}catch{}}),a},ov=function(r){var a=!1;return Sr(Nr,function(l,c){if(!a)try{l(r),a=us(c,1)}catch{}}),a},uv=function(r){if(!r||typeof r!="object")return!1;if(!tu){var a=us(iv(r),8,-1);return sv(os,a)>-1?a:a!=="Object"?!1:ov(r)}return Ir?av(r):null},lv=ze,ru=lv("ArrayBuffer.prototype.byteLength",!0),cv=Yo,fv=function(r){return cv(r)?ru?ru(r):r.byteLength:NaN},iu=Xf,st=ze,su=vh,hv=rt,un=bg,gv=ho,au=Dg,ou=ja,uu=yo,lu=Yo,cu=Xg,fu=Hg,hu=Jg,gu=fi,yu=wy,vu=My,pu=uv,mu=fv,du=st("SharedArrayBuffer.prototype.byteLength",!0),_u=st("Date.prototype.getTime"),cs=Object.getPrototypeOf,xu=st("Object.prototype.toString"),wr=hv("%Set%",!0),fs=st("Map.prototype.has",!0),br=st("Map.prototype.get",!0),Eu=st("Map.prototype.size",!0),Or=st("Set.prototype.add",!0),ku=st("Set.prototype.delete",!0),Tr=st("Set.prototype.has",!0),Lr=st("Set.prototype.size",!0);function Su(o,r,a,l){for(var c=un(o),h;(h=c.next())&&!h.done;)if(Qe(r,h.value,a,l))return ku(o,h.value),!0;return!1}function Iu(o){if(typeof o>"u")return null;if(typeof o!="object")return typeof o=="symbol"?!1:typeof o=="string"||typeof o=="number"?+o==+o:!0}function yv(o,r,a,l,c,h){var v=Iu(a);if(v!=null)return v;var p=br(r,v),_=iu({},c,{strict:!1});return typeof p>"u"&&!fs(r,v)||!Qe(l,p,_,h)?!1:!fs(o,v)&&Qe(l,p,_,h)}function vv(o,r,a){var l=Iu(a);return l??(Tr(r,l)&&!Tr(o,l))}function Nu(o,r,a,l,c,h){for(var v=un(o),p,_;(p=v.next())&&!p.done;)if(_=p.value,Qe(a,_,c,h)&&Qe(l,br(r,_),c,h))return ku(o,_),!0;return!1}function Qe(o,r,a,l){var c=a||{};if(c.strict?au(o,r):o===r)return!0;var h=yu(o),v=yu(r);if(h!==v)return!1;if(!o||!r||typeof o!="object"&&typeof r!="object")return c.strict?au(o,r):o==r;var p=l.has(o),_=l.has(r),x;if(p&&_){if(l.get(o)===l.get(r))return!0}else x={};return p||l.set(o,x),_||l.set(r,x),dv(o,r,c,l)}function wu(o){return!o||typeof o!="object"||typeof o.length!="number"||typeof o.copy!="function"||typeof o.slice!="function"||o.length>0&&typeof o[0]!="number"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function pv(o,r,a,l){if(Lr(o)!==Lr(r))return!1;for(var c=un(o),h=un(r),v,p,_;(v=c.next())&&!v.done;)if(v.value&&typeof v.value=="object")_||(_=new wr),Or(_,v.value);else if(!Tr(r,v.value)){if(a.strict||!vv(o,r,v.value))return!1;_||(_=new wr),Or(_,v.value)}if(_){for(;(p=h.next())&&!p.done;)if(p.value&&typeof p.value=="object"){if(!Su(_,p.value,a.strict,l))return!1}else if(!a.strict&&!Tr(o,p.value)&&!Su(_,p.value,a.strict,l))return!1;return Lr(_)===0}return!0}function mv(o,r,a,l){if(Eu(o)!==Eu(r))return!1;for(var c=un(o),h=un(r),v,p,_,x,S,m;(v=c.next())&&!v.done;)if(x=v.value[0],S=v.value[1],x&&typeof x=="object")_||(_=new wr),Or(_,x);else if(m=br(r,x),typeof m>"u"&&!fs(r,x)||!Qe(S,m,a,l)){if(a.strict||!yv(o,r,x,S,a,l))return!1;_||(_=new wr),Or(_,x)}if(_){for(;(p=h.next())&&!p.done;)if(x=p.value[0],m=p.value[1],x&&typeof x=="object"){if(!Nu(_,o,x,m,a,l))return!1}else if(!a.strict&&(!o.has(x)||!Qe(br(o,x),m,a,l))&&!Nu(_,o,x,m,iu({},a,{strict:!1}),l))return!1;return Lr(_)===0}return!0}function dv(o,r,a,l){var c,h;if(typeof o!=typeof r||o==null||r==null||xu(o)!==xu(r)||ou(o)!==ou(r))return!1;var v=uu(o),p=uu(r);if(v!==p)return!1;var _=o instanceof Error,x=r instanceof Error;if(_!==x||(_||x)&&(o.name!==r.name||o.message!==r.message))return!1;var S=fu(o),m=fu(r);if(S!==m||(S||m)&&(o.source!==r.source||su(o)!==su(r)))return!1;var k=cu(o),E=cu(r);if(k!==E||(k||E)&&_u(o)!==_u(r)||a.strict&&cs&&cs(o)!==cs(r))return!1;var N=pu(o),T=pu(r);if(N!==T)return!1;if(N||T){if(o.length!==r.length)return!1;for(c=0;c<o.length;c++)if(o[c]!==r[c])return!1;return!0}var R=wu(o),A=wu(r);if(R!==A)return!1;if(R||A){if(o.length!==r.length)return!1;for(c=0;c<o.length;c++)if(o[c]!==r[c])return!1;return!0}var P=lu(o),C=lu(r);if(P!==C)return!1;if(P||C)return mu(o)!==mu(r)?!1:typeof Uint8Array=="function"&&Qe(new Uint8Array(o),new Uint8Array(r),a,l);var F=hu(o),M=hu(r);if(F!==M)return!1;if(F||M)return du(o)!==du(r)?!1:typeof Uint8Array=="function"&&Qe(new Uint8Array(o),new Uint8Array(r),a,l);if(typeof o!=typeof r)return!1;var B=gu(o),Y=gu(r);if(B.length!==Y.length)return!1;for(B.sort(),Y.sort(),c=B.length-1;c>=0;c--)if(B[c]!=Y[c])return!1;for(c=B.length-1;c>=0;c--)if(h=B[c],!Qe(o[h],r[h],a,l))return!1;var U=vu(o),X=vu(r);return U!==X?!1:U==="Set"||X==="Set"?pv(o,r,a,l):U==="Map"?mv(o,r,a,l):!0}var _v=function(r,a,l){return Qe(r,a,l,gv())};const xv=sa(_v);var Ev=Object.defineProperty,he=(o,r)=>Ev(o,"name",{value:r,configurable:!0}),kv=class{constructor(r){this.direction=!1,this.compareProperties=!0;var a,l,c;this.precision=10**-((a=r==null?void 0:r.precision)!=null?a:17),this.direction=(l=r==null?void 0:r.direction)!=null?l:!1,this.compareProperties=(c=r==null?void 0:r.compareProperties)!=null?c:!0}compare(r,a){if(r.type!==a.type||!Fn(r,a))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,a.coordinates);case"LineString":return this.compareLine(r.coordinates,a.coordinates);case"Polygon":return this.comparePolygon(r,a);case"GeometryCollection":return this.compareGeometryCollection(r,a);case"Feature":return this.compareFeature(r,a);case"FeatureCollection":return this.compareFeatureCollection(r,a);default:if(r.type.startsWith("Multi")){const l=hs(r),c=hs(a);return l.every(h=>c.some(v=>this.compare(h,v)))}}return!1}compareCoord(r,a){return r.length===a.length&&r.every((l,c)=>Math.abs(l-a[c])<this.precision)}compareLine(r,a,l=0,c=!1){if(!Fn(r,a))return!1;const h=r;let v=a;if(c&&!this.compareCoord(h[0],v[0])){const _=this.fixStartIndex(v,h);if(_)v=_;else return!1}const p=this.compareCoord(h[l],v[l]);return this.direction||p?this.comparePath(h,v):this.compareCoord(h[l],v[v.length-(1+l)])?this.comparePath(h.slice().reverse(),v):!1}fixStartIndex(r,a){let l,c=-1;for(let h=0;h<r.length;h++)if(this.compareCoord(r[h],a[0])){c=h;break}return c>=0&&(l=[].concat(r.slice(c,r.length),r.slice(1,c+1))),l}comparePath(r,a){return r.every((l,c)=>this.compareCoord(l,a[c]))}comparePolygon(r,a){if(this.compareLine(r.coordinates[0],a.coordinates[0],1,!0)){const l=r.coordinates.slice(1,r.coordinates.length),c=a.coordinates.slice(1,a.coordinates.length);return l.every(h=>c.some(v=>this.compareLine(h,v,1,!0)))}return!1}compareGeometryCollection(r,a){return Fn(r.geometries,a.geometries)&&this.compareBBox(r,a)&&r.geometries.every((l,c)=>this.compare(l,a.geometries[c]))}compareFeature(r,a){return r.id===a.id&&(this.compareProperties?xv(r.properties,a.properties):!0)&&this.compareBBox(r,a)&&this.compare(r.geometry,a.geometry)}compareFeatureCollection(r,a){return Fn(r.features,a.features)&&this.compareBBox(r,a)&&r.features.every((l,c)=>this.compare(l,a.features[c]))}compareBBox(r,a){return!r.bbox&&!a.bbox||(r.bbox&&a.bbox?this.compareCoord(r.bbox,a.bbox):!1)}};he(kv,"GeojsonEquality");function Fn(o,r){return o.coordinates?o.coordinates.length===r.coordinates.length:o.length===r.length}he(Fn,"sameLength");function hs(o){return o.coordinates.map(r=>({type:o.type.replace("Multi",""),coordinates:r}))}he(hs,"explode");var Ae=63710088e-1,bu={centimeters:Ae*100,centimetres:Ae*100,degrees:360/(2*Math.PI),feet:Ae*3.28084,inches:Ae*39.37,kilometers:Ae/1e3,kilometres:Ae/1e3,meters:Ae,metres:Ae,miles:Ae/1609.344,millimeters:Ae*1e3,millimetres:Ae*1e3,nauticalmiles:Ae/1852,radians:1,yards:Ae*1.0936},Ou={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ye(o,r,a={}){const l={type:"Feature"};return(a.id===0||a.id)&&(l.id=a.id),a.bbox&&(l.bbox=a.bbox),l.properties=r||{},l.geometry=o,l}he(Ye,"feature");function Sv(o,r,a={}){switch(o){case"Point":return at(r).geometry;case"LineString":return pt(r).geometry;case"Polygon":return ln(r).geometry;case"MultiPoint":return Lu(r).geometry;case"MultiLineString":return Tu(r).geometry;case"MultiPolygon":return Rr(r).geometry;default:throw new Error(o+" is invalid")}}he(Sv,"geometry");function at(o,r,a={}){if(!o)throw new Error("coordinates is required");if(!Array.isArray(o))throw new Error("coordinates must be an Array");if(o.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Pr(o[0])||!Pr(o[1]))throw new Error("coordinates must contain numbers");return Ye({type:"Point",coordinates:o},r,a)}he(at,"point");function Iv(o,r,a={}){return ot(o.map(l=>at(l,r)),a)}he(Iv,"points");function ln(o,r,a={}){for(const c of o){if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(c[c.length-1].length!==c[0].length)throw new Error("First and last Position are not equivalent.");for(let h=0;h<c[c.length-1].length;h++)if(c[c.length-1][h]!==c[0][h])throw new Error("First and last Position are not equivalent.")}return Ye({type:"Polygon",coordinates:o},r,a)}he(ln,"polygon");function Nv(o,r,a={}){return ot(o.map(l=>ln(l,r)),a)}he(Nv,"polygons");function pt(o,r,a={}){if(o.length<2)throw new Error("coordinates must be an array of two or more positions");return Ye({type:"LineString",coordinates:o},r,a)}he(pt,"lineString");function wv(o,r,a={}){return ot(o.map(l=>pt(l,r)),a)}he(wv,"lineStrings");function ot(o,r={}){const a={type:"FeatureCollection"};return r.id&&(a.id=r.id),r.bbox&&(a.bbox=r.bbox),a.features=o,a}he(ot,"featureCollection");function Tu(o,r,a={}){return Ye({type:"MultiLineString",coordinates:o},r,a)}he(Tu,"multiLineString");function Lu(o,r,a={}){return Ye({type:"MultiPoint",coordinates:o},r,a)}he(Lu,"multiPoint");function Rr(o,r,a={}){return Ye({type:"MultiPolygon",coordinates:o},r,a)}he(Rr,"multiPolygon");function bv(o,r,a={}){return Ye({type:"GeometryCollection",geometries:o},r,a)}he(bv,"geometryCollection");function Ov(o,r=0){if(r&&!(r>=0))throw new Error("precision must be a positive number");const a=Math.pow(10,r||0);return Math.round(o*a)/a}he(Ov,"round");function gs(o,r="kilometers"){const a=bu[r];if(!a)throw new Error(r+" units is invalid");return o*a}he(gs,"radiansToLength");function Cr(o,r="kilometers"){const a=bu[r];if(!a)throw new Error(r+" units is invalid");return o/a}he(Cr,"lengthToRadians");function Tv(o,r){return Ru(Cr(o,r))}he(Tv,"lengthToDegrees");function Lv(o){let r=o%360;return r<0&&(r+=360),r}he(Lv,"bearingToAzimuth");function Ru(o){return o%(2*Math.PI)*180/Math.PI}he(Ru,"radiansToDegrees");function Rv(o){return o%360*Math.PI/180}he(Rv,"degreesToRadians");function Cv(o,r="kilometers",a="kilometers"){if(!(o>=0))throw new Error("length must be a positive number");return gs(Cr(o,r),a)}he(Cv,"convertLength");function Pv(o,r="meters",a="kilometers"){if(!(o>=0))throw new Error("area must be a positive number");const l=Ou[r];if(!l)throw new Error("invalid original units");const c=Ou[a];if(!c)throw new Error("invalid final units");return o/l*c}he(Pv,"convertArea");function Pr(o){return!isNaN(o)&&o!==null&&!Array.isArray(o)}he(Pr,"isNumber");function ys(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}he(ys,"isObject");function Av(o){if(!o)throw new Error("bbox is required");if(!Array.isArray(o))throw new Error("bbox must be an Array");if(o.length!==4&&o.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");o.forEach(r=>{if(!Pr(r))throw new Error("bbox must only contain numbers")})}he(Av,"validateBBox");function Mv(o){if(!o)throw new Error("id is required");if(["string","number"].indexOf(typeof o)===-1)throw new Error("id must be a number or a string")}he(Mv,"validateId");/**
|
|
1
|
+
(function(M,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],L):(M=typeof globalThis<"u"?globalThis:M||self,L(M.leafletMaptilerGeocodingController={},M.L))})(this,function(M,L){"use strict";var un=Object.defineProperty;var fn=(M,L,j)=>L in M?un(M,L,{enumerable:!0,configurable:!0,writable:!0,value:j}):M[L]=j;var _t=(M,L,j)=>fn(M,typeof L!="symbol"?L+"":L,j);function j(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const Q=j(L);function V(r,t,e={}){const n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function lt(r,t,e={}){for(const i of r){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return V({type:"Polygon",coordinates:r},t,e)}function Z(r,t={}){const e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Pt(r,t,e={}){return V({type:"MultiPolygon",coordinates:r},t,e)}function Mt(r,t,e){if(r!==null)for(var n,i,o,l,u,c,f,p=0,s=0,a,h=r.type,g=h==="FeatureCollection",y=h==="Feature",d=g?r.features.length:1,x=0;x<d;x++){f=g?r.features[x].geometry:y?r.geometry:r,a=f?f.type==="GeometryCollection":!1,u=a?f.geometries.length:1;for(var v=0;v<u;v++){var m=0,b=0;if(l=a?f.geometries[v]:f,l!==null){c=l.coordinates;var w=l.type;switch(p=0,w){case null:break;case"Point":if(t(c,s,x,m,b)===!1)return!1;s++,m++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],s,x,m,b)===!1)return!1;s++,w==="MultiPoint"&&m++}w==="LineString"&&m++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-p;i++){if(t(c[n][i],s,x,m,b)===!1)return!1;s++}w==="MultiLineString"&&m++,w==="Polygon"&&b++}w==="Polygon"&&m++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(b=0,i=0;i<c[n].length;i++){for(o=0;o<c[n][i].length-p;o++){if(t(c[n][i][o],s,x,m,b)===!1)return!1;s++}b++}m++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(Mt(l.geometries[n],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ut(r,t){var e,n,i,o,l,u,c,f,p,s,a=0,h=r.type==="FeatureCollection",g=r.type==="Feature",y=h?r.features.length:1;for(e=0;e<y;e++){for(u=h?r.features[e].geometry:g?r.geometry:r,f=h?r.features[e].properties:g?r.properties:{},p=h?r.features[e].bbox:g?r.bbox:void 0,s=h?r.features[e].id:g?r.id:void 0,c=u?u.type==="GeometryCollection":!1,l=c?u.geometries.length:1,i=0;i<l;i++){if(o=c?u.geometries[i]:u,o===null){if(t(null,a,f,p,s)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,a,f,p,s)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],a,f,p,s)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}a++}}function re(r,t){ut(r,function(e,n,i,o,l){var u=e===null?null:e.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return t(V(e,i,{bbox:o,id:l}),n,0)===!1?!1:void 0}var c;switch(u){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var f=0;f<e.coordinates.length;f++){var p=e.coordinates[f],s={type:c,coordinates:p};if(t(V(s,i),n,f)===!1)return!1}})}function ie(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;const e=[1/0,1/0,-1/0,-1/0];return Mt(r,n=>{e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}var ft=ie;function oe(r){if(!r)throw new Error("geojson is required");switch(r.type){case"Feature":return Lt(r);case"FeatureCollection":return se(r);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ct(r);default:throw new Error("unknown GeoJSON type")}}function Lt(r){const t={type:"Feature"};return Object.keys(r).forEach(e=>{switch(e){case"type":case"properties":case"geometry":return;default:t[e]=r[e]}}),t.properties=Ct(r.properties),r.geometry==null?t.geometry=null:t.geometry=ct(r.geometry),t}function Ct(r){const t={};return r&&Object.keys(r).forEach(e=>{const n=r[e];typeof n=="object"?n===null?t[e]=null:Array.isArray(n)?t[e]=n.map(i=>i):t[e]=Ct(n):t[e]=n}),t}function se(r){const t={type:"FeatureCollection"};return Object.keys(r).forEach(e=>{switch(e){case"type":case"features":return;default:t[e]=r[e]}}),t.features=r.features.map(e=>Lt(e)),t}function ct(r){const t={type:r.type};return r.bbox&&(t.bbox=r.bbox),r.type==="GeometryCollection"?(t.geometries=r.geometries.map(e=>ct(e)),t):(t.coordinates=Rt(r.coordinates),t)}function Rt(r){const t=r;return typeof t[0]!="object"?t.slice():t.map(e=>Rt(e))}var le=oe;/**
|
|
5
2
|
* splaytree v3.1.2
|
|
6
3
|
* Fast Splay tree for Node and browser
|
|
7
4
|
*
|
|
@@ -9,24 +6,18 @@
|
|
|
9
6
|
* @license MIT
|
|
10
7
|
* @preserve
|
|
11
8
|
*//*! *****************************************************************************
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
11
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
12
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
16
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
17
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`);var h=r+(a?" ":"│ ");o.left&&ps(o.left,h,!1,l,c),o.right&&ps(o.right,h,!0,l,c)}}var ms=function(){function o(r){r===void 0&&(r=Fv),this._root=null,this._size=0,this._comparator=r}return o.prototype.insert=function(r,a){return this._size++,this._root=vs(r,a,this._root,this._comparator)},o.prototype.add=function(r,a){var l=new bt(r,a);this._root===null&&(l.left=l.right=null,this._size++,this._root=l);var c=this._comparator,h=Ot(r,this._root,c),v=c(r,h.key);return v===0?this._root=h:(v<0?(l.left=h.left,l.right=h,h.left=null):v>0&&(l.right=h.right,l.left=h,h.right=null),this._size++,this._root=l),this._root},o.prototype.remove=function(r){this._root=this._remove(r,this._root,this._comparator)},o.prototype._remove=function(r,a,l){var c;if(a===null)return null;a=Ot(r,a,l);var h=l(r,a.key);return h===0?(a.left===null?c=a.right:(c=Ot(r,a.left,l),c.right=a.right),this._size--,c):a},o.prototype.pop=function(){var r=this._root;if(r){for(;r.left;)r=r.left;return this._root=Ot(r.key,this._root,this._comparator),this._root=this._remove(r.key,this._root,this._comparator),{key:r.key,data:r.data}}return null},o.prototype.findStatic=function(r){for(var a=this._root,l=this._comparator;a;){var c=l(r,a.key);if(c===0)return a;c<0?a=a.left:a=a.right}return null},o.prototype.find=function(r){return this._root&&(this._root=Ot(r,this._root,this._comparator),this._comparator(r,this._root.key)!==0)?null:this._root},o.prototype.contains=function(r){for(var a=this._root,l=this._comparator;a;){var c=l(r,a.key);if(c===0)return!0;c<0?a=a.left:a=a.right}return!1},o.prototype.forEach=function(r,a){for(var l=this._root,c=[],h=!1;!h;)l!==null?(c.push(l),l=l.left):c.length!==0?(l=c.pop(),r.call(a,l),l=l.right):h=!0;return this},o.prototype.range=function(r,a,l,c){for(var h=[],v=this._comparator,p=this._root,_;h.length!==0||p;)if(p)h.push(p),p=p.left;else{if(p=h.pop(),_=v(p.key,a),_>0)break;if(v(p.key,r)>=0&&l.call(c,p))return this;p=p.right}return this},o.prototype.keys=function(){var r=[];return this.forEach(function(a){var l=a.key;return r.push(l)}),r},o.prototype.values=function(){var r=[];return this.forEach(function(a){var l=a.data;return r.push(l)}),r},o.prototype.min=function(){return this._root?this.minNode(this._root).key:null},o.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},o.prototype.minNode=function(r){if(r===void 0&&(r=this._root),r)for(;r.left;)r=r.left;return r},o.prototype.maxNode=function(r){if(r===void 0&&(r=this._root),r)for(;r.right;)r=r.right;return r},o.prototype.at=function(r){for(var a=this._root,l=!1,c=0,h=[];!l;)if(a)h.push(a),a=a.left;else if(h.length>0){if(a=h.pop(),c===r)return a;c++,a=a.right}else l=!0;return null},o.prototype.next=function(r){var a=this._root,l=null;if(r.right){for(l=r.right;l.left;)l=l.left;return l}for(var c=this._comparator;a;){var h=c(r.key,a.key);if(h===0)break;h<0?(l=a,a=a.left):a=a.right}return l},o.prototype.prev=function(r){var a=this._root,l=null;if(r.left!==null){for(l=r.left;l.right;)l=l.right;return l}for(var c=this._comparator;a;){var h=c(r.key,a.key);if(h===0)break;h<0?a=a.left:(l=a,a=a.right)}return l},o.prototype.clear=function(){return this._root=null,this._size=0,this},o.prototype.toList=function(){return Bv(this._root)},o.prototype.load=function(r,a,l){a===void 0&&(a=[]),l===void 0&&(l=!1);var c=r.length,h=this._comparator;if(l&&xs(r,a,0,c-1,h),this._root===null)this._root=ds(r,a,0,c),this._size=c;else{var v=qv(this.toList(),Gv(r,a),h);c=this._size+c,this._root=_s({head:v},0,c)}return this},o.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(o.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),o.prototype.toString=function(r){r===void 0&&(r=function(l){return String(l.key)});var a=[];return ps(this._root,"",!0,function(l){return a.push(l)},r),a.join("")},o.prototype.update=function(r,a,l){var c=this._comparator,h=Cu(r,this._root,c),v=h.left,p=h.right;c(r,a)<0?p=vs(a,l,p,c):v=vs(a,l,v,c),this._root=$v(v,p,c)},o.prototype.split=function(r){return Cu(r,this._root,this._comparator)},o.prototype[Symbol.iterator]=function(){var r,a,l;return Dv(this,function(c){switch(c.label){case 0:r=this._root,a=[],l=!1,c.label=1;case 1:return l?[3,6]:r===null?[3,2]:(a.push(r),r=r.left,[3,5]);case 2:return a.length===0?[3,4]:(r=a.pop(),[4,r]);case 3:return c.sent(),r=r.right,[3,5];case 4:l=!0,c.label=5;case 5:return[3,1];case 6:return[2]}})},o}();function ds(o,r,a,l){var c=l-a;if(c>0){var h=a+Math.floor(c/2),v=o[h],p=r[h],_=new bt(v,p);return _.left=ds(o,r,a,h),_.right=ds(o,r,h+1,l),_}return null}function Gv(o,r){for(var a=new bt(null,null),l=a,c=0;c<o.length;c++)l=l.next=new bt(o[c],r[c]);return l.next=null,a.next}function Bv(o){for(var r=o,a=[],l=!1,c=new bt(null,null),h=c;!l;)r?(a.push(r),r=r.left):a.length>0?(r=h=h.next=a.pop(),r=r.right):l=!0;return h.next=null,c.next}function _s(o,r,a){var l=a-r;if(l>0){var c=r+Math.floor(l/2),h=_s(o,r,c),v=o.head;return v.left=h,o.head=o.head.next,v.right=_s(o,c+1,a),v}return null}function qv(o,r,a){for(var l=new bt(null,null),c=l,h=o,v=r;h!==null&&v!==null;)a(h.key,v.key)<0?(c.next=h,h=h.next):(c.next=v,v=v.next),c=c.next;return h!==null?c.next=h:v!==null&&(c.next=v),l.next}function xs(o,r,a,l,c){if(!(a>=l)){for(var h=o[a+l>>1],v=a-1,p=l+1;;){do v++;while(c(o[v],h)<0);do p--;while(c(o[p],h)>0);if(v>=p)break;var _=o[v];o[v]=o[p],o[p]=_,_=r[v],r[v]=r[p],r[p]=_}xs(o,r,a,p,c),xs(o,r,p+1,l,c)}}const mt=11102230246251565e-32,Te=134217729,zv=(3+8*mt)*mt;function Es(o,r,a,l,c){let h,v,p,_,x=r[0],S=l[0],m=0,k=0;S>x==S>-x?(h=x,x=r[++m]):(h=S,S=l[++k]);let E=0;if(m<o&&k<a)for(S>x==S>-x?(v=x+h,p=h-(v-x),x=r[++m]):(v=S+h,p=h-(v-S),S=l[++k]),h=v,p!==0&&(c[E++]=p);m<o&&k<a;)S>x==S>-x?(v=h+x,_=v-h,p=h-(v-_)+(x-_),x=r[++m]):(v=h+S,_=v-h,p=h-(v-_)+(S-_),S=l[++k]),h=v,p!==0&&(c[E++]=p);for(;m<o;)v=h+x,_=v-h,p=h-(v-_)+(x-_),x=r[++m],h=v,p!==0&&(c[E++]=p);for(;k<a;)v=h+S,_=v-h,p=h-(v-_)+(S-_),S=l[++k],h=v,p!==0&&(c[E++]=p);return(h!==0||E===0)&&(c[E++]=h),E}function Yv(o,r){let a=r[0];for(let l=1;l<o;l++)a+=r[l];return a}function $n(o){return new Float64Array(o)}const Uv=(3+16*mt)*mt,Xv=(2+12*mt)*mt,jv=(9+64*mt)*mt*mt,cn=$n(4),Pu=$n(8),Au=$n(12),Mu=$n(16),Re=$n(4);function Vv(o,r,a,l,c,h,v){let p,_,x,S,m,k,E,N,T,R,A,P,C,F,M,B,Y,U;const X=o-c,ie=a-c,ee=r-h,te=l-h;F=X*te,k=Te*X,E=k-(k-X),N=X-E,k=Te*te,T=k-(k-te),R=te-T,M=N*R-(F-E*T-N*T-E*R),B=ee*ie,k=Te*ee,E=k-(k-ee),N=ee-E,k=Te*ie,T=k-(k-ie),R=ie-T,Y=N*R-(B-E*T-N*T-E*R),A=M-Y,m=M-A,cn[0]=M-(A+m)+(m-Y),P=F+A,m=P-F,C=F-(P-m)+(A-m),A=C-B,m=C-A,cn[1]=C-(A+m)+(m-B),U=P+A,m=U-P,cn[2]=P-(U-m)+(A-m),cn[3]=U;let ae=Yv(4,cn),q=Xv*v;if(ae>=q||-ae>=q||(m=o-X,p=o-(X+m)+(m-c),m=a-ie,x=a-(ie+m)+(m-c),m=r-ee,_=r-(ee+m)+(m-h),m=l-te,S=l-(te+m)+(m-h),p===0&&_===0&&x===0&&S===0)||(q=jv*v+zv*Math.abs(ae),ae+=X*S+te*p-(ee*x+ie*_),ae>=q||-ae>=q))return ae;F=p*te,k=Te*p,E=k-(k-p),N=p-E,k=Te*te,T=k-(k-te),R=te-T,M=N*R-(F-E*T-N*T-E*R),B=_*ie,k=Te*_,E=k-(k-_),N=_-E,k=Te*ie,T=k-(k-ie),R=ie-T,Y=N*R-(B-E*T-N*T-E*R),A=M-Y,m=M-A,Re[0]=M-(A+m)+(m-Y),P=F+A,m=P-F,C=F-(P-m)+(A-m),A=C-B,m=C-A,Re[1]=C-(A+m)+(m-B),U=P+A,m=U-P,Re[2]=P-(U-m)+(A-m),Re[3]=U;const ne=Es(4,cn,4,Re,Pu);F=X*S,k=Te*X,E=k-(k-X),N=X-E,k=Te*S,T=k-(k-S),R=S-T,M=N*R-(F-E*T-N*T-E*R),B=ee*x,k=Te*ee,E=k-(k-ee),N=ee-E,k=Te*x,T=k-(k-x),R=x-T,Y=N*R-(B-E*T-N*T-E*R),A=M-Y,m=M-A,Re[0]=M-(A+m)+(m-Y),P=F+A,m=P-F,C=F-(P-m)+(A-m),A=C-B,m=C-A,Re[1]=C-(A+m)+(m-B),U=P+A,m=U-P,Re[2]=P-(U-m)+(A-m),Re[3]=U;const ue=Es(ne,Pu,4,Re,Au);F=p*S,k=Te*p,E=k-(k-p),N=p-E,k=Te*S,T=k-(k-S),R=S-T,M=N*R-(F-E*T-N*T-E*R),B=_*x,k=Te*_,E=k-(k-_),N=_-E,k=Te*x,T=k-(k-x),R=x-T,Y=N*R-(B-E*T-N*T-E*R),A=M-Y,m=M-A,Re[0]=M-(A+m)+(m-Y),P=F+A,m=P-F,C=F-(P-m)+(A-m),A=C-B,m=C-A,Re[1]=C-(A+m)+(m-B),U=P+A,m=U-P,Re[2]=P-(U-m)+(A-m),Re[3]=U;const ve=Es(ue,Au,4,Re,Mu);return Mu[ve-1]}function Wv(o,r,a,l,c,h){const v=(r-h)*(a-c),p=(o-c)*(l-h),_=v-p,x=Math.abs(v+p);return Math.abs(_)>=Uv*x?_:-Vv(o,r,a,l,c,h,x)}const Gn=(o,r)=>o.ll.x<=r.x&&r.x<=o.ur.x&&o.ll.y<=r.y&&r.y<=o.ur.y,ks=(o,r)=>{if(r.ur.x<o.ll.x||o.ur.x<r.ll.x||r.ur.y<o.ll.y||o.ur.y<r.ll.y)return null;const a=o.ll.x<r.ll.x?r.ll.x:o.ll.x,l=o.ur.x<r.ur.x?o.ur.x:r.ur.x,c=o.ll.y<r.ll.y?r.ll.y:o.ll.y,h=o.ur.y<r.ur.y?o.ur.y:r.ur.y;return{ll:{x:a,y:c},ur:{x:l,y:h}}};let Tt=Number.EPSILON;Tt===void 0&&(Tt=Math.pow(2,-52));const Hv=Tt*Tt,Du=(o,r)=>{if(-Tt<o&&o<Tt&&-Tt<r&&r<Tt)return 0;const a=o-r;return a*a<Hv*o*r?0:o<r?-1:1};class Zv{constructor(){this.reset()}reset(){this.xRounder=new Fu,this.yRounder=new Fu}round(r,a){return{x:this.xRounder.round(r),y:this.yRounder.round(a)}}}class Fu{constructor(){this.tree=new ms,this.round(0)}round(r){const a=this.tree.add(r),l=this.tree.prev(a);if(l!==null&&Du(a.key,l.key)===0)return this.tree.remove(r),l.key;const c=this.tree.next(a);return c!==null&&Du(a.key,c.key)===0?(this.tree.remove(r),c.key):r}}const Bn=new Zv,Ar=(o,r)=>o.x*r.y-o.y*r.x,$u=(o,r)=>o.x*r.x+o.y*r.y,Gu=(o,r,a)=>{const l=Wv(o.x,o.y,r.x,r.y,a.x,a.y);return l>0?-1:l<0?1:0},Mr=o=>Math.sqrt($u(o,o)),Jv=(o,r,a)=>{const l={x:r.x-o.x,y:r.y-o.y},c={x:a.x-o.x,y:a.y-o.y};return Ar(c,l)/Mr(c)/Mr(l)},Qv=(o,r,a)=>{const l={x:r.x-o.x,y:r.y-o.y},c={x:a.x-o.x,y:a.y-o.y};return $u(c,l)/Mr(c)/Mr(l)},Bu=(o,r,a)=>r.y===0?null:{x:o.x+r.x/r.y*(a-o.y),y:a},qu=(o,r,a)=>r.x===0?null:{x:a,y:o.y+r.y/r.x*(a-o.x)},Kv=(o,r,a,l)=>{if(r.x===0)return qu(a,l,o.x);if(l.x===0)return qu(o,r,a.x);if(r.y===0)return Bu(a,l,o.y);if(l.y===0)return Bu(o,r,a.y);const c=Ar(r,l);if(c==0)return null;const h={x:a.x-o.x,y:a.y-o.y},v=Ar(h,r)/c,p=Ar(h,l)/c,_=o.x+p*r.x,x=a.x+v*l.x,S=o.y+p*r.y,m=a.y+v*l.y,k=(_+x)/2,E=(S+m)/2;return{x:k,y:E}};class Ue{static compare(r,a){const l=Ue.comparePoints(r.point,a.point);return l!==0?l:(r.point!==a.point&&r.link(a),r.isLeft!==a.isLeft?r.isLeft?1:-1:Lt.compare(r.segment,a.segment))}static comparePoints(r,a){return r.x<a.x?-1:r.x>a.x?1:r.y<a.y?-1:r.y>a.y?1:0}constructor(r,a){r.events===void 0?r.events=[this]:r.events.push(this),this.point=r,this.isLeft=a}link(r){if(r.point===this.point)throw new Error("Tried to link already linked events");const a=r.point.events;for(let l=0,c=a.length;l<c;l++){const h=a[l];this.point.events.push(h),h.point=this.point}this.checkForConsuming()}checkForConsuming(){const r=this.point.events.length;for(let a=0;a<r;a++){const l=this.point.events[a];if(l.segment.consumedBy===void 0)for(let c=a+1;c<r;c++){const h=this.point.events[c];h.consumedBy===void 0&&l.otherSE.point.events===h.otherSE.point.events&&l.segment.consume(h.segment)}}}getAvailableLinkedEvents(){const r=[];for(let a=0,l=this.point.events.length;a<l;a++){const c=this.point.events[a];c!==this&&!c.segment.ringOut&&c.segment.isInResult()&&r.push(c)}return r}getLeftmostComparator(r){const a=new Map,l=c=>{const h=c.otherSE;a.set(c,{sine:Jv(this.point,r.point,h.point),cosine:Qv(this.point,r.point,h.point)})};return(c,h)=>{a.has(c)||l(c),a.has(h)||l(h);const{sine:v,cosine:p}=a.get(c),{sine:_,cosine:x}=a.get(h);return v>=0&&_>=0?p<x?1:p>x?-1:0:v<0&&_<0?p<x?-1:p>x?1:0:_<v?-1:_>v?1:0}}}let ep=0;class Lt{static compare(r,a){const l=r.leftSE.point.x,c=a.leftSE.point.x,h=r.rightSE.point.x,v=a.rightSE.point.x;if(v<l)return 1;if(h<c)return-1;const p=r.leftSE.point.y,_=a.leftSE.point.y,x=r.rightSE.point.y,S=a.rightSE.point.y;if(l<c){if(_<p&&_<x)return 1;if(_>p&&_>x)return-1;const m=r.comparePoint(a.leftSE.point);if(m<0)return 1;if(m>0)return-1;const k=a.comparePoint(r.rightSE.point);return k!==0?k:-1}if(l>c){if(p<_&&p<S)return-1;if(p>_&&p>S)return 1;const m=a.comparePoint(r.leftSE.point);if(m!==0)return m;const k=r.comparePoint(a.rightSE.point);return k<0?1:k>0?-1:1}if(p<_)return-1;if(p>_)return 1;if(h<v){const m=a.comparePoint(r.rightSE.point);if(m!==0)return m}if(h>v){const m=r.comparePoint(a.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(h!==v){const m=x-p,k=h-l,E=S-_,N=v-c;if(m>k&&E<N)return 1;if(m<k&&E>N)return-1}return h>v?1:h<v||x<S?-1:x>S?1:r.id<a.id?-1:r.id>a.id?1:0}constructor(r,a,l,c){this.id=++ep,this.leftSE=r,r.segment=this,r.otherSE=a,this.rightSE=a,a.segment=this,a.otherSE=r,this.rings=l,this.windings=c}static fromRing(r,a,l){let c,h,v;const p=Ue.comparePoints(r,a);if(p<0)c=r,h=a,v=1;else if(p>0)c=a,h=r,v=-1;else throw new Error(`Tried to create degenerate segment at [${r.x}, ${r.y}]`);const _=new Ue(c,!0),x=new Ue(h,!1);return new Lt(_,x,[l],[v])}replaceRightSE(r){this.rightSE=r,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const r=this.leftSE.point.y,a=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:r<a?r:a},ur:{x:this.rightSE.point.x,y:r>a?r:a}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(r){return r.x===this.leftSE.point.x&&r.y===this.leftSE.point.y||r.x===this.rightSE.point.x&&r.y===this.rightSE.point.y}comparePoint(r){if(this.isAnEndpoint(r))return 0;const a=this.leftSE.point,l=this.rightSE.point,c=this.vector();if(a.x===l.x)return r.x===a.x?0:r.x<a.x?1:-1;const h=(r.y-a.y)/c.y,v=a.x+h*c.x;if(r.x===v)return 0;const p=(r.x-a.x)/c.x,_=a.y+p*c.y;return r.y===_?0:r.y<_?-1:1}getIntersection(r){const a=this.bbox(),l=r.bbox(),c=ks(a,l);if(c===null)return null;const h=this.leftSE.point,v=this.rightSE.point,p=r.leftSE.point,_=r.rightSE.point,x=Gn(a,p)&&this.comparePoint(p)===0,S=Gn(l,h)&&r.comparePoint(h)===0,m=Gn(a,_)&&this.comparePoint(_)===0,k=Gn(l,v)&&r.comparePoint(v)===0;if(S&&x)return k&&!m?v:!k&&m?_:null;if(S)return m&&h.x===_.x&&h.y===_.y?null:h;if(x)return k&&v.x===p.x&&v.y===p.y?null:p;if(k&&m)return null;if(k)return v;if(m)return _;const E=Kv(h,this.vector(),p,r.vector());return E===null||!Gn(c,E)?null:Bn.round(E.x,E.y)}split(r){const a=[],l=r.events!==void 0,c=new Ue(r,!0),h=new Ue(r,!1),v=this.rightSE;this.replaceRightSE(h),a.push(h),a.push(c);const p=new Lt(c,v,this.rings.slice(),this.windings.slice());return Ue.comparePoints(p.leftSE.point,p.rightSE.point)>0&&p.swapEvents(),Ue.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),l&&(c.checkForConsuming(),h.checkForConsuming()),a}swapEvents(){const r=this.rightSE;this.rightSE=this.leftSE,this.leftSE=r,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let a=0,l=this.windings.length;a<l;a++)this.windings[a]*=-1}consume(r){let a=this,l=r;for(;a.consumedBy;)a=a.consumedBy;for(;l.consumedBy;)l=l.consumedBy;const c=Lt.compare(a,l);if(c!==0){if(c>0){const h=a;a=l,l=h}if(a.prev===l){const h=a;a=l,l=h}for(let h=0,v=l.rings.length;h<v;h++){const p=l.rings[h],_=l.windings[h],x=a.rings.indexOf(p);x===-1?(a.rings.push(p),a.windings.push(_)):a.windings[x]+=_}l.rings=null,l.windings=null,l.consumedBy=a,l.leftSE.consumedBy=a.leftSE,l.rightSE.consumedBy=a.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const r=this.prev.consumedBy||this.prev;this._beforeState=r.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const r=this.beforeState();this._afterState={rings:r.rings.slice(0),windings:r.windings.slice(0),multiPolys:[]};const a=this._afterState.rings,l=this._afterState.windings,c=this._afterState.multiPolys;for(let p=0,_=this.rings.length;p<_;p++){const x=this.rings[p],S=this.windings[p],m=a.indexOf(x);m===-1?(a.push(x),l.push(S)):l[m]+=S}const h=[],v=[];for(let p=0,_=a.length;p<_;p++){if(l[p]===0)continue;const x=a[p],S=x.poly;if(v.indexOf(S)===-1)if(x.isExterior)h.push(S);else{v.indexOf(S)===-1&&v.push(S);const m=h.indexOf(x.poly);m!==-1&&h.splice(m,1)}}for(let p=0,_=h.length;p<_;p++){const x=h[p].multiPoly;c.indexOf(x)===-1&&c.push(x)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const r=this.beforeState().multiPolys,a=this.afterState().multiPolys;switch(Ke.type){case"union":{const l=r.length===0,c=a.length===0;this._isInResult=l!==c;break}case"intersection":{let l,c;r.length<a.length?(l=r.length,c=a.length):(l=a.length,c=r.length),this._isInResult=c===Ke.numMultiPolys&&l<c;break}case"xor":{const l=Math.abs(r.length-a.length);this._isInResult=l%2===1;break}case"difference":{const l=c=>c.length===1&&c[0].isSubject;this._isInResult=l(r)!==l(a);break}default:throw new Error(`Unrecognized operation type found ${Ke.type}`)}return this._isInResult}}class zu{constructor(r,a,l){if(!Array.isArray(r)||r.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=a,this.isExterior=l,this.segments=[],typeof r[0][0]!="number"||typeof r[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const c=Bn.round(r[0][0],r[0][1]);this.bbox={ll:{x:c.x,y:c.y},ur:{x:c.x,y:c.y}};let h=c;for(let v=1,p=r.length;v<p;v++){if(typeof r[v][0]!="number"||typeof r[v][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let _=Bn.round(r[v][0],r[v][1]);_.x===h.x&&_.y===h.y||(this.segments.push(Lt.fromRing(h,_,this)),_.x<this.bbox.ll.x&&(this.bbox.ll.x=_.x),_.y<this.bbox.ll.y&&(this.bbox.ll.y=_.y),_.x>this.bbox.ur.x&&(this.bbox.ur.x=_.x),_.y>this.bbox.ur.y&&(this.bbox.ur.y=_.y),h=_)}(c.x!==h.x||c.y!==h.y)&&this.segments.push(Lt.fromRing(h,c,this))}getSweepEvents(){const r=[];for(let a=0,l=this.segments.length;a<l;a++){const c=this.segments[a];r.push(c.leftSE),r.push(c.rightSE)}return r}}class tp{constructor(r,a){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new zu(r[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(let l=1,c=r.length;l<c;l++){const h=new zu(r[l],this,!1);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.interiorRings.push(h)}this.multiPoly=a}getSweepEvents(){const r=this.exteriorRing.getSweepEvents();for(let a=0,l=this.interiorRings.length;a<l;a++){const c=this.interiorRings[a].getSweepEvents();for(let h=0,v=c.length;h<v;h++)r.push(c[h])}return r}}class Yu{constructor(r,a){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof r[0][0][0]=="number"&&(r=[r])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let l=0,c=r.length;l<c;l++){const h=new tp(r[l],this);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.polys.push(h)}this.isSubject=a}getSweepEvents(){const r=[];for(let a=0,l=this.polys.length;a<l;a++){const c=this.polys[a].getSweepEvents();for(let h=0,v=c.length;h<v;h++)r.push(c[h])}return r}}class Dr{static factory(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l];if(!h.isInResult()||h.ringOut)continue;let v=null,p=h.leftSE,_=h.rightSE;const x=[p],S=p.point,m=[];for(;v=p,p=_,x.push(p),p.point!==S;)for(;;){const k=p.getAvailableLinkedEvents();if(k.length===0){const T=x[0].point,R=x[x.length-1].point;throw new Error(`Unable to complete output ring starting at [${T.x}, ${T.y}]. Last matching segment found ends at [${R.x}, ${R.y}].`)}if(k.length===1){_=k[0].otherSE;break}let E=null;for(let T=0,R=m.length;T<R;T++)if(m[T].point===p.point){E=T;break}if(E!==null){const T=m.splice(E)[0],R=x.splice(T.index);R.unshift(R[0].otherSE),a.push(new Dr(R.reverse()));continue}m.push({index:x.length,point:p.point});const N=p.getLeftmostComparator(v);_=k.sort(N)[0].otherSE;break}a.push(new Dr(x))}return a}constructor(r){this.events=r;for(let a=0,l=r.length;a<l;a++)r[a].segment.ringOut=this;this.poly=null}getGeom(){let r=this.events[0].point;const a=[r];for(let x=1,S=this.events.length-1;x<S;x++){const m=this.events[x].point,k=this.events[x+1].point;Gu(m,r,k)!==0&&(a.push(m),r=m)}if(a.length===1)return null;const l=a[0],c=a[1];Gu(l,r,c)===0&&a.shift(),a.push(a[0]);const h=this.isExteriorRing()?1:-1,v=this.isExteriorRing()?0:a.length-1,p=this.isExteriorRing()?a.length:-1,_=[];for(let x=v;x!=p;x+=h)_.push([a[x].x,a[x].y]);return _}isExteriorRing(){if(this._isExteriorRing===void 0){const r=this.enclosingRing();this._isExteriorRing=r?!r.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let r=this.events[0];for(let c=1,h=this.events.length;c<h;c++){const v=this.events[c];Ue.compare(r,v)>0&&(r=v)}let a=r.segment.prevInResult(),l=a?a.prevInResult():null;for(;;){if(!a)return null;if(!l)return a.ringOut;if(l.ringOut!==a.ringOut)return l.ringOut.enclosingRing()!==a.ringOut?a.ringOut:a.ringOut.enclosingRing();a=l.prevInResult(),l=a?a.prevInResult():null}}}class Uu{constructor(r){this.exteriorRing=r,r.poly=this,this.interiorRings=[]}addInterior(r){this.interiorRings.push(r),r.poly=this}getGeom(){const r=[this.exteriorRing.getGeom()];if(r[0]===null)return null;for(let a=0,l=this.interiorRings.length;a<l;a++){const c=this.interiorRings[a].getGeom();c!==null&&r.push(c)}return r}}class np{constructor(r){this.rings=r,this.polys=this._composePolys(r)}getGeom(){const r=[];for(let a=0,l=this.polys.length;a<l;a++){const c=this.polys[a].getGeom();c!==null&&r.push(c)}return r}_composePolys(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l];if(!h.poly)if(h.isExteriorRing())a.push(new Uu(h));else{const v=h.enclosingRing();v.poly||a.push(new Uu(v)),v.poly.addInterior(h)}}return a}}class rp{constructor(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt.compare;this.queue=r,this.tree=new ms(a),this.segments=[]}process(r){const a=r.segment,l=[];if(r.consumedBy)return r.isLeft?this.queue.remove(r.otherSE):this.tree.remove(a),l;const c=r.isLeft?this.tree.add(a):this.tree.find(a);if(!c)throw new Error(`Unable to find segment #${a.id} [${a.leftSE.point.x}, ${a.leftSE.point.y}] -> [${a.rightSE.point.x}, ${a.rightSE.point.y}] in SweepLine tree.`);let h=c,v=c,p,_;for(;p===void 0;)h=this.tree.prev(h),h===null?p=null:h.key.consumedBy===void 0&&(p=h.key);for(;_===void 0;)v=this.tree.next(v),v===null?_=null:v.key.consumedBy===void 0&&(_=v.key);if(r.isLeft){let x=null;if(p){const m=p.getIntersection(a);if(m!==null&&(a.isAnEndpoint(m)||(x=m),!p.isAnEndpoint(m))){const k=this._splitSafely(p,m);for(let E=0,N=k.length;E<N;E++)l.push(k[E])}}let S=null;if(_){const m=_.getIntersection(a);if(m!==null&&(a.isAnEndpoint(m)||(S=m),!_.isAnEndpoint(m))){const k=this._splitSafely(_,m);for(let E=0,N=k.length;E<N;E++)l.push(k[E])}}if(x!==null||S!==null){let m=null;x===null?m=S:S===null?m=x:m=Ue.comparePoints(x,S)<=0?x:S,this.queue.remove(a.rightSE),l.push(a.rightSE);const k=a.split(m);for(let E=0,N=k.length;E<N;E++)l.push(k[E])}l.length>0?(this.tree.remove(a),l.push(r)):(this.segments.push(a),a.prev=p)}else{if(p&&_){const x=p.getIntersection(_);if(x!==null){if(!p.isAnEndpoint(x)){const S=this._splitSafely(p,x);for(let m=0,k=S.length;m<k;m++)l.push(S[m])}if(!_.isAnEndpoint(x)){const S=this._splitSafely(_,x);for(let m=0,k=S.length;m<k;m++)l.push(S[m])}}}this.tree.remove(a)}return l}_splitSafely(r,a){this.tree.remove(r);const l=r.rightSE;this.queue.remove(l);const c=r.split(a);return c.push(l),r.consumedBy===void 0&&this.tree.add(r),c}}const Xu=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ip=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class sp{run(r,a,l){Ke.type=r,Bn.reset();const c=[new Yu(a,!0)];for(let m=0,k=l.length;m<k;m++)c.push(new Yu(l[m],!1));if(Ke.numMultiPolys=c.length,Ke.type==="difference"){const m=c[0];let k=1;for(;k<c.length;)ks(c[k].bbox,m.bbox)!==null?k++:c.splice(k,1)}if(Ke.type==="intersection")for(let m=0,k=c.length;m<k;m++){const E=c[m];for(let N=m+1,T=c.length;N<T;N++)if(ks(E.bbox,c[N].bbox)===null)return[]}const h=new ms(Ue.compare);for(let m=0,k=c.length;m<k;m++){const E=c[m].getSweepEvents();for(let N=0,T=E.length;N<T;N++)if(h.insert(E[N]),h.size>Xu)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const v=new rp(h);let p=h.size,_=h.pop();for(;_;){const m=_.key;if(h.size===p){const E=m.segment;throw new Error(`Unable to pop() ${m.isLeft?"left":"right"} SweepEvent [${m.point.x}, ${m.point.y}] from segment #${E.id} [${E.leftSE.point.x}, ${E.leftSE.point.y}] -> [${E.rightSE.point.x}, ${E.rightSE.point.y}] from queue.`)}if(h.size>Xu)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(v.segments.length>ip)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const k=v.process(m);for(let E=0,N=k.length;E<N;E++){const T=k[E];T.consumedBy===void 0&&h.insert(T)}p=h.size,_=h.pop()}Bn.reset();const x=Dr.factory(v.segments);return new np(x).getGeom()}}const Ke=new sp;var ju={union:function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return Ke.run("union",o,a)},intersection:function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return Ke.run("intersection",o,a)},xor:function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return Ke.run("xor",o,a)},difference:function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return Ke.run("difference",o,a)}},ap=Object.defineProperty,be=(o,r)=>ap(o,"name",{value:r,configurable:!0});function fn(o,r,a){if(o!==null)for(var l,c,h,v,p,_,x,S=0,m=0,k,E=o.type,N=E==="FeatureCollection",T=E==="Feature",R=N?o.features.length:1,A=0;A<R;A++){x=N?o.features[A].geometry:T?o.geometry:o,k=x?x.type==="GeometryCollection":!1,p=k?x.geometries.length:1;for(var P=0;P<p;P++){var C=0,F=0;if(v=k?x.geometries[P]:x,v!==null){_=v.coordinates;var M=v.type;switch(S=a&&(M==="Polygon"||M==="MultiPolygon")?1:0,M){case null:break;case"Point":if(r(_,m,A,C,F)===!1)return!1;m++,C++;break;case"LineString":case"MultiPoint":for(l=0;l<_.length;l++){if(r(_[l],m,A,C,F)===!1)return!1;m++,M==="MultiPoint"&&C++}M==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(l=0;l<_.length;l++){for(c=0;c<_[l].length-S;c++){if(r(_[l][c],m,A,C,F)===!1)return!1;m++}M==="MultiLineString"&&C++,M==="Polygon"&&F++}M==="Polygon"&&C++;break;case"MultiPolygon":for(l=0;l<_.length;l++){for(F=0,c=0;c<_[l].length;c++){for(h=0;h<_[l][c].length-S;h++){if(r(_[l][c][h],m,A,C,F)===!1)return!1;m++}F++}C++}break;case"GeometryCollection":for(l=0;l<v.geometries.length;l++)if(fn(v.geometries[l],r,a)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}be(fn,"coordEach");function op(o,r,a,l){var c=a;return fn(o,function(h,v,p,_,x){v===0&&a===void 0?c=h:c=r(c,h,v,p,_,x)},l),c}be(op,"coordReduce");function Vu(o,r){var a;switch(o.type){case"FeatureCollection":for(a=0;a<o.features.length&&r(o.features[a].properties,a)!==!1;a++);break;case"Feature":r(o.properties,0);break}}be(Vu,"propEach");function up(o,r,a){var l=a;return Vu(o,function(c,h){h===0&&a===void 0?l=c:l=r(l,c,h)}),l}be(up,"propReduce");function Fr(o,r){if(o.type==="Feature")r(o,0);else if(o.type==="FeatureCollection")for(var a=0;a<o.features.length&&r(o.features[a],a)!==!1;a++);}be(Fr,"featureEach");function lp(o,r,a){var l=a;return Fr(o,function(c,h){h===0&&a===void 0?l=c:l=r(l,c,h)}),l}be(lp,"featureReduce");function cp(o){var r=[];return fn(o,function(a){r.push(a)}),r}be(cp,"coordAll");function Bt(o,r){var a,l,c,h,v,p,_,x,S,m,k=0,E=o.type==="FeatureCollection",N=o.type==="Feature",T=E?o.features.length:1;for(a=0;a<T;a++){for(p=E?o.features[a].geometry:N?o.geometry:o,x=E?o.features[a].properties:N?o.properties:{},S=E?o.features[a].bbox:N?o.bbox:void 0,m=E?o.features[a].id:N?o.id:void 0,_=p?p.type==="GeometryCollection":!1,v=_?p.geometries.length:1,c=0;c<v;c++){if(h=_?p.geometries[c]:p,h===null){if(r(null,k,x,S,m)===!1)return!1;continue}switch(h.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(r(h,k,x,S,m)===!1)return!1;break}case"GeometryCollection":{for(l=0;l<h.geometries.length;l++)if(r(h.geometries[l],k,x,S,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}k++}}be(Bt,"geomEach");function fp(o,r,a){var l=a;return Bt(o,function(c,h,v,p,_){h===0&&a===void 0?l=c:l=r(l,c,h,v,p,_)}),l}be(fp,"geomReduce");function $r(o,r){Bt(o,function(a,l,c,h,v){var p=a===null?null:a.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return r(Ye(a,c,{bbox:h,id:v}),l,0)===!1?!1:void 0}var _;switch(p){case"MultiPoint":_="Point";break;case"MultiLineString":_="LineString";break;case"MultiPolygon":_="Polygon";break}for(var x=0;x<a.coordinates.length;x++){var S=a.coordinates[x],m={type:_,coordinates:S};if(r(Ye(m,c),l,x)===!1)return!1}})}be($r,"flattenEach");function hp(o,r,a){var l=a;return $r(o,function(c,h,v){h===0&&v===0&&a===void 0?l=c:l=r(l,c,h,v)}),l}be(hp,"flattenReduce");function Wu(o,r){$r(o,function(a,l,c){var h=0;if(a.geometry){var v=a.geometry.type;if(!(v==="Point"||v==="MultiPoint")){var p,_=0,x=0,S=0;if(fn(a,function(m,k,E,N,T){if(p===void 0||l>_||N>x||T>S){p=m,_=l,x=N,S=T,h=0;return}var R=pt([p,m],a.properties);if(r(R,l,c,T,h)===!1)return!1;h++,p=m})===!1)return!1}}})}be(Wu,"segmentEach");function gp(o,r,a){var l=a,c=!1;return Wu(o,function(h,v,p,_,x){c===!1&&a===void 0?l=h:l=r(l,h,v,p,_,x),c=!0}),l}be(gp,"segmentReduce");function Hu(o,r){if(!o)throw new Error("geojson is required");$r(o,function(a,l,c){if(a.geometry!==null){var h=a.geometry.type,v=a.geometry.coordinates;switch(h){case"LineString":if(r(a,l,c,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p<v.length;p++)if(r(pt(v[p],a.properties),l,c,p)===!1)return!1;break}}})}be(Hu,"lineEach");function yp(o,r,a){var l=a;return Hu(o,function(c,h,v,p){h===0&&a===void 0?l=c:l=r(l,c,h,v,p)}),l}be(yp,"lineReduce");function vp(o,r){if(r=r||{},!ys(r))throw new Error("options is invalid");var a=r.featureIndex||0,l=r.multiFeatureIndex||0,c=r.geometryIndex||0,h=r.segmentIndex||0,v=r.properties,p;switch(o.type){case"FeatureCollection":a<0&&(a=o.features.length+a),v=v||o.features[a].properties,p=o.features[a].geometry;break;case"Feature":v=v||o.properties,p=o.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=o;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var _=p.coordinates;switch(p.type){case"Point":case"MultiPoint":return null;case"LineString":return h<0&&(h=_.length+h-1),pt([_[h],_[h+1]],v,r);case"Polygon":return c<0&&(c=_.length+c),h<0&&(h=_[c].length+h-1),pt([_[c][h],_[c][h+1]],v,r);case"MultiLineString":return l<0&&(l=_.length+l),h<0&&(h=_[l].length+h-1),pt([_[l][h],_[l][h+1]],v,r);case"MultiPolygon":return l<0&&(l=_.length+l),c<0&&(c=_[l].length+c),h<0&&(h=_[l][c].length-h-1),pt([_[l][c][h],_[l][c][h+1]],v,r)}throw new Error("geojson is invalid")}be(vp,"findSegment");function pp(o,r){if(r=r||{},!ys(r))throw new Error("options is invalid");var a=r.featureIndex||0,l=r.multiFeatureIndex||0,c=r.geometryIndex||0,h=r.coordIndex||0,v=r.properties,p;switch(o.type){case"FeatureCollection":a<0&&(a=o.features.length+a),v=v||o.features[a].properties,p=o.features[a].geometry;break;case"Feature":v=v||o.properties,p=o.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=o;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var _=p.coordinates;switch(p.type){case"Point":return at(_,v,r);case"MultiPoint":return l<0&&(l=_.length+l),at(_[l],v,r);case"LineString":return h<0&&(h=_.length+h),at(_[h],v,r);case"Polygon":return c<0&&(c=_.length+c),h<0&&(h=_[c].length+h),at(_[c][h],v,r);case"MultiLineString":return l<0&&(l=_.length+l),h<0&&(h=_[l].length+h),at(_[l][h],v,r);case"MultiPolygon":return l<0&&(l=_.length+l),c<0&&(c=_[l].length+c),h<0&&(h=_[l][c].length-h),at(_[l][c][h],v,r)}throw new Error("geojson is invalid")}be(pp,"findPoint");var mp=Object.defineProperty,dp=(o,r)=>mp(o,"name",{value:r,configurable:!0});function Zu(o,r={}){const a=[];if(Bt(o,c=>{a.push(c.coordinates)}),a.length<2)throw new Error("Must have at least 2 geometries");const l=ju.union(a[0],...a.slice(1));return l.length===0?null:l.length===1?ln(l[0],r.properties):Rr(l,r.properties)}dp(Zu,"union");var _p=Zu;function qn(){}function Ju(o){return o()}function Qu(){return Object.create(null)}function Gr(o){o.forEach(Ju)}function Ku(o){return typeof o=="function"}function xp(o,r){return o!=o?r==r:o!==r||o&&typeof o=="object"||typeof o=="function"}function Ep(o){return Object.keys(o).length===0}function kp(o,r){o.appendChild(r)}function Sp(o,r,a){o.insertBefore(r,a||null)}function el(o){o.parentNode&&o.parentNode.removeChild(o)}function tl(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function Rt(o,r,a){a==null?o.removeAttribute(r):o.getAttribute(r)!==a&&o.setAttribute(r,a)}function Ip(o){return Array.from(o.childNodes)}function Br(o,r,a){o.classList.toggle(r,!!a)}let Ss;function zn(o){Ss=o}const hn=[],nl=[];let gn=[];const rl=[],Np=Promise.resolve();let Is=!1;function wp(){Is||(Is=!0,Np.then(il))}function Ns(o){gn.push(o)}const ws=new Set;let yn=0;function il(){if(yn!==0)return;const o=Ss;do{try{for(;yn<hn.length;){const r=hn[yn];yn++,zn(r),bp(r.$$)}}catch(r){throw hn.length=0,yn=0,r}for(zn(null),hn.length=0,yn=0;nl.length;)nl.pop()();for(let r=0;r<gn.length;r+=1){const a=gn[r];ws.has(a)||(ws.add(a),a())}gn.length=0}while(hn.length);for(;rl.length;)rl.pop()();Is=!1,ws.clear(),zn(o)}function bp(o){if(o.fragment!==null){o.update(),Gr(o.before_update);const r=o.dirty;o.dirty=[-1],o.fragment&&o.fragment.p(o.ctx,r),o.after_update.forEach(Ns)}}function Op(o){const r=[],a=[];gn.forEach(l=>o.indexOf(l)===-1?r.push(l):a.push(l)),a.forEach(l=>l()),gn=r}const Tp=new Set;function Lp(o,r){o&&o.i&&(Tp.delete(o),o.i(r))}function Rp(o,r,a){const{fragment:l,after_update:c}=o.$$;l&&l.m(r,a),Ns(()=>{const h=o.$$.on_mount.map(Ju).filter(Ku);o.$$.on_destroy?o.$$.on_destroy.push(...h):Gr(h),o.$$.on_mount=[]}),c.forEach(Ns)}function Cp(o,r){const a=o.$$;a.fragment!==null&&(Op(a.after_update),Gr(a.on_destroy),a.fragment&&a.fragment.d(r),a.on_destroy=a.fragment=null,a.ctx=[])}function Pp(o,r){o.$$.dirty[0]===-1&&(hn.push(o),wp(),o.$$.dirty.fill(0)),o.$$.dirty[r/31|0]|=1<<r%31}function Ap(o,r,a,l,c,h,v=null,p=[-1]){const _=Ss;zn(o);const x=o.$$={fragment:null,ctx:[],props:h,update:qn,not_equal:c,bound:Qu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(r.context||(_?_.$$.context:[])),callbacks:Qu(),dirty:p,skip_bound:!1,root:r.target||_.$$.root};v&&v(x.root);let S=!1;if(x.ctx=a?a(o,r.props||{},(m,k,...E)=>{const N=E.length?E[0]:k;return x.ctx&&c(x.ctx[m],x.ctx[m]=N)&&(!x.skip_bound&&x.bound[m]&&x.bound[m](N),S&&Pp(o,m)),k}):[],x.update(),S=!0,Gr(x.before_update),x.fragment=l?l(x.ctx):!1,r.target){if(r.hydrate){const m=Ip(r.target);x.fragment&&x.fragment.l(m),m.forEach(el)}else x.fragment&&x.fragment.c();r.intro&&Lp(o.$$.fragment),Rp(o,r.target,r.anchor),il()}zn(_)}class Mp{constructor(){ia(this,"$$");ia(this,"$$set")}$destroy(){Cp(this,1),this.$destroy=qn}$on(r,a){if(!Ku(a))return qn;const l=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return l.push(a),()=>{const c=l.indexOf(a);c!==-1&&l.splice(c,1)}}$set(r){this.$$set&&!Ep(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}}const Dp="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Dp);function Fp(o){let r,a,l;return{c(){r=tl("svg"),a=tl("path"),Rt(a,"stroke-width","4"),Rt(a,"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"),Rt(a,"class","svelte-gzo3ar"),Rt(r,"width",l=o[0]==="list"?20:void 0),Rt(r,"viewBox","0 0 70 85"),Rt(r,"fill","none"),Rt(r,"class","svelte-gzo3ar"),Br(r,"in-map",o[0]!=="list"),Br(r,"list-icon",o[0]==="list")},m(c,h){Sp(c,r,h),kp(r,a)},p(c,[h]){h&1&&l!==(l=c[0]==="list"?20:void 0)&&Rt(r,"width",l),h&1&&Br(r,"in-map",c[0]!=="list"),h&1&&Br(r,"list-icon",c[0]==="list")},i:qn,o:qn,d(c){c&&el(r)}}}function $p(o,r,a){let{displayIn:l}=r;return o.$$set=c=>{"displayIn"in c&&a(0,l=c.displayIn)},[l]}class Gp extends Mp{constructor(r){super(),Ap(this,r,$p,Fp,xp,{displayIn:0})}}var Bp=Object.defineProperty,qp=(o,r)=>Bp(o,"name",{value:r,configurable:!0});function sl(o,r={}){if(o.bbox!=null&&r.recompute!==!0)return o.bbox;const a=[1/0,1/0,-1/0,-1/0];return fn(o,l=>{a[0]>l[0]&&(a[0]=l[0]),a[1]>l[1]&&(a[1]=l[1]),a[2]<l[0]&&(a[2]=l[0]),a[3]<l[1]&&(a[3]=l[1])}),a}qp(sl,"bbox");var zp=Object.defineProperty,Yp=(o,r)=>zp(o,"name",{value:r,configurable:!0});function al(o,r={}){const a=sl(o),l=(a[0]+a[2])/2,c=(a[1]+a[3])/2;return at([l,c],r.properties,r)}Yp(al,"center");var ol={exports:{}};(function(o,r){(function(a,l){o.exports=l()})(On,function(){function a(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function l(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function c(s,e,t){return e&&l(s.prototype,e),t&&l(s,t),s}function h(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),e&&p(s,e)}function v(s){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(s)}function p(s,e){return p=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},p(s,e)}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function x(s,e,t){return x=_()?Reflect.construct:function(n,i,u){var f=[null];f.push.apply(f,i);var g=new(Function.bind.apply(n,f));return u&&p(g,u.prototype),g},x.apply(null,arguments)}function S(s){var e=typeof Map=="function"?new Map:void 0;return S=function(t){if(t===null||(n=t,Function.toString.call(n).indexOf("[native code]")===-1))return t;var n;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return x(t,arguments,v(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),p(i,t)},S(s)}function m(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function k(s,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m(s)}function E(s){var e=_();return function(){var t,n=v(s);if(e){var i=v(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return k(this,t)}}function N(s,e,t){return N=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(n,i,u){var f=function(y,d){for(;!Object.prototype.hasOwnProperty.call(y,d)&&(y=v(y))!==null;);return y}(n,i);if(f){var g=Object.getOwnPropertyDescriptor(f,i);return g.get?g.get.call(u):g.value}},N(s,e,t||s)}function T(s){return function(e){if(Array.isArray(e))return A(e)}(s)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(s)||R(s)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function R(s,e){if(s){if(typeof s=="string")return A(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);return t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set"?Array.from(s):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(s,e):void 0}}function A(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=s[t];return n}function P(s,e){var t=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(!t){if(Array.isArray(s)||(t=R(s))||e){t&&(s=t);var n=0,i=function(){};return{s:i,n:function(){return n>=s.length?{done:!0}:{done:!1,value:s[n++]}},e:function(y){throw y},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
27
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,f=!0,g=!1;return{s:function(){t=t.call(s)},n:function(){var y=t.next();return f=y.done,y},e:function(y){g=!0,u=y},f:function(){try{f||t.return==null||t.return()}finally{if(g)throw u}}}}var C=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=s.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=s.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==s.JOIN_ROUND&&(this._quadrantSegments=s.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(e){this._joinStyle=e}},{key:"setSimplifyFactor",value:function(e){this._simplifyFactor=e<0?0:e}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(e){this._endCapStyle=e}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(e){this._mitreLimit=e}},{key:"setSingleSided",value:function(e){this._isSingleSided=e}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=s.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=s.CAP_ROUND,this._joinStyle=s.JOIN_ROUND,this._mitreLimit=s.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=s.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],u=arguments[1],f=arguments[2],g=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(u),this.setJoinStyle(f),this.setMitreLimit(g)}}}},{key:"bufferDistanceError",value:function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)}}]),s}();C.CAP_ROUND=1,C.CAP_FLAT=2,C.CAP_SQUARE=3,C.JOIN_ROUND=1,C.JOIN_MITRE=2,C.JOIN_BEVEL=3,C.DEFAULT_QUADRANT_SEGMENTS=8,C.DEFAULT_MITRE_LIMIT=5,C.DEFAULT_SIMPLIFY_FACTOR=.01;var F=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this,n)).name=Object.keys({Exception:t})[0],i}return c(t,[{key:"toString",value:function(){return this.message}}]),t}(S(Error)),M=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this,n)).name=Object.keys({IllegalArgumentException:t})[0],i}return t}(F),B=function(){function s(){a(this,s)}return c(s,[{key:"filter",value:function(e){}}]),s}();function Y(){}function U(){}function X(){}var ie,ee,te,ae,q,ne,ue,ve,Ie=function(){function s(){a(this,s)}return c(s,null,[{key:"equalsWithTolerance",value:function(e,t,n){return Math.abs(e-t)<=n}}]),s}(),Ne=function(){function s(e,t){a(this,s),this.low=t||0,this.high=e||0}return c(s,null,[{key:"toBinaryString",value:function(e){var t,n="";for(t=2147483648;t>0;t>>>=1)n+=(e.high&t)===t?"1":"0";for(t=2147483648;t>0;t>>>=1)n+=(e.low&t)===t?"1":"0";return n}}]),s}();function j(){}function Ce(){}j.NaN=NaN,j.isNaN=function(s){return Number.isNaN(s)},j.isInfinite=function(s){return!Number.isFinite(s)},j.MAX_VALUE=Number.MAX_VALUE,j.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,j.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,typeof Float64Array=="function"&&typeof Int32Array=="function"?(ne=2146435072,ue=new Float64Array(1),ve=new Int32Array(ue.buffer),j.doubleToLongBits=function(s){ue[0]=s;var e=0|ve[0],t=0|ve[1];return(t&ne)===ne&&1048575&t&&e!==0&&(e=0,t=2146959360),new Ne(t,e)},j.longBitsToDouble=function(s){return ve[0]=s.low,ve[1]=s.high,ue[0]}):(ie=1023,ee=Math.log2,te=Math.floor,ae=Math.pow,q=function(){for(var s=53;s>0;s--){var e=ae(2,s)-1;if(te(ee(e))+1===s)return e}return 0}(),j.doubleToLongBits=function(s){var e,t,n,i,u,f,g,y,d;if(s<0||1/s===Number.NEGATIVE_INFINITY?(f=1<<31,s=-s):f=0,s===0)return new Ne(y=f,d=0);if(s===1/0)return new Ne(y=2146435072|f,d=0);if(s!=s)return new Ne(y=2146959360,d=0);if(i=0,d=0,(e=te(s))>1)if(e<=q)(i=te(ee(e)))<=20?(d=0,y=e<<20-i&1048575):(d=e%(t=ae(2,n=i-20))<<32-n,y=e/t&1048575);else for(n=e,d=0;(n=te(t=n/2))!==0;)i++,d>>>=1,d|=(1&y)<<31,y>>>=1,t!==n&&(y|=524288);if(g=i+ie,u=e===0,e=s-e,i<52&&e!==0)for(n=0;;){if((t=2*e)>=1?(e=t-1,u?(g--,u=!1):(n<<=1,n|=1,i++)):(e=t,u?--g==0&&(i++,u=!1):(n<<=1,i++)),i===20)y|=n,n=0;else if(i===52){d|=n;break}if(t===1){i<20?y|=n<<20-i:i<52&&(d|=n<<52-i);break}}return y|=g<<20,new Ne(y|=f,d)},j.longBitsToDouble=function(s){var e,t,n,i,u=s.high,f=s.low,g=u&1<<31?-1:1;for(n=((2146435072&u)>>20)-ie,i=0,t=1<<19,e=1;e<=20;e++)u&t&&(i+=ae(2,-e)),t>>>=1;for(t=1<<31,e=21;e<=52;e++)f&t&&(i+=ae(2,-e)),t>>>=1;if(n===-1023){if(i===0)return 0*g;n=-1022}else{if(n===1024)return i===0?g/0:NaN;i+=1}return g*i*ae(2,n)});var we=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this,n)).name=Object.keys({RuntimeException:t})[0],i}return t}(F),Me=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,null,[{key:"constructor_",value:function(){if(arguments.length===0)we.constructor_.call(this);else if(arguments.length===1){var n=arguments[0];we.constructor_.call(this,n)}}}]),t}(we),se=function(){function s(){a(this,s)}return c(s,null,[{key:"shouldNeverReachHere",value:function(){if(arguments.length===0)s.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new Me("Should never reach here"+(e!==null?": "+e:""))}}},{key:"isTrue",value:function(){if(arguments.length===1){var e=arguments[0];s.isTrue(e,null)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(!t)throw n===null?new Me:new Me(n)}}},{key:"equals",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];s.equals(e,t,null)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],u=arguments[2];if(!i.equals(n))throw new Me("Expected "+n+" but encountered "+i+(u!==null?": "+u:""))}}}]),s}(),dt=new ArrayBuffer(8),wm=new Float64Array(dt),ql=new Int32Array(dt),O=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getM",value:function(){return j.NaN}},{key:"setOrdinate",value:function(e,t){switch(e){case s.X:this.x=t;break;case s.Y:this.y=t;break;case s.Z:this.setZ(t);break;default:throw new M("Invalid ordinate index: "+e)}}},{key:"equals2D",value:function(){if(arguments.length===1){var e=arguments[0];return this.x===e.x&&this.y===e.y}if(arguments.length===2){var t=arguments[0],n=arguments[1];return!!Ie.equalsWithTolerance(this.x,t.x,n)&&!!Ie.equalsWithTolerance(this.y,t.y,n)}}},{key:"setM",value:function(e){throw new M("Invalid ordinate index: "+s.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(e){switch(e){case s.X:return this.x;case s.Y:return this.y;case s.Z:return this.getZ()}throw new M("Invalid ordinate index: "+e)}},{key:"equals3D",value:function(e){return this.x===e.x&&this.y===e.y&&(this.getZ()===e.getZ()||j.isNaN(this.getZ())&&j.isNaN(e.getZ()))}},{key:"equals",value:function(e){return e instanceof s&&this.equals2D(e)}},{key:"equalInZ",value:function(e,t){return Ie.equalsWithTolerance(this.getZ(),e.getZ(),t)}},{key:"setX",value:function(e){this.x=e}},{key:"compareTo",value:function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(e){this.z=e}},{key:"clone",value:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return se.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw e}}},{key:"copy",value:function(){return new s(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.getZ()-e.getZ();return Math.sqrt(t*t+n*n+i*i)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(e){this.y=e}},{key:"distance",value:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)}},{key:"hashCode",value:function(){var e=17;return e=37*(e=37*e+s.hashCode(this.x))+s.hashCode(this.y)}},{key:"setCoordinate",value:function(e){this.x=e.x,this.y=e.y,this.z=e.getZ()}},{key:"interfaces_",get:function(){return[Y,U,X]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)s.constructor_.call(this,0,0);else if(arguments.length===1){var e=arguments[0];s.constructor_.call(this,e.x,e.y,e.getZ())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];s.constructor_.call(this,t,n,s.NULL_ORDINATE)}else if(arguments.length===3){var i=arguments[0],u=arguments[1],f=arguments[2];this.x=i,this.y=u,this.z=f}}},{key:"hashCode",value:function(e){return wm[0]=e,ql[0]^ql[1]}}]),s}(),bm=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"compare",value:function(e,t){var n=s.compare(e.x,t.x);if(n!==0)return n;var i=s.compare(e.y,t.y);return i!==0?i:this._dimensionsToTest<=2?0:s.compare(e.getZ(),t.getZ())}},{key:"interfaces_",get:function(){return[Ce]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,arguments.length===0)s.constructor_.call(this,2);else if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new M("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}},{key:"compare",value:function(e,t){return e<t?-1:e>t?1:j.isNaN(e)?j.isNaN(t)?0:-1:j.isNaN(t)?1:0}}]),s}();O.DimensionalComparator=bm,O.NULL_ORDINATE=j.NaN,O.X=0,O.Y=1,O.Z=2,O.M=3;var pe=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(e){if(!(e instanceof s))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()}},{key:"intersection",value:function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new s;var t=this._minx>e._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny;return new s(t,this._maxx<e._maxx?this._maxx:e._maxx,n,this._maxy<e._maxy?this._maxy:e._maxy)}},{key:"isNull",value:function(){return this._maxx<this._minx}},{key:"getMaxX",value:function(){return this._maxx}},{key:"covers",value:function(){if(arguments.length===1){if(arguments[0]instanceof O){var e=arguments[0];return this.covers(e.x,e.y)}if(arguments[0]instanceof s){var t=arguments[0];return!this.isNull()&&!t.isNull()&&t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}}},{key:"intersects",value:function(){if(arguments.length===1){if(arguments[0]instanceof s){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}if(arguments[0]instanceof O){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(arguments.length===2){if(arguments[0]instanceof O&&arguments[1]instanceof O){var n=arguments[0],i=arguments[1];if(this.isNull())return!1;var u=n.x<i.x?n.x:i.x;if(u>this._maxx)return!1;var f=n.x>i.x?n.x:i.x;if(f<this._minx)return!1;var g=n.y<i.y?n.y:i.y;if(g>this._maxy)return!1;var y=n.y>i.y?n.y:i.y;return!(y<this._miny)}if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var d=arguments[0],w=arguments[1];return!this.isNull()&&!(d>this._maxx||d<this._minx||w>this._maxy||w<this._miny)}}}},{key:"getMinY",value:function(){return this._miny}},{key:"getDiameter",value:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return Math.sqrt(e*e+t*t)}},{key:"getMinX",value:function(){return this._minx}},{key:"expandToInclude",value:function(){if(arguments.length===1){if(arguments[0]instanceof O){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof s){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t}},{key:"getWidth",value:function(){return this.isNull()?0:this._maxx-this._minx}},{key:"compareTo",value:function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0}},{key:"translate",value:function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)}},{key:"copy",value:function(){return new s(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(e){return!(!this.isNull()&&!e.isNull())||e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny}},{key:"getHeight",value:function(){return this.isNull()?0:this._maxy-this._miny}},{key:"maxExtent",value:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t}},{key:"expandBy",value:function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}},{key:"contains",value:function(){if(arguments.length===1){if(arguments[0]instanceof s){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof O){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}}},{key:"centre",value:function(){return this.isNull()?null:new O((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof O){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof s){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var u=arguments[0],f=arguments[1],g=arguments[2],y=arguments[3];u<f?(this._minx=u,this._maxx=f):(this._minx=f,this._maxx=u),g<y?(this._miny=g,this._maxy=y):(this._miny=y,this._maxy=g)}}},{key:"getMaxY",value:function(){return this._maxy}},{key:"distance",value:function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxy<e._miny?n=e._miny-this._maxy:this._miny>e._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)}},{key:"hashCode",value:function(){var e=17;return e=37*(e=37*(e=37*(e=37*e+O.hashCode(this._minx))+O.hashCode(this._maxx))+O.hashCode(this._miny))+O.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[Y,X]}}],[{key:"constructor_",value:function(){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 O){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof s){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var u=arguments[0],f=arguments[1],g=arguments[2],y=arguments[3];this.init(u,f,g,y)}}},{key:"intersects",value:function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.x<t.x?e.x:t.x)&&n.x<=(e.x>t.x?e.x:t.x)&&n.y>=(e.y<t.y?e.y:t.y)&&n.y<=(e.y>t.y?e.y:t.y)}if(arguments.length===4){var i=arguments[0],u=arguments[1],f=arguments[2],g=arguments[3],y=Math.min(f.x,g.x),d=Math.max(f.x,g.x),w=Math.min(i.x,u.x),b=Math.max(i.x,u.x);return!(w>d)&&!(b<y)&&(y=Math.min(f.y,g.y),d=Math.max(f.y,g.y),w=Math.min(i.y,u.y),b=Math.max(i.y,u.y),!(w>d)&&!(b<y))}}}]),s}(),W=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"isGeometryCollection",value:function(){return this.getTypeCode()===s.TYPECODE_GEOMETRYCOLLECTION}},{key:"getFactory",value:function(){return this._factory}},{key:"getGeometryN",value:function(e){return this}},{key:"getArea",value:function(){return 0}},{key:"isRectangle",value:function(){return!1}},{key:"equalsExact",value:function(e){return this===e||this.equalsExact(e,0)}},{key:"geometryChanged",value:function(){this.apply(s.geometryChangedFilter)}},{key:"geometryChangedAction",value:function(){this._envelope=null}},{key:"equalsNorm",value:function(e){return e!==null&&this.norm().equalsExact(e.norm())}},{key:"getLength",value:function(){return 0}},{key:"getNumGeometries",value:function(){return 1}},{key:"compareTo",value:function(){var e;if(arguments.length===1){var t=arguments[0];return e=t,this.getTypeCode()!==e.getTypeCode()?this.getTypeCode()-e.getTypeCode():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(arguments.length===2){var n=arguments[0],i=arguments[1];return e=n,this.getTypeCode()!==e.getTypeCode()?this.getTypeCode()-e.getTypeCode():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(n,i)}}},{key:"getUserData",value:function(){return this._userData}},{key:"getSRID",value:function(){return this._SRID}},{key:"getEnvelope",value:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}},{key:"checkNotGeometryCollection",value:function(e){if(e.getTypeCode()===s.TYPECODE_GEOMETRYCOLLECTION)throw new M("This method does not support GeometryCollection arguments")}},{key:"equal",value:function(e,t,n){return n===0?e.equals(t):e.distance(t)<=n}},{key:"norm",value:function(){var e=this.copy();return e.normalize(),e}},{key:"reverse",value:function(){var e=this.reverseInternal();return this.envelope!=null&&(e.envelope=this.envelope.copy()),e.setSRID(this.getSRID()),e}},{key:"copy",value:function(){var e=this.copyInternal();return e.envelope=this._envelope==null?null:this._envelope.copy(),e._SRID=this._SRID,e._userData=this._userData,e}},{key:"getPrecisionModel",value:function(){return this._factory.getPrecisionModel()}},{key:"getEnvelopeInternal",value:function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new pe(this._envelope)}},{key:"setSRID",value:function(e){this._SRID=e}},{key:"setUserData",value:function(e){this._userData=e}},{key:"compare",value:function(e,t){for(var n=e.iterator(),i=t.iterator();n.hasNext()&&i.hasNext();){var u=n.next(),f=i.next(),g=u.compareTo(f);if(g!==0)return g}return n.hasNext()?1:i.hasNext()?-1:0}},{key:"hashCode",value:function(){return this.getEnvelopeInternal().hashCode()}},{key:"isEquivalentClass",value:function(e){return this.getClass()===e.getClass()}},{key:"isGeometryCollectionOrDerived",value:function(){return this.getTypeCode()===s.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===s.TYPECODE_MULTIPOINT||this.getTypeCode()===s.TYPECODE_MULTILINESTRING||this.getTypeCode()===s.TYPECODE_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[U,Y,X]}},{key:"getClass",value:function(){return s}}],[{key:"hasNonEmptyElements",value:function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1}},{key:"hasNullElements",value:function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1}}]),s}();W.constructor_=function(s){s&&(this._envelope=null,this._userData=null,this._factory=s,this._SRID=s.getSRID())},W.TYPECODE_POINT=0,W.TYPECODE_MULTIPOINT=1,W.TYPECODE_LINESTRING=2,W.TYPECODE_LINEARRING=3,W.TYPECODE_MULTILINESTRING=4,W.TYPECODE_POLYGON=5,W.TYPECODE_MULTIPOLYGON=6,W.TYPECODE_GEOMETRYCOLLECTION=7,W.TYPENAME_POINT="Point",W.TYPENAME_MULTIPOINT="MultiPoint",W.TYPENAME_LINESTRING="LineString",W.TYPENAME_LINEARRING="LinearRing",W.TYPENAME_MULTILINESTRING="MultiLineString",W.TYPENAME_POLYGON="Polygon",W.TYPENAME_MULTIPOLYGON="MultiPolygon",W.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",W.geometryChangedFilter={get interfaces_(){return[B]},filter:function(s){s.geometryChangedAction()}};var I=function(){function s(){a(this,s)}return c(s,null,[{key:"toLocationSymbol",value:function(e){switch(e){case s.EXTERIOR:return"e";case s.BOUNDARY:return"b";case s.INTERIOR:return"i";case s.NONE:return"-"}throw new M("Unknown location value: "+e)}}]),s}();I.INTERIOR=0,I.BOUNDARY=1,I.EXTERIOR=2,I.NONE=-1;var ct=function(){function s(){a(this,s)}return c(s,[{key:"add",value:function(){}},{key:"addAll",value:function(){}},{key:"isEmpty",value:function(){}},{key:"iterator",value:function(){}},{key:"size",value:function(){}},{key:"toArray",value:function(){}},{key:"remove",value:function(){}}]),s}(),Qr=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this,n)).name=Object.keys({NoSuchElementException:t})[0],i}return t}(F),At=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this,n)).name=Object.keys({UnsupportedOperationException:t})[0],i}return t}(F),zl=function(s){h(t,s);var e=E(t);function t(){return a(this,t),e.apply(this,arguments)}return c(t,[{key:"contains",value:function(){}}]),t}(ct),Fs=function(s,e){h(n,s);var t=E(n);function n(i){var u;return a(this,n),(u=t.call(this)).map=new Map,i instanceof ct&&u.addAll(i),u}return c(n,[{key:"contains",value:function(i){var u=i.hashCode?i.hashCode():i;return!!this.map.has(u)}},{key:"add",value:function(i){var u=i.hashCode?i.hashCode():i;return!this.map.has(u)&&!!this.map.set(u,i)}},{key:"addAll",value:function(i){var u,f=P(i);try{for(f.s();!(u=f.n()).done;){var g=u.value;this.add(g)}}catch(y){f.e(y)}finally{f.f()}return!0}},{key:"remove",value:function(){throw new At}},{key:"size",value:function(){return this.map.size}},{key:"isEmpty",value:function(){return this.map.size===0}},{key:"toArray",value:function(){return Array.from(this.map.values())}},{key:"iterator",value:function(){return new Om(this.map)}},{key:e,value:function(){return this.map}}]),n}(zl,Symbol.iterator),Om=function(){function s(e){a(this,s),this.iterator=e.values();var t=this.iterator.next(),n=t.done,i=t.value;this.done=n,this.value=i}return c(s,[{key:"next",value:function(){if(this.done)throw new Qr;var e=this.value,t=this.iterator.next(),n=t.done,i=t.value;return this.done=n,this.value=i,e}},{key:"hasNext",value:function(){return!this.done}},{key:"remove",value:function(){throw new At}}]),s}(),G=function(){function s(){a(this,s)}return c(s,null,[{key:"opposite",value:function(e){return e===s.LEFT?s.RIGHT:e===s.RIGHT?s.LEFT:e}}]),s}();G.ON=0,G.LEFT=1,G.RIGHT=2;var Yl=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this,n)).name=Object.keys({EmptyStackException:t})[0],i}return t}(F),Ul=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this,n)).name=Object.keys({IndexOutOfBoundsException:t})[0],i}return t}(F),zt=function(s){h(t,s);var e=E(t);function t(){return a(this,t),e.apply(this,arguments)}return c(t,[{key:"get",value:function(){}},{key:"set",value:function(){}},{key:"isEmpty",value:function(){}}]),t}(ct),Tm=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),(n=e.call(this)).array=[],n}return c(t,[{key:"add",value:function(n){return this.array.push(n),!0}},{key:"get",value:function(n){if(n<0||n>=this.size())throw new Ul;return this.array[n]}},{key:"push",value:function(n){return this.array.push(n),n}},{key:"pop",value:function(){if(this.array.length===0)throw new Yl;return this.array.pop()}},{key:"peek",value:function(){if(this.array.length===0)throw new Yl;return this.array[this.array.length-1]}},{key:"empty",value:function(){return this.array.length===0}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(n){return this.array.indexOf(n)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}]),t}(zt);function re(s,e){return s.interfaces_&&s.interfaces_.indexOf(e)>-1}var Vn=function(){function s(e){a(this,s),this.str=e}return c(s,[{key:"append",value:function(e){this.str+=e}},{key:"setCharAt",value:function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)}},{key:"toString",value:function(){return this.str}}]),s}(),Kr=function(){function s(e){a(this,s),this.value=e}return c(s,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(e){return this.value<e?-1:this.value>e?1:0}}],[{key:"compare",value:function(e,t){return e<t?-1:e>t?1:0}},{key:"isNan",value:function(e){return Number.isNaN(e)}},{key:"valueOf",value:function(e){return new s(e)}}]),s}(),$s=function(){function s(){a(this,s)}return c(s,null,[{key:"isWhitespace",value:function(e){return e<=32&&e>=0||e===127}},{key:"toUpperCase",value:function(e){return e.toUpperCase()}}]),s}(),J=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"le",value:function(e){return this._hi<e._hi||this._hi===e._hi&&this._lo<=e._lo}},{key:"extractSignificantDigits",value:function(e,t){var n=this.abs(),i=s.magnitude(n._hi),u=s.TEN.pow(i);(n=n.divide(u)).gt(s.TEN)?(n=n.divide(s.TEN),i+=1):n.lt(s.ONE)&&(n=n.multiply(s.TEN),i-=1);for(var f=i+1,g=new Vn,y=s.MAX_PRINT_DIGITS-1,d=0;d<=y;d++){e&&d===f&&g.append(".");var w=Math.trunc(n._hi);if(w<0)break;var b=!1,L=0;w>9?(b=!0,L="9"):L="0"+w,g.append(L),n=n.subtract(s.valueOf(w)).multiply(s.TEN),b&&n.selfAdd(s.TEN);var $=!0,D=s.magnitude(n._hi);if(D<0&&Math.abs(D)>=y-d&&($=!1),!$)break}return t[0]=i,g.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof s){var e=arguments[0];return this.add(e.negate())}if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}}},{key:"equals",value:function(){if(arguments.length===1&&arguments[0]instanceof s){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}}},{key:"isZero",value:function(){return this._hi===0&&this._lo===0}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof s){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(e){return this.le(e)?this:e}},{key:"selfDivide",value:function(){if(arguments.length===1){if(arguments[0]instanceof s){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],u=null,f=null,g=null,y=null,d=null,w=null,b=null,L=null;return d=this._hi/n,L=(u=(w=s.SPLIT*d)-(u=w-d))*(g=(L=s.SPLIT*n)-(g=L-n))-(b=d*n)+u*(y=n-g)+(f=d-u)*g+f*y,L=d+(w=(this._hi-b-L+this._lo-d*i)/n),this._hi=L,this._lo=d-L+w,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof s){var e=arguments[0],t=null,n=null,i=null,u=null,f=null,g=null,y=null,d=null;n=(f=this._hi/e._hi)-(t=(g=s.SPLIT*f)-(t=g-f)),d=t*(i=(d=s.SPLIT*e._hi)-(i=d-e._hi))-(y=f*e._hi)+t*(u=e._hi-i)+n*i+n*u;var w=d=f+(g=(this._hi-y-d+this._lo-f*e._lo)/e._hi),b=f-d+g;return new s(w,b)}if(typeof arguments[0]=="number"){var L=arguments[0];return j.isNaN(L)?s.createNaN():s.copy(this).selfDivide(L,0)}}},{key:"ge",value:function(e){return this._hi>e._hi||this._hi===e._hi&&this._lo>=e._lo}},{key:"pow",value:function(e){if(e===0)return s.valueOf(1);var t=new s(this),n=s.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(t),(i/=2)>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n}},{key:"ceil",value:function(){if(this.isNaN())return s.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new s(e,t)}},{key:"compareTo",value:function(e){var t=e;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof s){var e=arguments[0];return this.init(e),this}if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}}},{key:"max",value:function(e){return this.ge(e)?this:e}},{key:"sqrt",value:function(){if(this.isZero())return s.valueOf(0);if(this.isNegative())return s.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=s.valueOf(t),i=this.subtract(n.sqr())._hi*(.5*e);return n.add(i)}},{key:"selfAdd",value:function(){if(arguments.length===1){if(arguments[0]instanceof s){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0],n=null,i=null,u=null,f=null,g=null,y=null;return f=(u=this._hi+t)-(g=u-this._hi),i=(y=(f=t-g+(this._hi-f))+this._lo)+(u-(n=u+y)),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var d=arguments[0],w=arguments[1],b=null,L=null,$=null,D=null,V=null,H=null,K=null;D=this._hi+d,L=this._lo+w,V=D-(H=D-this._hi),$=L-(K=L-this._lo);var ge=(b=D+(H=(V=d-H+(this._hi-V))+L))+(H=($=w-K+(this._lo-$))+(H+(D-b))),xe=H+(b-ge);return this._hi=ge,this._lo=xe,this}}},{key:"selfMultiply",value:function(){if(arguments.length===1){if(arguments[0]instanceof s){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],u=null,f=null,g=null,y=null,d=null,w=null;u=(d=s.SPLIT*this._hi)-this._hi,w=s.SPLIT*n,u=d-u,f=this._hi-u,g=w-n;var b=(d=this._hi*n)+(w=u*(g=w-g)-d+u*(y=n-g)+f*g+f*y+(this._hi*i+this._lo*n)),L=w+(u=d-b);return this._hi=b,this._lo=L,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return s.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new s(e,t)}},{key:"negate",value:function(){return this.isNaN()?this:new s(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return null;throw e}}},{key:"multiply",value:function(){if(arguments[0]instanceof s){var e=arguments[0];return e.isNaN()?s.createNaN():s.copy(this).selfMultiply(e)}if(typeof arguments[0]=="number"){var t=arguments[0];return j.isNaN(t)?s.createNaN():s.copy(this).selfMultiply(t,0)}}},{key:"isNaN",value:function(){return j.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var e=s.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),i=t[0]+1,u=n;if(n.charAt(0)===".")u="0"+n;else if(i<0)u="0."+s.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var f=i-n.length;u=n+s.stringOfChar("0",f)+".0"}return this.isNegative()?"-"+u:u}},{key:"reciprocal",value:function(){var e,t,n,i,u=null,f=null,g=null,y=null;e=(n=1/this._hi)-(u=(g=s.SPLIT*n)-(u=g-n)),f=(y=s.SPLIT*this._hi)-this._hi;var d=n+(g=(1-(i=n*this._hi)-(y=u*(f=y-f)-i+u*(t=this._hi-f)+e*f+e*t)-n*this._lo)/this._hi);return new s(d,n-d+g)}},{key:"toSciNotation",value:function(){if(this.isZero())return s.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),i=s.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new IllegalStateException("Found leading zero: "+n);var u="";n.length>1&&(u=n.substring(1));var f=n.charAt(0)+"."+u;return this.isNegative()?"-"+f+i:f+i}},{key:"abs",value:function(){return this.isNaN()?s.NaN:this.isNegative()?this.negate():new s(this)}},{key:"isPositive",value:function(){return this._hi>0||this._hi===0&&this._lo>0}},{key:"lt",value:function(e){return this._hi<e._hi||this._hi===e._hi&&this._lo<e._lo}},{key:"add",value:function(){if(arguments[0]instanceof s){var e=arguments[0];return s.copy(this).selfAdd(e)}if(typeof arguments[0]=="number"){var t=arguments[0];return s.copy(this).selfAdd(t)}}},{key:"init",value:function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof s){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}}},{key:"gt",value:function(e){return this._hi>e._hi||this._hi===e._hi&&this._lo>e._lo}},{key:"isNegative",value:function(){return this._hi<0||this._hi===0&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?s.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[X,Y,U]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof s){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var n=arguments[0];s.constructor_.call(this,s.parse(n))}}else if(arguments.length===2){var i=arguments[0],u=arguments[1];this.init(i,u)}}},{key:"determinant",value:function(){if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];return s.determinant(s.valueOf(e),s.valueOf(t),s.valueOf(n),s.valueOf(i))}if(arguments[3]instanceof s&&arguments[2]instanceof s&&arguments[0]instanceof s&&arguments[1]instanceof s){var u=arguments[0],f=arguments[1],g=arguments[2],y=arguments[3],d=u.multiply(y).selfSubtract(f.multiply(g));return d}}},{key:"sqr",value:function(e){return s.valueOf(e).selfMultiply(e)}},{key:"valueOf",value:function(){if(typeof arguments[0]=="string"){var e=arguments[0];return s.parse(e)}if(typeof arguments[0]=="number"){var t=arguments[0];return new s(t)}}},{key:"sqrt",value:function(e){return s.valueOf(e).sqrt()}},{key:"parse",value:function(e){for(var t=0,n=e.length;$s.isWhitespace(e.charAt(t));)t++;var i=!1;if(t<n){var u=e.charAt(t);u!=="-"&&u!=="+"||(t++,u==="-"&&(i=!0))}for(var f=new s,g=0,y=0,d=0,w=!1;!(t>=n);){var b=e.charAt(t);if(t++,$s.isDigit(b)){var L=b-"0";f.selfMultiply(s.TEN),f.selfAdd(L),g++}else{if(b!=="."){if(b==="e"||b==="E"){var $=e.substring(t);try{d=Kr.parseInt($)}catch(ge){throw ge instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+$+" in string "+e):ge}break}throw new NumberFormatException("Unexpected character '"+b+"' at position "+t+" in string "+e)}y=g,w=!0}}var D=f;w||(y=g);var V=g-y-d;if(V===0)D=f;else if(V>0){var H=s.TEN.pow(V);D=f.divide(H)}else if(V<0){var K=s.TEN.pow(-V);D=f.multiply(K)}return i?D.negate():D}},{key:"createNaN",value:function(){return new s(j.NaN,j.NaN)}},{key:"copy",value:function(e){return new s(e)}},{key:"magnitude",value:function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(n));return 10*Math.pow(10,i)<=t&&(i+=1),i}},{key:"stringOfChar",value:function(e,t){for(var n=new Vn,i=0;i<t;i++)n.append(e);return n.toString()}}]),s}();J.PI=new J(3.141592653589793,12246467991473532e-32),J.TWO_PI=new J(6.283185307179586,24492935982947064e-32),J.PI_2=new J(1.5707963267948966,6123233995736766e-32),J.E=new J(2.718281828459045,14456468917292502e-32),J.NaN=new J(j.NaN,j.NaN),J.EPS=123259516440783e-46,J.SPLIT=134217729,J.MAX_PRINT_DIGITS=32,J.TEN=J.valueOf(10),J.ONE=J.valueOf(1),J.SCI_NOT_EXPONENT_CHAR="E",J.SCI_NOT_ZERO="0.0E0";var Gs=function(){function s(){a(this,s)}return c(s,null,[{key:"orientationIndex",value:function(e,t,n){var i=s.orientationIndexFilter(e,t,n);if(i<=1)return i;var u=J.valueOf(t.x).selfAdd(-e.x),f=J.valueOf(t.y).selfAdd(-e.y),g=J.valueOf(n.x).selfAdd(-t.x),y=J.valueOf(n.y).selfAdd(-t.y);return u.selfMultiply(y).selfSubtract(f.selfMultiply(g)).signum()}},{key:"signOfDet2x2",value:function(){if(arguments[3]instanceof J&&arguments[2]instanceof J&&arguments[0]instanceof J&&arguments[1]instanceof J){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3],u=e.multiply(i).selfSubtract(t.multiply(n));return u.signum()}if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var f=arguments[0],g=arguments[1],y=arguments[2],d=arguments[3],w=J.valueOf(f),b=J.valueOf(g),L=J.valueOf(y),$=J.valueOf(d),D=w.multiply($).selfSubtract(b.multiply(L));return D.signum()}}},{key:"intersection",value:function(e,t,n,i){var u=new J(e.y).selfSubtract(t.y),f=new J(t.x).selfSubtract(e.x),g=new J(e.x).selfMultiply(t.y).selfSubtract(new J(t.x).selfMultiply(e.y)),y=new J(n.y).selfSubtract(i.y),d=new J(i.x).selfSubtract(n.x),w=new J(n.x).selfMultiply(i.y).selfSubtract(new J(i.x).selfMultiply(n.y)),b=f.multiply(w).selfSubtract(d.multiply(g)),L=y.multiply(g).selfSubtract(u.multiply(w)),$=u.multiply(d).selfSubtract(y.multiply(f)),D=b.selfDivide($).doubleValue(),V=L.selfDivide($).doubleValue();return j.isNaN(D)||j.isInfinite(D)||j.isNaN(V)||j.isInfinite(V)?null:new O(D,V)}},{key:"orientationIndexFilter",value:function(e,t,n){var i=null,u=(e.x-n.x)*(t.y-n.y),f=(e.y-n.y)*(t.x-n.x),g=u-f;if(u>0){if(f<=0)return s.signum(g);i=u+f}else{if(!(u<0)||f>=0)return s.signum(g);i=-u-f}var y=s.DP_SAFE_EPSILON*i;return g>=y||-g>=y?s.signum(g):2}},{key:"signum",value:function(e){return e>0?1:e<0?-1:0}}]),s}();Gs.DP_SAFE_EPSILON=1e-15;var le=function(){function s(){a(this,s)}return c(s,[{key:"getM",value:function(e){if(this.hasM()){var t=this.getDimension()-this.getMeasures();return this.getOrdinate(e,t)}return j.NaN}},{key:"setOrdinate",value:function(e,t,n){}},{key:"getZ",value:function(e){return this.hasZ()?this.getOrdinate(e,2):j.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(e,t){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(e){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(e){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(e){}},{key:"copy",value:function(){}},{key:"getY",value:function(e){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[U]}}]),s}();le.X=0,le.Y=1,le.Z=2,le.M=3;var Q=function(){function s(){a(this,s)}return c(s,null,[{key:"index",value:function(e,t,n){return Gs.orientationIndex(e,t,n)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var e=arguments[0],t=e.length-1;if(t<3)throw new M("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=e[0],i=0,u=1;u<=t;u++){var f=e[u];f.y>n.y&&(n=f,i=u)}var g=i;do(g-=1)<0&&(g=t);while(e[g].equals2D(n)&&g!==i);var y=i;do y=(y+1)%t;while(e[y].equals2D(n)&&y!==i);var d=e[g],w=e[y];if(d.equals2D(n)||w.equals2D(n)||d.equals2D(w))return!1;var b=s.index(d,n,w),L=null;return L=b===0?d.x>w.x:b>0,L}if(re(arguments[0],le)){var $=arguments[0],D=$.size()-1;if(D<3)throw new M("Ring has fewer than 4 points, so orientation cannot be determined");for(var V=$.getCoordinate(0),H=0,K=1;K<=D;K++){var ge=$.getCoordinate(K);ge.y>V.y&&(V=ge,H=K)}var xe=null,Le=H;do(Le-=1)<0&&(Le=D),xe=$.getCoordinate(Le);while(xe.equals2D(V)&&Le!==H);var qe=null,nt=H;do nt=(nt+1)%D,qe=$.getCoordinate(nt);while(qe.equals2D(V)&&nt!==H);if(xe.equals2D(V)||qe.equals2D(V)||xe.equals2D(qe))return!1;var kt=s.index(xe,V,qe);return kt===0?xe.x>qe.x:kt>0}}}]),s}();Q.CLOCKWISE=-1,Q.RIGHT=Q.CLOCKWISE,Q.COUNTERCLOCKWISE=1,Q.LEFT=Q.COUNTERCLOCKWISE,Q.COLLINEAR=0,Q.STRAIGHT=Q.COLLINEAR;var Lm=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value:function(e,t){var n=this.getRightmostSideOfSegment(e,t);return n<0&&(n=this.getRightmostSideOfSegment(e,t-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),n}},{key:"findRightmostEdgeAtVertex",value:function(){var e=this._minDe.getEdge().getCoordinates();se.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],n=e[this._minIndex+1],i=Q.index(this._minCoord,n,t),u=!1;(t.y<this._minCoord.y&&n.y<this._minCoord.y&&i===Q.COUNTERCLOCKWISE||t.y>this._minCoord.y&&n.y>this._minCoord.y&&i===Q.CLOCKWISE)&&(u=!0),u&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value:function(e,t){var n=e.getEdge().getCoordinates();if(t<0||t+1>=n.length||n[t].y===n[t+1].y)return-1;var i=G.LEFT;return n[t].y<n[t+1].y&&(i=G.RIGHT),i}},{key:"getEdge",value:function(){return this._orientedDe}},{key:"checkForRightmostCoordinate",value:function(e){for(var t=e.getEdge().getCoordinates(),n=0;n<t.length-1;n++)(this._minCoord===null||t[n].x>this._minCoord.x)&&(this._minDe=e,this._minIndex=n,this._minCoord=t[n])}},{key:"findRightmostEdgeAtNode",value:function(){var e=this._minDe.getNode().getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}},{key:"findEdge",value:function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.isForward()&&this.checkForRightmostCoordinate(n)}se.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,this.getRightmostSide(this._minDe,this._minIndex)===G.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),s}(),_t=function(s){h(t,s);var e=E(t);function t(n,i){var u;return a(this,t),(u=e.call(this,i?n+" [ "+i+" ]":n)).pt=i?new O(i):void 0,u.name=Object.keys({TopologyException:t})[0],u}return c(t,[{key:"getCoordinate",value:function(){return this.pt}}]),t}(we),Rm=function(){function s(){a(this,s),this.array=[]}return c(s,[{key:"addLast",value:function(e){this.array.push(e)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return this.array.length===0}}]),s}(),Z=function(s,e){h(n,s);var t=E(n);function n(i){var u;return a(this,n),(u=t.call(this)).array=[],i instanceof ct&&u.addAll(i),u}return c(n,[{key:"interfaces_",get:function(){return[zt,ct]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(i){return arguments.length===1?this.array.push(i):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(i){var u,f=P(i);try{for(f.s();!(u=f.n()).done;){var g=u.value;this.array.push(g)}}catch(y){f.e(y)}finally{f.f()}}},{key:"set",value:function(i,u){var f=this.array[i];return this.array[i]=u,f}},{key:"iterator",value:function(){return new Cm(this)}},{key:"get",value:function(i){if(i<0||i>=this.size())throw new Ul;return this.array[i]}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"sort",value:function(i){i?this.array.sort(function(u,f){return i.compare(u,f)}):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(i){for(var u=0,f=this.array.length;u<f;u++)if(this.array[u]===i)return!!this.array.splice(u,1);return!1}},{key:e,value:function(){return this.array.values()}}]),n}(zt,Symbol.iterator),Cm=function(){function s(e){a(this,s),this.arrayList=e,this.position=0}return c(s,[{key:"next",value:function(){if(this.position===this.arrayList.size())throw new Qr;return this.arrayList.get(this.position++)}},{key:"hasNext",value:function(){return this.position<this.arrayList.size()}},{key:"set",value:function(e){return this.arrayList.set(this.position-1,e)}},{key:"remove",value:function(){this.arrayList.remove(this.arrayList.get(this.position))}}]),s}(),Pm=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"clearVisitedEdges",value:function(){for(var e=this._dirEdgeList.iterator();e.hasNext();)e.next().setVisited(!1)}},{key:"getRightmostCoordinate",value:function(){return this._rightMostCoord}},{key:"computeNodeDepth",value:function(e){for(var t=null,n=e.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){t=i;break}}if(t===null)throw new _t("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(t);for(var u=e.getEdges().iterator();u.hasNext();){var f=u.next();f.setVisited(!0),this.copySymDepths(f)}}},{key:"computeDepth",value:function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.getNode(),t.getLabel(),t.setEdgeDepths(G.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)}},{key:"create",value:function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}},{key:"findResultEdges",value:function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(G.RIGHT)>=1&&t.getDepth(G.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}}},{key:"computeDepths",value:function(e){var t=new Fs,n=new Rm,i=e.getNode();for(n.addLast(i),t.add(i),e.setVisited(!0);!n.isEmpty();){var u=n.removeFirst();t.add(u),this.computeNodeDepth(u);for(var f=u.getEdges().iterator();f.hasNext();){var g=f.next().getSym();if(!g.isVisited()){var y=g.getNode();t.contains(y)||(n.addLast(y),t.add(y))}}}}},{key:"compareTo",value:function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(this._env===null){for(var e=new pe,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next().getEdge().getCoordinates(),i=0;i<n.length-1;i++)e.expandToInclude(n[i]);this._env=e}return this._env}},{key:"addReachable",value:function(e){var t=new Tm;for(t.add(e);!t.empty();){var n=t.pop();this.add(n,t)}}},{key:"copySymDepths",value:function(e){var t=e.getSym();t.setDepth(G.LEFT,e.getDepth(G.RIGHT)),t.setDepth(G.RIGHT,e.getDepth(G.LEFT))}},{key:"add",value:function(e,t){e.setVisited(!0),this._nodes.add(e);for(var n=e.getEdges().iterator();n.hasNext();){var i=n.next();this._dirEdgeList.add(i);var u=i.getSym().getNode();u.isVisited()||t.push(u)}}},{key:"getNodes",value:function(){return this._nodes}},{key:"getDirectedEdges",value:function(){return this._dirEdgeList}},{key:"interfaces_",get:function(){return[Y]}}],[{key:"constructor_",value:function(){this._finder=null,this._dirEdgeList=new Z,this._nodes=new Z,this._rightMostCoord=null,this._env=null,this._finder=new Lm}}]),s}(),Bs=function(){function s(){a(this,s)}return c(s,null,[{key:"intersection",value:function(e,t,n,i){var u=e.x<t.x?e.x:t.x,f=e.y<t.y?e.y:t.y,g=e.x>t.x?e.x:t.x,y=e.y>t.y?e.y:t.y,d=n.x<i.x?n.x:i.x,w=n.y<i.y?n.y:i.y,b=n.x>i.x?n.x:i.x,L=n.y>i.y?n.y:i.y,$=((u>d?u:d)+(g<b?g:b))/2,D=((f>w?f:w)+(y<L?y:L))/2,V=e.x-$,H=e.y-D,K=t.x-$,ge=t.y-D,xe=n.x-$,Le=n.y-D,qe=i.x-$,nt=i.y-D,kt=H-ge,Ht=K-V,nr=V*ge-K*H,rr=Le-nt,bn=qe-xe,Lc=xe*nt-qe*Le,Rc=kt*bn-rr*Ht,na=(Ht*Lc-bn*nr)/Rc,ra=(rr*nr-kt*Lc)/Rc;return j.isNaN(na)||j.isInfinite(na)||j.isNaN(ra)||j.isInfinite(ra)?null:new O(na+$,ra+D)}}]),s}(),je=function(){function s(){a(this,s)}return c(s,null,[{key:"arraycopy",value:function(e,t,n,i,u){for(var f=0,g=t;g<t+u;g++)n[i+f]=e[g],f++}},{key:"getProperty",value:function(e){return{"line.separator":`
|
|
28
|
-
`}[e]}}]),s}(),Wn=function(){function s(){a(this,s)}return c(s,null,[{key:"log10",value:function(e){var t=Math.log(e);return j.isInfinite(t)||j.isNaN(t)?t:t/s.LOG_10}},{key:"min",value:function(e,t,n,i){var u=e;return t<u&&(u=t),n<u&&(u=n),i<u&&(u=i),u}},{key:"clamp",value:function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],n=arguments[2];return e<t?t:e>n?n:e}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],u=arguments[1],f=arguments[2];return i<u?u:i>f?f:i}}},{key:"wrap",value:function(e,t){return e<0?t- -e%t:e%t}},{key:"max",value:function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],i=e;return t>i&&(i=t),n>i&&(i=n),i}if(arguments.length===4){var u=arguments[0],f=arguments[1],g=arguments[2],y=arguments[3],d=u;return f>d&&(d=f),g>d&&(d=g),y>d&&(d=y),d}}},{key:"average",value:function(e,t){return(e+t)/2}}]),s}();Wn.LOG_10=Math.log(10);var ft=function(){function s(){a(this,s)}return c(s,null,[{key:"segmentToSegment",value:function(e,t,n,i){if(e.equals(t))return s.pointToSegment(e,n,i);if(n.equals(i))return s.pointToSegment(i,e,t);var u=!1;if(pe.intersects(e,t,n,i)){var f=(t.x-e.x)*(i.y-n.y)-(t.y-e.y)*(i.x-n.x);if(f===0)u=!0;else{var g=(e.y-n.y)*(i.x-n.x)-(e.x-n.x)*(i.y-n.y),y=((e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y))/f,d=g/f;(d<0||d>1||y<0||y>1)&&(u=!0)}}else u=!0;return u?Wn.min(s.pointToSegment(e,n,i),s.pointToSegment(t,n,i),s.pointToSegment(n,e,t),s.pointToSegment(i,e,t)):0}},{key:"pointToSegment",value:function(e,t,n){if(t.x===n.x&&t.y===n.y)return e.distance(t);var i=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),u=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/i;if(u<=0)return e.distance(t);if(u>=1)return e.distance(n);var f=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/i;return Math.abs(f)*Math.sqrt(i)}},{key:"pointToLinePerpendicular",value:function(e,t,n){var i=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),u=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/i;return Math.abs(u)*Math.sqrt(i)}},{key:"pointToSegmentString",value:function(e,t){if(t.length===0)throw new M("Line array must contain at least one vertex");for(var n=e.distance(t[0]),i=0;i<t.length-1;i++){var u=s.pointToSegment(e,t[i],t[i+1]);u<n&&(n=u)}return n}}]),s}(),Xl=function(){function s(){a(this,s)}return c(s,[{key:"create",value:function(){if(arguments.length===1)arguments[0]instanceof Array||re(arguments[0],le);else if(arguments.length!==2){if(arguments.length===3){var e=arguments[0],t=arguments[1];return this.create(e,t)}}}}]),s}(),ei=function(){function s(){a(this,s)}return c(s,[{key:"filter",value:function(e){}}]),s}(),Am=function(){function s(){a(this,s)}return c(s,null,[{key:"ofLine",value:function(e){var t=e.size();if(t<=1)return 0;var n=0,i=new O;e.getCoordinate(0,i);for(var u=i.x,f=i.y,g=1;g<t;g++){e.getCoordinate(g,i);var y=i.x,d=i.y,w=y-u,b=d-f;n+=Math.sqrt(w*w+b*b),u=y,f=d}return n}}]),s}(),jl=function s(){a(this,s)},Yt=function(){function s(){a(this,s)}return c(s,null,[{key:"copyCoord",value:function(e,t,n,i){for(var u=Math.min(e.getDimension(),n.getDimension()),f=0;f<u;f++)n.setOrdinate(i,f,e.getOrdinate(t,f))}},{key:"isRing",value:function(e){var t=e.size();return t===0||!(t<=3)&&e.getOrdinate(0,le.X)===e.getOrdinate(t-1,le.X)&&e.getOrdinate(0,le.Y)===e.getOrdinate(t-1,le.Y)}},{key:"scroll",value:function(){if(arguments.length===2){if(re(arguments[0],le)&&Number.isInteger(arguments[1])){var e=arguments[0],t=arguments[1];s.scroll(e,t,s.isRing(e))}else if(re(arguments[0],le)&&arguments[1]instanceof O){var n=arguments[0],i=arguments[1],u=s.indexOf(i,n);if(u<=0)return null;s.scroll(n,u)}}else if(arguments.length===3){var f=arguments[0],g=arguments[1],y=arguments[2],d=g;if(d<=0)return null;for(var w=f.copy(),b=y?f.size()-1:f.size(),L=0;L<b;L++)for(var $=0;$<f.getDimension();$++)f.setOrdinate(L,$,w.getOrdinate((g+L)%b,$));if(y)for(var D=0;D<f.getDimension();D++)f.setOrdinate(b,D,f.getOrdinate(0,D))}}},{key:"isEqual",value:function(e,t){var n=e.size();if(n!==t.size())return!1;for(var i=Math.min(e.getDimension(),t.getDimension()),u=0;u<n;u++)for(var f=0;f<i;f++){var g=e.getOrdinate(u,f),y=t.getOrdinate(u,f);if(e.getOrdinate(u,f)!==t.getOrdinate(u,f)&&(!j.isNaN(g)||!j.isNaN(y)))return!1}return!0}},{key:"minCoordinateIndex",value:function(){if(arguments.length===1){var e=arguments[0];return s.minCoordinateIndex(e,0,e.size()-1)}if(arguments.length===3){for(var t=arguments[0],n=arguments[1],i=arguments[2],u=-1,f=null,g=n;g<=i;g++){var y=t.getCoordinate(g);(f===null||f.compareTo(y)>0)&&(f=y,u=g)}return u}}},{key:"extend",value:function(e,t,n){var i=e.create(n,t.getDimension()),u=t.size();if(s.copy(t,0,i,0,u),u>0)for(var f=u;f<n;f++)s.copy(t,u-1,i,f,1);return i}},{key:"reverse",value:function(e){for(var t=e.size()-1,n=Math.trunc(t/2),i=0;i<=n;i++)s.swap(e,i,t-i)}},{key:"swap",value:function(e,t,n){if(t===n)return null;for(var i=0;i<e.getDimension();i++){var u=e.getOrdinate(t,i);e.setOrdinate(t,i,e.getOrdinate(n,i)),e.setOrdinate(n,i,u)}}},{key:"copy",value:function(e,t,n,i,u){for(var f=0;f<u;f++)s.copyCoord(e,t+f,n,i+f)}},{key:"ensureValidRing",value:function(e,t){var n=t.size();return n===0?t:n<=3?s.createClosedRing(e,t,4):t.getOrdinate(0,le.X)===t.getOrdinate(n-1,le.X)&&t.getOrdinate(0,le.Y)===t.getOrdinate(n-1,le.Y)?t:s.createClosedRing(e,t,n+1)}},{key:"indexOf",value:function(e,t){for(var n=0;n<t.size();n++)if(e.x===t.getOrdinate(n,le.X)&&e.y===t.getOrdinate(n,le.Y))return n;return-1}},{key:"createClosedRing",value:function(e,t,n){var i=e.create(n,t.getDimension()),u=t.size();s.copy(t,0,i,0,u);for(var f=u;f<n;f++)s.copy(t,0,i,f,1);return i}},{key:"minCoordinate",value:function(e){for(var t=null,n=0;n<e.size();n++){var i=e.getCoordinate(n);(t===null||t.compareTo(i)>0)&&(t=i)}return t}}]),s}(),z=function(){function s(){a(this,s)}return c(s,null,[{key:"toDimensionSymbol",value:function(e){switch(e){case s.FALSE:return s.SYM_FALSE;case s.TRUE:return s.SYM_TRUE;case s.DONTCARE:return s.SYM_DONTCARE;case s.P:return s.SYM_P;case s.L:return s.SYM_L;case s.A:return s.SYM_A}throw new M("Unknown dimension value: "+e)}},{key:"toDimensionValue",value:function(e){switch($s.toUpperCase(e)){case s.SYM_FALSE:return s.FALSE;case s.SYM_TRUE:return s.TRUE;case s.SYM_DONTCARE:return s.DONTCARE;case s.SYM_P:return s.P;case s.SYM_L:return s.L;case s.SYM_A:return s.A}throw new M("Unknown dimension symbol: "+e)}}]),s}();z.P=0,z.L=1,z.A=2,z.FALSE=-1,z.TRUE=-2,z.DONTCARE=-3,z.SYM_FALSE="F",z.SYM_TRUE="T",z.SYM_DONTCARE="*",z.SYM_P="0",z.SYM_L="1",z.SYM_A="2";var ti=function(){function s(){a(this,s)}return c(s,[{key:"filter",value:function(e){}}]),s}(),ni=function(){function s(){a(this,s)}return c(s,[{key:"filter",value:function(e,t){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}]),s}(),Hn=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new pe:this._points.expandEnvelope(new pe)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new t(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof W){var n=arguments[0],i=arguments[1];if(!this.isEquivalentClass(n))return!1;var u=n;if(this._points.size()!==u._points.size())return!1;for(var f=0;f<this._points.size();f++)if(!this.equal(this._points.getCoordinate(f),u._points.getCoordinate(f),i))return!1;return!0}return N(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){for(var n=0;n<Math.trunc(this._points.size()/2);n++){var i=this._points.size()-1-n;if(!this._points.getCoordinate(n).equals(this._points.getCoordinate(i))){if(this._points.getCoordinate(n).compareTo(this._points.getCoordinate(i))>0){var u=this._points.copy();Yt.reverse(u),this._points=u}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?z.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var n=this._points.copy();return Yt.reverse(n),this.getFactory().createLineString(n)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return W.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return Am.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value:function(){if(arguments.length===1){for(var n=arguments[0],i=n,u=0,f=0;u<this._points.size()&&f<i._points.size();){var g=this._points.getCoordinate(u).compareTo(i._points.getCoordinate(f));if(g!==0)return g;u++,f++}return u<this._points.size()?1:f<i._points.size()?-1:0}if(arguments.length===2){var y=arguments[0],d=arguments[1],w=y;return d.compare(this._points,w._points)}}},{key:"apply",value:function(){if(re(arguments[0],ei))for(var n=arguments[0],i=0;i<this._points.size();i++)n.filter(this._points.getCoordinate(i));else if(re(arguments[0],ni)){var u=arguments[0];if(this._points.size()===0)return null;for(var f=0;f<this._points.size()&&(u.filter(this._points,f),!u.isDone());f++);u.isGeometryChanged()&&this.geometryChanged()}else if(re(arguments[0],ti)){var g=arguments[0];g.filter(this)}else if(re(arguments[0],B)){var y=arguments[0];y.filter(this)}}},{key:"getBoundary",value:function(){throw new At}},{key:"isEquivalentClass",value:function(n){return n instanceof t}},{key:"getCoordinateN",value:function(n){return this._points.getCoordinate(n)}},{key:"getGeometryType",value:function(){return W.TYPENAME_LINESTRING}},{key:"getCoordinateSequence",value:function(){return this._points}},{key:"isEmpty",value:function(){return this._points.size()===0}},{key:"init",value:function(n){if(n===null&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),n.size()===1)throw new M("Invalid number of points in LineString (found "+n.size()+" - must be 0 or >= 2)");this._points=n}},{key:"isCoordinate",value:function(n){for(var i=0;i<this._points.size();i++)if(this._points.getCoordinate(i).equals(n))return!0;return!1}},{key:"getStartPoint",value:function(){return this.isEmpty()?null:this.getPointN(0)}},{key:"getPointN",value:function(n){return this.getFactory().createPoint(this._points.getCoordinate(n))}},{key:"interfaces_",get:function(){return[jl]}}],[{key:"constructor_",value:function(){if(this._points=null,arguments.length!==0){if(arguments.length===2){var n=arguments[0],i=arguments[1];W.constructor_.call(this,i),this.init(n)}}}}]),t}(W),Vl=function s(){a(this,s)},qs=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"computeEnvelopeInternal",value:function(){if(this.isEmpty())return new pe;var n=new pe;return n.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),n}},{key:"getCoordinates",value:function(){return this.isEmpty()?[]:[this.getCoordinate()]}},{key:"copyInternal",value:function(){return new t(this._coordinates.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof W){var n=arguments[0],i=arguments[1];return!!this.isEquivalentClass(n)&&(!(!this.isEmpty()||!n.isEmpty())||this.isEmpty()===n.isEmpty()&&this.equal(n.getCoordinate(),this.getCoordinate(),i))}return N(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){}},{key:"getCoordinate",value:function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null}},{key:"getBoundaryDimension",value:function(){return z.FALSE}},{key:"reverseInternal",value:function(){return this.getFactory().createPoint(this._coordinates.copy())}},{key:"getTypeCode",value:function(){return W.TYPECODE_POINT}},{key:"getDimension",value:function(){return 0}},{key:"getNumPoints",value:function(){return this.isEmpty()?0:1}},{key:"getX",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var n=arguments[0],i=n;return this.getCoordinate().compareTo(i.getCoordinate())}if(arguments.length===2){var u=arguments[0],f=arguments[1],g=u;return f.compare(this._coordinates,g._coordinates)}}},{key:"apply",value:function(){if(re(arguments[0],ei)){var n=arguments[0];if(this.isEmpty())return null;n.filter(this.getCoordinate())}else if(re(arguments[0],ni)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this._coordinates,0),i.isGeometryChanged()&&this.geometryChanged()}else if(re(arguments[0],ti)){var u=arguments[0];u.filter(this)}else if(re(arguments[0],B)){var f=arguments[0];f.filter(this)}}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return W.TYPENAME_POINT}},{key:"getCoordinateSequence",value:function(){return this._coordinates}},{key:"getY",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}},{key:"isEmpty",value:function(){return this._coordinates.size()===0}},{key:"init",value:function(n){n===null&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),se.isTrue(n.size()<=1),this._coordinates=n}},{key:"isSimple",value:function(){return!0}},{key:"interfaces_",get:function(){return[Vl]}}],[{key:"constructor_",value:function(){this._coordinates=null;var n=arguments[0],i=arguments[1];W.constructor_.call(this,i),this.init(n)}}]),t}(W),Wl=function(){function s(){a(this,s)}return c(s,null,[{key:"ofRing",value:function(){if(arguments[0]instanceof Array){var e=arguments[0];return Math.abs(s.ofRingSigned(e))}if(re(arguments[0],le)){var t=arguments[0];return Math.abs(s.ofRingSigned(t))}}},{key:"ofRingSigned",value:function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,n=e[0].x,i=1;i<e.length-1;i++){var u=e[i].x-n,f=e[i+1].y,g=e[i-1].y;t+=u*(g-f)}return t/2}if(re(arguments[0],le)){var y=arguments[0],d=y.size();if(d<3)return 0;var w=new O,b=new O,L=new O;y.getCoordinate(0,b),y.getCoordinate(1,L);var $=b.x;L.x-=$;for(var D=0,V=1;V<d-1;V++)w.y=b.y,b.x=L.x,b.y=L.y,y.getCoordinate(V+1,L),L.x-=$,D+=b.x*(w.y-L.y);return D/2}}}]),s}(),Ut=function(){function s(){a(this,s)}return c(s,null,[{key:"sort",value:function(){var e=arguments,t=arguments[0];if(arguments.length===1)t.sort(function($,D){return $.compareTo(D)});else if(arguments.length===2)t.sort(function($,D){return e[1].compare($,D)});else if(arguments.length===3){var n=t.slice(arguments[1],arguments[2]);n.sort();var i=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));t.splice(0,t.length);var u,f=P(i);try{for(f.s();!(u=f.n()).done;){var g=u.value;t.push(g)}}catch($){f.e($)}finally{f.f()}}else if(arguments.length===4){var y=t.slice(arguments[1],arguments[2]);y.sort(function($,D){return e[3].compare($,D)});var d=t.slice(0,arguments[1]).concat(y,t.slice(arguments[2],t.length));t.splice(0,t.length);var w,b=P(d);try{for(b.s();!(w=b.n()).done;){var L=w.value;t.push(L)}}catch($){b.e($)}finally{b.f()}}}},{key:"asList",value:function(e){var t,n=new Z,i=P(e);try{for(i.s();!(t=i.n()).done;){var u=t.value;n.add(u)}}catch(f){i.e(f)}finally{i.f()}return n}},{key:"copyOf",value:function(e,t){return e.slice(0,t)}}]),s}(),Hl=function s(){a(this,s)},ri=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"computeEnvelopeInternal",value:function(){return this._shell.getEnvelopeInternal()}},{key:"getCoordinates",value:function(){if(this.isEmpty())return[];for(var n=new Array(this.getNumPoints()).fill(null),i=-1,u=this._shell.getCoordinates(),f=0;f<u.length;f++)n[++i]=u[f];for(var g=0;g<this._holes.length;g++)for(var y=this._holes[g].getCoordinates(),d=0;d<y.length;d++)n[++i]=y[d];return n}},{key:"getArea",value:function(){var n=0;n+=Wl.ofRing(this._shell.getCoordinateSequence());for(var i=0;i<this._holes.length;i++)n-=Wl.ofRing(this._holes[i].getCoordinateSequence());return n}},{key:"copyInternal",value:function(){for(var n=this._shell.copy(),i=new Array(this._holes.length).fill(null),u=0;u<this._holes.length;u++)i[u]=this._holes[u].copy();return new t(n,i,this._factory)}},{key:"isRectangle",value:function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var n=this._shell.getCoordinateSequence(),i=this.getEnvelopeInternal(),u=0;u<5;u++){var f=n.getX(u);if(f!==i.getMinX()&&f!==i.getMaxX())return!1;var g=n.getY(u);if(g!==i.getMinY()&&g!==i.getMaxY())return!1}for(var y=n.getX(0),d=n.getY(0),w=1;w<=4;w++){var b=n.getX(w),L=n.getY(w);if(b!==y==(L!==d))return!1;y=b,d=L}return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof W){var n=arguments[0],i=arguments[1];if(!this.isEquivalentClass(n))return!1;var u=n,f=this._shell,g=u._shell;if(!f.equalsExact(g,i)||this._holes.length!==u._holes.length)return!1;for(var y=0;y<this._holes.length;y++)if(!this._holes[y].equalsExact(u._holes[y],i))return!1;return!0}return N(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){if(arguments.length===0){this._shell=this.normalized(this._shell,!0);for(var n=0;n<this._holes.length;n++)this._holes[n]=this.normalized(this._holes[n],!1);Ut.sort(this._holes)}else if(arguments.length===2){var i=arguments[0],u=arguments[1];if(i.isEmpty())return null;var f=i.getCoordinateSequence(),g=Yt.minCoordinateIndex(f,0,f.size()-2);Yt.scroll(f,g,!0),Q.isCCW(f)===u&&Yt.reverse(f)}}},{key:"getCoordinate",value:function(){return this._shell.getCoordinate()}},{key:"getNumInteriorRing",value:function(){return this._holes.length}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"reverseInternal",value:function(){for(var n=this.getExteriorRing().reverse(),i=new Array(this.getNumInteriorRing()).fill(null),u=0;u<i.length;u++)i[u]=this.getInteriorRingN(u).reverse();return this.getFactory().createPolygon(n,i)}},{key:"getTypeCode",value:function(){return W.TYPECODE_POLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getLength",value:function(){var n=0;n+=this._shell.getLength();for(var i=0;i<this._holes.length;i++)n+=this._holes[i].getLength();return n}},{key:"getNumPoints",value:function(){for(var n=this._shell.getNumPoints(),i=0;i<this._holes.length;i++)n+=this._holes[i].getNumPoints();return n}},{key:"convexHull",value:function(){return this.getExteriorRing().convexHull()}},{key:"normalized",value:function(n,i){var u=n.copy();return this.normalize(u,i),u}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var n=arguments[0],i=this._shell,u=n._shell;return i.compareToSameClass(u)}if(arguments.length===2){var f=arguments[0],g=arguments[1],y=f,d=this._shell,w=y._shell,b=d.compareToSameClass(w,g);if(b!==0)return b;for(var L=this.getNumInteriorRing(),$=y.getNumInteriorRing(),D=0;D<L&&D<$;){var V=this.getInteriorRingN(D),H=y.getInteriorRingN(D),K=V.compareToSameClass(H,g);if(K!==0)return K;D++}return D<L?1:D<$?-1:0}}},{key:"apply",value:function(){if(re(arguments[0],ei)){var n=arguments[0];this._shell.apply(n);for(var i=0;i<this._holes.length;i++)this._holes[i].apply(n)}else if(re(arguments[0],ni)){var u=arguments[0];if(this._shell.apply(u),!u.isDone())for(var f=0;f<this._holes.length&&(this._holes[f].apply(u),!u.isDone());f++);u.isGeometryChanged()&&this.geometryChanged()}else if(re(arguments[0],ti)){var g=arguments[0];g.filter(this)}else if(re(arguments[0],B)){var y=arguments[0];y.filter(this),this._shell.apply(y);for(var d=0;d<this._holes.length;d++)this._holes[d].apply(y)}}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var n=new Array(this._holes.length+1).fill(null);n[0]=this._shell;for(var i=0;i<this._holes.length;i++)n[i+1]=this._holes[i];return n.length<=1?this.getFactory().createLinearRing(n[0].getCoordinateSequence()):this.getFactory().createMultiLineString(n)}},{key:"getGeometryType",value:function(){return W.TYPENAME_POLYGON}},{key:"getExteriorRing",value:function(){return this._shell}},{key:"isEmpty",value:function(){return this._shell.isEmpty()}},{key:"getInteriorRingN",value:function(n){return this._holes[n]}},{key:"interfaces_",get:function(){return[Hl]}}],[{key:"constructor_",value:function(){this._shell=null,this._holes=null;var n=arguments[0],i=arguments[1],u=arguments[2];if(W.constructor_.call(this,u),n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),W.hasNullElements(i))throw new M("holes must not contain null elements");if(n.isEmpty()&&W.hasNonEmptyElements(i))throw new M("shell is empty but holes are not");this._shell=n,this._holes=i}}]),t}(W),Mm=function(s){h(t,s);var e=E(t);function t(){return a(this,t),e.apply(this,arguments)}return t}(zl),Zl=function(s){h(t,s);var e=E(t);function t(n){var i;return a(this,t),(i=e.call(this)).array=[],n instanceof ct&&i.addAll(n),i}return c(t,[{key:"contains",value:function(n){var i,u=P(this.array);try{for(u.s();!(i=u.n()).done;)if(i.value.compareTo(n)===0)return!0}catch(f){u.e(f)}finally{u.f()}return!1}},{key:"add",value:function(n){if(this.contains(n))return!1;for(var i=0,u=this.array.length;i<u;i++)if(this.array[i].compareTo(n)===1)return!!this.array.splice(i,0,n);return this.array.push(n),!0}},{key:"addAll",value:function(n){var i,u=P(n);try{for(u.s();!(i=u.n()).done;){var f=i.value;this.add(f)}}catch(g){u.e(g)}finally{u.f()}return!0}},{key:"remove",value:function(){throw new At}},{key:"size",value:function(){return this.array.length}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"toArray",value:function(){return this.array.slice()}},{key:"iterator",value:function(){return new Dm(this.array)}}]),t}(Mm),Dm=function(){function s(e){a(this,s),this.array=e,this.position=0}return c(s,[{key:"next",value:function(){if(this.position===this.array.length)throw new Qr;return this.array[this.position++]}},{key:"hasNext",value:function(){return this.position<this.array.length}},{key:"remove",value:function(){throw new At}}]),s}(),$e=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"computeEnvelopeInternal",value:function(){for(var n=new pe,i=0;i<this._geometries.length;i++)n.expandToInclude(this._geometries[i].getEnvelopeInternal());return n}},{key:"getGeometryN",value:function(n){return this._geometries[n]}},{key:"getCoordinates",value:function(){for(var n=new Array(this.getNumPoints()).fill(null),i=-1,u=0;u<this._geometries.length;u++)for(var f=this._geometries[u].getCoordinates(),g=0;g<f.length;g++)n[++i]=f[g];return n}},{key:"getArea",value:function(){for(var n=0,i=0;i<this._geometries.length;i++)n+=this._geometries[i].getArea();return n}},{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),i=0;i<n.length;i++)n[i]=this._geometries[i].copy();return new t(n,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof W){var n=arguments[0],i=arguments[1];if(!this.isEquivalentClass(n))return!1;var u=n;if(this._geometries.length!==u._geometries.length)return!1;for(var f=0;f<this._geometries.length;f++)if(!this._geometries[f].equalsExact(u._geometries[f],i))return!1;return!0}return N(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){for(var n=0;n<this._geometries.length;n++)this._geometries[n].normalize();Ut.sort(this._geometries)}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()}},{key:"getBoundaryDimension",value:function(){for(var n=z.FALSE,i=0;i<this._geometries.length;i++)n=Math.max(n,this._geometries[i].getBoundaryDimension());return n}},{key:"reverseInternal",value:function(){for(var n=this._geometries.length,i=new Z(n),u=0;u<n;u++)i.add(this._geometries[u].reverse());return this.getFactory().buildGeometry(i)}},{key:"getTypeCode",value:function(){return W.TYPECODE_GEOMETRYCOLLECTION}},{key:"getDimension",value:function(){for(var n=z.FALSE,i=0;i<this._geometries.length;i++)n=Math.max(n,this._geometries[i].getDimension());return n}},{key:"getLength",value:function(){for(var n=0,i=0;i<this._geometries.length;i++)n+=this._geometries[i].getLength();return n}},{key:"getNumPoints",value:function(){for(var n=0,i=0;i<this._geometries.length;i++)n+=this._geometries[i].getNumPoints();return n}},{key:"getNumGeometries",value:function(){return this._geometries.length}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var n=arguments[0],i=new Zl(Ut.asList(this._geometries)),u=new Zl(Ut.asList(n._geometries));return this.compare(i,u)}if(arguments.length===2){for(var f=arguments[0],g=arguments[1],y=f,d=this.getNumGeometries(),w=y.getNumGeometries(),b=0;b<d&&b<w;){var L=this.getGeometryN(b),$=y.getGeometryN(b),D=L.compareToSameClass($,g);if(D!==0)return D;b++}return b<d?1:b<w?-1:0}}},{key:"apply",value:function(){if(re(arguments[0],ei))for(var n=arguments[0],i=0;i<this._geometries.length;i++)this._geometries[i].apply(n);else if(re(arguments[0],ni)){var u=arguments[0];if(this._geometries.length===0)return null;for(var f=0;f<this._geometries.length&&(this._geometries[f].apply(u),!u.isDone());f++);u.isGeometryChanged()&&this.geometryChanged()}else if(re(arguments[0],ti)){var g=arguments[0];g.filter(this);for(var y=0;y<this._geometries.length;y++)this._geometries[y].apply(g)}else if(re(arguments[0],B)){var d=arguments[0];d.filter(this);for(var w=0;w<this._geometries.length;w++)this._geometries[w].apply(d)}}},{key:"getBoundary",value:function(){return W.checkNotGeometryCollection(this),se.shouldNeverReachHere(),null}},{key:"getGeometryType",value:function(){return W.TYPENAME_GEOMETRYCOLLECTION}},{key:"isEmpty",value:function(){for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isEmpty())return!1;return!0}}],[{key:"constructor_",value:function(){if(this._geometries=null,arguments.length!==0){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(W.constructor_.call(this,i),n===null&&(n=[]),W.hasNullElements(n))throw new M("geometries must not contain null elements");this._geometries=n}}}}]),t}(W),zs=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),i=0;i<n.length;i++)n[i]=this._geometries[i].copy();return new t(n,this._factory)}},{key:"isValid",value:function(){return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof W){var n=arguments[0],i=arguments[1];return!!this.isEquivalentClass(n)&&N(v(t.prototype),"equalsExact",this).call(this,n,i)}return N(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getCoordinate",value:function(){if(arguments.length===1&&Number.isInteger(arguments[0])){var n=arguments[0];return this._geometries[n].getCoordinate()}return N(v(t.prototype),"getCoordinate",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return z.FALSE}},{key:"getTypeCode",value:function(){return W.TYPECODE_MULTIPOINT}},{key:"getDimension",value:function(){return 0}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return W.TYPENAME_MULTIPOINT}},{key:"interfaces_",get:function(){return[Vl]}}],[{key:"constructor_",value:function(){var n=arguments[0],i=arguments[1];$e.constructor_.call(this,n,i)}}]),t}($e),Zn=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"copyInternal",value:function(){return new t(this._points.copy(),this._factory)}},{key:"getBoundaryDimension",value:function(){return z.FALSE}},{key:"isClosed",value:function(){return!!this.isEmpty()||N(v(t.prototype),"isClosed",this).call(this)}},{key:"reverseInternal",value:function(){var n=this._points.copy();return Yt.reverse(n),this.getFactory().createLinearRing(n)}},{key:"getTypeCode",value:function(){return W.TYPECODE_LINEARRING}},{key:"validateConstruction",value:function(){if(!this.isEmpty()&&!N(v(t.prototype),"isClosed",this).call(this))throw new M("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new M("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")}},{key:"getGeometryType",value:function(){return W.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var n=arguments[0],i=arguments[1];Hn.constructor_.call(this,n,i),this.validateConstruction()}}]),t}(Hn);Zn.MINIMUM_VALID_SIZE=4;var Xt=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"setOrdinate",value:function(n,i){switch(n){case t.X:this.x=i;break;case t.Y:this.y=i;break;default:throw new M("Invalid ordinate index: "+n)}}},{key:"getZ",value:function(){return O.NULL_ORDINATE}},{key:"getOrdinate",value:function(n){switch(n){case t.X:return this.x;case t.Y:return this.y}throw new M("Invalid ordinate index: "+n)}},{key:"setZ",value:function(n){throw new M("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(n){this.x=n.x,this.y=n.y,this.z=n.getZ()}}],[{key:"constructor_",value:function(){if(arguments.length===0)O.constructor_.call(this);else if(arguments.length===1){if(arguments[0]instanceof t){var n=arguments[0];O.constructor_.call(this,n.x,n.y)}else if(arguments[0]instanceof O){var i=arguments[0];O.constructor_.call(this,i.x,i.y)}}else if(arguments.length===2){var u=arguments[0],f=arguments[1];O.constructor_.call(this,u,f,O.NULL_ORDINATE)}}}]),t}(O);Xt.X=0,Xt.Y=1,Xt.Z=-1,Xt.M=-1;var jt=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(n,i){switch(n){case t.X:this.x=i;break;case t.Y:this.y=i;break;case t.M:this._m=i;break;default:throw new M("Invalid ordinate index: "+n)}}},{key:"setM",value:function(n){this._m=n}},{key:"getZ",value:function(){return O.NULL_ORDINATE}},{key:"getOrdinate",value:function(n){switch(n){case t.X:return this.x;case t.Y:return this.y;case t.M:return this._m}throw new M("Invalid ordinate index: "+n)}},{key:"setZ",value:function(n){throw new M("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(n){this.x=n.x,this.y=n.y,this.z=n.getZ(),this._m=n.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)O.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof t){var n=arguments[0];O.constructor_.call(this,n.x,n.y),this._m=n._m}else if(arguments[0]instanceof O){var i=arguments[0];O.constructor_.call(this,i.x,i.y),this._m=this.getM()}}else if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2];O.constructor_.call(this,u,f,O.NULL_ORDINATE),this._m=g}}}]),t}(O);jt.X=0,jt.Y=1,jt.Z=-1,jt.M=2;var Ys=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(n,i){switch(n){case O.X:this.x=i;break;case O.Y:this.y=i;break;case O.Z:this.z=i;break;case O.M:this._m=i;break;default:throw new M("Invalid ordinate index: "+n)}}},{key:"setM",value:function(n){this._m=n}},{key:"getOrdinate",value:function(n){switch(n){case O.X:return this.x;case O.Y:return this.y;case O.Z:return this.getZ();case O.M:return this.getM()}throw new M("Invalid ordinate index: "+n)}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(n){this.x=n.x,this.y=n.y,this.z=n.getZ(),this._m=n.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)O.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof t){var n=arguments[0];O.constructor_.call(this,n),this._m=n._m}else if(arguments[0]instanceof O){var i=arguments[0];O.constructor_.call(this,i),this._m=this.getM()}}else if(arguments.length===4){var u=arguments[0],f=arguments[1],g=arguments[2],y=arguments[3];O.constructor_.call(this,u,f,g),this._m=y}}}]),t}(O),ii=function(){function s(){a(this,s)}return c(s,null,[{key:"measures",value:function(e){return e instanceof Xt?0:e instanceof jt||e instanceof Ys?1:0}},{key:"dimension",value:function(e){return e instanceof Xt?2:e instanceof jt?3:e instanceof Ys?4:3}},{key:"create",value:function(){if(arguments.length===1){var e=arguments[0];return s.create(e,0)}if(arguments.length===2){var t=arguments[0],n=arguments[1];return t===2?new Xt:t===3&&n===0?new O:t===3&&n===1?new jt:t===4&&n===1?new Ys:new O}}}]),s}(),Jn=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"getCoordinate",value:function(n){return this.get(n)}},{key:"addAll",value:function(){if(arguments.length===2&&typeof arguments[1]=="boolean"&&re(arguments[0],ct)){for(var n=arguments[0],i=arguments[1],u=!1,f=n.iterator();f.hasNext();)this.add(f.next(),i),u=!0;return u}return N(v(t.prototype),"addAll",this).apply(this,arguments)}},{key:"clone",value:function(){for(var n=N(v(t.prototype),"clone",this).call(this),i=0;i<this.size();i++)n.add(i,this.get(i).clone());return n}},{key:"toCoordinateArray",value:function(){if(arguments.length===0)return this.toArray(t.coordArrayType);if(arguments.length===1){var n=arguments[0];if(n)return this.toArray(t.coordArrayType);for(var i=this.size(),u=new Array(i).fill(null),f=0;f<i;f++)u[f]=this.get(i-f-1);return u}}},{key:"add",value:function(){if(arguments.length===1){var n=arguments[0];return N(v(t.prototype),"add",this).call(this,n)}if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var i=arguments[0],u=arguments[1];return this.add(i,u,!0),!0}if(arguments[0]instanceof O&&typeof arguments[1]=="boolean"){var f=arguments[0],g=arguments[1];if(!g&&this.size()>=1){var y=this.get(this.size()-1);if(y.equals2D(f))return null}N(v(t.prototype),"add",this).call(this,f)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var d=arguments[0],w=arguments[1];return this.add(d,w),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var b=arguments[0],L=arguments[1],$=arguments[2];if($)for(var D=0;D<b.length;D++)this.add(b[D],L);else for(var V=b.length-1;V>=0;V--)this.add(b[V],L);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof O){var H=arguments[0],K=arguments[1],ge=arguments[2];if(!ge){var xe=this.size();if(xe>0){if(H>0){var Le=this.get(H-1);if(Le.equals2D(K))return null}if(H<xe){var qe=this.get(H);if(qe.equals2D(K))return null}}}N(v(t.prototype),"add",this).call(this,H,K)}}else if(arguments.length===4){var nt=arguments[0],kt=arguments[1],Ht=arguments[2],nr=arguments[3],rr=1;Ht>nr&&(rr=-1);for(var bn=Ht;bn!==nr;bn+=rr)this.add(nt[bn],kt);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var n=this.get(0).copy();this.add(n,!1)}}}],[{key:"constructor_",value:function(){if(arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],u=arguments[1];this.ensureCapacity(i.length),this.add(i,u)}}}}]),t}(Z);Jn.coordArrayType=new Array(0).fill(null);var Ee=function(){function s(){a(this,s)}return c(s,null,[{key:"isRing",value:function(e){return!(e.length<4)&&!!e[0].equals2D(e[e.length-1])}},{key:"ptNotInList",value:function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(s.indexOf(i,t)<0)return i}return null}},{key:"scroll",value:function(e,t){var n=s.indexOf(t,e);if(n<0)return null;var i=new Array(e.length).fill(null);je.arraycopy(e,n,i,0,e.length-n),je.arraycopy(e,0,i,e.length-n,n),je.arraycopy(i,0,e,0,e.length)}},{key:"equals",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(e===null||t===null||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].equals(t[n]))return!1;return!0}if(arguments.length===3){var i=arguments[0],u=arguments[1],f=arguments[2];if(i===u)return!0;if(i===null||u===null||i.length!==u.length)return!1;for(var g=0;g<i.length;g++)if(f.compare(i[g],u[g])!==0)return!1;return!0}}},{key:"intersection",value:function(e,t){for(var n=new Jn,i=0;i<e.length;i++)t.intersects(e[i])&&n.add(e[i],!0);return n.toCoordinateArray()}},{key:"measures",value:function(e){if(e===null||e.length===0)return 0;var t,n=0,i=P(e);try{for(i.s();!(t=i.n()).done;){var u=t.value;n=Math.max(n,ii.measures(u))}}catch(f){i.e(f)}finally{i.f()}return n}},{key:"hasRepeatedPoints",value:function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1}},{key:"removeRepeatedPoints",value:function(e){return s.hasRepeatedPoints(e)?new Jn(e,!1).toCoordinateArray():e}},{key:"reverse",value:function(e){for(var t=e.length-1,n=Math.trunc(t/2),i=0;i<=n;i++){var u=e[i];e[i]=e[t-i],e[t-i]=u}}},{key:"removeNull",value:function(e){for(var t=0,n=0;n<e.length;n++)e[n]!==null&&t++;var i=new Array(t).fill(null);if(t===0)return i;for(var u=0,f=0;f<e.length;f++)e[f]!==null&&(i[u++]=e[f]);return i}},{key:"copyDeep",value:function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),n=0;n<e.length;n++)t[n]=e[n].copy();return t}if(arguments.length===5)for(var i=arguments[0],u=arguments[1],f=arguments[2],g=arguments[3],y=arguments[4],d=0;d<y;d++)f[g+d]=i[u+d].copy()}},{key:"isEqualReversed",value:function(e,t){for(var n=0;n<e.length;n++){var i=e[n],u=t[e.length-n-1];if(i.compareTo(u)!==0)return!1}return!0}},{key:"envelope",value:function(e){for(var t=new pe,n=0;n<e.length;n++)t.expandToInclude(e[n]);return t}},{key:"toCoordinateArray",value:function(e){return e.toArray(s.coordArrayType)}},{key:"dimension",value:function(e){if(e===null||e.length===0)return 3;var t,n=0,i=P(e);try{for(i.s();!(t=i.n()).done;){var u=t.value;n=Math.max(n,ii.dimension(u))}}catch(f){i.e(f)}finally{i.f()}return n}},{key:"atLeastNCoordinatesOrNothing",value:function(e,t){return t.length>=e?t:[]}},{key:"indexOf",value:function(e,t){for(var n=0;n<t.length;n++)if(e.equals(t[n]))return n;return-1}},{key:"increasingDirection",value:function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var n=e.length-1-t,i=e[t].compareTo(e[n]);if(i!==0)return i}return 1}},{key:"compare",value:function(e,t){for(var n=0;n<e.length&&n<t.length;){var i=e[n].compareTo(t[n]);if(i!==0)return i;n++}return n<t.length?-1:n<e.length?1:0}},{key:"minCoordinate",value:function(e){for(var t=null,n=0;n<e.length;n++)(t===null||t.compareTo(e[n])>0)&&(t=e[n]);return t}},{key:"extract",value:function(e,t,n){t=Wn.clamp(t,0,e.length);var i=(n=Wn.clamp(n,-1,e.length))-t+1;n<0&&(i=0),t>=e.length&&(i=0),n<t&&(i=0);var u=new Array(i).fill(null);if(i===0)return u;for(var f=0,g=t;g<=n;g++)u[f++]=e[g];return u}}]),s}(),Fm=function(){function s(){a(this,s)}return c(s,[{key:"compare",value:function(e,t){var n=e,i=t;return Ee.compare(n,i)}},{key:"interfaces_",get:function(){return[Ce]}}]),s}(),$m=function(){function s(){a(this,s)}return c(s,[{key:"compare",value:function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var u=Ee.compare(n,i);return Ee.isEqualReversed(n,i)?0:u}},{key:"OLDcompare",value:function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var u=Ee.increasingDirection(n),f=Ee.increasingDirection(i),g=u>0?0:n.length-1,y=f>0?0:n.length-1,d=0;d<n.length;d++){var w=n[g].compareTo(i[y]);if(w!==0)return w;g+=u,y+=f}return 0}},{key:"interfaces_",get:function(){return[Ce]}}]),s}();Ee.ForwardComparator=Fm,Ee.BidirectionalComparator=$m,Ee.coordArrayType=new Array(0).fill(null);var si=function(){function s(e){a(this,s),this.str=e}return c(s,[{key:"append",value:function(e){this.str+=e}},{key:"setCharAt",value:function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)}},{key:"toString",value:function(){return this.str}}]),s}(),Qn=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getM",value:function(e){return this.hasM()?this._coordinates[e].getM():j.NaN}},{key:"setOrdinate",value:function(e,t,n){switch(t){case le.X:this._coordinates[e].x=n;break;case le.Y:this._coordinates[e].y=n;break;default:this._coordinates[e].setOrdinate(t,n)}}},{key:"getZ",value:function(e){return this.hasZ()?this._coordinates[e].getZ():j.NaN}},{key:"size",value:function(){return this._coordinates.length}},{key:"getOrdinate",value:function(e,t){switch(t){case le.X:return this._coordinates[e].x;case le.Y:return this._coordinates[e].y;default:return this._coordinates[e].getOrdinate(t)}}},{key:"getCoordinate",value:function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}if(arguments.length===2){var t=arguments[0],n=arguments[1];n.setCoordinate(this._coordinates[t])}}},{key:"getCoordinateCopy",value:function(e){var t=this.createCoordinate();return t.setCoordinate(this._coordinates[e]),t}},{key:"createCoordinate",value:function(){return ii.create(this.getDimension(),this.getMeasures())}},{key:"getDimension",value:function(){return this._dimension}},{key:"getX",value:function(e){return this._coordinates[e].x}},{key:"getMeasures",value:function(){return this._measures}},{key:"expandEnvelope",value:function(e){for(var t=0;t<this._coordinates.length;t++)e.expandToInclude(this._coordinates[t]);return e}},{key:"copy",value:function(){for(var e=new Array(this.size()).fill(null),t=0;t<this._coordinates.length;t++){var n=this.createCoordinate();n.setCoordinate(this._coordinates[t]),e[t]=n}return new s(e,this._dimension,this._measures)}},{key:"toString",value:function(){if(this._coordinates.length>0){var e=new si(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var t=1;t<this._coordinates.length;t++)e.append(", "),e.append(this._coordinates[t]);return e.append(")"),e.toString()}return"()"}},{key:"getY",value:function(e){return this._coordinates[e].y}},{key:"toCoordinateArray",value:function(){return this._coordinates}},{key:"interfaces_",get:function(){return[le,X]}}],[{key:"constructor_",value:function(){if(this._dimension=3,this._measures=0,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];s.constructor_.call(this,e,Ee.dimension(e),Ee.measures(e))}else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n<t;n++)this._coordinates[n]=new O}else if(re(arguments[0],le)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._measures=i.getMeasures(),this._coordinates=new Array(i.size()).fill(null);for(var u=0;u<this._coordinates.length;u++)this._coordinates[u]=i.getCoordinateCopy(u)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var f=arguments[0],g=arguments[1];s.constructor_.call(this,f,g,Ee.measures(f))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var y=arguments[0],d=arguments[1];this._coordinates=new Array(y).fill(null),this._dimension=d;for(var w=0;w<y;w++)this._coordinates[w]=ii.create(d)}}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var b=arguments[0],L=arguments[1],$=arguments[2];this._dimension=L,this._measures=$,this._coordinates=b===null?new Array(0).fill(null):b}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var D=arguments[0],V=arguments[1],H=arguments[2];this._coordinates=new Array(D).fill(null),this._dimension=V,this._measures=H;for(var K=0;K<D;K++)this._coordinates[K]=this.createCoordinate()}}}}]),s}(),Us=function(){function s(){a(this,s)}return c(s,[{key:"readResolve",value:function(){return s.instance()}},{key:"create",value:function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Qn(e)}if(re(arguments[0],le)){var t=arguments[0];return new Qn(t)}}else{if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2&&(i=2),new Qn(n,i)}if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2],y=f-g;return g>1&&(g=1),y>3&&(y=3),y<2&&(y=2),new Qn(u,y+g,g)}}}},{key:"interfaces_",get:function(){return[Xl,X]}}],[{key:"instance",value:function(){return s.instanceObject}}]),s}();Us.instanceObject=new Us;var Xs=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),i=0;i<n.length;i++)n[i]=this._geometries[i].copy();return new t(n,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof W){var n=arguments[0],i=arguments[1];return!!this.isEquivalentClass(n)&&N(v(t.prototype),"equalsExact",this).call(this,n,i)}return N(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"getTypeCode",value:function(){return W.TYPECODE_MULTIPOLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var n=new Z,i=0;i<this._geometries.length;i++)for(var u=this._geometries[i].getBoundary(),f=0;f<u.getNumGeometries();f++)n.add(u.getGeometryN(f));var g=new Array(n.size()).fill(null);return this.getFactory().createMultiLineString(n.toArray(g))}},{key:"getGeometryType",value:function(){return W.TYPENAME_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[Hl]}}],[{key:"constructor_",value:function(){var n=arguments[0],i=arguments[1];$e.constructor_.call(this,n,i)}}]),t}($e),Jl=function(){function s(){a(this,s)}return c(s,[{key:"get",value:function(){}},{key:"put",value:function(){}},{key:"size",value:function(){}},{key:"values",value:function(){}},{key:"entrySet",value:function(){}}]),s}(),Gm=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),(n=e.call(this)).map=new Map,n}return c(t,[{key:"get",value:function(n){return this.map.get(n)||null}},{key:"put",value:function(n,i){return this.map.set(n,i),i}},{key:"values",value:function(){for(var n=new Z,i=this.map.values(),u=i.next();!u.done;)n.add(u.value),u=i.next();return n}},{key:"entrySet",value:function(){var n=new Fs;return this.map.entries().forEach(function(i){return n.add(i)}),n}},{key:"size",value:function(){return this.map.size()}}]),t}(Jl),et=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"equals",value:function(e){if(!(e instanceof s))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale}},{key:"compareTo",value:function(e){var t=e,n=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return Kr.compare(n,i)}},{key:"getScale",value:function(){return this._scale}},{key:"isFloating",value:function(){return this._modelType===s.FLOATING||this._modelType===s.FLOATING_SINGLE}},{key:"getType",value:function(){return this._modelType}},{key:"toString",value:function(){var e="UNKNOWN";return this._modelType===s.FLOATING?e="Floating":this._modelType===s.FLOATING_SINGLE?e="Floating-Single":this._modelType===s.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e}},{key:"makePrecise",value:function(){if(typeof arguments[0]=="number"){var e=arguments[0];return j.isNaN(e)||this._modelType===s.FLOATING_SINGLE?e:this._modelType===s.FIXED?Math.round(e*this._scale)/this._scale:e}if(arguments[0]instanceof O){var t=arguments[0];if(this._modelType===s.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}}},{key:"getMaximumSignificantDigits",value:function(){var e=16;return this._modelType===s.FLOATING?e=16:this._modelType===s.FLOATING_SINGLE?e=6:this._modelType===s.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e}},{key:"setScale",value:function(e){this._scale=Math.abs(e)}},{key:"interfaces_",get:function(){return[X,Y]}}],[{key:"constructor_",value:function(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=s.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof xn){var e=arguments[0];this._modelType=e,e===s.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=s.FIXED,this.setScale(t)}else if(arguments[0]instanceof s){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}}},{key:"mostPrecise",value:function(e,t){return e.compareTo(t)>=0?e:t}}]),s}(),xn=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"readResolve",value:function(){return s.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[X]}}],[{key:"constructor_",value:function(){this._name=null;var e=arguments[0];this._name=e,s.nameToTypeMap.put(e,this)}}]),s}();xn.nameToTypeMap=new Gm,et.Type=xn,et.FIXED=new xn("FIXED"),et.FLOATING=new xn("FLOATING"),et.FLOATING_SINGLE=new xn("FLOATING SINGLE"),et.maximumPreciseValue=9007199254740992;var js=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),i=0;i<n.length;i++)n[i]=this._geometries[i].copy();return new t(n,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof W){var n=arguments[0],i=arguments[1];return!!this.isEquivalentClass(n)&&N(v(t.prototype),"equalsExact",this).call(this,n,i)}return N(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?z.FALSE:0}},{key:"isClosed",value:function(){if(this.isEmpty())return!1;for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isClosed())return!1;return!0}},{key:"getTypeCode",value:function(){return W.TYPECODE_MULTILINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getBoundary",value:function(){throw new At}},{key:"getGeometryType",value:function(){return W.TYPENAME_MULTILINESTRING}},{key:"interfaces_",get:function(){return[jl]}}],[{key:"constructor_",value:function(){var n=arguments[0],i=arguments[1];$e.constructor_.call(this,n,i)}}]),t}($e),En=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"createEmpty",value:function(e){switch(e){case-1:return this.createGeometryCollection();case 0:return this.createPoint();case 1:return this.createLineString();case 2:return this.createPolygon();default:throw new M("Invalid dimension: "+e)}}},{key:"toGeometry",value:function(e){return e.isNull()?this.createPoint():e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new O(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new O(e.getMinX(),e.getMinY()),new O(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new O(e.getMinX(),e.getMinY()),new O(e.getMinX(),e.getMaxY()),new O(e.getMaxX(),e.getMaxY()),new O(e.getMaxX(),e.getMinY()),new O(e.getMinX(),e.getMinY())]),null)}},{key:"createLineString",value:function(){if(arguments.length===0)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLineString(e!==null?this.getCoordinateSequenceFactory().create(e):null)}if(re(arguments[0],le)){var t=arguments[0];return new Hn(t,this)}}}},{key:"createMultiLineString",value:function(){if(arguments.length===0)return new js(null,this);if(arguments.length===1){var e=arguments[0];return new js(e,this)}}},{key:"buildGeometry",value:function(e){for(var t=null,n=!1,i=!1,u=e.iterator();u.hasNext();){var f=u.next(),g=f.getTypeCode();t===null&&(t=g),g!==t&&(n=!0),f instanceof $e&&(i=!0)}if(t===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(s.toGeometryArray(e));var y=e.iterator().next();if(e.size()>1){if(y instanceof ri)return this.createMultiPolygon(s.toPolygonArray(e));if(y instanceof Hn)return this.createMultiLineString(s.toLineStringArray(e));if(y instanceof qs)return this.createMultiPoint(s.toPointArray(e));se.shouldNeverReachHere("Unhandled geometry type: "+y.getGeometryType())}return y}},{key:"createMultiPointFromCoords",value:function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)}},{key:"createPoint",value:function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof O){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}if(re(arguments[0],le)){var t=arguments[0];return new qs(t,this)}}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(arguments.length===0)return this.createPolygon(null,null);if(arguments.length===1){if(re(arguments[0],le)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Zn){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],u=arguments[1];return new ri(i,u,this)}}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){if(arguments.length===0)return new $e(null,this);if(arguments.length===1){var e=arguments[0];return new $e(e,this)}}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value:function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}if(re(arguments[0],le)){var t=arguments[0];return new Zn(t,this)}}}},{key:"createMultiPolygon",value:function(){if(arguments.length===0)return new Xs(null,this);if(arguments.length===1){var e=arguments[0];return new Xs(e,this)}}},{key:"createMultiPoint",value:function(){if(arguments.length===0)return new zs(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new zs(e,this)}if(re(arguments[0],le)){var t=arguments[0];if(t===null)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(t.size()).fill(null),i=0;i<t.size();i++){var u=this.getCoordinateSequenceFactory().create(1,t.getDimension(),t.getMeasures());Yt.copy(t,i,u,0,1),n[i]=this.createPoint(u)}return this.createMultiPoint(n)}}}},{key:"interfaces_",get:function(){return[X]}}],[{key:"constructor_",value:function(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,arguments.length===0)s.constructor_.call(this,new et,0);else if(arguments.length===1){if(re(arguments[0],Xl)){var e=arguments[0];s.constructor_.call(this,new et,0,e)}else if(arguments[0]instanceof et){var t=arguments[0];s.constructor_.call(this,t,0,s.getDefaultCoordinateSequenceFactory())}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];s.constructor_.call(this,n,i,s.getDefaultCoordinateSequenceFactory())}else if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2];this._precisionModel=u,this._coordinateSequenceFactory=g,this._SRID=f}}},{key:"toMultiPolygonArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toGeometryArray",value:function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"getDefaultCoordinateSequenceFactory",value:function(){return Us.instance()}},{key:"toMultiLineStringArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toLineStringArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toMultiPointArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toLinearRingArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toPointArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toPolygonArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"createPointFromInternalCoord",value:function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)}}]),s}(),Vs="XY",Bm="XYZ",qm="XYM",zm="XYZM",Ql={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},Kl="EMPTY",ai=1,xt=2,Mt=3,ec=4,kn=5,Ym=6;for(var Um in Ql)Ql[Um].toUpperCase();var Xm=function(){function s(e){a(this,s),this.wkt=e,this.index_=-1}return c(s,[{key:"isAlpha_",value:function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}},{key:"isNumeric_",value:function(e,t){return e>="0"&&e<="9"||e=="."&&!(t!==void 0&&t)}},{key:"isWhiteSpace_",value:function(e){return e==" "||e==" "||e=="\r"||e==`
|
|
29
|
-
`}},{key:"nextChar_",value:function(){return this.wkt.charAt(++this.index_)}},{key:"nextToken",value:function(){var e,t=this.nextChar_(),n=this.index_,i=t;if(t=="(")e=xt;else if(t==",")e=kn;else if(t==")")e=Mt;else if(this.isNumeric_(t)||t=="-")e=ec,i=this.readNumber_();else if(this.isAlpha_(t))e=ai,i=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t!=="")throw new Error("Unexpected character: "+t);e=Ym}return{position:n,value:i,type:e}}},{key:"readNumber_",value:function(){var e,t=this.index_,n=!1,i=!1;do e=="."?n=!0:e!="e"&&e!="E"||(i=!0),e=this.nextChar_();while(this.isNumeric_(e,n)||!i&&(e=="e"||e=="E")||i&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(t,this.index_--))}},{key:"readText_",value:function(){var e,t=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(t,this.index_--).toUpperCase()}}]),s}(),jm=function(){function s(e,t){a(this,s),this.lexer_=e,this.token_,this.layout_=Vs,this.factory=t}return c(s,[{key:"consume_",value:function(){this.token_=this.lexer_.nextToken()}},{key:"isTokenType",value:function(e){return this.token_.type==e}},{key:"match",value:function(e){var t=this.isTokenType(e);return t&&this.consume_(),t}},{key:"parse",value:function(){return this.consume_(),this.parseGeometry_()}},{key:"parseGeometryLayout_",value:function(){var e=Vs,t=this.token_;if(this.isTokenType(ai)){var n=t.value;n==="Z"?e=Bm:n==="M"?e=qm:n==="ZM"&&(e=zm),e!==Vs&&this.consume_()}return e}},{key:"parseGeometryCollectionText_",value:function(){if(this.match(xt)){var e=[];do e.push(this.parseGeometry_());while(this.match(kn));if(this.match(Mt))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePointText_",value:function(){if(this.match(xt)){var e=this.parsePoint_();if(this.match(Mt))return e}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}},{key:"parseLineStringText_",value:function(){if(this.match(xt)){var e=this.parsePointList_();if(this.match(Mt))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePolygonText_",value:function(){if(this.match(xt)){var e=this.parseLineStringTextList_();if(this.match(Mt))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPointText_",value:function(){var e;if(this.match(xt)){if(e=this.token_.type==xt?this.parsePointTextList_():this.parsePointList_(),this.match(Mt))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiLineStringText_",value:function(){if(this.match(xt)){var e=this.parseLineStringTextList_();if(this.match(Mt))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPolygonText_",value:function(){if(this.match(xt)){var e=this.parsePolygonTextList_();if(this.match(Mt))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePoint_",value:function(){for(var e=[],t=this.layout_.length,n=0;n<t;++n){var i=this.token_;if(!this.match(ec))break;e.push(i.value)}if(e.length==t)return e;throw new Error(this.formatErrorMessage_())}},{key:"parsePointList_",value:function(){for(var e=[this.parsePoint_()];this.match(kn);)e.push(this.parsePoint_());return e}},{key:"parsePointTextList_",value:function(){for(var e=[this.parsePointText_()];this.match(kn);)e.push(this.parsePointText_());return e}},{key:"parseLineStringTextList_",value:function(){for(var e=[this.parseLineStringText_()];this.match(kn);)e.push(this.parseLineStringText_());return e}},{key:"parsePolygonTextList_",value:function(){for(var e=[this.parsePolygonText_()];this.match(kn);)e.push(this.parsePolygonText_());return e}},{key:"isEmptyGeometry_",value:function(){var e=this.isTokenType(ai)&&this.token_.value==Kl;return e&&this.consume_(),e}},{key:"formatErrorMessage_",value:function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}},{key:"parseGeometry_",value:function(){var e=this.factory,t=function(H){return x(O,T(H))},n=function(H){var K=H.map(function(ge){return e.createLinearRing(ge.map(t))});return K.length>1?e.createPolygon(K[0],K.slice(1)):e.createPolygon(K[0])},i=this.token_;if(this.match(ai)){var u=i.value;if(this.layout_=this.parseGeometryLayout_(),u=="GEOMETRYCOLLECTION"){var f=this.parseGeometryCollectionText_();return e.createGeometryCollection(f)}switch(u){case"POINT":var g=this.parsePointText_();return g?e.createPoint(x(O,T(g))):e.createPoint();case"LINESTRING":var y=this.parseLineStringText_().map(t);return e.createLineString(y);case"LINEARRING":var d=this.parseLineStringText_().map(t);return e.createLinearRing(d);case"POLYGON":var w=this.parsePolygonText_();return w&&w.length!==0?n(w):e.createPolygon();case"MULTIPOINT":var b=this.parseMultiPointText_();if(!b||b.length===0)return e.createMultiPoint();var L=b.map(t).map(function(H){return e.createPoint(H)});return e.createMultiPoint(L);case"MULTILINESTRING":var $=this.parseMultiLineStringText_().map(function(H){return e.createLineString(H.map(t))});return e.createMultiLineString($);case"MULTIPOLYGON":var D=this.parseMultiPolygonText_();if(!D||D.length===0)return e.createMultiPolygon();var V=D.map(n);return e.createMultiPolygon(V);default:throw new Error("Invalid geometry type: "+u)}}throw new Error(this.formatErrorMessage_())}}]),s}();function tc(s){if(s.isEmpty())return"";var e=s.getCoordinate(),t=[e.x,e.y];return e.z===void 0||Number.isNaN(e.z)||t.push(e.z),e.m===void 0||Number.isNaN(e.m)||t.push(e.m),t.join(" ")}function Kn(s){for(var e=s.getCoordinates().map(function(u){var f=[u.x,u.y];return u.z===void 0||Number.isNaN(u.z)||f.push(u.z),u.m===void 0||Number.isNaN(u.m)||f.push(u.m),f}),t=[],n=0,i=e.length;n<i;++n)t.push(e[n].join(" "));return t.join(", ")}function nc(s){var e=[];e.push("("+Kn(s.getExteriorRing())+")");for(var t=0,n=s.getNumInteriorRing();t<n;++t)e.push("("+Kn(s.getInteriorRingN(t))+")");return e.join(", ")}var Vm={Point:tc,LineString:Kn,LinearRing:Kn,Polygon:nc,MultiPoint:function(s){for(var e=[],t=0,n=s.getNumGeometries();t<n;++t)e.push("("+tc(s.getGeometryN(t))+")");return e.join(", ")},MultiLineString:function(s){for(var e=[],t=0,n=s.getNumGeometries();t<n;++t)e.push("("+Kn(s.getGeometryN(t))+")");return e.join(", ")},MultiPolygon:function(s){for(var e=[],t=0,n=s.getNumGeometries();t<n;++t)e.push("("+nc(s.getGeometryN(t))+")");return e.join(", ")},GeometryCollection:function(s){for(var e=[],t=0,n=s.getNumGeometries();t<n;++t)e.push(rc(s.getGeometryN(t)));return e.join(", ")}};function rc(s){var e=s.getGeometryType(),t=Vm[e];e=e.toUpperCase();var n=function(i){var u="";if(i.isEmpty())return u;var f=i.getCoordinate();return f.z===void 0||Number.isNaN(f.z)||(u+="Z"),f.m===void 0||Number.isNaN(f.m)||(u+="M"),u}(s);return n.length>0&&(e+=" "+n),s.isEmpty()?e+" "+Kl:e+" ("+t(s)+")"}var Wm=function(){function s(e){a(this,s),this.geometryFactory=e||new En,this.precisionModel=this.geometryFactory.getPrecisionModel()}return c(s,[{key:"read",value:function(e){var t=new Xm(e);return new jm(t,this.geometryFactory).parse()}},{key:"write",value:function(e){return rc(e)}}]),s}(),Ws=function(){function s(e){a(this,s),this.parser=new Wm(e)}return c(s,[{key:"write",value:function(e){return this.parser.write(e)}}],[{key:"toLineString",value:function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"}}]),s}(),me=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getIndexAlongSegment",value:function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]}},{key:"getTopologySummary",value:function(){var e=new si;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()}},{key:"computeIntersection",value:function(e,t,n,i){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(e,t,n,i)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value: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 e=arguments[0],t=this.getEdgeDistance(e,0),n=this.getEdgeDistance(e,1);t>n?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(e){this._precisionModel=e}},{key:"isInteriorIntersection",value:function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var e=arguments[0],t=0;t<this._result;t++)if(!this._intPt[t].equals2D(this._inputLines[e][0])&&!this._intPt[t].equals2D(this._inputLines[e][1]))return!0;return!1}}},{key:"getIntersection",value:function(e){return this._intPt[e]}},{key:"isEndPoint",value:function(){return this.hasIntersection()&&!this._isProper}},{key:"hasIntersection",value:function(){return this._result!==s.NO_INTERSECTION}},{key:"getEdgeDistance",value:function(e,t){return s.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1])}},{key:"isCollinear",value:function(){return this._result===s.COLLINEAR_INTERSECTION}},{key:"toString",value:function(){return Ws.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Ws.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()}},{key:"getEndpoint",value:function(e,t){return this._inputLines[e][t]}},{key:"isIntersection",value:function(e){for(var t=0;t<this._result;t++)if(this._intPt[t].equals2D(e))return!0;return!1}},{key:"getIntersectionAlongSegment",value:function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]}}],[{key:"constructor_",value: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 O,this._intPt[1]=new O,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}},{key:"computeEdgeDistance",value:function(e,t,n){var i=Math.abs(n.x-t.x),u=Math.abs(n.y-t.y),f=-1;if(e.equals(t))f=0;else if(e.equals(n))f=i>u?i:u;else{var g=Math.abs(e.x-t.x),y=Math.abs(e.y-t.y);(f=i>u?g:y)!==0||e.equals(t)||(f=Math.max(g,y))}return se.isTrue(!(f===0&&!e.equals(t)),"Bad distance calculation"),f}},{key:"nonRobustComputeEdgeDistance",value:function(e,t,n){var i=e.x-t.x,u=e.y-t.y,f=Math.sqrt(i*i+u*u);return se.isTrue(!(f===0&&!e.equals(t)),"Invalid distance calculation"),f}}]),s}();me.DONT_INTERSECT=0,me.DO_INTERSECT=1,me.COLLINEAR=2,me.NO_INTERSECTION=0,me.POINT_INTERSECTION=1,me.COLLINEAR_INTERSECTION=2;var Vt=function(s){h(t,s);var e=E(t);function t(){return a(this,t),e.call(this)}return c(t,[{key:"isInSegmentEnvelopes",value:function(n){var i=new pe(this._inputLines[0][0],this._inputLines[0][1]),u=new pe(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&u.contains(n)}},{key:"computeIntersection",value:function(){if(arguments.length!==3)return N(v(t.prototype),"computeIntersection",this).apply(this,arguments);var n=arguments[0],i=arguments[1],u=arguments[2];if(this._isProper=!1,pe.intersects(i,u,n)&&Q.index(i,u,n)===0&&Q.index(u,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(u))&&(this._isProper=!1),this._result=me.POINT_INTERSECTION,null;this._result=me.NO_INTERSECTION}},{key:"intersection",value:function(n,i,u,f){var g=this.intersectionSafe(n,i,u,f);return this.isInSegmentEnvelopes(g)||(g=new O(t.nearestEndpoint(n,i,u,f))),this._precisionModel!==null&&this._precisionModel.makePrecise(g),g}},{key:"checkDD",value:function(n,i,u,f,g){var y=Gs.intersection(n,i,u,f),d=this.isInSegmentEnvelopes(y);je.out.println("DD in env = "+d+" --------------------- "+y),g.distance(y)>1e-4&&je.out.println("Distance = "+g.distance(y))}},{key:"intersectionSafe",value:function(n,i,u,f){var g=Bs.intersection(n,i,u,f);return g===null&&(g=t.nearestEndpoint(n,i,u,f)),g}},{key:"computeCollinearIntersection",value:function(n,i,u,f){var g=pe.intersects(n,i,u),y=pe.intersects(n,i,f),d=pe.intersects(u,f,n),w=pe.intersects(u,f,i);return g&&y?(this._intPt[0]=u,this._intPt[1]=f,me.COLLINEAR_INTERSECTION):d&&w?(this._intPt[0]=n,this._intPt[1]=i,me.COLLINEAR_INTERSECTION):g&&d?(this._intPt[0]=u,this._intPt[1]=n,!u.equals(n)||y||w?me.COLLINEAR_INTERSECTION:me.POINT_INTERSECTION):g&&w?(this._intPt[0]=u,this._intPt[1]=i,!u.equals(i)||y||d?me.COLLINEAR_INTERSECTION:me.POINT_INTERSECTION):y&&d?(this._intPt[0]=f,this._intPt[1]=n,!f.equals(n)||g||w?me.COLLINEAR_INTERSECTION:me.POINT_INTERSECTION):y&&w?(this._intPt[0]=f,this._intPt[1]=i,!f.equals(i)||g||d?me.COLLINEAR_INTERSECTION:me.POINT_INTERSECTION):me.NO_INTERSECTION}},{key:"computeIntersect",value:function(n,i,u,f){if(this._isProper=!1,!pe.intersects(n,i,u,f))return me.NO_INTERSECTION;var g=Q.index(n,i,u),y=Q.index(n,i,f);if(g>0&&y>0||g<0&&y<0)return me.NO_INTERSECTION;var d=Q.index(u,f,n),w=Q.index(u,f,i);return d>0&&w>0||d<0&&w<0?me.NO_INTERSECTION:g===0&&y===0&&d===0&&w===0?this.computeCollinearIntersection(n,i,u,f):(g===0||y===0||d===0||w===0?(this._isProper=!1,n.equals2D(u)||n.equals2D(f)?this._intPt[0]=n:i.equals2D(u)||i.equals2D(f)?this._intPt[0]=i:g===0?this._intPt[0]=new O(u):y===0?this._intPt[0]=new O(f):d===0?this._intPt[0]=new O(n):w===0&&(this._intPt[0]=new O(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,u,f)),me.POINT_INTERSECTION)}}],[{key:"nearestEndpoint",value:function(n,i,u,f){var g=n,y=ft.pointToSegment(n,u,f),d=ft.pointToSegment(i,u,f);return d<y&&(y=d,g=i),(d=ft.pointToSegment(u,n,i))<y&&(y=d,g=u),(d=ft.pointToSegment(f,n,i))<y&&(y=d,g=f),g}}]),t}(me),Hm=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"countSegment",value:function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var n=e.x,i=t.x;return n>i&&(n=t.x,i=e.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var u=Q.index(e,t,this._p);if(u===Q.COLLINEAR)return this._isPointOnSegment=!0,null;t.y<e.y&&(u=-u),u===Q.LEFT&&this._crossingCount++}}},{key:"isPointInPolygon",value:function(){return this.getLocation()!==I.EXTERIOR}},{key:"getLocation",value:function(){return this._isPointOnSegment?I.BOUNDARY:this._crossingCount%2==1?I.INTERIOR:I.EXTERIOR}},{key:"isOnSegment",value:function(){return this._isPointOnSegment}}],[{key:"constructor_",value:function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e}},{key:"locatePointInRing",value:function(){if(arguments[0]instanceof O&&re(arguments[1],le)){for(var e=arguments[0],t=arguments[1],n=new s(e),i=new O,u=new O,f=1;f<t.size();f++)if(t.getCoordinate(f,i),t.getCoordinate(f-1,u),n.countSegment(i,u),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof O&&arguments[1]instanceof Array){for(var g=arguments[0],y=arguments[1],d=new s(g),w=1;w<y.length;w++){var b=y[w],L=y[w-1];if(d.countSegment(b,L),d.isOnSegment())return d.getLocation()}return d.getLocation()}}}]),s}(),Hs=function(){function s(){a(this,s)}return c(s,null,[{key:"isOnLine",value:function(){if(arguments[0]instanceof O&&re(arguments[1],le)){for(var e=arguments[0],t=arguments[1],n=new Vt,i=new O,u=new O,f=t.size(),g=1;g<f;g++)if(t.getCoordinate(g-1,i),t.getCoordinate(g,u),n.computeIntersection(e,i,u),n.hasIntersection())return!0;return!1}if(arguments[0]instanceof O&&arguments[1]instanceof Array){for(var y=arguments[0],d=arguments[1],w=new Vt,b=1;b<d.length;b++){var L=d[b-1],$=d[b];if(w.computeIntersection(y,L,$),w.hasIntersection())return!0}return!1}}},{key:"locateInRing",value:function(e,t){return Hm.locatePointInRing(e,t)}},{key:"isInRing",value:function(e,t){return s.locateInRing(e,t)!==I.EXTERIOR}}]),s}(),Ve=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"setAllLocations",value:function(e){for(var t=0;t<this.location.length;t++)this.location[t]=e}},{key:"isNull",value:function(){for(var e=0;e<this.location.length;e++)if(this.location[e]!==I.NONE)return!1;return!0}},{key:"setAllLocationsIfNull",value:function(e){for(var t=0;t<this.location.length;t++)this.location[t]===I.NONE&&(this.location[t]=e)}},{key:"isLine",value:function(){return this.location.length===1}},{key:"merge",value:function(e){if(e.location.length>this.location.length){var t=new Array(3).fill(null);t[G.ON]=this.location[G.ON],t[G.LEFT]=I.NONE,t[G.RIGHT]=I.NONE,this.location=t}for(var n=0;n<this.location.length;n++)this.location[n]===I.NONE&&n<e.location.length&&(this.location[n]=e.location[n])}},{key:"getLocations",value:function(){return this.location}},{key:"flip",value:function(){if(this.location.length<=1)return null;var e=this.location[G.LEFT];this.location[G.LEFT]=this.location[G.RIGHT],this.location[G.RIGHT]=e}},{key:"toString",value:function(){var e=new Vn;return this.location.length>1&&e.append(I.toLocationSymbol(this.location[G.LEFT])),e.append(I.toLocationSymbol(this.location[G.ON])),this.location.length>1&&e.append(I.toLocationSymbol(this.location[G.RIGHT])),e.toString()}},{key:"setLocations",value:function(e,t,n){this.location[G.ON]=e,this.location[G.LEFT]=t,this.location[G.RIGHT]=n}},{key:"get",value:function(e){return e<this.location.length?this.location[e]:I.NONE}},{key:"isArea",value:function(){return this.location.length>1}},{key:"isAnyNull",value:function(){for(var e=0;e<this.location.length;e++)if(this.location[e]===I.NONE)return!0;return!1}},{key:"setLocation",value:function(){if(arguments.length===1){var e=arguments[0];this.setLocation(G.ON,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.location[t]=n}}},{key:"init",value:function(e){this.location=new Array(e).fill(null),this.setAllLocations(I.NONE)}},{key:"isEqualOnSide",value:function(e,t){return this.location[t]===e.location[t]}},{key:"allPositionsEqual",value:function(e){for(var t=0;t<this.location.length;t++)if(this.location[t]!==e)return!1;return!0}}],[{key:"constructor_",value:function(){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 t=arguments[0];this.init(1),this.location[G.ON]=t}else if(arguments[0]instanceof s){var n=arguments[0];if(this.init(n.location.length),n!==null)for(var i=0;i<this.location.length;i++)this.location[i]=n.location[i]}}else if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2];this.init(3),this.location[G.ON]=u,this.location[G.LEFT]=f,this.location[G.RIGHT]=g}}}]),s}(),We=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getGeometryCount",value:function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e}},{key:"setAllLocations",value:function(e,t){this.elt[e].setAllLocations(t)}},{key:"isNull",value:function(e){return this.elt[e].isNull()}},{key:"setAllLocationsIfNull",value:function(){if(arguments.length===1){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.elt[t].setAllLocationsIfNull(n)}}},{key:"isLine",value:function(e){return this.elt[e].isLine()}},{key:"merge",value:function(e){for(var t=0;t<2;t++)this.elt[t]===null&&e.elt[t]!==null?this.elt[t]=new Ve(e.elt[t]):this.elt[t].merge(e.elt[t])}},{key:"flip",value:function(){this.elt[0].flip(),this.elt[1].flip()}},{key:"getLocation",value:function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(G.ON)}if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.elt[t].get(n)}}},{key:"toString",value:function(){var e=new Vn;return this.elt[0]!==null&&(e.append("A:"),e.append(this.elt[0].toString())),this.elt[1]!==null&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()}},{key:"isArea",value:function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var e=arguments[0];return this.elt[e].isArea()}}},{key:"isAnyNull",value:function(e){return this.elt[e].isAnyNull()}},{key:"setLocation",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(G.ON,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],u=arguments[2];this.elt[n].setLocation(i,u)}}},{key:"isEqualOnSide",value:function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)}},{key:"allPositionsEqual",value:function(e,t){return this.elt[e].allPositionsEqual(t)}},{key:"toLine",value:function(e){this.elt[e].isArea()&&(this.elt[e]=new Ve(this.elt[e].location[0]))}}],[{key:"constructor_",value:function(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Ve(e),this.elt[1]=new Ve(e)}else if(arguments[0]instanceof s){var t=arguments[0];this.elt[0]=new Ve(t.elt[0]),this.elt[1]=new Ve(t.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Ve(I.NONE),this.elt[1]=new Ve(I.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2];this.elt[0]=new Ve(u,f,g),this.elt[1]=new Ve(u,f,g)}else if(arguments.length===4){var y=arguments[0],d=arguments[1],w=arguments[2],b=arguments[3];this.elt[0]=new Ve(I.NONE,I.NONE,I.NONE),this.elt[1]=new Ve(I.NONE,I.NONE,I.NONE),this.elt[y].setLocations(d,w,b)}}},{key:"toLineLabel",value:function(e){for(var t=new s(I.NONE),n=0;n<2;n++)t.setLocation(n,e.getLocation(n));return t}}]),s}(),oi=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"computeRing",value:function(){if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),t=0;t<this._pts.size();t++)e[t]=this._pts.get(t);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=Q.isCCW(this._ring.getCoordinates())}},{key:"isIsolated",value:function(){return this._label.getGeometryCount()===1}},{key:"computePoints",value:function(e){this._startDe=e;var t=e,n=!0;do{if(t===null)throw new _t("Found null DirectedEdge");if(t.getEdgeRing()===this)throw new _t("Directed Edge visited twice during ring-building at "+t.getCoordinate());this._edges.add(t);var i=t.getLabel();se.isTrue(i.isArea()),this.mergeLabel(i),this.addPoints(t.getEdge(),t.isForward(),n),n=!1,this.setEdgeRing(t,this),t=this.getNext(t)}while(t!==this._startDe)}},{key:"getLinearRing",value:function(){return this._ring}},{key:"getCoordinate",value:function(e){return this._pts.get(e)}},{key:"computeMaxNodeDegree",value:function(){this._maxNodeDegree=0;var e=this._startDe;do{var t=e.getNode().getEdges().getOutgoingDegree(this);t>this._maxNodeDegree&&(this._maxNodeDegree=t),e=this.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2}},{key:"addPoints",value:function(e,t,n){var i=e.getCoordinates();if(t){var u=1;n&&(u=0);for(var f=u;f<i.length;f++)this._pts.add(i[f])}else{var g=i.length-2;n&&(g=i.length-1);for(var y=g;y>=0;y--)this._pts.add(i[y])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)}},{key:"containsPoint",value:function(e){var t=this.getLinearRing();if(!t.getEnvelopeInternal().contains(e)||!Hs.isInRing(e,t.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(e))return!1;return!0}},{key:"addHole",value:function(e){this._holes.add(e)}},{key:"isShell",value:function(){return this._shell===null}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}},{key:"getShell",value:function(){return this._shell}},{key:"mergeLabel",value:function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=t.getLocation(n,G.RIGHT);if(i===I.NONE)return null;if(this._label.getLocation(n)===I.NONE)return this._label.setLocation(n,i),null}}},{key:"setShell",value:function(e){this._shell=e,e!==null&&e.addHole(this)}},{key:"toPolygon",value:function(e){for(var t=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)t[n]=this._holes.get(n).getLinearRing();return e.createPolygon(this.getLinearRing(),t)}}],[{key:"constructor_",value:function(){if(this._startDe=null,this._maxNodeDegree=-1,this._edges=new Z,this._pts=new Z,this._label=new We(I.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Z,this._geometryFactory=null,arguments.length!==0){if(arguments.length===2){var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()}}}}]),s}(),Zm=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"setEdgeRing",value:function(n,i){n.setMinEdgeRing(i)}},{key:"getNext",value:function(n){return n.getNextMin()}}],[{key:"constructor_",value:function(){var n=arguments[0],i=arguments[1];oi.constructor_.call(this,n,i)}}]),t}(oi),Jm=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"buildMinimalRings",value:function(){var n=new Z,i=this._startDe;do{if(i.getMinEdgeRing()===null){var u=new Zm(i,this._geometryFactory);n.add(u)}i=i.getNext()}while(i!==this._startDe);return n}},{key:"setEdgeRing",value:function(n,i){n.setEdgeRing(i)}},{key:"linkDirectedEdgesForMinimalEdgeRings",value:function(){var n=this._startDe;do n.getNode().getEdges().linkMinimalDirectedEdges(this),n=n.getNext();while(n!==this._startDe)}},{key:"getNext",value:function(n){return n.getNext()}}],[{key:"constructor_",value:function(){var n=arguments[0],i=arguments[1];oi.constructor_.call(this,n,i)}}]),t}(oi),ic=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"setVisited",value:function(e){this._isVisited=e}},{key:"setInResult",value:function(e){this._isInResult=e}},{key:"isCovered",value:function(){return this._isCovered}},{key:"isCoveredSet",value:function(){return this._isCoveredSet}},{key:"setLabel",value:function(e){this._label=e}},{key:"getLabel",value:function(){return this._label}},{key:"setCovered",value:function(e){this._isCovered=e,this._isCoveredSet=!0}},{key:"updateIM",value:function(e){se.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._label=e}}}}]),s}(),ui=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"isIncidentEdgeInResult",value:function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();)if(n.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return this._label.getGeometryCount()===1}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(n){n.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(n){}},{key:"computeMergedLocation",value:function(n,i){var u=I.NONE;if(u=this._label.getLocation(i),!n.isNull(i)){var f=n.getLocation(i);u!==I.BOUNDARY&&(u=f)}return u}},{key:"setLabel",value:function(){if(arguments.length!==2||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return N(v(t.prototype),"setLabel",this).apply(this,arguments);var n=arguments[0],i=arguments[1];this._label===null?this._label=new We(n,i):this._label.setLocation(n,i)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof t){var n=arguments[0];this.mergeLabel(n._label)}else if(arguments[0]instanceof We)for(var i=arguments[0],u=0;u<2;u++){var f=this.computeMergedLocation(i,u),g=this._label.getLocation(u);g===I.NONE&&this._label.setLocation(u,f)}}},{key:"add",value:function(n){this._edges.insert(n),n.setNode(this)}},{key:"setLabelBoundary",value:function(n){if(this._label===null)return null;var i=I.NONE;this._label!==null&&(i=this._label.getLocation(n));var u=null;switch(i){case I.BOUNDARY:u=I.INTERIOR;break;case I.INTERIOR:default:u=I.BOUNDARY}this._label.setLocation(n,u)}}],[{key:"constructor_",value:function(){this._coord=null,this._edges=null;var n=arguments[0],i=arguments[1];this._coord=n,this._edges=i,this._label=new We(0,I.NONE)}}]),t}(ic),Qm=function(s){h(t,s);var e=E(t);function t(){return a(this,t),e.apply(this,arguments)}return t}(Jl);function sc(s){return s==null?0:s.color}function fe(s){return s==null?null:s.parent}function ht(s,e){s!==null&&(s.color=e)}function Zs(s){return s==null?null:s.left}function ac(s){return s==null?null:s.right}var er=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),(n=e.call(this)).root_=null,n.size_=0,n}return c(t,[{key:"get",value:function(n){for(var i=this.root_;i!==null;){var u=n.compareTo(i.key);if(u<0)i=i.left;else{if(!(u>0))return i.value;i=i.right}}return null}},{key:"put",value:function(n,i){if(this.root_===null)return this.root_={key:n,value:i,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var u,f,g=this.root_;do if(u=g,(f=n.compareTo(g.key))<0)g=g.left;else{if(!(f>0)){var y=g.value;return g.value=i,y}g=g.right}while(g!==null);var d={key:n,left:null,right:null,value:i,parent:u,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return f<0?u.left=d:u.right=d,this.fixAfterInsertion(d),this.size_++,null}},{key:"fixAfterInsertion",value:function(n){var i;for(n.color=1;n!=null&&n!==this.root_&&n.parent.color===1;)fe(n)===Zs(fe(fe(n)))?sc(i=ac(fe(fe(n))))===1?(ht(fe(n),0),ht(i,0),ht(fe(fe(n)),1),n=fe(fe(n))):(n===ac(fe(n))&&(n=fe(n),this.rotateLeft(n)),ht(fe(n),0),ht(fe(fe(n)),1),this.rotateRight(fe(fe(n)))):sc(i=Zs(fe(fe(n))))===1?(ht(fe(n),0),ht(i,0),ht(fe(fe(n)),1),n=fe(fe(n))):(n===Zs(fe(n))&&(n=fe(n),this.rotateRight(n)),ht(fe(n),0),ht(fe(fe(n)),1),this.rotateLeft(fe(fe(n))));this.root_.color=0}},{key:"values",value:function(){var n=new Z,i=this.getFirstEntry();if(i!==null)for(n.add(i.value);(i=t.successor(i))!==null;)n.add(i.value);return n}},{key:"entrySet",value:function(){var n=new Fs,i=this.getFirstEntry();if(i!==null)for(n.add(i);(i=t.successor(i))!==null;)n.add(i);return n}},{key:"rotateLeft",value:function(n){if(n!=null){var i=n.right;n.right=i.left,i.left!=null&&(i.left.parent=n),i.parent=n.parent,n.parent==null?this.root_=i:n.parent.left===n?n.parent.left=i:n.parent.right=i,i.left=n,n.parent=i}}},{key:"rotateRight",value:function(n){if(n!=null){var i=n.left;n.left=i.right,i.right!=null&&(i.right.parent=n),i.parent=n.parent,n.parent==null?this.root_=i:n.parent.right===n?n.parent.right=i:n.parent.left=i,i.right=n,n.parent=i}}},{key:"getFirstEntry",value:function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n}},{key:"size",value:function(){return this.size_}},{key:"containsKey",value:function(n){for(var i=this.root_;i!==null;){var u=n.compareTo(i.key);if(u<0)i=i.left;else{if(!(u>0))return!0;i=i.right}}return!1}}],[{key:"successor",value:function(n){var i;if(n===null)return null;if(n.right!==null){for(i=n.right;i.left!==null;)i=i.left;return i}i=n.parent;for(var u=n;i!==null&&u===i.right;)u=i,i=i.parent;return i}}]),t}(Qm),oc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"find",value:function(e){return this.nodeMap.get(e)}},{key:"addNode",value:function(){if(arguments[0]instanceof O){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}if(arguments[0]instanceof ui){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}}},{key:"print",value:function(e){for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(e){for(var t=new Z,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(e)===I.BOUNDARY&&t.add(i)}return t}},{key:"add",value:function(e){var t=e.getCoordinate();this.addNode(t).add(e)}}],[{key:"constructor_",value:function(){this.nodeMap=new er,this.nodeFact=null;var e=arguments[0];this.nodeFact=e}}]),s}(),Pe=function(){function s(){a(this,s)}return c(s,null,[{key:"isNorthern",value:function(e){return e===s.NE||e===s.NW}},{key:"isOpposite",value:function(e,t){return e!==t&&(e-t+4)%4===2}},{key:"commonHalfPlane",value:function(e,t){if(e===t)return e;if((e-t+4)%4===2)return-1;var n=e<t?e:t;return n===0&&(e>t?e:t)===3?3:n}},{key:"isInHalfPlane",value:function(e,t){return t===s.SE?e===s.SE||e===s.SW:e===t||e===t+1}},{key:"quadrant",value:function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new M("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?s.NE:s.SE:t>=0?s.NW:s.SW}if(arguments[0]instanceof O&&arguments[1]instanceof O){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new M("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?s.NE:s.SE:i.y>=n.y?s.NW:s.SW}}}]),s}();Pe.NE=0,Pe.NW=1,Pe.SW=2,Pe.SE=3;var uc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"compareDirection",value:function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:Q.index(e._p0,e._p1,this._p1)}},{key:"getDy",value:function(){return this._dy}},{key:"getCoordinate",value:function(){return this._p0}},{key:"setNode",value:function(e){this._node=e}},{key:"print",value:function(e){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),u=n.substring(i+1);e.print(" "+u+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)}},{key:"compareTo",value:function(e){var t=e;return this.compareDirection(t)}},{key:"getDirectedCoordinate",value:function(){return this._p1}},{key:"getDx",value:function(){return this._dx}},{key:"getLabel",value:function(){return this._label}},{key:"getEdge",value:function(){return this._edge}},{key:"getQuadrant",value:function(){return this._quadrant}},{key:"getNode",value:function(){return this._node}},{key:"toString",value:function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),n=t.lastIndexOf(".");return" "+t.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label}},{key:"computeLabel",value:function(e){}},{key:"init",value:function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=Pe.quadrant(this._dx,this._dy),se.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")}},{key:"interfaces_",get:function(){return[Y]}}],[{key:"constructor_",value: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 e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2];s.constructor_.call(this,t,n,i,null)}else if(arguments.length===4){var u=arguments[0],f=arguments[1],g=arguments[2],y=arguments[3];s.constructor_.call(this,u),this.init(f,g),this._label=y}}}]),s}(),Js=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"getNextMin",value:function(){return this._nextMin}},{key:"getDepth",value:function(n){return this._depth[n]}},{key:"setVisited",value:function(n){this._isVisited=n}},{key:"computeDirectedLabel",value:function(){this._label=new We(this._edge.getLabel()),this._isForward||this._label.flip()}},{key:"getNext",value:function(){return this._next}},{key:"setDepth",value:function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new _t("assigned depths do not match",this.getCoordinate());this._depth[n]=i}},{key:"isInteriorAreaEdge",value:function(){for(var n=!0,i=0;i<2;i++)this._label.isArea(i)&&this._label.getLocation(i,G.LEFT)===I.INTERIOR&&this._label.getLocation(i,G.RIGHT)===I.INTERIOR||(n=!1);return n}},{key:"setNextMin",value:function(n){this._nextMin=n}},{key:"print",value:function(n){N(v(t.prototype),"print",this).call(this,n),n.print(" "+this._depth[G.LEFT]+"/"+this._depth[G.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")}},{key:"setMinEdgeRing",value:function(n){this._minEdgeRing=n}},{key:"isLineEdge",value:function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,I.EXTERIOR),u=!this._label.isArea(1)||this._label.allPositionsEqual(1,I.EXTERIOR);return n&&i&&u}},{key:"setEdgeRing",value:function(n){this._edgeRing=n}},{key:"getMinEdgeRing",value:function(){return this._minEdgeRing}},{key:"getDepthDelta",value:function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n}},{key:"setInResult",value:function(n){this._isInResult=n}},{key:"getSym",value:function(){return this._sym}},{key:"isForward",value:function(){return this._isForward}},{key:"getEdge",value:function(){return this._edge}},{key:"printEdge",value:function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)}},{key:"setSym",value:function(n){this._sym=n}},{key:"setVisitedEdge",value:function(n){this.setVisited(n),this._sym.setVisited(n)}},{key:"setEdgeDepths",value:function(n,i){var u=this.getEdge().getDepthDelta();this._isForward||(u=-u);var f=1;n===G.LEFT&&(f=-1);var g=G.opposite(n),y=i+u*f;this.setDepth(n,i),this.setDepth(g,y)}},{key:"getEdgeRing",value:function(){return this._edgeRing}},{key:"isInResult",value:function(){return this._isInResult}},{key:"setNext",value:function(n){this._next=n}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){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];var n=arguments[0],i=arguments[1];if(uc.constructor_.call(this,n),this._isForward=i,i)this.init(n.getCoordinate(0),n.getCoordinate(1));else{var u=n.getNumPoints()-1;this.init(n.getCoordinate(u),n.getCoordinate(u-1))}this.computeDirectedLabel()}},{key:"depthFactor",value:function(n,i){return n===I.EXTERIOR&&i===I.INTERIOR?1:n===I.INTERIOR&&i===I.EXTERIOR?-1:0}}]),t}(uc),lc=function(){function s(){a(this,s)}return c(s,[{key:"createNode",value:function(e){return new ui(e,null)}}]),s}(),cc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"printEdges",value:function(e){e.println("Edges:");for(var t=0;t<this._edges.size();t++){e.println("edge "+t+":");var n=this._edges.get(t);n.print(e),n.eiList.print(e)}}},{key:"find",value:function(e){return this._nodes.find(e)}},{key:"addNode",value:function(){if(arguments[0]instanceof ui){var e=arguments[0];return this._nodes.addNode(e)}if(arguments[0]instanceof O){var t=arguments[0];return this._nodes.addNode(t)}}},{key:"getNodeIterator",value:function(){return this._nodes.iterator()}},{key:"linkResultDirectedEdges",value:function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()}},{key:"debugPrintln",value:function(e){je.out.println(e)}},{key:"isBoundaryNode",value:function(e,t){var n=this._nodes.find(t);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(e)===I.BOUNDARY}},{key:"linkAllDirectedEdges",value:function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkAllDirectedEdges()}},{key:"matchInSameDirection",value:function(e,t,n,i){return!!e.equals(n)&&Q.index(e,t,i)===Q.COLLINEAR&&Pe.quadrant(e,t)===Pe.quadrant(n,i)}},{key:"getEdgeEnds",value:function(){return this._edgeEndList}},{key:"debugPrint",value:function(e){je.out.print(e)}},{key:"getEdgeIterator",value:function(){return this._edges.iterator()}},{key:"findEdgeInSameDirection",value:function(e,t){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),u=i.getCoordinates();if(this.matchInSameDirection(e,t,u[0],u[1])||this.matchInSameDirection(e,t,u[u.length-1],u[u.length-2]))return i}return null}},{key:"insertEdge",value:function(e){this._edges.add(e)}},{key:"findEdgeEnd",value:function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var n=t.next();if(n.getEdge()===e)return n}return null}},{key:"addEdges",value:function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();this._edges.add(n);var i=new Js(n,!0),u=new Js(n,!1);i.setSym(u),u.setSym(i),this.add(i),this.add(u)}}},{key:"add",value:function(e){this._nodes.add(e),this._edgeEndList.add(e)}},{key:"getNodes",value:function(){return this._nodes.values()}},{key:"findEdge",value:function(e,t){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),u=i.getCoordinates();if(e.equals(u[0])&&t.equals(u[1]))return i}return null}}],[{key:"constructor_",value:function(){if(this._edges=new Z,this._nodes=null,this._edgeEndList=new Z,arguments.length===0)this._nodes=new oc(new lc);else if(arguments.length===1){var e=arguments[0];this._nodes=new oc(e)}}},{key:"linkResultDirectedEdges",value:function(e){for(var t=e.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()}}]),s}(),Km=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"sortShellsAndHoles",value:function(e,t,n){for(var i=e.iterator();i.hasNext();){var u=i.next();u.isHole()?n.add(u):t.add(u)}}},{key:"computePolygons",value:function(e){for(var t=new Z,n=e.iterator();n.hasNext();){var i=n.next().toPolygon(this._geometryFactory);t.add(i)}return t}},{key:"placeFreeHoles",value:function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next();if(i.getShell()===null){var u=s.findEdgeRingContaining(i,e);if(u===null)throw new _t("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(u)}}}},{key:"buildMinimalEdgeRings",value:function(e,t,n){for(var i=new Z,u=e.iterator();u.hasNext();){var f=u.next();if(f.getMaxNodeDegree()>2){f.linkDirectedEdgesForMinimalEdgeRings();var g=f.buildMinimalRings(),y=this.findShell(g);y!==null?(this.placePolygonHoles(y,g),t.add(y)):n.addAll(g)}else i.add(f)}return i}},{key:"buildMaximalEdgeRings",value:function(e){for(var t=new Z,n=e.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&i.getEdgeRing()===null){var u=new Jm(i,this._geometryFactory);t.add(u),u.setInResult()}}return t}},{key:"placePolygonHoles",value:function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(e)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(e){for(var t=0,n=null,i=e.iterator();i.hasNext();){var u=i.next();u.isHole()||(n=u,t++)}return se.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n}},{key:"add",value:function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];cc.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(t),u=new Z,f=this.buildMinimalEdgeRings(i,this._shellList,u);this.sortShellsAndHoles(f,this._shellList,u),this.placeFreeHoles(this._shellList,u)}}}],[{key:"constructor_",value:function(){this._geometryFactory=null,this._shellList=new Z;var e=arguments[0];this._geometryFactory=e}},{key:"findEdgeRingContaining",value:function(e,t){for(var n=e.getLinearRing(),i=n.getEnvelopeInternal(),u=n.getCoordinateN(0),f=null,g=null,y=t.iterator();y.hasNext();){var d=y.next(),w=d.getLinearRing(),b=w.getEnvelopeInternal();if(!b.equals(i)&&b.contains(i)){u=Ee.ptNotInList(n.getCoordinates(),w.getCoordinates());var L=!1;Hs.isInRing(u,w.getCoordinates())&&(L=!0),L&&(f===null||g.contains(b))&&(g=(f=d).getLinearRing().getEnvelopeInternal())}}return f}}]),s}(),fc=function(){function s(){a(this,s)}return c(s,[{key:"getBounds",value:function(){}}]),s}(),Et=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getItem",value:function(){return this._item}},{key:"getBounds",value:function(){return this._bounds}},{key:"interfaces_",get:function(){return[fc,X]}}],[{key:"constructor_",value:function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t}}]),s}(),li=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"poll",value:function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e}},{key:"size",value:function(){return this._size}},{key:"reorder",value:function(e){for(var t=null,n=this._items.get(e);2*e<=this._size&&((t=2*e)!==this._size&&this._items.get(t+1).compareTo(this._items.get(t))<0&&t++,this._items.get(t).compareTo(n)<0);e=t)this._items.set(e,this._items.get(t));this._items.set(e,n)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return this._size===0}},{key:"add",value:function(e){this._items.add(null),this._size+=1;var t=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(t/2)))<0;t/=2)this._items.set(t,this._items.get(Math.trunc(t/2)));this._items.set(t,e)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new Z,this._items.add(null)}}]),s}(),ed=function(){function s(){a(this,s)}return c(s,[{key:"insert",value:function(e,t){}},{key:"remove",value:function(e,t){}},{key:"query",value:function(){}}]),s}(),He=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(e){se.isTrue(this._bounds===null),this._childBoundables.add(e)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[fc,X]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new Z,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}}}]),s}(),Sn={reverseOrder:function(){return{compare:function(s,e){return e.compareTo(s)}}},min:function(s){return Sn.sort(s),s.get(0)},sort:function(s,e){var t=s.toArray();e?Ut.sort(t,e):Ut.sort(t);for(var n=s.iterator(),i=0,u=t.length;i<u;i++)n.next(),n.set(t[i])},singletonList:function(s){var e=new Z;return e.add(s),e}},td=function(){function s(){a(this,s)}return c(s,null,[{key:"maxDistance",value:function(e,t,n,i,u,f,g,y){var d=s.distance(e,t,u,f);return d=Math.max(d,s.distance(e,t,g,y)),d=Math.max(d,s.distance(n,i,u,f)),d=Math.max(d,s.distance(n,i,g,y))}},{key:"distance",value:function(e,t,n,i){var u=n-e,f=i-t;return Math.sqrt(u*u+f*f)}},{key:"maximumDistance",value:function(e,t){var n=Math.min(e.getMinX(),t.getMinX()),i=Math.min(e.getMinY(),t.getMinY()),u=Math.max(e.getMaxX(),t.getMaxX()),f=Math.max(e.getMaxY(),t.getMaxY());return s.distance(n,i,u,f)}},{key:"minMaxDistance",value:function(e,t){var n=e.getMinX(),i=e.getMinY(),u=e.getMaxX(),f=e.getMaxY(),g=t.getMinX(),y=t.getMinY(),d=t.getMaxX(),w=t.getMaxY(),b=s.maxDistance(n,i,n,f,g,y,g,w);return b=Math.min(b,s.maxDistance(n,i,n,f,g,y,d,y)),b=Math.min(b,s.maxDistance(n,i,n,f,d,w,g,w)),b=Math.min(b,s.maxDistance(n,i,n,f,d,w,d,y)),b=Math.min(b,s.maxDistance(n,i,u,i,g,y,g,w)),b=Math.min(b,s.maxDistance(n,i,u,i,g,y,d,y)),b=Math.min(b,s.maxDistance(n,i,u,i,d,w,g,w)),b=Math.min(b,s.maxDistance(n,i,u,i,d,w,d,y)),b=Math.min(b,s.maxDistance(u,f,n,f,g,y,g,w)),b=Math.min(b,s.maxDistance(u,f,n,f,g,y,d,y)),b=Math.min(b,s.maxDistance(u,f,n,f,d,w,g,w)),b=Math.min(b,s.maxDistance(u,f,n,f,d,w,d,y)),b=Math.min(b,s.maxDistance(u,f,u,i,g,y,g,w)),b=Math.min(b,s.maxDistance(u,f,u,i,g,y,d,y)),b=Math.min(b,s.maxDistance(u,f,u,i,d,w,g,w)),b=Math.min(b,s.maxDistance(u,f,u,i,d,w,d,y))}}]),s}(),In=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"maximumDistance",value:function(){return td.maximumDistance(this._boundable1.getBounds(),this._boundable2.getBounds())}},{key:"expandToQueue",value:function(e,t){var n=s.isComposite(this._boundable1),i=s.isComposite(this._boundable2);if(n&&i)return s.area(this._boundable1)>s.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,e,t),null):(this.expand(this._boundable2,this._boundable1,!0,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,!1,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,!0,e,t),null;throw new M("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(s.isComposite(this._boundable1)||s.isComposite(this._boundable2))}},{key:"compareTo",value:function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0}},{key:"expand",value:function(e,t,n,i,u){for(var f=e.getChildBoundables().iterator();f.hasNext();){var g=f.next(),y=null;(y=n?new s(t,g,this._itemDistance):new s(g,t,this._itemDistance)).getDistance()<u&&i.add(y)}}},{key:"getBoundable",value:function(e){return e===0?this._boundable1:this._boundable2}},{key:"getDistance",value:function(){return this._distance}},{key:"distance",value:function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())}},{key:"interfaces_",get:function(){return[Y]}}],[{key:"constructor_",value:function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=n,this._distance=this.distance()}},{key:"area",value:function(e){return e.getBounds().getArea()}},{key:"isComposite",value:function(e){return e instanceof He}}]),s}(),hc=function(){function s(){a(this,s)}return c(s,[{key:"visitItem",value:function(e){}}]),s}(),Nn=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"queryInternal",value:function(){if(re(arguments[2],hc)&&arguments[0]instanceof Object&&arguments[1]instanceof He)for(var e=arguments[0],t=arguments[1],n=arguments[2],i=t.getChildBoundables(),u=0;u<i.size();u++){var f=i.get(u);this.getIntersectsOp().intersects(f.getBounds(),e)&&(f instanceof He?this.queryInternal(e,f,n):f instanceof Et?n.visitItem(f.getItem()):se.shouldNeverReachHere())}else if(re(arguments[2],zt)&&arguments[0]instanceof Object&&arguments[1]instanceof He)for(var g=arguments[0],y=arguments[1],d=arguments[2],w=y.getChildBoundables(),b=0;b<w.size();b++){var L=w.get(b);this.getIntersectsOp().intersects(L.getBounds(),g)&&(L instanceof He?this.queryInternal(g,L,d):L instanceof Et?d.add(L.getItem()):se.shouldNeverReachHere())}}},{key:"getNodeCapacity",value:function(){return this._nodeCapacity}},{key:"lastNode",value:function(e){return e.get(e.size()-1)}},{key:"size",value:function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],t=0,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof He?t+=this.size(i):i instanceof Et&&(t+=1)}return t}}},{key:"removeItem",value:function(e,t){for(var n=null,i=e.getChildBoundables().iterator();i.hasNext();){var u=i.next();u instanceof Et&&u.getItem()===t&&(n=u)}return n!==null&&(e.getChildBoundables().remove(n),!0)}},{key:"itemsTree",value:function(){if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new Z:e}if(arguments.length===1){for(var t=arguments[0],n=new Z,i=t.getChildBoundables().iterator();i.hasNext();){var u=i.next();if(u instanceof He){var f=this.itemsTree(u);f!==null&&n.add(f)}else u instanceof Et?n.add(u.getItem()):se.shouldNeverReachHere()}return n.size()<=0?null:n}}},{key:"insert",value:function(e,t){se.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Et(e,t))}},{key:"boundablesAtLevel",value:function(){if(arguments.length===1){var e=arguments[0],t=new Z;return this.boundablesAtLevel(e,this._root,t),t}if(arguments.length===3){var n=arguments[0],i=arguments[1],u=arguments[2];if(se.isTrue(n>-2),i.getLevel()===n)return u.add(i),null;for(var f=i.getChildBoundables().iterator();f.hasNext();){var g=f.next();g instanceof He?this.boundablesAtLevel(n,g,u):(se.isTrue(g instanceof Et),n===-1&&u.add(g))}return null}}},{key:"query",value:function(){if(arguments.length===1){var e=arguments[0];this.build();var t=new Z;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.queryInternal(e,this._root,t),t}if(arguments.length===2){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.queryInternal(n,this._root,i)}}},{key:"build",value:function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.remove(e,this._root,t)}if(arguments.length===3){var n=arguments[0],i=arguments[1],u=arguments[2],f=this.removeItem(i,u);if(f)return!0;for(var g=null,y=i.getChildBoundables().iterator();y.hasNext();){var d=y.next();if(this.getIntersectsOp().intersects(d.getBounds(),n)&&d instanceof He&&(f=this.remove(n,d,u))){g=d;break}}return g!==null&&g.getChildBoundables().isEmpty()&&i.getChildBoundables().remove(g),f}}},{key:"createHigherLevels",value:function(e,t){se.isTrue(!e.isEmpty());var n=this.createParentBoundables(e,t+1);return n.size()===1?n.get(0):this.createHigherLevels(n,t+1)}},{key:"depth",value:function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],t=0,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof He){var u=this.depth(i);u>t&&(t=u)}}return t+1}}},{key:"createParentBoundables",value:function(e,t){se.isTrue(!e.isEmpty());var n=new Z;n.add(this.createNode(t));var i=new Z(e);Sn.sort(i,this.getComparator());for(var u=i.iterator();u.hasNext();){var f=u.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(t)),this.lastNode(n).addChildBoundable(f)}return n}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[X]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new Z,this._nodeCapacity=null,arguments.length===0)s.constructor_.call(this,s.DEFAULT_NODE_CAPACITY);else if(arguments.length===1){var e=arguments[0];se.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}}},{key:"compareDoubles",value:function(e,t){return e>t?1:e<t?-1:0}}]),s}();Nn.IntersectsOp=function(){},Nn.DEFAULT_NODE_CAPACITY=10;var nd=function(){function s(){a(this,s)}return c(s,[{key:"distance",value:function(e,t){}}]),s}(),gt=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"createParentBoundablesFromVerticalSlices",value:function(n,i){se.isTrue(n.length>0);for(var u=new Z,f=0;f<n.length;f++)u.addAll(this.createParentBoundablesFromVerticalSlice(n[f],i));return u}},{key:"nearestNeighbourK",value:function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.nearestNeighbourK(n,j.POSITIVE_INFINITY,i)}if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2],y=f,d=new li;d.add(u);for(var w=new li;!d.isEmpty()&&y>=0;){var b=d.poll(),L=b.getDistance();if(L>=y)break;if(b.isLeaves())if(w.size()<g)w.add(b);else{var $=w.peek();$.getDistance()>L&&(w.poll(),w.add(b));var D=w.peek();y=D.getDistance()}else b.expandToQueue(d,y)}return t.getItems(w)}}},{key:"createNode",value:function(n){return new gc(n)}},{key:"size",value:function(){return arguments.length===0?N(v(t.prototype),"size",this).call(this):N(v(t.prototype),"size",this).apply(this,arguments)}},{key:"insert",value:function(){if(!(arguments.length===2&&arguments[1]instanceof Object&&arguments[0]instanceof pe))return N(v(t.prototype),"insert",this).apply(this,arguments);var n=arguments[0],i=arguments[1];if(n.isNull())return null;N(v(t.prototype),"insert",this).call(this,n,i)}},{key:"getIntersectsOp",value:function(){return t.intersectsOp}},{key:"verticalSlices",value:function(n,i){for(var u=Math.trunc(Math.ceil(n.size()/i)),f=new Array(i).fill(null),g=n.iterator(),y=0;y<i;y++){f[y]=new Z;for(var d=0;g.hasNext()&&d<u;){var w=g.next();f[y].add(w),d++}}return f}},{key:"query",value:function(){if(arguments.length===1){var n=arguments[0];return N(v(t.prototype),"query",this).call(this,n)}if(arguments.length===2){var i=arguments[0],u=arguments[1];N(v(t.prototype),"query",this).call(this,i,u)}}},{key:"getComparator",value:function(){return t.yComparator}},{key:"createParentBoundablesFromVerticalSlice",value:function(n,i){return N(v(t.prototype),"createParentBoundables",this).call(this,n,i)}},{key:"remove",value:function(){if(arguments.length===2&&arguments[1]instanceof Object&&arguments[0]instanceof pe){var n=arguments[0],i=arguments[1];return N(v(t.prototype),"remove",this).call(this,n,i)}return N(v(t.prototype),"remove",this).apply(this,arguments)}},{key:"depth",value:function(){return arguments.length===0?N(v(t.prototype),"depth",this).call(this):N(v(t.prototype),"depth",this).apply(this,arguments)}},{key:"createParentBoundables",value:function(n,i){se.isTrue(!n.isEmpty());var u=Math.trunc(Math.ceil(n.size()/this.getNodeCapacity())),f=new Z(n);Sn.sort(f,t.xComparator);var g=this.verticalSlices(f,Math.trunc(Math.ceil(Math.sqrt(u))));return this.createParentBoundablesFromVerticalSlices(g,i)}},{key:"nearestNeighbour",value:function(){if(arguments.length===1){if(re(arguments[0],nd)){var n=arguments[0];if(this.isEmpty())return null;var i=new In(this.getRoot(),this.getRoot(),n);return this.nearestNeighbour(i)}if(arguments[0]instanceof In){var u=arguments[0],f=j.POSITIVE_INFINITY,g=null,y=new li;for(y.add(u);!y.isEmpty()&&f>0;){var d=y.poll(),w=d.getDistance();if(w>=f)break;d.isLeaves()?(f=w,g=d):d.expandToQueue(y,f)}return g===null?null:[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else{if(arguments.length===2){var b=arguments[0],L=arguments[1];if(this.isEmpty()||b.isEmpty())return null;var $=new In(this.getRoot(),b.getRoot(),L);return this.nearestNeighbour($)}if(arguments.length===3){var D=arguments[0],V=arguments[1],H=arguments[2],K=new Et(D,V),ge=new In(this.getRoot(),K,H);return this.nearestNeighbour(ge)[0]}if(arguments.length===4){var xe=arguments[0],Le=arguments[1],qe=arguments[2],nt=arguments[3],kt=new Et(xe,Le),Ht=new In(this.getRoot(),kt,qe);return this.nearestNeighbourK(Ht,nt)}}}},{key:"isWithinDistance",value:function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],u=j.POSITIVE_INFINITY,f=new li;for(f.add(n);!f.isEmpty();){var g=f.poll(),y=g.getDistance();if(y>i)return!1;if(g.maximumDistance()<=i)return!0;if(g.isLeaves()){if((u=y)<=i)return!0}else g.expandToQueue(f,u)}return!1}if(arguments.length===3){var d=arguments[0],w=arguments[1],b=arguments[2],L=new In(this.getRoot(),d.getRoot(),w);return this.isWithinDistance(L,b)}}},{key:"interfaces_",get:function(){return[ed,X]}}],[{key:"constructor_",value:function(){if(arguments.length===0)t.constructor_.call(this,t.DEFAULT_NODE_CAPACITY);else if(arguments.length===1){var n=arguments[0];Nn.constructor_.call(this,n)}}},{key:"centreX",value:function(n){return t.avg(n.getMinX(),n.getMaxX())}},{key:"avg",value:function(n,i){return(n+i)/2}},{key:"getItems",value:function(n){for(var i=new Array(n.size()).fill(null),u=0;!n.isEmpty();){var f=n.poll();i[u]=f.getBoundable(0).getItem(),u++}return i}},{key:"centreY",value:function(n){return t.avg(n.getMinY(),n.getMaxY())}}]),t}(Nn),gc=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"computeBounds",value:function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var u=i.next();n===null?n=new pe(u.getBounds()):n.expandToInclude(u.getBounds())}return n}}],[{key:"constructor_",value:function(){var n=arguments[0];He.constructor_.call(this,n)}}]),t}(He);gt.STRtreeNode=gc,gt.xComparator=new(function(){function s(){a(this,s)}return c(s,[{key:"interfaces_",get:function(){return[Ce]}},{key:"compare",value:function(e,t){return Nn.compareDoubles(gt.centreX(e.getBounds()),gt.centreX(t.getBounds()))}}]),s}()),gt.yComparator=new(function(){function s(){a(this,s)}return c(s,[{key:"interfaces_",get:function(){return[Ce]}},{key:"compare",value:function(e,t){return Nn.compareDoubles(gt.centreY(e.getBounds()),gt.centreY(t.getBounds()))}}]),s}()),gt.intersectsOp=new(function(){function s(){a(this,s)}return c(s,[{key:"interfaces_",get:function(){return[IntersectsOp]}},{key:"intersects",value:function(e,t){return e.intersects(t)}}]),s}()),gt.DEFAULT_NODE_CAPACITY=10;var rd=function(){function s(){a(this,s)}return c(s,null,[{key:"relativeSign",value:function(e,t){return e<t?-1:e>t?1:0}},{key:"compare",value:function(e,t,n){if(t.equals2D(n))return 0;var i=s.relativeSign(t.x,n.x),u=s.relativeSign(t.y,n.y);switch(e){case 0:return s.compareValue(i,u);case 1:return s.compareValue(u,i);case 2:return s.compareValue(u,-i);case 3:return s.compareValue(-i,u);case 4:return s.compareValue(-i,-u);case 5:return s.compareValue(-u,-i);case 6:return s.compareValue(-u,i);case 7:return s.compareValue(i,-u)}return se.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0}}]),s}(),id=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:this._isInterior?t._isInterior?rd.compare(this._segmentOctant,this.coord,t.coord):1:-1}},{key:"isEndPoint",value:function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[Y]}}],[{key:"constructor_",value:function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._segString=e,this.coord=new O(t),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(n))}}]),s}(),sd=function(){function s(){a(this,s)}return c(s,[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}]),s}(),ad=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getSplitCoordinates",value:function(){var e=new Jn;this.addEndpoints();for(var t=this.iterator(),n=t.next();t.hasNext();){var i=t.next();this.addEdgeCoordinates(n,i,e),n=i}return e.toCoordinateArray()}},{key:"addCollapsedNodes",value:function(){var e=new Z;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var t=e.iterator();t.hasNext();){var n=t.next().intValue();this.add(this._edge.getCoordinate(n),n)}}},{key:"createSplitEdgePts",value:function(e,t){var n=t.segmentIndex-e.segmentIndex+2;if(n===2)return[new O(e.coord),new O(t.coord)];var i=this._edge.getCoordinate(t.segmentIndex),u=t.isInterior()||!t.coord.equals2D(i);u||n--;var f=new Array(n).fill(null),g=0;f[g++]=new O(e.coord);for(var y=e.segmentIndex+1;y<=t.segmentIndex;y++)f[g++]=this._edge.getCoordinate(y);return u&&(f[g]=new O(t.coord)),f}},{key:"print",value:function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"findCollapsesFromExistingVertices",value:function(e){for(var t=0;t<this._edge.size()-2;t++){var n=this._edge.getCoordinate(t);this._edge.getCoordinate(t+1);var i=this._edge.getCoordinate(t+2);n.equals2D(i)&&e.add(Kr.valueOf(t+1))}}},{key:"addEdgeCoordinates",value:function(e,t,n){var i=this.createSplitEdgePts(e,t);n.add(i,!1)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(e){this.addEndpoints(),this.addCollapsedNodes();for(var t=this.iterator(),n=t.next();t.hasNext();){var i=t.next(),u=this.createSplitEdge(n,i);e.add(u),n=i}}},{key:"findCollapseIndex",value:function(e,t,n){if(!e.coord.equals2D(t.coord))return!1;var i=t.segmentIndex-e.segmentIndex;return t.isInterior()||i--,i===1&&(n[0]=e.segmentIndex+1,!0)}},{key:"findCollapsesFromInsertedNodes",value:function(e){for(var t=new Array(1).fill(null),n=this.iterator(),i=n.next();n.hasNext();){var u=n.next();this.findCollapseIndex(i,u,t)&&e.add(Kr.valueOf(t[0])),i=u}}},{key:"getEdge",value:function(){return this._edge}},{key:"addEndpoints",value:function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)}},{key:"createSplitEdge",value:function(e,t){var n=this.createSplitEdgePts(e,t);return new Wt(n,this._edge.getData())}},{key:"add",value:function(e,t){var n=new id(this._edge,e,t,this._edge.getSegmentOctant(t)),i=this._nodeMap.get(n);return i!==null?(se.isTrue(i.coord.equals2D(e),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)}},{key:"checkSplitEdgesCorrectness",value:function(e){var t=this._edge.getCoordinates(),n=e.get(0).getCoordinate(0);if(!n.equals2D(t[0]))throw new we("bad split edge start point at "+n);var i=e.get(e.size()-1).getCoordinates(),u=i[i.length-1];if(!u.equals2D(t[t.length-1]))throw new we("bad split edge end point at "+u)}}],[{key:"constructor_",value:function(){this._nodeMap=new er,this._edge=null;var e=arguments[0];this._edge=e}}]),s}(),od=function(){function s(){a(this,s)}return c(s,null,[{key:"octant",value:function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new M("Cannot compute the octant for point ( "+e+", "+t+" )");var n=Math.abs(e),i=Math.abs(t);return e>=0?t>=0?n>=i?0:1:n>=i?7:6:t>=0?n>=i?3:2:n>=i?4:5}if(arguments[0]instanceof O&&arguments[1]instanceof O){var u=arguments[0],f=arguments[1],g=f.x-u.x,y=f.y-u.y;if(g===0&&y===0)throw new M("Cannot compute the octant for two identical points "+u);return s.octant(g,y)}}}]),s}(),ud=function(){function s(){a(this,s)}return c(s,[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(e){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(e){}},{key:"getData",value:function(){}}]),s}(),ld=function(){function s(){a(this,s)}return c(s,[{key:"addIntersection",value:function(e,t){}},{key:"interfaces_",get:function(){return[ud]}}]),s}(),Wt=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(e){return this._pts[e]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))}},{key:"setData",value:function(e){this._data=e}},{key:"safeOctant",value:function(e,t){return e.equals2D(t)?0:od.octant(e,t)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],u=arguments[3],f=new O(n.getIntersection(u));this.addIntersection(f,i)}}},{key:"toString",value:function(){return Ws.toLineString(new Qn(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value:function(e,t){var n=t,i=n+1;if(i<this._pts.length){var u=this._pts[i];e.equals2D(u)&&(n=i)}return this._nodeList.add(e,n)}},{key:"addIntersections",value:function(e,t,n){for(var i=0;i<e.getIntersectionNum();i++)this.addIntersection(e,t,n,i)}},{key:"interfaces_",get:function(){return[ld]}}],[{key:"constructor_",value:function(){this._nodeList=new ad(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t}},{key:"getNodedSubstrings",value:function(){if(arguments.length===1){var e=arguments[0],t=new Z;return s.getNodedSubstrings(e,t),t}if(arguments.length===2)for(var n=arguments[0],i=arguments[1],u=n.iterator();u.hasNext();){var f=u.next();f.getNodeList().addSplitEdges(i)}}}]),s}(),Ge=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"minX",value:function(){return Math.min(this.p0.x,this.p1.x)}},{key:"orientationIndex",value:function(){if(arguments[0]instanceof s){var e=arguments[0],t=Q.index(this.p0,this.p1,e.p0),n=Q.index(this.p0,this.p1,e.p1);return t>=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}if(arguments[0]instanceof O){var i=arguments[0];return Q.index(this.p0,this.p1,i)}}},{key:"toGeometry",value:function(e){return e.createLineString([this.p0,this.p1])}},{key:"isVertical",value:function(){return this.p0.x===this.p1.x}},{key:"equals",value:function(e){if(!(e instanceof s))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)}},{key:"intersection",value:function(e){var t=new Vt;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null}},{key:"project",value:function(){if(arguments[0]instanceof O){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new O(e);var t=this.projectionFactor(e),n=new O;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof s){var i=arguments[0],u=this.projectionFactor(i.p0),f=this.projectionFactor(i.p1);if(u>=1&&f>=1||u<=0&&f<=0)return null;var g=this.project(i.p0);u<0&&(g=this.p0),u>1&&(g=this.p1);var y=this.project(i.p1);return f<0&&(y=this.p0),f>1&&(y=this.p1),new s(g,y)}}},{key:"normalize",value:function(){this.p1.compareTo(this.p0)<0&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(e){return e===0?this.p0:this.p1}},{key:"distancePerpendicular",value:function(e){return ft.pointToLinePerpendicular(e,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return s.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value:function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=t*t+n*n;return i<=0?j.NaN:((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/i}},{key:"closestPoints",value:function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),i=j.MAX_VALUE,u=null,f=this.closestPoint(e.p0);i=f.distance(e.p0),n[0]=f,n[1]=e.p0;var g=this.closestPoint(e.p1);(u=g.distance(e.p1))<i&&(i=u,n[0]=g,n[1]=e.p1);var y=e.closestPoint(this.p0);(u=y.distance(this.p0))<i&&(i=u,n[0]=this.p0,n[1]=y);var d=e.closestPoint(this.p1);return(u=d.distance(this.p1))<i&&(i=u,n[0]=this.p1,n[1]=d),n}},{key:"closestPoint",value:function(e){var t=this.projectionFactor(e);return t>0&&t<1?this.project(e):this.p0.distance(e)<this.p1.distance(e)?this.p0:this.p1}},{key:"maxX",value:function(){return Math.max(this.p0.x,this.p1.x)}},{key:"getLength",value:function(){return this.p0.distance(this.p1)}},{key:"compareTo",value:function(e){var t=e,n=this.p0.compareTo(t.p0);return n!==0?n:this.p1.compareTo(t.p1)}},{key:"reverse",value:function(){var e=this.p0;this.p0=this.p1,this.p1=e}},{key:"equalsTopo",value:function(e){return this.p0.equals(e.p0)&&this.p1.equals(e.p1)||this.p0.equals(e.p1)&&this.p1.equals(e.p0)}},{key:"lineIntersection",value:function(e){return Bs.intersection(this.p0,this.p1,e.p0,e.p1)}},{key:"maxY",value:function(){return Math.max(this.p0.y,this.p1.y)}},{key:"pointAlongOffset",value:function(e,t){var n=this.p0.x+e*(this.p1.x-this.p0.x),i=this.p0.y+e*(this.p1.y-this.p0.y),u=this.p1.x-this.p0.x,f=this.p1.y-this.p0.y,g=Math.sqrt(u*u+f*f),y=0,d=0;if(t!==0){if(g<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");y=t*u/g,d=t*f/g}return new O(n-d,i+y)}},{key:"setCoordinates",value:function(){if(arguments.length===1){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=n.x,this.p1.y=n.y}}},{key:"segmentFraction",value:function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||j.isNaN(t))&&(t=1),t}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(e){var t=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),i=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),u=t*t+n*n,f=t*t-n*n,g=e.getX(),y=e.getY();return new O((-f*g-2*t*n*y-2*t*i)/u,(f*y-2*t*n*g-2*n*i)/u)}},{key:"distance",value:function(){if(arguments[0]instanceof s){var e=arguments[0];return ft.segmentToSegment(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof O){var t=arguments[0];return ft.pointToSegment(t,this.p0,this.p1)}}},{key:"pointAlong",value:function(e){var t=new O;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t}},{key:"hashCode",value:function(){var e=j.doubleToLongBits(this.p0.x);e^=31*j.doubleToLongBits(this.p0.y);var t=Math.trunc(e)^Math.trunc(e>>32),n=j.doubleToLongBits(this.p1.x);return n^=31*j.doubleToLongBits(this.p1.y),t^(Math.trunc(n)^Math.trunc(n>>32))}},{key:"interfaces_",get:function(){return[Y,X]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,arguments.length===0)s.constructor_.call(this,new O,new O);else if(arguments.length===1){var e=arguments[0];s.constructor_.call(this,e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0=t,this.p1=n}else if(arguments.length===4){var i=arguments[0],u=arguments[1],f=arguments[2],g=arguments[3];s.constructor_.call(this,new O(i,u),new O(f,g))}}},{key:"midPoint",value:function(e,t){return new O((e.x+t.x)/2,(e.y+t.y)/2)}}]),s}(),cd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"overlap",value:function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new Ge,this._overlapSeg2=new Ge}}]),s}(),yc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getLineSegment",value:function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]}},{key:"computeSelect",value:function(e,t,n,i){var u=this._pts[t],f=this._pts[n];if(n-t==1)return i.select(this,t),null;if(!e.intersects(u,f))return null;var g=Math.trunc((t+n)/2);t<g&&this.computeSelect(e,t,g,i),g<n&&this.computeSelect(e,g,n,i)}},{key:"getCoordinates",value:function(){for(var e=new Array(this._end-this._start+1).fill(null),t=0,n=this._start;n<=this._end;n++)e[t++]=this._pts[n];return e}},{key:"computeOverlaps",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.computeOverlaps(this._start,this._end,e,e._start,e._end,t)}else if(arguments.length===6){var n=arguments[0],i=arguments[1],u=arguments[2],f=arguments[3],g=arguments[4],y=arguments[5];if(i-n==1&&g-f==1)return y.overlap(this,n,u,f),null;if(!this.overlaps(n,i,u,f,g))return null;var d=Math.trunc((n+i)/2),w=Math.trunc((f+g)/2);n<d&&(f<w&&this.computeOverlaps(n,d,u,f,w,y),w<g&&this.computeOverlaps(n,d,u,w,g,y)),d<i&&(f<w&&this.computeOverlaps(d,i,u,f,w,y),w<g&&this.computeOverlaps(d,i,u,w,g,y))}}},{key:"setId",value:function(e){this._id=e}},{key:"select",value:function(e,t){this.computeSelect(e,this._start,this._end,t)}},{key:"getEnvelope",value:function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new pe(e,t)}return this._env}},{key:"overlaps",value:function(e,t,n,i,u){return pe.intersects(this._pts[e],this._pts[t],n._pts[i],n._pts[u])}},{key:"getEndIndex",value:function(){return this._end}},{key:"getStartIndex",value:function(){return this._start}},{key:"getContext",value:function(){return this._context}},{key:"getId",value:function(){return this._id}}],[{key:"constructor_",value:function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=i}}]),s}(),fd=function(){function s(){a(this,s)}return c(s,null,[{key:"findChainEnd",value:function(e,t){for(var n=t;n<e.length-1&&e[n].equals2D(e[n+1]);)n++;if(n>=e.length-1)return e.length-1;for(var i=Pe.quadrant(e[n],e[n+1]),u=t+1;u<e.length&&!(!e[u-1].equals2D(e[u])&&Pe.quadrant(e[u-1],e[u])!==i);)u++;return u-1}},{key:"getChains",value:function(){if(arguments.length===1){var e=arguments[0];return s.getChains(e,null)}if(arguments.length===2){var t=arguments[0],n=arguments[1],i=new Z,u=0;do{var f=s.findChainEnd(t,u),g=new yc(t,u,f,n);i.add(g),u=f}while(u<t.length-1);return i}}}]),s}(),Qs=function(){function s(){a(this,s)}return c(s,[{key:"computeNodes",value:function(e){}},{key:"getNodedSubstrings",value:function(){}}]),s}(),vc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"setSegmentIntersector",value:function(e){this._segInt=e}},{key:"interfaces_",get:function(){return[Qs]}}],[{key:"constructor_",value:function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}}}]),s}(),Ks=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"getMonotoneChains",value:function(){return this._monoChains}},{key:"getNodedSubstrings",value:function(){return Wt.getNodedSubstrings(this._nodedSegStrings)}},{key:"getIndex",value:function(){return this._index}},{key:"add",value:function(n){for(var i=fd.getChains(n.getCoordinates(),n).iterator();i.hasNext();){var u=i.next();u.setId(this._idCounter++),this._index.insert(u.getEnvelope(),u),this._monoChains.add(u)}}},{key:"computeNodes",value:function(n){this._nodedSegStrings=n;for(var i=n.iterator();i.hasNext();)this.add(i.next());this.intersectChains()}},{key:"intersectChains",value:function(){for(var n=new pc(this._segInt),i=this._monoChains.iterator();i.hasNext();)for(var u=i.next(),f=this._index.query(u.getEnvelope()).iterator();f.hasNext();){var g=f.next();if(g.getId()>u.getId()&&(u.computeOverlaps(g,n),this._nOverlaps++),this._segInt.isDone())return null}}}],[{key:"constructor_",value:function(){if(this._monoChains=new Z,this._index=new gt,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,arguments.length!==0){if(arguments.length===1){var n=arguments[0];vc.constructor_.call(this,n)}}}}]),t}(vc),pc=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"overlap",value:function(){if(arguments.length!==4)return N(v(t.prototype),"overlap",this).apply(this,arguments);var n=arguments[0],i=arguments[1],u=arguments[2],f=arguments[3],g=n.getContext(),y=u.getContext();this._si.processIntersections(g,i,y,f)}}],[{key:"constructor_",value:function(){this._si=null;var n=arguments[0];this._si=n}}]),t}(cd);Ks.SegmentOverlapAction=pc;var tt=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"isDeletable",value:function(e,t,n,i){var u=this._inputLine[e],f=this._inputLine[t],g=this._inputLine[n];return!!this.isConcave(u,f,g)&&!!this.isShallow(u,f,g,i)&&this.isShallowSampled(u,f,e,n,i)}},{key:"deleteShallowConcavities",value:function(){for(var e=1,t=this.findNextNonDeletedIndex(e),n=this.findNextNonDeletedIndex(t),i=!1;n<this._inputLine.length;){var u=!1;this.isDeletable(e,t,n,this._distanceTol)&&(this._isDeleted[t]=s.DELETE,u=!0,i=!0),e=u?n:t,t=this.findNextNonDeletedIndex(e),n=this.findNextNonDeletedIndex(t)}return i}},{key:"isShallowConcavity",value:function(e,t,n,i){return Q.index(e,t,n)===this._angleOrientation&&ft.pointToSegment(t,e,n)<i}},{key:"isShallowSampled",value:function(e,t,n,i,u){var f=Math.trunc((i-n)/s.NUM_PTS_TO_CHECK);f<=0&&(f=1);for(var g=n;g<i;g+=f)if(!this.isShallow(e,t,this._inputLine[g],u))return!1;return!0}},{key:"isConcave",value:function(e,t,n){var i=Q.index(e,t,n)===this._angleOrientation;return i}},{key:"simplify",value:function(e){this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=Q.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var t=!1;do t=this.deleteShallowConcavities();while(t);return this.collapseLine()}},{key:"findNextNonDeletedIndex",value:function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===s.DELETE;)t++;return t}},{key:"isShallow",value:function(e,t,n,i){return ft.pointToSegment(t,e,n)<i}},{key:"collapseLine",value:function(){for(var e=new Jn,t=0;t<this._inputLine.length;t++)this._isDeleted[t]!==s.DELETE&&e.add(this._inputLine[t]);return e.toCoordinateArray()}}],[{key:"constructor_",value:function(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Q.COUNTERCLOCKWISE;var e=arguments[0];this._inputLine=e}},{key:"simplify",value:function(e,t){return new s(e).simplify(t)}}]),s}();tt.INIT=0,tt.DELETE=1,tt.KEEP=1,tt.NUM_PTS_TO_CHECK=10;var mc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getCoordinates",value:function(){return this._ptList.toArray(s.COORDINATE_ARRAY_TYPE)}},{key:"setPrecisionModel",value:function(e){this._precisionModel=e}},{key:"addPt",value:function(e){var t=new O(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)}},{key:"reverse",value:function(){}},{key:"addPts",value:function(e,t){if(t)for(var n=0;n<e.length;n++)this.addPt(e[n]);else for(var i=e.length-1;i>=0;i--)this.addPt(e[i])}},{key:"isRedundant",value:function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1);return e.distance(t)<this._minimimVertexDistance}},{key:"toString",value:function(){return new En().createLineString(this.getCoordinates()).toString()}},{key:"closeRing",value:function(){if(this._ptList.size()<1)return null;var e=new O(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)}},{key:"setMinimumVertexDistance",value:function(e){this._minimimVertexDistance=e}}],[{key:"constructor_",value:function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Z}}]),s}();mc.COORDINATE_ARRAY_TYPE=new Array(0).fill(null);var Be=function(){function s(){a(this,s)}return c(s,null,[{key:"toDegrees",value:function(e){return 180*e/Math.PI}},{key:"normalize",value:function(e){for(;e>Math.PI;)e-=s.PI_TIMES_2;for(;e<=-Math.PI;)e+=s.PI_TIMES_2;return e}},{key:"angle",value:function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}if(arguments.length===2){var t=arguments[0],n=arguments[1],i=n.x-t.x,u=n.y-t.y;return Math.atan2(u,i)}}},{key:"isAcute",value:function(e,t,n){var i=e.x-t.x,u=e.y-t.y;return i*(n.x-t.x)+u*(n.y-t.y)>0}},{key:"isObtuse",value:function(e,t,n){var i=e.x-t.x,u=e.y-t.y;return i*(n.x-t.x)+u*(n.y-t.y)<0}},{key:"interiorAngle",value:function(e,t,n){var i=s.angle(t,e),u=s.angle(t,n);return Math.abs(u-i)}},{key:"normalizePositive",value:function(e){if(e<0){for(;e<0;)e+=s.PI_TIMES_2;e>=s.PI_TIMES_2&&(e=0)}else{for(;e>=s.PI_TIMES_2;)e-=s.PI_TIMES_2;e<0&&(e=0)}return e}},{key:"angleBetween",value:function(e,t,n){var i=s.angle(t,e),u=s.angle(t,n);return s.diff(i,u)}},{key:"diff",value:function(e,t){var n=null;return(n=e<t?t-e:e-t)>Math.PI&&(n=2*Math.PI-n),n}},{key:"toRadians",value:function(e){return e*Math.PI/180}},{key:"getTurn",value:function(e,t){var n=Math.sin(t-e);return n>0?s.COUNTERCLOCKWISE:n<0?s.CLOCKWISE:s.NONE}},{key:"angleBetweenOriented",value:function(e,t,n){var i=s.angle(t,e),u=s.angle(t,n)-i;return u<=-Math.PI?u+s.PI_TIMES_2:u>Math.PI?u-s.PI_TIMES_2:u}}]),s}();Be.PI_TIMES_2=2*Math.PI,Be.PI_OVER_2=Math.PI/2,Be.PI_OVER_4=Math.PI/4,Be.COUNTERCLOCKWISE=Q.COUNTERCLOCKWISE,Be.CLOCKWISE=Q.CLOCKWISE,Be.NONE=Q.COLLINEAR;var tr=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"addNextSegment",value:function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=Q.index(this._s0,this._s1,this._s2),i=n===Q.CLOCKWISE&&this._side===G.LEFT||n===Q.COUNTERCLOCKWISE&&this._side===G.RIGHT;n===0?this.addCollinear(t):i?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)}},{key:"addLineEndCap",value:function(e,t){var n=new Ge(e,t),i=new Ge;this.computeOffsetSegment(n,G.LEFT,this._distance,i);var u=new Ge;this.computeOffsetSegment(n,G.RIGHT,this._distance,u);var f=t.x-e.x,g=t.y-e.y,y=Math.atan2(g,f);switch(this._bufParams.getEndCapStyle()){case C.CAP_ROUND:this._segList.addPt(i.p1),this.addDirectedFillet(t,y+Math.PI/2,y-Math.PI/2,Q.CLOCKWISE,this._distance),this._segList.addPt(u.p1);break;case C.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(u.p1);break;case C.CAP_SQUARE:var d=new O;d.x=Math.abs(this._distance)*Math.cos(y),d.y=Math.abs(this._distance)*Math.sin(y);var w=new O(i.p1.x+d.x,i.p1.y+d.y),b=new O(u.p1.x+d.x,u.p1.y+d.y);this._segList.addPt(w),this._segList.addPt(b)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(e,t,n,i){var u=Bs.intersection(t.p0,t.p1,n.p0,n.p1);if(u!==null&&(i<=0?1:u.distance(e)/Math.abs(i))<=this._bufParams.getMitreLimit())return this._segList.addPt(u),null;this.addLimitedMitreJoin(t,n,i,this._bufParams.getMitreLimit())}},{key:"addOutsideTurn",value:function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*s.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===C.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===C.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))}},{key:"createSquare",value:function(e){this._segList.addPt(new O(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new O(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new O(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new O(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()}},{key:"addSegments",value:function(e,t){this._segList.addPts(e,t)}},{key:"addFirstSegment",value:function(){this._segList.addPt(this._offset1.p0)}},{key:"addCornerFillet",value:function(e,t,n,i,u){var f=t.x-e.x,g=t.y-e.y,y=Math.atan2(g,f),d=n.x-e.x,w=n.y-e.y,b=Math.atan2(w,d);i===Q.CLOCKWISE?y<=b&&(y+=2*Math.PI):y>=b&&(y-=2*Math.PI),this._segList.addPt(t),this.addDirectedFillet(e,y,b,i,u),this._segList.addPt(n)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value:function(e,t,n){this._s1=e,this._s2=t,this._side=n,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)}},{key:"addLimitedMitreJoin",value:function(e,t,n,i){var u=this._seg0.p1,f=Be.angle(u,this._seg0.p0),g=Be.angleBetweenOriented(this._seg0.p0,u,this._seg1.p1)/2,y=Be.normalize(f+g),d=Be.normalize(y+Math.PI),w=i*n,b=n-w*Math.abs(Math.sin(g)),L=u.x+w*Math.cos(d),$=u.y+w*Math.sin(d),D=new O(L,$),V=new Ge(u,D),H=V.pointAlongOffset(1,b),K=V.pointAlongOffset(1,-b);this._side===G.LEFT?(this._segList.addPt(H),this._segList.addPt(K)):(this._segList.addPt(K),this._segList.addPt(H))}},{key:"addDirectedFillet",value:function(e,t,n,i,u){var f=i===Q.CLOCKWISE?-1:1,g=Math.abs(t-n),y=Math.trunc(g/this._filletAngleQuantum+.5);if(y<1)return null;for(var d=g/y,w=new O,b=0;b<y;b++){var L=t+f*b*d;w.x=e.x+u*Math.cos(L),w.y=e.y+u*Math.sin(L),this._segList.addPt(w)}}},{key:"computeOffsetSegment",value:function(e,t,n,i){var u=t===G.LEFT?1:-1,f=e.p1.x-e.p0.x,g=e.p1.y-e.p0.y,y=Math.sqrt(f*f+g*g),d=u*n*f/y,w=u*n*g/y;i.p0.x=e.p0.x-w,i.p0.y=e.p0.y+d,i.p1.x=e.p1.x-w,i.p1.y=e.p1.y+d}},{key:"addInsideTurn",value:function(e,t){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*s.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new O((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new O((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(e){var t=new O(e.x+this._distance,e.y);this._segList.addPt(t),this.addDirectedFillet(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)}},{key:"init",value:function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new mc,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*s.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===C.JOIN_BEVEL||this._bufParams.getJoinStyle()===C.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,Q.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Ge,this._seg1=new Ge,this._offset0=new Ge,this._offset1=new Ge,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new Vt,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===C.JOIN_ROUND&&(this._closingSegLengthFactor=s.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}}]),s}();tr.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,tr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,tr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,tr.MAX_CLOSING_SEG_LEN_FACTOR=80;var hd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getOffsetCurve",value:function(e,t){if(this._distance=t,t===0)return null;var n=t<0,i=Math.abs(t),u=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],u):this.computeOffsetCurve(e,n,u);var f=u.getCoordinates();return n&&Ee.reverse(f),f}},{key:"computeSingleSidedBufferCurve",value:function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var u=tt.simplify(e,-i),f=u.length-1;n.initSideSegments(u[f],u[f-1],G.LEFT),n.addFirstSegment();for(var g=f-2;g>=0;g--)n.addNextSegment(u[g],!0)}else{n.addSegments(e,!1);var y=tt.simplify(e,i),d=y.length-1;n.initSideSegments(y[0],y[1],G.LEFT),n.addFirstSegment();for(var w=2;w<=d;w++)n.addNextSegment(y[w],!0)}n.addLastSegment(),n.closeRing()}},{key:"computeRingBufferCurve",value:function(e,t,n){var i=this.simplifyTolerance(this._distance);t===G.RIGHT&&(i=-i);var u=tt.simplify(e,i),f=u.length-1;n.initSideSegments(u[f-1],u[0],t);for(var g=1;g<=f;g++){var y=g!==1;n.addNextSegment(u[g],y)}n.closeRing()}},{key:"computeLineBufferCurve",value:function(e,t){var n=this.simplifyTolerance(this._distance),i=tt.simplify(e,n),u=i.length-1;t.initSideSegments(i[0],i[1],G.LEFT);for(var f=2;f<=u;f++)t.addNextSegment(i[f],!0);t.addLastSegment(),t.addLineEndCap(i[u-1],i[u]);var g=tt.simplify(e,-n),y=g.length-1;t.initSideSegments(g[y],g[y-1],G.LEFT);for(var d=y-2;d>=0;d--)t.addNextSegment(g[d],!0);t.addLastSegment(),t.addLineEndCap(g[1],g[0]),t.closeRing()}},{key:"computePointCurve",value:function(e,t){switch(this._bufParams.getEndCapStyle()){case C.CAP_ROUND:t.createCircle(e);break;case C.CAP_SQUARE:t.createSquare(e)}}},{key:"getLineCurve",value:function(e,t){if(this._distance=t,this.isLineOffsetEmpty(t))return null;var n=Math.abs(t),i=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],i);else if(this._bufParams.isSingleSided()){var u=t<0;this.computeSingleSidedBufferCurve(e,u,i)}else this.computeLineBufferCurve(e,i);return i.getCoordinates()}},{key:"getBufferParameters",value:function(){return this._bufParams}},{key:"simplifyTolerance",value:function(e){return e*this._bufParams.getSimplifyFactor()}},{key:"getRingCurve",value:function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return s.copyCoordinates(e);var i=this.getSegGen(n);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()}},{key:"computeOffsetCurve",value:function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){var u=tt.simplify(e,-i),f=u.length-1;n.initSideSegments(u[f],u[f-1],G.LEFT),n.addFirstSegment();for(var g=f-2;g>=0;g--)n.addNextSegment(u[g],!0)}else{var y=tt.simplify(e,i),d=y.length-1;n.initSideSegments(y[0],y[1],G.LEFT),n.addFirstSegment();for(var w=2;w<=d;w++)n.addNextSegment(y[w],!0)}n.addLastSegment()}},{key:"isLineOffsetEmpty",value:function(e){return e===0||e<0&&!this._bufParams.isSingleSided()}},{key:"getSegGen",value:function(e){return new tr(this._precisionModel,this._bufParams,e)}}],[{key:"constructor_",value:function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t}},{key:"copyCoordinates",value:function(e){for(var t=new Array(e.length).fill(null),n=0;n<t.length;n++)t[n]=new O(e[n]);return t}}]),s}(),dc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"findStabbedSegments",value:function(){if(arguments.length===1){for(var e=arguments[0],t=new Z,n=this._subgraphs.iterator();n.hasNext();){var i=n.next(),u=i.getEnvelope();e.y<u.getMinY()||e.y>u.getMaxY()||this.findStabbedSegments(e,i.getDirectedEdges(),t)}return t}if(arguments.length===3){if(re(arguments[2],zt)&&arguments[0]instanceof O&&arguments[1]instanceof Js)for(var f=arguments[0],g=arguments[1],y=arguments[2],d=g.getEdge().getCoordinates(),w=0;w<d.length-1;w++){this._seg.p0=d[w],this._seg.p1=d[w+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse();var b=Math.max(this._seg.p0.x,this._seg.p1.x);if(!(b<f.x)&&!(this._seg.isHorizontal()||f.y<this._seg.p0.y||f.y>this._seg.p1.y||Q.index(this._seg.p0,this._seg.p1,f)===Q.RIGHT)){var L=g.getDepth(G.LEFT);this._seg.p0.equals(d[w])||(L=g.getDepth(G.RIGHT));var $=new _c(this._seg,L);y.add($)}}else if(re(arguments[2],zt)&&arguments[0]instanceof O&&re(arguments[1],zt))for(var D=arguments[0],V=arguments[1],H=arguments[2],K=V.iterator();K.hasNext();){var ge=K.next();ge.isForward()&&this.findStabbedSegments(D,ge,H)}}}},{key:"getDepth",value:function(e){var t=this.findStabbedSegments(e);return t.size()===0?0:Sn.min(t)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new Ge;var e=arguments[0];this._subgraphs=e}}]),s}(),_c=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"compareTo",value:function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return n!==0||(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg))!==0?n:this._upwardSeg.compareTo(t._upwardSeg)}},{key:"compareX",value:function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)}},{key:"toString",value:function(){return this._upwardSeg.toString()}},{key:"interfaces_",get:function(){return[Y]}}],[{key:"constructor_",value:function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new Ge(e),this._leftDepth=t}}]),s}();dc.DepthSegment=_c;var xc=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,null,[{key:"constructor_",value:function(){F.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}]),t}(F),ea=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getY",value:function(){var e=this.y/this.w;if(j.isNaN(e)||j.isInfinite(e))throw new xc;return e}},{key:"getX",value:function(){var e=this.x/this.w;if(j.isNaN(e)||j.isInfinite(e))throw new xc;return e}},{key:"getCoordinate",value:function(){var e=new O;return e.x=this.getX(),e.y=this.getY(),e}}],[{key:"constructor_",value:function(){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 e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];this.x=t,this.y=n,this.w=1}else if(arguments[0]instanceof s&&arguments[1]instanceof s){var i=arguments[0],u=arguments[1];this.x=i.y*u.w-u.y*i.w,this.y=u.x*i.w-i.x*u.w,this.w=i.x*u.y-u.x*i.y}else if(arguments[0]instanceof O&&arguments[1]instanceof O){var f=arguments[0],g=arguments[1];this.x=f.y-g.y,this.y=g.x-f.x,this.w=f.x*g.y-g.x*f.y}}else if(arguments.length===3){var y=arguments[0],d=arguments[1],w=arguments[2];this.x=y,this.y=d,this.w=w}else if(arguments.length===4){var b=arguments[0],L=arguments[1],$=arguments[2],D=arguments[3],V=b.y-L.y,H=L.x-b.x,K=b.x*L.y-L.x*b.y,ge=$.y-D.y,xe=D.x-$.x,Le=$.x*D.y-D.x*$.y;this.x=H*Le-xe*K,this.y=ge*K-V*Le,this.w=V*xe-ge*H}}}]),s}(),gd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"area",value:function(){return s.area(this.p0,this.p1,this.p2)}},{key:"signedArea",value:function(){return s.signedArea(this.p0,this.p1,this.p2)}},{key:"interpolateZ",value:function(e){if(e===null)throw new M("Supplied point is null.");return s.interpolateZ(e,this.p0,this.p1,this.p2)}},{key:"longestSideLength",value:function(){return s.longestSideLength(this.p0,this.p1,this.p2)}},{key:"isAcute",value:function(){return s.isAcute(this.p0,this.p1,this.p2)}},{key:"circumcentre",value:function(){return s.circumcentre(this.p0,this.p1,this.p2)}},{key:"area3D",value:function(){return s.area3D(this.p0,this.p1,this.p2)}},{key:"centroid",value:function(){return s.centroid(this.p0,this.p1,this.p2)}},{key:"inCentre",value:function(){return s.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_",value:function(){this.p0=null,this.p1=null,this.p2=null;var e=arguments[0],t=arguments[1],n=arguments[2];this.p0=e,this.p1=t,this.p2=n}},{key:"area",value:function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)}},{key:"signedArea",value:function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2}},{key:"det",value:function(e,t,n,i){return e*i-t*n}},{key:"interpolateZ",value:function(e,t,n,i){var u=t.x,f=t.y,g=n.x-u,y=i.x-u,d=n.y-f,w=i.y-f,b=g*w-y*d,L=e.x-u,$=e.y-f,D=(w*L-y*$)/b,V=(-d*L+g*$)/b;return t.getZ()+D*(n.getZ()-t.getZ())+V*(i.getZ()-t.getZ())}},{key:"longestSideLength",value:function(e,t,n){var i=e.distance(t),u=t.distance(n),f=n.distance(e),g=i;return u>g&&(g=u),f>g&&(g=f),g}},{key:"circumcentreDD",value:function(e,t,n){var i=J.valueOf(e.x).subtract(n.x),u=J.valueOf(e.y).subtract(n.y),f=J.valueOf(t.x).subtract(n.x),g=J.valueOf(t.y).subtract(n.y),y=J.determinant(i,u,f,g).multiply(2),d=i.sqr().add(u.sqr()),w=f.sqr().add(g.sqr()),b=J.determinant(u,d,g,w),L=J.determinant(i,d,f,w),$=J.valueOf(n.x).subtract(b.divide(y)).doubleValue(),D=J.valueOf(n.y).add(L.divide(y)).doubleValue();return new O($,D)}},{key:"isAcute",value:function(e,t,n){return!!Be.isAcute(e,t,n)&&!!Be.isAcute(t,n,e)&&!!Be.isAcute(n,e,t)}},{key:"circumcentre",value:function(e,t,n){var i=n.x,u=n.y,f=e.x-i,g=e.y-u,y=t.x-i,d=t.y-u,w=2*s.det(f,g,y,d),b=s.det(g,f*f+g*g,d,y*y+d*d),L=s.det(f,f*f+g*g,y,y*y+d*d);return new O(i-b/w,u+L/w)}},{key:"perpendicularBisector",value:function(e,t){var n=t.x-e.x,i=t.y-e.y,u=new ea(e.x+n/2,e.y+i/2,1),f=new ea(e.x-i+n/2,e.y+n+i/2,1);return new ea(u,f)}},{key:"angleBisector",value:function(e,t,n){var i=t.distance(e),u=i/(i+t.distance(n)),f=n.x-e.x,g=n.y-e.y;return new O(e.x+u*f,e.y+u*g)}},{key:"area3D",value:function(e,t,n){var i=t.x-e.x,u=t.y-e.y,f=t.getZ()-e.getZ(),g=n.x-e.x,y=n.y-e.y,d=n.getZ()-e.getZ(),w=u*d-f*y,b=f*g-i*d,L=i*y-u*g,$=w*w+b*b+L*L,D=Math.sqrt($)/2;return D}},{key:"centroid",value:function(e,t,n){var i=(e.x+t.x+n.x)/3,u=(e.y+t.y+n.y)/3;return new O(i,u)}},{key:"inCentre",value:function(e,t,n){var i=t.distance(n),u=e.distance(n),f=e.distance(t),g=i+u+f,y=(i*e.x+u*t.x+f*n.x)/g,d=(i*e.y+u*t.y+f*n.y)/g;return new O(y,d)}}]),s}(),yd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"addRingSide",value:function(e,t,n,i,u){if(t===0&&e.length<Zn.MINIMUM_VALID_SIZE)return null;var f=i,g=u;e.length>=Zn.MINIMUM_VALID_SIZE&&Q.isCCW(e)&&(f=u,g=i,n=G.opposite(n));var y=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(y,f,g)}},{key:"addRingBothSides",value:function(e,t){this.addRingSide(e,t,G.LEFT,I.EXTERIOR,I.INTERIOR),this.addRingSide(e,t,G.RIGHT,I.INTERIOR,I.EXTERIOR)}},{key:"addPoint",value:function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,I.EXTERIOR,I.INTERIOR)}},{key:"addPolygon",value:function(e){var t=this._distance,n=G.LEFT;this._distance<0&&(t=-this._distance,n=G.RIGHT);var i=e.getExteriorRing(),u=Ee.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance)||this._distance<=0&&u.length<3)return null;this.addRingSide(u,t,n,I.EXTERIOR,I.INTERIOR);for(var f=0;f<e.getNumInteriorRing();f++){var g=e.getInteriorRingN(f),y=Ee.removeRepeatedPoints(g.getCoordinates());this._distance>0&&this.isErodedCompletely(g,-this._distance)||this.addRingSide(y,t,G.opposite(n),I.INTERIOR,I.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(e,t){var n=new gd(e[0],e[1],e[2]),i=n.inCentre();return ft.pointToSegment(i,n.p0,n.p1)<Math.abs(t)}},{key:"addLineString",value:function(e){if(this._curveBuilder.isLineOffsetEmpty(this._distance))return null;var t=Ee.removeRepeatedPoints(e.getCoordinates());if(Ee.isRing(t)&&!this._curveBuilder.getBufferParameters().isSingleSided())this.addRingBothSides(t,this._distance);else{var n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,I.EXTERIOR,I.INTERIOR)}}},{key:"addCurve",value:function(e,t,n){if(e===null||e.length<2)return null;var i=new Wt(e,new We(0,I.BOUNDARY,t,n));this._curveList.add(i)}},{key:"getCurves",value:function(){return this.add(this._inputGeom),this._curveList}},{key:"add",value:function(e){if(e.isEmpty())return null;if(e instanceof ri)this.addPolygon(e);else if(e instanceof Hn)this.addLineString(e);else if(e instanceof qs)this.addPoint(e);else if(e instanceof zs)this.addCollection(e);else if(e instanceof js)this.addCollection(e);else if(e instanceof Xs)this.addCollection(e);else{if(!(e instanceof $e))throw new At(e.getGeometryType());this.addCollection(e)}}},{key:"isErodedCompletely",value:function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var i=e.getEnvelopeInternal(),u=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>u}},{key:"addCollection",value:function(e){for(var t=0;t<e.getNumGeometries();t++){var n=e.getGeometryN(t);this.add(n)}}}],[{key:"constructor_",value:function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Z;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n}}]),s}(),vd=function(){function s(){a(this,s)}return c(s,[{key:"locate",value:function(e){}}]),s}(),pd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"next",value:function(){if(this._atStart)return this._atStart=!1,s.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 Qr;var e=this._parent.getGeometryN(this._index++);return e instanceof $e?(this._subcollectionIterator=new s(e),this._subcollectionIterator.next()):e}},{key:"remove",value:function(){throw new At(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[sd]}}],[{key:"constructor_",value:function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()}},{key:"isAtomic",value:function(e){return!(e instanceof $e)}}]),s}(),md=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"locate",value:function(e){return s.locate(e,this._geom)}},{key:"interfaces_",get:function(){return[vd]}}],[{key:"constructor_",value:function(){this._geom=null;var e=arguments[0];this._geom=e}},{key:"locatePointInPolygon",value:function(e,t){if(t.isEmpty())return I.EXTERIOR;var n=t.getExteriorRing(),i=s.locatePointInRing(e,n);if(i!==I.INTERIOR)return i;for(var u=0;u<t.getNumInteriorRing();u++){var f=t.getInteriorRingN(u),g=s.locatePointInRing(e,f);if(g===I.BOUNDARY)return I.BOUNDARY;if(g===I.INTERIOR)return I.EXTERIOR}return I.INTERIOR}},{key:"locatePointInRing",value:function(e,t){return t.getEnvelopeInternal().intersects(e)?Hs.locateInRing(e,t.getCoordinates()):I.EXTERIOR}},{key:"containsPointInPolygon",value:function(e,t){return I.EXTERIOR!==s.locatePointInPolygon(e,t)}},{key:"locateInGeometry",value:function(e,t){if(t instanceof ri)return s.locatePointInPolygon(e,t);if(t instanceof $e)for(var n=new pd(t);n.hasNext();){var i=n.next();if(i!==t){var u=s.locateInGeometry(e,i);if(u!==I.EXTERIOR)return u}}return I.EXTERIOR}},{key:"isContained",value:function(e,t){return I.EXTERIOR!==s.locate(e,t)}},{key:"locate",value:function(e,t){return t.isEmpty()?I.EXTERIOR:t.getEnvelopeInternal().intersects(e)?s.locateInGeometry(e,t):I.EXTERIOR}}]),s}(),dd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getNextCW",value:function(e){this.getEdges();var t=this._edgeList.indexOf(e),n=t-1;return t===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)}},{key:"propagateSideLabels",value:function(e){for(var t=I.NONE,n=this.iterator();n.hasNext();){var i=n.next().getLabel();i.isArea(e)&&i.getLocation(e,G.LEFT)!==I.NONE&&(t=i.getLocation(e,G.LEFT))}if(t===I.NONE)return null;for(var u=t,f=this.iterator();f.hasNext();){var g=f.next(),y=g.getLabel();if(y.getLocation(e,G.ON)===I.NONE&&y.setLocation(e,G.ON,u),y.isArea(e)){var d=y.getLocation(e,G.LEFT),w=y.getLocation(e,G.RIGHT);if(w!==I.NONE){if(w!==u)throw new _t("side location conflict",g.getCoordinate());d===I.NONE&&se.shouldNeverReachHere("found single null side (at "+g.getCoordinate()+")"),u=d}else se.isTrue(y.getLocation(e,G.LEFT)===I.NONE,"found single null side"),y.setLocation(e,G.RIGHT,u),y.setLocation(e,G.LEFT,u)}}}},{key:"getCoordinate",value:function(){var e=this.iterator();return e.hasNext()?e.next().getCoordinate():null}},{key:"print",value:function(e){je.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"isAreaLabelsConsistent",value:function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}},{key:"checkAreaLabelsConsistent",value:function(e){var t=this.getEdges();if(t.size()<=0)return!0;var n=t.size()-1,i=t.get(n).getLabel().getLocation(e,G.LEFT);se.isTrue(i!==I.NONE,"Found unlabelled area edge");for(var u=i,f=this.iterator();f.hasNext();){var g=f.next().getLabel();se.isTrue(g.isArea(e),"Found non-area edge");var y=g.getLocation(e,G.LEFT),d=g.getLocation(e,G.RIGHT);if(y===d||d!==u)return!1;u=y}return!0}},{key:"findIndex",value:function(e){this.iterator();for(var t=0;t<this._edgeList.size();t++)if(this._edgeList.get(t)===e)return t;return-1}},{key:"iterator",value:function(){return this.getEdges().iterator()}},{key:"getEdges",value:function(){return this._edgeList===null&&(this._edgeList=new Z(this._edgeMap.values())),this._edgeList}},{key:"getLocation",value:function(e,t,n){return this._ptInAreaLocation[e]===I.NONE&&(this._ptInAreaLocation[e]=md.locate(t,n[e].getGeometry())),this._ptInAreaLocation[e]}},{key:"toString",value:function(){var e=new Vn;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
|
|
30
|
-
`);for(var t=this.iterator();t.hasNext();){var n=t.next();e.append(n),e.append(`
|
|
31
|
-
`)}return e.toString()}},{key:"computeEdgeEndLabels",value:function(e){for(var t=this.iterator();t.hasNext();)t.next().computeLabel(e)}},{key:"computeLabelling",value:function(e){this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var t=[!1,!1],n=this.iterator();n.hasNext();)for(var i=n.next().getLabel(),u=0;u<2;u++)i.isLine(u)&&i.getLocation(u)===I.BOUNDARY&&(t[u]=!0);for(var f=this.iterator();f.hasNext();)for(var g=f.next(),y=g.getLabel(),d=0;d<2;d++)if(y.isAnyNull(d)){var w=I.NONE;if(t[d])w=I.EXTERIOR;else{var b=g.getCoordinate();w=this.getLocation(d,b,e)}y.setAllLocationsIfNull(d,w)}}},{key:"getDegree",value:function(){return this._edgeMap.size()}},{key:"insertEdgeEnd",value:function(e,t){this._edgeMap.put(e,t),this._edgeList=null}}],[{key:"constructor_",value:function(){this._edgeMap=new er,this._edgeList=null,this._ptInAreaLocation=[I.NONE,I.NONE]}}]),s}(),_d=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"linkResultDirectedEdges",value:function(){this.getResultAreaEdges();for(var n=null,i=null,u=this._SCANNING_FOR_INCOMING,f=0;f<this._resultAreaEdgeList.size();f++){var g=this._resultAreaEdgeList.get(f),y=g.getSym();if(g.getLabel().isArea())switch(n===null&&g.isInResult()&&(n=g),u){case this._SCANNING_FOR_INCOMING:if(!y.isInResult())continue;i=y,u=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!g.isInResult())continue;i.setNext(g),u=this._SCANNING_FOR_INCOMING}}if(u===this._LINKING_TO_OUTGOING){if(n===null)throw new _t("no outgoing dirEdge found",this.getCoordinate());se.isTrue(n.isInResult(),"unable to link last incoming dirEdge"),i.setNext(n)}}},{key:"insert",value:function(n){var i=n;this.insertEdgeEnd(i,i)}},{key:"getRightmostEdge",value:function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var u=n.get(0);if(i===1)return u;var f=n.get(i-1),g=u.getQuadrant(),y=f.getQuadrant();return Pe.isNorthern(g)&&Pe.isNorthern(y)?u:Pe.isNorthern(g)||Pe.isNorthern(y)?u.getDy()!==0?u:f.getDy()!==0?f:(se.shouldNeverReachHere("found two horizontal edges incident on node"),null):f}},{key:"print",value:function(n){je.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var u=i.next();n.print("out "),u.print(n),n.println(),n.print("in "),u.getSym().print(n),n.println()}}},{key:"getResultAreaEdges",value:function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Z;for(var n=this.iterator();n.hasNext();){var i=n.next();(i.isInResult()||i.getSym().isInResult())&&this._resultAreaEdgeList.add(i)}return this._resultAreaEdgeList}},{key:"updateLabelling",value:function(n){for(var i=this.iterator();i.hasNext();){var u=i.next().getLabel();u.setAllLocationsIfNull(0,n.getLocation(0)),u.setAllLocationsIfNull(1,n.getLocation(1))}}},{key:"linkAllDirectedEdges",value:function(){this.getEdges();for(var n=null,i=null,u=this._edgeList.size()-1;u>=0;u--){var f=this._edgeList.get(u),g=f.getSym();i===null&&(i=g),n!==null&&g.setNext(n),n=f}i.setNext(n)}},{key:"computeDepths",value:function(){if(arguments.length===1){var n=arguments[0],i=this.findIndex(n),u=n.getDepth(G.LEFT),f=n.getDepth(G.RIGHT),g=this.computeDepths(i+1,this._edgeList.size(),u),y=this.computeDepths(0,i,g);if(y!==f)throw new _t("depth mismatch at "+n.getCoordinate())}else if(arguments.length===3){for(var d=arguments[0],w=arguments[1],b=arguments[2],L=b,$=d;$<w;$++){var D=this._edgeList.get($);D.setEdgeDepths(G.RIGHT,L),L=D.getDepth(G.LEFT)}return L}}},{key:"mergeSymLabels",value:function(){for(var n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().merge(i.getSym().getLabel())}}},{key:"linkMinimalDirectedEdges",value:function(n){for(var i=null,u=null,f=this._SCANNING_FOR_INCOMING,g=this._resultAreaEdgeList.size()-1;g>=0;g--){var y=this._resultAreaEdgeList.get(g),d=y.getSym();switch(i===null&&y.getEdgeRing()===n&&(i=y),f){case this._SCANNING_FOR_INCOMING:if(d.getEdgeRing()!==n)continue;u=d,f=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(y.getEdgeRing()!==n)continue;u.setNextMin(y),f=this._SCANNING_FOR_INCOMING}}f===this._LINKING_TO_OUTGOING&&(se.isTrue(i!==null,"found null for first outgoing dirEdge"),se.isTrue(i.getEdgeRing()===n,"unable to link last incoming dirEdge"),u.setNextMin(i))}},{key:"getOutgoingDegree",value:function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var u=i.next();u.isInResult()&&n++}return n}if(arguments.length===1){for(var f=arguments[0],g=0,y=this.iterator();y.hasNext();){var d=y.next();d.getEdgeRing()===f&&g++}return g}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var n=I.NONE,i=this.iterator();i.hasNext();){var u=i.next(),f=u.getSym();if(!u.isLineEdge()){if(u.isInResult()){n=I.INTERIOR;break}if(f.isInResult()){n=I.EXTERIOR;break}}}if(n===I.NONE)return null;for(var g=n,y=this.iterator();y.hasNext();){var d=y.next(),w=d.getSym();d.isLineEdge()?d.getEdge().setCovered(g===I.INTERIOR):(d.isInResult()&&(g=I.EXTERIOR),w.isInResult()&&(g=I.INTERIOR))}}},{key:"computeLabelling",value:function(n){N(v(t.prototype),"computeLabelling",this).call(this,n),this._label=new We(I.NONE);for(var i=this.iterator();i.hasNext();)for(var u=i.next().getEdge().getLabel(),f=0;f<2;f++){var g=u.getLocation(f);g!==I.INTERIOR&&g!==I.BOUNDARY||this._label.setLocation(f,I.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}]),t}(dd),xd=function(s){h(t,s);var e=E(t);function t(){return a(this,t),e.call(this)}return c(t,[{key:"createNode",value:function(n){return new ui(n,new _d)}}]),t}(lc),Ec=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"compareTo",value:function(e){var t=e;return s.compareOriented(this._pts,this._orientation,t._pts,t._orientation)}},{key:"interfaces_",get:function(){return[Y]}}],[{key:"constructor_",value:function(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=s.orientation(e)}},{key:"orientation",value:function(e){return Ee.increasingDirection(e)===1}},{key:"compareOriented",value:function(e,t,n,i){for(var u=t?1:-1,f=i?1:-1,g=t?e.length:-1,y=i?n.length:-1,d=t?0:e.length-1,w=i?0:n.length-1;;){var b=e[d].compareTo(n[w]);if(b!==0)return b;var L=(d+=u)===g,$=(w+=f)===y;if(L&&!$)return-1;if(!L&&$)return 1;if(L&&$)return 0}}}]),s}(),Ed=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"print",value:function(e){e.print("MULTILINESTRING ( ");for(var t=0;t<this._edges.size();t++){var n=this._edges.get(t);t>0&&e.print(","),e.print("(");for(var i=n.getCoordinates(),u=0;u<i.length;u++)u>0&&e.print(","),e.print(i[u].x+" "+i[u].y);e.println(")")}e.print(") ")}},{key:"addAll",value:function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next())}},{key:"findEdgeIndex",value:function(e){for(var t=0;t<this._edges.size();t++)if(this._edges.get(t).equals(e))return t;return-1}},{key:"iterator",value:function(){return this._edges.iterator()}},{key:"getEdges",value:function(){return this._edges}},{key:"get",value:function(e){return this._edges.get(e)}},{key:"findEqualEdge",value:function(e){var t=new Ec(e.getCoordinates());return this._ocaMap.get(t)}},{key:"add",value:function(e){this._edges.add(e);var t=new Ec(e.getCoordinates());this._ocaMap.put(t,e)}}],[{key:"constructor_",value:function(){this._edges=new Z,this._ocaMap=new er}}]),s}(),kc=function(){function s(){a(this,s)}return c(s,[{key:"processIntersections",value:function(e,t,n,i){}},{key:"isDone",value:function(){}}]),s}(),kd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"isTrivialIntersection",value:function(e,t,n,i){if(e===n&&this._li.getIntersectionNum()===1){if(s.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var u=e.size()-1;if(t===0&&i===u||i===0&&t===u)return!0}}return!1}},{key:"getProperIntersectionPoint",value:function(){return this._properIntersectionPoint}},{key:"hasProperInteriorIntersection",value:function(){return this._hasProperInterior}},{key:"getLineIntersector",value:function(){return this._li}},{key:"hasProperIntersection",value:function(){return this._hasProper}},{key:"processIntersections",value:function(e,t,n,i){if(e===n&&t===i)return null;this.numTests++;var u=e.getCoordinates()[t],f=e.getCoordinates()[t+1],g=n.getCoordinates()[i],y=n.getCoordinates()[i+1];this._li.computeIntersection(u,f,g,y),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,n,i)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))}},{key:"hasIntersection",value:function(){return this._hasIntersection}},{key:"isDone",value:function(){return!1}},{key:"hasInteriorIntersection",value:function(){return this._hasInterior}},{key:"interfaces_",get:function(){return[kc]}}],[{key:"constructor_",value: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 e=arguments[0];this._li=e}},{key:"isAdjacentSegments",value:function(e,t){return Math.abs(e-t)===1}}]),s}(),Sd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getSegmentIndex",value:function(){return this.segmentIndex}},{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)}},{key:"compareTo",value:function(e){var t=e;return this.compare(t.segmentIndex,t.dist)}},{key:"isEndPoint",value:function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e}},{key:"toString",value:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist}},{key:"getDistance",value:function(){return this.dist}},{key:"compare",value:function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0}},{key:"interfaces_",get:function(){return[Y]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],n=arguments[2];this.coord=new O(e),this.segmentIndex=t,this.dist=n}}]),s}(),Id=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"print",value:function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(e){this.addEndpoints();for(var t=this.iterator(),n=t.next();t.hasNext();){var i=t.next(),u=this.createSplitEdge(n,i);e.add(u),n=i}}},{key:"addEndpoints",value:function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)}},{key:"createSplitEdge",value:function(e,t){var n=t.segmentIndex-e.segmentIndex+2,i=this.edge.pts[t.segmentIndex],u=t.dist>0||!t.coord.equals2D(i);u||n--;var f=new Array(n).fill(null),g=0;f[g++]=new O(e.coord);for(var y=e.segmentIndex+1;y<=t.segmentIndex;y++)f[g++]=this.edge.pts[y];return u&&(f[g]=t.coord),new Ic(f,new We(this.edge._label))}},{key:"add",value:function(e,t,n){var i=new Sd(e,t,n),u=this._nodeMap.get(i);return u!==null?u:(this._nodeMap.put(i,i),i)}},{key:"isIntersection",value:function(e){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(e))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new er,this.edge=null;var e=arguments[0];this.edge=e}}]),s}(),Nd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])||s.isTrue(this._matrix[I.INTERIOR][I.BOUNDARY])||s.isTrue(this._matrix[I.BOUNDARY][I.INTERIOR])||s.isTrue(this._matrix[I.BOUNDARY][I.BOUNDARY]))&&this._matrix[I.EXTERIOR][I.INTERIOR]===z.FALSE&&this._matrix[I.EXTERIOR][I.BOUNDARY]===z.FALSE}},{key:"isCoveredBy",value:function(){return(s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])||s.isTrue(this._matrix[I.INTERIOR][I.BOUNDARY])||s.isTrue(this._matrix[I.BOUNDARY][I.INTERIOR])||s.isTrue(this._matrix[I.BOUNDARY][I.BOUNDARY]))&&this._matrix[I.INTERIOR][I.EXTERIOR]===z.FALSE&&this._matrix[I.BOUNDARY][I.EXTERIOR]===z.FALSE}},{key:"set",value:function(){if(arguments.length===1)for(var e=arguments[0],t=0;t<e.length;t++){var n=Math.trunc(t/3),i=t%3;this._matrix[n][i]=z.toDimensionValue(e.charAt(t))}else if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2];this._matrix[u][f]=g}}},{key:"isContains",value:function(){return s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&this._matrix[I.EXTERIOR][I.INTERIOR]===z.FALSE&&this._matrix[I.EXTERIOR][I.BOUNDARY]===z.FALSE}},{key:"setAtLeast",value:function(){if(arguments.length===1)for(var e=arguments[0],t=0;t<e.length;t++){var n=Math.trunc(t/3),i=t%3;this.setAtLeast(n,i,z.toDimensionValue(e.charAt(t)))}else if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2];this._matrix[u][f]<g&&(this._matrix[u][f]=g)}}},{key:"setAtLeastIfValid",value:function(e,t,n){e>=0&&t>=0&&this.setAtLeast(e,t,n)}},{key:"isWithin",value:function(){return s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&this._matrix[I.INTERIOR][I.EXTERIOR]===z.FALSE&&this._matrix[I.BOUNDARY][I.EXTERIOR]===z.FALSE}},{key:"isTouches",value:function(e,t){return e>t?this.isTouches(t,e):(e===z.A&&t===z.A||e===z.L&&t===z.L||e===z.L&&t===z.A||e===z.P&&t===z.A||e===z.P&&t===z.L)&&this._matrix[I.INTERIOR][I.INTERIOR]===z.FALSE&&(s.isTrue(this._matrix[I.INTERIOR][I.BOUNDARY])||s.isTrue(this._matrix[I.BOUNDARY][I.INTERIOR])||s.isTrue(this._matrix[I.BOUNDARY][I.BOUNDARY]))}},{key:"isOverlaps",value:function(e,t){return e===z.P&&t===z.P||e===z.A&&t===z.A?s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&s.isTrue(this._matrix[I.INTERIOR][I.EXTERIOR])&&s.isTrue(this._matrix[I.EXTERIOR][I.INTERIOR]):e===z.L&&t===z.L&&this._matrix[I.INTERIOR][I.INTERIOR]===1&&s.isTrue(this._matrix[I.INTERIOR][I.EXTERIOR])&&s.isTrue(this._matrix[I.EXTERIOR][I.INTERIOR])}},{key:"isEquals",value:function(e,t){return e===t&&s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&this._matrix[I.INTERIOR][I.EXTERIOR]===z.FALSE&&this._matrix[I.BOUNDARY][I.EXTERIOR]===z.FALSE&&this._matrix[I.EXTERIOR][I.INTERIOR]===z.FALSE&&this._matrix[I.EXTERIOR][I.BOUNDARY]===z.FALSE}},{key:"toString",value:function(){for(var e=new si("123456789"),t=0;t<3;t++)for(var n=0;n<3;n++)e.setCharAt(3*t+n,z.toDimensionSymbol(this._matrix[t][n]));return e.toString()}},{key:"setAll",value:function(e){for(var t=0;t<3;t++)for(var n=0;n<3;n++)this._matrix[t][n]=e}},{key:"get",value:function(e,t){return this._matrix[e][t]}},{key:"transpose",value:function(){var e=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=e,e=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=e,e=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=e,this}},{key:"matches",value:function(e){if(e.length!==9)throw new M("Should be length 9: "+e);for(var t=0;t<3;t++)for(var n=0;n<3;n++)if(!s.matches(this._matrix[t][n],e.charAt(3*t+n)))return!1;return!0}},{key:"add",value:function(e){for(var t=0;t<3;t++)for(var n=0;n<3;n++)this.setAtLeast(t,n,e.get(t,n))}},{key:"isDisjoint",value:function(){return this._matrix[I.INTERIOR][I.INTERIOR]===z.FALSE&&this._matrix[I.INTERIOR][I.BOUNDARY]===z.FALSE&&this._matrix[I.BOUNDARY][I.INTERIOR]===z.FALSE&&this._matrix[I.BOUNDARY][I.BOUNDARY]===z.FALSE}},{key:"isCrosses",value:function(e,t){return e===z.P&&t===z.L||e===z.P&&t===z.A||e===z.L&&t===z.A?s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&s.isTrue(this._matrix[I.INTERIOR][I.EXTERIOR]):e===z.L&&t===z.P||e===z.A&&t===z.P||e===z.A&&t===z.L?s.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&s.isTrue(this._matrix[I.EXTERIOR][I.INTERIOR]):e===z.L&&t===z.L&&this._matrix[I.INTERIOR][I.INTERIOR]===0}},{key:"interfaces_",get:function(){return[U]}}],[{key:"constructor_",value:function(){if(this._matrix=null,arguments.length===0)this._matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(z.FALSE);else if(arguments.length===1){if(typeof arguments[0]=="string"){var e=arguments[0];s.constructor_.call(this),this.set(e)}else if(arguments[0]instanceof s){var t=arguments[0];s.constructor_.call(this),this._matrix[I.INTERIOR][I.INTERIOR]=t._matrix[I.INTERIOR][I.INTERIOR],this._matrix[I.INTERIOR][I.BOUNDARY]=t._matrix[I.INTERIOR][I.BOUNDARY],this._matrix[I.INTERIOR][I.EXTERIOR]=t._matrix[I.INTERIOR][I.EXTERIOR],this._matrix[I.BOUNDARY][I.INTERIOR]=t._matrix[I.BOUNDARY][I.INTERIOR],this._matrix[I.BOUNDARY][I.BOUNDARY]=t._matrix[I.BOUNDARY][I.BOUNDARY],this._matrix[I.BOUNDARY][I.EXTERIOR]=t._matrix[I.BOUNDARY][I.EXTERIOR],this._matrix[I.EXTERIOR][I.INTERIOR]=t._matrix[I.EXTERIOR][I.INTERIOR],this._matrix[I.EXTERIOR][I.BOUNDARY]=t._matrix[I.EXTERIOR][I.BOUNDARY],this._matrix[I.EXTERIOR][I.EXTERIOR]=t._matrix[I.EXTERIOR][I.EXTERIOR]}}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&typeof arguments[1]=="string"){var e=arguments[0],t=arguments[1];return t===z.SYM_DONTCARE||t===z.SYM_TRUE&&(e>=0||e===z.TRUE)||t===z.SYM_FALSE&&e===z.FALSE||t===z.SYM_P&&e===z.P||t===z.SYM_L&&e===z.L||t===z.SYM_A&&e===z.A}if(typeof arguments[0]=="string"&&typeof arguments[1]=="string"){var n=arguments[0],i=arguments[1],u=new s(n);return u.matches(i)}}},{key:"isTrue",value:function(e){return e>=0||e===z.TRUE}}]),s}(),wd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(e){return e===null||e.length===0?null:(this.ensureCapacity(this._size+e.length),je.arraycopy(e,0,this._data,this._size,e.length),void(this._size+=e.length))}},{key:"ensureCapacity",value:function(e){if(e<=this._data.length)return null;var t=Math.max(e,2*this._data.length);this._data=Ut.copyOf(this._data,t)}},{key:"toArray",value:function(){var e=new Array(this._size).fill(null);return je.arraycopy(this._data,0,e,0,this._size),e}},{key:"add",value:function(e){this.ensureCapacity(this._size+1),this._data[this._size]=e,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,arguments.length===0)s.constructor_.call(this,10);else if(arguments.length===1){var e=arguments[0];this._data=new Array(e).fill(null)}}}]),s}(),bd=function(){function s(){a(this,s)}return c(s,[{key:"getChainStartIndices",value:function(e){var t=0,n=new wd(Math.trunc(e.length/2));n.add(t);do{var i=this.findChainEnd(e,t);n.add(i),t=i}while(t<e.length-1);return n.toArray()}},{key:"findChainEnd",value:function(e,t){for(var n=Pe.quadrant(e[t],e[t+1]),i=t+1;i<e.length&&Pe.quadrant(e[i-1],e[i])===n;)i++;return i-1}},{key:"OLDgetChainStartIndices",value:function(e){var t=0,n=new Z;n.add(t);do{var i=this.findChainEnd(e,t);n.add(i),t=i}while(t<e.length-1);return s.toIntArray(n)}}],[{key:"toIntArray",value:function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t}}]),s}(),Od=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getCoordinates",value:function(){return this.pts}},{key:"getMaxX",value:function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t>n?t:n}},{key:"getMinX",value:function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t<n?t:n}},{key:"computeIntersectsForChain",value:function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[n],t.startIndex[n+1],i)}else if(arguments.length===6){var u=arguments[0],f=arguments[1],g=arguments[2],y=arguments[3],d=arguments[4],w=arguments[5];if(f-u==1&&d-y==1)return w.addIntersections(this.e,u,g.e,y),null;if(!this.overlaps(u,f,g,y,d))return null;var b=Math.trunc((u+f)/2),L=Math.trunc((y+d)/2);u<b&&(y<L&&this.computeIntersectsForChain(u,b,g,y,L,w),L<d&&this.computeIntersectsForChain(u,b,g,L,d,w)),b<f&&(y<L&&this.computeIntersectsForChain(b,f,g,y,L,w),L<d&&this.computeIntersectsForChain(b,f,g,L,d,w))}}},{key:"overlaps",value:function(e,t,n,i,u){return pe.intersects(this.pts[e],this.pts[t],n.pts[i],n.pts[u])}},{key:"getStartIndexes",value:function(){return this.startIndex}},{key:"computeIntersects",value:function(e,t){for(var n=0;n<this.startIndex.length-1;n++)for(var i=0;i<e.startIndex.length-1;i++)this.computeIntersectsForChain(n,e,i,t)}}],[{key:"constructor_",value:function(){this.e=null,this.pts=null,this.startIndex=null;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new bd;this.startIndex=t.getChainStartIndices(this.pts)}}]),s}(),Sc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"getDepth",value:function(e,t){return this._depth[e][t]}},{key:"setDepth",value:function(e,t,n){this._depth[e][t]=n}},{key:"isNull",value:function(){if(arguments.length===0){for(var e=0;e<2;e++)for(var t=0;t<3;t++)if(this._depth[e][t]!==s.NULL_VALUE)return!1;return!0}if(arguments.length===1){var n=arguments[0];return this._depth[n][1]===s.NULL_VALUE}if(arguments.length===2){var i=arguments[0],u=arguments[1];return this._depth[i][u]===s.NULL_VALUE}}},{key:"normalize",value:function(){for(var e=0;e<2;e++)if(!this.isNull(e)){var t=this._depth[e][1];this._depth[e][2]<t&&(t=this._depth[e][2]),t<0&&(t=0);for(var n=1;n<3;n++){var i=0;this._depth[e][n]>t&&(i=1),this._depth[e][n]=i}}}},{key:"getDelta",value:function(e){return this._depth[e][G.RIGHT]-this._depth[e][G.LEFT]}},{key:"getLocation",value:function(e,t){return this._depth[e][t]<=0?I.EXTERIOR:I.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(arguments.length===1)for(var e=arguments[0],t=0;t<2;t++)for(var n=1;n<3;n++){var i=e.getLocation(t,n);i!==I.EXTERIOR&&i!==I.INTERIOR||(this.isNull(t,n)?this._depth[t][n]=s.depthAtLocation(i):this._depth[t][n]+=s.depthAtLocation(i))}else if(arguments.length===3){var u=arguments[0],f=arguments[1],g=arguments[2];g===I.INTERIOR&&this._depth[u][f]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var t=0;t<3;t++)this._depth[e][t]=s.NULL_VALUE}},{key:"depthAtLocation",value:function(e){return e===I.EXTERIOR?0:e===I.INTERIOR?1:s.NULL_VALUE}}]),s}();Sc.NULL_VALUE=-1;var Ic=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var n=new Array(2).fill(null);return n[0]=this.pts[0],n[1]=this.pts[1],new t(n,We.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(n){this._isIsolated=n}},{key:"setName",value:function(n){this._name=n}},{key:"equals",value:function(n){if(!(n instanceof t))return!1;var i=n;if(this.pts.length!==i.pts.length)return!1;for(var u=!0,f=!0,g=this.pts.length,y=0;y<this.pts.length;y++)if(this.pts[y].equals2D(i.pts[y])||(u=!1),this.pts[y].equals2D(i.pts[--g])||(f=!1),!u&&!f)return!1;return!0}},{key:"getCoordinate",value:function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}}},{key:"print",value:function(n){n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var i=0;i<this.pts.length;i++)i>0&&n.print(","),n.print(this.pts[i].x+" "+this.pts[i].y);n.print(") "+this._label+" "+this._depthDelta)}},{key:"computeIM",value:function(n){t.updateIM(this._label,n)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(n){n.print("edge "+this._name+": ");for(var i=this.pts.length-1;i>=0;i--)n.print(this.pts[i]+" ");n.println("")}},{key:"getMonotoneChainEdge",value:function(){return this._mce===null&&(this._mce=new Od(this)),this._mce}},{key:"getEnvelope",value:function(){if(this._env===null){this._env=new pe;for(var n=0;n<this.pts.length;n++)this._env.expandToInclude(this.pts[n])}return this._env}},{key:"addIntersection",value:function(n,i,u,f){var g=new O(n.getIntersection(f)),y=i,d=n.getEdgeDistance(u,f),w=y+1;if(w<this.pts.length){var b=this.pts[w];g.equals2D(b)&&(y=w,d=0)}this.eiList.add(g,y,d)}},{key:"toString",value:function(){var n=new si;n.append("edge "+this._name+": "),n.append("LINESTRING (");for(var i=0;i<this.pts.length;i++)i>0&&n.append(","),n.append(this.pts[i].x+" "+this.pts[i].y);return n.append(") "+this._label+" "+this._depthDelta),n.toString()}},{key:"isPointwiseEqual",value:function(n){if(this.pts.length!==n.pts.length)return!1;for(var i=0;i<this.pts.length;i++)if(!this.pts[i].equals2D(n.pts[i]))return!1;return!0}},{key:"setDepthDelta",value:function(n){this._depthDelta=n}},{key:"getEdgeIntersectionList",value:function(){return this.eiList}},{key:"addIntersections",value:function(n,i,u){for(var f=0;f<n.getIntersectionNum();f++)this.addIntersection(n,i,u,f)}}],[{key:"constructor_",value:function(){if(this.pts=null,this._env=null,this.eiList=new Id(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Sc,this._depthDelta=0,arguments.length===1){var n=arguments[0];t.constructor_.call(this,n,null)}else if(arguments.length===2){var i=arguments[0],u=arguments[1];this.pts=i,this._label=u}}},{key:"updateIM",value:function(){if(!(arguments.length===2&&arguments[1]instanceof Nd&&arguments[0]instanceof We))return N(v(t),"updateIM",this).apply(this,arguments);var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,G.ON),n.getLocation(1,G.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,G.LEFT),n.getLocation(1,G.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,G.RIGHT),n.getLocation(1,G.RIGHT),2))}}]),t}(ic),Nc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"setWorkingPrecisionModel",value:function(e){this._workingPrecisionModel=e}},{key:"insertUniqueEdge",value:function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var n=t.getLabel(),i=e.getLabel();t.isPointwiseEqual(e)||(i=new We(e.getLabel())).flip(),n.merge(i);var u=s.depthDelta(i),f=t.getDepthDelta()+u;t.setDepthDelta(f)}else this._edgeList.add(e),e.setDepthDelta(s.depthDelta(e.getLabel()))}},{key:"buildSubgraphs",value:function(e,t){for(var n=new Z,i=e.iterator();i.hasNext();){var u=i.next(),f=u.getRightmostCoordinate(),g=new dc(n).getDepth(f);u.computeDepth(g),u.findResultEdges(),n.add(u),t.add(u.getDirectedEdges(),u.getNodes())}}},{key:"createSubgraphs",value:function(e){for(var t=new Z,n=e.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var u=new Pm;u.create(i),t.add(u)}}return Sn.sort(t,Sn.reverseOrder()),t}},{key:"createEmptyResultGeometry",value:function(){return this._geomFact.createPolygon()}},{key:"getNoder",value:function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new Ks,n=new Vt;return n.setPrecisionModel(e),t.setSegmentIntersector(new kd(n)),t}},{key:"buffer",value:function(e,t){var n=this._workingPrecisionModel;n===null&&(n=e.getPrecisionModel()),this._geomFact=e.getFactory();var i=new hd(n,this._bufParams),u=new yd(e,t,i).getCurves();if(u.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(u,n),this._graph=new cc(new xd),this._graph.addEdges(this._edgeList.getEdges());var f=this.createSubgraphs(this._graph),g=new Km(this._geomFact);this.buildSubgraphs(f,g);var y=g.getPolygons();return y.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(y)}},{key:"computeNodedEdges",value:function(e,t){var n=this.getNoder(t);n.computeNodes(e);for(var i=n.getNodedSubstrings().iterator();i.hasNext();){var u=i.next(),f=u.getCoordinates();if(f.length!==2||!f[0].equals2D(f[1])){var g=u.getData(),y=new Ic(u.getCoordinates(),new We(g));this.insertUniqueEdge(y)}}}},{key:"setNoder",value:function(e){this._workingNoder=e}}],[{key:"constructor_",value:function(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ed;var e=arguments[0];this._bufParams=e}},{key:"depthDelta",value:function(e){var t=e.getLocation(0,G.LEFT),n=e.getLocation(0,G.RIGHT);return t===I.INTERIOR&&n===I.EXTERIOR?1:t===I.EXTERIOR&&n===I.INTERIOR?-1:0}},{key:"convertSegStrings",value:function(e){for(var t=new En,n=new Z;e.hasNext();){var i=e.next(),u=t.createLineString(i.getCoordinates());n.add(u)}return t.buildGeometry(n)}}]),s}(),Td=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"rescale",value:function(){if(re(arguments[0],ct))for(var e=arguments[0],t=e.iterator();t.hasNext();){var n=t.next();this.rescale(n.getCoordinates())}else if(arguments[0]instanceof Array){for(var i=arguments[0],u=0;u<i.length;u++)i[u].x=i[u].x/this._scaleFactor+this._offsetX,i[u].y=i[u].y/this._scaleFactor+this._offsetY;i.length===2&&i[0].equals2D(i[1])&&je.out.println(i)}}},{key:"scale",value:function(){if(re(arguments[0],ct)){for(var e=arguments[0],t=new Z(e.size()),n=e.iterator();n.hasNext();){var i=n.next();t.add(new Wt(this.scale(i.getCoordinates()),i.getData()))}return t}if(arguments[0]instanceof Array){for(var u=arguments[0],f=new Array(u.length).fill(null),g=0;g<u.length;g++)f[g]=new O(Math.round((u[g].x-this._offsetX)*this._scaleFactor),Math.round((u[g].y-this._offsetY)*this._scaleFactor),u[g].getZ());var y=Ee.removeRepeatedPoints(f);return y}}},{key:"isIntegerPrecision",value:function(){return this._scaleFactor===1}},{key:"getNodedSubstrings",value:function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e}},{key:"computeNodes",value:function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)}},{key:"interfaces_",get:function(){return[Qs]}}],[{key:"constructor_",value:function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var e=arguments[0],t=arguments[1];s.constructor_.call(this,e,t,0,0)}else if(arguments.length===4){var n=arguments[0],i=arguments[1];this._noder=n,this._scaleFactor=i,this._isScaled=!this.isIntegerPrecision()}}}]),s}(),wc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"checkEndPtVertexIntersections",value:function(){if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var t=e.next(),n=t.getCoordinates();this.checkEndPtVertexIntersections(n[0],this._segStrings),this.checkEndPtVertexIntersections(n[n.length-1],this._segStrings)}else if(arguments.length===2){for(var i=arguments[0],u=arguments[1],f=u.iterator();f.hasNext();)for(var g=f.next(),y=g.getCoordinates(),d=1;d<y.length-1;d++)if(y[d].equals(i))throw new we("found endpt/interior pt intersection at index "+d+" :pt "+i)}}},{key:"checkInteriorIntersections",value:function(){if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var t=e.next(),n=this._segStrings.iterator();n.hasNext();){var i=n.next();this.checkInteriorIntersections(t,i)}else if(arguments.length===2)for(var u=arguments[0],f=arguments[1],g=u.getCoordinates(),y=f.getCoordinates(),d=0;d<g.length-1;d++)for(var w=0;w<y.length-1;w++)this.checkInteriorIntersections(u,d,f,w);else if(arguments.length===4){var b=arguments[0],L=arguments[1],$=arguments[2],D=arguments[3];if(b===$&&L===D)return null;var V=b.getCoordinates()[L],H=b.getCoordinates()[L+1],K=$.getCoordinates()[D],ge=$.getCoordinates()[D+1];if(this._li.computeIntersection(V,H,K,ge),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,V,H)||this.hasInteriorIntersection(this._li,K,ge)))throw new we("found non-noded intersection at "+V+"-"+H+" and "+K+"-"+ge)}}},{key:"checkValid",value:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}},{key:"checkCollapses",value:function(){if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var t=e.next();this.checkCollapses(t)}else if(arguments.length===1)for(var n=arguments[0],i=n.getCoordinates(),u=0;u<i.length-2;u++)this.checkCollapse(i[u],i[u+1],i[u+2])}},{key:"hasInteriorIntersection",value:function(e,t,n){for(var i=0;i<e.getIntersectionNum();i++){var u=e.getIntersection(i);if(!u.equals(t)&&!u.equals(n))return!0}return!1}},{key:"checkCollapse",value:function(e,t,n){if(e.equals(n))throw new we("found non-noded collapse at "+s.fact.createLineString([e,t,n]))}}],[{key:"constructor_",value:function(){this._li=new Vt,this._segStrings=null;var e=arguments[0];this._segStrings=e}}]),s}();wc.fact=new En;var ta=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"intersectsScaled",value:function(e,t){var n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),u=Math.min(e.y,t.y),f=Math.max(e.y,t.y),g=this._maxx<n||this._minx>i||this._maxy<u||this._miny>f;if(g)return!1;var y=this.intersectsToleranceSquare(e,t);return se.isTrue(!(g&&y),"Found bad envelope test"),y}},{key:"initCorners",value:function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new O(this._maxx,this._maxy),this._corner[1]=new O(this._minx,this._maxy),this._corner[2]=new O(this._minx,this._miny),this._corner[3]=new O(this._maxx,this._miny)}},{key:"intersects",value:function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}},{key:"scale",value:function(e){return Math.round(e*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)}},{key:"getSafeEnvelope",value:function(){if(this._safeEnv===null){var e=s.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new pe(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv}},{key:"intersectsPixelClosure",value:function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))}},{key:"intersectsToleranceSquare",value:function(e,t){var n=!1,i=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!n||!i)||!!e.equals(this._pt)||!!t.equals(this._pt))))}},{key:"addSnappedNode",value:function(e,t){var n=e.getCoordinate(t),i=e.getCoordinate(t+1);return!!this.intersects(n,i)&&(e.addIntersection(this.getCoordinate(),t),!0)}}],[{key:"constructor_",value:function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var e=arguments[0],t=arguments[1],n=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=n,t<=0)throw new M("Scale factor must be non-zero");t!==1&&(this._pt=new O(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new O,this._p1Scaled=new O),this.initCorners(this._pt)}}]),s}();ta.SAFE_ENV_EXPANSION_FACTOR=.75;var Ld=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"select",value:function(){if(arguments.length!==1){if(arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}}],[{key:"constructor_",value:function(){this.selectedSegment=new Ge}}]),s}(),bc=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"snap",value:function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],u=t.getSafeEnvelope(),f=new Oc(t,n,i);return this._index.query(u,new(function(){function g(){a(this,g)}return c(g,[{key:"interfaces_",get:function(){return[hc]}},{key:"visitItem",value:function(y){y.select(u,f)}}]),g}())),f.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var e=arguments[0];this._index=e}}]),s}(),Oc=function(s){h(t,s);var e=E(t);function t(){var n;return a(this,t),n=e.call(this),t.constructor_.apply(m(n),arguments),n}return c(t,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(arguments.length===2&&Number.isInteger(arguments[1])&&arguments[0]instanceof yc))return N(v(t.prototype),"select",this).apply(this,arguments);var n=arguments[0],i=arguments[1],u=n.getContext();if(this._parentEdge===u&&(i===this._hotPixelVertexIndex||i+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(u,i)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],i=arguments[1],u=arguments[2];this._hotPixel=n,this._parentEdge=i,this._hotPixelVertexIndex=u}}]),t}(Ld);bc.HotPixelSnapAction=Oc;var Rd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"processIntersections",value:function(e,t,n,i){if(e===n&&t===i)return null;var u=e.getCoordinates()[t],f=e.getCoordinates()[t+1],g=n.getCoordinates()[i],y=n.getCoordinates()[i+1];if(this._li.computeIntersection(u,f,g,y),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var d=0;d<this._li.getIntersectionNum();d++)this._interiorIntersections.add(this._li.getIntersection(d));e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1)}}},{key:"isDone",value:function(){return!1}},{key:"getInteriorIntersections",value:function(){return this._interiorIntersections}},{key:"interfaces_",get:function(){return[kc]}}],[{key:"constructor_",value:function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new Z}}]),s}(),Cd=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"checkCorrectness",value:function(e){var t=Wt.getNodedSubstrings(e),n=new wc(t);try{n.checkValid()}catch(i){if(!(i instanceof F))throw i;i.printStackTrace()}}},{key:"getNodedSubstrings",value:function(){return Wt.getNodedSubstrings(this._nodedSegStrings)}},{key:"snapRound",value:function(e,t){var n=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(n),this.computeVertexSnaps(e)}},{key:"findInteriorIntersections",value:function(e,t){var n=new Rd(t);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(e),n.getInteriorIntersections()}},{key:"computeVertexSnaps",value:function(){if(re(arguments[0],ct))for(var e=arguments[0],t=e.iterator();t.hasNext();){var n=t.next();this.computeVertexSnaps(n)}else if(arguments[0]instanceof Wt)for(var i=arguments[0],u=i.getCoordinates(),f=0;f<u.length;f++){var g=new ta(u[f],this._scaleFactor,this._li),y=this._pointSnapper.snap(g,i,f);y&&i.addIntersection(u[f],f)}}},{key:"computeNodes",value:function(e){this._nodedSegStrings=e,this._noder=new Ks,this._pointSnapper=new bc(this._noder.getIndex()),this.snapRound(e,this._li)}},{key:"computeIntersectionSnaps",value:function(e){for(var t=e.iterator();t.hasNext();){var n=t.next(),i=new ta(n,this._scaleFactor,this._li);this._pointSnapper.snap(i)}}},{key:"interfaces_",get:function(){return[Qs]}}],[{key:"constructor_",value:function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new Vt,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()}}]),s}(),wn=function(){function s(){a(this,s),s.constructor_.apply(this,arguments)}return c(s,[{key:"bufferFixedPrecision",value:function(e){var t=new Td(new Cd(new et(1)),e.getScale()),n=new Nc(this._bufParams);n.setWorkingPrecisionModel(e),n.setNoder(t),this._resultGeometry=n.buffer(this._argGeom,this._distance)}},{key:"bufferReducedPrecision",value:function(){if(arguments.length===0){for(var e=s.MAX_PRECISION_DIGITS;e>=0;e--){try{this.bufferReducedPrecision(e)}catch(u){if(!(u instanceof _t))throw u;this._saveException=u}if(this._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var t=arguments[0],n=s.precisionScaleFactor(this._argGeom,this._distance,t),i=new et(n);this.bufferFixedPrecision(i)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===et.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(e){this._bufParams.setQuadrantSegments(e)}},{key:"bufferOriginalPrecision",value:function(){try{var e=new Nc(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof we))throw t;this._saveException=t}}},{key:"getResultGeometry",value:function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(e){this._bufParams.setEndCapStyle(e)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new C,this._resultGeometry=null,this._saveException=null,arguments.length===1){var e=arguments[0];this._argGeom=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._argGeom=t,this._bufParams=n}}},{key:"bufferOp",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new s(e),i=n.getResultGeometry(t);return i}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof W&&typeof arguments[1]=="number"){var u=arguments[0],f=arguments[1],g=arguments[2],y=new s(u);y.setQuadrantSegments(g);var d=y.getResultGeometry(f);return d}if(arguments[2]instanceof C&&arguments[0]instanceof W&&typeof arguments[1]=="number"){var w=arguments[0],b=arguments[1],L=arguments[2],$=new s(w,L),D=$.getResultGeometry(b);return D}}else if(arguments.length===4){var V=arguments[0],H=arguments[1],K=arguments[2],ge=arguments[3],xe=new s(V);xe.setQuadrantSegments(K),xe.setEndCapStyle(ge);var Le=xe.getResultGeometry(H);return Le}}},{key:"precisionScaleFactor",value:function(e,t,n){var i=e.getEnvelopeInternal(),u=Wn.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY()))+2*(t>0?t:0),f=n-Math.trunc(Math.log(u)/Math.log(10)+1);return Math.pow(10,f)}}]),s}();wn.CAP_ROUND=C.CAP_ROUND,wn.CAP_BUTT=C.CAP_FLAT,wn.CAP_FLAT=C.CAP_FLAT,wn.CAP_SQUARE=C.CAP_SQUARE,wn.MAX_PRECISION_DIGITS=12;var Pd=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Tc=function(){function s(e){a(this,s),this.geometryFactory=e||new En}return c(s,[{key:"read",value:function(e){var t,n=(t=typeof e=="string"?JSON.parse(e):e).type;if(!Ze[n])throw new Error("Unknown GeoJSON type: "+t.type);return Pd.indexOf(n)!==-1?Ze[n].call(this,t.coordinates):n==="GeometryCollection"?Ze[n].call(this,t.geometries):Ze[n].call(this,t)}},{key:"write",value:function(e){var t=e.getGeometryType();if(!yt[t])throw new Error("Geometry is not supported");return yt[t].call(this,e)}}]),s}(),Ze={Feature:function(s){var e={};for(var t in s)e[t]=s[t];if(s.geometry){var n=s.geometry.type;if(!Ze[n])throw new Error("Unknown GeoJSON type: "+s.type);e.geometry=this.read(s.geometry)}return s.bbox&&(e.bbox=Ze.bbox.call(this,s.bbox)),e},FeatureCollection:function(s){var e={};if(s.features){e.features=[];for(var t=0;t<s.features.length;++t)e.features.push(this.read(s.features[t]))}return s.bbox&&(e.bbox=this.parse.bbox.call(this,s.bbox)),e},coordinates:function(s){for(var e=[],t=0;t<s.length;++t){var n=s[t];e.push(x(O,T(n)))}return e},bbox:function(s){return this.geometryFactory.createLinearRing([new O(s[0],s[1]),new O(s[2],s[1]),new O(s[2],s[3]),new O(s[0],s[3]),new O(s[0],s[1])])},Point:function(s){var e=x(O,T(s));return this.geometryFactory.createPoint(e)},MultiPoint:function(s){for(var e=[],t=0;t<s.length;++t)e.push(Ze.Point.call(this,s[t]));return this.geometryFactory.createMultiPoint(e)},LineString:function(s){var e=Ze.coordinates.call(this,s);return this.geometryFactory.createLineString(e)},MultiLineString:function(s){for(var e=[],t=0;t<s.length;++t)e.push(Ze.LineString.call(this,s[t]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(s){for(var e=Ze.coordinates.call(this,s[0]),t=this.geometryFactory.createLinearRing(e),n=[],i=1;i<s.length;++i){var u=s[i],f=Ze.coordinates.call(this,u),g=this.geometryFactory.createLinearRing(f);n.push(g)}return this.geometryFactory.createPolygon(t,n)},MultiPolygon:function(s){for(var e=[],t=0;t<s.length;++t){var n=s[t];e.push(Ze.Polygon.call(this,n))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(s){for(var e=[],t=0;t<s.length;++t){var n=s[t];e.push(this.read(n))}return this.geometryFactory.createGeometryCollection(e)}},yt={coordinate:function(s){var e=[s.x,s.y];return s.z&&e.push(s.z),s.m&&e.push(s.m),e},Point:function(s){return{type:"Point",coordinates:yt.coordinate.call(this,s.getCoordinate())}},MultiPoint:function(s){for(var e=[],t=0;t<s._geometries.length;++t){var n=s._geometries[t],i=yt.Point.call(this,n);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(s){for(var e=[],t=s.getCoordinates(),n=0;n<t.length;++n){var i=t[n];e.push(yt.coordinate.call(this,i))}return{type:"LineString",coordinates:e}},MultiLineString:function(s){for(var e=[],t=0;t<s._geometries.length;++t){var n=s._geometries[t],i=yt.LineString.call(this,n);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(s){var e=[],t=yt.LineString.call(this,s._shell);e.push(t.coordinates);for(var n=0;n<s._holes.length;++n){var i=s._holes[n],u=yt.LineString.call(this,i);e.push(u.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(s){for(var e=[],t=0;t<s._geometries.length;++t){var n=s._geometries[t],i=yt.Polygon.call(this,n);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(s){for(var e=[],t=0;t<s._geometries.length;++t){var n=s._geometries[t],i=n.getGeometryType();e.push(yt[i].call(this,n))}return{type:"GeometryCollection",geometries:e}}};return{BufferOp:wn,GeoJSONReader:function(){function s(e){a(this,s),this.parser=new Tc(e||new En)}return c(s,[{key:"read",value:function(e){return this.parser.read(e)}}]),s}(),GeoJSONWriter:function(){function s(){a(this,s),this.parser=new Tc(this.geometryFactory)}return c(s,[{key:"write",value:function(e){return this.parser.write(e)}}]),s}()}})})(ol);var Up=ol.exports;const Xp=sa(Up);function Ct(){return new qr}function qr(){this.reset()}qr.prototype={constructor:qr,reset:function(){this.s=this.t=0},add:function(o){ul(zr,o,this.t),ul(this,zr.s,this.s),this.s?this.t+=zr.t:this.s=zr.t},valueOf:function(){return this.s}};var zr=new qr;function ul(o,r,a){var l=o.s=r+a,c=l-r,h=l-c;o.t=r-h+(a-c)}var ye=1e-6,ce=Math.PI,ut=ce/2,ll=ce/4,lt=ce*2,Pt=180/ce,Xe=ce/180,Se=Math.abs,jp=Math.atan,vn=Math.atan2,de=Math.cos,_e=Math.sin,pn=Math.sqrt;function cl(o){return o>1?0:o<-1?ce:Math.acos(o)}function qt(o){return o>1?ut:o<-1?-ut:Math.asin(o)}function Yn(){}function Yr(o,r){o&&hl.hasOwnProperty(o.type)&&hl[o.type](o,r)}var fl={Feature:function(o,r){Yr(o.geometry,r)},FeatureCollection:function(o,r){for(var a=o.features,l=-1,c=a.length;++l<c;)Yr(a[l].geometry,r)}},hl={Sphere:function(o,r){r.sphere()},Point:function(o,r){o=o.coordinates,r.point(o[0],o[1],o[2])},MultiPoint:function(o,r){for(var a=o.coordinates,l=-1,c=a.length;++l<c;)o=a[l],r.point(o[0],o[1],o[2])},LineString:function(o,r){bs(o.coordinates,r,0)},MultiLineString:function(o,r){for(var a=o.coordinates,l=-1,c=a.length;++l<c;)bs(a[l],r,0)},Polygon:function(o,r){gl(o.coordinates,r)},MultiPolygon:function(o,r){for(var a=o.coordinates,l=-1,c=a.length;++l<c;)gl(a[l],r)},GeometryCollection:function(o,r){for(var a=o.geometries,l=-1,c=a.length;++l<c;)Yr(a[l],r)}};function bs(o,r,a){var l=-1,c=o.length-a,h;for(r.lineStart();++l<c;)h=o[l],r.point(h[0],h[1],h[2]);r.lineEnd()}function gl(o,r){var a=-1,l=o.length;for(r.polygonStart();++a<l;)bs(o[a],r,1);r.polygonEnd()}function Vp(o,r){o&&fl.hasOwnProperty(o.type)?fl[o.type](o,r):Yr(o,r)}Ct(),Ct();function Os(o){return[vn(o[1],o[0]),qt(o[2])]}function mn(o){var r=o[0],a=o[1],l=de(a);return[l*de(r),l*_e(r),_e(a)]}function Ur(o,r){return o[0]*r[0]+o[1]*r[1]+o[2]*r[2]}function Xr(o,r){return[o[1]*r[2]-o[2]*r[1],o[2]*r[0]-o[0]*r[2],o[0]*r[1]-o[1]*r[0]]}function Ts(o,r){o[0]+=r[0],o[1]+=r[1],o[2]+=r[2]}function jr(o,r){return[o[0]*r,o[1]*r,o[2]*r]}function Ls(o){var r=pn(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);o[0]/=r,o[1]/=r,o[2]/=r}Ct();function yl(o,r){function a(l,c){return l=o(l,c),r(l[0],l[1])}return o.invert&&r.invert&&(a.invert=function(l,c){return l=r.invert(l,c),l&&o.invert(l[0],l[1])}),a}function Rs(o,r){return[o>ce?o-lt:o<-ce?o+lt:o,r]}Rs.invert=Rs;function Wp(o,r,a){return(o%=lt)?r||a?yl(pl(o),ml(r,a)):pl(o):r||a?ml(r,a):Rs}function vl(o){return function(r,a){return r+=o,[r>ce?r-lt:r<-ce?r+lt:r,a]}}function pl(o){var r=vl(o);return r.invert=vl(-o),r}function ml(o,r){var a=de(o),l=_e(o),c=de(r),h=_e(r);function v(p,_){var x=de(_),S=de(p)*x,m=_e(p)*x,k=_e(_),E=k*a+S*l;return[vn(m*c-E*h,S*a-k*l),qt(E*c+m*h)]}return v.invert=function(p,_){var x=de(_),S=de(p)*x,m=_e(p)*x,k=_e(_),E=k*c-m*h;return[vn(m*c+k*h,S*a+E*l),qt(E*a-S*l)]},v}function Hp(o,r,a,l,c,h){if(a){var v=de(r),p=_e(r),_=l*a;c==null?(c=r+l*lt,h=r-_/2):(c=dl(v,c),h=dl(v,h),(l>0?c<h:c>h)&&(c+=l*lt));for(var x,S=c;l>0?S>h:S<h;S-=_)x=Os([v,-p*de(S),-p*_e(S)]),o.point(x[0],x[1])}}function dl(o,r){r=mn(r),r[0]-=o,Ls(r);var a=cl(-r[1]);return((-r[2]<0?-a:a)+lt-ye)%lt}function _l(){var o=[],r;return{point:function(a,l){r.push([a,l])},lineStart:function(){o.push(r=[])},lineEnd:Yn,rejoin:function(){o.length>1&&o.push(o.pop().concat(o.shift()))},result:function(){var a=o;return o=[],r=null,a}}}function Zp(o,r,a,l,c,h){var v=o[0],p=o[1],_=r[0],x=r[1],S=0,m=1,k=_-v,E=x-p,N;if(N=a-v,!(!k&&N>0)){if(N/=k,k<0){if(N<S)return;N<m&&(m=N)}else if(k>0){if(N>m)return;N>S&&(S=N)}if(N=c-v,!(!k&&N<0)){if(N/=k,k<0){if(N>m)return;N>S&&(S=N)}else if(k>0){if(N<S)return;N<m&&(m=N)}if(N=l-p,!(!E&&N>0)){if(N/=E,E<0){if(N<S)return;N<m&&(m=N)}else if(E>0){if(N>m)return;N>S&&(S=N)}if(N=h-p,!(!E&&N<0)){if(N/=E,E<0){if(N>m)return;N>S&&(S=N)}else if(E>0){if(N<S)return;N<m&&(m=N)}return S>0&&(o[0]=v+S*k,o[1]=p+S*E),m<1&&(r[0]=v+m*k,r[1]=p+m*E),!0}}}}}function Vr(o,r){return Se(o[0]-r[0])<ye&&Se(o[1]-r[1])<ye}function Wr(o,r,a,l){this.x=o,this.z=r,this.o=a,this.e=l,this.v=!1,this.n=this.p=null}function xl(o,r,a,l,c){var h=[],v=[],p,_;if(o.forEach(function(N){if(!((T=N.length-1)<=0)){var T,R=N[0],A=N[T],P;if(Vr(R,A)){for(c.lineStart(),p=0;p<T;++p)c.point((R=N[p])[0],R[1]);c.lineEnd();return}h.push(P=new Wr(R,N,null,!0)),v.push(P.o=new Wr(R,null,P,!1)),h.push(P=new Wr(A,N,null,!1)),v.push(P.o=new Wr(A,null,P,!0))}}),!!h.length){for(v.sort(r),El(h),El(v),p=0,_=v.length;p<_;++p)v[p].e=a=!a;for(var x=h[0],S,m;;){for(var k=x,E=!0;k.v;)if((k=k.n)===x)return;S=k.z,c.lineStart();do{if(k.v=k.o.v=!0,k.e){if(E)for(p=0,_=S.length;p<_;++p)c.point((m=S[p])[0],m[1]);else l(k.x,k.n.x,1,c);k=k.n}else{if(E)for(S=k.p.z,p=S.length-1;p>=0;--p)c.point((m=S[p])[0],m[1]);else l(k.x,k.p.x,-1,c);k=k.p}k=k.o,S=k.z,E=!E}while(!k.v);c.lineEnd()}}}function El(o){if(r=o.length){for(var r,a=0,l=o[0],c;++a<r;)l.n=c=o[a],c.p=l,l=c;l.n=c=o[0],c.p=l}}function kl(o,r){return o<r?-1:o>r?1:o>=r?0:NaN}function Jp(o){return o.length===1&&(o=Qp(o)),{left:function(r,a,l,c){for(l==null&&(l=0),c==null&&(c=r.length);l<c;){var h=l+c>>>1;o(r[h],a)<0?l=h+1:c=h}return l},right:function(r,a,l,c){for(l==null&&(l=0),c==null&&(c=r.length);l<c;){var h=l+c>>>1;o(r[h],a)>0?c=h:l=h+1}return l}}}function Qp(o){return function(r,a){return kl(o(r),a)}}Jp(kl);function Sl(o){for(var r=o.length,a,l=-1,c=0,h,v;++l<r;)c+=o[l].length;for(h=new Array(c);--r>=0;)for(v=o[r],a=v.length;--a>=0;)h[--c]=v[a];return h}var Un=1e9,Hr=-Un;function Kp(o,r,a,l){function c(x,S){return o<=x&&x<=a&&r<=S&&S<=l}function h(x,S,m,k){var E=0,N=0;if(x==null||(E=v(x,m))!==(N=v(S,m))||_(x,S)<0^m>0)do k.point(E===0||E===3?o:a,E>1?l:r);while((E=(E+m+4)%4)!==N);else k.point(S[0],S[1])}function v(x,S){return Se(x[0]-o)<ye?S>0?0:3:Se(x[0]-a)<ye?S>0?2:1:Se(x[1]-r)<ye?S>0?1:0:S>0?3:2}function p(x,S){return _(x.x,S.x)}function _(x,S){var m=v(x,1),k=v(S,1);return m!==k?m-k:m===0?S[1]-x[1]:m===1?x[0]-S[0]:m===2?x[1]-S[1]:S[0]-x[0]}return function(x){var S=x,m=_l(),k,E,N,T,R,A,P,C,F,M,B,Y={point:U,lineStart:te,lineEnd:ae,polygonStart:ie,polygonEnd:ee};function U(ne,ue){c(ne,ue)&&S.point(ne,ue)}function X(){for(var ne=0,ue=0,ve=E.length;ue<ve;++ue)for(var Ie=E[ue],Ne=1,j=Ie.length,Ce=Ie[0],we,Me,se=Ce[0],dt=Ce[1];Ne<j;++Ne)we=se,Me=dt,Ce=Ie[Ne],se=Ce[0],dt=Ce[1],Me<=l?dt>l&&(se-we)*(l-Me)>(dt-Me)*(o-we)&&++ne:dt<=l&&(se-we)*(l-Me)<(dt-Me)*(o-we)&&--ne;return ne}function ie(){S=m,k=[],E=[],B=!0}function ee(){var ne=X(),ue=B&&ne,ve=(k=Sl(k)).length;(ue||ve)&&(x.polygonStart(),ue&&(x.lineStart(),h(null,null,1,x),x.lineEnd()),ve&&xl(k,p,ne,h,x),x.polygonEnd()),S=x,k=E=N=null}function te(){Y.point=q,E&&E.push(N=[]),M=!0,F=!1,P=C=NaN}function ae(){k&&(q(T,R),A&&F&&m.rejoin(),k.push(m.result())),Y.point=U,F&&S.lineEnd()}function q(ne,ue){var ve=c(ne,ue);if(E&&N.push([ne,ue]),M)T=ne,R=ue,A=ve,M=!1,ve&&(S.lineStart(),S.point(ne,ue));else if(ve&&F)S.point(ne,ue);else{var Ie=[P=Math.max(Hr,Math.min(Un,P)),C=Math.max(Hr,Math.min(Un,C))],Ne=[ne=Math.max(Hr,Math.min(Un,ne)),ue=Math.max(Hr,Math.min(Un,ue))];Zp(Ie,Ne,o,r,a,l)?(F||(S.lineStart(),S.point(Ie[0],Ie[1])),S.point(Ne[0],Ne[1]),ve||S.lineEnd(),B=!1):ve&&(S.lineStart(),S.point(ne,ue),B=!1)}P=ne,C=ue,F=ve}return Y}}var Cs=Ct();function em(o,r){var a=r[0],l=r[1],c=[_e(a),-de(a),0],h=0,v=0;Cs.reset();for(var p=0,_=o.length;p<_;++p)if(S=(x=o[p]).length)for(var x,S,m=x[S-1],k=m[0],E=m[1]/2+ll,N=_e(E),T=de(E),R=0;R<S;++R,k=P,N=F,T=M,m=A){var A=x[R],P=A[0],C=A[1]/2+ll,F=_e(C),M=de(C),B=P-k,Y=B>=0?1:-1,U=Y*B,X=U>ce,ie=N*F;if(Cs.add(vn(ie*Y*_e(U),T*M+ie*de(U))),h+=X?B+Y*lt:B,X^k>=a^P>=a){var ee=Xr(mn(m),mn(A));Ls(ee);var te=Xr(c,ee);Ls(te);var ae=(X^B>=0?-1:1)*qt(te[2]);(l>ae||l===ae&&(ee[0]||ee[1]))&&(v+=X^B>=0?1:-1)}}return(h<-ye||h<ye&&Cs<-ye)^v&1}Ct();function Il(o){return o}Ct(),Ct();var dn=1/0,Zr=dn,Xn=-dn,Jr=Xn,Nl={point:tm,lineStart:Yn,lineEnd:Yn,polygonStart:Yn,polygonEnd:Yn,result:function(){var o=[[dn,Zr],[Xn,Jr]];return Xn=Jr=-(Zr=dn=1/0),o}};function tm(o,r){o<dn&&(dn=o),o>Xn&&(Xn=o),r<Zr&&(Zr=r),r>Jr&&(Jr=r)}Ct();function wl(o,r,a,l){return function(c,h){var v=r(h),p=c.invert(l[0],l[1]),_=_l(),x=r(_),S=!1,m,k,E,N={point:T,lineStart:A,lineEnd:P,polygonStart:function(){N.point=C,N.lineStart=F,N.lineEnd=M,k=[],m=[]},polygonEnd:function(){N.point=T,N.lineStart=A,N.lineEnd=P,k=Sl(k);var B=em(m,p);k.length?(S||(h.polygonStart(),S=!0),xl(k,rm,B,a,h)):B&&(S||(h.polygonStart(),S=!0),h.lineStart(),a(null,null,1,h),h.lineEnd()),S&&(h.polygonEnd(),S=!1),k=m=null},sphere:function(){h.polygonStart(),h.lineStart(),a(null,null,1,h),h.lineEnd(),h.polygonEnd()}};function T(B,Y){var U=c(B,Y);o(B=U[0],Y=U[1])&&h.point(B,Y)}function R(B,Y){var U=c(B,Y);v.point(U[0],U[1])}function A(){N.point=R,v.lineStart()}function P(){N.point=T,v.lineEnd()}function C(B,Y){E.push([B,Y]);var U=c(B,Y);x.point(U[0],U[1])}function F(){x.lineStart(),E=[]}function M(){C(E[0][0],E[0][1]),x.lineEnd();var B=x.clean(),Y=_.result(),U,X=Y.length,ie,ee,te;if(E.pop(),m.push(E),E=null,!!X){if(B&1){if(ee=Y[0],(ie=ee.length-1)>0){for(S||(h.polygonStart(),S=!0),h.lineStart(),U=0;U<ie;++U)h.point((te=ee[U])[0],te[1]);h.lineEnd()}return}X>1&&B&2&&Y.push(Y.pop().concat(Y.shift())),k.push(Y.filter(nm))}}return N}}function nm(o){return o.length>1}function rm(o,r){return((o=o.x)[0]<0?o[1]-ut-ye:ut-o[1])-((r=r.x)[0]<0?r[1]-ut-ye:ut-r[1])}const bl=wl(function(){return!0},im,am,[-ce,-ut]);function im(o){var r=NaN,a=NaN,l=NaN,c;return{lineStart:function(){o.lineStart(),c=1},point:function(h,v){var p=h>0?ce:-ce,_=Se(h-r);Se(_-ce)<ye?(o.point(r,a=(a+v)/2>0?ut:-ut),o.point(l,a),o.lineEnd(),o.lineStart(),o.point(p,a),o.point(h,a),c=0):l!==p&&_>=ce&&(Se(r-l)<ye&&(r-=l*ye),Se(h-p)<ye&&(h-=p*ye),a=sm(r,a,h,v),o.point(l,a),o.lineEnd(),o.lineStart(),o.point(p,a),c=0),o.point(r=h,a=v),l=p},lineEnd:function(){o.lineEnd(),r=a=NaN},clean:function(){return 2-c}}}function sm(o,r,a,l){var c,h,v=_e(o-a);return Se(v)>ye?jp((_e(r)*(h=de(l))*_e(a)-_e(l)*(c=de(r))*_e(o))/(c*h*v)):(r+l)/2}function am(o,r,a,l){var c;if(o==null)c=a*ut,l.point(-ce,c),l.point(0,c),l.point(ce,c),l.point(ce,0),l.point(ce,-c),l.point(0,-c),l.point(-ce,-c),l.point(-ce,0),l.point(-ce,c);else if(Se(o[0]-r[0])>ye){var h=o[0]<r[0]?ce:-ce;c=a*h/2,l.point(-h,c),l.point(0,c),l.point(h,c)}else l.point(r[0],r[1])}function om(o,r){var a=de(o),l=a>0,c=Se(a)>ye;function h(S,m,k,E){Hp(E,o,r,k,S,m)}function v(S,m){return de(S)*de(m)>a}function p(S){var m,k,E,N,T;return{lineStart:function(){N=E=!1,T=1},point:function(R,A){var P=[R,A],C,F=v(R,A),M=l?F?0:x(R,A):F?x(R+(R<0?ce:-ce),A):0;if(!m&&(N=E=F)&&S.lineStart(),F!==E&&(C=_(m,P),(!C||Vr(m,C)||Vr(P,C))&&(P[0]+=ye,P[1]+=ye,F=v(P[0],P[1]))),F!==E)T=0,F?(S.lineStart(),C=_(P,m),S.point(C[0],C[1])):(C=_(m,P),S.point(C[0],C[1]),S.lineEnd()),m=C;else if(c&&m&&l^F){var B;!(M&k)&&(B=_(P,m,!0))&&(T=0,l?(S.lineStart(),S.point(B[0][0],B[0][1]),S.point(B[1][0],B[1][1]),S.lineEnd()):(S.point(B[1][0],B[1][1]),S.lineEnd(),S.lineStart(),S.point(B[0][0],B[0][1])))}F&&(!m||!Vr(m,P))&&S.point(P[0],P[1]),m=P,E=F,k=M},lineEnd:function(){E&&S.lineEnd(),m=null},clean:function(){return T|(N&&E)<<1}}}function _(S,m,k){var E=mn(S),N=mn(m),T=[1,0,0],R=Xr(E,N),A=Ur(R,R),P=R[0],C=A-P*P;if(!C)return!k&&S;var F=a*A/C,M=-a*P/C,B=Xr(T,R),Y=jr(T,F),U=jr(R,M);Ts(Y,U);var X=B,ie=Ur(Y,X),ee=Ur(X,X),te=ie*ie-ee*(Ur(Y,Y)-1);if(!(te<0)){var ae=pn(te),q=jr(X,(-ie-ae)/ee);if(Ts(q,Y),q=Os(q),!k)return q;var ne=S[0],ue=m[0],ve=S[1],Ie=m[1],Ne;ue<ne&&(Ne=ne,ne=ue,ue=Ne);var j=ue-ne,Ce=Se(j-ce)<ye,we=Ce||j<ye;if(!Ce&&Ie<ve&&(Ne=ve,ve=Ie,Ie=Ne),we?Ce?ve+Ie>0^q[1]<(Se(q[0]-ne)<ye?ve:Ie):ve<=q[1]&&q[1]<=Ie:j>ce^(ne<=q[0]&&q[0]<=ue)){var Me=jr(X,(-ie+ae)/ee);return Ts(Me,Y),[q,Os(Me)]}}}function x(S,m){var k=l?o:ce-o,E=0;return S<-k?E|=1:S>k&&(E|=2),m<-k?E|=4:m>k&&(E|=8),E}return wl(v,p,h,l?[0,-o]:[-ce,o-ce])}function Ol(o){return function(r){var a=new Ps;for(var l in o)a[l]=o[l];return a.stream=r,a}}function Ps(){}Ps.prototype={constructor:Ps,point:function(o,r){this.stream.point(o,r)},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 Tl(o,r,a){var l=r[1][0]-r[0][0],c=r[1][1]-r[0][1],h=o.clipExtent&&o.clipExtent();o.scale(150).translate([0,0]),h!=null&&o.clipExtent(null),Vp(a,o.stream(Nl));var v=Nl.result(),p=Math.min(l/(v[1][0]-v[0][0]),c/(v[1][1]-v[0][1])),_=+r[0][0]+(l-p*(v[1][0]+v[0][0]))/2,x=+r[0][1]+(c-p*(v[1][1]+v[0][1]))/2;return h!=null&&o.clipExtent(h),o.scale(p*150).translate([_,x])}function um(o,r,a){return Tl(o,[[0,0],r],a)}var Ll=16,lm=de(30*Xe);function Rl(o,r){return+r?fm(o,r):cm(o)}function cm(o){return Ol({point:function(r,a){r=o(r,a),this.stream.point(r[0],r[1])}})}function fm(o,r){function a(l,c,h,v,p,_,x,S,m,k,E,N,T,R){var A=x-l,P=S-c,C=A*A+P*P;if(C>4*r&&T--){var F=v+k,M=p+E,B=_+N,Y=pn(F*F+M*M+B*B),U=qt(B/=Y),X=Se(Se(B)-1)<ye||Se(h-m)<ye?(h+m)/2:vn(M,F),ie=o(X,U),ee=ie[0],te=ie[1],ae=ee-l,q=te-c,ne=P*ae-A*q;(ne*ne/C>r||Se((A*ae+P*q)/C-.5)>.3||v*k+p*E+_*N<lm)&&(a(l,c,h,v,p,_,ee,te,X,F/=Y,M/=Y,B,T,R),R.point(ee,te),a(ee,te,X,F,M,B,x,S,m,k,E,N,T,R))}}return function(l){var c,h,v,p,_,x,S,m,k,E,N,T,R={point:A,lineStart:P,lineEnd:F,polygonStart:function(){l.polygonStart(),R.lineStart=M},polygonEnd:function(){l.polygonEnd(),R.lineStart=P}};function A(U,X){U=o(U,X),l.point(U[0],U[1])}function P(){m=NaN,R.point=C,l.lineStart()}function C(U,X){var ie=mn([U,X]),ee=o(U,X);a(m,k,S,E,N,T,m=ee[0],k=ee[1],S=U,E=ie[0],N=ie[1],T=ie[2],Ll,l),l.point(m,k)}function F(){R.point=A,l.lineEnd()}function M(){P(),R.point=B,R.lineEnd=Y}function B(U,X){C(c=U,X),h=m,v=k,p=E,_=N,x=T,R.point=C}function Y(){a(m,k,S,E,N,T,h,v,c,p,_,x,Ll,l),R.lineEnd=F,F()}return R}}var hm=Ol({point:function(o,r){this.stream.point(o*Xe,r*Xe)}});function gm(o){return ym(function(){return o})()}function ym(o){var r,a=150,l=480,c=250,h,v,p=0,_=0,x=0,S=0,m=0,k,E,N=null,T=bl,R=null,A,P,C,F=Il,M=.5,B=Rl(ee,M),Y,U;function X(q){return q=E(q[0]*Xe,q[1]*Xe),[q[0]*a+h,v-q[1]*a]}function ie(q){return q=E.invert((q[0]-h)/a,(v-q[1])/a),q&&[q[0]*Pt,q[1]*Pt]}function ee(q,ne){return q=r(q,ne),[q[0]*a+h,v-q[1]*a]}X.stream=function(q){return Y&&U===q?Y:Y=hm(T(k,B(F(U=q))))},X.clipAngle=function(q){return arguments.length?(T=+q?om(N=q*Xe,6*Xe):(N=null,bl),ae()):N*Pt},X.clipExtent=function(q){return arguments.length?(F=q==null?(R=A=P=C=null,Il):Kp(R=+q[0][0],A=+q[0][1],P=+q[1][0],C=+q[1][1]),ae()):R==null?null:[[R,A],[P,C]]},X.scale=function(q){return arguments.length?(a=+q,te()):a},X.translate=function(q){return arguments.length?(l=+q[0],c=+q[1],te()):[l,c]},X.center=function(q){return arguments.length?(p=q[0]%360*Xe,_=q[1]%360*Xe,te()):[p*Pt,_*Pt]},X.rotate=function(q){return arguments.length?(x=q[0]%360*Xe,S=q[1]%360*Xe,m=q.length>2?q[2]%360*Xe:0,te()):[x*Pt,S*Pt,m*Pt]},X.precision=function(q){return arguments.length?(B=Rl(ee,M=q*q),ae()):pn(M)},X.fitExtent=function(q,ne){return Tl(X,q,ne)},X.fitSize=function(q,ne){return um(X,q,ne)};function te(){E=yl(k=Wp(x,S,m),r);var q=r(p,_);return h=l-q[0]*a,v=c+q[1]*a,ae()}function ae(){return Y=U=null,X}return function(){return r=o.apply(this,arguments),X.invert=r.invert&&ie,te()}}function Cl(o){return function(r,a){var l=de(r),c=de(a),h=o(l*c);return[h*c*_e(r),h*_e(a)]}}function Pl(o){return function(r,a){var l=pn(r*r+a*a),c=o(l),h=_e(c),v=de(c);return[vn(r*h,l*v),qt(l&&a*h/l)]}}var vm=Cl(function(o){return pn(2/(1+o))});vm.invert=Pl(function(o){return 2*qt(o/2)});var Al=Cl(function(o){return(o=cl(o))&&o/_e(o)});Al.invert=Pl(function(o){return o});function pm(){return gm(Al).scale(79.4188).clipAngle(180-.001)}function Ml(o,r){return[o,r]}Ml.invert=Ml;var mm=Object.defineProperty,_n=(o,r)=>mm(o,"name",{value:r,configurable:!0}),{BufferOp:dm,GeoJSONReader:_m,GeoJSONWriter:xm}=Xp;function Dl(o,r,a){a=a||{};var l=a.units||"kilometers",c=a.steps||8;if(!o)throw new Error("geojson is required");if(typeof a!="object")throw new Error("options must be an object");if(typeof c!="number")throw new Error("steps must be an number");if(r===void 0)throw new Error("radius is required");if(c<=0)throw new Error("steps must be greater than 0");var h=[];switch(o.type){case"GeometryCollection":return Bt(o,function(v){var p=jn(v,r,l,c);p&&h.push(p)}),ot(h);case"FeatureCollection":return Fr(o,function(v){var p=jn(v,r,l,c);p&&Fr(p,function(_){_&&h.push(_)})}),ot(h)}return jn(o,r,l,c)}_n(Dl,"buffer");function jn(o,r,a,l){var c=o.properties||{},h=o.type==="Feature"?o.geometry:o;if(h.type==="GeometryCollection"){var v=[];return Bt(o,function(T){var R=jn(T,r,a,l);R&&v.push(R)}),ot(v)}var p=Fl(h),_={type:h.type,coordinates:Ms(h.coordinates,p)},x=new _m,S=x.read(_),m=gs(Cr(r,a),"meters"),k=dm.bufferOp(S,m,l),E=new xm;if(k=E.write(k),!As(k.coordinates)){var N={type:k.type,coordinates:Ds(k.coordinates,p)};return Ye(N,c)}}_n(jn,"bufferFeature");function As(o){return Array.isArray(o[0])?As(o[0]):isNaN(o[0])}_n(As,"coordsIsNaN");function Ms(o,r){return typeof o[0]!="object"?r(o):o.map(function(a){return Ms(a,r)})}_n(Ms,"projectCoords");function Ds(o,r){return typeof o[0]!="object"?r.invert(o):o.map(function(a){return Ds(a,r)})}_n(Ds,"unprojectCoords");function Fl(o){var r=al(o).geometry.coordinates,a=[-r[0],-r[1]];return pm().rotate(a).scale(Ae)}_n(Fl,"defineProjection");var Em=Dl,km=Object.defineProperty,Sm=(o,r)=>km(o,"name",{value:r,configurable:!0});function $l(o){const r=[];if(Bt(o,c=>{r.push(c.coordinates)}),r.length<2)throw new Error("Must have at least two features");const a=o.features[0].properties||{},l=ju.difference(r[0],...r.slice(1));return l.length===0?null:l.length===1?ln(l[0],a):Rr(l,a)}Sm($l,"difference");var Im=$l;function Gl(o){let r;for(const a of o)r&&a[0]-r[0]>=180?a[0]-=360:r&&a[0]-r[0]<-180&&(a[0]+=360),r=a}function Bl(o,r){const a=Im(ot([ln([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),o]));if(!a)return;a.properties={isMask:"y"};const l=Em(o,0);if(l){if(l.geometry.type==="Polygon")for(const c of l.geometry.coordinates)Gl(c);else for(const c of l.geometry.coordinates)for(const h of c)Gl(h);r(ot([l,a]))}}function Nm(o,r=!0,a=!0,l={},c={},h=v=>{var x,S,m;const p=(x=v==null?void 0:v.geometry)==null?void 0:x.type,_=(S=v==null?void 0:v.properties)!=null&&S.isMask?0:p==="LineString"||p==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(m=v==null?void 0:v.properties)!=null&&m.isMask?.1:0,weight:_,dashArray:[_,_],lineCap:"butt"}}){let v;const p=[];let _,x;const S=Jt.geoJSON(void 0,{style:h,interactive:!1}).addTo(o),m=E=>{v==null||v({type:"mapClick",coordinates:[E.latlng.lng,E.latlng.lat]})};function k(E,N=!1){const T=document.createElement("div");return new Gp({props:{displayIn:"leaflet"},target:T}),new Jt.Marker(E,{interactive:N,icon:new Jt.DivIcon({html:T,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(E){E?(v=E,o.on("click",m)):(v=void 0,o.off("click",m))},flyTo(E,N){o.flyTo([E[1],E[0]],N,{duration:2,...l})},fitBounds(E,N,T){o.flyToBounds([[E[1],E[0]],[E[3],E[2]]],{padding:[N,N],duration:2,maxZoom:T,...c})},indicateReverse(E){o.getContainer().style.cursor=E?"crosshair":""},setReverseMarker(E){var T;if(!r)return;const N=E&&[E[1],E[0]];x?N?x.setLatLng(N):(x.remove(),x=void 0):N&&(x=(typeof r=="object"?new Jt.Marker(N,r):k(N)).addTo(o),(T=x.getElement())==null||T.classList.add("marker-reverse"))},setMarkers(E,N){if(!r)return;function T(R){S.clearLayers(),R&&S.addData(R)}for(const R of p)R.remove();if(p.length=0,T(),N){let R=!1;if(N.geometry.type==="GeometryCollection"){const P=N.geometry.geometries.filter(C=>C.type==="Polygon"||C.type==="MultiPolygon");e:if(P.length>0){const C=_p(ot(P.map(F=>Ye(F))));if(!C)break e;Bl({...N,geometry:C.geometry},T),R=!0}else{const C=N.geometry.geometries.filter(F=>F.type==="LineString"||F.type==="MultiLineString");C.length>0&&(T({...N,geometry:{type:"GeometryCollection",geometries:C}}),R=!0)}}if(!R){if(N.geometry.type==="Polygon"||N.geometry.type==="MultiPolygon")Bl(N,T);else if(N.geometry.type==="LineString"||N.geometry.type==="MultiLineString"){T(N);return}}const A=[N.center[1],N.center[0]];p.push((typeof r=="object"?new Jt.Marker(A,r):k(A)).addTo(o))}if(a)for(const R of E??[]){if(R===N)continue;const A=[R.center[1],R.center[0]],P=typeof a=="object"?new Jt.Marker(A,a):k(A,!0);P.addTo(o).bindTooltip(R.place_type[0]==="reverse"?R.place_name:R.place_name.replace(/,.*/,""),{direction:"top"});const C=P.getElement();C&&(C.addEventListener("click",F=>{F.stopPropagation(),v==null||v({type:"markerClick",id:R.id})}),C.addEventListener("mouseenter",()=>{v==null||v({type:"markerMouseEnter",id:R.id})}),C.addEventListener("mouseleave",()=>{v==null||v({type:"markerMouseLeave",id:R.id})}),C.classList.toggle("marker-fuzzy",!!R.matching_text)),p.push(P)}},setSelectedMarker(E){var N,T;_&&((N=_.getElement())==null||N.classList.toggle("marker-selected",!1)),_=E>-1?p[E]:void 0,(T=_==null?void 0:_.getElement())==null||T.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const E=o.getCenter();return[o.getZoom(),E.lng,E.lat]}}}De.createLeafletMapController=Nm,Object.defineProperty(De,Symbol.toStringTag,{value:"Module"})});
|
|
19
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
|
+
and limitations under the License.
|
|
21
|
+
***************************************************************************** */function ue(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(p){return c([f,p])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){e.label=f[1];break}if(f[0]===6&&e.label<o[1]){e.label=o[1],o=f;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(f);break}o[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(r,e)}catch(p){f=[6,p],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var G=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function fe(r,t){return r>t?1:r<t?-1:0}function z(r,t,e){for(var n=new G(null,null),i=n,o=n;;){var l=e(r,t.key);if(l<0){if(t.left===null)break;if(e(r,t.left.key)<0){var u=t.left;if(t.left=u.right,u.right=t,t=u,t.left===null)break}o.left=t,o=t,t=t.left}else if(l>0){if(t.right===null)break;if(e(r,t.right.key)>0){var u=t.right;if(t.right=u.left,u.left=t,t=u,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=n.right,t.right=n.left,t}function ht(r,t,e,n){var i=new G(r,t);if(e===null)return i.left=i.right=null,i;e=z(r,e,n);var o=n(r,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 kt(r,t,e){var n=null,i=null;if(t){t=z(r,t,e);var o=e(t.key,r);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function ce(r,t,e){return t===null?r:(r===null||(t=z(r.key,t,e),t.left=r),t)}function at(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
|
|
22
|
+
`);var o=t+(e?" ":"│ ");r.left&&at(r.left,o,!1,n,i),r.right&&at(r.right,o,!0,n,i)}}var pt=function(){function r(t){t===void 0&&(t=fe),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=ht(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new G(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=z(t,this._root,i),l=i(t,o.key);return l===0?this._root=o:(l<0?(n.left=o.left,n.right=o,o.left=null):l>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=z(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=z(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=z(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=z(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],l=this._comparator,u=this._root,c;o.length!==0||u;)if(u)o.push(u),u=u.left;else{if(u=o.pop(),c=l(u.key,e),c>0)break;if(l(u.key,t)>=0&&n.call(i,u))return this;u=u.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)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 n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return ae(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&dt(t,e,0,i-1,o),this._root===null)this._root=gt(t,e,0,i),this._size=i;else{var l=pe(this.toList(),he(t,e),o);i=this._size+i,this._root=yt({head:l},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return at(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=kt(t,this._root,i),l=o.left,u=o.right;i(t,e)<0?u=ht(e,n,u,i):l=ht(e,n,l,i),this._root=ce(l,u,i)},r.prototype.split=function(t){return kt(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t,e,n;return ue(this,function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[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:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function gt(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),l=r[o],u=t[o],c=new G(l,u);return c.left=gt(r,t,e,o),c.right=gt(r,t,o+1,n),c}return null}function he(r,t){for(var e=new G(null,null),n=e,i=0;i<r.length;i++)n=n.next=new G(r[i],t[i]);return n.next=null,e.next}function ae(r){for(var t=r,e=[],n=!1,i=new G(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function yt(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=yt(r,t,i),l=r.head;return l.left=o,r.head=r.head.next,l.right=yt(r,i+1,e),l}return null}function pe(r,t,e){for(var n=new G(null,null),i=n,o=r,l=t;o!==null&&l!==null;)e(o.key,l.key)<0?(i.next=o,o=o.next):(i.next=l,l=l.next),i=i.next;return o!==null?i.next=o:l!==null&&(i.next=l),n.next}function dt(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],l=e-1,u=n+1;;){do l++;while(i(r[l],o)<0);do u--;while(i(r[u],o)>0);if(l>=u)break;var c=r[l];r[l]=r[u],r[u]=c,c=t[l],t[l]=t[u],t[u]=c}dt(r,t,e,u,i),dt(r,t,u+1,n,i)}}const N=11102230246251565e-32,E=134217729,ge=(3+8*N)*N;function xt(r,t,e,n,i){let o,l,u,c,f=t[0],p=n[0],s=0,a=0;p>f==p>-f?(o=f,f=t[++s]):(o=p,p=n[++a]);let h=0;if(s<r&&a<e)for(p>f==p>-f?(l=f+o,u=o-(l-f),f=t[++s]):(l=p+o,u=o-(l-p),p=n[++a]),o=l,u!==0&&(i[h++]=u);s<r&&a<e;)p>f==p>-f?(l=o+f,c=l-o,u=o-(l-c)+(f-c),f=t[++s]):(l=o+p,c=l-o,u=o-(l-c)+(p-c),p=n[++a]),o=l,u!==0&&(i[h++]=u);for(;s<r;)l=o+f,c=l-o,u=o-(l-c)+(f-c),f=t[++s],o=l,u!==0&&(i[h++]=u);for(;a<e;)l=o+p,c=l-o,u=o-(l-c)+(p-c),p=n[++a],o=l,u!==0&&(i[h++]=u);return(o!==0||h===0)&&(i[h++]=o),h}function ye(r,t){let e=t[0];for(let n=1;n<r;n++)e+=t[n];return e}function J(r){return new Float64Array(r)}const de=(3+16*N)*N,xe=(2+12*N)*N,me=(9+64*N)*N*N,U=J(4),It=J(8),$t=J(12),Ot=J(16),P=J(4);function ve(r,t,e,n,i,o,l){let u,c,f,p,s,a,h,g,y,d,x,v,m,b,w,S,R,_;const I=r-i,$=e-i,O=t-o,A=n-o;b=I*A,a=E*I,h=a-(a-I),g=I-h,a=E*A,y=a-(a-A),d=A-y,w=g*d-(b-h*y-g*y-h*d),S=O*$,a=E*O,h=a-(a-O),g=O-h,a=E*$,y=a-(a-$),d=$-y,R=g*d-(S-h*y-g*y-h*d),x=w-R,s=w-x,U[0]=w-(x+s)+(s-R),v=b+x,s=v-b,m=b-(v-s)+(x-s),x=m-S,s=m-x,U[1]=m-(x+s)+(s-S),_=v+x,s=_-v,U[2]=v-(_-s)+(x-s),U[3]=_;let B=ye(4,U),et=xe*l;if(B>=et||-B>=et||(s=r-I,u=r-(I+s)+(s-i),s=e-$,f=e-($+s)+(s-i),s=t-O,c=t-(O+s)+(s-o),s=n-A,p=n-(A+s)+(s-o),u===0&&c===0&&f===0&&p===0)||(et=me*l+ge*Math.abs(B),B+=I*p+A*u-(O*f+$*c),B>=et||-B>=et))return B;b=u*A,a=E*u,h=a-(a-u),g=u-h,a=E*A,y=a-(a-A),d=A-y,w=g*d-(b-h*y-g*y-h*d),S=c*$,a=E*c,h=a-(a-c),g=c-h,a=E*$,y=a-(a-$),d=$-y,R=g*d-(S-h*y-g*y-h*d),x=w-R,s=w-x,P[0]=w-(x+s)+(s-R),v=b+x,s=v-b,m=b-(v-s)+(x-s),x=m-S,s=m-x,P[1]=m-(x+s)+(s-S),_=v+x,s=_-v,P[2]=v-(_-s)+(x-s),P[3]=_;const on=xt(4,U,4,P,It);b=I*p,a=E*I,h=a-(a-I),g=I-h,a=E*p,y=a-(a-p),d=p-y,w=g*d-(b-h*y-g*y-h*d),S=O*f,a=E*O,h=a-(a-O),g=O-h,a=E*f,y=a-(a-f),d=f-y,R=g*d-(S-h*y-g*y-h*d),x=w-R,s=w-x,P[0]=w-(x+s)+(s-R),v=b+x,s=v-b,m=b-(v-s)+(x-s),x=m-S,s=m-x,P[1]=m-(x+s)+(s-S),_=v+x,s=_-v,P[2]=v-(_-s)+(x-s),P[3]=_;const sn=xt(on,It,4,P,$t);b=u*p,a=E*u,h=a-(a-u),g=u-h,a=E*p,y=a-(a-p),d=p-y,w=g*d-(b-h*y-g*y-h*d),S=c*f,a=E*c,h=a-(a-c),g=c-h,a=E*f,y=a-(a-f),d=f-y,R=g*d-(S-h*y-g*y-h*d),x=w-R,s=w-x,P[0]=w-(x+s)+(s-R),v=b+x,s=v-b,m=b-(v-s)+(x-s),x=m-S,s=m-x,P[1]=m-(x+s)+(s-S),_=v+x,s=_-v,P[2]=v-(_-s)+(x-s),P[3]=_;const ln=xt(sn,$t,4,P,Ot);return Ot[ln-1]}function be(r,t,e,n,i,o){const l=(t-o)*(e-i),u=(r-i)*(n-o),c=l-u,f=Math.abs(l+u);return Math.abs(c)>=de*f?c:-ve(r,t,e,n,i,o,f)}const W=(r,t)=>r.ll.x<=t.x&&t.x<=r.ur.x&&r.ll.y<=t.y&&t.y<=r.ur.y,mt=(r,t)=>{if(t.ur.x<r.ll.x||r.ur.x<t.ll.x||t.ur.y<r.ll.y||r.ur.y<t.ll.y)return null;const e=r.ll.x<t.ll.x?t.ll.x:r.ll.x,n=r.ur.x<t.ur.x?r.ur.x:t.ur.x,i=r.ll.y<t.ll.y?t.ll.y:r.ll.y,o=r.ur.y<t.ur.y?r.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:n,y:o}}};let T=Number.EPSILON;T===void 0&&(T=Math.pow(2,-52));const we=T*T,At=(r,t)=>{if(-T<r&&r<T&&-T<t&&t<T)return 0;const e=r-t;return e*e<we*r*t?0:r<t?-1:1};class Ee{constructor(){this.reset()}reset(){this.xRounder=new Nt,this.yRounder=new Nt}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class Nt{constructor(){this.tree=new pt,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&At(e.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(e);return i!==null&&At(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const K=new Ee,nt=(r,t)=>r.x*t.y-r.y*t.x,Bt=(r,t)=>r.x*t.x+r.y*t.y,Gt=(r,t,e)=>{const n=be(r.x,r.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},rt=r=>Math.sqrt(Bt(r,r)),Se=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return nt(i,n)/rt(i)/rt(n)},_e=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return Bt(i,n)/rt(i)/rt(n)},zt=(r,t,e)=>t.y===0?null:{x:r.x+t.x/t.y*(e-r.y),y:e},Tt=(r,t,e)=>t.x===0?null:{x:e,y:r.y+t.y/t.x*(e-r.x)},Pe=(r,t,e,n)=>{if(t.x===0)return Tt(e,n,r.x);if(n.x===0)return Tt(r,t,e.x);if(t.y===0)return zt(e,n,r.y);if(n.y===0)return zt(r,t,e.y);const i=nt(t,n);if(i==0)return null;const o={x:e.x-r.x,y:e.y-r.y},l=nt(o,t)/i,u=nt(o,n)/i,c=r.x+u*t.x,f=e.x+l*n.x,p=r.y+u*t.y,s=e.y+l*n.y,a=(c+f)/2,h=(p+s)/2;return{x:a,y:h}};class C{static compare(t,e){const n=C.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:F.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,i=e.length;n<i;n++){const o=e[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,n=i=>{const o=i.otherSE;e.set(i,{sine:Se(this.point,t.point,o.point),cosine:_e(this.point,t.point,o.point)})};return(i,o)=>{e.has(i)||n(i),e.has(o)||n(o);const{sine:l,cosine:u}=e.get(i),{sine:c,cosine:f}=e.get(o);return l>=0&&c>=0?u<f?1:u>f?-1:0:l<0&&c<0?u<f?-1:u>f?1:0:c<l?-1:c>l?1:0}}}let Me=0;class F{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,o=t.rightSE.point.x,l=e.rightSE.point.x;if(l<n)return 1;if(o<i)return-1;const u=t.leftSE.point.y,c=e.leftSE.point.y,f=t.rightSE.point.y,p=e.rightSE.point.y;if(n<i){if(c<u&&c<f)return 1;if(c>u&&c>f)return-1;const s=t.comparePoint(e.leftSE.point);if(s<0)return 1;if(s>0)return-1;const a=e.comparePoint(t.rightSE.point);return a!==0?a:-1}if(n>i){if(u<c&&u<p)return-1;if(u>c&&u>p)return 1;const s=e.comparePoint(t.leftSE.point);if(s!==0)return s;const a=t.comparePoint(e.rightSE.point);return a<0?1:a>0?-1:1}if(u<c)return-1;if(u>c)return 1;if(o<l){const s=e.comparePoint(t.rightSE.point);if(s!==0)return s}if(o>l){const s=t.comparePoint(e.rightSE.point);if(s<0)return 1;if(s>0)return-1}if(o!==l){const s=f-u,a=o-n,h=p-c,g=l-i;if(s>a&&h<g)return 1;if(s<a&&h>g)return-1}return o>l?1:o<l||f<p?-1:f>p?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++Me,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,o,l;const u=C.comparePoints(t,e);if(u<0)i=t,o=e,l=1;else if(u>0)i=e,o=t,l=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const c=new C(i,!0),f=new C(o,!1);return new F(c,f,[n],[l])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const o=(t.y-e.y)/i.y,l=e.x+o*i.x;if(t.x===l)return 0;const u=(t.x-e.x)/i.x,c=e.y+u*i.y;return t.y===c?0:t.y<c?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=mt(e,n);if(i===null)return null;const o=this.leftSE.point,l=this.rightSE.point,u=t.leftSE.point,c=t.rightSE.point,f=W(e,u)&&this.comparePoint(u)===0,p=W(n,o)&&t.comparePoint(o)===0,s=W(e,c)&&this.comparePoint(c)===0,a=W(n,l)&&t.comparePoint(l)===0;if(p&&f)return a&&!s?l:!a&&s?c:null;if(p)return s&&o.x===c.x&&o.y===c.y?null:o;if(f)return a&&l.x===u.x&&l.y===u.y?null:u;if(a&&s)return null;if(a)return l;if(s)return c;const h=Pe(o,this.vector(),u,t.vector());return h===null||!W(i,h)?null:K.round(h.x,h.y)}split(t){const e=[],n=t.events!==void 0,i=new C(t,!0),o=new C(t,!1),l=this.rightSE;this.replaceRightSE(o),e.push(o),e.push(i);const u=new F(i,l,this.rings.slice(),this.windings.slice());return C.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),C.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=F.compare(e,n);if(i!==0){if(i>0){const o=e;e=n,n=o}if(e.prev===n){const o=e;e=n,n=o}for(let o=0,l=n.rings.length;o<l;o++){const u=n.rings[o],c=n.windings[o],f=e.rings.indexOf(u);f===-1?(e.rings.push(u),e.windings.push(c)):e.windings[f]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let u=0,c=this.rings.length;u<c;u++){const f=this.rings[u],p=this.windings[u],s=e.indexOf(f);s===-1?(e.push(f),n.push(p)):n[s]+=p}const o=[],l=[];for(let u=0,c=e.length;u<c;u++){if(n[u]===0)continue;const f=e[u],p=f.poly;if(l.indexOf(p)===-1)if(f.isExterior)o.push(p);else{l.indexOf(p)===-1&&l.push(p);const s=o.indexOf(f.poly);s!==-1&&o.splice(s,1)}}for(let u=0,c=o.length;u<c;u++){const f=o[u].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(k.type){case"union":{const n=t.length===0,i=e.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===k.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${k.type}`)}return this._isInResult}}class Ft{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=K.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let o=i;for(let l=1,u=t.length;l<u;l++){if(typeof t[l][0]!="number"||typeof t[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=K.round(t[l][0],t[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(F.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(F.fromRing(o,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class Le{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ft(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(let n=1,i=t.length;n<i;n++){const o=new Ft(t[n],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}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let o=0,l=i.length;o<l;o++)t.push(i[o])}return t}}class qt{constructor(t,e){if(!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(let n=0,i=t.length;n<i;n++){const o=new Le(t[n],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}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let o=0,l=i.length;o<l;o++)t.push(i[o])}return t}}class it{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.isInResult()||o.ringOut)continue;let l=null,u=o.leftSE,c=o.rightSE;const f=[u],p=u.point,s=[];for(;l=u,u=c,f.push(u),u.point!==p;)for(;;){const a=u.getAvailableLinkedEvents();if(a.length===0){const y=f[0].point,d=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${d.x}, ${d.y}].`)}if(a.length===1){c=a[0].otherSE;break}let h=null;for(let y=0,d=s.length;y<d;y++)if(s[y].point===u.point){h=y;break}if(h!==null){const y=s.splice(h)[0],d=f.splice(y.index);d.unshift(d[0].otherSE),e.push(new it(d.reverse()));continue}s.push({index:f.length,point:u.point});const g=u.getLeftmostComparator(l);c=a.sort(g)[0].otherSE;break}e.push(new it(f))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let f=1,p=this.events.length-1;f<p;f++){const s=this.events[f].point,a=this.events[f+1].point;Gt(s,t,a)!==0&&(e.push(s),t=s)}if(e.length===1)return null;const n=e[0],i=e[1];Gt(n,t,i)===0&&e.shift(),e.push(e[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:e.length-1,u=this.isExteriorRing()?e.length:-1,c=[];for(let f=l;f!=u;f+=o)c.push([e[f].x,e[f].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){const l=this.events[i];C.compare(t,l)>0&&(t=l)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class jt{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class Ce{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.poly)if(o.isExteriorRing())e.push(new jt(o));else{const l=o.enclosingRing();l.poly||e.push(new jt(l)),l.poly.addInterior(o)}}return e}}class Re{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F.compare;this.queue=t,this.tree=new pt(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let o=i,l=i,u,c;for(;u===void 0;)o=this.tree.prev(o),o===null?u=null:o.key.consumedBy===void 0&&(u=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(t.isLeft){let f=null;if(u){const s=u.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(f=s),!u.isAnEndpoint(s))){const a=this._splitSafely(u,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}let p=null;if(c){const s=c.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(p=s),!c.isAnEndpoint(s))){const a=this._splitSafely(c,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}if(f!==null||p!==null){let s=null;f===null?s=p:p===null?s=f:s=C.comparePoints(f,p)<=0?f:p,this.queue.remove(e.rightSE),n.push(e.rightSE);const a=e.split(s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=u)}else{if(u&&c){const f=u.getIntersection(c);if(f!==null){if(!u.isAnEndpoint(f)){const p=this._splitSafely(u,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}if(!c.isAnEndpoint(f)){const p=this._splitSafely(c,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const Qt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ke=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ie{run(t,e,n){k.type=t,K.reset();const i=[new qt(e,!0)];for(let s=0,a=n.length;s<a;s++)i.push(new qt(n[s],!1));if(k.numMultiPolys=i.length,k.type==="difference"){const s=i[0];let a=1;for(;a<i.length;)mt(i[a].bbox,s.bbox)!==null?a++:i.splice(a,1)}if(k.type==="intersection")for(let s=0,a=i.length;s<a;s++){const h=i[s];for(let g=s+1,y=i.length;g<y;g++)if(mt(h.bbox,i[g].bbox)===null)return[]}const o=new pt(C.compare);for(let s=0,a=i.length;s<a;s++){const h=i[s].getSweepEvents();for(let g=0,y=h.length;g<y;g++)if(o.insert(h[g]),o.size>Qt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Re(o);let u=o.size,c=o.pop();for(;c;){const s=c.key;if(o.size===u){const h=s.segment;throw new Error(`Unable to pop() ${s.isLeft?"left":"right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Qt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>ke)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const a=l.process(s);for(let h=0,g=a.length;h<g;h++){const y=a[h];y.consumedBy===void 0&&o.insert(y)}u=o.size,c=o.pop()}K.reset();const f=it.factory(l.segments);return new Ce(f).getGeom()}}const k=new Ie;var Ut={union:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return k.run("union",r,e)},intersection:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return k.run("intersection",r,e)},xor:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return k.run("xor",r,e)},difference:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return k.run("difference",r,e)}};function $e(r,t={}){const e=[];if(ut(r,i=>{e.push(i.coordinates)}),e.length<2)throw new Error("Must have at least 2 geometries");const n=Ut.union(e[0],...e.slice(1));return n.length===0?null:n.length===1?lt(n[0],t.properties):Pt(n,t.properties)}var Dt=$e;function vt(r){const t=[...r];return t[2]<t[0]&&(Math.abs((t[0]+t[2]+360)/2)>Math.abs((t[0]-360+t[2])/2)?t[0]-=360:t[2]+=360),t}function H(){}function Yt(r){return r()}function Xt(){return Object.create(null)}function ot(r){r.forEach(Yt)}function Vt(r){return typeof r=="function"}function Oe(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function Ae(r){return Object.keys(r).length===0}function Ne(r,t){r.appendChild(t)}function Be(r,t,e){r.insertBefore(t,e||null)}function Zt(r){r.parentNode&&r.parentNode.removeChild(r)}function Jt(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function q(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function Ge(r){return Array.from(r.childNodes)}function st(r,t,e){r.classList.toggle(t,!!e)}let bt;function tt(r){bt=r}const D=[],Wt=[];let Y=[];const Kt=[],ze=Promise.resolve();let wt=!1;function Te(){wt||(wt=!0,ze.then(Ht))}function Et(r){Y.push(r)}const St=new Set;let X=0;function Ht(){if(X!==0)return;const r=bt;do{try{for(;X<D.length;){const t=D[X];X++,tt(t),Fe(t.$$)}}catch(t){throw D.length=0,X=0,t}for(tt(null),D.length=0,X=0;Wt.length;)Wt.pop()();for(let t=0;t<Y.length;t+=1){const e=Y[t];St.has(e)||(St.add(e),e())}Y.length=0}while(D.length);for(;Kt.length;)Kt.pop()();wt=!1,St.clear(),tt(r)}function Fe(r){if(r.fragment!==null){r.update(),ot(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(Et)}}function qe(r){const t=[],e=[];Y.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Y=t}const je=new Set;function Qe(r,t){r&&r.i&&(je.delete(r),r.i(t))}function Ue(r,t,e){const{fragment:n,after_update:i}=r.$$;n&&n.m(t,e),Et(()=>{const o=r.$$.on_mount.map(Yt).filter(Vt);r.$$.on_destroy?r.$$.on_destroy.push(...o):ot(o),r.$$.on_mount=[]}),i.forEach(Et)}function De(r,t){const e=r.$$;e.fragment!==null&&(qe(e.after_update),ot(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Ye(r,t){r.$$.dirty[0]===-1&&(D.push(r),Te(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function Xe(r,t,e,n,i,o,l=null,u=[-1]){const c=bt;tt(r);const f=r.$$={fragment:null,ctx:[],props:o,update:H,not_equal:i,bound:Xt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:Xt(),dirty:u,skip_bound:!1,root:t.target||c.$$.root};l&&l(f.root);let p=!1;if(f.ctx=e?e(r,t.props||{},(s,a,...h)=>{const g=h.length?h[0]:a;return f.ctx&&i(f.ctx[s],f.ctx[s]=g)&&(!f.skip_bound&&f.bound[s]&&f.bound[s](g),p&&Ye(r,s)),a}):[],f.update(),p=!0,ot(f.before_update),f.fragment=n?n(f.ctx):!1,t.target){if(t.hydrate){const s=Ge(t.target);f.fragment&&f.fragment.l(s),s.forEach(Zt)}else f.fragment&&f.fragment.c();t.intro&&Qe(r.$$.fragment),Ue(r,t.target,t.anchor),Ht()}tt(c)}class Ve{constructor(){_t(this,"$$");_t(this,"$$set")}$destroy(){De(this,1),this.$destroy=H}$on(t,e){if(!Vt(e))return H;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!Ae(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ze="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ze);function Je(r){let t,e,n;return{c(){t=Jt("svg"),e=Jt("path"),q(e,"stroke-width","4"),q(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"),q(e,"class","svelte-gzo3ar"),q(t,"width",n=r[0]==="list"?20:void 0),q(t,"viewBox","0 0 70 85"),q(t,"fill","none"),q(t,"class","svelte-gzo3ar"),st(t,"in-map",r[0]!=="list"),st(t,"list-icon",r[0]==="list")},m(i,o){Be(i,t,o),Ne(t,e)},p(i,[o]){o&1&&n!==(n=i[0]==="list"?20:void 0)&&q(t,"width",n),o&1&&st(t,"in-map",i[0]!=="list"),o&1&&st(t,"list-icon",i[0]==="list")},i:H,o:H,d(i){i&&Zt(t)}}}function We(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class Ke extends Ve{constructor(t){super(),Xe(this,t,We,Je,Oe,{displayIn:0})}}function He(r){const t=[];if(ut(r,i=>{t.push(i.coordinates)}),t.length<2)throw new Error("Must have at least two features");const e=r.features[0].properties||{},n=Ut.difference(t[0],...t.slice(1));return n.length===0?null:n.length===1?lt(n[0],e):Pt(n,e)}var tn=He;function en(r){if(!r)throw new Error("geojson is required");var t=[];return re(r,function(e){t.push(e)}),Z(t)}var nn=en;function te(r,t){const e=tn(Z([lt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),r]));if(!e)return;e.properties={isMask:!0};const n=vt(ft(r)),i=(n[2]-n[0])/360/1e3,o=n[0]<-180,l=n[2]>180,u=nn(r);if(u.features.length>1&&(o||l))for(const c of u.features){const f=vt(ft(c));if(l&&f[0]<-180+i)for(const p of c.geometry.coordinates)for(const s of p)s[0]+=360-i;if(o&&f[2]>180-i)for(const p of c.geometry.coordinates)for(const s of p)s[0]-=360-i}t(Z([u.features.length<2?r:Dt(u)??r,e]))}function rn(r,t=!0,e=!0,n={},i={},o=l=>{var f,p,s;const u=(f=l==null?void 0:l.geometry)==null?void 0:f.type,c=(p=l==null?void 0:l.properties)!=null&&p.isMask?0:u==="LineString"||u==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(s=l==null?void 0:l.properties)!=null&&s.isMask?.1:0,weight:c,dashArray:[c,c],lineCap:"butt"}}){let l;const u=[];let c,f;const p=Q.geoJSON(void 0,{style:o,interactive:!1}).addTo(r),s=h=>{l==null||l({type:"mapClick",coordinates:[h.latlng.lng,h.latlng.lat]})};function a(h,g=!1){const y=document.createElement("div");return new Ke({props:{displayIn:"leaflet"},target:y}),new Q.Marker(h,{interactive:g,icon:new Q.DivIcon({html:y,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(h){h?(l=h,r.on("click",s)):(l=void 0,r.off("click",s))},flyTo(h,g){r.flyTo([h[1],h[0]],g,{duration:2,...n})},fitBounds(h,g,y){r.flyToBounds([[h[1],h[0]],[h[3],h[2]]],{padding:[g,g],duration:2,...y?{maxZoom:y}:{},...i})},indicateReverse(h){r.getContainer().style.cursor=h?"crosshair":""},setReverseMarker(h){var y;if(!t)return;const g=h&&[h[1],h[0]];f?g?f.setLatLng(g):(f.remove(),f=void 0):g&&(f=(typeof t=="object"?new Q.Marker(g,t):a(g)).addTo(r),(y=f.getElement())==null||y.classList.add("marker-reverse"))},setMarkers(h,g){if(!t)return;function y(d){p.clearLayers(),d&&p.addData(d)}for(const d of u)d.remove();if(u.length=0,y(),g){let d=!1;if(g.geometry.type==="GeometryCollection"){const v=g.geometry.geometries.filter(m=>m.type==="Polygon"||m.type==="MultiPolygon");t:if(v.length>0){const m=Dt(Z(v.map(b=>V(b))));if(!m)break t;te({...g,geometry:m.geometry},y),d=!0}else{const m=g.geometry.geometries.filter(b=>b.type==="LineString"||b.type==="MultiLineString");m.length>0&&(y({...g,geometry:{type:"GeometryCollection",geometries:m}}),d=!0)}}if(!d){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")te(g,v=>{if(!v)return;const m=[...v.features],b=vt(ft(g)),w=b[2]-b[0];b[0]-w/4<-180&&m.push(...ee(v,-360).features),b[2]+w/4>180&&m.push(...ee(v,360).features),y(Z(m))});else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){y(g);return}}const x=[g.center[1],g.center[0]];u.push((typeof t=="object"?new Q.Marker(x,t):a(x)).addTo(r))}if(e)for(const d of h??[]){if(d===g)continue;const x=[d.center[1],d.center[0]],v=typeof e=="object"?new Q.Marker(x,e):a(x,!0);v.addTo(r).bindTooltip(d.place_type[0]==="reverse"?d.place_name:d.place_name.replace(/,.*/,""),{direction:"top"});const m=v.getElement();m&&(m.addEventListener("click",b=>{b.stopPropagation(),l==null||l({type:"markerClick",id:d.id})}),m.addEventListener("mouseenter",()=>{l==null||l({type:"markerMouseEnter",id:d.id})}),m.addEventListener("mouseleave",()=>{l==null||l({type:"markerMouseLeave",id:d.id})}),m.classList.toggle("marker-fuzzy",!!d.matching_text)),u.push(v)}},setSelectedMarker(h){var g,y;c&&((g=c.getElement())==null||g.classList.toggle("marker-selected",!1)),c=h>-1?u[h]:void 0,(y=c==null?void 0:c.getElement())==null||y.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const h=r.getCenter();return[r.getZoom(),h.lng,h.lat]}}}function ee(r,t){const e=le(r);for(const n of e.features)if(n.geometry.type=="MultiPolygon")for(const i of n.geometry.coordinates)ne(i,t);else ne(n.geometry.coordinates,t);return e}function ne(r,t){for(const e of r)for(const n of e)n[0]+=t}M.createLeafletMapController=rn,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
32
23
|
//# sourceMappingURL=leaflet-controller.umd.js.map
|